code: def FileEntryExistsByPathSpec(self, path_spec):
      
      location = getattr(path_spec, 'location', None)
  
      if (location is None or
          not location.startswith(self.LOCATION_ROOT)):
        return False
  
      if len(location) == 1:
        return True
  
      try:
        self._zip_file.getinfo(location[1:])
        return True
      except KeyError:
        pass
  
      # Check if location could be a virtual directory.
      for name in iter(self._zip_file.namelist()):
        # The ZIP info name does not have the leading path separator as
        # the location string does.
        if name.startswith(location[1:]):
          return True
  
      return False
docs: Determines if a file entry for a path specification exists.
  
      Args:
        path_spec (PathSpec): path specification of the file entry.
  
      Returns:
        bool: True if the file entry exists.