text:
/* Automatically generated by GNU msgfmt.  Do not modify!  */
package com.amazon.redshift.translation;
public class messages_fr extends java.util.ResourceBundle {
  private static final java.lang.String[] table;
  static {
    java.lang.String[] t = new java.lang.String[794];
    t[0] = "";
    t[1] = "Project-Id-Version: head-fr\nReport-Msgid-Bugs-To: \nPO-Revision-Date: 2007-07-27 12:27+0200\nLast-Translator: \nLanguage-Team:  <en@li.org>\nLanguage: \nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\nX-Generator: KBabel 1.11.4\nPlural-Forms:  nplurals=2; plural=(n > 1);\n";
    t[4] = "DataSource has been closed.";
    t[5] = "DataSource a été fermée.";
    t[18] = "Where: {0}";
    t[19] = "Où : {0}";
    t[26] = "The connection attempt failed.";
    t[27] = "La tentative de connexion a échoué.";
    t[28] = "Currently positioned after the end of the ResultSet.  You cannot call deleteRow() here.";
    t[29] = "Actuellement positionné après la fin du ResultSet. Vous ne pouvez pas appeler deleteRow() ici.";
    t[32] = "Can''t use query methods that take a query string on a PreparedStatement.";
    t[33] = "Impossible d''utiliser les fonctions de requête qui utilisent une chaîne de caractères sur un PreparedStatement.";
    t[36] = "Multiple ResultSets were returned by the query.";
    t[37] = "Plusieurs ResultSets ont été retournés par la requête.";
    t[50] = "Too many update results were returned.";
    t[51] = "Trop de résultats de mise à jour ont été retournés.";
    t[58] = "Illegal UTF-8 sequence: initial byte is {0}: {1}";
    t[59] = "Séquence UTF-8 illégale: le premier octet est {0}: {1}";
    t[66] = "The column name {0} was not found in this ResultSet.";
    t[67] = "Le nom de colonne {0} n''a pas été trouvé dans ce ResultSet.";
    t[70] = "Fastpath call {0} - No result was returned and we expected an integer.";
    t[71] = "Appel Fastpath {0} - Aucun résultat n''a été retourné et nous attendions un entier.";
    t[74] = "Protocol error.  Session setup failed.";
    t[75] = "Erreur de protocole. Ouverture de la session en échec.";
    t[76] = "A CallableStatement was declared, but no call to registerOutParameter(1, <some type>) was made.";
    t[77] = "Un CallableStatement a été déclaré, mais aucun appel à registerOutParameter(1, <un type>) n''a été fait.";
    t[78] = "ResultSets with concurrency CONCUR_READ_ONLY cannot be updated.";
    t[79] = "Les ResultSets avec la concurrence CONCUR_READ_ONLY ne peuvent être mis à jour.";
    t[90] = "LOB positioning offsets start at 1.";
    t[91] = "Les décalages de position des LOB commencent à 1.";
    t[92] = "Internal Position: {0}";
    t[93] = "Position interne : {0}";
    t[96] = "free() was called on this LOB previously";
    t[97] = "free() a été appelée auparavant sur ce LOB";
    t[100] = "Cannot change transaction read-only property in the middle of a transaction.";
    t[101] = "Impossible de changer la propriété read-only d''une transaction au milieu d''une transaction.";
    t[102] = "The JVM claims not to support the {0} encoding.";
    t[103] = "La JVM prétend ne pas supporter l''encodage {0}.";
    t[108] = "{0} function doesn''t take any argument.";
    t[109] = "La fonction {0} n''accepte aucun argument.";
    t[112] = "xid must not be null";
    t[113] = "xid ne doit pas être nul";
    t[114] = "Connection has been closed.";
    t[115] = "La connexion a été fermée.";
    t[122] = "The server does not support SSL.";
    t[123] = "Le serveur ne supporte pas SSL.";
    t[140] = "Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}";
    t[141] = "Séquence UTF-8 illégale: l''octet {0} de la séquence d''octet {1} n''est pas 10xxxxxx: {2}";
    t[148] = "Hint: {0}";
    t[149] = "Indice : {0}";
    t[152] = "Unable to find name datatype in the system catalogs.";
    t[153] = "Incapable de trouver le type de donnée name dans les catalogues systèmes.";
    t[156] = "Unsupported Types value: {0}";
    t[157] = "Valeur de type non supportée : {0}";
    t[158] = "Unknown type {0}.";
    t[159] = "Type inconnu : {0}.";
    t[166] = "{0} function takes two and only two arguments.";
    t[167] = "La fonction {0} n''accepte que deux et seulement deux arguments.";
    t[170] = "Finalizing a Connection that was never closed:";
    t[171] = "Destruction d''une connection qui n''a jamais été fermée:";
    t[180] = "The maximum field size must be a value greater than or equal to 0.";
    t[181] = "La taille maximum des champs doit être une valeur supérieure ou égale à 0.";
    t[186] = "Redshift LOBs can only index to: {0}";
    t[187] = "Les LOB Redshift peuvent seulement s''indicer à: {0}";
    t[194] = "Method {0} is not yet implemented.";
    t[195] = "La fonction {0} n''est pas encore implémentée.";
    t[198] = "Error loading default settings from driverconfig.properties";
    t[199] = "Erreur de chargement des valeurs par défaut depuis driverconfig.properties";
    t[200] = "Results cannot be retrieved from a CallableStatement before it is executed.";
    t[201] = "Les résultats ne peuvent être récupérés à partir d''un CallableStatement avant qu''il ne soit exécuté.";
    t[202] = "Large Objects may not be used in auto-commit mode.";
    t[203] = "Les Large Objects ne devraient pas être utilisés en mode auto-commit.";
    t[208] = "Expected command status BEGIN, got {0}.";
    t[209] = "Attendait le statut de commande BEGIN, obtenu {0}.";
    t[218] = "Invalid fetch direction constant: {0}.";
    t[219] = "Constante de direction pour la récupération invalide : {0}.";
    t[222] = "{0} function takes three and only three arguments.";
    t[223] = "La fonction {0} n''accepte que trois et seulement trois arguments.";
    t[226] = "Error during recover";
    t[227] = "Erreur durant la restauration";
    t[228] = "Cannot update the ResultSet because it is either before the start or after the end of the results.";
    t[229] = "Impossible de mettre à jour le ResultSet car c''est soit avant le début ou après la fin des résultats.";
    t[232] = "Parameter of type {0} was registered, but call to get{1} (sqltype={2}) was made.";
    t[233] = "Un paramètre de type {0} a été enregistré, mais un appel à get{1} (sqltype={2}) a été fait.";
    t[240] = "Cannot establish a savepoint in auto-commit mode.";
    t[241] = "Impossible d''établir un savepoint en mode auto-commit.";
    t[242] = "Cannot retrieve the id of a named savepoint.";
    t[243] = "Impossible de retrouver l''identifiant d''un savepoint nommé.";
    t[244] = "The column index is out of range: {0}, number of columns: {1}.";
    t[245] = "L''indice de la colonne est hors limite : {0}, nombre de colonnes : {1}.";
    t[250] = "Something unusual has occurred to cause the driver to fail. Please report this exception.";
    t[251] = "Quelque chose d''inhabituel a provoqué l''échec du pilote. Veuillez faire un rapport sur cette erreur.";
    t[260] = "Cannot cast an instance of {0} to type {1}";
    t[261] = "Impossible de convertir une instance de {0} vers le type {1}";
    t[264] = "Unknown Types value.";
    t[265] = "Valeur de Types inconnue.";
    t[266] = "Invalid stream length {0}.";
    t[267] = "Longueur de flux invalide {0}.";
    t[272] = "Cannot retrieve the name of an unnamed savepoint.";
    t[273] = "Impossible de retrouver le nom d''un savepoint sans nom.";
    t[274] = "Unable to translate data into the desired encoding.";
    t[275] = "Impossible de traduire les données dans l''encodage désiré.";
    t[276] = "Expected an EOF from server, got: {0}";
    t[277] = "Attendait une fin de fichier du serveur, reçu: {0}";
    t[278] = "Bad value for type {0} : {1}";
    t[279] = "Mauvaise valeur pour le type {0} : {1}";
    t[280] = "The server requested password-based authentication, but no password was provided.";
    t[281] = "Le serveur a demandé une authentification par mots de passe, mais aucun mot de passe n''a été fourni.";
    t[296] = "Truncation of large objects is only implemented in 8.3 and later servers.";
    t[297] = "Le troncage des large objects n''est implémenté que dans les serveurs 8.3 et supérieurs.";
    t[298] = "This PooledConnection has already been closed.";
    t[299] = "Cette PooledConnection a déjà été fermée.";
    t[306] = "Fetch size must be a value greater to or equal to 0.";
    t[307] = "Fetch size doit être une valeur supérieur ou égal à 0.";
    t[312] = "A connection could not be made using the requested protocol {0}.";
    t[313] = "Aucune connexion n''a pu être établie en utilisant le protocole demandé {0}. ";
    t[322] = "There are no rows in this ResultSet.";
    t[323] = "Il n''y pas pas de lignes dans ce ResultSet.";
    t[324] = "Unexpected command status: {0}.";
    t[325] = "Statut de commande inattendu : {0}.";
    t[334] = "Not on the insert row.";
    t[335] = "Pas sur la ligne en insertion.";
    t[344] = "Server SQLState: {0}";
    t[345] = "SQLState serveur : {0}";
    t[348] = "The server''s standard_conforming_strings parameter was reported as {0}. The JDBC driver expected on or off.";
    t[349] = "Le paramètre serveur standard_conforming_strings a pour valeur {0}. Le driver JDBC attend on ou off.";
    t[360] = "The driver currently does not support COPY operations.";
    t[361] = "Le pilote ne supporte pas actuellement les opérations COPY.";
    t[364] = "The array index is out of range: {0}, number of elements: {1}.";
    t[365] = "L''indice du tableau est hors limites : {0}, nombre d''éléments : {1}.";
    t[374] = "suspend/resume not implemented";
    t[375] = "suspend/resume pas implémenté";
    t[378] = "Not implemented: one-phase commit must be issued using the same connection that was used to start it";
    t[379] = "Pas implémenté: le commit à une phase doit avoir lieu en utilisant la même connection que celle où il a commencé";
    t[398] = "Cannot call cancelRowUpdates() when on the insert row.";
    t[399] = "Impossible d''appeler cancelRowUpdates() pendant l''insertion d''une ligne.";
    t[400] = "Cannot reference a savepoint after it has been released.";
    t[401] = "Impossible de référencer un savepoint après qu''il ait été libéré.";
    t[402] = "You must specify at least one column value to insert a row.";
    t[403] = "Vous devez spécifier au moins une valeur de colonne pour insérer une ligne.";
    t[404] = "Unable to determine a value for MaxIndexKeys due to missing system catalog data.";
    t[405] = "Incapable de déterminer la valeur de MaxIndexKeys en raison de données manquante dans lecatalogue système.";
    t[412] = "The JVM claims not to support the encoding: {0}";
    t[413] = "La JVM prétend ne pas supporter l''encodage: {0}";
    t[414] = "{0} function takes two or three arguments.";
    t[415] = "La fonction {0} n''accepte que deux ou trois arguments.";
    t[440] = "Unexpected error writing large object to database.";
    t[441] = "Erreur inattendue pendant l''écriture de large object dans la base.";
    t[442] = "Zero bytes may not occur in string parameters.";
    t[443] = "Zéro octets ne devrait pas se produire dans les paramètres de type chaîne de caractères.";
    t[444] = "A result was returned when none was expected.";
    t[445] = "Un résultat a été retourné alors qu''aucun n''était attendu.";
    t[450] = "ResultSet is not updateable.  The query that generated this result set must select only one table, and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details.";
    t[451] = "Le ResultSet n''est pas modifiable. La requête qui a généré ce résultat doit sélectionner seulement une table, et doit sélectionner toutes les clés primaires de cette table. Voir la spécification de l''API JDBC 2.1, section 5.6 pour plus de détails.";
    t[454] = "Bind message length {0} too long.  This can be caused by very large or incorrect length specifications on InputStream parameters.";
    t[455] = "La longueur du message de liaison {0} est trop grande. Cela peut être causé par des spécification de longueur très grandes ou incorrectes pour les paramètres de type InputStream.";
    t[460] = "Statement has been closed.";
    t[461] = "Statement a été fermé.";
    t[462] = "No value specified for parameter {0}.";
    t[463] = "Pas de valeur spécifiée pour le paramètre {0}.";
    t[468] = "The array index is out of range: {0}";
    t[469] = "L''indice du tableau est hors limites : {0}";
    t[474] = "Unable to bind parameter values for statement.";
    t[475] = "Incapable de lier les valeurs des paramètres pour la commande.";
    t[476] = "Can''t refresh the insert row.";
    t[477] = "Impossible de rafraîchir la ligne insérée.";
    t[480] = "No primary key found for table {0}.";
    t[481] = "Pas de clé primaire trouvée pour la table {0}.";
    t[482] = "Cannot change transaction isolation level in the middle of a transaction.";
    t[483] = "Impossible de changer le niveau d''isolation des transactions au milieu d''une transaction.";
    t[498] = "Provided InputStream failed.";
    t[499] = "L''InputStream fourni a échoué.";
    t[500] = "The parameter index is out of range: {0}, number of parameters: {1}.";
    t[501] = "L''indice du paramètre est hors limites : {0}, nombre de paramètres : {1}.";
    t[502] = "The server''s DateStyle parameter was changed to {0}. The JDBC driver requires DateStyle to begin with ISO for correct operation.";
    t[503] = "Le paramètre DateStyle du serveur a été changé pour {0}. Le pilote JDBC nécessite que DateStyle commence par ISO pour un fonctionnement correct.";
    t[508] = "Connection attempt timed out.";
    t[509] = "La tentative de connexion a échoué dans le délai imparti.";
    t[512] = "Internal Query: {0}";
    t[513] = "Requête interne: {0}";
    t[518] = "The authentication type {0} is not supported. Check that you have configured the pg_hba.conf file to include the client''s IP address or subnet, and that it is using an authentication scheme supported by the driver.";
    t[519] = "Le type d''authentification {0} n''est pas supporté. Vérifiez que vous avez configuré le fichier pg_hba.conf pour inclure l''adresse IP du client ou le sous-réseau et qu''il utilise un schéma d''authentification supporté par le pilote.";
    t[526] = "Interval {0} not yet implemented";
    t[527] = "L''interval {0} n''est pas encore implémenté";
    t[532] = "Conversion of interval failed";
    t[533] = "La conversion de l''intervalle a échoué";
    t[540] = "Query timeout must be a value greater than or equals to 0.";
    t[541] = "Query timeout doit être une valeur supérieure ou égale à 0.";
    t[542] = "Connection has been closed automatically because a new connection was opened for the same PooledConnection or the PooledConnection has been closed.";
    t[543] = "La connexion a été fermée automatiquement car une nouvelle connexion a été ouverte pour la même PooledConnection ou la PooledConnection a été fermée.";
    t[544] = "ResultSet not positioned properly, perhaps you need to call next.";
    t[545] = "Le ResultSet n''est pas positionné correctement, vous devez peut-être appeler next().";
    t[550] = "This statement has been closed.";
    t[551] = "Ce statement a été fermé.";
    t[552] = "Can''t infer the SQL type to use for an instance of {0}. Use setObject() with an explicit Types value to specify the type to use.";
    t[553] = "Impossible de déduire le type SQL à utiliser pour une instance de {0}. Utilisez setObject() avec une valeur de type explicite pour spécifier le type à utiliser.";
    t[554] = "Cannot call updateRow() when on the insert row.";
    t[555] = "Impossible d''appeler updateRow() tant que l''on est sur la ligne insérée.";
    t[562] = "Detail: {0}";
    t[563] = "Détail : {0}";
    t[566] = "Cannot call deleteRow() when on the insert row.";
    t[567] = "Impossible d''appeler deleteRow() pendant l''insertion d''une ligne.";
    t[568] = "Currently positioned before the start of the ResultSet.  You cannot call deleteRow() here.";
    t[569] = "Actuellement positionné avant le début du ResultSet. Vous ne pouvez pas appeler deleteRow() ici.";
    t[576] = "Illegal UTF-8 sequence: final value is a surrogate value: {0}";
    t[577] = "Séquence UTF-8 illégale: la valeur finale est une valeur de remplacement: {0}";
    t[578] = "Unknown Response Type {0}.";
    t[579] = "Type de réponse inconnu {0}.";
    t[582] = "Unsupported value for stringtype parameter: {0}";
    t[583] = "Valeur non supportée pour les paramètre de type chaîne de caractères : {0}";
    t[584] = "Conversion to type {0} failed: {1}.";
    t[585] = "La conversion vers le type {0} a échoué : {1}.";
    t[586] = "Conversion of money failed.";
    t[587] = "La conversion de money a échoué.";
    t[600] = "Unable to load the class {0} responsible for the datatype {1}";
    t[601] = "Incapable de charger la classe {0} responsable du type de données {1}";
    t[604] = "The fastpath function {0} is unknown.";
    t[605] = "La fonction fastpath {0} est inconnue.";
    t[608] = "Malformed function or procedure escape syntax at offset {0}.";
    t[609] = "Syntaxe de fonction ou d''échappement de procédure malformée à l''indice {0}.";
    t[612] = "Provided Reader failed.";
    t[613] = "Le Reader fourni a échoué.";
    t[614] = "Maximum number of rows must be a value grater than or equal to 0.";
    t[615] = "Le nombre maximum de lignes doit être une valeur supérieure ou égale à 0.";
    t[616] = "Failed to create object for: {0}.";
    t[617] = "Échec à la création de l''objet pour : {0}.";
    t[622] = "Premature end of input stream, expected {0} bytes, but only read {1}.";
    t[623] = "Fin prématurée du flux en entrée, {0} octets attendus, mais seulement {1} lus.";
    t[626] = "An unexpected result was returned by a query.";
    t[627] = "Un résultat inattendu a été retourné par une requête.";
    t[646] = "An error occurred while setting up the SSL connection.";
    t[647] = "Une erreur s''est produite pendant l''établissement de la connexion SSL.";
    t[654] = "Illegal UTF-8 sequence: {0} bytes used to encode a {1} byte value: {2}";
    t[655] = "Séquence UTF-8 illégale: {0} octets utilisé pour encoder une valeur à {1} octets: {2}";
    t[658] = "The SSLSocketFactory class provided {0} could not be instantiated.";
    t[659] = "La classe SSLSocketFactory fournie {0} n''a pas pu être instanciée.";
    t[670] = "Position: {0}";
    t[671] = "Position : {0}";
    t[676] = "Location: File: {0}, Routine: {1}, Line: {2}";
    t[677] = "Localisation : Fichier : {0}, Routine : {1}, Ligne : {2}";
    t[684] = "Cannot tell if path is open or closed: {0}.";
    t[685] = "Impossible de dire si path est fermé ou ouvert : {0}.";
    t[700] = "Cannot convert an instance of {0} to type {1}";
    t[701] = "Impossible de convertir une instance de type {0} vers le type {1}";
    t[710] = "{0} function takes four and only four argument.";
    t[711] = "La fonction {0} n''accepte que quatre et seulement quatre arguments.";
    t[718] = "Interrupted while attempting to connect.";
    t[719] = "Interrompu pendant l''établissement de la connexion.";
    t[722] = "Illegal UTF-8 sequence: final value is out of range: {0}";
    t[723] = "Séquence UTF-8 illégale: la valeur finale est en dehors des limites: {0}";
    t[734] = "No function outputs were registered.";
    t[735] = "Aucune fonction outputs n''a été enregistrée.";
    t[736] = "{0} function takes one and only one argument.";
    t[737] = "La fonction {0} n''accepte qu''un et un seul argument.";
    t[744] = "This ResultSet is closed.";
    t[745] = "Ce ResultSet est fermé.";
    t[746] = "Invalid character data was found.  This is most likely caused by stored data containing characters that are invalid for the character set the database was created in.  The most common example of this is storing 8bit data in a SQL_ASCII database.";
    t[747] = "Des données de caractères invalides ont été trouvées. C''est probablement causé par le stockage de caractères invalides pour le jeu de caractères de création de la base. L''exemple le plus courant est le stockage de données 8bit dans une base SQL_ASCII.";
    t[750] = "An I/O error occurred while sending to the backend.";
    t[751] = "Une erreur d''entrée/sortie a eu lieu lors d''envoi vers le serveur.";
    t[752] = "Error disabling autocommit";
    t[753] = "Erreur en désactivant autocommit";
    t[754] = "Ran out of memory retrieving query results.";
    t[755] = "Ai manqué de mémoire en récupérant les résultats de la requête.";
    t[756] = "Returning autogenerated keys is not supported.";
    t[757] = "Le renvoi des clés automatiquement générées n''est pas supporté.";
    t[760] = "Operation requires a scrollable ResultSet, but this ResultSet is FORWARD_ONLY.";
    t[761] = "L''opération nécessite un scrollable ResultSet, mais ce ResultSet est FORWARD_ONLY.";
    t[762] = "A CallableStatement function was executed and the out parameter {0} was of type {1} however type {2} was registered.";
    t[763] = "Une fonction CallableStatement a été exécutée et le paramètre en sortie {0} était du type {1} alors que le type {2} était prévu.";
    t[768] = "Unknown ResultSet holdability setting: {0}.";
    t[769] = "Paramètre holdability du ResultSet inconnu : {0}.";
    t[772] = "Transaction isolation level {0} not supported.";
    t[773] = "Le niveau d''isolation de transaction {0} n''est pas supporté.";
    t[774] = "Zero bytes may not occur in identifiers.";
    t[775] = "Des octects à 0 ne devraient pas apparaître dans les identifiants.";
    t[776] = "No results were returned by the query.";
    t[777] = "Aucun résultat retourné par la requête.";
    t[778] = "A CallableStatement was executed with nothing returned.";
    t[779] = "Un CallableStatement a été exécuté mais n''a rien retourné.";
    t[780] = "wasNull cannot be call before fetching a result.";
    t[781] = "wasNull ne peut pas être appelé avant la récupération d''un résultat.";
    t[786] = "This statement does not declare an OUT parameter.  Use '{' ?= call ... '}' to declare one.";
    t[787] = "Cette requête ne déclare pas de paramètre OUT. Utilisez '{' ?= call ... '}' pour en déclarer un.";
    t[788] = "Can''t use relative move methods while on the insert row.";
    t[789] = "Impossible d''utiliser les fonctions de déplacement relatif pendant l''insertion d''une ligne.";
    t[792] = "Connection is busy with another transaction";
    t[793] = "La connection est occupée avec une autre transaction";
    table = t;
  }
  public java.lang.Object handleGetObject (java.lang.String msgid) throws java.util.MissingResourceException {
    int hash_val = msgid.hashCode() & 0x7fffffff;
    int idx = (hash_val % 397) << 1;
    {
      java.lang.Object found = table[idx];
      if (found == null)
        return null;
      if (msgid.equals(found))
        return table[idx + 1];
    }
    int incr = ((hash_val % 395) + 1) << 1;
    for (;;) {
      idx += incr;
      if (idx >= 794)
        idx -= 794;
      java.lang.Object found = table[idx];
      if (found == null)
        return null;
      if (msgid.equals(found))
        return table[idx + 1];
    }
  }
  public java.util.Enumeration getKeys () {
    return
      new java.util.Enumeration() {
        private int idx = 0;
        { while (idx < 794 && table[idx] == null) idx += 2; }
        public boolean hasMoreElements () {
          return (idx < 794);
        }
        public java.lang.Object nextElement () {
          java.lang.Object key = table[idx];
          do idx += 2; while (idx < 794 && table[idx] == null);
          return key;
        }
      };
  }
  public java.util.ResourceBundle getParent () {
    return parent;
  }
}


