text:
/*
 * Created on 27 五月 2015 ( Time 17:36:24 )
 * Generated by Telosys Tools Generator ( version 2.1.0 )
 */
// This Bean has a basic Primary Key (not composite)

package com.dt.hippo.auto.model.jpa.base;

import java.io.Serializable;

//import javax.validation.constraints.* ;
//import org.hibernate.validator.constraints.* ;

import java.util.Date;

import javax.persistence.*;

/**
 * Persistent class for entity stored in table "mediaresource"
 *
 * @author Telosys Tools Generator
 *
 */
@MappedSuperclass
//@Entity
@Table(name="mediaresource", catalog="hippo" )
// Define named queries here
//@NamedQueries ( {
//  @NamedQuery ( name="MediaresourceEntity.countAll", query="SELECT COUNT(x) FROM MediaresourceEntity x" )
//} )
public class MediaresourceEntity extends com.dt.hippo.core.base.BaseBeanCommon implements Serializable {

    protected static final long serialVersionUID = 1L;

    //----------------------------------------------------------------------
    // ENTITY PRIMARY KEY ( BASED ON A SINGLE FIELD )
    //----------------------------------------------------------------------
    protected Long       uid          ;

    //----------------------------------------------------------------------
    // ENTITY DATA FIELDS
    //----------------------------------------------------------------------
    protected Byte       type         ;

    protected Long       userid       ;

    protected String     savepath     ;

    protected String     url          ;

    protected Date       createdate   ;

    protected Date       modifydate   ;

    protected String     createuser   ;

    protected String     modifyuser   ;

    protected Byte       delflg       ;

    protected String     platform     ;

    //----------------------------------------------------------------------
    // ENTITY LINKS ( RELATIONSHIP )
    //----------------------------------------------------------------------

    //----------------------------------------------------------------------
    // CONSTRUCTOR(S)
    //----------------------------------------------------------------------
    public MediaresourceEntity() {
		super();
    }

    //----------------------------------------------------------------------
    // GETTER & SETTER FOR THE KEY FIELD
    //----------------------------------------------------------------------
    public void setUid( Long uid ) {
        this.uid = uid ;
    }
       @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="uid", nullable=false)
  public Long getUid() {
        return this.uid;
    }

    //----------------------------------------------------------------------
    // GETTERS & SETTERS FOR FIELDS
    //----------------------------------------------------------------------
    //--- DATABASE MAPPING : type ( TINYINT )
    public void setType( Byte type ) {
        this.type = type;
    }
       @Column(name="type")
 public Byte getType() {
        return this.type;
    }

    //--- DATABASE MAPPING : userId ( BIGINT )
    public void setUserid( Long userid ) {
        this.userid = userid;
    }
       @Column(name="userId")
 public Long getUserid() {
        return this.userid;
    }

    //--- DATABASE MAPPING : savePath ( VARCHAR )
    public void setSavepath( String savepath ) {
        this.savepath = savepath;
    }
       @Column(name="savePath", length=200)
 public String getSavepath() {
        return this.savepath;
    }

    //--- DATABASE MAPPING : url ( VARCHAR )
    public void setUrl( String url ) {
        this.url = url;
    }
       @Column(name="url", length=200)
 public String getUrl() {
        return this.url;
    }

    //--- DATABASE MAPPING : createDate ( DATETIME )
    public void setCreatedate( Date createdate ) {
        this.createdate = createdate;
    }
       @Temporal(TemporalType.TIMESTAMP)
    @Column(name="createDate")
 public Date getCreatedate() {
        return this.createdate;
    }

    //--- DATABASE MAPPING : modifyDate ( DATETIME )
    public void setModifydate( Date modifydate ) {
        this.modifydate = modifydate;
    }
       @Temporal(TemporalType.TIMESTAMP)
    @Column(name="modifyDate")
 public Date getModifydate() {
        return this.modifydate;
    }

    //--- DATABASE MAPPING : createUser ( VARCHAR )
    public void setCreateuser( String createuser ) {
        this.createuser = createuser;
    }
       @Column(name="createUser", length=50)
 public String getCreateuser() {
        return this.createuser;
    }

    //--- DATABASE MAPPING : modifyUser ( VARCHAR )
    public void setModifyuser( String modifyuser ) {
        this.modifyuser = modifyuser;
    }
       @Column(name="modifyUser", length=50)
 public String getModifyuser() {
        return this.modifyuser;
    }

    //--- DATABASE MAPPING : delFlg ( TINYINT )
    public void setDelflg( Byte delflg ) {
        this.delflg = delflg;
    }
       @Column(name="delFlg")
 public Byte getDelflg() {
        return this.delflg;
    }

    //--- DATABASE MAPPING : platform ( VARCHAR )
    public void setPlatform( String platform ) {
        this.platform = platform;
    }
       @Column(name="platform", length=50)
 public String getPlatform() {
        return this.platform;
    }

    //----------------------------------------------------------------------
    // GETTERS & SETTERS FOR LINKS
    //----------------------------------------------------------------------

    //----------------------------------------------------------------------
    // toString METHOD
    //----------------------------------------------------------------------
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("[");
        sb.append(uid);
        sb.append("]:");
        sb.append(type);
        sb.append("|");
        sb.append(userid);
        sb.append("|");
        sb.append(savepath);
        sb.append("|");
        sb.append(url);
        sb.append("|");
        sb.append(createdate);
        sb.append("|");
        sb.append(modifydate);
        sb.append("|");
        sb.append(createuser);
        sb.append("|");
        sb.append(modifyuser);
        sb.append("|");
        sb.append(delflg);
        sb.append("|");
        sb.append(platform);
        return sb.toString();
    }

}

redpajama_set_name: RedPajamaGithub


text:
class AddProviderToUser < ActiveRecord::Migration
  def change

  end
end


text:
'use strict';

const _ = require('lodash');

/**
 * Given the k8s Pods API output generates the appropriate Teraslice cluster
 * state.  NOTE: This assumes the pods have already been filtered to ensure they
 * are teraslice pods and match the cluster in question.
 * @param  {Object} k8sPods          k8s pods API object (k8s v1.10+)
 * @param  {Object} clusterState     Teraslice Cluster State
 * @param  {String} clusterNameLabel k8s label containing clusterName
 */
function gen(k8sPods, clusterState) {
    // Make sure we clean up the old
    const hostIPs = _.uniq(_.map(k8sPods.items, 'status.hostIP'));
    const oldHostIps = _.difference(_.keys(clusterState), hostIPs);
    _.forEach(oldHostIps, (ip) => {
        delete clusterState[ip];
    });

    // Loop over the nodes in clusterState and set active = [] so we can append
    // later
    Object.keys(clusterState).forEach((nodeId) => {
        clusterState[nodeId].active = [];
    });

    // add a worker for each pod
    k8sPods.items.forEach((pod) => {
        if (!_.has(clusterState, pod.status.hostIP)) {
            // If the node isn't in clusterState, add it
            clusterState[pod.status.hostIP] = {
                node_id: pod.status.hostIP,
                hostname: pod.status.hostIP,
                pid: 'N/A',
                node_version: 'N/A',
                teraslice_version: 'N/A',
                total: 'N/A',
                state: 'connected',
                available: 'N/A',
                active: []
            };
        }

        const worker = {
            assets: [],
            assignment: pod.metadata.labels['app.kubernetes.io/component'],
            ex_id: pod.metadata.labels['teraslice.terascope.io/exId'],
            // WARNING: This makes the assumption that the first container
            // in the pod is the teraslice container.  Currently it is the
            // only container, so this assumption is safe for now.
            image: pod.spec.containers[0].image,
            job_id: pod.metadata.labels['teraslice.terascope.io/jobId'],
            pod_name: pod.metadata.name,
            pod_ip: pod.status.podIP,
            worker_id: pod.metadata.name,
        };

        // k8s pods can have status.phase = `Pending`, `Running`, `Succeeded`,
        // `Failed`, `Unknown`.  We will only add `Running` pods to the
        // Teraslice cluster state.
        if (pod.status.phase === 'Running') {
            clusterState[pod.status.hostIP].active.push(worker);
        }
    });
}

exports.gen = gen;


text:
using P03.Animal_hierarchy.Enums;
using System;

namespace P03.Animal_hierarchy.Models
{
    public abstract class Cat : Animal
    {
        public Cat(int age, string name, Gender gender)
            : base(age, name, gender)
        {
        }

        public override void ProduceSound()
        {
            Console.WriteLine("Miay");
        }
    }
}


