text:
define([
    'jquery',
    'underscore',
    'viewcontroller',
    'chroma',
    'slickformatters',
    'slickeditors'
], function($, _, ViewControllers, chroma, slickformatters, slickeditors) {

  // we only use the base attribute class, no need to get the base class
  /** @private */
  var EmperorAttributeABC = ViewControllers.EmperorAttributeABC;
  /**
   * @class VisibilityController
   *
   * Manipulates and displays the visibility of objects on screen.
   *
   * @param {Node} container Container node to create the controller in.
   * @param {Object} decompViewDict This object is keyed by unique
   * identifiers and the values are DecompositionView objects referring to a
   * set of objects presented on screen. This dictionary will usually be shared
   * by all the tabs in the application. This argument is passed by reference.
   *
   * @return {VisibilityController} An instance of VisibilityController
   * @constructs VisibilityController
   * @extends EmperorAttributeABC
   */
  function VisibilityController(container, decompViewDict) {
    var helpmenu = 'Change the visibility of the attributes on the plot, ' +
                   'such as spheres, vectors and ellipsoids.';
    var title = 'Visibility';

    // Constant for width in slick-grid
    var SLICK_WIDTH = 25, scope = this;

    // Build the options dictionary
    var options = {'valueUpdatedCallback': function(e, args) {
      var visible = args.item.value;
      var group = args.item.plottables;
      var element = scope.getView();
      scope.setPlottableAttributes(element, visible, group);
    },
      'categorySelectionCallback': function(evt, params) {
        var category = scope.$select.val();

        var decompViewDict = scope.getView();

        // getting all unique values per categories
        var uniqueVals = decompViewDict.decomp.getUniqueValuesByCategory(
          category);
        // getting color for each uniqueVals
        var attributes = {};
        _.each(uniqueVals, function(value) {
          attributes[value] = true;
        });
        // fetch the slickgrid-formatted data
        var data = decompViewDict.setCategory(
          attributes, scope.setPlottableAttributes, category);

        scope.setSlickGridDataset(data);
      },
      'slickGridColumn': {id: 'title', name: '', field: 'value',
        sortable: false, maxWidth: SLICK_WIDTH,
        minWidth: SLICK_WIDTH,
        formatter: Slick.Formatters.Checkmark,
        editor: Slick.Editors.Checkbox}};

    EmperorAttributeABC.call(this, container, title, helpmenu,
        decompViewDict, options);
    return this;
  }
  VisibilityController.prototype = Object.create(EmperorAttributeABC.prototype);
  VisibilityController.prototype.constructor = EmperorAttributeABC;

  /**
   *
   * Private method to reset all objects to be visible.
   *
   * @extends EmperorAttributeABC
   * @private
   *
   */
  VisibilityController.prototype._resetAttribute = function() {
    EmperorAttributeABC.prototype._resetAttribute.call(this);

    _.each(this.decompViewDict, function(view) {
      view.setVisibility(true);
      view.showEdgesForPlottables();
    });
  };

  /**
   * Helper function to set the visibility of plottable
   *
   * @param {Object} scope the scope where the plottables exist
   * @param {boolean} visible Visibility of the plottables
   * @param {Object[]} group Array of objects that should be changed in scope
   */
  VisibilityController.prototype.setPlottableAttributes =
      function(scope, visible, group) {
    scope.setVisibility(visible, group);
  };

  return VisibilityController;
});


text:
<!DOCTYPE html>

<title>OffscreenCanvas test: 2d.transformation.order</title>

2d.transformation.order

Transformations are applied in the right order

redpajama_set_name: RedPajamaGithub


text:
"use strict";

var goog = goog || {};
goog.exportSymbol = function() {};
goog.exportProperty = function() {};

var v86util = v86util || {};

// pad string with spaces on the right
v86util.pads = function(str, len)
{
    str = (str || str === 0) ? str + "" : "";
    return str.padEnd(len, " ");
};

// pad string with zeros on the left
v86util.pad0 = function(str, len)
{
    str = (str || str === 0) ? str + "" : "";
    return str.padStart(len, "0");
};

// generates array given size with zeros
v86util.zeros = function(size)
{
    return Array(size).fill(0);
};

// generates [0, 1, 2, ..., size-1]
v86util.range = function(size)
{
    return Array.from(Array(size).keys());
};

v86util.view = function(constructor, memory, offset, length)
{
    return new Proxy({},
        {
            get: function(target, property, receiver)
            {
                const b = new constructor(memory.buffer, offset, length);
                const x = b[property];
                if(typeof x === "function")
                {
                    return x.bind(b);
                }
                dbg_assert(/^\d+$/.test(property) || property === "buffer" || property === "length" ||
                    property === "BYTES_PER_ELEMENT" || property === "byteOffset");
                return x;
            },
            set: function(target, property, value, receiver)
            {
                dbg_assert(/^\d+$/.test(property));
                new constructor(memory.buffer, offset, length)[property] = value;
                return true;
            },
        });
};

/**
 * number to hex
 * @param {number} n
 * @param {number=} len
 * @return {string}
 */
function h(n, len)
{
    if(!n)
    {
        var str = "";
    }
    else
    {
        var str = n.toString(16);
    }

    return "0x" + v86util.pad0(str.toUpperCase(), len || 1);
}

function hex_dump(buffer)
{
    function hex(n, len)
    {
        return v86util.pad0(n.toString(16).toUpperCase(), len);
    }

    const result = [];
    let offset = 0;

    for(; offset + 15 < buffer.length; offset += 16)
    {
        let line = hex(offset, 5) + "   ";

        for(let j = 0; j < 0x10; j++)
        {
            line += hex(buffer[offset + j], 2) + " ";
        }

        line += "  ";

        for(let j = 0; j < 0x10; j++)
        {
            const x = buffer[offset + j];
            line += (x >= 33 && x !== 34 && x !== 92 && x <= 126) ? String.fromCharCode(x) : ".";
        }

        result.push(line);
    }

    let line = hex(offset, 5) + "   ";

    for(; offset < buffer.length; offset++)
    {
        line += hex(buffer[offset], 2) + " ";
    }

    const remainder = offset & 0xF;
    line += "   ".repeat(0x10 - remainder);
    line += "  ";

    for(let j = 0; j < remainder; j++)
    {
        const x = buffer[offset + j];
        line += (x >= 33 && x !== 34 && x !== 92 && x <= 126) ? String.fromCharCode(x) : ".";
    }

    result.push(line);

    return "\n" + result.join("\n") + "\n";
}

if(typeof crypto !== "undefined" && crypto.getRandomValues)
{
    let rand_data = new Int32Array(1);

    v86util.get_rand_int = function()
    {
        crypto.getRandomValues(rand_data);
        return rand_data[0];
    };
}
else if(typeof require !== "undefined")
{
    /** @type {{ randomBytes: Function }} */
    const crypto = require("crypto");

    v86util.get_rand_int = function()
    {
        return crypto.randomBytes(4)["readInt32LE"](0);
    };
}
else
{
    dbg_assert(false, "Unsupported platform: No cryptographic random values");
}

(function()
{
    if(typeof Math.clz32 === "function" && Math.clz32(0) === 32 &&
       Math.clz32(0x12345) === 15 && Math.clz32(-1) === 0)
    {
        /**
         * calculate the integer logarithm base 2 of a byte
         * @param {number} x
         * @return {number}
         */
        v86util.int_log2_byte = function(x)
        {
            dbg_assert(x > 0);
            dbg_assert(x < 0x100);

            return 31 - Math.clz32(x);
        };

        /**
         * calculate the integer logarithm base 2
         * @param {number} x
         * @return {number}
         */
        v86util.int_log2 = function(x)
        {
            dbg_assert(x > 0);

            return 31 - Math.clz32(x);
        };

        return;
    }

    var int_log2_table = new Int8Array(256);

    for(var i = 0, b = -2; i < 256; i++)
    {
        if(!(i & i - 1))
            b++;

        int_log2_table[i] = b;
    }

    /**
     * calculate the integer logarithm base 2 of a byte
     * @param {number} x
     * @return {number}
     */
    v86util.int_log2_byte = function(x)
    {
        dbg_assert(x > 0);
        dbg_assert(x < 0x100);

        return int_log2_table[x];
    };

    /**
     * calculate the integer logarithm base 2
     * @param {number} x
     * @return {number}
     */
    v86util.int_log2 = function(x)
    {
        x >>>= 0;
        dbg_assert(x > 0);

        // http://jsperf.com/integer-log2/6
        var tt = x >>> 16;

        if(tt)
        {
            var t = tt >>> 8;
            if(t)
            {
                return 24 + int_log2_table[t];
            }
            else
            {
                return 16 + int_log2_table[tt];
            }
        }
        else
        {
            var t = x >>> 8;
            if(t)
            {
                return 8 + int_log2_table[t];
            }
            else
            {
                return int_log2_table[x];
            }
        }
    };
})();

/**
 * @constructor
 *
 * Queue wrapper around Uint8Array
 * Used by devices such as the PS2 controller
 */
function ByteQueue(size)
{
    var data = new Uint8Array(size),
        start,
        end;

    dbg_assert((size & size - 1) === 0);

    this.length = 0;

    this.push = function(item)
    {
        if(this.length === size)
        {
            // intentional overwrite
        }
        else
        {
            this.length++;
        }

        data[end] = item;
        end = end + 1 & size - 1;
    };

    this.shift = function()
    {
        if(!this.length)
        {
            return -1;
        }
        else
        {
            var item = data[start];

            start = start + 1 & size - 1;
            this.length--;

            return item;
        }
    };

    this.peek = function()
    {
        if(!this.length)
        {
            return -1;
        }
        else
        {
            return data[start];
        }
    };

    this.clear = function()
    {
        start = 0;
        end = 0;
        this.length = 0;
    };

    this.clear();
}

/**
 * @constructor
 *
 * Queue wrapper around Float32Array
 * Used by devices such as the sound blaster sound card
 */
function FloatQueue(size)
{
    this.size = size;
    this.data = new Float32Array(size);
    this.start = 0;
    this.end = 0;
    this.length = 0;

    dbg_assert((size & size - 1) === 0);
}

FloatQueue.prototype.push = function(item)
{
    if(this.length === this.size)
    {
        // intentional overwrite
        this.start = this.start + 1 & this.size - 1;
    }
    else
    {
        this.length++;
    }

    this.data[this.end] = item;
    this.end = this.end + 1 & this.size - 1;
};

FloatQueue.prototype.shift = function()
{
    if(!this.length)
    {
        return undefined;
    }
    else
    {
        var item = this.data[this.start];

        this.start = this.start + 1 & this.size - 1;
        this.length--;

        return item;
    }
};

FloatQueue.prototype.shift_block = function(count)
{
    var slice = new Float32Array(count);

    if(count > this.length)
    {
        count = this.length;
    }
    var slice_end = this.start + count;

    var partial = this.data.subarray(this.start, slice_end);

    slice.set(partial);
    if(slice_end >= this.size)
    {
        slice_end -= this.size;
        slice.set(this.data.subarray(0, slice_end), partial.length);
    }
    this.start = slice_end;

    this.length -= count;

    return slice;
};

FloatQueue.prototype.peek = function()
{
    if(!this.length)
    {
        return undefined;
    }
    else
    {
        return this.data[this.start];
    }
};

