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

  /* exports */
  module.exports = Predicate

  /**
   *
   * @param {Function} evaluate function(subject) -> Boolean
   * @return {Object} instance of Predicate
   */
  function Predicate (evaluate) {
    if (!this) {
      return new Predicate(evaluate)
    } else {
      this.evaluate = evaluate
    }
  }

  /**
   *
   * @param {Function} predicate function(subject) -> Boolean
   * @return {Function} thisAndPredicate(subject) -> Boolean
   */
  Predicate.prototype.and = function (predicate) {
    var me = this

    return Predicate(function (subject) {
      return me.evaluate(subject) && predicate.evaluate(subject)
    })
  }

  /**
   *
   * @param {Function} predicate function(subject) -> Boolean
   * @return {Function} thisOrPredicate(subject) -> Boolean
   */
  Predicate.prototype.or = function (predicate) {
    var me = this

    return Predicate(function (subject) {
      return me.evaluate(subject) || predicate.evaluate(subject)
    })
  }

  /**
   *
   * @return {Function} notPredicate(subject) -> Boolean
   */
  Predicate.prototype.not = function () {
    var me = this

    return Predicate(function (subject) {
      return !me.evaluate(subject)
    })
  }

  /**
   *
   * @return {Function} notPredicate(subject) -> Boolean
   */
  Predicate.prototype.same = function () {
    return this
  }

  /**
   *
   * @return {Boolean} true
   */
  Predicate.yes = function () {
    return true
  }

  /**
   *
   * @return {Boolean} false
   */
  Predicate.no = function () {
    return false
  }
})()

<commit_msg>[MINOR][ADD] toString and transform with transform functions<commit_after>;(function () {
  'use strict'

  /* exports */
  module.exports = Predicate

  /**
   *
   * @param {Function} evaluate function(subject) -> Boolean
   * @return {Object} instance of Predicate
   */
  function Predicate (evaluate) {
    if (!this) {
      return new Predicate(evaluate)
    } else {
      this.evaluate = evaluate
    }
  }

  /**
   *
   * @param {Function} predicate function(subject) -> Boolean
   * @return {Function} thisAndPredicate(subject) -> Boolean
   */
  Predicate.prototype.and = function (predicate) {
    var me = this

    var newPredicate = function (subject) {
      return me.evaluate(subject) && predicate.evaluate(subject)
    }

    var newName = '(' + me.evaluate.name + ') AND (' + predicate.evaluate.name +
      ')'

    newPredicate = setName(newPredicate, newName)

    return Predicate(newPredicate)
  }

  /**
   *
   * @param {Function} predicate function(subject) -> Boolean
   * @return {Function} thisOrPredicate(subject) -> Boolean
   */
  Predicate.prototype.or = function (predicate) {
    var me = this

    var newPredicate = function (subject) {
      return me.evaluate(subject) || predicate.evaluate(subject)
    }

    var newName = '(' + me.evaluate.name + ') OR (' + predicate.evaluate.name +
      ')'

    newPredicate = setName(newPredicate, newName)

    return Predicate(newPredicate)
  }

  /**
   *
   * @return {Function} notPredicate(subject) -> Boolean
   */
  Predicate.prototype.not = function () {
    var me = this

    var newPredicate = function (subject) {
      return !me.evaluate(subject)
    }

    var newName = 'NOT(' + me.evaluate.name + ')'

    newPredicate = setName(newPredicate, newName)

    return Predicate(newPredicate)
  }

  /**
   *
   * @return {Function} notPredicate(subject) -> Boolean
   */
  Predicate.prototype.same = function () {
    return this
  }

  /**
   *
   * @param {*} subject to evaluate
   * @return {String} subject should predicateFunctionName
   */
  Predicate.prototype.toString = function toString (subject) {
    return subject + ' should ' + this.evaluate.name
  }

  /**
   *
   * @return {Boolean} true
   */
  Predicate.yes = function () {
    return true
  }

  /**
   *
   * @return {Boolean} false
   */
  Predicate.no = function () {
    return false
  }

  function setName (aFunction, newName) {
    var description = {
      value: newName
    }

    return Object.defineProperty(aFunction, 'name', description)
  }
})()


{'fraction_non_alphanumeric': 0.13682678311499272, 'fraction_numerical': 0.0, 'mean_word_length': 2.6262093227792436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '4375120', 'n_tokens_mistral': 1325, 'n_tokens_neox': 1257, 'n_words': 277}