text:
<?xml version="1.0" encoding="UTF-8"?>
<!-- (C) Copyright 2005-2014 CEN SIRI -->
<Siri xmlns="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://www.siri.org.uk/siri ../../xsd/siri.xsd">
<DataReceivedAcknowledgement >
 <ResponseTimestamp>2001-12-17T09:30:47-05:00</ResponseTimestamp>
 <ConsumerRef>NADER</ConsumerRef>
 <RequestMessageRef>012225678</RequestMessageRef>
 <Status>true</Status>
 </DataReceivedAcknowledgement>
 </Siri>


text:
import React, { Component } from 'react';
import { SingleDatePicker, DateRangePicker } from 'react-dates';
import moment from 'moment';

export default class DatePicker extends Component {
  state = {
    date: moment(),
    startDate: moment(),
    endDate: moment(),
    dateRangeFocusedInput: null,

  };

  render() {
    let { date } = this.state;
    return (

Date Picker

            <SingleDatePicker
              date={date}
              onDateChange={date => this.setState({date})}
              focused={this.state.focused}
              onFocusChange={({ focused }) => this.setState({ focused })}
            />

DateRange Picker

            <DateRangePicker
              startDate={this.state.startDate}
              endDate={this.state.endDate}
              focusedInput={this.state.dateRangeFocusedInput}
              onFocusChange={focusedInput => this.setState({dateRangeFocusedInput: focusedInput})}
              onDatesChange={({startDate, endDate}) => this.setState({startDate, endDate})} />

    );
  }
}

redpajama_set_name: RedPajamaGithub


text:
package becta.viewer.selection;

public interface Deletable {

}


text:
using Microsoft.DotNet.VersionTools.Util;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;

namespace Microsoft.DotNet.VersionTools.BuildManifest.Model
{
    public class PackageArtifactModel
    {
        private static readonly string[] RequiredAttributes =
        {
            nameof(Id),
            nameof(Version)
        };

        private static readonly string[] AttributeOrder = RequiredAttributes.Concat(new[]
        {
            nameof(OriginBuildName)
        }).ToArray();

        public IDictionary<string, string> Attributes { get; set; } = new Dictionary<string, string>();

        public string Id
        {
            get { return Attributes.GetOrDefault(nameof(Id)); }
            set { Attributes[nameof(Id)] = value; }
        }

        public string Version
        {
            get { return Attributes.GetOrDefault(nameof(Version)); }
            set { Attributes[nameof(Version)] = value; }
        }

        public string OriginBuildName
        {
            get { return Attributes.GetOrDefault(nameof(OriginBuildName)); }
            set { Attributes[nameof(OriginBuildName)] = value; }
        }

        public override string ToString() => $"Package {Id} {Version}";

        public XElement ToXml() => new XElement(
            "Package",
            Attributes
                .ThrowIfMissingAttributes(RequiredAttributes)
                .CreateXmlAttributes(AttributeOrder));

        public static PackageArtifactModel Parse(XElement xml) => new PackageArtifactModel
        {
            Attributes = xml
                .CreateAttributeDictionary()
                .ThrowIfMissingAttributes(RequiredAttributes)
        };
    }
}


text:
Silahkan Login

<fieldset>
<?php echo validation_errors(); ?>

<?php echo $this->session->flashdata('notification')?>

<?php echo form_open('akun/login')?>
Username : <input type="text" name="username"/>

Password : <input type="password" name="password"/>

<input type="submit" name="masuk" value="Masuk" />

</form>
</fieldset>


text:
"""change minizipali_status to municipal_status

Revision ID: 1723862d5c0
Revises: 231f70d55609
Create Date: 2018-10-01 23:58:53.049218

"""

# revision identifiers, used by Alembic.
revision = '1723862d5c0'
down_revision = '231f70d55609'
branch_labels = None
depends_on = None

import sqlalchemy as sa

