def replace_keys_in_template(template_dict: dict, mapping: dict):
    """Replace the keys, values in `component.yaml` based on `mapping` dict"""

    # Sample mapping will be as below
    # { "implementation.container.image" : "image_name" }
    for nested_key, value in mapping.items():

        # parse through each nested key

        keys = nested_key.split(".")
        accessable = template_dict
        for k in keys[:-1]:
            accessable = accessable[k]
        accessable[keys[-1]] = value

    return template_dict