FloatQueue.prototype.clear = function()
{
    this.start = 0;
    this.end = 0;
    this.length = 0;
};

/**
 * Simple circular queue for logs
 *
 * @param {number} size
 * @constructor
 */
function CircularQueue(size)
{
    this.data = [];
    this.index = 0;
    this.size = size;
}

CircularQueue.prototype.add = function(item)
{
    this.data[this.index] = item;
    this.index = (this.index + 1) % this.size;
};

CircularQueue.prototype.toArray = function()
{
    return [].slice.call(this.data, this.index).concat([].slice.call(this.data, 0, this.index));
};

CircularQueue.prototype.clear = function()
{
    this.data = [];
    this.index = 0;
};

/**
 * @param {Array} new_data
 */
CircularQueue.prototype.set = function(new_data)
{
    this.data = new_data;
    this.index = 0;
};

function dump_file(ab, name)
{
    if(!(ab instanceof Array))
    {
        ab = [ab];
    }

    var blob = new Blob(ab);
    download(blob, name);
}

function download(file_or_blob, name)
{
    var a = document.createElement("a");
    a["download"] = name;
    a.href = window.URL.createObjectURL(file_or_blob);
    a.dataset["downloadurl"] = ["application/octet-stream", a["download"], a.href].join(":");

    if(document.createEvent)
    {
        var ev = document.createEvent("MouseEvent");
        ev.initMouseEvent("click", true, true, window,
                          0, 0, 0, 0, 0, false, false, false, false, 0, null);
        a.dispatchEvent(ev);
    }
    else
    {
        a.click();
    }

    window.URL.revokeObjectURL(a.href);
}

/**
 * A simple 1d bitmap
 * @constructor
 */
v86util.Bitmap = function(length_or_buffer)
{
    if(typeof length_or_buffer === "number")
    {
        this.view = new Uint8Array(length_or_buffer + 7 >> 3);
    }
    else if(length_or_buffer instanceof ArrayBuffer)
    {
        this.view = new Uint8Array(length_or_buffer);
    }
    else
    {
        dbg_assert(false, "v86util.Bitmap: Invalid argument");
    }
};

v86util.Bitmap.prototype.set = function(index, value)
{
    const bit_index = index & 7;
    const byte_index = index >> 3;
    const bit_mask = 1 << bit_index;

    this.view[byte_index] =
        value ? this.view[byte_index] | bit_mask : this.view[byte_index] & ~bit_mask;
};

v86util.Bitmap.prototype.get = function(index)
{
    const bit_index = index & 7;
    const byte_index = index >> 3;

    return this.view[byte_index] >> bit_index & 1;
};

v86util.Bitmap.prototype.get_buffer = function()
{
    return this.view.buffer;
};

if(typeof XMLHttpRequest === "undefined")
{
    v86util.load_file = load_file_nodejs;
}
else
{
    v86util.load_file = load_file;
}

/**
 * @param {string} filename
 * @param {Object} options
 * @param {number=} n_tries
 */
function load_file(filename, options, n_tries)
{
    var http = new XMLHttpRequest();

    http.open(options.method || "get", filename, true);

    if(options.as_json)
    {
        http.responseType = "json";
    }
    else
    {
        http.responseType = "arraybuffer";
    }

    if(options.headers)
    {
        var header_names = Object.keys(options.headers);

        for(var i = 0; i < header_names.length; i++)
        {
            var name = header_names[i];
            http.setRequestHeader(name, options.headers[name]);
        }
    }

    if(options.range)
    {
        let start = options.range.start;
        let end = start + options.range.length - 1;
        http.setRequestHeader("Range", "bytes=" + start + "-" + end);

        // Abort if server responds with complete file in response to range
        // request, to prevent downloading large files from broken http servers
        http.onreadystatechange = function()
        {
            if(http.status === 200)
            {
                http.abort();
            }
        };
    }

    http.onload = function(e)
    {
        if(http.readyState === 4)
        {
            if(http.status !== 200 && http.status !== 206)
            {
                console.error("Loading the image " + filename + " failed (status %d)", http.status);
                if(http.status >= 500 && http.status < 600)
                {
                    retry();
                }
            }
            else if(http.response)
            {
                options.done && options.done(http.response, http);
            }
        }
    };

    http.onerror = function(e)
    {
        console.error("Loading the image " + filename + " failed", e);
        retry();
    };

    if(options.progress)
    {
        http.onprogress = function(e)
        {
            options.progress(e);
        };
    }

    http.send(null);

    function retry()
    {
        const number_of_tries = n_tries || 0;
        const timeout = [1, 1, 2, 3, 5, 8, 13, 21][number_of_tries] || 34;
        setTimeout(() => {
            load_file(filename, options, number_of_tries + 1);
        }, 1000 * timeout);
    }
}

function load_file_nodejs(filename, options)
{
    let fs = require("fs");

    if(options.range)
    {
        dbg_assert(!options.as_json);

        fs["open"](filename, "r", (err, fd) =>
            {
                if(err) throw err;

                let length = options.range.length;
                var buffer = Buffer.allocUnsafe(length);

                fs["read"](fd, buffer, 0, length, options.range.start, (err, bytes_read) =>
                    {
                        if(err) throw err;

                        dbg_assert(bytes_read === length);
                        options.done && options.done(new Uint8Array(buffer));

                        fs["close"](fd, (err) => {
                            if(err) throw err;
                        });
                    });
            });
    }
    else
    {
        var o = {
            encoding: options.as_json ? "utf-8" : null,
        };

        fs["readFile"](filename, o, function(err, data)
            {
                if(err)
                {
                    console.log("Could not read file:", filename, err);
                }
                else
                {
                    var result = data;

                    if(options.as_json)
                    {
                        result = JSON.parse(result);
                    }
                    else
                    {
                        result = new Uint8Array(result).buffer;
                    }

                    options.done(result);
                }
            });
    }
}

// Reads len characters at offset from Memory object mem as a JS string
v86util.read_sized_string_from_mem = function read_sized_string_from_mem(mem, offset, len)
{
    offset >>>= 0;
    len >>>= 0;
    return String.fromCharCode(...new Uint8Array(mem.buffer, offset, len));
};


text:
\documentclass[a4paper, 11pt]{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage[pdftex]{hyperref}
\usepackage{subcaption}

% Lengths and indenting
\setlength{\textwidth}{16.5cm}
\setlength{\marginparwidth}{1.5cm}
\setlength{\parindent}{0cm}
\setlength{\parskip}{0.15cm}
\setlength{\textheight}{22cm}
\setlength{\oddsidemargin}{0cm}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\topmargin}{0cm}
\setlength{\headheight}{0cm}
\setlength{\headsep}{0cm}

\renewcommand{\familydefault}{\sfdefault}

\title{Machine Learning 2015: Project 3 - Classification Report}
\author{jo@student.ethz.ch\\ sakhadov@student.ethz.ch\\ kevinlu@student.ethz.ch\\}
\date{\today}

\begin{document}
\maketitle

\section*{Experimental Protocol}
We used split-training (train on 80\%, test on 20\%) and cross-validation to select the best models. \\

\section{Tools}
We used Python 2 with the machine learning library \textit{scikit-learn} and \textit{numpy}. For Gradient Boosting we used XGBoost python library.

\section{Algorithm}
We first normalize all the features.\\
The resulted features are used to train the XGBoost classifier.\\

\section{Features}
For feature selection we used SelectKBest class implemented in sklearn library. With gridsearch we found around 130 features that carry the most information.\\
As an additional feature for every nucleus image we tried to compute a coefficient which would describe best the symmetry and the boundary of every nucleus shape. From the nucleus masks we could see that the most of malignant cells have a much more smoother boundary than a nucleus of a benign cell. Our smoothness coefficient $s_c$ is computed as follows:

\begin{equation}
s_c = \frac{ Area_{nucleus} }{Area_{chull}}
\end{equation}

\begin{figure}[!t!]
 \centering
\begin{subfigure}[b]{0.4\textwidth}
	\centering
	\includegraphics[width=\textwidth]{benign.png}
	\caption{A benign cell nucleus with a larger chunk in the middle and a small piece in the upper right corner.}
	\label{benign}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.4\textwidth}
	\centering
	\includegraphics[width=\textwidth]{malignant.png}
	\caption{A malignant cell nucleus with a compact round middle part and a small appendix in the bottom.}
	\label{malignant}
\end{subfigure}
\caption{A benign cell nucleus on the left and a malignant on the right. Our smoothness coefficient would be similar for these two masks if computed directly. The convex hull of benign cell would be too large if compute it for the whole object. That is why we erode every image which either clears of smaller pieces or separates them from the main bulk of the nucleus. The convex hull is then computed separately for every object. This forces the smoothness coefficient to only depend on the shape of the main bulk of the nucleus. }
\end{figure}

Where $Area_{chull}$ is the area of the convex hull of the nucleus.\\
Additionally we erode every nucleus mask with a matlab function $imerode$ with a disk as the structuring element. With this we try to separate nucleus mask image in several pieces in order to better compute the convex hull on separate objects. This allows to better differentiate between the compact malignant nucleus with a small appendix(Figure \ref{malignant}) and a spread benign nucleus (Figure \ref{benign}).\\

Furthermore, in order to measure the circularity of the nucleus shape we computed the relation between the shape area and its perimeter. This feature, however, did not give any substantial score improvement.\\

\section{Parameters}
We calibrated the parameters using grid search. For every possible set of parameters 10-fold cross-validation was performed to find the best generalizing parameters. To validate the model afterwards, a 10-fold cross-validation was applied together with a split-test, where we trained on 80\% of the data and tested on the other 20\%.

\end{document}


text:
package org.lastaflute.di.core.deployer;

/**
 * @author modified by jflute (originated in Seasar)
 */
public interface ComponentDeployer {

    Object deploy();

    void injectDependency(Object outerComponent);

    void init();

    void destroy();
}


text:
<?xml version="1.0"?>
<!--

-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd">
    <fixture name="taxClass" module="Mage_Tax" type="flat" entity_type="tax_class"
             collection="Mage\Tax\Model\Resource\Class\Collection" repository_class="Mage\Tax\Test\Repository\TaxClass"
             handler_interface="Mage\Tax\Test\Handler\TaxClass\TaxClassInterface"
             class="Mage\Tax\Test\Fixture\TaxClass">
        <field name="class_id" is_required="1"/>
        <field name="class_name" is_required="0"/>
        <field name="class_type" is_required="0"/>
        <field name="id"/>
    </fixture>
</config>


