text:
// Copyright (c) Gaurav Aroraa
// Licensed under the MIT License. See License.txt in the project root for license information.

using System.Text;

namespace TDD_Katas_NETCore.LCDDigits
{
    internal class LCDDigits
    {
        private static readonly int DIGIT_HEIGHT_DIMENSION = 1;

        private static readonly string[,] LcdDigitsMap =
        {
            {
                "._.",
                "|.|",
                "|_|"
            },
            {
                "...",
                "..|",
                "..|"
            },
            {
                "._.",
                "._|",
                "|_."
            },
            {
                "._.",
                "._|",
                "._|"
            },
            {
                "...",
                "|_|",
                "..|"
            },
            {
                "._.",
                "|_. ",
                "._|"
            },
            {
                "._.",
                "|_.",
                "|_|"
            },
            {
                "._.",
                "..|",
                "..|"
            },
            {
                "._.",
                "|_|",
                "|_|"
            },
            {
                "._.",
                "|_|",
                "..|"
            }
        };

        internal static string GetDigits(int number)
        {
            var output = new StringBuilder();
            var numberArray = ConvertIntegerToArray(number);

            for (var digitHeight = 0; digitHeight < LcdDigitsMap.GetLength(DIGIT_HEIGHT_DIMENSION); digitHeight++)
            {
                for (var numberIndex = 0; numberIndex < numberArray.Length; numberIndex++)
                    output.Append(
                        GetDigitLine(ConvertCharArrayToInteger(numberArray, numberIndex),
                            digitHeight));

                output.AppendLine();
            }

            return output.ToString();
        }

        private static int ConvertCharArrayToInteger(char[] numberArray, int numberIndex) => (int) char.GetNumericValue(numberArray[numberIndex]);

        private static string GetDigitLine(int number, int digitHeight) => LcdDigitsMap[number, digitHeight];

        private static char[] ConvertIntegerToArray(int number) => number.ToString().ToCharArray();
    }
}


text:
import socket
import urllib
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("208.67.220.220",80))
url="http://qrfree.kaywa.com/?s=20&d=http://"+s.getsockname()[0]+":5000/static/index.html"
s.close()
try:
	urllib.urlretrieve(url,"QrCode.png")
#print url
except:
	print "Connettere il computer ad Internet.\n Velocità Download:\nModem 56 kbps:\t1s\nADSL:\t<1s"
else:
	print"File salvato in QrCode.png"

redpajama_set_name: RedPajamaGithub


text:
extern "C"
{
    void _GTM_dump_stats();
}
#endif

/// A hack for making sure each thread goes to its own place
thread_local int thread_id;

template<class SET>
class benchmark
{
    /// The data structure we will manipulate
    SET* set;

    /// A barrier for ensuring all threads move forward together
    barrier* thread_barrier;

    /// Each iteration of the test will decide whether to insert, lookup, or
    /// remove
    void test_iteration(uint32_t id, uint32_t* seed, int counts[]) {
        uint32_t val = rand_r_32(seed) % Config::CFG.elements;
        uint32_t act = rand_r_32(seed) % 100;
        bool res;
        if (act < Config::CFG.lookpct) {
            __transaction_atomic {
                res = set->lookup(val);
            }
            counts[res?0:1]++;
        }
        else if (act < Config::CFG.inspct) {
            __transaction_atomic {
                res = set->insert(val);
            }
            counts[res?2:3]++;
        }
        else {
            __transaction_atomic {
                res = set->remove(val);
            }
            counts[res?4:5]++;
        }
    }

    /// This code runs some no-ops between transactions, if requested
    void nontxnwork() {
        if (Config::CFG.nops_after_tx)
            for (uint32_t i = 0; i < Config::CFG.nops_after_tx; i++)
                __asm__ __volatile__("nop");
    }

    /// This oversees the repeated execution of test_iteration, which will be
    /// performed based on timing, or a fixed number of operations, depending
    /// on the configuration of this experiment
    void run(uintptr_t id) {
        // set thread id
        thread_id = id;
        // wait until all threads created, then set alarm and read timer
        thread_barrier->arrive(id);
        if (id == 0) {
            if (!Config::CFG.execute) {
                signal(SIGALRM, Config::catch_SIGALRM);
                alarm(Config::CFG.duration);
            }
            Config::CFG.time = getElapsedTime();
        }

        // wait until read of start timer finishes, then start transactions
        thread_barrier->arrive(id);
        // these are for successful lookups, failed lookups,
        // successful inserts, failed inserts, successful removes,
        // and failed removes
        int counts[6] = {0, 0, 0, 0, 0, 0};
        uint32_t count = 0;
        uint32_t seed = id; // not everyone needs a seed, but we have to support it
        if (!Config::CFG.execute) {
            // run txns until alarm fires
            while (Config::CFG.running) {
                test_iteration(id, &seed, counts);
                ++count;
                nontxnwork(); // some nontx work between txns?
            }
        }
        else {
            // run fixed number of txns
            for (uint32_t e = 0; e < Config::CFG.execute; e++) {
                test_iteration(id, &seed, counts);
                ++count;
                nontxnwork(); // some nontx work between txns?
            }
        }

        // wait until all txns finish, then get time
        thread_barrier->arrive(id);
        if (id == 0)
            Config::CFG.time = getElapsedTime() - Config::CFG.time;

        // add this thread's count to an accumulator
        Config::CFG.txcount += count;
        Config::CFG.lookup_hit  += counts[0];
        Config::CFG.lookup_miss += counts[1];
        Config::CFG.insert_hit  += counts[2];
        Config::CFG.insert_miss += counts[3];
        Config::CFG.remove_hit  += counts[4];
        Config::CFG.remove_miss += counts[5];
    }

    /// wrapper for running the experiments, since threads can't call methods
    /// directly, only functions
    static void run_wrapper(int i, benchmark<SET>* b) {
        b->run(i);
        b->thread_barrier->arrive(i);
#ifdef LU_GCC
        if (i == 0)
            _GTM_dump_stats();
#endif
        b->thread_barrier->arrive(i);
    }

  public:

    /// The constructor doesn't build a barrier, because we don't know the
    /// thread count yet
    benchmark() : set(new SET()), thread_barrier(NULL) { }

    /// An alternative constructor that takes a pre-constructed SET
    benchmark(SET* _set) : set(_set), thread_barrier(NULL) { }

    /// warm up the data structure in a repeatable way
    void warmup() {
        // warm up the datastructure
        for (int32_t w = Config::CFG.elements; w >= 0; w-=2)
            set->insert(w);
        assert(set->isSane());
    }

    /// Create threads and a barrier, then run the tests
    void launch_test() {
        if (thread_barrier != NULL)
            delete(thread_barrier);
        thread_barrier = new barrier(Config::CFG.threads);

        // kick off the threads (this thread runs too...)
        std::thread* threads = new std::thread[Config::CFG.threads];
        for (int i = 1; i < Config::CFG.threads; ++i)
            threads[i] = std::thread(run_wrapper, i, this);

        run_wrapper(0, this);

        // wait for completion
        for (int i = 1; i < Config::CFG.threads; ++i)
            threads[i].join();

        // test for correctness
        bool v = set->isSane();
        std::cout << "Verification: " << (v ? "Passed" : "Failed") << "\n";
    }
};


text:
class CreateServers < ActiveRecord::Migration
  def change
    create_table :servers do |t|
      t.string      :name
      t.string      :host
      t.boolean     :status
      t.datetime    :synchronized_at

      t.timestamps
    end
  end
end


text:
package com.planet_ink.coffee_mud.Abilities.Traps;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;

public class Trap_OpenSpell extends Trap_Open
{
	public String ID() { return "Trap_OpenSpell"; }
	public String name(){ return "Open Spell Trap";}
	protected int canAffectCode(){return Ability.CAN_EXITS|Ability.CAN_ITEMS;}
	protected int canTargetCode(){return 0;}
	protected int trapType(){return TRAP_SPELL;}
	public Trap_OpenSpell()
	{
		super();
		setMiscText("Spell_Sleep");
	}

}


text:
package org.hibernate.ejb.test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

import org.jboss.logging.Logger;
import org.junit.After;
import org.junit.Before;

import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.Dialect;
import org.hibernate.ejb.AvailableSettings;
import org.hibernate.ejb.Ejb3Configuration;
import org.hibernate.ejb.EntityManagerFactoryImpl;
import org.hibernate.internal.SessionFactoryImpl;
import org.hibernate.service.BootstrapServiceRegistryBuilder;
import org.hibernate.service.ServiceRegistryBuilder;
import org.hibernate.service.internal.StandardServiceRegistryImpl;
import org.hibernate.testing.junit4.BaseUnitTestCase;

/**
 * A base class for all ejb tests.
 *
 * @author Emmanuel Bernard
 * @author Hardy Ferentschik
 */
public abstract class BaseEntityManagerFunctionalTestCase extends BaseUnitTestCase {
	private static final Logger log = Logger.getLogger( BaseEntityManagerFunctionalTestCase.class );

	// IMPL NOTE : Here we use @Before and @After (instead of @BeforeClassOnce and @AfterClassOnce like we do in
	// BaseCoreFunctionalTestCase) because the old HEM test methodology was to create an EMF for each test method.

	private static final Dialect dialect = Dialect.getDialect();

	private Ejb3Configuration ejb3Configuration;
	private StandardServiceRegistryImpl serviceRegistry;
	private EntityManagerFactoryImpl entityManagerFactory;

	private EntityManager em;
	private ArrayList<EntityManager> isolatedEms = new ArrayList<EntityManager>();

	protected Dialect getDialect() {
		return dialect;
	}

	protected EntityManagerFactory entityManagerFactory() {
		return entityManagerFactory;
	}

	protected StandardServiceRegistryImpl serviceRegistry() {
		return serviceRegistry;
	}

