text:
from setuptools import setup

with open('README.rst') as readme_file:
    readme = readme_file.read()

with open('HISTORY.rst') as history_file:
    history = history_file.read()

requirements = [
    # TODO: put package requirements here
]

test_requirements = [
    # TODO: put package test requirements here
]

setup(
    name='MCMC',
    version='0.1.0',
    description="Uses Metropolis-Hastings algorithm and Markov chain Monte Carlo method to compute an equilibrium distribution for states given a probability distribution. ",
    long_description=readme + '\n\n' + history,
    author="Unni Kurumbail",
    author_email='ukurumba@u.rochester.edu',
    url='https://github.com/ukurumba/MCMC',
    packages=[
        'MCMC',
    ],
    package_dir={'MCMC':
                 'MCMC'},
    include_package_data=True,
    install_requires=requirements,
    license="MIT license",
    zip_safe=False,
    keywords='MCMC',
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        "Programming Language :: Python :: 2",
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],
    test_suite='tests',
    tests_require=test_requirements
)

redpajama_set_name: RedPajamaGithub


text:
package com.ericsson.manhole.nbiot.tianao;

import java.util.Map;
import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;

import com.ericsson.common.AbstractDeviceMeasurement;

public class ManholeMeasurement extends AbstractDeviceMeasurement{

	public static final int MANHOLE_DATA_TYPE_MEASUREMENT_DATA = 1;

	public static final String MANHOLE_DATA_MEAS_TILT_ANGLE_KEY = "tilt_angle";
	public static final String MANHOLE_DATA_MEAS_AZIMUTH_ANGLE_KEY = "azimuth_angle";
	public static final String MANHOLE_DATA_MEAS_LATITUDE_KEY = "latitude";
	public static final String MANHOLE_DATA_MEAS_LATITUDE_DIRECTION_KEY = "latitude_direction";
	public static final String MANHOLE_DATA_MEAS_LONGTITUDE_KEY = "longtitude";
	public static final String MANHOLE_DATA_MEAS_LONGTITUDE_DIRECTION_KEY = "longtitude_direction";
	public static final String MANHOLE_DATA_MEAS_GEO_HEIGHT_KEY = "geo_height";

	public final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMddHHmmss.SSS");
	private static final Logger LOG = LoggerFactory.getLogger(ManholeMeasurement.class);

	public ManholeMeasurement()
	{

	}

	@Override
	public int decodeMeasurement(byte[] msg)
	{
		String msgString = new String(msg);
		String[] items = msgString.split(",");

		if(items.length != 14)
		{
			LOG.warn("receive invalid message!");
			return -1;
		}

		setType(MANHOLE_DATA_TYPE_MEASUREMENT_DATA);

		String imsi = items[1];
		String timestamp = items[2];
		String tiltAngle = items[3];
		String azimuthAngle = items[4];

		String temperature = items[5];
		String humidity = items[6];
		String barometricPressure = items[7];

		String latitude = items[8];
		String latitudeDirection = items[9];
		if("N".equals(latitudeDirection)){
			latitudeDirection = "1";
		}else if("S".equals(latitudeDirection)){
			latitudeDirection = "2";
		}

		String longtitude = items[10];
		String longtitudeDirection = items[11];
		if("E".equals(longtitudeDirection)){
			longtitudeDirection = "1";
		}else if("W".equals(longtitudeDirection)){
			longtitudeDirection = "2";
		}

		String geoHeight = items[12];

		setUniqueId(imsi);
		setSensorKV(MANHOLE_DATA_MEAS_TILT_ANGLE_KEY, tiltAngle);
		setSensorKV(MANHOLE_DATA_MEAS_AZIMUTH_ANGLE_KEY, azimuthAngle);
		setSensorKV(MANHOLE_DATA_MEAS_LATITUDE_KEY, latitude);
		setSensorKV(MANHOLE_DATA_MEAS_LATITUDE_DIRECTION_KEY, latitudeDirection);
		setSensorKV(MANHOLE_DATA_MEAS_LONGTITUDE_KEY, longtitude);
		setSensorKV(MANHOLE_DATA_MEAS_LONGTITUDE_DIRECTION_KEY, longtitudeDirection);
		setSensorKV(MANHOLE_DATA_MEAS_GEO_HEIGHT_KEY, geoHeight);

		Date today = new Date();
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(today);
		int year = calendar.get(Calendar.YEAR);
		int month = calendar.get(Calendar.MONTH) + 1;
		int day = calendar.get(Calendar.DATE);
		timestamp = String.format("%04d%02d%02d", year, month, day) + timestamp;

		Date eventDate = new Date();
		try{
			eventDate = DATE_FORMAT.parse(timestamp);
		}
		catch(Exception e){
			LOG.warn("fail to parse event date!");
		}
		setEventDate(eventDate.getTime());

		LOG.info("data: {}", toString());

		return 0;

	}

}


text:
using Mono.Cecil;

namespace Xamarin.Forms.Build.Tasks
{
	static class PropertyDefinitionExtensions
	{
		//		public static PropertyDefinition MakeGeneric (this PropertyDefinition self, GenericInstanceType declaringTypeReference)
		//		{
		//			if (declaringTypeReference == null)
		//				throw new ArgumentNullException ("declaringTypeReference");
		//			if (self == null)
		//				throw new ArgumentNullException ("self");
		//
		//			var propertyType = declaringTypeReference.GenericArguments[((GenericParameter)self.PropertyType).Position];
		//			self.PropertyType = propertyType;
		//			self.SetMethod = self.SetMethod.MakeGeneric (propertyType).Resolve ();
		//			self.GetMethod.ReturnType = propertyType;
		//
		//			return self;
		//		}

		public static TypeReference ResolveGenericPropertyType(this PropertyDefinition self,
			TypeReference declaringTypeReference)
		{
			if (self.PropertyType.IsGenericParameter)
			{
				return
					((GenericInstanceType)declaringTypeReference).GenericArguments[((GenericParameter)self.PropertyType).Position];
			}
			return self.PropertyType;
		}
	}
}


text:
import React from "react";
export interface LoadingProps {
    hidden: boolean
}
export default class Loading extends React.Component<LoadingProps, any> {
    render() {
        return

    }
}


text:
function log() {
    console.log('log');
}

exports.log = log;


text:
		<form data-ng-submit="signin()" class="signin form-horizontal" autocomplete="off">
			<fieldset>

					<input type="text" id="username" name="username" class="form-control username-signin" data-ng-model="credentials.username" placeholder="Username">

					<input type="password" id="password" name="password" class="form-control" data-ng-model="credentials.password" placeholder="Password">

					<button type="submit" class="signin-button btn btn-success ">Sign in</button>

					Sign up

					Forgot your password?

			</fieldset>
		</form>


text:
<?php

namespace Oro\Bundle\SecurityBundle\Configuration;

use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;

use Oro\Component\Config\Loader\CumulativeConfigLoader;
use Oro\Component\Config\Loader\YamlCumulativeFileLoader;
use Oro\Component\Config\Merger\ConfigurationMerger;

class PermissionConfigurationProvider
{
    const ROOT_NODE_NAME = 'oro_permissions';

    /** @var PermissionListConfiguration */
    protected $permissionConfiguration;

    /** @var array */
    protected $kernelBundles;

    /** @var string */
    protected $configPath = 'Resources/config/oro/permissions.yml';

    /**
     * @param PermissionListConfiguration $permissionConfiguration
     * @param array $kernelBundles
     */
    public function __construct(PermissionListConfiguration $permissionConfiguration, array $kernelBundles)
    {
        $this->permissionConfiguration = $permissionConfiguration;
        $this->kernelBundles = array_values($kernelBundles);
    }

    /**
     * @param array $acceptedPermissions
     * @return array
     */
    public function getPermissionConfiguration(array $acceptedPermissions = null)
    {
        $permissions = $this->parseConfiguration($this->loadConfiguration());

        if ($acceptedPermissions !== null) {
            foreach ($permissions as $permissionName => $permissionConfiguration) {
                // skip not used permissions
                if (!in_array($permissionName, $acceptedPermissions, true)) {
                    unset($permissions[$permissionName]);
                }
            }
        }

        return $permissions;
    }