from alembic import op

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('municipal_status',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('municipal_status_hebrew', sa.Text(), nullable=True),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_index(op.f('ix_municipal_status_id'), 'municipal_status', ['id'], unique=False)
    op.drop_table('minizipali_status')
    op.add_column('markers', sa.Column('municipal_status', sa.Integer(), nullable=True))
    op.drop_column('markers', 'minizipali_status')
    op.add_column('markers_no_location', sa.Column('municipal_status', sa.Integer(), nullable=True))
    op.drop_column('markers_no_location', 'minizipali_status')
    ### end Alembic commands ###

def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('markers_no_location',
                  sa.Column('minizipali_status', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_column('markers_no_location', 'municipal_status')
    op.add_column('markers', sa.Column('minizipali_status', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_column('markers', 'municipal_status')
    op.create_table('minizipali_status',
                    sa.Column('id', sa.INTEGER(), nullable=False),
                    sa.Column('minizipali_status_hebrew', sa.TEXT(), autoincrement=False, nullable=True),
                    sa.PrimaryKeyConstraint('id', name='minizipali_status_pkey')
                    )
    op.drop_index(op.f('ix_municipal_status_id'), table_name='municipal_status')
    op.drop_table('municipal_status')
    ### end Alembic commands ###


text:
const userHelper = require('modules/helper/user');
const response = require('modules/helper/response');
const tokenManager = require('modules/auth/token');
const request = require('modules/helper/request');
const authError = require('modules/error/auth');

const userController = {

    localDB: null,

    validateUser: (user, req, res, next) => {
        if(userHelper.isAdmin(user)) {
            let t = tokenManager.newToken(req);

            tokenManager.setTokenToDB(t)
                .then(
                    () => {
                        // set cookie
                        res.cookie('token', t.token);
                        // TODO return the role of admin user
                        next(response.success(t))
                    },
                    error => {
                        next(response.error(error.message));
                    }
                )
        }else {
            next(response.error(authError.AUTH_ERROR, authError.CODE));
        }
    },

    logoutUser: (token, req, res, next) => {
        const ip = request.getIp(req);
        const user_agent = request.getUserAgent(req);

        tokenManager.getTokensFromDB({
            token,
            ip,
            user_agent,
            valid: true
        })
        .then(tokens => {
            if(tokens.length === 0) {
                next(response.error(authError.AUTH_ERROR, authError.code));
                return;
            }

            return tokenManager
                         .invalidateTokens({
                             token,
                             ip,
                             user_agent,
                             valid: true
                         })
                         .then(() => {
                             res.cookie('token', null);
                         })
        })
        .then(() => {
            next(response.success());
        })
        .catch(err => {
            next(response.error(authError.AUTH_ERROR, authError.CODE));
        })
    }
}

module.exports = userController;


text:
package org.jclouds.aliyun.oss;

import java.io.Closeable;
import java.util.Set;

import com.aliyun.oss.OSS;

public interface OSSApi extends Closeable {

   static final String DEFAULT_REGION = "oss-cn-hangzhou";

   OSS getOSSClient(String region);

   Set<String> getAvailableRegions();
}


text:
/*
 * 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.
 */
package io.trino.operator;

import com.google.common.annotations.VisibleForTesting;
import io.trino.Session;
import io.trino.spi.Page;
import io.trino.spi.PageBuilder;
import io.trino.spi.type.Type;
import io.trino.sql.gen.JoinCompiler;
import io.trino.type.BlockTypeOperators;

import java.util.List;
import java.util.Optional;

import static io.trino.SystemSessionProperties.isDictionaryAggregationEnabled;
import static io.trino.spi.type.BigintType.BIGINT;

public interface GroupByHash
{
    static GroupByHash createGroupByHash(
            Session session,
            List<? extends Type> hashTypes,
            int[] hashChannels,
            Optional<Integer> inputHashChannel,
            int expectedSize,
            JoinCompiler joinCompiler,
            BlockTypeOperators blockTypeOperators,
            UpdateMemory updateMemory)
    {
        return createGroupByHash(hashTypes, hashChannels, inputHashChannel, expectedSize, isDictionaryAggregationEnabled(session), joinCompiler, blockTypeOperators, updateMemory);
    }

    static GroupByHash createGroupByHash(
            List<? extends Type> hashTypes,
            int[] hashChannels,
            Optional<Integer> inputHashChannel,
            int expectedSize,
            boolean processDictionary,
            JoinCompiler joinCompiler,
            BlockTypeOperators blockTypeOperators,
            UpdateMemory updateMemory)
    {
        if (hashTypes.size() == 1 && hashTypes.get(0).equals(BIGINT) && hashChannels.length == 1) {
            return new BigintGroupByHash(hashChannels[0], inputHashChannel.isPresent(), expectedSize, updateMemory);
        }
        return new MultiChannelGroupByHash(hashTypes, hashChannels, inputHashChannel, expectedSize, processDictionary, joinCompiler, blockTypeOperators, updateMemory);
    }

    long getEstimatedSize();

    long getHashCollisions();

    double getExpectedHashCollisions();

    List<Type> getTypes();

    int getGroupCount();

    void appendValuesTo(int groupId, PageBuilder pageBuilder, int outputChannelOffset);

    Work<?> addPage(Page page);

    Work<GroupByIdBlock> getGroupIds(Page page);

    boolean contains(int position, Page page, int[] hashChannels);

    default boolean contains(int position, Page page, int[] hashChannels, long rawHash)
    {
        return contains(position, page, hashChannels);
    }

    long getRawHash(int groupyId);

    @VisibleForTesting
    int getCapacity();
}


text:
package com.google.security.zynamics.reil.translators.x86;

import com.google.security.zynamics.reil.OperandSize;
import com.google.security.zynamics.reil.ReilHelpers;
import com.google.security.zynamics.reil.ReilInstruction;
import com.google.security.zynamics.reil.translators.IInstructionTranslator;
import com.google.security.zynamics.reil.translators.ITranslationEnvironment;
import com.google.security.zynamics.reil.translators.InternalTranslationException;
import com.google.security.zynamics.reil.translators.TranslationHelpers;
import com.google.security.zynamics.reil.translators.TranslationResult;
import com.google.security.zynamics.zylib.disassembly.IInstruction;
import com.google.security.zynamics.zylib.disassembly.IOperandTree;

import java.util.List;

/**
 * Translates RCR instructions to REIL code.
 */
public class RcrTranslator implements IInstructionTranslator {

  // TODO(timkornau): Check this code again

  /**
   * Translates a RCR instruction to REIL code.
   *
   * @param environment A valid translation environment.
   * @param instruction The RCR instruction to translate.
   * @param instructions The generated REIL code will be added to this list
   *
   * @throws InternalTranslationException if any of the arguments are null the passed instruction is
   *         not an RCR instruction
   */
  @Override
  public void translate(final ITranslationEnvironment environment, final IInstruction instruction,
      final List<ReilInstruction> instructions) throws InternalTranslationException {
    TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "rcr");

    if (instruction.getOperands().size() != 2) {
      throw new InternalTranslationException(
          "Error: Argument instruction is not a rcr instruction (invalid number of operands)");
    }

    final long baseOffset = instruction.getAddress().toLong() * 0x100;
    long offset = baseOffset;

    final List<? extends IOperandTree> operands = instruction.getOperands();

    final IOperandTree targetOperand = operands.get(0);
    final IOperandTree sourceOperand = operands.get(1);

    // Load source operand.
    final TranslationResult sourceResult =
        Helpers.translateOperand(environment, offset, sourceOperand, true);
    instructions.addAll(sourceResult.getInstructions());

    // Adjust the offset of the next REIL instruction.
    offset = baseOffset + instructions.size();

    // Load target operand.
    final TranslationResult targetResult =
        Helpers.translateOperand(environment, offset, targetOperand, true);
    instructions.addAll(targetResult.getInstructions());

    // Adjust the offset of the next REIL instruction.
    offset = baseOffset + instructions.size();

    final OperandSize sourceSize = sourceResult.getSize();
    final OperandSize targetSize = targetResult.getSize();
    final OperandSize resultSize = TranslationHelpers.getNextSize(sourceSize);

    final String sourceRegister = sourceResult.getRegister();
    final String targetRegister = targetResult.getRegister();

    final String rotateMask = environment.getNextVariableString();
    final String rotateMaskZero = environment.getNextVariableString();
    final String rotateMaskLessOne = environment.getNextVariableString();
    final String rotateMaskOne = environment.getNextVariableString();
    final String shiftedOp1 = environment.getNextVariableString();
    final String realOp1 = environment.getNextVariableString();
    final String shrValue = environment.getNextVariableString();
    final String shredResult = environment.getNextVariableString();
    final String shlValue = environment.getNextVariableString();
    final String shledResult = environment.getNextVariableString();
    final String result = environment.getNextVariableString();
    final String shiftedResult = environment.getNextVariableString();
    final String truncatedResult = environment.getNextVariableString();
    final String tempOf = environment.getNextVariableString();
    final String tempOfLsb = environment.getNextVariableString();

    final String msbMask = String.valueOf(TranslationHelpers.getMsbMask(sourceSize));
    final String maskSize = String.valueOf(TranslationHelpers.getAllBitsMask(sourceSize));
    final String modVal = String.valueOf(sourceSize.getBitSize());
    final String shiftMsbLsb = String.valueOf(TranslationHelpers.getShiftMsbLsbMask(sourceSize));

    // Make sure to rotate less than the size of the register
    instructions.add(ReilHelpers.createMod(offset, targetSize, targetRegister, targetSize, modVal,
        targetSize, rotateMask));

    // Find out if the rotate mask is 0 and negate the result
    instructions.add(ReilHelpers.createBisz(offset + 1, targetSize, rotateMask, OperandSize.BYTE,
        rotateMaskZero));

    // Find out if the rotate mask is 1
    instructions.add(ReilHelpers.createSub(offset + 2, targetSize, rotateMask, targetSize, "1",
        targetSize, rotateMaskLessOne));
    instructions.add(ReilHelpers.createBisz(offset + 3, targetSize, rotateMaskLessOne,
        OperandSize.BYTE, rotateMaskOne));

    // Rotating through the carry flag is like rotating through a 33 bit register
    // For rotating rightwards, the CF must be added at the LSB of the 32 register
    instructions.add(ReilHelpers.createBsh(offset + 4, sourceSize, sourceRegister,
        OperandSize.BYTE, "1", resultSize, shiftedOp1));
    instructions.add(ReilHelpers.createOr(offset + 5, resultSize, shiftedOp1, OperandSize.BYTE,
        Helpers.CARRY_FLAG, resultSize, realOp1));

    // Negate the rotate-mask => ROT to the right
    instructions.add(ReilHelpers.createSub(offset + 6, OperandSize.BYTE, "0", OperandSize.BYTE,
        rotateMask, OperandSize.BYTE, shrValue));

    // Perform the rotate
    instructions.add(ReilHelpers.createBsh(offset + 7, sourceSize, realOp1, OperandSize.BYTE,
        shrValue, sourceSize, shredResult));
    instructions.add(ReilHelpers.createSub(offset + 8, OperandSize.BYTE, modVal, OperandSize.BYTE,
        rotateMask, OperandSize.BYTE, shlValue));
    instructions.add(ReilHelpers.createBsh(offset + 9, sourceSize, realOp1, OperandSize.BYTE,
        shlValue, sourceSize, shledResult));
    instructions.add(ReilHelpers.createOr(offset + 10, sourceSize, shredResult, sourceSize,
        shledResult, sourceSize, result));

    // Truncate the result (get rid of the CF in the LSB)
    instructions.add(ReilHelpers.createBsh(offset + 11, resultSize, result, OperandSize.BYTE, "-1",
        resultSize, shiftedResult));
    instructions.add(ReilHelpers.createAnd(offset + 12, resultSize, shiftedResult, sourceSize,
        maskSize, sourceSize, truncatedResult));

    // Don't change the flags if the rotate value was zero
    final String jmpGoal = "666";
    instructions.add(ReilHelpers.createJcc(offset + 13, OperandSize.BYTE, rotateMaskZero,
        OperandSize.ADDRESS, jmpGoal));

    // Properly update OF if the rotate value == 1
    final String jmpGoal2 = "666";
    instructions.add(ReilHelpers.createJcc(offset + 14, OperandSize.BYTE, rotateMaskZero,
        OperandSize.ADDRESS, jmpGoal2));

    // Set the OF to undefined if the rotate-mask was positive but not 1
    instructions.add(ReilHelpers.createUndef(offset + 15, OperandSize.BYTE, Helpers.OVERFLOW_FLAG));

    // Update the CF now
    final String jmpGoal3 = "666";
    instructions.add(ReilHelpers.createJcc(offset + 15, OperandSize.BYTE, rotateMaskZero,
        OperandSize.ADDRESS, jmpGoal3));

    instructions.add(ReilHelpers.createAnd(offset + 16, sourceSize, sourceRegister, sourceSize,
        msbMask, sourceSize, tempOf));
    instructions.add(ReilHelpers.createBsh(offset + 17, sourceSize, tempOf, sourceSize,
        shiftMsbLsb, OperandSize.BYTE, tempOfLsb));
    instructions.add(ReilHelpers.createXor(offset + 18, OperandSize.BYTE, tempOfLsb,
        OperandSize.BYTE, Helpers.CARRY_FLAG, OperandSize.BYTE, Helpers.OVERFLOW_FLAG));

    // Set the CF to the LSB of the untruncated result
    instructions.add(ReilHelpers.createAnd(offset + 19, resultSize, result, OperandSize.BYTE, "1",
        OperandSize.BYTE, Helpers.CARRY_FLAG));

    Helpers.writeBack(environment, offset + 20, targetOperand, result, targetResult.getSize(),
        targetResult.getAddress(), targetResult.getType(), instructions);
  }

}


text:
<?php

namespace Symfony\Component\Finder;

/**
 * Finder allows to build rules to find files and directories.
 *
 * It is a thin wrapper around several specialized iterator classes.
 *
 * All rules may be invoked several times.
 *
 * All methods return the current Finder object to allow easy chaining:
 *
 * $finder = Finder::create()->files()->name('*.php')->in(__DIR__);
 *
 * @author Fabien Potencier <fabien@symfony.com>
 *
 * @api
 */
class Finder implements \IteratorAggregate, \Countable
{
    const IGNORE_VCS_FILES = 1;
    const IGNORE_DOT_FILES = 2;

    private $mode        = 0;
    private $names       = array();
    private $notNames    = array();
    private $exclude     = array();
    private $filters     = array();
    private $depths      = array();
    private $sizes       = array();
    private $followLinks = false;
    private $sort        = false;
    private $ignore      = 0;
    private $dirs        = array();
    private $dates       = array();
    private $iterators   = array();
    private $contains    = array();
    private $notContains = array();

    static private $vcsPatterns = array('.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg');

    /**
     * Constructor.
     */
    public function __construct()
    {
        $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES;
    }

    /**
     * Creates a new Finder.
     *
     * @return Finder A new Finder instance
     *
     * @api
     */
    static public function create()
    {
        return new self();
    }

    /**
     * Restricts the matching to directories only.
     *
     * @return Finder The current Finder instance
     *
     * @api
     */
    public function directories()
    {
        $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES;

        return $this;
    }

    /**
     * Restricts the matching to files only.
     *
     * @return Finder The current Finder instance
     *
     * @api
     */
    public function files()
    {
        $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES;

        return $this;
    }

    /**
     * Adds tests for the directory depth.
     *
     * Usage:
     *
     *   $finder->depth('> 1') // the Finder will start matching at level 1.
     *   $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point.
     *
     * @param  int $level The depth level expression
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\DepthRangeFilterIterator
     * @see Symfony\Component\Finder\Comparator\NumberComparator
     *
     * @api
     */
    public function depth($level)
    {
        $this->depths[] = new Comparator\NumberComparator($level);

        return $this;
    }

    /**
     * Adds tests for file dates (last modified).
     *
     * The date must be something that strtotime() is able to parse:
     *
     *   $finder->date('since yesterday');
     *   $finder->date('until 2 days ago');
     *   $finder->date('> now - 2 hours');
     *   $finder->date('>= 2005-10-15');
     *
     * @param  string $date A date rage string
     *
     * @return Finder The current Finder instance
     *
     * @see strtotime
     * @see Symfony\Component\Finder\Iterator\DateRangeFilterIterator
     * @see Symfony\Component\Finder\Comparator\DateComparator
     *
     * @api
     */
    public function date($date)
    {
        $this->dates[] = new Comparator\DateComparator($date);

        return $this;
    }

    /**
     * Adds rules that files must match.
     *
     * You can use patterns (delimited with / sign), globs or simple strings.
     *
     * $finder->name('*.php')
     * $finder->name('/\.php$/') // same as above
     * $finder->name('test.php')
     *
     * @param  string $pattern A pattern (a regexp, a glob, or a string)
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\FilenameFilterIterator
     *
     * @api
     */
    public function name($pattern)
    {
        $this->names[] = $pattern;

        return $this;
    }

    /**
     * Adds rules that files must not match.
     *
     * @param  string $pattern A pattern (a regexp, a glob, or a string)
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\FilenameFilterIterator
     *
     * @api
     */
    public function notName($pattern)
    {
        $this->notNames[] = $pattern;

        return $this;
    }

    /**
     * Adds tests that file contents must match.
     *
     * Strings or PCRE patterns can be used:
     *
     * $finder->contains('Lorem ipsum')
     * $finder->contains('/Lorem ipsum/i')
     *
     * @param  string $pattern A pattern (string or regexp)
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\FilecontentFilterIterator
     */
    public function contains($pattern)
    {
        $this->contains[] = $pattern;

        return $this;
    }

    /**
     * Adds tests that file contents must not match.
     *
     * Strings or PCRE patterns can be used:
     *
     * $finder->notContains('Lorem ipsum')
     * $finder->notContains('/Lorem ipsum/i')

     *
     * @param  string $pattern A pattern (string or regexp)
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\FilecontentFilterIterator
     */
    public function notContains($pattern)
    {
        $this->notContains[] = $pattern;

        return $this;
    }

    /**
     * Adds tests for file sizes.
     *
     * $finder->size('> 10K');
     * $finder->size('<= 1Ki');
     * $finder->size(4);
     *
     * @param string $size A size range string
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\SizeRangeFilterIterator
     * @see Symfony\Component\Finder\Comparator\NumberComparator
     *
     * @api
     */
    public function size($size)
    {
        $this->sizes[] = new Comparator\NumberComparator($size);

        return $this;
    }

    /**
     * Excludes directories.
     *
     * @param  string|array $dirs A directory path or an array of directories
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator
     *
     * @api
     */
    public function exclude($dirs)
    {
        $this->exclude = array_merge($this->exclude, (array) $dirs);

        return $this;
    }

    /**
     * Excludes "hidden" directories and files (starting with a dot).
     *
     * @param Boolean $ignoreDotFiles Whether to exclude "hidden" files or not
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator
     *
     * @api
     */
    public function ignoreDotFiles($ignoreDotFiles)
    {
        if ($ignoreDotFiles) {
            $this->ignore = $this->ignore | static::IGNORE_DOT_FILES;
        } else {
            $this->ignore = $this->ignore ^ static::IGNORE_DOT_FILES;
        }

        return $this;
    }

    /**
     * Forces the finder to ignore version control directories.
     *
     * @param Boolean $ignoreVCS Whether to exclude VCS files or not
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator
     *
     * @api
     */
    public function ignoreVCS($ignoreVCS)
    {
        if ($ignoreVCS) {
            $this->ignore = $this->ignore | static::IGNORE_VCS_FILES;
        } else {
            $this->ignore = $this->ignore ^ static::IGNORE_VCS_FILES;
        }

        return $this;
    }

    static public function addVCSPattern($pattern)
    {
        static::$vcsPatterns[] = $pattern;
    }

    /**
     * Sorts files and directories by an anonymous function.
     *
     * The anonymous function receives two \SplFileInfo instances to compare.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @param  Closure $closure An anonymous function
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\SortableIterator
     *
     * @api
     */
    public function sort(\Closure $closure)
    {
        $this->sort = $closure;

        return $this;
    }

    /**
     * Sorts files and directories by name.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\SortableIterator
     *
     * @api
     */
    public function sortByName()
    {
        $this->sort = Iterator\SortableIterator::SORT_BY_NAME;

        return $this;
    }

    /**
     * Sorts files and directories by type (directories before files), then by name.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\SortableIterator
     *
     * @api
     */
    public function sortByType()
    {
        $this->sort = Iterator\SortableIterator::SORT_BY_TYPE;

        return $this;
    }

    /**
     * Sorts files and directories by the last accessed time.
     *
     * This is the time that the file was last accessed, read or written to.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\SortableIterator
     *
     * @api
     */
    public function sortByAccessedTime()
    {
        $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME;

        return $this;
    }

    /**
     * Sorts files and directories by the last inode changed time.
     *
     * This is the time that the inode information was last modified (permissions, owner, group or other metadata).
     *
     * On Windows, since inode is not available, changed time is actually the file creation time.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\SortableIterator
     *
     * @api
     */
    public function sortByChangedTime()
    {
        $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME;

        return $this;
    }

    /**
     * Sorts files and directories by the last modified time.
     *
     * This is the last time the actual contents of the file were last modified.
     *
     * This can be slow as all the matching files and directories must be retrieved for comparison.
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\SortableIterator
     *
     * @api
     */
    public function sortByModifiedTime()
    {
        $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME;

        return $this;
    }

    /**
     * Filters the iterator with an anonymous function.
     *
     * The anonymous function receives a \SplFileInfo and must return false
     * to remove files.
     *
     * @param  Closure $closure An anonymous function
     *
     * @return Finder The current Finder instance
     *
     * @see Symfony\Component\Finder\Iterator\CustomFilterIterator
     *
     * @api
     */
    public function filter(\Closure $closure)
    {
        $this->filters[] = $closure;

        return $this;
    }

    /**
     * Forces the following of symlinks.
     *
     * @return Finder The current Finder instance
     *
     * @api
     */
    public function followLinks()
    {
        $this->followLinks = true;

        return $this;
    }

    /**
     * Searches files and directories which match defined rules.
     *
     * @param  string|array $dirs A directory path or an array of directories
     *
     * @return Finder The current Finder instance
     *
     * @throws \InvalidArgumentException if one of the directory does not exist
     *
     * @api
     */
    public function in($dirs)
    {
        $dirs = (array) $dirs;

        foreach ($dirs as $dir) {
            if (!is_dir($dir)) {
                throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir));
            }
        }

        $this->dirs = array_merge($this->dirs, $dirs);

        return $this;
    }

    /**
     * Returns an Iterator for the current Finder configuration.
     *
     * This method implements the IteratorAggregate interface.
     *
     * @return \Iterator An iterator
     *
     * @throws \LogicException if the in() method has not been called
     */
    public function getIterator()
    {
        if (0 === count($this->dirs)) {
            throw new \LogicException('You must call the in() method before iterating over a Finder.');
        }

        if (1 === count($this->dirs) && 0 === count($this->iterators)) {
            return $this->searchInDirectory($this->dirs[0]);
        }

        $iterator = new \AppendIterator();
        foreach ($this->dirs as $dir) {
            $iterator->append($this->searchInDirectory($dir));
        }

        foreach ($this->iterators as $it) {
            $iterator->append($it);
        }

        return $iterator;
    }

    /**
     * Appends an existing set of files/directories to the finder.
     *
     * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array.
     *
     * @param mixed $iterator
     */
    public function append($iterator)
    {
        if ($iterator instanceof \IteratorAggregate) {
            $this->iterators[] = $iterator->getIterator();
        } elseif ($iterator instanceof \Iterator) {
            $this->iterators[] = $iterator;
        } elseif ($iterator instanceof \Traversable || is_array($iterator)) {
            $it = new \ArrayIterator();
            foreach ($iterator as $file) {
                $it->append($file instanceof \SplFileInfo ? $file : new \SplFileInfo($file));
            }
            $this->iterators[] = $it;
        } else {
            throw new \InvalidArgumentException('Finder::append() method wrong argument type.');
        }
    }

    /**
     * Counts all the results collected by the iterators.
     *
     * @return int
     */
    public function count()
    {
        return iterator_count($this->getIterator());
    }

    private function searchInDirectory($dir)
    {
        $flags = \RecursiveDirectoryIterator::SKIP_DOTS;

        if ($this->followLinks) {
            $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS;
        }

        $iterator = new \RecursiveIteratorIterator(
            new Iterator\RecursiveDirectoryIterator($dir, $flags),
            \RecursiveIteratorIterator::SELF_FIRST
        );

        if ($this->depths) {
            $iterator = new Iterator\DepthRangeFilterIterator($iterator, $this->depths);
        }

        if ($this->mode) {
            $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode);
        }

        if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) {
            $this->exclude = array_merge($this->exclude, static::$vcsPatterns);
        }

        if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) {
            $this->exclude[] = '\..+';
        }

        if ($this->exclude) {
            $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $this->exclude);
        }

        if ($this->names || $this->notNames) {
            $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames);
        }

        if ($this->contains || $this->notContains) {
            $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains);
        }

        if ($this->sizes) {
            $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes);
        }

        if ($this->dates) {
            $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates);
        }

        if ($this->filters) {
            $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters);
        }

        if ($this->sort) {
            $iteratorAggregate = new Iterator\SortableIterator($iterator, $this->sort);
            $iterator = $iteratorAggregate->getIterator();
        }

        return $iterator;
    }
}


