<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_by_name(self, name):
 """ Retrieve a template by it's name Args: name (str):
 Name of the template to retrieve Raises: LagoMissingTemplateError: if no template is found """

        try:
            spec = self._dom.get('templates', {})[name]
        except KeyError:
            raise LagoMissingTemplateError(name, self._path)

        return Template(
            name=name,
            versions={
                ver_name: TemplateVersion(
                    name='%s:%s:%s' % (self.name, name, ver_name),
                    source=self._providers[ver_spec['source']],
                    handle=ver_spec['handle'],
                    timestamp=ver_spec['timestamp'],
                )
                for ver_name, ver_spec in spec['versions'].items()
            },
        )