def GetFileObject(self, data_stream_name=u''):
    """Retrieves the file-like object.

    Args:
      data_stream_name: optional data stream name. The default is
                        an empty string which represents the default
                        data stream.

    Returns:
      A file-like object (instance of file_io.FileIO) or None.

    Raises:
      IOError: if the file entry is not a file.
    """
    if not self.IsFile():
      raise IOError(u'Cannot open non-file.')

    if data_stream_name:
      return

    location = getattr(self.path_spec, u'location', None)
    if location is None:
      return

    file_data = self._file_system.GetDataByPath(location)
    file_object = fake_file_io.FakeFile(self._resolver_context, file_data)
    file_object.open(path_spec=self.path_spec)
    return file_object
dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/vfs/fake_file_entry.py/FakeFileEntry.GetFileObject/original