code: def Close(self):
      
      if not self._is_open:
        raise IOError('Not opened.')
  
      if not self._is_cached:
        close_file_system = True
      elif self._resolver_context.ReleaseFileSystem(self):
        self._is_cached = False
        close_file_system = True
      else:
        close_file_system = False
  
      if close_file_system:
        self._Close()
        self._is_open = False
        self._path_spec = None
docs: Closes the file system.
  
      Raises:
        IOError: if the file system object was not opened or the close failed.
        OSError: if the file system object was not opened or the close failed.