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

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>LSH Classes and Functions</title>
	<meta name="generator" content="TextMate http://macromates.com/">
	<meta name="author" content="Malcolm Slaney">

LSH Classes

This package includes a Python implementation of locality-sensitive hashing (LSH).  The code is reasonably
efficient for high-dimensional data because most of the computational cost
is in working with the numerical data, and
these (vector) routines are natively implemented with BLAS.
This Python code also provides a convenient test bed, and
was used to produce the figures in the article.

This LSH code is implemented with two classes (index and lsh) and one test class (TestDataClass).  These classes are used to implement the LSH algorithm described in this article:
	Malcolm Slaney, Yury Lifshits, Junfeng He, "Optimal
	Locality-Sensitive Hashing," Submitted to Proceedings of the
	IEEE, Special Issue on Web-Scale Multimedia, Summer 2012.

This document describes three classes: index, lsh (internal use only),
TestDataClass.  It also describes a simple
command-line interface useful for
testing the LSH code.

Class: index

This is the primary class used to implement an LSH index.  The index class accepts data, computes the projections, stores a pointer to the data in the tables, and answers nearest-neighbor queries.  The index class uses L copies of the lsh class to implement the projections.  This class just bundles the individual lsh classes together so one call hits all L lsh objects.

To use this class, create an index object and initialize it with the desired LSH index parameters.  Then send data to the object with AddToIndex().  Finally, call Find() or FindMP() to retrieve the nearest neighbors.

Note: All data passed to the LSH class must be a NumPy Dx1 array. (Transposed data doesn't work.)

index(w, k, l)

Create and return an index object.  The index has three parameters.

w - The bucket width for the quantization.  (Use float('inf') for a binary LSH.)

k - The number of projects per table.

l - The number of k-dimensional tables for this LSH index.

sizeof()

Returns the size of this index in bytes (only works for Python versions > 2.6)

InsertIntoTable(id, data)

	Insert some data into the index (all L k-dimensional projections.)  Returns nothing.

id - object that identifies this data.  The id can be any Python object.  It is best if the id is an integer, but if another object is used, then this routine silently changes the id to an integer for internal use.

 data - The data to index.  The data must be an NumPy Dx1 array.

Find(data)

	Find some data in all the LSH buckets. Return a list of matches, each match is a two-element tuple with the data's ID and the number of buckets that this item was found (a rough proxy for distance.)
	data's id and bucket counts.

 data - The data to index.  The data must be an NumPy Dx1 array.

FindMP(data, radius)

	Find some data in all the LSH buckets using multiprobe. Return a list of matches, each match is a two-element tuple with the data's ID and the number of buckets that this item was found (a rough proxy for distance.)

 data - The data to index.  The data must be an NumPy Dx1 array.

radius - multiprobe radius.  Multiprobe looks in adjacent bins to find possible matches.
		The radius specifies the number of coordinates to modify, or the Hamming radius.  A radius of 0 is without multiprobe.  A radius of 1 means only one coordinate (projection id) is changed.  A radius of 2 means up to two coordinates are changed.

FindExact(data, GetDataFunction)

	Find some data in all the LSH buckets. Return a list of matches, each match is a three-element tuple with the data's ID, the true distance, and the number of buckets that this item was found (a rough proxy for distance.)

 data - The data to index.  The data must be an NumPy Dx1 array.

GetDataFunction - A function which will be called with an ID (from InsertIntoTable) that returns the original data.  This function is used to calculate the true distance.

Class: lsh (internal class)

The lsh class is for internal use only.  It's documented here for completeness and to allow others to extend the class.    Do not class this class directly.  Instead use the index class above.

	Each index class includes L lsh classes.  The lsh class implements the guts of the LSH algorithm, the k-dimensional projections.

	This class implements one k-dimensional projection, the T1/T2 hashing
	and stores the results in a table for later retrieval.  Input parameters
	are the bin width (w, a floating point number, or float('inf') to get binary LSH),
	and the number of projections to compute for one table entry (k, an integer).

lsh(w, k)

Create and return an index object.  The index has three parameters.

w - The bucket width for the quantization.  (Use float('inf') for a binary LSH.)

k - The number of projects per table.

sizeof()

Returns the size of this lsh structure in bytes (only works for Python versions > 2.6)

InsertIntoTable(id, data)

	Insert some data into the index (all L k-dimensional projections.)  Returns nothing.

id - object that identifies this data.  The id can be any Python object.

 data - The data to index.  The data must be an NumPy Dx1 array, where D is the dimensionality of the data.

CreateProjections(dim)

Create the k x dim random Gaussian projection and the kx1 bias arrays we will use for this lsh instance.

dim - The dimensionality of the data.

CalculateHashes(data)

Calculate the k projections.  Multiply the projection data (KxD) by the input data (Dx1), add the random bias terms, and quantize by w.

 data - The data to project.  The data must be an NumPy Dx1 array, where D is the dimensionality of the data.

ListHash(lshdata)

Compute a 28-bit hash value from a kx1 array of bucket ids (integers).
This function is necessary since Python doesn't hash NumPy arrays.  This algorithm is from
http://stackoverflow.com/questions/2909106/python-whats-a-correct-and-good-way-to-implement-hash/2909572#2909572

CalculateHashIterator(data, multiprobeRadius=0)

This is an iterator function which generates all possible multiprobe hashes for this data query. This function is called by the FindMP() method, which collects all the nearest-neighbor candidates into a single list. Depending on the value of the multiprobe radius r, all buckets with a Hamming distance less than 1 along the side closest to the query will be checked for candidates.

 data - The data to project.  The data must be an NumPy Dx1 array, where D is the dimensionality of the data.

 multiprobeRadius - The maximum Hamming distance to check for nearest-neighbor candidates.

	At each iteration, this iterator returns a two-element tuple with the T1 and T2 hash values.

InsertIntoTable(id, data)

		Insert some data into the index (all L k-dimensional projections.)  Returns nothing.

id - object that identifies this data.  The id can be any Python object.  It is best if the id is an integer, but if another object is used, then this routine silently changes the id to an integer for internal use.

 data - The data to index.  The data must be an NumPy Dx1 array.

Find(data)

		Find some data in all the LSH buckets. Return a list of matches, each match is a two-element tuple with the data's ID and the number of buckets that this item was found (a rough proxy for distance.)
		data's id and bucket counts.

 data - The data to index.  The data must be an NumPy Dx1 array.

FindMP(data, radius)

		Find some data in all the LSH buckets using multiprobe. Return a list of matches, each match is a two-element tuple with the data's ID and the number of buckets that this item was found (a rough proxy for distance.)

 data - The data to index.  The data must be an NumPy Dx1 array.

radius - multiprobe radius.  Multiprobe looks in adjacent bins to find possible matches.
			The radius specifies the number of coordinates to modify, or the Hamming radius.  A radius of 0 is without multiprobe.  A radius of 1 means only one coordinate (projection id) is changed.  A radius of 2 means up to two coordinates are changed.

Class: TestDataClass

This is a useful base class upon which data storage representations can be built.  The basic class stores a set of data in memory, and provides several services that are useful when implementing an index based on LSH.  This is important since the LSH class does not provide any data storage.  This class implements a simple storage mechanism.  Specializations of this class can be built to handle custom storage requirements. (Such as reading custom file formats to get the raw data.)

The base class reads data from a flat file, stores it in memory, and puts it into an LSH index.  This code distribution provides one specialization, RandomTestData that creates random data for testing.  Further extensions of this class might leave data on disk, or consult a real database.

TestDataClass()

The base class.  Returns a generic TestDataClass.

LoadData(filename)

Load numeric data from a flat ASCII file. Each line is a single (multidimensional) point.
		All lines should have the same dimensionality.  Numbers are separated by white space (tabs or spaces).
		There is no tag or identity for each line, instead data points are referred to by line number
		(starting with zero.)  In other words, a nearest-neighbor query that wants to return the first
		datapoint will return the identity of zero.

filename - The name of an accessible file from which to read the numeric data.

		This function stores the data internally, so nothing is returned.

SaveData(filename)

Save all numeric data saved in this class in a flat file.  One line per data point, just like
		the format read by LoadData().

filename - The name of an accessible file from which to read the numeric data.

RetrieveData(id)

Retrieve one piece of data from the internal storage.

id - The id of the data.  This is a zero-based counter for the base class, but class extensions
			might use strings.

NumPoints()

Return the number of points that have been loaded into the dataset. This is equal, for the base class
		 to the number
		of lines in the original data file.  Class extensions might change this.

NumDimensions()

Return the dimensionality of each data point.  In the base class this is equal to the number of
		tokens on each line of the input file.

GetRandomQuery()

Returns the ID of a random data point from the archive. For the base class this is a number between
		zero and the number of data points minus 1.

FindNearestNeighbors(count)

Perform an exhaustive search for the nearest neighbors to a random set of queries.
		For each query, chosen using the GetRandomQuery() function, we search through all the data
		looking for the nearest neighbor.  The results are stored in an internal dictionary.
		This data can be used for computing distance histograms and measuring LSH performance.

SaveNearestNeighbors(filename)

Save the nearest neighbor data into a file. The data is stored in the file, one line per query.
		Each line contains the ID of the query, the distance to the nearest neighbor, and the ID of the
		nearest neighbor.

filename - The name of an accessible file where the data should be stored.

LoadNearestNeighbors(filename)

Load nearest neighbor data from a file. The data is stored in the file, one line per query.
		Each line contains the ID of the query, the distance to the nearest neighbor, and the ID of the
		nearest neighbor.

filename - The name of an accessible file where the data should be read.

IterateKeys()

Iterate through all possible keys in the dataset. For each iteration, return the ID of a point
		in the dataset.

ComputeDistanceHistogram(fp = sys.stdout)

Iterate through all known nearest neighbors and calculate the distance statistics needed to
		calculate the optimal LSH parameters. For each query-nearest-neighbor pair output the following
		quantities on one line of the output file.

Distance to the nearest neighbor, d_nn

Distance to any random point in the dataset, d_any

Probability that a random projection will put the query and the nearest neighbor into the
				same bucket of a binary quantization (left or right of zero)

Probability that a random projection will put the query and the nearest neighbor into the
				same bucket of a binary quantization (left or right of zero)

		This data can be read into Matlab and used to create the d_nn and d_any histograms that are input
		to the Matlab routine CalculateLSHParameters()

ComputePnnPany(w, k, l, multiprobe=0)

		Compute the P_nn and P_any probabilities for one instance of the LSH index. This function
		creates an LSH index, given the input parameters; loads all the data into the index; queries
		the database with all known query-nearest-neighbor pairs; and then reports the true performance
		of the index.  It is the core of several other higher-level testing routines.

w - Bucket width for the LSH index

k - Number of projections per table, an integer

l - Number of tables per index, an integer

r - Multiprobe radius, a Hamming distance, an integer

		This function returns a tuple consisting of the following fields.

p_nn_1 - The probability that the query and its nearest neighbor fall in the same bin
				for one table (l=1).  This happens after forming k projections and quantizing by w.

p_nn_full - The probability that the query and its nearest neighbor fall in the same bin
					for all l tables.  This happens after forming k projections, quantizing by w and
					then checking all l tables.

p_any_1 - The probability that the query and any neighbor fall in the same bin
				for one table (l=1).  This happens after forming k projections and quantizing by w.

p_any_full - The probability that the query and any neighbor fall in the same bin
					for all l tables.  This happens after forming k projections, quantizing by w and
					then checking all l tables.

queryTime - CPU time in seconds needed for answering each query over all L tables.

numDims - The number of dimensions in the input data
				(for assembling the right results together.)

ComputePnnPanyCurve(wList = .291032, multiprobe=0)

Compute the P_nn and P_any distributions for a single projection (k=1). For each w in the wList
		create an LSH index, load the data into the index, query the database with all known
		query-nearest-neighbor pairs, and report the performance.

wList - a list of bucket sizes (w) to try.

		This routine prints the following quantities to standard output

w - bucket width for this test

p_nn - Probability that query and nearest neighbors fell into the same bin

p_any - Probability that query and any neighbor fell into the same bin

queryTime - Amount of CPU time (seconds) needed to answer each query.

		If all goes well, the result is a curve that looks like this one.

ComputeKCurve(kList, w = .291032)

Compute the number of ANY neighbors as a function of
		k.  Should go down exponentially.

kList - a list of projection counts (k) to try.

		This routine prints the following quantities to standard output

w - bucket width for this test

k - Number of projections per table in this test

l - Number of tables per index in this test

p_nn - Probability that query and nearest neighbors fell into the same bin

p_any - Probability that query and any neighbor fell into the same bin

numCandidates - Number of candidate points that must be evaluated by checking
				their distance.  This is equal to p_any*NumPoints()

queryTime - Amount of CPU time (seconds) needed to answer each query.

		If all goes well, the result is a curve that looks like this one.

		To be done!

ComputeLCurve(lList, w = 2.91032, k=10)

Compute the probability of nearest neighbors as a function
		of l.

lList - a list of table counts (l) to try.

w - the bucket size

k - the number of projections per table

		If all goes well, the result is a curve that looks like this one.

		To be done!

Command Line Interface

The LSH code also includes a simple command-line interface useful for testing the basic LSH algorithm.
You can see examples of its usage in the examples file.

There are two types of parameters to the main test program.  First, a number of command line
options control the basic LSH index.

-d #: The default dimensions for the test.  For some tests this is used to create the random
		dataset, while for others it is used to create the file where the random data (and nearest
		neighbors) is read.

-k #: The default number of projections to calculate per table.

-l #: The default number of tables per index to create.

-w #: The default bucket size for quantizing a projection.

-c #: The count of nearest neighbors to compute.

-r #: The default multiprobe (Hamming) distance.

-f filename: Use the next argument as the base filename for the tests that follow.

Second, other options tell the program what tests to run.

-create: Create a set of random d-dimensional data and compute the nearest
		neighbors.  This is useful so all the following steps use the same data (and computing
		the nearest neighbors once is a good idea.)  This routine does the
		following steps.

Creates a database of 100k d-dimensional data points

Stores the data in a file with a name equal to 'testData%03d.dat' % defaultDims

Finds the nearest neighbors for "count" (see -c above) random queries.

Saves the nearest neighbor data with a file name equal to 'testData%03d.nn' % defaultDims

-histogram: Create a distance histogram for random d-dimensional data.  This routine does the
		following steps.

Computes the distance histograms and saves the data  into a file with the
				name 'testData%03d.distances' % defaultDims

		All this data can be used as input to the Matlab CalculateMPLSHParameters() routine.

{'repo_name': 'YahooArchive/Optimal-LSH', 'stars': '147', 'repo_language': 'Matlab', 'file_name': 'classes.html', 'mime_type': 'text/html', 'hash': -2204526820937609890, 'source_dataset': 'data'}


<phpunit backupGlobals="false"
         convertErrorsToExceptions="true"
         convertWarningsToExceptions="true"
         convertNoticesToExceptions="true"
         mapTestClassNameToCoveredClassName="true"
         bootstrap="tests/bootstrap.php"
         strict="false"
         verbose="true"
         colors="true">
    <testsuites>
        <testsuite name="csrf">
            <directory>./tests</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist>
            <directory suffix=".php">./src</directory>
        </whitelist>
    </filter>
</phpunit>

{'repo_name': 'psecio/gatekeeper', 'stars': '352', 'repo_language': 'PHP', 'file_name': '20141216132116_create_throttle_table.php', 'mime_type': 'text/x-php', 'hash': -7315190870860406040, 'source_dataset': 'data'}


<?php
/**
 * @var \yii\web\View $this
 * @var \yii\data\ActiveDataProvider $dataProvider
 * @var \app\components\SearchModel $searchModel
 */

use yii\helpers\Html;

    $this->title = Yii::t('app', 'Customers');
    $this->params['breadcrumbs'][] = $this->title;
?>
<div class="customers-index">
<?=
    \kartik\dynagrid\DynaGrid::widget([
        'options' => [
            'id' => 'customers-index-grid',
        ],
        'theme' => 'panel-default',
        'gridOptions' => [
            'dataProvider' => $dataProvider,
            'filterModel' => $searchModel,
            'hover' => true,
            'panel' => [
                'heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']),
                'after' => Html::a(
                    \kartik\icons\Icon::show('plus') . Yii::t('app', 'Add'),
                    ['create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()],
                    ['class' => 'btn btn-success']
                ),
            ],
            'rowOptions' => function ($model, $key, $index, $grid) {
                /** @var \app\modules\shop\models\Customer $model */
                if (intval($model->user_id) <= 0) {
                    return [
                        'class' => 'warning',
                    ];
                }
                return [];
            },
        ],
        'columns' => [
            'id',
            [
                'attribute' => 'orders',
                'label' => Yii::t('app', 'Orders count'),
                'value' => function ($model, $key, $index, $column) {
                    /** @var \app\modules\shop\models\Customer $model */
                    return count($model->orders);
                }
            ],
            [
                'attribute' => 'user',
                'label' => Yii::t('app', 'User'),
                'value' => function ($model, $key, $index, $column) {
                    /** @var \app\modules\shop\models\Customer $model */
                    /** @var \app\modules\user\models\User $user */
                    $user = $model->user;

                    return null === $user ?
                        Yii::t('app', 'Guest')
                        : $user->username;
                }
            ],
            'first_name',
            'middle_name',
            'last_name',
            'email',
            'phone',
            [
                'class' => 'app\backend\components\ActionColumn',
                'buttons' =>  function($model, $key, $index, $parent) {
                    $result = [
                        [
                            'url' => 'edit',
                            'icon' => 'eye',
                            'class' => 'btn-info',
                            'label' => Yii::t('app','View'),
                        ],
                    ];
                    return $result;
                },
            ],
        ],
    ]);
