def parse_address(formatted_address):
    """
    :param formatted_address: A string like "email@address.com" or "My Email <email@address.com>"
    
    :return: Tuple: (address, name)
    """
    if email_regex.match(formatted_address):
        # Just a raw address
        return (formatted_address, None)
    
    match = formatted_address_regex.match(formatted_address)

    if match:
        (name, email) = match.group(1, 2)
        return email.strip(), name.strip()

    raise ValueError('"{}" is not a valid formatted address'.format(formatted_address))
def parse_address(formatted_address):
    """
    :param formatted_address: A string like "email@address.com" or "My Email <email@address.com>"
    
    :return: Tuple: (address, name)
    """
    if email_regex.match(formatted_address):
        # Just a raw address
        return (formatted_address, None)
    
    match = formatted_address_regex.match(formatted_address)

    if match:
        (name, email) = match.group(1, 2)
        return email.strip(), name.strip()

    raise ValueError('"{}" is not a valid formatted address'.format(formatted_address))
def parse_address ( formatted_address ) : if email_regex . match ( formatted_address ) : # Just a raw address return ( formatted_address , None ) match = formatted_address_regex . match ( formatted_address ) if match : ( name , email ) = match . group ( 1 , 2 ) return email . strip ( ) , name . strip ( ) raise ValueError ( '"{}" is not a valid formatted address' . format ( formatted_address ) )
:param formatted_address: A string like "email@address.com" or "My Email <email@address.com>"
    
    :return: Tuple: (address, name)
: param formatted_address : A string like email