text:
package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class RoleEventArgument extends EventArgument {
  public int roleId;
  public String name;

  public int getRoleId() {
    return this.roleId;
  }

  public String getName() {
    return this.name;
  }

  public void setRoleId(int roleId) {
    this.roleId=roleId;
  }

  public void setName(String name) {
    this.name=name;
  }
}

redpajama_set_name: RedPajamaGithub


text:
package io.webfolder.cdp.type.css;

import io.webfolder.cdp.annotation.Experimental;

/**
 * Media query expression descriptor
 */
@Experimental
public class MediaQueryExpression {
    private Double value;

    private String unit;

    private String feature;

    private SourceRange valueRange;

    private Double computedLength;

    /**
     * Media query expression value.
     */
    public Double getValue() {
        return value;
    }

    /**
     * Media query expression value.
     */
    public void setValue(Double value) {
        this.value = value;
    }

    /**
     * Media query expression units.
     */
    public String getUnit() {
        return unit;
    }

    /**
     * Media query expression units.
     */
    public void setUnit(String unit) {
        this.unit = unit;
    }

    /**
     * Media query expression feature.
     */
    public String getFeature() {
        return feature;
    }

    /**
     * Media query expression feature.
     */
    public void setFeature(String feature) {
        this.feature = feature;
    }

    /**
     * The associated range of the value text in the enclosing stylesheet (if available).
     */
    public SourceRange getValueRange() {
        return valueRange;
    }

    /**
     * The associated range of the value text in the enclosing stylesheet (if available).
     */
    public void setValueRange(SourceRange valueRange) {
        this.valueRange = valueRange;
    }

    /**
     * Computed length of media query expression (if applicable).
     */
    public Double getComputedLength() {
        return computedLength;
    }

    /**
     * Computed length of media query expression (if applicable).
     */
    public void setComputedLength(Double computedLength) {
        this.computedLength = computedLength;
    }
}


text:
// ----------------------------------------------------------------------------
//
//
// OpenSteer -- Steering Behaviors for Autonomous Characters
//
// Copyright (c) 2002-2003, Sony Computer Entertainment America
// Original author: Craig Reynolds <craig_reynolds@playstation.sony.com>
//
// 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.
//
//
// ----------------------------------------------------------------------------
//
//
// Proximity
//
// Data structures for accelerating proximity/locality/neighborhood queries
//
// 10-04-04 bk:  put everything into the OpenSteer namespace
// 06-20-01 cwr: created
//
//
// ----------------------------------------------------------------------------

#ifndef OPENSTEER_PROXIMITY_H
#define OPENSTEER_PROXIMITY_H

#include <algorithm>
#include <vector>
#include "Vec3.h"
#include "lq.h"   // XXX temp?

namespace OpenSteer {

    // ----------------------------------------------------------------------------
    // "tokens" are the objects manipulated by the spatial database

    template <class ContentType>
    class AbstractTokenForProximityDatabase
    {
    public:

        virtual ~AbstractTokenForProximityDatabase () {}

        // the client object calls this each time its position changes
        virtual void updateForNewPosition (const Vec3& position) = 0;

        // find all neighbors within the given sphere (as center and radius)
        virtual void findNeighbors (const Vec3& center,
                                    const double radius,
                                    std::vector<ContentType>& results) = 0;

    };

    // ----------------------------------------------------------------------------
    // abstract type for all kinds of proximity databases

    template <class ContentType>
    class AbstractProximityDatabase
    {
    public:

        // type for the "tokens" manipulated by this spatial database
        typedef AbstractTokenForProximityDatabase<ContentType> tokenType;

        // allocate a token to represent a given client object in this database
        virtual tokenType* allocateToken (ContentType parentObject) = 0;

        // insert
        // XXX maybe this should return an iterator?
        // XXX see http://www.sgi.com/tech/stl/set.html
        // virtual void insert (const ContentType& x) = 0;

        // XXX name?
        // returns the number of tokens in the proximity database
        virtual int getPopulation (void) = 0;
    };

    // ----------------------------------------------------------------------------
    // This is the "brute force" O(n^2) approach implemented in terms of the
    // AbstractProximityDatabase protocol so it can be compared directly to other
    // approaches.  (e.g. the Boids plugin allows switching at runtime.)

    template <class ContentType>
    class BruteForceProximityDatabase
        : public AbstractProximityDatabase<ContentType>
    {
    public:

        // constructor
        BruteForceProximityDatabase (void)
        {
        }

        // destructor
        virtual ~BruteForceProximityDatabase ()
        {
        }

        // "token" to represent objects stored in the database
        class tokenType : public AbstractTokenForProximityDatabase<ContentType>
        {
        public:

            // constructor
            tokenType (ContentType parentObject, BruteForceProximityDatabase& pd)
            {
                // store pointer to our associated database and the object this
                // token represents, and store this token on the database's vector
                bfpd = &pd;
                object = parentObject;
                bfpd->group.push_back (this);
            }

            // destructor
            virtual ~tokenType ()
            {
                // remove this token from the database's vector
                bfpd->group.erase (std::find (bfpd->group.begin(),
                                              bfpd->group.end(),
                                              this));
            }

            // the client object calls this each time its position changes
            void updateForNewPosition (const Vec3& newPosition)
            {
                position = newPosition;
            }

            // find all neighbors within the given sphere (as center and radius)
            void findNeighbors (const Vec3& center,
                                const double radius,
                                std::vector<ContentType>& results)
            {
                // loop over all tokens
                const double r2 = radius * radius;
                for (tokenIterator i = bfpd->group.begin();
                     i != bfpd->group.end();
                     i++)
                {
                    const Vec3 offset = center - (**i).position;
                    const double d2 = offset.lengthSquared();

                    // push onto result vector when within given radius
                    if (d2 < r2) results.push_back ((**i).object);
                }
            }

        private:
            BruteForceProximityDatabase* bfpd;
            ContentType object;
            Vec3 position;
        };

        typedef std::vector<tokenType*> tokenVector;
        typedef typename tokenVector::const_iterator tokenIterator;

        // allocate a token to represent a given client object in this database
        tokenType* allocateToken (ContentType parentObject)
        {
            return new DEBUG_NEW_PLACEMENT tokenType (parentObject, *this);
        }

        // return the number of tokens currently in the database
        int getPopulation (void)
        {
            return group.size();
        }

    private:
        // STL vector containing all tokens in database
        tokenVector group;
    };

    // ----------------------------------------------------------------------------
    // A AbstractProximityDatabase-style wrapper for the LQ bin lattice system

    template <class ContentType>
    class LQProximityDatabase : public AbstractProximityDatabase<ContentType>
    {
    public:

        // constructor
        LQProximityDatabase (const Vec3& center,
                             const Vec3& dimensions,
                             const Vec3& divisions)
        {
            const Vec3 halfsize (dimensions * 0.5);
            const Vec3 origin (center - halfsize);

            lq = lqCreateDatabase (origin.x, origin.y, origin.z,
                                   dimensions.x, dimensions.y, dimensions.z,
                                   (int) round (divisions.x),
                                   (int) round (divisions.y),
                                   (int) round (divisions.z));
        }

        // destructor
        virtual ~LQProximityDatabase ()
        {
            lqDeleteDatabase (lq);
            lq = NULL;
        }

        // "token" to represent objects stored in the database
        class tokenType : public AbstractTokenForProximityDatabase<ContentType>
        {
        public:

