input: Write a function to determine if two given strings are anagrams. Two strings are considered anagrams if they contain the same characters in the same frequency. If the given strings are anagrams return True else return False.
  
  def is_anagram(str1, str2):
      if len(str1) != len(str2):
          return False
  
      str1_counts = collections.Counter(str1)
      str2_counts = collections.Counter(str2)
      
      for char in str1_counts:
          if str1_counts[char] != str2_counts[char]:
              return False
      return True
  
  assert is_anagram("abcd", "cbda")==True
  assert is_anagram("abcd", "abce")==False
  assert is_anagram("listen", "silent")==True
  assert is_anagram("listen", "silents")==False
  assert is_anagram("", "")==True
output: def is_anagram(str1, str2):
      if len(str1) != len(str2):
          return False
  
      str1_counts = collections.Counter(str1)
      str2_counts = collections.Counter(str2)
      
      for char in str1_counts:
          if str1_counts[char] != str2_counts[char]:
              return False
      return True