text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

namespace Microsoft.Azure.Commands.Batch.Utils
{
    public class Constants
    {
        public const int DefaultMaxCount = 1000;

        // ARM cmdlet nouns
        public const string AzureRmBatchAccount = "AzureRmBatchAccount";
        public const string AzureRmBatchAccountKey = "AzureRmBatchAccountKey";
        public const string AzureRmBatchAccountKeys = "AzureRmBatchAccountKeys";
        public const string AzureRmBatchSubscriptionQuotas = "AzureRmBatchSubscriptionQuotas";

        // Batch Service cmdlet nouns
        public const string AzureBatchPool = "AzureBatchPool";
        public const string AzureBatchPoolResize = "AzureBatchPoolResize";
        public const string AzureBatchComputeNode = "AzureBatchComputeNode";
        public const string AzureBatchComputeNodeUser = "AzureBatchComputeNodeUser";
        public const string AzureBatchJobSchedule = "AzureBatchJobSchedule";
        public const string AzureBatchJob = "AzureBatchJob";
        public const string AzureBatchTask = "AzureBatchTask";
        public const string AzureBatchNodeFile = "AzureBatchNodeFile";
        public const string AzureBatchNodeFileContent = "AzureBatchNodeFileContent";
        public const string AzureBatchRemoteDesktopProtocolFile = "AzureBatchRemoteDesktopProtocolFile";
        public const string AzureBatchAutoScale = "AzureBatchAutoScale";
        public const string AzureBatchPoolOSVersion = "AzureBatchPoolOSVersion";
        public const string AzureBatchCertificate = "AzureBatchCertificate";
        public const string AzureBatchCertificateDeletion = "AzureBatchCertificateDeletion";

        // Parameter sets
        public const string IdParameterSet = "Id";
        public const string ODataFilterParameterSet = "ODataFilter";
        public const string InputObjectParameterSet = "InputObject";
        public const string ParentObjectParameterSet = "ParentObject";
        public const string InputObjectAndPathParameterSet = "InputObject_Path";
        public const string InputObjectAndStreamParameterSet = "InputObject_Stream";
    }
}


text:
export class QueuedActions {

    static SAVE_IN_QUEUE = 'SAVE_IN_QUEUE';
    static DELETE_FROM_QUEUE = 'DELETE_FROM_QUEUE';
    static DELETE_FROM_QUEUE_COMMIT = 'DELETE_FROM_QUEUE_COMMIT';
    static GET_FROM_QUEUE = 'GET_FROM_QUEUE';
    static GET_FROM_QUEUE_COMMIT = 'GET_FROM_QUEUE_COMMIT';

    public saveInQueueAction(action) {

        return {
            type: action.type + '_SYNC',
            payload: action.payload,
            meta: action.meta,
        }
    }

    public getDeleteFromQueue(payload) {
        return {
            type: QueuedActions.DELETE_FROM_QUEUE,
            payload: payload,
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
module Softlayer
  class Location
    class Reservation
      class Rack
        class Member < Softlayer::Entity
          SERVICE = 'SoftLayer_Location_Reservation_Rack_Member'
          attr_accessor :id
          attr_accessor :location_id
          attr_accessor :location
          attr_accessor :location_reservation_rack

          def get_location
            request(:get_location, Softlayer::Location)
          end

          def get_location_reservation_rack
            request(:get_location_reservation_rack, Softlayer::Location::Reservation)
          end

          def get_object
            request(:get_object, Softlayer::Location::Reservation::Rack::Member)
          end

          class Representer < Softlayer::Entity::Representer
            include Representable::Hash
            include Representable::Coercion
            property :id, type: Integer
            property :location_id, type: Integer
          end
        end
      end
    end
  end
end


text:
package com.huawei.esdk.uc.professional.local.impl.autogen;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="deptId" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "deptId"
})
@XmlRootElement(name = "queryDeptInfo")
public class QueryDeptInfo {

    @XmlElement(required = true)
    protected String deptId;

    /**
     * Gets the value of the deptId property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDeptId() {
        return deptId;
    }

    /**
     * Sets the value of the deptId property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDeptId(String value) {
        this.deptId = value;
    }

}


text:
package org.acra.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * This array must not be empty for the configuration to be valid
 *
 * @author F43nd1r
 * @since 03.06.2017
 */

@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.METHOD)
public @interface NonEmpty {
}


text:
// -----------------------------------------------------------------------
// <copyright file="FileScheduleProvider.cs" company="Nathan Miller">
// The MIT License (MIT)
//
// Copyright(c) 2015 Nathan Miller
//
// 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.
// </copyright>
// -----------------------------------------------------------------------
namespace NFLToy.Provider.File
{
    using System;
    using System.Collections.Generic;
    using System.IO;

    using Newtonsoft.Json;

    using NFLToy.Data;

    /// <summary>
    /// Default schedule provider that loads the schedule from disk.
    /// </summary>
    public class FileScheduleProvider : IScheduleProvider
    {
        /// <summary>
        /// Loaded games.
        /// </summary>
        private readonly List<GameInfo> games;

        /// <summary>
        /// Construct the provider.
        /// </summary>
        /// <param name="filename">Schedule database to load.</param>
        public FileScheduleProvider(string filename)
        {
            if (string.IsNullOrWhiteSpace(filename))
            {
                throw new ArgumentNullException(nameof(filename));
            }

            using (var file = File.OpenText(filename))
            {
                var serializer = JsonSerializer.Create();

                this.games = (List<GameInfo>)serializer.Deserialize(file, typeof(List<GameInfo>));
            }
        }

        /// <inheritdoc/>
        public IEnumerable<GameInfo> GetGames()
        {
            return this.games;
        }
    }
}


text:
server.js: FileServer.st
	../bin/amberc -m FileServer FileServer.st server

run: server.js
	./server

clean:
	rm -f FileServer.js server.js


text:
package gov.va.med.lom.vistabroker.patient.data;

public class RemoteStation {

  private String stationNo;
  private String stationName;
  private double lastSeenDate;
  private String lastEvent;

  public String getStationNo() {
    return stationNo;
  }
  public void setStationNo(String stationNo) {
    this.stationNo = stationNo;
  }
  public String getStationName() {
    return stationName;
  }
  public void setStationName(String stationName) {
    this.stationName = stationName;
  }
  public double getLastSeenDate() {
    return lastSeenDate;
  }
  public void setLastSeenDate(double lastSeenDate) {
    this.lastSeenDate = lastSeenDate;
  }
  public String getLastEvent() {
    return lastEvent;
  }
  public void setLastEvent(String lastEvent) {
    this.lastEvent = lastEvent;
  }

}


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.2.3.7-5-b-47
description: >
    Object.defineProperties - value of 'enumerable' property of
    'descObj' is a Boolean object (8.10.5 step 3.b)
---*/

        var obj = {};
        var accessed = false;

        Object.defineProperties(obj, {
            prop: {
                enumerable: new Boolean(true)
            }
        });
        for (var property in obj) {
            if (property === "prop") {
                accessed = true;
            }
        }

assert(accessed, 'accessed !== true');


text:
<?xml version="1.0"?>
<data>
<histogram misc="0" name="load-times" type="int"/>
<INPUT type="text" OnDBLClick="retreive( )" testapos="JSFunction('val1','val2')"/>
</data>


text:
begin
  require 'spec'
rescue LoadError
  require 'rubygems'
  gem 'rspec'
  require 'spec'
end

require File.dirname(__FILE__) + '/../lib/hierclust'


text:
#ifndef ALINEUTRALMESONSELECTION_H
#define ALINEUTRALMESONSELECTION_H

//_________________________________________________________________________
/// \class AliNeutralMesonSelection
/// \ingroup CaloTrackCorrelationsBase
/// \brief Class that contains methods to select candidate cluster pairs to neutral meson.
///
/// Class that contains methods to select candidate pairs to neutral meson.
/// 2 main selections, invariant mass around pi0 (also any other mass),
/// apperture angle to distinguish from combinatorial.
/// There is a 3rd cut based on the gamma correlation on phi or pt.
///
/// More information can be found in this [twiki](https://twiki.cern.ch/twiki/bin/viewauth/ALICE/PhotonHadronCorrelations).
///
/// \author Gustavo Conesa Balbastre <Gustavo.Conesa.Balbastre@cern.ch>, LPSC-IN2P3-CNRS
//_________________________________________________________________________

// --- ROOT system ---
#include<TObject.h>
#include<TArrayD.h>
#include<TString.h>

class TLorentzVector ;
class TList   ;
class TH2F    ;

class AliNeutralMesonSelection : public TObject {

 public:

  AliNeutralMesonSelection() ; // default ctor

  /// Virtual destructor.
  virtual ~AliNeutralMesonSelection() { ; }

  // General

  TList *  GetCreateOutputObjects();

  void     InitParameters();

  void     Print(const Option_t * opt) const;

  Bool_t   AreNeutralMesonSelectionHistosKept()   const { return fKeepNeutralMesonHistos ; }
  void     KeepNeutralMesonSelectionHistos(Bool_t keep) { fKeepNeutralMesonHistos = keep ; }

  Bool_t   SelectPair(TLorentzVector particlei,  TLorentzVector particlej, Int_t calo)  ;

  void     SetParticle(TString particleName) ;  // Do some default settings for "Pi0" or "Eta"
  TString  GetParticle()                          const { return fParticle               ; }

  Int_t  GetDebug()                               const { return fDebug                  ; }
  void   SetDebug(Int_t d)                              { fDebug = d                     ; }

  // Asymmetry selection

  Float_t  GetAsymmetryCut()                      const { return fAsymmetryCut           ; }
  void     SetAsymmetryCut(Float_t asy)                 { fAsymmetryCut = asy            ; }

  void     SwitchOnAsymmetryCut()                       { fUseAsymmetryCut = kTRUE       ; }
  void     SwitchOffAsymmetryCut()                      { fUseAsymmetryCut = kFALSE      ; }

  //Opening angle selection

  Double_t GetAngleMaxParam(Int_t i)              const { return fAngleMaxParam.At(i)    ; }
  void     SetAngleMaxParam(Int_t i, Double_t par)      { fAngleMaxParam.AddAt(par,i)    ; }

  void     SetShiftMinAngleCut(Float_t a, Float_t b)    { fShiftMinAngle[0] = a          ;
                                                          fShiftMinAngle[1] = b          ; }

  void     SwitchOnAngleSelection()                     { fUseAngleCut = kTRUE           ; }
  void     SwitchOffAngleSelection()                    { fUseAngleCut = kFALSE          ; }

  Bool_t   IsAngleInWindow(Float_t angle, Float_t e) const ;

  //Invariant mass selection

  Double_t GetInvMassMaxCut()                     const { return fInvMassMaxCut          ; }
  Double_t GetInvMassMinCut()                     const { return fInvMassMinCut          ; }