            // constructor
            tokenType (ContentType parentObject, LQProximityDatabase& lqsd)
            {
                lqInitClientProxy (&proxy, parentObject);
                lq = lqsd.lq;
            }

            // destructor
            virtual ~tokenType (void)
            {
                lqRemoveFromBin (&proxy);
            }

            // the client object calls this each time its position changes
            void updateForNewPosition (const Vec3& p)
            {
                lqUpdateForNewLocation (lq, &proxy, p.x, p.y, p.z);
            }

            // find all neighbors within the given sphere (as center and radius)
            void findNeighbors (const Vec3& center,
                                const double radius,
                                std::vector<ContentType>& results)
            {
                lqMapOverAllObjectsInLocality (lq,
                                               center.x, center.y, center.z,
                                               radius,
                                               perNeighborCallBackFunction,
                                               (void*)&results);
            }

            // called by LQ for each clientObject in the specified neighborhood:
            // push that clientObject onto the ContentType vector in void*
            // clientQueryState
            // (parameter names commented out to prevent compiler warning from "-W")
            static void perNeighborCallBackFunction  (void* clientObject,
                                                      double /*distanceSquared*/,
                                                      void* clientQueryState)
            {
                typedef std::vector<ContentType> ctv;
                ctv& results = *((ctv*) clientQueryState);
                results.push_back ((ContentType) clientObject);
            }

        private:
            lqClientProxy proxy;
            lqDB* lq;
        };

        // allocate a token to represent a given client object in this database
        tokenType* allocateToken (ContentType parentObject)
        {
            return new DEBUG_NEW_PLACEMENT tokenType (parentObject, *this);
        }

        // count the number of tokens currently in the database
        int getPopulation (void)
        {
            int count = 0;
            lqMapOverAllObjects (lq, counterCallBackFunction, &count);
            return count;
        }

        // (parameter names commented out to prevent compiler warning from "-W")
        static void counterCallBackFunction  (void* /*clientObject*/,
                                              double /*distanceSquared*/,
                                              void* clientQueryState)
        {
            int& counter = *(int*)clientQueryState;
            counter++;
        }

    private:
        lqDB* lq;
    };

} // namespace OpenSteer

// ----------------------------------------------------------------------------
#endif // OPENSTEER_PROXIMITY_H


text:
<?php namespace Example\Chinook\Artists;

use Example\Chinook\AbstractRepository;
use Example\Chinook\Albums\Repository as AlbumsReposiory;

class Repository extends AbstractRepository
{
    public function __construct()
    {
        parent::__construct();
        $this->getBaseCriteria()
            ->cols([
                'ArtistId' => 'artistId',
                'Name' => 'name',
            ])
            ->from('artists');
    }

    public function assemble()
    {
        $collection = parent::assemble();

        if ($this->hasCriteria('Albums')) {
            $albums = $this->getCriteria('Albums')
                ->filterByArtistIds($collection->getAllValuesForProperty('artistId'))
                ->assemble();

            $collection->bindCollection($albums, ['artistId' => 'artistId'], 'Albums');
        }

        return $collection;
    }

    public function filterByName($name)
    {
        $this->getBaseCriteria()
            ->where('name == :filterByName')
            ->bindValues([
                'filterByName' => $name,
            ])
        ;

        return $this;
    }

    public function includeAlbums(array $params = [])
    {
        $this->setCriteria(
            'Albums',
            (new AlbumsReposiory)->invoke((object)$params)
        );

        return $this;
    }
}


text:
Notes

            <button gd-icon-button (click)="openCreateNewNoteDialog()" aria-label="Create new note">
                <gd-icon name="plus"></gd-icon>
            </button>

        <gd-note-calendar></gd-note-calendar>

    <gd-note-list-tools></gd-note-list-tools>
    <gd-note-list fxLayout fxFlex="1 1 auto"></gd-note-list>


text:
<?php

namespace ListaVirtual\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * CasamentoPresente
 *
 * @ORM\Table(name="casamento_presente", indexes={@ORM\Index(name="fk_Casamento_Presente_Categoria_Presente1_idx", columns={"Categoria_Presente_id"}), @ORM\Index(name="fk_Casamento_Presente_Casamento1_idx", columns={"Casamento_id"})})
 * @ORM\Entity
 */
class CasamentoPresente extends Application\Entity\Base\Entity
{
//    /**
//     * @var integer
//     *
//     * @ORM\Column(name="id", type="integer", nullable=false)
//     * @ORM\Id
//     * @ORM\GeneratedValue(strategy="NONE")
//     */
//    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="caminho_foto", type="string", length=45, nullable=true)
     */
    private $caminhoFoto;

    /**
     * @var string
     *
     * @ORM\Column(name="descricao", type="string", length=45, nullable=false)
     */
    private $descricao;

    /**
     * @var string
     *
     * @ORM\Column(name="valor", type="decimal", precision=3, scale=2, nullable=false)
     */
    private $valor;

    /**
     * @var string
     *
     * @ORM\Column(name="qtde_requerida", type="decimal", precision=3, scale=2, nullable=false)
     */
    private $qtdeRequerida = '1.00';

    /**
     * @var string
     *
     * @ORM\Column(name="qtde_disponivel", type="string", length=45, nullable=true)
     */
    private $qtdeDisponivel;

    /**
     * @var \CategoriaPresente
     *
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="NONE")
     * @ORM\OneToOne(targetEntity="CategoriaPresente")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="Categoria_Presente_id", referencedColumnName="id")
     * })
     */
    private $categoriaPresente;

    /**
     * @var \Casamento
     *
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="NONE")
     * @ORM\OneToOne(targetEntity="Casamento")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="Casamento_id", referencedColumnName="id")
     * })
     */
    private $casamento;

    public function getCaminhoFoto() {
        return $this->caminhoFoto;
    }

    public function getDescricao() {
        return $this->descricao;
    }

    public function getValor() {
        return $this->valor;
    }

    public function getQtdeRequerida() {
        return $this->qtdeRequerida;
    }

    public function getQtdeDisponivel() {
        return $this->qtdeDisponivel;
    }

    public function getCategoriaPresente() {
        return $this->categoriaPresente;
    }

    public function getCasamento() {
        return $this->casamento;
    }

    public function setCaminhoFoto($caminhoFoto) {
        $this->caminhoFoto = $caminhoFoto;
    }

    public function setDescricao($descricao) {
        $this->descricao = $descricao;
    }

    public function setValor($valor) {
        $this->valor = $valor;
    }

    public function setQtdeRequerida($qtdeRequerida) {
        $this->qtdeRequerida = $qtdeRequerida;
    }

    public function setQtdeDisponivel($qtdeDisponivel) {
        $this->qtdeDisponivel = $qtdeDisponivel;
    }

    public function setCategoriaPresente(\CategoriaPresente $categoriaPresente) {
        $this->categoriaPresente = $categoriaPresente;
    }

    public function setCasamento(\Casamento $casamento) {
        $this->casamento = $casamento;
    }

}


