code: def _Open(self, path_spec=None, mode='rb'):
      
      if not path_spec:
        raise ValueError('Missing path specification.')
  
      data_stream = getattr(path_spec, 'data_stream', None)
  
      self._file_system = resolver.Resolver.OpenFileSystem(
          path_spec, resolver_context=self._resolver_context)
  
      file_entry = self._file_system.GetFileEntryByPathSpec(path_spec)
      if not file_entry:
        raise IOError('Unable to open file entry.')
  
      fsntfs_data_stream = None
      fsntfs_file_entry = file_entry.GetNTFSFileEntry()
      if not fsntfs_file_entry:
        raise IOError('Unable to open NTFS file entry.')
  
      if data_stream:
        fsntfs_data_stream = fsntfs_file_entry.get_alternate_data_stream_by_name(
            data_stream)
        if not fsntfs_data_stream:
          raise IOError('Unable to open data stream: {0:s}.'.format(
              data_stream))
  
      elif not fsntfs_file_entry.has_default_data_stream():
        raise IOError('Missing default data stream.')
  
      self._fsntfs_data_stream = fsntfs_data_stream
      self._fsntfs_file_entry = fsntfs_file_entry
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.