code: def get_app_metadata(template_dict):
      
      if SERVERLESS_REPO_APPLICATION in template_dict.get(METADATA, {}):
          app_metadata_dict = template_dict.get(METADATA).get(SERVERLESS_REPO_APPLICATION)
          return ApplicationMetadata(app_metadata_dict)
  
      raise ApplicationMetadataNotFoundError(
          error_message='missing {} section in template Metadata'.format(SERVERLESS_REPO_APPLICATION))
docs: Get the application metadata from a SAM template.
  
      :param template_dict: SAM template as a dictionary
      :type template_dict: dict
      :return: Application metadata as defined in the template
      :rtype: ApplicationMetadata
      :raises ApplicationMetadataNotFoundError