code: def _Open(self, path_spec=None, mode='rb'):
      
      if not path_spec:
        raise ValueError('Missing path specfication.')
  
      volume_index = lvm.LVMPathSpecGetVolumeIndex(path_spec)
      if volume_index is None:
        raise errors.PathSpecError(
            'Unable to retrieve volume index from path specification.')
  
      self._file_system = resolver.Resolver.OpenFileSystem(
          path_spec, resolver_context=self._resolver_context)
      vslvm_volume_group = self._file_system.GetLVMVolumeGroup()
  
      if (volume_index < 0 or
          volume_index >= vslvm_volume_group.number_of_logical_volumes):
        raise errors.PathSpecError((
            'Unable to retrieve LVM logical volume index: {0:d} from path '
            'specification.').format(volume_index))
  
      self._vslvm_logical_volume = vslvm_volume_group.get_logical_volume(
          volume_index)
docs: Opens the file-like object defined by path specification.
  
      Args:
        path_spec (PathSpec): path specification.
        mode (Optional[str]): file access mode.
  
      Raises:
        AccessError: if the access to open the file was denied.
        IOError: if the file-like object could not be opened.
        OSError: if the file-like object could not be opened.
        PathSpecError: if the path specification is incorrect.
        ValueError: if the path specification is invalid.