text:
/*! Program part for parsing the input */
#include <iostream>
#include <seqan/sequence.h>
#include <seqan/seq_io.h>

using namespace seqan;

int loadSeqs(char const * path, StringSet<CharString>& ids, StringSet<Dna5String>& seqs, StringSet<CharString>& quals)
{
	SequenceStream seqStream(path, SequenceStream::READ);
	unsigned reads = 1000;									//number of records to be read
	resize(ids, reads);
	resize(seqs, reads);
	resize(quals, reads);

	if (!isGood(seqStream))
	{
		std::cerr << "Error while opening the sequence-file.\n";
		return 1;
	}

	if(readBatch(ids, seqs, quals, seqStream, reads) != 0)
	{
		std::cerr << "Error while reading the sequences.\n";
		return 1;
	}
	return 0;
}

int loadBarcodes(char const * path, StringSet<CharString>& bcids, StringSet<DnaString>& bcs)
{
	SequenceStream bcStream(path, SequenceStream::READ);

	if(!isGood (bcStream))
	{
		std::cerr << "Error while opening barcode-file.\n";
		return 1;
	}

	if(readAll(bcids, bcs, bcStream) != 0)
	{
		std::cerr << "Error while reading the barcodes.\n";
		return 1;
	}
	return 0;
}

int loadAdapters(char const * path, StringSet<CharString>& adids, StringSet<DnaString>& ads)
{
	SequenceStream adStream(path, SequenceStream::READ);

	if(!isGood (adStream))
	{
		std::cerr << "Error while opening adapter-file.\n";
		return 1;
	}

	if(readAll(adids, ads, adStream) != 0)
	{
		std::cerr << "Error while reading the adapters.\n";
		return 1;
	}
	return 0;
}

int writeSeqs(char const * path, const StringSet<CharString>& ids, const StringSet<Dna5String>& seqs, const StringSet<CharString>& quals)
{
	SequenceStream seqStream(path, SequenceStream::WRITE);
    if (!isGood(seqStream))
    {
        std::cerr << "ERROR: Could not create/open the file.\n";
        return 1;
    }
	if(writeRecord(seqStream, ids, seqs, quals) != 0)
	{
		std::cerr << "Error while saving the sequences.\n";
		return 1;
	}
	return 0;
}

int main(int argc, char const * argv[])
{
	StringSet<Dna5String> seqs;
	appendValue(seqs, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
	appendValue(seqs, "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC");
	appendValue(seqs, "GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG");
	StringSet<CharString> quals;
	appendValue(quals, "!§$%&()");
	appendValue(quals, "!'$#)");
	appendValue(quals, "!§$%&()#)");
	StringSet<CharString> ids;
	appendValue(ids, "Ahs");
	appendValue(ids, "Cehs");
	appendValue(ids, "Gehs");

	writeSeqs(argv[1], ids, seqs, quals);

	return 0;

}


text:
/**
 * @file ParodusInternal.c
 *
 * @description This file is used to manage internal functions of parodus
 *
 */

#include "ParodusInternal.h"
#include "config.h"
#include "connection.h"

/*----------------------------------------------------------------------------*/
/*                             External Functions                             */
/*----------------------------------------------------------------------------*/
char* getWebpaConveyHeader()
{
    cJSON *response = cJSON_CreateObject();
    char *buffer = NULL;
    static char encodedData[1024];
    int  encodedDataSize = 1024;
    char * reconnect_reason = get_global_reconnect_reason();
    int i =0, j=0;

    if(strlen(get_parodus_cfg()->hw_model)!=0)
    {
	    cJSON_AddStringToObject(response, HW_MODELNAME, get_parodus_cfg()->hw_model);
    }

    if(strlen(get_parodus_cfg()->hw_serial_number)!=0)
    {
	    cJSON_AddStringToObject(response, HW_SERIALNUMBER, get_parodus_cfg()->hw_serial_number);
    }

    if(strlen(get_parodus_cfg()->hw_manufacturer)!=0)
    {
	    cJSON_AddStringToObject(response, HW_MANUFACTURER, get_parodus_cfg()->hw_manufacturer);
    }

    if(strlen(get_parodus_cfg()->fw_name)!=0)
    {
	    cJSON_AddStringToObject(response, FIRMWARE_NAME, get_parodus_cfg()->fw_name);
    }

    cJSON_AddNumberToObject(response, BOOT_TIME, get_parodus_cfg()->boot_time);

    if(strlen(get_parodus_cfg()->webpa_protocol)!=0)
    {
        cJSON_AddStringToObject(response, WEBPA_PROTOCOL, get_parodus_cfg()->webpa_protocol);
    }

    if(strlen(get_parodus_cfg()->webpa_interface_used)!=0)
    {
	    cJSON_AddStringToObject(response, WEBPA_INTERFACE, get_parodus_cfg()->webpa_interface_used);
    }

    if(strlen(get_parodus_cfg()->hw_last_reboot_reason)!=0)
    {
        cJSON_AddStringToObject(response, HW_LAST_REBOOT_REASON, get_parodus_cfg()->hw_last_reboot_reason);
    }
    else
    {
	    ParodusError("Failed to GET Reboot reason value\n");
    }

    if(reconnect_reason !=NULL)
    {
        cJSON_AddStringToObject(response, LAST_RECONNECT_REASON, reconnect_reason);
    }
    else
    {
     	ParodusError("Failed to GET Reconnect reason value\n");
    }

	if(get_parodus_cfg()->boot_retry_wait > 0)
	{
	    cJSON_AddNumberToObject(response, BOOT_RETRY_WAIT, get_parodus_cfg()->boot_retry_wait);
	}
    buffer = cJSON_PrintUnformatted(response);
    ParodusInfo("X-WebPA-Convey Header: [%zd]%s\n", strlen(buffer), buffer);

    if(nopoll_base64_encode (buffer, strlen(buffer), encodedData, &encodedDataSize) != nopoll_true)
    {
	    ParodusError("Base64 Encoding failed for Connection Header\n");
    }
    else
    {
	    // Remove \n characters from the base64 encoded data
	    for(i=0;encodedData[i] != '\0';i++)
	    {
		    if(encodedData[i] == '\n')
		    {
			    ParodusPrint("New line is present in encoded data at position %d\n",i);
		    }
		    else
		    {
			    encodedData[j] = encodedData[i];
			    j++;
		    }
	    }
	    encodedData[j]='\0';
	    ParodusPrint("Encoded X-WebPA-Convey Header: [%zd]%s\n", strlen(encodedData), encodedData);
    }
    free(buffer);
    cJSON_Delete(response);

    if( 0 < strlen(encodedData) ) {
        return encodedData;
    }

    return NULL;
}

void timespec_diff(struct timespec *start, struct timespec *stop,
                   struct timespec *diff)
{
    if ((stop->tv_nsec - start->tv_nsec) < 0) {
        diff->tv_sec = stop->tv_sec - start->tv_sec - 1;
        diff->tv_nsec = stop->tv_nsec - start->tv_nsec + 1000000000UL;
    } else {
        diff->tv_sec = stop->tv_sec - start->tv_sec;
        diff->tv_nsec = stop->tv_nsec - start->tv_nsec;
    }

    return;
}

redpajama_set_name: RedPajamaGithub


text:
package edu.cmu.lti.nlp.amr

import scala.util.matching.Regex
import scala.collection.mutable.{Map, Set, ArrayBuffer}
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._ // see http://stackoverflow.com/questions/16162090/how-to-convert-java-util-list-to-scala-list

import java.net.URL
import java.io.File

import edu.mit.jwi.RAMDictionary
import edu.mit.jwi.IRAMDictionary
import edu.mit.jwi.data.ILoadPolicy
import edu.mit.jwi.item.POS
import edu.mit.jwi.morph.WordnetStemmer

object Wordnet {

    private val wnhome : String = System.getenv("WNHOME")
    private val path : String = wnhome + File.separator + "dict"
    private val url : URL = new URL("file", null, path)
    private val dict : IRAMDictionary = new RAMDictionary(url, ILoadPolicy.NO_LOAD)
    dict.open
    private val wordnetStemmer : WordnetStemmer = new WordnetStemmer(dict)

    def stemmer(word: String) : List[String] = {
        var stems = List[String]()
        for (pos <- POS.values) {
            try { stems ++= wordnetStemmer.findStems(word, pos) }
            catch { case e : Throwable => Unit }
        }
        return stems.distinct.sorted
    }

    def stemmer(word: String, pos: POS) : List[String] = {
        try { wordnetStemmer.findStems(word, pos).asScala.toList }
        catch { case e : Throwable => List() }
    }

}


text:
/*
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#include "common.h"
#include "samplefmt.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct SampleFmtInfo {
    char name[8];
    int bits;
    int planar;
    enum AVSampleFormat altform; ///< planar<->packed alternative form
} SampleFmtInfo;

/** this table gives more information about formats */
static const SampleFmtInfo sample_fmt_info[AV_SAMPLE_FMT_NB] = {
    [AV_SAMPLE_FMT_U8]   = { .name =   "u8", .bits =  8, .planar = 0, .altform = AV_SAMPLE_FMT_U8P  },
    [AV_SAMPLE_FMT_S16]  = { .name =  "s16", .bits = 16, .planar = 0, .altform = AV_SAMPLE_FMT_S16P },
    [AV_SAMPLE_FMT_S32]  = { .name =  "s32", .bits = 32, .planar = 0, .altform = AV_SAMPLE_FMT_S32P },
    [AV_SAMPLE_FMT_FLT]  = { .name =  "flt", .bits = 32, .planar = 0, .altform = AV_SAMPLE_FMT_FLTP },
    [AV_SAMPLE_FMT_DBL]  = { .name =  "dbl", .bits = 64, .planar = 0, .altform = AV_SAMPLE_FMT_DBLP },
    [AV_SAMPLE_FMT_U8P]  = { .name =  "u8p", .bits =  8, .planar = 1, .altform = AV_SAMPLE_FMT_U8   },
    [AV_SAMPLE_FMT_S16P] = { .name = "s16p", .bits = 16, .planar = 1, .altform = AV_SAMPLE_FMT_S16  },
    [AV_SAMPLE_FMT_S32P] = { .name = "s32p", .bits = 32, .planar = 1, .altform = AV_SAMPLE_FMT_S32  },
    [AV_SAMPLE_FMT_FLTP] = { .name = "fltp", .bits = 32, .planar = 1, .altform = AV_SAMPLE_FMT_FLT  },
    [AV_SAMPLE_FMT_DBLP] = { .name = "dblp", .bits = 64, .planar = 1, .altform = AV_SAMPLE_FMT_DBL  },
};

const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
{
    if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
        return NULL;
    return sample_fmt_info[sample_fmt].name;
}

enum AVSampleFormat av_get_sample_fmt(const char *name)
{
    int i;

    for (i = 0; i < AV_SAMPLE_FMT_NB; i++)
        if (!strcmp(sample_fmt_info[i].name, name))
            return i;
    return AV_SAMPLE_FMT_NONE;
}

enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, int planar)
{
    if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
        return AV_SAMPLE_FMT_NONE;
    if (sample_fmt_info[sample_fmt].planar == planar)
        return sample_fmt;
    return sample_fmt_info[sample_fmt].altform;
}

enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt)
{
    if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
        return AV_SAMPLE_FMT_NONE;
    if (sample_fmt_info[sample_fmt].planar)
        return sample_fmt_info[sample_fmt].altform;
    return sample_fmt;
}

enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt)
{
    if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
        return AV_SAMPLE_FMT_NONE;
    if (sample_fmt_info[sample_fmt].planar)
        return sample_fmt;
    return sample_fmt_info[sample_fmt].altform;
}

char *av_get_sample_fmt_string (char *buf, int buf_size, enum AVSampleFormat sample_fmt)
{
    /* print header */
    if (sample_fmt < 0)
        snprintf(buf, buf_size, "name  " " depth");
    else if (sample_fmt < AV_SAMPLE_FMT_NB) {
        SampleFmtInfo info = sample_fmt_info[sample_fmt];
        snprintf (buf, buf_size, "%-6s" "   %2d ", info.name, info.bits);
    }

    return buf;
}

int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
{
     return sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB ?
        0 : sample_fmt_info[sample_fmt].bits >> 3;
}

#if FF_API_GET_BITS_PER_SAMPLE_FMT
int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt)
{
    return sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB ?
        0 : sample_fmt_info[sample_fmt].bits;
}
#endif

int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
{
     if (sample_fmt < 0 || sample_fmt >= AV_SAMPLE_FMT_NB)
         return 0;
     return sample_fmt_info[sample_fmt].planar;
}

int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
                               enum AVSampleFormat sample_fmt, int align)
{
    int line_size;
    int sample_size = av_get_bytes_per_sample(sample_fmt);
    int planar      = av_sample_fmt_is_planar(sample_fmt);

    /* validate parameter ranges */
    if (!sample_size || nb_samples <= 0 || nb_channels <= 0)
        return AVERROR(EINVAL);

    /* auto-select alignment if not specified */
    if (!align) {
        if (nb_samples > INT_MAX - 31)
            return AVERROR(EINVAL);
        align = 1;
        nb_samples = FFALIGN(nb_samples, 32);
    }

    /* check for integer overflow */
    if (nb_channels > INT_MAX / align ||
        (int64_t)nb_channels * nb_samples > (INT_MAX - (align * nb_channels)) / sample_size)
        return AVERROR(EINVAL);

    line_size = planar ? FFALIGN(nb_samples * sample_size,               align) :
                         FFALIGN(nb_samples * sample_size * nb_channels, align);
    if (linesize)
        *linesize = line_size;

    return planar ? line_size * nb_channels : line_size;
}

int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
                           const uint8_t *buf, int nb_channels, int nb_samples,
                           enum AVSampleFormat sample_fmt, int align)
{
    int ch, planar, buf_size, line_size;

    planar   = av_sample_fmt_is_planar(sample_fmt);
    buf_size = av_samples_get_buffer_size(&line_size, nb_channels, nb_samples,
                                          sample_fmt, align);
    if (buf_size < 0)
        return buf_size;

    audio_data[0] = (uint8_t *)buf;
    for (ch = 1; planar && ch < nb_channels; ch++)
        audio_data[ch] = audio_data[ch-1] + line_size;

    if (linesize)
        *linesize = line_size;

#if FF_API_SAMPLES_UTILS_RETURN_ZERO
    return 0;
#else
    return buf_size;
#endif
}

int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
                     int nb_samples, enum AVSampleFormat sample_fmt, int align)
{
    uint8_t *buf;
    int size = av_samples_get_buffer_size(NULL, nb_channels, nb_samples,
                                          sample_fmt, align);
    if (size < 0)
        return size;

    buf = av_malloc(size);
    if (!buf)
        return AVERROR(ENOMEM);

    size = av_samples_fill_arrays(audio_data, linesize, buf, nb_channels,
                                  nb_samples, sample_fmt, align);
    if (size < 0) {
        av_free(buf);
        return size;
    }

    av_samples_set_silence(audio_data, 0, nb_samples, nb_channels, sample_fmt);

#if FF_API_SAMPLES_UTILS_RETURN_ZERO
    return 0;
#else
    return size;
#endif
}

int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int nb_channels,
                                       int nb_samples, enum AVSampleFormat sample_fmt, int align)
{
    int ret, nb_planes = av_sample_fmt_is_planar(sample_fmt) ? nb_channels : 1;

    *audio_data = av_calloc(nb_planes, sizeof(**audio_data));
    if (!*audio_data)
        return AVERROR(ENOMEM);
    ret = av_samples_alloc(*audio_data, linesize, nb_channels,
                           nb_samples, sample_fmt, align);
    if (ret < 0)
        av_freep(audio_data);
    return ret;
}

int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset,
                    int src_offset, int nb_samples, int nb_channels,
                    enum AVSampleFormat sample_fmt)
{
    int planar      = av_sample_fmt_is_planar(sample_fmt);
    int planes      = planar ? nb_channels : 1;
    int block_align = av_get_bytes_per_sample(sample_fmt) * (planar ? 1 : nb_channels);
    int data_size   = nb_samples * block_align;
    int i;

    dst_offset *= block_align;
    src_offset *= block_align;

    if((dst[0] < src[0] ? src[0] - dst[0] : dst[0] - src[0]) >= data_size) {
        for (i = 0; i < planes; i++)
            memcpy(dst[i] + dst_offset, src[i] + src_offset, data_size);
    } else {
        for (i = 0; i < planes; i++)
            memmove(dst[i] + dst_offset, src[i] + src_offset, data_size);
    }

    return 0;
}

int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples,
                           int nb_channels, enum AVSampleFormat sample_fmt)
{
    int planar      = av_sample_fmt_is_planar(sample_fmt);
    int planes      = planar ? nb_channels : 1;
    int block_align = av_get_bytes_per_sample(sample_fmt) * (planar ? 1 : nb_channels);
    int data_size   = nb_samples * block_align;
    int fill_char   = (sample_fmt == AV_SAMPLE_FMT_U8 ||
                     sample_fmt == AV_SAMPLE_FMT_U8P) ? 0x80 : 0x00;
    int i;

    offset *= block_align;

    for (i = 0; i < planes; i++)
        memset(audio_data[i] + offset, fill_char, data_size);

    return 0;
}


text:
package waveview.search;

import java.util.NoSuchElementException;
import waveview.wavedata.BitVector;
import waveview.wavedata.NetDataModel;
import waveview.wavedata.WaveformDataModel;
import waveview.wavedata.WaveformDataModel.AmbiguousNetException;

/// Converts a search string into a tree of expression nodes that
/// represents the value.
final class SearchParser {
    private final SearchLexer lexer;
    private final WaveformDataModel waveformDataModel;
    private final BooleanExpressionNode searchExpression;

    SearchParser(WaveformDataModel waveformDataModel, String searchString)
        throws SearchFormatException {
        this.waveformDataModel = waveformDataModel;
        lexer = new SearchLexer(searchString);
        searchExpression = parseExpression();
        matchToken(Token.Type.END);
    }

    BooleanExpressionNode getExpression() {
        return searchExpression;
    }

    /// Read the next token and throw an exception if the type does
    /// not match the parameter.
    private Token matchToken(Token.Type tokenType) throws SearchFormatException {
        Token token = lexer.nextToken();
        if (token.getType() != tokenType) {
            if (token.getType() == Token.Type.END) {
                throw new SearchFormatException(
                    "Unexpected end of string", token.getStart(), token.getEnd());
            } else {
                throw new SearchFormatException(
                    "Unexpected token", token.getStart(), token.getEnd());
            }
        }

        return token;
    }

    /// Read the next token and check if is an identifier that matches
    /// the passed type. If not, push back the token and return false.
    /// @note this is case insensitive
    private boolean tryToMatchToken(Token.Type tokenType) throws SearchFormatException {
        Token lookahead = lexer.nextToken();
        if (lookahead.getType() != tokenType) {
            lexer.pushBackToken();
            return false;
        }

        return true;
    }

    private BooleanExpressionNode parseExpression() throws SearchFormatException {
        return parseOr();
    }

    private BooleanExpressionNode parseOr() throws SearchFormatException {
        BooleanExpressionNode left = parseAnd();
        while (tryToMatchToken(Token.Type.DOUBLE_PIPE)) {
            left = new OrExpressionNode(left, parseAnd());
        }

        return left;
    }

    private BooleanExpressionNode parseAnd() throws SearchFormatException {
        BooleanExpressionNode left = parseCondition();
        while (tryToMatchToken(Token.Type.DOUBLE_AMPERSAND)) {
            left = new AndExpressionNode(left, parseCondition());
        }

        return left;
    }

    private BooleanExpressionNode parseCondition() throws SearchFormatException {
        Token lookahead = lexer.nextToken();
        if (lookahead.getType() == Token.Type.LPAREN) {
            BooleanExpressionNode node = parseExpression();
            matchToken(Token.Type.RPAREN);
            return node;
        }

        lexer.pushBackToken();
        ValueNode left = parseValue();
        lookahead = lexer.nextToken();
        switch (lookahead.getType()) {
            case GREATER:
                return new GreaterThanExpressionNode(left, parseValue());
            case GREATER_EQUAL:
                return new GreaterEqualExpressionNode(left, parseValue());
            case LESS_THAN:
                return new LessThanExpressionNode(left, parseValue());
            case LESS_EQUAL:
                return new LessEqualExpressionNode(left, parseValue());
            case NOT_EQUAL:
                return new NotEqualExpressionNode(left, parseValue());
            case EQUAL:
                return new EqualExpressionNode(left, parseValue());
            default:
                // If there's not an operator, treat as != 0
                lexer.pushBackToken();
                return new NotEqualExpressionNode(left, new ConstValueNode(BitVector.ZERO));
        }
    }

    private ValueNode parseValue() throws SearchFormatException {
        Token lookahead = lexer.nextToken();
        if (lookahead.getType() == Token.Type.IDENTIFIER) {
            String name = lookahead.toString();
            NetDataModel netDataModel;
            try {
                netDataModel = waveformDataModel.fuzzyFindNet(name);
            } catch (AmbiguousNetException exc) {
                throw new SearchFormatException(
                    "Ambiguous net \"" + name + "\"", lookahead.getStart(),
                    lookahead.getEnd());
            } catch (NoSuchElementException exc) {
                throw new SearchFormatException("Unknown net \"" + name + "\"",
                    lookahead.getStart(), lookahead.getEnd());
            }

            lookahead = lexer.nextToken();
            if (lookahead.getType() == Token.Type.LBRACKET) {
                Token highIndexTok = matchToken(Token.Type.LITERAL);
                int highIndex = highIndexTok.getLiteralValue().intValue();
                int lowIndex;

                int width = netDataModel.getTransitionVector().getWidth();
                lookahead = lexer.nextToken();
                if (lookahead.getType() == Token.Type.COLON) {
                    Token lowIndexTok = matchToken(Token.Type.LITERAL);
                    lowIndex = lowIndexTok.getLiteralValue().intValue();
                    if (highIndex >= width || highIndex < lowIndex) {
                        throw new SearchFormatException("Invalid bit slice range",
                            highIndexTok.getStart(), lowIndexTok.getEnd());
                    }
                } else {
                    lexer.pushBackToken();
                    lowIndex = highIndex;
                    if (highIndex >= width) {
                        throw new SearchFormatException("Invalid bit slice index",
                            highIndexTok.getStart(), highIndexTok.getEnd());
                    }
                }

                matchToken(Token.Type.RBRACKET);

                return new NetValueNode(netDataModel, lowIndex, highIndex);
            } else {
                lexer.pushBackToken();
                return new NetValueNode(netDataModel);
            }
        } else {
            lexer.pushBackToken();
            matchToken(Token.Type.LITERAL);
            return new ConstValueNode(lookahead.getLiteralValue());
        }
    }
}


