text:
package org.apache.metron.rest.controller;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import java.util.Set;
import org.apache.metron.rest.RestException;
import org.apache.metron.rest.model.KafkaTopic;
import org.apache.metron.rest.service.KafkaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * The API resource that is use to interact with Kafka.
 */
@RestController
@RequestMapping("/api/v1/kafka")
public class KafkaController {

  /**
   * Service used to interact with Kafka.
   */
  @Autowired
  private KafkaService kafkaService;

  @ApiOperation(value = "Creates a new Kafka topic")
  @ApiResponses({
    @ApiResponse(message = "Returns saved Kafka topic", code = 200)
  })
  @RequestMapping(value = "/topic", method = RequestMethod.POST)
  ResponseEntity<KafkaTopic> save(final @ApiParam(name = "topic", value = "Kafka topic", required = true) @RequestBody KafkaTopic topic) throws RestException {
    return new ResponseEntity<>(kafkaService.createTopic(topic), HttpStatus.CREATED);
  }

  @ApiOperation(value = "Retrieves a Kafka topic")
  @ApiResponses(value = {
    @ApiResponse(message = "Returns Kafka topic", code = 200),
    @ApiResponse(message = "Kafka topic is missing", code = 404)
  })
  @RequestMapping(value = "/topic/{name}", method = RequestMethod.GET)
  ResponseEntity<KafkaTopic> get(final @ApiParam(name = "name", value = "Kafka topic name", required = true) @PathVariable String name) throws RestException {
    KafkaTopic kafkaTopic = kafkaService.getTopic(name);
    if (kafkaTopic != null) {
      return new ResponseEntity<>(kafkaTopic, HttpStatus.OK);
    } else {
      return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }
  }

  @ApiOperation(value = "Retrieves all Kafka topics")
  @ApiResponses({
    @ApiResponse(message = "Returns a list of all Kafka topics", code = 200)
  })
  @RequestMapping(value = "/topic", method = RequestMethod.GET)
  ResponseEntity<Set<String>> list() throws Exception {
    return new ResponseEntity<>(kafkaService.listTopics(), HttpStatus.OK);
  }

  @ApiOperation(value = "Deletes a Kafka topic")
  @ApiResponses(value = {
    @ApiResponse(message = "Kafka topic was deleted", code = 200),
    @ApiResponse(message = "Kafka topic is missing", code = 404)
  })
  @RequestMapping(value = "/topic/{name}", method = RequestMethod.DELETE)
  ResponseEntity<Void> delete(final @ApiParam(name = "name", value = "Kafka topic name", required = true) @PathVariable String name) throws RestException {
    if (kafkaService.deleteTopic(name)) {
      return new ResponseEntity<>(HttpStatus.OK);
    } else {
      return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }
  }

  @ApiOperation(value = "Retrieves a sample message from a Kafka topic using the most recent offset")
  @ApiResponses(value = {
    @ApiResponse(message = "Returns sample message", code = 200),
    @ApiResponse(message = "Either Kafka topic is missing or contains no messages", code = 404)
  })
  @RequestMapping(value = "/topic/{name}/sample", method = RequestMethod.GET)
  ResponseEntity<String> getSample(final @ApiParam(name = "name", value = "Kafka topic name", required = true) @PathVariable String name) throws RestException {
    String sampleMessage = kafkaService.getSampleMessage(name);
    if (sampleMessage != null) {
      return new ResponseEntity<>(sampleMessage, HttpStatus.OK);
    } else {
      return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }
  }

  @ApiOperation(value = "Produces a message to a Kafka topic")
  @ApiResponses(value = {
      @ApiResponse(message = "Message produced successfully", code = 200)
  })
  @RequestMapping(value = "/topic/{name}/produce", method = RequestMethod.POST)
  ResponseEntity<String> produce(final @ApiParam(name = "name", value = "Kafka topic name", required = true) @PathVariable String name,
      final @ApiParam(name = "message", value = "Message", required = true) @RequestBody String message) throws RestException {
    kafkaService.produceMessage(name, message);
    return new ResponseEntity<>(HttpStatus.OK);
  }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using Orleans.Streams;

namespace Orleans.Configuration
{
    public class StreamLifecycleOptions
    {
        [Serializable]
        public enum RunState
        {
            None,
            Initialized,
            AgentsStarted,
            AgentsStopped,
        }

        public RunState StartupState = DEFAULT_STARTUP_STATE;
        public const RunState DEFAULT_STARTUP_STATE = RunState.AgentsStarted;

        public int InitStage { get; set; } = DEFAULT_INIT_STAGE;
        public const int DEFAULT_INIT_STAGE = ServiceLifecycleStage.ApplicationServices;

        public int StartStage { get; set; } = DEFAULT_START_STAGE;
        public const int DEFAULT_START_STAGE = ServiceLifecycleStage.Active;
    }

    public class StreamPubSubOptions
    {
        public StreamPubSubType PubSubType { get; set; } = DEFAULT_STREAM_PUBSUB_TYPE;
        public const StreamPubSubType DEFAULT_STREAM_PUBSUB_TYPE = StreamPubSubType.ExplicitGrainBasedAndImplicit;
    }

    public class StreamPullingAgentOptions
    {
        public TimeSpan GetQueueMsgsTimerPeriod { get; set; } = DEFAULT_GET_QUEUE_MESSAGES_TIMER_PERIOD;
        public static readonly TimeSpan DEFAULT_GET_QUEUE_MESSAGES_TIMER_PERIOD = TimeSpan.FromMilliseconds(100);

        public TimeSpan InitQueueTimeout { get; set; } = DEFAULT_INIT_QUEUE_TIMEOUT;
        public static readonly TimeSpan DEFAULT_INIT_QUEUE_TIMEOUT = TimeSpan.FromSeconds(5);

        public TimeSpan MaxEventDeliveryTime { get; set; } = DEFAULT_MAX_EVENT_DELIVERY_TIME;
        public static readonly TimeSpan DEFAULT_MAX_EVENT_DELIVERY_TIME = TimeSpan.FromMinutes(1);

        public TimeSpan StreamInactivityPeriod { get; set; } = DEFAULT_STREAM_INACTIVITY_PERIOD;
        public static readonly TimeSpan DEFAULT_STREAM_INACTIVITY_PERIOD = TimeSpan.FromMinutes(30);
    }
}


text:
import { Injectable } from '@angular/core';
import { List } from 'linqts';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';

import { Station, Disruption } from './shared/hsp-core.model';

const STATIONS_URL = '/api/resources/stations';
const DISRUPTIONS_URL = '/api/resources/disruptions';

@Injectable()
export abstract class ResourceService {
  protected stations: Subject<List<Station>> = new BehaviorSubject<List<Station>>(new List<Station>());
  protected disruptions: Subject<List<Disruption>> = new BehaviorSubject<List<Disruption>>(new List<Disruption>());

