code: def linkcode_resolve(domain, info):
      
      if domain != 'py':
          return None
  
      modname = info['module']
      fullname = info['fullname']
  
      submod = sys.modules.get(modname)
      if submod is None:
          return None
  
      obj = submod
      for part in fullname.split('.'):
          try:
              obj = getattr(obj, part)
          except:
              return None
      # try and sneak past a decorator
      try:
          obj = obj.im_func.func_closure[0].cell_contents
      except (AttributeError, TypeError):
          pass
  
      try:
          fn = inspect.getsourcefile(obj)
      except:
          fn = None
      if not fn:
          try:
              fn = inspect.getsourcefile(sys.modules[obj.__module__])
          except:
              fn = None
      if not fn:
          return None
  
      try:
          source, lineno = inspect.findsource(obj)
      except:
          lineno = None
  
      if lineno:
          linespec = "#L%d" % (lineno + 1)
      else:
          linespec = ""
  
      fn = os.path.relpath(fn, start=os.path.dirname(gwpy.__file__))
      if fn.startswith(os.path.pardir):
          return None
  
      return ("http://github.com/gwpy/gwpy/tree/%s/gwpy/%s%s"
              % (GWPY_VERSION['full-revisionid'], fn, linespec))
docs: Determine the URL corresponding to Python object
  
      This code is stolen with thanks from the scipy team.