text:
using System;
using com.TheDisappointedProgrammer.IOCC;

namespace com.TheDisappointedProgrammer.Drive
{
    [Bean]
    public class ColumnMap
    {
        public class ColumnSpec
        {
            public ColumnSpec(int index, Type type, Func<string, object> parser, string heading)
            {
                Index = index;
                Type = type;
                Parser = parser;
                Heading = heading;
            }
            public readonly int Index;
            public readonly Type Type;
            public readonly Func<string, object> Parser;
            public readonly string Heading;
        }
        private readonly ColumnSpec[] map =
        {
            new ColumnSpec( 1, typeof(DateTime), s => DateTime.Parse(s), "Date")
            ,new ColumnSpec( 2, typeof(object), s => s, "Description")
            ,new ColumnSpec( 3, typeof(object), s => s, "Category")
            ,new ColumnSpec( 4, typeof(object), s => s, "Receipts")
            ,new ColumnSpec( 5, typeof(object), s => s, "Payments")
            ,new ColumnSpec( 6, typeof(decimal?), s => ParseDecimal(s), "Cash")
            ,new ColumnSpec( 7, typeof(decimal?), s => ParseDecimal(s), "Groceries")
            ,new ColumnSpec( 8, typeof(decimal?), s => ParseDecimal(s), "Flat")
            ,new ColumnSpec( 9, typeof(decimal?), s => ParseDecimal(s), "Entertainment 1")
            ,new ColumnSpec( 10, typeof(decimal?), s => ParseDecimal(s), "Phones & Computers")
            ,new ColumnSpec( 11, typeof(decimal?), s => ParseDecimal(s), "Recreation")
            ,new ColumnSpec( 12, typeof(decimal?), s => ParseDecimal(s), "Sundry")
            ,new ColumnSpec( 13, typeof(decimal?), s => ParseDecimal(s), "Investments")
            ,new ColumnSpec( 14, typeof(decimal?), s => ParseDecimal(s), "Recreation 2")
        };

