def get_file_url(object):
 filename = inspect.getsourcefile(object)
 lines = inspect.getsourcelines(object)
 uri = (u'file://%s#L%d' % (filename, lines[1]))
 if is_git_repo():
  info = nipype.get_info()
  shortfile = os.path.join(u'nipype', filename.split(u'nipype/')[(-1)])
  uri = (u'http://github.com/nipy/nipype/tree/%s/%s#L%d' % (info[u'commit_hash'], shortfile, lines[1]))
 return uri

def get_file_url ( object ) : filename = inspect . getsourcefile ( object ) lines = inspect . getsourcelines ( object ) uri = ( u'file://%s#L%d' % ( filename , lines [ 1 ] ) ) if is_git_repo ( ) : info = nipype . get_info ( ) shortfile = os . path . join ( u'nipype' , filename . split ( u'nipype/' ) [ ( - 1 ) ] ) uri = ( u'http://github.com/nipy/nipype/tree/%s/%s#L%d' % ( info [ u'commit_hash' ] , shortfile , lines [ 1 ] ) ) return uri
returns local or remote url for an object .