code: def path_to_cache_dir(path):
      
      d, p = os.path.splitdrive(os.path.abspath(path))
      if d:
          d = d.replace(':', '---')
      p = p.replace(os.sep, '--')
      return d + p + '.cache'
docs: Convert an absolute path to a directory name for use in a cache.
  
      The algorithm used is:
  
      #. On Windows, any ``':'`` in the drive is replaced with ``'---'``.
      #. Any occurrence of ``os.sep`` is replaced with ``'--'``.
      #. ``'.cache'`` is appended.