def METHOD_NAME(config_file):
    with open(config_file, 'r') as handle:
        config = yaml.safe_load(handle.read())
    templates_directory = os.path.normpath(
        os.path.join(os.path.dirname(config_file), config['templates'])
    )
    environment = jinja2.Environment(
        variable_start_string='[%',
        variable_end_string='%]'
    )
    environment.filters['collection'] = collection_filter
    environment.filters['pad'] = pad_filter
    templates = {}
    subtests = {}
    for template_name, path in find_templates(templates_directory):
        subtests[template_name] = []
        with open(path, 'r') as handle:
            templates[template_name] = environment.from_string(handle.read())
    for case in config['cases']:
        unused_templates = set(templates) - set(case['template_axes'])
        # This warning is intended to help authors avoid mistakenly omitting
        # templates. It can be silenced by extending the`template_axes`
        # dictionary with an empty list for templates which are intentionally
        # unused.
        if unused_templates:
            print(
                'Warning: case does not reference the following templates:'
            )
            print('\n'.join('- {}'.format(name) for name in unused_templates))
        common_axis = product(
            case['common_axis'], [case.get('all_subtests', {})]
        )
        for template_name, template_axis in case['template_axes'].items():
            subtests[template_name].extend(product(common_axis, template_axis))
    for template_name, template in templates.items():
        provenance = make_provenance(
            PROJECT_ROOT,
            config_file,
            os.path.join(templates_directory, template_name)
        )
        get_filename = lambda subtest: test_name(
            config['output_directory'],
            template_name,
            subtest['filename_flags']
        )
        subtests_by_filename = itertools.groupby(
            sorted(subtests[template_name], key=get_filename),
            key=get_filename
        )
        for filename, some_subtests in subtests_by_filename:
            with open(filename, 'w') as handle:
                handle.write(templates[template_name].render(
                    subtests=list(some_subtests),
                    provenance=provenance
                ) + '\n')