?>
</div>

{'repo_name': 'DevGroup-ru/dotplant2', 'stars': '630', 'repo_language': 'PHP', 'file_name': 'php.ini', 'mime_type': 'text/plain', 'hash': -7314638818945314831, 'source_dataset': 'data'}


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "dtd/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>11.11. Event-type abstractors and event contour tenses</title>
    <link rel="stylesheet" type="text/css" href="final.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Complete Lojban Language" />
    <link rel="up" href="chapter-abstractions.html" title="Chapter 11. Events, Qualities, Quantities, And Other Vague Words: On Lojban Abstraction" />
    <link rel="prev" href="section-sumti-raising.html" title="11.10. Lojban sumti raising" />
    <link rel="next" href="section-abstractor-connection.html" title="11.12. Abstractor connection" />

    <meta xmlns="" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:docbook="http://docbook.org/ns/docbook" name="viewport" content="width=device-width, initial-scale=1" />

          Chapter 11. Events, Qualities, Quantities, And Other Vague Words: On Lojban Abstraction

            Prev: Section 11.10

            Next: Section 11.12

      Table of Contents

      Book Info Page

11.11. Event-type abstractors and event contour tenses

This section is a logical continuation of
    Section 11.3.

 There exists a relationship between the four types of events explained in
    Section 11.3 and the event contour tense cmavo of selma'o ZAhO. The specific cmavo of NU and of ZAhO are mutually interdefining; the ZAhO contours were chosen to fit the needs of the NU event types and vice versa. Event contours are explained in full in

    Section 10.10, and only summarized here.

The purpose of ZAhO cmavo is to represent the natural portions of an event, such as the beginning, the middle, and the end. They fall into several groups:

 The cmavo
        pu'o,
        ca'o, and
        ba'o represent spans of time: before an event begins, while it is going on, and after it is over, respectively.

The cmavo
        co'a,
        de'a,

        di'a, and

        co'u represent points of time: the start of an event, the temporary stopping of an event, the resumption of an event after a stop, and the end of an event, respectively. Not all events can have breaks in them, in which case
        de'a and

        di'a do not apply.

The cmavo
        mo'u and
        za'o correspond to

        co'u and
        ba'o respectively, in the case of those events which have a natural ending point that may not be the same as the actual ending point:
        mo'u refers to the natural ending point, and
        za'o to the time between the natural ending point and the actual ending point (the

        “excessive” or
        “superfective” part of the event).

The cmavo
        co'i represents an entire event considered as a point-event or achievement.

 All these cmavo are applicable to events seen as processes and abstracted with
    pu'u. Only processes have enough internal structure to make all these points and spans of time meaningful.

 For events seen as states and abstracted with
    za'i, the meaningful event contours are the spans

    pu'o,
    ca'o, and
    ba'o; the starting and ending points
    co'a and
    co'u, and the achievement contour
    co'i. States do not have natural endings distinct from their actual endings. (It is an open question whether states can be stopped and resumed.)

 For events seen as activities and abstracted with
    zu'o, the meaningful event contours are the spans

    pu'o,
    ca'o, and
    ba'o, and the achievement contour
    co'i. Because activities are inherently cyclic and repetitive, the beginning and ending points are not well-defined: you do not know whether an activity has truly begun until it begins to repeat.

 For events seen as point-events and abstracted with
    mu'e, the meaningful event contours are the spans

    pu'o and
    ba'o but not
    ca'o (a point-event has no duration), and the achievement contour
    co'i.