text:
$LOAD_PATH << File.expand_path('../../lib', __FILE__)

# Maybe benchmark stringex vs babosa just for fun...


text:
'''
Created on August 02, 2012

@author: Jose Antonio Sal y Rosas Celi
@contact: arturo.jasyrc@gmail.com
'''

#import paramiko
from config import config
import os
import sys

lista_path = os.path.dirname(__file__).split(os.path.sep)
lista_path.pop()
lista_path.pop()
path_api = os.path.sep.join(["%s" % subcadena for subcadena in lista_path])
sys.path.append(path_api)

class adminSFTP(object):

    accesoGossip = None
    conexionGossip = None
    __scriptName = "adminSFTP.py"

    # Constructor method
    def __init__(self):
        # Instancia a la clase que maneja el archivo de configuracion
        configuration = config()
        # Obtiene el diccionario de parametros de configuracion
        parametros = configuration.getContentFile()

        self.hostname = parametros["hostname"]
        self.port = int(parametros["port"])
        self.username = parametros["username"]

    # Funcion para enviar un archivo
    def enviaArchivo(self, archivolocal, archivoremoto):

        # Establece la conexion
        self.estableceConexion()

        # ST_SIZE: Size in bytes of a plain file; amount of data waiting on some special files.
        # ST_ATIME: Time of last access.
        # ST_MTIME: Time of last modification.
        # ST_CTIME: Unix is the time of the last metadata change, In Windows is the creation time

        #last_access = os.stat(archivolocal)[ST_ATIME]
        #last_access = os.stat(archivolocal).st_atime
        #print "Ultimo acceso: %s" % time.ctime(last_access)

        #last_access = os.stat(archivolocal)[ST_MTIME]
        last_modification = os.stat(archivolocal).st_mtime
        #print "Ultima modificacion: %s" % time.ctime(last_modification)

        #create_time = os.stat(archivolocal)[ST_CTIME]
        create_time = os.stat(archivolocal).st_ctime
        #print "Fecha de creacion: %s" % time.ctime(create_time)

        #print "last modified: %s" % time.ctime(os.path.getmtime(archivolocal))
        #print "created: %s" % time.ctime(os.path.getctime(archivolocal))

        # Envia el archivo
        self.accesoGossip.put(archivolocal, archivoremoto)
        # Agrega la informacion al archivo enviado
        # Times must be a 2-tuple of numbers, of the form (atime, mtime), which is used to set the access and modified times, respectively.
        self.accesoGossip.utime(archivoremoto, (last_modification, create_time))

        # Cierra la conexion
        self.cerrarConexion()

    # Funcion para enviar un archivo
    def enviaArchivo1(self, archivolocal, archivoremoto, ruta_server):

        # Establece la conexion
        self.estableceConexion()

        # ST_SIZE: Size in bytes of a plain file; amount of data waiting on some special files.
        # ST_ATIME: Time of last access.
        # ST_MTIME: Time of last modification.
        # ST_CTIME: Unix is the time of the last metadata change, In Windows is the creation time

        #last_access = os.stat(archivolocal)[ST_ATIME]
        #last_access = os.stat(archivolocal).st_atime
        #print "Ultimo acceso: %s" % time.ctime(last_access)

        #last_access = os.stat(archivolocal)[ST_MTIME]
        last_modification = os.stat(archivolocal).st_mtime
        #print "Ultima modificacion: %s" % time.ctime(last_modification)

        #create_time = os.stat(archivolocal)[ST_CTIME]
        create_time = os.stat(archivolocal).st_ctime
        #print "Fecha de creacion: %s" % time.ctime(create_time)

        #print "last modified: %s" % time.ctime(os.path.getmtime(archivolocal))
        #print "created: %s" % time.ctime(os.path.getctime(archivolocal))

        ruta_remota = os.path.join(ruta_server, archivoremoto)

        # Envia el archivo
        self.accesoGossip.put(archivolocal, ruta_remota)
        # Agrega la informacion al archivo enviado
        # Times must be a 2-tuple of numbers, of the form (atime, mtime), which is used to set the access and modified times, respectively.
        self.accesoGossip.utime(ruta_remota, (last_modification, create_time))

        # Cierra la conexion
        self.cerrarConexion()

    # Verifica la existencia de un directorio
    def verificaDirectorio(self, directorio, ruta_server):

        flag = False
        # Establece la conexion
        self.estableceConexion()
        # Obtiene una lista de directorios de la raiz del almacen de datos
        directorios = self.accesoGossip.listdir(ruta_server)
        # Recorre la lista de directorios obtenidos
        if directorio in [elemento for elemento in directorios]:
            # Si encuentra el directorio, hace el flag = True
            flag = True

        # Cierra la conexion
        self.cerrarConexion()
        # Retorna el valor del resultado de la busqueda
        return flag

    # Obtiene la lista de archivos en un directorio
    def obtieneArchivos(self, ruta):

        archivos = []
        # Establece la conexion
        self.estableceConexion()
        # Obtiene la lista de archivos dentro de un directorio
        lista_archivos = self.accesoGossip.listdir(ruta)
        # Recorre la lista de archivos
        for archivo in lista_archivos:
            # Forma la ruta del archivo
            ruta_archivo = os.path.join(ruta, archivo)
            # Obtiene los atributos del archivo
            atributos = self.accesoGossip.lstat(ruta_archivo)
            # Forma el diccionario del archivo
            dic_archivo = { "archivo" : archivo, "atributos" : atributos}
            # Agrega el diccionario a la lista de archivos
            archivos.append(dic_archivo)
        # Cierra la conexion
        self.cerrarConexion()
        # Retorna la lista de archivos
        return archivos

    # Envia un conjunto de archivos
    def enviarListaDatos(self, dic_archivos):

        pass

    # Funcion para crear un directorio
    def creaDirectorio(self, directorio, ruta_server):
        # Establece la conexion
        self.estableceConexion()
        # Forma la ruta donde debe crearse el directorio
        ruta_creacion = os.path.join(ruta_server, directorio)
        # Crea el directorio
        self.accesoGossip.mkdir(ruta_creacion, 0750)
        # Cierra la conexion
        self.cerrarConexion()

    # Envia un archivo a la maquina remota
    def enviarDatos(self, archivolocal, ruta_remota):
        # Obtiene la carpeta que contenedora del archivo local
        #ubicacionlocal = os.path.split(archivolocal)[0]
        # Obtiene el nombre del archivo
        archivo = os.path.split(archivolocal)[1]
        # Obtiene la ubicacion remota de los datos
        ubicacionremota = os.path.join(self.data_gossip, ruta_remota)
        # Forma la nueva ubicacion para almacenar el archivo a enviar
        archivoremoto = os.path.join(ubicacionremota, archivo)
        # Llama a la funcion para enviar el archivo
        self.enviaArchivo(archivolocal, archivoremoto)

    # Establece la conexion con Gossip
    def estableceConexion(self):

        # Obtiene la conexion a la maquina remota
        self.conexionGossip = paramiko.Transport((self.hostname, self.port))

        password = "dat2k8"

        # Obtiene el acceso a la maquina remota
        self.conexionGossip.connect(username = self.username, password = password)
        # Obtiene el acceso a la maquina remota con la conexion establecida
        self.accesoGossip = paramiko.SFTPClient.from_transport(self.conexionGossip)

    # Funcion para cerrar la conexion
    def cerrarConexion(self):
        # Cierra el acceso a la maquina remota
        self.accesoGossip.close()
        # Cierra la conexion con la maquina remota
        self.conexionGossip.close()

if __name__ == '__main__':

    a = adminSFTP()
    a.estableceConexion()
    a.enviarDatos("/home/developer/Datos/Iniciales/Atena+Grecia/2011-08-01_2011-08-11/Atena/d2011213/D2011213000.r","")


text:
import './errorHandler';
import './keyboardShortcuts';
import './persistAppState';
import './controlBar';
import './debug';
import './desktopSettings';
import './tray';
import './lastFM';
import './autoUpdater';
import './websocketAPI';
import './lyrics';
import './applicationMenu';
import './windowTitleInfo';
import './customStyle';
import './alarm.js';
import './sleepPreventor';
import './mediaService';


text:
import EmailTemplates = require('email-templates');

var EmailTemplate = EmailTemplates.EmailTemplate;
var template = new EmailTemplate("./");
var users = [
    {
        email: 'pappa.pizza@spaghetti.com',
        name: {
            first: 'Pappa',
            last: 'Pizza'
        }
    },
    {
        email: 'mister.geppetto@spaghetti.com',
        name: {
            first: 'Mister',
            last: 'Geppetto'
        }
    }
]

