Module Expr Str Import alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Return TupleLoad NameLoad Dict orelse If NameLoad body Return TupleLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return CompareIn NameLoad TupleLoad Str Str Str decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot NameLoad body Return BoolOpOr NameLoad TupleLoad Str Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr Str If CompareGtE Call NameLoad NameLoad Num body Return SubscriptLoad NameLoad Slice Num orelse If CompareEq Call NameLoad NameLoad Num body If CompareEq SubscriptLoad NameLoad Index Num Str body Return TupleLoad Str Str orelse If CompareEq SubscriptLoad NameLoad Index Num Str body Return TupleLoad Str Str Return TupleLoad Str Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return TupleLoad NameLoad NameLoad Return TupleLoad Call AttributeLoad Call AttributeLoad NameLoad attr Num attr SubscriptLoad NameLoad Slice Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Dict For TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad While NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore SubscriptLoad NameLoad Index Num If Call NameLoad NameLoad body Return Call AttributeLoad NameLoad attr Call NameLoad NameLoad orelse Return Call AttributeLoad Str attr GeneratorExp Call NameLoad NameLoad comprehension NameStore Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body For NameStore TupleLoad NameLoad NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad If NameLoad body Return TupleLoad NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Return TupleLoad Call NameLoad Str NameLoad NameLoad SubscriptLoad NameLoad Slice Call AttributeLoad NameLoad attr orelse Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Return TupleLoad Call NameLoad Str NameLoad NameLoad SubscriptLoad NameLoad Slice Call AttributeLoad NameLoad attr orelse Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return SubscriptLoad NameLoad Slice Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str Assign NameStore IfExp Call AttributeLoad NameLoad attr Str Call NameLoad Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad NameLoad body Return Call NameLoad NameLoad If Call NameLoad NameLoad body Return Call NameLoad NameLoad Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad For NameStore NameLoad body If Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Continue If NameLoad body Expr Yield Call NameLoad NameLoad Assign NameStore Call NameLoad Expr Yield NameLoad If NameLoad body Expr Yield Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Num If CompareNotEq Call NameLoad NameLoad Num body Return NameLoad Assign TupleStore NameStore NameStore NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad Call NameLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return CompareEq SubscriptLoad Call NameLoad NameLoad Index Num Str decorator_list FunctionDef arguments args NameParam defaults body Return CompareEq SubscriptLoad NameLoad Index Num Str decorator_list FunctionDef arguments args NameParam defaults body Return CompareEq SubscriptLoad NameLoad Index Num Str decorator_list FunctionDef arguments args NameParam defaults body Return CompareEq SubscriptLoad SubscriptLoad NameLoad Index Num Index Num Str decorator_list FunctionDef arguments args NameParam defaults body If Call NameLoad NameLoad body Return Call AttributeLoad SubscriptLoad NameLoad Index Num attr orelse Return Call AttributeLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index Num attr decorator_list FunctionDef arguments args NameParam defaults body Return SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Str attr GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad For NameStore NameLoad body Return Call NameLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr Str BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str
N/A N/A Module that is responsible for parsing parameterized header values
encoded in accordance to rfc2231 (new style) or rfc1342 (old style)
 N/A urllib N/A regex re flanker.mime.message.headers encodedword flanker.mime.message charsets collections deque itertools groupby decode N/A N/A header N/A N/A N/A Accepts parameterized header value (encoded in accordance to
     rfc2231 (new style) or rfc1342 (old style)
     and returns tuple:
         value, {'key': u'val'}
     returns None in case of any failure
     N/A N/A value rest N/A split N/A N/A encodedword unfold header N/A N/A value None N/A N/A N/A None N/A N/A N/A value N/A N/A N/A value N/A decode_parameters rest N/A is_parametrized N/A N/A name value N/A N/A N/A N/A name N/A Content-Type Content-Disposition Content-Transfer-Encoding N/A fix_content_type N/A N/A value default N/A None N/A N/A Content-Type value may be badly broken N/A N/A value N/A N/A N/A default N/A text plain N/A values N/A N/A N/A N/A value lower split / N/A N/A N/A len values 2 N/A N/A N/A values N/A 2 N/A N/A N/A N/A len values 1 N/A N/A N/A N/A values N/A 0 text N/A N/A N/A text plain N/A N/A N/A N/A values N/A 0 html N/A N/A N/A text html N/A N/A application octet-stream N/A split N/A N/A header N/A N/A N/A Splits value part and parameters part,
    e.g.
         split("MULTIPART/MIXED;boundary=hal_9000")
    becomes:
         ["multipart/mixed", "boundary=hal_9000"]
     N/A match N/A N/A headerValue match header N/A N/A match N/A N/A N/A None None N/A N/A N/A N/A N/A N/A match group 1 lower N/A header N/A N/A N/A match end N/A decode_parameters N/A N/A string N/A N/A N/A Parameters can be splitted into several parts, e.g.

    title*0*=us-ascii'en'This%20is%20even%20more%20
    title*1*=%2A%2A%2Afun%2A%2A%2A%20
    title*2="isn't it!"

    decode them to the dictionary with keys and values N/A parameters N/A collect_parameters string N/A groups N/A N/A N/A k parts N/A groupby parameters get_key N/A N/A N/A groups N/A k N/A concatenate N/A list parts N/A groups N/A collect_parameters N/A N/A rest N/A N/A N/A Scans the string and collects parts
    that look like parameter, returns deque of strings
     N/A parameters N/A deque N/A N/A p rest N/A match_parameter rest N/A p N/A N/A N/A N/A parameters append p N/A N/A p rest N/A match_parameter rest N/A parameters N/A concatenate N/A N/A parts N/A N/A N/A  Concatenates splitted parts of a parameter in a single parameter,
    e.g.
         URL*0="ftp://";
         URL*1="cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar"

    becomes:

         URL="ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar"
     N/A part N/A parts N/A 0 N/A N/A is_old_style part N/A N/A N/A N/A encodedword mime_to_unicode N/A get_value part N/A N/A N/A N/A join N/A N/A decode_new_style p N/A p N/A partition parts N/A match_parameter N/A N/A rest N/A N/A N/A match N/A match_old match_new N/A N/A N/A p rest N/A match rest N/A p N/A N/A N/A p rest N/A N/A None rest N/A match_old N/A N/A rest N/A N/A N/A match N/A N/A oldStyleParameter match rest N/A match N/A N/A name N/A N/A match group name N/A value N/A N/A match group value N/A N/A N/A parameter old name value N/A rest N/A N/A N/A match end N/A N/A N/A None rest N/A match_new N/A N/A rest N/A N/A N/A match N/A N/A newStyleParameter match rest N/A match N/A N/A name N/A parse_parameter_name N/A N/A match group name N/A value N/A N/A match group value N/A N/A N/A parameter new name value N/A rest N/A N/A N/A match end N/A N/A N/A None rest N/A reverse N/A N/A string N/A N/A N/A Native reverse of a string looks a little bit cryptic,
    just a readable wrapper N/A N/A string N/A -1 N/A parse_parameter_name N/A N/A key N/A N/A N/A New style parameter names can be splitted into parts,
    e.g.

    title*0* means that it's the first part that is encoded
    title*1* means that it's the second part that is encoded
    title*2 means that it is the third part that is unencoded
    title means single unencoded
    title* means single encoded part

    I found it easier to match against a reversed string,
    as regexp is simpler
     N/A m N/A N/A reverseContinuation match N/A reverse key N/A key N/A reverse N/A N/A m group key N/A part N/A N/A N/A m group part N/A reverse N/A N/A m group part None N/A encoded N/A N/A m group encoded N/A N/A key part encoded N/A decode_new_style N/A N/A parameter N/A N/A N/A Decodes parameter values, quoted or percent encoded, to unicode N/A N/A is_quoted parameter N/A N/A N/A unquote parameter N/A N/A is_encoded parameter N/A N/A N/A decode_charset parameter N/A N/A get_value parameter N/A partition N/A N/A parts N/A N/A N/A Partitions the parts in accordance to the algo here:
    http://tools.ietf.org/html/rfc2231#section-4.1
     N/A encoded N/A deque N/A part parts N/A N/A N/A is_encoded part N/A N/A N/A N/A encoded append part N/A N/A encoded N/A N/A N/A N/A join_parameters encoded N/A encoded N/A deque N/A N/A part N/A encoded N/A N/A N/A N/A join_parameters encoded N/A decode_charset N/A N/A parameter N/A N/A N/A Decodes things like:
    "us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20"
    to unicode  N/A v N/A get_value parameter N/A parts N/A N/A v split ' 2 N/A N/A N/A len parts 3 N/A N/A v N/A N/A charset language val parts N/A val N/A N/A urllib unquote val N/A N/A N/A charsets convert_to_unicode charset val N/A unquote N/A N/A parameter N/A N/A N/A Simply removes quotes N/A N/A N/A N/A get_value parameter strip " N/A parameter N/A N/A ptype key value N/A N/A N/A Parameter is stored as a tuple,
    and below are conventional
     N/A N/A ptype key value N/A is_quoted N/A N/A part N/A N/A N/A N/A N/A N/A get_value part N/A 0 " N/A is_new_style N/A N/A parameter N/A N/A N/A N/A N/A parameter N/A 0 new N/A is_old_style N/A N/A parameter N/A N/A N/A N/A N/A parameter N/A 0 old N/A is_encoded N/A N/A part N/A N/A N/A N/A N/A N/A part N/A 1 N/A 2 * N/A get_key N/A N/A parameter N/A N/A N/A N/A is_old_style parameter N/A N/A N/A N/A N/A parameter N/A 1 lower N/A N/A N/A N/A N/A N/A parameter N/A 1 N/A 0 lower N/A get_value N/A N/A parameter N/A N/A N/A N/A parameter N/A 2 N/A join_parameters N/A N/A parts N/A N/A N/A joined N/A N/A join N/A N/A get_value p N/A p parts N/A p parts N/A N/A N/A parameter N/A p N/A 0 N/A p N/A 1 joined N/A N/A headerValue N/A N/A re compile 
       # don't care about the spaces
       ^[\ \t]*
       #main type and sub type or any other value
       ([a-z0-9\-/\.\*]+)
       # grab the trailing spaces, colons
       [\ \t;]* N/A N/A re IGNORECASE N/A re VERBOSE N/A oldStyleParameter N/A N/A re compile 
     # according to rfc1342, param value can be encoded-word
     # and it's actually very popular, so detect this parameter first
     ^
     # skip spaces
     [\ \t]*
     # parameter name
     (?P<name>
         [^\x00-\x1f\s\(\)<>@,;:\\"/\[\]\?=]+
     )
     # skip spaces
     [\ \t]*
     =
     # skip spaces
     [\ \t]*
     #optional quoting sign
     "?
     # skip spaces
     [\ \t]*
     # and a glorious encoded-word sequence
     (?P<value>
       =\?
       .* # non-greedy to match the end sequence chars
       \?=
     )
     # ends with optional quoting sign that we ignore
     "?
 N/A N/A re IGNORECASE N/A re VERBOSE N/A newStyleParameter N/A N/A re compile 
     # Here we grab anything that looks like a parameter
     ^
     # skip spaces
     [\ \t]*
     # parameter name
     (?P<name>
         [^\x00-\x1f\s\(\)<>@,;:\\"/\[\]\?=]+
     )
     # skip spaces
     [\ \t]*
     =
     # skip spaces
     [\ \t]*
     (?P<value>
       (?:
         "(?:
             [\x21\x23-\x5b\x5d-\x7e\ \t]
             |
             (?:\\[\x21-\x7e\t\ ])
          )+"
       )
     |
     # any (US-ASCII) CHAR except SPACE, CTLs, or tspecials
     [^\x00-\x1f\s\(\)<>@,;:\\"/\[\]\?=]+
     )
     # skip spaces
     [\ \t]*
     ;?
 N/A N/A re IGNORECASE N/A re VERBOSE N/A reverseContinuation N/A N/A re compile ^(?P<encoded>\*)?(?P<part>\d+\*)?(?P<key>.*)