Note that the parts of events are themselves events, and may be treated as such. The points in time may be seen as
    mu'e point-events; the spans of time may constitute processes or activities. Therefore, Lojban allows us to refer to processes within processes, activities within states, and many other complicated abstract things.

          Chapter 11. Events, Qualities, Quantities, And Other Vague Words: On Lojban Abstraction

            Prev: Section 11.10

            Next: Section 11.12

      Table of Contents

      Book Info Page

{'repo_name': 'lojban/cll', 'stars': '151', 'repo_language': 'HTML', 'file_name': 'catdoc.out', 'mime_type': 'text/html', 'hash': -6010490637560707284, 'source_dataset': 'data'}


// TypeScript Version: 3.0

import {Compiler, Processor, Plugin} from 'unified'
import {Node, Parent} from 'unist'

declare class RemarkCompiler implements Compiler {
  compile(): string
  visitors: {
    [key: string]: remarkStringify.Visitor
  }
}

declare namespace remarkStringify {
  interface Stringify extends Plugin<[RemarkStringifyOptions?]> {
    Compiler: typeof RemarkCompiler
    (this: Processor, options?: RemarkStringifyOptions): void
  }

  type Compiler = RemarkCompiler

  interface RemarkStringifyOptions {
    gfm?: boolean
    commonmark?: boolean
    entities?: boolean | 'numbers' | 'escape'
    setext?: boolean
    closeAtx?: boolean
    tableCellPadding?: boolean
    tablePipeAlign?: boolean
    stringLength?: (s: string) => number
    fence?: '~' | '`'
    fences?: boolean
    bullet?: '-' | '*' | '+'
    listItemIndent?: 'tab' | '1' | 'mixed'
    incrementListMarker?: boolean
    tightDefinitions?: boolean
    rule?: '-' | '_' | '*'
    ruleRepetition?: number
    ruleSpaces?: boolean
    strong?: '_' | '*'
    emphasis?: '_' | '*'
  }

  /**
   * @deprecated Use `RemarkStringifyOptions` instead.
   */
  type PartialRemarkStringifyOptions = RemarkStringifyOptions

  type Visitor = (node: Node, parent?: Parent) => string
}

declare const remarkStringify: remarkStringify.Stringify

export = remarkStringify

{'repo_name': 'remarkjs/remark', 'stars': '3123', 'repo_language': 'JavaScript', 'file_name': 'products.md', 'mime_type': 'text/plain', 'hash': -4129796199724384752, 'source_dataset': 'data'}


// License: GPL. For details, see LICENSE file.
package org.openstreetmap.josm.gui.dialogs.properties;

import static org.junit.Assert.assertEquals;

import java.util.ArrayList;
import java.util.List;

import org.junit.Rule;
import org.junit.Test;
import org.openstreetmap.josm.data.coor.LatLon;
import org.openstreetmap.josm.data.osm.Node;
import org.openstreetmap.josm.data.osm.OsmPrimitive;
import org.openstreetmap.josm.data.osm.Way;
import org.openstreetmap.josm.testutils.JOSMTestRules;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

/**
 * Unit tests of {@link PropertiesDialog} class.
 */
public class PropertiesDialogTest {

    /**
     * Setup tests
     */
    @Rule
    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    public JOSMTestRules test = new JOSMTestRules();

    private static String createSearchSetting(List<OsmPrimitive> sel, boolean sameType) {
        return PropertiesDialog.createSearchSetting("foo", sel, sameType).text;
    }

    /**
     * Non-regression test for ticket #12504.
     */
    @Test
    public void testTicket12504() {
        List<OsmPrimitive> sel = new ArrayList<>();
        // 160 objects with foo=bar, 400 objects without foo
        for (int i = 0; i < 160+400; i++) {
            Node n = new Node(LatLon.ZERO);
            if (i < 160) {
                n.put("foo", "bar");
            }
            sel.add(n);
        }
        assertEquals("(\"foo\"=\"bar\")", createSearchSetting(sel, false));

        Node n = new Node(LatLon.ZERO);
        n.put("foo", "baz");
        sel.add(0, n);

        assertEquals("(\"foo\"=\"baz\") OR (\"foo\"=\"bar\")", createSearchSetting(sel, false));

        sel.remove(0);

        Way w = new Way();
        w.put("foo", "bar");
        sel.add(0, w);

        assertEquals("(type:way \"foo\"=\"bar\") OR (type:node \"foo\"=\"bar\")", createSearchSetting(sel, true));
    }
}

{'repo_name': 'openstreetmap/josm', 'stars': '248', 'repo_language': 'Java', 'file_name': 'org.sonarlint.eclipse.core.prefs', 'mime_type': 'text/plain', 'hash': 382076473180650456, 'source_dataset': 'data'}


=============
 0.10 series
=============

Release 0.10.2
==============

IPython 0.10.2 was released April 9, 2011.  This is a minor bugfix release that
preserves backward compatibility.  At this point, all IPython development
resources are focused on the 0.11 series that includes a complete architectural
restructuring of the project as well as many new capabilities, so this is
likely to be the last release of the 0.10.x series.  We have tried to fix all
major bugs in this series so that it remains a viable platform for those not
ready yet to transition to the 0.11 and newer codebase (since that will require
some porting effort, as a number of APIs have changed).

Thus, we are not opening a 0.10.3 active development branch yet, but if the
user community requires new patches and is willing to maintain/release such a
branch, we'll be happy to host it on the IPython github repositories.

Highlights of this release:

- The main one is the closing of github ticket #185, a major regression we had
  in 0.10.1 where pylab mode with GTK (or gthread) was not working correctly,
  hence plots were blocking with GTK.  Since this is the default matplotlib
  backend on Unix systems, this was a major annoyance for many users.  Many
  thanks to Paul Ivanov for helping resolve this issue.

- Fix IOError bug on Windows when used with -gthread.
- Work robustly if $HOME is missing from environment.
- Better POSIX support in ssh scripts (remove bash-specific idioms).
- Improved support for non-ascii characters in log files.
- Work correctly in environments where GTK can be imported but not started
  (such as a linux text console without X11).

For this release we merged 24 commits, contributed by the following people
(please let us know if we omitted your name and we'll gladly fix this in the
notes for the future):

* Fernando Perez
* MinRK
* Paul Ivanov
* Pieter Cristiaan de Groot
* TvrtkoM

Release 0.10.1
==============

IPython 0.10.1 was released October 11, 2010, over a year after version 0.10.
This is mostly a bugfix release, since after version 0.10 was released, the
development team's energy has been focused on the 0.11 series.  We have
nonetheless tried to backport what fixes we could into 0.10.1, as it remains
the stable series that many users have in production systems they rely on.

Since the 0.11 series changes many APIs in backwards-incompatible ways, we are
willing to continue maintaining the 0.10.x series.  We don't really have time
to actively write new code for 0.10.x, but we are happy to accept patches and
pull requests on the IPython `github site`_.  If sufficient contributions are
made that improve 0.10.1, we will roll them into future releases.  For this
purpose, we will have a branch called 0.10.2 on github, on which you can base
your contributions.

.. _github site: http://github.com/ipython

For this release, we applied approximately 60 commits totaling a diff of over
7000 lines::

    (0.10.1)amirbar[dist]> git diff --oneline rel-0.10.. | wc -l
    7296

Highlights of this release:

- The only significant new feature is that IPython's parallel computing
  machinery now supports natively the Sun Grid Engine and LSF schedulers.  This
  work was a joint contribution from Justin Riley, Satra Ghosh and Matthieu
  Brucher, who put a lot of work into it.  We also improved traceback handling
  in remote tasks, as well as providing better control for remote task IDs.

- New IPython Sphinx directive contributed by John Hunter.  You can use this
  directive to mark blocks in reStructuredText documents as containing IPython
  syntax (including figures) and the will be executed during the build:

  .. sourcecode:: ipython

      In [2]: plt.figure()  # ensure a fresh figure

      @savefig psimple.png width=4in
      In [3]: plt.plot([1,2,3])
      Out[3]: [<matplotlib.lines.Line2D object at 0x9b74d8c>]

- Various fixes to the standalone ipython-wx application.

- We now ship internally the excellent argparse library, graciously licensed
  under BSD terms by Steven Bethard.  Now (2010) that argparse has become part
  of Python 2.7 this will be less of an issue, but Steven's relicensing allowed
  us to start updating IPython to using argparse well before Python 2.7.  Many
  thanks!

- Robustness improvements so that IPython doesn't crash if the readline library
  is absent (though obviously a lot of functionality that requires readline
  will not be available).

- Improvements to tab completion in Emacs with Python 2.6.

- Logging now supports timestamps (see ``%logstart?`` for full details).

- A long-standing and quite annoying bug where parentheses would be added to
  ``print`` statements, under Python 2.5 and 2.6, was finally fixed.

- Improved handling of libreadline on Apple OSX.

- Fix ``reload`` method of IPython demos, which was broken.

- Fixes for the ipipe/ibrowse system on OSX.

- Fixes for Zope profile.

- Fix %timeit reporting when the time is longer than 1000s.

- Avoid lockups with ? or ?? in SunOS, due to a bug in termios.

- The usual assortment of miscellaneous bug fixes and small improvements.