  public getStations(): Observable<List<Station>> {
    return this.stations.map(stations => stations.DistinctBy(station => station.code));
  }

  public lookupStation(code: string): Observable<Station> {
    return this.stations.map(stations => stations.FirstOrDefault(station => (station.code === code)));
  }

  public lookupDisruption(code: number): Observable<Disruption> {
    return this.disruptions.map(disruptions => disruptions.FirstOrDefault(disruption => (disruption.code === code)));
  }
}

@Injectable()
export class HttpResourceService extends ResourceService {
    constructor(private http: HttpClient) {
      super();

      // Assign stations with a http result
      this.http.get<any>(STATIONS_URL).subscribe((response: Array<any>) => {
        this.stations.next(new List<Station>(response).OrderBy(station => station.text));
      });

      // Assign disruptions with a http result
      this.http.get(DISRUPTIONS_URL).subscribe((response: Array<any>) => {
        this.disruptions.next(new List<Disruption>(response));
      });
    }
}


text:
<?php

use Dibi\Type;

/**
 * This class is static container class for creating DB objects and
 * store connections info.
 */
class dibi
{
	use Dibi\Strict;

	const
		AFFECTED_ROWS = 'a',
		IDENTIFIER = 'n';

	/** version */
	const
		VERSION = '3.0.7',
		REVISION = 'released on 2017-01-04';

	/** sorting order */
	const
		ASC = 'ASC',
		DESC = 'DESC';

	/** @deprecated */
	const
		TEXT = Type::TEXT,
		BINARY = Type::BINARY,
		BOOL = Type::BOOL,
		INTEGER = Type::INTEGER,
		FLOAT = Type::FLOAT,
		DATE = Type::DATE,
		DATETIME = Type::DATETIME,
		TIME = Type::TIME,
		FIELD_TEXT = Type::TEXT,
		FIELD_BINARY = Type::BINARY,
		FIELD_BOOL = Type::BOOL,
		FIELD_INTEGER = Type::INTEGER,
		FIELD_FLOAT = Type::FLOAT,
		FIELD_DATE = Type::DATE,
		FIELD_DATETIME = Type::DATETIME,
		FIELD_TIME = Type::TIME;

	/** @var Dibi\Connection[]  Connection registry storage for DibiConnection objects */
	private static $registry = [];

	/** @var Dibi\Connection  Current connection */
	private static $connection;

	/** @var string  Last SQL command @see dibi::query() */
	public static $sql;

	/** @var int  Elapsed time for last query */
	public static $elapsedTime;

	/** @var int  Elapsed time for all queries */
	public static $totalTime;

	/** @var int  Number or queries */
	public static $numOfQueries = 0;

	/** @var string  Default dibi driver */
	public static $defaultDriver = 'mysqli';

	/**
	 * Static class - cannot be instantiated.
	 */
	final public function __construct()
	{
		throw new LogicException('Cannot instantiate static class ' . get_class($this));
	}

	/********************* connections handling ****************d*g**/

	/**
	 * Creates a new Connection object and connects it to specified database.
	 * @param  mixed   connection parameters
	 * @param  string  connection name
	 * @return Dibi\Connection
	 * @throws Dibi\Exception
	 */
	public static function connect($config = [], $name = 0)
	{
		return self::$connection = self::$registry[$name] = new Dibi\Connection($config, $name);
	}

	/**
	 * Disconnects from database (doesn't destroy Connection object).
	 * @return void
	 */
	public static function disconnect()
	{
		self::getConnection()->disconnect();
	}

	/**
	 * Returns TRUE when connection was established.
	 * @return bool
	 */
	public static function isConnected()
	{
		return (self::$connection !== NULL) && self::$connection->isConnected();
	}

	/**
	 * Retrieve active connection.
	 * @param  string   connection registy name
	 * @return Dibi\Connection
	 * @throws Dibi\Exception
	 */
	public static function getConnection($name = NULL)
	{
		if ($name === NULL) {
			if (self::$connection === NULL) {
				throw new Dibi\Exception('Dibi is not connected to database.');
			}

			return self::$connection;
		}

		if (!isset(self::$registry[$name])) {
			throw new Dibi\Exception("There is no connection named '$name'.");
		}

		return self::$registry[$name];
	}

	/**
	 * Sets connection.
	 * @param  Dibi\Connection
	 * @return Dibi\Connection
	 */
	public static function setConnection(Dibi\Connection $connection)
	{
		return self::$connection = $connection;
	}

	/**
	 * @deprecated
	 */
	public static function activate($name)
	{
		trigger_error(__METHOD__ . '() is deprecated.', E_USER_DEPRECATED);
		self::$connection = self::getConnection($name);
	}

	/********************* monostate for active connection ****************d*g**/

	/**
	 * Generates and executes SQL query - Monostate for Dibi\Connection::query().
	 * @param  array|mixed      one or more arguments
	 * @return Dibi\Result|int   result set object (if any)
	 * @throws Dibi\Exception
	 */
	public static function query($args)
	{
		$args = func_get_args();
		return self::getConnection()->query($args);
	}

	/**
	 * Executes the SQL query - Monostate for Dibi\Connection::nativeQuery().
	 * @param  string           SQL statement.
	 * @return Dibi\Result|int   result set object (if any)
	 */
	public static function nativeQuery($sql)
	{
		return self::getConnection()->nativeQuery($sql);
	}

	/**
	 * Generates and prints SQL query - Monostate for Dibi\Connection::test().
	 * @param  array|mixed  one or more arguments
	 * @return bool
	 */
	public static function test($args)
	{
		$args = func_get_args();
		return self::getConnection()->test($args);
	}

	/**
	 * Generates and returns SQL query as DataSource - Monostate for Dibi\Connection::test().
	 * @param  array|mixed      one or more arguments
	 * @return Dibi\DataSource
	 */
	public static function dataSource($args)
	{
		$args = func_get_args();
		return self::getConnection()->dataSource($args);
	}

	/**
	 * Executes SQL query and fetch result - Monostate for Dibi\Connection::query() & fetch().
	 * @param  array|mixed    one or more arguments
	 * @return Dibi\Row
	 * @throws Dibi\Exception
	 */
	public static function fetch($args)
	{
		$args = func_get_args();
		return self::getConnection()->query($args)->fetch();
	}

	/**
	 * Executes SQL query and fetch results - Monostate for Dibi\Connection::query() & fetchAll().
	 * @param  array|mixed    one or more arguments
	 * @return Dibi\Row[]
	 * @throws Dibi\Exception
	 */
	public static function fetchAll($args)
	{
		$args = func_get_args();
		return self::getConnection()->query($args)->fetchAll();
	}

	/**
	 * Executes SQL query and fetch first column - Monostate for Dibi\Connection::query() & fetchSingle().
	 * @param  array|mixed    one or more arguments
	 * @return string
	 * @throws Dibi\Exception
	 */
	public static function fetchSingle($args)
	{
		$args = func_get_args();
		return self::getConnection()->query($args)->fetchSingle();
	}

