code: def _GetPathSegmentSeparator(self, path):
      
      if path.startswith('\\') or path[1:].startswith(':\\'):
        return '\\'
  
      if path.startswith('/'):
        return '/'
  
      if '/' and '\\' in path:
        # Let's count slashes and guess which one is the right one.
        forward_count = len(path.split('/'))
        backward_count = len(path.split('\\'))
  
        if forward_count > backward_count:
          return '/'
  
        return '\\'
  
      # Now we are sure there is only one type of separators yet
      # the path does not start with one.
      if '/' in path:
        return '/'
  
      return '\\'
docs: Given a path give back the path separator as a best guess.
  
      Args:
        path (str): path.
  
      Returns:
        str: path segment separator.