def METHOD_NAME(name, email):
    # yes, a bit odd but this is the easiest way since we can't always be
    # sure how to split the name. Ensure every 'token' appears in at least
    # one of the two name fields.
    if not name:
        return None
    name_q = Q()
    for token in name.split():
        # ignore quoted parts; e.g. nicknames in strings
        if re.match(r'^[\'"].*[\'"]$', token):
            continue
        name_q &= (Q(first_name__icontains=token) | Q(last_name__icontains=token))
    return User.objects.get(name_q)