text:
void ofApp::setup(){
    ofSetWindowPosition(0,0);

    ofLog() << "loading settings.xml";
    ofxXmlSettings settings;
    if(!settings.loadFile("settings.xml")){
        ofLogWarning() << "failed to load settings.xml, loading default values";
    }

    osc_host = settings.getValue("of2030:remote:osc:host", "localhost");
    osc_port = settings.getValue("of2030:remote:osc:port", 2030);
    min_value = settings.getValue("of2030:remote:value:min", 0.0f);
    max_value = settings.getValue("of2030:remote:value:max", 1.0f);
    message = settings.getValue("of2030:remote:osc:message", "/value");
    for(int i=1; settings.tagExists("of2030:remote:guide"+ofToString(i)); i++){
        guide_values.push_back(settings.getValue("of2030:remote:guide"+ofToString(i), 0.0f));
    }
    preview_width = settings.getValue("of2030:remote:preview_width", 0.5f);

    ofLog() << "settings:";
    ofLog() << "osc host/port: " << osc_host << "/" << osc_port;
    ofLog() << "value range: " << min_value << "," << max_value;
    ofLog() << "message: " << message;
    for(auto guide_value: guide_values){
        ofLog() << "guide: " << guide_value;
    }
    ofLog() << "preview width: " << preview_width;

    osc_sender.setup(osc_host, osc_port);
    ofLog() << "osc client connect to: " << osc_host << " at port:: " << osc_port;

    current_value = ofLerp(min_value, max_value, 0.5);
}

//--------------------------------------------------------------
void ofApp::update(){
    ofBackground(0);
}

//--------------------------------------------------------------
void ofApp::draw(){
    ofSetColor(50,0,0);
    ofDrawRectangle(ofMap(current_value, min_value, max_value, 0, ofGetWidth()),
                    0,
                    ofMap(preview_width, 0, max_value-min_value, 0, ofGetWidth()),
                    ofGetHeight());

    ofSetColor(255,255,255,100);
    for(auto guide_value: guide_values){
        ofDrawRectangle(ofMap(guide_value, min_value, max_value, 0.0f, ofGetWidth()), 0.0f, 1, ofGetHeight());
    }
}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){
    if(key == 'i')
        updateValue(current_value-0.1);
    if(key == 'j')
        updateValue(current_value-0.03);
    if(key == 'b')
        updateValue(current_value-0.01);

    if(key == 'p')
        updateValue(current_value+0.1);
    if(key == 'l')
        updateValue(current_value+0.03);
    if(key == 'm')
        updateValue(current_value+0.01);

}

//--------------------------------------------------------------
void ofApp::keyReleased(int key){

}

//--------------------------------------------------------------
void ofApp::mouseMoved(int x, int y){

}

//--------------------------------------------------------------
void ofApp::mouseDragged(int x, int y, int button){
    updateValue(ofMap(x, 0, ofGetWidth(), min_value, max_value));
}

//--------------------------------------------------------------
void ofApp::mousePressed(int x, int y, int button){

}

//--------------------------------------------------------------
void ofApp::mouseReleased(int x, int y, int button){

}

//--------------------------------------------------------------
void ofApp::mouseEntered(int x, int y){

}

//--------------------------------------------------------------
void ofApp::mouseExited(int x, int y){

}

//--------------------------------------------------------------
void ofApp::windowResized(int w, int h){

}

//--------------------------------------------------------------
void ofApp::gotMessage(ofMessage msg){

}

//--------------------------------------------------------------
void ofApp::dragEvent(ofDragInfo dragInfo){

}

void ofApp::updateValue(float val){
    current_value = val;
    sendValue(current_value);
    ofLogVerbose() << "val: " << current_value;
}

void ofApp::sendValue(float val){
    osc_message.setAddress(message);
    osc_message.addFloatArg(val);
    osc_sender.sendMessage(osc_message);
    osc_message.clear();
}


text:
var consts = require('./constants');

var getRole = function(profile) {
    return profile.role || consts.auth.roles.USER;
};

var isAdmin = function(profile) {
    return getRole(profile) === consts.auth.roles.ADMIN;
};

var getSetting = function(profile, setting) {
    var value = getMetadataField(profile, setting.name);

    if(value === undefined) {
        return setting.defaultValue;
    }

    return value;
};

var getMetadataField = function(profile, field) {
    // jscs:disable requireCamelCaseOrUpperCaseIdentifiers

    if (profile.user_metadata && profile.user_metadata[field] !== undefined) {
        return profile.user_metadata[field];
    };

    // jscs:enable requireCamelCaseOrUpperCaseIdentifiers
};

module.exports = {
    isAdmin: isAdmin,
    getRole: getRole,
    getMetadataField: getMetadataField,
    getSetting: getSetting
};


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace MiContact.Models
{
    [Table("Social")]
    public class Social
    {
        [Key]
        public int SocialID { get; set; }
        //public ApplicationUser ApplicationUser { get; set; }
        //public string ApplicationUserID { get; set; }
        public int BasicInfoID { get; set; }

        [StringLength(50)]
        public string Link { get; set; }

        [StringLength(300)]
        public string URL { get; set; }

        [StringLength(100)]
        public string LinkType { get; set; }

        [StringLength(1000)]
        public string Description { get; set; }
        public DateTime CreatedOn { get; set; }
        public DateTime UpdatedOn { get; set; }
        public byte Status { get; set; }
    }
}


text:
namespace NPOI
{
    using NPOI.HPSF;
    using NPOI.HPSF.Extractor;
    using NPOI.POIFS.FileSystem;

    /// <summary>
    /// Common Parent for OLE2 based Text Extractors
    /// of POI Documents, such as .doc, .xls
    /// You will typically find the implementation of
    /// a given format's text extractor under NPOI.Format.Extractor
    /// </summary>
    /// <remarks>
    /// @see org.apache.poi.hssf.extractor.ExcelExtractor
    /// @see org.apache.poi.hslf.extractor.PowerPointExtractor
    /// @see org.apache.poi.hdgf.extractor.VisioTextExtractor
    /// @see org.apache.poi.hwpf.extractor.WordExtractor
    /// </remarks>
    public abstract class POIOLE2TextExtractor : POITextExtractor
    {
        /** The POIDocument that's open */
        protected POIDocument document;

        /// <summary>
        /// Creates a new text extractor for the given document
        /// </summary>
        /// <param name="document"></param>
        public POIOLE2TextExtractor(POIDocument document)
        {
            this.document = document;
            // Ensure any underlying resources, such as open files,
            //  will get cleaned up if the user calls #close()
            SetFilesystem(document);
        }

        /// <summary>
        /// Creates a new text extractor, using the same document as another
        /// text extractor. Normally only used by properties extractors.
        /// </summary>
        /// <param name="otherExtractor"></param>
        protected POIOLE2TextExtractor(POIOLE2TextExtractor otherExtractor)
        {
            this.document = otherExtractor.document;
        }
        /// <summary>
        /// Returns the document information metadata for the document
        /// </summary>
        /// <value>The doc summary information.</value>
        public virtual DocumentSummaryInformation DocSummaryInformation
        {
            get
            {
                return document.DocumentSummaryInformation;
            }
        }
        /// <summary>
        /// Returns the summary information metadata for the document
        /// </summary>
        /// <value>The summary information.</value>
        public virtual SummaryInformation SummaryInformation
        {
            get
            {
                return document.SummaryInformation;
            }
        }

        /// <summary>
        /// Returns an HPSF powered text extractor for the
        /// document properties metadata, such as title and author.
        /// </summary>
        /// <value></value>
        public override POITextExtractor MetadataTextExtractor
        {
            get
            {
                return new HPSFPropertiesExtractor(this);
            }
        }