        public ColumnSpec[] Columns => map;
        public int FirstExpenseColumn => 5;
        public int NumExpenseColumns => map.Length - FirstExpenseColumn;

        private static decimal? ParseDecimal(string s)
        {
            return string.IsNullOrWhiteSpace(s) ? (decimal?)null : Decimal.Parse(s);
        }
    }
}


text:
<envelope xmlns="http://marklogic.com/entity-services">
  <headers>
    <value xmlns="">1234</value>
  </headers>
  <triples>
    <sem:triple xmlns:sem="http://marklogic.com/semantics">
      <sem:subject>subject</sem:subject>
      <sem:predicate>predicate</sem:predicate>
      <sem:object>object</sem:object>
    </sem:triple>
  </triples>
  <instance>
    <info>
      <title>Person</title>
      <version>0.0.1</version>
    </info>
    <prs:Person xmlns:prs="http://marklogic.com/Person">
      <prs:Id>2</prs:Id>
    </prs:Person>
  </instance>
  <attachments/>
</envelope>


text:
package main

import (
	"context"
	"encoding/json"
	"fmt"
	"io"

	"github.com/spf13/cobra"
	"k8s.io/kops/cmd/kops/util"
	"k8s.io/kops/pkg/apis/kops"
	"k8s.io/kops/pkg/resources"
	resourceops "k8s.io/kops/pkg/resources/ops"
	"k8s.io/kops/upup/pkg/fi/cloudup"
	"k8s.io/kubernetes/pkg/kubectl/util/i18n"
	"k8s.io/kubernetes/pkg/kubectl/util/templates"
)

var (
	toolboxDumpLong = templates.LongDesc(i18n.T(`
	Displays cluster information.  Includes information about cloud and Kubernetes resources.`))

	toolboxDumpExample = templates.Examples(i18n.T(`
	# Dump cluster information
	kops toolbox dump --name k8s-cluster.example.com
	`))

	toolboxDumpShort = i18n.T(`Dump cluster information`)
)

type ToolboxDumpOptions struct {
	Output string

	ClusterName string
}

func (o *ToolboxDumpOptions) InitDefaults() {
	o.Output = OutputYaml
}

func NewCmdToolboxDump(f *util.Factory, out io.Writer) *cobra.Command {
	options := &ToolboxDumpOptions{}
	options.InitDefaults()

	cmd := &cobra.Command{
		Use:     "dump",
		Short:   toolboxDumpShort,
		Long:    toolboxDumpLong,
		Example: toolboxDumpExample,
		Run: func(cmd *cobra.Command, args []string) {
			if err := rootCommand.ProcessArgs(args); err != nil {
				exitWithError(err)
			}

			options.ClusterName = rootCommand.ClusterName()

			err := RunToolboxDump(f, out, options)
			if err != nil {
				exitWithError(err)
			}
		},
	}

	// TODO: Push up to top-level command?
	// Yes please! (@kris-nova)
	cmd.Flags().StringVarP(&options.Output, "output", "o", options.Output, "output format.  One of: yaml, json")

	return cmd
}

func RunToolboxDump(f *util.Factory, out io.Writer, options *ToolboxDumpOptions) error {
	clientset, err := f.Clientset()
	if err != nil {
		return err
	}

	if options.ClusterName == "" {
		return fmt.Errorf("ClusterName is required")
	}

	cluster, err := clientset.GetCluster(options.ClusterName)
	if err != nil {
		return err
	}

	if cluster == nil {
		return fmt.Errorf("cluster not found %q", options.ClusterName)
	}

	cloud, err := cloudup.BuildCloud(cluster)
	if err != nil {
		return err
	}

	region := "" // Use default
	resourceMap, err := resourceops.ListResources(cloud, options.ClusterName, region)
	if err != nil {
		return err
	}
	dump, err := resources.BuildDump(context.TODO(), cloud, resourceMap)
	if err != nil {
		return err
	}

	switch options.Output {
	case OutputYaml:
		b, err := kops.ToRawYaml(dump)
		if err != nil {
			return fmt.Errorf("error marshaling yaml: %v", err)
		}
		_, err = out.Write(b)
		if err != nil {
			return fmt.Errorf("error writing to stdout: %v", err)
		}
		return nil

	case OutputJSON:
		b, err := json.MarshalIndent(dump, "", "  ")
		if err != nil {
			return fmt.Errorf("error marshaling json: %v", err)
		}
		_, err = out.Write(b)
		if err != nil {
			return fmt.Errorf("error writing to stdout: %v", err)
		}
		return nil

	default:
		return fmt.Errorf("Unsupported output format: %q", options.Output)
	}
}


text:
package utils

