parameters: (path, start=curdir)
return_statement: return 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=curdir):
      """Return a relative version of a path"""
  
      if not path:
          raise ValueError("no path specified")
  
      start_list = [x for x in abspath(start).split(sep) if x]
      path_list = [x for x in abspath(path).split(sep) if x]
  
      # Work out how much of the filepath is shared by start and path.
      i = len(commonprefix([start_list, path_list]))
  
      rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
      if not rel_list:
          return curdir
      return join(*rel_list)
function_tokens: def relpath ( path , start = curdir ) : if not path : raise ValueError ( "no path specified" ) start_list = [ x for x in abspath ( start ) . split ( sep ) if x ] path_list = [ x for x in abspath ( path ) . split ( sep ) if x ] # Work out how much of the filepath is shared by start and path. i = len ( commonprefix ( [ start_list , path_list ] ) ) rel_list = [ pardir ] * ( len ( start_list ) - i ) + path_list [ i : ] if not rel_list : return curdir return join ( * rel_list )