	@Before
	@SuppressWarnings( {"UnusedDeclaration"})
	public void buildEntityManagerFactory() throws Exception {
		log.trace( "Building session factory" );
		ejb3Configuration = buildConfiguration();
		ejb3Configuration.configure( getConfig() );
		afterConfigurationBuilt( ejb3Configuration );

		entityManagerFactory = (EntityManagerFactoryImpl) ejb3Configuration.buildEntityManagerFactory( bootstrapRegistryBuilder() );
		serviceRegistry = (StandardServiceRegistryImpl) ( (SessionFactoryImpl) entityManagerFactory.getSessionFactory() ).getServiceRegistry().getParentServiceRegistry();

		afterEntityManagerFactoryBuilt();
	}

	private BootstrapServiceRegistryBuilder bootstrapRegistryBuilder() {
		return new BootstrapServiceRegistryBuilder();
	}

	protected Ejb3Configuration buildConfiguration() {
		Ejb3Configuration ejb3Cfg = constructConfiguration();
		addMappings( ejb3Cfg.getHibernateConfiguration() );
		return ejb3Cfg;
	}

	protected Ejb3Configuration constructConfiguration() {
		Ejb3Configuration ejb3Configuration = new Ejb3Configuration();
		if ( createSchema() ) {
			ejb3Configuration.getHibernateConfiguration().setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
		}
		ejb3Configuration
				.getHibernateConfiguration()
				.setProperty( org.hibernate.cfg.AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true");

		ejb3Configuration
				.getHibernateConfiguration()
				.setProperty( Environment.DIALECT, getDialect().getClass().getName() );
		return ejb3Configuration;
	}

	protected void addMappings(Configuration configuration) {
		String[] mappings = getMappings();
		if ( mappings != null ) {
			for ( String mapping : mappings ) {
				configuration.addResource( mapping, getClass().getClassLoader() );
			}
		}
	}

	protected static final String[] NO_MAPPINGS = new String[0];

	protected String[] getMappings() {
		return NO_MAPPINGS;
	}

	protected Map getConfig() {
		Map<Object, Object> config = new HashMap<Object, Object>(  );
		ArrayList<Class> classes = new ArrayList<Class>();

		classes.addAll( Arrays.asList( getAnnotatedClasses() ) );
		config.put( AvailableSettings.LOADED_CLASSES, classes );
		for ( Map.Entry<Class, String> entry : getCachedClasses().entrySet() ) {
			config.put( AvailableSettings.CLASS_CACHE_PREFIX + "." + entry.getKey().getName(), entry.getValue() );
		}
		for ( Map.Entry<String, String> entry : getCachedCollections().entrySet() ) {
			config.put( AvailableSettings.COLLECTION_CACHE_PREFIX + "." + entry.getKey(), entry.getValue() );
		}
		if ( getEjb3DD().length > 0 ) {
			ArrayList<String> dds = new ArrayList<String>();
			dds.addAll( Arrays.asList( getEjb3DD() ) );
			config.put( AvailableSettings.XML_FILE_NAMES, dds );
		}

		addConfigOptions( config );
		return config;
	}

	protected void addConfigOptions(Map options) {
	}

	protected static final Class<?>[] NO_CLASSES = new Class[0];

	protected Class<?>[] getAnnotatedClasses() {
		return NO_CLASSES;
	}

	public Map<Class, String> getCachedClasses() {
		return new HashMap<Class, String>();
	}

	public Map<String, String> getCachedCollections() {
		return new HashMap<String, String>();
	}

	public String[] getEjb3DD() {
		return new String[] { };
	}

	@SuppressWarnings( {"UnusedParameters"})
	protected void afterConfigurationBuilt(Ejb3Configuration ejb3Configuration) {
	}

	@SuppressWarnings( {"UnusedParameters"})
	protected void applyServices(ServiceRegistryBuilder registryBuilder) {
	}

	protected void afterEntityManagerFactoryBuilt() {
	}

	protected boolean createSchema() {
		return true;
	}

	@After
	@SuppressWarnings( {"UnusedDeclaration"})
	public void releaseResources() {
		try {
			releaseUnclosedEntityManagers();
		}
		finally {
			if ( entityManagerFactory != null && entityManagerFactory.isOpen()) {
				entityManagerFactory.close();
			}
		}
		// Note we don't destroy the service registry as we are not the ones creating it
	}

	private void releaseUnclosedEntityManagers() {
		releaseUnclosedEntityManager( this.em );

		for ( EntityManager isolatedEm : isolatedEms ) {
			releaseUnclosedEntityManager( isolatedEm );
		}
	}

	private void releaseUnclosedEntityManager(EntityManager em) {
		if ( em == null ) {
			return;
		}
		if ( em.getTransaction().isActive() ) {
			em.getTransaction().rollback();
            log.warn("You left an open transaction! Fix your test case. For now, we are closing it for you.");
		}
		if ( em.isOpen() ) {
			// as we open an EM before the test runs, it will still be open if the test uses a custom EM.
			// or, the person may have forgotten to close. So, do not raise a "fail", but log the fact.
			em.close();
            log.warn("The EntityManager is not closed. Closing it.");
		}
	}

	protected EntityManager getOrCreateEntityManager() {
		if ( em == null || !em.isOpen() ) {
			em = entityManagerFactory.createEntityManager();
		}
		return em;
	}

	protected EntityManager createIsolatedEntityManager() {
		EntityManager isolatedEm = entityManagerFactory.createEntityManager();
		isolatedEms.add( isolatedEm );
		return isolatedEm;
	}

	protected EntityManager createIsolatedEntityManager(Map props) {
		EntityManager isolatedEm = entityManagerFactory.createEntityManager(props);
		isolatedEms.add( isolatedEm );
		return isolatedEm;
	}

	protected EntityManager createEntityManager(Map properties) {
		// always reopen a new EM and close the existing one
		if ( em != null && em.isOpen() ) {
			em.close();
		}
		em = entityManagerFactory.createEntityManager( properties );
		return em;
	}
}


text:
package com.google.javascript.rhino;

/**
 * This class implements the JavaScript scanner.
 *
 *
It is based on the C source files jsscan.c and jsscan.h in the jsref package.
 *
 *
IMPORTANT: As of 2018-03-09 it is still not possible to use Java 8 features in this file due
 * to limitations on some internal Google projects that depend on it.
 */
public final class TokenStream {
  /**
   * Is the string an ES3 keyword?
   *
   *
Keywords for versions of JavaScript after ES3 are not included, because the parser would
   * reject valid ES3 code that happened to newer keywords if we did that.
   *
   *
Since isKeyword() is used repeatedly in scanning, for performance reasons, it is implemented
   * to do the minimum number of character comparisons to ascertain whether the given name is a
   * keyword, instead of doing string search of the name against JS keywords.
   */
  public static boolean isKeyword(String name) {
        boolean id = false;
        String s = name;
        complete: {
            String X = null;
            int c;
            partial: switch (s.length()) {
            case 2: c=s.charAt(1);
                if (c=='f') {
                  if (s.charAt(0)=='i') {id=true; break complete;}
                } else if (c=='n') {
                  if (s.charAt(0)=='i') {id=true; break complete;}
                } else if (c=='o') {
                  if (s.charAt(0)=='d') {id=true; break complete;}
                }
                break partial;
            case 3: switch (s.charAt(0)) {
                case 'f':
                  if (s.charAt(2)=='r' && s.charAt(1)=='o') {
                    id=true; break complete;
                  } break partial;
                case 'i':
                  if (s.charAt(2)=='t' && s.charAt(1)=='n') {
                    id=true; break complete;
                  } break partial;
                case 'n':
                  if (s.charAt(2)=='w' && s.charAt(1)=='e') {
                    id=true; break complete;
                  } break partial;
                case 't':
                  if (s.charAt(2)=='y' && s.charAt(1)=='r') {
                    id=true; break complete;
                  } break partial;
                case 'v':
                  if (s.charAt(2)=='r' && s.charAt(1)=='a') {
                    id=true; break complete;
                  } break partial;
                } break partial;
            case 4: switch (s.charAt(0)) {
                case 'b': X="byte";id=true; break partial;
                case 'c': c=s.charAt(3);
                    if (c=='e') { if (s.charAt(2)=='s' && s.charAt(1)=='a') {
                            id=true; break complete;} }
                    else if (c=='r') {
                      if (s.charAt(2)=='a' && s.charAt(1)=='h') {
                        id=true; break complete;
                      }
                    }
                    break partial;
                case 'e': c=s.charAt(3);
                    if (c=='e') { if (s.charAt(2)=='s' && s.charAt(1)=='l') {
                            id=true; break complete;} }
                    else if (c=='m') {
                      if (s.charAt(2)=='u' && s.charAt(1)=='n') {
                            id=true; break complete;} }
                    break partial;
                case 'g': X="goto";id=true; break partial;
                case 'l': X="long";id=true; break partial;
                case 'n': X="null";id=true; break partial;
                case 't': c=s.charAt(3);
                    if (c=='e') { if (s.charAt(2)=='u' && s.charAt(1)=='r') {
                            id=true; break complete;} }
                    else if (c=='s') {
                      if (s.charAt(2)=='i' && s.charAt(1)=='h') {
                            id=true; break complete;} }
                    break partial;
                case 'v': X="void";id=true; break partial;
                case 'w': X="with";id=true; break partial;
                } break partial;
            case 5: switch (s.charAt(2)) {
                case 'a': X="class";id=true; break partial;
                case 'e': X="break";id=true; break partial;
                case 'i': X="while";id=true; break partial;
                case 'l': X="false";id=true; break partial;
                case 'n': c=s.charAt(0);
                    if (c=='c') { X="const";id=true; }
                    else if (c=='f') { X="final";id=true; }
                    break partial;
                case 'o': c=s.charAt(0);
                    if (c=='f') { X="float";id=true; }
                    else if (c=='s') { X="short";id=true; }
                    break partial;
                case 'p': X="super";id=true; break partial;
                case 'r': X="throw";id=true; break partial;
                case 't': X="catch";id=true; break partial;
                } break partial;
            case 6: switch (s.charAt(1)) {
                case 'a': X="native";id=true; break partial;
                case 'e': c=s.charAt(0);
                    if (c=='d') { X="delete";id=true; }
                    else if (c=='r') { X="return";id=true; }
                    break partial;
                case 'h': X="throws";id=true; break partial;
                case 'm': X="import";id=true; break partial;
                case 'o': X="double";id=true; break partial;
                case 't': X="static";id=true; break partial;
                case 'u': X="public";id=true; break partial;
                case 'w': X="switch";id=true; break partial;
                case 'x': X="export";id=true; break partial;
                case 'y': X="typeof";id=true; break partial;
                } break partial;
            case 7: switch (s.charAt(1)) {
                case 'a': X="package";id=true; break partial;
                case 'e': X="default";id=true; break partial;
                case 'i': X="finally";id=true; break partial;
                case 'o': X="boolean";id=true; break partial;
                case 'r': X="private";id=true; break partial;
                case 'x': X="extends";id=true; break partial;
                } break partial;
            case 8: switch (s.charAt(0)) {
                case 'a': X="abstract";id=true; break partial;
                case 'c': X="continue";id=true; break partial;
                case 'd': X="debugger";id=true; break partial;
                case 'f': X="function";id=true; break partial;
                case 'v': X="volatile";id=true; break partial;
                } break partial;
            case 9: c=s.charAt(0);
                if (c=='i') { X="interface";id=true; }
                else if (c=='p') { X="protected";id=true; }
                else if (c=='t') { X="transient";id=true; }
                break partial;
            case 10: c=s.charAt(1);
                if (c=='m') { X="implements";id=true; }
                else if (c=='n') { X="instanceof";id=true; }
                break partial;
            case 12: X="synchronized";id=true; break partial;
            }
      // partial match validate the entire string the one possibility
      if (X != null && X != s && !X.equals(s)) {
        return false;
      }
        }
        return id;
    }