const (

	//keys for watchers
	SMTP    = "smtp"
	SLACK   = "slack"
	INFOBIP = "infobip"
	SCYLLA  = "scylla"
	META    = "meta"
	WHMCS   = "WHMCS"
	SENDER  = "sender"

	SCYLLAMGR = "scylladb"
	//config keys by watchers
	TOKEN          = "token"
	CHANNEL        = "channel"
	USERNAME       = "username"
	PASSWORD       = "password"
	IDENTITY       = "identity"
	WHMCS_PASSWORD = "whmcs_password"
	WHMCS_APIKEY   = "whmcs_apikey"
	ROOT_PASSWORD  = "root_password"
	APPLICATION_ID = "application_id"
	MESSAGE_ID     = "message_id"
	API_KEY        = "api_key"
	DOMAIN         = "domain"
	PIGGYBANKS     = "piggybanks"
	VERTICE_EMAIL  = "vertice_email"
	VERTICE_APIKEY = "vertice_apikey"
	VERTICE_ORGID  = "vertice_orgid"
	USERMAIL       = "email"
	STATUS         = "status"
	HOST_IP        = "host_ip"
	VERTICEAPI     = "verticegateway"
	TORPEDO        = "torpedo"
	CONTAINER      = "container"

	VONE_CLOUD     = "vone_cloud"
	HOME           = "home"
	DIR            = "dir"
	ORG_ID         = "org_id"
	MASTER_KEY     = "master_key"
	API_URL        = "url"
	SCYLLAHOST     = "scylla_host"
	SCYLLAKEYSPACE = "scylla_keyspace"
	SCYLLAUSERNAME = "scylla_username"
	SCYLLAPASSWORD = "scylla_password"

	ASSEMBLIES_ID    = "assemblies_id"
	EVENT_TYPE       = "event_type"
	ACCOUNT_ID       = "account_id"
	ASSEMBLY_ID      = "assembly_id"
	ASSEMBLY_NAME    = "assembly_name"
	QUOTA_ID         = "quota_id"
	DATA             = "data"
	CREATED_AT       = "created_at"
	REGION           = "region"
	DATASTORE        = "datastore"
	RAW_IMAGE_ID     = "raw_image_id"
	IMAGE_NAME       = "image_name"
	IMAGE_ID         = "image_id"
	INSTANCE_ID      = "instance_id"
	MARKETPLACE_ID   = "marketplace_id"
	POLICY_FAILURE   = "policy_failure"
	CPU_COST_HOUR    = "cpu_cost_hour"
	MEMORY_COST_HOUR = "ram_cost_hour"
	DISK_COST_HOUR   = "disk_cost_hour"

	CPU_COST    = "cpu_cost"
	MEMORY_COST = "memory_cost"
	DISK_COST   = "disk_cost"

	// events keys
	ACCOUNTID        = "AccountId"
	ASSEMBLYID       = "AssemblyId"
	ASSEMBLIESID     = "AssembliesId"
	ASSEMBLYNAME     = "AssemblyName"
	CONSUMED         = "Consumed"
	START_TIME       = "StartTime"
	END_TIME         = "EndTime"
	RESOURCES        = "Resources"
	BILL_TYPE        = "BillType"
	SOFT_ACTION      = "SoftAction"
	SOFT_LIMIT       = "SoftLimit"
	SOFT_GRACEPERIOD = "SoftGracePeriod"
	HARD_GRACEPERIOD = "HardGracePeriod"
	HARD_ACTION      = "HardAction"
	HARD_LIMIT       = "HardLimit"
	SKEWS_TYPE       = "SkewsType"
	QUOTAID          = "QuotaId"
	SKEWS_WARNING    = "skews_warning"
	NETWORK_UNAVAIL  = "network_unavail"
	BACKUP_NEW       = "vertice.torpedo.backup"
	SOURCE_PATH      = "backup_stored_path"
	DATASTORE_ID     = "datastore_id"

	ACTION              = "action"
	STATE               = "state"
	CONTROL             = "control"
	ACTION_TRIGGERED_AT = "action_trigger_at"
	NEXT_ACTION_DUE_AT  = "next_action_due_at"
	NEXT_ACTION         = "next_action"
	NILAVU_PASSWORD     = "nilavu_password"
	PASSWORD_HASH       = "password_hash"
	ALERT_MESSAGE       = "alert_message"
	SSH_KEY             = "ssh_key"
	INSTANCE_PASSWORD   = "instance_password"

	//args for notification
	NILAVU       = "nilavu"
	LOGO         = "logo"
	NAME         = "name"
	VERTNAME     = "appname"
	TEAM         = "team"
	VERTTYPE     = "type"
	EMAIL        = "email"
	DAYS         = "days"
	COST         = "cost"
	STARTTIME    = "starttime"
	ENDTIME      = "endtime"
	PUBLICIPV4   = "public_ipv4"
	PRIVATEIPV4  = "private_ipv4"
	PUBLICIPV6   = "public_ipv6"
	PRIVATEIPV6  = "private_ipv6"
	STORAGE_TYPE = "storage_hddtype"
	STORAGE      = "storage"
	CPU          = "cpu"
	RAM          = "ram"
	HDD          = "hdd"

	YES              = "yes"
	FALSE            = "false"
	TRUE             = "true"
	ENABLED          = "enabled"
	EventMachine     = "machine"
	EventMarketplace = "marketplaces"
	EventContainer   = "container"
	EventBill        = "bill"
	EventUser        = "user"
	EventStatus      = "status"

	BILLMGR = "bill"
	ADDONS  = "addons"

	PROVIDER         = "provider"
	PROVIDER_ONE     = "one"
	PROVIDER_DOCKER  = "docker"
	PROVIDER_RANCHER = "rancher"

	LAUNCHING         = "launching"
	INITIALIZING      = "initializing"
	BALANCECHECK      = "balance_check"
	INSUFFICIENT_FUND = "insufficient_fund"
	INITIALIZED       = "initialized"
	LAUNCHED          = "launched"
	VMBOOTING         = "vm_booting"
	BOOTSTRAPPED      = "bootstrapped"
	BOOTSTRAPPING     = "bootstrapping"

	CONTAINERINITIALIZING = "containerinitializing"
	CONTAINERINITIALIZED  = "containerinitialized"

	START        = "start"
	STOP         = "stop"
	HARD_STOP    = "hard-stop"
	RESTART      = "restart"
	HARD_RESTART = "hard-restart"
	SUSPEND      = "suspend"
	DESTROY      = "destroy"

	STATEUPPING    = "stateup_starting"
	STATEUPPED     = "stateup_started"
	RUNNING        = "running"
	STARTING       = "starting"
	STARTED        = "started"
	STOPPING       = "stopping"
	STOPPED        = "stopped"
	RESTARTING     = "restarting"
	RESTARTED      = "restarted"
	UPGRADED       = "upgraded"
	DESTROYING     = "destroying"
	DESTROYED      = "destroyed"
	NUKED          = "nuked"
	SNAPSHOTTING   = "snapshot_creating"
	SNAPSHOTTED    = "snapshot_created"
	SNAPDESTORYING = "snapshot_deleting"
	SNAPDESTORYED  = "snapshot_deleted"
	RESTORINGSNAP  = "snapshot_restoring"
	SNAPRESTORED   = "snapshot_restored"
	ACTIVESNAP     = "active"
	DEACTIVESNAP   = "deactive"

	IMAGECREATING = "image_creating"
	IMAGECREATED  = "image_created"
	IMAGEREMOVED  = "image_removed"
	IMAGEREMOVING = "image_removing"

	DISKATTACHING     = "disk_attaching"
	DISKATTACHED      = "disk_attached"
	DISKDETACHING     = "disk_detaching"
	DISKDETACHED      = "disk_detached"
	ATTACH_INPROGRESS = "attach_inprogress"
	DETACH_INPROGRESS = "detach_inprogress"
	INPROGRESS        = "inprogress"

	QUOTAUPDATING = "quota_updating"
	QUOTAUPDATED  = "quota_updated"
	QUOTA_UNPAID  = "quota_unpaid"

	LCMSTATECHECK = "check_lcmstate"
	VMSTATECHECK  = "check_vmstate"
	WAITUNTILL    = "waituntill"

	VNCHOSTUPDATING    = "vnchostupdating"
	VNCHOSTUPDATED     = "vnchostupdated"
	DNSNETWORKCREATING = "dnscnamecreating"
	DNSNETWORKCREATED  = "dnscnamecreated"
	DNSNETWORKSKIPPED  = "dnscnameskipped"
	CLONING            = "gitcloning"
	CLONED             = "gitcloned"
	APPDEPLOYING       = "appdeploying"
	APPDEPLOYED        = "appdeployed"
	BUILDSTARTING      = "buildstarting"
	BUILDSTOPPED       = "buildstopped"
	SERVICESTARTING    = "servicestarting"
	SERVICESTOPPED     = "servicestopped"
	RESETPASSWORD      = "reset_password"

	COOKBOOKDOWNLOADING     = "cookbook_downloading"
	COOKBOOKDOWNLOADED      = "cookbook_downloaded"
	COOKBOOKFAILURE         = "cookbook_failure"
	AUTHKEYSUPDATING        = "authkeys_updating"
	AUTHKEYSUPDATED         = "authkeys_updated"
	AUTHKEYSFAILURE         = "authkeys_failure"
	INSTANCEIPSUPDATING     = "ips_updating"
	INSTANCEIPSUPDATED      = "ips_updated"
	INSTANCEIPSFAILURE      = "ips_failure"
	CHEFCONFIGSETUPSTARTING = "chefconfigsetup_starting"
	CHEFCONFIGSETUPSTARTED  = "chefconfigsetup_started"
	CONTAINERNETWORKSUCCESS = "container_network_success"
	CONTAINERNETWORKFAILURE = "container_network_failure"

	CONTAINERLAUNCHING     = "containerlaunching"
	CONTAINERBOOTSTRAPPING = "containerbootstrapping"
	CONTAINERBOOTSTRAPPED  = "containerbootstrapped"
	CONTAINERLAUNCHED      = "containerlaunched"
	CONTAINEREXISTS        = "containerexists"
	CONTAINERDELETE        = "containerdelete"
	CONTAINERSTARTING      = "containerstarting"
	CONTAINERSTARTED       = "containerstarted"
	CONTAINERSTOPPING      = "containerstopping"
	CONTAINERSTOPPED       = "containerstopped"
	CONTAINERRESTARTING    = "containerrestarting"
	CONTAINERRESTARTED     = "containerrestarted"
	CONTAINERUPGRADED      = "containerupgraded"
	CONTAINERRUNNING       = "containerrunning"
	CONTAINERERROR         = "containererror"
	DATABLOCK_CREATING     = "datablock_creating"
	DATABLOCK_CREATED      = "datablock_created"
	IMAGE_SAVING           = "image_saving"
	IMAGE_SAVED            = "image_saved"
	IMAGE_READY            = "ready"

	ERROR            = "error"
	PREERROR         = "preerror"
	NETWORK_ERROR    = "netwroking_error"
	VMLAUNCH_ERROR   = "launching_error"
	VMBOOT_ERROR     = "vmboot_error"
	BOOTSTRAPE_ERROR = "bootstrapping_error"
	STATEUP_ERROR    = "stateup_error"
	STATEDOWN_ERROR  = "statedown_error"
	VMRESUME_ERROR   = "vmresume_error"
	VMPOWEROFF_ERROR = "vmshutdown_error"

	PREDEPLOY_ERROR = "preerror"
	POST_ERROR      = "posterror"
	PARKED          = "parked"

	CREATING   = "creating"
	ACTIVE     = "active"
	DEACTIVE   = "deactive"
	PENDING    = "pending"
	INIT       = "init"
	HOLD       = "hold"
	SUSPENDED  = "suspended"
	SUSPENDING = "suspending"

	StateContainerInitializing = State(CONTAINERINITIALIZING)
	StateContainerInitialized  = State(CONTAINERINITIALIZED)
	StateContainerBootstrapped = State(CONTAINERBOOTSTRAPPED)
	StateContainerRunning      = State(CONTAINERRUNNING)
	StateDestroying            = State(DESTROYING)
	StateDestroyed             = State(DESTROYED)
	StateMachineParked         = State(PARKED)
	// StateLaunched is the milestone state for box after launched in cloud.
	StateInitializing = State(INITIALIZING)

	StateInitialized = State(INITIALIZED)

	// StateBootstrapped is the milestone state for box after being booted by the agent in cloud
	StateBootstrapped = State(BOOTSTRAPPED)
	//StateRunning is the milestone for fully up instance
	StateRunning = State(RUNNING)

	StateStopped = State(STOPPED)

	StatePreError  = State(PREDEPLOY_ERROR)
	StatePostError = State(POST_ERROR)
	StateError     = State(ERROR)

	// StatusLaunching is the initial status of a box
	// it should transition shortly to a more specific status
	StatusLaunching = Status(LAUNCHING)

	StatusBalanceVerified = Status(BALANCECHECK)

	// StatusLaunched is the status for box after launched in cloud.
	StatusLaunched = Status(LAUNCHED)

	StatusQuotaUpdating = Status(QUOTAUPDATING)
	StatusQuotaUpdated  = Status(QUOTAUPDATED)

	StatusInsufficientFund = Status(INSUFFICIENT_FUND)
	StatusQuotaUnpaid      = Status(QUOTA_UNPAID)

	StatusVMBooting      = Status(VMBOOTING)
	StatusInitialized    = Status(INITIALIZED)
	StatusNetworkUnavail = Status(NETWORK_UNAVAIL)

	// StatusBootstrapped is the status for box after being booted by the agent in cloud
	StatusBootstrapped  = Status(BOOTSTRAPPED)
	StatusBootstrapping = Status(BOOTSTRAPPING)

	// Stateup is the status of the which is moving up in the state in cloud.
	// Sent by vertice to gulpd when it received StatusBootstrapped.
	StatusStateupping = Status(STATEUPPING)
	StatusStateupped  = Status(STATEUPPED)

	StatusVncHostUpdating = Status(VNCHOSTUPDATING)
	StatusVncHostUpdated  = Status(VNCHOSTUPDATED)
	//fully up instance
	StatusRunning  = Status(RUNNING)
	StatusActive   = Status(ACTIVE)
	StatusDeactive = Status(DEACTIVE)
	StatusCreating = Status(CREATING)

	StatusResetPassword = Status(RESETPASSWORD)
	StatusStarting      = Status(STARTING)
	StatusStarted       = Status(STARTED)
	StatusStopping      = Status(STOPPING)
	StatusStopped       = Status(STOPPED)
	StatusSuspending    = Status(SUSPENDING)
	StatusSuspended     = Status(SUSPENDED)
	StatusRestarting    = Status(RESTARTING)
	StatusRestarted     = Status(RESTARTED)
	StatusUpgraded      = Status(UPGRADED)
	StatusDestroying    = Status(DESTROYING)
	StatusDestroyed     = Status(DESTROYED)
	StatusNuked         = Status(NUKED)

	StatusInprogress     = Status(INPROGRESS)
	StatusSnapCreating   = Status(SNAPSHOTTING)
	StatusSnapCreated    = Status(SNAPSHOTTED)
	StatusSnapDeleting   = Status(SNAPDESTORYING)
	StatusSnapDeleted    = Status(SNAPDESTORYED)
	StatusSnapRestoring  = Status(RESTORINGSNAP)
	StatusSnapRestored   = Status(SNAPRESTORED)
	StatusBackupCreated  = Status(IMAGECREATED)
	StatusBackupCreating = Status(IMAGECREATING)
	StatusBackupDeleting = Status(IMAGEREMOVING)
	StatusBackupDeleted  = Status(IMAGEREMOVED)

	StatusDiskAttaching    = Status(DISKATTACHING)
	StatusDiskAttached     = Status(DISKATTACHED)
	StatusDiskDetaching    = Status(DISKDETACHING)
	StatusDiskDetached     = Status(DISKDETACHED)
	StatusLcmStateChecking = Status(LCMSTATECHECK)
	StatusWaitUntill       = Status(WAITUNTILL)
	StatusVmStateChecking  = Status(VMSTATECHECK)

	StatusCookbookDownloading = Status(COOKBOOKDOWNLOADING)
	StatusCookbookDownloaded  = Status(COOKBOOKDOWNLOADED)
	StatusCookbookFailure     = Status(COOKBOOKFAILURE)
	StatusAuthkeysUpdating    = Status(AUTHKEYSUPDATING)
	StatusAuthkeysUpdated     = Status(AUTHKEYSUPDATED)
	StatusAuthkeysFailure     = Status(AUTHKEYSFAILURE)

	StatusIpsUpdating         = Status(INSTANCEIPSUPDATING)
	StatusIpsUpdated          = Status(INSTANCEIPSUPDATED)
	StatusIpsFailure          = Status(INSTANCEIPSFAILURE)
	StatusChefConfigSetupping = Status(CHEFCONFIGSETUPSTARTING)
	StatusChefConfigSetupped  = Status(CHEFCONFIGSETUPSTARTED)
	StatusAppDeploying        = Status(APPDEPLOYING)
	StatusAppDeployed         = Status(APPDEPLOYED)

	StatusNetworkCreating = Status(DNSNETWORKCREATING)
	StatusNetworkCreated  = Status(DNSNETWORKCREATED)
	StatusNetworkSkipped  = Status(DNSNETWORKSKIPPED)
	StatusCloning         = Status(CLONING)
	StatusCloned          = Status(CLONED)
	StatusBuildStarting   = Status(BUILDSTARTING)
	StatusBuildStoped     = Status(BUILDSTOPPED)
	StatusServiceStarting = Status(SERVICESTARTING)
	StatusServiceStopped  = Status(SERVICESTOPPED)

	StatusContainerLaunching      = Status(CONTAINERLAUNCHING)
	StatusContainerBootstrapping  = Status(CONTAINERBOOTSTRAPPING)
	StatusContainerBootstrapped   = Status(CONTAINERBOOTSTRAPPED)
	StatusContainerLaunched       = Status(CONTAINERLAUNCHED)
	StatusContainerExists         = Status(CONTAINEREXISTS)
	StatusContainerDelete         = Status(CONTAINERDELETE)
	StatusContainerStarting       = Status(CONTAINERSTARTING)
	StatusContainerStarted        = Status(CONTAINERSTARTED)
	StatusContainerStopping       = Status(CONTAINERSTOPPING)
	StatusContainerStopped        = Status(CONTAINERSTOPPED)
	StatusContainerRestarting     = Status(CONTAINERRESTARTING)
	StatusContainerRestarted      = Status(CONTAINERRESTARTED)
	StatusContainerUpgraded       = Status(CONTAINERUPGRADED)
	StatusContainerRunning        = Status(CONTAINERRUNNING)
	StatusContainerNetworkSuccess = Status(CONTAINERNETWORKSUCCESS)
	StatusContainerNetworkFailure = Status(CONTAINERNETWORKFAILURE)
	StatusContainerError          = Status(CONTAINERERROR)

	// StatusError is the status for units that failed to start, because of
	// a box error.
	StatusError          = Status(ERROR)
	StatusPreError       = Status(PREERROR)
	StatusNetworkError   = Status(NETWORK_ERROR)
	StatusVmLaunchError  = Status(VMLAUNCH_ERROR)
	StatusVmBootError    = Status(VMBOOT_ERROR)
	StatusBootstrapError = Status(BOOTSTRAPE_ERROR)
	StatusStateupError   = Status(STATEUP_ERROR)
	StatusStatedownError = Status(STATEDOWN_ERROR)
	StatusVmStartError   = Status(VMRESUME_ERROR)
	StatusVmStopError    = Status(VMPOWEROFF_ERROR)
	StatusPolicyFailure  = Status(POLICY_FAILURE)

	StatusDataBlockCreating = Status(DATABLOCK_CREATING)
	StatusDataBlockCreated  = Status(DATABLOCK_CREATED)
	StatusImageSaving       = Status(IMAGE_SAVING)
	StatusImageSaved        = Status(IMAGE_SAVED)
	StatusImageReady        = Status(IMAGE_READY)
	StatusAttachInprogres   = Status(ATTACH_INPROGRESS)
	StatusDetachInprogres   = Status(DETACH_INPROGRESS)

	ONEINSTANCELAUNCHINGTYPE           = "compute.instance.launching"
	ONEINSTANCEBOOTINGTYPE             = "compute.instance.booting"
	ONEINSTANCEVNCHOSTUPDATING         = "compute.instance.vnchostupdating"
	ONEINSTANCEVNCHOSTUPDATED          = "compute.instance.vnchostupdated"
	ONEINSTANCECHEFCONFIGSETUPSTARTING = "compute.instance.chefconfigsetupstarting"
	ONEINSTANCECHEFCONFIGSETUPSTARTED  = "compute.instance.chefconfigsetupstarted"
	ONEINSTANCEGITCLONING              = "compute.instance.gitcloning"
	ONEINSTANCEGITCLONED               = "compute.instance.gitcloned"
	ONEINSTANCEAPPDEPLOYING            = "compute.instance.appdeploying"
	ONEINSTANCEAPPDEPLOYED             = "compute.instance.appdeployed"
	ONEINSTANCEBUILDSTARTING           = "compute.instance.buildstarting"
	ONEINSTANCEBUILDSTOPPED            = "compute.instance.buildstopped"
	ONEINSTANCESERVICESTARTING         = "compute.instance.servicestarting"
	ONEINSTANCESERVICESTOPPED          = "compute.instance.servicestopped"
	ONEINSTANCEDNSCNAMING              = "compute.instance.dnscnaming"
	ONEINSTANCEDNSCNAMED               = "compute.instance.dnscnamed"
	ONEINSTANCEDNSNETWORKSKIPPED       = "compute.instance.dnscnameskipped"
	ONEINSTANCEBOOTSTRAPPINGTYPE       = "compute.instance.bootstrapping"
	ONEINSTANCEBOOTSTRAPPEDTYPE        = "compute.instance.bootstrapped"
	ONEINSTANCESTATEUPPINGTYPE         = "compute.instance.stateupstarting"
	ONEINSTANCESTATEUPPEDTYPE          = "compute.instance.stateupstarted"
	ONEINSTANCERUNNINGTYPE             = "compute.instance.running"
	ONEINSTANCELAUNCHEDTYPE            = "compute.instance.launched"
	ONEINSTANCEEXISTSTYPE              = "compute.instance.exists"
	ONEINSTANCEDESTROYINGTYPE          = "compute.instance.destroying"
	ONEINSTANCEDELETEDTYPE             = "compute.instance.deleted"
	ONEINSTANCESTARTINGTYPE            = "compute.instance.starting"
	ONEINSTANCESTARTEDTYPE             = "compute.instance.started"
	ONEINSTANCESTOPPINGTYPE            = "compute.instance.stopping"
	ONEINSTANCESTOPPEDTYPE             = "compute.instance.stopped"
	ONEINSTANCESUSPENDINGTYPE          = "compute.instance.suspending"
	ONEINSTANCESUSPENDEDTYPE           = "compute.instance.suspended"
	ONEINSTANCERESTARTINGTYPE          = "compute.instance.restarting"
	ONEINSTANCERESTARTEDTYPE           = "compute.instance.restarted"
	ONEINSTANCEUPGRADEDTYPE            = "compute.instance.upgraded"
	ONEINSTANCERESIZINGTYPE            = "compute.instance.resizing"
	ONEINSTANCERESIZEDTYPE             = "compute.instance.resized"
	ONEINSTANCEERRORTYPE               = "compute.instance.posterror"
	ONEINSTANCEPREERRORTYPE            = "compute.instance.preerror"
	ONEINSTANCESNAPSHOTTINGTYPE        = "compute.instance.snapshotting"
	ONEINSTANCESNAPSHOTTEDTYPE         = "compute.instance.snapshotted"
	ONEINSTANCESBALANCEVERIFYTYPE      = "compute.instance.balance_check"
	ONEINSTANCESINSUFFIENTFUNDTYPE     = "compute.instance.insufficient_fund"
	ONEINSTANCEUSERQUOTAUPDATING       = "compute.instance.quota_updating"
	ONEINSTANCEUSERQUOTAUPDATED        = "compute.instance.quota_updated"
	ONEINSTANCELCMSTATECHECKING        = "compute.instance.lcmstate_checking"
	ONEINSTANCEVMSTATECHECKING         = "compute.instance.vmstate_checking"
	ONEINSTANCESQUOTAUNPAID            = "compute.instance.quota_unpaid"

	ONEINSTANCENETWORKUNAVAILABLE = "compute.instance.network_unavail"

	ONEINSTANCEWAITING        = "compute.instance.waituntill"
	ONEINSTANCEVMSTATEPENDING = "compute.instance.pending"
	ONEINSTANCEVMSTATEPROLOG  = "compute.instance.active"
	ONEINSTANCEVMSTATEHOLD    = "compute.instance.hold"

	ONEINSTANCELCMMSTATEPROLOG = "compute.instance.active_prolog"
	ONEINSTANCELCMSTATEBOOT    = "compute.instance.active_boot"
	ONEINSTANCELCMSTATERUNNING = "compute.instance.active_running"
	ONEINSTANCELCMSTATEINIT    = "compute.instance.active_lcm_init"

	COOKBOOKDOWNLOADINGTYPE  = "compute.instance.cookbook_downloading"
	COOKBOOKDOWNLOADEDTYPE   = "compute.instance.cookbook_downloaded"
	COOKBOOKFAILURETYPE      = "compute.instance.cookbook_download_failure"
	AUTHKEYSUPDATINGTYPE     = "compute.instance.authkeysupdating"
	AUTHKEYSUPDATEDTYPE      = "compute.instance.authkeysupdated"
	AUTHKEYSFAILURETYPE      = "compute.instance.authkeysfailure"
	INSTANCEIPSUPDATINGTYPE  = "compute.instance.ip_updating"
	INSTANCEIPSUPDATEDTYPE   = "compute.instance.ip_updated"
	INSTANCEIPSFAILURETYPE   = "compute.instance.ip_updatefailure"
	INSTANCERESETOLDPASSWORD = "compute.instance.reset_password"

	CONTAINERINSTANCELAUNCHINGTYPE = "compute.container.launching"
	CONTAINERINSTANCEBOOTSTRAPPING = "compute.container.bootstrapping"
	CONTAINERINSTANCEBOOTSTRAPPED  = "compute.container.bootstrapped"
	CONTAINERINSTANCELAUNCHEDTYPE  = "compute.container.launched"
	CONTAINERINSTANCEEXISTS        = "compute.container.exists"
	CONTAINERINSTANCEDELETE        = "compute.container.delete"
	CONTAINERINSTANCESTARTING      = "compute.container.starting"
	CONTAINERINSTANCESTARTED       = "compute.container.started"
	CONTAINERINSTANCESTOPPING      = "compute.container.stopping"
	CONTAINERINSTANCESTOPPED       = "compute.container.stopped"
	CONTAINERINSTANCERESTARTING    = "compute.container.restarting"
	CONTAINERINSTANCERESTARTED     = "compute.container.restarted"
	CONTAINERINSTANCEUPGRADED      = "compute.container.upgraded"
	CONTAINERINSTANCERUNNING       = "compute.container.running"
	CONTAINERNETWORKSUCCESSTYPE    = "compute.container.ip_allocate_success"
	CONTAINERNETWORKFAILURETYPE    = "compute.container.ip_allocate_failure"
	CONTAINERINSTANCEERROR         = "compute.container.posterror"

	MARKETPLACEINSTANCELAUNCHINGTYPE = "marketplaces.instance.launching"
	MARKETPLACEINSTANCELAUNCHEDTYPE  = "marketplaces.instance.launched"
	MARKETPLACEBLOCKCREATING         = "marketplaces.instance.block_creating"
	MARKETPLACEBLOCKCREATED          = "marketplaces.instance.block_created"
	MARKETPLACELCMSTATECHECKING      = "marketplaces.instance.lcmstate_checking"
	MARKETPLACEVMSTATECHECKING       = "marketplaces.instance.vmstate_checking"
	MARKETPLACEWAITING               = "marketplaces.instance.waituntill"
	MARKETPLACEVMSTATEPENDING        = "marketplaces.instance.pending"
	MARKETPLACEVMSTATEPROLOG         = "marketplaces.instance.active"
	MARKETPLACEVMSTATEHOLD           = "marketplaces.instance.hold"
	MARKETPLACELCMSTATEPROLOG        = "marketplaces.instance.active_prolog"
	MARKETPLACELCMSTATEBOOT          = "marketplaces.instance.active_boot"
	MARKETPLACELCMSTATERUNNING       = "marketplaces.instance.active_running"
	MARKETPLACELCMSTATEINIT          = "marketplaces.instance.active_lcm_init"
	MARKETPLACEBOOTINGTYPE           = "marketplaces.instance.booting"
	MARKETPLACEVNCHOSTUPDATING       = "marketplaces.instance.vnchostupdating"
	MARKETPLACEVNCHOSTUPDATED        = "marketplaces.instance.vnchostupdated"
	MARKETPLACEPREERRORTYPE          = "marketplaces.instance.preerror"
	MARKETPLACEIMAGESAVING           = "marketplaces.image.saving"
	MARKETPLACEIMAGESAVED            = "marketplaces.image.saved"
	MARKETPLACEIMAGEREADY            = "marketplaces.image.ready"
)


