<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def inject(self, state, response):
 """ Inject Debug Toolbar code to response body. """

        html = yield from self.app.ps.jinja2.render(
            'debugtoolbar/inject.html',
            static_path=self.cfg.prefix + 'static',
            toolbar_url=self.cfg.prefix + state.id,
        )
        html = html.encode(state.request.charset or 'utf-8')
        response.body = RE_BODY.sub(html + b'</body>', response.body)
        return response