  public static boolean isJSIdentifier(String s) {
    return JSIdentifier.isJSIdentifier(s);
  }

  private TokenStream() {}
}


text:
import warnings

from nilearn.input_data import NiftiMasker

warnings.filterwarnings("ignore", category=DeprecationWarning)

import os
from os.path import expanduser, join

import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from joblib import Memory, dump
from joblib import Parallel, delayed
from sklearn.model_selection import train_test_split
from sklearn.utils import check_random_state

from modl.datasets import fetch_adhd
from modl.decomposition.fmri import fMRIDictFact
from modl.decomposition.stability import mean_amari_discrepency
from modl.plotting.fmri import display_maps

from nilearn.datasets import fetch_atlas_smith_2009

from modl.utils.system import get_cache_dirs

batch_size = 200
learning_rate = .92
method = 'masked'
step_size = 0.01
reduction_ = 8
alpha = 1e-3
n_epochs = 4
verbose = 15
n_jobs = 70
smoothing_fwhm = 6
components_list = [20, 40, 80, 120, 200, 300, 500]
n_runs = 20

dict_init = fetch_atlas_smith_2009().rsn20

dataset = fetch_adhd(n_subjects=40)
data = dataset.rest.values
train_data, test_data = train_test_split(data, test_size=2, random_state=0)
train_imgs, train_confounds = zip(*train_data)
test_imgs, test_confounds = zip(*test_data)
mask = dataset.mask
mem = Memory(location=get_cache_dirs()[0])
masker = NiftiMasker(mask_img=mask).fit()

def fit_single(train_imgs, test_imgs, n_components, random_state):
    dict_fact = fMRIDictFact(smoothing_fwhm=smoothing_fwhm,
                             method=method,
                             step_size=step_size,
                             mask=mask,
                             memory=mem,
                             memory_level=2,
                             verbose=verbose,
                             n_epochs=n_epochs,
                             n_jobs=1,
                             random_state=random_state,
                             n_components=n_components,
                             positive=True,
                             learning_rate=learning_rate,
                             batch_size=batch_size,
                             reduction=reduction_,
                             alpha=alpha,
                             callback=None,
                             )
    dict_fact.fit(train_imgs, confounds=train_confounds)
    score = dict_fact.score(test_imgs)
    return dict_fact.components_, score

def fit_many_runs(train_imgs, test_imgs, components_list, n_runs=10, n_jobs=1):
    random_states = check_random_state(0).randint(0, int(1e7), size=n_runs)
    cached_fit = mem.cache(fit_single)

    res = Parallel(n_jobs=n_jobs)(delayed(cached_fit)(
        train_imgs, test_imgs, n_components, random_state)
                                  for n_components in components_list
                                  for random_state in random_states
                                  )
    components, scores = zip(*res)
    shape = (len(components_list), len(random_states))
    components = np.array(components).reshape(shape).tolist()
    scores = np.array(scores).reshape(shape).tolist()

    discrepencies = []
    var_discrepencies = []
    best_components = []
    for n_components, these_components, these_scores in zip(components_list,
                                                            components,
                                                            scores):
        discrepency, var_discrepency = mean_amari_discrepency(
            these_components)
        best_estimator = these_components[np.argmin(these_scores)]
        discrepencies.append(var_discrepency)
        var_discrepencies.append(var_discrepency)
        best_components.append(best_estimator)

    discrepencies = np.array(discrepencies)
    var_discrepencies = np.array(var_discrepencies)
    best_components = np.array(best_components)
    components = best_components[np.argmin(discrepencies)]

    return discrepencies, var_discrepencies, components

output_dir = expanduser('~/output_drago4/modl/fmri_stability2')

if not os.path.exists(output_dir):
    os.makedirs(output_dir)

discrepencies, var_discrepencies, components = fit_many_runs(
    train_imgs, test_imgs,
    components_list,
    n_jobs=n_jobs,
    n_runs=n_runs)

components_img = masker.inverse_transform(components)
components_img.to_filename(
    join(output_dir, 'components.nii.gz'))
dump((components_list, discrepencies, var_discrepencies),
     join(output_dir, 'discrepencies.pkl'))

fig = plt.figure()
display_maps(fig, components_img)
plt.savefig(join(output_dir, 'components.pdf'))
fig, ax = plt.subplots(1, 1)
ax.fill_between(components_list, discrepencies - var_discrepencies,
                discrepencies + var_discrepencies, alpha=0.5)
ax.plot(components_list, discrepencies, marker='o')
ax.set_xlabel('Number of components')
ax.set_ylabel('Mean Amari discrepency')
sns.despine(fig)
fig.suptitle('Stability selection using DL')
plt.savefig(join(output_dir, 'discrepencies.pdf'))


text:
<?php

class Module_Display_Catalogue_Object_List_Filter_Type_Room extends Dune_Include_Abstract_Code
{

