file_name large_stringlengths 4 140 | prefix large_stringlengths 0 12.1k | suffix large_stringlengths 0 12k | middle large_stringlengths 0 7.51k | fim_type large_stringclasses 4
values |
|---|---|---|---|---|
create.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | (self, args):
"""This is what gets called when the user runs this command.
Args:
args: an argparse namespace. All the arguments that were provided to this
command invocation.
Returns:
Some value that we want to have printed later.
"""
op = databases.Create(
args.instanc... | Run | identifier_name |
create.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
from googlecloudsdk.api_lib.spanner import database_operations
from googlecloudsdk.api_lib.spanner import databases
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.spanner import flags
class Create(base.CreateCommand):
"""Cloud Spanner databases create command."""
@staticmethod
def Ar... | # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Command for spanner databases create.""" | random_line_split |
create.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
def Run(self, args):
"""This is what gets called when the user runs this command.
Args:
args: an argparse namespace. All the arguments that were provided to this
command invocation.
Returns:
Some value that we want to have printed later.
"""
op = databases.Create(
a... | """Args is called by calliope to gather arguments for this command.
Please add arguments in alphabetical order except for no- or a clear-
pair for that argument which can follow the argument itself.
Args:
parser: An argparse parser that you can use to add arguments that go
on the command li... | identifier_body |
popup.js | /*
* uget-chrome-wrapper is an extension to integrate uGet Download manager
* with Google Chrome, Chromium, Vivaldi and Opera in Linux and Windows.
*
* Copyright (C) 2016 Gobinath
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as p... | () {
var keywordsToExclude = document.getElementById("keywordsToExclude").value.trim();
var keywordsToInclude = document.getElementById("keywordsToInclude").value.trim();
var interrupt = document.getElementById('chk-interrupt').checked;
var minFileSize = parseInt(document.getElementById("fileSize").value) * 1024;
... | saveChanges | identifier_name |
popup.js | /*
* uget-chrome-wrapper is an extension to integrate uGet Download manager
* with Google Chrome, Chromium, Vivaldi and Opera in Linux and Windows.
*
* Copyright (C) 2016 Gobinath
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as p... |
// When the popup HTML has loaded
window.addEventListener('load', function(evt) {
// Show the system status
current_browser.runtime.getBackgroundPage(function(backgroundPage) {
var state = backgroundPage.getState();
if (state == 0) {
// document.getElementById('info').innerHTML = "Info: Found uGet and uget-c... | {
var keywordsToExclude = document.getElementById("keywordsToExclude").value.trim();
var keywordsToInclude = document.getElementById("keywordsToInclude").value.trim();
var interrupt = document.getElementById('chk-interrupt').checked;
var minFileSize = parseInt(document.getElementById("fileSize").value) * 1024;
if ... | identifier_body |
popup.js | /*
* uget-chrome-wrapper is an extension to integrate uGet Download manager
* with Google Chrome, Chromium, Vivaldi and Opera in Linux and Windows.
*
* Copyright (C) 2016 Gobinath
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as p... |
window.close();
}
// When the popup HTML has loaded
window.addEventListener('load', function(evt) {
// Show the system status
current_browser.runtime.getBackgroundPage(function(backgroundPage) {
var state = backgroundPage.getState();
if (state == 0) {
// document.getElementById('info').innerHTML = "Info: Fo... | backgroundPage.updateKeywords(keywordsToInclude, keywordsToExclude);
backgroundPage.setInterruptDownload(interrupt, true);
backgroundPage.updateMinFileSize(minFileSize);
}); | random_line_split |
popup.js | /*
* uget-chrome-wrapper is an extension to integrate uGet Download manager
* with Google Chrome, Chromium, Vivaldi and Opera in Linux and Windows.
*
* Copyright (C) 2016 Gobinath
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as p... |
current_browser.runtime.getBackgroundPage(function(backgroundPage) {
backgroundPage.updateKeywords(keywordsToInclude, keywordsToExclude);
backgroundPage.setInterruptDownload(interrupt, true);
backgroundPage.updateMinFileSize(minFileSize);
});
window.close();
}
// When the popup HTML has loaded
window.addEv... | {
minFileSize = -1024; // Which is -1 KB
} | conditional_block |
config.js | /**
/* Script name : config.js
/* Description : Configuration file
/* Author : Redek Project
**/
'use strict';
// CONFIGURATIONS VARIABLES
// ----------------------------------------------------------------------------
let initialConfig = {
showDebug: true,
userModelName: 'User',
defaultRoleUser: {
name: 's... | // ----------------------------------------------------------------------------
module.exports = {
initialConfig,
get,
set
} | // EXPORTS | random_line_split |
engine.ts | import { IFuzzer } from 'fuzzer';
import os from 'os';
import readline from 'readline';
import { isMainThread, parentPort, Worker as ThreadWorker, workerData } from 'worker_threads';
enum WorkerMessageTypes {
Online = 'online',
Progress = 'progress',
Crash = 'crash',
}
/**
* Multi-threaded fuzzing engine.
*/
exp... | },
eval: true,
workerData: {
runThisFileInTheWorker: filename,
tid,
},
}
);
worker.on('message', (msg) => {
switch (msg.type) {
case WorkerMessageTypes.Online: {
workersOnline += 1;
break;
}
case WorkerMessageTypes.Progress: {
totalCases += ... | {
let workersOnline = 0;
let totalCases = 0;
const uniqueStacks = new Set();
const argv = process.argv.slice(2);
// Start all the workers
const numOfCpus = os.cpus().length;
process.stdout.write(`Main thread, launching ${numOfCpus} workers\n`);
for (const tid of Array(numOfCpus).keys()) {
const work... | identifier_body |
engine.ts | import { IFuzzer } from 'fuzzer';
import os from 'os';
import readline from 'readline';
import { isMainThread, parentPort, Worker as ThreadWorker, workerData } from 'worker_threads';
enum WorkerMessageTypes {
Online = 'online',
Progress = 'progress',
Crash = 'crash',
}
/**
* Multi-threaded fuzzing engine.
*/
exp... | <TFuzzer extends IFuzzer> {
run(fuzzer: TFuzzer, filename: string): void {
if (isMainThread) {
this.runMain(filename);
} else {
this.runWorker(fuzzer);
}
}
private runMain(filename: string): void {
let workersOnline = 0;
let totalCases = 0;
const uniqueStacks = new Set();
const argv = process.ar... | Engine | identifier_name |
engine.ts | import { IFuzzer } from 'fuzzer';
import os from 'os';
import readline from 'readline';
import { isMainThread, parentPort, Worker as ThreadWorker, workerData } from 'worker_threads';
enum WorkerMessageTypes {
Online = 'online',
Progress = 'progress',
Crash = 'crash',
}
/**
* Multi-threaded fuzzing engine.
*/
exp... |
deltaCases += 1;
// Init case
const fuzzCase = fuzzer.prepareCase();
// Execute the case
try {
fuzzCase.run();
} catch (error) {
// Test if this is an expected error
if (fuzzCase.isExpectedError(error)) {
continue;
}
// Not interested in duplicate stack traces
if (uniq... | {
parentPort.postMessage({
type: WorkerMessageTypes.Progress,
totalCases: deltaCases,
tid,
});
deltaCases = 0;
} | conditional_block |
engine.ts | import { IFuzzer } from 'fuzzer';
import os from 'os';
import readline from 'readline';
import { isMainThread, parentPort, Worker as ThreadWorker, workerData } from 'worker_threads';
enum WorkerMessageTypes {
Online = 'online',
Progress = 'progress',
Crash = 'crash',
}
/**
* Multi-threaded fuzzing engine.
*/
exp... | if (uniqueStacks.has(msg.stack)) {
return;
}
uniqueStacks.add(msg.stack);
// Print the error
process.stdout.write(
`\n\n!!! \x1b[31mCrash found\x1b[0m !!!\nSelector: \`${msg.selector}\`\nLanguage: \`${msg.language}\`\nBackend: \`${msg.backend}\`\n\`\`\`\n${msg.stack}\n\`\`\`... | // Must do this again because workers do not coordinate | random_line_split |
FieldCommentList.tsx | /*
MIT License
Copyright (c) 2020 Looker Data Sciences, Inc.
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, modi... | Text
} from "@looker/components"
import {
IUser,
ILookmlModelExploreField,
ILookmlModelExplore
} from "@looker/sdk"
import { UserData, FieldComments, CommentPermissions } from "./interfaces"
import { FieldComment } from "./FieldComment"
import { NOT_EDITING_COMMENT } from "../utils/constants"
export const Fie... | Space, | random_line_split |
FieldCommentList.tsx | /*
MIT License
Copyright (c) 2020 Looker Data Sciences, Inc.
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, modi... | else {
authorData = {
avatar_url: commentAuthor[0].avatar_url,
first_name: commentAuthor[0].first_name,
last_name: commentAuthor[0].last_name,
display_name: commentAuthor[0].display_name
}
}
return authorData
}
return (
<Flex flexDirection="column">
{s... | {
authorData = {
first_name: "Deleted",
last_name: "User",
display_name: "Deleted User",
avatar_url: ""
}
} | conditional_block |
pl.js | /*!
* FileInput Polish Translations
| *
* @see http://github.com/kartik-v/bootstrap-fileinput
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
(function ($) {
"use strict";
$.fn.fileinputLocales['pl'] = {
fileSingle: 'plik',
filePlural: 'pliki',
browseLabel: 'Przeglądaj …',
removeLabel... | *
* This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
* any HTML markup tags in the messages must not be converted or translated.
| random_line_split |
require.js | /* eslint strict:0 */
var modules = Object.create(null);
var inGuard = false;
function define(id, factory) {
modules[id] = {
factory,
module: {exports: {}},
isInitialized: false,
hasError: false,
};
if (__DEV__) { // HMR
Object.assign(modules[id].module, {
hot: {
acceptCallback... | return;
}
if (mod.module.hot.acceptCallback) {
mod.factory = factory;
mod.isInitialized = false;
require(id);
mod.module.hot.acceptCallback();
} else {
console.warn(
'[HMR] Module `' + id + '` can\'t be hot reloaded because it ' +
'doesn\'t provide accep... | ); | random_line_split |
require.js | /* eslint strict:0 */
var modules = Object.create(null);
var inGuard = false;
function define(id, factory) {
modules[id] = {
factory,
module: {exports: {}},
isInitialized: false,
hasError: false,
};
if (__DEV__) { // HMR
Object.assign(modules[id].module, {
hot: {
acceptCallback... |
mod.module.hot.acceptCallback();
} else {
console.warn(
'[HMR] Module `' + id + '` can\'t be hot reloaded because it ' +
'doesn\'t provide accept callback hook. Reload the app to get the updates.'
);
}
}
global.__accept = accept;
}
| {
var mod = modules[id];
if (!mod) {
define(id, factory);
return; // new modules don't need to be accepted
}
if (!mod.module.hot) {
console.warn(
'Cannot accept module because Hot Module Replacement ' +
'API was not installed.'
);
return;
}
if (mo... | identifier_body |
require.js | /* eslint strict:0 */
var modules = Object.create(null);
var inGuard = false;
function define(id, factory) {
modules[id] = {
factory,
module: {exports: {}},
isInitialized: false,
hasError: false,
};
if (__DEV__) { // HMR
Object.assign(modules[id].module, {
hot: {
acceptCallback... |
try {
// We must optimistically mark mod as initialized before running the factory to keep any
// require cycles inside the factory from causing an infinite require loop.
mod.isInitialized = true;
__DEV__ && Systrace().beginEvent('JS_require_' + id);
// keep args in sync with with defineModule... | {
throw new Error(
'Requiring module "' + id + '" which threw an exception'
);
} | conditional_block |
require.js | /* eslint strict:0 */
var modules = Object.create(null);
var inGuard = false;
function define(id, factory) {
modules[id] = {
factory,
module: {exports: {}},
isInitialized: false,
hasError: false,
};
if (__DEV__) { // HMR
Object.assign(modules[id].module, {
hot: {
acceptCallback... | (id, factory) {
var mod = modules[id];
if (!mod) {
define(id, factory);
return; // new modules don't need to be accepted
}
if (!mod.module.hot) {
console.warn(
'Cannot accept module because Hot Module Replacement ' +
'API was not installed.'
);
return;
... | accept | identifier_name |
strings.js | define({
"taskUrl": "Tehtävän URL-osoite",
"setTask": "Määritä",
"setTaskPopupTitle": "Määritä tehtävä",
"validate": "Määritä",
"inValidGPService": "Anna kelvollinen geoprosessointipalvelu.",
"GPFeatureRecordSetLayerERR": "Anna geoprosessointipalvelu, jossa on vain GPFeatureRecordSetLayer-tyypin lähtöaineis... | "visibilityText": "Näkyvä",
"exportToCsvText": "Vie CSV-tiedostoon",
"exportToCsvDisplayText": "CSV",
"settitngstext": "Asetukset",
"addFieldTitle": "Lisää kenttä",
"enterDisplayText": "Kirjoita näyttöteksti",
"setScale": "Määritä mittakaava",
"outputDisplay": "Näyttöteksti",
"saveTo... | "skipText": "Ohitettavissa", | random_line_split |
_mini_logo.py | 27",
"@. c #BA2D2D",
"#. c #7B1717",
"$. c #6E5B75",
"%. c #F9E0F9",
"&. c #EEECEE",
"*. c #EBF2EB",
"=. c #FDB9FB",
"-. c #BC7AA2",
";. c #C22F2F",
">. c #BC2D2D",
",. c #B62B2B",
"'. c #B02D2F",
"). c #C3627E",
"!. c #831F1F",
"~. c #962E2E",
"{. c #902E2E",
"]. c #931F1A",
"^. c #E59DD2",
"/. c #9D1B15",
"(. c #AB27... | "L+ c #E8A6E0",
"M+ c #ED7290",
"N+ c #CD2D28",
"O+ c #CC3B3B",
"P+ c #D04545",
"Q+ c #CA4141",
"R+ c #D03D3D",
"S+ c #DA3C3C",
"T+ c #D83636",
"U+ c #D43232",
"V+ c #D63232",
"W+ c #AC2626",
"X+ c #B22A2A",
"Y+ c #A02929",
"Z+ c #A54D4D",
"`+ c #DDD2D2",
" @ c #D3C5C5",
".@ c #B21D1D",
"+@ c #D43434",
"@@ c #D32E2A",
... | "I+ c #CB2C2A",
"J+ c #E97EA1",
"K+ c #F7A7DF", | random_line_split |
compiler_host.ts | = context.toSummaryFileName.bind(context);
}
if (context.fromSummaryFileName) {
this.fromSummaryFileName = context.fromSummaryFileName.bind(context);
}
this.metadataReaderHost = {
cacheMetadata: () => true,
getSourceFileMetadata: (filePath) => {
const sf = this.getOriginalSour... |
return moduleName;
}
resourceNameToFileName(resourceName: string, containingFile: string): string|null {
// Note: we convert package paths into relative paths to be compatible with the the
// previous implementation of UrlResolver.
const firstChar = resourceName[0];
if (firstChar === '/') {
... | {
throw new Error(
`Trying to import a source file from a node_modules package: import ${originalImportedFile} from ${containingFile}`);
} | conditional_block |
compiler_host.ts | FileName = context.toSummaryFileName.bind(context);
}
if (context.fromSummaryFileName) {
this.fromSummaryFileName = context.fromSummaryFileName.bind(context);
}
this.metadataReaderHost = {
cacheMetadata: () => true,
getSourceFileMetadata: (filePath) => {
const sf = this.getOrig... | (fileName: string, referringLibFileName: string): string {
const resolved = this.moduleNameToFileName(fileName, referringLibFileName);
if (!resolved) {
throw new Error(`Could not resolve ${fileName} from ${referringLibFileName}`);
}
return resolved;
}
parseSourceSpanOf(fileName: string, line:... | fromSummaryFileName | identifier_name |
compiler_host.ts | * Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {AotCompilerHost, EmitterVisitorContext, ExternalReference, GeneratedFile, ParseSourceSpan, TypeScriptEmitter, collectExternalReferences, syntaxError} from '@angular/compiler... | * Copyright Google Inc. All Rights Reserved.
* | random_line_split | |
compiler_host.ts | a violation of the principle that node_modules packages cannot
* import project sources.
*/
fileNameToModuleName(importedFile: string, containingFile: string): string {
const originalImportedFile = importedFile;
if (this.options.traceResolution) {
console.error(
'fileNameToModuleName... | {
const genSrcFile = this.generatedSourceFiles.get(fileName);
if (genSrcFile) {
return genSrcFile.sourceFile;
}
const {generate, baseFileName} = this.shouldGenerateFile(fileName);
if (generate) {
const genFile = this.codeGenerator.generateFile(fileName, baseFileName);
return this.a... | identifier_body | |
transpilers.js | BodyAttrs: function(attrsList) {
var attrsDict = {};
_.each(attrsList, function(attr) {
if (attr.escaped)
attr.val = attr.val.slice(1, -1);
attrsDict[attr.name] = attr.val;
});
return attrsDict;
}
});
TemplateCompiler = function(tree, options) {
var self = this;
self.tree = ... | {
dynamicAttrs.unshift(dict);
return HTML.Attrs.apply(null, dynamicAttrs);
} | conditional_block | |
transpilers.js | this;
self.nodes = tree.nodes;
self.filename = options && options.filename || "";
self.head = null;
self.body = null;
self.bodyAttrs = {};
self.templates = {};
};
_.extend(FileCompiler.prototype, {
compile: function () {
var self = this;
for (var i = 0; i < self.nodes.length; i++)
self.reg... |
options = options || {};
options.getTemplateTag = SpacebarsCompiler.TemplateTag.parseCompleteTag;
return HTMLTools.parseFragment(text, options);
},
visitComment: function (comment) {
// If buffer boolean is true we want to display this comment in the DOM
if (comment.buffer)
return HTML.... | text = text.replace(/!\{\s*((\.{1,2}\/)*[\w\.-]+)\s*\}/g, "{{{$1}}}"); | random_line_split |
ATSRemover.js | /**
*******************************************************
* *
* Copyright (C) Microsoft. All rights reserved. *
* *
*******************************************************
*/
var glob = require('glob')... | var data = plist.parse(fs.readFileSync(infoPListFile, 'utf-8'));
data.NSAppTransportSecurity = {
NSAllowsArbitraryLoads: true
};
fs.writeFileSync(infoPListFile, plist.build(data));
});
};
}; | }).forEach(function(filename) {
var infoPListFile = path.join(configFolder, filename); | random_line_split |
angular-locale_id.js | angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"Minggu",
"Senin",
"Sel... | "mediumDate": "d MMM yyyy",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "Rp",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
... | random_line_split | |
2D_Dielectric_Dielectric.js | _1;
let k_y = Math.sin(theta_i)*k_1;
for (let v=0;v < y_data.length ;v++) {
let z_row = [];
for (let i = 0; i < x_data.length ; i++) {
z = E_0* Math.sin(k_x* x_data[i]+k_y*y_data[v]+w_r*t);
z_row.push(z);
}
z_squar... | function play_loop(){//handles the play button
if(isPlay === true) {
t++;//keeps time ticking
Plotly.animate("graph",
{data: plot_data()},
| random_line_split | |
2D_Dielectric_Dielectric.js | 5;
let w_r = 2e9;
let c = 3e8; // Speed of light
let n1 = 1;
let k_1 = (n1*w_r)/c;
let k_2,theta_i,theta_t;
let x_data = numeric.linspace(2, 0, size);//x and y data is always the same and just change z
let x_data_t = math.add(-2,x_data);
let y_data = numeric.linspace(-2, 2, s... | (){//gives the new amplitude of the transmitted wave
let E_t0;
if (isNaN(theta_t) === true){//if snells law return not a number this means total internal refection is occurring hence no transmitted wave(no attenuation accounted for)
return 0
}
else {
... | transmit | identifier_name |
2D_Dielectric_Dielectric.js | (let i = 0; i < x_data.length ; i++) {
z = E_0_r* Math.sin(k_x* x_data[i]+k_y*y_data[v]-w_r*t);
z_row.push(z);
}
z_square.push(z_row);
}
return z_square
}
function getData_wave_transmitted(){//produces data for the incident wave ... |
Plotly.purge("graph");
Plotly.newPlot('graph', plot_data(),layout);//create plot
dom.tswitch.on("change", update_graph);//change of input produces reaction
dom.aSlider.on("input", update_graph);
dom.nSlider.on("input", update_graph);
$('#playButton').on('click',... | identifier_body | |
2D_Dielectric_Dielectric.js | 5;
let w_r = 2e9;
let c = 3e8; // Speed of light
let n1 = 1;
let k_1 = (n1*w_r)/c;
let k_2,theta_i,theta_t;
let x_data = numeric.linspace(2, 0, size);//x and y data is always the same and just change z
let x_data_t = math.add(-2,x_data);
let y_data = numeric.linspace(-2, 2, s... |
z_square.push(z_row);
}
return z_square
}
function getData_wave_transmitted(){//produces data for the incident wave on the boundry
let z,z_square = [];
let E_0_t = transmit();
let k_y = Math.sin(theta_i)*k_1;
let k_x = Math.cos(theta_t)*k_2... | {
z = E_0_r* Math.sin(k_x* x_data[i]+k_y*y_data[v]-w_r*t);
z_row.push(z);
} | conditional_block |
derive.rs | use crate::cfg_eval::cfg_eval;
use rustc_ast as ast;
use rustc_ast::{attr, token, GenericParamKind, ItemKind, MetaItemKind, NestedMetaItem, StmtKind};
use rustc_errors::{struct_span_err, Applicability};
use rustc_expand::base::{Annotatable, ExpandResult, ExtCtxt, Indeterminate, MultiItemModifier};
use rustc_feature::A... |
fn report_path_args(sess: &Session, meta: &ast::MetaItem) {
let report_error = |title, action| {
let span = meta.span.with_lo(meta.path.span.hi());
sess.struct_span_err(span, title)
.span_suggestion(span, action, String::new(), Applicability::MachineApplicable)
.emit();
... | {
let help_msg = match lit.token.kind {
token::Str if rustc_lexer::is_ident(&lit.token.symbol.as_str()) => {
format!("try using `#[derive({})]`", lit.token.symbol)
}
_ => "for example, write `#[derive(Debug)]` for `Debug`".to_string(),
};
struct_span_err!(sess, lit.span, ... | identifier_body |
derive.rs | use crate::cfg_eval::cfg_eval;
use rustc_ast as ast;
use rustc_ast::{attr, token, GenericParamKind, ItemKind, MetaItemKind, NestedMetaItem, StmtKind};
use rustc_errors::{struct_span_err, Applicability};
use rustc_expand::base::{Annotatable, ExpandResult, ExtCtxt, Indeterminate, MultiItemModifier};
use rustc_feature::A... | (
&self,
ecx: &mut ExtCtxt<'_>,
span: Span,
meta_item: &ast::MetaItem,
item: Annotatable,
) -> ExpandResult<Vec<Annotatable>, Annotatable> {
let sess = ecx.sess;
if report_bad_target(sess, &item, span) {
// We don't want to pass inappropriate targe... | expand | identifier_name |
derive.rs | use crate::cfg_eval::cfg_eval;
use rustc_ast as ast;
use rustc_ast::{attr, token, GenericParamKind, ItemKind, MetaItemKind, NestedMetaItem, StmtKind};
use rustc_errors::{struct_span_err, Applicability};
use rustc_expand::base::{Annotatable, ExpandResult, ExtCtxt, Indeterminate, MultiItemModifier};
use rustc_feature::A... | [(_, first_item, _), others @ ..] => {
*first_item = cfg_eval(sess, features, item.clone());
for (_, item, _) in others {
*item = first_item.clone();
}
}
}
... | // Do not configure or clone items unless necessary.
match &mut resolutions[..] {
[] => {} | random_line_split |
mock_engine.rs | // Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
use super::Result;
use crate::storage::kv::{Callback, ExtCallback, Modify, SnapContext, WriteData};
use crate::storage::{Engine, RocksEngine};
use kvproto::kvrpcpb::Context;
use std::collections::LinkedList;
use std::sync::{Arc, Mutex};
/// A mock eng... | (&self) -> Self::Local {
self.base.kv_engine()
}
fn snapshot_on_kv_engine(&self, start_key: &[u8], end_key: &[u8]) -> Result<Self::Snap> {
self.base.snapshot_on_kv_engine(start_key, end_key)
}
fn modify_on_kv_engine(&self, modifies: Vec<Modify>) -> Result<()> {
self.base.modify... | kv_engine | identifier_name |
mock_engine.rs | // Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
use super::Result;
use crate::storage::kv::{Callback, ExtCallback, Modify, SnapContext, WriteData};
use crate::storage::{Engine, RocksEngine};
use kvproto::kvrpcpb::Context;
use std::collections::LinkedList;
use std::sync::{Arc, Mutex};
/// A mock eng... |
pub fn add_expected_write(mut self, write: ExpectedWrite) -> Self {
self.expected_modifies.push_back(write);
self
}
pub fn build(self) -> MockEngine {
MockEngine {
base: self.base,
expected_modifies: Arc::new(ExpectedWriteList(Mutex::new(self.expected_modifi... | } | random_line_split |
mock_engine.rs | // Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
use super::Result;
use crate::storage::kv::{Callback, ExtCallback, Modify, SnapContext, WriteData};
use crate::storage::{Engine, RocksEngine};
use kvproto::kvrpcpb::Context;
use std::collections::LinkedList;
use std::sync::{Arc, Mutex};
/// A mock eng... |
// check whether use right callback
match expected_write.use_proposed_cb {
Some(true) => assert!(
proposed_cb.is_some(),
"this write is supposed to return during the propose stage"
),
... | {
assert_eq!(
modify, &expected_modify,
"modify writing to Engine not match with expected"
)
} | conditional_block |
mock_engine.rs | // Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
use super::Result;
use crate::storage::kv::{Callback, ExtCallback, Modify, SnapContext, WriteData};
use crate::storage::{Engine, RocksEngine};
use kvproto::kvrpcpb::Context;
use std::collections::LinkedList;
use std::sync::{Arc, Mutex};
/// A mock eng... |
fn async_write_ext(
&self,
ctx: &Context,
batch: WriteData,
write_cb: Callback<()>,
proposed_cb: Option<ExtCallback>,
committed_cb: Option<ExtCallback>,
) -> Result<()> {
let mut expected_writes = self.expected_modifies.0.lock().unwrap();
for mod... | {
self.async_write_ext(ctx, batch, write_cb, None, None)
} | identifier_body |
error.ts | import shortid from 'shortid';
import { ErrorLevel } from '~client/constants/error';
export const enum ActionTypeError {
Opened = '@@error/OPENED',
Closed = '@@error/CLOSED',
Removed = '@@error/REMOVED',
}
type ActionErrorOpened = {
type: ActionTypeError.Opened;
message: {
text: string;
level: Erro... | };
export const errorClosed = (id: string): ActionErrorClosed => ({
type: ActionTypeError.Closed,
id,
});
type ActionErrorRemoved = {
type: ActionTypeError.Removed;
id: string;
};
export const errorRemoved = (id: string): ActionErrorRemoved => ({
type: ActionTypeError.Removed,
id,
});
export type Action... |
type ActionErrorClosed = {
type: ActionTypeError.Closed;
id: string; | random_line_split |
Vote.tsx | import React from 'react';
import { useDispatch, useSelector } from 'react-redux';
import EntryBox from '../components/EntryBox';
import MainSection from '../components/MainSection';
import Scoreboard from '../components/Scoreboard';
import {
createTopicRequest, decrementCountRequest, destroyTopicRequest, incrementC... | export default Vote; | random_line_split | |
ja_utf-8.js | // 日本語 japanese utf-8 lang variables
tinyMCE.addToLang('',{
theme_style_select : '-- スタイル --',
theme_code_desc : 'ソースを編集',
theme_code_title : 'HTML ソース編集',
theme_code_wordwrap : '右端で折り返す',
theme_sub_desc : '下付き',
theme_sup_desc : '上付き',
theme_hr_desc : '水平面線を挿入',
theme_removeformat_desc : 'フォーマットを取消す',
theme_custom1_... | image_list : 'イメージのリスト',
browse : 'ブラウズ',
image_props_desc : 'イメージのプロパティ',
newdocument_desc : '新規',
class_name : 'クラス',
newdocument : '全てを削除?',
about_title : 'TinyMCEについて',
about : 'TinyMCEについて',
license : 'ライセンス',
plugins : 'プラグイン',
plugin : 'プラグイン',
author : '作者',
version : 'バージョン',
loaded_plugins : '有効なプラグイン',
help ... | cut_desc : '切り取り',
copy_desc : 'コピー',
paste_desc : '貼り付け',
link_list : 'リンクのリスト', | random_line_split |
Review.tsx | import * as React from 'react';
import Typography from '@mui/material/Typography';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import ListItemText from '@mui/material/ListItemText';
import Grid from '@mui/material/Grid';
const products = [
{
name: 'Product 1',
desc: ... | <ListItemText primary="Total" />
<Typography variant="subtitle1" sx={{ fontWeight: 700 }}>
$34.06
</Typography>
</ListItem>
</List>
<Grid container spacing={2}>
<Grid item xs={12} sm={6}>
<Typography variant="h6" gutterBottom sx={{ mt: 2 }}... | random_line_split | |
FilteringExample.js | /* eslint-disable import/no-extraneous-dependencies,import/no-unresolved */
import React, { useState } from 'react';
import { Form } from 'react-bootstrap';
import { Typeahead } from 'react-bootstrap-typeahead';
/* example-start */
const options = [
'Warsaw',
'Kraków',
'Łódź',
'Wrocław',
'Poznań',
'Gdańsk... | const FilteringExample = () => {
const [caseSensitive, setCaseSensitive] = useState(false);
const [ignoreDiacritics, setIgnoreDiacritics] = useState(true);
return (
<>
<Typeahead
caseSensitive={caseSensitive}
id="filtering-example"
ignoreDiacritics={ignoreDiacritics}
opt... | random_line_split | |
mtwt.rs | txt, IllegalCtxt)),
mark_memo: RefCell::new(HashMap::new()),
rename_memo: RefCell::new(HashMap::new()),
}
}
/// Print out an SCTable for debugging
pub fn display_sctable(table: &SCTable) {
error!("SC table:");
for (idx,val) in table.table.borrow().iter().enumerate() {
error!("{:4u} ... |
// extend a syntax context with a sequence of marks given
// in a vector. v[0] will be the outermost mark. | random_line_split | |
mtwt.rs | to, tail, table))
}
// Extend a syntax context with a given rename and sctable
fn new_rename_internal(id: Ident,
to: Name,
tail: SyntaxContext,
table: &SCTable) -> SyntaxContext {
let key = (tail,id,to);
let new_ctxt = |_: &(SyntaxContext, I... | else {
marks.push(mark);
}
}
#[cfg(test)]
mod tests {
use ast::*;
use super::{resolve, xorPush, new_mark_internal, new_sctable_internal};
use super::{new_rename_internal, marksof_internal, resolve_internal};
use super::{SCTable, EmptyCtxt, Mark, Rename, IllegalCtxt};
use collections::H... | {
marks.pop().unwrap();
} | conditional_block |
mtwt.rs | with_resolve_table_mut(|table| *table = HashMap::new());
}
// Add a value to the end of a vec, return its index
fn idx_push<T>(vec: &mut Vec<T> , val: T) -> u32 {
vec.push(val);
(vec.len() - 1) as u32
}
/// Resolve a syntax object to a name, per MTWT.
pub fn resolve(id: Ident) -> Name {
with_sctable(|sct... | test_marksof | identifier_name | |
umeditor.config.js | 项均为UEditor默认值。
* 修改默认配置请首先确保已经完全明确该参数的真实用途。
* 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。
* 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。
**************************提示********************************/
(function () {
/**
* 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。
... | ].src;
return new PathStack().push( currentPath ) + "";
})();
/**
* 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。
*/
window.UMEDITOR_CONFIG = {
//为编辑器实例添加一个路径,这个不能被注释
UMEDITOR_HOME_URL : URL
//图片上传配置区
,imageUrl:"/Advice/imgUpload" //图片上传提交地址
,ima... | th -1 | identifier_name |
umeditor.config.js | 配置项均为UEditor默认值。
* 修改默认配置请首先确保已经完全明确该参数的真实用途。
* 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。
* 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。
**************************提示********************************/
(function () {
/**
* 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。
... | h[ currentPath.length -1 ].src;
return new PathStack().push( currentPath ) + "";
})();
/**
* 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。
*/
window.UMEDITOR_CONFIG = {
//为编辑器实例添加一个路径,这个不能被注释
UMEDITOR_HOME_URL : URL
//图片上传配置区
,imageUrl:"/Advice/imgUpload" ... | for(var i= 0,tempPath,l=parsedStack.length,root = this.stack;i<l;i++){
tempPath = parsedStack[i];
if(tempPath){
if( PathStack.isParentPath( tempPath ) ) {
root.pop();
} else {
root.push( tempPath );
... | identifier_body |
umeditor.config.js | 配置项均为UEditor默认值。
* 修改默认配置请首先确保已经完全明确该参数的真实用途。
* 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。
* 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。
**************************提示********************************/
(function () {
/**
* 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。
... | //,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''}
//undo
//可以最多回退的次数,默认20
//,maxUndoCount:20
//当输入的字符数超过该值时,保存一次现场
//,maxInputCount:1
//imageScaleEnabled
// 是否允许点击文件拖拽改变大小,默认true
//,imageScaleEnabled:true
//dr... | //字号
//,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36]
//paragraph
//段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准 | random_line_split |
umeditor.config.js | 项均为UEditor默认值。
* 修改默认配置请首先确保已经完全明确该参数的真实用途。
* 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。
* 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。
**************************提示********************************/
(function () {
/**
* 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。
... | tunorderedlist | selectall cleardoc paragraph | fontfamily fontsize' ,
'| justifyleft justifycenter justifyright justifyjustify |',
'link unlink | emotion image video | map',
'| horizontal print preview fullscreen', 'drafts', 'formula'
]
//语言配置项,默认是zh-cn。有需要的话也可以使用如... | "upfile" //图片数据的key,若此处修改,需要在后台对应文件修改对应参数
//工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的从新定义
,toolbar:[
'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |',
'insertorderedlist inser | conditional_block |
auth.rs | // Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
use crate::{sleep_with_handle, FailReasonExt, GMsg, RequestExt, Route, SessionExt};
use futures::channel::oneshot;
use iml_wire_types::{EndpointName, Session};
use reg... | () -> Option<String> {
let html_doc: HtmlDocument = HtmlDocument::from(JsValue::from(document()));
let cookie = html_doc.cookie().unwrap();
parse_cookie(&cookie)
}
/// Parses the CSRF token out of the cookie if one exists.
fn parse_cookie(cookie: &str) -> Option<String> {
let re = Regex::new(r"csrftok... | csrf_token | identifier_name |
auth.rs | // Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
use crate::{sleep_with_handle, FailReasonExt, GMsg, RequestExt, Route, SessionExt};
use futures::channel::oneshot;
use iml_wire_types::{EndpointName, Session};
use reg... | #[allow(clippy::large_enum_variant)]
#[derive(Clone, Debug)]
pub enum Msg {
Fetch,
Fetched(fetch::FetchObject<Session>),
Logout,
LoggedIn,
Loop,
Noop,
}
pub fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg, GMsg>) {
match msg {
Msg::Fetch => {
model.ca... | pub(crate) fn get_session(&self) -> Option<&Session> {
self.session.as_ref()
}
}
| random_line_split |
auth.rs | // Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
use crate::{sleep_with_handle, FailReasonExt, GMsg, RequestExt, Route, SessionExt};
use futures::channel::oneshot;
use iml_wire_types::{EndpointName, Session};
use reg... |
Ok(resp) => {
model.session = Some(resp.data);
if model.session.as_ref().unwrap().needs_login() {
orders.send_g_msg(GMsg::RouteChange(Route::Login.into()));
} else {
orders.send_msg(Msg::Loop);
... | {
log!(format!("Error during session poll: {}", fail_reason.message()));
orders.skip().send_msg(Msg::Loop);
} | conditional_block |
__openerp__.py | # -*- encoding: utf-8 -*-
##############################################################################
# | # it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied ... | # Account Journal Always Check Date module for OpenERP
# Copyright (C) 2013-2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify | random_line_split |
PrimeDual.py | # import os
import random
import torch
import numpy as np
def | (Kx, Kz, N, params, p1, p2, epo, device):
print("use device:", device)
Kx = Kx / N
Kz = Kz / N
Kx = torch.from_numpy(Kx).float().to(device)
Kz = torch.from_numpy(Kz).float().to(device)
m = np.shape(Kx)[0]
n = np.shape(Kz)[0]
F = np.zeros((m,n))
F = torch.from_numpy(F).float().to(device)
Im = np.ones((m,1))
... | cor_pairs_match_Adam | identifier_name |
PrimeDual.py | # import os
import random
import torch
import numpy as np
def cor_pairs_match_Adam(Kx, Kz, N, params, p1, p2, epo, device):
| pho1 = 0.9
pho2 = 0.999
delta = 10e-8
Fst_moment = np.zeros((m,n))
Fst_moment = torch.from_numpy(Fst_moment).float().to(device)
Snd_moment = np.zeros((m,n))
Snd_moment = torch.from_numpy(Snd_moment).float().to(device)
i=0
while(i<params.epoch_pd):
grad = 2*torch.mm(F, torch.mm(Kz, torch.mm(torch.t(F), torch.... | print("use device:", device)
Kx = Kx / N
Kz = Kz / N
Kx = torch.from_numpy(Kx).float().to(device)
Kz = torch.from_numpy(Kz).float().to(device)
m = np.shape(Kx)[0]
n = np.shape(Kz)[0]
F = np.zeros((m,n))
F = torch.from_numpy(F).float().to(device)
Im = np.ones((m,1))
Im = torch.from_numpy(Im).float().to(device... | identifier_body |
PrimeDual.py | # import os
import random
import torch
import numpy as np
def cor_pairs_match_Adam(Kx, Kz, N, params, p1, p2, epo, device):
print("use device:", device)
Kx = Kx / N
Kz = Kz / N
Kx = torch.from_numpy(Kx).float().to(device)
Kz = torch.from_numpy(Kz).float().to(device)
m = np.shape(Kx)[0]
n = np.shape(Kz)[0]
F =... |
return pairs | pairs[i] = np.argsort(F[i])[-1] | conditional_block |
PrimeDual.py | # import os
import random
import torch
import numpy as np
def cor_pairs_match_Adam(Kx, Kz, N, params, p1, p2, epo, device):
print("use device:", device)
Kx = Kx / N
Kz = Kz / N
Kx = torch.from_numpy(Kx).float().to(device)
Kz = torch.from_numpy(Kz).float().to(device)
m = np.shape(Kx)[0]
n = np.shape(Kz)[0] | F = torch.from_numpy(F).float().to(device)
Im = np.ones((m,1))
Im = torch.from_numpy(Im).float().to(device)
In = np.ones((n,1))
In = torch.from_numpy(In).float().to(device)
Lambda = np.zeros((n,1))
Lambda = torch.from_numpy(Lambda).float().to(device)
Mu = np.zeros((m,1))
Mu = torch.from_numpy(Mu).float().to(de... | F = np.zeros((m,n)) | random_line_split |
repack_database.py | License, Version 3 [non-commercial/academic use]
(http://www.gnu.org/copyleft/lgpl.html)
"""
import os
import click
import numpy as np
def maybe_encode(string, encoding='ascii'):
try:
return string.encode(encoding) |
def unroll_and_merge_netcdf4(filenames, output_folder):
"""
Completely unroll and merge both files.
"""
import netCDF4
from scipy.spatial import cKDTree
# Find MZZ, MXX_P_MYY, MXZ_MYZ, MXY_MXX_M_MYY directories
if len(filenames) == 4:
filenames = [os.path.normpath(_i) for _i in fi... | except AttributeError:
return string
except UnicodeEncodeError:
return string
| random_line_split |
repack_database.py | return string
def unroll_and_merge_netcdf4(filenames, output_folder):
"""
Completely unroll and merge both files.
"""
import netCDF4
from scipy.spatial import cKDTree
# Find MZZ, MXX_P_MYY, MXZ_MYZ, MXY_MXX_M_MYY directories
if len(filenames) == 4:
filenames = [os.path.no... | epack_database( | identifier_name | |
repack_database.py | MXX_P_MYY" in _i]
mxz = [_i for _i in filenames if "MXZ_MYZ" in _i]
mxy = [_i for _i in filenames if "MXY_MXX_M_MYY" in _i]
assert len(mzz) == 1
assert len(mxx) == 1
assert len(mxz) == 1
assert len(mxy) == 1
mzz = mzz[0]
mxx = mxx[0]
mxz = mxz[0]
... | ound_filenames = []
for root, _, filenames in os.walk(input_folder, followlinks=True):
for filename in filenames:
if filename != "ordered_output.nc4":
continue
found_filenames.append(os.path.join(root, filename))
assert found_filenames, "No files named `ordered_o... | identifier_body | |
repack_database.py | = [_i for _i in filenames if "MXZ_MYZ" in _i]
mxy = [_i for _i in filenames if "MXY_MXX_M_MYY" in _i]
assert len(mzz) == 1
assert len(mxx) == 1
assert len(mxz) == 1
assert len(mxy) == 1
mzz = mzz[0]
mxx = mxx[0]
mxz = mxz[0]
mxy = mxy[0]
a... | epack_database()
| conditional_block | |
tf-distribution-loader.ts | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | ></paper-icon-button>
</div>
<style>
:host {
display: flex;
flex-direction: column;
width: 330px;
height: 235px;
margin-right: 10px;
margin-bottom: 15px;
}
:host([_expanded]) {
width: 700px;
height: 500px;
}
vz-... | random_line_split | |
tf-distribution-loader.ts | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | (e) {
this.set('_expanded', !this._expanded);
this.redraw();
}
}
| _toggleExpanded | identifier_name |
tf-distribution-loader.ts | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
@computed('run')
get _runColor(): string {
var run = this.run;
return this._colorScale.scale(run);
}
/**
* Ask the distribution chart to redraw itself. This should be
* called whenever the dimensions of the view change (e.g., when
* the card is expanded), as the distribution chart will need ... | {
var run = this.run;
var tag = this.tag;
this.dataToLoad = [{run, tag}];
} | identifier_body |
DataProvider.ts | import 'whatwg-fetch'
import IDataProvider from "./IDataProvider"
import { IPost, IComment } from "../common/ICommonObjects"
export class DataProvider implements IDataProvider {
_loginName: string;
constructor(loginName?: string) {
this._loginName = loginName;
}
public readUserP... | (item: IPost): boolean {
return true;
}
}
export default DataProvider; | updatePost | identifier_name |
DataProvider.ts | import 'whatwg-fetch'
import IDataProvider from "./IDataProvider"
import { IPost, IComment } from "../common/ICommonObjects"
export class DataProvider implements IDataProvider {
_loginName: string;
constructor(loginName?: string) {
this._loginName = loginName;
}
public readUserP... | else {
return Promise.reject(new Error(JSON.stringify(response)));
}
})
.then((data: any) => {
debugger;
let result: IPost[] = [];
console.log(data);
... | {
return response.json();
} | conditional_block |
DataProvider.ts | import 'whatwg-fetch'
import IDataProvider from "./IDataProvider"
import { IPost, IComment } from "../common/ICommonObjects"
export class DataProvider implements IDataProvider {
_loginName: string;
constructor(loginName?: string) {
this._loginName = loginName;
}
public readUserP... | var imageComment = "My perfect day is starting...";
var comments = item.comments;
result.push({
Id: i.toString(),
UserName: item.avatar.name,
... | var imageUrl = item.image;
var imageLocation = "...";
var imageLikes = item.likes + " Likes"; | random_line_split |
generic-function.rs | // Copyright 2013-2014 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-MI... | // gdb-check:$3 = {{1, 2.5}, {2.5, 1}}
// gdb-command:continue
// gdb-command:finish
// gdb-command:print *t0
// gdb-check:$4 = 3.5
// gdb-command:print *t1
// gdb-check:$5 = 4
// gdb-command:print ret
// gdb-check:$6 = {{3.5, 4}, {4, 3.5}}
// gdb-command:continue
// gdb-command:finish
// gdb-command:print *t0
// gdb... | // gdb-command:print *t0
// gdb-check:$1 = 1
// gdb-command:print *t1
// gdb-check:$2 = 2.5
// gdb-command:print ret | random_line_split |
generic-function.rs | // Copyright 2013-2014 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-MI... | () {()}
| zzz | identifier_name |
bin.rs | #[macro_use]
extern crate malachite_base_test_util;
extern crate malachite_nz;
extern crate malachite_nz_test_util;
extern crate serde;
extern crate serde_json;
use demo_and_bench::register;
use generate::digits_data::generate_string_data;
use malachite_base_test_util::runner::cmd::read_command_line_arguments;
use mal... | }
}
mod demo_and_bench;
mod generate;
| {
let args = read_command_line_arguments("malachite-nz test utils");
let mut runner = Runner::new();
register(&mut runner);
if let Some(demo_key) = args.demo_key {
runner.run_demo(&demo_key, args.generation_mode, args.config, args.limit);
} else if let Some(bench_key) = args.bench_key {
... | identifier_body |
bin.rs | #[macro_use]
extern crate malachite_base_test_util;
extern crate malachite_nz;
extern crate malachite_nz_test_util;
extern crate serde;
extern crate serde_json;
use demo_and_bench::register;
use generate::digits_data::generate_string_data;
use malachite_base_test_util::runner::cmd::read_command_line_arguments;
use mal... | () {
let args = read_command_line_arguments("malachite-nz test utils");
let mut runner = Runner::new();
register(&mut runner);
if let Some(demo_key) = args.demo_key {
runner.run_demo(&demo_key, args.generation_mode, args.config, args.limit);
} else if let Some(bench_key) = args.bench_key {
... | main | identifier_name |
bin.rs | #[macro_use]
extern crate malachite_base_test_util;
extern crate malachite_nz;
extern crate malachite_nz_test_util;
extern crate serde;
extern crate serde_json;
use demo_and_bench::register;
use generate::digits_data::generate_string_data;
use malachite_base_test_util::runner::cmd::read_command_line_arguments;
use mal... | let codegen_key = args.codegen_key.unwrap();
match codegen_key.as_str() {
"digits_data" => generate_string_data(),
_ => panic!("Invalid codegen key: {}", codegen_key),
}
}
}
mod demo_and_bench;
mod generate; | random_line_split | |
python_test.js | /* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of so... |
module.exports = {
setUp : function() {
this.mode = new Mode();
},
"test: getTokenizer() (smoke test)" : function() {
var tokenizer = this.mode.getTokenizer();
assert.ok(tokenizer instanceof Tokenizer);
var tokens = tokenizer.getLineTokens("'juhu'", "start").tokens;
... | var Mode = require("./python").Mode;
var assert = require("../test/assertions"); | random_line_split |
python_test.js | /* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of so... |
define(function(require, exports, module) {
"use strict";
var EditSession = require("../edit_session").EditSession;
var Tokenizer = require("../tokenizer").Tokenizer;
var Mode = require("./python").Mode;
var assert = require("../test/assertions");
module.exports = {
setUp : function() {
this.mode = ... | {
require("amd-loader");
} | conditional_block |
heartbeat.py | from __future__ import absolute_import, division
import copy
import time
class Heartbeat(object):
DEFAULT_CONFIG = {
'group_id': None,
'heartbeat_interval_ms': 3000,
'session_timeout_ms': 10000,
'max_poll_interval_ms': 300000,
'retry_backoff_ms': 100,
}
def __init... |
self.last_send = -1 * float('inf')
self.last_receive = -1 * float('inf')
self.last_poll = -1 * float('inf')
self.last_reset = time.time()
self.heartbeat_failed = None
def poll(self):
self.last_poll = time.time()
def sent_heartbeat(self):
self.last_send... | assert (self.config['heartbeat_interval_ms']
<= self.config['session_timeout_ms']), (
'Heartbeat interval must be lower than the session timeout') | conditional_block |
heartbeat.py | from __future__ import absolute_import, division
import copy
import time
class Heartbeat(object):
DEFAULT_CONFIG = {
'group_id': None,
'heartbeat_interval_ms': 3000,
'session_timeout_ms': 10000,
'max_poll_interval_ms': 300000,
'retry_backoff_ms': 100,
}
def __init... |
def session_timeout_expired(self):
last_recv = max(self.last_receive, self.last_reset)
return (time.time() - last_recv) > (self.config['session_timeout_ms'] / 1000)
def reset_timeouts(self):
self.last_reset = time.time()
self.last_poll = time.time()
self.heartbeat_fail... | return self.time_to_next_heartbeat() == 0 | identifier_body |
heartbeat.py | from __future__ import absolute_import, division
import copy
import time
class Heartbeat(object):
DEFAULT_CONFIG = {
'group_id': None,
'heartbeat_interval_ms': 3000,
'session_timeout_ms': 10000,
'max_poll_interval_ms': 300000,
'retry_backoff_ms': 100,
}
def __init... | (self):
return (time.time() - self.last_poll) > (self.config['max_poll_interval_ms'] / 1000)
| poll_timeout_expired | identifier_name |
heartbeat.py | from __future__ import absolute_import, division
import copy
import time
class Heartbeat(object):
DEFAULT_CONFIG = {
'group_id': None,
'heartbeat_interval_ms': 3000,
'session_timeout_ms': 10000,
'max_poll_interval_ms': 300000,
'retry_backoff_ms': 100,
}
def __init... | self.last_send = time.time()
self.heartbeat_failed = False
def fail_heartbeat(self):
self.heartbeat_failed = True
def received_heartbeat(self):
self.last_receive = time.time()
def time_to_next_heartbeat(self):
"""Returns seconds (float) remaining before next heartb... | self.last_poll = time.time()
def sent_heartbeat(self): | random_line_split |
TBinaryProtocol.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | def readMessageBegin(self):
sz = self.readI32()
if sz < 0:
version = sz & TBinaryProtocol.VERSION_MASK
if version != TBinaryProtocol.VERSION_1:
raise TProtocolException(
type=TProtocolException.BAD_VERSION,
message='Bad version in readMessageBegin: %d' % (sz))
typ... | def writeBinary(self, str):
self.writeI32(len(str))
self.trans.write(str)
| random_line_split |
TBinaryProtocol.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | (self):
pass
def writeStructBegin(self, name):
pass
def writeStructEnd(self):
pass
def writeFieldBegin(self, name, type, id):
self.writeByte(type)
self.writeI16(id)
def writeFieldEnd(self):
pass
def writeFieldStop(self):
self.writeByte(TType.STOP)
def writeMapBegin(self, kt... | writeMessageEnd | identifier_name |
TBinaryProtocol.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
def writeStructBegin(self, name):
pass
def writeStructEnd(self):
pass
def writeFieldBegin(self, name, type, id):
self.writeByte(type)
self.writeI16(id)
def writeFieldEnd(self):
pass
def writeFieldStop(self):
self.writeByte(TType.STOP)
def writeMapBegin(self, ktype, vtype, size... | pass | identifier_body |
TBinaryProtocol.py | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
return True
def readByte(self):
buff = self.trans.readAll(1)
val, = unpack('!b', buff)
return val
def readI16(self):
buff = self.trans.readAll(2)
val, = unpack('!h', buff)
return val
def readI32(self):
buff = self.trans.readAll(4)
val, = unpack('!i', buff)
return val
... | return False | conditional_block |
custom.js | // Jquery with no conflict
jQuery(document).ready(function($) {
// Datepicker
$('#datepicker').datepicker({
inline: true
});
// Clock Start
setInterval( function() {
var seconds = new Date().getSeconds();
var sdegree = seconds * 6;
var srotate = "rotate(" + sdegree + "deg)";
$("#sec").css({"-moz-tr... |
if($cats.length = 2) {
// Slug name
$cat = $cats[1]
if ($cat != null) {
$cat = $cat.replace(/\//g, "");
}
switch($cat) {
case "branch": $this.children('span').addClass("fa-th");
break;
case "hiring": $this.children('span').addClass("fa-star"); //CatID: 3: hiring
break;
case "... | {
$cats = $this.attr('href').split("com/");
} | conditional_block |
custom.js | // Jquery with no conflict
jQuery(document).ready(function($) {
// Datepicker
$('#datepicker').datepicker({
inline: true
});
// Clock Start
setInterval( function() {
var seconds = new Date().getSeconds();
var sdegree = seconds * 6;
var srotate = "rotate(" + sdegree + "deg)";
$("#sec").css({"-moz-tr... | setInterval( function() {
var mins = new Date().getMinutes();
var mdegree = mins * 6;
var mrotate = "rotate(" + mdegree + "deg)";
$("#min").css({"-moz-transform" : mrotate, "-webkit-transform" : mrotate});
}, 1000 );
// Clock END
// Sidebar - THONG TIN XA HOI
// Add new target for linking ... | random_line_split | |
intron_exon_reads.py | #!/usr/bin/python
"""
Example from pybedtools documentation (:ref:`third example`) to count \
reads in introns and exons using multiple CPUs.
"""
from __future__ import print_function
import pybedtools
import argparse
import os
import sys
import multiprocessing
def featuretype_filter(feature, featuretype):
"""
... | # processes.
pool = multiprocessing.Pool(processes=3)
# Get separate files for introns and exons in parallel (if specified)
featuretypes = ('intron', 'exon')
introns, exons = pool.map(subset_featuretypes, featuretypes)
# Perform some genome algebra to get unique and shared regions
exon_onl... | random_line_split | |
intron_exon_reads.py | #!/usr/bin/python
"""
Example from pybedtools documentation (:ref:`third example`) to count \
reads in introns and exons using multiple CPUs.
"""
from __future__ import print_function
import pybedtools
import argparse
import os
import sys
import multiprocessing
def featuretype_filter(feature, featuretype):
"""
... | (features):
"""
Callback function to count reads in features
"""
return features.intersect(abam=bam,
b=features.fn,
s=stranded,
bed=True,
stream=True).count()
def main():
"""
Thi... | count_reads_in_features | identifier_name |
intron_exon_reads.py | #!/usr/bin/python
"""
Example from pybedtools documentation (:ref:`third example`) to count \
reads in introns and exons using multiple CPUs.
"""
from __future__ import print_function
import pybedtools
import argparse
import os
import sys
import multiprocessing
def featuretype_filter(feature, featuretype):
"""
... |
return False
def subset_featuretypes(featuretype):
return g.filter(featuretype_filter, featuretype).saveas()
def count_reads_in_features(features):
"""
Callback function to count reads in features
"""
return features.intersect(abam=bam,
b=features.fn,
... | return True | conditional_block |
intron_exon_reads.py | #!/usr/bin/python
"""
Example from pybedtools documentation (:ref:`third example`) to count \
reads in introns and exons using multiple CPUs.
"""
from __future__ import print_function
import pybedtools
import argparse
import os
import sys
import multiprocessing
def featuretype_filter(feature, featuretype):
|
def subset_featuretypes(featuretype):
return g.filter(featuretype_filter, featuretype).saveas()
def count_reads_in_features(features):
"""
Callback function to count reads in features
"""
return features.intersect(abam=bam,
b=features.fn,
... | """
Only passes features with the specified *featuretype*
"""
if feature[2] == featuretype:
return True
return False | identifier_body |
translation_de.js | = {};
Signavio.I18N.Repository.Log.ERROR = "FEHLER";
Signavio.I18N.Repository.Log.CRITICAL = "KRITISCH";
Signavio.I18N.Repository.Log.FATAL = "FATAL";
Signavio.I18N.Repository.Log.LOG = "Log";
Signavio.I18N.Repository.loadingFailed = "Die Anwendung konnte nicht geladen werden. Bitte überprüfen Sie ihre Internetverbin... | Signavio.I18N.Repository.TableView.revision = "Revision";
Signavio.I18N.Repository.TableView.lastChanges = "Letzte Änderung";
Signavio.I18N.Repository.TableView.lastAuthor = "Letzter Autor";
Signavio.I18N.Repository.TableView.tooltip = "Listenansicht";
// DELETE
Signavio.I18N.Repository.Offer.deleteTitle = "Löschen";
... | Signavio.I18N.Repository.TableView.description = "Beschreibung"; | random_line_split |
types.rs | use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use std::str::SplitWhitespace;
pub type Params<'a> = SplitWhitespace<'a>;
pub type Flag = Arc<AtomicBool>;
pub const BK_CASTLE: u8 = 1;
pub const WK_CASTLE: u8 = BK_CASTLE << WHITE;
pub const BQ_CASTLE: u8 = 1 << 2;
pub const WQ_CASTLE: u8 = BQ_CASTLE << WHITE;
... |
pub const PVALS: [u32; 12] = [1000, 1000,
4126, 4126,
4222, 4222,
6414, 6414,
12730, 12730,
300000, 300000];
pub fn p_val(piece: u8) -> u32 {
match piece {
... | {
c ^ WHITE
} | identifier_body |
types.rs | use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use std::str::SplitWhitespace;
pub type Params<'a> = SplitWhitespace<'a>;
pub type Flag = Arc<AtomicBool>;
pub const BK_CASTLE: u8 = 1;
pub const WK_CASTLE: u8 = BK_CASTLE << WHITE;
pub const BQ_CASTLE: u8 = 1 << 2;
pub const WQ_CASTLE: u8 = BQ_CASTLE << WHITE;
... | (c: u8) -> u8 {
c ^ WHITE
}
pub const PVALS: [u32; 12] = [1000, 1000,
4126, 4126,
4222, 4222,
6414, 6414,
12730, 12730,
300000, 300000];
pub fn p_val(piece: u8) -> ... | flip | identifier_name |
types.rs | use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use std::str::SplitWhitespace;
pub type Params<'a> = SplitWhitespace<'a>;
pub type Flag = Arc<AtomicBool>;
pub const BK_CASTLE: u8 = 1;
pub const WK_CASTLE: u8 = BK_CASTLE << WHITE;
pub const BQ_CASTLE: u8 = 1 << 2;
pub const WQ_CASTLE: u8 = BQ_CASTLE << WHITE;
... |
pub const PVALS: [u32; 12] = [1000, 1000,
4126, 4126,
4222, 4222,
6414, 6414,
12730, 12730,
300000, 300000];
pub fn p_val(piece: u8) -> u32 {
match piece {
... | random_line_split | |
server.js | /* eslint no-console:0 */
var Hapi = require('hapi'),
Path = require('path'),
Swig = require('swig'),
Routes = require('./routes');
Swig.setDefaults({ cache: false });
var server = new Hapi.Server();
server.connection({ port: 3000 });
server.views({
engines: { swig: Swig },
path: Path.joi... | server.route({ method: 'GET', path: '/keys', handler: Routes.keys });
server.route({ method: 'GET', path: '/angular', handler: Routes.angular });
server.route({ method: 'GET', path: '/pace', handler: Routes.pace });
server.route({ method: 'GET', path: '/pace-theme-... | server.route({ method: 'GET', path: '/', handler: Routes.index });
server.route({ method: 'GET', path: '/action', handler: Routes.action });
server.route({ method: 'GET', path: '/responsive', handler: Routes.responsive});
server.route({ method: 'GET', path: '/form', ... | random_line_split |
getComponents.ts | import type { Prng } from '@dicebear/core';
import type { Options } from '../options';
import type { ComponentPickCollection } from '../static-types';
import { pickComponent } from './pickComponent';
type Props = {
prng: Prng;
options: Options;
};
export function getComponents({
prng,
options,
}: Props): Comp... | });
return {
eyes: eyesComponent,
eyebrows: eyebrowsComponent,
mouth: mouthComponent,
accessoires: prng.bool(options.accessoiresProbability)
? accessoiresComponent
: undefined,
};
}
| {
const eyesComponent = pickComponent({
prng,
group: 'eyes',
values: options.eyes,
});
const eyebrowsComponent = pickComponent({
prng,
group: 'eyebrows',
values: options.eyebrows,
});
const mouthComponent = pickComponent({
prng,
group: 'mouth',
values: options.mouth,
});
... | identifier_body |
getComponents.ts | import type { Prng } from '@dicebear/core';
import type { Options } from '../options'; | prng: Prng;
options: Options;
};
export function getComponents({
prng,
options,
}: Props): ComponentPickCollection {
const eyesComponent = pickComponent({
prng,
group: 'eyes',
values: options.eyes,
});
const eyebrowsComponent = pickComponent({
prng,
group: 'eyebrows',
values: opti... | import type { ComponentPickCollection } from '../static-types';
import { pickComponent } from './pickComponent';
type Props = { | random_line_split |
getComponents.ts | import type { Prng } from '@dicebear/core';
import type { Options } from '../options';
import type { ComponentPickCollection } from '../static-types';
import { pickComponent } from './pickComponent';
type Props = {
prng: Prng;
options: Options;
};
export function | ({
prng,
options,
}: Props): ComponentPickCollection {
const eyesComponent = pickComponent({
prng,
group: 'eyes',
values: options.eyes,
});
const eyebrowsComponent = pickComponent({
prng,
group: 'eyebrows',
values: options.eyebrows,
});
const mouthComponent = pickComponent({
pr... | getComponents | identifier_name |
dig.py | # coding=utf-8
#
# Copyright 2016 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | per(Dig, self).__init__(util)
self._meta_data['required_command_parameters'].update(('utilCmdArgs',))
self._meta_data['required_json_kind'] = 'tm:util:dig:runstate'
self._meta_data['allowed_commands'].append('run')
| identifier_body |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.