def sort_alphabetically(word):
    return ''.join(sorted(word.lower()))


def detect_anagrams(word, candidates):
    sorted_word = sort_alphabetically(word)
    anagrams = []
    for potential_anagram in candidates:
        if (sorted_word == sort_alphabetically(potential_anagram)) and (word.lower() != potential_anagram.lower()):
            anagrams.append(potential_anagram)

    return anagrams

aacaadb0371d79efcbde3e7ad5f60d37d8fc7f10
<mask token>

def sort_alphabetically(word):
    return ''.join(sorted(word.lower()))


<mask token>

def sort_alphabetically(word):
    return ''.join(sorted(word.lower()))


def detect_anagrams(word, candidates):
    sorted_word = sort_alphabetically(word)
    anagrams = []
    for potential_anagram in candidates:
        if sorted_word == sort_alphabetically(potential_anagram
            ) and word.lower() != potential_anagram.lower():
            anagrams.append(potential_anagram)
    return anagrams

def sort_alphabetically(word):
    return ''.join(sorted(word.lower()))


def detect_anagrams(word, candidates):
    sorted_word = sort_alphabetically(word)
    anagrams = []
    for potential_anagram in candidates:
        if (sorted_word == sort_alphabetically(potential_anagram)) and (word.lower() != potential_anagram.lower()):
            anagrams.append(potential_anagram)

    return anagrams
