text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Diagnostics;
using System.Collections.Generic;

using Internal.Text;
using Internal.TypeSystem;
using Internal.NativeFormat;

using ILCompiler.DependencyAnalysisFramework;

namespace ILCompiler.DependencyAnalysis
{
    /// <summary>
    /// Dependency analysis node used to keep track of types needing an entry in the default
    /// constructor map hashtable
    /// </summary>
    internal sealed class DefaultConstructorFromLazyNode : DependencyNodeCore<NodeFactory>
    {
        public TypeDesc TypeNeedingDefaultCtor { get; }

        public DefaultConstructorFromLazyNode(TypeDesc type)
        {
            Debug.Assert(!type.IsRuntimeDeterminedSubtype);
            Debug.Assert(type == type.ConvertToCanonForm(CanonicalFormKind.Specific));
            Debug.Assert(type.GetDefaultConstructor() != null && !type.IsValueType);

            TypeNeedingDefaultCtor = type;
        }

        public override bool HasDynamicDependencies => false;
        public override bool HasConditionalStaticDependencies => false;
        public override bool InterestingForDynamicDependencyAnalysis => false;
        public override bool StaticDependenciesAreComputed => true;
        protected override string GetName(NodeFactory factory) => "__DefaultConstructorFromLazyNode_" + factory.NameMangler.GetMangledTypeName(TypeNeedingDefaultCtor);
        public override IEnumerable<CombinedDependencyListEntry> GetConditionalStaticDependencies(NodeFactory context) => null;
        public override IEnumerable<CombinedDependencyListEntry> SearchDynamicDependencies(List<DependencyNodeCore<NodeFactory>> markedNodes, int firstNode, NodeFactory factory) => null;

        public override IEnumerable<DependencyListEntry> GetStaticDependencies(NodeFactory context)
        {
            yield return new DependencyListEntry(
                context.MaximallyConstructableType(TypeNeedingDefaultCtor),
                "DefaultConstructorNode type");

            yield return new DependencyListEntry(
                context.MethodEntrypoint(TypeNeedingDefaultCtor.GetDefaultConstructor(), TypeNeedingDefaultCtor.IsValueType),
                "DefaultConstructorNode");
        }
    }

    /// <summary>
    /// DefaultConstructorMap blob, containing information on default constructor entrypoints of all types used
    /// by lazy generic instantiations.
    /// </summary>
    internal class DefaultConstructorMapNode : ObjectNode, ISymbolDefinitionNode
    {
        private ObjectAndOffsetSymbolNode _endSymbol;
        private ExternalReferencesTableNode _externalReferences;

        public DefaultConstructorMapNode(ExternalReferencesTableNode externalReferences)
        {
            _endSymbol = new ObjectAndOffsetSymbolNode(this, 0, "__DefaultConstructor_Map_End", true);
            _externalReferences = externalReferences;
        }

        public ISymbolNode EndSymbol => _endSymbol;

        public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb)
        {
            sb.Append(nameMangler.CompilationUnitPrefix).Append("__DefaultConstructor_Map");
        }

        public int Offset => 0;
        public override bool IsShareable => false;
        public override ObjectNodeSection Section => _externalReferences.Section;
        public override bool ShouldSkipEmittingObjectNode(NodeFactory factory) => false;
        public override bool StaticDependenciesAreComputed => true;

        protected internal override int Phase => (int)ObjectNodePhase.Ordered;
        protected internal override int ClassCode => (int)ObjectNodeOrder.DefaultConstructorMapNode;

        protected override string GetName(NodeFactory factory) => this.GetMangledName(factory.NameMangler);

        public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
        {
            // This node does not trigger generation of other nodes.
            if (relocsOnly)
                return new ObjectData(Array.Empty<byte>(), Array.Empty<Relocation>(), 1, new ISymbolDefinitionNode[] { this });

            var writer = new NativeWriter();
            var defaultConstructorHashtable = new VertexHashtable();

            Section defaultConstructorHashtableSection = writer.NewSection();
            defaultConstructorHashtableSection.Place(defaultConstructorHashtable);

            foreach (var ctorNeeded in factory.MetadataManager.GetDefaultConstructorsNeeded())
            {
                MethodDesc defaultCtor = ctorNeeded.TypeNeedingDefaultCtor.GetDefaultConstructor();
                Debug.Assert(defaultCtor != null);

                ISymbolNode typeNode = factory.NecessaryTypeSymbol(ctorNeeded.TypeNeedingDefaultCtor);
                ISymbolNode defaultCtorNode = factory.MethodEntrypoint(defaultCtor, false);

                Vertex vertex = writer.GetTuple(
                    writer.GetUnsignedConstant(_externalReferences.GetIndex(typeNode)),
                    writer.GetUnsignedConstant(_externalReferences.GetIndex(defaultCtorNode)));

                int hashCode = ctorNeeded.TypeNeedingDefaultCtor.GetHashCode();
                defaultConstructorHashtable.Append((uint)hashCode, defaultConstructorHashtableSection.Place(vertex));
            }

            byte[] hashTableBytes = writer.Save();

            _endSymbol.SetSymbolOffset(hashTableBytes.Length);

            return new ObjectData(hashTableBytes, Array.Empty<Relocation>(), 1, new ISymbolDefinitionNode[] { this, _endSymbol });
        }
    }
}


text:
<?php
/**
 * Author: lf
 * Blog: https://blog.feehi.com
 * Email: job@feehi.com
 * Created at: 2016-10-19 13:11
 */

$this->title = yii::t('install', 'Congratuations! Success installed');
?>

            <?= yii::t('install', 'Congratuations! Success installed') ?>

                <?= yii::t('install', 'For your site security, please remove the directory install! and, backup common/config/conf/db.php') ?>

            <a target="_blank" class="btn btn-success"
               href="<?= yii::$app->getRequest()->hostInfo ?>"><?= yii::t('install', 'go Frontend') ?>
            <a target="_blank" class="btn btn-success"
               href="<?= yii::$app->getRequest()->hostInfo ?>/admin/"><?= yii::t('install', 'go Backend') ?>

redpajama_set_name: RedPajamaGithub


text:
'use strict';

var assert = require('assert');
var path = require('path');
var fs = require('fs');
var muk = require('muk');

for(var filepath in require.cache){
  delete require.cache[filepath];
}
var Index = require('../../lib/index.js');
var instance = new Index();
instance.load();

think.APP_PATH = path.dirname(__dirname) + think.sep + 'testApp';

var _http = require('../_http.js');

function getHttp(config, options){
  think.APP_PATH = path.dirname(__dirname) + think.sep + 'testApp';
  var req = think.extend({}, _http.req);
  var res = think.extend({}, _http.res);
  return think.http(req, res).then(function(http){
    if(config){
      http._config = config;
    }
    if(options){
      for(var key in options){
        http[key] = options[key];
      }
    }
    return http;
  })
}
var Logic = think.lookClass('', 'logic');
function getInstance(config, options){
  return getHttp(config, options).then(function(http){
    return new Logic(http);
  })
}

