<s> """<STR_LIT>""" <EOL> from warnings import warnpy3k <EOL> warnpy3k ( "<STR_LIT>" , stacklevel = <NUM_LIT:2> ) <EOL> del warnpy3k <EOL> whitespace = '<STR_LIT>' <EOL> lowercase = '<STR_LIT>' <EOL> uppercase = '<STR_LIT>' <EOL> letters = lowercase + uppercase <EOL> digits = '<STR_LIT>' <EOL> hexdigits = digits + '<STR_LIT>' + '<STR_LIT>' <EOL> octdigits = '<STR_LIT>' <EOL> _idmap = '<STR_LIT>' <EOL> for i in range ( <NUM_LIT> ) : _idmap = _idmap + chr ( i ) <EOL> del i <EOL> index_error = ValueError <EOL> atoi_error = ValueError <EOL> atof_error = ValueError <EOL> atol_error = ValueError <EOL> def lower ( s ) : <EOL> """<STR_LIT>""" <EOL> return s . lower ( ) <EOL> def upper ( s ) : <EOL> """<STR_LIT>""" <EOL> return s . upper ( ) <EOL> def swapcase ( s ) : <EOL> """<STR_LIT>""" <EOL> return s . swapcase ( ) <EOL> def strip ( s ) : <EOL> """<STR_LIT>""" <EOL> return s . strip ( ) <EOL> def lstrip ( s ) : <EOL> """<STR_LIT>""" <EOL> return s . lstrip ( ) <EOL> def rstrip ( s ) : <EOL> """<STR_LIT>""" <EOL> return s . rstrip ( ) <EOL> def split ( s , sep = None , maxsplit = <NUM_LIT:0> ) : <EOL> """<STR_LIT>""" <EOL> return s . split ( sep , maxsplit ) <EOL> splitfields = split <EOL> def join ( words , sep = '<STR_LIT:U+0020>' ) : <EOL> """<STR_LIT>""" <EOL> return sep . join ( words ) <EOL> joinfields = join <EOL> _apply = apply <EOL> def index ( s , * args ) : <EOL> """<STR_LIT>""" <EOL> return _apply ( s . index , args ) <EOL> def rindex ( s , * args ) : <EOL> """<STR_LIT>""" <EOL> return _apply ( s . rindex , args ) <EOL> def count ( s , * args ) : <EOL> """<STR_LIT>""" <EOL> return _apply ( s . count , args ) <EOL> def find ( s , * args ) : <EOL> """<STR_LIT>""" <EOL> return _apply ( s . find , args ) <EOL> def rfind ( s , * args ) : <EOL> """<STR_LIT>""" <EOL> return _apply ( s . rfind , args ) <EOL> _float = float <EOL> _int = int <EOL> _long = long <EOL> _StringType = type ( '<STR_LIT>' ) <EOL> def atof ( s ) : <EOL> """<STR_LIT>""" <EOL> if type ( s ) == _StringType : <EOL> return _float ( s ) <EOL> else : <EOL> raise TypeError ( '<STR_LIT>' % <EOL> type ( s ) . __name__ ) <EOL> def atoi ( * args ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> s = args [ <NUM_LIT:0> ] <EOL> except IndexError : <EOL> raise TypeError ( '<STR_LIT>' % <EOL> len ( args ) ) <EOL> if type ( s ) == _StringType : <EOL> return _apply ( _int , args ) <EOL> else : <EOL> raise TypeError ( '<STR_LIT>' % <EOL> type ( s ) . __name__ ) <EOL> def atol ( * args ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> s = args [ <NUM_LIT:0> ] <EOL> except IndexError : <EOL> raise TypeError ( '<STR_LIT>' % <EOL> len ( args ) ) <EOL> if type ( s ) == _StringType : <EOL> return _apply ( _long , args ) <EOL> else : <EOL> raise TypeError ( '<STR_LIT>' % <EOL> type ( s ) . __name__ ) <EOL> def ljust ( s , width ) : <EOL> """<STR_LIT>""" <EOL> n = width - len ( s ) <EOL> if n <= <NUM_LIT:0> : return s <EOL> return s + '<STR_LIT:U+0020>' * n <EOL> def rjust ( s , width ) : <EOL> """<STR_LIT>""" <EOL> n = width - len ( s ) <EOL> if n <= <NUM_LIT:0> : return s <EOL> return '<STR_LIT:U+0020>' * n + s <EOL> def center ( s , width ) : <EOL> """<STR_LIT>""" <EOL> n = width - len ( s ) <EOL> if n <= <NUM_LIT:0> : return s <EOL> half = n / <NUM_LIT:2> <EOL> if n % <NUM_LIT:2> and width % <NUM_LIT:2> : <EOL> half = half + <NUM_LIT:1> <EOL> return '<STR_LIT:U+0020>' * half + s + '<STR_LIT:U+0020>' * ( n - half ) <EOL> def zfill ( x , width ) : <EOL> """<STR_LIT>""" <EOL> if type ( x ) == type ( '<STR_LIT>' ) : s = x <EOL> else : s = repr ( x ) <EOL> n = len ( s ) <EOL> if n >= width : return s <EOL> sign = '<STR_LIT>' <EOL> if s [ <NUM_LIT:0> ] in ( '<STR_LIT:->' , '<STR_LIT:+>' ) : <EOL> sign , s = s [ <NUM_LIT:0> ] , s [ <NUM_LIT:1> : ] <EOL> return sign + '<STR_LIT:0>' * ( width - n ) + s <EOL> def expandtabs ( s , tabsize = <NUM_LIT:8> ) : <EOL> """<STR_LIT>""" <EOL> res = line = '<STR_LIT>' <EOL> for c in s : <EOL> if c == '<STR_LIT:\t>' : <EOL> c = '<STR_LIT:U+0020>' * ( tabsize - len ( line ) % tabsize ) <EOL> line = line + c <EOL> if c == '<STR_LIT:\n>' : <EOL> res = res + line <EOL> line = '<STR_LIT>' <EOL> return res + line <EOL> def translate ( s , table , deletions = "<STR_LIT>" ) : <EOL> """<STR_LIT>""" <EOL> return s . translate ( table , deletions ) <EOL> def capitalize ( s ) : <EOL> """<STR_LIT>""" <EOL> return s . capitalize ( ) <EOL> def capwords ( s , sep = None ) : <EOL> """<STR_LIT>""" <EOL> return join ( map ( capitalize , s . split ( sep ) ) , sep or '<STR_LIT:U+0020>' ) <EOL> _idmapL = None <EOL> def maketrans ( fromstr , tostr ) : <EOL> """<STR_LIT>""" <EOL> if len ( fromstr ) != len ( tostr ) : <EOL> raise ValueError , "<STR_LIT>" <EOL> global _idmapL <EOL> if not _idmapL : <EOL> _idmapL = list ( _idmap ) <EOL> L = _idmapL [ : ] <EOL> fromstr = map ( ord , fromstr ) <EOL> for i in range ( len ( fromstr ) ) : <EOL> L [ fromstr [ i ] ] = tostr [ i ] <EOL> return join ( L , "<STR_LIT>" ) <EOL> def replace ( s , old , new , maxsplit = <NUM_LIT:0> ) : <EOL> """<STR_LIT>""" <EOL> return s . replace ( old , new , maxsplit ) <EOL> try : <EOL> '<STR_LIT>' . upper <EOL> except AttributeError : <EOL> from stringold import * <EOL> try : <EOL> from strop import maketrans , lowercase , uppercase , whitespace <EOL> letters = lowercase + uppercase <EOL> except ImportError : <EOL> pass </s>
