code: def build_pattern(mapping=MAPPING):
      mod_list = " | ".join(
          ["module_name='%s'" % key for key in mapping]
      )
      bare_names = alternates(mapping.keys())
  
      yield """name_import=import_name< 'import' ((%s) |
                 multiple_imports=dotted_as_names< any* (%s) any* >) >
            """ % (
          mod_list,
          mod_list,
      )
      yield """import_from< 'from' (%s) 'import' ['(']
                ( any | import_as_name< any 'as' any > |
                  import_as_names< any* >)  [')'] >
            """ % mod_list
      yield """import_name< 'import' (dotted_as_name< (%s) 'as' any > |
                 multiple_imports=dotted_as_names<
                   any* dotted_as_name< (%s) 'as' any > any* >) >
            """ % (
          mod_list,
          mod_list,
      )
  
      # Find usages of module members in code e.g. thread.foo(bar)
      yield "power< bare_with_attr=(%s) trailer<'.' any > any* >" % bare_names
  
file_path: catboost/contrib/tools/python/src/Lib/lib2to3/fixes/fix_imports.py
imports: from ..None import fixer_base
  from ..fixer_util import Name, attr_chain
label_desc: Use image node_id 2 for calling a global function with example usage: build_pattern(mapping) without return types