  void     SetInvMassCutRange(Double_t invmassmin, Double_t invmassmax)
            { fInvMassMaxCut =invmassmax;  fInvMassMinCut =invmassmin                    ; }

  void     SetSideBandCutRanges( Double_t lmin, Double_t lmax,
                                 Double_t rmin, Double_t rmax )
            { fLeftBandMinCut  = lmin ; fLeftBandMaxCut  = lmax ;
              fRightBandMinCut = rmin ; fRightBandMaxCut = rmax ; }

  void     SetInvMassCutMaxParameters(Float_t a, Float_t b, Float_t c)
            { fInvMassMaxCutParam[0] = a ;
              fInvMassMaxCutParam[1] = b ;
              fInvMassMaxCutParam[2] = c ; }

  Double_t GetMass()                              const { return fM                      ; }
  void     SetMass(Double_t m)                          { fM = m                         ; }

  // Decay photon bit setting
  static const Int_t fgkMaxNDecayBits = 8;

  enum decayTypes { kPi0          = 0, kEta          = 1,
                    kPi0RightSide = 2, kEtaRightSide = 3, kEtaLeftSide  = 4,
                    kPi0LeftSide  = 5, kEtaBothSides = 6, kPi0BothSides = 7 } ;

  UInt_t    GetDecayBit()                         const { return fDecayBit               ; }

  void    SetDecayBit(Int_t &tag, UInt_t set) const {
    // Set bit of type set (decayTypes) in tag
    tag |= (1<<set) ;
  }

  void    SetDecayBit(Int_t &tag) const {
    // Set bit of type set (decayTypes) in tag
    tag |= (1<<fDecayBit) ;
  }

  Bool_t  CheckDecayBit(Int_t tag, UInt_t test) const {
    // Check if in tag the bit test (decayTypes) is set.
    if (tag & (1<<test) ) return  kTRUE ;
    else return kFALSE ;
  }

  Bool_t  CheckDecayBit(Int_t tag) const {
    // Check if in tag the bit test (decayTypes) is set.
    if (tag & (1<<fDecayBit) ) return  kTRUE ;
    else return kFALSE ;
  }

  // Histograms setters and getters

  virtual void SetHistoERangeAndNBins(Float_t min, Float_t max, Int_t n) {
    fHistoNEBins = n ;
    fHistoEMax = max ;
    fHistoEMin = min ;
  }

  Int_t   GetHistoNEBins()     const { return fHistoNEBins    ; }
  Float_t GetHistoEMin()       const { return fHistoEMin      ; }
  Float_t GetHistoEMax()       const { return fHistoEMax      ; }

  virtual void SetHistoAngleRangeAndNBins(Float_t min, Float_t max, Int_t n) {
    fHistoNAngleBins = n ;
    fHistoAngleMax = max ;
    fHistoAngleMin = min ;
  }

  Int_t   GetHistoNAngleBins() const { return fHistoNAngleBins ; }
  Float_t GetHistoAngleMin()   const { return fHistoAngleMin   ; }
  Float_t GetHistoAngleMax()   const { return fHistoAngleMax   ; }

  virtual void SetHistoIMRangeAndNBins(Float_t min, Float_t max, Int_t n) {
    fHistoNIMBins = n ;
    fHistoIMMax = max ;
    fHistoIMMin = min ;
  }

  Int_t   GetHistoNIMBins()    const { return fHistoNIMBins    ; }
  Float_t GetHistoIMMin()      const { return fHistoIMMin      ; }
  Float_t GetHistoIMMax()      const { return fHistoIMMax      ; }

 private:

  Float_t  fAsymmetryCut  ;               ///<  Asymmetry cut.

  Bool_t   fUseAsymmetryCut;              ///<  Use the asymmetry cut.

  Double_t fM ;                           ///<  Mass of the neutral meson.

  Double_t fInvMassMaxCut ;               ///<  Invariant Mass cut maximum.

  Double_t fInvMassMinCut ;               ///<  Invariant Masscut minimun.

  Double_t fInvMassMaxCutParam[3];        ///<  Variable invariant mass max cut, for pi0 in EMCAL.

  Double_t fLeftBandMinCut  ;             ///<  Side Band selection, min left  band cut.

  Double_t fLeftBandMaxCut  ;             ///<  Side Band selection, max left  band cut.

  Double_t fRightBandMinCut ;             ///<  Side Band selection, min right band cut.

  Double_t fRightBandMaxCut ;             ///<  Side Band selection, max right band cut.

  TArrayD  fAngleMaxParam ;               ///<  Maximum opening angle selection parameters.

  Bool_t   fUseAngleCut   ;               ///<  Select pairs depending on their opening angle.

  Float_t  fShiftMinAngle[2] ;            ///<  Correction shift for min angle from true kinematic limit, resolution effects.

  Bool_t   fKeepNeutralMesonHistos ;      ///<  Keep neutral meson selection histograms.

  TString  fParticle ;                    ///<  Meutral meson name (Pi0, Eta, +SideBand).

  UInt_t   fDecayBit;                     ///<  Decay type flag, set while selecting, depending on fParticle and side range. See enum decayTypes for possible bits.

  Int_t    fDebug ;                       ///< Debug level.

  // Histograms
  TH2F *   fhAnglePairNoCut ;             //!<! Aperture angle of decay photons, no cuts.

  TH2F *   fhAnglePairOpeningAngleCut ;   //!<! Aperture angle of decay photons, cut on opening angle.

  TH2F *   fhAnglePairAsymmetryCut ;      //!<! Aperture angle of decay photons, asymmetry cut.

  TH2F *   fhAnglePairAllCut ;            //!<! Aperture angle of decay photons, all cuts.

  TH2F *   fhInvMassPairNoCut ;           //!<! Invariant mass of decay photons, no cuts.

  TH2F *   fhInvMassPairOpeningAngleCut ; //!<! Invariant mass of decay photons, cut on opening angle.

  TH2F *   fhInvMassPairAsymmetryCut ;    //!<! Invariant mass of decay photons, asymmetry cut.

  TH2F *   fhInvMassPairAllCut ;          //!<! Invariant mass of decay photons, all cuts.

  TH2F *   fhAsymmetryNoCut ;             //!<! Asymmetry of decay photons, no cuts.

  TH2F *   fhAsymmetryOpeningAngleCut ;   //!<! Asymmetry of decay photons, cut on opening angle.

  TH2F *   fhAsymmetryAllCut ;            //!<! Asymmetry of decay photons, all cuts.

  // Histograms binning and range
  Int_t    fHistoNEBins ;                 ///< Number of bins in pi0 E axis.

  Float_t  fHistoEMax ;                   ///< Maximum value of pi0 E histogram range.

  Float_t  fHistoEMin ;                   ///< Minimum value of pi0 E histogram range.

  Int_t    fHistoNAngleBins ;             ///< Number of bins in angle axis.

  Float_t  fHistoAngleMax ;               ///< Maximum value of angle histogram range.

  Float_t  fHistoAngleMin ;               ///< Minimum value of angle histogram range.

  Int_t    fHistoNIMBins ;                ///< Number of bins in Invariant Mass axis.

  Float_t  fHistoIMMax ;                  ///< Maximum value of Invariant Mass histogram range.

  Float_t  fHistoIMMin ;                  ///< Minimum value of Invariant Mass histogram range.

  /// Copy constructor not implemented.
  AliNeutralMesonSelection(              const AliNeutralMesonSelection & nm) ;

  /// Assignment operator not implemented.
  AliNeutralMesonSelection & operator = (const AliNeutralMesonSelection & nm) ;

  /// \cond CLASSIMP
  ClassDef(AliNeutralMesonSelection,8) ;
  /// \endcond

} ;

#endif //ALINEUTRALMESONSELECTION_H


text:
<!DOCTYPE html>

    {% include 'inc/head.html' %}

    {% include 'inc/header.html' %}

Why Kotlin?

                        {% for feature in features %}

{{ feature.title }}

{{ feature.description }}

                                See example

                        {% endfor %}

        {% for feature in features %}

                    {{ feature.content | safe }}

        {% endfor %}

