file_name large_stringlengths 4 140 | prefix large_stringlengths 0 39k | suffix large_stringlengths 0 36.1k | middle large_stringlengths 0 29.4k | fim_type large_stringclasses 4
values |
|---|---|---|---|---|
matlab-to-python.py | # Autogenerated with SMOP version 0.23
# main.py ../../assessing-mininet/MATLAB/load_function.m ../../assessing-mininet/MATLAB/process_complete_test_set.m ../../assessing-mininet/MATLAB/process_single_testfile.m ../../assessing-mininet/MATLAB/ProcessAllLogsMain.m
from __future__ import division
from numpy import arang... |
def process_complete_test_set(file_names,output_format,crosstraffic):
from glob import glob
overview_img_file=strcat('overview.',output_format)
mean_bitrate=[]
std_dev_bitrate=[]
mean_delay=[]
std_dev_delay=[]
mean_jitter=[]
std_dev_jitter=[]
mean_packetloss=[]
std_dev_packetl... | return arange(8,12,0.5) | conditional_block |
matlab-to-python.py | # Autogenerated with SMOP version 0.23
# main.py ../../assessing-mininet/MATLAB/load_function.m ../../assessing-mininet/MATLAB/process_complete_test_set.m ../../assessing-mininet/MATLAB/process_single_testfile.m ../../assessing-mininet/MATLAB/ProcessAllLogsMain.m
from __future__ import division
from numpy import arang... | (matrix,current_picture_file_name,output_format):
t_start=matrix[1][5] * 3600 + matrix[1][6] * 60 + matrix[1][7]
print (matrix[:][5] * 3600 + matrix[:][6] * 60 + matrix[:][7])
t_conv=(matrix[:][5] * 3600 + matrix[:][6] * 60 + matrix[:][7]) - t_start
t_start_s=matrix[1][2] * 3600 + matrix[1][3] * 60 + ma... | process_single_testfile | identifier_name |
ThePrinceWhoCameTooLate.js | const PlotCard = require('../../plotcard');
const GameActions = require('../../GameActions');
class ThePrinceWhoCameTooLate extends PlotCard {
| (ability) {
this.action({
title: 'Search your deck',
phase: 'standing',
handler: context => {
this.game.resolveGameAction(
GameActions.search({
title: 'Select a character',
match: { type: 'cha... | setupCardAbilities | identifier_name |
ThePrinceWhoCameTooLate.js | const PlotCard = require('../../plotcard');
const GameActions = require('../../GameActions');
class ThePrinceWhoCameTooLate extends PlotCard {
setupCardAbilities(ability) {
this.action({
title: 'Search your deck',
phase: 'standing',
handler: context => {
... | }
ThePrinceWhoCameTooLate.code = '15052';
module.exports = ThePrinceWhoCameTooLate; | },
limit: ability.limit.perRound(1)
});
} | random_line_split |
client.js | /**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import 'babel-polyfill';
import ReactDOM from 'react-dom';... |
function run() {
let currentLocation = null;
let currentState = null;
// Make taps on links and buttons work fast on mobiles
FastClick.attach(document.body);
// Re-render the app when window.location changes
const unlisten = Location.listen(location => {
currentLocation = location;
currentState =... |
Router.dispatch(state, (newState, component) => {
ReactDOM.render( component, appContainer,
() => {
// Restore the scroll position if it was saved into the state
if (state.scrollY !== undefined) {
window.scrollTo(state.scrollX, state.scrollY);
} else {
window.sc... | identifier_body |
client.js | /**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import 'babel-polyfill';
import ReactDOM from 'react-dom';... |
trackPageview();
// Remove the pre-rendered CSS because it's no longer used
// after the React app is launched
if (cssContainer) {
cssContainer.parentNode.removeChild(cssContainer);
cssContainer = null;
}
});
});
}
function run() {
let currentLoca... |
window.scrollTo(0, 0);
}
| conditional_block |
client.js | /**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import 'babel-polyfill';
import ReactDOM from 'react-dom';... | ) {
let currentLocation = null;
let currentState = null;
// Make taps on links and buttons work fast on mobiles
FastClick.attach(document.body);
// Re-render the app when window.location changes
const unlisten = Location.listen(location => {
currentLocation = location;
currentState = Object.assign... | un( | identifier_name |
client.js | /**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import 'babel-polyfill';
import ReactDOM from 'react-dom';... | const client = new ApolloClient({
connectToDevTools: true,
networkInterface: networkInterface,
});
let cssContainer = document.getElementById('css');
const appContainer = document.getElementById('app');
const context = {
insertCss: styles => styles._insertCss(),
onSetTitle: value => (document.title = value),
... | }
});
| random_line_split |
efectos.js | $.fn.dropdown = function(options) {
var defaults = {
hideSpeed: 50,
showSpeed: 350,
parentBGHoverColor: false,
parentTextHoverColor: false,
zIndex: 5000
};
var settings = $.extend({}, defaults, options);
var self = {};
self.show = function(menu){
if... | $(menu).css("background-color")
);
}
$(menu).css("background-color", settings.parentBGHoverColor);
}
if(settings.parentTextHoverColor){
if(!$(menu).attr("dropdownParentOriginalTextColor")){
... | $(menu).attr(
"dropdownParentOriginalBGColor", | random_line_split |
efectos.js | $.fn.dropdown = function(options) {
var defaults = {
hideSpeed: 50,
showSpeed: 350,
parentBGHoverColor: false,
parentTextHoverColor: false,
zIndex: 5000
};
var settings = $.extend({}, defaults, options);
var self = {};
self.show = function(menu){
if... | else {
self.hide(this);
}
event.preventDefault();
});
});
return this;
};
$(document).ready(function(){
$("#header .bottom ul").dropdown({
showSpeed: 230,
hideSpeed: 230
});
$("#mobile-menu .menu a").click(function(){
... | {
self.show(this);
} | conditional_block |
sdputils.js | /*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree.
*/
/* More information about these options at jshint.com/docs/options */
/* globals displayError, ... |
// Create the b (bandwidth) sdp line.
var bwLine = 'b=AS:' + bitrate;
// As per RFC 4566, the b line should follow after c-line.
sdpLines.splice(cLineIndex + 1, 0, bwLine);
sdp = sdpLines.join('\r\n');
return sdp;
}
// Add an a=fmtp: x-google-min-bitrate=kbps line, if videoSendInitialBitrate
// is specif... | {
sdpLines.splice(bLineIndex, 1);
} | conditional_block |
sdputils.js | /*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree.
*/
/* More information about these options at jshint.com/docs/options */
/* globals displayError, ... |
function iceCandidateType(candidateStr) {
return candidateStr.split(' ')[7];
}
function maybeSetAudioSendBitRate(sdp) {
if (!params.audioSendBitrate) {
return sdp;
}
trace('Prefer audio send bitrate: ' + params.audioSendBitrate);
return preferBitRate(sdp, params.audioSendBitrate, 'audio');
}
function ... | {
var merged = cons1;
for (var name in cons2.mandatory) {
merged.mandatory[name] = cons2.mandatory[name];
}
merged.optional = merged.optional.concat(cons2.optional);
return merged;
} | identifier_body |
sdputils.js | /*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree.
*/
/* More information about these options at jshint.com/docs/options */
/* globals displayError, ... | (candidateStr) {
return candidateStr.split(' ')[7];
}
function maybeSetAudioSendBitRate(sdp) {
if (!params.audioSendBitrate) {
return sdp;
}
trace('Prefer audio send bitrate: ' + params.audioSendBitrate);
return preferBitRate(sdp, params.audioSendBitrate, 'audio');
}
function maybeSetAudioReceiveBitRate... | iceCandidateType | identifier_name |
sdputils.js | /*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree.
*/
/* More information about these options at jshint.com/docs/options */
/* globals displayError, ... | var payload = getCodecPayloadType(sdpLines[codecIndex]);
if (payload) {
sdpLines[mLineIndex] = setDefaultCodec(sdpLines[mLineIndex], payload);
}
}
sdp = sdpLines.join('\r\n');
return sdp;
}
// Add fmtp param to specified codec in SDP.
function addCodecParam(sdp, codec, param) {
var sdpLines ... | }
// If the codec is available, set it as the default in m line.
var codecIndex = findLine(sdpLines, 'a=rtpmap', codec);
if (codecIndex) { | random_line_split |
levelAnimation.ts | export class LevelAnimation {
// private _animations: LevelAnimation[] = [];
private _progressMs: number;
constructor(seed: number, animation: LevelAnimation, progress: number) |
// /**
// * Returns an array of animations.
// * Every levelanim is an array of shapes, or null
// */
// update(delta: number, gameStarted: boolean): ShapeCollection[] {
// const shapeCollections = [];
// this._progressMs += delta;
// for (let i = 0, m = this._animations... | {
// this._animations = animation ? animation(seed) : [];
/**
* @type {number}
* @private
*/
this._progressMs = progress || 0;
} | identifier_body |
levelAnimation.ts | export class LevelAnimation {
// private _animations: LevelAnimation[] = [];
private _progressMs: number;
constructor(seed: number, animation: LevelAnimation, progress: number) {
// this._animations = animation ? animation(seed) : [];
/** | }
// /**
// * Returns an array of animations.
// * Every levelanim is an array of shapes, or null
// */
// update(delta: number, gameStarted: boolean): ShapeCollection[] {
// const shapeCollections = [];
// this._progressMs += delta;
// for (let i = 0, m = this._anima... | * @type {number}
* @private
*/
this._progressMs = progress || 0; | random_line_split |
levelAnimation.ts | export class LevelAnimation {
// private _animations: LevelAnimation[] = [];
private _progressMs: number;
| (seed: number, animation: LevelAnimation, progress: number) {
// this._animations = animation ? animation(seed) : [];
/**
* @type {number}
* @private
*/
this._progressMs = progress || 0;
}
// /**
// * Returns an array of animations.
// * Every level... | constructor | identifier_name |
OrbeonForms.js | $identify("org/mathdox/formulaeditor/OrbeonForms.js");
$require("org/mathdox/formulaeditor/FormulaEditor.js");
var ORBEON;
$main(function(){
if (ORBEON && ORBEON.xforms && ORBEON.xforms.Document) {
/**
* Extend the save function of the formula editor to use the orbeon update | */
org.mathdox.formulaeditor.FormulaEditor =
$extend(org.mathdox.formulaeditor.FormulaEditor, {
save : function() {
// call the parent function
arguments.callee.parent.save.apply(this, arguments);
// let orbeon know about the change of textarea content
v... | * mechanism, see also:
* http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-javascript | random_line_split |
OrbeonForms.js | $identify("org/mathdox/formulaeditor/OrbeonForms.js");
$require("org/mathdox/formulaeditor/FormulaEditor.js");
var ORBEON;
$main(function(){
if (ORBEON && ORBEON.xforms && ORBEON.xforms.Document) {
/**
* Extend the save function of the formula editor to use the orbeon update
* mechanism, see also:
... |
// go through all canvases in the document
var canvases = document.getElementsByTagName("canvas");
for (var i=0; i<canvases.length; i++) {
// initialize a FormulaEditor for each canvas
var canvas = canvases[i];
if (canvas.nextSibling) {
if (canvas.nextSibling.tagNa... | {
oldXformsHandleResponse.apply(this, arguments);
} | conditional_block |
memory.py | # coding: utf-8
from __future__ import absolute_import
from apscheduler.jobstores.base import BaseJobStore, JobLookupError, ConflictingIdError
from apscheduler.util import datetime_to_utc_timestamp
class MemoryJobStore(BaseJobStore):
"""
Stores jobs in an array in RAM. Provides no persistence support.
P... | del self._jobs[index]
del self._jobs_index[job.id]
def remove_all_jobs(self):
self._jobs = []
self._jobs_index = {}
def shutdown(self):
self.remove_all_jobs()
def _get_job_index(self, timestamp, job_id):
"""
Returns the index of the given job, or if... | raise JobLookupError(job_id)
index = self._get_job_index(timestamp, job_id) | random_line_split |
memory.py | # coding: utf-8
from __future__ import absolute_import
from apscheduler.jobstores.base import BaseJobStore, JobLookupError, ConflictingIdError
from apscheduler.util import datetime_to_utc_timestamp
class MemoryJobStore(BaseJobStore):
"""
Stores jobs in an array in RAM. Provides no persistence support.
P... | (self, job):
old_job, old_timestamp = self._jobs_index.get(job.id, (None, None))
if old_job is None:
raise JobLookupError(job.id)
# If the next run time has not changed, simply replace the job in its present index.
# Otherwise, reinsert the job to the list to preserve the or... | update_job | identifier_name |
memory.py | # coding: utf-8
from __future__ import absolute_import
from apscheduler.jobstores.base import BaseJobStore, JobLookupError, ConflictingIdError
from apscheduler.util import datetime_to_utc_timestamp
class MemoryJobStore(BaseJobStore):
"""
Stores jobs in an array in RAM. Provides no persistence support.
P... |
def get_all_jobs(self):
return [j[0] for j in self._jobs]
def add_job(self, job):
if job.id in self._jobs_index:
raise ConflictingIdError(job.id)
timestamp = datetime_to_utc_timestamp(job.next_run_time)
index = self._get_job_index(timestamp, job.id)
self._... | return self._jobs[0][0].next_run_time if self._jobs else None | identifier_body |
memory.py | # coding: utf-8
from __future__ import absolute_import
from apscheduler.jobstores.base import BaseJobStore, JobLookupError, ConflictingIdError
from apscheduler.util import datetime_to_utc_timestamp
class MemoryJobStore(BaseJobStore):
"""
Stores jobs in an array in RAM. Provides no persistence support.
P... |
self._jobs_index[old_job.id] = (job, new_timestamp)
def remove_job(self, job_id):
job, timestamp = self._jobs_index.get(job_id, (None, None))
if job is None:
raise JobLookupError(job_id)
index = self._get_job_index(timestamp, job_id)
del self._jobs[index]
... | del self._jobs[old_index]
new_index = self._get_job_index(new_timestamp, job.id)
self._jobs.insert(new_index, (job, new_timestamp)) | conditional_block |
all_62.js | var searchData=
[
['base_5fvalue',['base_value',['../classAdData.html#a156da702ebf4837590f4854dc7c2bc81',1,'AdData']]], | ['bench_2ecpp',['bench.cpp',['../bench_8cpp.html',1,'']]],
['bench_2ehpp',['bench.hpp',['../bench_8hpp.html',1,'']]],
['block_5fof_5fmessages',['block_of_messages',['../classAdDataParallel.html#a9451414d03458e18a43331bc8eeb9db0',1,'AdDataParallel']]],
['break_5fnl',['break_nl',['../classAdData.html#a9c23c8706e4... | ['bench',['Bench',['../classBench.html',1,'']]], | random_line_split |
SafeAreaProviderCompat.tsx | import * as React from 'react';
import {
Dimensions,
Platform,
StyleProp,
StyleSheet,
View,
ViewStyle,
} from 'react-native';
import {
initialWindowMetrics,
SafeAreaInsetsContext,
SafeAreaProvider,
} from 'react-native-safe-area-context';
type Props = {
children: React.ReactNode;
style?: StylePro... | <SafeAreaInsetsContext.Consumer>
{(insets) => {
if (insets) {
// If we already have insets, don't wrap the stack in another safe area provider
// This avoids an issue with updates at the cost of potentially incorrect values
// https://github.com/react-navigation/react-nav... | random_line_split | |
SafeAreaProviderCompat.tsx | import * as React from 'react';
import {
Dimensions,
Platform,
StyleProp,
StyleSheet,
View,
ViewStyle,
} from 'react-native';
import {
initialWindowMetrics,
SafeAreaInsetsContext,
SafeAreaProvider,
} from 'react-native-safe-area-context';
type Props = {
children: React.ReactNode;
style?: StylePro... |
return (
<SafeAreaProvider initialMetrics={initialMetrics} style={style}>
{children}
</SafeAreaProvider>
);
}}
</SafeAreaInsetsContext.Consumer>
);
}
SafeAreaProviderCompat.initialMetrics = initialMetrics;
const styles = StyleSheet.create({
container: {
... | {
// If we already have insets, don't wrap the stack in another safe area provider
// This avoids an issue with updates at the cost of potentially incorrect values
// https://github.com/react-navigation/react-navigation/issues/174
return <View style={[styles.container, style]}>{c... | conditional_block |
SafeAreaProviderCompat.tsx | import * as React from 'react';
import {
Dimensions,
Platform,
StyleProp,
StyleSheet,
View,
ViewStyle,
} from 'react-native';
import {
initialWindowMetrics,
SafeAreaInsetsContext,
SafeAreaProvider,
} from 'react-native-safe-area-context';
type Props = {
children: React.ReactNode;
style?: StylePro... | ({ children, style }: Props) {
return (
<SafeAreaInsetsContext.Consumer>
{(insets) => {
if (insets) {
// If we already have insets, don't wrap the stack in another safe area provider
// This avoids an issue with updates at the cost of potentially incorrect values
// htt... | SafeAreaProviderCompat | identifier_name |
SafeAreaProviderCompat.tsx | import * as React from 'react';
import {
Dimensions,
Platform,
StyleProp,
StyleSheet,
View,
ViewStyle,
} from 'react-native';
import {
initialWindowMetrics,
SafeAreaInsetsContext,
SafeAreaProvider,
} from 'react-native-safe-area-context';
type Props = {
children: React.ReactNode;
style?: StylePro... |
SafeAreaProviderCompat.initialMetrics = initialMetrics;
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
| {
return (
<SafeAreaInsetsContext.Consumer>
{(insets) => {
if (insets) {
// If we already have insets, don't wrap the stack in another safe area provider
// This avoids an issue with updates at the cost of potentially incorrect values
// https://github.com/react-navigat... | identifier_body |
strings.py | class | :
ADD_SUPERVISOR = "You are now connected with "
START_MONITORING = " wants to monitor you, click to allow"
ACCEPTED_MONITORING= "You started monitoring "
STOP_MONITORING_SUPERVISE = " canceled monitoring"
STOP_MONITORING_SUPERVISOR = " is no longer monitoring you"
APPLICATION_ANOMALY = " opened... | Strings | identifier_name |
strings.py | class Strings:
ADD_SUPERVISOR = "You are now connected with "
START_MONITORING = " wants to monitor you, click to allow"
ACCEPTED_MONITORING= "You started monitoring "
STOP_MONITORING_SUPERVISE = " canceled monitoring" | STOP_MONITORING_SUPERVISOR = " is no longer monitoring you"
APPLICATION_ANOMALY = " opened an unauthorized application"
SPEED_ANOMALY = " drives faster then authorized. Speed: "
MONITOR_ACCEPTED = "Monitor accepted"
registration_id = "cRLRNiCkFPQ:APA91bENV-BxmM3iXhZ_DwlitVpI5nTvdqGhClq5K1M5sLIZ8aAca... | random_line_split | |
strings.py | class Strings:
| ADD_SUPERVISOR = "You are now connected with "
START_MONITORING = " wants to monitor you, click to allow"
ACCEPTED_MONITORING= "You started monitoring "
STOP_MONITORING_SUPERVISE = " canceled monitoring"
STOP_MONITORING_SUPERVISOR = " is no longer monitoring you"
APPLICATION_ANOMALY = " opened an un... | identifier_body | |
home.client.controller.js | 'use strict';
angular.module('core').controller('HomeController', ['$scope', '$http', '$location', 'Authentication',
function($scope, $http, $location, Authentication) {
// =====================================================================
// Non $scope member
// ============================================... | };
// =====================================================================
// Event listener
// =====================================================================
}
]); | }).error(function(response) {
$scope.error = response.message;
}); | random_line_split |
index.js | $('.message a').click(function(){ | var name = document.getElementById('name1');
var pw = document.getElementById('pw');
function store() {
localStorage.setItem('name1', name.value);
localStorage.setItem('pw', pw.value);
}
function check() {
// stored data from the register-form
var storedName = localStorage.getItem('name1');
var st... | $('form').animate({height: "toggle", opacity: "toggle"}, "slow");
}); | random_line_split |
index.js | $('.message a').click(function(){
$('form').animate({height: "toggle", opacity: "toggle"}, "slow");
});
var name = document.getElementById('name1');
var pw = document.getElementById('pw');
function store() {
localStorage.setItem('name1', name.value);
localStorage.setItem('pw', pw.value);
}
function check() ... | else{
alert("NO");
}
}
function create(){
profile["UserName"] = "username";
profile["PassWord"] = "passwo";
profile["email"] = "email";
document.getElementById("username").value;
document.getElementById("passwo").value;
document.getElementById("email").value;
profile.push("username");
profile.push("passwo... | {
alert("YES");
} | conditional_block |
index.js | $('.message a').click(function(){
$('form').animate({height: "toggle", opacity: "toggle"}, "slow");
});
var name = document.getElementById('name1');
var pw = document.getElementById('pw');
function store() {
localStorage.setItem('name1', name.value);
localStorage.setItem('pw', pw.value);
}
function check() ... | (){
profile["UserName"] = "username";
profile["PassWord"] = "passwo";
profile["email"] = "email";
document.getElementById("username").value;
document.getElementById("passwo").value;
document.getElementById("email").value;
profile.push("username");
profile.push("passwo");
profile.push("email");
accounts.pu... | create | identifier_name |
index.js | $('.message a').click(function(){
$('form').animate({height: "toggle", opacity: "toggle"}, "slow");
});
var name = document.getElementById('name1');
var pw = document.getElementById('pw');
function store() {
localStorage.setItem('name1', name.value);
localStorage.setItem('pw', pw.value);
}
function check() |
var accounts = [];
var profile = [];
function finding(){
indexof(0) = username;
}
function login(){
var username = document.getElementById("usern").value;
var passwo = document.getElementById("passw").value;
while (username != accounts(profile[0])){
accounts.forEach(finding);
var found = username;
}
if (pass... | {
// stored data from the register-form
var storedName = localStorage.getItem('name1');
var storedPw = localStorage.getItem('pw');
// entered data from the login-form
var userName = document.getElementById('userName');
var userPw = document.getElementById('userPw');
// check if stored dat... | identifier_body |
java_compile.py | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | relative_classpath = relativize_paths(classpath, self._buildroot)
jmake_classpath = self.tool_classpath('jmake')
args = [
'-classpath', ':'.join(relative_classpath),
'-d', classes_output_dir,
'-pdb', analysis_file,
'-pdb-text-format',
]
# TODO: This file should always exist for... | identifier_body | |
java_compile.py | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... |
args.append('-C-Tdependencyfile')
args.append('-C{}'.format(self._depfile))
jvm_options = list(self._jvm_options)
args.extend(sources)
result = self.runjava(classpath=jmake_classpath,
main=JmakeCompile._JMAKE_MAIN,
jvm_options=jvm_options,
... | args.extend(['-C-target', '-C{0}'.format(target_level)]) | conditional_block |
java_compile.py | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | (cls):
return ('-C-Xlint:none', '-C-nowarn')
@classmethod
def register_options(cls, register):
super(JmakeCompile, cls).register_options(register)
register('--use-jmake', advanced=True, action='store_true', default=True,
fingerprint=True,
help='Use jmake to compile Java target... | get_no_warning_args_default | identifier_name |
java_compile.py | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | -11: 'invalid source file extension',
-12: 'a class in a JAR is found dependent on a class with the .java source',
-13: 'more than one entry for the same class is found in the project',
-20: 'internal Java error (caused by java.lang.InternalError)',
-30: 'internal Java error (caused by java.lang.RuntimeExcept... | -6: 'error parsing a class file',
-7: 'file not found',
-8: 'I/O exception',
-9: 'internal jmake exception',
-10: 'deduced and actual class name mismatch', | random_line_split |
mysigs.py |
from __future__ import division
import myhdl
from myhdl import instance, delay
ClockList = []
class Clock(myhdl.SignalType):
def __init__(self, val, frequency=1, timescale='1ns'):
self._frequency = frequency
self._period = 1/frequency
self._timescale = timescale
self._htick... | (self):
return self._frequency
@frequency.setter
def frequency(self, f):
self._frequency = f
self._period = 1/f
self._set_hticks()
@property
def period(self):
return self._period
def _set_hticks(self):
# self._nts = self._convert_timescale(s... | frequency | identifier_name |
mysigs.py | from __future__ import division
import myhdl
from myhdl import instance, delay
ClockList = []
class Clock(myhdl.SignalType):
def __init__(self, val, frequency=1, timescale='1ns'):
self._frequency = frequency
self._period = 1/frequency
self._timescale = timescale
self._hticks ... |
def _convert_timescale(self, ts):
# @todo: need to complete this, ts is in the form
# "[0-9]*["ms","us","ns","ps"], parse the text
# format and retrieve a numerical value
# separate the numerical and text
nts = 1e9
return nts
def gen(self, ... |
def _set_hticks(self):
# self._nts = self._convert_timescale(self._timescale)
# self._hticks = int(round(self._period/self._nts))
self._hticks = 5 | random_line_split |
mysigs.py |
from __future__ import division
import myhdl
from myhdl import instance, delay
ClockList = []
class Clock(myhdl.SignalType):
def __init__(self, val, frequency=1, timescale='1ns'):
self._frequency = frequency
self._period = 1/frequency
self._timescale = timescale
self._htick... |
else:
self._hticks = hticks
# print('hticks %d'%(hticks))
@instance
def gclock():
self.next = False
while True:
yield delay(hticks)
self.next = not self.val
return gclock
class Reset(myhdl.ResetSignal):
... | hticks = self._hticks | conditional_block |
mysigs.py |
from __future__ import division
import myhdl
from myhdl import instance, delay
ClockList = []
class Clock(myhdl.SignalType):
def __init__(self, val, frequency=1, timescale='1ns'):
self._frequency = frequency
self._period = 1/frequency
self._timescale = timescale
self._htick... | if isinstance(delays, int):
self.next = self.active
yield delay(delays)
self.next = not self.active
elif isinstance(delays, tuple):
assert len(delays) in (1, 2, 3), "Incorrect number of delays"
self.next = not self.active if len(delays) == 3 else self.... | identifier_body | |
user.ts | import * as fs from 'fs'
import * as gm from 'gm'
import * as request from 'superagent'
const { promisify } = require('util')
const tesseract = require('node-tesseract')
import _h from '../../utils/headers'
import _c from '../../utils/charset'
import config from '../../config/user'
const headers = _h.updateHeaders()... |
const cookies = sres.headers['set-cookie']
let cookie = cookies.find(el => el.includes('JSESSIONID'))
return resolve({
cookie: cookie.split(';')[0]
})
})
})
export const getImg = (cookie: string) => new Promise((resolve, reject) => {
request
.get(imgURL)
.set(headers)
... | {
return reject(err)
} | conditional_block |
user.ts | import * as fs from 'fs'
import * as gm from 'gm'
import * as request from 'superagent'
const { promisify } = require('util')
const tesseract = require('node-tesseract')
import _h from '../../utils/headers'
import _c from '../../utils/charset'
import config from '../../config/user'
const headers = _h.updateHeaders()... | return reject(err)
}
resolve(sres.body)
})
})
export const saveImg = ({ username, img, imgDir }: TYPE) => new Promise((resolve) => {
const writeFile = promisify(fs.writeFile)
writeFile(imgDir, img).then(() => resolve())
})
export const editImg = ({ username, imgDir }: TYPE) => new Promise... | .set(headers)
.set('Cookie', cookie)
.end((err, sres) => {
if (err) { | random_line_split |
yuan-ti.ts | import * as Names from "app/models/names";
import { NameList } from "./name-list";
/* cSpell:disable */
export const YuanTi: Names.NameDefinition = new Names.NameDefinition({
name: "Yuan-ti",
formats: [{ name: "Forename", formats: ["{name}"] }],
parts: {
name: {
markovOrder: 2,
... | "tlaltecuhtli,", "tochtli", "tonatiuh", "totec", "tototl", "xilonen", "xipe", "xiuhpilli", "xochitl", "xochitl",
"yaotl", "yaretzi", "zolin"
]
},
}
}
});
NameList.push(YuanTi); | "cuauhtémoc", "eréndira", "huitzilin", "huitzilopochtli", "itzcóatl", "itzli", "matlal", "matlalihuitl", "mayahuel",
"nochehuatl", "quauhtli", "quetzalcoatl", "teiuc", "teyacapan", "tezcatlipoca", "tlacotl", "tlaloc", "tlaloc", | random_line_split |
app.js | import React, { Component } from 'react' ;
import { connect } from 'reslice' ;
import Footer from './footer' ;
import AddTodo from './addtodo' ;
import TodoList from './todolist' ;
/**
* Top-level component. Embeds the AddTodo, TodoList and Footer
* (application) components. These are each passed their slice of
* ... | () {
let { slice, filter } = this.props ;
return (
<div>
<AddTodo slice={ slice.addtodo } onAddTodo={ this.onAddTodo }/>
<TodoList slice={ slice.todolist } filter={ filter }/>
<Footer slice={ slice.footer } />
</div>
) ... | render | identifier_name |
app.js | import React, { Component } from 'react' ;
import { connect } from 'reslice' ;
import Footer from './footer' ;
import AddTodo from './addtodo' ;
import TodoList from './todolist' ;
/**
* Top-level component. Embeds the AddTodo, TodoList and Footer
* (application) components. These are each passed their slice of
* ... | } ;
}
export default connect(mapStateToProps, mapDispatchToProps)(App) ; | random_line_split | |
selectionClipboard.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... |
}));
this._register(editor.onMouseDown((e:IEditorMouseEvent) => {
if (!isEnabled) {
return;
}
if (!editor.getModel()) {
return;
}
if (e.event.middleButton) {
e.event.preventDefault();
editor.focus();
if (e.target.position) {
editor.setPosition(e.target.positio... | {
isEnabled = editor.getConfiguration().contribInfo.selectionClipboard;
} | conditional_block |
selectionClipboard.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... | (): void {
super.dispose();
}
}
EditorBrowserRegistry.registerEditorContribution(SelectionClipboard);
| dispose | identifier_name |
selectionClipboard.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... |
}
EditorBrowserRegistry.registerEditorContribution(SelectionClipboard);
| {
super.dispose();
} | identifier_body |
selectionClipboard.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... | process.nextTick(() => {
// TODO@Alex: electron weirdness: calling clipboard.readText('selection') generates a paste event, so no need to execute paste ourselves
clipboard.readText('selection');
// keybindingService.executeCommand(Handler.Paste, {
// text: clipboard.readText('selection'),
... | if (e.target.position) {
editor.setPosition(e.target.position);
}
| random_line_split |
models.py | from __future__ import unicode_literals
from future.builtins import str
from datetime import datetime
import re
try:
from urllib.parse import quote
except ImportError:
# Python 2
from urllib import quote
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from djang... |
else:
raise TwitterQueryException("Twitter OAuth settings missing")
try:
tweets = requests.get(url, auth=OAuth1(*auth_settings)).json()
except Exception as e:
raise TwitterQueryException("Error retrieving: %s" % e)
try:
raise Twitt... | auth_settings = (
"KxZTRD3OBft4PP0iQW0aNQ",
"sXpQRSDUVJ2AVPZTfh6MrJjHfOGcdK4wRb1WTGQ",
"1368725588-ldWCsd54AJpG2xcB5nyTHyCeIC3RJcNVUAkB1OI",
"r9u7qS18t8ad4Hu9XVqmCGxlIpzoCN3e1vx6LOSVgyw3R",
) | conditional_block |
models.py | from __future__ import unicode_literals
from future.builtins import str
from datetime import datetime
import re
try:
from urllib.parse import quote
except ImportError:
# Python 2
from urllib import quote
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from djang... | from mezzanine.twitter import get_auth_settings
from mezzanine.twitter.managers import TweetManager
re_usernames = re.compile("@([0-9a-zA-Z+_]+)", re.IGNORECASE)
re_hashtags = re.compile("#([0-9a-zA-Z+_]+)", re.IGNORECASE)
replace_hashtags = "<a href=\"http://twitter.com/search?q=%23\\1\">#\\1</a>"
replace_usernames ... | QUERY_TYPE_LIST, QUERY_TYPE_SEARCH | random_line_split |
models.py | from __future__ import unicode_literals
from future.builtins import str
from datetime import datetime
import re
try:
from urllib.parse import quote
except ImportError:
# Python 2
from urllib import quote
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from djang... |
@python_2_unicode_compatible
class Query(models.Model):
type = models.CharField(_("Type"), choices=QUERY_TYPE_CHOICES,
max_length=10)
value = models.CharField(_("Value"), max_length=140)
interested = models.BooleanField("Interested", default=True)
class Meta:
ver... | pass | identifier_body |
models.py | from __future__ import unicode_literals
from future.builtins import str
from datetime import datetime
import re
try:
from urllib.parse import quote
except ImportError:
# Python 2
from urllib import quote
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from djang... | :
verbose_name = _("Twitter query")
verbose_name_plural = _("Twitter queries")
ordering = ("-id",)
def __str__(self):
return "%s: %s" % (self.get_type_display(), self.value)
def run(self):
"""
Request new tweets from the Twitter API.
"""
try:
... | Meta | identifier_name |
struct-partial-move-1.rs | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
// | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[derive(PartialEq, Debug)]
pub struct Partial<T> { x: T, y: T }
#[derive(PartialEq, Debug)]
struct S { val: isize }
impl S { fn new(v: isize) -> S { S {... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | random_line_split |
struct-partial-move-1.rs | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | { val: isize }
impl S { fn new(v: isize) -> S { S { val: v } } }
impl Drop for S { fn drop(&mut self) { } }
pub fn f<T, F>((b1, b2): (T, T), mut f: F) -> Partial<T> where F: FnMut(T) -> T {
let p = Partial { x: b1, y: b2 };
// Move of `p` is legal even though we are also moving `p.y`; the
// `..p` moves ... | S | identifier_name |
zbytes.rs | //! The `zbyte` module contains code
//! to deal with opcodes and zcode.
/// A struct that holds an array of bytes and provides some convenience functions.
pub struct Bytes {
/// The underlying data
pub bytes: Vec<u8>
}
impl Bytes {
/// Returns the length of the byte array.
pub fn len(&self) -> usize ... | ///
/// `=> [index-1] == 0; [index] == nil;`
pub fn write_zero_until(&mut self, index: usize) {
while self.len() < index {
self.bytes.push(0);
}
}
/// Prints the underlying byte array
pub fn print(&self) {
debug!("bytes: {:?}", self.bytes);
}
} | /// Fills everything with zeros until but not including the index. | random_line_split |
zbytes.rs | //! The `zbyte` module contains code
//! to deal with opcodes and zcode.
/// A struct that holds an array of bytes and provides some convenience functions.
pub struct Bytes {
/// The underlying data
pub bytes: Vec<u8>
}
impl Bytes {
/// Returns the length of the byte array.
pub fn len(&self) -> usize ... | (&mut self, byte: u8) {
let index: usize = self.bytes.len();
self.write_byte(byte, index);
}
/// Writes a u16 in two bytes with the correct byte-order for the Z-Machine at the specified
/// index.
pub fn write_u16(&mut self, value: u16, index: usize) {
self.write_byte((value >> ... | append_byte | identifier_name |
es-DO.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
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js
function plural(n: number... | 'KRW': [, '₩'],
'MXN': [, '$'],
'NZD': [, '$'],
'RON': [, 'L'],
'SSP': [, 'SD£'],
'SYP': [, 'S£'],
'TWD': [, 'NT$'],
'USD': ['US$', '$'],
'VEF': [, 'BsF'],
'VND': [, '₫'],
'XAF': [],
'XCD': [, '$'],
'XOF': []
},
plural
]; | random_line_split | |
es-DO.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
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js
function | (n: number): number {
if (n === 1) return 1;
return 5;
}
export default [
'es-DO',
[
['a. m.', 'p. m.'],
,
],
,
[
['D', 'L', 'M', 'M', 'J', 'V', 'S'], ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'],
['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
... | plural | identifier_name |
es-DO.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
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js
function plural(n: number... |
export default [
'es-DO',
[
['a. m.', 'p. m.'],
,
],
,
[
['D', 'L', 'M', 'M', 'J', 'V', 'S'], ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'],
['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'],
['DO', 'LU', 'MA', 'MI', 'JU', 'VI', 'SA']
],
,
[
... | {
if (n === 1) return 1;
return 5;
} | identifier_body |
closeevent.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
use dom::bindings::codegen::Bindings::CloseEvent... | else {
EventCancelable::NotCancelable
};
Ok(CloseEvent::new(global, type_, bubbles, cancelable, init.wasClean,
init.code, init.reason.clone()))
}
}
impl<'a> CloseEventMethods for &'a CloseEvent {
// https://html.spec.whatwg.org/multipage/#dom-closeevent-w... | {
EventCancelable::Cancelable
} | conditional_block |
closeevent.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
use dom::bindings::codegen::Bindings::CloseEvent... |
// https://html.spec.whatwg.org/multipage/#dom-closeevent-reason
fn Reason(self) -> DOMString {
self.reason.clone()
}
}
| {
self.code
} | identifier_body |
closeevent.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
use dom::bindings::codegen::Bindings::CloseEvent... | reason: DOMString,
}
impl CloseEvent {
pub fn new_inherited(type_id: EventTypeId, wasClean: bool, code: u16,
reason: DOMString) -> CloseEvent {
CloseEvent {
event: Event::new_inherited(type_id),
wasClean: wasClean,
code: code,
rea... | #[derive(HeapSizeOf)]
pub struct CloseEvent {
event: Event,
wasClean: bool,
code: u16, | random_line_split |
closeevent.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
use dom::bindings::codegen::Bindings::CloseEvent... | (global: GlobalRef,
type_: DOMString,
bubbles: EventBubbles,
cancelable: EventCancelable,
wasClean: bool,
code: u16,
reason: DOMString) -> Root<CloseEvent> {
let event = box CloseEvent::new_inherited(EventTypeId::CloseEven... | new | identifier_name |
es.py | # coding: utf-8
{
'!langcode!': 'es',
'!langname!': 'Español',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN',
'%d days ago'... | 'value already in database or empty': 'el valor ya existe en la base de datos o está vacío',
'value not in database': 'el valor no está en la base de datos',
'Verify Password': 'Verificar Contraseña',
'versioning': 'versiones',
'Videos': 'Vídeos',
'View': 'Vista',
'view': 'vista',
'views': 'vistas',
'Views': 'Vistas',
... | 'Users': 'Usuarios', | random_line_split |
views.py | from django.shortcuts import redirect
from django.shortcuts import render
from django.views.decorators.cache import never_cache
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.decorators import login_required
from registration.backends import get_backend
def register(request, ba... |
@never_cache
def verify(request, backend='default', template_name='registration/registration_verify.html', **kwargs):
backend = get_backend(backend)
profile = backend.get_profile(request, **kwargs)
if profile:
# check to see if moderation for this profile is required and whether or
# not ... | backend = get_backend(backend)
# determine is registration is currently allowed. the ``request`` object
# is passed which can be used to selectively disallow registration based on
# the user-agent
if not backend.registration_allowed(request):
return redirect(*backend.registration_closed_redirec... | identifier_body |
views.py | from django.shortcuts import redirect
from django.shortcuts import render
from django.views.decorators.cache import never_cache
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.decorators import login_required
from registration.backends import get_backend
def register(request, ba... |
else:
form = form_class()
return render(request, template_name, {
'form': form,
'profile': profile,
})
@permission_required('registration.change_registrationprofile')
@login_required()
def moderate_list(request, backend='default', template_name='registration/registration_moderate_... | form = form_class(request.POST)
if form.is_valid():
backend.moderate(request, form, profile, **kwargs)
return redirect(backend.post_moderation_redirect(request, profile)) | conditional_block |
views.py | from django.contrib.auth.decorators import permission_required
from django.contrib.auth.decorators import login_required
from registration.backends import get_backend
def register(request, backend='default', template_name='registration/registration_form.html'):
backend = get_backend(backend)
# determine is re... | from django.shortcuts import redirect
from django.shortcuts import render
from django.views.decorators.cache import never_cache | random_line_split | |
views.py | from django.shortcuts import redirect
from django.shortcuts import render
from django.views.decorators.cache import never_cache
from django.contrib.auth.decorators import permission_required
from django.contrib.auth.decorators import login_required
from registration.backends import get_backend
def | (request, backend='default', template_name='registration/registration_form.html'):
backend = get_backend(backend)
# determine is registration is currently allowed. the ``request`` object
# is passed which can be used to selectively disallow registration based on
# the user-agent
if not backend.regi... | register | identifier_name |
index.tsx | /**
* Copyright 2020 Google LLC
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | <ListingCard
listingName="Some Listing"
price={SAMPLE_PRICE}
oldPrice={SAMPLE_OLD_PRICE}
endDate={SAMPLE_END_DATE}
imgUrl={SAMPLE_IMG_URL}
horizontal
>
<CommitProgress numCommits={70} minCommits={100} />
</ListingCard>
<... | >
<CommitProgress numCommits={70} minCommits={100} textPos="none" />
</ListingCard>
</StrippedCol>
<StrippedCol xs={12}> | random_line_split |
css.js | CodeMirror.defineMode("css", function(config) {
var indentUnit = config.indentUnit, type;
function ret(style, tp) {type = tp; return style;}
function | (stream, state) {
var ch = stream.next();
if (ch == "@") {stream.eatWhile(/\w/); return ret("meta", stream.current());}
else if (ch == "/" && stream.eat("*")) {
state.tokenize = tokenCComment;
return tokenCComment(stream, state);
}
else if (ch == "<" && stream.eat("!")) {
state.tok... | tokenBase | identifier_name |
css.js | CodeMirror.defineMode("css", function(config) {
var indentUnit = config.indentUnit, type;
function ret(style, tp) {type = tp; return style;}
function tokenBase(stream, state) {
var ch = stream.next();
if (ch == "@") {stream.eatWhile(/\w/); return ret("meta", stream.current());}
else if (ch == "/" && ... |
return {
startState: function(base) {
return {tokenize: tokenBase,
baseIndent: base || 0,
stack: []};
},
token: function(stream, state) {
if (stream.eatSpace()) return null;
var style = state.tokenize(stream, state);
var context = state.stack[state.s... | {
return function(stream, state) {
var escaped = false, ch;
while ((ch = stream.next()) != null) {
if (ch == quote && !escaped)
break;
escaped = !escaped && ch == "\\";
}
if (!escaped) state.tokenize = tokenBase;
return ret("string", "string");
};
} | identifier_body |
css.js | CodeMirror.defineMode("css", function(config) {
var indentUnit = config.indentUnit, type;
function ret(style, tp) {type = tp; return style;}
function tokenBase(stream, state) {
var ch = stream.next();
if (ch == "@") {stream.eatWhile(/\w/); return ret("meta", stream.current());}
else if (ch == "/" && ... | n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1;
return state.baseIndent + n * indentUnit;
},
electricChars: "}"
};
});
CodeMirror.defineMIME("text/css", "css"); | indent: function(state, textAfter) {
var n = state.stack.length;
if (/^\}/.test(textAfter)) | random_line_split |
scheduler_class.py | """
MIT License
Copyright (c) 2017 cgalleguillosm, AlessioNetti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, ... | :param es: events to be scheduled
:return: a tuple of (time to schedule, event id, list of assigned nodes), an array jobs id of rejected jobs
"""
to_reject = []
to_schedule = SortedListWithKey(jobs, **self.sorting_parameters)
re... | random_line_split | |
scheduler_class.py | """
MIT License
Copyright (c) 2017 cgalleguillosm, AlessioNetti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, ... |
to_allocate = []
# On accepted jobs by policy, try to schedule with the scheduling policy
if accepted:
to_allocate, to_reject = self.scheduling_method(cur_time, accepted, es_dict)
rejected += to_reject
for e in to_reject:
... | job = es_dict[e]
if not job.get_checked() and not self._check_job_request(job):
if self._job_check != JobVerification.REJECT:
self._logger.warning('{} has been rejected by the dispatcher. ({})'.format(e, self._job_check))
rejected.append(e)
... | conditional_block |
scheduler_class.py | """
MIT License
Copyright (c) 2017 cgalleguillosm, AlessioNetti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, ... | (self, _job):
"""
Simple method that checks if the loaded _job violates the system's resource constraints.
:param _job: Job object
:return: True if the _job is valid, false otherwise
"""
_job.set_checked(True)
if self._job_check == JobVerification.R... | _check_job_request | identifier_name |
scheduler_class.py | """
MIT License
Copyright (c) 2017 cgalleguillosm, AlessioNetti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, ... |
@abstractmethod
def scheduling_method(self, cur_time, es_dict, es):
"""
This function must map the queued events to available nodes at the current time.
:param cur_time: current time
:param es_dict: dictionary with full data of the job events
... | """
Must return the full ID of the scheduler, including policy and allocator.
:return: the scheduler's id.
"""
raise NotImplementedError | identifier_body |
index.tsx | import * as React from 'react'
import { F, Atom } from '@grammarly/focal'
import { of } from 'rxjs'
let globalCounter = 0
function mkName() {
return (++globalCounter).toString()
}
const El = ({ text = '', ts = '' }) => {
return <F.div>
El #{text} (render #{ts})
{of(undefined)}
</F.div>
} |
const ElWithHover = ({ text = '' }) => {
const ts = mkName()
console.log('RENDERED', ts)
const hovered = Atom.create(false)
return <F.div
onMouseEnter={() => hovered.set(true)}
onMouseLeave={() => hovered.set(false)}
>
El #{text} (render #{ts}) is
{hovered.view(x => {
console.lo... | random_line_split | |
index.tsx | import * as React from 'react'
import { F, Atom } from '@grammarly/focal'
import { of } from 'rxjs'
let globalCounter = 0
function mkName() |
const El = ({ text = '', ts = '' }) => {
return <F.div>
El #{text} (render #{ts})
{of(undefined)}
</F.div>
}
const ElWithHover = ({ text = '' }) => {
const ts = mkName()
console.log('RENDERED', ts)
const hovered = Atom.create(false)
return <F.div
onMouseEnter={() => hovered.set(true)}
o... | {
return (++globalCounter).toString()
} | identifier_body |
index.tsx | import * as React from 'react'
import { F, Atom } from '@grammarly/focal'
import { of } from 'rxjs'
let globalCounter = 0
function | () {
return (++globalCounter).toString()
}
const El = ({ text = '', ts = '' }) => {
return <F.div>
El #{text} (render #{ts})
{of(undefined)}
</F.div>
}
const ElWithHover = ({ text = '' }) => {
const ts = mkName()
console.log('RENDERED', ts)
const hovered = Atom.create(false)
return <F.div
... | mkName | identifier_name |
upgrade.ts | /*
* LiskHQ/lisk-commander
* Copyright © 2017–2018 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be c... | cacheDir,
releaseUrl,
upgradeVersion,
);
},
},
{
title: `Backup Lisk Core: ${currentVersion} installed as ${name}`,
task: async () => {
await backupLisk(installDir);
},
},
{
title: `Install Lisk Core: ${upgradeVersion}... | task: async () => {
await downloadLiskAndValidate( | random_line_split |
upgrade.ts | /*
* LiskHQ/lisk-commander
* Copyright © 2017–2018 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be c... | Promise<void> {
const { args, flags } = this.parse(UpgradeCommand);
const { name }: Args = args;
const { 'lisk-version': liskVersion } = flags as Flags;
const { pm2_env } = await describeApplication(name);
const { pm_cwd: installDir, LISK_NETWORK: network } = pm2_env as Pm2Env;
const { version: currentVers... | (): | identifier_name |
upgrade.ts | /*
* LiskHQ/lisk-commander
* Copyright © 2017–2018 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be c... | await startDatabase(installDir, network);
await restartApplication(name);
},
},
]);
await tasks.run();
}
}
| await startCache(installDir, network);
}
| conditional_block |
assignment-expression.js | 'use strict';
module.exports = function (node, scope, environment, utils) {
function assignResult(value) |
return utils.when(utils.evaluateNode(node.right, scope, environment), function (value) {
switch (node.operator) {
case '=':
assignResult(value);
return value;
default:
throw new Error('Unexpected operator ' + node.operator);
}
});
};
| {
if (node.left.type === 'Identifier') {
scope.assign(node.left.name, value);
} else if (node.left.type = 'MemberExpression') {
if (node.left.computed) {
return utils.when(utils.evaluateArray([node.left.object, node.left.property], scope, environment), function (results) {
if (resu... | identifier_body |
assignment-expression.js | 'use strict';
module.exports = function (node, scope, environment, utils) {
function assignResult(value) {
if (node.left.type === 'Identifier') {
scope.assign(node.left.name, value);
} else if (node.left.type = 'MemberExpression') {
if (node.left.computed) |
} else {
throw new Error('Invalid left hand side of assignment ' + node.left.type);
}
}
return utils.when(utils.evaluateNode(node.right, scope, environment), function (value) {
switch (node.operator) {
case '=':
assignResult(value);
return value;
default:
throw... | {
return utils.when(utils.evaluateArray([node.left.object, node.left.property], scope, environment), function (results) {
if (results[1] && (results[1].type === 'string' || results[1].type === 'number')) {
return results[0].setProperty(results[1].value, value);
}
});
... | conditional_block |
assignment-expression.js | 'use strict';
module.exports = function (node, scope, environment, utils) {
function assignResult(value) {
if (node.left.type === 'Identifier') {
scope.assign(node.left.name, value);
} else if (node.left.type = 'MemberExpression') {
if (node.left.computed) {
return utils.when(utils.evalua... | default:
throw new Error('Unexpected operator ' + node.operator);
}
});
}; | return utils.when(utils.evaluateNode(node.right, scope, environment), function (value) {
switch (node.operator) {
case '=':
assignResult(value);
return value; | random_line_split |
assignment-expression.js | 'use strict';
module.exports = function (node, scope, environment, utils) {
function | (value) {
if (node.left.type === 'Identifier') {
scope.assign(node.left.name, value);
} else if (node.left.type = 'MemberExpression') {
if (node.left.computed) {
return utils.when(utils.evaluateArray([node.left.object, node.left.property], scope, environment), function (results) {
... | assignResult | identifier_name |
bind-to-item.tsx | import * as React from "react";
import { database } from "./init";
import { isEqual, difference } from "lodash";
/// <reference path="../react.d.ts" />
const enum Status {
Pending,
LoadedFromLocalStorage,
LoadedFromFirebase
}
interface IProps<P> {
firebaseRef: string;
cacheLocally?: boolean;
loader?: (pr... | }
private buildOtherProps(outerProps: OuterProps<P>): P {
const otherProps = {} as P;
for (const id of difference(Object.keys(outerProps), BindToItem.propKeys)) {
otherProps[id] = outerProps[id];
}
return otherProps;
}
private buildInnerProps(outerProps: OuterProps<P>... | } | random_line_split |
bind-to-item.tsx | import * as React from "react";
import { database } from "./init";
import { isEqual, difference } from "lodash";
/// <reference path="../react.d.ts" />
const enum Status {
Pending,
LoadedFromLocalStorage,
LoadedFromFirebase
}
interface IProps<P> {
firebaseRef: string;
cacheLocally?: boolean;
loader?: (pr... |
private updateData(snapshot: firebase.database.DataSnapshot) {
const val = snapshot.val() as T;
this.setState({ data: val, status: Status.LoadedFromFirebase });
if (this.props.cacheLocally) {
saveToStorage(this.props.firebaseRef, val, this.props.storage);
}
}
private debu... | {
const innerProps = this.buildOtherProps(outerProps) as InnerProps<T, P> ;
innerProps.data = this.state.data;
return innerProps;
} | identifier_body |
bind-to-item.tsx | import * as React from "react";
import { database } from "./init";
import { isEqual, difference } from "lodash";
/// <reference path="../react.d.ts" />
const enum Status {
Pending,
LoadedFromLocalStorage,
LoadedFromFirebase
}
interface IProps<P> {
firebaseRef: string;
cacheLocally?: boolean;
loader?: (pr... | else {
this.state = state;
}
}
private buildOtherProps(outerProps: OuterProps<P>): P {
const otherProps = {} as P;
for (const id of difference(Object.keys(outerProps), BindToItem.propKeys)) {
otherProps[id] = outerProps[id];
}
return otherProps;
}
priva... | {
this.setState(state);
} | conditional_block |
bind-to-item.tsx | import * as React from "react";
import { database } from "./init";
import { isEqual, difference } from "lodash";
/// <reference path="../react.d.ts" />
const enum Status {
Pending,
LoadedFromLocalStorage,
LoadedFromFirebase
}
interface IProps<P> {
firebaseRef: string;
cacheLocally?: boolean;
loader?: (pr... | (props: OuterProps<P>) {
super(props);
this.reset(props, false);
}
public componentWillReceiveProps(nextProps: OuterProps<P>) {
// reset if reference changes
if (this.props.firebaseRef !== nextProps.firebaseRef) {
this.debug("Reseting since Firebase reference has changed");
... | constructor | identifier_name |
build.rs | // Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
use prost_build::Config;
fn | () -> Result<(), Box<dyn std::error::Error>> {
let mut config = Config::new();
config.bytes(&["."]);
tonic_build::configure()
.build_client(true)
.build_server(true)
.compile_with_config(
config,
&[
"protos/bazelbuild_remote-apis/build/bazel/remote/execution/v2/remote_execution.pr... | main | identifier_name |
build.rs | // Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
use prost_build::Config;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut config = Config::new();
config.bytes(&["."]);
tonic_build::configure()
.build_client(tr... | )?;
Ok(())
} | ], | random_line_split |
build.rs | // Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
use prost_build::Config;
fn main() -> Result<(), Box<dyn std::error::Error>> | {
let mut config = Config::new();
config.bytes(&["."]);
tonic_build::configure()
.build_client(true)
.build_server(true)
.compile_with_config(
config,
&[
"protos/bazelbuild_remote-apis/build/bazel/remote/execution/v2/remote_execution.proto",
"protos/bazelbuild_remote-apis/... | identifier_body | |
lib.rs | extern crate httparse;
extern crate hyper;
extern crate mio;
extern crate netbuf;
extern crate rotor;
extern crate unicase;
extern crate url;
extern crate time;
extern crate multimap;
use rotor::transports::{accept, stream};
pub use hyper::method::Method;
pub use hyper::status::StatusCode;
pub use hyper::version::Htt... | pub type HttpServer<C, R> = accept::Serve<C,
TcpListener,
stream::Stream<C, TcpStream, http1::Client<C, R>>>; | pub mod http1;
mod message;
mod request;
mod response;
| random_line_split |
evaluateXPathToStrings.ts | import IDomFacade from './domFacade/IDomFacade';
import evaluateXPath, { EvaluableExpression } from './evaluateXPath';
import { Options } from './types/Options';
/**
* Evaluates an XPath on the given contextNode. Returns the string result as if the XPath is wrapped in string(...). | * @param contextItem - The node from which to run the XPath.
* @param domFacade - The domFacade (or DomFacade like interface) for retrieving relations.
* @param variables - Extra variables (name to value). Values can be number, string, boolean, nodes or object literals and arrays.
* @param options - Ext... | *
* @public
*
* @param selector - The selector to execute. Supports XPath 3.1. | random_line_split |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.