text:
module Neo4j
  # Makes Neo4j nodes and relationships behave like ActiveRecord objects.
  # By including this module in your class it will create a mapping for the node to your ruby class
  # by using a Neo4j Label with the same name as the class. When the node is loaded from the database it
  # will check if there is a ruby class for the labels it has.
  # If there Ruby class with the same name as the label then the Neo4j node will be wrapped
  # in a new object of that class.
  #
  # = ClassMethods
  # * {Neo4j::ActiveNode::Labels::ClassMethods} defines methods like: <tt>index</tt> and <tt>find</tt>
  # * {Neo4j::ActiveNode::Persistence::ClassMethods} defines methods like: <tt>create</tt> and <tt>create!</tt>
  # * {Neo4j::ActiveNode::Property::ClassMethods} defines methods like: <tt>property</tt>.
  #
  # @example Create a Ruby wrapper for a Neo4j Node
  #   class Company
  #      include Neo4j::ActiveNode
  #      property :name
  #   end
  #   company = Company.new
  #   company.name = 'My Company AB'
  #   Company.save
  #
  module ActiveNode
    extend ActiveSupport::Concern

    MARSHAL_INSTANCE_VARIABLES = [:@attributes, :@_persisted_obj, :@default_property_value]

    include Neo4j::Shared
    include Neo4j::Shared::Identity
    include Neo4j::Shared::Marshal
    include Neo4j::ActiveNode::Initialize
    include Neo4j::ActiveNode::IdProperty
    include Neo4j::Shared::SerializedProperties
    include Neo4j::ActiveNode::Property
    include Neo4j::ActiveNode::Reflection
    include Neo4j::ActiveNode::Persistence
    include Neo4j::ActiveNode::Validations
    include Neo4j::ActiveNode::Callbacks
    include Neo4j::ActiveNode::Query
    include Neo4j::ActiveNode::Labels
    include Neo4j::ActiveNode::Rels
    include Neo4j::ActiveNode::Unpersisted
    include Neo4j::ActiveNode::HasN
    include Neo4j::ActiveNode::Scope
    include Neo4j::ActiveNode::Dependent

    def initialize(args = nil)
      symbol_args = args.is_a?(Hash) ? args.symbolize_keys : args
      super(symbol_args)
    end

    def neo4j_obj
      _persisted_obj || fail('Tried to access native neo4j object on a non persisted object')
    end

    module ClassMethods
      def nodeify(object)
        if object.is_a?(::Neo4j::ActiveNode) || object.nil?
          object
        else
          self.find(object)
        end
      end
    end

    included do
      include Neo4j::Timestamps if Neo4j::Config[:record_timestamps]

      def self.inherited(other)
        inherit_id_property(other)
        attributes.each_pair do |k, v|
          other.inherit_property k.to_sym, v.clone, declared_properties[k].options
        end

        Neo4j::ActiveNode::Labels.add_wrapped_class(other)
        super
      end

      def self.inherit_id_property(other)
        Neo4j::Session.on_next_session_available do |_|
          next if other.manual_id_property? || !self.id_property?
          id_prop = self.id_property_info
          conf = id_prop[:type].empty? ? {auto: :uuid} : id_prop[:type]
          other.id_property id_prop[:name], conf
        end
      end

      Neo4j::Session.on_next_session_available do |_|
        next if manual_id_property?
        id_property :uuid, auto: :uuid unless self.id_property?

        name = Neo4j::Config[:id_property]
        type = Neo4j::Config[:id_property_type]
        value = Neo4j::Config[:id_property_type_value]
        id_property(name, type => value) if name && type && value
      end
    end

    ActiveSupport.run_load_hooks(:active_node, self)
  end
end


text:
module Sensu
  module API
    module Validators
      # The error class for validation.
      class Invalid < RuntimeError; end
    end
  end
end


text:
package org.apache.solr.cloud;

import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.client.solrj.request.CollectionAdminRequest.Create;
import org.apache.solr.client.solrj.request.CollectionAdminRequest.RequestStatus;
import org.apache.solr.client.solrj.request.CollectionAdminRequest.SplitShard;
import org.apache.solr.client.solrj.response.CollectionAdminResponse;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.update.DirectUpdateHandler2;
import org.junit.Before;

import java.io.IOException;

/**
 * Tests the Cloud Collections API.
 */
@Slow
public class CollectionsAPIAsyncDistributedZkTest extends AbstractFullDistribZkTestBase {
  private static final int MAX_TIMEOUT_SECONDS = 60;
  private static final boolean DEBUG = false;

  @Before
  @Override
  public void setUp() throws Exception {
    super.setUp();

    useJettyDataDir = false;

    System.setProperty("numShards", Integer.toString(sliceCount));
    System.setProperty("solr.xml.persist", "true");
  }

  public CollectionsAPIAsyncDistributedZkTest() {
    fixShardCount = true;

    sliceCount = 1;
    shardCount = 1;
  }

  @Override
  public void doTest() throws Exception {

    testSolrJAPICalls();

    if (DEBUG) {
      super.printLayout();
    }
  }

  private void testSolrJAPICalls() throws Exception {
    SolrClient client = createNewSolrClient("", getBaseUrl((HttpSolrClient) clients.get(0)));
    try {
      Create createCollectionRequest = new Create();
      createCollectionRequest.setCollectionName("testasynccollectioncreation");
      createCollectionRequest.setNumShards(1);
      createCollectionRequest.setConfigName("conf1");
      createCollectionRequest.setAsyncId("1001");
      createCollectionRequest.process(client);

      String state = getRequestStateAfterCompletion("1001", MAX_TIMEOUT_SECONDS, client);

      assertEquals("CreateCollection task did not complete!", "completed", state);

      createCollectionRequest = new Create();
      createCollectionRequest.setCollectionName("testasynccollectioncreation");
      createCollectionRequest.setNumShards(1);
      createCollectionRequest.setConfigName("conf1");
      createCollectionRequest.setAsyncId("1002");
      createCollectionRequest.process(client);

      state = getRequestStateAfterCompletion("1002", MAX_TIMEOUT_SECONDS, client);

      assertEquals("Recreating a collection with the same name didn't fail, should have.", "failed", state);

      CollectionAdminRequest.AddReplica addReplica = new CollectionAdminRequest.AddReplica();
      addReplica.setCollectionName("testasynccollectioncreation");
      addReplica.setShardName("shard1");
      addReplica.setAsyncId("1003");
      client.request(addReplica);
      state = getRequestStateAfterCompletion("1003", MAX_TIMEOUT_SECONDS, client);
      assertEquals("Add replica did not complete", "completed", state);

      SplitShard splitShardRequest = new SplitShard();
      splitShardRequest.setCollectionName("testasynccollectioncreation");
      splitShardRequest.setShardName("shard1");
      splitShardRequest.setAsyncId("1004");
      splitShardRequest.process(client);

      state = getRequestStateAfterCompletion("1004", MAX_TIMEOUT_SECONDS * 2, client);

      assertEquals("Shard split did not complete. Last recorded state: " + state, "completed", state);
    } finally {
      client.shutdown();
    }
  }

  private String getRequestStateAfterCompletion(String requestId, int waitForSeconds, SolrClient client)
      throws IOException, SolrServerException {
    String state = null;
    while(waitForSeconds-- > 0) {
      state = getRequestState(requestId, client);
      if(state.equals("completed") || state.equals("failed"))
        return state;
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e) {
      }
    }
    return state;
  }

  private String getRequestState(String requestId, SolrClient client) throws IOException, SolrServerException {
    RequestStatus request = new RequestStatus();
    request.setRequestId(requestId);
    CollectionAdminResponse response = request.process(client);
    NamedList innerResponse = (NamedList) response.getResponse().get("status");
    return (String) innerResponse.get("state");
  }

  @Override
  public void tearDown() throws Exception {
    super.tearDown();
    System.clearProperty("numShards");
    System.clearProperty("zkHost");
    System.clearProperty("solr.xml.persist");

    // insurance
    DirectUpdateHandler2.commitOnClose = true;
  }

}


text:
package org.lable.oss.dynamicconfig.core;

import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.HierarchicalConfiguration;
import org.junit.Test;
import org.lable.oss.dynamicconfig.core.ConfigurationComposition.ConfigReference;
import org.lable.oss.dynamicconfig.core.commonsconfiguration.ConcurrentConfiguration;
import org.lable.oss.dynamicconfig.provider.FileBasedConfigSource;
import org.lable.oss.dynamicconfig.serialization.yaml.YamlDeserializer;
import org.lable.oss.dynamicconfig.serialization.yaml.YamlSerializer;
import org.lable.oss.dynamicconfig.test.FileUtil;

import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.concurrent.TimeUnit;

import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

public class ConfigurationManagerIT {
    @Test
    public void testMultipleFilesConfig() throws ConfigurationException, URISyntaxException {
        HierarchicalConfiguration defaults = new HierarchicalConfiguration();
        defaults.setProperty("outer.def-a", 111);
        defaults.setProperty("outer.def-b", 222);
        defaults.setProperty("outer.branch-a.x", "x");

        final String INPUT = "multiple-files/root.yaml";
        URL testUrl = getClass().getResource("/" + INPUT);
        final String testYaml = testUrl.toURI().getPath();
        Configuration sourceConfiguration = new BaseConfiguration();
        InitializedConfiguration ic = ConfigurationManager.fromTheseSettings(
                testYaml,
                "app",
                new FileBasedConfigSource(),
                new YamlDeserializer(),
                sourceConfiguration,
                defaults
        );
        Configuration configuration = ic.getConfiguration();

        // Overridden default.
        assertThat(configuration.getInt("outer.def-a"), is(123));

        // Test basic include.
        assertThat(configuration.getInt("outer.branch-a.a1"), is(1));
        assertThat(configuration.getInt("outer.branch-a.a2"), is(2));

        // Included config should override the extended one.
        assertThat(configuration.getList("outer.branch-a.lst"), contains(4, 5, 6));

        // Include in an include.
        assertThat(configuration.getInt("outer.branch-a.sub.s1"), is(1234));
        assertThat(configuration.getList("outer.branch-a.sub.s2"), contains("a", "b"));

        // Include in an extended config.
        assertThat(configuration.getInt("outer.branch-c.sub.s1"), is(1234));
        assertThat(configuration.getList("outer.branch-c.sub.s2"), contains("a", "b"));

        // Inherited from default.
        assertThat(configuration.getInt("outer.def-b"), is(222));
    }

    @Test
    public void testFileMutations() throws IOException, ConfigurationException, InterruptedException {
        Path dir = Files.createTempDirectory("filemutationsit");

        Files.copy(getClass().getResourceAsStream("/multiple-files/root.yaml"), dir.resolve("root.yaml"));
        Files.copy(getClass().getResourceAsStream("/multiple-files/base1.yaml"), dir.resolve("base1.yaml"));
        Files.copy(getClass().getResourceAsStream("/multiple-files/inc1.yaml"), dir.resolve("inc1.yaml"));
        Files.copy(getClass().getResourceAsStream("/multiple-files/inc2.yaml"), dir.resolve("inc2.yaml"));

        HierarchicalConfiguration defaults = new HierarchicalConfiguration();
        defaults.setProperty("outer.def-a", 111);
        defaults.setProperty("outer.def-b", 222);
        defaults.setProperty("outer.branch-a.x", "x");

        Configuration sourceConfiguration = new BaseConfiguration();
        InitializedConfiguration ic = ConfigurationManager.fromTheseSettings(
                dir.resolve("root.yaml").toString(),
                "app",
                new FileBasedConfigSource(),
                new YamlDeserializer(),
                sourceConfiguration,
                defaults
        );

        Configuration configuration = ic.getConfiguration();

        assertThat(configuration.getString("outer.branch-a.z"), is(nullValue()));

        TimeUnit.SECONDS.sleep(2);

        Files.copy(
                getClass().getResourceAsStream("/multiple-files/base1-alt1.yaml"),
                dir.resolve("base1.yaml"),
                StandardCopyOption.REPLACE_EXISTING
        );

        TimeUnit.SECONDS.sleep(2);

        assertThat(configuration.getString("outer.branch-a.z"), is("z"));

        Files.delete(dir.resolve("root.yaml"));

        TimeUnit.SECONDS.sleep(2);

        assertThat(configuration.getString("outer.branch-a.z"), is("z"));
        assertThat(configuration.getInt("outer.def-a"), is(123));

        Files.copy(getClass().getResourceAsStream("/multiple-files/root.yaml"), dir.resolve("root.yaml"));

        TimeUnit.SECONDS.sleep(2);

        assertThat(configuration.getString("outer.branch-a.z"), is("z"));
        assertThat(configuration.getInt("outer.def-a"), is(123));

        FileUtil.deleteDirAndContents(dir);
    }

