def METHOD_NAME(
    yaml_data: Dict[str, Any],
    app_names: Set[str],
    extension: "Extension",
) -> None:
    # Apply the root components of the extension (if any)
    root_extension = extension.get_root_snippet()
    for property_name, property_value in root_extension.items():
        yaml_data[property_name] = _apply_extension_property(
            yaml_data.get(property_name), property_value
        )
    # Apply the app-specific components of the extension (if any)
    app_extension = extension.get_app_snippet()
    for app_name in app_names:
        app_definition = yaml_data["apps"][app_name]
        for property_name, property_value in app_extension.items():
            app_definition[property_name] = _apply_extension_property(
                app_definition.get(property_name), property_value
            )
    # Next, apply the part-specific components, this can be plugin
    # aware.
    parts = yaml_data["parts"]
    for _, part_definition in parts.items():
        part_extension = extension.get_part_snippet(
            plugin_name=part_definition["plugin"]
        )
        for property_name, property_value in part_extension.items():
            part_definition[property_name] = _apply_extension_property(
                part_definition.get(property_name), property_value
            )
    # Finally, add any parts specified in the extension
    for part_name, part_definition in extension.get_parts_snippet().items():
        parts[part_name] = part_definition