human
I wrote the below code

    email = email_str = (email_str or u'').strip()
    def _check(e):
        _valid = True
        if (not e):
            _valid = False
        if (u'undisclosed-recipient' in e):
            return False
        elif ((u'    ' in e) and (u'<' not in e)):
            _valid = False
        else:
            e = extract_email_id(e)
            match = (re.match(u"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", e.lower()) if e else None)
            if (not match):
                _valid = False
            else:
                matched = match.group(0)
                if match:
                    match = (matched == e.lower())
        if (not _valid):
            if throw:
                frappe.throw(frappe._(u'{0}    is    not    a    valid    Email    Address').format(e), frappe.InvalidEmailAddressError)
            return None
        else:
            return matched
    out = []
    for e in email_str.split(u','):
        email = _check(e.strip())
        if email:
            out.append(email)
    return u',    '.join(out)

What's a good function header?
assistant
#Here's a good function header.

def validate_email_add(email_str, throw=False):