The following people contributed to this release (please let us know if we
omitted your name and we'll gladly fix this in the notes for the future):

* Beni Cherniavsky
* Boyd Waters.
* David Warde-Farley
* Fernando Perez
* Gökhan Sever
* John Hunter
* Justin Riley
* Kiorky
* Laurent Dufrechou
* Mark E. Smith
* Matthieu Brucher
* Satrajit Ghosh
* Sebastian Busch
* Václav Šmilauer

Release 0.10
============

This release brings months of slow but steady development, and will be the last
before a major restructuring and cleanup of IPython's internals that is already
under way.  For this reason, we hope that 0.10 will be a stable and robust
release so that while users adapt to some of the API changes that will come
with the refactoring that will become IPython 0.11, they can safely use 0.10 in
all existing projects with minimal changes (if any).

IPython 0.10 is now a medium-sized project, with roughly (as reported by David
Wheeler's :command:`sloccount` utility) 40750 lines of Python code, and a diff
between 0.9.1 and this release that contains almost 28000 lines of code and
documentation.  Our documentation, in PDF format, is a 495-page long PDF
document (also available in HTML format, both generated from the same sources).

Many users and developers contributed code, features, bug reports and ideas to
this release.  Please do not hesitate in contacting us if we've failed to
acknowledge your contribution here.  In particular, for this release we have
contribution from the following people, a mix of new and regular names (in
alphabetical order by first name):

* Alexander Clausen: fix #341726.
* Brian Granger: lots of work everywhere (features, bug fixes, etc).
* Daniel Ashbrook: bug report on MemoryError during compilation, now fixed.
* Darren Dale: improvements to documentation build system, feedback, design
  ideas.
* Fernando Perez: various places.
* Gaël Varoquaux: core code, ipythonx GUI, design discussions, etc. Lots...
* John Hunter: suggestions, bug fixes, feedback.
* Jorgen Stenarson: work on many fronts, tests, fixes, win32 support, etc.
* Laurent Dufréchou: many improvements to ipython-wx standalone app.
* Lukasz Pankowski: prefilter, `%edit`, demo improvements.
* Matt Foster: TextMate support in `%edit`.
* Nathaniel Smith: fix #237073.
* Pauli Virtanen: fixes and improvements to extensions, documentation.
* Prabhu Ramachandran: improvements to `%timeit`.
* Robert Kern: several extensions.
* Sameer D'Costa: help on critical bug #269966.
* Stephan Peijnik: feedback on Debian compliance and many man pages.
* Steven Bethard: we are now shipping his :mod:`argparse` module.
* Tom Fetherston: many improvements to :mod:`IPython.demo` module.
* Ville Vainio: lots of work everywhere (features, bug fixes, etc).
* Vishal Vasta: ssh support in ipcluster.
* Walter Doerwald: work on the :mod:`IPython.ipipe` system.

Below we give an overview of new features, bug fixes and backwards-incompatible
changes.  For a detailed account of every change made, feel free to view the
project log with :command:`bzr log`.

New features
------------

* New `%paste` magic automatically extracts current contents of clipboard and
  pastes it directly, while correctly handling code that is indented or
  prepended with `>>>` or `...` python prompt markers.  A very useful new
  feature contributed by Robert Kern.

* IPython 'demos', created with the :mod:`IPython.demo` module, can now be
  created from files on disk or strings in memory.  Other fixes and
  improvements to the demo system, by Tom Fetherston.

* Added :func:`find_cmd` function to :mod:`IPython.platutils` module, to find
  commands in a cross-platform manner.

* Many improvements and fixes to Gaël Varoquaux's :command:`ipythonx`, a
  WX-based lightweight IPython instance that can be easily embedded in other WX
  applications.  These improvements have made it possible to now have an
  embedded IPython in Mayavi and other tools.

* :class:`MultiengineClient` objects now have a :meth:`benchmark` method.

* The manual now includes a full set of auto-generated API documents from the
  code sources, using Sphinx and some of our own support code.  We are now
  using the `Numpy Documentation Standard`_  for all docstrings, and we have
  tried to update as many existing ones as possible to this format.

* The new :mod:`IPython.Extensions.ipy_pretty` extension by Robert Kern
  provides configurable pretty-printing.

* Many improvements to the :command:`ipython-wx` standalone WX-based IPython
  application by Laurent Dufréchou.  It can optionally run in a thread, and
  this can be toggled at runtime (allowing the loading of Matplotlib in a
  running session without ill effects).

* IPython includes a copy of Steven Bethard's argparse_ in the
  :mod:`IPython.external` package, so we can use it internally and it is also
  available to any IPython user.  By installing it in this manner, we ensure
  zero conflicts with any system-wide installation you may already have while
  minimizing external dependencies for new users.  In IPython 0.10, We ship
  argparse version 1.0.

* An improved and much more robust test suite, that runs groups of tests in
  separate subprocesses using either Nose or Twisted's :command:`trial` runner
  to ensure proper management of Twisted-using code.  The test suite degrades
  gracefully if optional dependencies are not available, so that the
  :command:`iptest` command can be run with only Nose installed and nothing
  else.  We also have more and cleaner test decorators to better select tests
  depending on runtime conditions, do setup/teardown, etc.

* The new ipcluster now has a fully working ssh mode that should work on
  Linux, Unix and OS X.  Thanks to Vishal Vatsa for implementing this!

* The wonderful TextMate editor can now be used with %edit on OS X.  Thanks
  to Matt Foster for this patch.

* The documentation regarding parallel uses of IPython, including MPI and PBS,
  has been significantly updated and improved.

* The developer guidelines in the documentation have been updated to explain
  our workflow using :command:`bzr` and Launchpad.

* Fully refactored :command:`ipcluster` command line program for starting
  IPython clusters.  This new version is a complete rewrite and 1) is fully
  cross platform (we now use Twisted's process management), 2) has much
  improved performance, 3) uses subcommands for different types of clusters, 4)
  uses argparse for parsing command line options, 5) has better support for
  starting clusters using :command:`mpirun`, 6) has experimental support for
  starting engines using PBS.  It can also reuse FURL files, by appropriately
  passing options to its subcommands.  However, this new version of ipcluster
  should be considered a technology preview.  We plan on changing the API in
  significant ways before it is final.

* Full description of the security model added to the docs.

* cd completer: show bookmarks if no other completions are available.

* sh profile: easy way to give 'title' to prompt: assign to variable
  '_prompt_title'. It looks like this::

        [~]|1> _prompt_title = 'sudo!'
        sudo![~]|2>

* %edit: If you do '%edit pasted_block', pasted_block variable gets updated
  with new data (so repeated editing makes sense)

.. _Numpy Documentation Standard: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt#docstring-standard

.. _argparse: http://code.google.com/p/argparse/

Bug fixes
---------

* Fix #368719, removed top-level debian/ directory to make the job of Debian
  packagers easier.

* Fix #291143 by including man pages contributed by Stephan Peijnik from the
  Debian project.

* Fix #358202, effectively a race condition, by properly synchronizing file
  creation at cluster startup time.

* `%timeit` now handles correctly functions that take a long time to execute
  even the first time, by not repeating them.

* Fix #239054, releasing of references after exiting.

* Fix #341726, thanks to Alexander Clausen.

* Fix #269966.  This long-standing and very difficult bug (which is actually a
  problem in Python itself) meant long-running sessions would inevitably grow
  in memory size, often with catastrophic consequences if users had large
  objects in their scripts.  Now, using `%run` repeatedly should not cause any
  memory leaks.  Special thanks to John Hunter and Sameer D'Costa for their
  help with this bug.

* Fix #295371, bug in `%history`.

* Improved support for py2exe.

* Fix #270856: IPython hangs with PyGTK

* Fix #270998: A magic with no docstring breaks the '%magic magic'

* fix #271684: -c startup commands screw up raw vs. native history

* Numerous bugs on Windows with the new ipcluster have been fixed.

* The ipengine and ipcontroller scripts now handle missing furl files
  more gracefully by giving better error messages.

* %rehashx: Aliases no longer contain dots. python3.0 binary
  will create alias python30. Fixes:
  #259716 "commands with dots in them don't work"

* %cpaste: %cpaste -r repeats the last pasted block.
  The block is assigned to pasted_block even if code
  raises exception.

* Bug #274067 'The code in get_home_dir is broken for py2exe' was
  fixed.

* Many other small bug fixes not listed here by number (see the bzr log for
  more info).

Backwards incompatible changes
------------------------------

* `ipykit` and related files were unmaintained and have been removed.

* The :func:`IPython.genutils.doctest_reload` does not actually call
  `reload(doctest)` anymore, as this was causing many problems with the test
  suite.  It still resets `doctest.master` to None.

* While we have not deliberately broken Python 2.4 compatibility, only minor
  testing was done with Python 2.4, while 2.5 and 2.6 were fully tested.  But
  if you encounter problems with 2.4, please do report them as bugs.

* The :command:`ipcluster` now requires a mode argument; for example to start a
  cluster on the local machine with 4 engines, you must now type::

    $ ipcluster local -n 4

* The controller now has a ``-r`` flag that needs to be used if you want to
  reuse existing furl files.  Otherwise they are deleted (the default).

* Remove ipy_leo.py. You can use :command:`easy_install ipython-extension` to
  get it.  (done to decouple it from ipython release cycle)

{'repo_name': 'ipython/ipython', 'stars': '14269', 'repo_language': 'Python', 'file_name': 'daft_extension.py', 'mime_type': 'text/x-python', 'hash': -807429666714606075, 'source_dataset': 'data'}


fileFormatVersion: 2
guid: d53fe55b037a6b04a885214de48c22cf
timeCreated: 1456211528
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:

{'repo_name': 'EnoxSoftware/OpenCVForUnity', 'stars': '319', 'repo_language': 'C#', 'file_name': 'facerec_0.bmp.meta', 'mime_type': 'text/plain', 'hash': -4139108146724329828, 'source_dataset': 'data'}


import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

faminsts = IN[0]
elementlist = list()
for item in faminsts:
	try:
		n = UnwrapElement(item).Name
	except:
		# Use a built-in property of (wrapped) Dynamo elements for family symbols instead
		try:
			n = item.Name
		except:
			# maybe it's a parameter name
			try:
				n = item.Definition.Name
			except:
				n = []
	elementlist.append(n)
OUT = elementlist

{'repo_name': 'andydandy74/ClockworkForDynamo', 'stars': '136', 'repo_language': 'Python', 'file_name': 'Element.AssociatedFamilyParameters.py', 'mime_type': 'text/x-python', 'hash': -2223912591411538098, 'source_dataset': 'data'}


# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __DATA,__litp - | FileCheck %s
# RUN: llvm-mc < %s -triple x86_64-apple-darwin -filetype=obj | llvm-objdump -m -section __DATA,__litp -non-verbose - | FileCheck %s -check-prefix=NON-VERBOSE

.cstring
L1: .asciz "Hello world\n"

.literal4
.align 2
L2: .float 4.0

.literal8
.align 3
L3: .double 8.0

.literal16
.align 4
L4: .long 0x10000016, 0x20000016, 0x30000016, 0x40000016

.const
L5: .asciz "const non-literal string"

.section __DATA,__litp, literal_pointers
.align 3
.quad L1
.quad L2
.quad L3
.quad L4
.quad L5

