code: def scan_code_imports(co):
      
      opit = iter_opcodes(co)
      opit, opit2, opit3 = itertools.tee(opit, 3)
  
      try:
          next(opit2)
          next(opit3)
          next(opit3)
      except StopIteration:
          return
  
      if sys.version_info >= (2, 5):
          for oparg1, oparg2, (op3, arg3) in izip(opit, opit2, opit3):
              if op3 == IMPORT_NAME:
                  op2, arg2 = oparg2
                  op1, arg1 = oparg1
                  if op1 == op2 == LOAD_CONST:
                      yield (co.co_consts[arg1],
                             co.co_names[arg3],
                             co.co_consts[arg2] or ())
      else:
          # Python 2.4 did not yet have 'level', so stack format differs.
          for oparg1, (op2, arg2) in izip(opit, opit2):
              if op2 == IMPORT_NAME:
                  op1, arg1 = oparg1
                  if op1 == LOAD_CONST:
                      yield (-1, co.co_names[arg2], co.co_consts[arg1] or ())
docs: Given a code object `co`, scan its bytecode yielding any ``IMPORT_NAME``
      and associated prior ``LOAD_CONST`` instructions representing an `Import`
      statement or `ImportFrom` statement.
  
      :return:
          Generator producing `(level, modname, namelist)` tuples, where:
  
          * `level`: -1 for normal import, 0, for absolute import, and >0 for
            relative import.
          * `modname`: Name of module to import, or from where `namelist` names
            are imported.
          * `namelist`: for `ImportFrom`, the list of names to be imported from
            `modname`.