def _parse(self, globals_dict):
globals = {}<EOL>if not isinstance(globals_dict, dict):<EOL><INDENT>raise InvalidGlobalsSectionException(self._KEYWORD,<EOL>"<STR_LIT>".format(self._KEYWORD))<EOL><DEDENT>for section_name, properties in globals_dict.items():<EOL><INDENT>resource_type = self._make_resource_type(section_name)<EOL>if resource_type not in self.supported_properties:<EOL><INDENT>raise InvalidGlobalsSectionException(self._KEYWORD,<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>.format(section=section_name,<EOL>supported=self.supported_resource_section_names))<EOL><DEDENT>if not isinstance(properties, dict):<EOL><INDENT>raise InvalidGlobalsSectionException(self._KEYWORD, "<STR_LIT>")<EOL><DEDENT>for key, value in properties.items():<EOL><INDENT>supported = self.supported_properties[resource_type]<EOL>if key not in supported:<EOL><INDENT>raise InvalidGlobalsSectionException(self._KEYWORD,<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>.format(key=key, section=section_name, supported=supported))<EOL><DEDENT><DEDENT>globals[resource_type] = GlobalProperties(properties)<EOL><DEDENT>return globals<EOL>
Takes a SAM template as input and parses the Globals section

:param globals_dict: Dictionary representation of the Globals section
:return: Processed globals dictionary which can be used to quickly identify properties to merge
:raises: InvalidResourceException if the input contains properties that we don't support