text:
<?php

namespace Gponster\OAuth\Provider;

use Carbon\Carbon;
use Session;
use Config;
use Auth;
use Illuminate\Support\Facades\Response;

/**
 * This is class OAuth Server
 *
 * @author Vu Dang a.k.a Gponster <anhvudg@gmail.com>
 * @see http://code.google.com/p/oauth-php
 */
class Server extends RequestVerifier {

	/**
	 * Whether bypass nonce or not
	 *
	 * @var boolean
	 *
	 */
	protected $forceBypassNonce = true;

	/**
	 *
	 * @var string Prefix to use for session variables
	 */
	protected $sessionPrefix = 'gponster/oauth-server_';

	/**
	 *
	 * @var string State token for validation
	 */
	protected $state;

	/**
	 *
	 * @var boolean Toggle for PHP session status check
	 */
	protected $checkForSessionStatus = true;

	/**
	 * This is method requestToken
	 *
	 * @return void
	 *
	 */
	public function xAuth() {
		// Auth config
		$auth = \Config::get('gponster/laravel-oauth-server::auth');

		// ----------------------------------------------------------------------------
		// IF PASSWORD STORE IN DATABASE AS DIGEST FORMAT, CLIENT APPLICATION
		// MUST GENERATE PASSWORD DIGEST BEFORE BUILD SIGNATURE WITH SAME ALGORITHM
		// ----------------------------------------------------------------------------
		$credentials = [
			$auth['username'] => $this->getParam(self::X_AUTH_USERNAME, true),
			$auth['password'] => $this->getParam(self::X_AUTH_PASSWORD, true),
			$auth['status'] => 1
		];

		if(empty($credentials[$auth['username']])) {
			throw OAuthException::make(OAuthException::PARAMETER_ABSENT,
				[
					'name' => self::X_AUTH_USERNAME
				]);
		}

		if(empty($credentials[$auth['password']])) {
			throw OAuthException::make(OAuthException::PARAMETER_ABSENT,
				[
					'name' => self::X_AUTH_PASSWORD
				]);
		}

		$xAuthMode = $this->getParam(self::X_AUTH_MODE, true);
		$loggedIn = false;
		$user = null;

		if($xAuthMode == 'client_auth') {
			$loggedIn = \Auth::validate($credentials);
			if($loggedIn) {
				$user = Auth::getLastAttempted();
			}
		} else if(! empty($auth['social_login'])) {
			// Try social-login
			$provider = \App::make(
				'Gponster\\OAuth\\Provider\\SocialLoginProviderInterface');
			$user = $provider->login($xAuthMode, $credentials[$auth['username']],
				$credentials[$auth['password']], null);
		}

		if(! $user) {
			throw OAuthException::make(OAuthException::INVALID_CREDENTIALS,
				[
					'username' => $credentials[$auth['username']]
				]);
		}

		// Verify request if signature not valid
		$result = $this->verify(false, $this->forceBypassNonce);

		$options = [];
		$options['callback_url'] = isset($result['callback_url']) ? $result['callback_url'] : null;
		$options['referer_url'] = isset($result['referer_url']) ? $result['referer_url'] : null;

		// Should have a transaction here?
		$accessToken = $this->storages['access_token']->createAccessToken(
			$result['consumer_key'], $credentials[$auth['username']], $options);
		if(! $accessToken) {
			throw new \RuntimeException(
				'Cannot create new access token for ' . json_encode($result));
		}

		$data = [];
		$data[self::OAUTH_TOKEN] = Rfc3986::urlEncode($accessToken['token']);
		$data[self::OAUTH_TOKEN_SECRET] = Rfc3986::urlEncode($accessToken['token_secret']);
		$data[self::OAUTH_CALLBACK_CONFIRMED] = 1;

		$data['user'] = [
			$auth['username'] => $user->{$auth['username']}
		];

		// Get extra information
		if(! empty($auth['profile'])) {
			$provider = \App::make(
				'Gponster\\OAuth\\Provider\\UserProfileProviderInterface');
			$profile = $provider->profile($user->{$auth['username']}, [
				'login' => true
			]);

			if(is_array($profile)) {
				$data['user'] = array_merge($data['user'], $profile);
			}
		}

		if(! empty($accessToken['expires_at']) && is_numeric($accessToken['expires_at'])) {
			$expiresAt = Carbon::createFromTimestamp(intval($accessToken['expires_at']));

			$data[self::XOAUTH_TOKEN_TTL] = $expiresAt->diffInSeconds();
			$data['expires_at'] = $expiresAt->timestamp;
		}

		return $data;
	}