        /**
	     * Return the underlying DirectoryEntry of this document.
	     *
	     * @return the DirectoryEntry that is associated with the POIDocument of this extractor.
	     */
        public DirectoryEntry Root
        {
            get { return document.Directory; }

        }
    }
}


text:
APIゲートウェイアプリ

      <button class='navbar-toggle navbar-toggle-menu' data-canvas='#canvas' data-target='#menu' data-toggle='offcanvas' type='button'>

      </button>
      <button class='navbar-toggle navbar-toggle-services' data-canvas='#canvas' data-target='#services' data-toggle='offcanvas' type='button'>

      </button>


text:
def add_tag_flag(cmd)
  cmd.desc 'Docker tag for application container'
  cmd.arg_name 'TAG'
  cmd.flag [:tag]
end

def add_target_flag(cmd)
  cmd.desc 'Deployment target to use, e.g. production_web'
  cmd.arg_name 'TARGET'
  cmd.flag [:t, :target], type: Symbol, required: true
end

def add_instance_flag(cmd)
  cmd.desc '0-based index into the array of running instances'
  cmd.default_value 0
  cmd.arg_name 'INSTANCE'
  cmd.flag [:n, :instance], type: Integer
end

def add_command_flags(cmd)
  add_instance_flag(cmd)
  add_target_flag(cmd)
end

def add_deploy_flags(cmd)
  add_tag_flag(cmd)
  add_target_flag(cmd)
end

desc 'Bootstrap your service and task definition from the configured definition.'
command :bootstrap do |bootstrap|
  add_deploy_flags(bootstrap)

  bootstrap.action do |_, options, _|
    Broadside::EcsDeploy.new(options).bootstrap
  end
end

desc 'Gives an overview of all of the deploy targets'
command :targets do |targets|
  targets.action do |_, _, _|
    Broadside::Command.targets
  end
end

desc 'Gets information about what is currently deployed.'
command :status do |status|
  status.desc 'Additionally displays service and task information'
  status.switch :verbose, negatable: false

  add_target_flag(status)

  status.action do |_, options, _|
    Broadside::Command.status(options)
  end
end

desc 'Creates a single instance of the application to run a command.'
command :run do |run|
  run.desc 'Broadside::Command to run (wrap argument in quotes)'
  run.arg_name 'COMMAND'
  run.flag [:command], type: Array

  add_deploy_flags(run)

  run.action do |_, options, _|
    EcsDeploy.new(options).run_commands([options[:command]], started_by: 'run')
  end
end

desc 'Tail the logs inside a running container.'
command :logtail do |logtail|
  logtail.desc 'Number of lines to tail'
  logtail.default_value Broadside::Command::DEFAULT_TAIL_LINES
  logtail.arg_name 'TAIL_LINES'
  logtail.flag [:l, :lines], type: Integer

  add_command_flags(logtail)

  logtail.action do |_, options, _|
    Broadside::Command.logtail(options)
  end
end

desc 'Establish a secure shell on an instance running the container.'
command :ssh do |ssh|
  add_command_flags(ssh)

  ssh.action do |_, options, _|
    Broadside::Command.ssh(options)
  end
end

desc 'Establish a shell inside a running container.'
command :bash do |bash|
  add_command_flags(bash)

  bash.action do |_, options, _|
    Broadside::Command.bash(options)
  end
end

desc 'Execute a bash command inside a running container.'
command :execute do |execute|
  add_command_flags(execute)

  execute.desc 'bash command to run (wrap argument in quotes)'
  execute.arg_name 'BASH_COMMAND'
  execute.flag [:c, :command], type: String, required: true

  execute.desc 'run on all containers in series'
  execute.arg_name 'ALL_CONTAINERS'
  execute.switch :all, negatable: false

  execute.action do |_, options, _|
    Broadside::Command.execute(options)
  end
end

desc 'Deploy your application.'
command :deploy do |d|
  d.desc 'Deploys WITHOUT running predeploy commands'
  d.command :short do |short|
    add_deploy_flags(short)

    short.action do |_, options, _|
      Broadside::EcsDeploy.new(options).short
    end
  end

  d.desc 'Deploys WITH running predeploy commands'
  d.command :full do |full|
    add_deploy_flags(full)

    full.action do |_, options, _|
      Broadside::EcsDeploy.new(options).full
    end
  end

  d.desc 'Scales application to a given count'
  d.command :scale do |scale|
    scale.desc 'Specify a new scale for application'
    scale.arg_name 'NUM'
    scale.flag [:s, :scale], type: Integer

    add_target_flag(scale)

    scale.action do |_, options, _|
      Broadside::EcsDeploy.new(options).scale(options)
    end
  end

  d.desc 'Rolls back n releases and deploys'
  d.command :rollback do |rollback|
    rollback.desc 'Number of releases to rollback'
    rollback.arg_name 'COUNT'
    rollback.flag [:r, :rollback], type: Integer

    add_target_flag(rollback)

    rollback.action do |_, options, _|
      Broadside::EcsDeploy.new(options).rollback(options)
    end
  end
end


text:
package com.microsoft.azure.management.eventhubs.v2017_04_01.implementation;

import com.microsoft.azure.management.eventhubs.v2017_04_01.CheckNameAvailabilityResult;
import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.management.eventhubs.v2017_04_01.UnavailableReason;

class CheckNameAvailabilityResultImpl extends WrapperImpl<CheckNameAvailabilityResultInner> implements CheckNameAvailabilityResult {
    private final EventHubsManager manager;
    CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner inner, EventHubsManager manager) {
        super(inner);
        this.manager = manager;
    }

    @Override
    public EventHubsManager manager() {
        return this.manager;
    }

    @Override
    public String message() {
        return this.inner().message();
    }

    @Override
    public Boolean nameAvailable() {
        return this.inner().nameAvailable();
    }

    @Override
    public UnavailableReason reason() {
        return this.inner().reason();
    }

}


text:
<?php declare(strict_types=1);

namespace CleverAge\ProcessBundle\Task\File;

use CleverAge\ProcessBundle\Model\AbstractConfigurableTask;
use CleverAge\ProcessBundle\Model\ProcessState;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\OptionsResolver\Exception\AccessException;
use Symfony\Component\OptionsResolver\Exception\ExceptionInterface;
use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
 * Read the whole file and output its content
 *
 * @todo Provide additional safeguards like if file exists and is readable
 *
 * @author Vincent Chalnot <vchalnot@clever-age.com>
 */
class FileReaderTask extends AbstractConfigurableTask
{
    /**
     * @param ProcessState $state
     *
     * @throws ExceptionInterface
     * @throws IOException
     */
    public function execute(ProcessState $state)
    {
        $options = $this->getOptions($state);

        $state->setOutput(file_get_contents($options['filename']));
    }

    /**
     * @param OptionsResolver $resolver
     *
     * @throws AccessException
     * @throws UndefinedOptionsException
     */
    protected function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired(
            [
                'filename',
            ]
        );
        $resolver->setAllowedTypes('filename', ['string']);
    }
}


text:
namespace gfx {

// Native port of android.widget.Scroller.
// * Change-Id: I4365946f890a76fcfa78ca9d69f2a8e0848095a9
// * Please update the Change-Id as upstream Android changes are pulled.
class GFX_EXPORT Scroller {
 public:
  struct Config {
    Config();

    // Controls fling deceleration. Defaults to 0.015f.
    float fling_friction;