    /**
     * @return array
     */
    protected function loadConfiguration()
    {
        $configLoader = new CumulativeConfigLoader('oro_security', new YamlCumulativeFileLoader($this->configPath));

        $resources = $configLoader->load();
        $configs = [];

        foreach ($resources as $resource) {
            if (array_key_exists(self::ROOT_NODE_NAME, $resource->data)) {
                $configs[$resource->bundleClass] = $resource->data;
            }
        }

        $merger = new ConfigurationMerger($this->kernelBundles);

        return $merger->mergeConfiguration($configs);
    }

    /**
     * @param array $configuration
     * @return array
     * @throws InvalidConfigurationException
     */
    protected function parseConfiguration(array $configuration)
    {
        try {
            $permissionsData = $this->permissionConfiguration->processConfiguration($configuration);
        } catch (InvalidConfigurationException $exception) {
            throw new InvalidConfigurationException(
                sprintf('Can\'t parse permission configuration. %s', $exception->getMessage())
            );
        }

        return $permissionsData;
    }
}


text:
//// [mergedInterfaceFromMultipleFiles1_0.ts]

interface I { foo(): string; }

interface C extends I {
	a(): number;
}

//// [mergedInterfaceFromMultipleFiles1_1.ts]
/// <reference path='mergedInterfaceFromMultipleFiles1_0.ts'/>

interface D { bar(): number; }

interface C extends D {
	b(): Date;
}

var c:C;
var a: string = c.foo();
var b: number = c.bar();
var d: number = c.a();
var e: Date = c.b();

//// [mergedInterfaceFromMultipleFiles1_0.js]
//// [mergedInterfaceFromMultipleFiles1_1.js]
var c;
var a = c.foo();
var b = c.bar();
var d = c.a();
var e = c.b();


text:
#ifndef CTTP_H
#define CTTP_H
#include <stdint.h>
bool handle_request();
void print_stats();
#endif


text:
/**
 * @author Cristiano Colangelo
 * The program shows the primitive data types of Java.
 */

public class Variables {
	public static void main(String[] args) {
		boolean booleanType = true;
		byte byteType = 16;
		char characterType = 'c';
		short shortType = 445;
		int integerType = 974220;
		long longType = 187964;
		float floatType = 4.5f;
		double doubleType = 32324.2342362301;

		System.out.println("Boolean: " + booleanType);
		System.out.println("Byte: " + byteType);
		System.out.println("Char: " + characterType);
		System.out.println("Short: " + shortType);
		System.out.println("Int: " + integerType);
		System.out.println("Long: " + longType);
		System.out.println("Float: " + floatType);
		System.out.println("Double: " + doubleType);
	}
}


text:
<?php

class AppConfig implements JsonSerializable
{
	private $id;
	private $setting_key;
	private $value;
	private $description;

	function __construct($id = null, $setting_key = null, $value = null, $description = null)
	{
		$this->id = $id;
		$this->setting_key = $setting_key;
		$this->value = $value;
		$this->description = $description;
	}

	public function setDescription($description)
	{
		$this->description = $description;
	}

	public function getDescription()
	{
		return $this->description;
	}

	public function setValue($value)
	{
		$this->value = $value;
	}

	public function getValue()
	{
		return $this->value;
	}

	public function setKey($setting_key)
	{
		$this->setting_key = $setting_key;
	}

	public function getKey()
	{
		return $this->setting_key;
	}

	public function setId($id)
	{
		$this->id = $id;
	}

	public function getId()
	{
		return $this->id;
	}

