code: def linkcode_resolve(domain, info):
      # Resolve function for the linkcode extension.
      # Stolen shamelessly from Lasagne! Thanks Lasagne!
      # https://github.com/Lasagne/Lasagne/blob/5d3c63cb315c50b1cbd27a6bc8664b406f34dd99/docs/conf.py#L114-L135
      def find_source():
          # try to find the file and line number, based on code from numpy:
          # https://github.com/numpy/numpy/blob/main/doc/source/conf.py#L286
          obj = sys.modules[info["module"]]
          for part in info["fullname"].split("."):
              obj = getattr(obj, part)
          import inspect
          import os
  
          fn = inspect.getsourcefile(obj)
          fn = os.path.relpath(
              fn, start=os.path.dirname(parlai.__file__)
          )
          source, lineno = inspect.getsourcelines(obj)
          return fn, lineno, lineno + len(source) - 1
  
      if domain != "py" or not info["module"]:
          return None
      try:
          filename = "parlai/%s#L%d-L%d" % find_source()
          tag = git.Git().rev_parse("HEAD")
          return (
              "https://github.com/facebookresearch/ParlAI/blob/%s/%s"
              % (tag, filename)
          )
      except Exception:
          return None
  
imports: import sys
  import git
  import sphinx_rtd_theme
  import parlai
label_desc: Use image node_id 1 for calling a global function with example usage: linkcode_resolve(domain, info) and returns: fn,  lineno,  unknown, None, unknown, None