def METHOD_NAME(self, login_error=None, username=None):
    context = {
        "next": url_escape(self.get_argument('next', default='')),
        "username": username,
        "login_error": login_error,
        "login_url": self.settings['login_url'],
        "authenticator_login_url": url_concat(
            self.authenticator.login_url(self.hub.base_url),
            {
                'next': self.get_argument('next', ''),
            },
        ),
        "authenticator": self.authenticator,
        "xsrf": self.xsrf_token.decode('ascii'),
    }
    custom_html = Template(
        self.authenticator.get_custom_html(self.hub.base_url)
    ).render(**context)
    return self.render_template(
        'login.html',
        **context,
        custom_html=custom_html,
    )