file_name large_stringlengths 4 140 | prefix large_stringlengths 0 12.1k | suffix large_stringlengths 0 12k | middle large_stringlengths 0 7.51k | fim_type large_stringclasses 4
values |
|---|---|---|---|---|
patsub.py | # -*- coding: utf-8 -*-
# Copyright (C) 2020 Rocky Bernstein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | min_abbrev = len("pats")
min_args = 2
short_help = "Set pattern substitution rule"
def run(self, args):
self.proc.add_remap_pat(args[0], args[1])
pass
if __name__ == "__main__":
from trepan.processor.command.set_subcmd import __demo_helper__ as Mhelper
Mhelper.demo_run(SetPatSu... | """**set patsub** *from-re* *replace-string*
Add a substitution pattern rule replacing *patsub* with
*replace-string* anywhere it is found in source file names. If a
substitution rule was previously set for *from-re*, the old rule is
replaced by the new one.
In the following example, suppose in a docker container /m... | identifier_body |
patsub.py | # -*- coding: utf-8 -*-
# Copyright (C) 2020 Rocky Bernstein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | *replace-string* anywhere it is found in source file names. If a
substitution rule was previously set for *from-re*, the old rule is
replaced by the new one.
In the following example, suppose in a docker container /mnt/project is
the mount-point for /home/rocky/project. You are running the code
from the docker contai... |
class SetPatSub(Mbase_subcmd.DebuggerSubcommand):
"""**set patsub** *from-re* *replace-string*
Add a substitution pattern rule replacing *patsub* with | random_line_split |
patsub.py | # -*- coding: utf-8 -*-
# Copyright (C) 2020 Rocky Bernstein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | from trepan.processor.command.set_subcmd import __demo_helper__ as Mhelper
Mhelper.demo_run(SetPatSub)
pass | conditional_block | |
patsub.py | # -*- coding: utf-8 -*-
# Copyright (C) 2020 Rocky Bernstein
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | (self, args):
self.proc.add_remap_pat(args[0], args[1])
pass
if __name__ == "__main__":
from trepan.processor.command.set_subcmd import __demo_helper__ as Mhelper
Mhelper.demo_run(SetPatSub)
pass
| run | identifier_name |
task.py | from the start of the L{LoopingCall}) to
be measured in intervals
@return: The C{int} number of intervals which have passed as of the
given point in time.
"""
elapsedTime = t - self.starttime
intervalNum = int(elapsedTime / self.interval)
return intervalN... |
return d
def pause(self):
"""
Pause this L{CooperativeTask}. Stop doing work until
L{CooperativeTask.resume} is called. If C{pause} is called more than
once, C{resume} must be called an equal number of times to resume this
task.
@raise TaskFinished: if t... | d.callback(self._completionResult) | conditional_block |
task.py | operator = cooperator
self._deferreds = []
self._pauseCount = 0
self._completionState = None
self._completionResult = None
cooperator._addTask(self)
def whenDone(self):
"""
Get a L{defer.Deferred} notification of when this task is complete.
@return:... | Clock | identifier_name | |
task.py | from the start of the L{LoopingCall}) to
be measured in intervals
@return: The C{int} number of intervals which have passed as of the
given point in time.
"""
elapsedTime = t - self.starttime
intervalNum = int(elapsedTime / self.interval)
return intervalN... | Schedule the next iteration of this looping call.
"""
if self.interval == 0:
self.call = self.clock.callLater(0, self)
return
currentTime = self.clock.seconds()
# Find how long is left until the interval comes around again.
untilNextTime = (self._... |
def _reschedule(self):
""" | random_line_split |
task.py | from the start of the L{LoopingCall}) to
be measured in intervals
@return: The C{int} number of intervals which have passed as of the
given point in time.
"""
elapsedTime = t - self.starttime
intervalNum = int(elapsedTime / self.interval)
return intervalN... |
class TaskFinished(SchedulerError):
"""
The operation could not complete because the task was already completed,
stopped, encountered an error or otherwise permanently stopped running.
"""
class TaskDone(TaskFinished):
"""
The operation could not complete because the task was already comp... | """
The operation could not complete because the scheduler was stopped in
progress or was already stopped.
""" | identifier_body |
application_module.ts | /**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {ApplicationInitStatus} from './application_init';
import {ApplicationRef} from './application_ref';
import {... |
}
| {} | identifier_body |
application_module.ts | /**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {ApplicationInitStatus} from './application_init';
import {ApplicationRef} from './application_ref';
import {... | (appRef: ApplicationRef) {}
}
| constructor | identifier_name |
application_module.ts | /**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {ApplicationInitStatus} from './application_init';
import {ApplicationRef} from './application_ref';
import {... | }
export function _keyValueDiffersFactory() {
return defaultKeyValueDiffers;
}
export function _localeFactory(locale?: string): string {
return locale || 'en-US';
}
/**
* This module includes the providers of @angular/core that are needed
* to bootstrap components via `ApplicationRef`.
*
* @experimental
*/
... | return defaultIterableDiffers; | random_line_split |
kendo.culture.pa-IN.js | /*
* Kendo UI v2014.3.1119 (http://www.telerik.com/kendo-ui)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial lice... | M: "dd MMMM",
s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss",
t: "tt hh:mm",
T: "tt hh:mm:ss",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
y: "MMMM, yyyy",
Y: "MMMM, yyyy"
},
... | D: "dd MMMM yyyy dddd",
F: "dd MMMM yyyy dddd tt hh:mm:ss",
g: "dd-MM-yy tt hh:mm",
G: "dd-MM-yy tt hh:mm:ss",
m: "dd MMMM", | random_line_split |
CacheKill.py | from plugins.external.sergio_proxy.plugins.plugin import Plugin
class CacheKill(Plugin):
name = "CacheKill Plugin"
optname = "cachekill"
desc = "Kills page caching by modifying headers."
implements = ["handleHeader","connectionMade"]
has_opts = True
bad_headers = ['if-none-match','if-modified-s... | if h in request.headers:
request.headers[h] = "" | random_line_split | |
CacheKill.py | from plugins.external.sergio_proxy.plugins.plugin import Plugin
class CacheKill(Plugin):
name = "CacheKill Plugin"
optname = "cachekill"
desc = "Kills page caching by modifying headers."
implements = ["handleHeader","connectionMade"]
has_opts = True
bad_headers = ['if-none-match','if-modified-s... | (self,options):
options.add_argument("--preserve-cookies",action="store_true",
help="Preserve cookies (will allow caching in some situations).")
def handleHeader(self,request,key,value):
'''Handles all response headers'''
request.client.headers['Expires'] = "0"
reques... | add_options | identifier_name |
CacheKill.py | from plugins.external.sergio_proxy.plugins.plugin import Plugin
class CacheKill(Plugin):
name = "CacheKill Plugin"
optname = "cachekill"
desc = "Kills page caching by modifying headers."
implements = ["handleHeader","connectionMade"]
has_opts = True
bad_headers = ['if-none-match','if-modified-s... |
def connectionMade(self,request):
'''Handles outgoing request'''
request.headers['Pragma'] = 'no-cache'
for h in self.bad_headers:
if h in request.headers:
request.headers[h] = ""
| '''Handles all response headers'''
request.client.headers['Expires'] = "0"
request.client.headers['Cache-Control'] = "no-cache" | identifier_body |
CacheKill.py | from plugins.external.sergio_proxy.plugins.plugin import Plugin
class CacheKill(Plugin):
name = "CacheKill Plugin"
optname = "cachekill"
desc = "Kills page caching by modifying headers."
implements = ["handleHeader","connectionMade"]
has_opts = True
bad_headers = ['if-none-match','if-modified-s... | request.headers[h] = "" | conditional_block | |
unifi.py | """
Support for Unifi WAP controllers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.unifi/
"""
import logging
import urllib
from homeassistant.components.device_tracker import DOMAIN
from homeassistant.const import CONF_HOST, CONF_USERN... | (self, controller):
"""Initialize the scanner."""
self._controller = controller
self._update()
def _update(self):
"""Get the clients from the device."""
try:
clients = self._controller.get_clients()
except urllib.error.HTTPError as ex:
_LOGGER... | __init__ | identifier_name |
unifi.py | """
Support for Unifi WAP controllers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.unifi/
"""
import logging
import urllib
from homeassistant.components.device_tracker import DOMAIN
from homeassistant.const import CONF_HOST, CONF_USERN... |
def scan_devices(self):
"""Scan for devices."""
self._update()
return self._clients.keys()
def get_device_name(self, mac):
"""Return the name (if known) of the device.
If a name has been set in Unifi, then return that, else
return the hostname if it has been d... | """Get the clients from the device."""
try:
clients = self._controller.get_clients()
except urllib.error.HTTPError as ex:
_LOGGER.error('Failed to scan clients: %s', ex)
clients = []
self._clients = {client['mac']: client for client in clients} | identifier_body |
unifi.py | """
Support for Unifi WAP controllers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.unifi/
"""
import logging
import urllib
from homeassistant.components.device_tracker import DOMAIN
from homeassistant.const import CONF_HOST, CONF_USERN... |
this_config = config[DOMAIN]
host = this_config.get(CONF_HOST, 'localhost')
username = this_config.get(CONF_USERNAME)
password = this_config.get(CONF_PASSWORD)
site_id = this_config.get(CONF_SITE_ID, 'default')
try:
port = int(this_config.get(CONF_PORT, 8443))
except ValueError:
... | _LOGGER.error('Invalid configuration')
return False | conditional_block |
unifi.py | """
Support for Unifi WAP controllers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.unifi/
"""
import logging
import urllib
from homeassistant.components.device_tracker import DOMAIN
from homeassistant.const import CONF_HOST, CONF_USERN... | _LOGGER.debug('Device %s name %s', mac, name)
return name | random_line_split | |
callbacks.ts | class CallbacksTest {
constructor(private opts: qq.CallbackOptions) {
}
testCallbacks() {
const opts = this.opts;
interface CustomType {
myTypeOfClass: string;
}
opts.onAutoRetry = (id, name, attemptNumber) => {};
opts.onCancel = (id, name) => {};
| opts.onDelete = (id) => {};
opts.onDeleteComplete = (id, xhr, isError) => {};
opts.onError = (id, name, errorReason, xhr) => {};
opts.onManualRetry = (id, name) => {
return true;
};
opts.onPasteReceived = (blob) => {};
opts.onProgress = (id, name,... | opts.onComplete = (id: number, name: string, responseJSON: CustomType, xhr: XMLHttpRequest) => {};
opts.onAllComplete = (succeeded, failed) => {};
| random_line_split |
callbacks.ts | class CallbacksTest {
| (private opts: qq.CallbackOptions) {
}
testCallbacks() {
const opts = this.opts;
interface CustomType {
myTypeOfClass: string;
}
opts.onAutoRetry = (id, name, attemptNumber) => {};
opts.onCancel = (id, name) => {};
opts.onComplete = (id: number, ... | constructor | identifier_name |
connected-position-strategy.ts | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Direction} from '@angular/cdk/bidi';
import {Platform} from '@angular/cdk/platform';
import {CdkScrollable, V... |
return this;
}
/**
* Sets an offset for the overlay's connection point on the x-axis
* @param offset New offset in the X axis.
*/
withOffsetX(offset: number): this {
this._positionStrategy.withDefaultOffsetX(offset);
return this;
}
/**
* Sets an offset for the overlay's connection ... | {
this._direction = dir;
} | conditional_block |
connected-position-strategy.ts | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Direction} from '@angular/cdk/bidi';
import {Platform} from '@angular/cdk/platform';
import {CdkScrollable, V... |
/**
* Sets the origin element, relative to which to position the overlay.
* @param origin Reference to the new origin element.
*/
setOrigin(origin: ElementRef): this {
this._positionStrategy.setOrigin(origin);
return this;
}
}
| {
this._preferredPositions = positions.slice();
this._positionStrategy.withPositions(this._preferredPositions);
return this;
} | identifier_body |
connected-position-strategy.ts | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Direction} from '@angular/cdk/bidi';
import {Platform} from '@angular/cdk/platform';
import {CdkScrollable, V... | () {
this._positionStrategy.detach();
}
/**
* Updates the position of the overlay element, using whichever preferred position relative
* to the origin fits on-screen.
* @docs-private
*/
apply(): void {
this._positionStrategy.apply();
}
/**
* Re-positions the overlay element with the t... | detach | identifier_name |
connected-position-strategy.ts | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Direction} from '@angular/cdk/bidi';
import {Platform} from '@angular/cdk/platform';
import {CdkScrollable, V... | * @docs-private
*/
_positionStrategy: FlexibleConnectedPositionStrategy;
/** The overlay to which this strategy is attached. */
private _overlayRef: OverlayReference;
private _direction: Direction | null;
/** Ordered list of preferred positions, from most to least desirable. */
_preferredPositions:... | random_line_split | |
lastIndexOf.js | define(['./_baseFindIndex', './_baseIsNaN', './_strictLastIndexOf', './toInteger'], function(baseFindIndex, baseIsNaN, strictLastIndexOf, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/* Built-in method references for those with the same name as other `loda... |
return lastIndexOf;
});
| {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
var index = length;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
}
return value === value
? strictLast... | identifier_body |
lastIndexOf.js | define(['./_baseFindIndex', './_baseIsNaN', './_strictLastIndexOf', './toInteger'], function(baseFindIndex, baseIsNaN, strictLastIndexOf, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/* Built-in method references for those with the same name as other `loda... | * @category Array
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} [fromIndex=array.length-1] The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
* @example
*
* _.lastIndexOf([1, 2, 1, 2], 2);
... | * @memberOf _
* @since 0.1.0 | random_line_split |
lastIndexOf.js | define(['./_baseFindIndex', './_baseIsNaN', './_strictLastIndexOf', './toInteger'], function(baseFindIndex, baseIsNaN, strictLastIndexOf, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/* Built-in method references for those with the same name as other `loda... |
var index = length;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
}
return value === value
? strictLastIndexOf(array, value, index)
: baseFindIndex(array, baseIsNaN, index, true);
}... | {
return -1;
} | conditional_block |
lastIndexOf.js | define(['./_baseFindIndex', './_baseIsNaN', './_strictLastIndexOf', './toInteger'], function(baseFindIndex, baseIsNaN, strictLastIndexOf, toInteger) {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
/* Built-in method references for those with the same name as other `loda... | (array, value, fromIndex) {
var length = array ? array.length : 0;
if (!length) {
return -1;
}
var index = length;
if (fromIndex !== undefined) {
index = toInteger(fromIndex);
index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
}
return value ==... | lastIndexOf | identifier_name |
urls.py | from django.conf import settings
from django.conf.urls import url
from plans.views import CreateOrderView, OrderListView, InvoiceDetailView, AccountActivationView, \
OrderPaymentReturnView, CurrentPlanView, UpgradePlanView, OrderView, BillingInfoRedirectView, \
BillingInfoCreateView, BillingInfoUpdateView, Bil... | urlpatterns += [
url(r'^fakepayments/(?P<pk>\d+)/$', FakePaymentsView.as_view(), name='fake_payments'),
] | conditional_block | |
urls.py | from django.conf import settings
from django.conf.urls import url
from plans.views import CreateOrderView, OrderListView, InvoiceDetailView, AccountActivationView, \
OrderPaymentReturnView, CurrentPlanView, UpgradePlanView, OrderView, BillingInfoRedirectView, \
BillingInfoCreateView, BillingInfoUpdateView, Bil... | if getattr(settings, 'DEBUG', False):
urlpatterns += [
url(r'^fakepayments/(?P<pk>\d+)/$', FakePaymentsView.as_view(), name='fake_payments'),
] | ]
| random_line_split |
FormatChangeSelectionTest.ts | import { describe, it } from '@ephox/bedrock-client';
import { TinyAssertions, TinyHooks, TinySelections } from '@ephox/mcagar';
import Editor from 'tinymce/core/api/Editor';
import Theme from 'tinymce/themes/silver/Theme';
describe('browser.tinymce.core.fmt.FormatChangeSelectionTest', () => {
const hook = TinyHooks... | editor.setContent('<p><em><strong>a </strong>b<strong> c</strong></em></p>');
TinySelections.setSelection(editor, [ 0, 0, 1 ], 0, [ 0, 0, 2 ], 0);
editor.execCommand('italic');
TinyAssertions.assertContent(editor, '<p><em><strong>a </strong></em>b<em><strong> c</strong></em></p>');
TinyAssertions.as... |
it('Check selection after removing part of an inline format', () => {
const editor = hook.editor(); | random_line_split |
LaserMatrix.js | import React from 'react';
import Analyzer from 'parser/core/Analyzer';
import { formatNumber, formatPercentage } from 'common/format';
import SPELLS from 'common/SPELLS/index';
import TraitStatisticBox, { STATISTIC_ORDER } from 'interface/others/TraitStatisticBox';
import SpellLink from 'common/SpellLink';
/**
* You... | this.active = this.selectedCombatant.hasTrait(SPELLS.LASER_MATRIX.id);
}
on_byPlayer_heal(event) {
const spellId = event.ability.guid;
if (spellId === SPELLS.LASER_MATRIX_HEAL.id) {
this.healing += event.amount + (event.absorbed || 0);
}
}
on_byPlayer_damage(event) {
const spellId =... | healing = 0;
damage = 0;
constructor(...args){
super(...args); | random_line_split |
LaserMatrix.js | import React from 'react';
import Analyzer from 'parser/core/Analyzer';
import { formatNumber, formatPercentage } from 'common/format';
import SPELLS from 'common/SPELLS/index';
import TraitStatisticBox, { STATISTIC_ORDER } from 'interface/others/TraitStatisticBox';
import SpellLink from 'common/SpellLink';
/**
* You... |
}
// TODO - Show actual gain from Reorigination Array (as an own module perhaps?)
statistic(){
const healingThroughputPercent = this.owner.getPercentageOfTotalHealingDone(this.healing);
const damageThroughputPercent = this.owner.getPercentageOfTotalDamageDone(this.damage);
return(
<TraitStati... | {
this.damage += event.amount + (event.absorbed || 0);
} | conditional_block |
LaserMatrix.js | import React from 'react';
import Analyzer from 'parser/core/Analyzer';
import { formatNumber, formatPercentage } from 'common/format';
import SPELLS from 'common/SPELLS/index';
import TraitStatisticBox, { STATISTIC_ORDER } from 'interface/others/TraitStatisticBox';
import SpellLink from 'common/SpellLink';
/**
* You... | )}
/>
);
}
}
export default LaserMatrix;
| {
const healingThroughputPercent = this.owner.getPercentageOfTotalHealingDone(this.healing);
const damageThroughputPercent = this.owner.getPercentageOfTotalDamageDone(this.damage);
return(
<TraitStatisticBox
position={STATISTIC_ORDER.OPTIONAL()}
trait={SPELLS.LASER_MATRIX.id}
... | identifier_body |
LaserMatrix.js | import React from 'react';
import Analyzer from 'parser/core/Analyzer';
import { formatNumber, formatPercentage } from 'common/format';
import SPELLS from 'common/SPELLS/index';
import TraitStatisticBox, { STATISTIC_ORDER } from 'interface/others/TraitStatisticBox';
import SpellLink from 'common/SpellLink';
/**
* You... | extends Analyzer{
healing = 0;
damage = 0;
constructor(...args){
super(...args);
this.active = this.selectedCombatant.hasTrait(SPELLS.LASER_MATRIX.id);
}
on_byPlayer_heal(event) {
const spellId = event.ability.guid;
if (spellId === SPELLS.LASER_MATRIX_HEAL.id) {
this.healing += event... | LaserMatrix | identifier_name |
app.e2e-spec.ts | import { browser, element, by, logging } from 'protractor';
describe('Inputs and Outputs', () => {
beforeEach(() => browser.get(''));
// helper function used to test what's logged to the console
async function logChecker(contents: string) |
it('should have title Inputs and Outputs', async () => {
const title = element.all(by.css('h1')).get(0);
expect(await title.getText()).toEqual('Inputs and Outputs');
});
it('should add 123 to the parent list', async () => {
const addToParentButton = element.all(by.css('button')).get(0);
const a... | {
const logs = await browser
.manage()
.logs()
.get(logging.Type.BROWSER);
const messages = logs.filter(({ message }) => message.indexOf(contents) !== -1);
expect(messages.length).toBeGreaterThan(0);
} | identifier_body |
app.e2e-spec.ts | import { browser, element, by, logging } from 'protractor';
describe('Inputs and Outputs', () => {
beforeEach(() => browser.get(''));
// helper function used to test what's logged to the console
async function | (contents: string) {
const logs = await browser
.manage()
.logs()
.get(logging.Type.BROWSER);
const messages = logs.filter(({ message }) => message.indexOf(contents) !== -1);
expect(messages.length).toBeGreaterThan(0);
}
it('should have title Inputs and Outputs', async () => {
con... | logChecker | identifier_name |
app.e2e-spec.ts | import { browser, element, by, logging } from 'protractor';
describe('Inputs and Outputs', () => {
beforeEach(() => browser.get(''));
// helper function used to test what's logged to the console
async function logChecker(contents: string) {
const logs = await browser
.manage()
.logs()
.g... | }); | });
| random_line_split |
logging_config.py | OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
"""
Configuration functions for the logging package for Python. The core package
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
by Apache's log4j system.
Should work under Python versions >= 1.5.2, except that sourc... | chunk = self.connection.recv(slen)
while len(chunk) < slen:
chunk = chunk + conn.recv(slen - len(chunk))
#Apply new configuration. We'd like to be able to
#create a StringIO and pass that | """
Handler for a logging configuration request.
It expects a completely new logging configuration and uses fileConfig
to install it.
"""
def handle(self):
"""
Handle a request.
Each request is expected to be a 4-byte length, packed using
... | identifier_body |
logging_config.py | import threading
except ImportError:
thread = None
from SocketServer import ThreadingTCPServer, StreamRequestHandler
DEFAULT_LOGGING_CONFIG_PORT = 9030
if sys.platform == "win32":
RESET_ERROR = 10054 #WSAECONNRESET
else:
RESET_ERROR = 104 #ECONNRESET
#
# The following code implements a sock... | ConfigSocketReceiver | identifier_name | |
logging_config.py |
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
"""
Configuration functions for the logging package for Python. The core package
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
by Apache's log4j system.
Should work under Python versions >= 1.5.2, except that source li... |
def _resolve(name):
"""Resolve a dotted name to a global object."""
name = string.split(name, '.')
used = name.pop(0)
found = __import__(used)
for n in name:
used = used + '.' + n
try:
found = getattr(found, n)
except AttributeError:
__import__(used)... | logging._releaseLock() | random_line_split |
logging_config.py |
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
"""
Configuration functions for the logging package for Python. The core package
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
by Apache's log4j system.
Should work under Python versions >= 1.5.2, except that source li... |
handlers[hand] = h
#now all handlers are loaded, fixup inter-handler references...
for h, t in fixups:
h.setTarget(handlers[t])
return handlers
def _install_loggers(cp, handlers):
"""Create and install loggers"""
# configure the root first
llist = cp.get("loggers", "keys")
... | fixups.append((h, target)) | conditional_block |
review_group_user.py | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.utils import six
from djblets.util.decorators import augment_method_from
from djblets.webapi.decorators import (webapi_login_required,
... |
@webapi_check_local_site
@augment_method_from(WebAPIResource)
def get_list(self, *args, **kwargs):
"""Retrieves the list of users belonging to a specific review group.
This includes only the users who have active accounts on the site.
Any account that has been disabled (for inacti... | """Removes a user from a review group."""
group_resource = resources.review_group
try:
group = group_resource.get_object(request, *args, **kwargs)
user = self.get_object(request, *args, **kwargs)
except ObjectDoesNotExist:
return DOES_NOT_EXIST
local... | identifier_body |
review_group_user.py | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.utils import six
from djblets.util.decorators import augment_method_from
from djblets.webapi.decorators import (webapi_login_required,
... |
try:
group = group_resource.get_object(request, *args, **kwargs)
user = self.get_object(request, *args, **kwargs)
except ObjectDoesNotExist:
return DOES_NOT_EXIST
local_site = self._get_local_site(kwargs.get('local_site_name', None))
if (not group_r... | """Removes a user from a review group."""
group_resource = resources.review_group | random_line_split |
review_group_user.py | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.utils import six
from djblets.util.decorators import augment_method_from
from djblets.webapi.decorators import (webapi_login_required,
... |
else:
user = User.objects.get(username=username)
except ObjectDoesNotExist:
return INVALID_USER
group.users.add(user)
return 201, {
self.item_result_key: user,
}
@webapi_check_local_site
@webapi_login_required
@webapi_re... | user = local_site.users.get(username=username) | conditional_block |
review_group_user.py | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.utils import six
from djblets.util.decorators import augment_method_from
from djblets.webapi.decorators import (webapi_login_required,
... | (self, request, username, *args, **kwargs):
"""Adds a user to a review group."""
group_resource = resources.review_group
try:
group = group_resource.get_object(request, *args, **kwargs)
except ObjectDoesNotExist:
return DOES_NOT_EXIST
local_site = self._... | create | identifier_name |
deps.py | #!/usr/bin/env python
# Finds all tasks and task outputs on the dependency paths from the given downstream task T
# up to the given source/upstream task S (optional). If the upstream task is not given,
# all upstream tasks on all dependancy paths of T will be returned.
# Terms:
# if the execution of Task T depends ... | ():
deps = find_deps_cli()
for task in deps:
task_output = task.output()
if isinstance(task_output, dict):
output_descriptions = [get_task_output_description(output) for label, output in task_output.items()]
elif isinstance(task_output, collections.Iterable):
out... | main | identifier_name |
deps.py | #!/usr/bin/env python
# Finds all tasks and task outputs on the dependency paths from the given downstream task T
# up to the given source/upstream task S (optional). If the upstream task is not given,
# all upstream tasks on all dependancy paths of T will be returned.
# Terms:
# if the execution of Task T depends ... | deps = find_deps_cli()
for task in deps:
task_output = task.output()
if isinstance(task_output, dict):
output_descriptions = [get_task_output_description(output) for label, output in task_output.items()]
elif isinstance(task_output, collections.Iterable):
output_... | def main(): | random_line_split |
deps.py | #!/usr/bin/env python
# Finds all tasks and task outputs on the dependency paths from the given downstream task T
# up to the given source/upstream task S (optional). If the upstream task is not given,
# all upstream tasks on all dependancy paths of T will be returned.
# Terms:
# if the execution of Task T depends ... |
class upstream(luigi.task.Config):
'''
Used to provide the parameter upstream-family
'''
family = parameter.Parameter(default=None)
def find_deps(task, upstream_task_family):
'''
Finds all dependencies that start with the given task and have a path
to upstream_task_family
Returns a... | if path is None:
path = [start_task]
if start_task.task_family == goal_task_family or goal_task_family is None:
for item in path:
yield item
for next in get_task_requires(start_task) - set(path):
for t in dfs_paths(next, goal_task_family, path + [next]):
yield t | identifier_body |
deps.py | #!/usr/bin/env python
# Finds all tasks and task outputs on the dependency paths from the given downstream task T
# up to the given source/upstream task S (optional). If the upstream task is not given,
# all upstream tasks on all dependancy paths of T will be returned.
# Terms:
# if the execution of Task T depends ... |
return output_description
def main():
deps = find_deps_cli()
for task in deps:
task_output = task.output()
if isinstance(task_output, dict):
output_descriptions = [get_task_output_description(output) for label, output in task_output.items()]
elif isinstance(task_outp... | output_description = "to be determined" | conditional_block |
kendo-test-json.ts | /// <reference path="../Scripts/typings/aurelia/aurelia.d.ts"/>
/// <reference path="../Scripts/typings/jquery/jquery.d.ts"/>
/// <reference path="../Scripts/typings/kendo/kendo.all.d.ts"/>
/// <reference path="services/products.ts"/>
//import $ = require("jquery");
//import k = require("kendo");
import products = req... |
attached() {
console.log("kendo-test attached :)");
var dataSource = new kendo.data.DataSource({
type: "json",
transport: {
read: "./dist/services/products.json"
},
pageSize: 21
});
$("#pager").kendoPager({
... | {
console.log("kendo-test constructed :)");
} | identifier_body |
kendo-test-json.ts | /// <reference path="../Scripts/typings/aurelia/aurelia.d.ts"/>
/// <reference path="../Scripts/typings/jquery/jquery.d.ts"/>
/// <reference path="../Scripts/typings/kendo/kendo.all.d.ts"/>
/// <reference path="services/products.ts"/>
//import $ = require("jquery");
//import k = require("kendo");
import products = req... | attached() {
console.log("kendo-test attached :)");
var dataSource = new kendo.data.DataSource({
type: "json",
transport: {
read: "./dist/services/products.json"
},
pageSize: 21
});
$("#pager").kendoPager({
... | console.log("kendo-test constructed :)");
}
| random_line_split |
kendo-test-json.ts | /// <reference path="../Scripts/typings/aurelia/aurelia.d.ts"/>
/// <reference path="../Scripts/typings/jquery/jquery.d.ts"/>
/// <reference path="../Scripts/typings/kendo/kendo.all.d.ts"/>
/// <reference path="services/products.ts"/>
//import $ = require("jquery");
//import k = require("kendo");
import products = req... | () {
console.log("kendo-test constructed :)");
}
attached() {
console.log("kendo-test attached :)");
var dataSource = new kendo.data.DataSource({
type: "json",
transport: {
read: "./dist/services/products.json"
},
pageSize... | constructor | identifier_name |
net_logging.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"s... | level:
description:
- Set logging severity levels.
aggregate:
description: List of logging definitions.
purge:
description:
- Purge logging not defined in the I(aggregate) parameter.
default: false
state:
description:
- State of the logging configuration.
default: present
... | description:
- If value of C(dest) is I(host) it indicates file-name the host name to be notified.
facility:
description:
- Set logging facility. | random_line_split |
localDataFactory.ts | ///<reference path="../coreReferences.ts"/>
/**
* Created by Johanna on 2015-08-28.
*/
module Moosetrail.Core.DataAccess {
export class LocalDataFactory {
private prefix = "data";
protected q: ng.IQService;
private localStorage: ng.local.storage.ILocalStorageService;
static $in... | (key: string, data: any): void {
if (data != null)
this.localStorage.set(this.prefix + key, data);
else
this.localStorage.set(this.prefix + key, new NoDataObj());
}
protected getPlainData(identifier: string): any {
return this.localSto... | setDataWithKey | identifier_name |
localDataFactory.ts | ///<reference path="../coreReferences.ts"/>
/**
* Created by Johanna on 2015-08-28.
*/
module Moosetrail.Core.DataAccess {
export class LocalDataFactory {
private prefix = "data";
protected q: ng.IQService;
private localStorage: ng.local.storage.ILocalStorageService;
static $in... |
else if (foundData != null) {
def.resolve(new DataResult(foundData, 0, DataSource.LocalStorage));
} else {
def.reject(new DataResult(null, -1, DataSource.LocalStorage));
}
return def.promise;
}
protected setDataWithKey(ke... | {
def.resolve(new DataResult(null, 0, DataSource.LocalStorage));
} | conditional_block |
localDataFactory.ts | ///<reference path="../coreReferences.ts"/>
/**
* Created by Johanna on 2015-08-28.
*/
module Moosetrail.Core.DataAccess {
export class LocalDataFactory {
private prefix = "data";
protected q: ng.IQService;
private localStorage: ng.local.storage.ILocalStorageService;
static $in... | } |
} | random_line_split |
localDataFactory.ts | ///<reference path="../coreReferences.ts"/>
/**
* Created by Johanna on 2015-08-28.
*/
module Moosetrail.Core.DataAccess {
export class LocalDataFactory {
private prefix = "data";
protected q: ng.IQService;
private localStorage: ng.local.storage.ILocalStorageService;
static $in... |
protected getPlainData(identifier: string): any {
return this.localStorage.get(this.prefix + identifier);
}
}
class NoDataObj {
}
} | {
if (data != null)
this.localStorage.set(this.prefix + key, data);
else
this.localStorage.set(this.prefix + key, new NoDataObj());
} | identifier_body |
karaoke.py | #!/usr/bin/python
# -*- coding: iso-8859-15 -*-
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
import smallsmilhandler
import sys
import os
class KaraokeLocal(smallsmilhandler.SmallSMILHandler):
def __init__(self, fich):
parser = make_parser()
sHandler = smallsmilhand... |
def do_local(self):
list_recurso = []
for diccionarios in self.list_tags:
for clave in diccionarios.keys():
if clave == "src":
recurso = diccionarios[clave]
os.system("wget -q " + recurso)
list_recurso = recurs... | todo = ""
for diccionarios in self.list_tags:
frase = ""
for clave in diccionarios.keys():
if clave != "name" and diccionarios[clave] != "":
frase = frase + clave + "=" + diccionarios[clave] + "\t"
todo = todo + diccionarios['name'] + "\t" ... | identifier_body |
karaoke.py | #!/usr/bin/python
# -*- coding: iso-8859-15 -*-
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
import smallsmilhandler
import sys
import os
class KaraokeLocal(smallsmilhandler.SmallSMILHandler):
def __init__(self, fich):
parser = make_parser()
sHandler = smallsmilhand... | self.list_tags = sHandler.get_tags()
def __str__(self):
todo = ""
for diccionarios in self.list_tags:
frase = ""
for clave in diccionarios.keys():
if clave != "name" and diccionarios[clave] != "":
frase = frase + clave + "=" + dicc... | random_line_split | |
karaoke.py | #!/usr/bin/python
# -*- coding: iso-8859-15 -*-
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
import smallsmilhandler
import sys
import os
class KaraokeLocal(smallsmilhandler.SmallSMILHandler):
def __init__(self, fich):
parser = make_parser()
sHandler = smallsmilhand... |
if __name__ == "__main__":
try:
fich = open(sys.argv[1])
except IndexError:
print "Usage: python karaoke.py file.smil."
KL = KaraokeLocal(fich)
print KL
KL.do_local()
print KL
| recurso = diccionarios[clave]
os.system("wget -q " + recurso)
list_recurso = recurso.split("/")
recurso = list_recurso[-1]
diccionarios[clave] = recurso | conditional_block |
karaoke.py | #!/usr/bin/python
# -*- coding: iso-8859-15 -*-
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
import smallsmilhandler
import sys
import os
class KaraokeLocal(smallsmilhandler.SmallSMILHandler):
def __init__(self, fich):
parser = make_parser()
sHandler = smallsmilhand... | (self):
todo = ""
for diccionarios in self.list_tags:
frase = ""
for clave in diccionarios.keys():
if clave != "name" and diccionarios[clave] != "":
frase = frase + clave + "=" + diccionarios[clave] + "\t"
todo = todo + diccionarios... | __str__ | identifier_name |
resourceGained.ts | import { AnyEvent, EventType } from 'parser/core/Events';
import metric from 'parser/core/metric';
interface ResourcesGained {
[targetId: number]: {
[resourceTypeId: number]: {
[spellId: number]: number;
};
};
}
/**
* Returns an object with the total resource gained per resource.
*/
const resource... |
export const sumResourceGained = (
resourcesGained: ResourcesGained,
resourceId: number,
playerId: number,
) =>
Object.values(resourcesGained[playerId]?.[resourceId]).reduce((sum, item) => sum + item, 0) || 0;
export const sumResourceGainedByPlayerBySpell = (
resourcesGained: ResourcesGained,
resourceId: n... | }
return obj;
}, {});
export default metric(resourceGained); | random_line_split |
resourceGained.ts | import { AnyEvent, EventType } from 'parser/core/Events';
import metric from 'parser/core/metric';
interface ResourcesGained {
[targetId: number]: {
[resourceTypeId: number]: {
[spellId: number]: number;
};
};
}
/**
* Returns an object with the total resource gained per resource.
*/
const resource... |
return obj;
}, {});
export default metric(resourceGained);
export const sumResourceGained = (
resourcesGained: ResourcesGained,
resourceId: number,
playerId: number,
) =>
Object.values(resourcesGained[playerId]?.[resourceId]).reduce((sum, item) => sum + item, 0) || 0;
export const sumResourceGainedByPl... | {
obj[event.targetID] = obj[event.targetID] || {};
obj[event.targetID][event.resourceChangeType] =
obj[event.targetID][event.resourceChangeType] || {};
obj[event.targetID][event.resourceChangeType][event.ability.guid] =
(obj[event.targetID][event.resourceChangeType][event.ability.guid]... | conditional_block |
test_auth_saml2.py | from __future__ import absolute_import
import six
import pytest
import base64
from sentry.utils.compat import mock
from exam import fixture
from six.moves.urllib.parse import urlencode, urlparse, parse_qs
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from ... |
@pytest.mark.skipif(not HAS_SAML2, reason="SAML2 library is not installed")
class AuthSAML2Test(AuthProviderTestCase):
provider = DummySAML2Provider
provider_name = "saml2_dummy"
def setUp(self):
self.user = self.create_user("rick@onehundredyears.com")
self.org = self.create_organization... | return dummy_provider_config | identifier_body |
test_auth_saml2.py | from __future__ import absolute_import
import six
import pytest | import base64
from sentry.utils.compat import mock
from exam import fixture
from six.moves.urllib.parse import urlencode, urlparse, parse_qs
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from sentry.auth.authenticators import TotpInterface
from sentry.auth.... | random_line_split | |
test_auth_saml2.py | from __future__ import absolute_import
import six
import pytest
import base64
from sentry.utils.compat import mock
from exam import fixture
from six.moves.urllib.parse import urlencode, urlparse, parse_qs
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from ... | (SAML2Provider):
def get_saml_setup_pipeline(self):
return []
def build_config(self, state):
return dummy_provider_config
@pytest.mark.skipif(not HAS_SAML2, reason="SAML2 library is not installed")
class AuthSAML2Test(AuthProviderTestCase):
provider = DummySAML2Provider
provider_name ... | DummySAML2Provider | identifier_name |
mrps.py | #!/usr/bin/env python
import sys
import configparser
import os
import shutil
from PyQt5 import QtWidgets
from PyQt5 import QtWebKitWidgets
from PyQt5 import QtCore
# Read config file
home_dir = os.path.expanduser("~")
conf_path = os.path.join(home_dir, ".config/mrps/mrps.conf")
config = configparser.ConfigParser(de... | exit() | random_line_split | |
mrps.py | #!/usr/bin/env python
import sys
import configparser
import os
import shutil
from PyQt5 import QtWidgets
from PyQt5 import QtWebKitWidgets
from PyQt5 import QtCore
# Read config file
home_dir = os.path.expanduser("~")
conf_path = os.path.join(home_dir, ".config/mrps/mrps.conf")
config = configparser.ConfigParser(de... | ():
os.remove(html_file_full)
shutil.rmtree(os.path.join(o_file_dir, "reveal.js"))
app = QtWidgets.QApplication(sys.argv)
app.aboutToQuit.connect(clean_up)
if len(sys.argv) == 2:
o_file_full = os.path.abspath(sys.argv[1])
else:
o_file_full = QtWidgets.QFileDialog.getOpenFileName()[0]
if o_file_full:... | clean_up | identifier_name |
mrps.py | #!/usr/bin/env python
import sys
import configparser
import os
import shutil
from PyQt5 import QtWidgets
from PyQt5 import QtWebKitWidgets
from PyQt5 import QtCore
# Read config file
home_dir = os.path.expanduser("~")
conf_path = os.path.join(home_dir, ".config/mrps/mrps.conf")
config = configparser.ConfigParser(de... |
app = QtWidgets.QApplication(sys.argv)
app.aboutToQuit.connect(clean_up)
if len(sys.argv) == 2:
o_file_full = os.path.abspath(sys.argv[1])
else:
o_file_full = QtWidgets.QFileDialog.getOpenFileName()[0]
if o_file_full:
o_file_dir = os.path.dirname(o_file_full)
o_file_name = os.path.basename(os.path.... | os.remove(html_file_full)
shutil.rmtree(os.path.join(o_file_dir, "reveal.js")) | identifier_body |
mrps.py | #!/usr/bin/env python
import sys
import configparser
import os
import shutil
from PyQt5 import QtWidgets
from PyQt5 import QtWebKitWidgets
from PyQt5 import QtCore
# Read config file
home_dir = os.path.expanduser("~")
conf_path = os.path.join(home_dir, ".config/mrps/mrps.conf")
config = configparser.ConfigParser(de... |
if o_file_full:
o_file_dir = os.path.dirname(o_file_full)
o_file_name = os.path.basename(os.path.normpath(o_file_full))
o_file_name_bare = os.path.splitext(o_file_name)[0]
html_file_full = os.path.join(o_file_dir, o_file_name_bare + ".html")
shutil.copytree(os.path.normpath(config['DEFAULT']['re... | o_file_full = QtWidgets.QFileDialog.getOpenFileName()[0] | conditional_block |
di_bindings.ts | // TODO (jteplitz602): This whole file is nearly identical to core/application.ts.
// There should be a way to refactor application so that this file is unnecessary. See #3277
import {Injector, bind, Binding} from "angular2/src/core/di";
import {DEFAULT_PIPES} from 'angular2/src/core/pipes';
import {AnimationBuilder} f... | import {WebWorkerSetup} from 'angular2/src/web_workers/ui/setup';
import {
ServiceMessageBrokerFactory,
ServiceMessageBrokerFactory_
} from 'angular2/src/web_workers/shared/service_message_broker';
import {
ClientMessageBrokerFactory,
ClientMessageBrokerFactory_
} from 'angular2/src/web_workers/shared/client_me... | import {MessageBasedXHRImpl} from 'angular2/src/web_workers/ui/xhr_impl'; | random_line_split |
di_bindings.ts | // TODO (jteplitz602): This whole file is nearly identical to core/application.ts.
// There should be a way to refactor application so that this file is unnecessary. See #3277
import {Injector, bind, Binding} from "angular2/src/core/di";
import {DEFAULT_PIPES} from 'angular2/src/core/pipes';
import {AnimationBuilder} f... | (zone: NgZone, bus: MessageBus): Injector {
BrowserDomAdapter.makeCurrent();
_rootBindings.push(bind(NgZone).toValue(zone));
_rootBindings.push(bind(MessageBus).toValue(bus));
var injector: Injector = Injector.resolveAndCreate(_rootBindings);
return injector.resolveAndCreateChild(_injectorBindings());
}
| createInjector | identifier_name |
di_bindings.ts | // TODO (jteplitz602): This whole file is nearly identical to core/application.ts.
// There should be a way to refactor application so that this file is unnecessary. See #3277
import {Injector, bind, Binding} from "angular2/src/core/di";
import {DEFAULT_PIPES} from 'angular2/src/core/pipes';
import {AnimationBuilder} f... | bind(AppViewManager).toClass(AppViewManager_),
AppViewManagerUtils,
AppViewListener,
ProtoViewFactory,
ViewResolver,
DEFAULT_PIPES,
DirectiveResolver,
Parser,
Lexer,
bind(ExceptionHandler).toFactory(() => new ExceptionHandler(DOM), []),
bind(XHR).toValue(new XHRImpl()),
U... | {
return [
bind(DOCUMENT)
.toValue(DOM.defaultDoc()),
EventManager,
new Binding(EVENT_MANAGER_PLUGINS, {toClass: DomEventsPlugin, multi: true}),
new Binding(EVENT_MANAGER_PLUGINS, {toClass: KeyEventsPlugin, multi: true}),
new Binding(EVENT_MANAGER_PLUGINS, {toClass: HammerGesturesPlugin, m... | identifier_body |
LandingPage.tsx | import * as React from "react";
import * as weavejs from "weavejs";
import {Weave} from "weavejs";
import WeaveComponentRenderer = weavejs.ui.WeaveComponentRenderer;
import MiscUtils = weavejs.util.MiscUtils;
import WeaveApp from "weaveapp/WeaveApp";
import GetStartedComponent from "weaveapp/dialog/GetStartedComponent... | (props:LandingPageProps)
{
super(props);
this.urlParams = MiscUtils.getUrlParams();
var weaveExternalTools: any;
/* Wrap this in a try/catch so we don't crash if there's a security exception from accessing a window in another domain. */
try
{
weaveExternalTools = window && window.opener && (window.open... | constructor | identifier_name |
LandingPage.tsx | import * as React from "react";
import * as weavejs from "weavejs";
import {Weave} from "weavejs";
import WeaveComponentRenderer = weavejs.ui.WeaveComponentRenderer;
import MiscUtils = weavejs.util.MiscUtils;
import WeaveApp from "weaveapp/WeaveApp";
import GetStartedComponent from "weaveapp/dialog/GetStartedComponent... |
return (
<WeaveApp
ref={this.props.weaveAppRef}
weave={this.props.weave}
style={{width: "100%", height: "100%"}}
showFileDialog={this.state.view == "file"}
enableTour={this.state.view == "tour"}
readUrlParams={true}
onClose={this.loadGetStartedComponentWithTourList}
/>
)
}
} | );
} | random_line_split |
LandingPage.tsx | import * as React from "react";
import * as weavejs from "weavejs";
import {Weave} from "weavejs";
import WeaveComponentRenderer = weavejs.ui.WeaveComponentRenderer;
import MiscUtils = weavejs.util.MiscUtils;
import WeaveApp from "weaveapp/WeaveApp";
import GetStartedComponent from "weaveapp/dialog/GetStartedComponent... | this.state = {view: view as LandingPageView};
}
loadGetStartedComponentWithTourList=()=>{
this.props.weave.history.clearHistory(); // important to clear the hsitory created by prev tour
this.props.weave.root.removeAllObjects(); // important to clear the all the session state object created by prev tour
this... | {
super(props);
this.urlParams = MiscUtils.getUrlParams();
var weaveExternalTools: any;
/* Wrap this in a try/catch so we don't crash if there's a security exception from accessing a window in another domain. */
try
{
weaveExternalTools = window && window.opener && (window.opener as any)[WEAVE_EXTERNAL_... | identifier_body |
Highlights.tsx | import * as React from 'react';
| <span className="feature-icon">
<i className="fa fa-cloud icon"></i>
</span>
<div className="tech-container">
<h3>Web</h3>
<p>
Experience in connecting users with content they need. Seth has created web APIs, for
consumption by other systems and mobile devices. An API centric mode... | export const Highlights = () => (
<section id="highlights" className="container-fluid">
<div className="row">
<div className="col-sm-4 tech-highlight"> | random_line_split |
test.ts | /*
* @license Apache-2.0
*
* Copyright (c) 2019 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | * See the License for the specific language governing permissions and
* limitations under the License.
*/
import incrsumabs2 = require( './index' );
// TESTS //
// The function returns an accumulator function...
{
incrsumabs2(); // $ExpectType accumulator
}
// The compiler throws an error if the function is provi... | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | random_line_split |
javax.swing.plaf.basic.BasicEditorPaneUI.d.ts | declare namespace javax {
namespace swing {
namespace plaf {
namespace basic {
class | extends javax.swing.plaf.basic.BasicTextUI {
public static createUI(arg0: javax.swing.JComponent): javax.swing.plaf.ComponentUI
public constructor()
protected getPropertyPrefix(): java.lang.String
public installUI(arg0: javax.swing.JComponent): void
public uninstallUI(... | BasicEditorPaneUI | identifier_name |
javax.swing.plaf.basic.BasicEditorPaneUI.d.ts | declare namespace javax {
namespace swing {
namespace plaf {
namespace basic {
class BasicEditorPaneUI extends javax.swing.plaf.basic.BasicTextUI {
public static createUI(arg0: javax.swing.JComponent): javax.swing.plaf.ComponentUI
public constructor()
protected getProp... | }
}
}
} | random_line_split | |
exhaustMap.ts | import { Operator } from '../Operator';
import { Observable } from '../Observable';
import { Subscriber } from '../Subscriber';
import { Subscription } from '../Subscription';
import { OuterSubscriber } from '../OuterSubscriber';
import { InnerSubscriber } from '../InnerSubscriber';
import { subscribeToResult } from '.... | (private project: (value: T, index: number) => ObservableInput<R>) {
}
call(subscriber: Subscriber<R>, source: any): any {
return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));
}
}
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
class Exhaus... | constructor | identifier_name |
exhaustMap.ts | import { Operator } from '../Operator';
import { Observable } from '../Observable';
import { Subscriber } from '../Subscriber';
import { Subscription } from '../Subscription';
import { OuterSubscriber } from '../OuterSubscriber';
import { InnerSubscriber } from '../InnerSubscriber';
import { subscribeToResult } from '.... | }
} | this.hasSubscription = false;
if (this.hasCompleted) {
this.destination.complete();
} | random_line_split |
exhaustMap.ts | import { Operator } from '../Operator';
import { Observable } from '../Observable';
import { Subscriber } from '../Subscriber';
import { Subscription } from '../Subscription';
import { OuterSubscriber } from '../OuterSubscriber';
import { InnerSubscriber } from '../InnerSubscriber';
import { subscribeToResult } from '.... |
}
}
| {
this.destination.complete();
} | conditional_block |
06. System components.js | /**
* Created by Vicky on 6/13/2017.
*/
function | (strArr) {
let components = new Map();
for (let line of strArr) {
let [system, component, subcomponent] = line.split(' | ');
if (!components.has(system)) {
components.set(system, new Map());
}
if (!components.get(system).has(component)) {
components.get(sy... | systemComponents | identifier_name |
06. System components.js | /**
* Created by Vicky on 6/13/2017.
*/
function systemComponents(strArr) {
let components = new Map();
for (let line of strArr) {
let [system, component, subcomponent] = line.split(' | ');
if (!components.has(system)) {
components.set(system, new Map());
}
if (!com... |
function compareSystems(a, b) {
if ([...a[1]].length > [...b[1]].length) {
return -1;
} else if ([...a[1]].length < [...b[1]].length) {
return 1;
} else {
if (a < b) {
return -1;
} else if (a > b) {
return 1;
... | {
return a[1].length < b[1].length;
} | identifier_body |
06. System components.js | /**
* Created by Vicky on 6/13/2017.
*/
function systemComponents(strArr) {
let components = new Map();
for (let line of strArr) {
let [system, component, subcomponent] = line.split(' | ');
if (!components.has(system)) { | components.set(system, new Map());
}
if (!components.get(system).has(component)) {
components.get(system).set(component, []);
}
components.get(system).get(component).push(subcomponent);
}
components = [...components].sort(compareSystems);
for (let [sys... | random_line_split | |
06. System components.js | /**
* Created by Vicky on 6/13/2017.
*/
function systemComponents(strArr) {
let components = new Map();
for (let line of strArr) {
let [system, component, subcomponent] = line.split(' | ');
if (!components.has(system)) {
components.set(system, new Map());
}
if (!com... | else if ([...a[1]].length < [...b[1]].length) {
return 1;
} else {
if (a < b) {
return -1;
} else if (a > b) {
return 1;
} else {
return 0;
}
}
}
}
systemComponents([
'SULS | Main Site |... | {
return -1;
} | conditional_block |
ifttt.js | var request = require('request');
var IFTTT_CONNECTION_TIMEOUT_MS = 20000;
module.exports = function (RED) {
// This is a config node holding the keys for connecting to PubNub
function IftttKeyNode(n) {
RED.nodes.createNode(this, n);
}
RED.nodes.registerType('ifttt-key', IftttKeyNode, {credentials: {key: ... | if (!error && response.statusCode === 200) {
node.status({fill: 'green', shape: 'dot', text: 'Sent!'});
} else {
var errorMessage;
try {
errorMessage = (JSON.parse(body).hasOwnProperty('errors')) ? JSON.parse(body).errors[0].message : JSON.parse(body);
... | {
RED.nodes.createNode(this, config);
var node = this;
node.config = config;
node.key = RED.nodes.getNode(config.key);
this.on('input', function (msg) {
node.status({fill: 'blue', shape: 'dot', text: 'Sending...'});
var iftttPayload = {};
if (msg.payload) {
iftttPayload.val... | identifier_body |
ifttt.js | var request = require('request');
var IFTTT_CONNECTION_TIMEOUT_MS = 20000;
module.exports = function (RED) {
// This is a config node holding the keys for connecting to PubNub
function IftttKeyNode(n) {
RED.nodes.createNode(this, n);
}
RED.nodes.registerType('ifttt-key', IftttKeyNode, {credentials: {key: ... | }
var eventName = msg.payload.eventName ? msg.payload.eventName : node.config.eventName;
request({
uri: 'https://maker.ifttt.com/trigger/' + eventName + '/with/key/' + node.key.credentials.key,
method: 'POST',
timeout: IFTTT_CONNECTION_TIMEOUT_MS,
json: iftttPayload
... | iftttPayload.value3 = msg.payload.value3; | random_line_split |
ifttt.js | var request = require('request');
var IFTTT_CONNECTION_TIMEOUT_MS = 20000;
module.exports = function (RED) {
// This is a config node holding the keys for connecting to PubNub
function IftttKeyNode(n) {
RED.nodes.createNode(this, n);
}
RED.nodes.registerType('ifttt-key', IftttKeyNode, {credentials: {key: ... | (config) {
RED.nodes.createNode(this, config);
var node = this;
node.config = config;
node.key = RED.nodes.getNode(config.key);
this.on('input', function (msg) {
node.status({fill: 'blue', shape: 'dot', text: 'Sending...'});
var iftttPayload = {};
if (msg.payload) {
iftttPa... | IftttOutNode | identifier_name |
ifttt.js | var request = require('request');
var IFTTT_CONNECTION_TIMEOUT_MS = 20000;
module.exports = function (RED) {
// This is a config node holding the keys for connecting to PubNub
function IftttKeyNode(n) {
RED.nodes.createNode(this, n);
}
RED.nodes.registerType('ifttt-key', IftttKeyNode, {credentials: {key: ... |
setTimeout(function () {
node.status({});
}, 1000);
});
});
}
RED.nodes.registerType('ifttt out', IftttOutNode);
};
| {
var errorMessage;
try {
errorMessage = (JSON.parse(body).hasOwnProperty('errors')) ? JSON.parse(body).errors[0].message : JSON.parse(body);
} catch (e) {
node.error("IFTTT Read error");
errorMessage = e;
}
node.status({fill: 'red', ... | conditional_block |
app.js | import {inject} from 'aurelia-framework';
import {EditSessionFactory} from '../editing/edit-session-factory';
import {CurrentFileChangedEvent} from '../editing/current-file-changed-event';
import {QueryString} from '../editing/query-string';
import {defaultGist} from '../github/default-gist';
import {Importer} from '..... |
import(urlOrId) {
this.importer.import(urlOrId)
.then(gist => {
this.queryString.write(gist, true);
return this.editSessionFactory.create(gist);
})
.then(::this.setEditSession)
.then(() => alertify.success('Import successful.'), reason => alertify.error(reason));
}
}
| {
this.queryString.clear();
this.setEditSession(this.editSessionFactory.create(defaultGist));
} | identifier_body |
app.js | import {inject} from 'aurelia-framework';
import {EditSessionFactory} from '../editing/edit-session-factory';
import {CurrentFileChangedEvent} from '../editing/current-file-changed-event';
import {QueryString} from '../editing/query-string';
import {defaultGist} from '../github/default-gist';
import {Importer} from '..... | else {
this.focus.set('editor');
}
}
setEditSession(editSession) {
if (this.fileChangedSub) {
this.fileChangedSub.dispose();
}
this.editSession = editSession;
this.fileChangedSub = editSession.subscribe(CurrentFileChangedEvent, ::this.currentFileChanged);
this.editSession.reset... | {
this.focus.set('filename');
} | conditional_block |
app.js | import {inject} from 'aurelia-framework';
import {EditSessionFactory} from '../editing/edit-session-factory';
import {CurrentFileChangedEvent} from '../editing/current-file-changed-event';
import {QueryString} from '../editing/query-string';
import {defaultGist} from '../github/default-gist';
import {Importer} from '..... | () {
this.queryString.clear();
this.setEditSession(this.editSessionFactory.create(defaultGist));
}
import(urlOrId) {
this.importer.import(urlOrId)
.then(gist => {
this.queryString.write(gist, true);
return this.editSessionFactory.create(gist);
})
.then(::this.setEditSe... | newGist | identifier_name |
app.js | import {inject} from 'aurelia-framework';
import {EditSessionFactory} from '../editing/edit-session-factory';
import {CurrentFileChangedEvent} from '../editing/current-file-changed-event';
import {QueryString} from '../editing/query-string';
import {defaultGist} from '../github/default-gist';
import {Importer} from '..... | this.editSession.resetWorker().then(::this.editSession.run);
}
activate() {
return this.queryString.read()
.then(gist => this.setEditSession(this.editSessionFactory.create(gist)));
}
newGist() {
this.queryString.clear();
this.setEditSession(this.editSessionFactory.create(defaultGist));
... | }
this.editSession = editSession;
this.fileChangedSub = editSession.subscribe(CurrentFileChangedEvent, ::this.currentFileChanged); | random_line_split |
GoogleSource.js | MAP", "SATELLITE",
* "HYBRID" and "TERRAIN"
*/
/** api: example
* The configuration in the ``sources`` property of the :class:`gxp.Viewer` is
* straightforward:
*
* .. code-block:: javascript
*
* "google": {
* ptype: "gxp_google"
* }
*
* A typical configuration for a laye... | record.set("selected", config.selected || false);
record.set("source", config.source);
record.set("name", config.name);
if ("group" in config) {
record.set("group", config.group);
}
record.commit();
}
return... | {
// records can be in only one store
record = this.store.getAt(this.store.findBy(cmp)).clone();
var layer = record.getLayer();
// set layer title from config
if (config.title) {
/**
* Because the layer title data is dup... | conditional_block |
GoogleSource.js | /** api: constructor
* .. class:: GoolgeSource(config)
*
* Plugin for using Google layers with :class:`gxp.Viewer` instances. The
* plugin uses the GMaps v3 API and also takes care of loading the
* required Google resources.
*
* Available layer names for this source are "ROADMAP", "SATELLITE"... | random_line_split |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.