    {# This fle conteins a lot of pre-formatted code. #}
    {% include 'inc/pages/index/code-examples.html' %}

                    See Kotlin in action

Try Kotlin

{{ data.releases.latest.version }}

In the browser

Try Online

                        Explore Kotlin code samples and solve problems directly in your browser.

                            Try Online

Standalone

Compiler

                        Compile your code from the command line or use build tools such as Ant, Gradle and Maven.

                        Download Compiler

Use

IntelliJ IDEA

                        Kotlin works with the free Community Edition, IntelliJ IDEA Ultimate or Android Studio.

                            Setup Plugin

Use

Eclipse

                        Get a preview version of the Kotlin plugin for Eclipse Luna.

                            Setup Plugin

Setting Up IntelliJ IDEA

Milestone Versions

                        A stable milestone version of Kotlin can be obtained from JetBrains Plugin
                        Repository.

                        In IDEA navigate to: Settings -> Plugins -> Browse Repositories

                        Select the Kotlin plugin and then Download and Install.

Using the Kotlin Nightly Builds

In IDEA navigate to: Preferences -> Plugins -> Browse Repositories. Enter:

                            for IntelliJ IDEA 13 EAP:

                                http://teamcity.jetbrains.com/guestAuth/repository/download/bt345/.lastSuccessful/updatePlugins.xml

                            for IntelliJ IDEA 12.1.5:

                                http://teamcity.jetbrains.com/guestAuth/repository/download/bt345/.lastSuccessful/updatePlugins.xml?branch=idea12

                            for IntelliJ IDEA 12.1.4 and below: download manually, see instructions below.

Then you should be able to select the Kotlin plugin and Download and Install. The repository
                        above contains nightly builds published automatically.

Who's using Kotlin

                        {% for testimonial in data['companies-using-kotlin'] %}

{{ testimonial.description }}

                                    {% if testimonial.logo or testimonial.url %}

                                            {{ testimonial.company }}

                                    {% else %}
                                        {{ testimonial.company }}
                                    {% endif %}

                        {% endfor %}

Stay in touch

                        Blog

                        Community

                        Twitter

                        Issue Tracker

{% include 'inc/footer.html' %}


text:
@interface UIView (MMActivityIndicator)

@property (nonatomic, strong) UIActivityIndicatorView *mm_activityIndicator;

- (void)mm_addActivityIndicator;
- (void)mm_addActivityIndicatorWithStyle:(UIActivityIndicatorViewStyle)activityStyle;
- (void)mm_removeActivityIndicator;

@end


text:
use std::fmt;
use kailua_env::Spanned;
use kailua_diag::Result;
use kailua_syntax::Name;
use kailua_syntax::ast::{FuncKind, Returns};

use diag::{Origin, TypeReport, TypeResult};
use super::{Display, DisplayState, Ty, TySeq, TypeContext, TypeResolver, Lattice};

/// A function type.
#[derive(Clone, PartialEq)]
pub struct Function {
    /// Argument types.
    pub args: TySeq,

    /// Optional argument names, used for diagnostics only.
    pub argnames: Vec<Option<Spanned<Name>>>,

    /// Return types, or `None` if the function diverges.
    pub returns: Option<TySeq>,
}

impl Function {
    pub fn from_kind(func: &Spanned<FuncKind>, resolv: &mut TypeResolver) -> Result<Function> {
        let args = TySeq::from_kind_seq(&func.args, |namekind| &namekind.1, resolv)?;
        let mut argnames = Vec::new();
        for (i, &(ref name, _)) in func.args.head.iter().enumerate() {
            if let Some(ref name) = *name {
                argnames.resize(i, None);
                argnames.push(Some(name.clone()));
            }
        }
        let returns = match func.returns {
            Returns::Seq(ref seq) => Some(TySeq::from_kind_seq(seq, |kind| kind, resolv)?),
            Returns::Never(_span) => None,
        };
        Ok(Function { args: args, argnames: argnames, returns: returns })
    }

    fn assert_sub(&self, other: &Self, ctx: &mut TypeContext) -> TypeResult<()> {
        // contravariant
        other.args.assert_sub(&self.args, ctx)?;

        // covariant, ! <: any seq
        match (&self.returns, &other.returns) {
            (&Some(ref lhs), &Some(ref rhs)) => lhs.assert_sub(rhs, ctx),
            (&Some(ref lhs), &None) => {
                Err(ctx.gen_report().not_sub(Origin::Functions, lhs, "!", ctx))
            },
            (&None, _) => Ok(()),
        }
    }

    fn assert_eq(&self, other: &Self, ctx: &mut TypeContext) -> TypeResult<()> {
        self.args.assert_eq(&other.args, ctx)?;

        match (&self.returns, &other.returns) {
            (&Some(ref lhs), &Some(ref rhs)) => lhs.assert_sub(rhs, ctx),
            (&Some(ref lhs), &None) => {
                Err(ctx.gen_report().not_sub(Origin::Functions, lhs, "!", ctx))
            },
            (&None, &Some(ref rhs)) => {
                Err(ctx.gen_report().not_sub(Origin::Functions, "!", rhs, ctx))
            },
            (&None, &None) => Ok(()),
        }
    }

    fn fmt_generic<WriteTy, WriteTySeq>(&self, f: &mut fmt::Formatter,
                                        mut write_ty: WriteTy,
                                        mut write_tyseq: WriteTySeq) -> fmt::Result
            where WriteTy: FnMut(&Ty, &mut fmt::Formatter, bool) -> fmt::Result,
                  WriteTySeq: FnMut(&TySeq, &mut fmt::Formatter) -> fmt::Result {
        // we cannot directly print self.args as they should be interleaved with self.argnames
        write!(f, "function(")?;
        let mut first = true;
        let mut names = self.argnames.iter();
        for t in &self.args.head {
            if first { first = false; } else { write!(f, ", ")?; }
            if let Some(name) = names.next() {
                if let Some(ref name) = *name {
                    write!(f, "{:+}: ", name)?;
                }
            }
            write_ty(t, f, false)?;
        }
        if let Some(ref t) = self.args.tail {
            if !first { write!(f, ", ")?; }
            write_ty(t, f, true)?;
            write!(f, "...")?;
        }
        write!(f, ")")?;

        match self.returns {
            Some(ref returns) => match (returns.head.len(), returns.tail.is_some()) {
                (0, false) => write!(f, " --> ()"),
                (1, false) => {
                    write!(f, " --> ")?;
                    write_ty(&returns.head[0], f, false)
                },
                (_, _) => {
                    write!(f, " --> ")?;
                    write_tyseq(returns, f)
                },
            },
            None => write!(f, " --> !"),
        }
    }
}

impl Display for Function {
    fn fmt_displayed(&self, f: &mut fmt::Formatter, st: &DisplayState) -> fmt::Result {
        self.fmt_generic(
            f,
            |t, f, without_nil| {
                let t = t.display(st);
                if without_nil { write!(f, "{:#}", t) } else { write!(f, "{}", t) }
            },
            |s, f| fmt::Display::fmt(&s.display(st), f),
        )
    }
}

impl fmt::Debug for Function {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        self.fmt_generic(
            f,
            |t, f, without_nil| {
                if without_nil { write!(f, "{:#?}", t) } else { write!(f, "{:?}", t) }
            },
            fmt::Debug::fmt,
        )
    }
}

/// Function types.
#[derive(Clone)]
pub enum Functions {
    /// A single, not overloaded function.
    Simple(Function),

    /// Any function. (This is not really callable.)
    All,
}

impl Functions {
    fn fmt_generic<WriteFunc>(&self, f: &mut fmt::Formatter,
                              mut write_func: WriteFunc) -> fmt::Result
            where WriteFunc: FnMut(&Function, &mut fmt::Formatter) -> fmt::Result {
        match *self {
            Functions::All => write!(f, "function"),
            Functions::Simple(ref fty) => write_func(fty, f),
        }
    }
}

impl Lattice for Functions {
    fn assert_sub(&self, other: &Self, ctx: &mut TypeContext) -> TypeResult<()> {
        (|| {
            match (self, other) {
                (_, &Functions::All) => Ok(()),
                (&Functions::All, _) => Err(ctx.gen_report()),

                (&Functions::Simple(ref a), &Functions::Simple(ref b)) => a.assert_sub(b, ctx),
            }
        })().map_err(|r: TypeReport| r.not_sub(Origin::Functions, self, other, ctx))
    }

    fn assert_eq(&self, other: &Self, ctx: &mut TypeContext) -> TypeResult<()> {
        (|| {
            match (self, other) {
                (&Functions::All, &Functions::All) => Ok(()),
                (&Functions::Simple(ref a), &Functions::Simple(ref b)) => a.assert_eq(b, ctx),
                (_, _) => Err(ctx.gen_report()),
            }
        })().map_err(|r: TypeReport| r.not_eq(Origin::Functions, self, other, ctx))
    }
}

impl PartialEq for Functions {
    fn eq(&self, other: &Functions) -> bool {
        match (self, other) {
            (&Functions::All, &Functions::All) => true,
            (&Functions::Simple(ref a), &Functions::Simple(ref b)) => *a == *b,
            (_, _) => false,
        }
    }
}

impl Display for Functions {
    fn fmt_displayed(&self, f: &mut fmt::Formatter, st: &DisplayState) -> fmt::Result {
        self.fmt_generic(f, |t, f| fmt::Display::fmt(&t.display(st), f))
    }
}

impl fmt::Debug for Functions {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        self.fmt_generic(f, fmt::Debug::fmt)
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

        <title>Home - Pahina de Pilipinas</title>
        <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <link rel="icon" type="image/x-icon" href="favicon.ico" />
        <link rel="stylesheet" type="text/css" media="screen, print" href="css/default.css" title="Default" />
        <link rel="alternate stylesheet" type="text/css" media="screen" href="css/alternate.css" title="High Contrast" />

        <?php
        /*
        Legend: 27 [Don't count conceptual and attribute guides]
        # : Page Guide (6)
        #*: Page Extra (5)
        ? :    Usability Guide (6)
        ?*: Usability Extra (6)
        ! :    Accessibility Guide (4)
        !*: Accessibility Extra (0)
        []: Conceptual Guide (2)
        (): Attribute Guide (5)
        */
        ?>

            d
            Ang pambansang pahina ng Pilipino

                [Skip]

                Home

                About

                Section

                Section

                Section

        <form id="search" action="/path/search_result.php">
            <fieldset>
                <legend>Search</legend>
                Search for:
                <input type="text" name="search_field" id="search_field" value="Keyword" />
                <input type="submit" name="search_submit" id="search_submit" value="Go" />
            </fieldset>
        </form>

Header: Lorem ipsum dolor sit amet, consectetuer adipiscing elit!

Subheader

                        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
                        Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
                        Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros
                        et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

Subheader

                        Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
                        Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros
                        et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
                        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Subheader

                        Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros
                        et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
                        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
                        Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Subheader

                        Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros
                        et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
                        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
                        Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Local Links

                        Lorem ipsum dolor

                        Sit amet, consectetuer

                        Adipiscing Elit, sed diam

                        Nonummy Nibh

                        Euismod tincidunt Ut laoreet

                        Dolore magna aliquam

                        Erat volutpat Ut wisi enim ad

External Links

                            Ut wisi enim ad minim

                            Veniam, quis nostrud exerci

                            Tation ullamcorper suscipit

                            Lobortis nisl ut aliquip ex

                            Ea commodo consequat

Advertisement

                            Duis autem vel eum iriure

                            Dolor in hendrerit in vulputate

                            Velit esse molestie consequat

                            Vel illum dolore eu feugiat

                            Nulla facilisis at vero eros et

                Copyright © 2010

                    NoobSociety.com
                . All rights reserved.

                        xhtml1.0

                        css3

                        µf

                        aaa2

                        508

                        cynthia