	/**
	 * This is method requestToken
	 *
	 * @return mixed This is the return value description
	 */
	public function requestToken() {
		$this->verify(false);

		// Optional TTL
		$options = array();
		$ttl = $this->getParam(self::XOAUTH_TOKEN_TTL, false);
		if($ttl) {
			$options['token_ttl'] = $ttl;
		}

		// 1.0a Compatibility : associate callback url to the request token
		$callbackUrl = $this->getParam(self::OAUTH_CALLBACK, true);
		if($callbackUrl) {
			$options['callback_url'] = $callbackUrl;
		}

		// Create a request token
		$consumerKey = $this->getParam(self::OAUTH_CONSUMER_KEY, true);

		if(! isset($this->storages['request_token'])) {
			throw new \RuntimeException(
				'You must supply a storage object implementing ' .
					 $this->storageMap['request_token']);
		}

		// MUST be included with an empty value to indicate this is a two-legged request.
		$is2Legged = $this->getParam(self::OAUTH_CALLBACK) === '';
		if($is2Legged) {
			// Create pre-authorized request token
		}

		$requestToken = $this->storages['request_token']->createRequestToken($consumerKey,
			$options);

		$data = [];
		$data[self::OAUTH_TOKEN] = Rfc3986::urlEncode($requestToken['token']);
		$data[self::OAUTH_TOKEN_SECRET] = Rfc3986::urlEncode(
			$requestToken['token_secret']);
		$data[self::OAUTH_CALLBACK_CONFIRMED] = '1';

		if(! empty($requestToken['expires_at']) && is_numeric($requestToken['expires_at'])) {
			$expiresAt = Carbon::createFromTimestamp(intval($requestToken['expires_at']));

			$data[self::XOAUTH_TOKEN_TTL] = $expiresAt->diffInSeconds();
		}

		return $data;
	}