	/**
	 * Executes SQL query and fetch pairs - Monostate for Dibi\Connection::query() & fetchPairs().
	 * @param  array|mixed    one or more arguments
	 * @return array
	 * @throws Dibi\Exception
	 */
	public static function fetchPairs($args)
	{
		$args = func_get_args();
		return self::getConnection()->query($args)->fetchPairs();
	}

	/**
	 * Gets the number of affected rows.
	 * Monostate for Dibi\Connection::getAffectedRows()
	 * @return int  number of rows
	 * @throws Dibi\Exception
	 */
	public static function getAffectedRows()
	{
		return self::getConnection()->getAffectedRows();
	}

	/**
	 * Gets the number of affected rows. Alias for getAffectedRows().
	 * @return int  number of rows
	 * @throws Dibi\Exception
	 */
	public static function affectedRows()
	{
		return self::getConnection()->getAffectedRows();
	}

	/**
	 * Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
	 * Monostate for Dibi\Connection::getInsertId()
	 * @param  string     optional sequence name
	 * @return int
	 * @throws Dibi\Exception
	 */
	public static function getInsertId($sequence = NULL)
	{
		return self::getConnection()->getInsertId($sequence);
	}

	/**
	 * Retrieves the ID generated for an AUTO_INCREMENT column. Alias for getInsertId().
	 * @param  string     optional sequence name
	 * @return int
	 * @throws Dibi\Exception
	 */
	public static function insertId($sequence = NULL)
	{
		return self::getConnection()->getInsertId($sequence);
	}

	/**
	 * Begins a transaction - Monostate for Dibi\Connection::begin().
	 * @param  string  optional savepoint name
	 * @return void
	 * @throws Dibi\Exception
	 */
	public static function begin($savepoint = NULL)
	{
		self::getConnection()->begin($savepoint);
	}

	/**
	 * Commits statements in a transaction - Monostate for Dibi\Connection::commit($savepoint = NULL).
	 * @param  string  optional savepoint name
	 * @return void
	 * @throws Dibi\Exception
	 */
	public static function commit($savepoint = NULL)
	{
		self::getConnection()->commit($savepoint);
	}

	/**
	 * Rollback changes in a transaction - Monostate for Dibi\Connection::rollback().
	 * @param  string  optional savepoint name
	 * @return void
	 * @throws Dibi\Exception
	 */
	public static function rollback($savepoint = NULL)
	{
		self::getConnection()->rollback($savepoint);
	}

	/**
	 * Gets a information about the current database - Monostate for Dibi\Connection::getDatabaseInfo().
	 * @return Dibi\Reflection\Database
	 */
	public static function getDatabaseInfo()
	{
		return self::getConnection()->getDatabaseInfo();
	}

	/**
	 * Import SQL dump from file - extreme fast!
	 * @param  string  filename
	 * @return int  count of sql commands
	 */
	public static function loadFile($file)
	{
		return Dibi\Helpers::loadFromFile(self::getConnection(), $file);
	}

	/********************* fluent SQL builders ****************d*g**/

	/**
	 * @return Dibi\Fluent
	 */
	public static function command()
	{
		return self::getConnection()->command();
	}

	/**
	 * @param  string    column name
	 * @return Dibi\Fluent
	 */
	public static function select($args)
	{
		$args = func_get_args();
		return call_user_func_array([self::getConnection(), 'select'], $args);
	}

	/**
	 * @param  string   table
	 * @param  array
	 * @return Dibi\Fluent
	 */
	public static function update($table, $args)
	{
		return self::getConnection()->update($table, $args);
	}

	/**
	 * @param  string   table
	 * @param  array
	 * @return Dibi\Fluent
	 */
	public static function insert($table, $args)
	{
		return self::getConnection()->insert($table, $args);
	}

	/**
	 * @param  string   table
	 * @return Dibi\Fluent
	 */
	public static function delete($table)
	{
		return self::getConnection()->delete($table);
	}

	/********************* substitutions ****************d*g**/

	/**
	 * Returns substitution hashmap - Monostate for Dibi\Connection::getSubstitutes().
	 * @return Dibi\HashMap
	 */
	public static function getSubstitutes()
	{
		return self::getConnection()->getSubstitutes();
	}

	/********************* misc tools ****************d*g**/

	/**
	 * Prints out a syntax highlighted version of the SQL command or Result.
	 * @param  string|Result
	 * @param  bool  return output instead of printing it?
	 * @return string
	 */
	public static function dump($sql = NULL, $return = FALSE)
	{
		return Dibi\Helpers::dump($sql, $return);
	}

}


text:
"use strict";
function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
require('reflect-metadata');
__export(require('./Collection.decorator'));
__export(require('./Model.decorator'));
__export(require('./Type.decorator'));
__export(require('./Subschema.decorator'));
__export(require('./Default.decorator'));
__export(require('./Index.decorator'));
__export(require('./Populate.decorator'));
__export(require('./QueryHelper.decorator'));
__export(require('./SchemaOptions.decorator'));
__export(require('./Subschema.decorator'));
//# sourceMappingURL=index.js.map


text:
#if !defined(XALAN_ELEMDECIMALFORMAT_HEADER_GUARD)
#define XALAN_ELEMDECIMALFORMAT_HEADER_GUARD

// Base include file.  Must be first.
#include "XSLTDefinitions.hpp"

// Base class header file.
#include "ElemTemplateElement.hpp"

#include <xalanc/PlatformSupport/XalanDecimalFormatSymbols.hpp>

XALAN_CPP_NAMESPACE_BEGIN

class XPath;

class ElemDecimalFormat : public ElemTemplateElement
{
public:

    /**
     * Construct an object corresponding to a decimal-format element
     *
     * @param constructionContext context for construction of object
     * @param stylesheetTree      stylesheet containing element
     * @param atts                list of attributes for element
     * @param lineNumber                line number in document
     * @param columnNumber          column number in document
     */
    ElemDecimalFormat(
            StylesheetConstructionContext&  constructionContext,
            Stylesheet&                     stylesheetTree,
            const AttributeListType&        atts,
            XalanFileLoc                    lineNumber,
            XalanFileLoc                    columnNumber);

    ~ElemDecimalFormat();

    // These methods are inherited from ElemTemplateElement ...

    virtual const XalanDOMString&
    getElementName() const;

    const XalanDecimalFormatSymbols&
    getDecimalFormatSymbols() const
    {
        return m_decimalFormatSymbols;
    }

    const XalanQName&
    getQName() const
    {
        assert(m_qname != 0);

        return *m_qname;
    }

    virtual const XPath*
    getXPath(XalanSize_t    index) const;

private:

    const XPath*                m_countMatchPattern;
    const XPath*                m_fromMatchPattern;
    const XPath*                m_valueExpr;

    const XalanQName*           m_qname;