                        cc


text:
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';
import { Store } from '@ngxs/store';
import { IdName, Label, LoadOpts, Project } from 'app/model/project.model';
import { ProjectStore } from 'app/service/project/project.store';
import { LabelsEditComponent } from 'app/shared/labels/edit/labels.edit.component';
import { EnrichProject } from 'app/store/project.action';
import { finalize } from 'rxjs/operators';
import { NzModalService } from 'ng-zorro-antd/modal';

@Component({
    selector: 'app-project-workflows',
    templateUrl: './workflow.list.html',
    styleUrls: ['./workflow.list.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class ProjectWorkflowListComponent implements OnInit {

    @Input()
    set project(project: Project) {
        this._project = project;
        if (project.workflow_names) {
            let filter = this.filter.toLowerCase();
            this.filteredWorkflows = project.workflow_names.filter((wf) => wf.name.toLowerCase().indexOf(filter) !== -1);
        }
        if (project.labels) {
            let labelFilter = this.labelFilter.toLowerCase();
            this.filteredLabels = project.labels.filter((lbl) => lbl.name.toLowerCase().indexOf(labelFilter) !== -1);
        }
    }

    get project(): Project {
        return this._project;
    }

    set filter(filter: string) {
        this._filter = filter;
        if (this.project.workflow_names) {
            let filterLower = filter.toLowerCase();
            this.filteredWorkflows = this.project.workflow_names.filter((wf) => wf.name.toLowerCase().indexOf(filterLower) !== -1);
        }
    }

    get filter(): string {
        return this._filter;
    }

    set labelFilter(filter: string) {
        this._filterLabel = filter;
        if (this.project.labels) {
            let filterLower = filter.toLowerCase();
            this.filteredLabels = this.project.labels.filter((lbl) => lbl.name.toLowerCase().indexOf(filterLower) !== -1);
        }
    }

    get labelFilter(): string {
        return this._filterLabel;
    }

    _project: Project;
    _filter = '';
    _filterLabel = '';

    viewMode: 'blocs' | 'labels' | 'lines' = 'blocs';
    filteredWorkflows: Array<IdName> = [];
    filteredLabels: Array<Label> = [];
    loading = true;

    constructor(
        private store: Store,
        private _cd: ChangeDetectorRef,
        private _projectStore: ProjectStore,
        private _modalService: NzModalService
    ) { }

    ngOnInit(): void {
        this.viewMode = this._projectStore.getWorkflowViewMode(this.project.key);
        let opts: Array<LoadOpts> = [new LoadOpts('withWorkflowNames', 'workflow_names')];
        this.store.dispatch(new EnrichProject({ projectKey: this.project.key, opts }))
            .pipe(finalize(() => {
                this.loading = false;
                this._cd.markForCheck();
            }))
            .subscribe();
    }

    editLabels() {
        this._modalService.create({
                nzTitle: 'Labels',
                nzWidth: '900px',
                nzContent: LabelsEditComponent,
                nzComponentParams: {
                    project: this.project
                }
            });
    }

    setViewMode(mode: 'blocs' | 'labels' | 'lines') {
        this.viewMode = mode;
        this._projectStore.setWorkflowViewMode(this.project.key, mode);
    }
}


text:
package de.hska.iwi.microservice.catalog.service;

import de.hska.iwi.microservice.catalog.entity.Catalog;
import de.hska.iwi.microservice.catalog.entity.Category;
import de.hska.iwi.microservice.catalog.entity.Credential;
import de.hska.iwi.microservice.catalog.entity.Product;

import java.util.List;

/**
 * Created by ameo on 13.11.16.
 */
public interface ICatalogServiceFacade {
    boolean checkPermission(Credential credential);

    List<Category> getAllCategories();

    Category createCategory(Category category);

    Category updateCategory(int categoryId, Category category);

    Category getCategory(int categoryId);

    boolean deleteCategory(int categoryId);

    Product createProduct(Product product);

    Product updateProduct(int productId, Product product);

    boolean deleteProduct(int id);

    List<Product> getProducts(int categoryId);

    Product getProduct(int id);

    List<Catalog> getCatalog();

    List<Catalog> getCatalogCategorie(int categoryId);

    List<Product> searchCatalog(double minPrice, double maxPrice, String content);
}


text:
<?php

/**
 * @group rest-api
 */
class Papi_REST_API_Test extends WP_UnitTestCase {

	public function setUp() {
		parent::setUp();

		$this->class = new Papi_REST_API;
	}

	public function tearDown() {
		parent::tearDown();

		unset( $this->class );
	}

	public function test_actions() {
		$this->assertSame( 10, has_action( 'rest_api_init', [$this->class, 'rest_api_init'] ) );
		$this->assertSame( 10, has_action( 'rest_api_init', [$this->class, 'register_routes'] ) );
	}
}


text:
<?php

/* Created by Hatim Jacquir
 * User: Hatim Jacquir <jacquirhatim@gmail.com>
 */

namespace Hj\Tests\Unit;

use \Hj\File;
use \PHPUnit_Framework_TestCase;

require '../../vendor/autoload.php';

/**
 * @covers \Hj\File
 */
class FileTest extends PHPUnit_Framework_TestCase
{
    /**
     * @param string $filename
     *
     * @return File
     */
    private function getFile($filename)
    {
        return new File($filename);
    }

    public function testFileIsAnSplFileObject()
    {
        $file = $this->getFile('fixtures/test.jpg');

        $this->assertTrue($file->isFile());
        $this->assertInstanceOf('\SplFileObject', $file);
    }

    public function testFileShouldHaveTheCorrectOpenMode()
    {
        $file = $this->getFile('fixtures/test.png');

        $this->assertTrue($file->isFile());
        $this->assertAttributeEquals('r', 'openMode', $file);
    }

    public function testMethodGenerateFileNameOfTheCopyShouldReturnAString()
    {
        $file = $this->getFile('fixtures/test.jpg');

        $this->assertTrue($file->isFile());
        $this->assertContains('test.jpg', $file->generateFilenameOfTheCopy());
        $this->assertContains('fixtures/', $file->generateFilenameOfTheCopy());
    }

    /**
     * @dataProvider provideSupportedFormatOfFile
     *
     * @param string $filename
     */
    public function testMethodIsImageShouldReturnTrueWhenTheFileIsSupported($filename)
    {
        $file = $this->getFile($filename);

        $this->assertTrue($file->isFile());
        $this->assertTrue($file->isImage());
    }

    /**
     * @return array
     */
    public function provideSupportedFormatOfFile()
    {
        return array(
            array('fixtures/test.jpg'),
            array('fixtures/test.png'),
            array('fixtures/test.jpeg'),
        );
    }

    /**
     * @dataProvider provideNotSupportedFormatOfFile
     *
     * @param string $filename
     */
    public function testMethodIsImageShouldReturnFalseWhenTheFileIsNotSupported($filename)
    {
        $file = $this->getFile($filename);

        $this->assertTrue($file->isFile());
        $this->assertFalse($file->isImage());
    }

    /**
     * @return array
     */
    public function provideNotSupportedFormatOfFile()
    {
        return array(
            array('fixtures/test.avi'),
            array('fixtures/test.doc'),
            array('fixtures/test.docx'),
            array('fixtures/test.mp3'),
            array('fixtures/test.ppt'),
            array('fixtures/test.xls'),
        );
    }
}


text:
import ClipboardTransferMode from "openfl/desktop/ClipboardTransferMode";
import * as assert from "assert";

describe ("ES6 | ClipboardTransferMode", function () {

	it ("test", function () {

		switch (""+ClipboardTransferMode.CLONE_ONLY) {

			case ClipboardTransferMode.CLONE_ONLY:
			case ClipboardTransferMode.CLONE_PREFERRED:
			case ClipboardTransferMode.ORIGINAL_ONLY:
			case ClipboardTransferMode.ORIGINAL_PREFERRED:
				break;

			default:
				assert.ok (false);

		}

	});

});


text:
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.IO.Packaging;
using System.Collections.Generic;
using Mono.Options;

namespace MooGet.Commands {

	///moo pack
	public class PackCommand : MooGetCommand {

		[Command("pack", "Pack a package from a remote source")]
		public static object Run(string[] args) { return new PackCommand(args).Run(); }

		public PackCommand(string[] args) : base(args) {
			PrintHelpIfNoArguments = true;
			// Options = new OptionSet() {
			// 	{ "s|source=",  v => Source  = v },
			// 	{ "v|version=", v => Version = v }
			// };
		}

		/// moo pack
		public override object RunDefault() {
			if (Args.Count == 1)
				return PackNuspec(Args.First());
			else
				return "Nothing yet ... you need to pass in a nuspec to pack ...";
		}

		public virtual string RandomXsdId {
			get {
				var id    = "";
				var chars = "abcdefghijklmnopqrstuvwxyz0123456789";
				while (id.Length < 16) {
					id += chars[new Random((int) DateTime.Now.Ticks).Next(chars.Length)];
				}
				return "R" + id;
			}
		}

		// TODO - this whole method (except for the writelines) should be available on the Nuspec or Nupkg classes
		public virtual object PackNuspec(string nuspecPath) {
			var response = new StringBuilder();

			var nuspec = new Nuspec(Path.GetFullPath(nuspecPath));
			if (! nuspec.Exists())
				return string.Format("Nuspec not found: {0}\n", nuspecPath);

			var filename = nuspec.IdAndVersion() + ".nupkg";

			// Print out basic information about the package
			response.AppendFormat("Package Id: {0}\n", nuspec.Id);
			response.AppendFormat("Version:    {0}\n", nuspec.Version);
			response.AppendFormat("File:       {0}\n", filename);

			var zip = new Zip(Path.Combine(nuspec.DirName(), filename));
			if (zip.Exists())
				return string.Format("Package already exists: {0}\n", zip.FileName());

			// We always add the nuspec file to the nupkg
			zip.AddExisting(nuspec.FileName(), nuspec.Path);

			response.AppendFormat("Adding files:\n");

			// Add files specified in the <file> attributes of the Nuspec
			foreach (var fileSource in nuspec.FileSources) {
				foreach (var realFile in fileSource.GetFiles()) {
					var filePath = Path.GetFullPath(realFile);
					var relative = Path.GetFullPath(nuspec.DirName()).AsDir().Relative(filePath);
					if (! string.IsNullOrEmpty(fileSource.Target))
						relative = fileSource.Target.Replace("\\", "/") + "/" + Path.GetFileName(relative);
					response.AppendFormat("  {0}\n", relative.TrimStart(@"\/".ToCharArray()));
					zip.AddExisting(relative, filePath);
				}
			}

			// Ugh, need to do some ugly OpenXML bullshit ...

			using (var package = ZipPackage.Open(zip.Path, FileMode.OpenOrCreate, FileAccess.ReadWrite)) {
				// First, let's set some properties
				package.PackageProperties.Creator     = nuspec.AuthorsText;
				package.PackageProperties.Description = nuspec.Description;
				package.PackageProperties.Identifier  = nuspec.Id;
				package.PackageProperties.Version     = nuspec.VersionText;

				// Now, let's create an internal 'Relationship' to the nuspec file (for some reason)
				var nuspecUri           = new Uri("/" + nuspec.FileName(), UriKind.Relative);
				var someCrappyNamespace = "http://schemas.microsoft.com/packaging/2010/07/manifest";
				package.CreateRelationship(nuspecUri, TargetMode.Internal, someCrappyNamespace, RandomXsdId);

				// If there's a relationship with an (invalid) ID of 0, delete it and create it with a unique ID
                try {
				    var invalid = package.GetRelationship("0");
				    if (invalid != null) {
					    package.DeleteRelationship("0");
					    package.CreateRelationship(invalid.TargetUri, invalid.TargetMode, invalid.RelationshipType, RandomXsdId);
				    }
                } catch (Exception ex) {
                    if (! ex.Message.Contains("'0' ID is not a valid XSD ID")) // this is a safe exception to swallow
                        throw ex;
                }
			}

			return response;
		}
	}
}


text:
from .views import frontend

from .about import about
from .analysis import analysis
from .announcement import announcement
from .collection import collection
from .forum import forum
from .index import index
from .trade import trade
from .walkthrough import walkthrough
from .calendar import calendar

__all__ = ['frontend'
           'about', 'analysis', 'announcement', 'collection', 'forum',
           'index', 'trade', 'walkthrough', 'calendar']


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Aecidium dodartiae Tranzschel

### Remarks
null


text:
<?php

/* FOSUserBundle:Security:login.html.twig */
class __TwigTemplate_4b02061dd6f71fb6ceecdd5e81bf157a34a52ed65211c467615b3d8e1b7462d0 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = $this->env->loadTemplate("SonataUserBundle:Security:base_login.html.twig");

        $this->blocks = array(
        );
    }

    protected function doGetParent(array $context)
    {
        return "SonataUserBundle:Security:base_login.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    public function getTemplateName()
    {
        return "FOSUserBundle:Security:login.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array ();
    }
}


text: this is test3


text:
@extends('layouts.app')

@section('content')

            Provincia

        @include('adminlte-templates::common.errors')

                    {!! Form::open(['route' => 'provincias.store']) !!}

                        @include('provincias.fields')

                    {!! Form::close() !!}

@endsection


text:
require 'tzinfo'

module Clockworkd

  #
  # A 'cron line' is a line in the sense of a crontab
  # (man 5 crontab) file line.
  #
  class CronLine

    # The string used for creating this cronline instance.
    #
    attr_reader :original

    attr_reader :seconds
    attr_reader :minutes
    attr_reader :hours
    attr_reader :days
    attr_reader :months
    attr_reader :weekdays
    attr_reader :monthdays
    attr_reader :timezone

    def initialize(line)

      super()

      @original = line

      items = line.split

      @timezone = (TZInfo::Timezone.get(items.last) rescue nil)
      items.pop if @timezone

      raise ArgumentError.new(
        "not a valid cronline : '#{line}'"
      ) unless items.length == 5 or items.length == 6

      offset = items.length - 5

      @seconds = offset == 1 ? parse_item(items[0], 0, 59) : [ 0 ]
      @minutes = parse_item(items[0 + offset], 0, 59)
      @hours = parse_item(items[1 + offset], 0, 24)
      @days = parse_item(items[2 + offset], 1, 31)
      @months = parse_item(items[3 + offset], 1, 12)
      @weekdays, @monthdays = parse_weekdays(items[4 + offset])
    end

    # Returns true if the given time matches this cron line.
    #
    def matches?(time)

      time = Time.at(time) unless time.kind_of?(Time)

      time = @timezone.utc_to_local(time.getutc) if @timezone

      return false unless sub_match?(time.sec, @seconds)
      return false unless sub_match?(time.min, @minutes)
      return false unless sub_match?(time.hour, @hours)
      return false unless date_match?(time)
      true
    end

    # Returns the next time that this cron line is supposed to 'fire'
    #
    # This is raw, 3 secs to iterate over 1 year on my macbook :( brutal.
    # (Well, I was wrong, takes 0.001 sec on 1.8.7 and 1.9.1)
    #
    # This method accepts an optional Time parameter. It's the starting point
    # for the 'search'. By default, it's Time.now
    #
    # Note that the time instance returned will be in the same time zone that
    # the given start point Time (thus a result in the local time zone will
    # be passed if no start time is specified (search start time set to
    # Time.now))
    #
    #   Rufus::CronLine.new('30 7 * * *').next_time(
    #     Time.mktime(2008, 10, 24, 7, 29))
    #   #=> Fri Oct 24 07:30:00 -0500 2008
    #
    #   Rufus::CronLine.new('30 7 * * *').next_time(
    #     Time.utc(2008, 10, 24, 7, 29))
    #   #=> Fri Oct 24 07:30:00 UTC 2008
    #
    #   Rufus::CronLine.new('30 7 * * *').next_time(
    #     Time.utc(2008, 10, 24, 7, 29)).localtime
    #   #=> Fri Oct 24 02:30:00 -0500 2008
    #
    # (Thanks to K Liu for the note and the examples)
    #
    def next_time(now=Time.now)

      time = @timezone ? @timezone.utc_to_local(now.getutc) : now

      time = time - time.usec * 1e-6 + 1
        # little adjustment before starting

      loop do

        unless date_match?(time)
          time += (24 - time.hour) * 3600 - time.min * 60 - time.sec
          next
        end
        unless sub_match?(time.hour, @hours)
          time += (60 - time.min) * 60 - time.sec
          next
        end
        unless sub_match?(time.min, @minutes)
          time += 60 - time.sec
          next
        end
        unless sub_match?(time.sec, @seconds)
          time += 1
          next
        end

        break
      end

      if @timezone
        time = @timezone.local_to_utc(time)
        time = time.getlocal unless now.utc?
      end

      time
    end

    # Returns an array of 6 arrays (seconds, minutes, hours, days,
    # months, weekdays).
    # This method is used by the cronline unit tests.
    #
    def to_array

      [
        @seconds,
        @minutes,
        @hours,
        @days,
        @months,
        @weekdays,
        @monthdays,
        @timezone ? @timezone.name : nil
      ]
    end

    private

    WEEKDAYS = %w[ sun mon tue wed thu fri sat ]

    def parse_weekdays(item)

      return nil if item == '*'

      items = item.downcase.split(',')

      weekdays = nil
      monthdays = nil

      items.each do |it|

        if it.match(/#[12345]$/)

          raise ArgumentError.new(
            "ranges are not supported for monthdays (#{it})"
          ) if it.index('-')

          (monthdays ||= []) << it
        else

          WEEKDAYS.each_with_index { |a, i| it.gsub!(/#{a}/, i.to_s) }

          its = it.index('-') ? parse_range(it, 0, 7) : [ Integer(it) ]
          its = its.collect { |i| i == 7 ? 0 : i }

          (weekdays ||= []).concat(its)
        end
      end

      weekdays = weekdays.uniq if weekdays

      [ weekdays, monthdays ]
    end

    def parse_item(item, min, max)

      return nil if item == '*'
      return parse_list(item, min, max) if item.index(',')
      return parse_range(item, min, max) if item.index('*') or item.index('-')

      i = Integer(item)

      i = min if i < min
      i = max if i > max

      [ i ]
    end

    def parse_list(item, min, max)

      item.split(',').inject([]) { |r, i|
        r.push(parse_range(i, min, max))
      }.flatten
    end

    def parse_range(item, min, max)

      i = item.index('-')
      j = item.index('/')

      return item.to_i if (not i and not j)

      inc = j ? Integer(item[j+1..-1]) : 1

      istart = -1
      iend = -1

      if i

        istart = Integer(item[0..i - 1])

        if j
          iend = Integer(item[i + 1..j - 1])
        else
          iend = Integer(item[i + 1..-1])
        end

      else # case */x

        istart = min
        iend = max
      end

      istart = min if istart < min
      iend = max if iend > max

      result = []

      value = istart
      loop do
        result << value
        value = value + inc
        break if value > iend
      end

      result
    end

    def sub_match?(value, values)

      values.nil? || values.include?(value)
    end

    def monthday_match(monthday, monthdays)

      return true if monthdays == nil
      return true if monthdays.include?(monthday)
    end

    def date_match?(date)

      return false unless sub_match?(date.day, @days)
      return false unless sub_match?(date.month, @months)
      return false unless sub_match?(date.wday, @weekdays)
      return false unless sub_match?(CronLine.monthday(date), @monthdays)
      true
    end

    DAY_IN_SECONDS = 7 * 24 * 3600

    def self.monthday(date)

      count = 1
      date2 = date.dup

      loop do
        date2 = date2 - DAY_IN_SECONDS
        break if date2.month != date.month
        count = count + 1
      end

      "#{WEEKDAYS[date.wday]}##{count}"
    end
  end
end


text:
package pl.java.scalatech;

import java.io.File;
import java.io.IOException;
import java.util.concurrent.Callable;
import static com.jayway.awaitility.Awaitility.*;
import static java.util.concurrent.TimeUnit.*;
import static org.hamcrest.Matchers.*;
public class FileUtils {

	public static void createNewFile(File sourceFolder, String fileName) throws IOException {
		new File(sourceFolder, fileName).createNewFile();
	}

	public static void assertThatFileExistsInFolder(File targetFolder) throws Exception {
		waitAtMost(5, SECONDS).until(targetFolderSize(targetFolder), is(equalTo(1)));
	}

	private static Callable<Integer> targetFolderSize(final File folder) {
		return () -> folder.list().length;
	}

}


text:
/* Custom stylesheet that makes sure To and From fields are always visible when composing. */

.aoD.hl {
    display:none !important;
}

.fX.aXjCH {
    display:block !important;
}


text:
from validator.BaseValidator import BaseValidator

class ConditionalValidator(BaseValidator):

    operator = None #should be a lambda expression which return boolean variable
    message = "This value is not valid"

    def validate(self, fieldA, fieldB):

        fieldA = super(ConditionalValidator, self).validate(fieldA)
        fieldB = super(ConditionalValidator, self).validate(fieldB)

        return self.operator(fieldA, fieldB)

    def __init__(self, params):
        super(ConditionalValidator, self).__init__(params)

        if 'fieldB' in params:
            self.fieldB = params.get('fieldB')
        else:
            raise ValueError("Missing conditional field parameter")

        if 'operator' in params:
            self.operator = eval(params.get('operator'))
        else:
            raise ValueError("Missing operator parameter")

        if self.operator.__name__ != "<lambda>":
            raise ValueError("Operator should be an lambda function")


text:
// Code generated by main. DO NOT EDIT.

package v1

import (
	"context"
	"time"

	"github.com/rancher/lasso/pkg/client"
	"github.com/rancher/lasso/pkg/controller"
	"github.com/rancher/wrangler/pkg/generic"
	v1 "k8s.io/api/rbac/v1"
	"k8s.io/apimachinery/pkg/api/equality"
	"k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"k8s.io/apimachinery/pkg/types"
	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
	"k8s.io/apimachinery/pkg/watch"
	"k8s.io/client-go/tools/cache"
)

type RoleBindingHandler func(string, *v1.RoleBinding) (*v1.RoleBinding, error)

type RoleBindingController interface {
	generic.ControllerMeta
	RoleBindingClient

	OnChange(ctx context.Context, name string, sync RoleBindingHandler)
	OnRemove(ctx context.Context, name string, sync RoleBindingHandler)
	Enqueue(namespace, name string)
	EnqueueAfter(namespace, name string, duration time.Duration)

	Cache() RoleBindingCache
}

type RoleBindingClient interface {
	Create(*v1.RoleBinding) (*v1.RoleBinding, error)
	Update(*v1.RoleBinding) (*v1.RoleBinding, error)

	Delete(namespace, name string, options *metav1.DeleteOptions) error
	Get(namespace, name string, options metav1.GetOptions) (*v1.RoleBinding, error)
	List(namespace string, opts metav1.ListOptions) (*v1.RoleBindingList, error)
	Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)
	Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.RoleBinding, err error)
}

type RoleBindingCache interface {
	Get(namespace, name string) (*v1.RoleBinding, error)
	List(namespace string, selector labels.Selector) ([]*v1.RoleBinding, error)

	AddIndexer(indexName string, indexer RoleBindingIndexer)
	GetByIndex(indexName, key string) ([]*v1.RoleBinding, error)
}

type RoleBindingIndexer func(obj *v1.RoleBinding) ([]string, error)

type roleBindingController struct {
	controller    controller.SharedController
	client        *client.Client
	gvk           schema.GroupVersionKind
	groupResource schema.GroupResource
}

func NewRoleBindingController(gvk schema.GroupVersionKind, resource string, namespaced bool, controller controller.SharedControllerFactory) RoleBindingController {
	c := controller.ForResourceKind(gvk.GroupVersion().WithResource(resource), gvk.Kind, namespaced)
	return &roleBindingController{
		controller: c,
		client:     c.Client(),
		gvk:        gvk,
		groupResource: schema.GroupResource{
			Group:    gvk.Group,
			Resource: resource,
		},
	}
}

func FromRoleBindingHandlerToHandler(sync RoleBindingHandler) generic.Handler {
	return func(key string, obj runtime.Object) (ret runtime.Object, err error) {
		var v *v1.RoleBinding
		if obj == nil {
			v, err = sync(key, nil)
		} else {
			v, err = sync(key, obj.(*v1.RoleBinding))
		}
		if v == nil {
			return nil, err
		}
		return v, err
	}
}

func (c *roleBindingController) Updater() generic.Updater {
	return func(obj runtime.Object) (runtime.Object, error) {
		newObj, err := c.Update(obj.(*v1.RoleBinding))
		if newObj == nil {
			return nil, err
		}
		return newObj, err
	}
}

func UpdateRoleBindingDeepCopyOnChange(client RoleBindingClient, obj *v1.RoleBinding, handler func(obj *v1.RoleBinding) (*v1.RoleBinding, error)) (*v1.RoleBinding, error) {
	if obj == nil {
		return obj, nil
	}

	copyObj := obj.DeepCopy()
	newObj, err := handler(copyObj)
	if newObj != nil {
		copyObj = newObj
	}
	if obj.ResourceVersion == copyObj.ResourceVersion && !equality.Semantic.DeepEqual(obj, copyObj) {
		return client.Update(copyObj)
	}

	return copyObj, err
}

func (c *roleBindingController) AddGenericHandler(ctx context.Context, name string, handler generic.Handler) {
	c.controller.RegisterHandler(ctx, name, controller.SharedControllerHandlerFunc(handler))
}

func (c *roleBindingController) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler) {
	c.AddGenericHandler(ctx, name, generic.NewRemoveHandler(name, c.Updater(), handler))
}

func (c *roleBindingController) OnChange(ctx context.Context, name string, sync RoleBindingHandler) {
	c.AddGenericHandler(ctx, name, FromRoleBindingHandlerToHandler(sync))
}

func (c *roleBindingController) OnRemove(ctx context.Context, name string, sync RoleBindingHandler) {
	c.AddGenericHandler(ctx, name, generic.NewRemoveHandler(name, c.Updater(), FromRoleBindingHandlerToHandler(sync)))
}

func (c *roleBindingController) Enqueue(namespace, name string) {
	c.controller.Enqueue(namespace, name)
}

func (c *roleBindingController) EnqueueAfter(namespace, name string, duration time.Duration) {
	c.controller.EnqueueAfter(namespace, name, duration)
}

func (c *roleBindingController) Informer() cache.SharedIndexInformer {
	return c.controller.Informer()
}

func (c *roleBindingController) GroupVersionKind() schema.GroupVersionKind {
	return c.gvk
}

func (c *roleBindingController) Cache() RoleBindingCache {
	return &roleBindingCache{
		indexer:  c.Informer().GetIndexer(),
		resource: c.groupResource,
	}
}

func (c *roleBindingController) Create(obj *v1.RoleBinding) (*v1.RoleBinding, error) {
	result := &v1.RoleBinding{}
	return result, c.client.Create(context.TODO(), obj.Namespace, obj, result, metav1.CreateOptions{})
}

func (c *roleBindingController) Update(obj *v1.RoleBinding) (*v1.RoleBinding, error) {
	result := &v1.RoleBinding{}
	return result, c.client.Update(context.TODO(), obj.Namespace, obj, result, metav1.UpdateOptions{})
}

func (c *roleBindingController) Delete(namespace, name string, options *metav1.DeleteOptions) error {
	if options == nil {
		options = &metav1.DeleteOptions{}
	}
	return c.client.Delete(context.TODO(), namespace, name, *options)
}

func (c *roleBindingController) Get(namespace, name string, options metav1.GetOptions) (*v1.RoleBinding, error) {
	result := &v1.RoleBinding{}
	return result, c.client.Get(context.TODO(), namespace, name, result, options)
}

func (c *roleBindingController) List(namespace string, opts metav1.ListOptions) (*v1.RoleBindingList, error) {
	result := &v1.RoleBindingList{}
	return result, c.client.List(context.TODO(), namespace, result, opts)
}

func (c *roleBindingController) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) {
	return c.client.Watch(context.TODO(), namespace, opts)
}

func (c *roleBindingController) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (*v1.RoleBinding, error) {
	result := &v1.RoleBinding{}
	return result, c.client.Patch(context.TODO(), namespace, name, pt, data, result, metav1.PatchOptions{}, subresources...)
}

type roleBindingCache struct {
	indexer  cache.Indexer
	resource schema.GroupResource
}

func (c *roleBindingCache) Get(namespace, name string) (*v1.RoleBinding, error) {
	obj, exists, err := c.indexer.GetByKey(namespace + "/" + name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(c.resource, name)
	}
	return obj.(*v1.RoleBinding), nil
}

func (c *roleBindingCache) List(namespace string, selector labels.Selector) (ret []*v1.RoleBinding, err error) {

	err = cache.ListAllByNamespace(c.indexer, namespace, selector, func(m interface{}) {
		ret = append(ret, m.(*v1.RoleBinding))
	})

	return ret, err
}

func (c *roleBindingCache) AddIndexer(indexName string, indexer RoleBindingIndexer) {
	utilruntime.Must(c.indexer.AddIndexers(map[string]cache.IndexFunc{
		indexName: func(obj interface{}) (strings []string, e error) {
			return indexer(obj.(*v1.RoleBinding))
		},
	}))
}

func (c *roleBindingCache) GetByIndex(indexName, key string) (result []*v1.RoleBinding, err error) {
	objs, err := c.indexer.ByIndex(indexName, key)
	if err != nil {
		return nil, err
	}
	result = make([]*v1.RoleBinding, 0, len(objs))
	for _, obj := range objs {
		result = append(result, obj.(*v1.RoleBinding))
	}
	return result, nil
}


text:
/*
 * Initial version of this adapter based on tutorial example code here:
 * http://developer.android.com/guide/topics/ui/layout/gridview.html
 * License: http://creativecommons.org/licenses/by/2.5/
 * Material has not yet been modified (other than resource naming).
 */

package summea.kanjoto.adapter;

import summea.kanjoto.R;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;

public class ImageAdapter extends BaseAdapter {
    private Context mContext;

