<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def accept_best_match(accept_header, mimetypes):
 """Return a mimetype best matched the accept headers. 'application/json' 'text/plain' """

    for mimetype_pattern, _ in _parse_and_sort_accept_header(accept_header):
        matched_types = fnmatch.filter(mimetypes, mimetype_pattern)
        if matched_types:
            return matched_types[0]
    return mimetypes[0]