    XalanDecimalFormatSymbols   m_decimalFormatSymbols;
};

XALAN_CPP_NAMESPACE_END

#endif  // XALAN_ELEMEMPTY_HEADER_GUARD


text:
import { compile } from 'ember-template-compiler';
import { ENV } from '@ember/-internals/environment';
import AbstractTestCase from './abstract';
import { runDestroy } from '../run';

export default class AbstractApplicationTestCase extends AbstractTestCase {
  _ensureInstance(bootOptions) {
    if (this._applicationInstancePromise) {
      return this._applicationInstancePromise;
    }

    return (this._applicationInstancePromise = this.runTask(() => this.application.boot()).then(
      app => {
        this.applicationInstance = app.buildInstance();

        return this.applicationInstance.boot(bootOptions);
      }
    ));
  }

  visit(url, options) {
    // TODO: THIS IS HORRIBLE
    // the promise returned by `ApplicationInstance.protoype.visit` does **not**
    // currently guarantee rendering is completed
    return this.runTask(() => {
      return this._ensureInstance(options).then(instance => instance.visit(url));
    });
  }

  get element() {
    if (this._element) {
      return this._element;
    } else if (ENV._APPLICATION_TEMPLATE_WRAPPER) {
      return (this._element = document.querySelector('#qunit-fixture > div.ember-view'));
    } else {
      return (this._element = document.querySelector('#qunit-fixture'));
    }
  }

  set element(element) {
    this._element = element;
  }

  afterEach() {
    runDestroy(this.applicationInstance);
    runDestroy(this.application);

    super.teardown();
  }

  get applicationOptions() {
    return {
      rootElement: '#qunit-fixture',
    };
  }

  get routerOptions() {
    return {
      location: 'none',
    };
  }

  get router() {
    return this.application.resolveRegistration('router:main');
  }

  compile(/* string, options */) {
    return compile(...arguments);
  }
}


text:
using System.Collections.Generic;
using System.Linq;
using MathNet.Numerics.Statistics;
using QuantConnect.Data;
using QuantConnect.Data.UniverseSelection;

package com.quantconnect.lean.Algorithm
{
    /**
     * Provides helpers for defining universes based on the daily dollar volume
    */
    public class DollarVolumeUniverseDefinitions
    {
        private final QCAlgorithm _algorithm;

        /**
         * Initializes a new instance of the <see cref="DollarVolumeUniverseDefinitions"/> class
        */
         * @param algorithm The algorithm instance, used for obtaining the default <see cref="UniverseSettings"/>
        public DollarVolumeUniverseDefinitions(QCAlgorithm algorithm) {
            _algorithm = algorithm;
        }

        /**
         * Creates a new coarse universe that contains the top count of stocks
         * by daily dollar volume
        */
         * @param count The number of stock to select
         * @param universeSettings The settings for stocks added by this universe.
         * Defaults to <see cref="QCAlgorithm.UniverseSettings"/>
        @returns A new coarse universe for the top count of stocks by dollar volume
        public Universe Top(int count, UniverseSettings universeSettings = null ) {
            universeSettings = universeSettings ?? _algorithm.UniverseSettings;
            symbol = CoarseFundamental.CreateUniverseSymbol(Market.USA);
            config = new SubscriptionDataConfig(typeof(CoarseFundamental), symbol, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, true);
            return new FuncUniverse(config, universeSettings, _algorithm.SecurityInitializer, selectionData -> (
                from c in selectionData.OfType<CoarseFundamental>()
                orderby c.DollarVolume descending
                select c.Symbol).Take(count)
                );
        }

        /**
         * Creates a new coarse universe that contains the bottom count of stocks
         * by daily dollar volume
        */
         * @param count The number of stock to select
         * @param universeSettings The settings for stocks added by this universe.
         * Defaults to <see cref="QCAlgorithm.UniverseSettings"/>
        @returns A new coarse universe for the bottom count of stocks by dollar volume
        public Universe Bottom(int count, UniverseSettings universeSettings = null ) {
            universeSettings = universeSettings ?? _algorithm.UniverseSettings;
            symbol = CoarseFundamental.CreateUniverseSymbol(Market.USA);
            config = new SubscriptionDataConfig(typeof(CoarseFundamental), symbol, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, true);
            return new FuncUniverse(config, universeSettings, _algorithm.SecurityInitializer, selectionData -> (
                from c in selectionData.OfType<CoarseFundamental>()
                orderby c.DollarVolume descending
                select c.Symbol).Take(count)
                );
        }

        /**
         * Creates a new coarse universe that contains stocks in the specified
         * dollar volume percentile
        */
         * @param percentile The desired dollar volume percentile (0 to 100 inclusive)
         * @param universeSettings The settings for stocks added by this universe.
         * Defaults to <see cref="QCAlgorithm.UniverseSettings"/>
        @returns A new coarse universe for the bottom count of stocks by dollar volume
        public Universe Percentile(double percentile, UniverseSettings universeSettings = null ) {
            universeSettings = universeSettings ?? _algorithm.UniverseSettings;
            symbol = CoarseFundamental.CreateUniverseSymbol(Market.USA);
            config = new SubscriptionDataConfig(typeof(CoarseFundamental), symbol, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, true);
            return new FuncUniverse(config, universeSettings, _algorithm.SecurityInitializer, selectionData =>
            {
                list = selectionData as IReadOnlyList<CoarseFundamental> ?? selectionData.OfType<CoarseFundamental>().ToList();

                // using quantiles since the Percentile implementation requires integers, so scale into quantile space
                lowerBound = (decimal)list.Select(x -> (double)x.DollarVolume).Quantile(percentile / 100d);

                return from c in list
                       where c.DollarVolume >= lowerBound
                       orderby c.DollarVolume descending
                       select c.Symbol;
            });
        }

        /**
         * Creates a new coarse universe that contains stocks in the specified dollar volume percentile range,
         * that is, this universe will produce stocks with dollar volumes between the lower percentile bound
         * and the upper percentile bound
        */
         * @param lowerPercentile The desired lower dollar volume  percentile bound (0 to 100 inclusive)
         * @param upperPercentile The desired upper dollar volume  percentile bound (0 to 100 inclusive)
         * @param universeSettings The settings for stocks added by this universe.
         * Defaults to <see cref="QCAlgorithm.UniverseSettings"/>
        @returns A new coarse universe for the bottom count of stocks by dollar volume
        public Universe Percentile(double lowerPercentile, double upperPercentile, UniverseSettings universeSettings = null ) {
            universeSettings = universeSettings ?? _algorithm.UniverseSettings;
            symbol = CoarseFundamental.CreateUniverseSymbol(Market.USA);
            config = new SubscriptionDataConfig(typeof(CoarseFundamental), symbol, Resolution.Daily, TimeZones.NewYork, TimeZones.NewYork, false, false, true);
            return new FuncUniverse(config, universeSettings, _algorithm.SecurityInitializer, selectionData =>
            {
                list = selectionData as IReadOnlyList<CoarseFundamental> ?? selectionData.OfType<CoarseFundamental>().ToList();

                // using quantiles since the Percentile implementation requires integers, so scale into quantile space
                lowerBound = (decimal) list.Select(x -> (double) x.DollarVolume).Quantile(lowerPercentile/100d);
                upperBound = (decimal) list.Select(x -> (double) x.DollarVolume).Quantile(upperPercentile/100d);

                return from c in list
                       where c.DollarVolume >= lowerBound
                       where c.DollarVolume <= upperBound
                       orderby c.DollarVolume descending
                       select c.Symbol;
            });
        }
    }
}


text:
<?php
namespace AndreasWolf\DebuggerClient\Streams;
use AndreasWolf\DebuggerClient\Core\Bootstrap;
use AndreasWolf\DebuggerClient\Event\StreamEvent;

/**
 * Wraps a listening stream that reacts to new connections.
 *
 * When a new connection is encountered, it is accepted, a stream wrapper is created and other components are notified.
 *
 * @author Andreas Wolf <aw@foundata.net>
 */
class ConnectionListener implements StreamDataHandler {

