docs: def best_match(supported, header):
      """Return mime-type with the highest quality ('q') from list of candidates.
  
      Takes a list of supported mime-types and finds the best match for all the
      media-ranges listed in header. The value of header must be a string that
      conforms to the format of the HTTP Accept: header. The value of 'supported'
      is a list of mime-types. The list of supported mime-types should be sorted
      in order of increasing desirability, in case of a situation where there is
      a tie.
  
      >>> best_match(['application/xbel+xml', 'text/xml'],
                     'text/*;q=0.5,*/*; q=0.1')
      'text/xml'
  
      :rtype: str
      """
      split_header = _filter_blank(header.split(','))
      parsed_header = [parse_media_range(r) for r in split_header]
      weighted_matches = []
      pos = 0
      for mime_type in supported:
          weighted_matches.append((
              quality_and_fitness_parsed(mime_type, parsed_header),
              pos,
              mime_type
          ))
          pos += 1
      weighted_matches.sort()
  
      return weighted_matches[-1][0][0] and weighted_matches[-1][2] or ''