_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q18300 | setColumnDefaults | train | function setColumnDefaults(columns) {
if (!columns)
return;
// Only one column should hold the tree view
// Thus if multiple columns are provided with
// isTreeColumn as true we take only the first one
var treeColumnFound = false;
for (var _i = 0, columns_1 = columns; _i < columns_1.leng... | javascript | {
"resource": ""
} |
q18301 | translateTemplates | train | function translateTemplates(templates) {
var result = [];
for (var _i = 0, templates_1 = templates; _i < templates_1.length; _i++) {
var temp = templates_1[_i];
var col = {};
var props = Object.getOwnPropertyNames(temp);
for (var _a = 0, props_1 = props; _a < props_1.length; _a++... | javascript | {
"resource": ""
} |
q18302 | getterForProp | train | function getterForProp(prop) {
if (prop == null)
return emptyStringGetter;
if (typeof prop === 'number') {
return numericIndexGetter;
}
else {
// deep or simple
if (prop.indexOf('.') !== -1) {
return deepValueGetter;
}
else {
return... | javascript | {
"resource": ""
} |
q18303 | numericIndexGetter | train | function numericIndexGetter(row, index) {
if (row == null)
return '';
// mimic behavior of deepValueGetter
if (!row || index == null)
return row;
var value = row[index];
if (value == null)
return '';
return value;
} | javascript | {
"resource": ""
} |
q18304 | ChainableTemporaryCredentials | train | function ChainableTemporaryCredentials(options) {
AWS.Credentials.call(this);
options = options || {};
this.errorCode = 'ChainableTemporaryCredentialsProviderFailure';
this.expired = true;
this.tokenCodeFn = null;
var params = AWS.util.copy(options.params) || {};
if (params.RoleArn) {
... | javascript | {
"resource": ""
} |
q18305 | eventually | train | function eventually(callback, block, options) {
if (!options) options = {};
if (!options.delay) options.delay = 0;
if (!options.backoff) options.backoff = 500;
if (!options.maxTime) options.maxTime = 5;
var delay = options.delay;
var started = this.AWS.util.date.getDate();
var self = this... | javascript | {
"resource": ""
} |
q18306 | request | train | function request(svc, operation, params, next, extra) {
var world = this;
if (!svc) svc = this.service;
if (typeof svc === 'string') svc = this[svc];
svc[operation](params, function(err, data) {
world.response = this;
world.error = err;
world.data = data;
try {
if (typ... | javascript | {
"resource": ""
} |
q18307 | unexpectedError | train | function unexpectedError(resp, next) {
var svc = resp.request.service.api.serviceName;
var op = resp.request.operation;
var code = resp.error.code;
var msg = resp.error.message;
var err = 'Received unexpected error from ' + svc + '.' + op + ', ' + code + ': ' + msg;
next.fail(new Error(err));
... | javascript | {
"resource": ""
} |
q18308 | train | function(bucket) {
var fs = require('fs');
var path = require('path');
var filePath = path.resolve('integ.buckets.json');
var cache;
if (fs.existsSync(filePath)) {
try {
cache = JSON.parse(fs.readFileSync(filePath));
cache.buckets.push(bucket);
fs.writeFileSync(filePath... | javascript | {
"resource": ""
} | |
q18309 | train | function(size, name) {
var fs = require('fs');
var path = require('path');
name = this.uniqueName(name);
// Cannot set this as a world property because the world
// is cleaned up before the AfterFeatures hook is fired.
var fixturePath = path.resolve('./features/extra/fixtures/tmp');
if (!fs.... | javascript | {
"resource": ""
} | |
q18310 | train | function(size) {
var match;
var buffer;
if (match = size.match(/(\d+)KB/)) {
buffer = new Buffer(parseInt(match[1]) * 1024);
} else if (match = size.match(/(\d+)MB/)) {
buffer = new Buffer(parseInt(match[1]) * 1024 * 1024);
} else {
switch (size) {
case 'empty': buffer = ne... | javascript | {
"resource": ""
} | |
q18311 | eventMessageChunker | train | function eventMessageChunker(buffer) {
/** @type Buffer[] */
var messages = [];
var offset = 0;
while (offset < buffer.length) {
var totalLength = buffer.readInt32BE(offset);
// create new buffer for individual message (shares memory with original)
var message = buffer.slice(of... | javascript | {
"resource": ""
} |
q18312 | SharedIniFileCredentials | train | function SharedIniFileCredentials(options) {
AWS.Credentials.call(this);
options = options || {};
this.filename = options.filename;
this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;
this.disableAssumeRole = Boolean(options.disableAssumeRole);
this.preferStat... | javascript | {
"resource": ""
} |
q18313 | escapeAttribute | train | function escapeAttribute(value) {
return value.replace(/&/g, '&').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
} | javascript | {
"resource": ""
} |
q18314 | clearCache | train | function clearCache() {
this._identityId = null;
delete this.params.IdentityId;
var poolId = this.params.IdentityPoolId;
var loginId = this.params.LoginId || '';
delete this.storage[this.localStorageKey.id + poolId + loginId];
delete this.storage[this.localStorageKey.providers + poolId + loginI... | javascript | {
"resource": ""
} |
q18315 | loadWaiterConfig | train | function loadWaiterConfig(state) {
if (!this.service.api.waiters[state]) {
throw new AWS.util.error(new Error(), {
code: 'StateNotFoundError',
message: 'State ' + state + ' not found.'
});
}
this.config = AWS.util.copy(this.service.api.waiters[state]);
} | javascript | {
"resource": ""
} |
q18316 | XmlNode | train | function XmlNode(name, children) {
if (children === void 0) { children = []; }
this.name = name;
this.children = children;
this.attributes = {};
} | javascript | {
"resource": ""
} |
q18317 | eachPage | train | function eachPage(callback) {
// Make all callbacks async-ish
callback = AWS.util.fn.makeAsync(callback, 3);
function wrappedCallback(response) {
callback.call(response, response.error, response.data, function (result) {
if (result === false) return;
if (response.hasNextPage()) {
... | javascript | {
"resource": ""
} |
q18318 | eachItem | train | function eachItem(callback) {
var self = this;
function wrappedCallback(err, data) {
if (err) return callback(err, null);
if (data === null) return callback(null, null);
var config = self.service.paginationConfig(self.operation);
var resultKey = config.resultKey;
if (Array.isArray... | javascript | {
"resource": ""
} |
q18319 | Publisher | train | function Publisher(options) {
// handle configuration
options = options || {};
this.enabled = options.enabled || false;
this.port = options.port || 31000;
this.clientId = options.clientId || '';
if (this.clientId.length > 255) {
// ClientId has a max length of 255
this.clientId =... | javascript | {
"resource": ""
} |
q18320 | removeVirtualHostedBucketFromPath | train | function removeVirtualHostedBucketFromPath(req) {
var httpRequest = req.httpRequest;
var bucket = httpRequest.virtualHostedBucket;
if (bucket && httpRequest.path) {
if (req.params && req.params.Key) {
var encodedS3Key = '/' + AWS.util.uriEscapePath(req.params.Key);
if (httpRequest.path... | javascript | {
"resource": ""
} |
q18321 | addContentType | train | function addContentType(req) {
var httpRequest = req.httpRequest;
if (httpRequest.method === 'GET' || httpRequest.method === 'HEAD') {
// Content-Type is not set in GET/HEAD requests
delete httpRequest.headers['Content-Type'];
return;
}
if (!httpRequest.headers['Content-Type']) { // a... | javascript | {
"resource": ""
} |
q18322 | computeContentMd5 | train | function computeContentMd5(req) {
if (req.service.willComputeChecksums(req)) {
var md5 = AWS.util.crypto.md5(req.httpRequest.body, 'base64');
req.httpRequest.headers['Content-MD5'] = md5;
}
} | javascript | {
"resource": ""
} |
q18323 | dnsCompatibleBucketName | train | function dnsCompatibleBucketName(bucketName) {
var b = bucketName;
var domain = new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/);
var ipAddress = new RegExp(/(\d+\.){3}\d+/);
var dots = new RegExp(/\.\./);
return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false;
} | javascript | {
"resource": ""
} |
q18324 | updateReqBucketRegion | train | function updateReqBucketRegion(request, region) {
var httpRequest = request.httpRequest;
if (typeof region === 'string' && region.length) {
httpRequest.region = region;
}
if (!httpRequest.endpoint.host.match(/s3(?!-accelerate).*\.amazonaws\.com$/)) {
return;
}
var service = request.s... | javascript | {
"resource": ""
} |
q18325 | extractError | train | function extractError(resp) {
var codes = {
304: 'NotModified',
403: 'Forbidden',
400: 'BadRequest',
404: 'NotFound'
};
var req = resp.request;
var code = resp.httpResponse.statusCode;
var body = resp.httpResponse.body || '';
var headers = resp.httpResponse.headers || {... | javascript | {
"resource": ""
} |
q18326 | requestBucketRegion | train | function requestBucketRegion(resp, done) {
var error = resp.error;
var req = resp.request;
var bucket = req.params.Bucket || null;
if (!error || !bucket || error.region || req.operation === 'listObjects' ||
(AWS.util.isNode() && req.operation === 'headBucket') ||
(error.statusCode === 4... | javascript | {
"resource": ""
} |
q18327 | reqRegionForNetworkingError | train | function reqRegionForNetworkingError(resp, done) {
if (!AWS.util.isBrowser()) {
return done();
}
var error = resp.error;
var request = resp.request;
var bucket = request.params.Bucket;
if (!error || error.code !== 'NetworkingError' || !bucket ||
request.httpRequest.region === 'us-e... | javascript | {
"resource": ""
} |
q18328 | train | function(buckets) {
var bucketRegionCache = this.bucketRegionCache;
if (!buckets) {
buckets = Object.keys(bucketRegionCache);
} else if (typeof buckets === 'string') {
buckets = [buckets];
}
for (var i = 0; i < buckets.length; i++) {
delete bucketRegionCache[buckets[i]];
}
... | javascript | {
"resource": ""
} | |
q18329 | correctBucketRegionFromCache | train | function correctBucketRegionFromCache(req) {
var bucket = req.params.Bucket || null;
if (bucket) {
var service = req.service;
var requestRegion = req.httpRequest.region;
var cachedRegion = service.bucketRegionCache[bucket];
if (cachedRegion && cachedRegion !== requestRegion) {
se... | javascript | {
"resource": ""
} |
q18330 | extractRequestIds | train | function extractRequestIds(resp) {
var extendedRequestId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-id-2'] : null;
var cfId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-cf-id'] : null;
resp.extendedRequestId = extendedRequestId;
resp.cfId = cfId;
if (resp.error... | javascript | {
"resource": ""
} |
q18331 | getSignedUrl | train | function getSignedUrl(operation, params, callback) {
params = AWS.util.copy(params || {});
var expires = params.Expires || 900;
delete params.Expires; // we can't validate this
var request = this.makeRequest(operation, params);
if (callback) {
AWS.util.defer(function() {
request.presi... | javascript | {
"resource": ""
} |
q18332 | createPresignedPost | train | function createPresignedPost(params, callback) {
if (typeof params === 'function' && callback === undefined) {
callback = params;
params = null;
}
params = AWS.util.copy(params || {});
var boundParams = this.config.params || {};
var bucket = params.Bucket || boundParams.Bucket,
se... | javascript | {
"resource": ""
} |
q18333 | convertInput | train | function convertInput(data, options) {
options = options || {};
var type = typeOf(data);
if (type === 'Object') {
return formatMap(data, options);
} else if (type === 'Array') {
return formatList(data, options);
} else if (type === 'Set') {
return formatSet(data, options);
} el... | javascript | {
"resource": ""
} |
q18334 | marshallItem | train | function marshallItem(data, options) {
return AWS.DynamoDB.Converter.input(data, options).M;
} | javascript | {
"resource": ""
} |
q18335 | convertOutput | train | function convertOutput(data, options) {
options = options || {};
var list, map, i;
for (var type in data) {
var values = data[type];
if (type === 'M') {
map = {};
for (var key in values) {
map[key] = convertOutput(values[key], options);
}
return map;
... | javascript | {
"resource": ""
} |
q18336 | unmarshall | train | function unmarshall(data, options) {
return AWS.DynamoDB.Converter.output({M: data}, options);
} | javascript | {
"resource": ""
} |
q18337 | populateHostPrefix | train | function populateHostPrefix(request) {
var enabled = request.service.config.hostPrefixEnabled;
if (!enabled) return request;
var operationModel = request.service.api.operations[request.operation];
//don't marshal host prefix when operation has endpoint discovery traits
if (hasEndpointDiscover(request)) retur... | javascript | {
"resource": ""
} |
q18338 | loadFromPath | train | function loadFromPath(path) {
this.clear();
var options = JSON.parse(AWS.util.readFileSync(path));
var fileSystemCreds = new AWS.FileSystemCredentials(path);
var chain = new AWS.CredentialProviderChain();
chain.providers.unshift(fileSystemCreds);
chain.resolve(function (err, creds) {
if (... | javascript | {
"resource": ""
} |
q18339 | extractCredentials | train | function extractCredentials(options) {
if (options.accessKeyId && options.secretAccessKey) {
options = AWS.util.copy(options);
options.credentials = new AWS.Credentials(options);
}
return options;
} | javascript | {
"resource": ""
} |
q18340 | setPromisesDependency | train | function setPromisesDependency(dep) {
PromisesDependency = dep;
// if null was passed in, we should try to use native promises
if (dep === null && typeof Promise === 'function') {
PromisesDependency = Promise;
}
var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain];
... | javascript | {
"resource": ""
} |
q18341 | train | function() {
$('div[id] > :header:first').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this headline')).
appendTo(this);
});
$('dt[id]').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('h... | javascript | {
"resource": ""
} | |
q18342 | train | function() {
if (document.location.hash && $.browser.mozilla)
window.setTimeout(function() {
document.location.href += '';
}, 10);
} | javascript | {
"resource": ""
} | |
q18343 | train | function() {
var togglers = $('img.toggler').click(function() {
var src = $(this).attr('src');
var idnum = $(this).attr('id').substr(7);
$('tr.cg-' + idnum).toggle();
if (src.substr(-9) == 'minus.png')
$(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
else
... | javascript | {
"resource": ""
} | |
q18344 | train | function() {
var path = document.location.pathname;
var parts = path.split(/\//);
$.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
if (this == '..')
parts.pop();
});
var url = parts.join('/');
return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
} | javascript | {
"resource": ""
} | |
q18345 | Service | train | function Service(config) {
if (!this.loadServiceClass) {
throw AWS.util.error(new Error(),
'Service must be constructed with `new\' operator');
}
var ServiceClass = this.loadServiceClass(config || {});
if (ServiceClass) {
var originalConfig = AWS.util.copy(config);
var svc = ne... | javascript | {
"resource": ""
} |
q18346 | makeRequest | train | function makeRequest(operation, params, callback) {
if (typeof params === 'function') {
callback = params;
params = null;
}
params = params || {};
if (this.config.params) { // copy only toplevel bound params
var rules = this.api.operations[operation];
if (rules) {
params... | javascript | {
"resource": ""
} |
q18347 | makeUnauthenticatedRequest | train | function makeUnauthenticatedRequest(operation, params, callback) {
if (typeof params === 'function') {
callback = params;
params = {};
}
var request = this.makeRequest(operation, params).toUnauthenticated();
return callback ? request.send(callback) : request;
} | javascript | {
"resource": ""
} |
q18348 | waitFor | train | function waitFor(state, params, callback) {
var waiter = new AWS.ResourceWaiter(this, state);
return waiter.wait(params, callback);
} | javascript | {
"resource": ""
} |
q18349 | apiCallEvent | train | function apiCallEvent(request) {
var api = request.service.api.operations[request.operation];
var monitoringEvent = {
Type: 'ApiCall',
Api: api ? api.name : request.operation,
Version: 1,
Service: request.service.api.serviceId || request.service.api.endpointPrefix,
Region: request.... | javascript | {
"resource": ""
} |
q18350 | apiAttemptEvent | train | function apiAttemptEvent(request) {
var api = request.service.api.operations[request.operation];
var monitoringEvent = {
Type: 'ApiCallAttempt',
Api: api ? api.name : request.operation,
Version: 1,
Service: request.service.api.serviceId || request.service.api.endpointPrefix,
Fqdn: ... | javascript | {
"resource": ""
} |
q18351 | attemptFailEvent | train | function attemptFailEvent(request) {
var monitoringEvent = this.apiAttemptEvent(request);
var response = request.response;
var error = response.error;
if (response.httpResponse.statusCode > 299 ) {
if (error.code) monitoringEvent.AwsException = error.code;
if (error.message) monitoringEvent.... | javascript | {
"resource": ""
} |
q18352 | attachMonitoringEmitter | train | function attachMonitoringEmitter(request) {
var attemptTimestamp; //timestamp marking the beginning of a request attempt
var attemptStartRealTime; //Start time of request attempt. Used to calculating attemptLatency
var attemptLatency; //latency from request sent out to http response reaching SDK
var cal... | javascript | {
"resource": ""
} |
q18353 | getSignerClass | train | function getSignerClass(request) {
var version;
// get operation authtype if present
var operation = null;
var authtype = '';
if (request) {
var operations = request.service.api.operations || {};
operation = operations[request.operation] || null;
authtype = operation ? operation.au... | javascript | {
"resource": ""
} |
q18354 | defineMethods | train | function defineMethods(svc) {
AWS.util.each(svc.prototype.api.operations, function iterator(method) {
if (svc.prototype[method]) return;
var operation = svc.prototype.api.operations[method];
if (operation.authtype === 'none') {
svc.prototype[method] = function (params, callback) {
... | javascript | {
"resource": ""
} |
q18355 | nextPage | train | function nextPage(callback) {
var config;
var service = this.request.service;
var operation = this.request.operation;
try {
config = service.paginationConfig(operation, true);
} catch (e) { this.error = e; }
if (!this.hasNextPage()) {
if (callback) callback(this.error, null);
... | javascript | {
"resource": ""
} |
q18356 | toBuffer | train | function toBuffer(data, encoding) {
return (typeof Buffer.from === 'function' && Buffer.from !== Uint8Array.from) ?
Buffer.from(data, encoding) : new Buffer(data, encoding);
} | javascript | {
"resource": ""
} |
q18357 | train | function(query) {
// create the required interface elements
this.out = $('#search-results');
this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
this.dots = $('<span></span>').appendTo(this.title);
this.status = $('<p style="display: none"></p>').appendTo(this.out);
this.output... | javascript | {
"resource": ""
} | |
q18358 | resolveMonitoringConfig | train | function resolveMonitoringConfig() {
var config = {
port: undefined,
clientId: undefined,
enabled: undefined,
};
if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config);
return toJSType(config);
} | javascript | {
"resource": ""
} |
q18359 | fromEnvironment | train | function fromEnvironment(config) {
config.port = config.port || process.env.AWS_CSM_PORT;
config.enabled = config.enabled || process.env.AWS_CSM_ENABLED;
config.clientId = config.clientId || process.env.AWS_CSM_CLIENT_ID;
return config.port && config.enabled && config.clientId ||
['false', '0'].indexOf(conf... | javascript | {
"resource": ""
} |
q18360 | fromConfigFile | train | function fromConfigFile(config) {
var sharedFileConfig;
try {
var configFile = AWS.util.iniLoader.loadFrom({
isConfig: true,
filename: process.env[AWS.util.sharedConfigFileEnv]
});
var sharedFileConfig = configFile[
process.env.AWS_PROFILE || AWS.util.defaultProfile
];
} catch (e... | javascript | {
"resource": ""
} |
q18361 | Signer | train | function Signer(keyPairId, privateKey) {
if (keyPairId === void 0 || privateKey === void 0) {
throw new Error('A key pair ID and private key are required');
}
this.keyPairId = keyPairId;
this.privateKey = privateKey;
} | javascript | {
"resource": ""
} |
q18362 | train | function (options, cb) {
var signatureHash = 'policy' in options
? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey)
: signWithCannedPolicy(options.url, options.expires, this.keyPairId, this.privateKey);
var cookieHash = {};
for (var key in signatureH... | javascript | {
"resource": ""
} | |
q18363 | train | function (options, cb) {
try {
var resource = getResource(options.url);
} catch (err) {
return handleError(err, cb);
}
var parsedUrl = url.parse(options.url, true),
signatureHash = Object.prototype.hasOwnProperty.call(options, 'policy')
... | javascript | {
"resource": ""
} | |
q18364 | train | function(list, iter, callback) {
var item = list.shift();
iter(item, function(err) {
if (err) return callback(err);
else if (list.length) {
eachSeries(list, iter, callback);
} else {
return callback();
}
});
} | javascript | {
"resource": ""
} | |
q18365 | train | function(bucket, callback) {
var s3 = new AWS.S3({maxRetries: 100});
var params = {
Bucket: bucket
};
s3.listObjects(params, function (err, data) {
if (err) return callback(err);
if (data.Contents.length > 0) {
params.Delete = { Objects: [] };
data.Contents.forEach(fun... | javascript | {
"resource": ""
} | |
q18366 | ProcessCredentials | train | function ProcessCredentials(options) {
AWS.Credentials.call(this);
options = options || {};
this.filename = options.filename;
this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;
this.get(options.callback || AWS.util.fn.noop);
} | javascript | {
"resource": ""
} |
q18367 | loadViaCredentialProcess | train | function loadViaCredentialProcess(profile, callback) {
proc.exec(profile['credential_process'], function(err, stdOut, stdErr) {
if (err) {
callback(AWS.util.error(
new Error('credential_process returned error'),
{ code: 'ProcessCredentialsProviderFailure'}
), null);
}... | javascript | {
"resource": ""
} |
q18368 | DocumentClient | train | function DocumentClient(options) {
var self = this;
self.options = options || {};
self.configure(self.options);
} | javascript | {
"resource": ""
} |
q18369 | allocBuffer | train | function allocBuffer(size) {
if (typeof size !== 'number') {
throw new Error('size passed to allocBuffer must be a number.');
}
var buffer = typeof Buffer.alloc === 'function' ? Buffer.alloc(size) : new Buffer(size);
buffer.fill(0);
return buffer;
} | javascript | {
"resource": ""
} |
q18370 | addVersionJSONToChangelog | train | function addVersionJSONToChangelog(version, changes) {
if (!changelog) readChangelog();
var entry = '\n\n## ' + version;
changes.forEach(function(change) {
entry += '\n* ' + change.type + ': ' + change.category + ': ' +
change.description;
});
var logParts = changelog.split(insertMarker);
logParts[0] = log... | javascript | {
"resource": ""
} |
q18371 | ClientCreator | train | function ClientCreator() {
this._metadata = require('../apis/metadata');
this._apisFolderPath = path.join(__dirname, '..', 'apis');
this._clientFolderPath = path.join(__dirname, '..', 'clients');
this._serviceCustomizationsFolderPath = path.join(__dirname, '..', 'lib', 'services');
this._packageJsonPath = pat... | javascript | {
"resource": ""
} |
q18372 | marshallCustomIdentifiers | train | function marshallCustomIdentifiers(request, shape) {
var identifiers = {};
marshallCustomIdentifiersHelper(identifiers, request.params, shape);
return identifiers;
} | javascript | {
"resource": ""
} |
q18373 | optionalDiscoverEndpoint | train | function optionalDiscoverEndpoint(request) {
var service = request.service;
var api = service.api;
var operationModel = api.operations ? api.operations[request.operation] : undefined;
var inputShape = operationModel ? operationModel.input : undefined;
var identifiers = marshallCustomIdentifiers(request, inpu... | javascript | {
"resource": ""
} |
q18374 | addApiVersionHeader | train | function addApiVersionHeader(endpointRequest) {
var api = endpointRequest.service.api;
var apiVersion = api.apiVersion;
if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) {
endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion;
}
} | javascript | {
"resource": ""
} |
q18375 | invalidateCachedEndpoints | train | function invalidateCachedEndpoints(response) {
var error = response.error;
var httpResponse = response.httpResponse;
if (error &&
(error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421)
) {
var request = response.request;
var operations = request.service.api.operations || {};
... | javascript | {
"resource": ""
} |
q18376 | hasCustomEndpoint | train | function hasCustomEndpoint(client) {
//if set endpoint is set for specific client, enable endpoint discovery will raise an error.
if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) {
throw util.error(new Error(), {
code: 'Configuratio... | javascript | {
"resource": ""
} |
q18377 | discoverEndpoint | train | function discoverEndpoint(request, done) {
var service = request.service || {};
if (hasCustomEndpoint(service) || request.isPresigned()) return done();
if (!isEndpointDiscoveryApplicable(request)) return done();
request.httpRequest.appendToUserAgent('endpoint-discovery');
var operations = service.api.opera... | javascript | {
"resource": ""
} |
q18378 | ManagedUpload | train | function ManagedUpload(options) {
var self = this;
AWS.SequentialExecutor.call(self);
self.body = null;
self.sliceFn = null;
self.callback = null;
self.parts = {};
self.completeInfo = [];
self.fillQueue = function() {
self.callback(new Error('Unsupported body payload ' + typeof sel... | javascript | {
"resource": ""
} |
q18379 | train | function(callback) {
var self = this;
self.failed = false;
self.callback = callback || function(err) { if (err) throw err; };
var runFill = true;
if (self.sliceFn) {
self.fillQueue = self.fillBuffer;
} else if (AWS.util.isNode()) {
var Stream = AWS.util.stream.Stream;
if (self... | javascript | {
"resource": ""
} | |
q18380 | ParamValidator | train | function ParamValidator(validation) {
if (validation === true || validation === undefined) {
validation = {'min': true};
}
this.validation = validation;
} | javascript | {
"resource": ""
} |
q18381 | Signer | train | function Signer(options) {
options = options || {};
this.options = options;
this.service = options.service;
this.bindServiceObject(options);
this._operations = {};
} | javascript | {
"resource": ""
} |
q18382 | removeEventStreamOperations | train | function removeEventStreamOperations(model) {
var modifiedModel = false;
// loop over all operations
var operations = model.operations;
var operationNames = Object.keys(operations);
for (var i = 0; i < operationNames.length; i++) {
var operationName = operationNames[i];
var operation... | javascript | {
"resource": ""
} |
q18383 | stringToBuffer | train | function stringToBuffer(data) {
return (typeof Buffer.from === 'function' && Buffer.from !== Uint8Array.from) ?
Buffer.from(data) : new Buffer(data);
} | javascript | {
"resource": ""
} |
q18384 | vGrow | train | function vGrow(yy, edge) {
const c = matrix.findCellAt(sheetName, yy, cell.col);
if (!c || !c.mark) { return false; }
range[edge] = yy;
c.mark = false;
return true;
} | javascript | {
"resource": ""
} |
q18385 | hGrow | train | function hGrow(xx, edge) {
const cells = [];
for (y = range.top; y <= range.bottom; y++) {
const c = matrix.findCellAt(sheetName, y, xx);
if (c && c.mark) {
cells.push(c);
} else {
return false;
}
}
range[edge] = xx;
for (let i = 0; i < c... | javascript | {
"resource": ""
} |
q18386 | train | function(size) {
var buffers;
// read min(buffer, size || infinity)
if (size) {
buffers = [];
while (size && this.buffers.length && !this.buffers[0].eod) {
var first = this.buffers[0];
var buffer = first.read(size);
size -= buffer.length;
buffers.push(buffer);
... | javascript | {
"resource": ""
} | |
q18387 | train | function() {
var topBlocks = this.workspace_.getTopBlocks(false);
for (var i = 0, block; block = topBlocks[i]; i++) {
block.removeSelect();
}
} | javascript | {
"resource": ""
} | |
q18388 | train | function(menuOptions) {
// Add the edit option at the end.
menuOptions.push(Blockly.Procedures.makeEditOption(this));
// Find the delete option and update its callback to be specific to
// functions.
for (var i = 0, option; option = menuOptions[i]; i++) {
if (option.text == Blockly.Msg.DELETE... | javascript | {
"resource": ""
} | |
q18389 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.OPERATORS_MATHOP,
"args0": [
{
"type": "field_dropdown",
"name": "OPERATOR",
"options": [
[Blockly.Msg.OPERATORS_MATHOP_ABS, 'abs'],
[Blockly.Msg.OPERATORS_MATHOP_FLOOR, 'floor'],
... | javascript | {
"resource": ""
} | |
q18390 | randomColour | train | function randomColour() {
var num = Math.floor(Math.random() * Math.pow(2, 24));
return '#' + ('00000' + num.toString(16)).substr(-6);
} | javascript | {
"resource": ""
} |
q18391 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.LOOKS_CHANGEEFFECTBY,
"args0": [
{
"type": "field_dropdown",
"name": "EFFECT",
"options": [
[Blockly.Msg.LOOKS_EFFECT_COLOR, 'COLOR'],
[Blockly.Msg.LOOKS_EFFECT_FISHEYE, 'FISHEYE'],
... | javascript | {
"resource": ""
} | |
q18392 | train | function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_dropdown",
"name": "COSTUME",
"options": [
['costume1', 'COSTUME1'],
['costume2', 'COSTUME2']
]
}
],
"colour": Blockly.Colours.looks.seco... | javascript | {
"resource": ""
} | |
q18393 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.LOOKS_BACKDROPNUMBERNAME,
"args0": [
{
"type": "field_dropdown",
"name": "NUMBER_NAME",
"options": [
[Blockly.Msg.LOOKS_NUMBERNAME_NUMBER, 'number'],
[Blockly.Msg.LOOKS_NUMBERNAME_NAME, 'na... | javascript | {
"resource": ""
} | |
q18394 | train | function() {
this.jsonInit({
"id": "event_whenflagclicked",
"message0": Blockly.Msg.EVENT_WHENFLAGCLICKED,
"args0": [
{
"type": "field_image",
"src": Blockly.mainWorkspace.options.pathToMedia + "green-flag.svg",
"width": 24,
"height": 24,
"... | javascript | {
"resource": ""
} | |
q18395 | train | function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_variable",
"name": "BROADCAST_OPTION",
"variableTypes":[Blockly.BROADCAST_MESSAGE_VARIABLE_TYPE],
"variable": Blockly.Msg.DEFAULT_BROADCAST_MESSAGE_NAME
}
],
"co... | javascript | {
"resource": ""
} | |
q18396 | train | function() {
this.jsonInit({
"id": "event_whenkeypressed",
"message0": Blockly.Msg.EVENT_WHENKEYPRESSED,
"args0": [
{
"type": "field_dropdown",
"name": "KEY_OPTION",
"options": [
[Blockly.Msg.EVENT_WHENKEYPRESSED_SPACE, 'space'],
[Block... | javascript | {
"resource": ""
} | |
q18397 | train | function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_dropdown",
"name": "KEY_OPTION",
"options": [
[Blockly.Msg.EVENT_WHENKEYPRESSED_SPACE, 'space'],
[Blockly.Msg.EVENT_WHENKEYPRESSED_UP, 'up arrow'],
[Blockl... | javascript | {
"resource": ""
} | |
q18398 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.SENSING_SETDRAGMODE,
"args0": [
{
"type": "field_dropdown",
"name": "DRAG_MODE",
"options": [
[Blockly.Msg.SENSING_SETDRAGMODE_DRAGGABLE, 'draggable'],
[Blockly.Msg.SENSING_SETDRAGMODE_NOTD... | javascript | {
"resource": ""
} | |
q18399 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.SENSING_OF,
"args0": [
{
"type": "field_dropdown",
"name": "PROPERTY",
"options": [
[Blockly.Msg.SENSING_OF_XPOSITION, 'x position'],
[Blockly.Msg.SENSING_OF_YPOSITION, 'y position'],
... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.