<s> __all__ = [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' <EOL> ] <EOL> from IPython . core . error import UsageError <EOL> import code , struct <EOL> def hexstr ( s ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT:U+0020>' . join ( [ '<STR_LIT>' % ord ( b ) for b in s ] ) <EOL> def hexint ( s ) : <EOL> """<STR_LIT>""" <EOL> if s . startswith ( '<STR_LIT:_>' ) : <EOL> base = code . pad <EOL> else : <EOL> base = <NUM_LIT:0> <EOL> if s . endswith ( '<STR_LIT:_>' ) : <EOL> s += '<STR_LIT>' <EOL> return base + int ( s . replace ( '<STR_LIT:_>' , '<STR_LIT>' ) , <NUM_LIT:16> ) <EOL> def hexint_tuple ( s ) : <EOL> """<STR_LIT>""" <EOL> return tuple ( hexint ( i ) for i in s . split ( '<STR_LIT::>' ) ) <EOL> def hexint_aligned ( s ) : <EOL> """<STR_LIT>""" <EOL> i = hexint ( s ) <EOL> if i & <NUM_LIT:3> : <EOL> raise UsageError ( "<STR_LIT>" % i ) <EOL> return i <EOL> def pad_cdb ( cdb ) : <EOL> """<STR_LIT>""" <EOL> return ( cdb + chr ( <NUM_LIT:0> ) * <NUM_LIT:12> ) [ : <NUM_LIT:12> ] <EOL> def scsi_out ( d , cdb , data ) : <EOL> """<STR_LIT>""" <EOL> return d . scsi_out ( pad_cdb ( cdb ) , data ) <EOL> def scsi_in ( d , cdb , size = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> return d . scsi_in ( pad_cdb ( cdb ) , size ) <EOL> def scsi_read ( d , lba , blockcount = <NUM_LIT:1> ) : <EOL> cdb = struct . pack ( '<STR_LIT>' , <NUM_LIT> , <NUM_LIT:0> , lba , blockcount ) <EOL> return scsi_in ( d , cdb , blockcount * <NUM_LIT> ) <EOL> def get_signature ( d ) : <EOL> """<STR_LIT>""" <EOL> return d . get_signature ( ) <EOL> def peek ( d , address ) : <EOL> """<STR_LIT>""" <EOL> return d . peek ( address ) <EOL> def poke ( d , address , word ) : <EOL> """<STR_LIT>""" <EOL> return d . poke ( address , word ) ; <EOL> def peek_byte ( d , address ) : <EOL> """<STR_LIT>""" <EOL> return d . peek ( address ) <EOL> def poke_byte ( d , address , byte ) : <EOL> """<STR_LIT>""" <EOL> return d . poke ( address , byte ) ; <EOL> def blx ( d , address , r0 = <NUM_LIT:0> ) : <EOL> """<STR_LIT>""" <EOL> return d . blx ( address , r0 ) <EOL> def all_defines ( ) : <EOL> """<STR_LIT>""" <EOL> import shell_namespace <EOL> d = dict ( shell_namespace . __dict__ ) <EOL> d . update ( code . defines ) <EOL> return d <EOL> def all_includes ( ) : <EOL> """<STR_LIT>""" <EOL> return dict ( code . includes , <EOL> shell_builtins = '<STR_LIT>' ) </s>