text:
/* NOTE: This is an internal header file, included by other STL headers.
 *   You should not attempt to use it directly.
 */

#ifndef _STLP_INTERNAL_FUNCTION_BASE_H
#define _STLP_INTERNAL_FUNCTION_BASE_H

#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_TYPE_TRAITS_H)
#  include <stl/type_traits.h>
#endif

_STLP_BEGIN_NAMESPACE

template <class _Arg, class _Result>
struct unary_function {
  typedef _Arg argument_type;
  typedef _Result result_type;
};

template <class _Arg1, class _Arg2, class _Result>
struct binary_function {
  typedef _Arg1 first_argument_type;
  typedef _Arg2 second_argument_type;
  typedef _Result result_type;
};

template <class _Tp>
struct equal_to : public binary_function<_Tp, _Tp, bool> {
  bool operator()(const _Tp& __x, const _Tp& __y) const { return __x == __y; }
};

template <class _Tp>
struct less : public binary_function<_Tp,_Tp,bool>
#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
/* less is the default template parameter for many STL containers, to fully use
 * the move constructor feature we need to know that the default less is just a
 * functor.
 */
              , public __stlport_class<less<_Tp> >
#endif
{
  bool operator()(const _Tp& __x, const _Tp& __y) const { return __x < __y; }

#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND)
  //This is for a very special compiler config: partial template specialization
  //but no template function partial ordering.
  void swap(less<_Tp>&) {}
#endif
};

#if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)
template <class _Tp>
struct __type_traits<less<_Tp> > {
#if !defined (__BORLANDC__)
  typedef typename _IsSTLportClass<less<_Tp> >::_Ret _STLportLess;
#else
  enum { _Is = _IsSTLportClass<less<_Tp> >::_Is };
  typedef typename __bool2type<_Is>::_Ret _STLportLess;
#endif
  typedef _STLportLess has_trivial_default_constructor;
  typedef _STLportLess has_trivial_copy_constructor;
  typedef _STLportLess has_trivial_assignment_operator;
  typedef _STLportLess has_trivial_destructor;
  typedef _STLportLess is_POD_type;
};
#endif

_STLP_MOVE_TO_PRIV_NAMESPACE

template <class _Tp>
less<_Tp> __less(_Tp* ) { return less<_Tp>(); }

template <class _Tp>
equal_to<_Tp> __equal_to(_Tp* ) { return equal_to<_Tp>(); }

_STLP_MOVE_TO_STD_NAMESPACE

template <class _Tp>
struct plus : public binary_function<_Tp, _Tp, _Tp> {
  _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x + __y; }
};

template <class _Tp>
struct minus : public binary_function<_Tp, _Tp, _Tp> {
  _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x - __y; }
};

_STLP_MOVE_TO_PRIV_NAMESPACE

template <class _Tp>
plus<_Tp> __plus(_Tp* ) { return plus<_Tp>(); }

template <class _Tp>
minus<_Tp> __minus(_Tp* ) { return minus<_Tp>(); }

_STLP_MOVE_TO_STD_NAMESPACE

template <class _Tp>
struct multiplies : public binary_function<_Tp, _Tp, _Tp> {
  _Tp operator()(const _Tp& __x, const _Tp& __y) const { return __x * __y; }
};

_STLP_MOVE_TO_PRIV_NAMESPACE

template <class _Pair>
struct _Select1st : public unary_function<_Pair, typename _Pair::first_type> {
  const typename _Pair::first_type& operator()(const _Pair& __x) const {
    return __x.first;
  }
};

template <class _Pair>
struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type> {
  const typename _Pair::second_type& operator()(const _Pair& __x) const {
    return __x.second;
  }
};

// project1st and project2nd are extensions: they are not part of the standard
template <class _Arg1, class _Arg2>
struct _Project1st : public binary_function<_Arg1, _Arg2, _Arg1> {
  _Arg1 operator()(const _Arg1& __x, const _Arg2&) const { return __x; }
};

template <class _Arg1, class _Arg2>
struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2> {
  _Arg2 operator()(const _Arg1&, const _Arg2& __y) const { return __y; }
};

#if defined (_STLP_MULTI_CONST_TEMPLATE_ARG_BUG)
// fbp : sort of select1st just for maps
template <class _Pair, class _Whatever>
// JDJ (CW Pro1 doesn't like const when first_type is also const)
struct __Select1st_hint : public unary_function<_Pair, _Whatever> {
    const _Whatever& operator () (const _Pair& __x) const { return __x.first; }
};
#  define  _STLP_SELECT1ST(__x,__y) _STLP_PRIV __Select1st_hint< __x, __y >
#else
#  define  _STLP_SELECT1ST(__x, __y) _STLP_PRIV _Select1st< __x >
#endif

template <class _Tp>
struct _Identity : public unary_function<_Tp,_Tp> {
  const _Tp& operator()(const _Tp& __x) const { return __x; }
};

template <class _Result, class _Argument>
struct _Constant_unary_fun {
  typedef _Argument argument_type;
  typedef  _Result  result_type;
  result_type _M_val;

  _Constant_unary_fun(const result_type& __v) : _M_val(__v) {}
  const result_type& operator()(const _Argument&) const { return _M_val; }
};

template <class _Result, class _Arg1, class _Arg2>
struct _Constant_binary_fun {
  typedef  _Arg1   first_argument_type;
  typedef  _Arg2   second_argument_type;
  typedef  _Result result_type;
  _Result _M_val;

  _Constant_binary_fun(const _Result& __v) : _M_val(__v) {}
  const result_type& operator()(const _Arg1&, const _Arg2&) const {
    return _M_val;
  }
};

// identity_element (not part of the C++ standard).
template <class _Tp> inline _Tp __identity_element(plus<_Tp>) {  return _Tp(0); }
template <class _Tp> inline _Tp __identity_element(multiplies<_Tp>) { return _Tp(1); }

_STLP_MOVE_TO_STD_NAMESPACE

_STLP_END_NAMESPACE

#endif /* _STLP_INTERNAL_FUNCTION_BASE_H */

// Local Variables:
// mode:C++
// End:


text:
namespace QuantConnect.Indicators {
    /// <summary>
    /// Represents an indictor capable of tracking the sum for the given period
    /// </summary>
    public class Sum : WindowIndicator<IndicatorDataPoint> {
        /// <summary>The sum for the given period</summary>
        private decimal _sum;

        /// <summary>
        ///     Gets a flag indicating when this indicator is ready and fully initialized
        /// </summary>
        public override bool IsReady {
            get { return Samples >= Period; }
        }

        /// <summary>
        /// Resets this indicator to its initial state
        /// </summary>
        public override void Reset() {
            _sum = 0.0m;
            base.Reset();
        }

        /// <summary>
        ///     Initializes a new instance of the Sum class with the specified name and period
        /// </summary>
        /// <param name="name">The name of this indicator</param>
        /// <param name="period">The period of the SMA</param>
        public Sum(string name, int period)
            : base(name, period)
        {
        }

        /// <summary>
        ///     Initializes a new instance of the Sum class with the default name and period
        /// </summary>
        /// <param name="period">The period of the SMA</param>
        public Sum(int period)
            : this("SUM" + period, period)
        {
        }

        /// <summary>
        ///     Computes the next value for this indicator from the given state.
        /// </summary>
        /// <param name="window">The window of data held in this indicator</param>
        /// <param name="input">The input value to this indicator on this time step</param>
        /// <returns>A new value for this indicator</returns>
        protected override decimal ComputeNextValue(IReadOnlyWindow<IndicatorDataPoint> window, IndicatorDataPoint input) {
            _sum += input.Value;
            if (window.IsReady) {
                _sum -= window.MostRecentlyRemoved.Value;
            }
            return _sum;
        }
    }
}


text:
/* Includes ------------------------------------------------------------------*/
#include "lwip/mem.h"
#include "lwip/memp.h"
#include "lwip/dhcp.h"
#include "ethernetif.h"
#include "net_basic_cfg.h"
#include "stm32f4x7_eth_bsp.h"
#include "netconf.h"
#include "tcpip.h"
#include <stdio.h>

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#define MAX_DHCP_TRIES 4

/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
struct netif xnetif; /* network interface structure */
extern __IO uint32_t  EthStatus;
#ifdef USE_DHCP
__IO uint8_t DHCP_state;
#endif /* USE_DHCP */

/* Private functions ---------------------------------------------------------*/
/**
  * @brief  Initializes the lwIP stack
  * @param  None
  * @retval None
  */
void LwIP_Init(void)
{
  struct ip_addr ipaddr;
  struct ip_addr netmask;
  struct ip_addr gw;
#ifndef USE_DHCP
  uint8_t iptab[4] = {0};
  uint8_t iptxt[20];
#endif
  /* Create tcp_ip stack thread */
  tcpip_init( NULL, NULL );

  /* IP address setting */
#ifdef USE_DHCP
  ipaddr.addr = 0;
  netmask.addr = 0;
  gw.addr = 0;
#else
  IP4_ADDR(&ipaddr, IP_ADDR0, IP_ADDR1, IP_ADDR2, IP_ADDR3);
  IP4_ADDR(&netmask, NETMASK_ADDR0, NETMASK_ADDR1 , NETMASK_ADDR2, NETMASK_ADDR3);
  IP4_ADDR(&gw, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3);
#endif

  /* - netif_add(struct netif *netif, struct ip_addr *ipaddr,
  struct ip_addr *netmask, struct ip_addr *gw,
  void *state, err_t (* init)(struct netif *netif),
  err_t (* input)(struct pbuf *p, struct netif *netif))

  Adds your network interface to the netif_list. Allocate a struct
  netif and pass a pointer to this structure as the first argument.
  Give pointers to cleared ip_addr structures when using DHCP,
  or fill them with sane numbers otherwise. The state pointer may be NULL.

  The init function pointer must point to a initialization function for
  your ethernet netif interface. The following code illustrates it's use.*/
  netif_add(&xnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &tcpip_input);

  /*  Registers the default network interface.*/
  netif_set_default(&xnetif);

  if (EthStatus == (ETH_INIT_FLAG | ETH_LINK_FLAG))
  {
    /* Set Ethernet link flag */
    xnetif.flags |= NETIF_FLAG_LINK_UP;

    /* When the netif is fully configured this function must be called.*/
    netif_set_up(&xnetif);
#ifdef USE_DHCP
    DHCP_state = DHCP_START;
#else

    iptab[0] = IP_ADDR3;
    iptab[1] = IP_ADDR2;
    iptab[2] = IP_ADDR1;
    iptab[3] = IP_ADDR0;

    sprintf((char*)iptxt, "  %d.%d.%d.%d", iptab[3], iptab[2], iptab[1], iptab[0]);

	xprintf("LCD:   Static IP address   \n");
	xprintf("LCD:   %s   \n",iptxt);

#endif /* USE_DHCP */
  }
  else
  {
    /*  When the netif link is down this function must be called.*/
    netif_set_down(&xnetif);
#ifdef USE_DHCP
    DHCP_state = DHCP_LINK_DOWN;
#endif /* USE_DHCP */

	xprintf("network cable is not connected\n");
  }

  /* Set the link callback function, this function is called on change of link status*/
  netif_set_link_callback(&xnetif, ETH_link_callback);
}

#ifdef USE_DHCP
/**
  * @brief  LwIP_DHCP_Process_Handle
  * @param  None
  * @retval None
  */
