def METHOD_NAME(code):
  """A lightweight parser.  Does some of what disassemble() does.
  """
  n = len(code)
  i = 0
  extended_arg = 0
  while i < n:
      c = code[i]
      op = ord(c)
      i += 1
      if op >= dis.HAVE_ARGUMENT:
          oparg = ord(code[i]) + ord(code[i+1])*256 + extended_arg
          extended_arg = 0
          i += 2
          if op == dis.EXTENDED_ARG:
              extended_arg = oparg*65536L
      yield dis.opname[op], oparg