	public function getRequestToken($token) {
		if(! isset($this->storages['request_token'])) {
			throw new \RuntimeException(
				'You must supply a storage object implementing ' .
					 $this->storageMap['request_token']);
		}

		$requestToken = $this->storages['request_token']->getRequestToken($token);
		if(! $requestToken) {
			throw OAuthException::make(OAuthException::TOKEN_REJECTED,
				[
					'value' => $token
				]);
		}

		return $requestToken;
	}

	/**
	 * Verify the authorization information
	 *
	 * @return array The state of authorization flow
	 */
	public function authorizeVerify() {
		// Authorization implementation goes here
		$token = $this->getParam(self::OAUTH_TOKEN, true);

		if(! isset($this->storages['request_token'])) {
			throw new \RuntimeException(
				'You must supply a storage object implementing ' .
					 $this->storageMap['request_token']);
		}

		$requestToken = $this->storages['request_token']->getRequestToken($token);
		if(! $requestToken) {
			throw OAuthException::make(OAuthException::TOKEN_REJECTED,
				[
					'value' => $token
				]);
		}

		$state = $this->loadState();

		// We need to remember the callback
		if(empty($state['token']) || strcmp($state['token'], $requestToken['token'])) {
			$state['token'] = $requestToken['token'];
			$state['consumer_key'] = $requestToken['consumer_key'];

			$cb = $this->getParam(self::OAUTH_CALLBACK, true);
			if($cb) {
				$state['callback_url'] = $cb;
			} else {
				$state['callback_url'] = $requestToken['callback_url'];
			}

			$this->storeState($state);
		}

		return $state;
	}

	/**
	 * Finish the authozization flow
	 *
	 * @param boolean $authorized
	 *        	Whether user authorized or not
	 * @param string $username
	 *        	The authorizing username
	 * @return string The verifier/PIN code
	 */
	public function authorizeFinish($authorized, $username) {
		$token = $this->getParam(self::OAUTH_TOKEN, true);
		$result = null;

		// Initialize session
		$state = $this->loadState();

		// Check session has verified
		if(isset($state['token']) && $state['token'] == $token) {
			// Fetch the referrer host from the oauth callback parameter
			$refererUrl = '';
			$callbackUrl = false;
			if(! empty($state['callback_url']) && $state['callback_url'] != 'oob') { // OUT OF BAND
				$callbackUrl = $state['callback_url'];
				$components = parse_url($callbackUrl);

				if(isset($components['host'])) {
					$refererUrl = $components['host'];
				}
			}

			if(! isset($this->storages['request_token'])) {
				throw new \RuntimeException(
					'You must supply a storage object implementing ' .
						 $this->storageMap['request_token']);
			}

			if($authorized) {
				// 1.0a Compatibility : create a verifier code
				$result = $this->storages['request_token']->authorizeRequestToken($token,
					$username, $refererUrl);
			} else {
				$this->storages['request_token']->deleteRequestToken($token);
			}

			if(! empty($callbackUrl)) {
				$params = [
					'oauth_token' => rawurlencode($token)
				];

				// 1.0a Compatibility : if verifier code has been generated, add it to the URL
				if($result) {
					$params['oauth_verifier'] = $result['verifier'];
				}

				$this->redirect($callbackUrl, $params);
			}
		}

		return $result;
	}