    public ImageAdapter(Context c) {
        mContext = c;
    }

    public int getCount() {
        return mThumbIds.length;
    }

    public Object getItem(int position) {
        return null;
    }

    public long getItemId(int position) {
        return 0;
    }

    // create a new ImageView for each item referenced by the Adapter
    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView imageView;
        if (convertView == null) { // if it's not recycled, initialize some attributes
            imageView = new ImageView(mContext);
            int width = (int) mContext.getResources().getDimension(R.dimen.image_width);
            int height = (int) mContext.getResources().getDimension(R.dimen.image_height);
            imageView.setLayoutParams(new GridView.LayoutParams(width, height));
            imageView.setPadding(0, 0, 0, 0);
        } else {
            imageView = (ImageView) convertView;
        }

        imageView.setImageResource(mThumbIds[position]);
        return imageView;
    }

    // references to our images
    private Integer[] mThumbIds = {
            R.drawable.data_mode,
            R.drawable.play_mode,
    };
}


text:
package io.remotecontrol;

public class UnserializableException extends Exception {
	private UnserializableThing thing = new UnserializableThing();

	public UnserializableThing getThing() {
		return thing;
	}
}


text:
<?php

namespace Vatsimphp;

class ResultContainerTest extends \PHPUnit_Framework_TestCase
{
    protected $resultClass = 'Vatsimphp\Filter\Iterator';

