parameters: (path, start)
return_statement: return posixpath.join(*rel_list)
docstring: Return a relative version of a path
docstring_summary: Return a relative version of a path
docstring_tokens: Return a relative version of a path
function: def relpath(path, start):
      """Return a relative version of a path"""
  
      import posixpath
      if not path:
          raise ValueError("no path specified")
      start_list = posixpath.abspath(start).split(posixpath.sep)
      path_list = posixpath.abspath(path).split(posixpath.sep)
      # Work out how much of the filepath is shared by start and path.
      i = len(posixpath.commonprefix([start_list, path_list]))
      rel_list = [posixpath.pardir] * (len(start_list)-i) + path_list[i:]
      if not rel_list:
          return posixpath.curdir
      return posixpath.join(*rel_list)
function_tokens: def relpath ( path , start ) : import posixpath if not path : raise ValueError ( "no path specified" ) start_list = posixpath . abspath ( start ) . split ( posixpath . sep ) path_list = posixpath . abspath ( path ) . split ( posixpath . sep ) # Work out how much of the filepath is shared by start and path. i = len ( posixpath . commonprefix ( [ start_list , path_list ] ) ) rel_list = [ posixpath . pardir ] * ( len ( start_list ) - i ) + path_list [ i : ] if not rel_list : return posixpath . curdir return posixpath . join ( * rel_list )