<s> """<STR_LIT>""" <EOL> import os , re , sys <EOL> try : <EOL> set = set <EOL> except NameError : <EOL> from sets import Set as set <EOL> try : <EOL> sorted = sorted <EOL> except NameError : <EOL> def sorted ( iterable ) : <EOL> """<STR_LIT>""" <EOL> lst = list ( iterable ) <EOL> lst . sort ( ) <EOL> return lst <EOL> try : <EOL> reversed = reversed <EOL> except NameError : <EOL> def reversed ( iterable ) : <EOL> """<STR_LIT>""" <EOL> lst = list ( iterable ) <EOL> return lst [ : : - <NUM_LIT:1> ] <EOL> try : <EOL> "<STR_LIT>" . rpartition <EOL> except AttributeError : <EOL> def rpartition ( s , sep ) : <EOL> """<STR_LIT>""" <EOL> i = s . rfind ( sep ) <EOL> if i == - <NUM_LIT:1> : <EOL> return ( '<STR_LIT>' , '<STR_LIT>' , s ) <EOL> else : <EOL> return ( s [ : i ] , sep , s [ i + len ( sep ) : ] ) <EOL> else : <EOL> def rpartition ( s , sep ) : <EOL> """<STR_LIT>""" <EOL> return s . rpartition ( sep ) <EOL> try : <EOL> from cStringIO import StringIO <EOL> BytesIO = StringIO <EOL> except ImportError : <EOL> from io import StringIO , BytesIO <EOL> try : <EOL> string_class = basestring <EOL> except NameError : <EOL> string_class = str <EOL> try : <EOL> import cPickle as pickle <EOL> except ImportError : <EOL> import pickle <EOL> try : <EOL> range = xrange <EOL> except NameError : <EOL> range = range <EOL> try : <EOL> { } . iteritems <EOL> except AttributeError : <EOL> def iitems ( d ) : <EOL> """<STR_LIT>""" <EOL> return d . items ( ) <EOL> else : <EOL> def iitems ( d ) : <EOL> """<STR_LIT>""" <EOL> return d . iteritems ( ) <EOL> if sys . version_info >= ( <NUM_LIT:3> , <NUM_LIT:0> ) : <EOL> def exec_code_object ( code , global_map ) : <EOL> """<STR_LIT>""" <EOL> exec ( code , global_map ) <EOL> else : <EOL> eval ( <EOL> compile ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" <EOL> ) <EOL> ) <EOL> if sys . version_info >= ( <NUM_LIT:3> , <NUM_LIT:0> ) : <EOL> import tokenize <EOL> try : <EOL> open_source = tokenize . open <EOL> except AttributeError : <EOL> from io import TextIOWrapper <EOL> detect_encoding = tokenize . detect_encoding <EOL> def open_source ( fname ) : <EOL> """<STR_LIT>""" <EOL> buffer = open ( fname , '<STR_LIT:rb>' ) <EOL> encoding , _ = detect_encoding ( buffer . readline ) <EOL> buffer . seek ( <NUM_LIT:0> ) <EOL> text = TextIOWrapper ( buffer , encoding , line_buffering = True ) <EOL> text . mode = '<STR_LIT:r>' <EOL> return text <EOL> else : <EOL> def open_source ( fname ) : <EOL> """<STR_LIT>""" <EOL> return open ( fname , "<STR_LIT>" ) <EOL> if sys . version_info >= ( <NUM_LIT:3> , <NUM_LIT:0> ) : <EOL> def to_bytes ( s ) : <EOL> """<STR_LIT>""" <EOL> return s . encode ( '<STR_LIT:utf8>' ) <EOL> def to_string ( b ) : <EOL> """<STR_LIT>""" <EOL> return b . decode ( '<STR_LIT:utf8>' ) <EOL> def binary_bytes ( byte_values ) : <EOL> """<STR_LIT>""" <EOL> return bytes ( byte_values ) <EOL> def byte_to_int ( byte_value ) : <EOL> """<STR_LIT>""" <EOL> return byte_value <EOL> def bytes_to_ints ( bytes_value ) : <EOL> """<STR_LIT>""" <EOL> return bytes_value <EOL> else : <EOL> def to_bytes ( s ) : <EOL> """<STR_LIT>""" <EOL> return s <EOL> def to_string ( b ) : <EOL> """<STR_LIT>""" <EOL> return b <EOL> def binary_bytes ( byte_values ) : <EOL> """<STR_LIT>""" <EOL> return "<STR_LIT>" . join ( [ chr ( b ) for b in byte_values ] ) <EOL> def byte_to_int ( byte_value ) : <EOL> """<STR_LIT>""" <EOL> return ord ( byte_value ) <EOL> def bytes_to_ints ( bytes_value ) : <EOL> """<STR_LIT>""" <EOL> for byte in bytes_value : <EOL> yield ord ( byte ) <EOL> try : <EOL> import hashlib <EOL> md5 = hashlib . md5 <EOL> except ImportError : <EOL> import md5 <EOL> md5 = md5 . new </s>
