as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
create a function that will return all anagrams of a given string.
user
def get_anagrams(str):
    """
    function to return all anagrams of the given string
    
    parameters:
    str: string to be anagrammed 
    
    returns: 
    anagrams: a list of strings that are anagrams of the given string
    """
    if not str:
        return []
    
    anagrams = []
    letters = list(str)
    comb = itertools.permutations(letters, len(letters))
    
    for t in comb:
        anagram = ''.join(t)
        if anagram != str:
            anagrams.append(anagram)
    
    return anagrams
assistant