<s> """<STR_LIT>""" <EOL> import mimetypes <EOL> import six <EOL> from time import time as now <EOL> try : <EOL> from email . utils import formatdate , parsedate_tz , mktime_tz <EOL> from urllib . request import AbstractDigestAuthHandler , parse_keqv_list , parse_http_list <EOL> except ImportError : <EOL> from rfc822 import formatdate , parsedate_tz , mktime_tz <EOL> from urllib2 import AbstractDigestAuthHandler , parse_keqv_list , parse_http_list <EOL> from . httpexceptions import HTTPBadRequest <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ] <EOL> class EnvironVariable ( str ) : <EOL> """<STR_LIT>""" <EOL> def __call__ ( self , environ ) : <EOL> return environ . get ( self , '<STR_LIT>' ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % self <EOL> def update ( self , environ , value ) : <EOL> environ [ self ] = value <EOL> REMOTE_USER = EnvironVariable ( "<STR_LIT>" ) <EOL> REMOTE_SESSION = EnvironVariable ( "<STR_LIT>" ) <EOL> AUTH_TYPE = EnvironVariable ( "<STR_LIT>" ) <EOL> REQUEST_METHOD = EnvironVariable ( "<STR_LIT>" ) <EOL> SCRIPT_NAME = EnvironVariable ( "<STR_LIT>" ) <EOL> PATH_INFO = EnvironVariable ( "<STR_LIT>" ) <EOL> for _name , _obj in six . iteritems ( dict ( globals ( ) ) ) : <EOL> if isinstance ( _obj , EnvironVariable ) : <EOL> __all__ . append ( _name ) <EOL> _headers = { } <EOL> class HTTPHeader ( object ) : <EOL> """<STR_LIT>""" <EOL> version = '<STR_LIT>' <EOL> category = '<STR_LIT>' <EOL> reference = '<STR_LIT>' <EOL> extensions = { } <EOL> def compose ( self , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError ( ) <EOL> def parse ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError ( ) <EOL> def apply ( self , collection , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> self . update ( collection , ** kwargs ) <EOL> def __new__ ( cls , name , category = None , reference = None , version = None ) : <EOL> """<STR_LIT>""" <EOL> self = get_header ( name , raiseError = False ) <EOL> if self : <EOL> assert self . name == name , "<STR_LIT>" <EOL> assert self . category == category , "<STR_LIT>" <EOL> assert cls == self . __class__ , "<STR_LIT>" <EOL> return self <EOL> self = object . __new__ ( cls ) <EOL> self . name = name <EOL> assert isinstance ( self . name , str ) <EOL> self . category = category or self . category <EOL> self . version = version or self . version <EOL> self . reference = reference or self . reference <EOL> _headers [ self . name . lower ( ) ] = self <EOL> self . sort_order = { '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : <NUM_LIT:2> , <EOL> '<STR_LIT>' : <NUM_LIT:3> , '<STR_LIT>' : <NUM_LIT:4> } [ self . category ] <EOL> self . _environ_name = getattr ( self , '<STR_LIT>' , <EOL> '<STR_LIT>' + self . name . upper ( ) . replace ( "<STR_LIT:->" , "<STR_LIT:_>" ) ) <EOL> self . _headers_name = getattr ( self , '<STR_LIT>' , <EOL> self . name . lower ( ) ) <EOL> assert self . version in ( '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' ) <EOL> return self <EOL> def __str__ ( self ) : <EOL> return self . name <EOL> def __lt__ ( self , other ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( other , HTTPHeader ) : <EOL> if self . sort_order != other . sort_order : <EOL> return self . sort_order < other . sort_order <EOL> return self . name < other . name <EOL> return False <EOL> def __repr__ ( self ) : <EOL> ref = self . reference and ( '<STR_LIT>' % self . reference ) or '<STR_LIT>' <EOL> return '<STR_LIT>' % ( self . __class__ . __name__ , self . name , ref ) <EOL> def values ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if not args : <EOL> return self . compose ( ** kwargs ) <EOL> if list == type ( args [ <NUM_LIT:0> ] ) : <EOL> assert <NUM_LIT:1> == len ( args ) <EOL> result = [ ] <EOL> name = self . name . lower ( ) <EOL> for value in [ value for header , value in args [ <NUM_LIT:0> ] <EOL> if header . lower ( ) == name ] : <EOL> result . append ( value ) <EOL> return result <EOL> if dict == type ( args [ <NUM_LIT:0> ] ) : <EOL> assert <NUM_LIT:1> == len ( args ) and '<STR_LIT>' in args [ <NUM_LIT:0> ] <EOL> value = args [ <NUM_LIT:0> ] . get ( self . _environ_name ) <EOL> if not value : <EOL> return ( ) <EOL> return ( value , ) <EOL> for item in args : <EOL> assert not type ( item ) in ( dict , list ) <EOL> return args <EOL> def __call__ ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> values = self . values ( * args , ** kwargs ) <EOL> assert isinstance ( values , ( tuple , list ) ) <EOL> if not values : <EOL> return '<STR_LIT>' <EOL> assert len ( values ) == <NUM_LIT:1> , "<STR_LIT>" % repr ( values ) <EOL> return str ( values [ <NUM_LIT:0> ] ) . strip ( ) <EOL> def delete ( self , collection ) : <EOL> """<STR_LIT>""" <EOL> if type ( collection ) == dict : <EOL> if self . _environ_name in collection : <EOL> del collection [ self . _environ_name ] <EOL> return self <EOL> assert list == type ( collection ) <EOL> i = <NUM_LIT:0> <EOL> while i < len ( collection ) : <EOL> if collection [ i ] [ <NUM_LIT:0> ] . lower ( ) == self . _headers_name : <EOL> del collection [ i ] <EOL> continue <EOL> i += <NUM_LIT:1> <EOL> def update ( self , collection , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> value = self . __call__ ( * args , ** kwargs ) <EOL> if not value : <EOL> self . delete ( collection ) <EOL> return <EOL> if type ( collection ) == dict : <EOL> collection [ self . _environ_name ] = value <EOL> return <EOL> assert list == type ( collection ) <EOL> i = <NUM_LIT:0> <EOL> found = False <EOL> while i < len ( collection ) : <EOL> if collection [ i ] [ <NUM_LIT:0> ] . lower ( ) == self . _headers_name : <EOL> if found : <EOL> del collection [ i ] <EOL> continue <EOL> collection [ i ] = ( self . name , value ) <EOL> found = True <EOL> i += <NUM_LIT:1> <EOL> if not found : <EOL> collection . append ( ( self . name , value ) ) <EOL> def tuples ( self , * args , ** kwargs ) : <EOL> value = self . __call__ ( * args , ** kwargs ) <EOL> if not value : <EOL> return ( ) <EOL> return [ ( self . name , value ) ] <EOL> class _SingleValueHeader ( HTTPHeader ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class _MultiValueHeader ( HTTPHeader ) : <EOL> """<STR_LIT>""" <EOL> def __call__ ( self , * args , ** kwargs ) : <EOL> results = self . values ( * args , ** kwargs ) <EOL> if not results : <EOL> return '<STR_LIT>' <EOL> return "<STR_LIT:U+002CU+0020>" . join ( [ str ( v ) . strip ( ) for v in results ] ) <EOL> def parse ( self , * args , ** kwargs ) : <EOL> value = self . __call__ ( * args , ** kwargs ) <EOL> values = value . split ( '<STR_LIT:U+002C>' ) <EOL> return [ <EOL> v . strip ( ) for v in values <EOL> if v . strip ( ) ] <EOL> class _MultiEntryHeader ( HTTPHeader ) : <EOL> """<STR_LIT>""" <EOL> def update ( self , collection , * args , ** kwargs ) : <EOL> assert list == type ( collection ) , "<STR_LIT>" <EOL> self . delete ( collection ) <EOL> collection . extend ( self . tuples ( * args , ** kwargs ) ) <EOL> def tuples ( self , * args , ** kwargs ) : <EOL> values = self . values ( * args , ** kwargs ) <EOL> if not values : <EOL> return ( ) <EOL> return [ ( self . name , value . strip ( ) ) for value in values ] <EOL> def get_header ( name , raiseError = True ) : <EOL> """<STR_LIT>""" <EOL> retval = _headers . get ( str ( name ) . strip ( ) . lower ( ) . replace ( "<STR_LIT:_>" , "<STR_LIT:->" ) ) <EOL> if not retval and raiseError : <EOL> raise AssertionError ( "<STR_LIT>" % name ) <EOL> return retval <EOL> def list_headers ( general = None , request = None , response = None , entity = None ) : <EOL> "<STR_LIT>" <EOL> if not ( general or request or response or entity ) : <EOL> general = request = response = entity = True <EOL> search = [ ] <EOL> for ( bool , strval ) in ( ( general , '<STR_LIT>' ) , ( request , '<STR_LIT>' ) , <EOL> ( response , '<STR_LIT>' ) , ( entity , '<STR_LIT>' ) ) : <EOL> if bool : <EOL> search . append ( strval ) <EOL> return [ head for head in _headers . values ( ) if head . category in search ] <EOL> def normalize_headers ( response_headers , strict = True ) : <EOL> """<STR_LIT>""" <EOL> category = { } <EOL> for idx in range ( len ( response_headers ) ) : <EOL> ( key , val ) = response_headers [ idx ] <EOL> head = get_header ( key , strict ) <EOL> if not head : <EOL> newhead = '<STR_LIT:->' . join ( [ x . capitalize ( ) for x in <EOL> key . replace ( "<STR_LIT:_>" , "<STR_LIT:->" ) . split ( "<STR_LIT:->" ) ] ) <EOL> response_headers [ idx ] = ( newhead , val ) <EOL> category [ newhead ] = <NUM_LIT:4> <EOL> continue <EOL> response_headers [ idx ] = ( str ( head ) , val ) <EOL> category [ str ( head ) ] = head . sort_order <EOL> def key_func ( item ) : <EOL> value = item [ <NUM_LIT:0> ] <EOL> return ( category [ value ] , value ) <EOL> response_headers . sort ( key = key_func ) <EOL> class _DateHeader ( _SingleValueHeader ) : <EOL> """<STR_LIT>""" <EOL> def compose ( self , time = None , delta = None ) : <EOL> time = time or now ( ) <EOL> if delta : <EOL> assert type ( delta ) == int <EOL> time += delta <EOL> return ( formatdate ( time ) , ) <EOL> def parse ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> value = self . __call__ ( * args , ** kwargs ) <EOL> if value : <EOL> try : <EOL> return mktime_tz ( parsedate_tz ( value ) ) <EOL> except ( TypeError , OverflowError ) : <EOL> raise HTTPBadRequest ( ( <EOL> "<STR_LIT>" ) % <EOL> ( self . name , value ) ) <EOL> class _CacheControl ( _MultiValueHeader ) : <EOL> """<STR_LIT>""" <EOL> ONE_HOUR = <NUM_LIT> * <NUM_LIT> <EOL> ONE_DAY = ONE_HOUR * <NUM_LIT> <EOL> ONE_WEEK = ONE_DAY * <NUM_LIT:7> <EOL> ONE_MONTH = ONE_DAY * <NUM_LIT:30> <EOL> ONE_YEAR = ONE_WEEK * <NUM_LIT> <EOL> def _compose ( self , public = None , private = None , no_cache = None , <EOL> no_store = False , max_age = None , s_maxage = None , <EOL> no_transform = False , ** extensions ) : <EOL> assert isinstance ( max_age , ( type ( None ) , int ) ) <EOL> assert isinstance ( s_maxage , ( type ( None ) , int ) ) <EOL> expires = <NUM_LIT:0> <EOL> result = [ ] <EOL> if private is True : <EOL> assert not public and not no_cache and not s_maxage <EOL> result . append ( '<STR_LIT>' ) <EOL> elif no_cache is True : <EOL> assert not public and not private and not max_age <EOL> result . append ( '<STR_LIT>' ) <EOL> else : <EOL> assert public is None or public is True <EOL> assert not private and not no_cache <EOL> expires = max_age <EOL> result . append ( '<STR_LIT>' ) <EOL> if no_store : <EOL> result . append ( '<STR_LIT>' ) <EOL> if no_transform : <EOL> result . append ( '<STR_LIT>' ) <EOL> if max_age is not None : <EOL> result . append ( '<STR_LIT>' % max_age ) <EOL> if s_maxage is not None : <EOL> result . append ( '<STR_LIT>' % s_maxage ) <EOL> for ( k , v ) in six . iteritems ( extensions ) : <EOL> if k not in self . extensions : <EOL> raise AssertionError ( "<STR_LIT>" % k ) <EOL> result . append ( '<STR_LIT>' % ( k . replace ( "<STR_LIT:_>" , "<STR_LIT:->" ) , v ) ) <EOL> return ( result , expires ) <EOL> def compose ( self , ** kwargs ) : <EOL> ( result , expires ) = self . _compose ( ** kwargs ) <EOL> return result <EOL> def apply ( self , collection , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> ( result , expires ) = self . _compose ( ** kwargs ) <EOL> if expires is not None : <EOL> EXPIRES . update ( collection , delta = expires ) <EOL> self . update ( collection , * result ) <EOL> return expires <EOL> _CacheControl ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class _ContentType ( _SingleValueHeader ) : <EOL> """<STR_LIT>""" <EOL> version = '<STR_LIT:1.0>' <EOL> _environ_name = '<STR_LIT>' <EOL> UNKNOWN = '<STR_LIT>' <EOL> TEXT_PLAIN = '<STR_LIT>' <EOL> TEXT_HTML = '<STR_LIT>' <EOL> TEXT_XML = '<STR_LIT>' <EOL> def compose ( self , major = None , minor = None , charset = None ) : <EOL> if not major : <EOL> if minor in ( '<STR_LIT>' , '<STR_LIT:html>' , '<STR_LIT>' ) : <EOL> major = '<STR_LIT:text>' <EOL> else : <EOL> assert not minor and not charset <EOL> return ( self . UNKNOWN , ) <EOL> if not minor : <EOL> minor = "<STR_LIT:*>" <EOL> result = "<STR_LIT>" % ( major , minor ) <EOL> if charset : <EOL> result += "<STR_LIT>" % charset <EOL> return ( result , ) <EOL> _ContentType ( '<STR_LIT:Content-Type>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class _ContentLength ( _SingleValueHeader ) : <EOL> """<STR_LIT>""" <EOL> version = "<STR_LIT:1.0>" <EOL> _environ_name = '<STR_LIT>' <EOL> _ContentLength ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class _ContentDisposition ( _SingleValueHeader ) : <EOL> """<STR_LIT>""" <EOL> def _compose ( self , attachment = None , inline = None , filename = None ) : <EOL> result = [ ] <EOL> if inline is True : <EOL> assert not attachment <EOL> result . append ( '<STR_LIT>' ) <EOL> else : <EOL> assert not inline <EOL> result . append ( '<STR_LIT>' ) <EOL> if filename : <EOL> assert '<STR_LIT:">' not in filename <EOL> filename = filename . split ( "<STR_LIT:/>" ) [ - <NUM_LIT:1> ] <EOL> filename = filename . split ( "<STR_LIT:\\>" ) [ - <NUM_LIT:1> ] <EOL> result . append ( '<STR_LIT>' % filename ) <EOL> return ( ( "<STR_LIT>" . join ( result ) , ) , filename ) <EOL> def compose ( self , ** kwargs ) : <EOL> ( result , mimetype ) = self . _compose ( ** kwargs ) <EOL> return result <EOL> def apply ( self , collection , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> ( result , filename ) = self . _compose ( ** kwargs ) <EOL> mimetype = CONTENT_TYPE ( collection ) <EOL> if filename and ( not mimetype or CONTENT_TYPE . UNKNOWN == mimetype ) : <EOL> mimetype , _ = mimetypes . guess_type ( filename ) <EOL> if mimetype and CONTENT_TYPE . UNKNOWN != mimetype : <EOL> CONTENT_TYPE . update ( collection , mimetype ) <EOL> self . update ( collection , * result ) <EOL> return mimetype <EOL> _ContentDisposition ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class _IfModifiedSince ( _DateHeader ) : <EOL> """<STR_LIT>""" <EOL> version = '<STR_LIT:1.0>' <EOL> def __call__ ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return _DateHeader . __call__ ( self , * args , ** kwargs ) . split ( '<STR_LIT:;>' , <NUM_LIT:1> ) [ <NUM_LIT:0> ] <EOL> def parse ( self , * args , ** kwargs ) : <EOL> value = _DateHeader . parse ( self , * args , ** kwargs ) <EOL> if value and value > now ( ) : <EOL> raise HTTPBadRequest ( ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) % self . name ) <EOL> return value <EOL> _IfModifiedSince ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class _Range ( _MultiValueHeader ) : <EOL> """<STR_LIT>""" <EOL> def parse ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> value = self . __call__ ( * args , ** kwargs ) <EOL> if not value : <EOL> return None <EOL> ranges = [ ] <EOL> last_end = - <NUM_LIT:1> <EOL> try : <EOL> ( units , range ) = value . split ( "<STR_LIT:=>" , <NUM_LIT:1> ) <EOL> units = units . strip ( ) . lower ( ) <EOL> for item in range . split ( "<STR_LIT:U+002C>" ) : <EOL> ( begin , end ) = item . split ( "<STR_LIT:->" ) <EOL> if not begin . strip ( ) : <EOL> begin = <NUM_LIT:0> <EOL> else : <EOL> begin = int ( begin ) <EOL> if begin <= last_end : <EOL> raise ValueError ( ) <EOL> if not end . strip ( ) : <EOL> end = None <EOL> else : <EOL> end = int ( end ) <EOL> last_end = end <EOL> ranges . append ( ( begin , end ) ) <EOL> except ValueError : <EOL> return None <EOL> return ( units , ranges ) <EOL> _Range ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class _AcceptLanguage ( _MultiValueHeader ) : <EOL> """<STR_LIT>""" <EOL> def parse ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> header = self . __call__ ( * args , ** kwargs ) <EOL> if header is None : <EOL> return [ ] <EOL> langs = [ v for v in header . split ( "<STR_LIT:U+002C>" ) if v ] <EOL> qs = [ ] <EOL> for lang in langs : <EOL> pieces = lang . split ( "<STR_LIT:;>" ) <EOL> lang , params = pieces [ <NUM_LIT:0> ] . strip ( ) . lower ( ) , pieces [ <NUM_LIT:1> : ] <EOL> q = <NUM_LIT:1> <EOL> for param in params : <EOL> if '<STR_LIT:=>' not in param : <EOL> continue <EOL> lvalue , rvalue = param . split ( "<STR_LIT:=>" ) <EOL> lvalue = lvalue . strip ( ) . lower ( ) <EOL> rvalue = rvalue . strip ( ) <EOL> if lvalue == "<STR_LIT:q>" : <EOL> q = float ( rvalue ) <EOL> qs . append ( ( lang , q ) ) <EOL> qs . sort ( key = lambda query : query [ <NUM_LIT:1> ] , reverse = True ) <EOL> return [ lang for ( lang , q ) in qs ] <EOL> _AcceptLanguage ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class _AcceptRanges ( _MultiValueHeader ) : <EOL> """<STR_LIT>""" <EOL> def compose ( self , none = None , bytes = None ) : <EOL> if bytes : <EOL> return ( '<STR_LIT>' , ) <EOL> return ( '<STR_LIT:none>' , ) <EOL> _AcceptRanges ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class _ContentRange ( _SingleValueHeader ) : <EOL> """<STR_LIT>""" <EOL> def compose ( self , first_byte = None , last_byte = None , total_length = None ) : <EOL> retval = "<STR_LIT>" % ( first_byte , last_byte , total_length ) <EOL> assert last_byte == - <NUM_LIT:1> or first_byte <= last_byte <EOL> assert last_byte < total_length <EOL> return ( retval , ) <EOL> _ContentRange ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> class _Authorization ( _SingleValueHeader ) : <EOL> """<STR_LIT>""" <EOL> def compose ( self , digest = None , basic = None , username = None , password = None , <EOL> challenge = None , path = None , method = None ) : <EOL> assert username and password <EOL> if basic or not challenge : <EOL> assert not digest <EOL> userpass = "<STR_LIT>" % ( username . strip ( ) , password . strip ( ) ) <EOL> return "<STR_LIT>" % userpass . encode ( '<STR_LIT>' ) . strip ( ) <EOL> assert challenge and not basic <EOL> path = path or "<STR_LIT:/>" <EOL> ( _ , realm ) = challenge . split ( '<STR_LIT>' ) <EOL> ( realm , _ ) = realm . split ( '<STR_LIT:">' , <NUM_LIT:1> ) <EOL> auth = AbstractDigestAuthHandler ( ) <EOL> auth . add_password ( realm , path , username , password ) <EOL> ( token , challenge ) = challenge . split ( '<STR_LIT:U+0020>' , <NUM_LIT:1> ) <EOL> chal = parse_keqv_list ( parse_http_list ( challenge ) ) <EOL> class FakeRequest ( object ) : <EOL> if six . PY3 : <EOL> @ property <EOL> def full_url ( self ) : <EOL> return path <EOL> selector = full_url <EOL> @ property <EOL> def data ( self ) : <EOL> return None <EOL> else : <EOL> def get_full_url ( self ) : <EOL> return path <EOL> get_selector = get_full_url <EOL> def has_data ( self ) : <EOL> return False <EOL> def get_method ( self ) : <EOL> return method or "<STR_LIT:GET>" <EOL> retval = "<STR_LIT>" % auth . get_authorization ( FakeRequest ( ) , chal ) <EOL> return ( retval , ) <EOL> _Authorization ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> for ( name , category , version , style , comment ) in ( ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> , ( "<STR_LIT>" , '<STR_LIT>' , '<STR_LIT:1.0>' , '<STR_LIT>' , '<STR_LIT>' ) ) : <EOL> klass = { '<STR_LIT>' : _MultiValueHeader , <EOL> '<STR_LIT>' : _MultiEntryHeader , <EOL> '<STR_LIT>' : _DateHeader , <EOL> '<STR_LIT>' : _SingleValueHeader } [ style ] <EOL> klass ( name , category , comment , version ) . __doc__ = comment <EOL> del klass <EOL> for head in _headers . values ( ) : <EOL> headname = head . name . replace ( "<STR_LIT:->" , "<STR_LIT:_>" ) . upper ( ) <EOL> locals ( ) [ headname ] = head <EOL> __all__ . append ( headname ) <EOL> __pudge_all__ = __all__ [ : ] <EOL> for _name , _obj in six . iteritems ( dict ( globals ( ) ) ) : <EOL> if isinstance ( _obj , type ) and issubclass ( _obj , HTTPHeader ) : <EOL> __pudge_all__ . append ( _name ) </s>
