<commit_before>var _                 = require("lodash")
  , expect            = require("chai").expect
  , oriskami            = require("../../oriskami")
  , methods           = ["create", "retrieve", "update", "del", "list"]

describe("FilterScoringsDedicated", function(){
  describe("Properties", function(){
    it("Should have a name and path attribute", function() {
      expect(oriskami["FilterScoringsDedicated"]["path"]).to.exist
    })

    it("Should link to parent (oriskami)", function() {
      expect(oriskami["FilterScoringsDedicated"]["oriskami"]).to.exist
    })

    _.each(methods, function(method){
      var METHOD      = method.toUpperCase()
      it("Should have "+METHOD+" methods", function(done) {
        if(!_.isFunction(oriskami["FilterScoringsDedicated"][method])){
          return done(new Error("Should have "+METHOD+" methods"))
        }
        done()
      })
    })
  })

  describe("Methods", function(){
    it("Should list", function(done){
      oriskami["FilterScoringsDedicated"].list(done)
    })

    it("Should create", function(done){
      oriskami["FilterScoringsDedicated"].create({
        "query_target"      : "sample:100" 
      , "query_base"        : "fr" 
      , "features"          : "all" 
      }, done)
    })

    it("Should retrieve", function(done){
      oriskami["FilterScoringsDedicated"].retrieve(0, done)
    })

    it("Should update status", function(done){
      oriskami["FilterScoringsDedicated"].create({
        "is_active": "false"
      }, function(err, res){
        console.log(err, res)
        if(!err && res.data && res.data.is_active === "false"){
          oriskami["FilterScoringsDedicated"].create({
            "is_active": "true"
          }, function(err, res){
            if(!err && res.data && res.data.is_active === "true"){
              done()
            } else if(!err){
              done(new Error("Failed to roll back 'is_active'"))
            } else {
              done(err)
            }
          })
        } else if(!err){
          done(new Error("Failed to set 'is_active'"))
        } else {
          done(err)
        }
      })
    })
  })
})
<commit_msg>change<commit_after>var _                 = require("lodash")
  , expect            = require("chai").expect
  , oriskami            = require("../../oriskami")
  , methods           = ["create", "retrieve", "update", "del", "list"]

describe("FilterScoringsDedicated", function(){
  describe("Properties", function(){
    it("Should have a name and path attribute", function() {
      expect(oriskami["FilterScoringsDedicated"]["path"]).to.exist
    })

    it("Should link to parent (oriskami)", function() {
      expect(oriskami["FilterScoringsDedicated"]["oriskami"]).to.exist
    })

    _.each(methods, function(method){
      var METHOD      = method.toUpperCase()
      it("Should have "+METHOD+" methods", function(done) {
        if(!_.isFunction(oriskami["FilterScoringsDedicated"][method])){
          return done(new Error("Should have "+METHOD+" methods"))
        }
        done()
      })
    })
  })

  describe("Methods", function(){
    it("Should list", function(done){
      oriskami["FilterScoringsDedicated"].list(function(err, res){
        if(err){
          console.log(err)
          return done(new Error("Failed to list filter scorings dedicated"))
        }
        console.log(res)
        done()
      })
    })

    it("Should create", function(done){
      oriskami["FilterScoringsDedicated"].create({
        "query_target"      : "sample:100" 
      , "query_base"        : "fr" 
      , "features"          : "all" 
      }, done)
    })

    it("Should retrieve", function(done){
      oriskami["FilterScoringsDedicated"].retrieve(0, done)
    })

    xit("Should update status", function(done){
      oriskami["FilterScoringsDedicated"].create({
        "is_active": "false"
      }, function(err, res){
        console.log(err, res)
        if(!err && res.data && res.data.is_active === "false"){
          oriskami["FilterScoringsDedicated"].create({
            "is_active": "true"
          }, function(err, res){
            if(!err && res.data && res.data.is_active === "true"){
              done()
            } else if(!err){
              done(new Error("Failed to roll back 'is_active'"))
            } else {
              done(err)
            }
          })
        } else if(!err){
          done(new Error("Failed to set 'is_active'"))
        } else {
          done(err)
        }
      })
    })
  })
})

{'fraction_non_alphanumeric': 0.16372851476421332, 'fraction_numerical': 0.0017628911414720142, 'mean_word_length': 2.205508474576271, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, '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': '5518376', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1346, 'n_words': 245}