code: def _lookup_module(modmap, name, obj, main_module):
      """lookup name or id of obj if module is imported"""
      for modobj, modname in modmap.by_name[name]:
          if modobj is obj and sys.modules[modname] is not main_module:
              return modname, name
      __module__ = getattr(obj, "__module__", None)
      if isinstance(obj, IMPORTED_AS_TYPES) or (
          __module__ is not None
          and any(
              regex.fullmatch(__module__)
              for regex in IMPORTED_AS_MODULES
          )
      ):
          for modobj, objname, modname in modmap.by_id[id(obj)]:
              if sys.modules[modname] is not main_module:
                  return modname, objname
      return None, None
  
imports: import re
  import os
  import sys
  import warnings
  from dill import _dill, Pickler, Unpickler
  from ._dill import BuiltinMethodType, FunctionType, MethodType, ModuleType, TypeType, _import_module, _is_builtin_module, _is_imported_module, _main_module, _reverse_typemap, __builtin__
  from typing import Optional, Union
  import pathlib
  import tempfile
label_desc: Use image node_id 2 for calling a global function with example usage: _lookup_module(modmap, name, obj, main_module) and returns: None,  None, modname,  name, modname,  objname