	/**
	 * Exchange a request token for an access token
	 *
	 * @param boolean $bypassNonce
	 *        	Whether bypass nonce check or not
	 * @return array The new access token
	 */
	public function accessToken($bypassNonce = false) {
		$result = $this->verify('request', $bypassNonce);

		// Optional TTL
		$options = array();
		$ttl = $this->getParam(self::XOAUTH_TOKEN_TTL, true);
		if($ttl) {
			$options['token_ttl'] = $ttl;
		}

		$verifier = $this->getParam(self::OAUTH_VERIFIER, true);
		if($verifier) {
			$options['verifier'] = $verifier;
		}

		$options['callback_url'] = isset($result['callback_url']) ? $result['callback_url'] : null;
		$options['referer_url'] = isset($result['referer_url']) ? $result['referer_url'] : null;

		// Exchange request token for an access token
		if(! isset($this->storages['request_token'])) {
			throw new \RuntimeException(
				'You must supply a storage object implementing ' .
					 $this->storageMap['request_token']);
		}

		if(! isset($this->storages['access_token'])) {
			throw new \RuntimeException(
				'You must supply a storage object implementing ' .
					 $this->storageMap['access_token']);
		}

		// Should have a transaction here?
		$accessToken = $this->storages['access_token']->createAccessToken(
			$result['consumer_key'], $result['username'], $options);
		if(! $accessToken) {
			throw new \RuntimeException(
				'Cannot create new access token for ' . json_encode($result));
		}

		// Delete request token here
		$this->storages['access_token']->deleteRequestToken($result['token']);

		$data = [];
		$data[self::OAUTH_TOKEN] = Rfc3986::urlEncode($accessToken['token']);
		$data[self::OAUTH_TOKEN_SECRET] = Rfc3986::urlEncode($accessToken['token_secret']);
		$data[self::OAUTH_CALLBACK_CONFIRMED] = 1;

		if(! empty($accessToken['expires_at']) && is_numeric($accessToken['expires_at'])) {
			$expiresAt = Carbon::createFromTimestamp(intval($accessToken['expires_at']));

			$data[self::XOAUTH_TOKEN_TTL] = $expiresAt->diffInSeconds();
		}

		return $data;
	}

	protected function storeState($state) {
		Session::put($this->sessionPrefix . 'state', $state);
	}

	protected function loadState() {
		$this->state = Session::get($this->sessionPrefix . 'state');
		return $this->state;
	}

	/**
	 * Disables the session_status() check when using $_SESSION
	 */
	public function disableSessionStatusCheck() {
		$this->checkForSessionStatus = false;
	}