    protected function code()
    {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

$list = new Special_Vtor_Object_List_Type_Room();
$list->setUseAdressFull();
$session = Dune_Session::getInstance($this->session_zone);
//echo $session;
if ($session->levels)
    $list->setLevels();
else
    $list->setRoomsCountArray(array(
                                    1 => $session->rooms_count_1,
                                    2 => $session->rooms_count_2,
                                    3 => $session->rooms_count_3,
                                    4 => $session->rooms_count_4,
                                    ));
if ($session->house_type)
    $list->setHouseType($session->house_type);

if ($session->condition)
    $list->setConditionArray($session->condition);

// Óñòàíîâêà ôèëüòðà äëÿ âñåõ òèïîâ
    $set_list = new Module_Display_Catalogue_Object_List_Filter_Type_Common();
    $set_list->list = $list;
    $set_list->session = $session;
    $set_list->adress_object = $this->adress_object;
    $set_list->type = $this->type;
    $set_list->no_ryazan = $this->no_ryazan;
    $set_list->make();
//    $list = $set_list->getResult('list');
    $no_mediator = $set_list->getResult('no_mediator');
/// êëíåö óñòàíîâêè äëÿ âñåõ òèïîâ

if ($session->seller and $session->seller > 0)
    $list->setSeller($session->seller);

else if ($session->seller and $session->seller == -1)
{
    $array = array();
    foreach (Special_Vtor_Data::$sellerSpecial as $value)
    {
        $array[] = $value['id'];
    }
    $list->setSellerException($array);
}

if ($session->phone)
    $list->setPhone();
if ($session->photo)
    $list->setPhoto();

if ($session->floor_no_first)
    $list->setFloorFrom();
if ($session->floor_from)
    $list->setFloorFrom($session->floor_from);

$x      = 0;
$result = null;
if ($session->new_building_flag_0 === 1)
{
    $x++;
    $result = 0;
}
if ($session->new_building_flag_1 === 1)
{
    $x++;
    $result = 1;
}
if ($x == 1)
{
    $list->setNewBuilding($result);
}

if ($session->floor_no_last)
    $list->setFloorTo();

if ($session->floor_to)
    $list->setFloorTo($session->floor_to);

if ($session->value_from)
    $list->setValueFrom($session->value_from);
if ($session->value_to)
    $list->setValueTo($session->value_to);

$list->filter = $session->getZone(true);

if ($this->type)
    $list->setType($this->type);

$count = $list->count(1);
$count_no_group = $list->count();

$this->results['count'] = $count;
$page_curent = $this->url_info->getPage();
$page_per = $this->perPage;
$view = Dune_Zend_View::getInstance();

$module = new Module_Catalogue_List_Sort_Get();
$module->make();

if ($module->getResult('field'))
{
    $order_field = $module->getResult('field');
    $order_direction = $module->getResult('order');
    $order_special = true;
}
else
{
    $order_special = false;
    $order_field = 'time_insert';
    $order_direction = 'DESC';
}

/*$session = Dune_Session::getInstance($this->session_zone);
$saved = $session->getZone(true);
$price_min_max = array('min' => $saved['price_from'], 'max' => $saved['price_to']);
*/

$price_min_max = array('min' => null, 'max' => null);

$this->setResult('where_string', $list->getWhereStringSpecial());
$this->setResult('use_table_user', $list->isUseTableUser());
$this->setResult('use_table_user_time', $list->isUseTableUserTime());

if ($count)
{
    $list_spec = false;
    if (!$order_special)
    {
        if ($no_mediator and !$page_curent and $count > $page_per)  // Ðàáîòàåò â òåñòîâîì ðåæèìå
        {
            $list->clearSeller();
            $list->setOrder($order_field, $order_direction);
            $fseller_list = $list->getListCumulate(0, $page_per);
            $fseller_count = count($fseller_list);
            $list->setSeller(Special_Vtor_Settings::$idOk62);
            $list->setFSeller(false);
            if ($fseller_count > 0)
            {
                if ($fseller_count > $page_per - 2)
                    $fseller_count_temp = $page_per - 2;
                else
                    $fseller_count_temp = $fseller_count;
                $ok62_list = $list->getListCumulate(0, $page_per - $fseller_count_temp);
                $ok62_count = count($ok62_list);
                if ($ok62_count > 0)
                {
                    $list_spec = array();
                    $x = 0;
                    foreach ($fseller_list as $value)
                    {
                        $list_spec[] = $value;
                        $x++;
                        if ($x == $page_per - 2)
                        {
                            break;
                        }
                    }
                    foreach ($ok62_list as $value)
                    {
                        $list_spec[] = $value;
                    }
                }
                else
                {
                    $list_spec = $fseller_list;
                }

            }
        }
        else
            $list->setOrder('priority', 'DESC');
    }

//    if ($order_field == 'price')
        $list->setOrder('price_contractual');

    if (Special_Vtor_Settings::$useGroupInList)
        $list->setGroupInList();

    if ($list_spec === false)
    {
        $list->setOrder($order_field, $order_direction);
        $objects_list_run = $list->getListCumulate($page_curent * $page_per, $page_per);
    }
    else
        $objects_list_run = $list_spec;

//    if ((int)$price_min_max['max'] < 1 or (int)$price_min_max['min'] < 1)
      $price_min_max = $list->getFromListCumulatePriceMinMax();

$objects_list_list = array();
foreach ($objects_list_run as $key => $value)
{
    $objects_list_list[$key] = $value;

    $cat_url = new Special_Vtor_Catalogue_Url_Collector();
    $cat_url->setRegion($value['region_id']);
    $cat_url->setArea($value['area_id']);
    $cat_url->setSettlement($value['settlement_id']);
    $cat_url->setStreet($value['street_id']);
    $cat_url->setHouse($value['house_number']);

    if (Special_Vtor_Settings::$districtPlus)
        $cat_url->setDistrict($value['district_id_plus'], true);
    else
        $cat_url->setDistrict($value['district_id']);

    // Óçíàåì íà êàêèõ ýòàæàõ åñòü êâàðòèðêè
    if ($value['count_in_group'] > 1)
    {

        $list = new Special_Vtor_Object_List();
        $list->setActivity(1);
        $list->setRegion(null);
        $list->setOrder('floor');
        $list->setShowWitoutHouseNumber();
        $objects_list_list[$key]['array_group'] = $list->getListCumulateInGroup($value['group_list']);
    }
    else
    {
        $objects_list_list[$key]['array_group'] = array();
    }

    $cat_url->setType($value['type']);

    $objects_list_list[$key]['link_adress'] = $cat_url->get(); // Ññûëêà äëÿ îáúåêòà áåç óêàçàíèÿ êîäà îáúåêò à

    $cat_url->setObject($value['id']);
    $objects_list_list[$key]['link'] = $cat_url->get();

    $pics = new Special_Vtor_Catalogue_Info_Plan($value['id'], $value['time_insert']);
    //echo $pics->count();
    if ($pics->count())
    {
        $prew = $pics->getOneImage();
        $objects_list_list[$key]['preview'] = $prew->getPreviewFileUrl(100);
    }
    else
    {
        $pics = new Special_Vtor_Catalogue_Info_Image($value['id'], $value['time_insert']);
        if ($pics->count())
        {
            $prew = $pics->getOneImage();
            $objects_list_list[$key]['preview'] = $prew->getPreviewFileUrl(100);
        }
        else
            $objects_list_list[$key]['preview'] = '';
    }
}

//    echo '
Îáúåêòîâ: ' . $count . '
';
    //$list->setOrderTimeInsert('DESC');
//    $list->setOrder($order_field, $order_direction);
    $view->data = $objects_list_list;
    $view->navigator_per_page = $this->perPage;

    $view->count = $count;
    $view->count_no_group = $count_no_group;

    $view->gm = $this->gm;

    $view->url_info = $this->url_info;
    $view->navigator_page = $page_curent;

    $view->price_min_max = $price_min_max;

    $view->order_field     = $order_field;
    $view->order_direction = $order_direction;

    $URL = Dune_Parsing_UrlSingleton::getInstance();
    $view->url_self = $URL->getCommandString('true');

    $view->type = $this->type;
    $view->list_statistic = $view->render('bit/catalogue/object/list/statistic');

    echo $view->render('bit/catalogue/object/list/room');
}
else
{
    $session = Dune_Session::getInstance($this->session_zone);
    $count_with_bad = 0;
    if (!$session->show_bad)
    {
        $list->setShowWitoutHouseNumber(true);
        $count_with_bad = $list->count();
    }

    $view->count_with_bad = $count_with_bad;
    echo $view->render('bit/catalogue/object/list/no_one');
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    }

}


text:
package org.spongycastle.cms.test;

import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.security.KeyPair;
import java.security.Security;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.spongycastle.asn1.ASN1ObjectIdentifier;
import org.spongycastle.asn1.oiw.OIWObjectIdentifiers;
import org.spongycastle.asn1.pkcs.PKCSObjectIdentifiers;
import org.spongycastle.asn1.x509.AlgorithmIdentifier;
import org.spongycastle.cert.X509CertificateHolder;
import org.spongycastle.cms.CMSAlgorithm;
import org.spongycastle.cms.CMSAuthenticatedDataParser;
import org.spongycastle.cms.CMSAuthenticatedDataStreamGenerator;
import org.spongycastle.cms.OriginatorInfoGenerator;
import org.spongycastle.cms.RecipientInformation;
import org.spongycastle.cms.RecipientInformationStore;
import org.spongycastle.cms.jcajce.JceCMSMacCalculatorBuilder;
import org.spongycastle.cms.jcajce.JceKeyTransAuthenticatedRecipient;
import org.spongycastle.cms.jcajce.JceKeyTransRecipientInfoGenerator;
import org.spongycastle.jce.provider.BouncyCastleProvider;
import org.spongycastle.operator.DigestCalculatorProvider;
import org.spongycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder;

public class NewAuthenticatedDataStreamTest
    extends TestCase
{
    private static final String BC = BouncyCastleProvider.PROVIDER_NAME;

    private static String          _signDN;
    private static KeyPair _signKP;
    private static X509Certificate _signCert;

    private static String          _origDN;
    private static KeyPair         _origKP;
    private static X509Certificate _origCert;

    private static String          _reciDN;
    private static KeyPair         _reciKP;
    private static X509Certificate _reciCert;

    private static KeyPair         _origEcKP;
    private static KeyPair         _reciEcKP;
    private static X509Certificate _reciEcCert;

    private static boolean         _initialised = false;

    public boolean DEBUG = true;

    private static void init()
        throws Exception
    {
        if (!_initialised)
        {
            _initialised = true;
            Security.addProvider(new org.spongycastle.jce.provider.BouncyCastleProvider());

            _signDN   = "O=Bouncy Castle, C=AU";
            _signKP   = CMSTestUtil.makeKeyPair();
            _signCert = CMSTestUtil.makeCertificate(_signKP, _signDN, _signKP, _signDN);

            _origDN   = "CN=Bob, OU=Sales, O=Bouncy Castle, C=AU";
            _origKP   = CMSTestUtil.makeKeyPair();
            _origCert = CMSTestUtil.makeCertificate(_origKP, _origDN, _signKP, _signDN);

            _reciDN   = "CN=Doug, OU=Sales, O=Bouncy Castle, C=AU";
            _reciKP   = CMSTestUtil.makeKeyPair();
            _reciCert = CMSTestUtil.makeCertificate(_reciKP, _reciDN, _signKP, _signDN);

            _origEcKP = CMSTestUtil.makeEcDsaKeyPair();
            _reciEcKP = CMSTestUtil.makeEcDsaKeyPair();
            _reciEcCert = CMSTestUtil.makeCertificate(_reciEcKP, _reciDN, _signKP, _signDN);
        }
    }

    public void setUp()
        throws Exception
    {
        init();
    }

    public NewAuthenticatedDataStreamTest(String name)
    {
        super(name);
    }

    public static void main(String args[])
    {
        junit.textui.TestRunner.run(NewAuthenticatedDataStreamTest.class);
    }

    public static Test suite()
        throws Exception
    {
        init();

        return new CMSTestSetup(new TestSuite(NewAuthenticatedDataStreamTest.class));
    }

    public void testKeyTransDESede()
        throws Exception
    {
        tryKeyTrans(CMSAlgorithm.DES_EDE3_CBC);
    }

    public void testKeyTransDESedeWithDigest()
        throws Exception
    {
        tryKeyTransWithDigest(CMSAlgorithm.DES_EDE3_CBC);
    }

    public void testOriginatorInfo()
        throws Exception
    {
        ASN1ObjectIdentifier macAlg = CMSAlgorithm.DES_EDE3_CBC;
        byte[]          data     = "Eric H. Echidna".getBytes();

        CMSAuthenticatedDataStreamGenerator adGen = new CMSAuthenticatedDataStreamGenerator();
        ByteArrayOutputStream               bOut = new ByteArrayOutputStream();

        X509CertificateHolder origCert = new X509CertificateHolder(_origCert.getEncoded());

        adGen.setOriginatorInfo(new OriginatorInfoGenerator(origCert).generate());

        adGen.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(_reciCert).setProvider(BC));

        OutputStream aOut = adGen.open(bOut, new JceCMSMacCalculatorBuilder(macAlg).setProvider(BC).build());

        aOut.write(data);

        aOut.close();

        CMSAuthenticatedDataParser ad = new CMSAuthenticatedDataParser(bOut.toByteArray());

        assertTrue(ad.getOriginatorInfo().getCertificates().getMatches(null).contains(origCert));

        RecipientInformationStore recipients = ad.getRecipientInfos();

        assertEquals(ad.getMacAlgOID(), macAlg.getId());

        Collection c = recipients.getRecipients();

        assertEquals(1, c.size());

        Iterator it = c.iterator();

        while (it.hasNext())
        {
            RecipientInformation recipient = (RecipientInformation)it.next();

            assertEquals(recipient.getKeyEncryptionAlgOID(), PKCSObjectIdentifiers.rsaEncryption.getId());

            byte[] recData = recipient.getContent(new JceKeyTransAuthenticatedRecipient(_reciKP.getPrivate()).setProvider(BC));

            assertTrue(Arrays.equals(data, recData));
            assertTrue(Arrays.equals(ad.getMac(), recipient.getMac()));
        }
    }

