def getAcceptable(accept_header, have_types):
 accepted = parseAcceptHeader(accept_header)
 preferred = matchTypes(accepted, have_types)
 return [mtype for (mtype, _) in preferred]

def getAcceptable ( accept_header , have_types ) : accepted = parseAcceptHeader ( accept_header ) preferred = matchTypes ( accepted , have_types ) return [ mtype for ( mtype , _ ) in preferred ]
parse the accept header and return a list of available types in preferred order .