	/**
	 * @var StreamWrapper
	 */
	protected $wrapper;

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

	/**
	 * Handles an incoming connection by accepting it and wrapping the new stream appropriately.
	 *
	 * To get notified for new events, listen to the "stream.connection.opened" event.
	 */
	public function handleIncomingData() {
		$dataStream = stream_socket_accept($this->wrapper->getStream());
		$streamWrapper = new DebuggerEngineStream($dataStream);

		$event = new StreamEvent($streamWrapper);
		Bootstrap::getInstance()->getEventDispatcher()->dispatch('stream.connection.opened', $event);
	}

}


text:
package org.jgroups.tests.helpers;

import org.jboss.byteman.rule.Rule;
import org.jboss.byteman.rule.helper.Helper;
import org.jgroups.Event;
import org.jgroups.JChannel;
import org.jgroups.Message;
import org.jgroups.protocols.UNICAST3;

/**
 * @author Bela Ban
 * @since 3.3
 */
public class MessageBeforeConnectedTestHelper extends Helper {

    protected MessageBeforeConnectedTestHelper(Rule rule) {
        super(rule);
    }

    /**
     * Sends a unicast message up UNICAST2
     */
    public void sendUnicast(JChannel ch) throws Exception {
        final Message msg=new Message(ch.getAddress(), ch.getAddress(), "hello-1");

        // Add a UNICAST2 header
        final UNICAST3 unicast=(UNICAST3)ch.getProtocolStack().findProtocol(UNICAST3.class);
        UNICAST3.Header hdr=UNICAST3.Header.createDataHeader(1, (short)1, true);
        msg.putHeader(unicast.getId(), hdr);

        new Thread() {
            public void run() {
                unicast.up(new Event(Event.MSG, msg));
            }
        }.start();
    }

}


text:
/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
"use strict";
const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
const ConstDependency = require("./dependencies/ConstDependency");
const UnsupportedFeatureWarning = require("./UnsupportedFeatureWarning");

const ParserHelpers = exports;

ParserHelpers.addParsedVariableToModule = function(parser, name, expression) {
	if(!parser.state.current.addVariable) return false;
	var deps = [];
	parser.parse(expression, {
		current: {
			addDependency: function(dep) {
				dep.userRequest = name;
				deps.push(dep);
			}
		},
		module: parser.state.module
	});
	parser.state.current.addVariable(name, expression, deps);
	return true;
};

ParserHelpers.toConstantDependency = function(value) {
	return function constDependency(expr) {
		var dep = new ConstDependency(value, expr.range);
		dep.loc = expr.loc;
		this.state.current.addDependency(dep);
		return true;
	};
};

ParserHelpers.evaluateToString = function(value) {
	return function stringExpression(expr) {
		return new BasicEvaluatedExpression().setString(value).setRange(expr.range);
	};
};

ParserHelpers.evaluateToBoolean = function(value) {
	return function booleanExpression(expr) {
		return new BasicEvaluatedExpression().setBoolean(value).setRange(expr.range);
	};
};

ParserHelpers.expressionIsUnsupported = function(message) {
	return function unsupportedExpression(expr) {
		var dep = new ConstDependency("(void 0)", expr.range);
		dep.loc = expr.loc;
		this.state.current.addDependency(dep);
		if(!this.state.module) return;
		this.state.module.warnings.push(new UnsupportedFeatureWarning(this.state.module, message));
		return true;
	};
};

ParserHelpers.skipTraversal = function skipTraversal() {
	return true;
};

ParserHelpers.approve = function approve() {
	return true;
};


text:
								<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Title

								<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>

								<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Eliminar Integrante

							  <?php echo form_open(site_url("Integrante/deleteItem/".$userdata['idGrupo']), array("class" => "form-horizontal")) ?>

Esta seguro que desea eliminar el integrante?

									<input type="hidden" class="form-control" name="idPersona" id="idPersona" value="0" />

								<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
								<input type="submit" class="btn btn-primary" value="Eliminar Integrante">

							<?php echo form_close() ?>

								<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Pasar integrante a Inactivos

							  <?php echo form_open(site_url("Integrante/archiveItem/".$userdata['idGrupo']), array("class" => "form-horizontal")) ?>

Esta seguro que desea pasar el integrante como inactivo?

									<input type="hidden" class="form-control" name="idPersona" id="idPersona" value="0" />

												Razón del cambio:
												<textarea class="form-control" name="razonCambio" id="message-text"></textarea>

								<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
								<input type="submit" class="btn btn-primary" value="Inactivar Integrante">

							<?php echo form_close() ?>

	<?php if (isset($mobile) && $mobile): ?>

	<?php else: ?>

	<?php endif; ?>


text:
package com.yahoo.maven.visitor;

import java.io.Writer;

public interface TemplateMerger {

    void merge(Writer writer, Object context);

}


text:
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Windows.Media;
using Newtonsoft.Json;
using Noterium.Core.Annotations;

namespace Noterium.Core.DataCarriers
{
    public class Tag : INotifyPropertyChanged, IComparable, IComparable<Tag>, IEquatable<Tag>
    {
        private Color _color;
        private int _instances;
        private string _name;

        public Tag()
        {
            _color = Color.FromArgb(204, 17, 158, 218);
        }

        [DataMember]
        public string Name
        {
            get => _name;
            set
            {
                if (_name == null)
                    _name = value.ToLower();
                else
                    throw new NotSupportedException("Cant change name of a tag.");
            }
        }

        [DataMember]
        public Color Color
        {
            get => _color;
            set
            {
                _color = value;
                OnPropertyChanged();
            }
        }