    // Controls fling accumulation. Defaults to disabled.
    bool flywheel_enabled;
  };

  explicit Scroller(const Config& config);
  ~Scroller();

  // Start scrolling by providing a starting point and the distance to travel.
  // The default value of 250 milliseconds will be used for the duration.
  void StartScroll(float start_x,
                   float start_y,
                   float dx,
                   float dy,
                   base::TimeTicks start_time);

  // Start scrolling by providing a starting point, the distance to travel,
  // and the duration of the scroll.
  void StartScroll(float start_x,
                   float start_y,
                   float dx,
                   float dy,
                   base::TimeTicks start_time,
                   base::TimeDelta duration);

  // Start scrolling based on a fling gesture. The distance travelled will
  // depend on the initial velocity of the fling.
  void Fling(float start_x,
             float start_y,
             float velocity_x,
             float velocity_y,
             float min_x,
             float max_x,
             float min_y,
             float max_y,
             base::TimeTicks start_time);

  // Call this when you want to know the new location.  If it returns true,
  // the animation is not yet finished.
  bool ComputeScrollOffset(base::TimeTicks time);

  // Extend the scroll animation by |extend|. This allows a running animation
  // to scroll further and longer when used with |SetFinalX()| or |SetFinalY()|.
  void ExtendDuration(base::TimeDelta extend);
  void SetFinalX(float new_x);
  void SetFinalY(float new_y);

  // Stops the animation. Contrary to |ForceFinished()|, aborting the animation
  // causes the scroller to move to the final x and y position.
  void AbortAnimation();

  // Terminate the scroll without affecting the current x and y positions.
  void ForceFinished(bool finished);

  // Returns whether the scroller has finished scrolling.
  bool IsFinished() const;

  // Returns the time elapsed since the beginning of the scrolling.
  base::TimeDelta GetTimePassed() const;

  // Returns how long the scroll event will take.
  base::TimeDelta GetDuration() const;

  float GetStartX() const;
  float GetStartY() const;
  float GetCurrX() const;
  float GetCurrY() const;
  float GetCurrVelocity() const;
  float GetCurrVelocityX() const;
  float GetCurrVelocityY() const;
  float GetFinalX() const;
  float GetFinalY() const;

  bool IsScrollingInDirection(float xvel, float yvel) const;

 private:
  enum Mode {
    UNDEFINED,
    SCROLL_MODE,
    FLING_MODE,
  };

  void OnDurationChanged();
  void RecomputeDeltas();

  double GetSplineDeceleration(float velocity) const;
  base::TimeDelta GetSplineFlingDuration(float velocity) const;
  double GetSplineFlingDistance(float velocity) const;

  Mode mode_;

  float start_x_;
  float start_y_;
  float final_x_;
  float final_y_;

  float min_x_;
  float max_x_;
  float min_y_;
  float max_y_;

  float curr_x_;
  float curr_y_;
  base::TimeTicks start_time_;
  base::TimeTicks curr_time_;
  base::TimeDelta duration_;
  double duration_seconds_reciprocal_;
  float delta_x_;
  float delta_x_norm_;
  float delta_y_;
  float delta_y_norm_;
  bool finished_;
  bool flywheel_enabled_;

  float velocity_;
  float curr_velocity_;
  float distance_;

  float fling_friction_;
  float deceleration_;
  float tuning_coeff_;
};

}  // namespace gfx

#endif  // UI_GFX_ANDROID_SCROLLER_H_


text:
class String
  def to_real_item
  	 fields = self.chomp
   	 fields = fields.split(":")
   	  RealItem.new(name: fields[0],price: fields[1].to_i,weight: fields[2].to_i)

  end
end


text:
require "spec_helper"

describe Lita::Handlers::LiterallyLita, lita_handler: true do
  it { routes("cocktail").to(:cocktail) }
  it { routes("XD").to(:xd) }

  describe "#cocktail" do
    it "wants to confirm that someone is discussing cocktails" do
      send_message("Anyone want to go for cocktails?")
      expect(replies.last).to include("Did someone mention cocktails?")
    end
  end

  describe "#xd" do
    it "smiles extra hard" do
      send_message("omg XD")
      expect(replies.last).to eq("XD")
    end
  end
end


text:
package org.jetbrains.plugins.scala.lang.parser.parsing.top

import org.jetbrains.plugins.scala.lang.parser.ScalaElementType
import org.jetbrains.plugins.scala.lang.parser.parsing.ParsingRule
import org.jetbrains.plugins.scala.lang.parser.parsing.base.AccessModifier
import org.jetbrains.plugins.scala.lang.parser.parsing.builder.ScalaPsiBuilder
import org.jetbrains.plugins.scala.lang.parser.parsing.expressions.Annotations

/**
 * [[ConstrMods]] ::= [[Annotations]] [ [[AccessModifier]] ]
 */
object ConstrMods extends ParsingRule {

  override def parse(implicit builder: ScalaPsiBuilder): Boolean = {
    Annotations.parseOnTheSameLine()

    val modifiersMarker = builder.mark()
    if (!builder.newlineBeforeCurrentToken) {
      AccessModifier()
    }
    modifiersMarker.done(ScalaElementType.MODIFIERS)

    true
  }
}


text:
using System;
using System.IO;

using Dicom.Log;

namespace Dicom.Network {
	public class DicomCEchoProvider : DicomService, IDicomServiceProvider, IDicomCEchoProvider {
		public DicomCEchoProvider(Stream stream, Logger log) : base(stream, log) {
		}

		public void OnReceiveAssociationRequest(DicomAssociation association) {
			foreach (var pc in association.PresentationContexts) {
				if (pc.AbstractSyntax == DicomUID.Verification)
					pc.SetResult(DicomPresentationContextResult.Accept);
				else
					pc.SetResult(DicomPresentationContextResult.RejectAbstractSyntaxNotSupported);
			}
			SendAssociationAccept(association);
		}

		public void OnReceiveAssociationReleaseRequest() {
			SendAssociationReleaseResponse();
		}

		public void OnReceiveAbort(DicomAbortSource source, DicomAbortReason reason) {
		}

		public void OnConnectionClosed(int errorCode) {
		}

		public DicomCEchoResponse OnCEchoRequest(DicomCEchoRequest request) {
			return new DicomCEchoResponse(request, DicomStatus.Success);
		}
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TRL.Common.Events;
using TRL.Common.Data;
using TRL.Common.Extensions.Data;
using TRL.Common.Models;
using TRL.Common.Collections;
using TRL.Logging;
//using TRL.Common.Extensions;

namespace TRL.Common.Handlers
{
    public class OrderQueueProcessor:IObserver
    {
        private IDataContext tradingData;
        private ObservableQueue<Order> orderQueue;
        private IOrderManager manager;
        private ILogger logger;

        public OrderQueueProcessor(IOrderManager manager, IDataContext tradingData, ObservableQueue<Order> orderQueue, ILogger logger)
        {
            this.manager = manager;
            this.tradingData = tradingData;
            this.orderQueue = orderQueue;
            this.logger = logger;

            this.orderQueue.RegisterObserver(this);
        }

        public void Update()
        {
            Order order = this.orderQueue.Dequeue();

            if (OrderExists(order))
                return;

            this.logger.Log(String.Format("{0:dd/MM/yyyy H:mm:ss.fff}, {1}, отправка заявки {2}.", DateTime.Now, this.GetType().Name, order.ToString()));

            if (order.Signal != null)
                CopyOrderAsCloseOrAsOpen(order);

            this.manager.PlaceOrder(order);

            this.tradingData.Get<ObservableHashSet<Order>>().Add(order);
        }

