code: def _CreateOutputModule(self, options):
      
      formatter_mediator = formatters_mediator.FormatterMediator(
          data_location=self._data_location)
  
      try:
        formatter_mediator.SetPreferredLanguageIdentifier(
            self._preferred_language)
      except (KeyError, TypeError) as exception:
        raise RuntimeError(exception)
  
      mediator = output_mediator.OutputMediator(
          self._knowledge_base, formatter_mediator,
          preferred_encoding=self.preferred_encoding)
      mediator.SetTimezone(self._preferred_time_zone)
  
      try:
        output_module = output_manager.OutputManager.NewOutputModule(
            self._output_format, mediator)
  
      except (KeyError, ValueError) as exception:
        raise RuntimeError(
            'Unable to create output module with error: {0!s}'.format(
                exception))
  
      if output_manager.OutputManager.IsLinearOutputModule(self._output_format):
        output_file_object = open(self._output_filename, 'wb')
        output_writer = tools.FileObjectOutputWriter(output_file_object)
        output_module.SetOutputWriter(output_writer)
  
      helpers_manager.ArgumentHelperManager.ParseOptions(options, output_module)
  
      # Check if there are parameters that have not been defined and need to
      # in order for the output module to continue. Prompt user to supply
      # those that may be missing.
      missing_parameters = output_module.GetMissingArguments()
      while missing_parameters:
        for parameter in missing_parameters:
          value = self._PromptUserForInput(
              'Missing parameter {0:s} for output module'.format(parameter))
          if value is None:
            logger.warning(
                'Unable to set the missing parameter for: {0:s}'.format(
                    parameter))
            continue
  
          setattr(options, parameter, value)
  
        helpers_manager.ArgumentHelperManager.ParseOptions(
            options, output_module)
        missing_parameters = output_module.GetMissingArguments()
  
      return output_module
docs: Creates the output module.
  
      Args:
        options (argparse.Namespace): command line arguments.
  
      Returns:
        OutputModule: output module.
  
      Raises:
        RuntimeError: if the output module cannot be created.