        [JsonProperty("instances", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
        [DefaultValue(0)]
        [DataMember]
        public int Instances
        {
            get => _instances;
            set
            {
                _instances = value;
                OnPropertyChanged();
            }
        }

        public int CompareTo(object obj)
        {
            return string.Compare(Name, ((Tag) obj).Name, StringComparison.CurrentCultureIgnoreCase);
        }

        public int CompareTo(Tag other)
        {
            return string.Compare(Name, other.Name, StringComparison.CurrentCultureIgnoreCase);
        }

        public bool Equals(Tag other)
        {
            return Name.Equals(other.Name, StringComparison.CurrentCultureIgnoreCase);
        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            var handler = PropertyChanged;
            handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}


text:
BOOST_AUTO_TEST_SUITE(bignum_tests)

// Unfortunately there's no standard way of preventing a function from being
// inlined, so we define a macro for it.
//
// You should use it like this:
//   NOINLINE void function() {...}
#if defined(__GNUC__)
// This also works and will be defined for any compiler implementing GCC
// extensions, such as Clang and ICC.
#define NOINLINE __attribute__((noinline))
#elif defined(_MSC_VER)
#define NOINLINE __declspec(noinline)
#else
// We give out a warning because it impacts the correctness of one bignum test.
#warning You should define NOINLINE for your compiler.
#define NOINLINE
#endif

// For the following test case, it is useful to use additional tools.
//
// The simplest one to use is the compiler flag -ftrapv, which detects integer
// overflows and similar errors. However, due to optimizations and compilers
// taking advantage of undefined behavior sometimes it may not actually detect
// anything.
//
// You can also use compiler-based stack protection to possibly detect possible
// stack buffer overruns.
//
// For more accurate diagnostics, you can use an undefined arithmetic operation
// detector such as the clang's undefined behaviour checker.
// See also: http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
//
// It might also be useful to use Google's AddressSanitizer to detect
// stack buffer overruns, which valgrind can't currently detect.

// Let's force this code not to be inlined, in order to actually
// test a generic version of the function. This increases the chance
// that -ftrapv will detect overflows.
NOINLINE void mysetint64(CBigNum& num, int64_t n)
{
    num.setint64(n);
}

// For each number, we do 2 tests: one with inline code, then we reset the
// value to 0, then the second one with a non-inlined function.
BOOST_AUTO_TEST_CASE(bignum_setint64)
{
    int64_t n;

    {
        n = 0;
        CBigNum num(n);
        BOOST_CHECK(num.ToString() == "0");
        num.setulong(0);
        BOOST_CHECK(num.ToString() == "0");
        mysetint64(num, n);
        BOOST_CHECK(num.ToString() == "0");
    }
    {
        n = 1;
        CBigNum num(n);
        BOOST_CHECK(num.ToString() == "1");
        num.setulong(0);
        BOOST_CHECK(num.ToString() == "0");
        mysetint64(num, n);
        BOOST_CHECK(num.ToString() == "1");
    }
    {
        n = -1;
        CBigNum num(n);
        BOOST_CHECK(num.ToString() == "-1");
        num.setulong(0);
        BOOST_CHECK(num.ToString() == "0");
        mysetint64(num, n);
        BOOST_CHECK(num.ToString() == "-1");
    }
    {
        n = 5;
        CBigNum num(n);
        BOOST_CHECK(num.ToString() == "5");
        num.setulong(0);
        BOOST_CHECK(num.ToString() == "0");
        mysetint64(num, n);
        BOOST_CHECK(num.ToString() == "5");
    }
    {
        n = -5;
        CBigNum num(n);
        BOOST_CHECK(num.ToString() == "-5");
        num.setulong(0);
        BOOST_CHECK(num.ToString() == "0");
        mysetint64(num, n);
        BOOST_CHECK(num.ToString() == "-5");
    }
    {
        n = std::numeric_limits<int64_t>::min();
        CBigNum num(n);
        BOOST_CHECK(num.ToString() == "-9223372036854775808");
        num.setulong(0);
        BOOST_CHECK(num.ToString() == "0");
        mysetint64(num, n);
        BOOST_CHECK(num.ToString() == "-9223372036854775808");
    }
    {
        n = std::numeric_limits<int64_t>::max();
        CBigNum num(n);
        BOOST_CHECK(num.ToString() == "9223372036854775807");
        num.setulong(0);
        BOOST_CHECK(num.ToString() == "0");
        mysetint64(num, n);
        BOOST_CHECK(num.ToString() == "9223372036854775807");
    }
}

BOOST_AUTO_TEST_CASE(bignum_SetCompact)
{
    CBigNum num;
    num.SetCompact(0);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);

    num.SetCompact(0x00123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);

    num.SetCompact(0x01003456);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);

    num.SetCompact(0x02000056);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);

    num.SetCompact(0x03000000);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);

    num.SetCompact(0x04000000);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);

    num.SetCompact(0x00923456);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);

    num.SetCompact(0x01803456);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);

    num.SetCompact(0x02800056);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);

    num.SetCompact(0x03800000);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);

    num.SetCompact(0x04800000);
    BOOST_CHECK_EQUAL(num.GetHex(), "0");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);

    num.SetCompact(0x01123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "12");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x01120000U);

    // Make sure that we don't generate compacts with the 0x00800000 bit set
    num = 0x80;
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x02008000U);

    num.SetCompact(0x01fedcba);
    BOOST_CHECK_EQUAL(num.GetHex(), "-7e");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x01fe0000U);

    num.SetCompact(0x02123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "1234");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x02123400U);

    num.SetCompact(0x03123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "123456");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x03123456U);

    num.SetCompact(0x04123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "12345600");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x04123456U);

    num.SetCompact(0x04923456);
    BOOST_CHECK_EQUAL(num.GetHex(), "-12345600");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x04923456U);

    num.SetCompact(0x05009234);
    BOOST_CHECK_EQUAL(num.GetHex(), "92340000");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x05009234U);

    num.SetCompact(0x20123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "1234560000000000000000000000000000000000000000000000000000000000");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0x20123456U);

    num.SetCompact(0xff123456);
    BOOST_CHECK_EQUAL(num.GetHex(), "123456000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
    BOOST_CHECK_EQUAL(num.GetCompact(), 0xff123456U);
}

BOOST_AUTO_TEST_CASE(bignum_SetHex)
{
    std::string hexStr = "deecf97fd890808b9cc0f1b6a3e7a60b400f52710e6ad075b1340755bfa58cc9";
    CBigNum num;
    num.SetHex(hexStr);
    BOOST_CHECK_EQUAL(num.GetHex(), hexStr);
}