var templates = users.map(function(user) {
    return template.render(user);
})


text:
module Trade
  class PaypalPayment < Payment
    include Model::Payment::PaypalPayment
  end
end


text:
class Admin::FeedsController < Admin::BaseAdminController
  def index
    @feeds = Feed.
             paginate(page: params[:page], per_page: 20).
             order(:id).
             all
  end

  def show
    @feed = Feed.find(params[:id])
  end

  def new
    @feed = Feed.new
  end

  def create
    @feed = Feed.create!(feed_params)
    redirect_to admin_feed_path(@feed), flash: { success: "Feed created" }
  rescue ActiveRecord::RecordInvalid => e
    redirect_to(admin_feeds_path,
                flash: { warning: "Error creating feed: #{e}" })
  end

  def edit
    @feed = Feed.find(params[:id])
    @users = User.all.map {|user| [user.email, user.id] }
  end

  def update
    @feed = Feed.find(params[:id])
    @feed.update_attributes!(feed_params)
    @feed.update_meta
    redirect_to admin_feed_path(@feed), flash: { success: "Feed updated" }
  rescue ActiveRecord::RecordInvalid => e
    redirect_to(admin_feed_path(@feed),
                flash: { warning: "Error updating feed: #{e}" })
  end

  def destroy
    feed = Feed.find(params[:id])
    feed.articles.destroy_all
    Feed.destroy(params[:id])
    redirect_to admin_feeds_path, flash: { success: "Feed destroyed" }
  end

  def refresh
    @feed = Feed.find(params[:id])
    @feed.update_articles
    redirect_to(admin_feed_path(@feed),
                flash: { success: "Feed articles refreshed" })
  end

  private

  def feed_params
    params.require(:feed).permit(:url, :user_id)
  end
end


text:
<!DOCTYPE html>

<meta charset=utf-8>
<title>WebRTC Test: RTCDTMFSender</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel=help href="http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcdtmfsender">


text:
<?php

namespace Banckle\Helpdesk\Models;

class MailboxDto {

  static $swaggerTypes = array(
      'MailboxId' => 'string',
      'AccountId' => 'string',
      'MailboxName' => 'string',
      'EmailAddress' => 'string'

    );

  public $MailboxId; // string
  public $AccountId; // string
  public $MailboxName; // string
  public $EmailAddress; // string
  }


text:
#import <UIKit/UIKit.h>
@class Game;
@class BluetoothDataHandler;

@interface AppDelegate : UIResponder <UIApplicationDelegate,UITabBarControllerDelegate> {
    UIWindow *_mainWindow; // the only window
    BluetoothDataHandler *btdh; // the object managing bluetooth data transfers and disconnects - we need a reference to this, so we can disconnect on application termination
}
-(void) startGame;
-(void) endGame;

@property (nonatomic, retain) IBOutlet UIWindow *mainWindow;
@property (nonatomic, retain) BluetoothDataHandler *btdh;
@property (nonatomic, retain) Game *currentGame;
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;

@property (nonatomic, retain) NSDictionary *plist;

@property (nonatomic) BOOL isAIActivated;
@property (nonatomic) BOOL isAIRedPlayer;
@property (nonatomic) int strengthOfAI;

@property (nonatomic) BOOL turnLimit;
@property (nonatomic) int turnLimitNumber;
@property (nonatomic) BOOL boardSizeLimit;
@property (nonatomic) int boardSizeWidth;
@property (nonatomic) int boardSizeHeight;
@property (nonatomic) int minimumLineSize;
@property (nonatomic) BOOL scoreMode;
@property (nonatomic) BOOL additionalRedTurn;
@property (nonatomic) BOOL reuseLines;
@property (nonatomic) BOOL localPlayerColorBlue;

@property (nonatomic) BOOL needsAck;
//used by AlertViews to know which type of game player tried to start
@property (nonatomic) int menuReqType;
/*  0 - TechTacToe
    1 - TicTacToe
    2 - Gomoku
    3 - Custom Game
    4 - Load Game
 */

@property (nonatomic, retain) UIViewController *noActiveGameViewController;

@property (nonatomic, retain) UINavigationController *tab0NavigationController;
@property (nonatomic, retain) UINavigationController *tab1NavigationController;
@property (nonatomic, retain) UINavigationController *tab2NavigationController;
@property (nonatomic, retain) UINavigationController *tab3NavigationController;
@property (nonatomic, retain) UIViewController *tab4ViewController;

@end


text:
<?php
header('Access-Control-Allow-Origin: *');
require("fortunes/fortune.php");
$f = new Fortune;
echo $f->quoteFromDir("fortunes/");
?>


text:
import json
import os

from collections.abc import Mapping
from typing import List, Optional, Union

import google.auth
import google.oauth2.service_account

from google.oauth2.service_account import Credentials

from polyaxon.connections.reader import read_keys
from polyaxon.contexts import paths as ctx_paths
from polyaxon.exceptions import PolyaxonStoresException
from polyaxon.logger import logger

DEFAULT_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",)

def get_project_id(
    keys: Optional[Union[str, List[str]]] = None,
    context_path: Optional[str] = None,
    **kwargs,
):
    value = kwargs.get("project_id")
    if value:
        return value
    keys = keys or [
        "GC_PROJECT",
        "GOOGLE_PROJECT",
        "GC_PROJECT_ID",
        "GOOGLE_PROJECT_ID",
    ]
    return read_keys(context_path=context_path, keys=keys)

def get_key_path(
    keys: Optional[Union[str, List[str]]] = None,
    context_path: Optional[str] = None,
    **kwargs,
):
    value = kwargs.get("key_path")
    if value:
        return value
    keys = keys or ["GC_KEY_PATH", "GOOGLE_KEY_PATH", "GOOGLE_APPLICATION_CREDENTIALS"]
    return read_keys(context_path=context_path, keys=keys)

def get_keyfile_dict(
    keys: Optional[Union[str, List[str]]] = None,
    context_path: Optional[str] = None,
    **kwargs,
):
    value = kwargs.get("keyfile_dict")
    if value:
        return value
    keys = keys or ["GC_KEYFILE_DICT", "GOOGLE_KEYFILE_DICT"]
    return read_keys(context_path=context_path, keys=keys)

def get_scopes(
    keys: Optional[Union[str, List[str]]] = None,
    context_path: Optional[str] = None,
    **kwargs,
):
    value = kwargs.get("scopes")
    if value:
        return value
    keys = keys or ["GC_SCOPES", "GOOGLE_SCOPES"]
    return read_keys(context_path=context_path, keys=keys)

def get_gc_credentials(
    context_path: Optional[str] = None,
    **kwargs,
):
    """
    Returns the Credentials object for Google API
    """
    key_path = get_key_path(context_path=context_path, **kwargs)
    keyfile_dict = get_keyfile_dict(context_path=context_path, **kwargs)
    scopes = get_scopes(context_path=context_path, **kwargs)

    if scopes is not None:
        scopes = [s.strip() for s in scopes.split(",")]
    else:
        scopes = DEFAULT_SCOPES

    if not key_path and not keyfile_dict:
        # Look for default GC path
        if os.path.exists(ctx_paths.CONTEXT_MOUNT_GC):
            key_path = ctx_paths.CONTEXT_MOUNT_GC

    if not key_path and not keyfile_dict:
        logger.info(
            "Getting connection using `google.auth.default()` "
            "since no key file is defined for hook."
        )
        credentials, _ = google.auth.default(scopes=scopes)
    elif key_path:
        # Get credentials from a JSON file.
        if key_path.endswith(".json"):
            logger.info("Getting connection using a JSON key file.")
            credentials = Credentials.from_service_account_file(
                os.path.abspath(key_path), scopes=scopes
            )
        else:
            raise PolyaxonStoresException("Unrecognised extension for key file.")
    else:
        # Get credentials from JSON data.
        try:
            if not isinstance(keyfile_dict, Mapping):
                keyfile_dict = json.loads(keyfile_dict)

            # Convert escaped newlines to actual newlines if any.
            keyfile_dict["private_key"] = keyfile_dict["private_key"].replace(
                "\\n", "\n"
            )

            credentials = Credentials.from_service_account_info(
                keyfile_dict, scopes=scopes
            )
        except ValueError:  # json.decoder.JSONDecodeError does not exist on py2
            raise PolyaxonStoresException("Invalid key JSON.")

    return credentials

