code: def GetFileEntryByPathSpec(self, path_spec):
      
      location = getattr(path_spec, 'location', None)
  
      if (location is None or
          not location.startswith(self.LOCATION_ROOT)):
        return None
  
      if len(location) == 1:
        return cpio_file_entry.CPIOFileEntry(
            self._resolver_context, self, path_spec, is_root=True,
            is_virtual=True)
  
      cpio_archive_file_entry = self._cpio_archive_file.GetFileEntryByPath(
          location[1:])
      if cpio_archive_file_entry is None:
        return None
  
      return cpio_file_entry.CPIOFileEntry(
          self._resolver_context, self, path_spec,
          cpio_archive_file_entry=cpio_archive_file_entry)
docs: Retrieves a file entry for a path specification.
  
      Args:
        path_spec (PathSpec): a path specification.
  
      Returns:
        CPIOFileEntry: a file entry or None if not available.