parameters: (url)
return_statement: return matches[0]
docstring: extract username and domain from a mastodon account url
      in the format https://instance.tld/@username
  
      :return: tuple (server, username)
docstring_summary: extract username and domain from a mastodon account url
      in the format https://instance.tld/@username
docstring_tokens: extract username and domain from a mastodon account url in the format https : // instance . tld / @username
function: def parse_mastodon_url(url):
      """extract username and domain from a mastodon account url
      in the format https://instance.tld/@username
  
      :return: tuple (server, username)
      """
  
      matches = re.findall(mastodon_url_regex, url)
      if len(matches) != 1 or len(matches[0]) != 2:
          # try legacy fallback
          matches = re.findall(mastodon_url_legacy_regex, url)
          if len(matches) != 1 or len(matches[0]) != 2:
              raise SyntaxError
  
      return matches[0]
function_tokens: def parse_mastodon_url ( url ) : matches = re . findall ( mastodon_url_regex , url ) if len ( matches ) != 1 or len ( matches [ 0 ] ) != 2 : # try legacy fallback matches = re . findall ( mastodon_url_legacy_regex , url ) if len ( matches ) != 1 or len ( matches [ 0 ] ) != 2 : raise SyntaxError return matches [ 0 ]