    private void tryKeyTrans(ASN1ObjectIdentifier macAlg)
        throws Exception
    {
        byte[]          data     = "Eric H. Echidna".getBytes();

        CMSAuthenticatedDataStreamGenerator adGen = new CMSAuthenticatedDataStreamGenerator();
        ByteArrayOutputStream               bOut = new ByteArrayOutputStream();

        adGen.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(_reciCert).setProvider(BC));

        OutputStream aOut = adGen.open(bOut, new JceCMSMacCalculatorBuilder(macAlg).setProvider(BC).build());

        aOut.write(data);

        aOut.close();

        CMSAuthenticatedDataParser ad = new CMSAuthenticatedDataParser(bOut.toByteArray());

        RecipientInformationStore recipients = ad.getRecipientInfos();

        assertEquals(ad.getMacAlgOID(), macAlg.getId());

        Collection c = recipients.getRecipients();

        assertEquals(1, c.size());

        Iterator it = c.iterator();

        while (it.hasNext())
        {
            RecipientInformation recipient = (RecipientInformation)it.next();

            assertEquals(recipient.getKeyEncryptionAlgOID(), PKCSObjectIdentifiers.rsaEncryption.getId());

            byte[] recData = recipient.getContent(new JceKeyTransAuthenticatedRecipient(_reciKP.getPrivate()).setProvider(BC));

            assertTrue(Arrays.equals(data, recData));
            assertTrue(Arrays.equals(ad.getMac(), recipient.getMac()));
        }
    }

    private void tryKeyTransWithDigest(ASN1ObjectIdentifier macAlg)
        throws Exception
    {
        byte[]          data     = "Eric H. Echidna".getBytes();

        CMSAuthenticatedDataStreamGenerator adGen = new CMSAuthenticatedDataStreamGenerator();
        ByteArrayOutputStream               bOut = new ByteArrayOutputStream();
        DigestCalculatorProvider            calcProvider = new JcaDigestCalculatorProviderBuilder().setProvider(BC).build();

        adGen.addRecipientInfoGenerator(new JceKeyTransRecipientInfoGenerator(_reciCert).setProvider(BC));

        OutputStream aOut = adGen.open(bOut, new JceCMSMacCalculatorBuilder(macAlg).setProvider(BC).build(), calcProvider.get(new AlgorithmIdentifier(OIWObjectIdentifiers.idSHA1)));

        aOut.write(data);

        aOut.close();

        CMSAuthenticatedDataParser ad = new CMSAuthenticatedDataParser(bOut.toByteArray(), calcProvider);

        RecipientInformationStore recipients = ad.getRecipientInfos();

        assertEquals(ad.getMacAlgOID(), macAlg.getId());

        Collection c = recipients.getRecipients();

        assertEquals(1, c.size());

        Iterator it = c.iterator();

        while (it.hasNext())
        {
            RecipientInformation recipient = (RecipientInformation)it.next();

            assertEquals(recipient.getKeyEncryptionAlgOID(), PKCSObjectIdentifiers.rsaEncryption.getId());

            byte[] recData = recipient.getContent(new JceKeyTransAuthenticatedRecipient(_reciKP.getPrivate()).setProvider(BC));

            assertTrue(Arrays.equals(data, recData));
            assertTrue(Arrays.equals(ad.getMac(), recipient.getMac()));
            assertTrue(Arrays.equals(ad.getContentDigest(), recipient.getContentDigest()));
        }
    }
}


text:
class AcceptsController < ApplicationController

  def new
    @accept = Accept.new(service_definition_id: params[:service_definition_id])
  end

  def create
    @accept = Accept.new(accept_params)
    if @accept.save
      redirect_to @accept
    else
      render 'new'
    end
  end

  def show
    @accept = Accept.find(params[:id])
  end
  #
  # def index
  #   @accepts = Accept.all
  # end

  def edit
    @accept = Accept.find(params[:id])
  end

  def update
    @accept = Accept.find(params[:id])
    if @accept.update(accept_params)
      redirect_to @accept
    else
      render 'edit'
    end
  end

  def destroy
    @accept = Accept.find(params[:id])
    @accept.destroy
    redirect_to url_for(@accept.service_definition) + '#accepts'
  end

private

  def accept_params
    params.require(:accept).permit! #(:name, :comment)
  end

end


text:
<?php

/**
 * Taint a string
 *
 * @phpstub-variable-parameters
 * @phpstub
 *
 * @param string $string
 * @param string $_
 *
 * @return bool Return TRUE if the transformation is done. Always return TRUE if the taint
 *              extension is not enabled.
 */
function taint(&$string, $_ = NULL)
{
}


text:
<!--
    Copyright 2016 Fredhopper B.V.

    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.
 -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.fredhopper.core</groupId>
	<artifactId>fredhoppercore</artifactId>
	<version>1.0.0</version>

	<name>fredhoppercore</name>
	<description>Fredhopper-Hybris Connector</description>
	<properties>
		<spring.version>4.1.7.RELEASE</spring.version>
		<log4j.version>1.2.17</log4j.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5.1</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>2.4.3</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.15</version>
				<configuration>
					<!-- Sets the VM argument line used when unit tests are run. -->
					<argLine>${surefireArgLine}</argLine>
					<!-- Skips unit tests if the value of skip.unit.tests property is true -->
					<skipTests>${skip.unit.tests}</skipTests>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.7.7.201606060606</version>
				<executions>
					<!-- Prepares the property pointing to the JaCoCo runtime agent which
						is passed as VM argument when Maven the Surefire plugin is executed. -->
					<execution>
						<id>pre-unit-test</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<!-- Sets the path to the file which contains the execution data. -->
							<destFile>${project.build.directory}/jacoco-it.exec</destFile>
							<!-- Sets the name of the property containing the settings for JaCoCo
								runtime agent. -->
							<propertyName>surefireArgLine</propertyName>
						</configuration>
					</execution>
					<!-- Ensures that the code coverage report for unit tests is created
						after unit tests have been run. -->
					<execution>
						<id>post-unit-test</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
						<configuration>
							<!-- Sets the path to the file which contains the execution data. -->
							<dataFile>${project.build.directory}/jacoco-it.exec</dataFile>
							<!-- Sets the output directory for the code coverage report. -->
							<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.pitest</groupId>
				<artifactId>pitest-maven</artifactId>
				<version>1.1.10</version>
				<configuration>
					<targetClasses>
						<param>com.fredhopper.core*</param>
					</targetClasses>
					<targetTests>
						<param>com.fredhopper.core*</param>
					</targetTests>
					<threads>4</threads>
				</configuration>
			</plugin>

		</plugins>
	</build>
	<dependencies>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>${log4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-pool2</artifactId>
			<version>2.4.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-collections4</artifactId>
			<version>4.1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.4</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.4</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.5.2</version>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>18.0</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>1.9.5</version>
		</dependency>
		<dependency>
			<groupId>fredhopper</groupId>
			<artifactId>client</artifactId>
			<version>1.0</version>
			<scope>system</scope>
			<systemPath>${project.basedir}/src/main/resources/ws-client-1.7.2.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>fredhopper</groupId>
			<artifactId>query-lang</artifactId>
			<version>1.0</version>
			<scope>system</scope>
			<systemPath>${project.basedir}/src/main/resources/query-lang-2.17.1.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>org.mock-server</groupId>
			<artifactId>mockserver-netty</artifactId>
			<version>RELEASE</version>
		</dependency>
		<dependency>
			<groupId>org.mock-server</groupId>
			<artifactId>mockserver-client-java</artifactId>
			<version>RELEASE</version>
		</dependency>
		<dependency>
			<groupId>org.mock-server</groupId>
			<artifactId>mockserver-core</artifactId>
			<version>RELEASE</version>
		</dependency>
	</dependencies>
</project>


text:
$:.unshift(File.expand_path('../../lib', __FILE__))
$:.unshift(File.expand_path('../../../aws-sdk-core/features', __FILE__))
$:.unshift(File.expand_path('../../../aws-sdk-core/lib', __FILE__))
$:.unshift(File.expand_path('../../../aws-sigv4/lib', __FILE__))

require 'features_helper'
require 'aws-sdk-pinpointsmsvoice'

Aws::PinpointSMSVoice::Client.add_plugin(ApiCallTracker)


text:
test_name 'FM-3918 - C95871 - Install MOTD module'

step 'Install MOTD Module'
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '../../../'))
staging = { module_name: 'puppetlabs-motd' }
local = { module_name: 'motd', source: proj_root, target_module_path: master['distmoduledir'] }

# in CI install from staging forge, otherwise from local
install_dev_puppet_module_on(master, options[:forge_host] ? staging : local)


text:
package org.camunda.bpm.engine.test.standalone.history;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.ExecutionListener;
import org.camunda.bpm.engine.delegate.Expression;

/**
 * @author Frederik Heremans
 */
public class VariableUpdateExecutionListener implements ExecutionListener {

  private Expression varName;