    public void printConfig(ConcurrentConfiguration configuration) {
        YamlSerializer serializer = new YamlSerializer();

        ConfigurationManager.composition.allReferences.keySet().forEach(
                s -> {
                    ConfigReference ref = ConfigurationManager.composition.allReferences.get(s);
                    try {
                        serializer.serialize(ref.configuration, System.out);
                        System.out.println("---");
                    } catch (ConfigurationException e) {
                        e.printStackTrace();
                    }
                }
        );

        configuration.withConfiguration(combinedConfiguration -> {
            try {
                serializer.serialize(combinedConfiguration, System.out);
            } catch (ConfigurationException e) {
                e.printStackTrace();
            }
        });
    }
}


text:
<?php

namespace bariew\abstractModule\models;

use Yii;
use \yii\db\ActiveRecord;
use yii\db\ActiveQuery;
use yii\helpers\Inflector;

/**
 * Description.
 *
 * Usage:
 * @author Pavel Bariev <bariew@yandex.ru>
 *
 */
class AbstractModel extends ActiveRecord
{
    /**
     * Gets class name for a parent model for the current module's model.
     * @param bool $asModel
     * @return static|string
     */
    public static function parentClass($asModel = false)
    {
        $class = array_values(class_parents(get_called_class()))[2];
        return $asModel ? new $class() : $class;
    }

    /**
     * Gets class name for a model that inherits current modules model.
     * CAUTION! This works only when called from inside another module model
     * @param bool $asModel
     * @param array $initData
     * @return string|static
     */
    public static function childClass($asModel = false, $initData = [])
    {
        $data = debug_backtrace();
        $callingClassName = get_class($data[1]['object']);
        $pattern = '#^(.+\\\\)(\w+\\\\\w+)$#';
        $formName = preg_replace($pattern, '$2', get_called_class());
        $result = preg_replace($pattern, '$1'.$formName, $callingClassName);
        return $asModel ? new $result($initData) : $result;
    }

    /**
     * @param $className
     * @return mixed
     */
    public static function moduleName($className)
    {
        return preg_replace('#.*\\\\(\w+)\\\\\w+\\\\\w+$#','$1', $className);
    }

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        $name = preg_replace('#.*\\\\(\w+)\\\\models\\\\(\w+)$#', '$1$2', static::className());
        return '{{%'.Inflector::camel2id($name, '_').'}}';
    }

    /**
     * Gets search query.
     * @param array $params search params key=>value
     * @return ActiveQuery
     */
    public function search($params = [])
    {
        return $this::find()->andFilterWhere(array_merge($this->attributes, $params));
    }
}


text:
package blasd.apex.jconsole;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;

/**
 * Demonstrate how to start a custom JConsole
 *
 * @author Benoit Lacelle
 *
 */
public class ApexMainJConsole {
	protected ApexMainJConsole() {
		// hidden
	}

	// http://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html
	public static void main(String[] args) throws IOException, URISyntaxException, InterruptedException {
		String pathToJar = getPathToJar(BufferMonitorJConsolePlugin.class);
		System.out.println(pathToJar);

		List<String> cmd = new ArrayList<>();

		boolean jdk7 = true;

		{
			boolean defaultJdkFodler = true;
			String jconsoleFolder;
			if (defaultJdkFodler) {
				jconsoleFolder = "C:\\Program Files\\Java\\jdk1.8.0_92\\bin\\";
			} else {
				if (jdk7) {
					jconsoleFolder = "C:\\HOMEWARE\\ITEC-Toolbox\\apps\\jdk\\jdk1.7.0_72-windows-x64\\bin\\";
				} else {
					jconsoleFolder = "C:\\HOMEWARE\\ITEC-Toolbox\\apps\\jdk\\jdk1.8.0_25-windows-x64\\bin\\";
				}
			}

			cmd.add(jconsoleFolder + "jconsole.exe");
		}

		boolean runInJarFolder = false;

		String folder = "D:\\blacelle112212\\workspace4.4\\apex\\shared\\buffermonitor\\target";
		folder = "C:\\NB5419\\workspace\\apex\\shared\\buffermonitor\\target";

		boolean useBufferMonitorPlugin = true;
		if (useBufferMonitorPlugin) {
			cmd.add("-pluginpath");

			String pluginPath = "";
			if (!runInJarFolder) {
				pluginPath += folder;
			}
			pluginPath += "\\apex-buffermonitor-2.2-SNAPSHOT.jar";
			cmd.add(pluginPath);
		}

		boolean debug = false;

		if (debug) {
			cmd.add("-J-Xdebug");
			cmd.add("-J-Xnoagent");
			cmd.add("-J-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000");
		}

		ProcessBuilder pb = new ProcessBuilder(cmd);
		if (runInJarFolder) {
			pb = pb.directory(new File(folder));
		}
		pb = pb.inheritIO();

		// JDK_HOME/bin/jconsole
		Process p = pb.start();

		int code = p.waitFor();

		System.out.println(code);
	}

	// http://stackoverflow.com/questions/320542/how-to-get-the-path-of-a-running-jar-file
	public static String getPathToJar(Class<?> clazz) throws URISyntaxException {
		// ClassLoader.getSystemClassLoader().getResource(".").getPath();
		// String decodedPath = URLDecoder.decode(path, "UTF-8");
		return clazz.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
	}
}


text:
<?php

namespace BalancedHtmlTags;

/**
 * Makes sure that the passed HTML contains balanced tags, so we don't break the frontend.
 *
 * @package App\Model\Rule
 */
class BalancedHtmlTags
{
    /**
     * Balances the tags on the passed HTML.
     *
     * @param $html
     * @return string
     */
    public static function balanceTags($html)
    {
        return self::_balanceTags($html);
    }

    /**
     * Determines if the passed HTML contains balanced tags.
     *
     * @param $html
     * @return bool
     */
    public static function tagsBalanced($html)
    {
        return $html === self::_balanceTags($html);
    }

    /**
     * Balances tags of string using a modified stack.
     *
     * @since 2.0.4
     *
     * @author Leonard Lin <leonard@acm.org>
     * @license GPL v2.0
     * @copyright November 4, 2001
     * @version 1.1
     * @todo Make better - change loop condition to $text in 1.2
     * @internal Modified by Scott Reilly (coffee2code) 02 Aug 2004
     *		1.1  Fixed handling of append/stack pop order of end text
     *			 Added Cleaning Hooks
     *		1.0  First Version
     *
     * @param string $text Text to be balanced.
     * @return string Balanced text.
     */
    protected static function _balanceTags( $text ) {
        $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = '';
        $single_tags = array('area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta',
            'param', 'source', 'track', 'wbr'); //Known single-entity/self-closing tags
        $nestable_tags = array('blockquote', 'div', 'span'); //Tags that can be immediately nested within themselves

        # WP bug fix for comments - in case you REALLY meant to type '< !--'
        $text = str_replace('< !--', '<    !--', $text);
        # WP bug fix for LOVE <3 (and other situations with '<' before a number)
        $text = preg_replace('#<([0-9]{1})#', '<$1', $text);

        while (preg_match("/<(\/?\w*)\s*([^>]*)>/",$text,$regex)) {
            $newtext .= $tagqueue;

            $i = strpos($text,$regex[0]);
            $l = strlen($regex[0]);

            // clear the shifter
            $tagqueue = '';
            // Pop or Push
            if ( isset($regex[1][0]) && '/' == $regex[1][0] ) { // End Tag
                $tag = strtolower(substr($regex[1],1));
                // if too many closing tags
                if($stacksize <= 0) {
                    $tag = '';
                    //or close to be safe $tag = '/' . $tag;
                }
                // if stacktop value = tag close value then pop
                else if ($tagstack[$stacksize - 1] == $tag) { // found closing tag
                    $tag = '</' . $tag . '>'; // Close Tag
                    // Pop
                    array_pop ($tagstack);
                    $stacksize--;
                } else { // closing tag not at top, search for it
                    for ($j=$stacksize-1;$j>=0;$j--) {
                        if ($tagstack[$j] == $tag) {
                            // add tag to tagqueue
                            for ($k=$stacksize-1;$k>=$j;$k--){
                                $tagqueue .= '</' . array_pop ($tagstack) . '>';
                                $stacksize--;
                            }
                            break;
                        }
                    }
                    $tag = '';
                }
            } else { // Begin Tag
                $tag = strtolower($regex[1]);

                // Tag Cleaning

                // If self-closing or '', don't do anything.
                if((substr($regex[2],-1) == '/') || ($tag == '')) {
                }
                // ElseIf it's a known single-entity tag but it doesn't close itself, do so
                elseif ( in_array($tag, $single_tags) ) {
                    $regex[2] .= '/';
                } else {	// Push the tag onto the stack
                    // If the top of the stack is the same as the tag we want to push, close previous tag
                    if (($stacksize > 0) && !in_array($tag, $nestable_tags) && ($tagstack[$stacksize - 1] == $tag)) {
                        $tagqueue = '</' . array_pop ($tagstack) . '>';
                        $stacksize--;
                    }
                    $stacksize = array_push ($tagstack, $tag);
                }

                // Attributes
                $attributes = $regex[2];
                if($attributes) {
                    $attributes = ' '.$attributes;
                }
                $tag = '<'.$tag.$attributes.'>';
                //If already queuing a close tag, then put this tag on, too
                if ($tagqueue) {
                    $tagqueue .= $tag;
                    $tag = '';
                }
            }
            $newtext .= substr($text,0,$i) . $tag;
            $text = substr($text,$i+$l);
        }

        // Clear Tag Queue
        $newtext .= $tagqueue;

        // Add Remaining text
        $newtext .= $text;

        // Empty Stack
        while($x = array_pop($tagstack)) {
            $newtext .= '</' . $x . '>'; // Add remaining tags to close
        }

        // WP fix for the bug with HTML comments
        $newtext = str_replace("< !--","<!--",$newtext);
        $newtext = str_replace("<    !--","< !--",$newtext);

        return $newtext;
    }
}


text:
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):

        # Changing field 'Snippet.key'
        db.alter_column('addendum_snippet', 'key', self.gf('django.db.models.fields.CharField')(max_length=250, primary_key=True))

    def backwards(self, orm):

        # Changing field 'Snippet.key'
        db.alter_column('addendum_snippet', 'key', self.gf('django.db.models.fields.CharField')(max_length=100, primary_key=True))

    models = {
        'addendum.snippet': {
            'Meta': {'ordering': "('key',)", 'object_name': 'Snippet'},
            'key': ('django.db.models.fields.CharField', [], {'max_length': '250', 'primary_key': 'True'}),
            'text': ('django.db.models.fields.TextField', [], {})
        }
    }

    complete_apps = ['addendum']


