code: def ParseOptions(cls, options, output_module):
      
      if not isinstance(output_module, timesketch_out.TimesketchOutputModule):
        raise errors.BadConfigObject(
            'Output module is not an instance of TimesketchOutputModule')
  
      document_type = cls._ParseStringOption(
          options, 'document_type', default_value=cls._DEFAULT_DOCUMENT_TYPE)
      output_module.SetDocumentType(document_type)
  
      flush_interval = cls._ParseNumericOption(
          options, 'flush_interval', default_value=cls._DEFAULT_FLUSH_INTERVAL)
      output_module.SetFlushInterval(flush_interval)
  
      index = cls._ParseStringOption(
          options, 'index', default_value=cls._DEFAULT_UUID)
      output_module.SetIndexName(index)
  
      name = cls._ParseStringOption(
          options, 'timeline_name', default_value=cls._DEFAULT_NAME)
      output_module.SetTimelineName(name)
  
      username = cls._ParseStringOption(
          options, 'username', default_value=cls._DEFAULT_USERNAME)
      output_module.SetTimelineOwner(username)
docs: Parses and validates options.
  
      Args:
        options (argparse.Namespace): parser options.
        output_module (TimesketchOutputModule): output module to configure.
  
      Raises:
        BadConfigObject: when the output module object is of the wrong type.
        BadConfigOption: when a configuration parameter fails validation.