  public void notify(DelegateExecution execution) throws Exception {
    String variableName = (String) varName.getValue(execution);
    execution.setVariable(variableName, "Event: " + execution.getEventName());
  }

}


text:
from constructions import *

def init(env):
    circ = env.add_free_circ((312.75, 251.75), 113.75)
    env.set_tools(
        "move", "point", "line", "circle",
        "perp_bisector", "intersection",
    )
    env.goal_params(circ)

def construct_goals(circ):
    return Point(circ.c)


text:
module KeyGenerator

    def generate(input)
        key = []
        input.tr('.:', '').split(//).each{|char|
            key.push(char.hex)
        }

        return key
    end

    module_function :generate
end


text:
<?php
//this is the main page for the site.
//include the configuration file:
header("Content-Type:text/html; charset=utf-8");

require ('../../../includes/config.inc.php');

//redirect if is not admin or unlogged in
if (!isset($_COOKIE['username'])) {
	$url = BASE_URL .'index.html';
	header("Location: $url");
	exit();
}
else {
	if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Handle the form.
		// Need the database connection:
		require (MYSQL);

		$flag = "success";

		// set all default = 'N'
		$q = "DELETE FROM imges WHERE product_id={$_POST['product_id']} AND img_name='{$_POST['checked']}' LIMIT 1";
		$r = mysqli_query($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error: " . mysqli_error($dbc));
		if (mysqli_affected_rows($dbc) == 0)
			$flag = "failed";
		echo $flag;
		mysqli_close($dbc);
	}
}
?>


text:
module.exports = function (grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        config: grunt.file.readJSON('settings.json'),
        jshint: {
            // define the files to lint`
            files: ['src/**/*.js']
        },
        uglify: {
            // :: widgets.js ::
            prep_widgets: {
                options: {
                    mangle: false,
                    compress: false,
                    preserveComments: 'some',
                    exportAll: true,
                    beautify: true,
                    report: 'gzip'
                },
                files: {
                    '.tmp/widgets.js': [
                        'src/widgets/service.js',
                        'src/widgets/config.js',
                        'src/widgets/utils.js',
                        'src/widgets/dispatcher.js',
                        'src/widgets/factory.js',
                        'src/widgets/auth.js',
                        'src/widgets/api.js',
                        'src/widgets/bootstrap.js'
                    ]
                }
            },
            build_widgets: {
                options: {
                    mangle: false,
                    compress: false,
                    preserveComments: 'some',
                    exportAll: true,
                    beautify: true,
                    banner: '(function(global, undefined){\n',
                    footer: '\n})(this);'
                },
                files: {
                    'build/widgets.js': [
                        '.tmp/settings.js',
                        '.tmp/widgets.js'
                    ]
                }
            },
            prettify_build_widgets: {
                options: {
                    mangle: false,
                    compress: false,
                    preserveComments: 'some',
                    exportAll: true,
                    beautify: true
                },
                files: {
                    'build/widgets.js': [ // prettify
                        'build/widgets.js'
                    ]
                }
            },
            build_widgets_min: {
                options: {
                    report: 'min',
                    compress: true
                },
                files: {
                    'build/widgets.min.js': [
                        'build/widgets.js'
                    ]
                }
            }
        },
        cssmin: {
            options: {
                shorthandCompacting: false,
                roundingPrecision: -1
            },
            target: {
                files: {
                    '.tmp/loading.css': ['src/styles/loading.css']
                }
            }
        },
        replace: {
            embedded: {
                options: {
                    patterns: [
                        { match: 'name', replacement: '<%= pkg.name %>' },
                        { match: 'loadingStyle', replacement: function() {
                            return grunt.file.read('.tmp/loading.css');
                        } }
                    ]
                },
                files: [
                    { expand: true, flatten: true, src: ['build/*.js'], dest: 'build/' }
                ]
            }
        },
        json: {
            main: {
                options: {
                    namespace: 'settings',
                    includePath: false,
                    processName: function() {
                        return "config";
                    }
                },
                src: ['./settings.json'],
                dest: '.tmp/settings.js'
            }
        },
        clean: [".tmp"]
    });

    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-json');
    grunt.loadNpmTasks('grunt-contrib-cssmin');
    grunt.loadNpmTasks('grunt-contrib-compress');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-replace');
    grunt.loadNpmTasks('grunt-contrib-clean');

    grunt.registerTask('default', ['jshint', 'cssmin', 'json', 'uglify', 'replace', 'clean']);
};


text:
#region License

#endregion

#region Contact

/*
 * Leslie Sanford
 * Email: jabberdabber@hotmail.com
 */

#endregion

using System;
using System.Collections;
using System.Drawing;
using System.Threading;
using System.Windows.Forms;

namespace Sanford.Multimedia.Midi.UI
{
    public partial class PianoControl : Control
    {
        private enum KeyType
        {
            White,
            Black
        }

        private readonly static Hashtable keyTable = new Hashtable();

        private static readonly KeyType[] KeyTypeTable =
            {
                KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White,
                KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White,
                KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White,
                KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White,
                KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White,
                KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White,
                KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White,
                KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White,
                KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White,
                KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White,
                KeyType.White, KeyType.Black, KeyType.White, KeyType.Black, KeyType.White, KeyType.White, KeyType.Black, KeyType.White
            };

        private delegate void NoteMessageCallback(ChannelMessage message);

        private const int DefaultLowNoteID = 21;

        private const int DefaultHighNoteID = 109;

        private const double BlackKeyScale = 0.666666666;

        private SynchronizationContext context;

        private int lowNoteID = DefaultLowNoteID;

        private int highNoteID = DefaultHighNoteID;

        private int octaveOffset = 5;

        private Color noteOnColor = Color.SkyBlue;

        private PianoKey[] keys = null;

        private int whiteKeyCount;

        private NoteMessageCallback noteOnCallback;

        private NoteMessageCallback noteOffCallback;

        public event EventHandler<PianoKeyEventArgs> PianoKeyDown;

        public event EventHandler<PianoKeyEventArgs> PianoKeyUp;

        static PianoControl()
        {
            keyTable.Add(Keys.A, 0);
            keyTable.Add(Keys.W, 1);
            keyTable.Add(Keys.S, 2);
            keyTable.Add(Keys.E, 3);
            keyTable.Add(Keys.D, 4);
            keyTable.Add(Keys.F, 5);
            keyTable.Add(Keys.T, 6);
            keyTable.Add(Keys.G, 7);
            keyTable.Add(Keys.Y, 8);
            keyTable.Add(Keys.H, 9);
            keyTable.Add(Keys.U, 10);
            keyTable.Add(Keys.J, 11);
            keyTable.Add(Keys.K, 12);
            keyTable.Add(Keys.O, 13);
            keyTable.Add(Keys.L, 14);
            keyTable.Add(Keys.P, 15);
        }

        public PianoControl()
        {
            CreatePianoKeys();
            InitializePianoKeys();

            context = SynchronizationContext.Current;

            noteOnCallback = delegate(ChannelMessage message)
            {
                if(message.Data2 > 0)
                {
                    keys[message.Data1 - lowNoteID].PressPianoKey();
                }
                else
                {
                    keys[message.Data1 - lowNoteID].ReleasePianoKey();
                }
            };

            noteOffCallback = delegate(ChannelMessage message)
            {
                keys[message.Data1 - lowNoteID].ReleasePianoKey();
            };
        }

        private void CreatePianoKeys()
        {
            // If piano keys have already been created.
            if(keys != null)
            {
                // Remove and dispose of current piano keys.
                foreach(PianoKey key in keys)
                {
                    Controls.Remove(key);
                    key.Dispose();
                }
            }

            keys = new PianoKey[HighNoteID - LowNoteID];

            whiteKeyCount = 0;

            for(int i = 0; i < keys.Length; i++)
            {
                keys[i] = new PianoKey(this);
                keys[i].NoteID = i + LowNoteID;

                if(KeyTypeTable[keys[i].NoteID] == KeyType.White)
                {
                    whiteKeyCount++;
                }
                else
                {
                    keys[i].NoteOffColor = Color.Black;
                    keys[i].BringToFront();
                }

                keys[i].NoteOnColor = NoteOnColor;

                Controls.Add(keys[i]);
            }
        }

        private void InitializePianoKeys()
        {
            #region Guard

            if(keys.Length == 0)
            {
                return;
            }

            #endregion

            int whiteKeyWidth = Width / whiteKeyCount;
            int blackKeyWidth = (int)(whiteKeyWidth * BlackKeyScale);
            int blackKeyHeight = (int)(Height * BlackKeyScale);
            int offset = whiteKeyWidth - blackKeyWidth / 2;
            int n = 0;
            int w = 0;

            while(n < keys.Length)
            {
                if(KeyTypeTable[keys[n].NoteID] == KeyType.White)
                {
                    keys[n].Height = Height;
                    keys[n].Width = whiteKeyWidth;
                    keys[n].Location = new Point(w * whiteKeyWidth, 0);
                    w++;
                    n++;
                }
                else
                {
                    keys[n].Height = blackKeyHeight;
                    keys[n].Width = blackKeyWidth;
                    keys[n].Location = new Point(offset + (w - 1) * whiteKeyWidth);
                    keys[n].BringToFront();
                    n++;
                }
            }
        }

        public void Send(ChannelMessage message)
        {
            if(message.Command == ChannelCommand.NoteOn &&
                message.Data1 >= LowNoteID && message.Data1 <= HighNoteID)
            {
                if(InvokeRequired)
                {
                    BeginInvoke(noteOnCallback, message);
                }
                else
                {
                    noteOnCallback(message);
                }
            }
            else if(message.Command == ChannelCommand.NoteOff &&
                message.Data1 >= LowNoteID && message.Data1 <= HighNoteID)
            {
                if(InvokeRequired)
                {
                    BeginInvoke(noteOffCallback, message);
                }
                else
                {
                    noteOffCallback(message);
                }
            }
        }

