def choose_content_type(accept_header, supported_types):
 for accept_item in parse_accept_header(accept_header):
  for supported_type in supported_types:
   if accept_item.match(supported_type):
    return supported_type
 return None

def choose_content_type ( accept_header , supported_types ) : for accept_item in parse_accept_header ( accept_header ) : for supported_type in supported_types : if accept_item . match ( supported_type ) : return supported_type return None
choose most appropriate supported type based on what client accepts .