def get_gc_access_token(
    credentials=None,
    context_path: Optional[str] = None,
    **kwargs,
):
    credentials = credentials or get_gc_credentials(context_path=context_path, **kwargs)
    return credentials.token

def get_gc_client(
    credentials=None,
    context_path: Optional[str] = None,
    **kwargs,
):
    from google.cloud.storage.client import Client

    credentials = credentials or get_gc_credentials(context_path=context_path, **kwargs)
    project_id = get_project_id(context_path=context_path, **kwargs)
    return Client(project=project_id, credentials=credentials)


text:
package org.mozilla.javascript.regexp;

import org.mozilla.javascript.*;

/**
 * This class implements the RegExp constructor native object.
 *
 * Revision History:
 * Implementation in C by Brendan Eich
 * Initial port to Java by Norris Boyd from jsregexp.c version 1.36
 * Merged up to version 1.38, which included Unicode support.
 * Merged bug fixes in version 1.39.
 * Merged JSFUN13_BRANCH changes up to 1.32.2.11
 *
 */
class NativeRegExpCtor extends BaseFunction
{
    static final long serialVersionUID = -5733330028285400526L;

    NativeRegExpCtor()
    {
    }

    @Override
    public String getFunctionName()
    {
        return "RegExp";
    }

    @Override
    public Object call(Context cx, Scriptable scope, Scriptable thisObj,
                       Object[] args)
    {
        if (args.length > 0 && args[0] instanceof NativeRegExp &&
            (args.length == 1 || args[1] == Undefined.instance))
        {
            return args[0];
        }
        return construct(cx, scope, args);
    }

    @Override
    public Scriptable construct(Context cx, Scriptable scope, Object[] args)
    {
        NativeRegExp re = new NativeRegExp();
        re.compile(cx, scope, args);
        ScriptRuntime.setBuiltinProtoAndParent(re, scope, TopLevel.Builtins.RegExp);
        return re;
    }

    private static RegExpImpl getImpl()
    {
        Context cx = Context.getCurrentContext();
        return (RegExpImpl) ScriptRuntime.getRegExpProxy(cx);
    }

// #string_id_map#

    private static final int
        Id_multiline     = 1,
        Id_STAR          = 2,  // #string=$*#

        Id_input         = 3,
        Id_UNDERSCORE    = 4,  // #string=$_#

        Id_lastMatch     = 5,
        Id_AMPERSAND     = 6,  // #string=$&#

        Id_lastParen     = 7,
        Id_PLUS          = 8,  // #string=$+#

        Id_leftContext   = 9,
        Id_BACK_QUOTE    = 10, // #string=$`#

        Id_rightContext  = 11,
        Id_QUOTE         = 12, // #string=$'#

        DOLLAR_ID_BASE   = 12;

    private static final int
        Id_DOLLAR_1 = DOLLAR_ID_BASE + 1, // #string=$1#
        Id_DOLLAR_2 = DOLLAR_ID_BASE + 2, // #string=$2#
        Id_DOLLAR_3 = DOLLAR_ID_BASE + 3, // #string=$3#
        Id_DOLLAR_4 = DOLLAR_ID_BASE + 4, // #string=$4#
        Id_DOLLAR_5 = DOLLAR_ID_BASE + 5, // #string=$5#
        Id_DOLLAR_6 = DOLLAR_ID_BASE + 6, // #string=$6#
        Id_DOLLAR_7 = DOLLAR_ID_BASE + 7, // #string=$7#
        Id_DOLLAR_8 = DOLLAR_ID_BASE + 8, // #string=$8#
        Id_DOLLAR_9 = DOLLAR_ID_BASE + 9, // #string=$9#

        MAX_INSTANCE_ID = DOLLAR_ID_BASE + 9;

    @Override
    protected int getMaxInstanceId()
    {
        return super.getMaxInstanceId() + MAX_INSTANCE_ID;
    }

    @Override
    protected int findInstanceIdInfo(String s) {
        int id;
// #generated# Last update: 2001-05-24 16:09:31 GMT+02:00
        L0: { id = 0; String X = null; int c;
            L: switch (s.length()) {
            case 2: switch (s.charAt(1)) {
                case '&': if (s.charAt(0)=='$') {id=Id_AMPERSAND; break L0;} break L;
                case '\'': if (s.charAt(0)=='$') {id=Id_QUOTE; break L0;} break L;
                case '*': if (s.charAt(0)=='$') {id=Id_STAR; break L0;} break L;
                case '+': if (s.charAt(0)=='$') {id=Id_PLUS; break L0;} break L;
                case '1': if (s.charAt(0)=='$') {id=Id_DOLLAR_1; break L0;} break L;
                case '2': if (s.charAt(0)=='$') {id=Id_DOLLAR_2; break L0;} break L;
                case '3': if (s.charAt(0)=='$') {id=Id_DOLLAR_3; break L0;} break L;
                case '4': if (s.charAt(0)=='$') {id=Id_DOLLAR_4; break L0;} break L;
                case '5': if (s.charAt(0)=='$') {id=Id_DOLLAR_5; break L0;} break L;
                case '6': if (s.charAt(0)=='$') {id=Id_DOLLAR_6; break L0;} break L;
                case '7': if (s.charAt(0)=='$') {id=Id_DOLLAR_7; break L0;} break L;
                case '8': if (s.charAt(0)=='$') {id=Id_DOLLAR_8; break L0;} break L;
                case '9': if (s.charAt(0)=='$') {id=Id_DOLLAR_9; break L0;} break L;
                case '_': if (s.charAt(0)=='$') {id=Id_UNDERSCORE; break L0;} break L;
                case '`': if (s.charAt(0)=='$') {id=Id_BACK_QUOTE; break L0;} break L;
                } break L;
            case 5: X="input";id=Id_input; break L;
            case 9: c=s.charAt(4);
                if (c=='M') { X="lastMatch";id=Id_lastMatch; }
                else if (c=='P') { X="lastParen";id=Id_lastParen; }
                else if (c=='i') { X="multiline";id=Id_multiline; }
                break L;
            case 11: X="leftContext";id=Id_leftContext; break L;
            case 12: X="rightContext";id=Id_rightContext; break L;
            }
            if (X!=null && X!=s && !X.equals(s)) id = 0;
        }
// #/generated#

        if (id == 0) return super.findInstanceIdInfo(s);

        int attr;
        switch (id) {
          case Id_multiline:
          case Id_STAR:
          case Id_input:
          case Id_UNDERSCORE:
            attr = PERMANENT;
            break;
          default:
            attr = PERMANENT | READONLY;
            break;
        }

        return instanceIdInfo(attr, super.getMaxInstanceId() + id);
    }

// #/string_id_map#

    @Override
    protected String getInstanceIdName(int id)
    {
        int shifted = id - super.getMaxInstanceId();
        if (1 <= shifted && shifted <= MAX_INSTANCE_ID) {
            switch (shifted) {
                case Id_multiline:    return "multiline";
                case Id_STAR:         return "$*";

                case Id_input:        return "input";
                case Id_UNDERSCORE:   return "$_";

                case Id_lastMatch:    return "lastMatch";
                case Id_AMPERSAND:    return "$&";

                case Id_lastParen:    return "lastParen";
                case Id_PLUS:         return "$+";

                case Id_leftContext:  return "leftContext";
                case Id_BACK_QUOTE:   return "$`";

                case Id_rightContext: return "rightContext";
                case Id_QUOTE:        return "$'";
            }
            // Must be one of $1..$9, convert to 0..8
            int substring_number = shifted - DOLLAR_ID_BASE - 1;
            char[] buf = { '$', (char)('1' + substring_number) };
            return new String(buf);
        }
        return super.getInstanceIdName(id);
    }

    @Override
    protected Object getInstanceIdValue(int id)
    {
        int shifted = id - super.getMaxInstanceId();
        if (1 <= shifted && shifted <= MAX_INSTANCE_ID) {
            RegExpImpl impl = getImpl();
            Object stringResult;
            switch (shifted) {
              case Id_multiline:
              case Id_STAR:
                return ScriptRuntime.wrapBoolean(impl.multiline);

              case Id_input:
              case Id_UNDERSCORE:
                stringResult = impl.input;
                break;

              case Id_lastMatch:
              case Id_AMPERSAND:
                stringResult = impl.lastMatch;
                break;

              case Id_lastParen:
              case Id_PLUS:
                stringResult = impl.lastParen;
                break;

              case Id_leftContext:
              case Id_BACK_QUOTE:
                stringResult = impl.leftContext;
                break;

              case Id_rightContext:
              case Id_QUOTE:
                stringResult = impl.rightContext;
                break;

              default:
                {
                    // Must be one of $1..$9, convert to 0..8
                    int substring_number = shifted - DOLLAR_ID_BASE - 1;
                    stringResult = impl.getParenSubString(substring_number);
                    break;
                }
            }
            return (stringResult == null) ? "" : stringResult.toString();
        }
        return super.getInstanceIdValue(id);
    }

