<commit_before><!DOCTYPE html>
<html lang="en" ng-app="Compass">
  <head>
    <meta charset="utf-8">
    <title>Compass</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Tor relay stats">
    <meta name="author" content="<NAME>">

    <!-- Le styles -->
    <link href="static/css/bootstrap.css" rel="stylesheet">
    <link href="static/lib/select2/select2.css" rel='stylesheet'>
    <link href="static/lib/angular-ui/angular-ui.min.css" rel="stylesheet">
    <link href="static/css/style.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
    </style>

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  </head>

  <body>

    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="/"><img src="static/img/compass-logo.jpg" /></a>
          <div class="nav-collapse">
            <ul class="nav">
              <li class="active"><a href="/">Home</a></li>
              <li><a href="https://trac.torproject.org/projects/tor/ticket/6498">Trac
              Ticket #6498</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container" ng-controller="CompassCtrl">
      <div class="hero-unit">
        <form class="form-horizontal" action=""
              method=get id="form">
          <fieldset>
            <legend>Compass</legend>
            <div class="control-group">
              <h3> Filter </h3>
              <label class="control-label" for="inactive">Inactive</label>
            <div class="controls">
              <label class="checkbox">
                <input type="checkbox" id="inactive" value="True" name="inactive" ng-model='inactive'>
                  include relays in selection that aren't currently running </label>
            </div>
            <label class="control-label" for="guards">Guards</label>
            <div class="controls">
              <label class="checkbox">
                <input type="checkbox" id="guards_only" value="True" name="guards_only" ng-model='guards_only'>
                 select only relays suitable for guard position
              </label>
            </div>
            <label class="control-label" for="exits_only">Exits</label>
            <div class="controls">
              <label class="checkbox">
                <input type="checkbox" id="exits_only" value="True" name="exits_only">
                  select only relays suitable for exit position</label>
            </div>
            <label class="control-label" for="family">Family</label>
              <div class="controls">
                <input type="text" class="input-xlarge" id="family" name="family"
                       placeholder="A59E1E7C7EAEE083D756EE1FF6EC31CA3D8651D7">
                  <span class="help-inline">Select family by fingerprint or nickname</span>
              </div>              
            <label class="control-label" for="asNo">AS Number</label>
              <div class="controls">
                <input type="text" class="input-xlarge" id="ases" name="ases"
                       placeholder="AS39138">
                  <span class="help-inline">select only relays from AS number</span>
              </div>              
            <label class="control-label" for="cc">Country Code</label>
              <div class="controls">
                <input type="text" class="input-xlarge" id="country" name="country"
                       placeholder="de">
                  <span class="help-inline">select only relays from country with code</span>
              </div>              
            </div>
            <label class="control-label" for="exits">Exits</label>
            <div class="controls">
              <label class="radio">
                <input type="radio" class="exits" name="exits" id="all_relays" value="all_relays" checked>
                  All relays
                </label>
                <label class="radio">
                  <input type="radio" class="exits" name="exits" id="fast_exits_only" value="fast_exits_only">
                    Fast exit relays (95+ Mbit/s, 5000+ KB/s,
                    80/443/554/1755, 2 relays per /24)
                  </label>
                <label class="radio">
                  <input type="radio" class="exits" name="exits" id="almost_fast_exits_only" value="almost_fast_exits_only">
                    Almost fast exit relays (80+ Mbit/s, 2000+ KB/s, 80/443, not in set of fast exits)
                  </label>
                <label class="radio">
                  <input type="radio" class="exits" name="exits" id="fast_exits_only_any_network" value="fast_exits_only_any_network">
                    Fast exits relays any network (95+ Mbit/s, 5000+ KB/s, 80/443/554/1755)
                  </label>
                </div>
            <div class="control-group">
              <h3> Group </h3>
              <label class="control-label" for="country">Country</label>
            <div class="controls">
              <label class="checkbox">
                <input type="checkbox" id="by_country" value="True" name="by_country">
                 group relays by country </label>
            </div>
              <label class="control-label" for="as">AS</label>
            <div class="controls">
                <input type="checkbox" id="by_as" value="True" name="by_as">
                 group relays by AS </label>
            </div>
            </div>

            <div class="control-group">
              <h3> Display </h3>
            <label class="control-label" for="top">Number of results</label>
              <div class="controls">
                <input type="text" class="input-xlarge" id="top" name="top"
                       placeholder="-1" value="-1">
                  <span class="help-inline">display only the top results (-1 for all)</span>
              </div>
            </div>
            <div class="form-actions">
            <button type="submit" class="btn btn-primary">Submit</button>
            <button class="btn" type=reset>Reset</button>
          </div>
          </fieldset>
        </form>
      </div>

      <div class="loading"><img src="{{ url_for('static', filename='img/loader.gif') }}" /></div>
      <hr>
      <div id="result" ></div>
      <table class="table table-striped">
      <thead>
      <tr>
      <th>#</th>
      <th><span rel="tooltip" title="Relative bandwidth weight assigned to this relay by the directory authorities">Consensus Weights</span></th>
      <th><span rel="tooltip" title="Relative advertised bandwidth of this relay compared to the total advertised bandwidth in the network">Advertised Bandwidth</span></th>
      <th><span rel="tooltip" title=" Probability of this relay to be selected for the guard position">Guard Probability</span></th>
      <th><span rel="tooltip" title="Probability of this relay to be selected for the middle position">Middle Probability</span></th>
      <th><span rel="tooltip" title="Probability of this relay to be selected for the exit position">Exit Probability</span></th>
      <th>Nickname</th>
      <th>Fingerprint</th>
      <th>Exit</th>
      <th>Guard</th>
      <th>Country</th>
      <th>Autonomous System</th>
      </tr>
      </thead>                                         
      <tbody>
      <tr ng-repeat="relay in relayResults.results">
        <td> [[ relay.index ]] </td>
        <td> [[ relay.cw ]] </td>
        <td> [[ relay.adv_bw]] </td>
        <td>[[ relay.p_guard ]]</td>
        <td>[[ relay.p_middle ]]</td>
        <td>[[ relay.p_exit ]]</td>
        <td>[[ relay.nick ]]</td>
        <!-- it's not a fingerprint -->
        {% if relay.fp|length != 40 %}
        <td>[[ relay.fp ]]</td>
        {% else %}
        <td><a href="https://atlas.torproject.org/#details/[[ relay.fp ]]">[[ relay.fp[:8] ]]</a></td>
        {% endif %}
        <td>[[ relay.exit ]]</td>
        <td>[[ relay.guard ]]</td>
        <td>[[ relay.cc ]]</td>
        <td>[[ relay.as_info ]]</td>
      <tr>
      </tbody>
      </table>



      <footer>
        The Tor Project - 2012<br>
        <a href="https://gitweb.torproject.org/compass.git">Source code</a> -
        <a href="https://trac.torproject.org/projects/tor/newticket?component=Compass">Report a bug</a> -
        <a href="mailto:<EMAIL>">Contact</a>
      </footer>

    </div> <!-- /container -->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster
    -->
    <script src="static/js/jquery-1.8.0.min.js"></script>
    <script src="static/js/bootstrap.min.js"></script>
    <script src="static/js/bootstrap-tooltip.js"></script>
    <script src="static/lib/select2/select2.js" type="text/javascript"></script>
    <script src="static/js/angular/angular.js"> </script>
    <script src="static/lib/angular-ui/angular-ui.js"></script>
    <script src="static/js/angularize.js"></script>
  </body>