text:
@interface DemoSelecter ()
@property (weak, nonatomic) IBOutlet UISlider *slider;

@end

@implementation DemoSelecter

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
      // [self performSelector:@selector(hideSlider) withObject:nil afterDelay: 2];
}
- (IBAction)crunchData:(id)sender {
    [self performSelectorOnMainThread:@selector(doCrunchData) withObject:nil waitUntilDone: true];
    [self performSelectorOnMainThread:@selector(processData:) withObject:@{@"apple": @"táo", @"lemon": @"chanh"} waitUntilDone: true];

}

- (void) doCrunchData {
    [NSThread sleepForTimeInterval: 5];
}

- (void) processData: (NSDictionary*) data {
    for (NSString* key in [data allKeys]) {
        NSLog(@"%@ - %@", key, [data valueForKey:key]);
    }

}

@end


text:
@implementation LWSwitchTableViewCell
@synthesize model;

BOOL _processModelChanges = YES;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (LWSwitchModel*) model {
    return model;
}

-(void) setModel:(LWSwitchModel *)newModel {
    model = newModel;
    if (!model) return;
    [self fillDataFromModel];
    [model addObserver:self forKeyPath:@"isOn" options:NSKeyValueObservingOptionNew context:nil];
}

- (void)fillDataFromModel {
    if (!model) {
        self.labelTitel.text = @"no name";
        self.switchState.on = NO;
    } else {
        self.labelTitel.text = self.model.name;
        self.switchState.on = self.model.isOn;
    }
}

//-(void) updateModel:(LWSwitchModel)

- (IBAction)onSwitchValueChanged:(UISwitch *)sender {
    if (_processModelChanges)
        self.model.isOn = sender.on;
}

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
    if ([keyPath isEqualToString:@"isOn"]) {
        LWSwitchModel* model = object;
        _processModelChanges = NO;
        [self.switchState setOn:model.isOn animated:YES];
        _processModelChanges = YES;
    }
    else {
        [super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
    }
}

@end


text:
import React, { PropTypes } from 'react'

import ExpansionTriangle from './ExpansionTriangle'
import styles from './menu.scss'

const MenuItem = ({ children, isExpanded, onClick, text }) => (

        {children &&

            <ExpansionTriangle isExpanded={isExpanded} />

        }
        {text}

    {isExpanded &&
{children}
}

)

MenuItem.propTypes = {
  children: PropTypes.array,
  isExpanded: PropTypes.bool,
  onClick: PropTypes.func,
  text: PropTypes.string,
}

export default MenuItem


text:
Y.Common.DomBind.Directives = {};

 /**
  * Priorities weight for directives definition, higher priorities means that those directives are going to be processed first
  * where HIGH: 10, MEDIUM: 5, LOW: 1
  *
  * @property DIRECTIVES_PRIORITIES
  * @type {Object}
  * @static
  * @for Common.DomBind
  */
 Y.Common.DomBind.DIRECTIVES_PRIORITIES = {
    HIGH: 10,
    MEDIUM: 5,
    LOW: 1,
 };

 /**
  * Creates a directive, by adding it to Y.Common.DomBind.Directives object, on directives compilation phase, this object will be retrieved in order to start
  * the initialization of all the directives difined in the dom
  *
  * @method createDirective
  *
  * @param {String} keyName Attribute name that will be used on directive declaration in the html
  * @param {Number} priority Number that defines the directive priority in terms of processing higher value will be processed first than lower values
  * @param {Function} directiveExecFn Callback function that will be executed on directive compilation e.g function(directiveName, el, attribute, scopeModel) { }
  * @static
  * @for Common.DomBind
  */
 Y.Common.DomBind.createDirective = function (keyName, priority, directiveExecFn) {
     keyName = '-' + keyName;
     Y.Common.DomBind.Directives[keyName] = {
         keyName: keyName,
         priority: priority,
         directiveExecFn: directiveExecFn
     };
 }

 /**
  * Definition for -onclick directive, provides click event that can be defined from markup and call methods defined in the controller
  *
  * @property Directives['-onclick']
  * @type {Object}
  */
 Y.Common.DomBind.createDirective('onclick',  Y.Common.DomBind.DIRECTIVES_PRIORITIES.HIGH, function (directiveName, el, attribute, scopeModel) {
     var me = this;
     this.attachEvent(el, 'click', function(scopeModel) {
         // TODO: be able to call multiple methods from the same directive
         me.execControllerMethodExpression(attribute, scopeModel, el);
     }, scopeModel);
 });

 /**
  * Definition for -onchange directive, provides change event that can be defined from markup and call methods defined in the controller
  *
  * @property Directives['-onchange']
  * @type {Object}
  */
 Y.Common.DomBind.createDirective('onchange', Y.Common.DomBind.DIRECTIVES_PRIORITIES.HIGH, function (directiveName, el, attribute, scopeModel) {
     var me = this;
     this.attachEvent(el, 'change', function(scopeModel) {
         me.execControllerMethodExpression(attribute, scopeModel, el);
     }, scopeModel);
 });

 /**
  * Definition for -onfocus directive, provides focus event that can be defined from markup and call methods defined in the controller
  *
  * @property Directives['-onfocus']
  * @type {Object}
  */
 Y.Common.DomBind.createDirective('onfocus', Y.Common.DomBind.DIRECTIVES_PRIORITIES.HIGH, function (directiveName, el, attribute, scopeModel) {
     var me = this;
     this.attachEvent(el, 'focus', function(scopeModel) {
         me.execControllerMethodExpression(attribute, scopeModel, el);
     }, scopeModel);
 });

 /**
  * Definition for -onblur directive, provides blur event that can be defined from markup and call methods defined in the controller
  *
  * @property Directives['-onblur']
  * @type {Object}
  */
 Y.Common.DomBind.createDirective('onblur', Y.Common.DomBind.DIRECTIVES_PRIORITIES.HIGH, function (directiveName, el, attribute, scopeModel) {
     var me = this;
     this.attachEvent(el, 'blur', function(e) {
         me.execControllerMethodExpression(attribute, scopeModel, el);
     }, scopeModel);
 });

 /**
  * Definition for -bind directive, model properties can be associated to dom element or viceversa, reflecting changes on both sides,
  * meaning that it will provide two-way binding
  *
  * @property Directives['-bind']
  * @type {Object}
  */
 Y.Common.DomBind.createDirective('bind', Y.Common.DomBind.DIRECTIVES_PRIORITIES.MEDIUM, function (directiveName, el, attribute, scopeModel) {
     /* check if element was already bind */
     if (typeof el.getData(this.get('prefix') + DATA_IS_BINDED) == 'undefined') {
         var me = this;
         /* if element bind is inside of an array as an array item, it'll add the index as part of the key */
         var uniqueKey = this._generateUniqueKey(attribute, scopeModel);
         Y.log(LOG_PREFIX + 'Processing ' + directiveName + ' : ' + attribute, 'info');
         /* listen field changes  */
         el.on(['keyup', 'change', 'click'], function () {
             /* if value is different than previous sets the model */
             if (me._getElementValue(el) != el.getData('previousValue')) {
                 el.setData('previousValue', me._getElementValue(el));
                 me.setModel(attribute, me._getElementValue(el), scopeModel, el);
             }
         });
         /* listen the model changes by using custom event */
         var modelEventHandle = this.listen(uniqueKey, function (model) {
             if (el._node != null) {
                 /* avoid reset same element */
                 if (typeof model.triggerElement == 'undefined' || !model.triggerElement.compareTo(el)) {
                     el.setData('previousValue', model.newValue);
                     /* sets element value */
                     me._setElementValue(el, model.newValue);
                 }
             } else {
                 /* stop listening if node was removed */
                 modelEventHandle.detach();
             }
         });

         /* sets initial flag to avoid add multiple events to the same element */
         el.setData(this.get('prefix') + DATA_IS_BINDED, true)
     }
     /* inializes with the current model if value in model is there and not undefined */
     if (this._getModel(attribute, scopeModel)) {
         this.setModel(attribute, this._getModel(attribute, scopeModel), scopeModel);
     }
 });

 /**
  * Definition for -container-loop-model directive, array list iterator, each element iterated has its own scope so this item can be passed through
  * controller methods, the iteration elements will be shown according to the template provided by the directive -template
  *
  * @property Directives['-container-loop-model']
  * @type {Object}
  */
 Y.Common.DomBind.createDirective('container-loop-model', Y.Common.DomBind.DIRECTIVES_PRIORITIES.LOW, function (directiveName, el, attribute, scopeModel) {
     var me = this;
     var model = this.get('model');
     Y.log(LOG_PREFIX + 'Processing ' + directiveName + ' : ' + attribute);
     /* separates list iteration from list filters*/
     attribute = attribute.split(LOOP_DATA_FILTER);
     var filters = (attribute.length > 1) ? this._tokenizeFilters(attribute[1].split(COMMA_SEPARATOR)) : [];
     /* retrieve list iteration */
     attribute = attribute[0];
     /* tokenize the list iteration by item looped and list e.g "item in itemList" will be tokenized into ['item', 'in', 'itemList'] */
     attribute = attribute.match(/[^ ]+/g);
     var listProperty = attribute[2];
     var modelList = (model[listProperty] && model[listProperty].length > 0) ? model[listProperty] : [];
     /* iterates with the given list */
     var iterateList = function (list) {
         el.empty();
         Y.Array.each(list, function (item, index) {
             /* execute before each item filter */
             var modelItem = me._doBeforeEachItem(filters, item);
             /* creates the new node */
             var renderedMarkup = Y.Common.TemplateHandler.render(el.getAttribute(me._getDirectiveName(TEMPLATE)), modelItem);
             var node = Y.Node.create(renderedMarkup);
             var scopeObject = {
                 containerNode: node,
                 scopeModel: scopeModel
             };
             /* passes additional information in the model item */
             modelItem._info = {
                 parent: attribute[2],
                 parentType: DATA_ARRAY,
                 index: index
             };
             scopeObject.scopeModel[attribute[0]] = modelItem;
             me._compileDirectives(scopeObject);
             el.append(node);
             me._doAfterEachItem(filters, item, node);
         });
     };
     iterateList(modelList);
     /* listens list property changes */
     this.listen(listProperty, function () {
         iterateList(me.get('model')[listProperty]);
     });
 });


text:
package com.ibm.streamsx.health.ingest.types.connector;

import java.io.Serializable;

import com.ibm.streams.operator.OutputTuple;
import com.ibm.streamsx.topology.TStream;
import com.ibm.streamsx.topology.function.BiFunction;
import com.ibm.streamsx.topology.json.JSONSchemas;
import com.ibm.streamsx.topology.spl.SPLStream;
import com.ibm.streamsx.topology.spl.SPLStreams;

public class JsonPublisher implements Serializable {
	private static final long serialVersionUID = 1L;

	public static void publish(TStream<String> jsonInputStream, String topic) {
		SPLStream splStream = SPLStreams.convertStream(jsonInputStream, new JsonToSpl(), JSONSchemas.JSON);
		splStream.publish(topic);
	}

	private static class JsonToSpl implements BiFunction<String, OutputTuple, OutputTuple> {
		private static final long serialVersionUID = 1L;