    /**
     *
     * Empty/countable interface
     * @covers Vatsimphp\Result\ResultContainer::__construct
     * @covers Vatsimphp\Result\ResultContainer::count
     */
    public function testCountable()
    {
        $rc = $this->getMockBuilder('Vatsimphp\Result\ResultContainer')
            ->setMethods(null)
            ->getMock();
        $this->assertCount(0, $rc);
    }

    /**
     *
     * Access non-existing results
     * @covers Vatsimphp\Result\ResultContainer::get
     * @covers Vatsimphp\Result\ResultContainer::__get
     */
    public function testNonExistingResult()
    {
        $rc = $this->getMockBuilder('Vatsimphp\Result\ResultContainer')
            ->setMethods(null)
            ->getMock();
        $this->assertInstanceOf($this->resultClass, $rc->get('doesnotexist'));
        $this->assertInstanceOf($this->resultClass, $rc->doesnotexist);
    }

    /**
     *
     * Append/overwrite test results
     * @dataProvider providerTestAppendArray
     * @covers Vatsimphp\Result\ResultContainer::get
     * @covers Vatsimphp\Result\ResultContainer::__get
     * @covers Vatsimphp\Result\ResultContainer::getList
     * @covers Vatsimphp\Result\ResultContainer::append
     */
    public function testAppendArray($test1, $data1, $test2, $data2, $count, $list)
    {
        $rc = $this->getMockBuilder('Vatsimphp\Result\ResultContainer')
            ->setMethods(null)
            ->getMock();
        $rc->append($test1, $data1);
        $rc->append($test2, $data2);

        $this->assertCount($count, $rc);
        $this->assertInstanceOf($this->resultClass, $rc->get($test1));
        $this->assertInstanceOf($this->resultClass, $rc->$test1);
        $this->assertInstanceOf($this->resultClass, $rc->get($test2));
        $this->assertInstanceOf($this->resultClass, $rc->$test2);

        $this->assertSame($list, $rc->getList());
    }

    public function providerTestAppendArray()
    {
        $iterator = $this->getMockBuilder('Vatsimphp\Filter\Iterator')
            ->setConstructorArgs(array(array('column2' => 'value2')))
            ->getMock();

        return array(
            array(
                'test1',
                array('column1' => 'value1'),
                'test2',
                $iterator,
                2,
                array('test1', 'test2'),
            ),
            array(
                'test3',
                array('column3' => 'value3'),
                'test3',
                array('column3' => 'value3'),
                1,
                array('test3'),
            ),

        );
    }