BOOST_AUTO_TEST_SUITE_END()


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>cwlavro</artifactId>
    <name>CWL Avro</name>
    <groupId>io.cwl</groupId>
    <version>2.0.4.7-SNAPSHOT</version>
    <packaging>pom</packaging>

    <modules>
        <module>cwlavro-generated</module>
        <module>cwlavro-tools</module>
    </modules>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <prerequisites>
        <maven>3.1</maven>
    </prerequisites>

    <properties>
        <github.url>scm:git:git@github.com:common-workflow-language/cwlavro.git</github.url>
	    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <jackson.version>2.10.1</jackson.version>
    </properties>

    <scm>
        <connection>${github.url}</connection>
        <developerConnection>${github.url}</developerConnection>
        <url>${github.url}</url>
        <tag>2.0.4</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>central</id>
            <name>artifacts.oicr.on.ca-releases</name>
            <url>https://artifacts.oicr.on.ca/artifactory/collab-release</url>
        </repository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>1.21</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson/jackson-bom -->
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-publish-plugin</artifactId>
                    <version>1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <release>11</release>
                        <showDeprecation>true</showDeprecation>
                        <forceJavacCompilerUse>true</forceJavacCompilerUse>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.0.2</version>
                    <inherited>true</inherited>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.5.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.19.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>3.0.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>2.4.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.4.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.4</version>
                    <configuration>
                        <failOnError>false</failOnError>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <aggregate>true</aggregate>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
package io.gravitee.rest.api.management.rest.resource.param;

import java.util.List;
import javax.ws.rs.QueryParam;

/**
 * @author Nicolas GERAUD (nicolas.geraud at graviteesource.com)
 * @author GraviteeSource Team
 */
public class FetchersParam {

    @QueryParam("expand")
    List<String> expand;

    @QueryParam("import")
    private boolean onlyFilesFetchers;

    public List<String> getExpand() {
        return expand;
    }

    public void setExpand(List<String> expand) {
        this.expand = expand;
    }

    public boolean isOnlyFilesFetchers() {
        return onlyFilesFetchers;
    }

    public void setOnlyFilesFetchers(boolean onlyFilesFetchers) {
        this.onlyFilesFetchers = onlyFilesFetchers;
    }
}


text:
<?php

namespace yii\base;

/**
 * Behavior is the base class for all behavior classes.
 * Behavior是所有行为类的基类
 *
 * A behavior can be used to enhance the functionality of an existing component without modifying its code.
 * In particular, it can "inject" its own methods and properties into the component
 * and make them directly accessible via the component. It can also respond to the events triggered in the component
 * and thus intercept the normal code execution.
 * 行为可以在不修改已存在组件的情况下增强它的功能。特别是,它可以把自己的方法和属性注入到组件中
 * 使他们可以直接被组件访问,同时,也可以在组件触发事件时做出响应 因此拦截正常代码的执行
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class Behavior extends Object
{
    /**
     * @var Component the owner of this behavior
     * 一个Component 类的实例
     * 表示事件的所有者
     */
    public $owner;

    /**
     * Declares event handlers for the [[owner]]'s events.
     * 为事件所有者定义事件句柄
     *
     * Child classes may override this method to declare what PHP callbacks should
     * be attached to the events of the [[owner]] component.
     * 子类也许会重写这个方法,用来规定 哪种PHP回调才能被绑定到(事件所有者,即Component)的事件上
     *
     * The callbacks will be attached to the [[owner]]'s events when the behavior is
     * attached to the owner; and they will be detached from the events when
     * the behavior is detached from the component.
     * 当行为绑定到事件所有者上的时候,毁掉也会绑定在事件所有者上
     * 行为解绑后,回调也随之解绑
     *
     * The callbacks can be any of the following:
     * 回调必须是如下几种形式(没有全局函数?):
     *
     * - method in this behavior: `'handleClick'`, equivalent to `[$this, 'handleClick']`
     * - 本行为中的方法: 用`'handleClick'`, 等同于 `[$this, 'handleClick']`
     * - object method: `[$object, 'handleClick']`
     * - 对象的方法
     * - static method: `['Page', 'handleClick']`
     * - 类的静态方法
     * - anonymous function: `function ($event) { ... }`
     * - 匿名函数
     *
     * The following is an example:
     *
     * ~~~
     * [
     *     Model::EVENT_BEFORE_VALIDATE => 'myBeforeValidate',
     *     Model::EVENT_AFTER_VALIDATE => 'myAfterValidate',
     * ]
     * ~~~
     *
     * @return array events (array keys) and the corresponding event handler methods (array values).
     */
    public function events()
    {
        return [];
    }

    /**
     * Attaches the behavior object to the component.
     * 绑定行为对象到组件上
     * The default implementation will set the [[owner]] property
     * and attach event handlers as declared in [[events]].
     * 默认的实现会为本行为对象设置属性owner以及像enents()方法返回的那样绑定事件句柄
     * Make sure you call the parent implementation if you override this method.
     * 假如重写本方法,请确保调用了父类的实现。
     * @param Component $owner the component that this behavior is to be attached to.
     * 参数$owner 是一个Component实例
     * 该实例就是本行为所绑定的组件
     */
    public function attach($owner)
    {
        $this->owner = $owner;
        foreach ($this->events() as $event => $handler) {
            // 如果events()返回的数组元素中值为字符串,则默认使用[$this, $handler]
            $owner->on($event, is_string($handler) ? [$this, $handler] : $handler);
        }
    }

    /**
     * Detaches the behavior object from the component.
     * 从组件中解绑行为对象
     * The default implementation will unset the [[owner]] property
     * and detach event handlers declared in [[events]].
     * 默认的逻辑会使本对象的owner属性为null,并且从绑定的组件中逐一解绑本行为中的事件句柄
     * Make sure you call the parent implementation if you override this method.
     * 假如你在子类中重写了此方法,请确保调用了父类方法
     */
    public function detach()
    {
        if ($this->owner) {
            foreach ($this->events() as $event => $handler) {
                $this->owner->off($event, is_string($handler) ? [$this, $handler] : $handler);
            }
            $this->owner = null;
        }
    }
}


text:
'''
Created on Apr 21, 2016

@author: PJ
'''
import os
import json
from django.db import transaction

