Module Import alias Assign NameStore Call AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Str NameLoad Return Call AttributeLoad Call AttributeLoad NameLoad attr Str Str NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return SubscriptLoad Call AttributeLoad NameLoad attr Str Index Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return IfExp NameLoad Call AttributeLoad NameLoad attr Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If NameLoad body Return IfExp NameLoad Call NameLoad NameLoad NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Str Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore UnaryOpUSub Call NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num If CompareIsNot NameLoad Num body Return NameLoad Assign TupleStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad Index Num Assign TupleStore NameStore NameStore Call NameLoad SubscriptLoad NameLoad Index Num If BoolOpAnd CompareEq NameLoad Str CompareEq NameLoad Str body Return Num If BoolOpAnd CompareEq NameLoad Str CompareEq NameLoad Str body Return Num If CompareEq NameLoad Str body Return Num If CompareEq NameLoad Str body Return Num Return Num decorator_list If UnaryOpNot NameLoad body Return ListLoad Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Num attr Assign NameStore ListLoad Assign NameStore Num For NameStore NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr Str Num If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list
N/A N/A re N/A charset_pattern N/A N/A re compile .*;\s*charset=(.*) camelcase_to_slash N/A N/A name N/A N/A N/A  Converts CamelCase to camel/case

    code ripped from http://stackoverflow.com/questions/1175208/does-the-python-standard-library-have-function-to-convert-camelcase-to-camel-cas
     N/A s1 N/A N/A re sub (.)([A-Z][a-z]+) \1/\2 name N/A N/A N/A N/A N/A re sub ([a-z0-9])([A-Z]) \1/\2 s1 lower N/A strip_charset N/A N/A content_type N/A N/A N/A  Strip charset from the content type string.

    :param content_type: The Content-Type string (possibly with charset info)
    :returns: The Content-Type string without the charset information
     N/A N/A N/A N/A content_type split ; N/A 0 N/A extract_charset N/A N/A content_type N/A N/A N/A  Extract charset info from content type.

    E.g.  application/json;charset=utf-8  ->  utf-8

    :param content_type: The Content-Type string (possibly with charset info)
    :returns: The charset or ``None`` if not found.
     N/A match N/A N/A charset_pattern match content_type N/A N/A match N/A N/A match group 1 None N/A get_charset N/A N/A request N/A N/A N/A  Extract charset from the content type
     N/A content_type N/A N/A N/A request META get CONTENT_TYPE None N/A content_type N/A N/A N/A content_type N/A extract_charset content_type None N/A N/A None N/A parse_accept_header N/A N/A accept N/A N/A N/A  Parse the Accept header

    todo: memoize

    :returns: list with pairs of (media_type, q_value), ordered by q
    values.
     parse_media_range N/A N/A accept_item N/A N/A N/A  Parse media range and subtype  N/A N/A N/A accept_item split / 1 N/A comparator N/A N/A a b N/A N/A N/A  Compare accept items a and b  N/A result N/A N/A cmp N/A a N/A 2 N/A b N/A 2 N/A N/A result 0 N/A N/A result N/A N/A mtype_a subtype_a N/A parse_media_range N/A a N/A 0 N/A N/A mtype_b subtype_b N/A parse_media_range N/A b N/A 0 N/A N/A N/A mtype_a * N/A subtype_a * N/A N/A 1 N/A N/A N/A mtype_b * N/A subtype_b * N/A N/A -1 N/A N/A subtype_a * N/A N/A 1 N/A N/A subtype_b * N/A N/A -1 N/A 0 N/A N/A N/A accept N/A N/A N/A N/A result N/A N/A media_range N/A N/A accept split , N/A N/A parts N/A N/A media_range split ; N/A media_type N/A N/A N/A N/A parts pop 0 strip N/A media_params N/A N/A q 1.0 N/A part parts N/A N/A N/A key value N/A N/A N/A N/A part lstrip split = 1 N/A N/A key q N/A N/A q N/A float value N/A N/A N/A N/A media_params append N/A key value N/A N/A N/A result append N/A media_type N/A tuple media_params q N/A N/A N/A result sort comparator N/A result N/A