<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ReleaseFileSystem(self, file_system):
 """Releases a cached file system object. Args: file_system (FileSystem):
 file system object. Returns: bool: True if the file system object can be closed. Raises: PathSpecError: if the path specification is incorrect. RuntimeError: if the file system object is not cached or an inconsistency is detected in the cache. """

    identifier, cache_value = self._file_system_cache.GetCacheValueByObject(
        file_system)

    if not identifier:
      raise RuntimeError('Object not cached.')

    if not cache_value:
      raise RuntimeError('Invalid cache value.')

    self._file_system_cache.ReleaseObject(identifier)

    result = cache_value.IsDereferenced()
    if result:
      self._file_system_cache.RemoveObject(identifier)

    return result