def _iter_code(code):
 from array import array
 from dis import HAVE_ARGUMENT, EXTENDED_ARG
 bytes = array('b', code.co_code)
 eof = len(code.co_code)
 ptr = 0
 extended_arg = 0
 while (ptr < eof):
  op = bytes[ptr]
  if (op >= HAVE_ARGUMENT):
   arg = ((bytes[(ptr + 1)] + (bytes[(ptr + 2)] * 256)) + extended_arg)
   ptr += 3
   if (op == EXTENDED_ARG):
    extended_arg = (arg * long_type(65536))
    continue
  else:
   arg = None
   ptr += 1
  (yield (op, arg))

def _iter_code ( code ) : from array import array from dis import HAVE_ARGUMENT , EXTENDED_ARG bytes = array ( 'b' , code . co_code ) eof = len ( code . co_code ) ptr = 0 extended_arg = 0 while ( ptr < eof ) : op = bytes [ ptr ] if ( op >= HAVE_ARGUMENT ) : arg = ( ( bytes [ ( ptr + 1 ) ] + ( bytes [ ( ptr + 2 ) ] * 256 ) ) + extended_arg ) ptr += 3 if ( op == EXTENDED_ARG ) : extended_arg = ( arg * long_type ( 65536 ) ) continue else : arg = None ptr += 1 ( yield ( op , arg ) )
yield pair for each operation in code object code .