text:
export default class Event {
    constructor(type: string);
    target: any;
    type: string;
    preventDefault(): void;
    stopPropagation(): void;
}
export function preventDefault(evt: Event | Event): void;
export function stopPropagation(evt: Event | Event): void;


text:
import rotate
import shift
import run_error_matrix
import plot_analysis


text:
using Blocks.CommandLine;
using SRFS.IO;
using SRFS.Model;
using System;
using System.ComponentModel;
using SRFS.Model.Clusters;
using System.Security.Cryptography;
using System.Security;
using System.Text;
using SRFS.Model.Data;

namespace SRFS.Commands {

    [Command(Name = "makekey", Description = "Make an EC public/private key pair")]
    public class MakeKeyCommand {

        public enum FileType : int {
            Public,
            Private
        }

        [Parameter(ShortForm = 'v', LongForm = "private", Description = "Private Key Output File", IsRequired = true)]
        public string PrivateKeyFile { get; private set; }

        [Parameter(ShortForm = 'p', LongForm = "public", Description = "Public Key Output File", IsRequired = true)]
        public string PublicKeyFile { get; private set; }

        public string GetPassword() {
            var pwd = new StringBuilder();
            while (true) {
                ConsoleKeyInfo i = Console.ReadKey(true);
                if (i.Key == ConsoleKey.Enter) {
                    break;
                } else if (i.Key == ConsoleKey.Backspace) {
                    if (pwd.Length > 0) {
                        pwd.Remove(pwd.Length - 1, 1);
                        Console.Write("\b \b");
                    }
                } else {
                    pwd.Append(i.KeyChar);
                    Console.Write("*");
                }
            }
            return pwd.ToString();
        }