void LwIP_DHCP_task(void * pvParameters)
{
  struct ip_addr ipaddr;
  struct ip_addr netmask;
  struct ip_addr gw;
  uint32_t IPaddress;
  uint8_t iptab[4] = {0};
  uint8_t iptxt[20];

  for (;;)
  {
    switch (DHCP_state)
    {
    case DHCP_START:
      {
        dhcp_start(&xnetif);
        /* IP address should be set to 0
           every time we want to assign a new DHCP address */
        IPaddress = 0;
        DHCP_state = DHCP_WAIT_ADDRESS;
#ifdef USE_LCD
        LCD_SetTextColor(White);
        LCD_ClearLine(Line4);
        LCD_ClearLine(Line5);
        LCD_ClearLine(Line6);
        LCD_DisplayStringLine(Line4, (uint8_t*)"     Looking for    ");
        LCD_DisplayStringLine(Line5, (uint8_t*)"     DHCP server    ");
        LCD_DisplayStringLine(Line6, (uint8_t*)"     please wait... ");
#endif
      }
      break;

      case DHCP_WAIT_ADDRESS:
      {
        /* Toggle LED1 */
        //STM_EVAL_LEDToggle(LED1);

        /* Read the new IP address */
        IPaddress = xnetif.ip_addr.addr;

        if (IPaddress!=0)
        {
          DHCP_state = DHCP_ADDRESS_ASSIGNED;

          /* Stop DHCP */
          dhcp_stop(&xnetif);

#ifdef USE_LCD
          iptab[0] = (uint8_t)(IPaddress >> 24);
          iptab[1] = (uint8_t)(IPaddress >> 16);
          iptab[2] = (uint8_t)(IPaddress >> 8);
          iptab[3] = (uint8_t)(IPaddress);

          sprintf((char*)iptxt, "  %d.%d.%d.%d", iptab[3], iptab[2], iptab[1], iptab[0]);

          LCD_SetTextColor(White);
          LCD_ClearLine(Line4);
          LCD_ClearLine(Line5);
          LCD_ClearLine(Line6);
          /* Display the IP address */
          LCD_DisplayStringLine(Line7, (uint8_t*)"IP address assigned ");
          LCD_DisplayStringLine(Line8, (uint8_t*)"  by a DHCP server  ");
          LCD_DisplayStringLine(Line9, iptxt);
#endif
          /* end of DHCP process: LED1 stays ON*/
          //STM_EVAL_LEDOn(LED1);
        }
        else
        {
          /* DHCP timeout */
          if (xnetif.dhcp->tries > MAX_DHCP_TRIES)
          {
            DHCP_state = DHCP_TIMEOUT;

            /* Stop DHCP */
            dhcp_stop(&xnetif);

            /* Static address used */
            IP4_ADDR(&ipaddr, IP_ADDR0 ,IP_ADDR1 , IP_ADDR2 , IP_ADDR3 );
            IP4_ADDR(&netmask, NETMASK_ADDR0, NETMASK_ADDR1, NETMASK_ADDR2, NETMASK_ADDR3);
            IP4_ADDR(&gw, GW_ADDR0, GW_ADDR1, GW_ADDR2, GW_ADDR3);
            netif_set_addr(&xnetif, &ipaddr , &netmask, &gw);

#ifdef USE_LCD
            iptab[0] = IP_ADDR3;
            iptab[1] = IP_ADDR2;
            iptab[2] = IP_ADDR1;
            iptab[3] = IP_ADDR0;

            sprintf((char*)iptxt, "  %d.%d.%d.%d", iptab[3], iptab[2], iptab[1], iptab[0]);

            LCD_SetTextColor(White);
            LCD_ClearLine(Line4);
            LCD_ClearLine(Line5);
            LCD_ClearLine(Line6);
            LCD_ClearLine(Line7);
            LCD_DisplayStringLine(Line7, (uint8_t*)"    DHCP timeout    ");
            LCD_DisplayStringLine(Line8, (uint8_t*)"  Static IP address   ");
            LCD_DisplayStringLine(Line9, iptxt);
#endif
            /* end of DHCP process: LED1 stays ON*/
            //STM_EVAL_LEDOn(LED1);
          }
        }
      }
      break;

      default: break;
    }

    /* wait 250 ms */
    vTaskDelay(250);
  }
}
#endif  /* USE_DHCP */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
<!--
  MIT License

  Copyright 2017-2018 Sabre GLBL Inc.

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.
 -->

# Contributing to _conf4j_

You have found a bug or you have an idea for a cool new feature? Contributing code is a great way to give something
back to the open source community. Before you dig right into the code there are a few guidelines that we need
contributors to follow so that we can have a chance of keeping on top of things.

## Getting Started

