<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def require_resource(self, type: Type[T_Resource], name: str = 'default') -> T_Resource: """ Look up a resource in the chain of contexts and raise an exception if it is not found. This is like :meth:`get_resource` except that instead of returning ``None`` when a resource is not found, it will raise :exc:`~asphalt.core.context.ResourceNotFound`. :param type: type of the requested resource :param name: name of the requested resource :return: the requested resource :raises asphalt.core.context.ResourceNotFound: if a resource of the given type and name was not found """

        resource = self.get_resource(type, name)
        if resource is None:
            raise ResourceNotFound(type, name)

        return resource