input: Write a function to determine if two given strings are anagrams of each other. If they are anagrams, return True, otherwise return False. Two strings are considered anagrams if they contain the same characters with the same frequencies, irrespective of the order of characters. If either string is empty, return False.
  
  def is_anagram(str1, str2):
      if not str1 or not str2:
          return False
      if len(str1) != len(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("aabb", "bbaa")==True
  assert is_anagram("hello", "world")==False
  assert is_anagram("abcd", "abcde")==False
  assert is_anagram("", "a")==False
output: def is_anagram(str1, str2):
      if not str1 or not str2:
          return False
      if len(str1) != len(str2):
          return False
  
      str1_counts = collections.Counter(str1)
      str2_counts = collections.Counter(str2)
      
      return str1_counts == str2_counts