    /**
     * Test serach interface
     * @dataProvider providerTestSearch
     * @covers Vatsimphp\Result\ResultContainer::search
     */
    public function testSearch($header, $data, $query, $expectedResult)
    {
        $class = $this->getMockBuilder('Vatsimphp\Result\ResultContainer')
            ->setMethods(null)
            ->getMock();

        $class->append('test_header', $header);
        $class->append('test', $data);
        $resultIterator = $class->search('test', $query);
        $this->assertInstanceOf('Vatsimphp\Filter\Iterator', $resultIterator);
        $this->assertEquals($expectedResult, $resultIterator->toArray());

    }

    public function providerTestSearch()
    {
        // default test header/data
        $header =  array('cid', 'callsign', 'realname');
        $data = array(
            array(
                'cid' => '123456',
                'callsign' => 'SWA3437',
                'realname' => 'Jelle Vink - KSJC'
            ),
            array(
                'cid' => '7890',
                'callsign' => 'AAL123',
                'realname' => 'Foo Vink - EBBR'
            ),
        );

        return array(
            // full field match
            array(
                $header,
                $data,
                array('cid' => '123456'),
                array(
                    array(
                        'cid' => '123456',
                        'callsign' => 'SWA3437',
                        'realname' => 'Jelle Vink - KSJC'
                    ),
                ),
            ),
            // partial field match
            array(
                $header,
                $data,
                array('realname' => 'Vink'),
                array(
                    array(
                        'cid' => '123456',
                        'callsign' => 'SWA3437',
                        'realname' => 'Jelle Vink - KSJC'
                    ),
                    array(
                        'cid' => '7890',
                        'callsign' => 'AAL123',
                        'realname' => 'Foo Vink - EBBR'
                    ),
                ),
            ),
            // no field match
            array(
                $header,
                $data,
                array('realname' => 'NotExist'),
                array(),
            ),
            // invalid column
            array(
                $header,
                $data,
                array('notexist' => '345'),
                array(),
            ),
        );
    }

    /**
     * Test if an object is searchable - needs matching _header object
     * @dataProvider providerTestIsSearchable
     * @covers Vatsimphp\Result\ResultContainer::isSearchable
     */
    public function testIsSearchable($header, $data)
    {
        $class = $this->getMockBuilder('Vatsimphp\Result\ResultContainer')
            ->setMethods(null)
            ->getMock();

        if ($header) {
            $class->append('test_header', $header);
            $expectedResult = true;
        } else {
            $expectedResult = false;
        }

        $class->append('test', $data);

        $searchable = new \ReflectionMethod($class, 'isSearchable');
        $searchable->setAccessible(true);
        $this->assertSame($expectedResult, $searchable->invoke($class, 'test'));
    }

    public function providerTestIsSearchable()
    {
        return array(
            array(array('col1', 'col2'), array('data1', 'data2')),
            array(false, array('data1', 'data2')),
        );
    }
}


text: SOM = new Mongo.Collection('soms');


text:
namespace Blossom
{
    /// <summary>
    /// Shared config instance between all deployment hosts.
    /// </summary>
    public interface IConfig
    {
        /// <summary>
        /// Initialize the deployment configuration, including which
        /// hosts to connect to.
        /// </summary>
        /// <param name="deploymentConfig"></param>
        void InitializeDeployment(IDeploymentConfig deploymentConfig);

        /// <summary>
        /// Initialize the deployment context, including the environment.
        /// </summary>
        /// <param name="context"></param>
        void InitializeContext(IDeploymentContext context);
    }

    /// <summary>
    /// A basic <see cref="IConfig"/> implementation that does no
    /// initialization.
    /// </summary>
    public class BaseConfig : IConfig
    {
        /// <inheritdoc />
        public virtual void InitializeDeployment(IDeploymentConfig deploymentConfig)
        {
        }

        /// <inheritdoc />
        public virtual void InitializeContext(IDeploymentContext context)
        {
        }
    }
}


text:
package org.opengrid.security.impl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.opengrid.security.RoleAccessValidator;
import org.opengrid.security.TokenAuthenticationService;
import org.opengrid.security.TokenHandler;
import org.opengrid.security.impl.UserAuthentication;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UserDetails;

public class MongoTokenAuthenticationService implements TokenAuthenticationService {
	private static final Logger log = Logger.getLogger(MongoTokenAuthenticationService.class);
    private static final String AUTH_HEADER_NAME = "X-AUTH-TOKEN";

    private final TokenHandler tokenHandler;

    private RoleAccessValidator roleAccessValidator = new JwtRoleAccessValidator();

    public MongoTokenAuthenticationService() {
        tokenHandler = new TokenHandler();
    }

	public void addAuthentication(HttpServletResponse response, Authentication authentication) {
        final org.opengrid.security.impl.User user = (org.opengrid.security.impl.User) authentication.getDetails();
        response.addHeader(AUTH_HEADER_NAME, tokenHandler.createTokenForUser(user));

        //fix CORS issue
        response.addHeader("Access-Control-Allow-Origin", "*");
        response.addHeader("Access-Control-Expose-Headers", AUTH_HEADER_NAME);
    }

    public Authentication getAuthentication(HttpServletRequest request) {
        final String token = request.getHeader(AUTH_HEADER_NAME);
        if (token != null) {
        	try {
                final UserDetails user = tokenHandler.parseUserFromToken(token);
                if (user != null) {

                	//use our custom resource access validator
                	if (!roleAccessValidator.hasAccess(token, request) ) {
                		//by returning NULL, a 403 is returned to the client
                		return null;
                	} else {
                		return new UserAuthentication(user);
                	}
                }
        	} catch (Exception ex) {
        		log.error(ex);

        		//we need to catch this to prevent generating an HTTP 500
        		//returning a NULL will trigger an authentication failure
        		return null;
        	}
        }
        return null;
    }

    public void renewAuthentication(HttpServletRequest request, HttpServletResponse response) {
    	String token = request.getHeader(AUTH_HEADER_NAME);
    	 if (token != null) {
             String newToken = tokenHandler.renewExpirationTime(token);

             //replace old token with new one
             response.setHeader(AUTH_HEADER_NAME, newToken);

             //fix CORS issue
             response.addHeader("Access-Control-Allow-Origin", "*");
             response.addHeader("Access-Control-Expose-Headers", AUTH_HEADER_NAME);
         }
    }

	@Override
	public void setKey(String key) {
		tokenHandler.setSecret(key);
	}

	public String getToken(HttpServletRequest request) {
		return request.getHeader(AUTH_HEADER_NAME);
	}
}


text:
$.fn.optionValueAutocomplete = function (options) {
  'use strict'

  // Default options
  options = options || {}
  var multiple = typeof (options.multiple) !== 'undefined' ? options.multiple : true
  var productSelect = options.productSelect
  var productId = options.productId
  var values = options.values
  var clearSelection = options.clearSelection

  function formatOptionValueList(values) {
    return values.map(function(obj) {
      return { id: obj.id, text: obj.name }
    })
  }

  function addOptions(select, productId, values) {
    $.ajax({
      type: 'GET',
      url: Spree.routes.option_values_api,
      dataType: 'json',
      data: {
        token: Spree.api_key,
        q: {
          id_in: values,
          variants_product_id_eq: productId
        }
      }
    }).then(function (data) {
      select.addSelect2Options(data)
    })
  }

  this.select2({
    multiple: multiple,
    minimumInputLength: 1,
    ajax: {
      url: Spree.routes.option_values_api,
      dataType: 'json',
      data: function (params) {
        var selectedProductId = typeof (productSelect) !== 'undefined' ? productSelect.val() : null

        var query = {
          q: {
            name_cont: params.term,
            variants_product_id_eq: selectedProductId
          },
          token: Spree.api_key
        }

        return query;
      },
      processResults: function(data) {
        var results = formatOptionValueList(data)

        return {
          results: results
        }
      }
    }
  })

  if (values && productId && !clearSelection) {
    addOptions(this, productId, values)
  }

  if (clearSelection) {
    this.val(null).trigger('change')
  }
}


text:
/*******************************************************************************
  System Services Library Interface Header

  Company:
    Microchip Technology Inc.

  File Name:
    system.h

  Summary:
    Top level common system services library interface header.

  Description:
    This file is the top level common system services library interface header.
    It defines (or includes files that define) the common system service
    types, prototypes, and other definitions that are commonly used by MPLAB
    Harmony libraries and system services.

    System services provide common functionality that would otherwise need to
    be duplicated by multiple other modules or that would force them to
    interact in complex and hard to manage ways.  System services eliminate
    conflicts by controlling access shared resources.

  Remarks:
    The parent directory to the "system" directory should be added to the
    compiler's search path for header files such that the following include
    statment will successfully include this file.

    #include "system/system.h"
 *******************************************************************************/

//DOM-IGNORE-BEGIN
/*******************************************************************************
Copyright (c) 2011-2015 released Microchip Technology Inc.  All rights reserved.

Microchip licenses to you the right to use, modify, copy and distribute
Software only when embedded on a Microchip microcontroller or digital signal
controller that is integrated into your product or third party product
(pursuant to the sublicense terms in the accompanying license agreement).

You should refer to the license agreement accompanying this Software for
additional information regarding your rights and obligations.

SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
 *******************************************************************************/
//DOM-IGNORE-END

#ifndef _SYSTEM_H
#define _SYSTEM_H

// *****************************************************************************
// *****************************************************************************
// Section: Included Files
// *****************************************************************************
// *****************************************************************************

#include "system/common/sys_common.h"
#include "system/common/sys_module.h"

// DOM-IGNORE-BEGIN
#ifdef __cplusplus  // Provide C++ Compatibility

    extern "C" {

#endif
// DOM-IGNORE-END

//DOM-IGNORE-BEGIN
#ifdef __cplusplus
}
#endif
//DOM-IGNORE-END

#endif // _SYSTEM_H
/*******************************************************************************
 End of File
*/


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="author" content="Georgia Southern University">
	<meta name="google-site-verification" content="05mIT9ftUnS7p8gYv9YqNeKhPMcfH1aDch-XlDgylYA">
	<meta name="description" content="MyGeorgiaSouthern is the University's portal for students, faculty and staff">
  <meta name="mobile-web-app-capable" content="yes">

	<title>MyGeorgiaSouthern Portal</title>

<link rel="icon" sizes="192x192" href="icon-192x192.png">
<link rel="stylesheet" href="/css/bootstrap.min.css" />

<link rel="stylesheet" type="text/css" href="/css/styles.min.css" />

<link rel="shortcut icon" href="/favicon.ico?">

	Skip to main content

MyGeorgiaSouthern

				Log In

Access for:

Student Organizations & Departmental Accounts Login >

Georgia Bankers Login >

Instructions for:

First-time Users

Parents

							University HomeDirectory

MyNews

Dine at Zaxby's on July 5 and help support the Athletic Foundation

COE student named Georgia Council for Exceptional Children Student Member of the Year

7 Eagles to compete in Miss Georgia Pageant

Read more >

Today's Events

The BIG Pitch Competition 2017 Registration at Savannah, GA

Russell Union closed for renovations for Summer 2017 at Russell Union

LEGO Video Games at Nessmith-Lane Conference Center

See more events >

Copyright © 2017 Georgia Southern University