	/**
	 * This is method fault
	 *
	 * @param mixed $exception
	 *        	This is a description
	 * @param mixed $format
	 *        	This is a description
	 * @param mixed $httpCode
	 *        	This is a description
	 * @return mixed This is the return value description
	 */
	public function fault($exception = null, $format = 'json', $httpCode = null) {
		$error = false;
		if($exception instanceof OAuthException) {
			$error = [
				'code' => $exception->getCode(), 'message' => $exception->getMessage()
			];
		} else if($exception instanceof \Exception) {
			$error = [
				'code' => $exception->getCode(), 'message' => $exception->getMessage()
			];
		} else {
			$error = [
				'code' => BAD_URL, 'message' => static::getError(BAD_URL)
			];
		}

		switch($format) {
			case 'xml':
				$errorXml = Response::error($error['code'], $error['message']);
				return $errorXml;

			case 'plain-text':
				return Response::plain($error);

			case 'json':
				$errorXml = Response::error($error['code'], $error['message'], false);
				return Zend_Json::fromXml($errorXml);
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
package samples.powermockito.junit4.annotationbased;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import samples.finalmocking.FinalDemo;
import samples.injectmocks.DependencyHolder;

import static org.junit.Assert.assertNotNull;

/**
 * Asserts that {@link @InjectMocks} with PowerMock.
 */
@RunWith(PowerMockRunner.class)
@PrepareForTest(FinalDemo.class)
public class InjectMocksAnnotationTest {

	@SuppressWarnings("unused")
	@Mock
	private FinalDemo finalDemo;

	@InjectMocks
	private DependencyHolder dependencyHolder = new DependencyHolder();

	@Test
	public void injectMocksWorks() throws Exception {
		assertNotNull(dependencyHolder.getFinalDemo());
	}
}


text:
package org.wildfly.swarm.ejb.remote.runtime;

import org.wildfly.swarm.naming.NamingFraction;
import org.wildfly.swarm.spi.api.Customizer;
import org.wildfly.swarm.spi.runtime.annotations.Post;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Any;
import javax.enterprise.inject.Instance;
import javax.inject.Inject;

@Post
@ApplicationScoped
public class RemoteNamingCustomizer implements Customizer {
    @Inject
    @Any
    Instance<NamingFraction> namingInstance;

    @Override
    public void customize() {
        if (!namingInstance.isUnsatisfied()) {
            namingInstance.get().remoteNamingService();
        }
    }
}


text:
package telegram

import (
	"testing"

	"github.com/go-telegram-bot-api/telegram-bot-api"
	"github.com/kr/pretty"
	"github.com/stretchr/testify/assert"
)

func TestInputTextMessageContent_content(t *testing.T) {
	actual := InputTextMessageContent{
		MessageText: "Hello",
		ParseMode:   "Markdown",
	}.content()
	expected := tgbotapi.InputTextMessageContent{
		Text:      "Hello",
		ParseMode: "Markdown",
	}
	assert.Equal(t, expected, actual)
}

func TestInlineQueryResultArticle_result(t *testing.T) {
	type fields struct {
		ID                  string
		Title               string
		Description         string
		ThumbURL            string
		InputMessageContent InputMessageContent
		ReplyMarkup         InlineKeyboardMarkup
	}
	tests := []struct {
		name   string
		fields fields
		want   interface{}
	}{
		{
			name: "without inline keyboard",
			fields: fields{
				ID:          "ID",
				Title:       "Title",
				Description: "Description",
				ThumbURL:    "ThumbURL",
				InputMessageContent: InputTextMessageContent{
					MessageText: "Hello",
					ParseMode:   "Markdown",
				},
			},
			want: tgbotapi.InlineQueryResultArticle{
				Type:  "article",
				ID:    "ID",
				Title: "Title",
				InputMessageContent: tgbotapi.InputTextMessageContent{
					Text:      "Hello",
					ParseMode: "Markdown",
				},
				Description: "Description",
				ThumbURL:    "ThumbURL",
			},
		},
		{
			name: "with inline keyboard",
			fields: fields{
				ID:          "ID",
				Title:       "Title",
				Description: "Description",
				ThumbURL:    "ThumbURL",
				InputMessageContent: InputTextMessageContent{
					MessageText: "Hello",
					ParseMode:   "Markdown",
				},
				ReplyMarkup: InlineKeyboardMarkup{
					InlineKeyboard: [][]InlineKeyboardButton{
						{
							{
								Text:         "Button",
								CallbackData: "data",
							},
						},
					},
				},
			},
			want: tgbotapi.InlineQueryResultArticle{
				Type:  "article",
				ID:    "ID",
				Title: "Title",
				InputMessageContent: tgbotapi.InputTextMessageContent{
					Text:      "Hello",
					ParseMode: "Markdown",
				},
				ReplyMarkup: func() *tgbotapi.InlineKeyboardMarkup {
					button := tgbotapi.NewInlineKeyboardButtonData("Button", "data")
					markup := tgbotapi.NewInlineKeyboardMarkup(tgbotapi.NewInlineKeyboardRow(button))
					return &markup
				}(),
				Description: "Description",
				ThumbURL:    "ThumbURL",
			},
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			a := InlineQueryResultArticle{
				ID:                  tt.fields.ID,
				Title:               tt.fields.Title,
				Description:         tt.fields.Description,
				ThumbURL:            tt.fields.ThumbURL,
				InputMessageContent: tt.fields.InputMessageContent,
				ReplyMarkup:         tt.fields.ReplyMarkup,
			}
			if got := a.result(); !assert.Equal(t, tt.want, got) {
				pretty.Println(got)
			}
		})
	}
}

func TestAnswerInlineQueryRequest_config(t *testing.T) {
	type fields struct {
		InlineQueryID string
		Results       []InlineQueryResult
		CacheTime     int
		IsPersonal    bool
	}
	tests := []struct {
		name   string
		fields fields
		want   tgbotapi.InlineConfig
	}{
		{
			name: "no results",
			fields: fields{
				InlineQueryID: "ID",
				Results:       nil,
				CacheTime:     100,
				IsPersonal:    true,
			},
			want: tgbotapi.InlineConfig{
				InlineQueryID: "ID",
				Results:       make([]interface{}, 0),
				CacheTime:     100,
				IsPersonal:    true,
			},
		},
		{
			name: "with results",
			fields: fields{
				InlineQueryID: "InlineQueryID",
				Results: []InlineQueryResult{
					InlineQueryResultArticle{
						InputMessageContent: InputTextMessageContent{},
					},
					InlineQueryResultArticle{
						InputMessageContent: InputTextMessageContent{},
					},
				},
				CacheTime:  100,
				IsPersonal: true,
			},
			want: tgbotapi.InlineConfig{
				InlineQueryID: "InlineQueryID",
				Results: []interface{}{
					tgbotapi.InlineQueryResultArticle{
						Type:                "article",
						InputMessageContent: tgbotapi.InputTextMessageContent{},
					},
					tgbotapi.InlineQueryResultArticle{
						Type:                "article",
						InputMessageContent: tgbotapi.InputTextMessageContent{},
					},
				},
				CacheTime:  100,
				IsPersonal: true,
			},
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			r := AnswerInlineQueryRequest{
				InlineQueryID: tt.fields.InlineQueryID,
				Results:       tt.fields.Results,
				CacheTime:     tt.fields.CacheTime,
				IsPersonal:    tt.fields.IsPersonal,
			}
			if got := r.config(); !assert.Equal(t, tt.want, got) {
				pretty.Println(got)
			}
		})
	}
}


text:
package cmd

import (
	"time"

	"github.com/golang/glog"
	kerrors "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/types"
	"k8s.io/apimachinery/pkg/util/wait"
	kapi "k8s.io/kubernetes/pkg/api"
	kclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
	"k8s.io/kubernetes/pkg/kubectl"

	deployapi "github.com/openshift/origin/pkg/apps/apis/apps"
	appsclient "github.com/openshift/origin/pkg/apps/generated/internalclientset"
	"github.com/openshift/origin/pkg/apps/util"
)

// NewDeploymentConfigReaper returns a new reaper for deploymentConfigs
func NewDeploymentConfigReaper(appsClient appsclient.Interface, kc kclientset.Interface) kubectl.Reaper {
	return &DeploymentConfigReaper{appsClient: appsClient, kc: kc, pollInterval: kubectl.Interval, timeout: kubectl.Timeout}
}

// DeploymentConfigReaper implements the Reaper interface for deploymentConfigs
type DeploymentConfigReaper struct {
	appsClient            appsclient.Interface
	kc                    kclientset.Interface
	pollInterval, timeout time.Duration
}

// pause marks the deployment configuration as paused to avoid triggering new
// deployments.
func (reaper *DeploymentConfigReaper) pause(namespace, name string) (*deployapi.DeploymentConfig, error) {
	patchBytes := []byte(`{"spec":{"paused":true,"replicas":0,"revisionHistoryLimit":0}}`)
	return reaper.appsClient.Apps().DeploymentConfigs(namespace).Patch(name, types.StrategicMergePatchType, patchBytes)
}

// Stop scales a replication controller via its deployment configuration down to
// zero replicas, waits for all of them to get deleted and then deletes both the
// replication controller and its deployment configuration.
func (reaper *DeploymentConfigReaper) Stop(namespace, name string, timeout time.Duration, gracePeriod *metav1.DeleteOptions) error {
	// Pause the deployment configuration to prevent the new deployments from
	// being triggered.
	config, err := reaper.pause(namespace, name)
	configNotFound := kerrors.IsNotFound(err)
	if err != nil && !configNotFound {
		return err
	}

	var (
		isPaused bool
		legacy   bool
	)
	// Determine if the deployment config controller noticed the pause.
	if !configNotFound {
		if err := wait.Poll(1*time.Second, 1*time.Minute, func() (bool, error) {
			dc, err := reaper.appsClient.Apps().DeploymentConfigs(namespace).Get(name, metav1.GetOptions{})
			if err != nil {
				return false, err
			}
			isPaused = dc.Spec.Paused
			return dc.Status.ObservedGeneration >= config.Generation, nil
		}); err != nil {
			return err
		}

		// If we failed to pause the deployment config, it means we are talking to
		// old API that does not support pausing. In that case, we delete the
		// deployment config to stay backward compatible.
		if !isPaused {
			if err := reaper.appsClient.Apps().DeploymentConfigs(namespace).Delete(name, &metav1.DeleteOptions{}); err != nil {
				return err
			}
			// Setting this to true avoid deleting the config at the end.
			legacy = true
		}
	}

	// Clean up deployments related to the config. Even if the deployment
	// configuration has been deleted, we want to sweep the existing replication
	// controllers and clean them up.
	options := metav1.ListOptions{LabelSelector: util.ConfigSelector(name).String()}
	rcList, err := reaper.kc.Core().ReplicationControllers(namespace).List(options)
	if err != nil {
		return err
	}
	rcReaper, err := kubectl.ReaperFor(kapi.Kind("ReplicationController"), reaper.kc)
	if err != nil {
		return err
	}

	// If there is neither a config nor any deployments, nor any deployer pods, we can return NotFound.
	deployments := rcList.Items

	if configNotFound && len(deployments) == 0 {
		return kerrors.NewNotFound(kapi.Resource("deploymentconfig"), name)
	}

	for _, rc := range deployments {
		if err = rcReaper.Stop(rc.Namespace, rc.Name, timeout, gracePeriod); err != nil {
			// Better not error out here...
			glog.Infof("Cannot delete ReplicationController %s/%s for deployment config %s/%s: %v", rc.Namespace, rc.Name, namespace, name, err)
		}

		// Only remove deployer pods when the deployment was failed. For completed
		// deployment the pods should be already deleted.
		if !util.IsFailedDeployment(&rc) {
			continue
		}

		// Delete all deployer and hook pods
		podList, err := reaper.kc.Core().Pods(rc.Namespace).List(metav1.ListOptions{
			LabelSelector: util.DeployerPodSelector(rc.Name).String(),
		})
		if err != nil {
			return err
		}
		for _, pod := range podList.Items {
			err := reaper.kc.Core().Pods(pod.Namespace).Delete(pod.Name, gracePeriod)
			if err != nil {
				// Better not error out here...
				glog.Infof("Cannot delete lifecycle Pod %s/%s for deployment config %s/%s: %v", pod.Namespace, pod.Name, namespace, name, err)
			}
		}
	}

	// Nothing to delete or we already deleted the deployment config because we
	// failed to pause.
	if configNotFound || legacy {
		return nil
	}

	return reaper.appsClient.Apps().DeploymentConfigs(namespace).Delete(name, &metav1.DeleteOptions{})
}


text:
"""
Defines the datasets package.
"""

__docformat__ = 'epytext'


text:
=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2022] EMBL-European Bioinformatics Institute

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.

=cut

package EnsEMBL::Web::TextSequence::Annotation::Sequence;

use strict;
use warnings;

use parent qw(EnsEMBL::Web::TextSequence::Annotation);

sub prepare_ropes {
  my ($self,$config,$slices) = @_;

  my %vtypes;
  foreach my $sl (@$slices) {
    # XXX belongsin variation
    my $aux_rope;
    if($sl->{'use_aux'} && !$sl->{'no_variations'}) {
      $aux_rope = $self->add_rope;
    }
    my $pos = 'bottom';
    $pos = 'top' if $sl->{'vtype'} and $sl->{'vtype'} eq 'snp_display';
    my $main_rope = $self->add_rope($pos);
    # XXX plain string key names are not optimal
    $main_rope->relation('aux',$aux_rope) if $aux_rope;
    $main_rope->make_root;
    # XXX belongs elsewhere
    $vtypes{$sl->{'vtype'}} = $main_rope if $sl->{'vtype'};
  }
  if($vtypes{'main'}) {
    $vtypes{'main'}->relation('protein',$vtypes{'translation'});
    $vtypes{'main'}->relation('aux',$vtypes{'snp_display'});
  }
}