describe('logic/base', function(){
  it('validate is function', function(done){
    getInstance().then(function(instance){
      assert.equal(think.isFunction(instance.validate), true);
      done();
    })
  })
  it('validate, empty', function(done){
    getInstance().then(function(instance){
      var data = instance.validate();
      assert.deepEqual(data, true)
      done();
    })
  })
  it('validate, empty 1', function(done){
    getInstance().then(function(instance){
      var data = instance.validate({});
      assert.deepEqual(data, true)
      done();
    })
  })
  it('parse rules, empty', function(done){
    getInstance().then(function(instance){
      var data = instance._parseValidateData();
      assert.deepEqual(data, { })
      done();
    })
  })
  it('parse rules, empty 1', function(done){
    getInstance().then(function(instance){
      var data = instance._parseValidateData({
        welefen: ''
      });
      assert.deepEqual(data, { welefen: { string: true, value: '',_method: 'get' } })
      done();
    })
  })
  it('parse rules, required', function(done){
    getInstance().then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required'
      });
      assert.deepEqual(data, { welefen: { string: true, value: '', required: true,_method: 'get' } })
      done();
    })
  })
  it('parse rules, int', function(done){
    getInstance().then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|int'
      });
      assert.deepEqual(data, { welefen: { required: true, int: true, value: '',_method: 'get' } })
      done();
    })
  })
  it('parse rules, int, has value', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      }
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|int'
      });
      assert.deepEqual(data, { welefen: { required: true, int: true, value: '10',_method: 'get' } })
      done();
    })
  })
  it('parse rules, min, has value', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      }
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|int|min:5'
      });
      assert.deepEqual(data, { welefen: { required: true, min: [ '5' ], int: true, value: '10' ,_method: 'get'} })
      done();
    })
  })
  it('parse rules, array args', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      }
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|int|min:[1,2,4]'
      });
      assert.deepEqual(data, { welefen: { required: true, int: true, min: [[ 1, 2, 4 ]], value: '10',_method: 'get' } })
      done();
    })
  })
  it('parse rules, object args', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      }
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|int|min: {name: "welefen"}'
      });
      assert.deepEqual(data, { welefen: { required: true, int: true, min: [{ name: 'welefen' }], value: '10',_method: 'get' } })
      done();
    })
  })
  it('parse rules, object args, object', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      }
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: {required: true, int: true, min: {name: 'welefen'}}
      });
      assert.deepEqual(data, { welefen: { required: true, int: true, min: { name: 'welefen' }, value: '10',_method: 'get' } })
      done();
    })
  })
  it('parse rules, value from get', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      }
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|get|int|min: {name: "welefen"}'
      });
      assert.deepEqual(data, { welefen: { required: true, int: true, min: [{ name: 'welefen' }], value: '10',_method: 'get' } })
      done();
    })
  })
  it('parse rules, value from get, method is post', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      },
      _post: {
        welefen: '20'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|get|int|min: {name: "welefen"}'
      });
      assert.deepEqual(data, { welefen: { required: true, int: true, min: [{ name: 'welefen' }], value: '10',_method: 'get' } })
      done();
    })
  })
  it('parse rules, value from post, method is post', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      },
      _post: {
        welefen: '20'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|int|min: {name: "welefen"}'
      });
      assert.deepEqual(data, { welefen: { required: true, int: true, min: [{ name: 'welefen' }], value: '20',_method: 'post' } })
      done();
    })
  })
  it('parse rules, value from file, method is post', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      },
      _file: {
        welefen: {path: 'filepath'}
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|file|object'
      });
      assert.deepEqual(data, { welefen: { required: true, object: true, value: {path: 'filepath'},_method: 'file' } })
      done();
    })
  })
  it('parse rules, value from file, method is post 1', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      },
      _file: {
        welefen: {path: 'filepath'}
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|file'
      });
      assert.deepEqual(data, { welefen: { required: true, object: true, value: {path: 'filepath'},_method: 'file' } })
      done();
    })
  })
  it('parse rules, default value', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      },
      _file: {
        welefen: '20'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        suredy: 'required|int|min: {name: "welefen"}|default:30'
      });
      //console.log(JSON.stringify(data));
      assert.deepEqual(data, {"suredy":{"required":true,"int":true,"min":[{"name":"welefen"}],"default":"30","value":"",_method: 'post'}})
      done();
    })
  })
  it('parse rules, default value is array', function(done){
    getInstance({}, {
      _get: {
        welefen: '10'
      },
      _file: {
        welefen: '20'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        suredy: 'required|array|default:[30]'
      });
      assert.deepEqual(data, {"suredy":{"required":true,"array":true,"default":[30],"value":"",_method: 'post'}})
      done();
    }).catch(function(err){
      console.log(err.stack)
    })
  })
  it('parse rules, float', function(done){
    getInstance({}, {
      _post: {
        welefen: '10.3'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|float|default:30'
      });
      assert.deepEqual(data, {"welefen":{"required":true,"float":true,"default":"30","value":"10.3",_method: 'post'}});
      var welefen = instance.post('welefen');
      assert.equal(welefen, '10.3')
      done();
    })
  })
  it('parse rules, array', function(done){
    getInstance({}, {
      _post: {
        welefen: '10,3,2'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|array'
      });
      //console.log(JSON.stringify(data));
      assert.deepEqual(data, {"welefen":{"required":true,"array":true,"value":"10,3,2",_method: 'post'}});
      done();
    })
  })
  it('parse rules, array int', function(done){
    getInstance({}, {
      _post: {
        welefen: '10,3,2'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|array|int'
      });
      //console.log(JSON.stringify(data));
      assert.deepEqual(data, {"welefen":{"required":true,"array":true,"int":true,"value":"10,3,2",_method: 'post'}});
      assert.deepEqual(instance.post('welefen'), '10,3,2')
      done();
    })
  })
  it('parse rules, array float', function(done){
    getInstance({}, {
      _post: {
        welefen: '10,3,2.2'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|array|float'
      });
      //console.log(JSON.stringify(data));
      assert.deepEqual(data, {"welefen":{"required":true,"array":true,"float":true,"value":"10,3,2.2",_method: 'post'}});
      done();
    })
  })
  it('parse rules, array float, item is string', function(done){
    getInstance({}, {
      _post: {
        welefen: ['10]','3','2.2']
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|array|float'
      });
      //console.log(JSON.stringify(data));
      assert.deepEqual(data, {"welefen":{"required":true,"array":true,"float":true,"value":["10]","3","2.2"],_method: 'post'}});
      done();
    })
  })
  it('parse rules, array float, item is object', function(done){
    getInstance({}, {
      _post: {
        welefen: {}
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|array'
      });
      //console.log(JSON.stringify(data));
      assert.deepEqual(data, {"welefen":{"required":true,"array":true,"value":{},_method: 'post'}});
      done();
    })
  })
  it('parse rules, boolean, yes', function(done){
    getInstance({}, {
      _post: {
        welefen: 'yes'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|boolean'
      });
      //console.log(JSON.stringify(data));
      assert.deepEqual(data, {"welefen":{"required":true,"boolean":true,"value":"yes",_method: 'post'}});
      done();
    })
  })
  it('parse rules, boolean, on', function(done){
    getInstance({}, {
      _post: {
        welefen: 'on'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|boolean'
      });
      assert.deepEqual(data, { welefen: { required: true, boolean: true, value: 'on' ,_method: 'post'} });
      done();
    })
  })
  it('parse rules, boolean, 1', function(done){
    getInstance({}, {
      _post: {
        welefen: '1'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|boolean'
      });
      assert.deepEqual(data, { welefen: { required: true, boolean: true, value: '1',_method: 'post' } });
      done();
    })
  })
  it('parse rules, boolean, true', function(done){
    getInstance({}, {
      _post: {
        welefen: 'true'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|boolean'
      });
      assert.deepEqual(data, { welefen: { required: true, boolean: true, value: 'true',_method: 'post' } });
      done();
    })
  })
  it('parse rules, boolean, true', function(done){
    getInstance({}, {
      _post: {
        welefen: 'false'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|boolean'
      });
      assert.deepEqual(data, { welefen: { required: true, boolean: true, value: 'false',_method: 'post' } });
      done();
    })
  })
  it('parse rules, boolean, true, boolean', function(done){
    getInstance({}, {
      _post: {
        welefen: true
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|boolean'
      });
      assert.deepEqual(data, { welefen: { required: true, boolean: true, value: true,_method: 'post' } });
      done();
    })
  })
  it('parse rules, object', function(done){
    getInstance({}, {
      _post: {
        welefen: "{}"
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|object'
      });
      assert.deepEqual(data, { welefen: { required: true, object: true, value: '{}',_method: 'post' } });
      done();
    })
  })
  it('parse rules, object error', function(done){
    getInstance({}, {
      _post: {
        welefen: "{ww}"
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|object'
      });
      assert.deepEqual(data, { welefen: { required: true, object: true, value: '{ww}',_method: 'post' } });
      done();
    })
  })
  it('parse rules, object', function(done){
    getInstance({}, {
      _post: {
        welefen: {}
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance._parseValidateData({
        welefen: 'required|object'
      });
      assert.deepEqual(data, { welefen: { required: true, object: true, value: {},_method: 'post'} });
      done();
    })
  })
  it('parse rules, object', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: {
          name: 'welefen'
        }
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: 'required|object'
      });
      assert.deepEqual(data, true);
      done();
    })
  })
  it('parse rules, object, fail', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: 30
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: 'required|int|max:10'
      });
      assert.deepEqual(data, false);
      var errors = instance.errors();
      assert.deepEqual(errors.welefen.length > 0, true);
      done();
    })
  })
  it('parse rules, different', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: 30,
        suredy: 30
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: 'required|int|max:40',
        suredy: 'required|different:welefen'
      });
      assert.deepEqual(data, false);
      var errors = instance.errors();
      assert.deepEqual(errors.suredy.length > 0, true);
      done();
    })
  })
  it('parse rules, different, with clean rules 1', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: 30,
        suredy: 30
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        suredy: 'required|int|different:welefen'
      });
      assert.deepEqual(data, false);
      var errors = instance.errors();
      assert.deepEqual(errors.suredy.length > 0, true);
      done();
    })
  })
  it('parse rules, different, with clean rules 2', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '',
        suredy: ''
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        suredy: 'requiredWithout:welefen'
      });
      assert.deepEqual(data, false);
      var errors = instance.errors();
      assert.deepEqual(errors.suredy.length > 0, true);
      done();
    })
  })
  it('parse rules, different, with clean rules 3', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: 'wwww',
        suredy: ''
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        suredy: 'requiredWithout:welefen'
      });
      assert.deepEqual(data, true);
      done();
    })
  })

  it('parse rules, after', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '2014-11-11',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: 'required|before',
        suredy: 'required|after:welefen'
      });
      assert.deepEqual(data, false);
      var errors = instance.errors();
      assert.deepEqual(errors.suredy.length > 0, true);
      done();
    })
  })
  it('parse rules, string, default', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '2014-11-11',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        doc: "string|default:index",
        version: "string|default:2.0"
      });
      assert.deepEqual(data, true);
      done();
    })
  })
  it('parse rules, string, required|int', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: 'test',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: 'required|int'
      });
      assert.deepEqual(data, false);
      done();
    })
  })
  it('parse rules, string, required|int empty', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: 'required|int'
      });
      assert.deepEqual(data, false);
      done();
    })
  })
  it('parse rules, string, required|int number string', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '10',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: 'required|int'
      });
      assert.deepEqual(data, true);
      done();
    })
  })
  it('parse rules, requiredWithout, empty', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '',
        suredy: ''
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: "requiredWithout:suredy|email",
        suredy: "requiredWithout:welefen|mobile"
      });
      assert.deepEqual(data, false);
      done();
    })
  })
  it('parse rules, default, int', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '',
        suredy: ''
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: 'required|int|default:10'
      });
      assert.deepEqual(data, true);
      var post = instance.post();
      assert.deepEqual(post, {welefen: 10, suredy: ''})
      done();
    })
  })
  it('parse rules, default, int 2', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {

      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: 'int'
      });
      assert.deepEqual(data, true);
      var post = instance.post();
      assert.deepEqual(post, {})
      done();
    })
  })

  it('parse rules, default, float', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '',
        suredy: ''
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: 'required|float|default:10.2'
      });
      assert.deepEqual(data, true);
      var post = instance.post();
      assert.deepEqual(post, {welefen: 10.2, suredy: ''})
      done();
    })
  })
  it('parse rules, default, array, float', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '',
        suredy: ''
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: 'required|array|float|default:[10.2, 11]'
      });
      var post = instance.post();
      assert.deepEqual(data, true);
      assert.deepEqual(post, {welefen: [10.2, 11], suredy: ''})
      done();
    })
  })
  it('parse rules, requiredWithout, has one', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: 'welefen@gmail.com',
        suredy: ''
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: "requiredWithout:suredy|email",
        suredy:  "requiredWithout:welefen|mobile"
      });
      assert.deepEqual(data, true);
      done();
    })
  })
  it('parse rules, requiredWithout, has two', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: 'welefen@gmail.com',
        suredy: '15811300250'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: "requiredWithout:suredy|email",
        suredy: "requiredWithout:welefen|mobile"
      });
      assert.deepEqual(data, true);
      done();
    })
  })
  it('parse rules, requiredWithout, has two, not mobile', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: 'welefen@gmail.com',
        suredy: '1581130025ww0'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        welefen: "requiredWithout:suredy|email",
        suredy: "requiredWithout:welefen|mobile"
      });
      assert.deepEqual(data, false);
      done();
    })
  })
  it('parse rules, empty, different', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {

      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        username: 'string|length:5,16',
        password: 'string|length:5,16|different:username'
      });
      assert.deepEqual(data, true);
      done();
    })
  })
  it('parse rules, string, default, object', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '2014-11-11',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.validate({
        doc: {string: true, default:"index"},
        version: {string: true, default: "2.0"}
      });
      assert.deepEqual(data, true);
      done();
    })
  })
  it('__after, rules empty', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '2014-11-11',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      var data = instance.__after();
      assert.deepEqual(data, undefined);
      done();
    })
  })
  it('__after, _validateInvoked', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        welefen: '2014-11-11',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      instance.rules = {name: 'required'};
      instance._validateInvoked = true;
      var data = instance.__after();
      assert.deepEqual(data, undefined);
      done();
    })
  })
  it('__after, has rules', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        name: '2014-11-11',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      instance.rules = {name: 'required'};
      var data = instance.__after();
      assert.deepEqual(data, undefined);
      assert.equal(instance._validateInvoked, true)
      done();
    })
  })
  it('__after, has rules, has value', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        name: '2014-11-11',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      instance.rules = {name: {
        required: true,
        value: ''
      }};
      var data = instance.__after();
      assert.equal(instance._validateInvoked, true);
      data.catch(function () {
        done();
      })
    })
  })
  it('__after, has rules, has value 1', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        name: '2014-11-11',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      instance.rules = {name: {
        required: true,
        value: 'welefen'
      }};
      var data = instance.__after();
      assert.deepEqual(data, undefined);
      assert.equal(instance._validateInvoked, true);
      done();
    })
  })
  it('__after, has errors', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        name: '',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      instance.rules = {name: 'required'};
      instance.fail = function(errno, errmsg){
        assert.equal(errno, 1001);
      }
      instance.__after()
      done();
    })
  })
  it('__after, has errors, message', function(done){
    getInstance({}, {
      _config: think.config(),
      _post: {
        name: '',
        suredy: '2014-11-10'
      },
      method: 'POST'
    }).then(function(instance){
      instance.rules = {name: 'required', value: 'required'};
      instance.http.end = function(data){
        assert.equal(data.errno, 1001);
        assert.deepEqual(Object.keys(data.errmsg), ['name', 'value'])
      }
      instance.__after().catch(function(){})
      done();
    })
  })
})