		@Override
		public OutputTuple apply(String jsonString, OutputTuple outTuple) {
			outTuple.setString(0, jsonString);
			return outTuple;
		}

	}
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Philipp. J. Sci. , C 6:390. 1912

#### Original name
null

### Remarks
null


text:
/* Range object interface */

#ifndef Py_RANGEOBJECT_H
#define Py_RANGEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif

/* This is about the type 'xrange', not the built-in function range(), which
   returns regular lists. */

/*
A range object represents an integer range.  This is an immutable object;
a range cannot change its value after creation.

Range objects behave like the corresponding tuple objects except that
they are represented by a start, stop, and step datamembers.
*/

PyAPI_DATA(PyTypeObject) PyRange_Type;

#define PyRange_Check(op) (Py_TYPE(op) == &PyRange_Type)

#ifdef __cplusplus
}
#endif
#endif /* !Py_RANGEOBJECT_H */


text:
<?xml version="1.0" encoding="UTF-8"?>
<tei xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML">
	<teiHeader>
		<fileDesc>
			<sourceDesc>
				<biblStruct>
					<analytic>

						<author>
							<persName>
								 <forename>Walid</forename>
								 <middlename>F</middlename>.
								 <surname>Gellad</surname>,
								 <roleName>MD, MPH</roleName>
								 <marker>1,2,3</marker> ,
							</persName>
							<persName>
								 <forename>Haiden</forename>
								 <middlename>A</middlename>.
								 <surname>Huskamp</surname>,
								 <roleName>PhD</roleName>
								 <marker>4</marker> ,
							</persName>
							<persName>
								 <forename>Angela</forename>
								 <surname>Li</surname>,
								 <roleName>MPH</roleName>
								 <marker>5,6</marker> ,
							</persName>
							<persName>
								 <forename>Yuting</forename>
								 <surname>Zhang</surname>,
								 <roleName>PhD</roleName>
								 <marker>7</marker> ,
							</persName>
							<persName>
								 <forename>Dana</forename>
								 <surname>Gelb Safran</surname>,
								 <roleName>ScD</roleName>
								 <marker>5,6</marker> , and
							</persName>
							<persName>
								 <forename>Julie</forename>
								 <middlename>M</middlename>.
								 <surname>Donohue</surname>,
								 <roleName>PhD</roleName>
								 <marker>7</marker>
							</persName>
						</author>

					</analytic>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
	</teiHeader>
</tei>