sub annotate {
  my ($self,$config,$slice_data,$markup,$seq,$ph,$sequence) = @_;

    if ($config->{'match_display'}) {
      if ($slice_data->{'name'} eq $config->{'ref_slice_name'}) {
        $sequence->legacy([ map {{ letter => $_ }} @{$config->{'ref_slice_seq'}} ]);
      } else {
        my $i       = 0;
        my @cmp_seq = map {{ letter => ($config->{'ref_slice_seq'}[$i++] eq $_ ? '|' : ($config->{'ref_slice_seq'}[$i-1] eq uc($_) ? '.' : $_)) }} split '', $seq;
        while ($seq =~ m/([^~]+)/g) {
          my $reseq_length = length $1;
          my $reseq_end    = pos $seq;

          $markup->{'comparisons'}{$reseq_end - $_}{'resequencing'} = 1 for 1..$reseq_length;
        }
        $sequence->legacy(\@cmp_seq);
      }
    } else {
      my $i = 0;
      $sequence->legacy([ map { { letter => $_, match => (uc($config->{'ref_slice_seq'}[$i++]||'') eq uc($_||'')) }} split '', $seq ]);
  }
}

1;


text:
using System.IO;
using System.Web.Mvc;

namespace System.Web.Bem.BundleMappers
{
    public class Single : Mapper
    {
        protected override string GetBundleName(ControllerContext context)
        {
            return DefaultBundle;
        }
    }
}


text:
package se.litsec.eidas.opensaml2.ext.impl;

import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
import org.opensaml.xml.XMLObject;
import org.opensaml.xml.io.MarshallingException;
import org.opensaml.xml.util.XMLHelper;
import org.w3c.dom.Element;

import se.litsec.eidas.opensaml2.ext.SPType;

/**
 * A thread safe Marshaller for {@link SPType} objects.
 *
 * @author Martin Lindström (martin.lindstrom@litsec.se)
 */
public class SPTypeMarshaller extends AbstractSAMLObjectMarshaller {

  /** {@inheritDoc} */
  protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException {
    SPType spType = (SPType) samlObject;

    if (spType.getType() != null && spType.getType().getValue() != null) {
      XMLHelper.appendTextContent(domElement, spType.getType().getValue());
    }
  }

}


text:
package changelist

import (
	"context"

	"go.chromium.org/luci/auth/identity"
	"go.chromium.org/luci/common/errors"
	gerritpb "go.chromium.org/luci/common/proto/gerrit"
	"go.chromium.org/luci/common/retry/transient"
	"go.chromium.org/luci/gae/service/datastore"

	"go.chromium.org/luci/cv/internal/common"
)

// PanicIfNotValid checks that Snapshot stored has required fields set.
func (s *Snapshot) PanicIfNotValid() {
	switch {
	case s == nil:
	case s.GetExternalUpdateTime() == nil:
		panic("missing ExternalUpdateTime")
	case s.GetLuciProject() == "":
		panic("missing LuciProject")
	case s.GetMinEquivalentPatchset() == 0:
		panic("missing MinEquivalentPatchset")
	case s.GetPatchset() == 0:
		panic("missing Patchset")

	case s.GetGerrit() == nil:
		panic("Gerrit is required, until CV supports more code reviews")
	case s.GetGerrit().GetInfo() == nil:
		panic("Gerrit.Info is required, until CV supports more code reviews")
	}
}

// LoadCLsMap loads `CL` entities which are values in the provided map.
//
// Updates `CL` entities *in place*, but also returns them as a slice.
func LoadCLsMap(ctx context.Context, m map[common.CLID]*CL) ([]*CL, error) {
	cls := make([]*CL, 0, len(m))
	for _, cl := range m {
		cls = append(cls, cl)
	}
	return loadCLs(ctx, cls)
}

// LoadCLsByIDs loads `CL` entities of the provided list of clids.
func LoadCLsByIDs(ctx context.Context, clids common.CLIDs) ([]*CL, error) {
	cls := make([]*CL, len(clids))
	for i, clid := range clids {
		cls[i] = &CL{ID: clid}
	}
	return loadCLs(ctx, cls)
}

// LoadCLs loads given `CL` entities.
func LoadCLs(ctx context.Context, cls []*CL) error {
	_, err := loadCLs(ctx, cls)
	return err
}

func loadCLs(ctx context.Context, cls []*CL) ([]*CL, error) {
	err := datastore.Get(ctx, cls)
	switch merr, ok := err.(errors.MultiError); {
	case err == nil:
		return cls, nil
	case ok:
		for i, err := range merr {
			if err == datastore.ErrNoSuchEntity {
				return nil, errors.Reason("CL %d not found in Datastore", cls[i].ID).Err()
			}
		}
		count, err := merr.Summary()
		return nil, errors.Annotate(err, "failed to load %d out of %d CLs", count, len(cls)).Tag(transient.Tag).Err()
	default:
		return nil, errors.Annotate(err, "failed to load %d CLs", len(cls)).Tag(transient.Tag).Err()
	}
}

// RemoveUnusedGerritInfo mutates given ChangeInfo to remove what CV definitely
// doesn't need to reduce bytes shuffled to/from Datastore.
//
// Doesn't complain if anything is missing.
//
// NOTE: keep this function actions in sync with storage.proto doc for
// Gerrit.info field.
func RemoveUnusedGerritInfo(ci *gerritpb.ChangeInfo) {
	const keepEmail = true
	const removeEmail = false
	cleanUser := func(u *gerritpb.AccountInfo, keepEmail bool) {
		if u == nil {
			return
		}
		u.SecondaryEmails = nil
		u.Name = ""
		u.Username = ""
		if !keepEmail {
			u.Email = ""
		}
	}

	cleanRevision := func(r *gerritpb.RevisionInfo) {
		if r == nil {
			return
		}
		cleanUser(r.GetUploader(), keepEmail)
		r.Description = ""
		// TODO(crbug/1260615): erase commit message after CQDaemon is gone.
		r.Files = nil
	}

	cleanMessage := func(m *gerritpb.ChangeMessageInfo) {
		if m == nil {
			return
		}
		cleanUser(m.GetAuthor(), removeEmail)
		cleanUser(m.GetRealAuthor(), removeEmail)
	}

	cleanLabel := func(l *gerritpb.LabelInfo) {
		if l == nil {
			return
		}
		all := l.GetAll()[:0]
		for _, a := range l.GetAll() {
			if a.GetValue() == 0 {
				continue
			}
			cleanUser(a.GetUser(), keepEmail)
			all = append(all, a)
		}
		l.All = all
	}

	for _, r := range ci.GetRevisions() {
		cleanRevision(r)
	}
	for _, m := range ci.GetMessages() {
		cleanMessage(m)
	}
	for _, l := range ci.GetLabels() {
		cleanLabel(l)
	}
	cleanUser(ci.GetOwner(), keepEmail)
}

// OwnerIdentity is the identity of a user owning this CL.
//
// Snapshot must not be nil.
func (s *Snapshot) OwnerIdentity() (identity.Identity, error) {
	if s == nil {
		panic("Snapshot is nil")
	}

	g := s.GetGerrit()
	if g == nil {
		return "", errors.New("non-Gerrit CLs not supported")
	}
	owner := g.GetInfo().GetOwner()
	if owner == nil {
		panic("Snapshot Gerrit has no owner. Bug in gerrit/updater")
	}
	email := owner.GetEmail()
	if email == "" {
		return "", errors.Reason(
			"CL %s/%d owner email of account %d is unknown",
			g.GetHost(), g.GetInfo().GetNumber(),
			owner.GetAccountId(),
		).Err()
	}
	return identity.MakeIdentity("user:" + email)
}

// IsSubmittable returns whether the change has been approved
// by the project submit rules.
func (s *Snapshot) IsSubmittable() (bool, error) {
	if s == nil {
		panic("Snapshot is nil")
	}

	g := s.GetGerrit()
	if g == nil {
		return false, errors.New("non-Gerrit CLs not supported")
	}
	return g.GetInfo().GetSubmittable(), nil
}

// IsSubmitted returns whether the change has been submitted.
func (s *Snapshot) IsSubmitted() (bool, error) {
	if s == nil {
		panic("Snapshot is nil")
	}

	g := s.GetGerrit()
	if g == nil {
		return false, errors.New("non-Gerrit CLs not supported")
	}
	return g.GetInfo().GetStatus() == gerritpb.ChangeStatus_MERGED, nil
}


text:
package org.locationtech.geomesa.fs.tools.status

import com.beust.jcommander.Parameters
import org.locationtech.geomesa.fs.data.FileSystemDataStore
import org.locationtech.geomesa.fs.tools.FsDataStoreCommand
import org.locationtech.geomesa.fs.tools.FsDataStoreCommand.FsParams
import org.locationtech.geomesa.fs.tools.status.FsGetSftConfigCommand.FsGetSftConfigParameters
import org.locationtech.geomesa.tools.status.{GetSftConfigCommand, GetSftConfigParams}

