human
I wrote the below code

    def GetSubjectForError():
        if (len(targets) == 1):
            return list(targets)[0]
        else:
            return None
    if (not token):
        raise access_control.UnauthorizedAccess(('Must    give    an    authorization    token    for    %s' % targets), subject=GetSubjectForError())
    token.CheckExpiry()
    if (not token.username):
        raise access_control.UnauthorizedAccess(('Must    specify    a    username    for    access    to    %s.' % targets), subject=GetSubjectForError())
    return True

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

def ValidateToken(token, targets):