docs: def init_exporter(extract_images, execute, **exporter_config):
      """
      Returns an initialized exporter.
      """
      config = Config(InteractExporter=exporter_config)
  
      preprocessors = []
      if extract_images:
          # Use ExtractOutputPreprocessor to extract the images to separate files
          preprocessors.append(
              'nbconvert.preprocessors.ExtractOutputPreprocessor'
          )
      if execute:
          # Use the NbiExecutePreprocessor to correctly generate widget output
          # for interact() calls.
          preprocessors.append('nbinteract.preprocessors.NbiExecutePreprocessor')
  
      config.InteractExporter.preprocessors = preprocessors
  
      exporter = InteractExporter(config=config)
      return exporter