<s> """<STR_LIT>""" <EOL> import sys <EOL> try : <EOL> from urllib . parse import quote <EOL> except ImportError : <EOL> from urllib import quote <EOL> PYTHON3 = True if sys . version_info > ( <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:0> ) else False <EOL> def is_string ( value ) : <EOL> """<STR_LIT>""" <EOL> checks = [ isinstance ( value , t ) for t in [ bytes , str ] ] <EOL> if not PYTHON3 : <EOL> checks . append ( isinstance ( value , unicode ) ) <EOL> return any ( checks ) <EOL> def maybe_encode ( value ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return value . encode ( '<STR_LIT:utf-8>' ) <EOL> except AttributeError : <EOL> return value </s>