	public function jsonSerialize() {
        return [
        	'value' => $this->getValue(),
            'key' => $this->getKey(),
            'id' => $this->getId(),
            'description' => $this->getDescription()
        ];
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Boletín de la Soc. Ciencias de Córdoba 29(2-3): 166 (1926)

#### Original name
Phyllosticta bruchiana Speg.

### Remarks
null


text:
<?php

namespace Zephir\Statements;

use Zephir\CompilationContext;
use Zephir\CompilerException;
use Zephir\StatementsBlock;
use Zephir\Passes\LoopBreakPass;
use Zephir\Branch;

/**
 * LoopStatement
 *
 * Loop statement, infinite loop
 */
class LoopStatement extends StatementAbstract
{
    /**
     * @param CompilationContext $compilationContext
     * @throws CompilerException
     */
    public function compile(CompilationContext $compilationContext)
    {
        $compilationContext->codePrinter->output('while (1) {');

        /**
         * Variables are initialized in a different way inside cycle
         */
        $compilationContext->insideCycle++;

        /**
         * Compile statements in the 'loop' block
         */
        if (!isset($this->_statement['statements'])) {
            throw new CompilerException("Infinite loop without at least a 'break' statement is not allowed", $this->_statement);
        }

        $st = new StatementsBlock($this->_statement['statements']);

        /**
         * Check if the block contain at least a break statement
         */
        $loopBreakPass = new LoopBreakPass();
        $loopBreakPass->pass($st);
        if (!$loopBreakPass->hasBreak()) {
            throw new CompilerException("Infinite loop without at least a 'break' statement is not allowed", $this->_statement);
        }

        $st->isLoop(true);
        $st->compile($compilationContext, false, Branch::TYPE_LOOP_INFINITE);

        $compilationContext->insideCycle--;

        $compilationContext->codePrinter->output('}');
    }
}


text:
from __future__ import print_function, absolute_import, division
import sys
import inspect
import socket

import numpy as np
from sklearn.utils import check_random_state
from sklearn.grid_search import ParameterGrid
try:
    from hyperopt import (Trials, tpe, fmin, STATUS_OK, STATUS_RUNNING,
                          STATUS_FAIL)
except ImportError:
    # hyperopt is optional, but required for hyperopt_tpe()
    pass

try:
    from GPy import kern
    from GPy.kern import RBF, Fixed, Bias
    from GPy.util.linalg import tdot
    from GPy.models import GPRegression
    from scipy.optimize import minimize
except:
    # GPy is optional, but required for gp
    GPRegression = kern = minimize = None
    pass
from .search_space import EnumVariable

DEFAULT_TIMEOUT = socket._GLOBAL_DEFAULT_TIMEOUT

class BaseStrategy(object):
    short_name = None

    def suggest(self, history, searchspace):
        """
        Parameters
        ----------
        history : list of 3-tuples
            History of past function evaluations. Each element in history
            should be a tuple `(params, score, status)`, where `params` is a
            dict mapping parameter names to values
        searchspace : SearchSpace
            Instance of search_space.SearchSpace
        random_state :i nteger or numpy.RandomState, optional
            The random seed for sampling. If an integer is given, it fixes the
            seed. Defaults to the global numpy random number generator.

        Returns
        -------
        new_params : dict
        """
        raise NotImplementedError()

class RandomSearch(BaseStrategy):
    short_name = 'random'

    def __init__(self, seed=None):
        self.seed = seed

    def suggest(self, history, searchspace):
        """Randomly suggest params from searchspace.
        """
        return searchspace.rvs(self.seed)

class HyperoptTPE(BaseStrategy):
    short_name = 'hyperopt_tpe'

    def __init__(self, seed=None):
        self.seed = seed

    def suggest(self, history, searchspace):
        """
        Suggest params to maximize an objective function based on the
        function evaluation history using a tree of Parzen estimators (TPE),
        as implemented in the hyperopt package.

        Use of this function requires that hyperopt be installed.
        """
        # This function is very odd, because as far as I can tell there's
        # no real documented API for any of the internals of hyperopt. Its
        # execution model is that hyperopt calls your objective function
        # (instead of merely providing you with suggested points, and then
        # you calling the function yourself), and its very tricky (for me)
        # to use the internal hyperopt data structures to get these predictions
        # out directly.

        # so they path we take in this function is to construct a synthetic
        # hyperopt.Trials database which from the `history`, and then call
        # hyoperopt.fmin with a dummy objective function that logs the value
        # used, and then return that value to our client.

        # The form of the hyperopt.Trials database isn't really documented in
        # the code -- most of this comes from reverse engineering it, by
        # running fmin() on a simple function and then inspecting the form of
        # the resulting trials object.
        if 'hyperopt' not in sys.modules:
            raise ImportError('No module named hyperopt')

        random = check_random_state(self.seed)
        hp_searchspace = searchspace.to_hyperopt()

        trials = Trials()
        for i, (params, scores, status) in enumerate(history):
            if status == 'SUCCEEDED':
                # we're doing maximization, hyperopt.fmin() does minimization,
                # so we need to swap the sign
                result = {'loss': -np.mean(scores), 'status': STATUS_OK}
            elif status == 'PENDING':
                result = {'status': STATUS_RUNNING}
            elif status == 'FAILED':
                result = {'status': STATUS_FAIL}
            else:
                raise RuntimeError('unrecognized status: %s' % status)

            # the vals key in the trials dict is basically just the params
            # dict, but enum variables (hyperopt hp.choice() nodes) are
            # different, because the index of the parameter is specified
            # in vals, not the parameter itself.

            vals = {}
            for var in searchspace:
                if isinstance(var, EnumVariable):
                    # get the index in the choices of the parameter, and use
                    # that.
                    matches = [i for i, c in enumerate(var.choices)
                               if c == params[var.name]]
                    assert len(matches) == 1
                    vals[var.name] = matches
                else:
                    # the other big difference is that all of the param values
                    # are wrapped in length-1 lists.
                    vals[var.name] = [params[var.name]]

            trials.insert_trial_doc({
                'misc': {
                    'cmd': ('domain_attachment', 'FMinIter_Domain'),
                    'idxs': dict((k, [i]) for k in hp_searchspace.keys()),
                    'tid': i,
                    'vals': vals,
                    'workdir': None},
                'result': result,
                'tid': i,
                # bunch of fixed fields that hyperopt seems to require
                'owner': None, 'spec': None, 'state': 2, 'book_time': None,
                'exp_key': None, 'refresh_time': None, 'version': 0
                })

        trials.refresh()
        chosen_params_container = []

        def mock_fn(x):
            # http://stackoverflow.com/a/3190783/1079728
            # to get around no nonlocal keywork in python2
            chosen_params_container.append(x)
            return 0

        fmin(fn=mock_fn, algo=tpe.suggest, space=hp_searchspace, trials=trials,
             max_evals=len(trials.trials)+1,
             **self._hyperopt_fmin_random_kwarg(random))
        chosen_params = chosen_params_container[0]

        return chosen_params

    @staticmethod
    def _hyperopt_fmin_random_kwarg(random):
        if 'rstate' in inspect.getargspec(fmin).args:
            # 0.0.3-dev version uses this argument
            kwargs = {'rstate': random, 'allow_trials_fmin': False}
        elif 'rseed' in inspect.getargspec(fmin).args:
            # 0.0.2 version uses different argument
            kwargs = {'rseed': random.randint(2**32-1)}
        return kwargs

class GP(BaseStrategy):
    short_name = 'gp'

    def __init__(self, seeds=1, max_feval=5E4, max_iter=1E5):
        self.seeds = seeds
        self.max_feval = max_feval
        self.max_iter = max_iter
        self.model = None
        self.n_dims = None
        self.kernel = None
        self._kerns = None
        self._kernf = None
        self._kernb = None

    def _create_kernel(self, V):
        self._kerns = [RBF(1, ARD=True, active_dims=[i])
                       for i in range(self.n_dims)]
        self._kernf = Fixed(self.n_dims, tdot(V))
        self._kernb = Bias(self.n_dims)
        self.kernel = np.sum(self._kerns) + self._kernf + self._kernb

    def _fit_model(self, X, Y):
        model = GPRegression(X, Y, self.kernel)
        model.optimize(messages=False, max_f_eval=self.max_feval)
        self.model = model

    def _get_random_point(self):
        return np.array([np.random.uniform(low=0., high=1.)
                         for i in range(self.n_dims)])

    def _optimize(self, init=None):
        if not init:
            init = self._get_random_point()

        def z(x):
            y = x.copy().reshape(-1, self.n_dims)
            s, v = self.model.predict(y, kern=(np.sum(self._kerns).copy() +
                                               self._kernb.copy()))
            return -(s+v).flatten()

        return minimize(z, init, bounds=self.n_dims*[(0., 1.)],
                        options={'maxiter': self.max_iter, 'disp': 0}).x

    def _get_data(self, history, searchspace):
        X = []
        Y = []
        V = []
        ignore = []
        for param_dict, scores, status in history:
            # transform points into the GP domain. This invloves bringing
            # int and enum variables to floating point, etc.
            if status == 'FAILED':
                # not sure how to deal with these yet
                continue

            point = searchspace.point_to_gp(param_dict)
            if status == 'SUCCEEDED':
                X.append(point)
                Y.append(np.mean(scores))
                V.append(np.var(scores))

            elif status == 'PENDING':
                ignore.append(point)
            else:
                raise RuntimeError('unrecognized status: %s' % status)

        return (np.array(X).reshape(-1, self.n_dims),
                np.array(Y).reshape(-1, 1),
                np.array(V).reshape(-1, 1),
                np.array(ignore).reshape(-1, self.n_dims))

    def _from_gp(self, result, searchspace):

        # Note that GP only deals with float-valued variables, so we have
        # a transform step on either side, where int and enum valued variables
        # are transformed before calling gp, and then the result suggested by
        # GP needs to be reverse-transformed.
        out = {}
        for gpvalue, var in zip(result, searchspace):
            out[var.name] = var.point_from_gp(float(gpvalue))

        return out

    def _is_within(self, point, X, tol=1E-2):
        if True in (np.sqrt(((point - X)**2).sum(axis=0)) <= tol):
            return True
        return False

    def suggest(self, history, searchspace, max_tries=5):
        if not GPRegression:
            raise ImportError('No module named GPy')
        if not minimize:
            raise ImportError('No module named SciPy')

        if len(history) < self.seeds:
            return RandomSearch().suggest(history, searchspace)

        self.n_dims = searchspace.n_dims

        X, Y, V, ignore = self._get_data(history, searchspace)
        self._create_kernel(V)
        self._fit_model(X, Y)

        suggestion = self._optimize()

        if suggestion in ignore or self._is_within(suggestion, X):
            return RandomSearch().suggest(history, searchspace)

        return self._from_gp(suggestion, searchspace)

class GridSearch(BaseStrategy):
    short_name = 'grid'

    def __init__(self):
        self.param_grid = None
        self.current = -1

    def suggest(self, history, searchspace):
        # Convert searchspace to param_grid
        if self.param_grid is None:
            if not all(isinstance(v, EnumVariable) for v in searchspace):
                raise RuntimeError("GridSearchStrategy is defined only for all-enum search space")

            self.param_grid = ParameterGrid(dict((v.name, v.choices) for v in searchspace))

        # NOTE: there is no way of signaling end of parameters to be searched against
        # so user should pick correctly number of evaluations
        self.current += 1
        return self.param_grid[self.current % len(self.param_grid)]


text:
namespace tensorflow {

template <class Scalar, bool SupportsBatchOperationT>
class MatrixInverseOp
    : public LinearAlgebraOp<Scalar, SupportsBatchOperationT> {
 public:
  explicit MatrixInverseOp(OpKernelConstruction* context)
      : LinearAlgebraOp<Scalar, SupportsBatchOperationT>(context) {}
  ~MatrixInverseOp() override {}

  TensorShape GetOutputMatrixShape(
      const TensorShape& input_matrix_shape) override {
    return input_matrix_shape;
  }

  int64 GetCostPerUnit(const TensorShape& input_matrix_shape) override {
    const int64 rows = input_matrix_shape.dim_size(0);
    if (rows > (1LL << 20)) {
      // A big number to cap the cost in case overflow.
      return kint32max;
    } else {
      return rows * rows * rows;
    }
  }

  using typename LinearAlgebraOp<Scalar, SupportsBatchOperationT>::MatrixMap;
  using
      typename LinearAlgebraOp<Scalar, SupportsBatchOperationT>::ConstMatrixMap;

  void ComputeMatrix(OpKernelContext* context, const ConstMatrixMap& input,
                     MatrixMap* output) override {
    OP_REQUIRES(context, input.rows() == input.cols(),
                errors::InvalidArgument("Input matrix must be square."));
    if (input.rows() == 0) {
      // By definition, an empty matrix's inverse is an emptry matrix.
      return;
    }
    Eigen::FullPivLU<Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic,
                                   Eigen::RowMajor>> lu_decomposition(input);
    OP_REQUIRES(context, lu_decomposition.isInvertible(),
                errors::InvalidArgument("Input is not invertible."));
    *output = lu_decomposition.inverse();
  }
};

REGISTER_LINALG_OP("MatrixInverse", (MatrixInverseOp<float, false>), float);
REGISTER_LINALG_OP("MatrixInverse", (MatrixInverseOp<double, false>), double);
REGISTER_LINALG_OP("BatchMatrixInverse", (MatrixInverseOp<float, true>), float);
REGISTER_LINALG_OP("BatchMatrixInverse", (MatrixInverseOp<double, true>),
                   double);

}  // namespace tensorflow


text:
#include <round/server_internal.h>

#if defined(ROUND_ENABLE_FINDER)

/****************************************
 * round_server_nodeaddedlistener
 ****************************************/

void round_server_nodeaddedlistener(RoundFinder* finder, RoundNode* node)
{
  if (!finder || !node)
    return;

  RoundServer* server = round_finder_getuserdata(finder);
  if (!server)
    return;

  round_local_node_addclusternode(server->node, node);
}

/****************************************
 * round_server_noderemovedlistener
 ****************************************/

void round_server_noderemovedlistener(RoundFinder* finder, RoundNode* node)
{
  if (!finder || !node)
    return;

  RoundServer* server = round_finder_getuserdata(finder);
  if (!server)
    return;

  round_local_node_removeclusternode(server->node, node);
}

#endif


text:
class CreateEditorships < ActiveRecord::Migration[5.2]
  def change
    create_table :editorships do |t|
      t.references :case, foreign_key: true
      t.references :editor, foreign_key: { to_table: :readers }

      t.timestamps
    end
  end
end


text:
namespace DotNetXri.Client.Resolve {

using java.io.ByteArrayInputStream;
using java.io.InputStream;
using java.net.URI;

using junit.framework.Test;
using junit.framework.TestCase;
using junit.framework.TestSuite;
using junit.textui.TestRunner;

using org.openxri.XRI;
using org.openxri.resolve.exception.PartialResolutionException;
using org.openxri.resolve.exception.XRIResolutionException;
using org.openxri.xml.Ref;
using org.openxri.xml.XRD;
using org.openxri.xml.XRDS;

/*
********************************************************************************
* Class: IRITest
********************************************************************************
*/ /**
* This class simulates IRI Authority Resolution
* @author =chetan
*/
public class IRITest
    :TestCase
{
    /*
    ****************************************************************************
    * main()
    ****************************************************************************
    */ /**
    *
    */
    public static void main(string[] oArgs)
    {
        // Pass control to the non-graphical test runner
        TestRunner.run(suite());

    } // main()

    /*
    ****************************************************************************
    * suite()
    ****************************************************************************
    */ /**
    *
    */
    public static Test suite()
    {
        return new TestSuite(typeof(IRITest));

    } // suite()

    /*
    ****************************************************************************
    * Class: IRIResolver
    ****************************************************************************
    */ /**
    *
    */
    class IRIResolver
        :Resolver
    {

        protected InputStream getDataFromURI(URI oURI, string query, ResolverFlags flags, ResolverState state)
        //    throws XRIResolutionException
        {
            // the path better be empty
            if ((oURI.getPath() != null) && (oURI.getPath().Length > 0))
                return null;

            XRD oDesc = new XRD();
            XRI oExternal = new XRI("xri://@foo");
            oDesc.addRef(new Ref(oExternal.toString()));
            XRDS oDescs = new XRDS();
            oDescs.add(oDesc);

			state.pushResolved(oURI.toString(), flags.toString(), oDesc.toString(), oURI);

            return new ByteArrayInputStream(oDescs.toString().getBytes());

        }

    }

    public void testFakeIRI()
    {
        Resolver oResolver = new IRIResolver();
    	ResolverState state = new ResolverState();
        oResolver.setMaxHttpRedirects(0);
        try
        {
            XRD oDesc = oResolver.resolveAuthToXRD(
            		"xri://www.epok.net/!foo!bar", new TrustType(), true, state);
            assertTrue(
                "Failed to obtain XRD for IRI Authority",
                oDesc != null);
            assertTrue(
                "Failed to obtain correct XRD for IRI Authority",
                oDesc.getRefAt(0).getValue().Equals(
                    "xri://@foo"));
        }
        catch (Exception oEx)
        {
        	oEx.printStackTrace();
        	if (oEx is PartialResolutionException) {
        		System.err.println("Partial = " + ((PartialResolutionException)oEx).getPartialXRDS());
        	}
        	System.err.println("Resolver state = " + state);
            fail("Got exception while trying to resolve IRI " + oEx);
        }

        try
        {
            XRD oDesc = oResolver.resolveAuthToXRD(
            		"xri://www.epok.net/!foo!bar", new TrustType(TrustType.TRUST_SAML), true);
            assertTrue(
                "Failed to get exception for trusted IRI Authority resolution",
                false);
        }
        catch (XRIResolutionException oEx) {}
        catch (Exception oEx)
        {
            fail("Got wrong exception while trying to resolve IRI " + oEx);
        }

    } // testFakeIRI()

} // Class: IRITest
}


text:
/**
 * @fileOverview Defines the {@link CKEDITOR.dom} object, which contains DOM
 *		manipulation objects and function.
 */

/**
 * DOM manipulation objects and function.

 * @see CKEDITOR.dom.element
 * @see CKEDITOR.dom.node
 * @namespace
 * @example
 */
CKEDITOR.dom =
{};

// PACKAGER_RENAME( CKEDITOR.dom )


text:
[![Build Status](https://travis-ci.org/bfontaine/LazyScraper.png)](https://travis-ci.org/bfontaine/LazyScraper)
[![Coverage Status](https://coveralls.io/repos/bfontaine/LazyScraper/badge.png)](https://coveralls.io/r/bfontaine/LazyScraper)

LazyScraper is the easy way to define lazy entity-oriented Web scrapers.

Note: This is only a proof-of-concept.

## Usage

Let's say we want to fetch some reviews from FooBar website (which doesn't have
a public API). Reviews are located at `'/review?product_id=something'` (we'll
leave the domain part here).

We start by creating a class which inherit from `LazyScraper::Entity`:

```rb
class FooBarReview < LazyScraper::Entity
end
```

Then we'll add some hooks. A hook map a set of attributes to an URL with a
parser.  This is used to ensure that a webpage is fetched & parsed only once,
and only at the right time. Here, we'll assume that each review has a product id
we know, a product name, a score, and a text. They are all located on the
same page, but LazyScraper also support hooks on multiple URLs.

```rb
class FooBarReview < LazyScraper::Entity
  attr_hook '/review?product_id=:product_id',
    :product_name, :score, :text do |doc, attrs|

    attrs[:product_name] = doc.css('#product .name').text
    attrs[:score]        = doc.css('#score').text.to_i
    attrs[:text]         = doc.css('#text').text
  end
end
```

Here, `attr_hook` takes the path to the page, with a `:product_id` placeholder,
which will later be replaced by the actual `product_id` of a review. Then, we
gives it the list of attributes which depends on this webpage. This way, the
page will be fetched and parsed *only* the first time we access one of the
attributes. The last argument is a block which takes a Nokogiri document and a
hash we'll populate in it.

That's all, we can now try our class:

```rb
# note how we're given the product id
lazy_review = FooBarReview.new :product_id => 42

# we haven't fetched the page yet

lazy_review.text  # this fetches the page and return the text
lazy_review.score # this returns the score without fetching the page again
```

## Requirements

* Ruby 2.x


text:
/*
Arrays.asList("A", "B", "A", "C", "D", "B", "A");
String findWinner(List<String> votes)

Given a list of strings containing votes cast for a set of candidates, find the winning candidate.

The votes data structure consists of candidate names represented as strings (for simplicity, consider candidate names
to be case-sensitive. i.e. "A" and "a" would be two distinct candaidate names.).

P.S: how could ties be handled?

*/

package main

import (
	"log"
)

func main() {
	// log.Printf("%s\n", findWinner([]string{"A", "B", "A", "C", "D", "B", "A"}))

	tests := [][]string{{"A", "B", "A", "C", "D", "B", "A"}, {"A"}, {"A", "B"}, {"B", "A", "B"}}

	for _, test := range tests {
		log.Printf("findWinner(%s) = %s\n", test, findWinner(test))
	}
}

// findWinner accepts a slice of strings consisting cast votes, and returns the winning candidate name.
func findWinner(votes []string) string {
	// declare map mapping each candidate name to the number of votes they received
	candidateVotes := map[string]int{}

	// iterate through the votes slice and update candidate/vote map
	// keep track of the candidate with most votes (count and name)
	var winnerVotes int
	var winnerName string

	for _, candidate := range votes {
		candidateVotes[candidate]++

		if candidateVotes[candidate] > winnerVotes {
			winnerVotes = candidateVotes[candidate]
			winnerName = candidate
		}
	}

	return winnerName
}


text:
ActiveRecord::Schema.define(version: 20131230150149) do

  create_table "tickets", force: true do |t|
    t.datetime "created_at"
    t.datetime "updated_at"
    t.string   "description"
    t.string   "status"
    t.string   "priority"
    t.string   "category"
    t.string   "private"
    t.decimal  "lat",                            precision: 10, scale: 7
    t.decimal  "lon",                            precision: 10, scale: 7
    t.text     "image",       limit: 2147483647
    t.string   "address"
  end

end


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System.Collections.Immutable;
using System.Linq;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.FxCopAnalyzers.Utilities;

namespace Microsoft.CodeAnalysis.FxCopAnalyzers.Design
{
    [DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
    public sealed class CA1017DiagnosticAnalyzer : DiagnosticAnalyzer
    {
        internal const string RuleId = "CA1017";
        private static LocalizableString s_localizableTitle = new LocalizableResourceString(nameof(FxCopRulesResources.MarkAllAssembliesWithComVisible), FxCopRulesResources.ResourceManager, typeof(FxCopRulesResources));
        private static LocalizableString s_localizableDescription = new LocalizableResourceString(nameof(FxCopRulesResources.MarkAllAssembliesWithComVisibleDescription), FxCopRulesResources.ResourceManager, typeof(FxCopRulesResources));

        internal static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(RuleId,
                                                                                s_localizableTitle,
                                                                                "{0}",
                                                                                FxCopDiagnosticCategory.Design,
                                                                                DiagnosticSeverity.Warning,
                                                                                isEnabledByDefault: false,
                                                                                description: s_localizableDescription,
                                                                                helpLinkUri: "http://msdn.microsoft.com/library/ms182157.aspx",
                                                                                customTags: DiagnosticCustomTags.Microsoft);

        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
        {
            get
            {
                return ImmutableArray.Create(Rule);
            }
        }

        public override void Initialize(AnalysisContext analysisContext)
        {
            analysisContext.RegisterCompilationEndAction(AnalyzeCompilation);
        }

        private void AnalyzeCompilation(CompilationEndAnalysisContext context)
        {
            if (AssemblyHasPublicTypes(context.Compilation.Assembly))
            {
                var comVisibleAttributeSymbol = WellKnownTypes.ComVisibleAttribute(context.Compilation);
                if (comVisibleAttributeSymbol == null)
                {
                    return;
                }

                var attributeInstance = context.Compilation.Assembly.GetAttributes().FirstOrDefault(a => a.AttributeClass.Equals(comVisibleAttributeSymbol));

                if (attributeInstance != null)
                {
                    if (attributeInstance.ConstructorArguments.Length > 0 &&
                        attributeInstance.ConstructorArguments[0].Kind == TypedConstantKind.Primitive &&
                        attributeInstance.ConstructorArguments[0].Value != null &
                        attributeInstance.ConstructorArguments[0].Value.Equals(true))
                    {
                        // Has the attribute, with the value 'true'.
                        context.ReportDiagnostic(Diagnostic.Create(Rule, Location.None, string.Format(FxCopRulesResources.CA1017_AttributeTrue, context.Compilation.Assembly.Name)));
                    }
                }
                else
                {
                    // No ComVisible attribute at all.
                    context.ReportDiagnostic(Diagnostic.Create(Rule, Location.None, string.Format(FxCopRulesResources.CA1017_NoAttribute, context.Compilation.Assembly.Name)));
                }
            }

            return;
        }

        private static bool AssemblyHasPublicTypes(IAssemblySymbol assembly)
        {
            return assembly
                    .GlobalNamespace
                    .GetMembers()
                    .OfType<INamedTypeSymbol>()
                    .Where(s => s.DeclaredAccessibility == Accessibility.Public)
                    .Any();
        }
    }
}


text:
```
yo react-webpack-alt:action Todo
```

####Create actions
Add some actions in constructor of TodoActions:

```
  this.generateActions(
    'toggleAll',
    'toggle',
    'destroy',
    'save',
    'clearCompleted',
    'edit',
    'show'
  );
}
```


text:
body,h1 {font-family: "Raleway", sans-serif}
body, html {height: 100%}
.bgimg {
    background-image: url('../img/bg.jpg');
    min-height: 100%;
    background-position: center;
    background-size: cover;
}
form{
  vertical-align: center;
}
input[type=text]{
  background: transparent;
  border :none;
  color: white;
  text-align: center;
  outline-color: grey;
  margin-top: 4px;

}

select{
  background: transparent;
  border :white;
  color: white;
  text-align: center;
  outline-color: grey;
  border: 1px solid white;
  padding: 1px;
}
select option {
    background: #6b717a;
}
.button {
    background-color: #4CAF50; /* Green */
    border: none;

    padding: 1px 13px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 12px;
    margin: 4px 2px;
    cursor: pointer;
}
label{
  color: grey;
}

img{
  border: 2px solid white;
  border-radius: 20px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);

}
.controls{
  background-color: black;
}
.button1 {
    background: transparent;
    color: white;
    border: 1px solid white;
    outline-color: grey;
    margin-top: 4px;

}


text:
.audio-container {
}

.audio-container audio {
    display: none;
}

.audio-container .audio-progress {
}

.audio-container .audio-time {
}


text:
package br.org.arquitetura.model.business.facade;

import java.io.Serializable;
import java.util.List;

import br.org.arquitetura.excecao.EntidadeJaExisteExcecao;
import br.org.arquitetura.excecao.EntidadeNaoEncontradaExcecao;

/**
 * Interface de uma fachada para a camada negocial de um módulo. A fachada é o
 * ponto de entrada para a camada negocial do módulo. Normalmente utilizada por
 * Controladores ou pela API.
 *
 * @param <D>
 *            tipo do DTO.
 * @param <P>
 *            tipo da chave primária da Entidade representada pelo DTO.
 *
 * @see br.org.arquitetura.model.business.IBusiness
 */
public interface IBusinessFacade<D, P extends Serializable> extends Serializable {

    D adicionar(D dto) throws EntidadeJaExisteExcecao, EntidadeNaoEncontradaExcecao;

    List<D> listar();

    void remover(D dto) throws EntidadeNaoEncontradaExcecao;

    void remover(P chavePrimaria) throws EntidadeNaoEncontradaExcecao;

    D atualizar(D dto) throws EntidadeNaoEncontradaExcecao, EntidadeJaExisteExcecao;

    D recuperar(P chavePrimaria) throws EntidadeNaoEncontradaExcecao;

}


text:
/*
	A JavaScript file to fetch and display articles for use on the admin panel
*/

/*
    The PHP should output the user and password, if they are contained within the session data. This way, the javascript can use the data to login to the server
    and perform operations on the database.
*/

var from = 1;
var page = 1;
var number = 10;
var strData;
var xhttp;
var results;

//jQuery Section

$(".pageUp").click(function() {
    page++;
});

$(".pageDown").click(function() {
    page--;
});

$('.error-close').click(function() {
    $('.error').slideUp();
});

//Standard functions

var changeArticle = function(mode, ID, newValue) {
switch(mode) {
    case "makeNSFW":
        changeNSFWState(ID, 1, user, pass);
        break;
    case "makeSFW":
        changeNSFWState(ID, 0, user, pass);
        break;
    case "disableArticle":
        disableArticle(ID, user, pass);
        break;
    case "enableArticle":
        enableArticle(ID, user, pass);
        break;
}

var displayArticles = function(mode, from, number) {
    //Mode = either "allowed" or "denied"
    //From = number of article to start from
    //Number = number of articles to fetch, INCLUDING from.
    xhttp = new XMLHttpRequest();
    from = (page * 10) - 9;
    if (mode === "allowed") {
        strData = "mode=allowed&from=" + from + "&number=" + number;
    } else {
        strData = "mode=denied&from=" + from + "&number=" + number;
    }
    xhttp.open("GET", "/assets/php/admin.php", false);
    xhttp.send(strData);
    displayAdminTable(JSON.parse(xhttp.responseText));
}

var displayAdminTable = function(table) {

}

var displayError = function(error) {
    //Displays error specified, using .error object
    $('.error-text').text(error);
    $('.error').slideDown();
}

var renameArticle = function(ID, newTitle, user, pass) {
    if (ID !== null) {
        strData = "ID=" + ID + "&newTitle=" + newTitle + "&user=" + user + "&pass=" + pass;
        xhttp = new XMLHttpRequest();
        xhttp.open("POST", "/assets/php/admin.php?mode=renameArticle");
        xhttp.send(strData);
        results = JSON.parse(xhttp.responseText);
        if (results.state === true) {
            displayArticles("allowed", from, number);
        } else {
            displayError(results.error);
        }
    }
}

var changeNSFWState = function(ID, newState, user, pass) {
    if (ID !== null) {
        strData = "ID=" + ID + "&newState=" + newState + "&user=" + user + "&pass=" + pass;
        xhttp = new XMLHttpRequest();
        xhttp.open("POST", "/assets/php/admin.php?mode=changeNSFWState");
        xhttp.send(strData);
        results = JSON.parse(xhttp.responseText);
        if (results.state === true) {
            displayArticles("allowed", from, number);
        } else {
            displayError(results.error);
        }
    }
}

var onPageLoad = function() {
    if (user !== null and pass !== null) {
        displayArticles("allowed", from, number);
    } else {
        displayError("Could not login. No login details were passed.");
    }
}
var disableArticle = function(ID, user, pass) {
    if (ID !== null) {
        strData = "ID=" + ID + "&user=" + user + "&pass=" + pass; //Will be passed using POST, not GET
        xhttp = new XMLHttpRequest();
        xhttp.open("POST", "/assets/php/admin.php?mode=disableArticle");
        xhttp.send(strData);
        results = JSON.parse(xhttp.responseText);
        if (results.state === true) {
            displayArticles("allowed", from, number);
        } else {
            displayError(results.error);
        }
    }
}


text:
<?php
use PHPUnit\Framework\TestCase;
use Karolina\Experiment\Experiment;

class TopicTest extends TestCase
{

    public function testGetShortDescription ()
    {

    	$topic = new Karolina\Discussion\Topic();

//        $this->assertEquals($shortDescription, $experiment->getShortDescription());

    }

}


text:
package com.lixia.rdp;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class LicenceStore {

	static Logger logger = LoggerFactory.getLogger(LicenceStore.class);
	protected Options options;

	public LicenceStore(Options options) {
		this.options = options;
	}

	/**
	 * Load a licence from a file
	 *
	 * @return Licence data stored in file
	 */
	public byte[] load_licence() {
		String path = options.getLicence_path() + "/licence." + options.getHostname();
		byte[] data = null;
		FileInputStream fd = null;
		try {
			fd = new FileInputStream(path);
			data = new byte[fd.available()];
			fd.read(data);
		} catch (FileNotFoundException e) {
			logger.warn("Licence file not found!");
		} catch (IOException e) {
			logger.warn("IOException in load_licence");
		} finally {
			if (fd != null) {
				try {
					fd.close();
				} catch (IOException e) {
					logger.error("close license stream failed.", e);
				}
			}
		}
		return data;
	}

	/**
	 * Save a licence to file
	 *
	 * @param databytes
	 *            Licence data to store
	 */
	public void save_licence(byte[] databytes) {
		/* set and create the directory -- if it doesn't exist. */
		// String home = "/root";
		String dirpath = options.getLicence_path();// home+"/.rdesktop";
		String filepath = dirpath + "/licence." + options.getHostname();

		File file = new File(dirpath);
		file.mkdir();
		try {
			FileOutputStream fd = new FileOutputStream(filepath);

			/* write to the licence file */
			fd.write(databytes);
			fd.close();
			logger.info("Stored licence at " + filepath);
		} catch (FileNotFoundException e) {
			logger.warn("save_licence: file path not valid!");
		} catch (IOException e) {
			logger.warn("IOException in save_licence");
		}
	}

}


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

<lookupTable oid="70000000-0000-0000-1111-000000000021"
   xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
   xmlns='http://midpoint.evolveum.com/xml/ns/public/common/common-3'
   xmlns:c='http://midpoint.evolveum.com/xml/ns/public/common/common-3'
   xmlns:t='http://prism.evolveum.com/xml/ns/public/types-3'
   xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
   xmlns:piracy='http://midpoint.evolveum.com/xml/ns/samples/piracy'>

    <name>Role Types</name>

    <row>
        <key>application</key>
        Application role
    </row>
    <row>
        <key>system</key>
        System role
    </row>
    <row>
        <key>it</key>
        IT role
    </row>

</lookupTable>


text:
'use strict';

var path = require('path');
var gulp = require('gulp');
var conf = require('./conf');

var browserSync = require('browser-sync');

var $ = require('gulp-load-plugins')();

gulp.task('scripts-reload', function() {
  return buildScripts()
    .pipe(browserSync.stream());
});

gulp.task('scripts', function() {
  return buildScripts();
});

function buildScripts() {
  return gulp.src(path.join(conf.paths.src, '/app/**/*.js'))
    .pipe($.eslint())
    .pipe($.eslint.format())
    .pipe($.sourcemaps.init())
    .pipe($.sourcemaps.write())
    .pipe(gulp.dest(path.join(conf.paths.tmp, '/serve/app')))
    .pipe($.size())
};


text:
JSCompiler2 is a tool for [Brackets](https://github.com/adobe/brackets) that allows you to compress and mangle your JavaScript code into one minified file, powered by [UglifyJS2](https://github.com/mishoo/UglifyJS2)

## Features

- Doesn't require previous configurations for quick first use.
- Customize advanced compilation options.
- Compile multiple javascripts into one output.
- Generate multiple outputs at once.
- Works even offline.

## Usage

Simply press the "Compress JavaScript" button on the sidebar, or go to `File > Compress JavaScript`, and your code will be compressed into a `{filename}.min.js` file.

Optionally, you can toggle "Compress JavaScript on Save" by going to `File > Compress JavaScript on Save`, and your code will be compressed automatically. This options is off by default.

### The custom options file

You can go to `File > Compress JavaScript: Options` to open your custom options. If you have no custom options yet, you will be asked to choose one of this types of custom options:

- **Project**: Bracket's default. This will add your options to the default `.brackets.json` file along with all the other options shared inside your current project. Your options will be inside an object with the indentifier `jscompiler`.

- **Portable**: This will add your options to a `.jscompiler.json` file inside the current directory, which can be compatible with other compilers that use the same standard, and allows you to create multiple compilable projects inside your main project. On contrast, the current open file on your editor must be inside the same directory of the options file at the moment of compiling, or it will be ignored.

When the compilation starts, JSCompiler will give priority to any `.jscompiler.json` in the current folder, as this option will allow you to have custom sub-projects inside your main project. Then, it will search for any global options in the current project inside `.brackets.json`. If no option is found anywhere, it will attempt to compile then the current file, if it is a Javascript file.

### Custom options

In your options file, you can customize next values:

- **Inputs**: An array of javascript files to be compressed into the minified file.
- **Output**: The name of the resulting minified file.
- **GenerateMap**: A boolean value. If this is false, the source map for the code won't be generated.
- **Mangle**: A boolean value. If this is false, the code won't be mangled.
- **Isolate**: A boolean value. If this is true, the resulting code will be isolated so it won't affect or be affected by other scripts.
- **Precompile**: A boolean value. If this is true, the resulting code will be precompiled before it is parsed. This option is hidden by default, and should be used only if your code really requires it, as the resulting source map won't be able to point to the original source files.

If the isolate option is true, the resulting code will be wrapped with the next code:

```javascript
(function(window, undefined){
   // Your compiled code
}(window));
```

You can create multiple outputs by adding more JSON objects to the main **outputs** array.

Also, you can customize the default template for new projects at `File > Compress JavaScript: Options template`. Careful! This is only for advanced users. Updates will restore the template to prevent unexpected crashes.

## Special thanks

To Steffen Bruchmann and Peter Flynn, who helped me a lot on my first steps with brackets extension development.

Also to miladd3, elegos, mrmckeb, kevinmerckx and bbak for their support and ideas through GitHub.

To mrmckeb for the new compiler icon.

And to randdusing and henrylavoo for the auto-compile on save feature.


text:
/* jshint node: true */
'use strict';

module.exports = {
  name: 'ui-multiselect'
};


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>test Class Hierarchy (aalto-xml 1.3.0 API)</title>
<meta name="date" content="2021-05-11">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package test

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

test.BasePerfTest

test.TestLineReader

test.TestNameTable

test.TestRawStream

test.TestUTF8

test.RunStreamWriter

test.TestAsyncReader (implements javax.xml.stream.XMLStreamConstants)

test.TestBase64Reader (implements javax.xml.stream.XMLStreamConstants)

test.TestEventReader

test.TestNameHashing

test.TestPNamePerf

test.TestSaxReader

test.TestScannerPerf

test.TestStreamCopier

test.TestStreamReader (implements javax.xml.stream.XMLStreamConstants)

test.TestTypedSpeed (implements javax.xml.stream.XMLStreamConstants)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2021 FasterXML. All rights reserved.


text:
package com.kakao;

import com.kakao.http.HttpResponseHandler;

import java.util.Map;

/**
 * {@link UserManagement} API중 UserProfile을 결과로 받는 요청에 대한 응답 handler로 공통된 부분과 default 동작이 구현되어 있다.
 * 이 클래스를 상속 받아 아래 세 method를 구현한 callback을 각 API 요청시 param으로 넘겨주면 된다.
 * <p/>
 * {@link UserProfileResponseCallback#onSuccessUserProfile(UserProfile user)}
 * {@link com.kakao.http.HttpResponseHandler#onHttpSessionClosedFailure(APIErrorResult)},
 * {@link com.kakao.http.HttpResponseHandler#onHttpFailure(APIErrorResult)},
 *
 * @author MJ
 */

public abstract class UserProfileResponseCallback extends HttpResponseHandler<Map> {

    /**
     * 요청이 성공한 경우로 결과객체를 UserProfile객체로 만들어서 {@link #onSuccessUserProfile(UserProfile)}을 호출한다.
     * @param userMap 요청결과
     */
    @Override
    protected void onHttpSuccess(final Map userMap) {
        final UserProfile userProfile = UserProfile.createFromResponse(userMap);

        onSuccessUserProfile(userProfile);
    }

    /**
     * User API 요청이 성공한 경우, 성공 결과를 {@link UserProfile} type으로 받아서 결과 처리를 한다.
     * @param userProfile User API의 성공 결과로 요청 유저의 정보
     */
    protected abstract void onSuccessUserProfile(final UserProfile userProfile);

}


text:
import 'babel-polyfill';
import { describe } from 'mocha';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import dirtyChai from 'dirty-chai';
import jsdoc from './parser/jsdoc';

chai.use(chaiAsPromised);
chai.use(dirtyChai);

chai.should();

describe('rest-jsdoc', () => {
  describe('parser', () => {
    describe('jsdoc', jsdoc);
  });

  describe('formatter', () => {

  });
});


text:
package com.microsoft.azure.management.network.v2019_09_01;

import com.microsoft.azure.arm.collection.SupportsCreating;
import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup;
import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion;
import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup;
import rx.Observable;
import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup;
import com.microsoft.azure.arm.collection.SupportsListing;
import com.microsoft.azure.management.network.v2019_09_01.implementation.WebApplicationFirewallPoliciesInner;
import com.microsoft.azure.arm.model.HasInner;

/**
 * Type representing WebApplicationFirewallPolicies.
 */
public interface WebApplicationFirewallPolicies extends SupportsCreating<WebApplicationFirewallPolicy.DefinitionStages.Blank>, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup<WebApplicationFirewallPolicy>, SupportsListingByResourceGroup<WebApplicationFirewallPolicy>, SupportsListing<WebApplicationFirewallPolicy>, HasInner<WebApplicationFirewallPoliciesInner> {
}


text:
@interface InstapaperViewController : UIViewController <ReadLaterDelegate>

@property (strong) ReadLaterKit *readLaterKit;
@property (weak, nonatomic) IBOutlet UITextField *url;
@property (weak, nonatomic) IBOutlet UITextField *password;
@property (weak, nonatomic) IBOutlet UITextField *username;
@property (weak, nonatomic) IBOutlet UIButton *getTokenBtn;
@property (weak, nonatomic) IBOutlet UIButton *saveURLBtn;

- (IBAction)saveURLBtnTapped:(id)sender;
- (IBAction)getTokenBtnTapped:(id)sender;

@end


text:
**OMG A SPECIAL NOTE!** While I am using this in a couple places in my own projects, I wouldn't recommend just tossing it into yours just yet. I'm open-sourcing it now mainly to get some thoughts from everyone on where to take it. It's still very custom to my own needs.

`JMLayerStyles` is a set of tools built around a small little UIView subclass that supports being styled by invoking methods whose parameters are quite similar to those found on Photoshop's "Layer Styles" panel.

The end result looks like this:

``` objc

JMStylableView *styledView = [[JMStylableView alloc] initWithFrame:CGRectMake(10.0, 30.0, self.window.bounds.size.width - 20.0, self.window.bounds.size.height - 40.0)];

[styledView addLayerStyle:[DropShadowLayerStyle dropShadowStyleWithColor:[UIColor colorWithWhite:0.0 alpha:0.56]
                                                          distance:4.0
                                                              size:4.5]];

[styledView addLayerStyle:[InnerShadowLayerStyle innerShadowStyleWithColor:[UIColor colorWithRed:71.0/255.0 green:159.0/255.0 blue:243.0/255.0 alpha:1.0]
                                                             opacity:1.0
                                                            distance:1.0
                                                               choke:0.0
                                                                size:0.0]];

[styledView addLayerStyle:[StrokeLayerStyle strokeStyleWithColor:[UIColor colorWithRed:3.0/255.0 green:25.0/255.0 blue:47.0/255.0 alpha:1.0]
                                                   opacity:1.0
                                                      size:1.0]];

NSArray *colors = [NSArray arrayWithObjects:[UIColor colorWithRed:19.0/255.0 green:148.0/255.0 blue:213.0/255.0 alpha:1.0], [UIColor colorWithRed:10.0/255.0 green:71.0/255.0 blue:131.0/255.0 alpha:1.0], nil];
[styledView addLayerStyle:[GradientOverlayLayerStyle gradientStyleWithColors:colors style:GradientOverlayStyleLinear]];

styledView.cornerRadius = 10.0;

[self.window addSubview:styledView];

[styledView release];

```


text:
'use strict';

// Reports controller
angular.module('reports').controller('ReportsController', ['$scope', '$stateParams', '$location', 'Authentication', 'Reports',
	function($scope, $stateParams, $location, Authentication, Reports) {
		$scope.authentication = Authentication;

		// Create new Report
		$scope.create = function() {
			// Create new Report object
			var report = new Reports ({
				name: this.name
			});

			// Redirect after save
			report.$save(function(response) {
				$location.path('reports/' + response._id);

				// Clear form fields
				$scope.name = '';
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Remove existing Report
		$scope.remove = function(report) {
			if ( report ) {
				report.$remove();

				for (var i in $scope.reports) {
					if ($scope.reports [i] === report) {
						$scope.reports.splice(i, 1);
					}
				}
			} else {
				$scope.report.$remove(function() {
					$location.path('reports');
				});
			}
		};

		// Update existing Report
		$scope.update = function() {
			var report = $scope.report;

			report.$update(function() {
				$location.path('reports/' + report._id);
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

		// Find a list of Reports
		$scope.find = function() {
			$scope.reports = Reports.query();
		};

		// Find existing Report
		$scope.findOne = function() {
			$scope.report = Reports.get({
				reportId: $stateParams.reportId
			});
		};
	}
]);


text:
<resources>
    <string name="app_name">AndroidTestUsingMockito</string>
</resources>


text:
namespace Knowledge.Prospector.Templates.Handlers.CreateEntity
{
	public abstract class CreateEntityHandler : BaseHandler
	{

	}
}


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

package org.chromium.net;

import static junit.framework.Assert.assertEquals;

import android.os.ConditionVariable;

import java.util.concurrent.Executor;

class TestNetworkQualityThroughputListener extends NetworkQualityThroughputListener {
    // Lock to ensure that observation counts can be updated and read by different threads.
    private final Object mLock = new Object();

    // Signals when the first throughput observation is received.
    private final ConditionVariable mWaitForThroughput = new ConditionVariable();

    private int mThroughputObservationCount;
    private Thread mExecutorThread;

    /*
     * Constructs a NetworkQualityThroughputListener that can listen to the throughput observations.
     * @param executor The executor on which the observations are reported.
     */
    TestNetworkQualityThroughputListener(Executor executor) {
        super(executor);
    }

    @Override
    public void onThroughputObservation(int throughputKbps, long when, int source) {
        synchronized (mLock) {
            mWaitForThroughput.open();
            mThroughputObservationCount++;
            if (mExecutorThread == null) {
                mExecutorThread = Thread.currentThread();
            }
            // Verify that the listener is always notified on the same thread.
            assertEquals(mExecutorThread, Thread.currentThread());
        }
    }

    /*
     * Blocks until the first throughput observation is received.
     */
    public void waitUntilFirstThroughputObservationReceived() {
        mWaitForThroughput.block();
    }

    public int throughputObservationCount() {
        synchronized (mLock) {
            return mThroughputObservationCount;
        }
    }

    public Thread getThread() {
        synchronized (mLock) {
            return mExecutorThread;
        }
    }
}


text:
<?php

namespace TetoCLI;

class TestCLIApp extends \TetoCLI\CLI
{
    public function normal_cmd()
    {
        return 'success!';
    }

    /**
     * @throws \OutOfRangeException
     */
    public function get_raise_outofrange()
    {
        return $this->not_exists;
    }

    /**
     * @throws \OutOfRangeException
     */
    public function set_raise_outofrange()
    {
        $this->not_exists = 'value';
    }

    private function private_cmd_is_invisible()
    {
        return "Don't returns!";
    }
}

class CLITest extends \TetoCLI\TestCase
{
    public function test_normal_cmd()
    {
        $expected = 'success!';
        $arg = ['testappcmd', 'normal_cmd'];
        $cli = new TestCLIApp($arg);

        $actual = $cli->__invoke();
        $this->assertSame($expected, $actual);
    }

    public function test_get_raise_OutOuRangeException()
    {
        $arg = ['testappcmd', 'get_raise_outofrange'];
        $cli = new TestCLIApp($arg);

        $this->setExpectedException('OutOfRangeException');
        $cli->__invoke();
    }

    public function test_set_raise_OutOuRangeException()
    {
        $arg = ['testappcmd', 'set_raise_outofrange'];
        $cli = new TestCLIApp($arg);

        $this->setExpectedException('OutOfRangeException');
        $cli->__invoke();
    }

    public function test_privateMethod_raise_RuntimeException()
    {
        $arg = ['testappcmd', 'private_cmd_is_invisible'];
        $cli = new TestCLIApp($arg);

        $this->setExpectedException('RuntimeException');
        $cli->__invoke();
    }

    public function test_protectedMethod_raise_RuntimeException()
    {
        $arg = ['testappcmd', 'protected_cmd_is_invisible'];
        $cli = new TestCLIApp($arg);

        $this->setExpectedException('RuntimeException');
        $cli->__invoke();
    }
}


text:
package org.apache.shardingsphere.sharding.rewrite.token.generator.impl;

import lombok.Setter;
import org.apache.shardingsphere.underlying.rewrite.sql.token.generator.aware.RouteContextAware;
import org.apache.shardingsphere.sharding.rewrite.token.pojo.ShardingInsertValue;
import org.apache.shardingsphere.sharding.rewrite.token.pojo.ShardingInsertValuesToken;
import org.apache.shardingsphere.sql.parser.binder.segment.insert.values.InsertValueContext;
import org.apache.shardingsphere.sql.parser.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.sql.parser.binder.statement.dml.InsertStatementContext;
import org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.InsertValuesSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.dml.expr.ExpressionSegment;
import org.apache.shardingsphere.underlying.common.rule.DataNode;
import org.apache.shardingsphere.underlying.rewrite.sql.token.generator.OptionalSQLTokenGenerator;
import org.apache.shardingsphere.underlying.rewrite.sql.token.pojo.generic.InsertValuesToken;
import org.apache.shardingsphere.underlying.route.context.RouteContext;

import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

/**
 * Insert values token generator for sharding.
 */
@Setter
public final class ShardingInsertValuesTokenGenerator implements OptionalSQLTokenGenerator<InsertStatementContext>, RouteContextAware {

    private RouteContext routeContext;

    @Override
    public boolean isGenerateSQLToken(final SQLStatementContext sqlStatementContext) {
        return sqlStatementContext instanceof InsertStatementContext && !(((InsertStatementContext) sqlStatementContext).getSqlStatement()).getValues().isEmpty();
    }

    @Override
    public InsertValuesToken generateSQLToken(final InsertStatementContext insertStatementContext) {
        Collection<InsertValuesSegment> insertValuesSegments = (insertStatementContext.getSqlStatement()).getValues();
        InsertValuesToken result = new ShardingInsertValuesToken(getStartIndex(insertValuesSegments), getStopIndex(insertValuesSegments));
        Iterator<Collection<DataNode>> originalDataNodesIterator = null == routeContext || routeContext.getRouteResult().getOriginalDataNodes().isEmpty()
                ? null : routeContext.getRouteResult().getOriginalDataNodes().iterator();
        for (InsertValueContext each : insertStatementContext.getInsertValueContexts()) {
            List<ExpressionSegment> expressionSegments = each.getValueExpressions();
            Collection<DataNode> dataNodes = null == originalDataNodesIterator ? Collections.emptyList() : originalDataNodesIterator.next();
            result.getInsertValues().add(new ShardingInsertValue(expressionSegments, dataNodes));
        }
        return result;
    }

    private int getStartIndex(final Collection<InsertValuesSegment> segments) {
        int result = segments.iterator().next().getStartIndex();
        for (InsertValuesSegment each : segments) {
            result = result > each.getStartIndex() ? each.getStartIndex() : result;
        }
        return result;
    }

    private int getStopIndex(final Collection<InsertValuesSegment> segments) {
        int result = segments.iterator().next().getStopIndex();
        for (InsertValuesSegment each : segments) {
            result = result < each.getStopIndex() ? each.getStopIndex() : result;
        }
        return result;
    }
}


text:
module.exports = {
  custom: 'custom'
}


text:
<?php defined('BASEPATH') OR exit('No direct script access allowed');?>

<?php $this->load->view('_blocks/header'); ?>

Edit group

      <?php echo form_open('',array('class'=>'form-horizontal'));?>

          <?php echo form_label('Group name','group_name');?>
          <?php echo form_error('group_name');?>
          <?php echo form_input('group_name',set_value('group_name',$group->name),'class="form-control"');?>

          <?php echo form_label('Group description','group_description');?>
          <?php echo form_error('group_description');?>
          <?php echo form_input('group_description',set_value('group_description',$group->description),'class="form-control"');?>

        <?php echo form_hidden('group_id',set_value('group_id',$group->id));?>
        <?php echo form_submit('submit', 'Edit group', 'class="btn btn-primary btn-lg btn-block"');?>
      <?php echo form_close();?>

<?php $this->load->view('_blocks/footer'); ?>


text:
from __future__ import unicode_literals

from cStringIO import StringIO

from django.core.management.base import CommandError
from django.test import TestCase

from jenkins.management.helpers import import_jenkinsserver
from jenkins.models import JenkinsServer
from jenkins.tests.factories import JenkinsServerFactory

class ImportJenkinsServerTest(TestCase):

    def test_import_jenkinsserver(self):
        """
        We can import a new keypair with a name.
        """
        stdout = StringIO()
        import_jenkinsserver(
            "server1", "http://example.com/", "admin", "testing",
            stdout=stdout)

        server = JenkinsServer.objects.get(name="server1")
        self.assertEqual("http://example.com/", server.url)
        self.assertEqual("admin", server.username)
        self.assertEqual("testing", server.password)

        self.assertEqual("Server created\n", stdout.getvalue())

    def test_import_jenkinsserver_fails_with_preexisting_name(self):
        """
        import_jenkinsserver should fail if we have a server with that name.
        """
        server = JenkinsServerFactory.create(
            name="testing", url="http://example.com/")
        with self.assertRaises(CommandError) as cm:
            import_jenkinsserver(
                "testing", "http://example.com/2", "admin",
                "password")

        self.assertEqual("Server already exists", str(cm.exception))

        server = JenkinsServer.objects.get(name=server.name)
        self.assertEqual("http://example.com/", server.url)
        self.assertEqual("root", server.username)
        self.assertEqual("testing", server.password)

    def test_import_jenkinsserver_updates_existing_server(self):
        """
        import_jenkinsserver should update update the details if we supply the
        update parameter.
        """
        stdout = StringIO()
        server = JenkinsServerFactory.create()
        import_jenkinsserver(
            server.name, "http://www1.example.com/", "admin", "secret",
            update=True, stdout=stdout)

        server = JenkinsServer.objects.get(name=server.name)
        self.assertEqual("http://www1.example.com/", server.url)
        self.assertEqual("admin", server.username)
        self.assertEqual("secret", server.password)
        self.assertEqual("Server updated\n", stdout.getvalue())