<commit_before>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0"><!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
    <!-- Optional theme -->
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="//msurguy.github.io/ladda-bootstrap/dist/ladda-themeless.min.css">

    <style>
      .form-alert {
          margin-bottom: 0px;
          padding-top:5px;
          padding-bottom:5px;
      }
    </style>


  </head>
  <body ng-app="yncApp" ng-controller="Controller as ctrl"> 
    <div class="container">
      <div class="row">
        <div class="col-md-offset-3 col-md-6">
          <div ng-form="signin_form" novalidate class="form-signin" id="form-signin">
            <h2 class="form-signin-heading">Signup</h2>
            <input type="text" name="email" ng-model="ctrl.email" placeholder="email" autofocus class="form-control" ng-enter="ctrl.validate()">
            <input type="password" name="password" ng-model="ctrl.password" placeholder="password" class="form-control" ng-enter="ctrl.validate()">
            <button data-style="expand-right" class="btn btn-primary ladda-button" type="button" ng-click="ctrl.validate()">
              <span class="ladda-label">Submit</span>
            </button>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-md-offset3 col-md-6"><span>The result object:</span></div>
      </div>
      <div class="row">
        <div class="col-md-offset3 col-md-6"><span id="validationResult">{{ctrl.validationResult}}</span></div>
      </div>
    </div>
  </body>
  <!-- Latest compiled and minified JavaScript -->
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
  <script src="//msurguy.github.io/ladda-bootstrap/dist/spin.min.js"></script>
  <script src="//msurguy.github.io/ladda-bootstrap/dist/ladda.min.js"></script>
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>

  <script src="../../lib/validation.js"></script>
  <script>
    (function() {
        'use strict';

        angular.module('yncApp', [])
          .directive('ngEnter', function () {
            return function (scope, element, attrs) {
                element.bind('keydown keypress', function (event) {
                    if(event.which === 13) {
                        scope.$apply(function (){
                            scope.$eval(attrs.ngEnter);
                        });

                        event.preventDefault();
                    }
                });
            };
          })
          .controller('Controller', function($scope, validationService) {
            alert('ctrl load');
            var ctrl = this;
            this.validate = function() {
                validationService.validate(
                  {
                    email: ctrl.email, 
                    password: <PASSWORD>
                  }, 
                  function(err,res){
                    if(err) return alert(err);
                    ctrl.validationResult = res;
                  });
            };
          })
          .factory('validationService', function(){

            var emailRequiredValidator = new ync.RequiredValidator('email');

            var passwordRequiredValidator = new ync.RequiredValidator('password');

            var emailFormatValidator = new ync.Validator(
              function validate(obj) {
                var field = obj.email;
                return !field || (field.indexOf('@') >= 0 && field.indexOf('.') >= 0 && field.lastIndexOf('@') < field.lastIndexOf('.'));
              },
              new ync.FailedResult('email', 'ERROR', 'format'));

            var passwordLengthValidator = new ync.Validator(
              function validate(obj) {
                return !obj.password || obj.password.length >= 6;<commit_msg>example3: angular template for error message<commit_after>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0"><!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
    <!-- Optional theme -->
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="//msurguy.github.io/ladda-bootstrap/dist/ladda-themeless.min.css">

    <style>
      .form-alert {
          margin-bottom: 0px;
          padding-top:5px;
          padding-bottom:5px;
      }
    </style>


  </head>
  <body ng-app="yncApp" ng-controller="Controller as ctrl"> 
    
    <div class="container">
      <div class="row">
        <div class="col-md-offset-3 col-md-6">
          <div ng-form="signin_form" novalidate class="form-signin" id="form-signin">
            <h2 class="form-signin-heading">Signup</h2>
            <div ng-include src="'error-template'"></div>
            <input type="text" name="email" ng-model="ctrl.email" placeholder="email" autofocus class="form-control" ng-enter="ctrl.validate()">
            <input type="password" name="password" ng-model="ctrl.password" placeholder="password" class="form-control" ng-enter="ctrl.validate()">
            <button data-style="expand-right" class="btn btn-primary ladda-button" type="button" ng-click="ctrl.validate()">
              <span class="ladda-label">Submit</span>
            </button>
          </div>
        </div>
      </div>
      <div class="row">
        <div class="col-md-offset3 col-md-6"><span>The result object:</span></div>
      </div>
      <div class="row">
        <div class="col-md-offset3 col-md-6"><span id="validationResult">{{ctrl.validationResult}}</span></div>
      </div>
    </div>
  </body>
  <!-- Latest compiled and minified JavaScript -->
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
  <script src="//msurguy.github.io/ladda-bootstrap/dist/spin.min.js"></script>
  <script src="//msurguy.github.io/ladda-bootstrap/dist/ladda.min.js"></script>
  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>

  <script src="../../lib/validation.js"></script>

  <script id="error-template" type="text/ng-template">
      <div role="alert" class="alert alert-danger form-alert">
        <span aria-hidden="true" class="glyphicon glyphicon-exclamation-sign"></span>
        <span class="sr-only">Error:</span>
        <span>Message</span>
      </div>
    </script>


  <script>
    (function() {
        'use strict';

        angular.module('yncApp', [])
          .directive('ngEnter', function () {
            return function (scope, element, attrs) {
                element.bind('keydown keypress', function (event) {
                    if(event.which === 13) {
                        scope.$apply(function (){
                            scope.$eval(attrs.ngEnter);
                        });

                        event.preventDefault();
                    }
                });
            };
          })
          .controller('Controller', function($scope, validationService) {
            var ctrl = this;
            this.validate = function() {
                validationService.validate(
                  {
                    email: ctrl.email, 
                    password: ctrl.password
                  }, 
                  function(err,res){
                    if(err) return alert(err);
                    ctrl.validationResult = res;
                  });
            };
          })
          .factory('validationService', function(){

            var emailRequiredValidator = new ync.RequiredValidator('email');

            var passwordRequiredValidator = new ync.RequiredValidator('password');

            var emailFormatValidator = new ync.Validator(
              function validate(obj) {
                var field = obj.email;
                return !field || (field.indexOf('@') >= 0 && field.indexOf('.') >= 0 && field.lastIndexOf('@') < field.lastIndexOf('.'));
              },
              new ync.FailedResult('email', 'ERROR', 'format'));

            var passwordLengthValidator = new ync.Validator(
              function validate(obj) {
                return !obj.password || obj.password.length >= 6;
{'fraction_non_alphanumeric': 0.1660637576305675, 'fraction_numerical': 0.008252317431607507, 'mean_word_length': 2.097689075630252, 'pattern_counts': {'":': 0, '<': 134, '<?xml version=': 0, '>': 138, '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': '916236', 'n_tokens_mistral': 2635, 'n_tokens_neox': 2497, 'n_words': 426}