<commit_before><%
from urllib import urlencode

came_from = request.params.get('came_from', '')
query_string = ''
if came_from:
    query_string = '?%s' % urlencode({'came_from': came_from.encode('utf-8')})
    
login_titleandtype = h.allowed_login_types()
if 'email+password' in login_titleandtype:
    field_question = _('What is your email address?')
    field_title = _('My email:')
    if 'username+password' in login_titleandtype:
        field_type = 'text'
    else:
        field_type = 'email'
else:
    field_question = _('What is your user name?')
    field_title = _('My user name:')
    field_type =  'text'
%>
<form class="login-alternate" name="login" method="POST" action="/perform_login">
  <form:error name="login"></form:error>
  <div class="login-alternate-question">
    ${field_question}
  </div>
  <label>${field_title}
    <input type="${field_type}" name="login" tabindex="1" autofocus="autofocus" required="required"/>
  </label>
  <div class="login-alternate-question">
    ${_('Do you have a password for %s?') % h.site.name()}
  </div>
  <label>
    <input type="radio" name="have_password" value="false" tabindex="3" />
    <span>${_('No, I do not have a password, or I forgot it.')}</span>
  </label>
  <label>
    <input type="radio" name="have_password" value="true" tabindex="3" /><commit_msg>Add CSRF token field in alternate login form<commit_after><%
from urllib import urlencode

came_from = request.params.get('came_from', '')
query_string = ''
if came_from:
    query_string = '?%s' % urlencode({'came_from': came_from.encode('utf-8')})
    
login_titleandtype = h.allowed_login_types()
if 'email+password' in login_titleandtype:
    field_question = _('What is your email address?')
    field_title = _('My email:')
    if 'username+password' in login_titleandtype:
        field_type = 'text'
    else:
        field_type = 'email'
else:
    field_question = _('What is your user name?')
    field_title = _('My user name:')
    field_type =  'text'
%>
<form class="login-alternate" name="login" method="POST" action="/perform_login">
  ${h.field_token()|n}

  <form:error name="login"></form:error>
  <div class="login-alternate-question">
    ${field_question}
  </div>
  <label>${field_title}
    <input type="${field_type}" name="login" tabindex="1" autofocus="autofocus" required="required"/>
  </label>
  <div class="login-alternate-question">
    ${_('Do you have a password for %s?') % h.site.name()}
  </div>
  <label>
    <input type="radio" name="have_password" value="false" tabindex="3" />
    <span>${_('No, I do not have a password, or I forgot it.')}</span>
  </label>
  <label>
    <input type="radio" name="have_password" value="true" tabindex="3" />
{'fraction_non_alphanumeric': 0.17299889339727037, 'fraction_numerical': 0.002950940612320177, 'mean_word_length': 4.413173652694611, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5447274', 'n_tokens_mistral': 937, 'n_tokens_neox': 930, 'n_words': 218}