code: def get_email_domain(emailaddr):
      
      realname, address = email.utils.parseaddr(emailaddr)
      try:
          username, domain = address.split('@')
          if not username:
              return None
          return domain or None
      except ValueError:
          return None
docs: Return the domain component of an email address. Returns None if the
      provided string cannot be parsed as an email address.
  
      >>> get_email_domain('test@example.com')
      'example.com'
      >>> get_email_domain('test+trailing@example.com')
      'example.com'
      >>> get_email_domain('Example Address <test@example.com>')
      'example.com'
      >>> get_email_domain('foobar')
      >>> get_email_domain('foo@bar@baz')
      'bar'
      >>> get_email_domain('foobar@')
      >>> get_email_domain('@foobar')