<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(self):
 """Parse the whole template into a `Template` node."""

        result = nodes.Template(self.subparse(), lineno=1)
        result.set_environment(self.environment)
        return result