'Returns the item from "options" that best matches the accept header.
Returns None if no available options are acceptable to the client.
:param options: a list of content-types the server can respond with'

def best_match(self, options):

    try:
        types = self._get_types()
    except ValueError:
        return None
    if ((not types) and options):
        return options[0]
    for pattern in types:
        for option in options:
            if re.match(pattern, option):
                return option
    return None
