file_name large_stringlengths 4 140 | prefix large_stringlengths 0 39k | suffix large_stringlengths 0 36.1k | middle large_stringlengths 0 29.4k | fim_type large_stringclasses 4
values |
|---|---|---|---|---|
issue-15381.rs | // Copyright 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-MIT or ... | () {
let values: Vec<u8> = vec![1,2,3,4,5,6,7,8];
for
[x,y,z]
//~^ ERROR refutable pattern in `for` loop binding: `[]` not covered
in values.as_slice().chunks(3).filter(|&xs| xs.len() == 3) {
println!("y={}", y);
}
}
| main | identifier_name |
issue-15381.rs | // Copyright 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-MIT or ... | println!("y={}", y);
}
} |
for
[x,y,z]
//~^ ERROR refutable pattern in `for` loop binding: `[]` not covered
in values.as_slice().chunks(3).filter(|&xs| xs.len() == 3) { | random_line_split |
__init__.py | # Copyright 2014 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... | resolver=resolvers.FromProperty(properties.VALUES.core.project))
# TODO(user): remove command dependence on these.
context[BIGQUERY_MESSAGES_MODULE_KEY] = apis.GetMessagesModule(
'bigquery', 'v2')
context[APITOOLS_CLIENT_KEY] = apis.GetClientInstance(
'bigquery', 'v2', http=self.Htt... | random_line_split | |
__init__.py | # Copyright 2014 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... | (parser):
parser.add_argument(
'--fingerprint-job-id',
action='store_true',
help='Whether to use a job id that is derived from a fingerprint of '
'the job configuration.')
| Args | identifier_name |
__init__.py | # Copyright 2014 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... |
@staticmethod
def Args(parser):
parser.add_argument(
'--fingerprint-job-id',
action='store_true',
help='Whether to use a job id that is derived from a fingerprint of '
'the job configuration.')
| """Initialize context for bigquery commands.
Args:
context: The current context.
args: The argparse namespace that was specified on the CLI or API.
Returns:
The updated context.
"""
resources.SetParamDefault(
api='bigquery', collection=None, param='projectId',
resolve... | identifier_body |
jquery.bbq.d.ts | // Type definitions for jquery.bbq 1.2
// Project: http://benalman.com/projects/jquery-bbq-plugin/
// Definitions by: Adam R. Smith <https://github.com/sunetos>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
declare namespace JQueryBbq {
interfac... | * @name key An optional state key for which to return a value.
* @name coerce If true, coerces any numbers or true, false, null, and undefined to their actual value. Defaults to false
*/
getState(key?: string, coerce?: boolean): any;
getState(coerce?: boolean): any;
/**... | * entire state, optionally coercing numbers, booleans, null and undefined
* values.
* | random_line_split |
mod.rs | pub use self::manager::ContextManager;
pub use self::manager::ViewContext;
pub use self::manager::ViewContextMut;
mod manager;
//mod proxies;
//use mopa;
use std::collections::HashMap;
use store::StoreValueStatic;
use {
Store,
StoreValue,
AttributeGetResult,
AttributeMutResult,
AttributeSetResult
... | }
} |
fn get_store_mut(&mut self, key: String) -> Option<&mut Box<Store + 'static>> {
self.stores.get_mut(&key) | random_line_split |
mod.rs | pub use self::manager::ContextManager;
pub use self::manager::ViewContext;
pub use self::manager::ViewContextMut;
mod manager;
//mod proxies;
//use mopa;
use std::collections::HashMap;
use store::StoreValueStatic;
use {
Store,
StoreValue,
AttributeGetResult,
AttributeMutResult,
AttributeSetResult
... |
}
// Context implementation
impl Context for AmbientModel {
fn register_value<V: Into<StoreValueStatic>>(&mut self, key: String, value: V) {
self.values.insert(key, value.into());
}
fn register_store<S: Store + 'static>(&mut self, key: String, store: S) {
self.stores.insert(key, Box::new... | {
match self.stores.set_attribute(k.clone(), value) {
AttributeSetResult::NoSuchProperty(v) => {
self.values.set_attribute(k, v)
}
_ => AttributeSetResult::Stored
}
} | identifier_body |
mod.rs | pub use self::manager::ContextManager;
pub use self::manager::ViewContext;
pub use self::manager::ViewContextMut;
mod manager;
//mod proxies;
//use mopa;
use std::collections::HashMap;
use store::StoreValueStatic;
use {
Store,
StoreValue,
AttributeGetResult,
AttributeMutResult,
AttributeSetResult
... | <S: Store + 'static>(&mut self, key: String, store: S) {
self.stores.insert(key, Box::new(store) as Box<Store>);
}
fn get_store_mut(&mut self, key: String) -> Option<&mut Box<Store + 'static>> {
self.stores.get_mut(&key)
}
}
| register_store | identifier_name |
ext-lang-pt_PT.js | /*!
* Extensible 1.6.0-rc.1
* Copyright(c) 2010-2013 Extensible, LLC
* licensing@ext.ensible.com
* http://ext.ensible.com
*/
/**
* Portuguese/Portugal (pt_PT) Translation
* by Nuno Franco da Costa - francodacosta.com
* translated from ext-lang-en.js
*/
Ext.onReady(function() {
var cm = Ext.ClassManager,
... | "Abril",
"Maio",
"Junho",
"Julho",
"Agosto",
"Setembro",
"Outubro",
"Novembro",
"Dezembro"
];
Ext.Date.getShortMonthName = function(month) {
return Ext.Date.monthNames[month].substring(0, 3);
};
... | "Fevereiro",
"Março", | random_line_split |
ext-lang-pt_PT.js | /*!
* Extensible 1.6.0-rc.1
* Copyright(c) 2010-2013 Extensible, LLC
* licensing@ext.ensible.com
* http://ext.ensible.com
*/
/**
* Portuguese/Portugal (pt_PT) Translation
* by Nuno Franco da Costa - francodacosta.com
* translated from ext-lang-en.js
*/
Ext.onReady(function() {
var cm = Ext.ClassManager,
... |
if(Ext.Date) {
Ext.Date.monthNames = [
"Janeiro",
"Fevereiro",
"Março",
"Abril",
"Maio",
"Junho",
"Julho",
"Agosto",
"Setembro",
"Outubro",
"Novembro",
"Dezembro"
];
... | {
Ext.LoadMask.prototype.msg = "A carregar...";
} | conditional_block |
ConvergencePlot.py | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
import matp... | (self, title):
self._axes.set_title(title)
def _fit(self, x, y):
"""
Apply the fit and report the slope.
Key, value Options:
x[float]: The x-position in data coordinates.
y[float]: The y-position in data coordinates.
"""
# Perform fit
co... | set_title | identifier_name |
ConvergencePlot.py | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
import matp... |
def plot(self, df, label=None, title=None, num_fitted_points=None, slope_precision=3, **kwargs):
num_y_columns = len(df.columns) - 1
if label:
if num_y_columns > 1:
if not isinstance(label, list):
raise TypeError("For multiple y-data label must be a... | self._figure = plt.figure(figsize=(10,6), facecolor='w')
self._axes = plt.gca()
self._axes.set_yscale('log')
self._axes.set_xscale('log')
# Add axis labels
plt.xlabel(xlabel, fontsize=fontsize)
plt.ylabel(ylabel, fontsize=fontsize)
# Adjust tick mark fonts
... | identifier_body |
ConvergencePlot.py | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
import matp... |
# Apply grid marks
plt.grid(True, which='both', color=[0.8]*3)
self.label_to_slope = {}
self.label_to_intercept = {}
def plot(self, df, label=None, title=None, num_fitted_points=None, slope_precision=3, **kwargs):
num_y_columns = len(df.columns) - 1
if label:
... | tick.label.set_fontsize(fontsize) | conditional_block |
ConvergencePlot.py | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
import matp... | Display the plot.
"""
plt.show() | random_line_split | |
Gruntfile.js | /**
* @file
*/
module.exports = function(grunt) {
// This is where we configure each task that we'd like to run.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
// This is where we set up all the tasks we'd like grunt to watch for changes.
images: {
files: ['**/*... | 'css/layout.css': 'scss/layout/layout.scss',
'css/states.css': 'scss/states/states.scss',
'css/theme.css': 'scss/theme/theme.scss',
'css/print.css': 'scss/theme/print.scss'
}
}
},
drush: {
ccall: {
... | dist: {
files: {
// Compiled styles.
'css/components.css': 'scss/components/components.scss', | random_line_split |
__init__.py | # Copyright (C) 2021 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ycmd... |
return Wrapper
def IsolatedYcmd( custom_options = {} ):
def Decorator( test ):
@functools.wraps( test )
def Wrapper( test_case_instance, *args, **kwargs ):
with IsolatedApp( custom_options ) as app:
try:
test( test_case_instance, app, *args, **kwargs )
finally:
g... | ClearCompletionsCache()
with IgnoreExtraConfOutsideTestsFolder():
return test( test_case_instance, shared_app, *args, **kwargs ) | identifier_body |
__init__.py | # Copyright (C) 2021 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ycmd... | ( app, filepath ):
request_data = BuildRequest( filetype = 'cs', filepath = filepath )
return app.post_json( '/debug_info', request_data ).json
def ReadFile( filepath, fileposition ):
with open( filepath, encoding = 'utf8' ) as f:
if fileposition:
f.seek( fileposition )
return f.read(), f.tell()
... | GetDebugInfo | identifier_name |
__init__.py | # Copyright (C) 2021 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ycmd... |
return Wrapper
return Decorator
def GetDebugInfo( app, filepath ):
request_data = BuildRequest( filetype = 'cs', filepath = filepath )
return app.post_json( '/debug_info', request_data ).json
def ReadFile( filepath, fileposition ):
with open( filepath, encoding = 'utf8' ) as f:
if fileposition:
... | StopCompleterServer( app, 'cs', filepath ) | conditional_block |
__init__.py | # Copyright (C) 2021 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ycmd... | # GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ycmd. If not, see <http://www.gnu.org/licenses/>.
import functools
import os
import sys
import time
from contextlib import contextmanager
from ycmd.tests.test_utils import ( BuildRequest,
... | random_line_split | |
object.rs | use std::sync::Arc;
use ::types::{Vec3f, Mat4f};
use ::Material;
use ::ray::Ray;
pub struct | {
ray: Ray, // Ray that intersected
pub time: f64,
normal: Vec3f,
object: Arc<Object>
}
pub struct ObjectData {
// texture
transformation: Mat4f,
inv_trans: Mat4f
}
pub trait Object {
/// Return whether ray intersected object
fn intersection(&self, ray: &Ray) -> Opt... | Intersection | identifier_name |
object.rs | use std::sync::Arc;
use ::types::{Vec3f, Mat4f};
use ::Material;
use ::ray::Ray;
pub struct Intersection {
ray: Ray, // Ray that intersected
pub time: f64,
normal: Vec3f,
object: Arc<Object>
}
pub struct ObjectData {
// texture
transformation: Mat4f,
inv_trans: Mat4f
}
pub... | // fn children
// pre computed
// trans_inverse
// aabb
} | random_line_split | |
BaseBuildTriggerTemplate.tsx | import React from 'react';
import { capitalize, get } from 'lodash';
import { Option } from 'react-select';
import { $q } from 'ngimport';
import { IPromise } from 'angular';
import { Observable, Subject } from 'rxjs';
import { IBuild, IBuildInfo, IBuildTrigger, IPipelineCommand } from 'core/domain';
import { ITrigg... |
// do not re-initialize if the trigger has changed to some other type
if (trigger.type !== this.props.buildTriggerType) {
return;
}
Observable.fromPromise(IgorService.listBuildsForJob(trigger.master, trigger.job))
.takeUntil(this.destroy$)
.subscribe(this.buildLoadSuccess, this.buil... | {
this.updateSelectedBuild(trigger.buildInfo);
} | conditional_block |
BaseBuildTriggerTemplate.tsx | import React from 'react';
import { capitalize, get } from 'lodash';
import { Option } from 'react-select';
import { $q } from 'ngimport';
import { IPromise } from 'angular';
import { Observable, Subject } from 'rxjs';
import { IBuild, IBuildInfo, IBuildTrigger, IPipelineCommand } from 'core/domain';
import { ITrigg... | });
};
private updateSelectedBuild = (item: any) => {
const { updateCommand } = this.props;
updateCommand('extraFields.buildNumber', item.number);
this.setState({ selectedBuild: item.number });
};
private initialize = (command: IPipelineCommand) => {
this.props.updateCommand('triggerInvali... | buildsLoading: false,
loadError: true, | random_line_split |
BaseBuildTriggerTemplate.tsx | import React from 'react';
import { capitalize, get } from 'lodash';
import { Option } from 'react-select';
import { $q } from 'ngimport';
import { IPromise } from 'angular';
import { Observable, Subject } from 'rxjs';
import { IBuild, IBuildInfo, IBuildTrigger, IPipelineCommand } from 'core/domain';
import { ITrigg... |
public componentWillUnmount(): void {
this.destroy$.next();
}
private handleBuildChanged = (option: Option): void => {
this.updateSelectedBuild({ number: option.number });
};
private optionRenderer = (build: Option) => {
return (
<span style={{ fontSize: '13px' }}>
<strong>Build ... | {
this.initialize(this.props.command);
} | identifier_body |
BaseBuildTriggerTemplate.tsx | import React from 'react';
import { capitalize, get } from 'lodash';
import { Option } from 'react-select';
import { $q } from 'ngimport';
import { IPromise } from 'angular';
import { Observable, Subject } from 'rxjs';
import { IBuild, IBuildInfo, IBuildTrigger, IPipelineCommand } from 'core/domain';
import { ITrigg... | () {
this.initialize(this.props.command);
}
public componentWillUnmount(): void {
this.destroy$.next();
}
private handleBuildChanged = (option: Option): void => {
this.updateSelectedBuild({ number: option.number });
};
private optionRenderer = (build: Option) => {
return (
<span sty... | componentDidMount | identifier_name |
settings.py | # Django settings for mcjsms project.
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
ADMINS = []
MANAGERS = ADMINS
if DEBUG:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql',... | # Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
if DEBUG:
STATIC_ROOT = os.path.join(SITE_ROOT, 'static')
else:
STATIC_ROOT = '/home/ramisayar/public/mcj/mcj2011/static/'
# ... | # trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '/site_media/'
# Absolute path to the directory static files should be collected to. | random_line_split |
settings.py | # Django settings for mcjsms project.
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
ADMINS = []
MANAGERS = ADMINS
if DEBUG:
|
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'mcj_sms', # Or path to database file if using sqlite3.
'USER': 'mcj_sms', ... | DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': os.path.join(SITE_ROOT, 'data/dev.sqlite'), # Or path to database file if using sqlite3.
'USER': '', ... | conditional_block |
test_notifications.py | """Integration test for Notifications."""
import github3
from .helper import IntegrationHelper
class TestThread(IntegrationHelper):
"""Integration test for methods on Test class"""
def test_subscription(self):
"""Show that a user can retrieve notifications for repository"""
self.token_login(... | (self):
"""Show that user can successful set subscription"""
self.token_login()
cassette_name = self.cassette_name("set")
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository('sigmavirus24', 'github3.py')
threads = list(repository.notifi... | test_set | identifier_name |
test_notifications.py | """Integration test for Notifications."""
import github3
from .helper import IntegrationHelper
class TestThread(IntegrationHelper):
"""Integration test for methods on Test class"""
def test_subscription(self):
"""Show that a user can retrieve notifications for repository"""
self.token_login(... | """Show that user can successful set subscription"""
self.token_login()
cassette_name = self.cassette_name("set")
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository('sigmavirus24', 'github3.py')
threads = list(repository.notifications(all='tru... | identifier_body | |
test_notifications.py | """Integration test for Notifications."""
import github3
from .helper import IntegrationHelper
class TestThread(IntegrationHelper):
"""Integration test for methods on Test class"""
def test_subscription(self):
"""Show that a user can retrieve notifications for repository"""
self.token_login(... | assert len(threads) > 0
thread = threads[0]
assert isinstance(thread, github3.notifications.Thread)
assert isinstance(thread.subscription(),
github3.notifications.Subscription)
class TestSubscription(IntegrationHelper):
"""Integration ... | cassette_name = self.cassette_name("subscription")
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository('sigmavirus24', 'github3.py')
threads = list(repository.notifications(all=True)) | random_line_split |
unit-test.js | var page = require('webpage').create();
var url;
if (phantom.args) {
url = phantom.args[0];
} else {
url = require('system').args[1];
}
page.onConsoleMessage = function (message) {
console.log(message);
};
function exit(code) |
console.log("Loading URL: " + url);
page.open(url, function (status) {
if (status != "success") {
console.log('Failed to open ' + url);
phantom.exit(1);
}
console.log("Running test.");
var result = page.evaluate(function() {
return chess_game.test_runner.runner();
});
if (result != 0) {
... | {
setTimeout(function(){ phantom.exit(code); }, 0);
phantom.onError = function(){};
} | identifier_body |
unit-test.js | var page = require('webpage').create();
var url;
if (phantom.args) {
url = phantom.args[0];
} else {
url = require('system').args[1];
}
page.onConsoleMessage = function (message) {
console.log(message);
};
function | (code) {
setTimeout(function(){ phantom.exit(code); }, 0);
phantom.onError = function(){};
}
console.log("Loading URL: " + url);
page.open(url, function (status) {
if (status != "success") {
console.log('Failed to open ' + url);
phantom.exit(1);
}
console.log("Running test.");
var result = page.... | exit | identifier_name |
unit-test.js | var page = require('webpage').create();
var url;
if (phantom.args) {
url = phantom.args[0];
} else {
url = require('system').args[1];
}
page.onConsoleMessage = function (message) {
console.log(message);
};
function exit(code) {
setTimeout(function(){ phantom.exit(code); }, 0);
phantom.onError = function(){... |
else {
console.log("Test succeeded.");
exit(0);
}
});
| {
console.log("*** Test failed! ***");
exit(1);
} | conditional_block |
unit-test.js | var page = require('webpage').create();
var url;
if (phantom.args) {
url = phantom.args[0];
} else {
url = require('system').args[1];
}
page.onConsoleMessage = function (message) {
console.log(message);
};
function exit(code) { |
console.log("Loading URL: " + url);
page.open(url, function (status) {
if (status != "success") {
console.log('Failed to open ' + url);
phantom.exit(1);
}
console.log("Running test.");
var result = page.evaluate(function() {
return chess_game.test_runner.runner();
});
if (result != 0) {
... | setTimeout(function(){ phantom.exit(code); }, 0);
phantom.onError = function(){};
} | random_line_split |
render.ts | import global from 'global';
import dedent from 'ts-dedent';
import { RenderContext, ElementArgs, OptionsArgs } from './types';
const { window: globalWindow, document } = global;
declare let Ember: any;
const rootEl = document.getElementById('root');
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAM... | (options: OptionsArgs, el: ElementArgs) {
if (isRendering) return;
isRendering = true;
const { template, context = {}, element } = options;
if (hasRendered) {
lastPromise = lastPromise.then((instance: any) => instance.destroy());
}
lastPromise = lastPromise
.then(() => {
const appInstancePr... | render | identifier_name |
render.ts | import global from 'global';
import dedent from 'ts-dedent';
import { RenderContext, ElementArgs, OptionsArgs } from './types';
const { window: globalWindow, document } = global;
declare let Ember: any;
const rootEl = document.getElementById('root');
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAM... |
lastPromise = lastPromise
.then(() => {
const appInstancePrivate = app.buildInstance();
return appInstancePrivate.boot().then(() => appInstancePrivate);
})
.then((instance: any) => {
instance.register(
'component:story-mode',
Ember.Component.extend({
layout: t... | {
lastPromise = lastPromise.then((instance: any) => instance.destroy());
} | conditional_block |
render.ts | import global from 'global';
import dedent from 'ts-dedent';
import { RenderContext, ElementArgs, OptionsArgs } from './types';
const { window: globalWindow, document } = global;
declare let Ember: any;
const rootEl = document.getElementById('root');
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAM... |
if (element) {
component.appendTo(element);
element.appendTo(el);
} else {
component.appendTo(el);
}
hasRendered = true;
isRendering = false;
return instance;
});
}
export default function renderMain({ storyFn, kind, name, showMain, showError }: Render... | );
const component = instance.lookup('component:story-mode'); | random_line_split |
render.ts | import global from 'global';
import dedent from 'ts-dedent';
import { RenderContext, ElementArgs, OptionsArgs } from './types';
const { window: globalWindow, document } = global;
declare let Ember: any;
const rootEl = document.getElementById('root');
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAM... | {
const element = storyFn();
if (!element) {
showError({
title: `Expecting a Ember element from the story: "${name}" of "${kind}".`,
description: dedent`
Did you forget to return the Ember element from the story?
Use "() => hbs('{{component}}')" or "() => { return {
templa... | identifier_body | |
grabbing.rs | #[cfg(target_os = "android")]
#[macro_use]
extern crate android_glue;
extern crate glutin;
use glutin::{Event, ElementState};
mod support;
#[cfg(target_os = "android")]
android_start!(main);
fn main() {
let window = glutin::WindowBuilder::new().build().unwrap();
window.set_title("glutin - Cursor grabbing t... | else {
grabbed = true;
window.set_cursor_state(glutin::CursorState::Grab)
.ok().expect("could not grab mouse cursor");
}
},
Event::Closed => break,
a @ Event::MouseMoved(_, _) => {
pr... | {
grabbed = false;
window.set_cursor_state(glutin::CursorState::Normal)
.ok().expect("could not ungrab mouse cursor");
} | conditional_block |
grabbing.rs | #[cfg(target_os = "android")]
#[macro_use]
extern crate android_glue;
extern crate glutin;
use glutin::{Event, ElementState};
mod support;
#[cfg(target_os = "android")] | window.set_title("glutin - Cursor grabbing test");
let _ = unsafe { window.make_current() };
let context = support::load(&window);
let mut grabbed = false;
for event in window.wait_events() {
match event {
Event::KeyboardInput(ElementState::Pressed, _, _) => {
i... | android_start!(main);
fn main() {
let window = glutin::WindowBuilder::new().build().unwrap(); | random_line_split |
grabbing.rs | #[cfg(target_os = "android")]
#[macro_use]
extern crate android_glue;
extern crate glutin;
use glutin::{Event, ElementState};
mod support;
#[cfg(target_os = "android")]
android_start!(main);
fn main() | {
let window = glutin::WindowBuilder::new().build().unwrap();
window.set_title("glutin - Cursor grabbing test");
let _ = unsafe { window.make_current() };
let context = support::load(&window);
let mut grabbed = false;
for event in window.wait_events() {
match event {
Event:... | identifier_body | |
grabbing.rs | #[cfg(target_os = "android")]
#[macro_use]
extern crate android_glue;
extern crate glutin;
use glutin::{Event, ElementState};
mod support;
#[cfg(target_os = "android")]
android_start!(main);
fn | () {
let window = glutin::WindowBuilder::new().build().unwrap();
window.set_title("glutin - Cursor grabbing test");
let _ = unsafe { window.make_current() };
let context = support::load(&window);
let mut grabbed = false;
for event in window.wait_events() {
match event {
Eve... | main | identifier_name |
Util.py | # encoding: utf-8
import sys
import os
import signal
from openpyxl.utils import get_column_letter
from openpyxl import Workbook,load_workbook
ItemList=[]
## {{{ http://code.activestate.com/recipes/410692/ (r8)
# This class provides the functionality we want. You only need to look at
# this if you want to know how thi... |
def __iter__(self):
"""Return the match method once, then stop"""
yield self.match
raise StopIteration
def match(self, *args):
"""Indicate whether or not to enter a case suite"""
if self.fall or not args:
return True
elif self.value in args: # ... | self.value = value
self.fall = False | random_line_split |
Util.py | # encoding: utf-8
import sys
import os
import signal
from openpyxl.utils import get_column_letter
from openpyxl import Workbook,load_workbook
ItemList=[]
## {{{ http://code.activestate.com/recipes/410692/ (r8)
# This class provides the functionality we want. You only need to look at
# this if you want to know how thi... |
elif self.value in args: # changed for v1.5, see below
self.fall = True
return True
else:
return False
class Items:
def __init__(self, BallName,GPIO):
self.BallName = BallName
self.GPIO = GPIO
self.NetName = None
self.Direction = None
self.Data = None
... | return True | conditional_block |
Util.py | # encoding: utf-8
import sys
import os
import signal
from openpyxl.utils import get_column_letter
from openpyxl import Workbook,load_workbook
ItemList=[]
## {{{ http://code.activestate.com/recipes/410692/ (r8)
# This class provides the functionality we want. You only need to look at
# this if you want to know how thi... |
def match(self, *args):
"""Indicate whether or not to enter a case suite"""
if self.fall or not args:
return True
elif self.value in args: # changed for v1.5, see below
self.fall = True
return True
else:
return False
class It... | """Return the match method once, then stop"""
yield self.match
raise StopIteration | identifier_body |
Util.py | # encoding: utf-8
import sys
import os
import signal
from openpyxl.utils import get_column_letter
from openpyxl import Workbook,load_workbook
ItemList=[]
## {{{ http://code.activestate.com/recipes/410692/ (r8)
# This class provides the functionality we want. You only need to look at
# this if you want to know how thi... | ():
for item in ItemList:
if item.NetName is None:
item.set_NetName("NOT_CONNECT_"+item.GPIO[4:])
def PrintItemList():
for item in ItemList:
print (xstr(item.BallName)+" "+xstr(item.GPIO)+" "+xstr(item.Position)+" "+xstr(item.NetName))
| CheckEmptyNetName | identifier_name |
CargadePanos.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Carga de paños.py
#
# Copyright 2013 Akoharowen <alejandrofabrega@ingenieriapesquera.com.ar>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundat... | ""
autor=""
descred=""
while nombre=="":
nombre=raw_input("Nombre de la Red: ") #Alfa
while autor=="":
autor=raw_input("Autor: ") #Alfa
while descred=="":
descred=raw_input("Descripcion de la Red: ") #Alfa
archivo=open(nombre+".red","w")
datosred=str([nombre,autor,descred])
#print datosred
archivo.write... | identifier_body | |
CargadePanos.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Carga de paños.py
#
# Copyright 2013 Akoharowen <alejandrofabrega@ingenieriapesquera.com.ar>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundat... | arga de Datos de cabecera de Red
nombre=""
autor=""
descred=""
while nombre=="":
nombre=raw_input("Nombre de la Red: ") #Alfa
while autor=="":
autor=raw_input("Autor: ") #Alfa
while descred=="":
descred=raw_input("Descripcion de la Red: ") #Alfa
archivo=open(nombre+".red","w")
datosred=str([nombre,autor,... | Panos():
#C | identifier_name |
CargadePanos.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Carga de paños.py
#
# Copyright 2013 Akoharowen <alejandrofabrega@ingenieriapesquera.com.ar>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundat... | vo=open(nombre+".red","w")
datosred=str([nombre,autor,descred])
#print datosred
archivo.write(datosred)
archivo.write('\n')
seguir=1
#Carga de paños de la Red
Red=""
PreRed=""
iteraciones=0
Panel=1
while seguir==1:
iteraciones=iteraciones+1
print "------------"
print "Panel:"+str(Panel) #n+1 ó b+letra... | =raw_input("Descripcion de la Red: ") #Alfa
archi | conditional_block |
CargadePanos.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Carga de paños.py
#
# Copyright 2013 Akoharowen <alejandrofabrega@ingenieriapesquera.com.ar>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundat... | except:
print "Valor Inesperado"
panel=[Panel, "Descripcion",mat,NPaneles,Runnage,mL,Dhilo,T1,T2,N2]
seguir=raw_input("¿Cargar otro panel?")
if seguir=="0" or seguir=="n":
PreRed=PreRed+","+str(panel)
Red="["+str(PreRed)+"]"
print datosred
print Red
print "-"*len("Se guardó "+ nombre+".red ... | break | random_line_split |
events.ts | import { DadosVeiculo } from '../../../../browser/src/app/services/veiculo.service';
import { DadosLogin, DadosRegistro, RegistroResultado } from '../../../../browser/src/interfaces/login.interface';
import { BrazucasServer } from '../../../../common/brazucas-server';
import { Jogador } from '../../../../common/databas... | r: PlayerMp, dados: {
pacote: string,
nome: string;
}) {
player.stopAnimation();
player.playAnimation(dados.pacote, dados.nome, 1, 0);
}
}
| casEventos.VISUALIZAR_ANIMACAO](playe | identifier_name |
events.ts | import { DadosVeiculo } from '../../../../browser/src/app/services/veiculo.service';
import { DadosLogin, DadosRegistro, RegistroResultado } from '../../../../browser/src/interfaces/login.interface';
import { BrazucasServer } from '../../../../common/brazucas-server';
import { Jogador } from '../../../../common/databas... | VoiceChatProvider.habilitar(player, target);
}
public async [BrazucasEventos.DESABILITAR_VOICE_CHAT](player: PlayerMp, dados: any) {
console.log(`[VOICE CHAT] Desativando voice chat para ${player.name} com os dados: ${JSON.stringify(dados)}`);
const target = mp.players.at(dados.targetId);
if (!tar... | return {
erro: true,
mensagem: 'Jogador não encontrado',
};
}
| conditional_block |
events.ts | import { DadosVeiculo } from '../../../../browser/src/app/services/veiculo.service';
import { DadosLogin, DadosRegistro, RegistroResultado } from '../../../../browser/src/interfaces/login.interface';
import { BrazucasServer } from '../../../../common/brazucas-server';
import { Jogador } from '../../../../common/databas... |
public async [BrazucasEventos.AUTENTICAR_JOGADOR](player: PlayerMp, dados: DadosLogin) {
try {
const jogador: Jogador = await this.brazucasServer.autenticarJogador(player.name, dados.senha);
if (jogador) {
player.spawn(environment.posicaoLogin);
await Rpg.playerProvider.update(playe... | protected brazucasServer: BrazucasServer;
constructor(brazucasServer: BrazucasServer) {
this.brazucasServer = brazucasServer;
} | random_line_split |
events.ts | import { DadosVeiculo } from '../../../../browser/src/app/services/veiculo.service';
import { DadosLogin, DadosRegistro, RegistroResultado } from '../../../../browser/src/interfaces/login.interface';
import { BrazucasServer } from '../../../../common/brazucas-server';
import { Jogador } from '../../../../common/databas... | blic async [BrazucasEventos.VISUALIZAR_ANIMACAO](player: PlayerMp, dados: {
pacote: string,
nome: string;
}) {
player.stopAnimation();
player.playAnimation(dados.pacote, dados.nome, 1, 0);
}
}
| console.log(`[VOICE CHAT] Aplicando animação para ${player.name}`);
player.playAnimation('special_ped@baygor@monologue_3@monologue_3e', 'trees_can_talk_4', 1, 0);
}
pu | identifier_body |
struct_lits_visual.rs | // rustfmt-normalize_comments: true
// rustfmt-wrap_comments: true
// rustfmt-struct_lit_style: Visual
// rustfmt-error_on_line_overflow: false
// Struct literal expressions.
fn | () {
let x = Bar;
// Comment
let y = Foo { a: x };
Foo { a: foo(), // comment
// comment
b: bar(),
..something };
Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: f(), b: b() };
Foooooooooooooooooooooooooooooooooooooooooooooooooo... | main | identifier_name |
struct_lits_visual.rs | // rustfmt-normalize_comments: true
// rustfmt-wrap_comments: true
// rustfmt-struct_lit_style: Visual
// rustfmt-error_on_line_overflow: false
// Struct literal expressions.
fn main() {
let x = Bar;
// Comment
let y = Foo { a: x };
Foo { a: foo(), // comment
// comment
b: bar(),... | ,
y: baz(), };
Baz { x: yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
z: zzzzz, /* test */ };
A { // Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit
// amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante
... | {
bar();
} | conditional_block |
struct_lits_visual.rs | // rustfmt-normalize_comments: true
// rustfmt-wrap_comments: true
// rustfmt-struct_lit_style: Visual
// rustfmt-error_on_line_overflow: false
// Struct literal expressions.
fn main() {
let x = Bar;
// Comment
let y = Foo { a: x };
Foo { a: foo(), // comment
// comment
b: bar(),... | // Comment
b: bar(), /* Comment */ };
Foo { a: Bar, b: f() };
Quux { x: if cond {
bar();
},
y: ba... | a: foo(), /* Comment */ | random_line_split |
struct_lits_visual.rs | // rustfmt-normalize_comments: true
// rustfmt-wrap_comments: true
// rustfmt-struct_lit_style: Visual
// rustfmt-error_on_line_overflow: false
// Struct literal expressions.
fn main() | {
let x = Bar;
// Comment
let y = Foo { a: x };
Foo { a: foo(), // comment
// comment
b: bar(),
..something };
Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: f(), b: b() };
Fooooooooooooooooooooooooooooooooooooooooooooooooooooo... | identifier_body | |
index.js | const GraphQL = require('graphql');
const {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
graphql
} = GraphQL;
const graphqlMiddleware = require('graphql-middleware').default;
const ExampleType = new GraphQLObjectType({
name: 'Example',
fields: {
id: {
type: GraphQLStrin... | }
}
}, [
(root, args, ctx) => {
// throw new Error('Applies to all');
},
(root, args, ctx) => {
throw new Error('Applies to all after first');
},
]);
const schema = new GraphQLSchema({
query: new GraphQLObjectType(querySchema)
});
const query = '{ hello }';
graphql(sch... | };
} | random_line_split |
index.js | const GraphQL = require('graphql');
const {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
graphql
} = GraphQL;
const graphqlMiddleware = require('graphql-middleware').default;
const ExampleType = new GraphQLObjectType({
name: 'Example',
fields: {
id: {
type: GraphQLStrin... |
},
haha: {
type: ExampleType,
resolve () {
return {
id: 1
};
}
}
}
}, [
(root, args, ctx) => {
// throw new Error('Applies to all');
},
(root, args, ctx) => {
throw new Error(... | {
return 'world';
} | identifier_body |
index.js | const GraphQL = require('graphql');
const {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
graphql
} = GraphQL;
const graphqlMiddleware = require('graphql-middleware').default;
const ExampleType = new GraphQLObjectType({
name: 'Example',
fields: {
id: {
type: GraphQLStrin... | () {
return {
id: 1
};
}
}
}
}, [
(root, args, ctx) => {
// throw new Error('Applies to all');
},
(root, args, ctx) => {
throw new Error('Applies to all after first');
},
]);
const schema = new GraphQLSchema({
... | resolve | identifier_name |
serializers.py | from django.contrib.auth import get_user_model
from rest_framework.fields import CharField
from rest_framework.serializers import ModelSerializer
from grandchallenge.challenges.models import Challenge
from grandchallenge.components.serializers import (
ComponentInterfaceValueSerializer,
)
from grandchallenge.evalu... |
class EvaluationSerializer(ModelSerializer):
submission = SubmissionSerializer()
outputs = ComponentInterfaceValueSerializer(many=True)
status = CharField(source="get_status_display", read_only=True)
title = CharField(read_only=True)
class Meta:
model = Evaluation
fields = (
... | model = Submission
fields = (
"pk",
"phase",
"created",
"creator",
"comment",
"predictions_file",
"supplementary_file",
"supplementary_url",
) | identifier_body |
serializers.py | from django.contrib.auth import get_user_model
from rest_framework.fields import CharField
from rest_framework.serializers import ModelSerializer
from grandchallenge.challenges.models import Challenge
from grandchallenge.components.serializers import (
ComponentInterfaceValueSerializer,
)
from grandchallenge.evalu... |
class Meta:
model = Evaluation
fields = (
"pk",
"method",
"submission",
"created",
"published",
"outputs",
"rank",
"rank_score",
"rank_per_metric",
"status",
"title",
... | title = CharField(read_only=True) | random_line_split |
serializers.py | from django.contrib.auth import get_user_model
from rest_framework.fields import CharField
from rest_framework.serializers import ModelSerializer
from grandchallenge.challenges.models import Challenge
from grandchallenge.components.serializers import (
ComponentInterfaceValueSerializer,
)
from grandchallenge.evalu... | :
model = Phase
fields = (
"challenge",
"title",
"slug",
)
class SubmissionSerializer(ModelSerializer):
phase = PhaseSerializer()
creator = UserSerializer()
class Meta:
model = Submission
fields = (
"pk",
... | Meta | identifier_name |
nl.js | export default {
// Generic
"generic.add": "Toevoegen",
"generic.cancel": "Annuleren",
// BlockType
"components.controls.blocktype.h1": "H1",
"components.controls.blocktype.h2": "H2",
"components.controls.blocktype.h3": "H3",
"components.controls.blocktype.h4": "H4",
"components.controls.blocktype.h5... | // List
"components.controls.list.list": "Lijst",
"components.controls.list.unordered": "Ongeordend",
"components.controls.list.ordered": "Geordend",
"components.controls.list.indent": "Inspringen",
"components.controls.list.outdent": "Inspringen verkleinen",
// Remove
"components.controls.remove.remov... | "components.controls.link.linkTargetOption": "Open link in een nieuw venster",
"components.controls.link.link": "Link",
"components.controls.link.unlink": "Unlink",
| random_line_split |
385. Mini Parser.py | """
Given a nested list of integers represented as a string, implement a parser to deserialize it.
Each element is either an integer, or a list -- whose elements may also be integers or other lists.
Note: You may assume that the string is well-formed:
String is non-empty.
String does not contain white spaces.
String... |
s.pop(0)
return result
s = list(s + ' ')
return parse()
| result.add(parse())
if s[0] == ',':
s.pop(0) | conditional_block |
385. Mini Parser.py | """
Given a nested list of integers represented as a string, implement a parser to deserialize it.
Each element is either an integer, or a list -- whose elements may also be integers or other lists.
Note: You may assume that the string is well-formed:
String is non-empty.
String does not contain white spaces.
String... | i. An integer containing value 456.
ii. A nested list with one element:
a. An integer containing value 789.
"""
# """
# This is the interface that allows for creating nested lists.
# You should not implement it, or speculate about its implementation
# """
#class NestedInteger(object):
# def __init... |
Return a NestedInteger object containing a nested list with 2 elements:
1. An integer containing value 123.
2. A nested list containing two elements: | random_line_split |
385. Mini Parser.py | """
Given a nested list of integers represented as a string, implement a parser to deserialize it.
Each element is either an integer, or a list -- whose elements may also be integers or other lists.
Note: You may assume that the string is well-formed:
String is non-empty.
String does not contain white spaces.
String... | """
:type s: str
:rtype: NestedInteger
"""
def parse():
num = ''
while s[0] in '-0123456789':
num += s.pop(0)
if num:
return NestedInteger(int(num))
s.pop(0)
result = NestedInteger()
w... | identifier_body | |
385. Mini Parser.py | """
Given a nested list of integers represented as a string, implement a parser to deserialize it.
Each element is either an integer, or a list -- whose elements may also be integers or other lists.
Note: You may assume that the string is well-formed:
String is non-empty.
String does not contain white spaces.
String... | (object):
def deserialize(self, s):
"""
:type s: str
:rtype: NestedInteger
"""
def parse():
num = ''
while s[0] in '-0123456789':
num += s.pop(0)
if num:
return NestedInteger(int(num))
s.pop(0)
... | Solution | identifier_name |
python_comparator_code.py | ## Script that takes in a list of fastas and generates summaries of their differences
# this is python implementation to which bugMat was compared in our publication.
# code by Drs Madeleine Cule and David Eyre, Oxford University
import sys, re, os, gzip
from Bio import SeqIO
from itertools import izip
bas... |
if __name__=="__main__":
## Parse command line arguments
listoffasta, outname_prefix = sys.argv[1:]
outname = outname_prefix
## Read in all the sequences, and replace the id with the required nicename
seqlist = []
with open( listoffasta ) as fp:
for line in fp:
nicename, fapath = line.st... | '''Function to calculate the [Hamming] distance between two sequences'''
return sum(True for c1, c2 in izip( seq1, seq2 ) if c1!=c2 and c1 in bases and c2 in bases ) | identifier_body |
python_comparator_code.py | ## Script that takes in a list of fastas and generates summaries of their differences
# this is python implementation to which bugMat was compared in our publication.
# code by Drs Madeleine Cule and David Eyre, Oxford University
import sys, re, os, gzip
from Bio import SeqIO
from itertools import izip
bas... | listoffasta, outname_prefix = sys.argv[1:]
outname = outname_prefix
## Read in all the sequences, and replace the id with the required nicename
seqlist = []
with open( listoffasta ) as fp:
for line in fp:
nicename, fapath = line.strip().split()
if (os.path.exists( fapath)):
f = gzip.open( f... | conditional_block | |
python_comparator_code.py | ## Script that takes in a list of fastas and generates summaries of their differences
# this is python implementation to which bugMat was compared in our publication.
# code by Drs Madeleine Cule and David Eyre, Oxford University
import sys, re, os, gzip
from Bio import SeqIO
from itertools import izip
bas... | ( seq1, seq2 ):
'''Function to calculate the [Hamming] distance between two sequences'''
return sum(True for c1, c2 in izip( seq1, seq2 ) if c1!=c2 and c1 in bases and c2 in bases )
if __name__=="__main__":
## Parse command line arguments
listoffasta, outname_prefix = sys.argv[1:]
outname = outnam... | get_distance | identifier_name |
python_comparator_code.py | ## Script that takes in a list of fastas and generates summaries of their differences
# this is python implementation to which bugMat was compared in our publication.
# code by Drs Madeleine Cule and David Eyre, Oxford University
import sys, re, os, gzip
from Bio import SeqIO
from itertools import izip
bas... | for line in fp:
nicename, fapath = line.strip().split()
if (os.path.exists( fapath)):
f = gzip.open( fapath )
fa = SeqIO.read( f, "fasta" )
fa.id = nicename
seqlist.append( fa )
else:
sys.stderr.write(fapath+" does not exist, skipping...")
## Find nonshared positions
seq_ge... | with open( listoffasta ) as fp:
| random_line_split |
tr.js | /**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
/**
* @fileOverview
*/
/**#@+
@type String
@example
*/
/** | */
CKEDITOR.lang[ 'tr' ] = {
// ARIA description.
editor: 'Zengin Metin Editörü',
// Common messages and labels.
common: {
// Screenreader titles. Please note that screenreaders are not always capable
// of reading non-English words. So be careful while translating it.
editorHelp: 'Yardım için ALT 0 tuşuna ... | * Contains the dictionary of language entries.
* @namespace | random_line_split |
toolkit.py | import datetime
import os
import subprocess
import sys
import warnings
from typing import Optional, Union
import click
from ruamel.yaml import YAML
from ruamel.yaml.compat import StringIO
from great_expectations import exceptions as ge_exceptions
from great_expectations.checkpoint import Checkpoint, LegacyCheckpoint
... | suite = context.create_expectation_suite(expectation_suite_name)
suite.add_citation(comment="New suite added via CLI", batch_kwargs=batch_kwargs)
context.save_expectation_suite(suite, expectation_suite_name)
def launch_jupyter_notebook(notebook_path: str) -> None:
jupyter_command_override = os.getenv(... | random_line_split | |
toolkit.py | import datetime
import os
import subprocess
import sys
import warnings
from typing import Optional, Union
import click
from ruamel.yaml import YAML
from ruamel.yaml.compat import StringIO
from great_expectations import exceptions as ge_exceptions
from great_expectations.checkpoint import Checkpoint, LegacyCheckpoint
... | (
# TODO consolidate all the myriad CLI tests into this
context: DataContext,
suite_name: str,
usage_event: str,
) -> ExpectationSuite:
"""
Load an expectation suite from a given context.
Handles a suite name with or without `.json`
:param usage_event:
"""
if suite_name.endswith... | load_expectation_suite | identifier_name |
toolkit.py | import datetime
import os
import subprocess
import sys
import warnings
from typing import Optional, Union
import click
from ruamel.yaml import YAML
from ruamel.yaml.compat import StringIO
from great_expectations import exceptions as ge_exceptions
from great_expectations.checkpoint import Checkpoint, LegacyCheckpoint
... |
def launch_jupyter_notebook(notebook_path: str) -> None:
jupyter_command_override = os.getenv("GE_JUPYTER_CMD", None)
if jupyter_command_override:
subprocess.call(f"{jupyter_command_override} {notebook_path}", shell=True)
else:
subprocess.call(["jupyter", "notebook", notebook_path])
def... | cli_message(
"""
Great Expectations will create a new Expectation Suite '{:s}' and store it here:
{:s}
""".format(
expectation_suite_name,
context.stores[
context.expectations_store_name
].store_backend.get_url_for_key(
ExpectationSuiteIdent... | identifier_body |
toolkit.py | import datetime
import os
import subprocess
import sys
import warnings
from typing import Optional, Union
import click
from ruamel.yaml import YAML
from ruamel.yaml.compat import StringIO
from great_expectations import exceptions as ge_exceptions
from great_expectations.checkpoint import Checkpoint, LegacyCheckpoint
... |
else:
subprocess.call(["jupyter", "notebook", notebook_path])
def load_batch(
context: DataContext,
suite: Union[str, ExpectationSuite],
batch_kwargs: Union[dict, BatchKwargs],
) -> Union[Batch, DataAsset]:
batch: Union[Batch, DataAsset] = context.get_batch(batch_kwargs, suite)
assert... | subprocess.call(f"{jupyter_command_override} {notebook_path}", shell=True) | conditional_block |
code_interpreter.py | #!/usr/bin/env python3
# -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# vim: set fileencoding=utf-8 filetype=python syntax=python.doxygen fileformat=unix tabstop=4 expandtab :
# kate: encoding utf-8; bom off; syntax python; indent-mode python; eol unix; replace-tabs off; indent-width 4; tab-... | _input = input(r'Shell: $ ').replace('\'', '\\\'') # nosec
if _input in {r'exit', r'quit'}:
break
stdout.write(getoutput('sh -c \'' + _input + '\'') + '\n') | conditional_block | |
code_interpreter.py | #!/usr/bin/env python3
# -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# vim: set fileencoding=utf-8 filetype=python syntax=python.doxygen fileformat=unix tabstop=4 expandtab :
# kate: encoding utf-8; bom off; syntax python; indent-mode python; eol unix; replace-tabs off; indent-width 4; tab-... | """Execute Perl code given as a str and return the output as a str."""
return getoutput('perl -e \'' + _code.replace('\'', '\\\'') + '\'')
def execperlfile(_filename: str) -> str:
"""Execute a Perl script given as a str and return the output as a str."""
return getoutput(r'perl ' + _filename)
def in... |
def execperl(_code: str) -> str: | random_line_split |
code_interpreter.py | #!/usr/bin/env python3
# -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# vim: set fileencoding=utf-8 filetype=python syntax=python.doxygen fileformat=unix tabstop=4 expandtab :
# kate: encoding utf-8; bom off; syntax python; indent-mode python; eol unix; replace-tabs off; indent-width 4; tab-... | (_code: str) -> str:
"""Execute Lua code given as a str and return the output as a str."""
return getoutput('lua -e \'' + _code.replace('\'', '\\\'') + '\'')
def execluafile(_filename: str) -> str:
"""Execute a Lua script given as a str and return the output as a str."""
return getoutput(r'lua ' + _fi... | execlua | identifier_name |
code_interpreter.py | #!/usr/bin/env python3
# -*- coding: utf-8; Mode: Python; indent-tabs-mode: nil; tab-width: 4 -*-
# vim: set fileencoding=utf-8 filetype=python syntax=python.doxygen fileformat=unix tabstop=4 expandtab :
# kate: encoding utf-8; bom off; syntax python; indent-mode python; eol unix; replace-tabs off; indent-width 4; tab-... |
# SHELL #
def execsh(_code: str) -> str:
"""Execute Shell code given as a str and return the output as a str."""
return getoutput('sh -c \'' + _code.replace('\'', '\\\'') + '\'')
def execshfile(_filename: str) -> str:
"""Execute a Shell script given as a str and return the output as a str."""
ret... | """Execute a Scala file given as a str and return the output as a str."""
return getoutput(r'scala ' + _filename) | identifier_body |
dev-data.js | // For development only!!
// Add sample data to window object that used for initializing appendGrid.
window.myAppendGridInitData = [{
"uid": "d4c74a61-a24e-429f-9db0-3cf3aaa22425",
"name": "Monique Zebedee",
"company": "Welch LLC",
"country": "Japan",
"memberSince": "2012-02-18",
"orderPlaced": ... | "isNPO": true
}, {
"uid": "38e08e8a-c7eb-41eb-9191-6bb2df1fd39b",
"name": "Paulie Poel",
"company": "MacGyver, Rohan and West",
"country": "United Kingdom",
"memberSince": "2016-12-26",
"orderPlaced": 387,
"level": "Silver",
"isNPO": false
}, {
"uid": "d7bf56d4-f955-4dca-b3db-b30... | random_line_split | |
mod.rs | //! A 'simple' ARM emulator.
//!
//! At the moment the emulator only has support for a handful of THUMB-2 instructions
/// and no ARM-mode support.
use super::*;
pub use self::memory_tree::MemoryTree;
pub use self::ram::RAM;
pub use self::emu::SimpleEmulator;
pub use self::system::SimpleSystem;
pub mod memory_tree;
... | (a: Word, b: Word, c: Word) -> (Word, bool, bool) {
let sa = a as i64;
let sb = b as i64;
let sc = c as i64;
let ua = (a as u32) as u64;
let ub = (b as u32) as u64;
let uc = (c as u32) as u64;
let us = ua.wrapping_add(ub).wrapping_add(uc);
let ss = sa.wrapping_add(sb).wrapping_add(s... | adc32 | identifier_name |
mod.rs | //! A 'simple' ARM emulator.
//!
//! At the moment the emulator only has support for a handful of THUMB-2 instructions
/// and no ARM-mode support.
use super::*;
pub use self::memory_tree::MemoryTree;
pub use self::ram::RAM;
pub use self::emu::SimpleEmulator;
pub use self::system::SimpleSystem;
pub mod memory_tree;
... |
fn write_u32(&self, addr: u64, val: u32) -> Result<()> {
self.write(addr, &[(val & 0xff) as u8,
((val >> 8) & 0xff) as u8,
((val >> 16) & 0xff) as u8,
((val >> 24) & 0xff) as u8])
}
}
pub trait System {
type Memory: ... | {
self.write(addr, &[(val & 0xff) as u8,
((val >> 8) & 0xff) as u8])
} | identifier_body |
mod.rs | //! A 'simple' ARM emulator.
//!
//! At the moment the emulator only has support for a handful of THUMB-2 instructions
/// and no ARM-mode support.
use super::*;
pub use self::memory_tree::MemoryTree;
pub use self::ram::RAM;
pub use self::emu::SimpleEmulator;
pub use self::system::SimpleSystem;
pub mod memory_tree;
... |
dest[x] = src[x]
}
}
fn swap_word(src: Word) -> Word {
let src = src as u32;
let src = (src >> 24)
| ((src >> 8) & 0xff00)
| ((src << 8) & 0xff0000)
| ((src << 24) & 0xff000000);
src as Word
}
fn adc32(a: Word, b: Word, c: Word) -> (Word, bool, bool) {
let sa = a ... | {
break
} | conditional_block |
mod.rs | //! A 'simple' ARM emulator.
//!
//! At the moment the emulator only has support for a handful of THUMB-2 instructions
/// and no ARM-mode support.
use super::*;
pub use self::memory_tree::MemoryTree;
pub use self::ram::RAM;
pub use self::emu::SimpleEmulator;
pub use self::system::SimpleSystem;
pub mod memory_tree;
... | try!(self.read(addr, &mut data));
Ok((data[0] as u16) | ((data[1] as u16) << 8))
}
fn read_u32(&self, addr: u64) -> Result<u32> {
let mut data = [0u8;4];
try!(self.read(addr, &mut data));
Ok((data[0] as u32)
| ((data[1] as u32) << 8)
| ((data[2] as ... | let mut data = [0u8;2]; | random_line_split |
result_try.rs | use std::io::prelude::*;
use std::fs::File;
type Result<T> = std::result::Result<T, String>;
// Setup to make this work. Create two files with some info. Ignore the
// return values because we don't care about them here.
fn setup() {
File::create("a")
.and_then(|mut file| file.write_all(b"grape"))
... |
// Concat the contents of the two files together into a new `Result`.
fn concat(a: &str, b: &str) -> Result<String> {
let (data_a, data_b) = (get_data(a), get_data(b));
data_a.and_then(|a|
// Return `Ok` when both `a` and `b` are `Ok`. Otherwise return
// whichever has the first `Err`.
... | .map(|_| contents)
})
} | random_line_split |
result_try.rs | use std::io::prelude::*;
use std::fs::File;
type Result<T> = std::result::Result<T, String>;
// Setup to make this work. Create two files with some info. Ignore the
// return values because we don't care about them here.
fn setup() {
File::create("a")
.and_then(|mut file| file.write_all(b"grape"))
... | {
setup();
match concat("a", "b") {
Ok(n) => println!("{}", n),
Err(e) => println!("Error: {}", e),
}
} | identifier_body | |
result_try.rs | use std::io::prelude::*;
use std::fs::File;
type Result<T> = std::result::Result<T, String>;
// Setup to make this work. Create two files with some info. Ignore the
// return values because we don't care about them here.
fn setup() {
File::create("a")
.and_then(|mut file| file.write_all(b"grape"))
... | () {
setup();
match concat("a", "b") {
Ok(n) => println!("{}", n),
Err(e) => println!("Error: {}", e),
}
}
| main | identifier_name |
logger.service.spec.ts | import "test-setup";
import { consts } from "../core.consts";
import { LoggerService } from "./logger.service";
import { LogType } from "./logger.model";
beforeEach(JasminePromiseMatchers.install);
afterEach(JasminePromiseMatchers.uninstall);
describe("LoggerServiceSpecs", () => {
let SUT: LoggerService;
let $lo... |
it("should be sucessful", () => {
expect(1 + 1).toBe(2);
});
});
describe("given logType warn", () => {
it("should invoke warn method", () => {
spyOn($log, "warn");
SUT.log(LogType.Warning, "yo querro");
expect($log.warn).toHaveBeenCalled();
});
});
describe("given logType error", () => {
... | describe("given a simple task", () => {
it("should fail", () => {
expect(1 + 1).toBe(3);
}); | random_line_split |
ThemesDialog.ts | namespace phasereditor2d.ide.ui.dialogs {
import controls = colibri.ui.controls;
export class ThemesDialog extends controls.dialogs.ViewerDialog {
constructor() {
super(new ThemeViewer());
this.setSize(200, 300);
}
|
this.addButton("Close", () => this.close());
}
}
class ThemeViewer extends controls.viewers.TreeViewer {
constructor() {
super("ThemeViewer");
this.setLabelProvider(new ThemeLabelProvider());
this.setContentProvider(new controls.viewers.ArrayT... | create() {
super.create();
this.setTitle("Themes"); | random_line_split |
ThemesDialog.ts | namespace phasereditor2d.ide.ui.dialogs {
import controls = colibri.ui.controls;
export class ThemesDialog extends controls.dialogs.ViewerDialog {
| () {
super(new ThemeViewer());
this.setSize(200, 300);
}
create() {
super.create();
this.setTitle("Themes");
this.addButton("Close", () => this.close());
}
}
class ThemeViewer extends controls.viewers.TreeViewer {
... | constructor | identifier_name |
lib.rs | // Copyright 2016 Mozilla Foundation
//
// 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 agreed... | println!();
1
}
});
}
fn init_logging() {
if env::var(LOGGING_ENV).is_ok() {
match env_logger::Builder::from_env(LOGGING_ENV).try_init() {
Ok(_) => (),
Err(e) => panic!("Failed to initalize logging: {:?}", e),
}
}
} | println!("sccache: caused by: {}", e);
}
cmdline::get_app().print_help().unwrap(); | random_line_split |
lib.rs | // Copyright 2016 Mozilla Foundation
//
// 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 agreed... | () {
if env::var(LOGGING_ENV).is_ok() {
match env_logger::Builder::from_env(LOGGING_ENV).try_init() {
Ok(_) => (),
Err(e) => panic!("Failed to initalize logging: {:?}", e),
}
}
}
| init_logging | identifier_name |
lib.rs | // Copyright 2016 Mozilla Foundation
//
// 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 agreed... |
},
Err(e) => {
println!("sccache: {}", e);
for e in e.chain().skip(1) {
println!("sccache: caused by: {}", e);
}
cmdline::get_app().print_help().unwrap();
println!();
1
}
});
}
fn init_logging() {
i... | {
eprintln!("sccache: error: {}", e);
for e in e.chain().skip(1) {
eprintln!("sccache: caused by: {}", e);
}
2
} | conditional_block |
lib.rs | // Copyright 2016 Mozilla Foundation
//
// 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 agreed... | {
if env::var(LOGGING_ENV).is_ok() {
match env_logger::Builder::from_env(LOGGING_ENV).try_init() {
Ok(_) => (),
Err(e) => panic!("Failed to initalize logging: {:?}", e),
}
}
} | identifier_body | |
pt.ts | import type { Translations, TranslationsContext } from '.';
export const translations: Translations = { | site: {
description: 'Website de Luiz Felipe Gonçalves (lffg)',
nav: {
home: 'Início',
about: 'Sobre',
contact: 'Contato'
},
footer: {
openSource:
'O código fonte deste website é <a href="https://github.com/lffg/luizfelipe.dev" rel="noopener noreferrer" target="_blank">... | random_line_split | |
test_issue_162.py | def compute_rir(order):
fromPos = np.zeros((3))
toPos = np.ones((3, 1))
roomSize = np.array([3, 3, 3])
room = pra.ShoeBox(roomSize, fs=1000, absorption=0.95, max_order=order)
room.add_source(fromPos)
mics = pra.MicrophoneArray(toPos, room.fs)
room.add_microphone_array(mics)
room.compute_... | import numpy as np
import pyroomacoustics as pra
| random_line_split |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.