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:
  fn = inspect.getsourcefile(obj)
 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 = relpath(fn, start='../')
 return '{}/blob/{}/{}{}'.format(GITHUB_URL, code_branch, fn, linespec)

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 : fn = inspect . getsourcefile ( obj ) 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 = relpath ( fn , start = '../' ) return '{}/blob/{}/{}{}' . format ( GITHUB_URL , code_branch , fn , linespec )
determine the url corresponding to python object .