        public void PressPianoKey(int noteID)
        {
            #region Require

            if(noteID < lowNoteID || noteID > highNoteID)
            {
                throw new ArgumentOutOfRangeException();
            }

            #endregion

            keys[noteID - lowNoteID].PressPianoKey();
        }

        public void ReleasePianoKey(int noteID)
        {
            #region Require

            if(noteID < lowNoteID || noteID > highNoteID)
            {
                throw new ArgumentOutOfRangeException();
            }

            #endregion

            keys[noteID - lowNoteID].ReleasePianoKey();
        }

        public void PressPianoKey(Keys k)
        {
            if(!Focused)
            {
                return;
            }

            if(keyTable.Contains(k))
            {
                int noteID = (int)keyTable[k] + 12 * octaveOffset;

                if(noteID >= LowNoteID && noteID <= HighNoteID)
                {
                    if(!keys[noteID - lowNoteID].IsPianoKeyPressed)
                    {
                        keys[noteID - lowNoteID].PressPianoKey();
                    }
                }
            }
            else
            {
                if(k == Keys.D0)
                {
                    octaveOffset = 0;
                }
                else if(k == Keys.D1)
                {
                    octaveOffset = 1;
                }
                else if(k == Keys.D2)
                {
                    octaveOffset = 2;
                }
                else if(k == Keys.D3)
                {
                    octaveOffset = 3;
                }
                else if(k == Keys.D4)
                {
                    octaveOffset = 4;
                }
                else if(k == Keys.D5)
                {
                    octaveOffset = 5;
                }
                else if(k == Keys.D6)
                {
                    octaveOffset = 6;
                }
                else if(k == Keys.D7)
                {
                    octaveOffset = 7;
                }
                else if(k == Keys.D8)
                {
                    octaveOffset = 8;
                }
                else if(k == Keys.D9)
                {
                    octaveOffset = 9;
                }
            }
        }

        public void ReleasePianoKey(Keys k)
        {
            #region Guard

            if(!keyTable.Contains(k))
            {
                return;
            }

            #endregion

            int noteID = (int)keyTable[k] + 12 * octaveOffset;

            if(noteID >= LowNoteID && noteID <= HighNoteID)
            {
                keys[noteID - lowNoteID].ReleasePianoKey();
            }
        }

        protected override void OnResize(EventArgs e)
        {
            InitializePianoKeys();

            base.OnResize(e);
        }

        protected override void Dispose(bool disposing)
        {
            if(disposing)
            {
                foreach(PianoKey key in keys)
                {
                    key.Dispose();
                }
            }

            base.Dispose(disposing);
        }

        protected virtual void OnPianoKeyDown(PianoKeyEventArgs e)
        {
            PianoKeyDown?.Invoke(this, e);
        }

        protected virtual void OnPianoKeyUp(PianoKeyEventArgs e)
        {
            PianoKeyUp?.Invoke(this, e);
        }

        public int LowNoteID
        {
            get
            {
                return lowNoteID;
            }
            set
            {
                #region Require

                if(value < 0 || value > ShortMessage.DataMaxValue)
                {
                    throw new ArgumentOutOfRangeException("LowNoteID", value,
                        "Low note ID out of range.");
                }

                #endregion

                #region Guard

                if(value == lowNoteID)
                {
                    return;
                }

                #endregion

                lowNoteID = value;

                if(lowNoteID > highNoteID)
                {
                    highNoteID = lowNoteID;
                }

                CreatePianoKeys();
                InitializePianoKeys();
            }
        }

        public int HighNoteID
        {
            get
            {
                return highNoteID;
            }
            set
            {
                #region Require

                if(value < 0 || value > ShortMessage.DataMaxValue)
                {
                    throw new ArgumentOutOfRangeException("HighNoteID", value,
                        "High note ID out of range.");
                }

                #endregion

                #region Guard

                if(value == highNoteID)
                {
                    return;
                }

                #endregion

                highNoteID = value;

                if(highNoteID < lowNoteID)
                {
                    lowNoteID = highNoteID;
                }

                CreatePianoKeys();
                InitializePianoKeys();
            }
        }

        public Color NoteOnColor
        {
            get
            {
                return noteOnColor;
            }
            set
            {
                #region Guard

                if(value == noteOnColor)
                {
                    return;
                }

                #endregion

                noteOnColor = value;

                foreach(PianoKey key in keys)
                {
                    key.NoteOnColor = noteOnColor;
                }
            }
        }
    }
}


text:
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">

  <title>epydoc.markup.epytext.ColorizingError</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />

         Home

         Trees

         Indices

         Help

epydoc 3.0beta1

        Package epydoc ::
        Package markup ::
        Module epytext ::
        Class ColorizingError

[hide private]

[frames] | no frames]

Class ColorizingError
source code

  <map id="uml_class_diagram_for_epydoc_m_8" name="uml_class_diagram_for_epydoc_m_8">
<area shape="rect" href="epydoc.markup.ParseError-class.html#__str__" title="Return a string representation of this ParseError." alt="" coords="68,329,257,348" />
<area shape="rect" href="epydoc.markup.ParseError-class.html#__cmp__" title="Compare two ParseErrors, based on their line number." alt="" coords="68,348,257,367" />
<area shape="rect" href="epydoc.markup.ParseError-class.html#set_linenum_offset" title="Set the line number offset for this error." alt="" coords="68,367,257,385" />
<area shape="rect" href="epydoc.markup.ParseError-class.html#is_fatal" title="Returns:  true if this is a fatal error." alt="" coords="68,385,257,404" />
<area shape="rect" href="epydoc.markup.ParseError-class.html#linenum" title="Returns:  The line number on which the error occured (including any offset)." alt="" coords="68,404,257,423" />
<area shape="rect" href="epydoc.markup.ParseError-class.html#__repr__" title="Return the formal representation of this ParseError." alt="" coords="68,423,257,441" />
<area shape="rect" href="epydoc.markup.ParseError-class.html" title="The base class for errors generated while parsing docstrings." alt="" coords="56,299,269,448" />
<area shape="rect" href="epydoc.markup.epytext.ColorizingError-class.html#CONTEXT_RANGE" title="epydoc.markup.epytext.ColorizingError.CONTEXT_RANGE" alt="" coords="17,489,308,508" />
<area shape="rect" href="epydoc.markup.epytext.ColorizingError-class.html#__init__" title="Construct a new colorizing exception." alt="" coords="17,511,308,529" />
<area shape="rect" href="epydoc.markup.epytext.ColorizingError-class.html#descr" title="epydoc.markup.epytext.ColorizingError.descr" alt="" coords="17,529,308,548" />
<area shape="rect" href="epydoc.markup.epytext.ColorizingError-class.html" title="An error generated while colorizing a paragraph." alt="" coords="5,467,320,555" />
<area shape="rect" href="javascript: void(0);" title="exceptions.BaseException.args" alt="" coords="84,28,241,47" />
<area shape="rect" href="javascript: void(0);" title="exception message" alt="" coords="84,47,241,65" />
<area shape="rect" href="javascript: void(0);" title="x.__setattr__('name', value) <==> x.name = value" alt="" coords="84,68,241,87" />
<area shape="rect" href="javascript: void(0);" title="x[y]" alt="" coords="84,87,241,105" />
<area shape="rect" href="javascript: void(0);" title="exceptions.BaseException.__setstate__" alt="" coords="84,105,241,124" />
<area shape="rect" href="javascript: void(0);" title="x.__getattribute__('name') <==> x.name" alt="" coords="84,124,241,143" />
<area shape="rect" href="javascript: void(0);" title="helper for pickle" alt="" coords="84,143,241,161" />
<area shape="rect" href="javascript: void(0);" title="x.__delattr__('name') <==> del x.name" alt="" coords="84,161,241,180" />
<area shape="rect" href="javascript: void(0);" title="exceptions.BaseException.__unicode__" alt="" coords="84,180,241,199" />
<area shape="rect" href="javascript: void(0);" title="Common base class for all exceptions" alt="" coords="72,5,253,205" />
<area shape="rect" href="javascript: void(0);" title="exceptions.Exception.__new__" alt="" coords="99,255,227,273" />
<area shape="rect" href="javascript: void(0);" title="Common base class for all non-exit exceptions." alt="" coords="87,224,239,280" />
</map>

An error generated while colorizing a paragraph.

        Instance Methods
        [hide private]

          __init__(self,
        descr,
        token,
        charnum,
        is_fatal=1)

      Construct a new colorizing exception.

            source code

          descr(self)

            source code

Inherited from ParseError:
      __cmp__,
      __repr__,
      __str__,
      is_fatal,
      linenum,
      set_linenum_offset

Inherited from exceptions.Exception:
      __new__

Inherited from exceptions.BaseException:
      __delattr__,
      __getattribute__,
      __getitem__,
      __reduce__,
      __setattr__,
      __setstate__,
      __unicode__

Inherited from object:
      __hash__,
      __reduce_ex__

        Class Variables
        [hide private]

        CONTEXT_RANGE = 20

        Instance Variables
        [hide private]

Inherited from ParseError (private):
      _descr,
      _fatal,
      _linenum,
      _offset

        Properties
        [hide private]

Inherited from exceptions.BaseException:
      args,
      message

Inherited from object:
      __class__

        Method Details
        [hide private]

__init__(self,
        descr,
        token,
        charnum,
        is_fatal=1)

(Constructor)

  	source code

  Construct a new colorizing exception.

Parameters:

descr (string) - A short description of the error.

token (Token) - The token where the error occured

charnum (int) - The character index of the position in token
          where the error occured.

Overrides:
      ParseError.__init__

descr(self)

  	source code

Overrides:
      ParseError.descr

         Home

         Trees

         Indices

         Help

epydoc 3.0beta1

    Generated by Epydoc
    3.0beta1 on Tue Feb 27 06:04:56 2007

      http://epydoc.sourceforge.net


text:
#region copyright
// Copyright 2015 Habart Thierry
//
// 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.
#endregion

using Moq;
using SimpleIdentityServer.Client;
using SimpleIdentityServer.Client.Operations;
using SimpleIdentityServer.Common.Client.Factories;
using System.Threading.Tasks;
using Xunit;