        private void CopyOrderAsCloseOrAsOpen(Order order)
        {
            double amount = this.tradingData.GetAmount(order.Signal.Strategy);

            if (amount == 0)
                this.tradingData.Get<ObservableHashSet<OpenOrder>>().Add(new OpenOrder(order));

            if (amount > 0 && order.TradeAction == TradeAction.Buy)
                this.tradingData.Get<ObservableHashSet<OpenOrder>>().Add(new OpenOrder(order));

            if (amount > 0 && order.TradeAction == TradeAction.Sell)
                this.tradingData.Get<ObservableHashSet<CloseOrder>>().Add(new CloseOrder(order));

            if (amount < 0 && order.TradeAction == TradeAction.Sell)
                this.tradingData.Get<ObservableHashSet<OpenOrder>>().Add(new OpenOrder(order));

            if (amount < 0 && order.TradeAction == TradeAction.Buy)
                this.tradingData.Get<ObservableHashSet<CloseOrder>>().Add(new CloseOrder(order));
        }

        private bool OrderExists(Order order)
        {
            try
            {
                return this.tradingData.Get<IEnumerable<Order>>().Any(o => o.Id == order.Id);
            }
            catch
            {
                return false;
            }
        }
    }
}


text:
package com.cpacm.moemusic.moe_music1s.ui.web;

import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.webkit.DownloadListener;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.cpacm.moemusic.moe_music1s.R;
import com.cpacm.moemusic.moe_music1s.ui.AbstractAppActivity;

/**
 * Created by DIY on 2016/11/19.
 */

public class BaseWebActivity extends AbstractAppActivity {
    private Toolbar toolbar;
    private TextView titleTv;
    private View shadowView;
    private WebView webView;
    private ProgressBar progressBar;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.web_layout);
        initToolBar();
        webView=(WebView)findViewById(R.id.home_web);
        progressBar=(ProgressBar)findViewById(R.id.webview_progress);
        initView();
    }

    protected void initToolBar(){
        toolbar=(Toolbar)findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowTitleEnabled(false);
        titleTv=(TextView)findViewById(R.id.navi_title);
        shadowView=findViewById(R.id.toolbar_shoadow);
        if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP){
            //GONE不显示
            shadowView.setVisibility(View.GONE);
        }
    }

    private void initView() {
        WebSettings webSettings = webView.getSettings();
        //允许访问文件
        webSettings.setAllowFileAccess(true);
        //支持JS
        webSettings.setJavaScriptEnabled(false);
        //关闭webview中缓存
        webSettings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
        //自动打开窗口
        webSettings.setDomStorageEnabled(true);
        webSettings.setAppCacheEnabled(true);
        webSettings.setDatabaseEnabled(true);
        if (Build.VERSION.SDK_INT >= 21) {
            webSettings.setMixedContentMode(WebSettings
                    .MIXED_CONTENT_ALWAYS_ALLOW);
        }
        if (Build.VERSION.SDK_INT >= 19) {
            //设置是否自动加载图片
            webSettings.setLoadsImagesAutomatically(true);
        } else {
            webSettings.setLoadsImagesAutomatically(false);
        }
        webView.setDownloadListener(new FileDownLoadListener());
        webView.setWebChromeClient(new WebChromeClient(){
            @Override
            public void onReceivedTitle(WebView view, String title) {
                super.onReceivedTitle(view, title);
                setTitle(title);
            }

            @Override
            public void onProgressChanged(WebView view, int position) {
                progressBar.setProgress(position);
                if(position==100){
                    progressBar.setVisibility(View.GONE);
                }
                super.onProgressChanged(view, position);
            }
        });
        webView.setWebViewClient(new BaseWebClient());
    }

    public void startUrl(){
        Intent intent=getIntent();
        String url=intent.getStringExtra("url");
        if(TextUtils.isEmpty(url)) return;
//        String title=intent.getStringExtra(title);
//        titleTv.setText(title);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id=item.getItemId();

        if(id==android.R.id.home){
            back();
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if(keyCode==KeyEvent.KEYCODE_BACK && webView.canGoBack()){
            finish();
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }

    public boolean back(){
        if(webView.canGoBack())
            webView.goBack();
        else
            onBackPressed();
        return true;
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if(webView !=null){
            webView.removeAllViews();
            webView.destroy();
        }
    }

    public void synCookies(final String url){
        final CookieManager cookieManager=CookieManager.getInstance();
        cookieManager.setAcceptCookie(true);
        removeCookies();
        if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP){
            cookieManager.setAcceptThirdPartyCookies(webView,true);
            cookieManager.flush();
        }else{
            CookieSyncManager.createInstance(webView.getContext());
            CookieSyncManager.getInstance().sync();
        }

    }

    public void removeCookies(){
        CookieManager cookieManager=CookieManager.getInstance();
        cookieManager.removeAllCookie();
        if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP){
            cookieManager.flush();
        }else{
            CookieSyncManager.createInstance(webView.getContext());
            //清除Cookie
            CookieSyncManager.getInstance().sync();;
        }
    }

    private class FileDownLoadListener implements DownloadListener{
        @Override
        public void onDownloadStart(String url, String userAgent,
                                    String contentDisposition,
                                    String mimetype,
                                    long contentLength) {
            Uri uri=Uri.parse(url);
            Intent intent=new Intent(Intent.ACTION_VIEW,uri);
            startActivity(intent);
        }
    }

    public class BaseWebClient extends WebViewClient{
        @Override
        public void onPageFinished(WebView view, String url) {
            super.onPageFinished(view, url);
        }

        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            if(!webView.getSettings().getLoadsImagesAutomatically()){
                webView.getSettings().setLoadsImagesAutomatically(true);
            }
            progressBar.setVisibility(View.VISIBLE);
            super.onPageStarted(view, url, favicon);
        }
    }
}


text:
import os

import numpy
try:
    from scipy import io
    _scipy_available = True
except Exception as e:
    _error = e
    _scipy_available = False

import chainer
from chainer.dataset import download
from chainer.datasets import tuple_dataset

def get_svhn(withlabel=True, scale=1., dtype=None, label_dtype=numpy.int32,
             add_extra=False):
    """Gets the SVHN dataset.

    `The Street View House Numbers (SVHN) dataset <http://ufldl.stanford.edu/housenumbers/>`_
    is a dataset similar to MNIST but composed of cropped images of house
    numbers.
    The functionality of this function is identical to the counterpart for the
    MNIST dataset (:func:`~chainer.datasets.get_mnist`),
    with the exception that there is no ``ndim`` argument.

    .. note::
       `SciPy <https://www.scipy.org/>`_ is required to use this feature.

    Args:
        withlabel (bool): If ``True``, it returns datasets with labels. In this
            case, each example is a tuple of an image and a label. Otherwise,
            the datasets only contain images.
        scale (float): Pixel value scale. If it is 1 (default), pixels are
            scaled to the interval ``[0, 1]``.
        dtype: Data type of resulting image arrays. ``chainer.config.dtype`` is
            used by default (see :ref:`configuration`).
        label_dtype: Data type of the labels.
        add_extra: Use extra training set.

    Returns:
        If ``add_extra`` is ``False``, a tuple of two datasets (train and test). Otherwise,
        a tuple of three datasets (train, test, and extra).
        If ``withlabel`` is ``True``, all datasets are :class:`~chainer.datasets.
        TupleDataset` instances. Otherwise, both datasets are arrays of images.

    """  # NOQA
    if not _scipy_available:
        raise RuntimeError('SciPy is not available: %s' % _error)

    train_raw = _retrieve_svhn_training()
    dtype = chainer.get_dtype(dtype)

    train = _preprocess_svhn(train_raw, withlabel, scale, dtype,
                             label_dtype)
    test_raw = _retrieve_svhn_test()
    test = _preprocess_svhn(test_raw, withlabel, scale, dtype,
                            label_dtype)
    if add_extra:
        extra_raw = _retrieve_svhn_extra()
        extra = _preprocess_svhn(extra_raw, withlabel, scale, dtype,
                                 label_dtype)
        return train, test, extra
    else:
        return train, test

