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
def init_exporter ( extract_images , execute , ** exporter_config ) : config = Config ( InteractExporter = exporter_config ) preprocessors = [ ] if extract_images : preprocessors . append ( 'nbconvert.preprocessors.ExtractOutputPreprocessor' ) if execute : preprocessors . append ( 'nbinteract.preprocessors.NbiExecutePreprocessor' ) config . InteractExporter . preprocessors = preprocessors exporter = InteractExporter ( config = config ) return exporter
Returns an initialized exporter.