    @Override
    protected void setInstanceIdValue(int id, Object value)
    {
        int shifted = id - super.getMaxInstanceId();
        switch (shifted) {
            case Id_multiline:
            case Id_STAR:
                getImpl().multiline = ScriptRuntime.toBoolean(value);
                return;

            case Id_input:
            case Id_UNDERSCORE:
                getImpl().input = ScriptRuntime.toString(value);
                return;

            case Id_lastMatch:
            case Id_AMPERSAND:
            case Id_lastParen:
            case Id_PLUS:
            case Id_leftContext:
            case Id_BACK_QUOTE:
            case Id_rightContext:
            case Id_QUOTE:
                return;
            default:
                int substring_number = shifted - DOLLAR_ID_BASE - 1;
                if (0 <= substring_number && substring_number <= 8) {
                  return;
                }
        }
        super.setInstanceIdValue(id, value);
    }

}


text:
package org.sharedhealth.datasense.dhis2.model;

import com.fasterxml.jackson.annotation.JsonRawValue;
import com.fasterxml.jackson.annotation.JsonValue;

public class DHISResponse {

    private String value;

    public DHISResponse(String value) {
        this.value = value;
    }

    @JsonValue
    @JsonRawValue
    public String getValue() {
        return value;
    }

    public void replace(String content, String with) {
        if (value.indexOf(content) > -1) {
            value = value.replace(content, with);
        }

    }
}


text:
title: "ArgData API: WetWeatherSettingsReader Class"
---

[API Reference](/argdata/api/) > [0.21](/argdata/api/0.21/) > WetWeatherSettingsReader

# WetWeatherSettingsReader Class

Reads the wet weather settings.

**Namespace:** ArgData

## Constructors

    Name
    Description

    WetWeatherSettingsReader(GpExeFile exeFile)
    Creates a WetWeatherSettingsReader for the specified GP.EXE file.
exeFile: GpExeFile to read from.

## Methods

    Name
    Description

    For(GpExeFile exeFile)
    Creates a WetWeatherSettingsReader for the specified GP.EXE file.
exeFile: GpExeFile to read from.

    ReadSettings()
    Read wet weather settings from a GP.EXE file.


text:
using namespace llvm;

Module *llvm::ParseAssembly(MemoryBuffer *F,
                            Module *M,
                            SMDiagnostic &Err,
                            LLVMContext &Context) {
  SourceMgr SM;
  SM.AddNewSourceBuffer(F, SMLoc());

  // If we are parsing into an existing module, do it.
  if (M)
    return LLParser(F, SM, Err, M).Run() ? 0 : M;

  // Otherwise create a new module.
  OwningPtr<Module> M2(new Module(F->getBufferIdentifier(), Context));
  if (LLParser(F, SM, Err, M2.get()).Run())
    return 0;
  return M2.take();
}

Module *llvm::ParseAssemblyFile(const std::string &Filename, SMDiagnostic &Err,
                                LLVMContext &Context) {
  OwningPtr<MemoryBuffer> File;
  if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename.c_str(), File)) {
    Err = SMDiagnostic(Filename, SourceMgr::DK_Error,
                       "Could not open input file: " + ec.message());
    return 0;
  }

  return ParseAssembly(File.take(), 0, Err, Context);
}

Module *llvm::ParseAssemblyString(const char *AsmString, Module *M,
                                  SMDiagnostic &Err, LLVMContext &Context) {
  MemoryBuffer *F =
    MemoryBuffer::getMemBuffer(StringRef(AsmString, strlen(AsmString)),
                               "<string>");

  return ParseAssembly(F, M, Err, Context);
}


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="knp_paginator.class">Knp\Component\Pager\Paginator</parameter>
        <parameter key="knp_paginator.templating.helper.pagination.class">Knp\Bundle\PaginatorBundle\Templating\PaginationHelper</parameter>
        <parameter key="knp_paginator.helper.processor.class">Knp\Bundle\PaginatorBundle\Helper\Processor</parameter>
    </parameters>

    <services>
        <service id="knp_paginator" class="%knp_paginator.class%">
            <argument type="service" id="event_dispatcher" />
        </service>

        <service id="knp_paginator.subscriber.paginate" class="Knp\Component\Pager\Event\Subscriber\Paginate\PaginationSubscriber">
            <tag name="knp_paginator.subscriber" />
        </service>

        <service id="knp_paginator.subscriber.sortable" class="Knp\Component\Pager\Event\Subscriber\Sortable\SortableSubscriber">
            <tag name="knp_paginator.subscriber" />
        </service>

        <service id="knp_paginator.subscriber.filtration" class="Knp\Component\Pager\Event\Subscriber\Filtration\FiltrationSubscriber">
            <tag name="knp_paginator.subscriber" />
        </service>

        <service id="knp_paginator.subscriber.sliding_pagination" class="Knp\Bundle\PaginatorBundle\Subscriber\SlidingPaginationSubscriber">
            <argument type="collection">
                <argument key="defaultPaginationTemplate">%knp_paginator.template.pagination%</argument>
                <argument key="defaultSortableTemplate">%knp_paginator.template.sortable%</argument>
                <argument key="defaultFiltrationTemplate">%knp_paginator.template.filtration%</argument>
                <argument key="defaultPageRange">%knp_paginator.page_range%</argument>
            </argument>
            <tag name="knp_paginator.subscriber" />
            <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" />
        </service>

        <service id="knp_paginator.helper.processor" class="%knp_paginator.helper.processor.class%">
            <argument type="service" id="templating.helper.router" />
            <argument type="service" id="translator" />
        </service>

        <service id="knp_paginator.templating.helper.pagination" class="%knp_paginator.templating.helper.pagination.class%">
            <argument type="service" id="knp_paginator.helper.processor" />
            <argument type="service" id="templating.engine.php" />
            <tag name="templating.helper" alias="knp_pagination" />
        </service>

        <service id="knp_paginator.twig.extension.pagination" class="Knp\Bundle\PaginatorBundle\Twig\Extension\PaginationExtension">
            <argument type="service" id="knp_paginator.helper.processor" />
            <tag name="twig.extension" />
        </service>
    </services>
</container>


text:
// ---------------------------------------------------------------------------------------
// <copyright file="Device.cs" company="Corale">
//     Copyright © 2015-2016 by Adam Hellberg and Brandon Scott.
//
//     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.
//
//     "Razer" is a trademark of Razer USA Ltd.
// </copyright>
// ---------------------------------------------------------------------------------------

namespace Corale.Colore.Core
{
    using System;

    /// <summary>
    /// Base class for devices, containing code common between all devices.
    /// </summary>
    public abstract class Device : IDevice
    {
        /// <summary>
        /// Gets or sets the ID of the currently active effect.
        /// </summary>
        public Guid CurrentEffectId { get; protected set; }

        /// <summary>
        /// Clears the current effect on the device.
        /// </summary>
        public abstract void Clear();

        /// <summary>
        /// Sets the color of all components on this device.
        /// </summary>
        /// <param name="color">Color to set.</param>
        public abstract void SetAll(Color color);

        /// <summary>
        /// Updates the device to use the effect pointed to by the specified GUID.
        /// </summary>
        /// <param name="guid">GUID to set.</param>
        public void SetGuid(Guid guid)
        {
            DeleteCurrentEffect();
            NativeWrapper.SetEffect(guid);
            CurrentEffectId = guid;
        }

        /// <summary>
        /// Deletes the currently set effect.
        /// </summary>
        internal void DeleteCurrentEffect()
        {
            if (CurrentEffectId == Guid.Empty)
                return;

            NativeWrapper.DeleteEffect(CurrentEffectId);
            CurrentEffectId = Guid.Empty;
        }
    }
}


text:
/*
 * jVal - dynamic jquery form field validation framework
 *	version 0.1.5
 * Author: Jim Palmer
 * Released under MIT license.
 */
