code: def relativize_path(path, base, os_sep=os.sep):
      '''
      Make absolute path relative to an absolute base.
  
      :param path: absolute path
      :type path: str
      :param base: absolute base path
      :type base: str
      :param os_sep: path component separator, defaults to current OS separator
      :type os_sep: str
      :return: relative path
      :rtype: str or unicode
      :raises OutsideDirectoryBase: if path is not below base
      '''
      if not check_base(path, base, os_sep):
          raise OutsideDirectoryBase("%r is not under %r" % (path, base))
      prefix_len = len(base)
      if not base.endswith(os_sep):
          prefix_len += len(os_sep)
      return path[prefix_len:f relativize_path(path, base, os_sep=os.sep):
      '''
      Make absolute path relative to an absolute base.
  
      :param path: absolute path
      :type path: str
      :param base: absolute base path
      :type base: str
      :param os_sep: path component separator, defaults to current OS separator
      :type os_sep: str
      :return: relative path
      :rtype: str or unicode
      :raises OutsideDirectoryBase: if path is not below base
      '''
      if not check_base(path, base, os_sep):
          raise OutsideDirectoryBase("%r is not under %r" % (path, base))
      prefix_len = len(base)
      if not base.endswith(os_sep):
          prefix_len += len(os_sep)
      return path[prefix_len:]
docs: Make absolute path relative to an absolute base.
  
      :param path: absolute path
      :type path: str
      :param base: absolute base path
      :type base: str
      :param os_sep: path component separator, defaults to current OS separator
      :type os_sep: str
      :return: relative path
      :rtype: str or unicode
      :raises OutsideDirectoryBase: if path is not below base