        public byte[] HashString(string s) {
            using (var hasher = new SHA256Cng()) {
                byte[] bytes = Encoding.Unicode.GetBytes(s);
                hasher.TransformFinalBlock(bytes, 0, bytes.Length);
                return hasher.Hash;
            }
        }

        private const int ECPrivateBlobLength = 206;
        private const int EncryptedECPrivateBlobLength = 208;
        private const int ECPublicBlobLength = 140;

        private byte[] IV = new byte[16];

        [Invoke]
        public void Invoke() {

            using (AesCng aes = new AesCng()) {

                Console.Write("Enter Key Password: ");
                string p1 = Console.ReadLine();
                Console.Write("Confirm Password: ");
                string p2 = Console.ReadLine();
                if (!p1.Equals(p2)) {
                    Console.Error.WriteLine("Passwords did not match.");
                    return;
                }

                CngKey pk = CngKey.Create(CngAlgorithm.ECDiffieHellmanP521, null, new CngKeyCreationParameters { ExportPolicy = CngExportPolicies.AllowPlaintextExport });
                byte[] publicKeyBlock = pk.Export(CngKeyBlobFormat.EccPublicBlob);

                byte[] privateKeyBlob = pk.Export(CngKeyBlobFormat.EccPrivateBlob);

                aes.KeySize = 256;
                aes.BlockSize = 128;
                aes.Mode = CipherMode.CBC;
                aes.Padding = PaddingMode.None;
                aes.IV = IV;
                aes.Key = HashString(p1);

                byte[] decryptedECPrivateBlob = new byte[EncryptedECPrivateBlobLength];
                Buffer.BlockCopy(privateKeyBlob, 0, decryptedECPrivateBlob, 0, privateKeyBlob.Length);

                byte[] encryptedData = null;
                using (var encryptor = aes.CreateEncryptor()) {
                    encryptedData = encryptor.TransformFinalBlock(decryptedECPrivateBlob, 0, decryptedECPrivateBlob.Length);
                }

                using (var file = new System.IO.FileStream(PublicKeyFile, System.IO.FileMode.CreateNew))
                using (var writer = new System.IO.BinaryWriter(file)) {
                    writer.Write((int)FileType.Public);
                    file.Write(publicKeyBlock, 0, publicKeyBlock.Length);
                }

                using (var file = new System.IO.FileStream(PrivateKeyFile, System.IO.FileMode.CreateNew))
                using (var writer = new System.IO.BinaryWriter(file)) {
                    writer.Write((int)FileType.Private);
                    writer.Write(encryptedData, 0, encryptedData.Length);
                }

                Console.WriteLine($"Thumbprint: {new KeyThumbprint(pk)}");
            }
        }
    }
}