text:
actions :add, :remove

default_action :add if defined?(:default_action) # Chef > 10.8

attribute :alias_name,
  :kind_of => String,
  :name_attribute => true
attribute :command,
  :kind_of => String,
  :default => :add

# Default action for Chef <= 10.8
def initialize(*args)
  super
  @action = :add
end


text:
* Convert to supervisor (#42)
* Move towards a ruleset module instead of a registry (#41)
* Update build matrix and bump dependencies + fix warnings, typespecs and brittle tests

## Enhancements

* Force Jason for serialization (#40)
* Update all dependencies, add benchmarks

## v1.0.0 2018-03-20

### Enhancements

* [Flippant] - Add `dump/1` and `load/1` functions for backups and portability.

### Changes

* [Flippant.Adapter.Postgres] - Replace Poison with Jason for JSON encoding.
* [Flippant.Serializer] - Rename `dump`/`load` to `encode!`/`decode!`. This is
  partially to indicate that they will not return success tuples, but moreover
  to prevent confusion with the new export functions.

### Bug Fixes

* [Flippant] - Modify `enable/3` and `disable/3` to prevent duplicate values and
  operate atomically without a transaction.
* [Flippant] - Configure dialyzer and correct failing specifications.

## v0.4.2 2017-10-20

* [Flippant] - Documentation fixes to correct hexdocs loading.

## v0.4.1 2017-10-20

* [Flippant] - Revert the elixir constraint to `~> 1.4`

## v0.4.0 2017-10-20

### Enhancements

* [Flippant] - Add a new Postgres adatper, backed by Postgrex.
* [Flippant] - Add `exists?/1` for checking whether a feature exists at all,
  and `exists?/2` for checking whether a feature exists for a particular group.
* [Flippant] - Add `rename/2` for renaming existing features.
* [Flippant] - Merge additional values when enabling features. This prevents
  clobbering existing values in "last write wins" situations.
* [Flippant] - Support enabling or disabling of individual values. This makes it
  possible to remove a single value from a group's rules.
* [Flippant] - Add `setup/0` to facilitate adapter setup (i.e. Postgres).
* [Flippant.Adapters.Redis] - Accept options to configure the adapter's set key.

### Changes

* [Flippant.Adapter] - Values are no longer guaranteed to be sorted. Some
  adapters guarantee sorting, but race conditions prevent it in the Postgres
  adapter, so it is no longer guaranteed.
* [Flippant.Registry] - Use a named ETS table for rule storage rather than an
  Agent. This is slightly faster, and it prepares us for crash recovery.

### Bug Fixes

* [Flippant] - Correct guard logic for multiple `when` clauses.

## v0.3.0 2016-09-20

### Enhancements

* [Flippant] Add `breakdown/0` for complete details
* [Flippant] Rename `reset/0` to `clear/0`, and add `clear/1` variants that can
  clear either `:features` or `:groups`.
* [Flippant.Adapter] Explicitly sort feature keys
* [Flippant.Adapter.Redis] Only load the adpater if `redix` is available
* [Flippant.Adapter.Memory] Optimize the adapter for read conncurency

### Bug Fixes

* [Flippant.Adapter] Safely generate a breakdown without any rules
* [Flippant.Adatper.Redis] Use custom pipeline that is aware of empty lists

## v0.2.0 2016-08-08

* Added: Support for extracting the URL during Redix connection. The
  documentation now also illustrates use of `redis_opts` when setting the
  adapter to Redis.
* Added: Configurable serialization for adapters. Now JSON, MessagePack or some
  other custom option can be used instead of Erlang term storage.
* Added: Documentation for using a temporary worker to configure groups at boot
  time.

## v0.1.0 2016-08-02

* Initial release! Supports a Memory and Redis adapter.


text:
/*
* ScriptFileExecutionItem.java
*
* User: Greg Schueler greg@dtosolutions.com
* Created: 3/21/11 4:37 PM
*
*/
package com.dtolabs.rundeck.core.execution.workflow.steps.node.impl;

import com.dtolabs.rundeck.core.execution.workflow.steps.NodeDispatchStepExecutor;

/**
 * ScriptFileExecutionItem is ...
 *
 * @author Greg Schueler greg@dtosolutions.com
 */
public abstract class ScriptFileCommand implements ScriptFileCommandExecutionItem {

    public String getType() {
        return NodeDispatchStepExecutor.STEP_EXECUTION_TYPE;
    }

    @Override
    public String getNodeStepType() {
        return ScriptFileNodeStepExecutor.SERVICE_IMPLEMENTATION_NAME;
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=../../../../../../../libc/constant.ENOBUFS.html">

Redirecting to ../../../../../../../libc/constant.ENOBUFS.html...


text:
import setup from '../utilities/dom-setup';

import { addListenerSpy, delListenerSpy } from '../listener-spies';

/**
 * @name Store
 * @description
 * Stores the event listeners set, and exposes methods to modify the collection.
 */
import Store from 'event-store.js';

QUnit.module('EventsStore');

QUnit.test('interface', function(assert) {
    assert.type(Store.get, 'function', 'Store.get must be a function');
    assert.type(Store.add, 'function', 'Store.add must be a function');
    assert.type(Store.del, 'function', 'Store.del must be a function');
    assert.type(Store.run, 'function', 'Store.run must be a function');
});

QUnit.module('EventsStore functionalities', {
    beforeEach: function() {
        const fakeDOM = '\
            <button id="btn">\
                ★\
                Click here\
            </button>';

        setup(fakeDOM);
        this.el = document.getElementById('btn');
    },
    afterEach: function() {
        Store.del(this.el);
        addListenerSpy.reset();
        delListenerSpy.reset();
    }
});

QUnit.test('[ES01] add/get from events store', function(assert) {
    const noop = function noop() {};
    const addObj = Store.add(this.el, 'click', null, noop);
    const getObj = Store.get(this.el, 'click')[0];

    assert.ok(addObj && addObj === getObj, 'add/get from events store');

    sinon.assert.calledOnce(addListenerSpy);
    addListenerSpy.reset();

    Store.add(this.el, 'click', '.text', noop);
    const list = Store.get(this.el, 'click');

    assert.equal(list.length, 2);

    sinon.assert.notCalled(addListenerSpy);
    addListenerSpy.reset();

    Store.add(this.el, 'mouseover', '.icon', noop);
    const all = Store.get(this.el);

    assert.equal(all.mouseover.length, 1);

    sinon.assert.calledOnce(addListenerSpy);
});

const noop1 = () => {};
const noop2 = () => {};
const noop3 = () => {};

function setupDeleteTests() {
    Store.add(this.el, 'click', null, noop1);
    Store.add(this.el, 'click', '.add-btn', noop2);
    Store.add(this.el, 'click', '.delete-btn', noop3);
    Store.add(this.el, 'mouseover', null, sinon.spy());
    Store.add(document, 'keyup', null, sinon.spy());
}

QUnit.test('[ES02] del: by event\'s type', function(assert) {
    setupDeleteTests.call(this);

    Store.del(this.el, 'click');

    assert.equal(Store.get(this.el, 'click').length, 0);
    assert.equal(Store.get(this.el, 'mouseover').length, 1);

    sinon.assert.calledOnce(delListenerSpy);
    delListenerSpy.reset();

    Store.del(this.el, 'mouseover');

    assert.emptyObject(Store.get(this.el));

    sinon.assert.calledOnce(delListenerSpy);
});

QUnit.test('[ES03] del: by event\'s name and delegator', function(assert) {
    setupDeleteTests.call(this);

    Store.del(this.el, 'click', '.do-nothing');
    assert.equal(Store.get(this.el, 'click').length, 3);

    Store.del(this.el, 'click', '.delete-btn');
    assert.equal(Store.get(this.el, 'click').length, 2);

    sinon.assert.notCalled(delListenerSpy);
});

QUnit.test('[ES04] del: by event\'s name and specified handler', function(assert) {
    setupDeleteTests.call(this);

    Store.del(this.el, 'click', null, sinon.spy());
    assert.equal(Store.get(this.el, 'click').length, 3);

    Store.del(this.el, 'click', null, noop1);
    assert.equal(Store.get(this.el, 'click').length, 2);

    sinon.assert.notCalled(delListenerSpy);
});

QUnit.test('[ES05] del: by event\'s name with handler && delegator', function(assert) {
    setupDeleteTests.call(this);

    Store.del(this.el, 'click', '.do-nothing', sinon.spy());
    Store.del(this.el, 'click', '.add-btn', function() {});
    assert.equal(Store.get(this.el, 'click').length, 3);

    Store.del(this.el, 'click', '.add-btn', noop2);
    assert.equal(Store.get(this.el, 'click').length, 2);

    Store.del(this.el, 'click', null,  noop1);
    assert.equal(Store.get(this.el, 'click').length, 1);

    sinon.assert.notCalled(delListenerSpy);

    Store.del(this.el, 'click', '.delete-btn', noop3);

    sinon.assert.calledOnce(delListenerSpy);
});

QUnit.test('[ES06] del: special listeners [A]', function(assert) {
    Store.add(this.el, 'mouseenter', null, sinon.spy());
    Store.add(this.el, 'mouseenter', '.removed', sinon.spy());
    Store.add(this.el, 'mouseover', null, sinon.spy());

    Store.del(this.el, 'mouseover');

    const mouseoverHandlers = Store.get(this.el, 'mouseover');
    assert.equal(mouseoverHandlers.length, 1);
    assert.equal(mouseoverHandlers[0].origType, 'mouseenter');

    const mouseenterHandlers = Store.get(this.el, 'mouseenter');
    assert.equal(mouseenterHandlers.length, 1);
});

QUnit.test('[ES07] del: special listeners [B]', function(assert) {
    Store.add(this.el, 'mouseenter', null, sinon.spy());
    Store.add(this.el, 'mouseenter', '.removed', sinon.spy());
    Store.add(this.el, 'mouseover', null, sinon.spy());

    Store.del(this.el, 'mouseenter');

    const mouseoverHandlers = Store.get(this.el, 'mouseover');
    assert.equal(mouseoverHandlers.length, 1);
    assert.equal(mouseoverHandlers[0].origType, 'mouseover');

    const mouseenterHandlers = Store.get(this.el, 'mouseenter');
    assert.equal(mouseenterHandlers.length, 0);
});


text:
import MySQLdb
import MySQLdb.cursors
import sys
import pandas
import json
import pandas
##############################################################################################################
# KnowledgeBase class																						 #
# Prototype KnowledgeBase for NEMO																			 #
##############################################################################################################
# ****** INSTANCE VARIABLES ******                                                                           #
# HOST     -     host for the database (typically localhost), STRING                                         #
# PORT     -     Port number for database, MUST BE AN INTEGER!!                                              #
# USER     -     User name for database, STRING                                                              #
# PASSWD   -     Password for database, STRING                                                               #
# DATABASE -     Database name, STRING                                                                       #
# db       -     object connected to the database, DATABASE CONNECTION OBJECT                                #
# cursor   -     cursor that executes MySQL commands, CURSOR OBJECT                                          #
# X        -     attribute names, LIST of STRINGS                                                            #
# Y        -     target name, STRING					                                                     #
# schema   -     list containing MySQL compatible schema, format: ATTR_NAME ATTR_TYPE, LIST OF STRINGS       #
#                                                                                #
###############################################################################################################

class KnowledgeBase:
	#method to import data into the MySQL server
	#Preconditions:
	# * KnowledgeBase object is created with connection to db established
	# * data_file - a text file containing the data to be added to the databases
	#	Assumptions: The file is one comma-delimited record per line.
	#				 The first value for each line is the value to classify
	#				 The remaining values on each line are the attributes
	# * schema_file - a text file containing the MySQL schema for the table
	#	Assumptions: column_name data_type
	#	Assumptions: On separate lines, the file contains the MySQL schema for creation of the DATA table
	def importData(self, data_file, schema_file):

		self.cursor.execute("drop table if exists DATA;")
		#db.commit()

		#read in schema
		self.readSchemaFile(schema_file)
		stmt = "create table DATA ( "

		while len(self.schema) > 1:
			stmt = stmt + self.schema.pop() + ", "

		stmt = stmt + self.schema.pop() + " );"
		#create new data table
		self.cursor.execute(stmt);
		self.db.commit()

		#add new records
		f = open(data_file, 'r')
		for line in f:
			#print line
			stmt = "insert into DATA values ( "
			curr_ = line.split(',')

			for i in range(0,len(curr_)):
				curr_[i] = curr_[i].strip('\n')

			curr = tuple(curr_)
			#print curr
			#print len(curr)
			for i in range(0, len(curr)-1):
				stmt = stmt + "%s, "
			stmt = stmt + "%s )"
			#print stmt
			self.cursor.execute(stmt, curr)
		self.db.commit()
		#close the database

		f.close()

	#method to read schema file
	#Preconditions
	# * schema_file - a text file containing the MySQL schema for the table
	#	Assumptions: column_name data_type
	#	Assumptions: On separate lines, the file contains the MySQL schema for creation of the DATA table
	#Postconditions: Returns list object with schema
	def readSchemaFile(self, schema_file):
		f = open(schema_file, 'r')
		self.schema = []
		for line in f:
			self.schema.append(line.strip("\n"))
		f.close()
		self.schema.reverse()
		self.getXYTokens()
		#return schema

	#method to get a list of names from the attributes and targets
	#Preconditions:
	# * schema has already been read from file (ie readSchemaFile has already been called)
	#Postconditions: self.X has names of the attributes, self.Y has the names of the target
	def getXYTokens(self):
		self.X = []
		for i in range(0,len(self.schema)):
			tokens = self.schema[i].split(' ')
			if(tokens[0] != self.Y):
				self.X.append(tokens[0])
		self.X.reverse()
		#tokens = self.schema[len(self.schema)-1].split(' ')
		#self.Y = tokens[0]

	def updateDatabaseWithResults(self, algorithm):
		# results = (algorithm.results['ID'], algorithm.results['Name'], algorithm.results['Accuracy'],  algorithm.results['Precision'], algorithm.results['Recall'], algorithm.results['F1'], str(algorithm.results['Confusion_Matrix']).replace('\n', ""))
		# stmt = "insert into AlgorithmResults(algorithm_id, algorithm_name, accuracy, prec, recall, f1, confusion_matrix) values (%s,%s,%s,%s,%s,%s,%s)"

		results = (algorithm.results['ID'], algorithm.results['Name'], algorithm.results['Accuracy'],  algorithm.results['Precision'], algorithm.results['Recall'], algorithm.results['F1'])
		stmt = "insert into AlgorithmResults(algorithm_id, algorithm_name, accuracy, prec, recall, f1) values (%s,%s,%s,%s,%s,%s)"
		# print stmt
		# print str(results)
		self.executeQuery(stmt, results)

	def getData(self):
		stmt = "select * from DATA"
		return pandas.read_sql_query(stmt, self.db)

	#Constructor
	#Preconditions:
	# * login_file - a text file containing the login and database information
	#	Assumptions: On separate lines, the file must contain HOST, PORT, MySQL USER NAME, PASSWORD, DATABASE
	#Postconditions: Connects to database
	def __init__(self, config_file):
		with open(config_file) as fd:
			json_data = json.load(fd)

		info = json_data['DATABASE']
		self.HOST = info['HOST']
		self.PORT = int(info['PORT'])
		self.USER = info['USER']
		self.PASSWD = info['PASS']
		self.DATABASE = info['DB']

		self.db = MySQLdb.connect(host = self.HOST, port = self.PORT, user = self.USER, passwd = self.PASSWD, db = self.DATABASE)
		self.cursor = self.db.cursor()

		file_info = json_data['DATA']
		self.schema = None
		self.X = None
		self.Y = file_info['CLASS']
		print file_info['DATA']
		print file_info['SCHEMA']
		print self.Y
		self.multi = bool(file_info['MULTI-CLASS'])
		self.importData(file_info['DATA'], file_info['SCHEMA'])

	def executeQuery(self, query, args=None):
		complete = False
		#print query
		#if args is not None: print args
		while not complete:
			try:
				if args is None:
					self.cursor.execute(query)
					self.db.commit()
				else:
					self.cursor.execute(query, args)
			except (AttributeError, MySQLdb.OperationalError):
				self.db = MySQLdb.connect(host = self.HOST, port = self.PORT, user = self.USER, passwd = self.PASSWD, db = self.DATABASE)
				self.cursor = self.db.cursor()
			complete = True

	def fetchOne(self):
		complete = False
		while not complete:
			try:
				return self.cursor.fetchone()
			except (AttributeError, MySQLdb.OperationalError):
				self.db = MySQLdb.connect(host = self.HOST, port = self.PORT, user = self.USER, passwd = self.PASSWD, db = self.DATABASE)
				self.cursor = self.db.cursor()
			complete=True

	def fetchAll(self):
		complete = False
		while not complete:
			try:
				return self.cursor.fetchall()
			except (AttributeError, MySQLdb.OperationalError):
				self.db = MySQLdb.connect(host = self.HOST, port = self.PORT, user = self.USER, passwd = self.PASSWD, db = self.DATABASE)
				self.cursor = self.db.cursor()
			complete=True

	def removeModelFromRepository(self, model):
		stmt = "delete from ModelRepository where algorithm_id = " + model.algorithm_id
		self.executeQuery(stmt)

	def updateDatabaseWithModel(self, model):
		#check to see if model is in database
		#if so, add modified char to id (mod_id)
		# update ModelRepository set algorithm_id = mod_id where algorithm_id = model.algorithm_id
		stmt = "select * from ModelRepository where algorithm_id = " + model.algorithm_id
		self.executeQuery(stmt)
		row = self.fetchOne()
		mod_id = None
		if row is not None: #it exists in the database
			mod_id = model.algorithm_id + "*"
			stmt = "update ModelRepository set algorithm_id = \'" + mod_id + "\' where algorithm_id = \'" + model.algorithm_id + "\'"
			#print stmt
			self.executeQuery(stmt)
		arguments = model.get_params()
		#print arguments
		for key, value in arguments.iteritems():
			#print key + ": " + str(value)
			stmt = "insert into ModelRepository (algorithm_id, algorithm_name, arg_type, arg_val) values ( %s, %s, %s, %s)"
			args = (model.algorithm_id, model.algorithm_name, key, str(value))
			self.executeQuery(stmt, args)
		#remove backup model...
		if mod_id is not None: #we had to use mod_id
			stmt = "delete from ModelRepository where algorithm_id = \'" + mod_id + "\'"
			#print stmt
			self.executeQuery(stmt)
		self.db.commit()

	def addCurrentModel(self, model):
		stmt = "insert into CurrentModel(algorithm_id) values (%s)"
		args = (model.algorithm_id,)
		self.executeQuery(stmt, args)

	def removeCurrentModel(self, model):
		stmt = "delete from CurrentModel where algorithm_id = " + model.algorithm_id
		self.executeQuery(stmt)

	def getData(self):
		stmt = "select * from DATA"
		return pandas.read_sql_query(stmt, self.db)

	#DESTRUCTOR
	#commits all changes to database and closes the connection
	def __del__(self):
		self.db.commit()
		self.db.close()

############################################################################################################################################
# 	END OF KNOWLEDGE BASE CLASS 																										   #
############################################################################################################################################

######## Executable For Testing #########
def main():
	kb = KnowledgeBase("config/config.json")

if __name__ == "__main__":
	main()


text:
ALTER TABLE %DB_TBL_PREFIX%entry
ADD COLUMN status            smallint DEFAULT 1 NOT NULL;


text:
<?php
class ControllerExtensionReportCustomerActivity extends Controller {
	public function index() {
		$this->load->language('extension/report/customer_activity');

		$this->document->setTitle($this->language->get('heading_title'));

		$this->load->model('setting/setting');

		if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
			$this->model_setting_setting->editSetting('report_customer_activity', $this->request->post);

			$this->session->data['success'] = $this->language->get('text_success');

			$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report', true));
		}

		if (isset($this->error['warning'])) {
			$data['error_warning'] = $this->error['warning'];
		} else {
			$data['error_warning'] = '';
		}

		$data['breadcrumbs'] = array();

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_home'),
			'href' => $this->url->link('common/dashboard', 'user_token=' . $this->session->data['user_token'], true)
		);

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_extension'),
			'href' => $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report', true)
		);

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('heading_title'),
			'href' => $this->url->link('extension/report/customer_activity', 'user_token=' . $this->session->data['user_token'], true)
		);

		$data['action'] = $this->url->link('extension/report/customer_activity', 'user_token=' . $this->session->data['user_token'], true);

		$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=report', true);

		if (isset($this->request->post['report_customer_activity_status'])) {
			$data['report_customer_activity_status'] = $this->request->post['report_customer_activity_status'];
		} else {
			$data['report_customer_activity_status'] = $this->config->get('report_customer_activity_status');
		}

		if (isset($this->request->post['report_customer_activity_sort_order'])) {
			$data['report_customer_activity_sort_order'] = $this->request->post['report_customer_activity_sort_order'];
		} else {
			$data['report_customer_activity_sort_order'] = $this->config->get('report_customer_activity_sort_order');
		}

		$data['header'] = $this->load->controller('common/header');
		$data['column_left'] = $this->load->controller('common/column_left');
		$data['footer'] = $this->load->controller('common/footer');

		$this->response->setOutput($this->load->view('extension/report/customer_activity_form', $data));
	}

	protected function validate() {
		if (!$this->user->hasPermission('modify', 'extension/report/customer_activity')) {
			$this->error['warning'] = $this->language->get('error_permission');
		}

		return !$this->error;
	}

	public function report() {
		$this->load->language('extension/report/customer_activity');

		if (isset($this->request->get['filter_customer'])) {
			$filter_customer = $this->request->get['filter_customer'];
		} else {
			$filter_customer = '';
		}

		if (isset($this->request->get['filter_ip'])) {
			$filter_ip = $this->request->get['filter_ip'];
		} else {
			$filter_ip = '';
		}

		if (isset($this->request->get['filter_date_start'])) {
			$filter_date_start = $this->request->get['filter_date_start'];
		} else {
			$filter_date_start = '';
		}

		if (isset($this->request->get['filter_date_end'])) {
			$filter_date_end = $this->request->get['filter_date_end'];
		} else {
			$filter_date_end = '';
		}

		if (isset($this->request->get['page'])) {
			$page = $this->request->get['page'];
		} else {
			$page = 1;
		}

		$this->load->model('extension/report/customer');

		$data['activities'] = array();

		$filter_data = array(
			'filter_customer'   => $filter_customer,
			'filter_ip'         => $filter_ip,
			'filter_date_start'	=> $filter_date_start,
			'filter_date_end'	=> $filter_date_end,
			'start'             => ($page - 1) * 20,
			'limit'             => 20
		);

		$activity_total = $this->model_extension_report_customer->getTotalCustomerActivities($filter_data);

		$results = $this->model_extension_report_customer->getCustomerActivities($filter_data);

		foreach ($results as $result) {
			$comment = vsprintf($this->language->get('text_activity_' . $result['key']), json_decode($result['data'], true));

			$find = array(
				'customer_id=',
				'order_id='
			);

			$replace = array(
				$this->url->link('customer/customer/edit', 'user_token=' . $this->session->data['user_token'] . '&customer_id=', true),
				$this->url->link('sale/order/info', 'user_token=' . $this->session->data['user_token'] . '&order_id=', true)
			);

			$data['activities'][] = array(
				'comment'    => str_replace($find, $replace, $comment),
				'ip'         => $result['ip'],
				'date_added' => date($this->language->get('datetime_format'), strtotime($result['date_added']))
			);
		}

		$data['user_token'] = $this->session->data['user_token'];

		$url = '';

		if (isset($this->request->get['filter_customer'])) {
			$url .= '&filter_customer=' . urlencode($this->request->get['filter_customer']);
		}

		if (isset($this->request->get['filter_ip'])) {
			$url .= '&filter_ip=' . $this->request->get['filter_ip'];
		}

		if (isset($this->request->get['filter_date_start'])) {
			$url .= '&filter_date_start=' . $this->request->get['filter_date_start'];
		}

		if (isset($this->request->get['filter_date_end'])) {
			$url .= '&filter_date_end=' . $this->request->get['filter_date_end'];
		}

		$pagination = new Pagination();
		$pagination->total = $activity_total;
		$pagination->page = $page;
		$pagination->limit = $this->config->get('config_limit_admin');
		$pagination->url = $this->url->link('report/report', 'user_token=' . $this->session->data['user_token'] . '&code=customer_activity' . $url . '&page={page}', true);

		$data['pagination'] = $pagination->render();

		$data['results'] = sprintf($this->language->get('text_pagination'), ($activity_total) ? (($page - 1) * $this->config->get('config_limit_admin')) + 1 : 0, ((($page - 1) * $this->config->get('config_limit_admin')) > ($activity_total - $this->config->get('config_limit_admin'))) ? $activity_total : ((($page - 1) * $this->config->get('config_limit_admin')) + $this->config->get('config_limit_admin')), $activity_total, ceil($activity_total / $this->config->get('config_limit_admin')));

		$data['filter_customer'] = $filter_customer;
		$data['filter_ip'] = $filter_ip;
		$data['filter_date_start'] = $filter_date_start;
		$data['filter_date_end'] = $filter_date_end;

		return $this->load->view('extension/report/customer_activity_info', $data);
	}
}


text:
@implementation ServerCenter

@synthesize httpTokenSalt = _httpTokenSalt;

static ServerCenter *center = nil;

+ (ServerCenter *)shareCenter{
    @synchronized(self) {
        if(center == nil) {
            center = [[[self class] alloc] init];
        }
    }
    return center;
}

- (instancetype)init{
    if (self = [super init]) {
    }

    return self;
}

+(id)allocWithZone:(NSZone *)zone
{
    @synchronized(self)
    {
        if (center == nil)
        {
            center = [super allocWithZone:zone];
            return center;
        }
    }
    return nil;
}

- (ServerInfo *)getCurrentServer{
    ServerInfo *server = [ServerInfo new];
    server.data.pub_key = ServerPublickey;
    return server;
}

- (NSString *)getCurrentServer_userEcdhkey{
    NSString *ecdhkey = [KeyHandle getECDHkeyUsePrivkey:[[LKUserCenter shareCenter] currentLoginUser].prikey PublicKey:[self getCurrentServer].data.pub_key];

    return ecdhkey;
}

- (NSData *)httpTokenSalt{

    if (_httpTokenSalt && _httpTokenSalt.length > 0) {
        return _httpTokenSalt;
    }
    return self.httpTokenResponse.salt;
}

- (GenerateTokenResponse *)httpTokenResponse{
    if (!_httpTokenResponse) {
        NSString *saltHex = GJCFUDFGetValue([[LKUserCenter shareCenter] currentLoginUser].pub_key);
        if (!GJCFStringIsNull(saltHex)) {
            NSData *gcmData = [StringTool hexStringToData:saltHex];
            GcmData *gcm = [GcmData parseFromData:gcmData error:nil];
            NSData *saltData = [ConnectTool decodeGcmDataWithGcmData:gcm publickey:[[LKUserCenter shareCenter] currentLoginUser].pub_key];
            _httpTokenResponse = [GenerateTokenResponse parseFromData:saltData error:nil];
            return _httpTokenResponse;
        }
    }
    return _httpTokenResponse;
}

- (NSTimeInterval)saltDeadTime{
    if (_saltDeadTime == 0) {
        _saltDeadTime = self.httpTokenResponse.expired + [[NSDate date] timeIntervalSince1970];
    }
    return _saltDeadTime;
}

- (void)setHttpTokenSalt:(NSData *)httpTokenSalt{
    if (httpTokenSalt && httpTokenSalt.length > 0) {
        _httpTokenSalt = httpTokenSalt;
    }
}

- (NSData *)defineAad{
    if (_defineAad.length < 16) {
        _defineAad = [InnerAadStringDefine dataUsingEncoding:NSUTF8StringEncoding];
    }
    return _defineAad;
}

@end


text:
@implementation ApptentiveJSONSerialization
+ (NSData *)dataWithJSONObject:(id)obj options:(ATJSONWritingOptions)opt error:(NSError **)error {
	if ([NSJSONSerialization isValidJSONObject:obj]) {
		NSData *jsonData = nil;
		@try {
			jsonData = [NSJSONSerialization dataWithJSONObject:obj options:opterr error:error];
		} @catch (NSException *exception) {
			ApptentiveLogError(@"Unable to create JSON data from object: %@ Exception: %@", obj, exception);
		}
		return jsonData;
	} else {
		ApptentiveLogError(@"Attempting to create JSON data from an invalid JSON object.");
		return nil;
	}
}

+ (NSString *)stringWithJSONObject:(id)obj options:(ATJSONWritingOptions)opt error:(NSError **)error {
	NSData *d = [ApptentiveJSONSerialization dataWithJSONObject:obj options:opt error:error];
	if (!d) {
		return nil;
	}
	NSString *s = [[NSString alloc] initWithData:d encoding:NSUTF8StringEncoding];
	return s;
}

+ (id)JSONObjectWithData:(NSData *)data error:(NSError **)error {
	return [NSJSONSerialization JSONObjectWithData:data options:0 error:error];
}

+ (id)JSONObjectWithString:(NSString *)string error:(NSError **)error {
	NSData *d = [string dataUsingEncoding:NSUTF8StringEncoding];
	NSObject *result = [ApptentiveJSONSerialization JSONObjectWithData:d error:error];
	return result;
}
@end


text:
import { Box, Serif, Spacer } from "@artsy/palette"
import { RelatedCollectionsRail_collections } from "__generated__/RelatedCollectionsRail_collections.graphql"
import { track } from "Artsy/Analytics"
import * as Schema from "Artsy/Analytics/Schema"
import { ArrowButton, Carousel } from "Components/v2/Carousel"
import { once, take } from "lodash"
import React from "react"
import { createFragmentContainer, graphql } from "react-relay"
import Waypoint from "react-waypoint"
import { data as sd } from "sharify"
import styled from "styled-components"
import Events from "Utils/Events"
import { RelatedCollectionEntityFragmentContainer as RelatedCollectionEntity } from "./RelatedCollectionEntity"

interface RelatedCollectionsRailProps {
  collections: RelatedCollectionsRail_collections
  title?: string
}

@track(null, {
  dispatch: data => Events.postEvent(data),
})
export class RelatedCollectionsRail extends React.Component<
  RelatedCollectionsRailProps
> {
  @track({
    action_type: Schema.ActionType.Impression,
    context_module: Schema.ContextModule.CollectionsRail,
    context_page_owner_type: Schema.OwnerType.Collection,
  })
  trackImpression() {
    // noop
  }

  @track({
    action_type: Schema.ActionType.Click,
    context_module: Schema.ContextModule.CollectionsRail,
    context_page_owner_type: Schema.OwnerType.Collection,
    type: Schema.Type.Button,
    subject: Schema.Subject.ClickedNextButton,
  })
  trackCarouselNav() {
    // noop
  }

  render() {
    const { collections } = this.props
    const { title } = this.props
    if (collections.length > 3) {
      return (
        <Box>
          <Waypoint onEnter={once(this.trackImpression.bind(this))} />
          <Serif size="8" color="black100">
            More like {title}
          </Serif>
          <Spacer pb={4} />

          <Carousel
            height="200px"
            options={{
              groupCells: sd.IS_MOBILE ? 1 : 4,
              cellAlign: "left",
              contain: true,
              wrapAround: sd.IS_MOBILE ? true : false,
              pageDots: false,
              draggable: sd.IS_MOBILE ? true : false,
            }}
            onArrowClick={this.trackCarouselNav.bind(this)}
            data={take(collections, 16)}
            render={slide => {
              return <RelatedCollectionEntity collection={slide} />
            }}
            renderLeftArrow={({ Arrow }) => {
              return (
                <ArrowContainer>
                  <Arrow />
                </ArrowContainer>
              )
            }}
            renderRightArrow={({ Arrow }) => {
              return (
                <ArrowContainer>
                  {collections.length > 4 && <Arrow />}
                </ArrowContainer>
              )
            }}
          />
        </Box>
      )
    } else {
      return null
    }
  }
}

const ArrowContainer = styled(Box)`
  align-self: flex-start;

  ${ArrowButton} {
    height: 60%;
  }
`

export const RelatedCollectionsRailFragmentContainer = createFragmentContainer(
  RelatedCollectionsRail,
  {
    collections: graphql`
      fragment RelatedCollectionsRail_collections on MarketingCollection
        @relay(plural: true) {
        ...RelatedCollectionEntity_collection
      }
    `,
  }
)


text:
module Fog
  module Compute
    class AWS
      class Real

        require 'fog/aws/parsers/compute/describe_reserved_instances_offerings'

        # Describe all or specified reserved instances offerings
        #
        # ==== Parameters
        # * filters<~Hash> - List of filters to limit results with
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'requestId'<~String> - Id of request
        #     * 'reservedInstancesOfferingsSet'<~Array>:
        #       * 'availabilityZone'<~String> - availability zone of offering
        #       * 'duration'<~Integer> - duration, in seconds, of offering
        #       * 'fixedPrice'<~Float> - purchase price of offering
        #       * 'instanceType'<~String> - instance type of offering
        #       * 'productDescription'<~String> - description of offering
        #       * 'reservedInstancesOfferingId'<~String> - id of offering
        #       * 'usagePrice'<~Float> - usage price of offering, per hour
        #
        # {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstancesOfferings.html]
        def describe_reserved_instances_offerings(filters = {})
          params = Fog::AWS.indexed_filters(filters)
          request({
            'Action'    => 'DescribeReservedInstancesOfferings',
            :idempotent => true,
            :parser     => Fog::Parsers::Compute::AWS::DescribeReservedInstancesOfferings.new
          }.merge!(params))
        end
      end

      class Mock
        def describe_reserved_instances_offerings(filters = {})
          response = Excon::Response.new
          response.status = 200

          self.data[:reserved_instances_offerings] ||= [{
            'reservedInstancesOfferingId' => Fog::AWS::Mock.reserved_instances_offering_id,
            'instanceType'        => 'm1.small',
            'availabilityZone'    => 'us-east-1d',
            'duration'            => 31536000,
            'fixedPrice'          => 350.0,
            'usagePrice'          => 0.03,
            'productDescription'  => 'Linux/UNIX',
            'instanceTenancy'     => 'default',
            'currencyCode'         => 'USD'
          }]

          response.body = {
            'reservedInstancesOfferingsSet' => self.data[:reserved_instances_offerings],
            'requestId' => Fog::AWS::Mock.request_id
          }

          response
        end
      end
    end
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Biblthca Lichenol. 78: 252 (2001)

#### Original name
Badimia elixii Kalb & Lumbsch

### Remarks
null