def _preprocess_svhn(raw, withlabel, scale, image_dtype, label_dtype):
    images = raw["x"].transpose(3, 2, 0, 1)
    images = images.astype(image_dtype)
    images *= scale / 255.

    labels = raw["y"].astype(label_dtype).flatten()
    # labels go from 1-10, with the digit "0" having label 10.
    # Set "0" to be label 0 to restore expected ordering
    labels[labels == 10] = 0

    if withlabel:
        return tuple_dataset.TupleDataset(images, labels)
    else:
        return images

def _retrieve_svhn_training():
    url = "http://ufldl.stanford.edu/housenumbers/train_32x32.mat"
    return _retrieve_svhn("train.npz", url)

def _retrieve_svhn_test():
    url = "http://ufldl.stanford.edu/housenumbers/test_32x32.mat"
    return _retrieve_svhn("test.npz", url)

def _retrieve_svhn_extra():
    url = "http://ufldl.stanford.edu/housenumbers/extra_32x32.mat"
    return _retrieve_svhn("extra.npz", url)

def _retrieve_svhn(name, url):
    root = download.get_dataset_directory('pfnet/chainer/svhn')
    path = os.path.join(root, name)
    return download.cache_or_load_file(
        path, lambda path: _make_npz(path, url), numpy.load)

def _make_npz(path, url):
    _path = download.cached_download(url)
    raw = io.loadmat(_path)
    images = raw["X"].astype(numpy.uint8)
    labels = raw["y"].astype(numpy.uint8)

    numpy.savez_compressed(path, x=images, y=labels)
    return {'x': images, 'y': labels}


text:
/*
 * Created by SharpDevelop.
 * User: Skrylar
 * Date: 10/9/2011
 * Time: 3:30 AM
 *
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Runtime.InteropServices;

using FontHandle = System.IntPtr;
using FileHandle = System.IntPtr;
using uint32_t = System.UInt32;

namespace Allegro5Net.AL5
{
	/// <summary>
	/// Description of Ttf.
	/// </summary>
	public static class Ttf
	{
		public const string LIBRARY="allegro_ttf-5.0.dll";

		public enum TtfFontFlag : int
		{
			No_Kerning = 1,
			Monochrome = 2
		}

		[DllImport(LIBRARY, EntryPoint="al_load_ttf_font",
			CallingConvention=CallingConvention.Cdecl)]
		public static extern FontHandle al_load_ttf_font([MarshalAs(UnmanagedType.LPStr)] string filename, int size, int flags);
		[DllImport(LIBRARY, EntryPoint="al_load_ttf_font_f",
			CallingConvention=CallingConvention.Cdecl)]
		public static extern FontHandle al_load_ttf_font_f(FileHandle file, [MarshalAs(UnmanagedType.LPStr)] string filename, int size, int flags);
		[DllImport(LIBRARY, EntryPoint="al_init_ttf_addon",
			CallingConvention=CallingConvention.Cdecl)]
		public static extern bool al_init_ttf_addon();
		[DllImport(LIBRARY, EntryPoint="al_shutdown_ttf_addon",
			CallingConvention=CallingConvention.Cdecl)]
		public static extern void al_shutdown_ttf_addon();
		[DllImport(LIBRARY, EntryPoint="al_get_allegro_ttf_version",
			CallingConvention=CallingConvention.Cdecl)]
		public static extern uint32_t al_get_allegro_ttf_version();
	}
}


text:
import { Router, ActivatedRoute } from '@angular/router';
import { Component, OnInit, OnDestroy, AfterViewInit, ViewContainerRef, ViewChildren, ElementRef } from '@angular/core';
import { FormBuilder, FormGroup, FormControl, FormArray, Validators, FormControlName } from '@angular/forms';

import { BaseComponent } from './../../shared/base.component';
import { UsuarioService } from './../../services/usuario.service';
import { ResetarSenha } from './../../models/resetar-senha';
import { GenericValidator } from './../../utils/generic-form-validator';

import { CustomValidators, CustomFormsModule } from 'ng2-validation';
import { ToastsManager,Toast } from 'ng2-toastr/ng2-toastr';

import { Subscription } from 'rxjs/Subscription';

@Component({
  selector: 'app-resetar-senha',
  templateUrl: './resetar-senha.component.html',
  styleUrls: ['./resetar-senha.component.scss']
})
export class ResetarSenhaComponent extends BaseComponent implements OnInit, AfterViewInit, OnDestroy {
  @ViewChildren(FormControlName, { read: ElementRef }) formInputElements: ElementRef[];

  formulario:FormGroup;
  resetarModel:ResetarSenha;
  inscricao: Subscription;

  constructor(private usuarioService:UsuarioService,
              public toastr: ToastsManager,
              vcr: ViewContainerRef,
              private routerC: Router,
              private routeActivated: ActivatedRoute,
              private fb:FormBuilder) {

      super(toastr,vcr,routerC);

      this.validationMessages = {
        senha:{
            required: this.message.messages.ALTERAR_SENHA.SENHA_NOVA_REQUIRED,
            minlength: this.message.messages.ALTERAR_SENHA.SENHA_NOVA_MIN_LENGTH
        },
        confirmeSenha:{
            required: this.message.messages.ALTERAR_SENHA.SENHA_CONFIRME_REQUIRED,
            minlength: this.message.messages.ALTERAR_SENHA.SENHA_CONFIRME_MIN_LENGTH,
            equalTo: this.message.messages.ALTERAR_SENHA.SENHA_CONFIRME_EQUAL_TO
        }
      };

      this.genericValidator = new GenericValidator(this.validationMessages);
      this.resetarModel = new ResetarSenha();
   }

  ngOnInit() {
    this.inscricao = this.routeActivated.params.subscribe(
        (params:any) => {

            this.resetarModel = new ResetarSenha();

            this.resetarModel.Id = params['id'];
        }
    );

    let senha = new FormControl('', [Validators.required, Validators.minLength(6)]);
    let senhaConfirmacao = new FormControl('', [Validators.required, Validators.minLength(6), CustomValidators.equalTo(senha)]);

    this.formulario = this.fb.group({
      senha: senha,
      confirmeSenha: senhaConfirmacao
    });

    this.formulario.setValue({
      senha:'',
      confirmeSenha:''
    });
  }

  ngAfterViewInit(): void {
      this.validateOnBlur(this.formInputElements,this.formulario);
  }

  ngOnDestroy(){
    this.inscricao.unsubscribe();
  }

  resetar(){
    if (this.formIsValid(this.formulario)){
          this.showToastrInfo(this.message.messages.SHARED.MSG_SAVING);

          this.resetarModel.Senha = this.formulario.get("senha").value;
          this.resetarModel.ConfirmeSenha = this.formulario.get("confirmeSenha").value;

          this.usuarioService.resetarSenha(this.resetarModel)
          .subscribe(
              result => { this.onCompleteSuccess(result,
                this.message.messages.SHARED.MSG_SAVE_SUCCESS,
                this.message.routes.LOGIN.ENTRAR) },
              error => { this.onError(error) }
          );
    }
  }
}


text:
package org.wso2.andes.kernel;

import org.apache.axis2.clustering.ClusteringAgent;
import org.wso2.andes.configuration.AndesConfigurationManager;
import org.wso2.andes.configuration.StoreConfiguration;
import org.wso2.andes.configuration.enums.AndesConfiguration;
import org.wso2.andes.server.cluster.ClusterAgent;
import org.wso2.andes.subscription.SubscriptionEngine;

import java.util.List;

/**
 * AndesContext is used to pass instances created and configurations read through component level
 * to Andes. A place holder class.
 */
