input: Write a function to check if two given strings are anagrams. Return True if they are anagrams, otherwise return False. Two strings are considered anagrams if they contain the same characters with the same frequency. If either of the input strings is empty, return False.
  
  def is_anagram(str1, str2):
      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("listen", "silent")==True
  assert is_anagram("hello", "world")==False
  assert is_anagram("", "nonempty")==False
  assert is_anagram("sing", "sign")==False
output: def is_anagram(str1, str2):
      if len(str1) == 0 or len(str2) == 0:
          return False
      return sorted(str1) == sorted(str2)