code: def traverse_imports(names):
      """
      Walks over all the names imported in a dotted_as_names node.
      """
      pending = [names]
      while pending:
          node = pending.pop()
          if node.type == token.NAME:
              yield node.value
          elif node.type == syms.dotted_name:
              yield "".join([ch.value for ch in node.children])
          elif node.type == syms.dotted_as_name:
              pending.append(node.children[0])
          elif node.type == syms.dotted_as_names:
              pending.extend(node.children[::-2])
          else:
              raise AssertionError("unknown node type")
  
file_path: catboost/contrib/tools/python/src/Lib/lib2to3/fixes/fix_import.py
imports: from ..None import fixer_base
  from os.path import dirname, join, exists, sep
  from ..fixer_util import FromImport, syms, token
label_desc: Use image node_id 1 for calling a global function with example usage: traverse_imports(names) without return types