(function($) {
	// core jVal function - returns TRUE if all jVal validation passes, false if not
	$.fn.jVal = function (options) {
		$.fn.jVal.clean(this);
		// clear jVal warnings
		if ((options || '').toString().toUpperCase() == 'CLEAN')
			return this; // chainable
		$.fn.jVal.defaults = $.extend($.fn.jVal.defaults, options);
		$(this).stop().find('.jfVal,.jValCover').stop().remove();
		var passVal = true, dm = $.fn.jVal.defaults.message, ds = $.fn.jVal.defaults.jvalstyle;
		$(this).find('.jVal,[jVal]:not(:disabled):visible').each(
			function () {
				var cmd = $(this).data('jVal');
				if ( typeof cmd !== 'object' ) eval( 'cmd = ' + ( $(this).data('jVal') || $(this).attr('jVal') ) + ';' );
				//$.fn.jVal.clean(this);
				if ( cmd instanceof Object && cmd.valid instanceof RegExp && !cmd.valid.test($(this).val()) ) {
					$.fn.jVal.showWarning(cmd.target || this, cmd.message || dm, cmd.autoHide || false, cmd.styleType || ds);
					passVal = false;
				} else if ( cmd instanceof Object && cmd.valid instanceof Function ) {
					var testFRet = cmd.valid( $(this).val(), this );
					if ( testFRet === false || testFRet.length > 0 ) {
						$.fn.jVal.showWarning(cmd.target || this, testFRet || cmd.message || dm, cmd.autoHide || false, cmd.styleType || ds);
						passVal = false;
					}
				} else if ( ( cmd instanceof RegExp && !cmd.test($(this).val()) ) || ( cmd instanceof Function && !cmd($(this).val()) ) ) {
					$.fn.jVal.showWarning(cmd.target || this, dm, cmd.autoHide || false, cmd.styleType || ds);
					passVal = false;
				}
			}
		);
		return passVal;
	};
	// showWarning utility function
	$.fn.jVal.showWarning = function (elements, message, autoHide, styleType) {
		var par = $(elements).eq(0).parent();
		clearTimeout( $(par).data('autoHide') ) && $(par).data('autoHide', null);
		$.fn.jVal.clean(par);
		$(elements).css({marginTop:'',position:'',borderColor:'red'});
		var dbw = $.fn.jVal.defaults.border,
			dp = $.fn.jVal.defaults.padding,
			fieldWidth = 0, fieldHeight = 0,
			absoluteLeft = $(elements).eq(0).position().left,
			absoluteTop = $(elements).eq(0).position().top;
		// normalize multi-element coordinates
		$(elements).each(function () {
			fieldWidth += $(this).outerWidth(true);
			fieldHeight = Math.max( $(elements).outerHeight(true), fieldHeight );
			absoluteLeft = Math.min( $(this).position().left, absoluteLeft );
			absoluteTop = Math.min( $(this).position().top, absoluteTop );
		});
		var fwidth = 0, tPos = absoluteTop - dp - dbw, lPos = absoluteLeft + dp, rPos = absoluteLeft + fieldWidth + dp,
			ph = (fieldHeight + (dp * 2)), fhp = fieldHeight + dp + dbw, fwp = fieldWidth + dp,
			clips = [
				'rect(0px, 5000px, ' + (dp + dbw) + 'px, 0px)', // top
				'rect(' + fhp + 'px, 5000px, 5000px, 0px)', // bottom
				'rect(' + dp + 'px, ' + dp + 'px, 5000px, 0px)', // left
				'rect(' + dp + 'px, 5000px, 5000px, ' + fwp + 'px)']; // right
		// fixed alerts, no wrapping
		if (!$.fn.jVal.defaults.wrap) {
			fieldWidth = ph = fph = 12;
			rPos = lPos;
		}
		$(elements).eq(0).before(
			'
' +
			'
' +
				'

' +
				'
' +
					'' + message + '' +
				'
' +
			'
')
			.parent().find('.jfVal>*').each(function () { fwidth += $(this).outerWidth() }).end()
			.find('.jfVal').width(fwidth + 20);
		for (var si = 1; si < 4; si++)
			$(par).find('.jValSpacer:first').before(
				$(par).find('.jValSpacer:first').clone().css({clip:clips[si]}) );
		// autoHide = set spacer width + add autohide function to fx queue
		if ( autoHide )
			$(par).data( 'autoHide', setTimeout(function () { $(par).find('.jfVal').animate({left:lPos,opacity:0}, 200, function () { $.fn.jVal.clean(par); }); }, 10000) )
				.find('.jfVal').css({'left':rPos});
		else
			$(par).find('.jfVal').css({opacity:0}).animate({left:rPos,opacity:1}, 200);
	};
	// validate key stroke
	$.fn.jVal.valKey = function (keyRE, e, cF, cA) {
		var ek = (typeof(e.keyCode) != 'undefined'), ec = (typeof(e.charCode) != 'undefined'),
			k = e.keyCode, c = e.charCode, ks = k.toString();
		// return if invalid regex
		if ( !(keyRE instanceof RegExp) )
			return false;
		// test for ENTER key and cF being valid function otherwise return true
		if ( /^13$/.test(String(k || c)) ) {
			try { (this[cF]) ? this[cF](cA) : eval(cF); } catch(e) { return true; }
			return -1;
		}
		// otherwise test for valid keys supported by the regex allowing meta keys by default
		if	( e.ctrlKey || e.shiftKey || e.metaKey || (
				ek && k > 0 && keyRE.test(String.fromCharCode(k)) ) ||
				( ec && c > 0 && String.fromCharCode(c).search(keyRE) != (-1) ) ||
				( ec && c != k && ek && ks.search(/^(8|9|45|46|35|36|37|39)$/) != (-1) ) ||
				( ec && c == k && ek && ks.search(/^(8|9)$/) != (-1) ||
				( !ec && ek && ks.search(/^(8|9|45|46|35|36|37|39)$/) != (-1) ) )
			) {
			return 1;
		} else {
			return 0;
		}
	};
	// clear all displayed jVal warnings within scope
	$.fn.jVal.clean = function (target) {
		$(target)
			.find('.jfVal,.jValSpacer').stop().remove().end()
			.find('.jVal,[jVal]').css({position:'',borderColor:'',left:'0px',top:'0px'}).parent().find('.jValRelWrap').remove();
	};
	$.fn.jVal.init = function (options) {
		$.fn.jVal.defaults = $.extend($.fn.jVal.defaults, options);
		$('.jVal,[jVal]').filter(':not(:disabled)').unbind("blur").bind("blur", function (e) {
			if ($.fn.jVal.defaults.blurCheck || $(this).hasClass('jValBlur'))
				$(this).parent().jVal();
		});
		var keyFunc = function (e) {
			eval( 'var cmd = ' + ( $(this).data('jValKey') || $(this).attr('jValKey') || $(this).data('jValKeyUp') || $(this).attr('jValKeyUp') ) + ';' );
			var keyTest, ds = $.fn.jVal.defaults.jvalstyle, dkm = $.fn.jVal.defaults.keyMessage,
				autoHide = typeof(cmd.autoHide) != 'undefined' ? cmd.autoHide : true;
			if ( cmd instanceof Object && cmd.valid instanceof Function ) {
				keyTest = cmd.valid( e, this );
				if ( keyTest === false || keyTest.length > 0 ) {
					$.fn.jVal.clean(cmd.target || this);
					// only show warning and allow keypress event to return true
					$.fn.jVal.showWarning(cmd.target || this, ( keyTest || (cmd.message || dkm).replace('%c', String.fromCharCode(e.keyCode || e.charCode))), autoHide, cmd.styleType || ds);
				} else
					$.fn.jVal.clean($(cmd.target || this).parent());
			} else {
				keyTest = $.fn.jVal.valKey( ( (cmd instanceof Object) ? cmd.valid : cmd ), e, (cmd instanceof Object) ? cmd.cFunc : null, (cmd instanceof Object) ? cmd.cArgs : null );
				if ( keyTest == 0 ) {
					$.fn.jVal.clean(cmd.target || this);
					$.fn.jVal.showWarning(cmd.target || this, (( cmd instanceof Object && cmd.message) || dkm).replace('%c', String.fromCharCode(e.keyCode || e.charCode)), autoHide, cmd.styleType || ds);
					return false;
				} else if ( keyTest == -1 )
					return false;
				else
					$.fn.jVal.clean($(cmd.target || this).parent());
			}
			return true;
		};
		$('.jValKey,[jValKey]').filter(':not(:disabled)').unbind("keypress").bind("keypress", keyFunc);
		$('.jValKeyUp,[jValKeyUp]').filter(':not(:disabled)').unbind("keyup").bind("keyup", keyFunc);
		return this; // chainable
	};
	// jVal defaults
	$.fn.jVal.defaults = {
		blurCheck: false,
		message: 'Invalid entry',
		jvalstyle: 'cover',
		keyMessage: '"%c" Invalid character',
		padding: 3,
		border: 1,
		wrap: true
	};
	// automatically init on dom load
	$($.fn.jVal.init);
})(jQuery);


text:
import os
import sys, traceback
import threading
import time
import simplejson as json

import urllib2

from PyQt4 import QtGui,QtCore

from boardlet import Boardlet
from modellet import Modellet

class QuadrigaTicker(Boardlet):
  def __init__(self, parent, targetCurr):
    super(QuadrigaTicker, self).__init__(parent)
    self.p_model = Quadriga( targetCurr )
    self.initUI()

  def initUI(self):
    super(QuadrigaTicker, self).initUI()
    self.p_icon = QtGui.QLabel(self)
    self.p_icon.setGeometry( self.b_imgx(), self.b_imgy(),
                             self.b_iconwidth(),self.b_iconheight() )
    self.p_icon.setPixmap( QtGui.QPixmap(os.getcwd() + "/img/quadriga.png" ) )

    t = threading.Thread(target=self.periodicUpdate)
    t.setDaemon(True)
    t.start()

  def paintEvent(self, e):
    super(QuadrigaTicker, self).paintEvent(e)

    qp = QtGui.QPainter()
    qp.begin(self)
    qp.setPen( self.p_grayPen )
    qp.setFont( self.p_pairFont )
    qp.drawText( self.b_col1x(), self.b_row1y(),
                 'Quadriga BTC' + self.p_model.getTargetCurr() )

    qp.setPen( self.p_whitePen )
    qp.setFont( self.p_normFont )
    qp.drawText( self.b_col1x(), self.b_row2y() - 5,
                 'bid: ' + self.p_model.getBid() )
    qp.drawText( self.b_col1x(), self.b_row3y() - 5,
                 'ask: ' + self.p_model.getAsk() )

    qp.setFont( self.p_timeFont )
    qp.setPen( self.p_grayPen )
    qp.drawText( self.b_imgx(), self.b_row4y(),
                 'Refreshed: ' + self.p_model.getLastUpdated() )
    qp.end()

  def periodicUpdate(self):
    while(True):
      st = self.getNextWaitTimeSeconds()
      time.sleep( st )
      self.p_model.doRefresh()

class Quadriga(Modellet):
  def __init__(self, targetCurr='cad'):
    self.p_targetCurr = targetCurr
    self.p_refreshTime = None
    self.p_bid = '000.00'
    self.p_ask = '000.00'

  def getBid(self):
    return self.p_bid

  def getAsk(self):
    return self.p_ask

  def getTargetCurr(self):
    return self.p_targetCurr

  def doRefresh(self):
    headers = {'User-agent' : 'Mozilla/5.0'}
    req = urllib2.Request('https://api.quadrigacx.com/v2/ticker?book=btc_' + self.p_targetCurr, None, headers )

    try:
      resp = urllib2.urlopen(req).read()
      rdict = json.loads( resp )
      self.p_bid = rdict['bid']
      self.p_ask = rdict['ask']

      super(Quadriga, self).setFaultFlag(False)
      super(Quadriga, self).setLastUpdatedNow()
    except Exception:
      exc_type, exc_value, exc_traceback = sys.exc_info()
      lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
      print ''.join('!! ' + line for line in lines)
      super(Quadriga, self).setFaultFlag(False)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revis. gen. pl. (Leipzig) 3: 454 (1898)

#### Original name
Sphaeria subgemina Berk. & M.A. Curtis

### Remarks
null


text:
{% extends 'base.html' %}

{% block titulo %} Error {% endblock %}

{% block contenido %}

    <article>
            <h2> Error 500 </h2>
            <p> Ha ocurrido un error interno en el Sitio, los administradores ya han sido notificados. Por favor, intente volver más tarde </p>
    </article>

{% endblock %}


text:
#include <aws/monitoring/model/DescribeAlarmHistoryRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

using namespace Aws::CloudWatch::Model;
using namespace Aws::Utils;

DescribeAlarmHistoryRequest::DescribeAlarmHistoryRequest() :
    m_alarmNameHasBeenSet(false),
    m_historyItemType(HistoryItemType::NOT_SET),
    m_historyItemTypeHasBeenSet(false),
    m_startDateHasBeenSet(false),
    m_endDateHasBeenSet(false),
    m_maxRecords(0),
    m_maxRecordsHasBeenSet(false),
    m_nextTokenHasBeenSet(false)
{
}

Aws::String DescribeAlarmHistoryRequest::SerializePayload() const
{
  Aws::StringStream ss;
  ss << "Action=DescribeAlarmHistory&";
  if(m_alarmNameHasBeenSet)
  {
    ss << "AlarmName=" << StringUtils::URLEncode(m_alarmName.c_str()) << "&";
  }

  if(m_historyItemTypeHasBeenSet)
  {
    ss << "HistoryItemType=" << HistoryItemTypeMapper::GetNameForHistoryItemType(m_historyItemType) << "&";
  }

  if(m_startDateHasBeenSet)
  {
    ss << "StartDate=" << StringUtils::URLEncode(m_startDate.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
  }

  if(m_endDateHasBeenSet)
  {
    ss << "EndDate=" << StringUtils::URLEncode(m_endDate.ToGmtString(DateFormat::ISO_8601).c_str()) << "&";
  }

  if(m_maxRecordsHasBeenSet)
  {
    ss << "MaxRecords=" << m_maxRecords << "&";
  }

  if(m_nextTokenHasBeenSet)
  {
    ss << "NextToken=" << StringUtils::URLEncode(m_nextToken.c_str()) << "&";
  }

  ss << "Version=2010-08-01";
  return ss.str();
}

void  DescribeAlarmHistoryRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
  uri.SetQueryString(SerializePayload());
}


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

using System.ComponentModel;
using System.Drawing;
using VsChromium.Core.Utility;

namespace VsChromium.Settings {
  public class GlobalSettings : INotifyPropertyChanged {
    private bool _enableSourceExplorerHierarchy;
    private int _maxTextExtractLength;
    private int _searchFilePathsMaxResults;
    private int _searchCodeMaxResults;
    private int _autoSearchDelayMsec;
    private bool _searchMatchCase;
    private bool _searchMatchWholeWord;
    private bool _searchUseRegEx;
    private bool _searchIncludeSymLinks;
    private bool _searchUnderstandBuildOutputPaths;
    private bool _codingStyleAccessorIndent;
    private bool _codingStyleTrailingSpace;
    private bool _codingStyleTabCharacter;
    private bool _codingStyleSpaceAfterForKeyword;
    private bool _codingStyleOpenBraceAfterNewLine;
    private bool _codingStyleLongLine;
    private bool _codingStyleEndOfLineCharacter;
    private bool _codingStyleElseIfOnNewLine;
    private Font _displayFont;
    private Font _textExtractFont;
    private Font _pathFont;

    public event PropertyChangedEventHandler PropertyChanged;

    protected virtual void OnPropertyChanged(string propertyName) {
      var handler = PropertyChanged;
      if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
    }

    private static int InRange(int value, int min, int max) {
      if (value < min)
        return min;
      if (value > max)
        return max;
      return value;
    }

    public bool EnableSourceExplorerHierarchy {
      get { return _enableSourceExplorerHierarchy; }
      set {
        if (value == _enableSourceExplorerHierarchy)
          return;

        _enableSourceExplorerHierarchy = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x=> x.EnableSourceExplorerHierarchy));
      }
    }

    public int MaxTextExtractLength {
      get { return _maxTextExtractLength; }
      set {
        value = InRange(value, 10, 1024);
        if (value == _maxTextExtractLength)
          return;

        _maxTextExtractLength = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.MaxTextExtractLength));

      }
    }

    public int SearchFilePathsMaxResults {
      get { return _searchFilePathsMaxResults; }
      set {
        value = InRange(value, 100, 1000 * 1000);
        if (value == _searchFilePathsMaxResults)
          return;

        _searchFilePathsMaxResults = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.SearchFilePathsMaxResults));

      }
    }

    public int SearchCodeMaxResults {
      get { return _searchCodeMaxResults; }
      set {
        value = InRange(value, 1000, 1000 * 1000);
        if (value == _searchCodeMaxResults)
          return;

        _searchCodeMaxResults = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.SearchCodeMaxResults));

      }
    }

    public int AutoSearchDelayMsec {
      get { return _autoSearchDelayMsec; }
      set {
        value = InRange(value, 0, int.MaxValue);
        if (value == _autoSearchDelayMsec)
          return;

        _autoSearchDelayMsec = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.AutoSearchDelayMsec));
      }
    }

    public Font DisplayFont {
      get { return _displayFont; }
      set {
        if (object.Equals(value, _displayFont))
          return;

        _displayFont = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.DisplayFont));
      }
    }

    public Font TextExtractFont {
      get { return _textExtractFont; }
      set {
        if (object.Equals(value, _textExtractFont))
          return;

        _textExtractFont = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.TextExtractFont));
      }
    }

    public Font PathFont {
      get { return _pathFont; }
      set {
        if (object.Equals(value, _pathFont))
          return;

        _pathFont = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.PathFont));
      }
    }

    public bool SearchMatchCase {
      get { return _searchMatchCase; }
      set {
        if (value == _searchMatchCase)
          return;

        _searchMatchCase = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.SearchMatchCase));
      }
    }

    public bool SearchMatchWholeWord {
      get { return _searchMatchWholeWord; }
      set {
        if (value == _searchMatchWholeWord)
          return;

        _searchMatchWholeWord = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.SearchMatchWholeWord));
      }
    }

    public bool SearchUseRegEx {
      get { return _searchUseRegEx; }
      set {
        if (value == _searchUseRegEx)
          return;

        _searchUseRegEx = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.SearchUseRegEx));
      }
    }

    public bool SearchIncludeSymLinks {
      get { return _searchIncludeSymLinks; }
      set {
        if (value == _searchIncludeSymLinks)
          return;

        _searchIncludeSymLinks = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.SearchIncludeSymLinks));
      }
    }

    public bool SearchUnderstandBuildOutputPaths {
      get { return _searchUnderstandBuildOutputPaths; }
      set {
        if (value == _searchUnderstandBuildOutputPaths)
          return;

        _searchUnderstandBuildOutputPaths = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.SearchUnderstandBuildOutputPaths));
      }
    }

    #region Chromium Coding Style

    public bool CodingStyleAccessorIndent {
      get { return _codingStyleAccessorIndent; }
      set {
        if (value == _codingStyleAccessorIndent)
          return;

        _codingStyleAccessorIndent = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.CodingStyleAccessorIndent));
      }
    }

    public bool CodingStyleElseIfOnNewLine {
      get { return _codingStyleElseIfOnNewLine; }
      set {
        if (value == _codingStyleElseIfOnNewLine)
          return;

        _codingStyleElseIfOnNewLine = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.CodingStyleElseIfOnNewLine));
      }
    }

    public bool CodingStyleEndOfLineCharacter {
      get { return _codingStyleEndOfLineCharacter; }
      set {
        if (value == _codingStyleEndOfLineCharacter)
          return;

        _codingStyleEndOfLineCharacter = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.CodingStyleEndOfLineCharacter));
      }
    }

    public bool CodingStyleLongLine {
      get { return _codingStyleLongLine; }
      set {
        if (value == _codingStyleLongLine)
          return;

        _codingStyleLongLine = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.CodingStyleLongLine));
      }
    }

    public bool CodingStyleOpenBraceAfterNewLine {
      get { return _codingStyleOpenBraceAfterNewLine; }
      set {
        if (value == _codingStyleOpenBraceAfterNewLine)
          return;

        _codingStyleOpenBraceAfterNewLine = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.CodingStyleOpenBraceAfterNewLine));
      }
    }

    public bool CodingStyleSpaceAfterForKeyword {
      get { return _codingStyleSpaceAfterForKeyword; }
      set {
        if (value == _codingStyleSpaceAfterForKeyword)
          return;

        _codingStyleSpaceAfterForKeyword = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.CodingStyleSpaceAfterForKeyword));
      }
    }

    public bool CodingStyleTabCharacter {
      get { return _codingStyleTabCharacter; }
      set {
        if (value == _codingStyleTabCharacter)
          return;

        _codingStyleTabCharacter = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.CodingStyleTabCharacter));
      }
    }

    public bool CodingStyleTrailingSpace {
      get { return _codingStyleTrailingSpace; }
      set {
        if (value == _codingStyleTrailingSpace)
          return;

        _codingStyleTrailingSpace = value;
        OnPropertyChanged(ReflectionUtils.GetPropertyName(this, x => x.CodingStyleTrailingSpace));
      }
    }

    #endregion
  }
}