# CHECK: Contents of (__DATA,__litp) section
# CHECK: 0000000000000050  __TEXT:__cstring:Hello world\n
# CHECK: 0000000000000058  __TEXT:__literal4:0x40800000
# CHECK: 0000000000000060  __TEXT:__literal8:0x00000000 0x40200000
# CHECK: 0000000000000068  __TEXT:__literal16:0x10000016 0x20000016 0x30000016 0x40000016
# CHECK: 0000000000000070  0x30 (not in a literal section)

# NON-VERBOSE: Contents of (__DATA,__litp) section
# NON-VERBOSE: 0000000000000050	00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00
# NON-VERBOSE: 0000000000000060	18 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00
# NON-VERBOSE: 0000000000000070	30 00 00 00 00 00 00 00

{'repo_name': 'microsoft/checkedc-clang', 'stars': '278', 'repo_language': 'C++', 'file_name': 'coro-split-dbg.ll', 'mime_type': 'text/plain', 'hash': -7075319873885035552, 'source_dataset': 'data'}


// +build !windows,!linux

package chrootarchive // import "github.com/docker/docker/pkg/chrootarchive"

import "golang.org/x/sys/unix"

func chroot(path string) error {
	if err := unix.Chroot(path); err != nil {
		return err
	}
	return unix.Chdir("/")
}

func realChroot(path string) error {
	return chroot(path)
}

{'repo_name': 'docker/docker-ce', 'stars': '4545', 'repo_language': 'Go', 'file_name': 'docker_windows.go', 'mime_type': 'text/plain', 'hash': 1852313052465411554, 'source_dataset': 'data'}


