code: def is_profile_in_legacy_format(profile):
      
      if isinstance(profile, dict):
          pass
      elif isinstance(profile, (str, unicode)):
          try:
              profile = json.loads(profile)
          except ValueError:
              return False
      else:
          return False
  
      if "@type" in profile:
          return False
  
      if "@context" in profile:
          return False
  
      is_in_legacy_format = False
  
      if "avatar" in profile:
          is_in_legacy_format = True
      elif "cover" in profile:
          is_in_legacy_format = True
      elif "bio" in profile:
          is_in_legacy_format = True
      elif "twitter" in profile:
          is_in_legacy_format = True
      elif "facebook" in profile:
          is_in_legacy_format = True
  
      return is_in_legacy_format
docs: Is a given profile JSON object in legacy format?