code: def linkcode_resolve(domain, info):
      if domain != "py" or not info["module"]:
          return None
  
      # Import the object from module path
      obj = _import_object_from_name(info["module"], info["fullname"])
  
      # If it's not defined in the internal module, return None.
      mod = inspect.getmodule(obj)
      if mod is None:
          return None
      if not mod.__name__.split(".")[0] in _top_modules:
          return None
  
      # If it's wrapped (e.g., by `contextlib.contextmanager`), unwrap it
      obj = inspect.unwrap(obj)
  
      # Get the source file name and line number at which obj is defined.
      try:
          filename = inspect.getsourcefile(obj)
      except TypeError:
          # obj is not a module, class, function, ..etc.
          return None
  
      def get_pyx_file(obj):
          filename = inspect.getfile(obj)
          for ext in importlib.machinery.EXTENSION_SUFFIXES:
              if filename.endswith(ext):
                  filename = filename[: -len(ext)] + ".pyx"
                  return filename
          else:
              return None
  
      # `cupy.ndarray` (aka. `cupy._core.core.ndarray`) has `__module__`
      # attribute overwritten and `inspect.getsourcefile` doesn't work on it,
      # so use `cupy._core.core`'s source location instead
      if obj is cupy.ndarray:
          filename = get_pyx_file(cupy._core.core)
          if filename is None:
              return None
          linenum = None
      # `inspect.getsourcefile` returns None for C-extension objects
      elif filename is None:
          filename = get_pyx_file(obj)
          if filename is None:
              return None
          linenum = None
      else:
          # Get the source line number
          _, linenum = inspect.getsourcelines(obj)
          assert isinstance(linenum, int)
  
      filename = os.path.realpath(filename)
      relpath = _get_source_relative_path(filename)
  
      fragment = "" if linenum is None else f"#L{linenum}"
      return (
          f"https://github.com/cupy/cupy/blob/{tag}/{relpath}{fragment}"
      )
  
file_path: cupy/docs/source/conf.py
imports: import importlib
  import inspect
  import os
  import sys
  import sphinx
  import cupy
  import _comparison_generator
label_desc: Use image node_id 4 for calling a global function with example usage: linkcode_resolve(domain, info) and returns: str, tag, str, relpath, fragment, None, None, None, None, None, None, filename, None