/*
 * -------------------------------------------
 *    CC3220 SDK - v0.10.00.00
 * -------------------------------------------
 *
 *  Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *    Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 *    Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the
 *    distribution.
 *
 *    Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
//*****************************************************************************
//
//  prcm.h
//
//  Prototypes for the PRCM control driver.
//
//*****************************************************************************

#ifndef __PRCM_H__
#define __PRCM_H__

//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif

//*****************************************************************************
//
// Peripheral clock and reset control registers
//
//*****************************************************************************
typedef struct _PRCM_PeripheralRegs_
{

unsigned long ulClkReg;
unsigned long ulRstReg;

}PRCM_PeriphRegs_t;

//*****************************************************************************
// Values that can be passed to PRCMPeripheralEnable() and
// PRCMPeripheralDisable()
//*****************************************************************************
#define PRCM_RUN_MODE_CLK         0x00000001
#define PRCM_SLP_MODE_CLK         0x00000100

//*****************************************************************************
// Values that can be passed to PRCMSRAMRetentionEnable() and
// PRCMSRAMRetentionDisable() as ulSramColSel.
//*****************************************************************************
#define PRCM_SRAM_COL_1           0x00000001
#define PRCM_SRAM_COL_2           0x00000002
#define PRCM_SRAM_COL_3           0x00000004
#define PRCM_SRAM_COL_4           0x00000008

//*****************************************************************************
// Values that can be passed to PRCMSRAMRetentionEnable() and
// PRCMSRAMRetentionDisable() as ulModeFlags.
//*****************************************************************************
#define PRCM_SRAM_LPDS_RET        0x00000002

//*****************************************************************************
// Values that can be passed to PRCMLPDSWakeupSourceEnable(),
// PRCMLPDSWakeupCauseGet() and PRCMLPDSWakeupSourceDisable().
//*****************************************************************************
#define PRCM_LPDS_HOST_IRQ        0x00000080
#define PRCM_LPDS_GPIO            0x00000010
#define PRCM_LPDS_TIMER           0x00000001

//*****************************************************************************
// Values that can be passed to PRCMLPDSWakeUpGPIOSelect() as Type
//*****************************************************************************
#define PRCM_LPDS_LOW_LEVEL       0x00000002
#define PRCM_LPDS_HIGH_LEVEL      0x00000000
#define PRCM_LPDS_FALL_EDGE       0x00000001
#define PRCM_LPDS_RISE_EDGE       0x00000003

//*****************************************************************************
// Values that can be passed to PRCMLPDSWakeUpGPIOSelect()
//*****************************************************************************
#define PRCM_LPDS_GPIO2           0x00000000
#define PRCM_LPDS_GPIO4           0x00000001
#define PRCM_LPDS_GPIO13          0x00000002
#define PRCM_LPDS_GPIO17          0x00000003
#define PRCM_LPDS_GPIO11          0x00000004
#define PRCM_LPDS_GPIO24          0x00000005
#define PRCM_LPDS_GPIO26          0x00000006

//*****************************************************************************
// Values that can be passed to PRCMHibernateWakeupSourceEnable(),
// PRCMHibernateWakeupSourceDisable().
//*****************************************************************************
#define PRCM_HIB_SLOW_CLK_CTR     0x00000001

//*****************************************************************************
// Values that can be passed to PRCMHibernateWakeUpGPIOSelect() as ulType
//*****************************************************************************
#define PRCM_HIB_LOW_LEVEL        0x00000000
#define PRCM_HIB_HIGH_LEVEL       0x00000001
#define PRCM_HIB_FALL_EDGE        0x00000002
#define PRCM_HIB_RISE_EDGE        0x00000003

//*****************************************************************************
// Values that can be passed to PRCMHibernateWakeupSourceEnable(),
// PRCMHibernateWakeupSourceDisable(), PRCMHibernateWakeUpGPIOSelect()
//*****************************************************************************
#define PRCM_HIB_GPIO2            0x00010000
#define PRCM_HIB_GPIO4            0x00020000
#define PRCM_HIB_GPIO13           0x00040000
#define PRCM_HIB_GPIO17           0x00080000
#define PRCM_HIB_GPIO11           0x00100000
#define PRCM_HIB_GPIO24           0x00200000
#define PRCM_HIB_GPIO26           0x00400000

//*****************************************************************************
// Values that will be returned from PRCMSysResetCauseGet().
//*****************************************************************************
#define PRCM_POWER_ON             0x00000000
#define PRCM_LPDS_EXIT            0x00000001
#define PRCM_CORE_RESET           0x00000003
#define PRCM_MCU_RESET            0x00000004
#define PRCM_WDT_RESET            0x00000005
#define PRCM_SOC_RESET            0x00000006
#define PRCM_HIB_EXIT             0x00000007

//*****************************************************************************
// Values that can be passed to PRCMHibernateWakeupCauseGet().
//*****************************************************************************
#define PRCM_HIB_WAKEUP_CAUSE_SLOW_CLOCK  0x00000002
#define PRCM_HIB_WAKEUP_CAUSE_GPIO        0x00000004

//*****************************************************************************
// Values that can be passed to PRCMSEnableInterrupt
//*****************************************************************************
#define PRCM_INT_SLOW_CLK_CTR     0x00004000

//*****************************************************************************
// Values that can be passed to PRCMPeripheralClkEnable(),
// PRCMPeripheralClkDisable(), PRCMPeripheralReset()
//*****************************************************************************
#define PRCM_CAMERA               0x00000000
#define PRCM_I2S                  0x00000001
#define PRCM_SDHOST               0x00000002
#define PRCM_GSPI                 0x00000003
#define PRCM_LSPI                 0x00000004
#define PRCM_UDMA                 0x00000005
#define PRCM_GPIOA0               0x00000006
#define PRCM_GPIOA1               0x00000007
#define PRCM_GPIOA2               0x00000008
#define PRCM_GPIOA3               0x00000009
#define PRCM_GPIOA4               0x0000000A
#define PRCM_WDT                  0x0000000B
#define PRCM_UARTA0               0x0000000C
#define PRCM_UARTA1               0x0000000D
#define PRCM_TIMERA0              0x0000000E
#define PRCM_TIMERA1              0x0000000F
#define PRCM_TIMERA2              0x00000010
#define PRCM_TIMERA3              0x00000011
#define PRCM_DTHE                 0x00000012
#define PRCM_SSPI                 0x00000013
#define PRCM_I2CA0                0x00000014
// Note : PRCM_ADC is a dummy define for pinmux utility code generation
// PRCM_ADC should never be used in any user code.
#define PRCM_ADC                  0x000000FF

//*****************************************************************************
// Values that can be passed to PRCMIORetEnable() and PRCMIORetDisable()
//*****************************************************************************
#define PRCM_IO_RET_GRP_0       0x00000001
#define PRCM_IO_RET_GRP_1       0x00000002
#define PRCM_IO_RET_GRP_2       0x00000004
#define PRCM_IO_RET_GRP_3       0x00000008

//*****************************************************************************
// Macros definig the device type
//*****************************************************************************
#define PRCM_DEV_TYPE_FLAG_R         0x00000001
#define PRCM_DEV_TYPE_FLAG_F         0x00000002
#define PRCM_DEV_TYPE_FLAG_Z         0x00000004
#define PRCM_DEV_TYPE_FLAG_SECURE    0x00000008
#define PRCM_DEV_TYPE_FLAG_PRE_PROD  0x00000010
#define PRCM_DEV_TYPE_FLAG_3200      0x00000020
#define PRCM_DEV_TYPE_FLAG_3220      0x00000040
#define PRCM_DEV_TYPE_FLAG_REV1      0x00010000
#define PRCM_DEV_TYPE_FLAG_REV2      0x00020000

//*****************************************************************************
// Pre-defined helper macros
//*****************************************************************************
#define PRCM_DEV_TYPE_PRE_CC3200R    (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3200|     \
                                      PRCM_DEV_TYPE_FLAG_R)

#define PRCM_DEV_TYPE_PRE_CC3200F    (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3200|     \
                                      PRCM_DEV_TYPE_FLAG_F)

#define PRCM_DEV_TYPE_PRE_CC3200Z    (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3200|     \
                                      PRCM_DEV_TYPE_FLAG_Z)

#define PRCM_DEV_TYPE_CC3200R        (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3200|     \
                                      PRCM_DEV_TYPE_FLAG_R)

#define PRCM_DEV_TYPE_PRE_CC3220R    (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3220|     \
                                      PRCM_DEV_TYPE_FLAG_R)

#define PRCM_DEV_TYPE_PRE_CC3220F    (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3220|     \
                                      PRCM_DEV_TYPE_FLAG_F)

#define PRCM_DEV_TYPE_PRE_CC3220Z    (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3220|     \
                                      PRCM_DEV_TYPE_FLAG_Z)

#define PRCM_DEV_TYPE_CC3220R        (PRCM_DEV_TYPE_FLAG_3220|     \
                                      PRCM_DEV_TYPE_FLAG_R)

#define PRCM_DEV_TYPE_PRE_CC3220RS   (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3220|     \
                                      PRCM_DEV_TYPE_FLAG_R|        \
                                      PRCM_DEV_TYPE_FLAG_SECURE)

#define PRCM_DEV_TYPE_PRE_CC3220FS   (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3220|     \
                                      PRCM_DEV_TYPE_FLAG_F|        \
                                      PRCM_DEV_TYPE_FLAG_SECURE)

#define PRCM_DEV_TYPE_PRE_CC3220ZS   (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3220|     \
                                      PRCM_DEV_TYPE_FLAG_Z|        \
                                      PRCM_DEV_TYPE_FLAG_SECURE)

#define PRCM_DEV_TYPE_CC3220RS       (PRCM_DEV_TYPE_FLAG_3220|     \
                                      PRCM_DEV_TYPE_FLAG_R|        \
                                      PRCM_DEV_TYPE_FLAG_SECURE)

#define PRCM_DEV_TYPE_CC3220FS       (PRCM_DEV_TYPE_FLAG_3220|     \
                                      PRCM_DEV_TYPE_FLAG_F|        \
                                      PRCM_DEV_TYPE_FLAG_SECURE)

#define PRCM_DEV_TYPE_PRE_CC3220Z1   (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3220|     \
                                      PRCM_DEV_TYPE_FLAG_Z|        \
                                      PRCM_DEV_TYPE_FLAG_REV1)

#define PRCM_DEV_TYPE_PRE_CC3220Z2   (PRCM_DEV_TYPE_FLAG_PRE_PROD| \
                                      PRCM_DEV_TYPE_FLAG_3220|     \
                                      PRCM_DEV_TYPE_FLAG_Z|        \
                                      PRCM_DEV_TYPE_FLAG_REV2)

//*****************************************************************************
//
// API Function prototypes
//
//*****************************************************************************
extern void PRCMMCUReset(tBoolean bIncludeSubsystem);
extern unsigned long PRCMSysResetCauseGet(void);

extern void PRCMPeripheralClkEnable(unsigned long ulPeripheral,
                                    unsigned long ulClkFlags);
extern void PRCMPeripheralClkDisable(unsigned long ulPeripheral,
                                     unsigned long ulClkFlags);
extern void PRCMPeripheralReset(unsigned long ulPeripheral);
extern tBoolean PRCMPeripheralStatusGet(unsigned long ulPeripheral);

extern void PRCMI2SClockFreqSet(unsigned long ulI2CClkFreq);
extern unsigned long PRCMPeripheralClockGet(unsigned long ulPeripheral);

extern void PRCMSleepEnter(void);

extern void PRCMSRAMRetentionEnable(unsigned long ulSramColSel,
                                    unsigned long ulFlags);
extern void PRCMSRAMRetentionDisable(unsigned long ulSramColSel,
                                     unsigned long ulFlags);
extern void PRCMLPDSRestoreInfoSet(unsigned long ulRestoreSP,
                                   unsigned long ulRestorePC);
extern void PRCMLPDSEnter(void);
extern void PRCMLPDSIntervalSet(unsigned long ulTicks);
extern void PRCMLPDSWakeupSourceEnable(unsigned long ulLpdsWakeupSrc);
extern unsigned long PRCMLPDSWakeupCauseGet(void);
extern void PRCMLPDSWakeUpGPIOSelect(unsigned long ulGPIOPin,
                                     unsigned long ulType);
extern void PRCMLPDSWakeupSourceDisable(unsigned long ulLpdsWakeupSrc);

extern void PRCMHibernateEnter(void);
extern void PRCMHibernateWakeupSourceEnable(unsigned long ulHIBWakupSrc);
extern unsigned long PRCMHibernateWakeupCauseGet(void);
extern void PRCMHibernateWakeUpGPIOSelect(unsigned long ulMultiGPIOBitMap,
                                          unsigned long ulType);
extern void PRCMHibernateWakeupSourceDisable(unsigned long ulHIBWakupSrc);
extern void PRCMHibernateIntervalSet(unsigned long long ullTicks);

extern unsigned long long PRCMSlowClkCtrGet(void);
extern unsigned long long PRCMSlowClkCtrFastGet(void);
extern void PRCMSlowClkCtrMatchSet(unsigned long long ullTicks);
extern unsigned long long PRCMSlowClkCtrMatchGet(void);

extern void PRCMOCRRegisterWrite(unsigned char ucIndex,
                                 unsigned long ulRegValue);
extern unsigned long PRCMOCRRegisterRead(unsigned char ucIndex);

extern void PRCMIntRegister(void (*pfnHandler)(void));
extern void PRCMIntUnregister(void);
extern void PRCMIntEnable(unsigned long ulIntFlags);
extern void PRCMIntDisable(unsigned long ulIntFlags);
extern unsigned long PRCMIntStatus(void);
extern void PRCMRTCInUseSet(void);
extern tBoolean PRCMRTCInUseGet(void);
extern void PRCMRTCSet(unsigned long ulSecs, unsigned short usMsec);
extern void PRCMRTCGet(unsigned long *ulSecs, unsigned short *usMsec);
extern void PRCMRTCMatchSet(unsigned long ulSecs, unsigned short usMsec);
extern void PRCMRTCMatchGet(unsigned long *ulSecs, unsigned short *usMsec);
extern void PRCMCC3200MCUInit(void);
extern unsigned long PRCMHIBRegRead(unsigned long ulRegAddr);
extern void PRCMHIBRegWrite(unsigned long ulRegAddr, unsigned long ulValue);
extern unsigned long PRCMCameraFreqSet(unsigned char ulDivider,
                                                unsigned char ulWidth);
extern void PRCMIORetentionEnable(unsigned long ulIORetGrpFlags);
extern void PRCMIORetentionDisable(unsigned long ulIORetGrpFlags);
extern unsigned long PRCMDeviceTypeGet(void);
extern void PRCMLPDSEnterKeepDebugIf(void);
extern void PRCMHibernateCycleTrigger(void);

//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif

#endif //  __PRCM_H__

{'repo_name': 'cjlano/freertos', 'stars': '226', 'repo_language': 'C', 'file_name': 'xddrps.h', 'mime_type': 'text/x-c', 'hash': 6104160096001306949, 'source_dataset': 'data'}


require_relative "./helper"

describe "Plugin" do
  include WithTemporaryDirectory

  describe "b:node_root" do
    it "must be set when in same directory with package.json" do
      FileUtils.touch File.join(@dir, "package.json")
      $vim.edit File.join(@dir, "index.js")
      $vim.echo("b:node_root").must_equal @dir
    end

    it "must be set when in same directory with node_modules" do
      Dir.mkdir File.join(@dir, "node_modules")
      $vim.edit File.join(@dir, "index.js")
      $vim.echo("b:node_root").must_equal @dir
    end

    it "must be set when ancestor directory has package.json" do
      FileUtils.touch File.join(@dir, "package.json")

      nested = File.join(@dir, "lib", "awesomeness")
      FileUtils.mkdir_p nested
      $vim.edit File.join(nested, "index.js")
      $vim.echo("b:node_root").must_equal @dir
    end

    it "must be set when ancestor directory has node_modules" do
      Dir.mkdir File.join(@dir, "node_modules")

      nested = File.join(@dir, "lib", "awesomeness")
      FileUtils.mkdir_p nested
      $vim.edit File.join(nested, "index.js")
      $vim.echo("b:node_root").must_equal @dir
    end

    it "must be set also for other filetypes" do
      FileUtils.touch File.join(@dir, "package.json")

      $vim.edit File.join(@dir, "README.txt")
      $vim.echo("b:node_root").must_equal @dir
    end

    it "must be set in nested Node projects" do
      nested = File.join(@dir, "node_modules", "require-guard")
      FileUtils.mkdir_p nested
      FileUtils.touch File.join(nested, "package.json")

      test = File.join(nested, "test")
      FileUtils.mkdir_p test
      $vim.edit File.join(test, "index_test.js")
      $vim.echo("b:node_root").must_equal nested
    end

    it "must not be set when no ancestor has one" do
      $vim.edit File.join(@dir, "index_test.js")
      $vim.echo(%(exists("b:node_root"))).must_equal "0"
    end

    it "must be set from file, not working directory" do
      $vim.command "cd #{@dir}"
      FileUtils.touch File.join(@dir, "package.json")

      nested = File.join(@dir, "node_modules", "require-guard")
      FileUtils.mkdir_p nested
      FileUtils.touch File.join(nested, "package.json")

      $vim.edit File.join(nested, "index_test.js")
      $vim.echo("b:node_root").must_equal nested
    end

    it "must detect directory as Node's when opening Vim" do
      begin
        Dir.chdir @dir
        FileUtils.touch File.join(@dir, "package.json")

        vim = Vimrunner::Server.new(:vimrc => $vimrc).start
        vim.command("pwd").must_equal @dir
        vim.echo("b:node_root").must_equal @dir
      ensure
        vim.kill if vim
      end
    end
  end
end

{'repo_name': 'moll/vim-node', 'stars': '801', 'repo_language': 'Ruby', 'file_name': 'lib_test.rb', 'mime_type': 'text/x-ruby', 'hash': -5220034777506088091, 'source_dataset': 'data'}


<?xml version="1.0" ?><!DOCTYPE TS><TS language="pl_PL" version="2.1">
<context>
    <name>SBI_ImagesIcon</name>
    <message>
        <location filename="../sbi_imagesicon.cpp" line="33"/>
        <source>Modify images loading settings per-site and globally</source>
        <translation>Zmień ustawienia ładowania obrazów dla strony i globalnie</translation>
    </message>
    <message>
        <location filename="../sbi_imagesicon.cpp" line="57"/>
        <source>Current Page Settings</source>
        <translation>Ustawienia aktualnej strony</translation>
    </message>
    <message>
        <location filename="../sbi_imagesicon.cpp" line="60"/>
        <source>Disable loading images (temporarily)</source>
        <translation>Wyłącz ładowanie obrazów (tymczasowo)</translation>
    </message>
    <message>
        <location filename="../sbi_imagesicon.cpp" line="63"/>
        <source>Enable loading images (temporarily)</source>
        <translation>Włącz ładowanie obrazów (tymczasowo)</translation>
    </message>
    <message>
        <location filename="../sbi_imagesicon.cpp" line="67"/>
        <source>Global Settings</source>
        <translation>Ustawiania Ogólne</translation>
    </message>
    <message>
        <location filename="../sbi_imagesicon.cpp" line="69"/>
        <source>Automatically load images</source>
        <translation>Automatycznie ładuj obrazy</translation>
    </message>
</context>
<context>
    <name>SBI_JavaScriptIcon</name>
    <message>
        <location filename="../sbi_javascripticon.cpp" line="34"/>
        <source>Modify JavaScript settings per-site and globally</source>
        <translation>Zmień ustawienia JavaScript dla strony i globalnie</translation>
    </message>
    <message>
        <location filename="../sbi_javascripticon.cpp" line="51"/>
        <source>Current Page Settings</source>
        <translation>Ustawienia aktualnej strony</translation>
    </message>
    <message>
        <location filename="../sbi_javascripticon.cpp" line="54"/>
        <source>Disable JavaScript (temporarily)</source>
        <translation>Wyłącz JavaScript (tymczasowo)</translation>
    </message>
    <message>
        <location filename="../sbi_javascripticon.cpp" line="57"/>
        <source>Enable JavaScript (temporarily)</source>
        <translation>Włącz JavaScript (tymczasowo)</translation>
    </message>
    <message>
        <location filename="../sbi_javascripticon.cpp" line="66"/>
        <source>Global Settings</source>
        <translation>Ustawiania Ogólne</translation>
    </message>
    <message>
        <location filename="../sbi_javascripticon.cpp" line="67"/>
        <source>Manage JavaScript settings</source>
        <translation>Zarządzaj ustawieniami JavaScript</translation>
    </message>
</context>
<context>
    <name>SBI_NetworkIcon</name>
    <message>
        <location filename="../sbi_networkicon.cpp" line="65"/>
        <source>Proxy Configuration</source>
        <translation>Ustawienia proxy</translation>
    </message>
    <message>
        <location filename="../sbi_networkicon.cpp" line="67"/>
        <source>Select proxy</source>
        <translation>Wybierz proxy</translation>
    </message>
    <message>
        <location filename="../sbi_networkicon.cpp" line="81"/>
        <source>Empty</source>
        <translation>Pusto</translation>
    </message>
    <message>
        <location filename="../sbi_networkicon.cpp" line="85"/>
        <source>Manage proxies</source>
        <translation>Zarządzaj proxy</translation>
    </message>
    <message>
        <location filename="../sbi_networkicon.cpp" line="98"/>
        <source>Shows network status and manages proxy

Network:
%1

Proxy:
%2</source>
        <translation>Pokazuje status sieci i zarządza serwerami proxy

Sieć:
%1

Proxy:
%2</translation>
    </message>
    <message>
        <location filename="../sbi_networkicon.cpp" line="101"/>
        <source>Connected</source>
        <translation>Podłączony</translation>
    </message>
    <message>
        <location filename="../sbi_networkicon.cpp" line="104"/>
        <source>Offline</source>
        <translation>Odłączony</translation>
    </message>
    <message>
        <location filename="../sbi_networkicon.cpp" line="109"/>
        <source>System proxy</source>
        <translation>Proxy systemowe</translation>
    </message>
    <message>
        <location filename="../sbi_networkicon.cpp" line="113"/>
        <source>No proxy</source>
        <translation>Brak proxy</translation>
    </message>
    <message>
        <location filename="../sbi_networkicon.cpp" line="117"/>
        <source>User defined</source>
        <translation>Zdefiniowane przez użytkownika</translation>
    </message>
</context>
<context>
    <name>SBI_NetworkIconDialog</name>
    <message>
        <location filename="../sbi_networkicondialog.ui" line="14"/>
        <source>Proxy Manager</source>
        <translation>Menadżer Proxy</translation>
    </message>
    <message>
        <location filename="../sbi_networkicondialog.ui" line="28"/>
        <source>Select proxy: </source>
        <translation>Wybierz proxy:</translation>
    </message>
    <message>
        <location filename="../sbi_networkicondialog.ui" line="38"/>
        <location filename="../sbi_networkicondialog.cpp" line="57"/>
        <source>Add proxy</source>
        <translation>Dodaj proxy</translation>
    </message>
    <message>
        <location filename="../sbi_networkicondialog.ui" line="45"/>
        <source>Remove proxy</source>
        <translation>Usuń proxy</translation>
    </message>
    <message>
        <location filename="../sbi_networkicondialog.ui" line="69"/>
        <source>No proxies. You can add proxy by clicking on Add button.</source>
        <translation>Brak proxy. Możesz dodać proxy klikając przycisk Dodaj.</translation>
    </message>
    <message>
        <location filename="../sbi_networkicondialog.ui" line="104"/>
        <source>All changes must be saved with Save button.</source>
        <translation>Wszystkie zmiany muszą być potwierdzone przyciskiem Zapisz.</translation>
    </message>
    <message>
        <location filename="../sbi_networkicondialog.cpp" line="57"/>
        <source>Name of proxy:</source>
        <translation>Nazwa proxy:</translation>
    </message>
    <message>
        <location filename="../sbi_networkicondialog.cpp" line="70"/>
        <source>Remove current proxy</source>
        <translation>Usuń aktualne proxy</translation>
    </message>
    <message>
        <location filename="../sbi_networkicondialog.cpp" line="70"/>
        <source>Are you sure you want to remove current proxy?</source>
        <translation>Na pewno chcesz usunąć aktualne proxy?</translation>
    </message>
</context>
<context>
    <name>SBI_ProxyWidget</name>
    <message>
        <location filename="../sbi_proxywidget.ui" line="14"/>
        <source>Form</source>
        <translation>Z</translation>
    </message>
    <message>
        <location filename="../sbi_proxywidget.ui" line="23"/>
        <source>HTTP</source>
        <translation>HTTP</translation>
    </message>
    <message>
        <location filename="../sbi_proxywidget.ui" line="28"/>
        <source>SOCKS5</source>
        <translation>SOCKS5</translation>
    </message>
    <message>
        <location filename="../sbi_proxywidget.ui" line="39"/>
        <source>Port:</source>
        <translation>Port:</translation>
    </message>
    <message>
        <location filename="../sbi_proxywidget.ui" line="76"/>
        <source>Username:</source>
        <translation>Nazwa użytkownika:</translation>
    </message>
    <message>
        <location filename="../sbi_proxywidget.ui" line="86"/>
        <source>Password:</source>
        <translation>Hasło:</translation>
    </message>
    <message>
        <location filename="../sbi_proxywidget.ui" line="111"/>
        <source>S&ystem proxy configuration</source>
        <translation>S&ystemowe ustawienia proxy</translation>
    </message>
    <message>
        <location filename="../sbi_proxywidget.ui" line="118"/>
        <source>&Manual configuration</source>
        <translation>&Ręczna konfiguracja</translation>
    </message>
</context>
<context>
    <name>SBI_SettingsDialog</name>
    <message>
        <location filename="../sbi_settingsdialog.ui" line="14"/>
        <source>StatusBar Icons</source>
        <translation>Ikona Statusu</translation>
    </message>
    <message>
        <location filename="../sbi_settingsdialog.ui" line="48"/>
        <source>
StatusBar Icons
</source>
        <translation>
Ikona paska statusu
</translation>
    </message>
    <message>
        <location filename="../sbi_settingsdialog.ui" line="70"/>
        <source>These icons will be displayed in statusbar:</source>
        <translation>Te ikony będą widoczne na pasku statusu.</translation>
    </message>
    <message>
        <location filename="../sbi_settingsdialog.ui" line="97"/>
        <source>Images Icon</source>
        <translation>Ikona obrazów</translation>
    </message>
    <message>
        <location filename="../sbi_settingsdialog.ui" line="104"/>
        <source>JavaScript Icon</source>
        <translation>Ikona JavaScript</translation>
    </message>
    <message>
        <location filename="../sbi_settingsdialog.ui" line="111"/>
        <source>Network Icon</source>
        <translation>Ikona sieci</translation>
    </message>
    <message>
        <location filename="../sbi_settingsdialog.ui" line="118"/>
        <source>Zoom widget</source>
        <translation>Widżet powiększenia</translation>
    </message>
</context>
<context>
    <name>SBI_ZoomWidget</name>
    <message>
        <location filename="../sbi_zoomwidget.cpp" line="48"/>
        <source>Zoom: %1%</source>
        <translation>Powiększenie: %1%</translation>
    </message>
</context>
</TS>

{'repo_name': 'QupZilla/qupzilla', 'stars': '1044', 'repo_language': 'C++', 'file_name': 'nl_NL.ts', 'mime_type': 'text/xml', 'hash': -5195963595377807993, 'source_dataset': 'data'}


// Meeting Rooms II

/// answer = maximum clique = maximum number of intersecting intervals

class Solution {
public:
  int minMeetingRooms(vector<Interval>& intervals) {
    int n = intervals.size(), r = 0;
    vector<int> a, b;
    for (auto &i: intervals) {
      a.push_back(i.start);
      b.push_back(i.end);
    }
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    for (int c = 0, i = 0, j = 0; i < n; ) {
      if (a[i] < b[j])
        i++, c++;
      else
        j++, c--;
      r = max(r, c);
    }
    return r;
  }
};

/// answer = chromatic number. graph coloring with greedy algorithm

class Solution {
public:
  int minMeetingRooms(vector<Interval>& intervals) {
    sort(intervals.begin(), intervals.end(), [](const Interval &x, const Interval &y) { return x.start < y.start; });
    priority_queue<int, vector<int>, greater<int>> h;
    for (auto &i: intervals) {
      if (! h.empty() && h.top() <= i.start)
        h.pop();
      h.push(i.end);
    }
    return h.size();
  }
};

{'repo_name': 'MaskRay/LeetCode', 'stars': '427', 'repo_language': 'C++', 'file_name': 'find-the-derangement-of-an-array.cc', 'mime_type': 'text/x-c', 'hash': -9132907576993401582, 'source_dataset': 'data'}


BERT
----------------------------------------------------

Overview
~~~~~~~~~~~~~~~~~~~~~

The BERT model was proposed in `BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding <https://arxiv.org/abs/1810.04805>`__
by Jacob Devlin, Ming-Wei Chang, Kenton Lee and Kristina Toutanova. It's a bidirectional transformer
pre-trained using a combination of masked language modeling objective and next sentence prediction
on a large corpus comprising the Toronto Book Corpus and Wikipedia.

The abstract from the paper is the following:

*We introduce a new language representation model called BERT, which stands for Bidirectional Encoder Representations
from Transformers. Unlike recent language representation models, BERT is designed to pre-train deep bidirectional
representations from unlabeled text by jointly conditioning on both left and right context in all layers. As a result,
the pre-trained BERT model can be fine-tuned with just one additional output layer to create state-of-the-art models
for a wide range of tasks, such as question answering and language inference, without substantial task-specific
architecture modifications.*

*BERT is conceptually simple and empirically powerful. It obtains new state-of-the-art results on eleven natural
language processing tasks, including pushing the GLUE score to 80.5% (7.7% point absolute improvement), MultiNLI
accuracy to 86.7% (4.6% absolute improvement), SQuAD v1.1 question answering Test F1 to 93.2 (1.5 point absolute
improvement) and SQuAD v2.0 Test F1 to 83.1 (5.1 point absolute improvement).*

Tips:

- BERT is a model with absolute position embeddings so it's usually advised to pad the inputs on
  the right rather than the left.
- BERT was trained with a masked language modeling (MLM) objective. It is therefore efficient at predicting masked
  tokens and at NLU in general, but is not optimal for text generation. Models trained with a causal language
  modeling (CLM) objective are better in that regard.
- Alongside MLM, BERT was trained using a next sentence prediction (NSP) objective using the [CLS] token as a sequence
  approximate. The user may use this token (the first token in a sequence built with special tokens) to get a sequence
  prediction rather than a token prediction. However, averaging over the sequence may yield better results than using
  the [CLS] token.

The original code can be found `here <https://github.com/google-research/bert>`_.

BertConfig
~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.BertConfig
    :members:

BertTokenizer
~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.BertTokenizer
    :members: build_inputs_with_special_tokens, get_special_tokens_mask,
        create_token_type_ids_from_sequences, save_vocabulary

BertTokenizerFast
~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.BertTokenizerFast
    :members:

BertModel
~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.BertModel
    :members:

BertForPreTraining
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.BertForPreTraining
    :members:

BertForMaskedLM
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.BertForMaskedLM
    :members:

BertForNextSentencePrediction
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.BertForNextSentencePrediction
    :members:

BertForSequenceClassification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.BertForSequenceClassification
    :members:

BertForMultipleChoice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.BertForMultipleChoice
    :members:

BertForTokenClassification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.BertForTokenClassification
    :members:

BertForQuestionAnswering
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.BertForQuestionAnswering
    :members:

TFBertModel
~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.TFBertModel
    :members:

TFBertForPreTraining
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.TFBertForPreTraining
    :members:

TFBertForMaskedLM
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.TFBertForMaskedLM
    :members:

TFBertForNextSentencePrediction
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.TFBertForNextSentencePrediction
    :members:

TFBertForSequenceClassification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.TFBertForSequenceClassification
    :members:

TFBertForMultipleChoice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.TFBertForMultipleChoice
    :members:

TFBertForTokenClassification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.TFBertForTokenClassification
    :members:

TFBertForQuestionAnswering
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. autoclass:: transformers.TFBertForQuestionAnswering
    :members:

{'repo_name': 'bhoov/exbert', 'stars': '312', 'repo_language': 'Python', 'file_name': '__init__.py', 'mime_type': 'text/x-python', 'hash': 8849485457328070197, 'source_dataset': 'data'}


$ time python3 test_faup.py urls.txt

real			0m2.252s
user			0m2.128s
sys			0m0.120s

$ time python3 test_regex.py urls.txt
Success:680211;Failures:15842

real	0m3.845s
user	0m3.786s
sys	0m0.057s

$ time python3 ./test_urllib.py urls.txt

real	0m7.406s
user	0m7.345s
sys	0m0.058s

$ time python3 test_qurl.py urls.txt

real			0m4.413s
user			0m4.244s
sys			0m0.166s

{'repo_name': 'stricaud/faup', 'stars': '147', 'repo_language': 'C', 'file_name': 'postinst', 'mime_type': 'text/plain', 'hash': -5059928381571291134, 'source_dataset': 'data'}


/**
 * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
 */