</html>
<commit_msg>Transformed form to use Angular<commit_after><!DOCTYPE html>
<html lang="en" ng-app="Compass">
  <head>
    <meta charset="utf-8">
    <title>Compass</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Tor relay stats">
    <meta name="author" content="<NAME>">

    <!-- Le styles -->
    <link href="static/css/bootstrap.css" rel="stylesheet">
    <link href="static/lib/select2/select2.css" rel='stylesheet'>
    <link href="static/lib/angular-ui/angular-ui.min.css" rel="stylesheet">
    <link href="static/css/style.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
    </style>

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  </head>

  <body>

    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="/"><img src="static/img/compass-logo.jpg" /></a>
          <div class="nav-collapse">
            <ul class="nav">
              <li class="active"><a href="/">Home</a></li>
              <li><a href="https://trac.torproject.org/projects/tor/ticket/6498">Trac
                Ticket #6498</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container" ng-controller="CompassCtrl">
      <div class="hero-unit">
        <form class="form-horizontal" id="form">
          <fieldset>
            <legend>Compass</legend>
            <div class="control-group">
              <h3> Filter </h3>
              <label class="control-label" for="inactive">Inactive</label>
              <div class="controls">
                <label class="checkbox">
                  <input type="checkbox" id="inactive" value="True" name="inactive" ng-model='query.inactive'>
                  include relays in selection that aren't currently running </label>
              </div>
              <label class="control-label" for="guards">Guards</label>
              <div class="controls">
                <label class="checkbox">
                  <input type="checkbox" id="guards_only" value="True" name="guards_only" ng-model='query.guards_only'>
                  select only relays suitable for guard position
                </label>
              </div>
              <label class="control-label" for="exits_only">Exits</label>
              <div class="controls">
                <label class="checkbox">
                  <input type="checkbox" id="exits_only" value="True" name="exits_only" ng-model='query.exits_only'>
                  select only relays suitable for exit position</label>
              </div>
              <label class="control-label" for="family">Family</label>
              <div class="controls">
                <input type="text" class="input-xlarge" id="family" name="family" ng-model="query.family"
                placeholder="A59E1E7C7EAEE083D756EE1FF6EC31CA3D8651D7">
                <span class="help-inline">Select family by fingerprint or nickname</span>
              </div>              
              <label class="control-label" for="asNo">AS Number</label>
              <div class="controls">
                <input type="text" class="input-xlarge" id="ases" name="ases" ng-model="query.ases"
                placeholder="AS3320">
                <span class="help-inline">select only relays from AS number</span>
              </div>              
              <label class="control-label" for="cc">Country</label>
              <div class="controls">
                 <select id="country" name="country" ng-model='query.country' 
                   ui-select2 multiple data-placeholder="Germany">
                   <option ng-repeat="country in cc_data" value="{{country.id}}" >{{country.text}}</option>
                </select>
                <span class="help-inline">select only relays from these countries</span>
              </div>              
            </div>
            <label class="control-label" for="exits">Exits</label>
            <div class="controls">
              <label class="radio">
                <input type="radio" class="exits" name="exits" id="all_relays" value="all_relays" 
                ng-model='query.exit_filter' checked>
                All relays
              </label>
              <label class="radio">
                <input type="radio" class="exits" name="exits" id="fast_exits_only" value="fast_exits_only"
                ng-model='query.exit_filter'>
                Fast exit relays (95+ Mbit/s, 5000+ KB/s,
                80/443/554/1755, 2 relays per /24)
              </label>
              <label class="radio">
                <input type="radio" class="exits" name="exits" id="almost_fast_exits_only" 
                value="almost_fast_exits_only" ng-model="almost_fast_exits_only">
                Almost fast exit relays (80+ Mbit/s, 2000+ KB/s, 80/443, not in set of fast exits)
              </label>
              <label class="radio">
                <input type="radio" class="exits" name="exits" id="fast_exits_only_any_network" 
                ng-model="query.exit_filter" value="fast_exits_only_any_network">
                Fast exits relays any network (95+ Mbit/s, 5000+ KB/s, 80/443/554/1755)
              </label>
            </div>
            <div class="control-group">
              <h3> Group </h3>
              <label class="control-label" for="country">Country</label>
              <div class="controls">
                <label class="checkbox">
                  <input type="checkbox" id="by_country" value="True" name="by_country" ng-model="query.by_country">
                  group relays by country </label>
              </div>
              <label class="control-label" for="as">AS</label>
              <div class="controls">
                <input type="checkbox" id="by_as" value="True" name="by_as" ng-model="query.by_as">
                group relays by AS </label>
            </div>
          </div>
          <div class="control-group">
            <h3> Display </h3>
            <label class="control-label" for="top">Number of results</label>
            <div class="controls">
              <input type="text" class="input-xlarge" id="top" name="top"
              placeholder="-1" value="-1" ng-model="query.top">
              <span class="help-inline">display only the top results (-1 for all)</span>
            </div>
          </div>
          <div class="form-actions">
            <button  class="btn btn-primary" ng-click="request(query)">Submit</button>
            <button class="btn" ng-click="reset()">Reset</button>
            <div ng-show="state == loading" class="loading"><img src="/static/img/loader.gif" /></div>
          </div>
        </fieldset>
      </form>
    </div>

      <div class="loading"><img src="{{ url_for('static', filename='img/loader.gif') }}" /></div>
      <hr>
      <div id="result" ></div>
      <table class="table table-striped">
      <thead>
      <tr>
      <th>#</th>
      <th><span rel="tooltip" title="Relative bandwidth weight assigned to this relay by the directory authorities">Consensus Weights</span></th>
      <th><span rel="tooltip" title="Relative advertised bandwidth of this relay compared to the total advertised bandwidth in the network">Advertised Bandwidth</span></th>
      <th><span rel="tooltip" title=" Probability of this relay to be selected for the guard position">Guard Probability</span></th>
      <th><span rel="tooltip" title="Probability of this relay to be selected for the middle position">Middle Probability</span></th>
      <th><span rel="tooltip" title="Probability of this relay to be selected for the exit position">Exit Probability</span></th>
      <th>Nickname</th>
      <th>Fingerprint</th>
      <th>Exit</th>
      <th>Guard</th>
      <th>Country</th>
      <th>Autonomous System</th>
      </tr>
      </thead>                                         
      <tbody>
      <tr ng-repeat="relay in relayResults.results">
        <td> [[ relay.index ]] </td>
        <td> [[ relay.cw ]] </td>
        <td> [[ relay.adv_bw]] </td>
        <td>[[ relay.p_guard ]]</td>
        <td>[[ relay.p_middle ]]</td>
        <td>[[ relay.p_exit ]]</td>
        <td>[[ relay.nick ]]</td>
        <!-- it's not a fingerprint -->
        {% if relay.fp|length != 40 %}
        <td>[[ relay.fp ]]</td>
        {% else %}
        <td><a href="https://atlas.torproject.org/#details/[[ relay.fp ]]">[[ relay.fp[:8] ]]</a></td>
        {% endif %}
        <td>[[ relay.exit ]]</td>
        <td>[[ relay.guard ]]</td>
        <td>[[ relay.cc ]]</td>
        <td>[[ relay.as_info ]]</td>
      <tr>
      </tbody>
      </table>



      <footer>
        The Tor Project - 2012<br>
        <a href="https://gitweb.torproject.org/compass.git">Source code</a> -
        <a href="https://trac.torproject.org/projects/tor/newticket?component=Compass">Report a bug</a> -
        <a href="mailto:<EMAIL>">Contact</a>
      </footer>

    </div> <!-- /container -->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster
    -->
    <script src="static/js/jquery-1.8.0.min.js"></script>
    <script src="static/js/bootstrap.min.js"></script>
    <script src="static/js/bootstrap-tooltip.js"></script>
    <script src="static/lib/select2/select2.js" type="text/javascript"></script>
    <script src="static/js/angular/angular.js"> </script>
    <script src="static/lib/angular-ui/angular-ui.js"></script>
    <script src="static/js/angularize.js"></script>
  </body>
</html>

{'fraction_non_alphanumeric': 0.1700301435651152, 'fraction_numerical': 0.012363970776069075, 'mean_word_length': 2.0699498117942285, 'pattern_counts': {'":': 0, '<': 545, '<?xml version=': 0, '>': 545, 'https://': 8, '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': '6137632', 'n_tokens_mistral': 6020, 'n_tokens_neox': 5667, 'n_words': 1256}