code: def _linkcode_resolve(domain, info, url_fmt, revision):
      """Determine a link to online source for a class/method/function
  
      This is called by sphinx.ext.linkcode
  
      An example with a long-untouched module that everyone has
      >>> _linkcode_resolve('py', {'module': 'tty',
      ...                          'fullname': 'setraw'},
      ...                   package='tty',
      ...                   url_fmt='http://hg.python.org/cpython/file/'
      ...                           '{revision}/Lib/{package}/{path}#L{lineno}',
      ...                   revision='xxxx')
      'http://hg.python.org/cpython/file/xxxx/Lib/tty/tty.py#L18'
      """
  
      if revision is None:
          return
      if domain != "py":
          return
      if not info.get("module") or not info.get("fullname"):
          return
  
      class_name = info["fullname"].split(".")[0]
      module = __import__(info["module"], fromlist=[class_name])
      obj = attrgetter(info["fullname"])(module)
  
      # Unwrap the object to get the correct source
      # file in case that is wrapped by a decorator
      obj = inspect.unwrap(obj)
  
      fn: str = None
      lineno: str = None
  
      obj_module = inspect.getmodule(obj)
      if not obj_module:
          print(f"could not infer source code link for: {info}")
          return
      module_name = obj_module.__name__.split(".")[0]
  
      module_dir_dict = {
          "cugraph_dgl": "cugraph-dgl",
          "cugraph_pyg": "cugraph-pyg",
          "cugraph_service_client": "cugraph-service/client",
          "cugraph_service_server": "cugraph-service/server",
          "cugraph": "cugraph",
          "pylibcugraph": "pylibcugraph",
      }
      module_dir = module_dir_dict.get(module_name)
      if not module_dir:
          print(f"no source path directory set for {module_name}")
          return
  
      obj_path = "/".join(obj_module.__name__.split(".")[1:])
      obj_file_ext = obj_module.__file__.split(".")[-1]
      source_ext = "pyx" if obj_file_ext == "so" else "py"
      fn = f"{module_dir}/{module_name}/{obj_path}.{source_ext}"
  
      # Get the line number if we need it. (Can work without it)
      if lineno is None:
          try:
              lineno = inspect.getsourcelines(obj)[1]
          except Exception:
              # Can happen if its a cyfunction. See if it has `__code__`
              if hasattr(obj, "__code__"):
                  lineno = obj.__code__.co_firstlineno
              else:
                  lineno = ""
      return url_fmt.format(revision=revision, path=fn, lineno=lineno)
  
file_path: cugraph/docs/cugraph/source/sphinxext/github_link.py
imports: import inspect
  import re
  import subprocess
  from functools import partial
  from operator import attrgetter
label_desc: Use image node_id 3 for calling a global function with example usage: _linkcode_resolve(domain, info, url_fmt, revision) and returns: url_fmt