def _ensure_compiled(self, limited: bool=False, strict: bool=False) -> jinja2.Template:
    'Bind a template to a specific hass instance.'
    self.ensure_valid()
    assert (self.hass is not None), 'hass variable not set on template'
    assert ((self._limited is None) or (self._limited == limited)), "can't change between limited and non limited template"
    assert ((self._strict is None) or (self._strict == strict)), "can't change between strict and non strict template"
    assert (not (strict and limited)), "can't combine strict and limited template"
    self._limited = limited
    self._strict = strict
    env = self._env
    self._compiled = cast(jinja2.Template, jinja2.Template.from_code(env, self._compiled_code, env.globals, None))
    return self._compiled
Bind a template to a specific hass instance.
def _ensure_compiled(self, limited: bool=False, strict: bool=False) -> jinja2.Template:
    
    self.ensure_valid()
    assert (self.hass is not None), 'hass variable not set on template'
    assert ((self._limited is None) or (self._limited == limited)), "can't change between limited and non limited template"
    assert ((self._strict is None) or (self._strict == strict)), "can't change between strict and non strict template"
    assert (not (strict and limited)), "can't combine strict and limited template"
    self._limited = limited
    self._strict = strict
    env = self._env
    self._compiled = cast(jinja2.Template, jinja2.Template.from_code(env, self._compiled_code, env.globals, None))
    return self._compiled