namespace SimpleIdentityServer.Host.Tests
{
    public class DiscoveryClientFixture : IClassFixture<TestOauthServerFixture>
    {
        private readonly TestOauthServerFixture _server;
        private Mock<IHttpClientFactory> _httpClientFactoryStub;
        private IDiscoveryClient _discoveryClient;

        public DiscoveryClientFixture(TestOauthServerFixture server)
        {
            _server = server;
        }

        [Fact]
        public async Task When_Retrieving_DiscoveryInformation_Then_No_Exception_Is_Thrown()
        {
            const string baseUrl = "http://localhost:5000";
            // ARRANGE
            InitializeFakeObjects();
            _httpClientFactoryStub.Setup(h => h.GetHttpClient()).Returns(_server.Client);

            // ACT
            var discovery = await _discoveryClient.GetDiscoveryInformationAsync(baseUrl + "/.well-known/openid-configuration");

            // ASSERT
            Assert.NotNull(discovery);
            Assert.True(discovery.ScimEndpoint == FakeStartup.ScimEndPoint);
        }

        private void InitializeFakeObjects()
        {
            _httpClientFactoryStub = new Mock<IHttpClientFactory>();
            _discoveryClient = new DiscoveryClient(new GetDiscoveryOperation(_httpClientFactoryStub.Object));
        }
    }
}


text:
import { Component, Input } from '@angular/core'

@Component({
  selector: 'app-content-page',
  template: `
    <ui-card>
      <ui-card-header>

        {{item.name}}
      </ui-card-header>
      <ui-card-content>

      </ui-card-content>
    </ui-card>
  `,
  styles: [`
    .line-breaker {
      white-space: pre-line;
    }
  `]
})
export class PageComponent {

  @Input() item: any = {}

}


text:
<?xml version="1.0" encoding="UTF-8"?>

<recipeml version="0.5">
  <recipe>
    <head>
      <title>Beef and Broccoli Stir-Fry</title>
      <categories>
        <cat>Main dish</cat>
        <cat>Beef</cat></categories>
      <yield>4</yield></head>
    <ingredients>
      <ing-div>
        <title/>
        <ing>
          <amt>
            <qty/>
            <unit/></amt>
          <item>Quick-cooking brown rice</item></ing>
        <ing>
          <amt>
            <qty>1</qty>
            <unit>tablespoon</unit></amt>
          <item>Plus 1 teaspoon vegetable oil</item></ing>
        <ing>
          <amt>
            <qty>1</qty>
            <unit>pound</unit></amt>
          <item>Beef strips for stir-fry (such as beef round steak)</item></ing>
        <ing>
          <amt>
            <qty>3</qty>
            <unit>teaspoons</unit></amt>
          <item>Cornstarch, divided</item></ing>
        <ing>
          <amt>
            <qty>2</qty>
            <unit/></amt>
          <item>Cloves garlic, minced</item></ing>
        <ing>
          <amt>
            <qty>1/4</qty>
            <unit>teaspoons</unit></amt>
          <item>To 1/2 teaspoon red pepper flakes</item></ing>
        <ing>
          <amt>
            <qty>1</qty>
            <unit/></amt>
          <item>Sweet onion, halved and sliced</item></ing>
        <ing>
          <amt>
            <qty>1</qty>
            <unit/></amt>
          <item>Bag (8 oz.) fresh broccoli florets</item></ing>
        <ing>
          <amt>
            <qty>1/2</qty>
            <unit>cups</unit></amt>
          <item>Stir-Fry Sauce (recipe follows)</item></ing>
        <ing>
          <amt>
            <qty>1/2</qty>
            <unit>cups</unit></amt>
          <item>Chicken broth</item></ing>
        <ing>
          <amt>
            <qty>1</qty>
            <unit>bunch</unit></amt>
          <item>(3 cups) watercress</item></ing></ing-div>
      <ing-div>
        <title>STIR FRY SAUCE</title>
        <ing>
          <amt>
            <qty>1</qty>
            <unit>cup</unit></amt>
          <item>Reduced-sodium soy sauce</item></ing>
        <ing>
          <amt>
            <qty>1/3</qty>
            <unit>cups</unit></amt>
          <item>Dry sherry</item></ing>
        <ing>
          <amt>
            <qty>4</qty>
            <unit>teaspoons</unit></amt>
          <item>Grated fresh ginger</item></ing>
        <ing>
          <amt>
            <qty>2</qty>
            <unit>teaspoons</unit></amt>
          <item>Sugar</item></ing></ing-div></ingredients>
    <directions>
      <step>  1. Prepare brown rice according to package directions for 4 servings.

  2. Meanwhile, heat 1 tablespoon oil in large, deep skillet or wok over high
  heat until shimmering. Toss beef with 2 teaspoons cornstarch in medium
  bowl. Add to skillet and cook, stirring, until no longer pink, 1 to 2
  minutes. With slotted spoon, transfer to clean bowl.

  3. Add remaining 1 teaspoon oil to skillet. Add garlic, red pepper flakes
  and onion; cook, stirring, 30 seconds. Stir in broccoli and Stir-Fry Sauce.
  Dissolve remaining 1 teaspoon cornstarch in chicken broth; add to skillet
  and cook, stirring occasionally, until broccoli is tender, 5 minutes.

  4. Return beef to skillet with watercress and cook, stirring, 1 minute
  more. Serve with brown rice. Makes 4 servings.

  STIR-FRY SAUCE: Combine all ingredients in jar with tight-fitting lid. Stir
  until sugar is dissolved. Refrigerate up to 2 weeks. Shake before using.
  Makes
    1 1/2    cups.

  PER SERVING: Calories 440, Total Fat 21 g, Saturated Fat 6 g, Cholesterol
  71 mg, Sodium 1,052 mg, Carbohydrates 35 g, Protein 30 g

  Recipe by Cathy Luchetti's Hot Flash Cookbook
  Posted to MM-Recipes Digest  by Julie Bertholf <jewel1@ix.netcom.com> on
  Jun 03, 1998

</step></directions></recipe></recipeml>


text:
package griffon.core.editors;

import griffon.core.formatters.CalendarFormatter;
import griffon.core.formatters.Formatter;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

import static griffon.util.GriffonNameUtils.isBlank;

/**
 * @author Andres Almiray
 * @since 2.0.0
 */
public class CalendarPropertyEditor extends AbstractPropertyEditor {
    protected void setValueInternal(Object value) {
        if (null == value) {
            super.setValueInternal(null);
        } else if (value instanceof CharSequence) {
            handleAsString(String.valueOf(value));
        } else if (value instanceof Calendar) {
            super.setValueInternal(value);
        } else if (value instanceof Date) {
            Calendar c = Calendar.getInstance();
            c.setTime((Date) value);
            super.setValueInternal(c);
        } else if (value instanceof Number) {
            Calendar c = Calendar.getInstance();
            c.setTime(new Date(((Number) value).longValue()));
            super.setValueInternal(c);
        } else {
            throw illegalValue(value, Calendar.class);
        }
    }

    protected void handleAsString(String str) {
        if (isBlank(str)) {
            super.setValueInternal(null);
            return;
        }

        Calendar c = Calendar.getInstance();
        try {
            c.setTime(new Date(Long.parseLong(str)));
            super.setValueInternal(c);
            return;
        } catch (NumberFormatException nfe) {
            // ignore, let's try parsing the date in a locale specific format
        }

        try {
            c.setTime(new SimpleDateFormat().parse(str));
            super.setValueInternal(c);
        } catch (ParseException e) {
            throw illegalValue(str, Calendar.class, e);
        }
    }

    protected Formatter<Calendar> resolveFormatter() {
        return isBlank(getFormat()) ? null : new CalendarFormatter(getFormat());
    }
}


text:
(function() {
  'use strict';

  angular.module('words').controller('DictionaryCtrl', ['$stateParams', '$window', '$log', 'dictionaryManager', 'translationManager', 'dictionaryModalManager',
  function($stateParams, $window, $log, dictionaryManager, translationManager, dictionaryModalManager) {
    var vm = this;

    vm.category = $stateParams.category;
    vm.all = vm.category === 'All Categories' ? true : false;
    vm.words = dictionaryManager.load(vm.category);
    vm.allChecked = false;
    vm.search = '';
    vm.defaultImg = '../images/default-img.png';
    vm.audios = {};

    vm.addPopover = {};

    vm.checkAll = function() {
      _.each(vm.words, function(elem) {
        elem.checked = vm.allChecked;
      });
    };

    vm.add = function() {
      translationManager.translate(vm.search).$promise.then(function(translation) {
        vm.addPopover.translation = translation[0];
      }, function(err) {
        $log.error(err);
      });
    };

    vm.save = function() {
      vm.addPopover.isOpen = false;
      dictionaryManager.save(vm.search, vm.addPopover.translation);
      vm.addPopover.translation = '';
      vm.search = '';
    };

    vm.sound = function(wordCard) {
      if(!vm.audios[wordCard.word]) {
        vm.audios[wordCard.word] = new Audio(wordCard.audioUrl);
      }
      vm.audios[wordCard.word].play();
    };

    vm.remove = function(word) {
      dictionaryManager.remove([word]);
    };

    vm.removeChecked = function() {
      var wordsToRemove = _.reject(vm.words, function(elem) {
        return !elem.checked;
      });

      if(wordsToRemove.length > 0) {
        dictionaryManager.remove(wordsToRemove);
      }
    };

    vm.back = function() {
      $window.history.back()
    };

    vm.checked = function() {
      return _.some(vm.words, function(elem) {
        return elem.checked;
      });
    };

    vm.changeImg = function(word) {
      dictionaryModalManager.addImg(word);
    }

    vm.showCard = function(word) {
      dictionaryModalManager.wordCard(word);
    };

  }]);
}());


text:
<?php

require_once('phpmailer/class.phpmailer.php');
require_once('phpmailer/class.smtp.php');

?>