text:
<?php

namespace AnyContent\CMCK\Modules\Backend\Admin\ExcelBackup;

use AnyContent\CMCK\Modules\Backend\Edit\Exchange\Exporter;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;

use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

use AnyContent\CMCK\Modules\Backend\Core\Repositories\RepositoryManager;

use Symfony\Component\Filesystem\Filesystem;

class BackupCommand extends \AnyContent\CMCK\Modules\Backend\Core\Application\Command
{

    protected function configure()
    {
        $this->setName('cmck:backup:export')
             ->setDescription('Creates excel backup archive of a repository.')
             ->addArgument(
                 'repository',
                 InputArgument::REQUIRED,
                 'Name/Id of the repository having the content type to be exported. Use the list command to show available repositories.'
             )
             ->addArgument('contentType', InputArgument::OPTIONAL, 'Name of the content type to be exported.')
             ->addOption('path', 'p', InputOption::VALUE_REQUIRED, 'Provide path to export folder.')
             ->addOption('filename', 'f', InputOption::VALUE_REQUIRED, 'Set filename to export.');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {

        $app = $this->getSilexApplication();

        $repositoryName = $input->getArgument('repository');

        /** @var RepositoryManager $repositoryManager */
        $repositoryManager = $app['repos'];

        $repository = $repositoryManager->getRepositoryById($repositoryName);

        if (!$repository) {
            $output->writeln(self::escapeError . 'Repository ' . $repositoryName . ' unknown. Use the list command to show available repositories.' . self::escapeReset);

            return;
        }

        $output->writeln('');
        $output->writeln('Selecting repository ' . $repositoryName);
        $output->writeln('');

        $exporter = new Exporter();
        $exporter->setOutput($output);

        if ($input->getArgument('contentType') != '') {
            $data     = $exporter->backupXLSX($repository, $input->getArgument('contentType'));
            $filename = $repositoryName . '_' . $input->getArgument('contentType') . '_' . date('Ymd_hi') . '.xlsx';
        }
        else {
            $data     = $exporter->backupXLSX($repository);
            $filename = $repositoryName . '_all_' . date('Ymd_hi') . '.xlsx';
        }

        // Check if filename has been provied
        if ($input->getOption('filename')) {
            $filename = $input->getOption('filename');
        }

        // Check if path has been provided

        if ($input->getOption('path')) {
            $path     = $input->getOption('path');
            $realPath = realpath($path);
            if (!$realPath) {
                $output->writeln(self::escapeError . 'Path ' . $path . ' not found.' . self::escapeReset);

                return;
            }

            $filename = $path . '/' . $filename;
        }

        $filesystem = new Filesystem();
        $output->writeln('Dumping data to ' . $filename);
        $filesystem->dumpFile($filename, $data);
        $output->writeln('');
        $output->writeln('Done');
        $output->writeln('');

        return;
    }
}


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">

    <title>Terminus</title>

    <link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="bower_components/angular-tooltips/dist/angular-tooltips.min.css" rel="stylesheet">

    <link href="assets/css/terminus.css" rel="stylesheet">

Player

Map

Combat

Map


text:
<?php

namespace common\models\company;

/**
 * This is the ActiveQuery class for [[CompanyTypePayment]].
 *
 * @see CompanyTypePayment
 */
class CompanyTypePaymentQuery extends \yii\db\ActiveQuery
{
    /*public function active()
    {
        $this->andWhere('[[status]]=1');
        return $this;
    }*/

    /**
     * @inheritdoc
     * @return CompanyTypePayment[]|array
     */
    public function all($db = null)
    {
        return parent::all($db);
    }

    /**
     * @inheritdoc
     * @return CompanyTypePayment|array|null
     */
    public function one($db = null)
    {
        return parent::one($db);
    }
}


text:
import React from 'react';
import { Tooltip, Button, Center } from 'native-base';

export function Example() {
  return (
    <Center>
      <Tooltip
        label="Click here to read more"
        openDelay={500}
        bg="indigo.500"
        _text={{ color: '#fff' }}
      >
        <Button>More</Button>
      </Tooltip>
    </Center>
  );
}