class FsGetSftConfigCommand extends GetSftConfigCommand[FileSystemDataStore] with FsDataStoreCommand {
  override val params = new FsGetSftConfigParameters
}

object FsGetSftConfigCommand {
  @Parameters(commandDescription = "Get the SimpleFeatureType definition of a schema")
  class FsGetSftConfigParameters extends FsParams with GetSftConfigParams
}


text:
//-----------------------------------------------------------------
// This script handles the export window for turning an UPAImage into .jpg or .png format.
// It hosts functions for exporting & also draws the proper editor GUI.
// TODO: Add ExportImage method (Kind of crucial don't you think?).
//-----------------------------------------------------------------

using UnityEngine;
using UnityEditor;

public class UPAExportWindow : EditorWindow {

	public static UPAExportWindow window;

	public UPAImage exportImg;

	private TextureType texType = TextureType.sprite;
	private TextureExtension texExtension = TextureExtension.PNG;

	public static void Init (UPAImage img) {
		// Get existing open window or if none, make new one
		window = (UPAExportWindow)EditorWindow.GetWindow (typeof (UPAExportWindow));
		#if UNITY_4_3
		window.title = "Export Image";
		#elif UNITY_4_6
		window.title = "Export Image";
		#else
		window.titleContent = new GUIContent ("Export Image");
		#endif

		window.position = new Rect(Screen.width/2 + 260/2f,Screen.height/2 - 80, 260, 170);
		window.ShowPopup();

		window.exportImg = img;
	}

	void OnGUI () {
		GUILayout.Label ("Image to Export", EditorStyles.boldLabel);
		exportImg = (UPAImage)EditorGUILayout.ObjectField (exportImg, typeof(UPAImage), false);

		GUILayout.Label ("Export Settings", EditorStyles.boldLabel);
		texExtension = (TextureExtension)EditorGUILayout.EnumPopup("Save As:", texExtension);
		if (texExtension == TextureExtension.JPG) {
			#if UNITY_4_2
			GUILayout.Label ("Error: Export to JPG requires Unity 4.5+");
			#elif UNITY_4_3
			GUILayout.Label ("Error: Export to JPG requires Unity 4.5+");
			#endif

			GUILayout.Label ("Warning: JPG files will lose transparency.");
		}
		texType = (TextureType)EditorGUILayout.EnumPopup("Texture Type:", texType);

		EditorGUILayout.Space ();

		if ( GUILayout.Button ("Export", GUILayout.Height(30)) ) {

			if (exportImg == null) {
				EditorUtility.DisplayDialog(
					"Select Image",
					"You Must Select an Image first!",
					"Ok");
				return;
			}

			bool succes = UPASession.ExportImage ( exportImg, texType, texExtension );
			if (succes)
				this.Close();
			UPAEditorWindow.window.Repaint();
		}
	}
}


text:
extern void DrawLaraL2();

#endif


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2017.11.30 at 08:24:17 PM JST
//

package uk.org.siri.siri;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;

/**
 * Type for Action Publish SITUATION Manual process.
 *
 *
Java class for ManualActionStructure complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="ManualActionStructure">
 *   <complexContent>
 *     <extension base="{http://www.siri.org.uk/siri}ParameterisedActionStructure">
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ManualActionStructure")
@XmlSeeAlso({
    ManualAction.class
})
public class ManualActionStructure
    extends ParameterisedActionStructure
{

}


text:
@implementation NSXMLNode (Extensions)

- (NSInteger)integerValue
{
    return [[self stringValue] integerValue];
}

- (double)doubleValue
{
    return [[self stringValue] doubleValue];
}

- (BOOL)boolValue
{
    return [[self stringValue] boolValue];
}

@end


text:
<?php

/* BloggerBlogBundle::base.html.twig */
class __TwigTemplate_006efd752f1d2e8ce5ab56fa96d24c8d extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->blocks = array(
            'stylesheets' => array($this, 'block_stylesheets'),
            'navigation' => array($this, 'block_navigation'),
            'sidebar' => array($this, 'block_sidebar'),
        );
    }

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

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

    // line 4
    public function block_stylesheets($context, array $blocks = array())
    {
        // line 5
        echo "    ";
        $this->displayParentBlock("stylesheets", $context, $blocks);
        echo "

    ";
        // line 7
        if (isset($context['assetic']['debug']) && $context['assetic']['debug']) {
            // asset "e95c551_0"
            $context["asset_url"] = isset($context['assetic']['use_controller']) && $context['assetic']['use_controller'] ? $this->env->getExtension('routing')->getPath("_assetic_e95c551_0") : $this->env->getExtension('assets')->getAssetUrl("_controller/css/blogger_part_1_blog_1.css");
            // line 12
            echo "        <link href=\"";
            echo twig_escape_filter($this->env, $this->getContext($context, "asset_url"), "html", null, true);
            echo "\" rel=\"stylesheet\" media=\"screen\" />
    ";
            // asset "e95c551_1"
            $context["asset_url"] = isset($context['assetic']['use_controller']) && $context['assetic']['use_controller'] ? $this->env->getExtension('routing')->getPath("_assetic_e95c551_1") : $this->env->getExtension('assets')->getAssetUrl("_controller/css/blogger_part_1_sidebar_2.css");
            echo "        <link href=\"";
            echo twig_escape_filter($this->env, $this->getContext($context, "asset_url"), "html", null, true);
            echo "\" rel=\"stylesheet\" media=\"screen\" />
    ";
        } else {
            // asset "e95c551"
            $context["asset_url"] = isset($context['assetic']['use_controller']) && $context['assetic']['use_controller'] ? $this->env->getExtension('routing')->getPath("_assetic_e95c551") : $this->env->getExtension('assets')->getAssetUrl("_controller/css/blogger.css");
            echo "        <link href=\"";
            echo twig_escape_filter($this->env, $this->getContext($context, "asset_url"), "html", null, true);
            echo "\" rel=\"stylesheet\" media=\"screen\" />
    ";
        }
        unset($context["asset_url"]);
    }

    // line 17
    public function block_navigation($context, array $blocks = array())
    {
        // line 18
        echo "

env, $this->env->getExtension('routing')->getPath("BloggerBlogBundle_homepage"), "html", null, true);
        echo "\">Home

env, $this->env->getExtension('routing')->getPath("BloggerBlogBundle_about"), "html", null, true);
        echo "\">About

env, $this->env->getExtension('routing')->getPath("BloggerBlogBundle_contact"), "html", null, true);
        echo "\">Contact

";
    }

    // line 27
    public function block_sidebar($context, array $blocks = array())
    {
        // line 28
        echo "    ";
        echo $this->env->getExtension('actions')->renderAction("BloggerBlogBundle:Page:sidebar", array(), array());
    }

    public function getTemplateName()
    {
        return "BloggerBlogBundle::base.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }
}


text:
function [ resulting_data, dim3_sum ] = add( obj, data )
% add the data for the grids (which have been given at object construction)

warning('Regular2Grid#add is obsolete. Use "quantile" instead.');

prepared_data = obj.prepare( data );
resulting_data = sparse(obj.G.Nx, obj.G.Ny);
[m,n] = size(prepared_data);
dim3_sum = zeros(obj.G.Nx, obj.G.Ny, m);
for i = 1:m  % iterate over records
  for j = 1:n  % iterate over grids
    dim3_sum(:,:,i) = dim3_sum(:,:,i) + prepared_data{i,j};
    resulting_data = resulting_data + prepared_data{i,j};
  end
end

assert( all( size(resulting_data) == size(obj.G) ) );

end


text:
using PatientManagement.PatientManagement.Entities;

namespace PatientManagement.Common
{
    using Serenity.ComponentModel;
    using Serenity.Services;
    using System;
    using System.ComponentModel;
    using Serenity.Data.Mapping;

    [FormScript("Common.HelloModalAddVisit")]
    [BasedOnRow(typeof(VisitsRow))]
    public class HelloModalAddVisitRequest : ServiceRequest
    {
        public Int32 PatientId { get; set; }
        public Int32 VisitTypeId { get; set; }

        public Int32 CabinetId { get; set; }

        [DefaultValue("now")]
        public DateTime StartDate { get; set; }
        [DefaultValue("now")]
        public DateTime EndDate { get; set; }

        [TextAreaEditor(Cols = 40,Rows = 5)]
        public String Description { get; set; }
    }
}