CKEDITOR.plugins.add( 'popup' );

CKEDITOR.tools.extend( CKEDITOR.editor.prototype, {
	/**
	 * Opens Browser in a popup. The `width` and `height` parameters accept
	 * numbers (pixels) or percent (of screen size) values.
	 *
	 * @member CKEDITOR.editor
	 * @param {String} url The url of the external file browser.
	 * @param {Number/String} [width='80%'] Popup window width.
	 * @param {Number/String} [height='70%'] Popup window height.
	 * @param {String} [options='location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes']
	 * Popup window features.
	 */
	popup: function( url, width, height, options ) {
		width = width || '80%';
		height = height || '70%';

		if ( typeof width == 'string' && width.length > 1 && width.substr( width.length - 1, 1 ) == '%' )
			width = parseInt( window.screen.width * parseInt( width, 10 ) / 100, 10 );

		if ( typeof height == 'string' && height.length > 1 && height.substr( height.length - 1, 1 ) == '%' )
			height = parseInt( window.screen.height * parseInt( height, 10 ) / 100, 10 );

		if ( width < 640 )
			width = 640;

		if ( height < 420 )
			height = 420;

		var top = parseInt( ( window.screen.height - height ) / 2, 10 ),
			left = parseInt( ( window.screen.width - width ) / 2, 10 );

		options = ( options || 'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes' ) + ',width=' + width +
			',height=' + height +
			',top=' + top +
			',left=' + left;

		var popupWindow = window.open( '', null, options, true );

		// Blocked by a popup blocker.
		if ( !popupWindow )
			return false;

		try {
			// Chrome is problematic with moveTo/resizeTo, but it's not really needed here (https://dev.ckeditor.com/ticket/8855).
			var ua = navigator.userAgent.toLowerCase();
			if ( ua.indexOf( ' chrome/' ) == -1 ) {
				popupWindow.moveTo( left, top );
				popupWindow.resizeTo( width, height );
			}
			popupWindow.focus();
			popupWindow.location.href = url;
		} catch ( e ) {
			popupWindow = window.open( url, null, options, true );
		}

		return true;
	}
} );

