def on_before_transform_template(self, template_dict):
try:<EOL><INDENT>global_section = Globals(template_dict)<EOL><DEDENT>except InvalidGlobalsSectionException as ex:<EOL><INDENT>raise InvalidDocumentException([ex])<EOL><DEDENT>template = SamTemplate(template_dict)<EOL>for logicalId, resource in template.iterate():<EOL><INDENT>resource.properties = global_section.merge(resource.type, resource.properties)<EOL>template.set(logicalId, resource)<EOL><DEDENT>Globals.del_section(template_dict)<EOL>
Hook method that runs before a template gets transformed. In this method, we parse and process Globals section
from the template (if present).

:param dict template_dict: SAM template as a dictionary