human
I wrote the below code

    if (query is None):
        query = {}
    _validate_query(query)
    for (field, values) in query.items():
        for value in values:
            if (field == u'track_no'):
                q = _convert_to_int(value)
            else:
                q = value.strip().lower()
            def uri_filter(t):
                return bool((t.uri and (q in t.uri.lower())))
            def track_name_filter(t):
                return bool((t.name and (q in t.name.lower())))
            def album_filter(t):
                return bool((t.album and t.album.name and (q in t.album.name.lower())))
            def artist_filter(t):
                return bool(filter((lambda a: bool((a.name and (q in a.name.lower())))), t.artists))
            def albumartist_filter(t):
                return any([(a.name and (q in a.name.lower())) for a in getattr(t.album, u'artists', [])])
            def composer_filter(t):
                return any([(a.name and (q in a.name.lower())) for a in getattr(t, u'composers', [])])
            def performer_filter(t):
                return any([(a.name and (q in a.name.lower())) for a in getattr(t, u'performers', [])])
            def track_no_filter(t):
                return (q == t.track_no)
            def genre_filter(t):
                return bool((t.genre and (q in t.genre.lower())))
            def date_filter(t):
                return bool((t.date and t.date.startswith(q)))
            def comment_filter(t):
                return bool((t.comment and (q in t.comment.lower())))
            def any_filter(t):
                return (uri_filter(t) or track_name_filter(t) or album_filter(t) or artist_filter(t) or albumartist_filter(t) or composer_filter(t) or performer_filter(t) or track_no_filter(t) or genre_filter(t) or date_filter(t) or comment_filter(t))
            if (field == u'uri'):
                tracks = filter(uri_filter, tracks)
            elif (field == u'track_name'):
                tracks = filter(track_name_filter, tracks)
            elif (field ==...

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

def search(tracks, query=None, limit=100, offset=0, uris=None):