<commit_before><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Results - {{ project }} - pyspider</title>
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <meta name="description" content="results of {{ project }}">
    <meta name="author" content="binux">
    <link href="{{ url_for('cdn', path='twitter-bootstrap/3.1.1/css/bootstrap.min.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='result.css') }}" rel="stylesheet">

    <script src="{{ url_for('cdn', path='jquery/1.11.0/jquery.min.js') }}"></script>
    <script src="{{ url_for('cdn', path='twitter-bootstrap/3.1.1/js/bootstrap.min.js') }}"></script>
  </head>

  <body>
    <div class="top-bar">
      <h1>{{ project }} - Results</h1>
      <div class="btn-group">
        <a href="/results/dump/{{ project }}.json"
          target="_blank" class="btn btn-default btn-sm">
          <span class="glyphicon glyphicon-download-alt"></span>
          JSON</a>
        <a href="/results/dump/{{ project }}.txt"
          target="_blank" class="btn btn-default btn-sm">URL-JSON</a>
        <a href="/results/dump/{{ project }}.csv"
          target="_blank" class="btn btn-default btn-sm">CSV</a>
      </div>
    </div>
    # set common_fields, results = result_formater(results)
    <table class="table table-condensed table-striped">
      <thead>
        <th>url</th>
        <th></th>
        # for field in common_fields|sort
        <th>
          {{ field }}
        </th>
        # endfor
        <th>
          ...
        </th>
      </thead>
      <tbody>
        # for result in results
        <tr>
          <td>
            <a class=url href="/task/{{ project }}:{{ result.taskid }}" target=_blank>{{ result.url }}</a>
          </td>
          <td>
            <a class=open-url href="{{ result.url }}" target="_blank"><span class="glyphicon glyphicon-new-window"></span></a>
          </td>
          # for field in common_fields|sort
          <td>{{ json.dumps(result.result_formated[field], ensure_ascii=False)[:100] }}</td>
          # endfor
          <td>
            {{ json.dumps(result.others, ensure_ascii=False)[:100] }}
          </td>
        # endfor
      </tbody>
    </table><commit_msg>change string slice to truncate<commit_after><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Results - {{ project }} - pyspider</title>
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <meta name="description" content="results of {{ project }}">
    <meta name="author" content="binux">
    <link href="{{ url_for('cdn', path='twitter-bootstrap/3.1.1/css/bootstrap.min.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='result.css') }}" rel="stylesheet">

    <script src="{{ url_for('cdn', path='jquery/1.11.0/jquery.min.js') }}"></script>
    <script src="{{ url_for('cdn', path='twitter-bootstrap/3.1.1/js/bootstrap.min.js') }}"></script>
  </head>

  <body>
    <div class="top-bar">
      <h1>{{ project }} - Results</h1>
      <div class="btn-group">
        <a href="/results/dump/{{ project }}.json"
          target="_blank" class="btn btn-default btn-sm">
          <span class="glyphicon glyphicon-download-alt"></span>
          JSON</a>
        <a href="/results/dump/{{ project }}.txt"
          target="_blank" class="btn btn-default btn-sm">URL-JSON</a>
        <a href="/results/dump/{{ project }}.csv"
          target="_blank" class="btn btn-default btn-sm">CSV</a>
      </div>
    </div>
    # set common_fields, results = result_formater(results)
    <table class="table table-condensed table-striped">
      <thead>
        <th>url</th>
        <th></th>
        # for field in common_fields|sort
        <th>
          {{ field }}
        </th>
        # endfor
        <th>
          ...
        </th>
      </thead>
      <tbody>
        # for result in results
        <tr>
          <td>
            <a class=url href="/task/{{ project }}:{{ result.taskid }}" target=_blank>{{ result.url }}</a>
          </td>
          <td>
            <a class=open-url href="{{ result.url }}" target="_blank"><span class="glyphicon glyphicon-new-window"></span></a>
          </td>
          # for field in common_fields|sort
          <td>{{ json.dumps(result.result_formated[field], ensure_ascii=False) | truncate(100, True) }}</td>
          # endfor
          <td>
            {{ json.dumps(result.others, ensure_ascii=False) | truncate(100, True) }}
          </td>
        # endfor
      </tbody>
    </table>
{'fraction_non_alphanumeric': 0.19940094137783482, 'fraction_numerical': 0.009413778348309799, 'mean_word_length': 2.303886925795053, 'pattern_counts': {'":': 0, '<': 129, '<?xml version=': 0, '>': 129, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5883289', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1508, 'n_words': 301}