def _update_relative_paths(template_dict,<EOL>original_root,<EOL>new_root):
for resource_type, properties in template_dict.get("<STR_LIT>", {}).items():<EOL><INDENT>if resource_type not in _METADATA_WITH_LOCAL_PATHS:<EOL><INDENT>continue<EOL><DEDENT>for path_prop_name in _METADATA_WITH_LOCAL_PATHS[resource_type]:<EOL><INDENT>path = properties.get(path_prop_name)<EOL>updated_path = _resolve_relative_to(path, original_root, new_root)<EOL>if not updated_path:<EOL><INDENT>continue<EOL><DEDENT>properties[path_prop_name] = updated_path<EOL><DEDENT><DEDENT>for _, resource in template_dict.get("<STR_LIT>", {}).items():<EOL><INDENT>resource_type = resource.get("<STR_LIT>")<EOL>if resource_type not in _RESOURCES_WITH_LOCAL_PATHS:<EOL><INDENT>continue<EOL><DEDENT>for path_prop_name in _RESOURCES_WITH_LOCAL_PATHS[resource_type]:<EOL><INDENT>properties = resource.get("<STR_LIT>", {})<EOL>path = properties.get(path_prop_name)<EOL>updated_path = _resolve_relative_to(path, original_root, new_root)<EOL>if not updated_path:<EOL><INDENT>continue<EOL><DEDENT>properties[path_prop_name] = updated_path<EOL><DEDENT><DEDENT>template_dict = _update_aws_include_relative_path(template_dict, original_root, new_root)<EOL>return template_dict<EOL>
SAM/CloudFormation template can contain certain properties whose value is a relative path to a local file/folder.
This path is usually relative to the template's location. If the template is being moved from original location
``original_root`` to new location ``new_root``, use this method to update these paths to be
relative to ``new_root``.

After this method is complete, it is safe to write the template to ``new_root`` without
breaking any relative paths.

This methods updates resource properties supported by ``aws cloudformation package`` command:
https://docs.aws.amazon.com/cli/latest/reference/cloudformation/package.html

If a property is either an absolute path or a S3 URI, this method will not update them.


Parameters
----------
template_dict : dict
    Dictionary containing template contents. This dictionary will be updated & written to ``dest`` location.

original_root : str
    Path to the directory where all paths were originally set relative to. This is usually the directory
    containing the template originally

new_root : str
    Path to the new directory that all paths set relative to after this method completes.

Returns
-------
Updated dictionary