code: def ParseFileObject(self, parser_mediator, file_object):
      
      encoding = self._ENCODING or parser_mediator.codepage
      text_file_object = text_file.TextFile(file_object, encoding=encoding)
      if not self._ParseAndValidateRecord(parser_mediator, text_file_object):
        raise errors.UnableToParseFile(
            'Unable to parse as Opera global_history.dat.')
  
      while self._ParseRecord(parser_mediator, text_file_object):
        pass
docs: Parses an Opera global history file-like object.
  
      Args:
        parser_mediator (ParserMediator): mediates interactions between parsers
            and other components, such as storage and dfvfs.
        file_object (dfvfs.FileIO): file-like object.
  
      Raises:
        UnableToParseFile: when the file cannot be parsed.