input: Write a function to determine if two given strings are anagrams. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. If the strings are anagrams return True, otherwise return False. If either of the strings is empty, return False.
  
  def is_anagram(str1, str2):
      if not str1 or not str2:
          return False
      
      str1_counts = collections.Counter(str1)
      str2_counts = collections.Counter(str2)
      
      return str1_counts == str2_counts
  
  assert is_anagram("abcd", "cbda")==True
  assert is_anagram("listen", "silent")==True
  assert is_anagram("hello", "world")==False
  assert is_anagram("race", "care")==True
  assert is_anagram("", "nonempty")==False
output: def is_anagram(str1, str2):
      if not str1 or not str2:
          return False
      
      str1_counts = collections.Counter(str1)
      str2_counts = collections.Counter(str2)
      
      return str1_counts == str2_counts