code: def _realpath(path):
      
      # there is a bug in cygwin for os.path.abspath() for abs paths
      if sys.platform == 'cygwin':
          if path[1:3] == ':\\':
              return path
          elif path[1:3] == ':/':
              path = "/cygdrive/" + path[0] + path[2:]
          return os.path.abspath(os.path.expanduser(path))
      return os.path.realpath(os.path.abspath(os.path.expanduser(path)))
docs: Return the real path of `path`
  
      Is equivalent to ``realpath(abspath(expanduser(path)))``.
  
      Of the particular notice is the hack dealing with the unfortunate
      sitaution of running native-Windows python (os.name == 'nt') inside
      of Cygwin (abspath starts with '/'), which apparently normal
      os.path.realpath completely messes up.