{'repo_name': 'greyli/helloflask', 'stars': '952', 'repo_language': 'None', 'file_name': 'improvement.md', 'mime_type': 'text/x-python', 'hash': -8075605008658096817, 'source_dataset': 'data'}


<?php

namespace Marquine\Etl\Database;

use InvalidArgumentException;

class Manager
{
    /**
     * The Connection Factory.
     *
     * @var \Marquine\Etl\Database\ConnectionFactory
     */
    protected $factory;

    /**
     * The connections configuration.
     *
     * @var array
     */
    protected $config = [];

    /**
     * The connections instances.
     *
     * @var array
     */
    protected $connections = [];

    /**
     * Create a new database manager instance.
     *
     * @param  \Marquine\Etl\Database\ConnectionFactory  $factory
     * @return void
     */
    public function __construct(ConnectionFactory $factory)
    {
        $this->factory = $factory;
    }

    /**
     * Register a connection.
     *
     * @param  array  $config
     * @param  string  $name
     * @return void
     */
    public function addConnection($config, $name = 'default')
    {
        $this->config[$name] = $config;
    }

    /**
     * Get a connection instance.
     *
     * @param  string  $name
     * @return \Marquine\Etl\Database\Connection
     */
    protected function getConnection($name)
    {
        if (! isset($this->connections[$name])) {
            $this->connections[$name] = $this->makeConnection($name);
        }

        return $this->connections[$name];
    }

    /**
     * Make a connection instance.
     *
     * @param  string  $name
     * @return \Marquine\Etl\Database\Connection
     *
     * @throws \InvalidArgumentException
     */
    protected function makeConnection($name)
    {
        if (isset($this->config[$name])) {
            return $this->factory->make($this->config[$name]);
        }

        throw new InvalidArgumentException("Database [{$name}] not configured.");
    }

    /**
     * Get a new query builder instance.
     *
     * @param  string  $connection
     * @return \Marquine\Etl\Database\Query
     */
    public function query($connection)
    {
        return new Query($this->getConnection($connection));
    }

    /**
     * Get a new statement builder instance.
     *
     * @param  string  $connection
     * @return \Marquine\Etl\Database\Statement
     */
    public function statement($connection)
    {
        return new Statement($this->getConnection($connection));
    }

    /**
     * Get a new transaction instance.
     *
     * @param  string  $connection
     * @return \Marquine\Etl\Database\Transaction
     */
    public function transaction($connection)
    {
        return new Transaction($this->getConnection($connection));
    }

    /**
     * Get the pdo connection instance.
     *
     * @param  string  $connection
     * @return \PDO
     */
    public function pdo($connection)
    {
        return $this->getConnection($connection);
    }
}

{'repo_name': 'leomarquine/php-etl', 'stars': '117', 'repo_language': 'PHP', 'file_name': 'json2.json', 'mime_type': 'text/plain', 'hash': -2861559263316102043, 'source_dataset': 'data'}


// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<Form/> handles submit event 1`] = `
<form
  onSubmit={[Function]}
>
  <div
    className="FormMessageStyled-fwGYVz inUxOm"
  >
    test
  </div>
</form>
`;

exports[`<Form/> renders correctly if prop errorMessage set 1`] = `
<form
  onSubmit={[Function]}
>
  <div
    className="FormMessageStyled-fwGYVz inUxOm"
  >
    test
  </div>
</form>
`;

exports[`<Form/> renders correctly with default props 1`] = `
<form
  onSubmit={[Function]}
>
  <input />
</form>
`;

exports[`<Form/> renders correctly, handles update and scrolls to field 1`] = `
<form
  onSubmit={[Function]}
>
  <div
    className="FormMessageStyled-fwGYVz inUxOm"
  >
    test
  </div>
</form>
`;

exports[`<Form/> renders correctly, handles update and scrolls to field 2`] = `
<form
  onSubmit={[Function]}
>
  <div
    className="FormMessageStyled-fwGYVz inUxOm"
  >
    test
  </div>
</form>
`;

exports[`<FormItem> renders correctly with default props 1`] = `
<div
  className="FormItemStyled-gPCFon eiiyPI"
/>
`;

{'repo_name': 'bcrumbs/reactackle', 'stars': '277', 'repo_language': 'JavaScript', 'file_name': 'svgMock.js', 'mime_type': 'text/plain', 'hash': 6629582695076011938, 'source_dataset': 'data'}