					All rights reserved • Privacy Statement

					A Unit of the University System of Georgia


text:
template<typename ComponentType, typename... Bases> struct SubArray;
namespace java
{
    namespace io
    {
typedef ::SubArray< ::java::io::Serializable, ::java::lang::ObjectArray > SerializableArray;
    } // io

    namespace lang
    {
typedef ::SubArray< ::java::lang::CharSequence, ObjectArray > CharSequenceArray;
typedef ::SubArray< ::java::lang::Comparable, ObjectArray > ComparableArray;
typedef ::SubArray< ::java::lang::String, ObjectArray, ::java::io::SerializableArray, ComparableArray, CharSequenceArray > StringArray;
    } // lang
} // java

namespace poi
{
    namespace ss
    {
        namespace formula
        {
            namespace ptg
            {
typedef ::SubArray< ::poi::ss::formula::ptg::Ptg, ::java::lang::ObjectArray > PtgArray;
            } // ptg
        } // formula
    } // ss
} // poi

template<typename T, typename U>
static T java_cast(U* u)
{
    if(!u) return static_cast<T>(nullptr);
    auto t = dynamic_cast<T>(u);
    if(!t) throw new ::java::lang::ClassCastException();
    return t;
}

template<typename T>
static T* npc(T* t)
{
    if(!t) throw new ::java::lang::NullPointerException();
    return t;
}

poi::ss::formula::FormulaRenderer::FormulaRenderer(const ::default_init_tag&)
    : super(*static_cast< ::default_init_tag* >(0))
{
    clinit();
}

poi::ss::formula::FormulaRenderer::FormulaRenderer()
    : FormulaRenderer(*static_cast< ::default_init_tag* >(0))
{
    ctor();
}

java::lang::String* poi::ss::formula::FormulaRenderer::toFormulaString(FormulaRenderingWorkbook* book, ::poi::ss::formula::ptg::PtgArray* ptgs)
{
    clinit();
    if(ptgs == nullptr || npc(ptgs)->length == 0) {
        throw new ::java::lang::IllegalArgumentException(u"ptgs must not be null"_j);
    }
    auto stack = new ::java::util::Stack();
    for(auto ptg : *npc(ptgs)) {
        if(dynamic_cast< ::poi::ss::formula::ptg::MemAreaPtg* >(ptg) != nullptr || dynamic_cast< ::poi::ss::formula::ptg::MemFuncPtg* >(ptg) != nullptr || dynamic_cast< ::poi::ss::formula::ptg::MemErrPtg* >(ptg) != nullptr) {
            continue;
        }
        if(dynamic_cast< ::poi::ss::formula::ptg::ParenthesisPtg* >(ptg) != nullptr) {
            auto contents = java_cast< ::java::lang::String* >(npc(stack)->pop());
            npc(stack)->push(::java::lang::StringBuilder().append(u"("_j)->append(contents)
                ->append(u")"_j)->toString());
            continue;
        }
        if(dynamic_cast< ::poi::ss::formula::ptg::AttrPtg* >(ptg) != nullptr) {
            auto attrPtg = (java_cast< ::poi::ss::formula::ptg::AttrPtg* >(ptg));
            if(npc(attrPtg)->isOptimizedIf() || npc(attrPtg)->isOptimizedChoose() || npc(attrPtg)->isSkip()) {
                continue;
            }
            if(npc(attrPtg)->isSpace()) {
                continue;
            }
            if(npc(attrPtg)->isSemiVolatile()) {
                continue;
            }
            if(npc(attrPtg)->isSum()) {
                auto operands = getOperands(stack, npc(attrPtg)->getNumberOfOperands());
                npc(stack)->push(npc(attrPtg)->toFormulaString(operands));
                continue;
            }
            throw new ::java::lang::RuntimeException(::java::lang::StringBuilder().append(u"Unexpected tAttr: "_j)->append(static_cast< ::java::lang::Object* >(attrPtg))->toString());
        }
        if(dynamic_cast< WorkbookDependentFormula* >(ptg) != nullptr) {
            auto optg = java_cast< WorkbookDependentFormula* >(ptg);
            npc(stack)->push(npc(optg)->toFormulaString(book));
            continue;
        }
        if(!(dynamic_cast< ::poi::ss::formula::ptg::OperationPtg* >(ptg) != nullptr)) {
            npc(stack)->push(npc(ptg)->toFormulaString());
            continue;
        }
        auto o = java_cast< ::poi::ss::formula::ptg::OperationPtg* >(ptg);
        auto operands = getOperands(stack, npc(o)->getNumberOfOperands());
        npc(stack)->push(npc(o)->toFormulaString(operands));
    }
    if(npc(stack)->isEmpty()) {
        throw new ::java::lang::IllegalStateException(u"Stack underflow"_j);
    }
    auto result = java_cast< ::java::lang::String* >(npc(stack)->pop());
    if(!npc(stack)->isEmpty()) {
        throw new ::java::lang::IllegalStateException(u"too much stuff left on the stack"_j);
    }
    return result;
}

java::lang::StringArray* poi::ss::formula::FormulaRenderer::getOperands(::java::util::Stack* stack, int32_t nOperands)
{
    clinit();
    auto operands = new ::java::lang::StringArray(nOperands);
    for (auto j = nOperands - int32_t(1); j >= 0; j--) {
        if(npc(stack)->isEmpty()) {
            auto msg = ::java::lang::StringBuilder().append(u"Too few arguments supplied to operation. Expected ("_j)->append(nOperands)
                ->append(u") operands but got ("_j)
                ->append((nOperands - j - int32_t(1)))
                ->append(u")"_j)->toString();
            throw new ::java::lang::IllegalStateException(msg);
        }
        operands->set(j, java_cast< ::java::lang::String* >(npc(stack)->pop()));
    }
    return operands;
}

extern java::lang::Class *class_(const char16_t *c, int n);

java::lang::Class* poi::ss::formula::FormulaRenderer::class_()
{
    static ::java::lang::Class* c = ::class_(u"org.apache.poi.ss.formula.FormulaRenderer", 41);
    return c;
}

java::lang::Class* poi::ss::formula::FormulaRenderer::getClass0()
{
    return class_();
}


text:
package org.cactoos.matchers;

import java.io.File;
import org.cactoos.Text;
import org.cactoos.io.TeeInput;
import org.cactoos.scalar.And;
import org.cactoos.scalar.Equals;
import org.cactoos.scalar.UncheckedScalar;
import org.cactoos.text.ComparableText;
import org.cactoos.text.FormattedText;
import org.cactoos.text.TextOf;
import org.cactoos.text.UncheckedText;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;

/**
 * Matcher for the {@link TeeInput}'s results.
 *
 * @author Roman Proshin (roman@proshin.org)
 * @version $Id$
 * @since 1.0
 */
public final class TeeInputHasResult extends TypeSafeMatcher<TeeInput> {

    /**
     * Value that is expected to be returned from the given TeeInput.
     */
    private final ComparableText expected;
    /**
     * Value that is expected to be copied into the output of TeeInput.
     */
    private final ComparableText copied;
    /**
     * Actual value returned from the given TeeInput.
     */
    private ComparableText actual;

    /**
     * Ctor.
     * @param expected Value that is expected to be returned from the TeeInput
     * @param file Value that is expected to be copied into the output of
     *  the TeeInput
     */
    public TeeInputHasResult(
        final String expected,
        final File file) {
        this(
            new TextOf(expected),
            new TextOf(file)
        );
    }

    /**
     * Ctor.
     * @param expected Value that is expected to be returned from the TeeInput
     * @param copied Value that is expected to be copied into the output of
     *  the TeeInput
     */
    public TeeInputHasResult(
        final String expected,
        final Text copied) {
        this(
            new TextOf(expected),
            copied
        );
    }

    /**
     * Ctor.
     * @param expected Value that is expected to be returned from the TeeInput
     * @param copied Value that is expected to be copied into the output of
     *  the TeeInput
     */
    public TeeInputHasResult(
        final Text expected,
        final Text copied) {
        super();
        this.expected = new ComparableText(expected);
        this.copied = new ComparableText(copied);
        this.actual = new ComparableText(new TextOf(""));
    }

    @Override
    public boolean matchesSafely(final TeeInput item) {
        this.actual = new ComparableText(new TextOf(item));
        return
            new UncheckedScalar<>(
                new And(
                    new Equals<>(
                        this.expected::asString,
                        this.actual::asString
                    ),
                    new Equals<>(
                        this.expected::asString,
                        this.copied::asString
                    )
                )
            ).value();
    }

    @Override
    public void describeTo(final Description description) {
        description.appendText(
            new UncheckedText(
                new FormattedText(
                    "TeeInput with result \"%1$s\" and copied value \"%1$s\"",
                    new UncheckedText(this.expected).asString()
                )
            ).asString()
        );
    }

    @Override
    public void describeMismatchSafely(
        final TeeInput item,
        final Description description) {
        this.describeTo(description);
    }
}


text:
"""
Copyright 2015 Rackspace

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

from functionaltests.api.v2.models.quotas_model import QuotasModel
from functionaltests.common.client import ClientMixin

class QuotasClient(ClientMixin):

    @classmethod
    def quotas_uri(cls, tenant_id, filters=None):
        url = "/admin/quotas/{0}".format(tenant_id)
        if filters:
            url = cls.add_filters(url, filters)
        return url

    def get_quotas(self, tenant_id, filters=None, **kwargs):
        resp, body = self.client.get(
            self.quotas_uri(tenant_id, filters), **kwargs)
        return self.deserialize(resp, body, QuotasModel)

    def patch_quotas(self, tenant_id, quotas_model, **kwargs):
        resp, body = self.client.patch(self.quotas_uri(tenant_id),
            body=quotas_model.to_json(), **kwargs)
        return self.deserialize(resp, body, QuotasModel)

    def delete_quotas(self, tenant_id, **kwargs):
        resp, body = self.client.patch(self.quotas_uri(tenant_id), **kwargs)
        return self.deserialize(resp, body, QuotasModel)


text:
.mattermostView {
  text-align: center;
}

.mattermostView .ErrorView {
  text-align: left;
}

.mattermostView webview, .mattermostView .mattermostView-loadingScreen {
  position: absolute;
  top: 0px;
  right: 0px;
  bottom: 0px;
  left: 0px;
}

.mattermostView-with-tab webview, .mattermostView-with-tab .mattermostView-loadingScreen {
  top: 31px;
}

.mattermostView-hidden webview {
  flex: 0 1;
  width: 0px;
  height: 0px;
}

.mattermostView-loadingScreen {
  vertical-align: middle;
  background: white;
}

.mattermostView-loadingImage {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
}