text:
%% COSTSUMMIN Find the control which minimises the sum of costs
%
% SYNOPSIS
%   This function finds the control that minimises the sum of cost function
%   realisations  for some set number of steps.
%
%   - The cost function is given in `options.cost_fn'.
%   - The number of forward-looking steps is given by `options.steps'.
%   - If `options.use_controldefault' is set to 1, then the algorithm will
%     not bother finding an optimal control for the final step, but will
%     instead apply 'options.controldefault'.
%
% USAGE
%   % Standard use, with required parameters:
%   u = CostSumMin(x, K, f, c)
%
%   % With optional parameters.  options is either a list of name,value
%   % pairs, or a structure created by vk_options.
%   u = CostSumMin(x, K, f, c, options)
%
% Requires:  vk_costsum_recursive, vk_options
%
% See also: CostMin, NormMin1Step

%%
%  Copyright 2011 Jacek B. Krawczyk and Alastair Pharo
%
%  Licensed under the Apache License, Version 2.0 (the "License");
%  you may not use this file except in compliance with the License.
%  You may obtain a copy of the License at
%
%      http://www.apache.org/licenses/LICENSE-2.0
%
%  Unless required by applicable law or agreed to in writing, software
%  distributed under the License is distributed on an "AS IS" BASIS,
%  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%  See the License for the specific language governing permissions and
%  limitations under the License.
function u = CostSumMin(x, K, f, c, varargin)

    % Create options structure if required
    options = vk_options(K, f, c, varargin{:});

    steps = options.steps;
    min_fn = options.min_fn;

    cost_of_nextchange_fn = @(u) vk_costsum_recursive(x, u, steps, ...
        K, f, c, options);

    % Minimise our cost function.
    u = min_fn(cost_of_nextchange_fn, -c, c);
end

%% Recursive helper function for COSTSUMMIN
%   This function computes the aggregate cost of continuing some number of
%   steps into the future, given a starting position (x) and a control
%   level (u).  If the constraint set is exited, costs become infinite.
function cost = vk_costsum_recursive(x, u, steps, K, ...
    f, c, options)

    cost_fn = options.cost_fn;
    min_fn = options.min_fn;
    next_fn = options.next_fn;

    futurex = next_fn(x, u);

    % If there are future steps, we calculate the miniumum cost of all
    % future steps, given futurex.
    if (steps == 0)
        future_costs = 0;
    elseif (steps == 1 && options.use_controldefault)
        future_costs = cost_fn( ...
            next_fn(futurex, options.controldefault), ...
            f(futurex, options.controldefault));
    else
        future_cfn = @(u2) vk_costsum_recursive(...
            futurex, u2, steps - 1, ...
            K, f, c, options);

        [min_control_int, future_costs] = ...
            min_fn(future_cfn, -c, c);
    end

    % Then, we add the current cost and return.
    cost = cost_fn(next_fn(x, u), f(x, u)) + future_costs;
end


text:
// <copyright company="Aspose Pty Ltd">
//   Copyright (C) 2011-2021 GroupDocs. All Rights Reserved.
// </copyright>

namespace GroupDocs.Metadata.Examples.CSharp.AdvancedUsage.WorkingWithMetadataStandards.Xmp
{
    using Standards.Xmp;

    /// <summary>
    /// This code sample shows how to remove XMP metadata from a file.
    /// </summary>
    public static class RemoveXmpMetadata
    {
        public static void Run()
        {
            using (Metadata metadata = new Metadata(Constants.JpegWithXmp))
            {
                IXmp root = metadata.GetRootPackage() as IXmp;
                if (root != null)
                {
                    root.XmpPackage = null;
                    metadata.Save(Constants.OutputJpeg);
                }
            }
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/app_title">

<PreferenceScreen
android:selectable="false"
android:layout="@layout/preference_topspacer"
/>

<PreferenceCategory
android:icon="@drawable/ic_launcher_slimota"
android:layout="@layout/preference_header"
android:title="@string/ota_category">
<PreferenceScreen
android:selectable="false"
android:layout="@layout/preference_spacer"/>
<PreferenceScreen
android:icon="@drawable/twisted_ota_romupdate_icon"
android:layout="@layout/preference_header"
android:title="@string/notification_title"
android:key="key_rom_info"/>
<PreferenceScreen
android:layout="@layout/preference_header"
android:icon="@drawable/twisted_ota_checkupdates"
android:key="key_check_update"
android:title="@string/check_update_title"
></PreferenceScreen>
<ListPreference
android:layout="@layout/preference_header"
android:icon="@drawable/twisted_ota_update_icon"
android:key="key_update_interval"
android:title="@string/interval_title"
android:dialogTitle="@string/interval_title"
android:entries="@array/interval_entries"
android:entryValues="@array/interval_values">

</ListPreference>
</PreferenceCategory>

<PreferenceScreen
android:selectable="false"
android:layout="@layout/preference_spacer"/>
<PreferenceCategory
android:icon="@drawable/twisted_ota_links_icon"
android:layout="@layout/preference_header"
android:key="category_links"
android:title="@string/links_category">
</PreferenceCategory>

<PreferenceScreen
android:selectable="false"
android:layout="@layout/preference_spacer">
</PreferenceScreen>

</PreferenceScreen>


text:
package com.linecorp.armeria.server.http;

import static com.linecorp.armeria.common.SerializationFormat.NONE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

import org.junit.ClassRule;
import org.junit.Test;

import com.linecorp.armeria.client.ClientFactory;
import com.linecorp.armeria.client.Clients;
import com.linecorp.armeria.client.http.HttpClient;
import com.linecorp.armeria.common.http.AggregatedHttpMessage;
import com.linecorp.armeria.common.http.HttpHeaderNames;
import com.linecorp.armeria.common.http.HttpHeaders;
import com.linecorp.armeria.common.http.HttpMethod;
import com.linecorp.armeria.common.http.HttpRequest;
import com.linecorp.armeria.common.http.HttpResponseWriter;
import com.linecorp.armeria.common.http.HttpStatus;
import com.linecorp.armeria.server.ServerBuilder;
import com.linecorp.armeria.server.ServiceRequestContext;
import com.linecorp.armeria.server.http.cors.CorsServiceBuilder;
import com.linecorp.armeria.testing.server.ServerRule;

import io.netty.util.AsciiString;

public class HttpServerCorsTest {

    private static final ClientFactory clientFactory = ClientFactory.DEFAULT;

    @ClassRule
    public static final ServerRule server = new ServerRule() {
        @Override
        protected void configure(ServerBuilder sb) throws Exception {
            sb.service("/cors", new AbstractHttpService() {
                @Override
                protected void doGet(ServiceRequestContext ctx, HttpRequest req, HttpResponseWriter res) {
                    res.respond(HttpStatus.OK);
                }

                @Override
                protected void doPost(ServiceRequestContext ctx, HttpRequest req, HttpResponseWriter res) {
                    res.respond(HttpStatus.OK);
                }

                @Override
                protected void doHead(ServiceRequestContext ctx, HttpRequest req, HttpResponseWriter res) {
                    res.respond(HttpStatus.OK);
                }

                @Override
                protected void doOptions(ServiceRequestContext ctx, HttpRequest req, HttpResponseWriter res) {
                    res.respond(HttpStatus.OK);
                }
            }.decorate(CorsServiceBuilder.forOrigin("http://example.com")
                                         .allowRequestMethods(HttpMethod.POST)
                                         .preflightResponseHeader("x-preflight-cors", "Hello CORS")
                                         .newDecorator()));
        }
    };

    @Test
    public void testCorsPreflight() throws Exception {
        HttpClient client = Clients.newClient(clientFactory, server.uri(NONE, "/"), HttpClient.class);
        AggregatedHttpMessage response = client.execute(
                HttpHeaders.of(HttpMethod.OPTIONS, "/cors")
                           .set(HttpHeaderNames.ACCEPT, "utf-8")
                           .set(HttpHeaderNames.ORIGIN, "http://example.com")
                           .set(HttpHeaderNames.ACCESS_CONTROL_REQUEST_METHOD, "POST")
        ).aggregate().get();

        assertEquals(HttpStatus.OK, response.status());
        assertEquals("http://example.com", response.headers().get(HttpHeaderNames.ACCESS_CONTROL_ALLOW_ORIGIN));
        assertEquals("Hello CORS", response.headers().get(AsciiString.of("x-preflight-cors")));
    }

    @Test
    public void testCorsAllowed() throws Exception {
        HttpClient client = Clients.newClient(clientFactory, server.uri(NONE, "/"), HttpClient.class);
        AggregatedHttpMessage response = client.execute(
                HttpHeaders.of(HttpMethod.POST, "/cors")
                           .set(HttpHeaderNames.ACCEPT, "utf-8")
                           .set(HttpHeaderNames.ORIGIN, "http://example.com")
                           .set(HttpHeaderNames.ACCESS_CONTROL_REQUEST_METHOD, "POST")).aggregate().get();

        assertEquals(HttpStatus.OK, response.status());
        assertEquals("http://example.com", response.headers().get(HttpHeaderNames.ACCESS_CONTROL_ALLOW_ORIGIN));
    }

    @Test
    public void testCorsForbidden() throws Exception {
        HttpClient client = Clients.newClient(clientFactory, server.uri(NONE, "/"), HttpClient.class);
        AggregatedHttpMessage response = client.execute(
                HttpHeaders.of(HttpMethod.POST, "/cors")
                           .set(HttpHeaderNames.ACCEPT, "utf-8")
                           .set(HttpHeaderNames.ORIGIN, "http://example.org")
                           .set(HttpHeaderNames.ACCESS_CONTROL_REQUEST_METHOD, "POST")).aggregate().get();

        assertNull(response.headers().get(HttpHeaderNames.ACCESS_CONTROL_ALLOW_ORIGIN));
    }
}


text:
/**
 */
package isostdisois_13584_32ed_1techxmlschemaontomlSimplified;

import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;

/**
 *
 * A representation of the model object 'CREATEICON'.
 *
 *
 *

 * The following features are supported:
 *

 *

 *
{@link isostdisois_13584_32ed_1techxmlschemaontomlSimplified.CREATEICON#getIllustrations Illustrations}

 *

 *
 * @see isostdisois_13584_32ed_1techxmlschemaontomlSimplified.Isostdisois_13584_32ed_1techxmlschemaontomlSimplifiedPackage#getCREATEICON()
 * @model
 * @generated
 */
public interface CREATEICON extends EObject {
	/**
	 * Returns the value of the 'Illustrations' containment reference list.
	 * The list contents are of type {@link isostdisois_13584_32ed_1techxmlschemaontomlSimplified.ILLUSTRATION}.
	 *
	 *

	 * If the meaning of the 'Illustrations' containment reference list isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Illustrations' containment reference list.
	 * @see isostdisois_13584_32ed_1techxmlschemaontomlSimplified.Isostdisois_13584_32ed_1techxmlschemaontomlSimplifiedPackage#getCREATEICON_Illustrations()
	 * @model containment="true" required="true"
	 * @generated
	 */
	EList<ILLUSTRATION> getIllustrations();

} // CREATEICON


text:
class AddIWantToVolunteerToRegistrant < ActiveRecord::Migration
  def change
    add_column :registrants, :volunteer, :boolean
  end
end


text:
from unittest import TestCase

import os
from conf_publisher.page_maker import make_page, make_pages
from conf_publisher.confluence import Page
from conf_publisher.config import ConfigLoader, ConfigDumper

class FakeConfluencePageManager(object):

    def __init__(self, initial_pages=None):
        if initial_pages is None:
            initial_pages = []
        self._pages = dict((page.id, page) for page in initial_pages)

    def _get_last_content_id(self):
        if len(self._pages.keys()):
            return max(self._pages.keys())
        return 0

    def load(self, content_id):
        return self._pages[content_id]

    def create(self, page):
        content_id = self._get_last_content_id() + 1
        self._pages[content_id] = page
        return content_id

    def update(self, page, bump_version=True):
        if bump_version:
            page.version_number += 1
        self._pages[page.id] = page
        return page.id

def make_page_fixture(page_id=None, title=None, body=None, space_key='TEST'):
    p = Page()
    p.id = page_id
    p.space_key = space_key
    p.title = title
    p.body = body
    return p

class PageMakerTestCase(TestCase):

    def test_make_page(self):
        parent_page = make_page_fixture(page_id=40000000, title='parent page')
        page_manager = FakeConfluencePageManager([parent_page])
        page_id = make_page(parent_page, 'child page', page_manager)
        self.assertEqual(page_id, 40000001)

    def test_make_pages_with_parent_id(self):
        page_manager = FakeConfluencePageManager([
            make_page_fixture(page_id=40000000, title='parent page')
        ])

        config = ConfigLoader.from_dict({
            'version': 2,
            'base_dir': 'fixtures',
            'pages': [
                {
                    'title': 'child page',
                }
            ]
        })

        make_pages(config, page_manager, parent_id=40000000)
        self.assertTrue(40000001 in page_manager._pages)

    def test_make_pages_without_parent_id(self):
        page_manager = FakeConfluencePageManager([
            make_page_fixture(page_id=40000000, title='parent page')
        ])

        config = ConfigLoader.from_dict({
            'version': 2,
            'base_dir': 'fixtures',
            'pages': [
                {
                    'id': 40000000,
                    'title': 'parent page',
                    'pages': [
                        {
                            'title': 'child page',
                        }
                    ]
                }
            ]
        })

        make_pages(config, page_manager, parent_id=40000000)
        self.assertTrue(40000001 in page_manager._pages)

    def test_dump_config(self):
        expected = [
            'version: 2\n',
            'base_dir: fixtures\n',
            'pages:\n',
            '- id: 40000000\n',
            '  title: parent page\n',
            '  pages:\n',
            '  - title: child page\n'
        ]
        config = ConfigLoader.from_dict({
            'version': 2,
            'base_dir': 'fixtures',
            'pages': [
                {
                    'id': 40000000,
                    'title': 'parent page',
                    'pages': [
                        {
                            'title': 'child page',
                        }
                    ]
                }
            ]
        })
        ConfigDumper.to_yaml_file(config, 'test_cfg.yaml')
        with open('test_cfg.yaml') as cfg:
            data = cfg.readlines()
        os.remove('test_cfg.yaml')
        self.assertEqual(expected, data)


text:
.. toctree::
  :maxdepth: 2

  class/Log.rst
  class/LogViewer.rst
  function/electrofacies.rst
  function/dataset.rst
  function/download.rst


text:
/**
 * A single item designated for upload.
 *
 * It is a simple object wrapping the native file API object.
 */
Ext.define('MyApp.ux.panel.upload.Item', {
	mixins : {
		observable : 'Ext.util.Observable'
	},

	STATUS_READY : 'ready',
	STATUS_UPLOADING : 'uploading',
	STATUS_UPLOADED : 'uploaded',
	STATUS_UPLOAD_ERROR : 'uploaderror',

	config : {
		/**
		 * @cfg {Object} fileApiObject (required)
		 *
		 * A native file API object
		 */
		fileApiObject : null,
		remoteFolder : null, // tony
		xhr : null,// tony: for aborting connection

		/**
		 * @cfg {String}
		 *
		 * The upload error message associated with this file object
		 */
		uploadErrorMessage : ''
	},

	constructor : function(config) {
		this.mixins.observable.constructor.call(this);

		this.addEvents({
			changestatus : true,
			progressupdate : true
		});

		this.initConfig(config);

		Ext.apply(this, {
			status : this.STATUS_READY,
			progress : 0
		});
	},

	reset : function() {
		this.uploadErrorMessage = '';
		this.setStatus(this.STATUS_READY);
		this.setProgress(0);
	},

	getFileApiObject : function() {
		return this.fileApiObject;
	},

	getId : function() {
		// tony
		return this.getRemoteFolder() + '/' + this.getFilename();
		// return this.getFilename();
	},

	getName : function() {
		return this.getProperty('name');
	},

	getFilename : function() {
		return this.getName();
	},

	getSize : function() {
		return this.getProperty('size');
	},

	getType : function() {
		return this.getProperty('type');
	},

	getProperty : function(propertyName) {
		if (this.fileApiObject) {
			return this.fileApiObject[propertyName];
		}

		return null;
	},

	getProgress : function() {
		return this.progress;
	},

	getProgressPercent : function() {
		// tony
		if (this.getSize() === 0) {
			return 100;
		}
		var progress = this.getProgress();
		if (!progress) {
			return 0;
		}

		var percent = Ext.util.Format.number((progress / this.getSize()) * 100, '0.0');
		if (percent > 100) {
			percent = 100;
		}

		return percent;
	},

	setProgress : function(progress) {
//		console.log('setProgress', progress);
		this.progress = progress;
		this.fireEvent('progressupdate', this);
	},

	getStatus : function() {
		return this.status;
	},

	setStatus : function(status) {
		this.status = status;
		this.fireEvent('changestatus', this, status);
	},

	isReady : function() {
		return (this.status == this.STATUS_READY);
	},

	isUploaded : function() {
		return (this.status == this.STATUS_UPLOADED);
	},

	setUploaded : function() {
		console.log('setUploaded', this.getSize());
		this.setProgress(this.getSize());
		this.setStatus(this.STATUS_UPLOADED);
	},

	isUploadError : function() {
		return (this.status == this.STATUS_UPLOAD_ERROR);
	},

	getUploadErrorMessage : function() {
		return this.uploadErrorMessage;
	},

	setUploadError : function(message) {
		this.uploadErrorMessage = message;
		this.setStatus(this.STATUS_UPLOAD_ERROR);
	},

	setUploading : function() {
		this.setStatus(this.STATUS_UPLOADING);
	}
});


text:
package harmony.mastermind.logic.commands;

import java.util.EmptyStackException;

import harmony.mastermind.model.TaskManager;
// @@author A0138862W
public class UndoCommand extends Command{

    public static final String COMMAND_WORD = "undo";

    public static final String MESSAGE_SUCCESS = "Undo successfully.";
    public static final String MESSAGE_EMPTY_COMMAND_HISTORY = "There's no more action available to undo.";
    public static final String MESSAGE_COMMAND_NOT_UNDOABLE = "This command is not undoable";
    public static final String COMMAND_DESCRIPTION = "Undo an action";

    @Override
    //@@author A0138862W
    public CommandResult execute() {

        try{
            // All Command supports undo operation must implement Undoable interface

            // execute the undo strategy implemented by the underlying command
            CommandResult undoResult = model.undo();

            // display successful message and the details of the undo operations
            return new CommandResult(COMMAND_WORD,
                    MESSAGE_SUCCESS + "\n" +
                    "=====Undo Details=====\n" +
                    undoResult.feedbackToUser + "\n"+
                    "==================");
        }catch(EmptyStackException ex){
            return new CommandResult(COMMAND_WORD, MESSAGE_EMPTY_COMMAND_HISTORY);
        }
    }

}


text:
/* */
require("../modules/es6.number.constructor");
require("../modules/es6.number.statics");
module.exports = require("../modules/$").core.Number;


text:
package com.github.springtestdbunit.operation;

import java.util.HashMap;
import java.util.Map;

import org.dbunit.ext.mssql.InsertIdentityOperation;

import com.github.springtestdbunit.annotation.DatabaseOperation;

/**
 * Microsoft SQL Server implementation of {@link DatabaseOperationLookup}.
 *
 * @author Phillip Webb
 */
public class MicrosoftSqlDatabaseOperationLookup extends DefaultDatabaseOperationLookup {

	private static Map<DatabaseOperation, org.dbunit.operation.DatabaseOperation> MSSQL_LOOKUP;
	static {
		MSSQL_LOOKUP = new HashMap<DatabaseOperation, org.dbunit.operation.DatabaseOperation>();
		MSSQL_LOOKUP.put(DatabaseOperation.INSERT, InsertIdentityOperation.INSERT);
		MSSQL_LOOKUP.put(DatabaseOperation.REFRESH, InsertIdentityOperation.REFRESH);
		MSSQL_LOOKUP.put(DatabaseOperation.CLEAN_INSERT, InsertIdentityOperation.CLEAN_INSERT);
	}

	@Override
	public org.dbunit.operation.DatabaseOperation get(DatabaseOperation operation) {
		if (MSSQL_LOOKUP.containsKey(operation)) {
			return MSSQL_LOOKUP.get(operation);
		}
		return super.get(operation);
	}
}


text:
class Tag {
    id: String;
    label: String;
}

export default Tag;


text:
namespace YAF.Pages.Admin
{

    public partial class BannedEmails
    {

        /// <summary>
        /// PageLinks-Steuerelement.
        /// </summary>
        /// <remarks>
        /// Automatisch generiertes Feld.
        /// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
        /// </remarks>
        protected global::YAF.Web.Controls.PageLinks PageLinks;

        /// <summary>
        /// HelpLabel2-Steuerelement.
        /// </summary>
        /// <remarks>
        /// Automatisch generiertes Feld.
        /// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
        /// </remarks>
        protected global::YAF.Web.Controls.LocalizedLabel HelpLabel2;

        /// <summary>
        /// PageSize-Steuerelement.
        /// </summary>
        /// <remarks>
        /// Automatisch generiertes Feld.
        /// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
        /// </remarks>
        protected global::System.Web.UI.WebControls.DropDownList PageSize;

        /// <summary>
        /// HelpLabel1-Steuerelement.
        /// </summary>
        /// <remarks>
        /// Automatisch generiertes Feld.
        /// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
        /// </remarks>
        protected global::YAF.Web.Controls.HelpLabel HelpLabel1;

        /// <summary>
        /// SearchInput-Steuerelement.
        /// </summary>
        /// <remarks>
        /// Automatisch generiertes Feld.
        /// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox SearchInput;

        /// <summary>
        /// search-Steuerelement.
        /// </summary>
        /// <remarks>
        /// Automatisch generiertes Feld.
        /// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
        /// </remarks>
        protected global::YAF.Web.Controls.ThemeButton search;

        /// <summary>
        /// list-Steuerelement.
        /// </summary>
        /// <remarks>
        /// Automatisch generiertes Feld.
        /// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Repeater list;

        /// <summary>
        /// PagerTop-Steuerelement.
        /// </summary>
        /// <remarks>
        /// Automatisch generiertes Feld.
        /// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
        /// </remarks>
        protected global::YAF.Web.Controls.Pager PagerTop;

        /// <summary>
        /// ImportDialog-Steuerelement.
        /// </summary>
        /// <remarks>
        /// Automatisch generiertes Feld.
        /// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
        /// </remarks>
        protected global::YAF.Dialogs.BannedEmailImport ImportDialog;

        /// <summary>
        /// EditDialog-Steuerelement.
        /// </summary>
        /// <remarks>
        /// Automatisch generiertes Feld.
        /// Zum Ändern Felddeklaration aus der Designerdatei in eine Code-Behind-Datei verschieben.
        /// </remarks>
        protected global::YAF.Dialogs.BannedEmailEdit EditDialog;
    }
}


text:
package org.jclouds.chef.strategy.internal;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Predicates.and;
import static com.google.common.base.Predicates.notNull;
import static com.google.common.collect.Iterables.filter;
import static com.google.common.collect.Iterables.transform;
import static org.jclouds.chef.util.ChefUtils.fromOhaiTime;

import java.util.Calendar;
import java.util.Date;

import javax.annotation.Resource;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

import org.jclouds.chef.config.ChefProperties;
import org.jclouds.chef.domain.Node;
import org.jclouds.chef.strategy.CleanupStaleNodesAndClients;
import org.jclouds.chef.strategy.DeleteAllClientsInList;
import org.jclouds.chef.strategy.DeleteAllNodesInList;
import org.jclouds.chef.strategy.ListNodes;
import org.jclouds.domain.JsonBall;
import org.jclouds.logging.Logger;

import com.google.common.base.Function;
import com.google.common.base.Predicate;

/**
 *
 * Cleans up nodes and apis who have been hanging around too long.
 */
@Singleton
public class CleanupStaleNodesAndClientsImpl implements CleanupStaleNodesAndClients {
   @Resource
   @Named(ChefProperties.CHEF_LOGGER)
   protected Logger logger = Logger.NULL;

   private final ListNodes nodeLister;
   private final DeleteAllNodesInList nodeDeleter;
   private final DeleteAllClientsInList clientDeleter;

   @Inject
   public CleanupStaleNodesAndClientsImpl(DeleteAllNodesInList nodeDeleter, DeleteAllClientsInList clientDeleter,
         ListNodes nodeLister) {
      this.nodeLister = checkNotNull(nodeLister, "nodeLister");
      this.nodeDeleter = checkNotNull(nodeDeleter, "nodeDeleter");
      this.clientDeleter = checkNotNull(clientDeleter, "clientDeleter");
   }

   @Override
   public void execute(final String prefix, int secondsStale) {
      final Calendar expired = Calendar.getInstance();
      expired.setTime(new Date());
      expired.add(Calendar.SECOND, -secondsStale);
      Iterable<? extends Node> staleNodes = filter(
         nodeLister.execute(), and(notNull(), new Predicate<Node>() {
               @Override
               public boolean apply(Node input) {
                  return input.getName().startsWith(prefix);
               }
         },
         new Predicate<Node>() {
             @Override
             public boolean apply(Node input) {
                JsonBall dateLong = input.getAutomaticAttributes().get("ohai_time");
                if (dateLong == null)
                   return true;
                Calendar nodeUpdate = Calendar.getInstance();
                nodeUpdate.setTime(fromOhaiTime(dateLong));
                return expired.after(nodeUpdate);
             }
         }));
      Iterable<String> nodeNames = transform(staleNodes, new Function<Node, String>() {

         @Override
         public String apply(Node from) {
            return from.getName();
         }

      });
      nodeDeleter.execute(nodeNames);
      clientDeleter.execute(nodeNames);
   }
}


text:
#pragma once

#include "XPathElement.h"

namespace antlr4 {
namespace tree {
namespace xpath {

  class ANTLR4CPP_PUBLIC XPathTokenAnywhereElement : public XPathElement {
  protected:
    int tokenType = 0;
  public:
    XPathTokenAnywhereElement(const std::string &tokenName, int tokenType);

    virtual std::vector<ParseTree *> evaluate(ParseTree *t) override;
  };

} // namespace xpath
} // namespace tree
} // namespace antlr4


text: Just starting to develop the server for Jaby.


text:
using Abp.Modules;
using System;
using System.Collections.Generic;

namespace Cinotam.FileManager
{
    public class FileManagerModule : AbpModule
    {
        public static List<Type> FileManagerServiceProviders = new List<Type>();

        protected FileManagerModule()
        {

        }
    }
}


text:
import { Component, OnInit } from '@angular/core';
// Variable in assets/js/scripts.js file
declare var AdminLTE: any;

@Component({

  selector: 'app-skills-management-main',
  templateUrl: './skills-management-main.component.html'
})
export class SkillsManagementMainComponent implements OnInit {

  constructor() { }

  user = {
    name:'Eddy',
    lastname:'Masson',
    role:'maitre',
    job:'Developpeur'
  }

  ngOnInit() {
    // Update the AdminLTE layouts
    AdminLTE.init();
  }

}


text:
<!doctype HTML>
<html>
<head>
    <meta charset="UTF-8">
    <title>OrderedSet tests</title>

    <link rel="stylesheet" href="vendor/objectDiff/objectDiff.css">
    <script src="vendor/objectDiff/objectDiff.js"></script>
    <script src="vendor/objectDiff/jasmine-objectDiff.js"></script>

    <link rel="stylesheet" href="vendor/jasmine/jasmine.css">
    <script src="vendor/jasmine/jasmine.js"></script>
    <link rel="stylesheet" href="vendor/jasmine-html-reporter/HtmlReporter.css">
    <script src="vendor/jasmine-html-reporter/HtmlReporter.js"></script>

    <script>
    beforeEach(function() {
        this.addMatchers(objectDiff.jasmine);
    });
    </script>

    <script src="../LinkedList.js"></script>
    <script src="LinkedList.spec.js"></script>

    <script src="../OrderedSet.js"></script>
    <script src="OrderedSet.spec.js"></script>

    <script src="../Ordered2DSet.js"></script>
    <script src="Ordered2DSet.spec.js"></script>

    <script>
    var htmlReporter = new jasmine.HtmlReporter();
    var jasmineEnv = jasmine.getEnv();
    jasmineEnv.updateInterval = 1000;
    jasmineEnv.addReporter(htmlReporter);
    jasmineEnv.specFilter = htmlReporter.specFilter;

    window.onload = function() {
        jasmineEnv.execute();
    };
    </script>
    <link id="favicon_pass" href="vendor/jasmine-html-reporter/pass.png"/>
    <link id="favicon_fail" href="vendor/jasmine-html-reporter/fail.png"/>
</head>
<body></body>
</html>


text:
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({name: 'checkmark'})
export class CheckmarkPipe implements PipeTransform {

  transform(input: boolean) {
    return input ? '\u2713' : '\u2718';
  }

}


text:
{% load i18n unoconsole_urls %}

		{% if show_save %}
		    {% if has_state %}
			    <input type="submit" value="{% trans 'Save & Publish' %}" class="default btn btn-primary" name="_publish" {{ onclick_attrib }}/>
			    <input type="submit" value="{% trans 'Save & Stage' %}" class="default btn btn-warning" name="_stage" {{ onclick_attrib }}/>
			    <input type="submit" value="{% trans 'Save & Unpublish' %}" class="default btn btn-default" name="_unpublish" {{ onclick_attrib }}/>
		     {% else %}
		        <input type="submit" value="{% trans 'Save' %}" class="default btn btn-primary" name="_continue" {{ onclick_attrib }}/>
		     {% endif %}
		{% endif %}
		{% if show_delete_link %}{% trans "Delete" %}{% endif %}
{% comment %}
		{% if not copy_new_version %}
			{% if show_save_as_new %}<input type="submit" value="{% trans 'Save as new' %}" name="_saveasnew" {{ onclick_attrib }}/>{%endif%}
			{% if show_save_and_add_another %}<input type="submit" value="{% trans 'Save and add another' %}" name="_addanother" class="btn btn-primary" {{ onclick_attrib }}/>{% endif %}
			{% if show_save_and_continue %}<input type="submit" value="{% trans 'Save and continue editing' %}" name="_continue" class="btn btn-primary" {{ onclick_attrib }}/>{% endif %}
        {% endif %}
{% endcomment %}


text:
@protocol JWTTokenDecoderNecessaryDataObject__Protocol <NSObject>
@property (copy, nonatomic, readonly) NSString *chosenAlgorithmName;
@property (copy, nonatomic, readonly) NSString *chosenSecret;
@property (copy, nonatomic, readonly) NSData *chosenSecretData;
@property (assign, nonatomic, readonly) BOOL isBase64EncodedSecret;
@end

@protocol JWTTokenDecoderProtocol
- (JWTCodingResultType *)decodeToken:(NSString *)token skipSignatureVerification:(BOOL)skipVerification necessaryDataObject:(id<JWTTokenDecoderNecessaryDataObject__Protocol>)object;
@end

@interface JWTTokenDecoder : NSObject <JWTTokenDecoderProtocol>
@end