class PopulateRegionalResults:

    def __init__(self, team_model, team_competes_in_model, match_model, competition_model, official_match_model, official_match_sr_model):
        self.team_model = team_model
        self.team_competes_in_model = team_competes_in_model
        self.match_model = match_model
        self.competition_model = competition_model
        self.official_match_model = official_match_model
        self.official_match_sr_model = official_match_sr_model

    def __read_local_copy(self, input_file):
        with open(input_file, 'r') as f:
            response_body = f.read()

        json_struct = json.loads(response_body)

        return json_struct

    def __get_non_null_field(self, team_info, field_name, default="Unknown"):

        return team_info[field_name] if team_info[field_name] != None else default

    def __update_team_info(self, local_file):

        if not os.path.exists(local_file):
            print("No team info, skipping population")
            return

        json_struct = self.__read_local_copy(local_file)

        for team_info in json_struct["teams"]:
            team_number = team_info["teamNumber"]

            team, _ = self.team_model.objects.get_or_create(teamNumber=team_number)
            team.homepage = self.__get_non_null_field(team_info, "website")
            team.rookie_year = self.__get_non_null_field(team_info, "rookieYear")
            team.city = self.__get_non_null_field(team_info, "city")
            team.state = self.__get_non_null_field(team_info, "stateProv")
            team.country = self.__get_non_null_field(team_info, "country")
            team.team_name = self.__get_non_null_field(team_info, "nameFull")
            team.team_nickname = self.__get_non_null_field(team_info, "nameShort")
            team.robot_name = self.__get_non_null_field(team_info, "robotName")
            team.save()
            print("Updating info for team %s" % team_number)

    #########################################
    # Season Info
    #########################################
    @transaction.atomic
    def update_all_team_info(self, json_path):
        team_files_dir = json_path + "/teams"
        for _, _, files in os.walk(team_files_dir):
            for f in files:
                file_path = os.path.join(team_files_dir, f)
                self.__update_team_info(file_path)

    @transaction.atomic
    def update_competition_list(self, json_path):

        json_struct = self.__read_local_copy(json_path + "events/event_query.json")

        for event_info in json_struct["Events"]:
            code = event_info["code"]
            event = self.competition_model.objects.create(code=code)

            event.name = event_info["name"]
            event.city = event_info["city"]
            event.state = event_info["stateprov"]
            event.country = event_info["country"]
            event.save()

            print("Adding event %s" % code)

    #########################################
    # Competition Info
    #########################################

    @transaction.atomic
    def update_team_info(self, event_code, json_path):

        local_file = json_path + '/{0}_team_query.json'.format(event_code)
        if not os.path.exists(local_file):
            print("No team info, skipping population")
            return

        json_struct = self.__read_local_copy(local_file)

        for team_info in json_struct["teams"]:
            team_number = team_info["teamNumber"]

            team, _ = self.team_model.objects.get_or_create(teamNumber=team_number)
#             team.teamHomepage = team_info["website"] if team_info["website"] != None else "NA"
#             team.teamFirstYear = team_info["rookieYear"]
            team.homepage = self.__get_non_null_field(team_info, "website")
            team.rookie_year = self.__get_non_null_field(team_info, "rookieYear")
            team.city = self.__get_non_null_field(team_info, "city")
            team.state = self.__get_non_null_field(team_info, "stateProv")
            team.country = self.__get_non_null_field(team_info, "country")
            team.team_name = self.__get_non_null_field(team_info, "nameFull")
            team.team_nickname = self.__get_non_null_field(team_info, "nameShort")
            team.robot_name = self.__get_non_null_field(team_info, "robotName")
            team.save()
            print("Updating info for team %s" % team_number)

    @transaction.atomic
    def update_schedule(self, event_code, json_path):

        competition = self.competition_model.objects.get(code=event_code)

        local_file = json_path + '/{0}_schedule_query.json'.format(event_code)
        if not os.path.exists(local_file):
            print("No schedule info, skipping population")
            return

        json_struct = self.__read_local_copy(local_file)

        schedule_info = json_struct["Schedule"]

        for match_info in schedule_info:
            match_number = match_info["matchNumber"]

            red_teams = []
            blue_teams = []

            for team_info in match_info["Teams"]:
                team, _ = self.team_model.objects.get_or_create(teamNumber=team_info["teamNumber"])
                if "Red" in team_info["station"]:
                    red_teams.append(team)
                elif "Blue" in team_info["station"]:
                    blue_teams.append(team)

            official_match, _ = self.official_match_model.objects.get_or_create(matchNumber=match_number, competition=competition)
            official_sr_search = self.official_match_sr_model.objects.filter(official_match=official_match)
            match_search = self.match_model.objects.filter(matchNumber=match_number)

            for team in red_teams + blue_teams:
                self.team_competes_in_model.objects.get_or_create(team=team, competition=competition)

            if len(match_search) == 0:
                match = self.match_model.objects.create(matchNumber=match_number, competition=competition,
                                                        red1=red_teams[0], red2=red_teams[1], red3=red_teams[2],
                                                        blue1=blue_teams[0], blue2=blue_teams[1], blue3=blue_teams[2])
            else:
                match = match_search[0]

                match.red1 = red_teams[0]
                match.red2 = red_teams[1]
                match.red3 = red_teams[2]
                match.blue1 = blue_teams[0]
                match.blue2 = blue_teams[1]
                match.blue3 = blue_teams[2]
                match.save()
                print("Updating teams for match %s" % match.matchNumber)

            if len(official_sr_search) == 0:
                self.official_match_sr_model.objects.create(official_match=official_match, competition=competition)
                self.official_match_sr_model.objects.create(official_match=official_match, competition=competition)
                print("Creating official match %s" % official_match.matchNumber)

    @transaction.atomic
    def update_matchresults(self, event_code, json_path):
        competition = self.competition_model.objects.get(code=event_code)

        local_file = json_path + '/{0}_scoreresult_query.json'.format(event_code)
        if not os.path.exists(local_file):
            print("No official results, skipping population")
            return

        json_struct = self.__read_local_copy(local_file)

        scores_info = json_struct["MatchScores"]
        for match_info in scores_info:
            match_number = match_info["matchNumber"]

            official_match = self.official_match_model.objects.get_or_create(matchNumber=match_number, competition=competition)[0]
            official_sr_search = self.official_match_sr_model.objects.filter(official_match=official_match)
            if len(official_sr_search) != 2:
                comp1 = self.official_match_sr_model.objects.create(competition=competition, official_match=official_match, alliance_color='R')
                comp2 = self.official_match_sr_model.objects.create(competition=competition, official_match=official_match, alliance_color='B')
                official_sr_search = [comp1, comp2]

            red_breakdown = [x for x in match_info["Alliances"] if x["alliance"] == "Red"][0]
            blue_breakdown = [x for x in match_info["Alliances"] if x["alliance"] == "Blue"][0]

            self._populate_official_sr(official_sr_search[0], red_breakdown, "R")
            self._populate_official_sr(official_sr_search[1], blue_breakdown, "B")

            print("Adding stats to official match %s" % official_match.matchNumber)


text:
--------------------------------
--
-- @function [parent=#EaseElasticInOut] update
-- @param self
-- @param #float time

--------------------------------
--
-- @function [parent=#EaseElasticInOut] reverse
-- @param self
-- @return EaseElasticInOut#EaseElasticInOut ret (return value: cc.EaseElasticInOut)

return nil


text:
class Chef
  class Resource

    # Convenience class for using the deploy resource with the timestamped
    # deployment strategy (provider)
    class TimestampedDeploy < Chef::Resource::Deploy
      def initialize(*args, &block)
        super(*args, &block)
        @provider = Chef::Provider::Deploy::Timestamped
      end
    end
  end
end


text:
using System;

namespace HeptaSoft.SmartEntity.Mapping.Accessors
{
    internal class PropertyAccessorFactory : IPropertyAccessorFactory
    {
        #region IPropertyAccessorFactory

        /// <inheritdoc />
        public IPropertyAccessor CreatePropertyAccessor(Type dtoType, string propertyName)
        {
            return new PropertyAccessor(dtoType, propertyName);
        }

        #endregion
    }
}