def METHOD_NAME(
    config_path,
    sdk_folder,
    project_pattern,
    readme,
    restapi_git_folder,
    autorest_bin=None,
    force_generation=False,
    python_tag=None,
):
    sdk_folder = Path(sdk_folder).expanduser()
    config = read_config(sdk_folder, config_path)
    global_conf = config["meta"]
    repotag = get_repo_tag_meta(global_conf)
    global_conf["autorest_options"] = solve_relative_path(global_conf.get("autorest_options", {}), sdk_folder)
    global_conf["envs"] = solve_relative_path(global_conf.get("envs", {}), sdk_folder)
    global_conf["advanced_options"] = solve_relative_path(global_conf.get("advanced_options", {}), sdk_folder)
    if python_tag:
        global_conf["autorest_options"]["tag"] = python_tag
    if restapi_git_folder:
        restapi_git_folder = Path(restapi_git_folder).expanduser()
    # Look for configuration in Readme
    if readme:
        swagger_files_in_pr = [readme]
    else:
        if not restapi_git_folder:
            raise ValueError("RestAPI folder must be set if you don't provide a readme.")
        swagger_files_in_pr = list(restapi_git_folder.glob("specification/**/readme.md"))
    _LOGGER.info(f"Readme files: {swagger_files_in_pr}")
    extract_conf_from_readmes(
        swagger_files_in_pr,
        restapi_git_folder,
        repotag,
        config,
        force_generation=force_generation,
    )
    with tempfile.TemporaryDirectory() as temp_dir:
        for project, local_conf in config.get("projects", {}).items():
            if readme:
                if str(readme) not in project:
                    _LOGGER.info("Skip project %s (readme was %s)", project, readme)
                    continue
            else:
                if project_pattern and not any(p in project for p in project_pattern):
                    _LOGGER.info("Skip project %s", project)
                    continue
            local_conf["autorest_options"] = solve_relative_path(local_conf.get("autorest_options", {}), sdk_folder)
            if readme and readme.startswith("http"):
                # Simplify here, do not support anything else than Readme.md
                absolute_markdown_path = readme
                _LOGGER.info(f"HTTP Markdown input: {absolute_markdown_path}")
            else:
                markdown_relative_path, optional_relative_paths = get_input_paths(global_conf, local_conf)
                _LOGGER.info(f"Markdown input: {markdown_relative_path}")
                _LOGGER.info(f"Optional inputs: {optional_relative_paths}")
                absolute_markdown_path = None
                if markdown_relative_path:
                    absolute_markdown_path = Path(restapi_git_folder or "", markdown_relative_path).resolve()
                if optional_relative_paths:
                    local_conf.setdefault("autorest_options", {})["input-file"] = [
                        Path(restapi_git_folder or "", input_path).resolve() for input_path in optional_relative_paths
                    ]
            build_project(
                temp_dir,
                project,
                absolute_markdown_path,
                sdk_folder,
                global_conf,
                local_conf,
                autorest_bin,
            )
    return config