def render_login_result(framework_name, result):
reload_module(sys)<EOL>if six.PY2:<EOL><INDENT>sys.setdefaultencoding('<STR_LIT:utf-8>')<EOL><DEDENT>response = None<EOL>original_credentials = {}<EOL>refreshed_credentials = {}<EOL>if result:<EOL><INDENT>if result.user:<EOL><INDENT>result.user.update()<EOL>if result.user.credentials:<EOL><INDENT>original_credentials.update(result.user.credentials.__dict__)<EOL>time.sleep(<NUM_LIT:2>)<EOL>response = result.user.credentials.refresh(force=True)<EOL>refreshed_credentials.update(result.user.credentials.__dict__)<EOL><DEDENT><DEDENT>user_properties = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT:email>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT:id>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT:location>', '<STR_LIT:name>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT:username>']<EOL>access_token_content = None<EOL>if hasattr(result.provider, '<STR_LIT>'):<EOL><INDENT>access_token_content = result.provider.access_token_response.content  <EOL><DEDENT>template = env.get_template('<STR_LIT>')<EOL>return template.render(result=result,<EOL>providers=ASSEMBLED_CONFIG.values(),<EOL>oauth2_providers=OAUTH2_PROVIDERS,<EOL>oauth1_providers=OAUTH1_PROVIDERS,<EOL>openid_providers=OPENID_PROVIDERS,<EOL>user_properties=user_properties,<EOL>error=result.error,<EOL>credentials_response=response,<EOL>original_credentials=original_credentials,<EOL>refreshed_credentials=refreshed_credentials,<EOL>framework_name=framework_name,<EOL>access_token_content=access_token_content,<EOL>birth_date_format=BIRTH_DATE_FORMAT)<EOL><DEDENT>
Renders the login handler.

:param result:

    The :class:`.authomatic.core.LoginResult` returned by the
    :meth:`.authomatic.Authomatic.login` method.