text:
package org.apache.samza.sql.client.impl;

import org.apache.samza.Partition;
import org.apache.samza.config.Config;
import org.apache.samza.metrics.MetricsRegistry;
import org.apache.samza.system.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * System factory of Samza Sql Shell which needs to provide Consumer, Producer and Admin
 */
public class CliLoggingSystemFactory implements SystemFactory {

  private static final Logger LOG = LoggerFactory.getLogger(CliLoggingSystemFactory.class);
  private static AtomicInteger messageCounter = new AtomicInteger(0);

  @Override
  public SystemConsumer getConsumer(String systemName, Config config, MetricsRegistry registry) {
    throw new UnsupportedOperationException();
  }

  @Override
  public SystemProducer getProducer(String systemName, Config config, MetricsRegistry registry) {
    return new CliLoggingSystemFactory.LoggingSystemProducer();
  }

  @Override
  public SystemAdmin getAdmin(String systemName, Config config) {
    return new CliLoggingSystemFactory.SimpleSystemAdmin(config);
  }

  private static class SimpleSystemAdmin implements SystemAdmin {

    public SimpleSystemAdmin(Config config) {
    }

    @Override
    public Map<SystemStreamPartition, String> getOffsetsAfter(Map<SystemStreamPartition, String> offsets) {
      return offsets.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, null));
    }

    @Override
    public Map<String, SystemStreamMetadata> getSystemStreamMetadata(Set<String> streamNames) {
      return streamNames.stream()
              .collect(Collectors.toMap(Function.identity(), streamName -> new SystemStreamMetadata(streamName,
                      Collections.singletonMap(new Partition(0),
                              new SystemStreamMetadata.SystemStreamPartitionMetadata(null, null, null)))));
    }

    @Override
    public Integer offsetComparator(String offset1, String offset2) {
      if (offset1 == null) {
        return offset2 == null ? 0 : -1;
      } else if (offset2 == null) {
        return 1;
      }
      return offset1.compareTo(offset2);
    }
  }

  private class LoggingSystemProducer implements SystemProducer {

    @Override
    public void start() {
    }

    @Override
    public void stop() {
    }

    @Override
    public void register(String source) {
      LOG.info("Registering source" + source);
    }

    @Override
    public void send(String source, OutgoingMessageEnvelope envelope) {
      LOG.info(String.format(String.format("Message %d :", messageCounter.incrementAndGet())));
      String msg = String.format("OutputStream:%s Key:%s Value:%s", envelope.getSystemStream(), envelope.getKey(),
              new String((byte[]) envelope.getMessage()));
      LOG.info(msg);

      SamzaExecutor.saveOutputMessage(envelope);
    }

    @Override
    public void flush(String source) {
    }
  }
}


text:
package org.pitest.coverage.execute;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.pitest.testapi.Description;
import org.pitest.testapi.TestListener;
import org.pitest.testapi.TestResult;
import org.pitest.util.Log;

public class ErrorListener implements TestListener {
  private static final Logger LOG = Log.getLogger();

  @Override
  public void onRunStart() {
  }

  @Override
  public void onTestStart(final Description d) {
  }

  @Override
  public void onTestFailure(final TestResult tr) {
    LOG.log(Level.SEVERE, tr.getDescription().toString(), tr.getThrowable());
  }

  @Override
  public void onTestSkipped(final TestResult tr) {
  }

  @Override
  public void onTestSuccess(final TestResult tr) {

  }

  @Override
  public void onRunEnd() {
  }

}


text:
var Stemmer = require('./stemmer');
var ruleTable = require('./lancaster_rules').rules;

function acceptable(candidate) {
    if(candidate.match(/^[aeiou]/))
	return (candidate.length > 1);
    else
	return (candidate.length > 2 && candidate.match(/[aeiouy]/));
}

// take a token, look up the applicatble rule section and attempt some stemming!
function applyRuleSection(token, intact) {
    var section = token.substr(-1);
    var rules = ruleTable[section];

    if(rules) {
        for(var i = 0; i < rules.length; i++) {
            if((intact || !rules[i].intact) // only apply intact rules to intact tokens
                    && token.substr(0 - rules[i].pattern.length) == rules[i].pattern) {
                // hack off only as much as the rule indicates
                var result = token.substr(0, token.length - rules[i].size);

                // if the rules wants us to apply an appendage do so
                if(rules[i].appendage)
                    result += rules[i].appendage;

		if(acceptable(result)) {
		    token = result;

		    // see what the rules wants to do next
		    if(rules[i].continuation) {
			// this rule thinks there still might be stem left. keep at it.
			// since we've applied a change we'll pass false in for intact
			return applyRuleSection(result, false);
		    } else {
			// the rule thinks we're done stemming. drop out.
			return result;
		    }
		}
            }
        }
    }

    return token;
}

var LancasterStemmer = new Stemmer();
module.exports = LancasterStemmer;

LancasterStemmer.stem = function(token) {
    return applyRuleSection(token.toLowerCase(), true);
}


text:
package com.hazelcast.sql.security;

import com.hazelcast.config.IndexType;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.map.IMap;
import com.hazelcast.security.permission.ActionConstants;
import com.hazelcast.security.permission.MapPermission;
import com.hazelcast.sql.SqlResult;
import com.hazelcast.sql.SqlStatement;
import com.hazelcast.sql.impl.SqlServiceImpl;
import com.hazelcast.sql.impl.SqlTestSupport;
import com.hazelcast.sql.impl.plan.node.MapIndexScanPlanNode;
import com.hazelcast.sql.impl.security.SqlSecurityContext;
import com.hazelcast.test.TestHazelcastInstanceFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.security.Permission;
import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

/**
 * Test that ensures that a security callback is invoked as expected.
 */
public class SqlSecurityCallbackTest extends SqlTestSupport {

    private static final String MAP_NAME = "map";

    private final TestHazelcastInstanceFactory factory = new TestHazelcastInstanceFactory(1);
    private HazelcastInstance member;

    @Before
    public void before() {
        member = factory.newHazelcastInstance(getConfig());

        IMap<Integer, Integer> map = member.getMap(MAP_NAME);
        map.addIndex(IndexType.SORTED, "this");
        map.put(1, 1);
    }

    @After
    public void after() {
        factory.shutdownAll();
    }

    @Test
    public void testScan() {
        check("SELECT * FROM " + MAP_NAME, false);
    }

    @Test
    public void testIndexScan() {
        check("SELECT * FROM " + MAP_NAME + " WHERE this = 1", true);
    }

    private void check(String sql, boolean useIndex) {
        // Execute twice to make sure that permission is checked when the plan is cached.
        for (int i = 0; i < 2; i++) {
            TestSqlSecurityContext securityContext = new TestSqlSecurityContext();

            try (SqlResult result = ((SqlServiceImpl) member.getSql()).execute(new SqlStatement(sql), securityContext)) {
                // Check whether the index is used as expected.
                MapIndexScanPlanNode indexScanNode = findFirstIndexNode(result);

                if (useIndex) {
                    assertNotNull(indexScanNode);
                } else {
                    assertNull(indexScanNode);
                }

                // Check permissions.
                List<Permission> permissions = securityContext.getPermissions();
                assertEquals(1, permissions.size());

                Permission permission = permissions.get(0);
                assertTrue(permission instanceof MapPermission);

                MapPermission mapPermission = (MapPermission) permission;
                MapPermission expectedMapPermission = new MapPermission(MAP_NAME, ActionConstants.ACTION_READ);

                assertEquals(expectedMapPermission.getName(), mapPermission.getName());
                assertEquals(expectedMapPermission.getActions(), mapPermission.getActions());
            }
        }
    }

    private static class TestSqlSecurityContext implements SqlSecurityContext {

        private List<Permission> permissions = new ArrayList<>();

        @Override
        public boolean isSecurityEnabled() {
            return true;
        }

        @Override
        public void checkPermission(Permission permission) {
            permissions.add(permission);
        }

        private List<Permission> getPermissions() {
            return permissions;
        }
    }
}


text:
using Chloe.RDBMS;
using System.Reflection;

namespace Chloe.Oracle
{
    partial class SqlGenerator : SqlGeneratorBase
    {
        static Dictionary<string, IMethodHandler> GetMethodHandlers()
        {
            var methodHandlers = new Dictionary<string, IMethodHandler>();

            var methodHandlerTypes = Assembly.GetExecutingAssembly().GetTypes().Where(a => a.IsClass && !a.IsAbstract && typeof(IMethodHandler).IsAssignableFrom(a) && a.Name.EndsWith("_Handler") && a.GetConstructor(Type.EmptyTypes) != null);

            foreach (Type methodHandlerType in methodHandlerTypes)
            {
                string handleMethodName = methodHandlerType.Name.Substring(0, methodHandlerType.Name.Length - "_Handler".Length);
                methodHandlers.Add(handleMethodName, (IMethodHandler)Activator.CreateInstance(methodHandlerType));
            }

            var ret = PublicHelper.Clone(methodHandlers);
            return ret;
        }
    }
}


text:
package forummacro.rightsmanagement.ao;

import forummacro.forum.ao.ForumAO;
import forummacro.forum.ao.PostAO;
import forummacro.forum.ao.ThreadAO;
import net.java.ao.Entity;
import net.java.ao.OneToMany;
import net.java.ao.schema.NotNull;
import net.java.ao.schema.Table;

/**
 * Created by Rik on 12/05/2014.
 */
@Table("User")
public interface UserAO extends Entity {
    @NotNull
    String getUserKey();

    void setUserKey(String userKey);

    RoleAO getRole();

    void setRole(RoleAO role);

    @NotNull
    ForumAO getForum();

    void setForum(ForumAO forum);

    @OneToMany
    PostAO[] getPosts();

    @OneToMany
    ThreadAO[] getThreads();
}