* Make sure you have a [GitHub account](https://github.com/signup/free).
* If you're planning to implement a bigger feature it makes sense to discuss your changes first.
  Please create an issue and explain the intended change.
  This way you can make sure you're not wasting your time on something that isn't considered to be in
  _conf4j_ scope.
* Submit a ticket for your issue, assuming one does not already exist.
  * Clearly describe the issue including steps to reproduce when it is a bug.
  * Make sure you fill in the earliest version that you know has the issue.
* Fork the repository on GitHub.

## Making Changes

* Create a topic branch from where you want to base your work (this is usually the master/trunk branch).
* Make commits of logical units.
* Respect the original code style:
  * Only use spaces for indentation.
  * Create minimal diffs - disable on save actions like reformat source code or organize imports.
    If you feel the source code should be reformatted create a separate PR for this change.
  * Check for unnecessary whitespace with git diff --check before committing.
* Make sure your commit messages are in the proper format.
* Make sure you have added the necessary tests for your changes.
* Run all the tests with `mvn clean verify` to assure nothing else was accidentally broken.

## Submitting Changes

* Sign the [Contributor License Agreement][cla] if you haven't already.
* Push your changes to a topic branch in your fork of the repository.
* Submit a pull request to the repository.

## Additional Resources

+ [Contributor License Agreement][cla]
+ [General GitHub documentation](https://help.github.com/)
+ [GitHub pull request documentation](https://help.github.com/send-pull-requests/)

[cla]:https://cla-assistant.io/


text:
using System;

namespace Benchy.Framework
{
    interface IBenchmarkTest
    {
        uint ExecutionCount { get; }

        TimeSpan? WarnTime { get; }
        TimeSpan? FailTime { get; }

        string Name { get; }
        string TypeName { get; }
        string Category { get; }
        bool CollectGarbage { get; }
        bool RunInParallel { get; }

        bool HasSetup(ExecutionScope scope);
        bool HasTeardown(ExecutionScope scope);

        void Setup();
        void Execute();
        void Teardown();
        void PerPassSetup();
        void PerPassTeardown();
    }
}


text:
const connection = require('../knexfile');
const knex = require('knex')(connection);

const assert = require('assert');

const Comment = require('../models/comment');
const Enrolment = require('../models/enrolment');
const Friend = require('../models/friend');
const Group = require('../models/group');
const Post = require('../models/post');
const Rating = require('../models/rating');
const Role = require('../models/role');
const Tag = require('../models/tag');
const User = require('../models/user');
const Empty = require('../models/empty');

exports.test = async function() {
  let postsWithTagsCount = await Post.whereHas('tags').count();
  let tagsWithPostsCount = await Tag.whereHas('posts').count();
  let posts = await Post.with('tags').get();
  let tags = await Tag.with('posts').get();
  posts = posts.toJSON();
  tags = tags.toJSON();

  let tagsIds = new Set();
  let postsWithTagsCountTest = 0;
  for (let post of posts) {
    if (post.tags.length > 0) postsWithTagsCountTest++;
    for (let tag of post.tags) tagsIds.add(tag.id);

    let postTagsCount = await Tag.whereHas('posts', (sq) => {
      sq.whereIn('postIdAttr', [post.postIdAttr]);
    }).count();
    assert.equal(post.tags.length, postTagsCount);
  }
  assert.equal(postsWithTagsCountTest, postsWithTagsCount);

  let postsIds = new Set();
  let tagsWithPostsCountTest = 0;
  for (let tag of tags) {
    if (tag.posts.length > 0) tagsWithPostsCountTest++;
    for (let post of tag.posts) postsIds.add(post.postIdAttr);

    let tagPostsCount = await Post.whereHas('tags', (sq) => {
      sq.whereIn('id', [tag.id]);
    }).count();
    assert.equal(tag.posts.length, tagPostsCount);
  }
  assert.equal(tagsWithPostsCount, tagsWithPostsCountTest);

  // Test bookshelf paranoia.
  let postCount = await Post.count();
  let allPostCount = await Post.withDeleted().count();
  let postCount2 = await Post.withDeleted().whereNull('deletedAt').count();

  let postCountTest = await knex('posts').whereNull('deletedAt').count('* as count');
  postCountTest = postCountTest[0].count;
  let allPostCountTest = await knex('posts').count('* as count');
  allPostCountTest = allPostCountTest[0].count;

  assert.equal(postCount, postCountTest);
  assert.equal(postCount2, postCountTest);
  assert.equal(allPostCount, allPostCountTest);

  // Test bookshelf paranoia 2.
  postsWithTagsCount = await Post.withDeleted().whereHas('tags').count();
  tagsWithPostsCount = await Tag.whereHas('posts', (pq) => {
    pq.withDeleted();
  }).count();
  posts = await Post.withDeleted().with('tags').get();
  tags = await Tag.with('posts', (pq) => {
    pq.withDeleted();
  }).get();
  posts = posts.toJSON();
  tags = tags.toJSON();

  tagsIds = new Set();
  postsWithTagsCountTest = 0;
  for (let post of posts) {
    if (post.tags.length > 0) postsWithTagsCountTest++;
    for (let tag of post.tags) tagsIds.add(tag.id);

    let postTagsCount = await Tag.whereHas('posts', (sq) => {
      sq.withDeleted();
      sq.whereIn('postIdAttr', [post.postIdAttr]);
    }).count();
    assert.equal(post.tags.length, postTagsCount);
  }
  assert.equal(postsWithTagsCountTest, postsWithTagsCount);

  postsIds = new Set();
  tagsWithPostsCountTest = 0;
  for (let tag of tags) {
    if (tag.posts.length > 0) tagsWithPostsCountTest++;
    for (let post of tag.posts) postsIds.add(post.postIdAttr);

    let tagPostsCount = await Post.withDeleted().whereHas('tags', (sq) => {
      sq.whereIn('id', [tag.id]);
    }).count();
    assert.equal(tag.posts.length, tagPostsCount);
  }
  assert.equal(tagsWithPostsCount, tagsWithPostsCountTest);
};


text:
<?php
namespace cs;
include __DIR__.'/../../unit.php';
define('DIR', make_tmp_dir());
Core::instance();
?>
--EXPECT--
Config file not found, is system installed properly?
How to install CleverStyle Framework: https://github.com/nazar-pc/CleverStyle-Framework/tree/master/docs/installation/Installation.md


text:
describe('component: ngWigPlugin', () => {
    let component;
    let scope;
    let plugin = {
        name: 'myPlugin',
        pluginName: 'my-plugin'
    };
    let execCommand = 'fakeCmd()';
    let editMode = false;
    let disabled = false;
    let options = ['Option 1', 'Option 2'];
    let content = 'Fake text';
    let element = angular.element('

');
    let compile;

    beforeEach(module('ngWig'));

    beforeEach(inject((_$componentController_, _$rootScope_, _$compile_) => {
        scope = _$rootScope_.$new();
        compile = _$compile_;

        spyOn(element, 'replaceWith');

        component = _$componentController_('ngWigPlugin',
                                            { $scope: scope, $element: element },
                                            { plugin: plugin, execCommand: execCommand, editMode: editMode, disabled: disabled, options: options, content: content }
                                            );
    }));

    it('should expose plugin', () => {
        expect(component.plugin).toEqual(plugin);
    });

    it('should expose execCommand', () => {
        expect(component.execCommand).toEqual(execCommand);
    });

    it('should expose editMode', () => {
        expect(component.editMode).toEqual(editMode);
    });

    it('should expose disabled', () => {
        expect(component.disabled).toEqual(disabled);
    });

    it('should expose options', () => {
        expect(component.options).toEqual(options);
    });

    it('should expose content', () => {
        expect(component.content).toEqual(content);
    });

    it('should replace with the plugin template', () => {
        component.$onInit();

        let pluginElement = compile('<' + component.plugin.pluginName + ' ' +
        'plugin=' + '"$ctrl.plugin"' +
        'exec-command=' + '"$ctrl.execCommand"' +
        'edit-mode=' + '"$ctrl.editMode"' +
        'data-disabled=' + '"$ctrl.disabled"' +
        'options=' + '"$ctrl.options"' +
        'content=' + '"$ctrl.content"' +
        '/>')(scope);

        expect(element.replaceWith).toHaveBeenCalledWith(pluginElement);
    });
});


text:
<?php

class YokazeDb_Factory_Orm
{
    private $config = array();

    public function __construct($config)
    {
        $this->config = $config;
    }

    public function create($tableName)
    {
        if (!$this->config){
            trigger_error('Not configured', E_USER_WARNING);
            return;
        }

        try {
            require_once dirname(dirname(__FILE__)) . '/Driver/Factory.php';
            $db = YokazeDb_Driver_Factory::factory($this->config['dsn']);
        }catch (PDOException $e){
            // PDO error
            trigger_error($e->getMessage(), E_USER_ERROR);
        }catch (Exception $e){
            // framework error
            trigger_error($e->getMessage(), E_USER_ERROR);
        }
        require_once dirname(dirname(__FILE__)) . '/Orm.php';
        $dao = new YokazeDb_Orm($db, $tableName);
        $dao->autoCreateConfig($this->config['autoConfig']);
        $dao->setTableConfigs($this->config['configFile']);
        if (!$dao->existsTable()){
            require_once dirname(dirname(__FILE__)) . '/Inflector.php';
            if($dao->existsTable(YokazeDb_Inflector::singularize($tableName))){
                $dao->setTableName(YokazeDb_Inflector::singularize($tableName));
                require_once dirname(dirname(__FILE__)) . '/Iterator/Orm.php';
                $dao = new YokazeDb_Iterator_Orm($dao);
            }
        }
        return $dao;
    }
}


text:
#pragma once

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#define INITGUID
#include "targetver.h"

// Windows Header Files:
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include <setupapi.h>
#include <devguid.h>
#include <devpkey.h>
#include <regstr.h>
#include <Cfgmgr32.h>
//#include <winioctl.h>
#include <lmerr.h>
#include "ntddvol.h"    // Checked in locally, will fix later

// TODO: reference additional headers your program requires here


text:
from axiom.test.historic.stubloader import saveStub

from xmantissa.test.historic.stub_pyLuceneIndexer3to4 import createDatabase as _createDatabase

def createDatabase(*a, **kw):
    return _createDatabase(*a, **kw)

if __name__ == '__main__':
    saveStub(createDatabase, 10568)


text:
namespace Dropbox.Api.Team
{
    using sys = System;
    using col = System.Collections.Generic;
    using re = System.Text.RegularExpressions;

    using enc = Dropbox.Api.Stone;

    /// <summary>
    /// <para>The members list arg object</para>
    /// </summary>
    public class MembersListArg
    {
        #pragma warning disable 108

        /// <summary>
        /// <para>The encoder instance.</para>
        /// </summary>
        internal static enc.StructEncoder<MembersListArg> Encoder = new MembersListArgEncoder();

        /// <summary>
        /// <para>The decoder instance.</para>
        /// </summary>
        internal static enc.StructDecoder<MembersListArg> Decoder = new MembersListArgDecoder();

        /// <summary>
        /// <para>Initializes a new instance of the <see cref="MembersListArg" /> class.</para>
        /// </summary>
        /// <param name="limit">Number of results to return per call.</param>
        /// <param name="includeRemoved">Whether to return removed members.</param>
        public MembersListArg(uint limit = 1000,
                              bool includeRemoved = false)
        {
            if (limit < 1U)
            {
                throw new sys.ArgumentOutOfRangeException("limit", "Value should be greater or equal than 1");
            }
            if (limit > 1000U)
            {
                throw new sys.ArgumentOutOfRangeException("limit", "Value should be less of equal than 1000");
            }

            this.Limit = limit;
            this.IncludeRemoved = includeRemoved;
        }

        /// <summary>
        /// <para>Initializes a new instance of the <see cref="MembersListArg" /> class.</para>
        /// </summary>
        /// <remarks>This is to construct an instance of the object when
        /// deserializing.</remarks>
        [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)]
        public MembersListArg()
        {
            this.Limit = 1000;
            this.IncludeRemoved = false;
        }

        /// <summary>
        /// <para>Number of results to return per call.</para>
        /// </summary>
        public uint Limit { get; protected set; }

        /// <summary>
        /// <para>Whether to return removed members.</para>
        /// </summary>
        public bool IncludeRemoved { get; protected set; }

        #region Encoder class

        /// <summary>
        /// <para>Encoder for  <see cref="MembersListArg" />.</para>
        /// </summary>
        private class MembersListArgEncoder : enc.StructEncoder<MembersListArg>
        {
            /// <summary>
            /// <para>Encode fields of given value.</para>
            /// </summary>
            /// <param name="value">The value.</param>
            /// <param name="writer">The writer.</param>
            public override void EncodeFields(MembersListArg value, enc.IJsonWriter writer)
            {
                WriteProperty("limit", value.Limit, writer, enc.UInt32Encoder.Instance);
                WriteProperty("include_removed", value.IncludeRemoved, writer, enc.BooleanEncoder.Instance);
            }
        }

        #endregion

        #region Decoder class

        /// <summary>
        /// <para>Decoder for  <see cref="MembersListArg" />.</para>
        /// </summary>
        private class MembersListArgDecoder : enc.StructDecoder<MembersListArg>
        {
            /// <summary>
            /// <para>Create a new instance of type <see cref="MembersListArg" />.</para>
            /// </summary>
            /// <returns>The struct instance.</returns>
            protected override MembersListArg Create()
            {
                return new MembersListArg();
            }

            /// <summary>
            /// <para>Set given field.</para>
            /// </summary>
            /// <param name="value">The field value.</param>
            /// <param name="fieldName">The field name.</param>
            /// <param name="reader">The json reader.</param>
            protected override void SetField(MembersListArg value, string fieldName, enc.IJsonReader reader)
            {
                switch (fieldName)
                {
                    case "limit":
                        value.Limit = enc.UInt32Decoder.Instance.Decode(reader);
                        break;
                    case "include_removed":
                        value.IncludeRemoved = enc.BooleanDecoder.Instance.Decode(reader);
                        break;
                    default:
                        reader.Skip();
                        break;
                }
            }
        }

        #endregion
    }
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.12.03 at 11:33:45 AM PST
//

package org.ndexbio.xbel.model;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;

/**
 * This object contains factory methods for each
 * Java content interface and Java element interface
 * generated in the org.ndexbio.xbel.model package.
 *
An ObjectFactory allows you to programatically
 * construct new instances of the Java representation
 * for XML content. The Java representation of XML
 * content can consist of schema derived interfaces
 * and classes representing the binding of schema
 * type definitions, element declarations and model
 * groups.  Factory methods for each of these are
 * provided in this class.
 *
 */
@XmlRegistry
public class ObjectFactory {

    private final static QName _Name_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "name");
    private final static QName _Evidence_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "evidence");
    private final static QName _Description_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "description");
    private final static QName _Disclaimer_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "disclaimer");
    private final static QName _ContactInfo_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "contactInfo");
    private final static QName _ListValue_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "listValue");
    private final static QName _Author_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "author");
    private final static QName _PatternAnnotation_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "patternAnnotation");
    private final static QName _Version_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "version");
    private final static QName _License_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "license");
    private final static QName _Comment_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "comment");
    private final static QName _Copyright_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "copyright");
    private final static QName _Usage_QNAME = new QName("http://belframework.org/schema/1.0/xbel", "usage");

    /**
     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.ndexbio.xbel.model
     *
     */
    public ObjectFactory() {
    }

    /**
     * Create an instance of {@link Citation }
     *
     */
    public Citation createCitation() {
        return new Citation();
    }

    /**
     * Create an instance of {@link AnnotationDefinitionGroup }
     *
     */
    public AnnotationDefinitionGroup createAnnotationDefinitionGroup() {
        return new AnnotationDefinitionGroup();
    }

    /**
     * Create an instance of {@link InternalAnnotationDefinition }
     *
     */
    public InternalAnnotationDefinition createInternalAnnotationDefinition() {
        return new InternalAnnotationDefinition();
    }

    /**
     * Create an instance of {@link ListAnnotation }
     *
     */
    public ListAnnotation createListAnnotation() {
        return new ListAnnotation();
    }

    /**
     * Create an instance of {@link ExternalAnnotationDefinition }
     *
     */
    public ExternalAnnotationDefinition createExternalAnnotationDefinition() {
        return new ExternalAnnotationDefinition();
    }

    /**
     * Create an instance of {@link Subject }
     *
     */
    public Subject createSubject() {
        return new Subject();
    }

    /**
     * Create an instance of {@link Term }
     *
     */
    public Term createTerm() {
        return new Term();
    }

    /**
     * Create an instance of {@link Parameter }
     *
     */
    public Parameter createParameter() {
        return new Parameter();
    }

    /**
     * Create an instance of {@link Object }
     *
     */
    public Object createObject() {
        return new Object();
    }

    /**
     * Create an instance of {@link Statement }
     *
     */
    public Statement createStatement() {
        return new Statement();
    }

    /**
     * Create an instance of {@link AnnotationGroup }
     *
     */
    public AnnotationGroup createAnnotationGroup() {
        return new AnnotationGroup();
    }

    /**
     * Create an instance of {@link Annotation }
     *
     */
    public Annotation createAnnotation() {
        return new Annotation();
    }

    /**
     * Create an instance of {@link Citation.AuthorGroup }
     *
     */
    public Citation.AuthorGroup createCitationAuthorGroup() {
        return new Citation.AuthorGroup();
    }

    /**
     * Create an instance of {@link LicenseGroup }
     *
     */
    public LicenseGroup createLicenseGroup() {
        return new LicenseGroup();
    }

    /**
     * Create an instance of {@link org.ndexbio.xbel.model.AuthorGroup }
     *
     */
    public org.ndexbio.xbel.model.AuthorGroup createAuthorGroup() {
        return new org.ndexbio.xbel.model.AuthorGroup();
    }

    /**
     * Create an instance of {@link Namespace }
     *
     */
    public Namespace createNamespace() {
        return new Namespace();
    }

    /**
     * Create an instance of {@link Document }
     *
     */
    public Document createDocument() {
        return new Document();
    }

    /**
     * Create an instance of {@link Header }
     *
     */
    public Header createHeader() {
        return new Header();
    }

    /**
     * Create an instance of {@link NamespaceGroup }
     *
     */
    public NamespaceGroup createNamespaceGroup() {
        return new NamespaceGroup();
    }

    /**
     * Create an instance of {@link StatementGroup }
     *
     */
    public StatementGroup createStatementGroup() {
        return new StatementGroup();
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "name")
    public JAXBElement<String> createName(String value) {
        return new JAXBElement<>(_Name_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "evidence")
    public JAXBElement<String> createEvidence(String value) {
        return new JAXBElement<>(_Evidence_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "description")
    public JAXBElement<String> createDescription(String value) {
        return new JAXBElement<>(_Description_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "disclaimer")
    public JAXBElement<String> createDisclaimer(String value) {
        return new JAXBElement<>(_Disclaimer_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "contactInfo")
    public JAXBElement<String> createContactInfo(String value) {
        return new JAXBElement<>(_ContactInfo_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "listValue")
    public JAXBElement<String> createListValue(String value) {
        return new JAXBElement<>(_ListValue_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "author")
    public JAXBElement<String> createAuthor(String value) {
        return new JAXBElement<>(_Author_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "patternAnnotation")
    public JAXBElement<String> createPatternAnnotation(String value) {
        return new JAXBElement<>(_PatternAnnotation_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "version")
    public JAXBElement<String> createVersion(String value) {
        return new JAXBElement<>(_Version_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "license")
    public JAXBElement<String> createLicense(String value) {
        return new JAXBElement<>(_License_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "comment")
    public JAXBElement<String> createComment(String value) {
        return new JAXBElement<>(_Comment_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "copyright")
    public JAXBElement<String> createCopyright(String value) {
        return new JAXBElement<>(_Copyright_QNAME, String.class, null, value);
    }

    /**
     * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
     *
     */
    @XmlElementDecl(namespace = "http://belframework.org/schema/1.0/xbel", name = "usage")
    public JAXBElement<String> createUsage(String value) {
        return new JAXBElement<>(_Usage_QNAME, String.class, null, value);
    }

}


text:
/**
 * HumanPlayer.java (Tic-Tac-Toe Eclipse Project)
 *
 * by: Joel Fischer
 */

/**
 * An entity HumanPlayer that is a player but chooses to play
 * its move through showing a prompt and asking the user for a value
 *
 */
public class HumanPlayer extends Player {

	/**
	 * HumanPlayer Constructor
	 *
	 * @param mark This object's mark (X or O)
	 * @param playerNum This object's player number (1 or 2)
	 */
	public HumanPlayer(char mark, int playerNum) {
		super(mark, playerNum);
	}

	@Override
	/**
	 * Overridden function, implements asking a human user for a choice to play
	 * @Return The value chosen by the player
	 */
	public int getMove() {
		//Create a command line scanner
		int moveLoc = -1;

		//Retrieve the user's selection
		BoardGui.playerMark = this.getMarker();
		BoardGui.setBoardEnabled(true);
		while(moveLoc < 0 || moveLoc > 8) {
			try {
				Thread.sleep(10);
			} catch (InterruptedException ie) {}
			if(BoardGui.getGameUpdated() == true) {
				moveLoc = BoardGui.getMarkedSpace();
				BoardGui.setGameUpdated(false);
			}
		}
		BoardGui.setBoardEnabled(false);

		return moveLoc; //Return the value
	}
}


text:
var expect = require( 'chai' ).expect;
var sinon = require( 'sinon' );
var proxyquire = require( 'proxyquire' );

describe( 'grunt commands', function() {
    var childProcess,
        output,
        core,
        fp,
        commands;

    before( function() {
        //Set stubs
        childProcess = sinon.stub();
        output = sinon.stub();
        core = sinon.stub();
        fp = sinon.stub();

        commands = proxyquire( '../commands', {
            'child_process': childProcess,
            '../../../lib/output': output,
            '../../../lib/core': core,
            '../../core/filePath/commands': fp
        } ).commands;

    });

    var throwErrorStub,
        targetPathStub,
        getAliasStub,
        passErrorStub,
        prefixStub,
        execStub;

    beforeEach( function() {
        throwErrorStub = sinon.stub( output, "throwError", function( msg ) { throw new Error( msg ) } );
        targetPathStub = sinon.stub( fp.hooks, 'getTargetPath', function() { return 'C:\\targetPath' } );
        getAliasStub = sinon.stub( fp.hooks, 'getAlias', function( aliasName ) {
            if( aliasName == 'aliasSet' ) {
                return [ 'C:\\pathOne', 'C:\\pathTwo' ]
            } else {
                return 'C:\\' + aliasName
            }
        });
        passErrorStub = sinon.stub( output, 'passError' );
        prefixStub = sinon.stub( core, 'createTerminalExecutionPrefix', function( filepath, termAlias ) { return 'start "' + termAlias + '" cmd /k "' + filepath } );
        execStub = sinon.stub( childProcess, 'exec', function( statement, callback ) { callback(); } )
    });

    afterEach( function() {
        throwErrorStub.restore();
        targetPathStub.restore();
        getAliasStub.restore();
        passErrorStub.restore();
        prefixStub.restore();
        execStub.restore();
    });

    describe( 'grunt', function() {
        describe( 'under failure conditions', function() {
            it( 'will throw an error if no arguments are passed', function() {
                expect( function() { commands.grunt() } ).to.throw( Error, /This function requires at least one argument/ );
                expect( throwErrorStub.callCount ).to.equal( 1 );
                expect( prefixStub.callCount ).to.equal( 0 );
            });

            it( 'will throw an error if more than two arguments are passed', function() {
                expect( function() { commands.grunt( 'testAlias', 'testGruntTask', '"--filename:dark.txt"' ) } ).to.throw( Error, /This function takes only two arguments/ );
                expect( throwErrorStub.callCount ).to.equal( 1 );
                expect( prefixStub.callCount ).to.equal( 0 );
            });
            it( 'will throw an error if an alias set is used as the alias', function() {
                expect( function() { commands.grunt( 'aliasSet', 'testGruntTask' ) } ).to.throw( Error, /The specified alias is an alias set./ );
                expect( throwErrorStub.callCount ).to.equal( 1 );
                expect( prefixStub.callCount ).to.equal( 0 );
            });
        });

        describe( 'under success conditions', function() {

            it( 'will generate a Grunt statement using the target path if no alias specified', function() {
                commands.grunt( 'localGruntTask' );
                expect( targetPathStub.callCount ).to.equal( 1 );
                expect( getAliasStub.callCount ).to.equal( 0 );
                expect( prefixStub.callCount ).to.equal( 1 );
                expect( execStub.callCount ).to.equal( 1 );
                expect( execStub.args[ 0 ][ 0 ] ).to.equal( 'start "localGruntTask" cmd /k "C:\\targetPath & grunt localGruntTask"' );
            });

            it( 'will generate a Grunt statement using the alias path if an alias specified', function() {
                commands.grunt( 'gruntTaskFolder', 'otherGruntTask' );
                expect( getAliasStub.callCount ).to.equal( 1 );
                expect( targetPathStub.callCount ).to.equal( 0 );
                expect( prefixStub.callCount ).to.equal( 1 );
                expect( execStub.callCount ).to.equal( 1 );
                expect( execStub.args[ 0 ][ 0 ] ).to.equal( 'start "otherGruntTask" cmd /k "C:\\gruntTaskFolder & grunt otherGruntTask"' );

            });
        });

    });

    describe( 'gruntWithOptions', function() {
        describe( 'under failure conditions', function() {
            it( 'will throw an error if 0 or 1 argument(s) are passed', function() {
                expect( function() { commands.gruntWithOptions() } ).to.throw( Error, /This function requires at least two arguments/ );
                expect( throwErrorStub.callCount ).to.equal( 1 );
                expect( prefixStub.callCount ).to.equal( 0 );

                expect( function() { commands.gruntWithOptions( 'gruntTaskName') } ).to.throw( Error, /This function requires at least two arguments/ );
                expect( throwErrorStub.callCount ).to.equal( 2 );
                expect( prefixStub.callCount ).to.equal( 0 );
            });

            it( 'will throw an error if an alias set is used as the alias', function() {
                expect( function() { commands.gruntWithOptions( 'aliasSet', 'otherGruntTask', '--name:main.js' ) } ).to.throw( Error, /The specified alias is an alias set./ );
                expect( throwErrorStub.callCount ).to.equal( 1 );
                expect( prefixStub.callCount ).to.equal( 0 );
            });

        });

        describe( 'under success conditions', function() {

            it( 'will generate a Grunt statement including options using the target path if no alias specified', function() {
                commands.gruntWithOptions( 'localGruntTask', '--name:main.js' );
                expect( targetPathStub.callCount ).to.equal( 1 );
                expect( getAliasStub.callCount ).to.equal( 0 );
                expect( prefixStub.callCount ).to.equal( 1 );

                expect( execStub.callCount ).to.equal( 1 );
                expect( execStub.args[ 0 ][ 0 ] ).to.equal( 'start "localGruntTask" cmd /k "C:\\targetPath & grunt localGruntTask --name:main.js"' );
            });

            it( 'will generate a Grunt statement including options using the alias path if an alias specified', function() {
                commands.gruntWithOptions( 'gruntTaskFolder', 'otherGruntTask', '--name:main.js' );
                expect( getAliasStub.callCount ).to.equal( 1 );
                expect( targetPathStub.callCount ).to.equal( 0 );
                expect( prefixStub.callCount ).to.equal( 1 );

                expect( execStub.callCount ).to.equal( 1 );
                expect( execStub.args[ 0 ][ 0 ] ).to.equal( 'start "otherGruntTask" cmd /k "C:\\gruntTaskFolder & grunt otherGruntTask --name:main.js"' );
            });
        });

    });

});


text:
package org.yawni.util;

import org.junit.Test;
import static org.junit.Assert.*;

public class CharSequencesTest {
  @Test
  public void testHashCode() {
    assertEquals("1".hashCode(), CharSequences.hashCode(new StringBuilder("1")));
    assertEquals("-1557994400".hashCode(), CharSequences.hashCode(new StringBuilder("-1557994400")));
  }

//  @Test
//  public void testEquals() {
//  }
//
//  @Test
//  public void testStartsWith() {
//  }
//
//  @Test
//  public void testRegionMatches_5args() {
//  }
//
//  @Test
//  public void testRegionMatches_6args() {
//  }
//
//  @Test
//  public void testContainsUpper() {
//  }
//
//  @Test
//  public void testSameLetterDigitSequence() {
//  }
//
//  @Test
//  public void testParseInt_CharSequence_int() {
//  }
//
//  @Test
//  public void testParseInt_3args() {
//  }
//
//  @Test
//  public void testParseInt_4args() {
//  }
//
//  @Test
//  public void testParseLong_CharSequence_int() {
//  }
//
//  @Test
//  public void testParseLong_4args() {
//  }
//
//  @Test
//  public void testSubstring() {
//  }
}


text:
import sys
sys.path.append('/notebooks')

import wave
import struct
import glob
from mylibs import constants as con
from scipy import fromstring, int16
import numpy as np
import os.path
from keras.models import Sequential, load_model
from keras.layers import Dense, LSTM, Dropout
from keras.callbacks import Callback
from keras import backend as K

test_files = glob.glob('/data/input/*.wav')
test_files = test_files[0]

def get_dataset(filename):
    wavfile = filename
    wr = wave.open(wavfile, "rb")
    origin = wr.readframes(wr.getnframes())
    data = origin[:con.fr * 4 * 60]
    wr.close()
    X = np.frombuffer(data, dtype="int16")/ 32768.0
    X = np.reshape(X, (-1, con.fr // 2))
    #print(X.shape)
    #print(len(X))
    return X

model = load_model(con.model_encoder)

data = get_dataset(test_files)
res = []
for datum in data:
    res.append(model.predict(np.reshape(datum, (1, con.fr // 2))))

row_data = np.array(res)
mdata = np.reshape(res, (-1)) * 32768
mdata = mdata.astype('int16')
outf = '/data/output/test.wav'
outd = struct.pack("h" * len(mdata), *mdata)
ww = wave.open(outf, 'w')
ww.setnchannels(2)
ww.setsampwidth(2)
ww.setframerate(con.fr)
ww.writeframes(outd)
ww.close()


text:
%Notes by Harsh Mistry
%Stat231
%based on Template from : https://www.cs.cmu.edu/~ggordon/10725-F12/template.tex

\documentclass{article}
\setlength{\oddsidemargin}{0.25 in}
\setlength{\evensidemargin}{-0.25 in}
\setlength{\topmargin}{-0.6 in}
\setlength{\textwidth}{6.5 in}
\setlength{\textheight}{8.5 in}
\setlength{\headsep}{0.75 in}
\setlength{\parindent}{0 in}
\setlength{\parskip}{0.1 in}
\usepackage{amsfonts,graphicx, amssymb}
\usepackage[fleqn]{amsmath}
\usepackage{fixltx2e}
\usepackage{tikz}
\usepackage{color}
\usepackage{tcolorbox}
\usepackage{lipsum}
\usepackage{listings}
\usepackage{scrextend}
\tcbuselibrary{skins,breakable}
\usetikzlibrary{shadings,shadows}
\newcounter{lecnum}
\renewcommand{\thepage}{\thelecnum-\arabic{page}}
\renewcommand{\thesection}{\thelecnum.\arabic{section}}
\renewcommand{\theequation}{\thelecnum.\arabic{equation}}
\renewcommand{\thefigure}{\thelecnum.\arabic{figure}}
\renewcommand{\thetable}{\thelecnum.\arabic{table}}
\newcommand{\lecture}[4]{
   \pagestyle{myheadings}
   \thispagestyle{plain}
   \newpage
   \setcounter{lecnum}{#1}
   \setcounter{page}{1}

%Info Box
   \begin{center}
   \framebox{
      \vbox{\vspace{2mm}
    \hbox to 6.28in { {\bf Stat 231 - Statistics
	\hfill Spring 2017} }
       \vspace{4mm}
       \hbox to 6.28in { {\Large \hfill Lecture #1: #2  \hfill} }
       \vspace{2mm}
       \hbox to 6.28in { {\it Lecturer: #3 \hfill Notes By: #4} }
      \vspace{2mm}}
   }
   \end{center}

   \markboth{Lecture #1: #2}{Lecture #1: #2}

}

\renewcommand{\cite}[1]{[#1]}
\def\beginrefs{\begin{list}%
        {[\arabic{equation}]}{\usecounter{equation}
         \setlength{\leftmargin}{2.0truecm}\setlength{\labelsep}{0.4truecm}%
         \setlength{\labelwidth}{1.6truecm}}}
\def\endrefs{\end{list}}
\def\bibentry#1{\item[\hbox{[#1]}]}

\newcommand{\fig}[3]{
			\vspace{#2}
			\begin{center}
			Figure \thelecnum.#1:~#3
			\end{center}
	}

\newcommand{\pipe}{\(\mid\)}
\newcommand{\ctr}{\(\wedge\)}

\newtheorem{theorem}{Theorem}[lecnum]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{ex}[theorem]{Example}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newenvironment{proof}{{\bf Proof:}}{\hfill\rule{2mm}{2mm}}
\newcommand\E{\mathbb{E}}

%color definitions :
\definecolor{darkred}{rgb}{0.55, 0.0, 0.0}
\definecolor{lightcoral}{rgb}{0.94, 0.5, 0.5}
\definecolor{tomato}{rgb}{1.0, 0.39, 0.28}
\definecolor{lightgray}{rgb}{.9,.9,.9}
\definecolor{darkgray}{rgb}{.4,.4,.4}
\definecolor{purple}{rgb}{0.65, 0.12, 0.82}
\definecolor{lightgreen}{rgb}{0.56, 0.93, 0.56}
\definecolor{darkgreen}{rgb}{0.0, 0.2, 0.13}
\definecolor{limegreen}{rgb}{0.2, 0.8, 0.2}
\definecolor{lightblue}{rgb}{0.68, 0.85, 0.9}
\definecolor{darkblue}{rgb}{0.0, 0.0, 0.55}

%Environments
\newenvironment{exblock}[1]{%
    \tcolorbox[beamer,%
    noparskip,breakable,
    colback=lightgreen,colframe=darkgreen,%
    colbacklower=limegreen!75!lightgreen,%
    title=#1]}%
    {\endtcolorbox}

\newenvironment{ablock}[1]{%
    \tcolorbox[beamer,%
    noparskip,breakable,
    colback=lightcoral,colframe=darkred,%
    colbacklower=tomato!75!lightcoral,%
    title=#1]}%
    {\endtcolorbox}

\newenvironment{cblock}[1]{%
    \tcolorbox[beamer,%
    noparskip,breakable,
    colback=lightblue,colframe=darkblue,%
    colbacklower=darkblue!75!lightblue,%
    title=#1]}%
    {\endtcolorbox}

%Languages
\lstdefinelanguage{JavaScript}{
  keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break},
  keywordstyle=\color{blue}\bfseries,
  ndkeywords={class, export, boolean, throw, implements, import, this},
  ndkeywordstyle=\color{darkgray}\bfseries,
  identifierstyle=\color{black},
  sensitive=false,
  comment=[l]{//},
  morecomment=[s]{/*}{*/},
  commentstyle=\color{purple}\ttfamily,
  stringstyle=\color{red}\ttfamily,
  morestring=[b]',
  morestring=[b]"
}

%Listings
\lstset{
   language=JavaScript,
   backgroundcolor=\color{lightgray},
   extendedchars=true,
   basicstyle=\footnotesize\ttfamily,
   showstringspaces=false,
   showspaces=false,
   numbers=left,
   numberstyle=\footnotesize,
   numbersep=9pt,
   tabsize=2,
   breaklines=true,
   showtabs=false,
   captionpos=b
}

%Start
\begin{document}

\lecture{11, 12}{May 24th - 26th, 2017}{Suryapratim Banerjee}{Harsh Mistry}

\section*{Exponential Model}
\[Y_i \sim Exp(\gamma)  \]
\textbf{Density Function :}
\[f(y) = \frac{1}{\gamma}e^{-y / \gamma}\]
\textbf{Likelihood Function :}
\[L(\gamma) = \frac{1}{\gamma} e ^{-y_1 / \gamma} \cdot \ldots \cdot \frac{1}{y}e^{-y_n / \gamma} = \frac{1}{\gamma^n} e^{-\frac{1}{\gamma} \sum y_i}\]
\textbf{Log-Likelihood Function}
\[l(\gamma) = -n \ln \gamma - \frac{1}{\gamma} \sum y_i\]
\section*{Gaussian Distribution}
\[Y_i \sim G(\gamma, \sigma) \]
\[f(y) = \frac{1}{\sqrt{2\pi}  \sigma} e^{-\frac{1}{2 \sigma^2} (y - \gamma)^2}\]
\textbf{Likelihood Function :}
\[L(\gamma, \sigma) = \frac{1}{(2\pi)^{n/2}  \sigma^n } e^{-\frac{1}{2 \sigma^2} (y_i - \gamma)^2}\]
\textbf{Log-Likelihood Function}
\[l(\gamma, \sigma) =   \frac{-n}{2} \cdot \ln(2\pi) - n \ln  \sigma - \frac{1}{2 \sigma^2} \sum (y_i - \sigma)^2\]
\section*{Invariance Property Of The MLE}
If \(\hat{\theta}\) is the MLE for \(\theta\), then \(g(\hat{\theta})\) in the MLE for \(g(\theta)\) if g is continuous.
\section*{Uniform Distribution}
\[Y_i \sim  U[0, \theta] \]
\textbf{Density Function :}
\[f(y) = \begin{cases} \frac{1}{\theta}  & \text{ if } 0 \leq y \leq \theta \\ 0 & \text{elsewhere}\end{cases}\]
\textbf{Likelihood Function :}
\[L(\theta) = \begin{cases} \frac{1}{\theta^n} y  & \text{ if } 0 \leq y_i \leq \theta , \forall i \\
0 & \text{ if } \theta < max\{y_1, \ldots, y_n\} \end{cases} \]
\section{Model Selection}
Model : "Identify" the random variable from which \(\{y_1, \ldots, y_n\}\) is drawn

\subsection*{Subjective Tests}
We run numerical and graphical tests on the data to select the "right" model.
\subsubsection*{Numerical Tests}
\begin{itemize}
\item Check whether the data set satisfies the theoretical properties of the distributions assumed in your model
\end{itemize}
\subsubsection{Graphical Tools}
\begin{itemize}
\item Super impose the relative frequency histogram of your data set to the theoretical distirbution function assumed and see whether the shapes match
\end{itemize}

\subsubsection*{The Q-Q plot}
Typically used to check whether Gaussian is the "right mode"

\end{document}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using ClassWrapper;
using ConcurrencyHelpers.Coroutines;
using Node.Cs.Lib.Attributes;
using Node.Cs.Lib.Contexts;
using Node.Cs.Lib.Controllers;
using Node.Cs.Lib.Exceptions;
using Node.Cs.Lib.Filters;
using Node.Cs.Lib.Routing;
using Node.Cs.Lib.Utils;
using TB.ComponentModel;
using System.IO;
using Node.Cs.Lib.Loggers;

namespace Node.Cs.Lib.OnReceive
{
	public class ControllersManagerCoroutine : Coroutine, IControllersManagerCoroutine
	{
		public ControllersManagerCoroutine()
		{
			RouteInstanceParams = new Dictionary<string, object>();
		}

		public bool IsChildRequest { get; set; }
		//public ContextManager ContextManager { get; set; }
		public INodeCsContext Context { get; set; }
		public RouteInstance RouteDefintion { get; set; }
		public string LocalPath { get; set; }
		public Dictionary<string, object> ViewData { get; set; }
		public ISessionManager SessionManager { get; set; }
		public string ActionName { get; set; }
		public string ControllerName { get; set; }
		public Dictionary<string,object>  RouteInstanceParams { get; set; }

		protected void RunGlobalPostFilters(IResponse result)
		{
			if (IsChildRequest) return;
			foreach (var filter in GlobalVars.GlobalFilters)
			{
				filter.OnPostExecute((HttpContextBase)Context, result);
			}
		}

		/// <summary>
		/// Wait for completion and store the result into the container object
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="func"></param>
		/// <param name="result"></param>
		/// <returns></returns>
		protected virtual Step InvokeControllerAndWait<T>(Func<IEnumerable<T>> func, Container result = null)
		{
			if (typeof(T) != typeof(Step))
			{
				return InvokeLocalAndWait(() => MakeControllerEnumerable((IEnumerable)func()), result);
			}
			if (result == null) result = new Container();
			var enumerator = ((IEnumerable<Step>)func()).GetEnumerator();
			return Step.DataStep(new EnumeratorWrapper
			{
				Enum = enumerator,
				Result = result,
				Culture = System.Threading.Thread.CurrentThread.CurrentCulture
			});
		}

		private static IEnumerable<Step> MakeControllerEnumerable(IEnumerable enumerable)
		{
			foreach (var item in enumerable)
			{
				var stepItem = item as Step;
				var stepResponse = item as StepResponse;
				if (stepResponse != null)
				{
					stepItem = stepResponse.CalleStep;
				}

				if (item == null) yield return Step.Current;
				else if (stepItem == null) yield return Step.DataStep(item);
				else yield return stepItem;
			}
		}

		private IEnumerable<Step> EnumerateResponse(IEnumerable<IResponse> enumerableResult)
		{
			foreach (var item in enumerableResult)
			{
				var calleeStep = item as StepResponse;
				var itemStep = item as Step;
				if (calleeStep != null)
				{
					yield return calleeStep.CalleStep;
				}
				else if (itemStep != null)
				{
					yield return itemStep;
				}
				else
				{
					yield return Step.DataStep(item);
					yield break;
				}
			}
		}

		private bool TryInvoke(MethodWrapperDescriptor method,
			Dictionary<string, object> allParams,
			global::ClassWrapper.ClassWrapper controllerWrapper, bool hasConverter,
			HttpContextBase context, bool isChildRequest, out object methResult)
		{
			try
			{
				var request = context.Request;
				var parsValues = new List<object>();
				methResult = null;
				var methPars = method.Parameters.ToList();

				for (int index = 0; index < methPars.Count; index++)
				{
					bool parValueSet = false;
					var par = methPars[index];
					object valueToAdd = null;

					if (allParams.ContainsKey(par.Name))
					{
						var parValue = allParams[par.Name];
						if (parValue.GetType() != par.ParameterType)
						{
							object convertedValue;
							if (UniversalTypeConverter.TryConvert(parValue, par.ParameterType, out convertedValue))
							{
								valueToAdd = convertedValue;
								parValueSet = true;
							}
							else if (!par.HasDefault)
							{
								if (par.ParameterType.IsValueType)
								{
									return false;
								}
								parValueSet = true;
							}
						}
						else
						{
							valueToAdd = parValue;
							parValueSet = true;
						}

					}
					if (par.ParameterType == typeof(FormCollection))
					{
						parValueSet = true;
						valueToAdd = new FormCollection(context.Request.Form);
					}
					if (parValueSet == false && request.ContentType != null)
					{
						var parType = par.ParameterType;
						if (!parType.IsValueType &&
								!parType.IsArray &&
								!(parType == typeof(string)) &&
								!parType.IsEnum &&
								!(parType == typeof(object)))
						{
							try
							{
								valueToAdd = GlobalVars.ConversionService.Convert(parType, request.ContentType, request);
								parValueSet = true;
							}
							catch (Exception)
							{

							}
						}
					}
					if (par.HasDefault && !parValueSet)
					{
						parValueSet = true;
						valueToAdd = par.Default;
					}

					if (!parValueSet && string.Compare(par.Name, "returnUrl", StringComparison.OrdinalIgnoreCase) == 0)
					{
						if (request.UrlReferrer != null)
						{
							parValueSet = true;
							valueToAdd = request.UrlReferrer.ToString();
						}
					}

					if (!par.GetType().IsValueType && !parValueSet)
					{
						parValueSet = true;
						valueToAdd = null;
					}

					if (!parValueSet) return false;
					parsValues.Add(valueToAdd);
				}

				var attributes = new List<Attribute>(method.Attributes);
				foreach (var attribute in attributes)
				{
					var filter = attribute as IFilter;

					if (filter != null)
					{
						if (!filter.OnPreExecute(context))
						{
							methResult = NullResponse.Instance;
							return true;
						}
					}
					else if (attribute is ChildActionOnly && !isChildRequest)
					{
						throw new NodeCsException("Item not found '{0}'.", 404, Context.Request.Url.ToString());
					}
				}
				var msd = new ModelStateDictionary();
				foreach (var par in parsValues)
				{
					if (ValidationAttributesService.CanValidate(par))
					{
						ValidationAttributesService.ValidateModel(par, msd);
					}

				}
				controllerWrapper.Set("ModelState", msd);
				var result = controllerWrapper.TryInvoke(method, out methResult, parsValues.ToArray());
				if (result)
				{
					foreach (var attribute in attributes)
					{
						var filter = attribute as IFilter;
						if (filter != null)
						{
							filter.OnPostExecute(context, null);
						}
					}
				}
				return result;
			}
			catch (Exception)
			{
				Logger.Info("Not found suitable action for method '{0}'.", method.Name);
				methResult = null;
				return false;
			}
		}

		public IEnumerable<Step> HandleRoutedRequests(RouteInstance routeInstance, string localPath,
			INodeCsContext context, bool isChildRequest = false)
		{
			var verb = context.Request.HttpMethod;
			object methResult = null;

			if (!string.IsNullOrEmpty(ControllerName) &&
					!string.IsNullOrEmpty(ActionName))
			{

				var allParams = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
				foreach (var param in RouteInstanceParams)
				{
					allParams.Add(param.Key, param.Value);
				}
				foreach (var param in context.Request.QueryString.AllKeys)
				{
					if (param != null && !allParams.ContainsKey(param))
					{
						allParams.Add(param, context.Request.QueryString[param]);
					}
				}
				foreach (var param in context.Request.Form.AllKeys)
				{
					if (param != null && !allParams.ContainsKey(param))
					{
						allParams.Add(param, context.Request.Form[param]);
					}
				}

				var requestContentType = context.Request.ContentType;
				bool hasConverter = GlobalVars.ConversionService.HasConverter(requestContentType);

				var controller = (ControllerWrapperInstance)GlobalVars.ControllersFactoryHandler.Create(ControllerName + "Controller");
				if (controller == null)
				{
					throw new NodeCsException("Url '{0}' not found.",404,Context.Request.Url.ToString());
				}
				controller.Instance.Set("HttpContext", (HttpContextBase)context);

				var methods = controller.GetMethodGroup(ActionName, verb).ToList();

				bool methodInvoked = false;
				foreach (var method in methods)
				{
					if (TryInvoke(method, allParams, controller.Instance, hasConverter, (HttpContextBase)context, isChildRequest,
						out methResult))
					{
						methodInvoked = true;
						break;
					}
				}
				if (!methodInvoked)
				{
					throw new NodeCsException("Url '{0}' not found.", 404, Context.Request.Url.ToString());
				}

				var enumerableResult = methResult as IEnumerable<IResponse>;

				var result = new Container();
				yield return Coroutine.InvokeLocalAndWait(() => EnumerateResponse(enumerableResult), result);

				var typeofResponse = result.RawData.GetType();
				var responseHandler = GlobalVars.ResponseHandlers.Load(typeofResponse);
				var response = result.RawData as IResponse;
				if (responseHandler != null && response != null)
				{
					responseHandler.Handle(controller, context, response);
					yield return Step.DataStep(response);
				}
				else
				{
					yield return Step.DataStep(result.RawData);
				}

				if (controller != null)
				{
					GlobalVars.ControllersFactoryHandler.Release((IController)controller.Instance.Instance);
				}
				yield break;
			}
			throw new NodeCsException("Url '{0}' not found.", 404, Context.Request.Url.ToString());
		}

		public override IEnumerable<Step> Run()
		{

			var resultDate = new Container();
			yield return InvokeControllerAndWait(() =>
				HandleRoutedRequests(RouteDefintion, LocalPath, Context, IsChildRequest),
					resultDate);

			CheckException();

			var result = resultDate.RawData as IResponse;
			if (result != null)
			{
				RunGlobalPostFilters(result);
				var responseHandler = GlobalVars.ResponseHandlers.Load(result.GetType());
				yield return Step.Current;
				if (responseHandler != null)
				{
					//Its responsability to close connection
					var viewResult = result as IViewResponse;

					if (viewResult != null)
					{
						ViewData = viewResult.ViewData;

						if (!IsChildRequest)
						{
							Thread.AddCoroutine(BuildViewManager(viewResult));
						}
						else
						{
							yield return InvokeCoroutineAndWait(BuildViewManager(viewResult));
						}
					}
				}
				else
				{
					var dataResponse = result as DataResponse;
					if (dataResponse != null)
					{
						Context.Response.ContentType = dataResponse.ContentType;
						Context.Response.ContentEncoding = dataResponse.ContentEncoding;
						var output = Context.Response.OutputStream;;
						((IForcedHeadersResponse)Context.Response).SetContentLength(dataResponse.Data.Length);
#if !TESTHTTP
						yield return InvokeTaskAndWait(output.WriteAsync(dataResponse.Data, 0, dataResponse.Data.Length));
						if (!IsChildRequest)
						{
							output.Close();
						}
#else
						if (IsChildRequest)
						{
							yield return InvokeTaskAndWait(output.WriteAsync(dataResponse.Data, 0, dataResponse.Data.Length));
						}
						else
						{
							HttpSender.Send(output, dataResponse.Data, true);
						}
#endif
					}
					else
					{
						var codesManager = new HttpCodesManager();
						codesManager.Response = result as HttpCodeResponse;
						codesManager.Context = Context;
						codesManager.SessionManager = SessionManager;
						Thread.AddCoroutine(codesManager);
					}
				}

			}
			ShouldTerminate = true;
		}

		public IPagesManager PagesManager { get; set; }

		protected virtual ViewsManagerCoroutine BuildViewManager(IViewResponse viewResult)
		{
			var viewsManager = new ViewsManagerCoroutine();
			viewsManager.PagesManager = PagesManager;
			viewsManager.LocalPath = viewResult.View;
			viewsManager.ViewData = ViewData;
			viewsManager.IsChildRequest = IsChildRequest;
			viewsManager.Context = Context;
			viewsManager.SessionManager = SessionManager;
			viewsManager.ViewBag = viewResult.ViewBag;
			viewsManager.Model = viewResult.Model;
			viewsManager.ModelState = viewResult.ModelState;
			if (IsChildRequest)
			{
				viewsManager.StringBuilder = StringBuilder;
			}

			return viewsManager;
		}

		public override void OnError(Exception ex)
		{
			ShouldTerminate = true;
			GlobalVars.ExceptionManager.HandleException(ex, (HttpContextBase)Context);
			Context.Response.Close();
		}

		public void InitializeRouteInstance()
		{
			RouteInstanceParams = RouteDefintion.Parameters;
			if (RouteDefintion.Parameters.ContainsKey("controller"))
			{
				ControllerName = RouteDefintion.Parameters["controller"].ToString();
			}
			if (RouteDefintion.Parameters.ContainsKey("action"))
			{
				ActionName = RouteDefintion.Parameters["action"].ToString();
			}
		}

		public StringBuilder StringBuilder { get; set; }
	}
}


text:
. config
docker build -t $IMAGE ./src


text:
import { Filter } from '../../common/model';
import { getFilter } from '../../mongo/MongoFilterBuilder';

describe('MongoFilterBuilder.getFilter', () => {
  test('multiple contains filters on the different field results in a ANDed filter where the same field uses an in clause', () => {
    const filters: Filter[] = [
      getContainsFilter('make', 'val1'),
      getContainsFilter('make', 'val2'),
      getContainsFilter('model', 'val2'),
      getContainsFilter('site', 'val3'),
      getEqualsFilter('make', 'val4'),
    ];
    expect(getFilter(filters)).toEqual({
      $and: [
        {
          make: { $in: [/val1/i, /val2/i, 'val4'] },
        },
        {
          model: { $in: [/val2/i] },
        },
        {
          site: { $in: [/val3/i] },
        },
      ],
    });
  });
});

function getContainsFilter(field: string, value: string): Filter {
  return { field, operator: '~', value };
}

function getEqualsFilter(field: string, value: string): Filter {
  return { field, operator: '=', value };
}