public class AndesContext {
    private SubscriptionEngine subscriptionEngine;
    private AndesContextStore andesContextStore;
    private StoreConfiguration storeConfiguration;
    private ClusteringAgent clusteringAgent;
    private boolean isClusteringEnabled;
    private AMQPConstructStore AMQPConstructStore;
    private static AndesContext instance = new AndesContext();
    private MessageStore messageStore;
    private int deliveryTimeoutForMessage;

    /**
     * This is mainly used by Cluster Manager to manger cluster communication
     */
    private ClusterAgent clusterAgent;

    /**
     * Getter for cluster agent
     *
     * @return cluster agent for this node if one is available, else null
     */
    public ClusterAgent getClusterAgent() {
        return clusterAgent;
    }

    /**
     * Setter for cluster agent.
     *
     * @param clusterAgent
     */
    public void setClusterAgent(ClusterAgent clusterAgent) {
        this.clusterAgent = clusterAgent;
    }

    /**
     * Get virtual host configuration object
     * @return StoreConfiguration
     */
    public StoreConfiguration getStoreConfiguration() {
        return storeConfiguration;
    }

    /**
     * get subscription store
     *
     * @return subscription store
     */
    public SubscriptionEngine getSubscriptionEngine() {
        return subscriptionEngine;
    }

    /**
     * set subscription store
     *
     * @param subscriptionEngine subscription store
     */
    public void setSubscriptionEngine(SubscriptionEngine subscriptionEngine) {
        this.subscriptionEngine = subscriptionEngine;
    }

    /**
     * set andes context store
     *
     * @param andesContextStore context store to store
     */
    public void setAndesContextStore(AndesContextStore andesContextStore) {
        this.andesContextStore = andesContextStore;
    }

    /**
     * get andes context store
     *
     * @return context store
     */
    public AndesContextStore getAndesContextStore() {
        return this.andesContextStore;
    }

    /**
     * get andes context instance
     *
     * @return andes context
     */
    public static AndesContext getInstance() {
        return instance;
    }

    /**
     * get if clustering is enabled
     *
     * @return if clustering is on
     */
    public boolean isClusteringEnabled() {
        return isClusteringEnabled;
    }

    /**
     * set if clustering is enabled
     *
     * @param isClusteringEnabled if clustering is enabled
     */
    public void setClusteringEnabled(boolean isClusteringEnabled) {
        this.isClusteringEnabled = isClusteringEnabled;
    }

    /**
     * set AMQP constructs store instance
     *
     * @param AMQPConstructStore AMQP constructs store
     */
    public void setAMQPConstructStore(AMQPConstructStore AMQPConstructStore) {
        this.AMQPConstructStore = AMQPConstructStore;
    }

    /**
     * get AMQP construct store
     *
     * @return AMQP construct store
     */
    public AMQPConstructStore getAMQPConstructStore() {
        return AMQPConstructStore;
    }

    /**
     *  get thrift server host ip
     * @return  thrift server host ip
     */
    public String getThriftServerHost() {
        return AndesConfigurationManager.readValue(AndesConfiguration.COORDINATION_THRIFT_SERVER_HOST);
    }

    /**
     * get thrift server port
     *
     * @return The port value
     */
    public Integer getThriftServerPort() {
        return AndesConfigurationManager.readValue(AndesConfiguration.COORDINATION_THRIFT_SERVER_PORT);
    }

    /**
     * Read configuration properties related to persistent stores and construct semantic object
     * for simple reference.
     */
    public void constructStoreConfiguration() {

        storeConfiguration = new StoreConfiguration();

        storeConfiguration.setMessageStoreClassName((String) AndesConfigurationManager.readValue
                (AndesConfiguration.PERSISTENCE_MESSAGE_STORE_HANDLER));

        List<String> messageStoreProperties = AndesConfigurationManager.readValueList
                (AndesConfiguration.LIST_PERSISTENCE_MESSAGE_STORE_PROPERTIES);

        for (String messageStoreProperty : messageStoreProperties) {
            storeConfiguration.addMessageStoreProperty(messageStoreProperty, (String) AndesConfigurationManager
                    .readValueOfChildByKey(AndesConfiguration.PERSISTENCE_MESSAGE_STORE_PROPERTY, messageStoreProperty));
        }

        storeConfiguration.setAndesContextStoreClassName((String) AndesConfigurationManager.readValue
                (AndesConfiguration.PERSISTENCE_CONTEXT_STORE_HANDLER));

        List<String> contextStoreProperties = AndesConfigurationManager.readValueList
                (AndesConfiguration.LIST_PERSISTENCE_CONTEXT_STORE_PROPERTIES);

        for (String contextStoreProperty : contextStoreProperties) {
            storeConfiguration.addContextStoreProperty(contextStoreProperty, (String) AndesConfigurationManager
                    .readValueOfChildByKey(AndesConfiguration.PERSISTENCE_CONTEXT_STORE_PROPERTY,contextStoreProperty));
        }
    }

    /**
     * Get delivery time out of a message. If this is breached an ack for the message
     * will be simulated internally.
     * @return time out value
     */
    public int getDeliveryTimeoutForMessage() {
        return deliveryTimeoutForMessage;
    }

    /**
     * Set delivery time out of a message. If this is breached an ack for the message
     * will be simulated internally.
     * @param deliveryTimeoutForMessage time out value to set
     */
    public void setDeliveryTimeoutForMessage(int deliveryTimeoutForMessage) {
        this.deliveryTimeoutForMessage = deliveryTimeoutForMessage;
    }

    /**
     * Gets the message store.
     *
     * @return The message store.
     */
    public MessageStore getMessageStore() {
        return messageStore;
    }

    /**
     * Sets message store instance
     *
     * @param messageStore The message store
     */
    public void setMessageStore(MessageStore messageStore) {
        this.messageStore = messageStore;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Game1
{
  public interface IDrawable
  {
    void Draw(SpriteBatch spriteBatch);
  }
  public interface IUpdateable
  {
    void Update(float dt);
  }
  public interface IComponent : IDrawable, IUpdateable { }

  public interface IStateMachine : IUpdateable
  {
      bool Busy { get; }
      void Reset();
    }

    public interface IAction {
      void Run();
  }
}