<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def atlas_renderer(layout, coverage_layer, output_path, file_format):
 """Extract composition using atlas generation. :param layout: QGIS Print Layout object used for producing the report. :type layout: qgis.core.QgsPrintLayout :param coverage_layer: Coverage Layer used for atlas map. :type coverage_layer: QgsMapLayer :param output_path: The output path of the product. :type output_path: str :param file_format: File format of map output, 'pdf' or 'png'. :type file_format: str :return: Generated output path(s). :rtype: str, list """

    # set the composer map to be atlas driven
    composer_map = layout_item(
        layout, 'impact-map', QgsLayoutItemMap)
    composer_map.setAtlasDriven(True)
    composer_map.setAtlasScalingMode(QgsLayoutItemMap.Auto)

    # setup the atlas composition and composition atlas mode
    atlas_composition = layout.atlas()
    atlas_composition.setCoverageLayer(coverage_layer)
    atlas_on_single_file = layout.customProperty('singleFile', True)

    if file_format == QgisComposerComponentsMetadata.OutputFormat.PDF:
        if not atlas_composition.filenameExpression():
            atlas_composition.setFilenameExpression(
                "'output_'||@atlas_featurenumber")
        output_directory = os.path.dirname(output_path)

        # we need to set the predefined scales for atlas
        project_scales = []
        scales = QgsProject.instance().readListEntry(
            "Scales", "/ScalesList")[0]
        has_project_scales = QgsProject.instance().readBoolEntry(
            "Scales", "/useProjectScales")[0]
        if not has_project_scales or not scales:
            scales_string = str(general_setting("Map/scales", PROJECT_SCALES))
            scales = scales_string.split(',')
        for scale in scales:
            parts = scale.split(':')
            if len(parts) == 2:
                project_scales.append(float(parts[1]))
        layout.reportContext().setPredefinedScales(project_scales)

        settings = QgsLayoutExporter.PdfExportSettings()

        LOGGER.info('Exporting Atlas')
        atlas_output = []
        if atlas_on_single_file:
            res, error = QgsLayoutExporter.exportToPdf(
                atlas_composition, output_path, settings)
            atlas_output.append(output_path)
        else:
            res, error = QgsLayoutExporter.exportToPdfs(
                atlas_composition, output_directory, settings)

        if res != QgsLayoutExporter.Success:
            LOGGER.error(error)

        return atlas_output