_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q9100 | run | train | function run(data) {
var cookies = cookie.parse(data.cookies);
debug('cookies: ', cookies);
request({
method: 'POST',
url: 'http://weibo.com/aj/mblog/add?_wv=5&__rnd=' + (new Date).getTime(),
headers: {
Cookie: data.cookies,
Referer: data.referer
},
form: 'text=you%20are%20attacked... | javascript | {
"resource": ""
} |
q9101 | getMaven | train | function getMaven(dir) {
var mvn = 'mvn';
var isWin = /^win/.test(process.platform);
// check for wrapper
if (isWin) {
if (fs.existsSync(path.resolve(dir, 'mvnw.bat'))) {
mvn = path.resolve(dir, 'mvnw.bat');
}
| javascript | {
"resource": ""
} |
q9102 | getBootstrapNode | train | function getBootstrapNode() {
// Use the cache if already found.
if (cache) {
return cache;
}
// Get the debug object.
var Debug = require('vm').runInDebugContext('Debug');
// Use the debug object to list all of the scripts.
// It is only possible to get the scripts is a listener is set.
// However, we do n... | javascript | {
"resource": ""
} |
q9103 | buildStars | train | function buildStars(numVerts, cells) {
var stars = new Array(numVerts)
for(var i=0; i<numVerts; ++i) {
stars[i] = []
}
var numCells = cells.length
for(var i=0; i<numCells; ++i) { | javascript | {
"resource": ""
} |
q9104 | clone | train | function clone(obj) {
var key;
var copy = {};
for (key in obj) {
/* istanbul ignore else */
| javascript | {
"resource": ""
} |
q9105 | parse | train | function parse(op, target) {
if (OPERATORS.indexOf(op.op) !== -1) {
op = clone(op);
if (op.from != null) {
op.from = parsePointer(op.from);
}
if (op.path != null) {
op.path = parsePointer(op.path);
} else {
throw new error.InvalidOperationError(op.op, 'Operation object must have ... | javascript | {
"resource": ""
} |
q9106 | setOnSuccess | train | function setOnSuccess (path, transform=getDataFromAction) {
return handleSuccess((state, | javascript | {
"resource": ""
} |
q9107 | setOnFailure | train | function setOnFailure (path, transform=getDataFromAction) {
return handleFailure((state, | javascript | {
"resource": ""
} |
q9108 | Circus | train | function Circus() {
const LOCATIONS = [
'Tree Gnome Stronghold',
'Seers\' Village',
'Catherby',
'Taverley',
'Edgeville',
'Falador',
'Rimmington',
'Draynor Village',
'Al Kharid',
'Lumbridge',
'Lumber Yard',
'Gertrude\'s H... | javascript | {
"resource": ""
} |
q9109 | _parseSentence | train | function _parseSentence(rawSentence) {
if (!rawSentence || typeof rawSentence !== "string") {
throw "rawSentence must be a string.";
}
var components = [];
var start, end, endChar;
for (start = 0, end = 0; end < rawSentence.length; end++) {
endChar = rawSentence.charAt(end);
/**
... | javascript | {
"resource": ""
} |
q9110 | _whichTransitionEndEvent | train | function _whichTransitionEndEvent() {
var t;
var el = document.createElement("fakeelement");
var transitions = {
"WebkitTransition": "webkitTransitionEnd",
"MozTransition": "transitionend",
"MSTransition": "msTransitionEnd",
"OTransition": "otransitionend",
"transition": "trans... | javascript | {
"resource": ""
} |
q9111 | closestPoint1d | train | function closestPoint1d(a, b, x, result) {
var denom = 0.0;
var numer = 0.0;
for(var i=0; i<x.length; ++i) {
var ai = a[i];
var bi = b[i];
var xi = x[i];
var dd = ai - bi;
numer += dd * (xi - bi);
denom += dd * dd;
}
var t = 0.0;
if(Math.abs(denom) > EPSILON) {
t = numer / denom;... | javascript | {
"resource": ""
} |
q9112 | evaluateMacros | train | function evaluateMacros({references, state, babel}) {
references.default.forEach(referencePath => makeLegacyEnsure({
| javascript | {
"resource": ""
} |
q9113 | makeLegacyEnsure | train | function makeLegacyEnsure ({references, state, babel, referencePath}) {
const brokerTemplate = babel.template.smart(`
(typeof Broker !== 'undefined' ? Broker : require('${pkgName}').default)(
PROMISES,
OPTIONS
)
`, {preserveComments: true})
const {promises, options} = parseArguments(
refe... | javascript | {
"resource": ""
} |
q9114 | toObjectExpression | train | function toObjectExpression (obj, {types: t, template}) {
const properties = []
for (let | javascript | {
"resource": ""
} |
q9115 | getShortChunkName | train | function getShortChunkName (source) {
if (source.match(relativePkg) || path.isAbsolute(source)) {
| javascript | {
"resource": ""
} |
q9116 | train | function(options) {
stream.Duplex.call(this, { objectMode: true });
this.options = extend(true, Pipeline.DEFAULTS, options || {});
this.readyState = 0; // 0: closed, 1: open
this._pipeline = [];
this.setMaxListeners(0); // | javascript | {
"resource": ""
} | |
q9117 | getQueryDelay | train | function getQueryDelay(url) {
var delay;
if (options.delayQueryParam) {
var parsedUrl = parseUrl(url, true);
if (parsedUrl.query && parsedUrl.query[options.delayQueryParam]) {
| javascript | {
"resource": ""
} |
q9118 | getUrlDelay | train | function getUrlDelay(url) {
var delay;
if (options.url | javascript | {
"resource": ""
} |
q9119 | todo_name_me | train | function todo_name_me() {
var args = process_signature(arguments)
var opts = merge({}, base_defaults, | javascript | {
"resource": ""
} |
q9120 | escapeCarriageReturn | train | function escapeCarriageReturn(txt) {
if (!txt) return "";
if (!/\r/.test(txt)) return txt;
txt = txt.replace(/\r+\n/gm, "\n"); // \r followed by \n --> newline
while (/\r[^$]/.test(txt)) {
var base = /^(.*)\r+/m.exec(txt)[1];
var insert = /\r+(.*)$/m.exec(txt)[1]; | javascript | {
"resource": ""
} |
q9121 | escapeCarriageReturnSafe | train | function escapeCarriageReturnSafe(txt) {
if (!txt) return "";
if (!/\r/.test(txt)) return txt;
if (!/\n/.test(txt)) return escapeSingleLineSafe(txt);
txt = txt.replace(/\r+\n/gm, "\n"); // \r followed by \n --> newline
var idx = | javascript | {
"resource": ""
} |
q9122 | parseAction | train | function parseAction ({ action, payload={}, error=false }) {
switch (typeof action) {
// If it's an action creator, create the action
case 'function': return action(payload)
// If it's an action object | javascript | {
"resource": ""
} |
q9123 | Pantry | train | function Pantry(config) {
this.name = config.name;
this.path = config.path; | javascript | {
"resource": ""
} |
q9124 | parsePointer | train | function parsePointer (pointer) {
if (pointer === '') {
return []
}
if (pointer.charAt(0) !== '/') {
throw new | javascript | {
"resource": ""
} |
q9125 | validatePath | train | function validatePath (path, target) {
var i = 0
var len = path.length
var ref = target
for (; i < len; i++) {
if (Iterable.isIterable(ref)) {
ref = ref.getIn(path.slice(0, i))
if | javascript | {
"resource": ""
} |
q9126 | gulpHtmlLint | train | function gulpHtmlLint(options) {
let htmlLintOptions = {},
issueFileCount = 0,
issueCount = 0;
options = options || {};
options.htmllintrc = options.htmllintrc || '.htmllintrc';
options.useHtmllintrc = options.useHtmllintrc !== false;
options.plugins = options.plugins || [];
options.limitFiles = options.limi... | javascript | {
"resource": ""
} |
q9127 | tryResultAction | train | function tryResultAction(action, result, callback) {
if (action.length > 1) return action.call(this, result, | javascript | {
"resource": ""
} |
q9128 | wrapError | train | function wrapError(err) {
if (err && !(err instanceof gutil.PluginError)) {
err = new PluginError(err.plugin || PLUGIN_NAME, err, {
| javascript | {
"resource": ""
} |
q9129 | resolveFormatter | train | function resolveFormatter(formatter) {
if (!formatter) return resolveFormatter('stylish');
if (typeof formatter === 'function') return formatter;
if (typeof formatter === 'string') {
if (isModuleAvailable(formatter)) return require(formatter);
| javascript | {
"resource": ""
} |
q9130 | train | function (obj) {
var keys = []
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
| javascript | {
"resource": ""
} | |
q9131 | lessThan | train | function lessThan(validatedObject, threshold, errorText) {
number(validatedObject);
number(threshold, 'Threshold is not a number');
if (validatedObject >= threshold) {
throw new ValidationError(
| javascript | {
"resource": ""
} |
q9132 | greaterThan | train | function greaterThan(validatedObject, threshold, errorText) {
number(validatedObject);
number(threshold, 'Threshold is not a number');
if (validatedObject <= threshold) {
throw new ValidationError(
errorText | javascript | {
"resource": ""
} |
q9133 | booleanTrue | train | function booleanTrue(validatedObject, errorText) {
if (!_.isBoolean(validatedObject) || !validatedObject) {
throw new | javascript | {
"resource": ""
} |
q9134 | booleanFalse | train | function booleanFalse(validatedObject, errorText) {
if (!_.isBoolean(validatedObject) || validatedObject) {
throw new | javascript | {
"resource": ""
} |
q9135 | withProperties | train | function withProperties(validatedObject, validatedProperties) {
notNil(validatedObject);
const undefinedProperties = _.filter(validatedProperties, function(property) {
return !validatedObject.hasOwnProperty(property);
});
if (!_.isEmpty(undefinedProperties)) {
| javascript | {
"resource": ""
} |
q9136 | instanceOf | train | function instanceOf(validatedObject, expectedClass, errorText) {
if (!(validatedObject instanceof expectedClass)) {
throw new ValidationError(
errorText || `Validated object | javascript | {
"resource": ""
} |
q9137 | inheritsFrom | train | function inheritsFrom(validatedClass, expectedParentClass, errorText) {
if (
//fail-fast if it is nil
!validatedClass ||
//lenient check whether class directly or indirectly inherits from expected class
(!(validatedClass.prototype instanceof expectedParentClass) &&
validatedClass | javascript | {
"resource": ""
} |
q9138 | train | function (execPlan, error, stderr, errorHandler) {
var shouldContinue = execPlan.continuesOnError(); // default to using configured policy
var errorHandlerDefined = utils.isFunction(errorHandler);
var errorHandlerReturn;
var shouldOverridePolicy; // whether the given error handler is overriding the... | javascript | {
"resource": ""
} | |
q9139 | train | function (execPlan, first, preLogic, command, options, errorHandler, nextStep) {
return function (error, stdout, stderr) {
var shouldContinue; // whether the plan should continue executing beyond this step
// log stdout/err
if (!first) { // a previous step's stdout/err is available
... | javascript | {
"resource": ""
} | |
q9140 | Ingredient | train | function Ingredient(config) {
this.name = config.name;
this.path = config.path;
this.pantryName = | javascript | {
"resource": ""
} |
q9141 | train | function( buffer, offset ) {
offset = offset || 0
this.signature = buffer.readUInt32BE( offset + 0 )
if( this.signature !== Footer.signature ) {
var expected = Footer.signature.toString(16)
var actual = this.signature.toString(16)
throw new Error( `Invalid footer signature: Expected 0x$... | javascript | {
"resource": ""
} | |
q9142 | handleSuccess | train | function handleSuccess (handler) {
return (state, action) => isSuccessAction(action) ? handler(state, | javascript | {
"resource": ""
} |
q9143 | injectFields | train | function injectFields(string, values) {
const fieldsModel = parseFields(string);
const fieldsAmount = fieldsModel.fields.length;
if (fieldsAmount) {
values = values.slice();
if (values.length > fieldsAmount) {
// More values that output fields: collapse rest values into
// a single token
values = value... | javascript | {
"resource": ""
} |
q9144 | closestPoint0d | train | function closestPoint0d(a, x, result) {
var d = 0.0;
for(var i=0; i<x.length; | javascript | {
"resource": ""
} |
q9145 | patch | train | function patch(object, ops) {
ops = Array.isArray(ops) ? ops : [ops];
object = ops.reduce(function (ob, op) {
op = (0, _parse2['default'])(op, ob);
return operators[op.op].call(ob, op);
}, object);
// Re-convert the returned object | javascript | {
"resource": ""
} |
q9146 | invert | train | function invert () {
if (Immutable.Iterable.isIterable(toValues)) {
toValues = toValues.map(mapInvertValues);
} else {
| javascript | {
"resource": ""
} |
q9147 | start | train | function start () {
var now = performance.now();
if (typeof pausedAfter !== 'undefined') {
startTime = now + pausedAfter;
} else {
startTime = now + delayMillis;
}
| javascript | {
"resource": ""
} |
q9148 | stop | train | function stop () {
currentValues = fromValues;
triggerEvent('stop');
stopLoop(animationId);
pausedAfter | javascript | {
"resource": ""
} |
q9149 | pause | train | function pause () {
triggerEvent('pause');
stopLoop(animationId);
pausedAfter | javascript | {
"resource": ""
} |
q9150 | first | train | function first (callback) {
if (typeof callback !== 'function') {
throw new Error('Callback must be a function, instead got: ' + (typeof callback));
}
function firstCallback (result) {
callback(result);
| javascript | {
"resource": ""
} |
q9151 | then | train | function then (callback) {
if (typeof callback !== 'function') {
throw new Error('Callback must be a function, instead got: ' + (typeof callback));
}
function thenCallback (result) {
callback(result);
| javascript | {
"resource": ""
} |
q9152 | train | function(routePrefix)
{
if(routePrefix==='/')routePrefix='';
this.appUrl = routePrefix;
var pattern = /^(.*?)\s(.*?)$/
for(var routePath | javascript | {
"resource": ""
} | |
q9153 | News | train | function News(config) {
this.getRecent = function() {
return new Promise(function(resolve, reject) {
request.rss(config.urls.rss).then(function(data) {
| javascript | {
"resource": ""
} |
q9154 | train | function(line) {
var dataArray = [];
var tempString="";
var lineLength = line.length;
var index=0;
while(index<lineLength) {
if(line[index]=='"') {
var index2 = index+1;
while(line[index2]!='"') {
tempString+=line[index2];
index2++;
}
dataArray.push(tempString);
tempString = "... | javascript | {
"resource": ""
} | |
q9155 | train | function() {
var x, els;
// setup [contentEditable=true]
els = document.querySelectorAll(
'p[hashedit-element], [hashedit] h1[hashedit-element], [hashedit] h2[hashedit-element], h3[hashedit-element], h4[hashedit-element], h5[hashedit-element], span[hashedit-element], ul[hashedit-element] li,... | javascript | {
"resource": ""
} | |
q9156 | train | function() {
var x, sortable, els;
els = document.querySelectorAll('[hashedit-sortable]');
// walk through sortable clases
for (x = 0; x < els.length; x += 1) {
if(els[x].firstElementChild | javascript | {
"resource": ""
} | |
q9157 | train | function() {
var x, els, y, div, blocks, el, next, previous, span;
blocks = hashedit.config.blocks;
// setup sortable classes
els = document.querySelectorAll('[hashedit] ' + blocks);
// set [data-hashedit-sortable=true]
for (y = 0; y < els.length; y += 1) {
// setup blo... | javascript | {
"resource": ""
} | |
q9158 | train | function(el) {
var menu, span;
// set element
el.setAttribute('hashedit-element', '');
// create element menu
menu = document.createElement('span');
menu.setAttribute('class', 'hashedit-element-menu');
menu.setAttribute('contentEditable', 'false');
menu.innerHTML = '<l... | javascript | {
"resource": ""
} | |
q9159 | train | function() {
var x, y, els, div, span, el, item, obj, menu, sortable, a;
sortable = hashedit.config.sortable;
// walk through sortable clases
for (x = 0; x < sortable.length; x += 1) {
// setup sortable classes
els = document.querySelectorAll('[hashedit] ' + sortable[x]);
... | javascript | {
"resource": ""
} | |
q9160 | train | function() {
var menu, data, xhr, url, help, els, x, title = '', arr;
// create menu
menu = document.createElement('menu');
menu.setAttribute('class', 'hashedit-menu');
menu.innerHTML =
'<div class="hashedit-menu-body"></div>';
// append menu
hashedit.current.contain... | javascript | {
"resource": ""
} | |
q9161 | train | function() {
var menu = document.querySelector('.hashedit-menu');
if(menu.hasAttribute('active') == true) {
menu.removeAttribute('active');
| javascript | {
"resource": ""
} | |
q9162 | train | function() {
var data, xhr;
data = hashedit.retrieveUpdateArray();
if (hashedit.saveUrl) {
// construct an HTTP request
xhr = new XMLHttpRequest();
xhr.open('post', hashedit.saveUrl, true);
// set token
if(hashedit.useToken == true) {
xhr.setReque... | javascript | {
"resource": ""
} | |
q9163 | train | function() {
var x, el, selector, sortable, item, action, html;
// setup sortable on the menu
el = document.querySelector('.hashedit-menu-body');
sortable = new Sortable(el, {
group: {
name: 'hashedit-sortable',
pull: 'clone',
put: false
},
... | javascript | {
"resource": ""
} | |
q9164 | train | function(element) {
var x, link, image, text, fields;
// set current element and node
hashedit.current.element = element;
hashedit.current.node = element;
// if the current element is not a [hashedit-element], find the parent that matches
if(hashedit.current.element.hasAttribute('... | javascript | {
"resource": ""
} | |
q9165 | train | function() {
var attrs, x, y, z, key, value, html, inputs, textarea;
console.log(hashedit.current.node);
if (hashedit.current.node !== null) {
// get attributes
attrs = hashedit.current.node.attributes;
for (x = 0; x < attrs.length; x += 1) {
// get key and valu... | javascript | {
"resource": ""
} | |
q9166 | train | function(el) {
var text = '';
for (var i = 0; i < el.childNodes.length; i++) {
var curNode = el.childNodes[i];
var whitespace = /^\s*$/;
if(curNode === undefined) {
text = "";
break;
| javascript | {
"resource": ""
} | |
q9167 | train | function(html) {
var x, newNode, node, firstChild;
// create a new node
newNode = document.createElement('div');
newNode.innerHTML = html;
// get new new node
newNode = newNode.childNodes[0];
newNode.setAttribute('hashedit-element', '');
hashedit.setupElementMenu(newN... | javascript | {
"resource": ""
} | |
q9168 | train | function(current, position) {
var x, newNode, node, firstChild;
// create a new node
newNode = current.cloneNode(true);
// create new node in | javascript | {
"resource": ""
} | |
q9169 | train | function(html, current, position) {
var x, newNode, node, firstChild;
// create a new node
newNode = document.createElement('div');
newNode.innerHTML = html;
// get new new node
newNode = newNode.childNodes[0];
// create new node in mirror
if (position == 'before') {
| javascript | {
"resource": ""
} | |
q9170 | train | function() {
var id, cssClass, href, target, title, link;
// get selected link
hashedit.currLink = hashedit.getLinkFromSelection();
// populate link values
if (hashedit.currLink !== null) {
// get attributes
id = hashedit.currLink.getAttribute('id') || '';
cssC... | javascript | {
"resource": ""
} | |
q9171 | train | function(block) {
var x, dialog, list, html, el, target, i, items;
if(block !== null) {
block.setAttribute('hashedit-block-active', '');
}
// show the layout dialog
dialog = document.querySelector('#hashedit-layout-modal');
// get list
list = document.querySelector(... | javascript | {
"resource": ""
} | |
q9172 | train | function() {
var id, cssClass, src, target, link, alt, title;
// populate link values
if (hashedit.current.node !== null) {
// get attributes
id = hashedit.current.node.getAttribute('id') || '';
cssClass = hashedit.current.node.getAttribute('class') || '';
src = has... | javascript | {
"resource": ""
} | |
q9173 | train | function() {
var ranges, i, sel, len;
if (window.getSelection) {
sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
ranges = [];
len = sel.rangeCount;
| javascript | {
"resource": ""
} | |
q9174 | train | function() {
var parent, selection, range, div, links;
parent = null;
if (document.selection) {
parent = document.selection.createRange().parentElement();
} else {
selection = window.getSelection();
if (selection.rangeCount > 0) {
parent = selection.getRangeA... | javascript | {
"resource": ""
} | |
q9175 | train | function(node) {
var style, textColor, textSize, textShadowColor, textShadowHorizontal, textShadowVertical, textShadowBlur;
// get current node
style = '';
// build a style attribute for (text-color, text-size, text-shadow-color, text-shadow-vertical, text-shadow-horizontal, text-shadow-blur)... | javascript | {
"resource": ""
} | |
q9176 | train | function() {
var toast;
toast = document.createElement('div');
toast.setAttribute('class', 'hashedit-toast');
toast.innerHTML = 'Sample Toast';
// append toast
| javascript | {
"resource": ""
} | |
q9177 | train | function(src, stringToFind, stringToReplace) {
var temp, index;
temp = src;
index = temp.indexOf(stringToFind);
while (index != -1) {
| javascript | {
"resource": ""
} | |
q9178 | train | function(language){
var els, x, id, html;
// select elements
els = document.querySelectorAll('[data-i18n]');
// walk through elements
for(x=0; x<els.length; x++){
id = els[x].getAttribute('data-i18n');
// set id to text if empty
if(id == ''){
| javascript | {
"resource": ""
} | |
q9179 | train | function(text){
var options, language, path;
language = hashedit.language;
// translatable
if(hashedit.canTranslate === true) {
// make sure library is installed
if(i18n !== undefined) {
if(hashedit.isI18nInit === false) {
// get language path
pa... | javascript | {
"resource": ""
} | |
q9180 | initAndCachePantry | train | function initAndCachePantry(pantryCache, config) {
return initialize(config)
.then(function (initializedPantry) {
// cache the pantry for next | javascript | {
"resource": ""
} |
q9181 | normalizeConfig | train | function normalizeConfig(config, defaults) {
if (_.isUndefined(config)) {
config = {};
}
if (!_.isObject(config)) {
throw new TypeError('`config` must be an object');
}
if (_.isUndefined(defaults)) {
defaults = {};
}
if (!_.isObject(defaults)) {
throw new TypeError('`defaults` must be an object');
}
... | javascript | {
"resource": ""
} |
q9182 | onInit | train | function onInit(unused, callback) {
var filePath = path.resolve(options.file);
stats.deserialise.fs.start = Date.now();
if (fs.existsSync(filePath)) {
fs.readFile(filePath, complete);
} else {
complete(true);
}
function complete(error, contents) {
stats.deserialise.fs.stop = ... | javascript | {
"resource": ""
} |
q9183 | afterEmit | train | function afterEmit(compilation, callback) {
var failures;
if (options.persist) {
var cache = compilation.cache,
filePath = path.resolve(options.file);
stats.serialise.encode.start = Date.now();
var encoded = encode(cache);
failures = (encoded.$failed || [])
.filter(... | javascript | {
"resource": ""
} |
q9184 | train | function( buffer, offset ) {
offset = offset || 0
this.signature = buffer.readUInt32BE( offset + 0 )
if( this.signature !== BlockMap.signature ) {
var expected = BlockMap.signature.toString(16)
var actual = this.signature.toString(16)
throw new Error( `Invalid block map signature: Expec... | javascript | {
"resource": ""
} | |
q9185 | encode | train | function encode(object, path, exclusions) {
var failed = [],
result = {};
// ensure valid path and exclusions
path = path || [];
exclusions = exclusions || [];
// enumerable properties
for (var key in object) {
var value = object[key];
// objects
if (value && (typeof value === 'object... | javascript | {
"resource": ""
} |
q9186 | train | function(routePrefix, modelController, permission){
var routes = {};
/** if the given controller is not an instance of openbiz ModelController we will not generate it */
if(modelController instanceof openbiz.ModelController){
routes["post "+routePrefix] = [modelController.creat... | javascript | {
"resource": ""
} | |
q9187 | parseLinks | train | function parseLinks(target, resp) {
target._links = parseLinkHeader(resp.headers.get('link'));
target._linkTemplates = | javascript | {
"resource": ""
} |
q9188 | throwStatusError | train | function throwStatusError(resp) {
let err = new Error(resp.statusText || 'http error: ' + resp.status);
err.type = resp.status; | javascript | {
"resource": ""
} |
q9189 | throwTimeoutError | train | function throwTimeoutError(resp) {
let err = new Error('timeout'); | javascript | {
"resource": ""
} |
q9190 | setOnResponse | train | function setOnResponse (
successPath,
failurePath,
transformSuccess=getDataFromAction,
transformFailure=getDataFromAction,
) | javascript | {
"resource": ""
} |
q9191 | train | function(rootPath, filePath, encoding) {
return | javascript | {
"resource": ""
} | |
q9192 | resolve | train | function resolve(options) {
options = extend({
root: '.',
fileProvider: defaultFileProvider
}, options);
var context = {
options: options,
parser: new Parser({
excludeClasses: options.excludeClasses,
skipParse: options.skipParse,
extraDepe... | javascript | {
"resource": ""
} |
q9193 | Clan | train | function Clan(config) {
//Read the clans data from a csv to an array object
var readClan = function(data) {
var members = [],
space = new RegExp(String.fromCharCode(65533), 'g');
for (var i = 1; i < data.length; i++) {
var member = data[i];
members.push({
... | javascript | {
"resource": ""
} |
q9194 | train | function(data) {
var members = [],
space = new RegExp(String.fromCharCode(65533), 'g');
for (var i = 1; i < data.length; i++) {
var member = data[i];
members.push({
player: member[0].replace(space, ' '),
| javascript | {
"resource": ""
} | |
q9195 | _serveFile | train | function _serveFile(requestedFile, done) {
let compiled
, temp = []
, wasCompiled;
log.debug(`Fetching ${transformPath(requestedFile.path)} from buffer`);
if (requestedFile.sha) {
delete requestedFile.sha; //simple hack i used to prevent infinite loop
... | javascript | {
"resource": ""
} |
q9196 | train | function (source, destination) {
return cont.mapAsync(readFileAsJSON(source), function (json, cb) {
json.copied = Date.now()
| javascript | {
"resource": ""
} | |
q9197 | _getStatsAndParts | train | function _getStatsAndParts (tp, cb){
fs.stat(tp.absPath, function(err, stats){
if (err) return cb(err);
if (stats.isDirectory) {
glob(path.join(tp.absPath, '**/*'), function(err, dirAbsPaths){
if (err) return cb(err);
async.map(dirAbsPaths, fs.stat, function(err, ... | javascript | {
"resource": ""
} |
q9198 | _check | train | function _check(mnode, cb){
if (mnode.node.filePath) {
fs.stat(path.resolve(root, mnode.node.filePath), function(err, stats){
if (err) return cb(err);
mnode.node.dateModified = stats.mtime.toISOString();
if (psize) { mnode.node[psize] = stats.size; }
cb(null);
});
} e... | javascript | {
"resource": ""
} |
q9199 | train | function (eventName) {
if (RUNTIME_CHECKS && typeof eventName !== 'string') {
throw '"eventName" argument must be a string';
}
if (!this.__private || !this.__private.listeners) { return; }
var listenersForEvent = this.__private.listeners[eventName]; | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.