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 |
|---|---|---|---|---|
benchmark_qt_rx2.py | #!/usr/bin/env python
#
# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... | (self):
try:
gain_phase = self.gui.gainPhaseEdit.text().toDouble()[0]
self.fg.set_rx_gain_phase(gain_phase)
except RuntimeError:
pass
def gainClockEditText(self):
try:
gain = self.gui.gainClockEdit.text().toDouble()[0]
self.fg.set_... | gainPhaseEditText | identifier_name |
benchmark_qt_rx2.py | #!/usr/bin/env python
#
# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
... | except RuntimeError:
pass
def gainPhaseEditText(self):
try:
gain_phase = self.gui.gainPhaseEdit.text().toDouble()[0]
self.fg.set_rx_gain_phase(gain_phase)
except RuntimeError:
pass
def gainClockEditText(self):
try:
gai... | random_line_split | |
parameters-definitions.model.ts | /**
* @license
* Copyright 2017 Red Hat
*
* 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 ... | (name: string): Oas20ParameterDefinition {
return this.removeParameter(name);
}
}
export class Oas20ParametersDefinitionsItems {
[key: string]: Oas20ParameterDefinition;
}
| deleteItem | identifier_name |
parameters-definitions.model.ts | /**
* @license
* Copyright 2017 Red Hat
*
* 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 ... |
}
export class Oas20ParametersDefinitionsItems {
[key: string]: Oas20ParameterDefinition;
}
| {
return this.removeParameter(name);
} | identifier_body |
parameters-definitions.model.ts | /**
* @license
* Copyright 2017 Red Hat
*
* 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 ... | * See the License for the specific language governing permissions and
* limitations under the License.
*/
import {IOasNodeVisitor, IOas20NodeVisitor} from "../../visitors/visitor.iface";
import {OasNode} from "../node.model";
import {Oas20ParameterDefinition} from "./parameter.model";
import {IOasIndexedNode} from ... | random_line_split | |
parameters-definitions.model.ts | /**
* @license
* Copyright 2017 Red Hat
*
* 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 ... |
return rval;
}
/**
* Gets a list of all the parameter names.
*/
public parameterNames(): string[] {
let rval: string[] = [];
for (let name in this._parameters) {
rval.push(name);
}
return rval;
}
/**
* Creates an OAS 2.0 Parameter... | {
delete this._parameters[name];
} | conditional_block |
mkfifo.rs | #![crate_name = "mkfifo"]
/*
* This file is part of the uutils coreutils package.
*
* (c) Michael Gehring <mg@ebfe.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
extern crate getopts;
extern crate libc;
#[macro_use]
extern... | () {
std::process::exit(uumain(std::env::args().collect()));
}
| main | identifier_name |
mkfifo.rs | #![crate_name = "mkfifo"]
/*
* This file is part of the uutils coreutils package.
*
* (c) Michael Gehring <mg@ebfe.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
extern crate getopts;
extern crate libc;
#[macro_use]
extern... | opts.optflag("V", "version", "output version information and exit");
let matches = match opts.parse(&args[1..]) {
Ok(m) => m,
Err(err) => panic!("{}", err),
};
if matches.opt_present("version") {
println!("{} {}", NAME, VERSION);
return 0;
}
if matches.opt_pres... | pub fn uumain(args: Vec<String>) -> i32 {
let mut opts = getopts::Options::new();
opts.optopt("m", "mode", "file permissions for the fifo", "(default 0666)");
opts.optflag("h", "help", "display this help and exit"); | random_line_split |
mkfifo.rs | #![crate_name = "mkfifo"]
/*
* This file is part of the uutils coreutils package.
*
* (c) Michael Gehring <mg@ebfe.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
extern crate getopts;
extern crate libc;
#[macro_use]
extern... |
return 0;
}
let mode = match matches.opt_str("m") {
Some(m) => match usize::from_str_radix(&m, 8) {
Ok(m) => m,
Err(e)=> {
show_error!("invalid mode: {}", e);
return 1;
}
},
None => 0o666,
};
let mut e... | {
return 1;
} | conditional_block |
mkfifo.rs | #![crate_name = "mkfifo"]
/*
* This file is part of the uutils coreutils package.
*
* (c) Michael Gehring <mg@ebfe.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
extern crate getopts;
extern crate libc;
#[macro_use]
extern... | {
std::process::exit(uumain(std::env::args().collect()));
} | identifier_body | |
form_group_name.ts | /**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Directive, Host, Inject, Input, OnDestroy, OnInit, Optional, Self, SkipSelf, forwardRef} from '@angular/core... | }
} | random_line_split | |
form_group_name.ts | /**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Directive, Host, Inject, Input, OnDestroy, OnInit, Optional, Self, SkipSelf, forwardRef} from '@angular/core... | extends AbstractFormGroupDirective implements OnInit, OnDestroy {
@Input('formGroupName') name: string;
constructor(
@Host() @SkipSelf() parent: ControlContainer,
@Optional() @Self() @Inject(NG_VALIDATORS) validators: any[],
@Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: any[]... | FormGroupName | identifier_name |
form_group_name.ts | /**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Directive, Host, Inject, Input, OnDestroy, OnInit, Optional, Self, SkipSelf, forwardRef} from '@angular/core... |
}
| {
super();
this._parent = parent;
this._validators = validators;
this._asyncValidators = asyncValidators;
} | identifier_body |
PatientViewPageStore.spec.ts | /**
* Created by aaronlisman on 3/2/17.
*/ | import { assert } from 'chai';
import { AppStore } from '../../../AppStore';
describe('PatientViewPageStore', () => {
let store: PatientViewPageStore;
beforeAll(() => {
store = new PatientViewPageStore(new AppStore());
});
it('if there are pdf items in response and their name starts with a gi... | import {
handlePathologyReportCheckResponse,
PatientViewPageStore,
} from './PatientViewPageStore'; | random_line_split |
client.js | 'use strict';
var stringify = require('json-stringify-safe');
var parsers = require('./parsers');
var zlib = require('zlib');
var utils = require('./utils');
var uuid = require('uuid');
var transports = require('./transports');
var nodeUtil = require('util'); // nodeUtil to avoid confusion with "utils"
var events = re... | () {
this.breadcrumbs = {
record: this.captureBreadcrumb.bind(this)
};
}
nodeUtil.inherits(Raven, events.EventEmitter);
extend(Raven.prototype, {
config: function config(dsn, options) {
// We get lots of users using raven-node when they want raven-js, hence this warning if it seems like a browser
if... | Raven | identifier_name |
client.js | 'use strict';
var stringify = require('json-stringify-safe');
var parsers = require('./parsers');
var zlib = require('zlib');
var utils = require('./utils');
var uuid = require('uuid');
var transports = require('./transports');
var nodeUtil = require('util'); // nodeUtil to avoid confusion with "utils"
var events = re... |
nodeUtil.inherits(Raven, events.EventEmitter);
extend(Raven.prototype, {
config: function config(dsn, options) {
// We get lots of users using raven-node when they want raven-js, hence this warning if it seems like a browser
if (typeof window !== 'undefined' && typeof document !== 'undefined' && typeof nav... | {
this.breadcrumbs = {
record: this.captureBreadcrumb.bind(this)
};
} | identifier_body |
client.js | 'use strict';
var stringify = require('json-stringify-safe');
var parsers = require('./parsers');
var zlib = require('zlib');
var utils = require('./utils');
var uuid = require('uuid');
var transports = require('./transports');
var nodeUtil = require('util'); // nodeUtil to avoid confusion with "utils"
var events = re... | } else {
kwargs = kwargs || {};
}
var eventId = this.generateEventId();
this.process(eventId, parsers.parseText(message, kwargs), cb);
return eventId;
},
captureException: function captureException(err, kwargs, cb) {
if (!(err instanceof Error)) {
// This handles when someone d... | cb = kwargs;
kwargs = {}; | random_line_split |
client.js | 'use strict';
var stringify = require('json-stringify-safe');
var parsers = require('./parsers');
var zlib = require('zlib');
var utils = require('./utils');
var uuid = require('uuid');
var transports = require('./transports');
var nodeUtil = require('util'); // nodeUtil to avoid confusion with "utils"
var events = re... |
// enabled if a dsn is set
this._enabled = !!this.dsn;
var globalContext = this._globalContext = {};
if (options.tags) {
globalContext.tags = options.tags;
}
if (options.extra) {
globalContext.extra = options.extra;
}
this.onFatalError = this.defaultOnFatalError = functio... | {
// In case we want to provide our own SSL certificates / keys
this.ca = options.ca || null;
} | conditional_block |
__Filter.js | "use strict";
import I from "immutable";
import assert from "assert";
import React from "react/addons";
let { TestUtils } = React.addons;
import FilterInput from "../../../src/js/components/filter/FilterInput";
import MultiSelect from "../../../src/js/components/filter/MultiSelect";
import Preset from "../../../src/j... | key: "name",
options: ["jim", "tim"]
}
}
});
const selections = I.fromJS({
name: ["jim"]
});
const presetConfig = [
{description: "preset", onSelect: []}
];
const ShallowRenderer = TestUtils.createRenderer();
ShallowRenderer.render(
<Filter filters={filters} selections={selections}
setF... | endDate: "2016-01-01",
restrictions: {
name: { | random_line_split |
extendablemessageevent.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::ExtendableMessageEventBinding;
use crate::dom::bindings::codegen::Bin... | (
worker: &ServiceWorkerGlobalScope,
type_: DOMString,
init: RootedTraceableBox<ExtendableMessageEventBinding::ExtendableMessageEventInit>,
) -> Fallible<DomRoot<ExtendableMessageEvent>> {
let global = worker.upcast::<GlobalScope>();
let ev = ExtendableMessageEvent::new(
... | Constructor | identifier_name |
extendablemessageevent.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::ExtendableMessageEventBinding;
use crate::dom::bindings::codegen::Bin... | message,
DOMString::new(),
DOMString::new(),
);
Extendablemessageevent.upcast::<Event>().fire(target);
}
}
impl ExtendableMessageEventMethods for ExtendableMessageEvent {
#[allow(unsafe_code)]
// https://w3c.github.io/ServiceWorker/#extendablemessage-even... | let Extendablemessageevent = ExtendableMessageEvent::new(
scope,
atom!("message"),
false,
false, | random_line_split |
extendablemessageevent.rs | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::ExtendableMessageEventBinding;
use crate::dom::bindings::codegen::Bin... |
}
| {
self.event.IsTrusted()
} | identifier_body |
MdFavoriteHeartEmpty.js | import * as React from "react";
import PropTypes from "prop-types";
import { withWrapper } from "../Icon"; | viewBox="4 4 32 32"
xmlns="http://www.w3.org/2000/svg"
ref={ref}
aria-hidden={!props["aria-label"]}
{...props}
>
<path
d="m20 28.947 8.236-7.71.164-.156a10.936 10.936 0 0 0 1.253-1.449C30.502 18.456 31 17.247 31 16.095 31 12.844 29.062 11 25.598 11c-1.595 0-3.343 1.034-4.905 2.534a1 1 0 ... |
const Vector = React.forwardRef(({ size, color, ...props }, ref) => (
<svg
width={size}
height={size} | random_line_split |
CommitMessage.spec.tsx | import { nullTranslator } from '@jupyterlab/translation';
import Input from '@material-ui/core/Input';
import { shallow } from 'enzyme';
import 'jest';
import * as React from 'react';
import {
CommitMessage,
ICommitMessageProps
} from '../../src/components/CommitMessage';
describe('CommitMessage', () => {
const ... | const node = component.find(Input).last();
expect(node.prop('placeholder')).toEqual('Description (optional)');
});
it('should set a `title` attribute on the input element to provide a commit message description', () => {
const props = defaultProps;
const component = shallow(<CommitMessage {...props... | const props = defaultProps;
const component = shallow(<CommitMessage {...props} />); | random_line_split |
licenses.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility for checking and processing licensing information in third_party
directories.
Usage: licenses.py <command>
Commands:
... |
else:
print __doc__
return 1
if __name__ == '__main__':
sys.exit(main())
| return 1 | conditional_block |
licenses.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility for checking and processing licensing information in third_party
directories.
Usage: licenses.py <command>
Commands:
... | (root=None):
"""Scan a list of directories and report on any problems we find."""
if root is None:
root = os.getcwd()
third_party_dirs = FindThirdPartyDirs(PRUNE_PATHS, root)
third_party_dirs = FilterDirsWithFiles(third_party_dirs, root)
errors = []
for path in sorted(third_party_dirs):
... | ScanThirdPartyDirs | identifier_name |
licenses.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility for checking and processing licensing information in third_party
directories.
Usage: licenses.py <command>
Commands:
... | "License File": "LICENSE", # Relative path to license text.
"Name": None, # Short name (for header on about:credits).
"URL": None, # Project home page.
"License": None, # Software license.
}
# Relative path to a file containing some h... | """Examine a third_party/foo component and extract its metadata."""
# Parse metadata fields out of README.chromium.
# We examine "LICENSE" for the license file by default.
metadata = { | random_line_split |
licenses.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility for checking and processing licensing information in third_party
directories.
Usage: licenses.py <command>
Commands:
... |
root = os.path.join(os.path.dirname(__file__), '..')
third_party_dirs = FindThirdPartyDirs(PRUNE_PATHS, root)
entry_template = open(os.path.join(root, 'chrome', 'browser', 'resources',
'about_credits_entry.tmpl'), 'rb').read()
entries = []
for path in sorted... | """Expand a template with variables like {{foo}} using a
dictionary of expansions."""
for key, val in env.items():
if escape and not key.endswith("_unescaped"):
val = cgi.escape(val)
template = template.replace('{{%s}}' % key, val)
return template | identifier_body |
configHandler.ts | import * as nconf from "nconf";
import { existsSync, copyFileSync, watchFile } from "fs";
export function configInit(configPath: string) {
if (!existsSync(configPath)) {
console.log("No config file present. Copying from config.default.json");
copyFileSync("./cfg/config.default.json", configPath);
... | (key: string) {
return nconf.get(key);
}
export function configSet(key: string, value: Object) {
nconf.set(key, value);
}
export function configSave() {
nconf.save((error: Error) => {
if (error) {
console.error(error.message);
return;
}
});
}
export function co... | configGet | identifier_name |
configHandler.ts | import * as nconf from "nconf";
import { existsSync, copyFileSync, watchFile } from "fs";
export function configInit(configPath: string) {
if (!existsSync(configPath)) {
console.log("No config file present. Copying from config.default.json");
copyFileSync("./cfg/config.default.json", configPath);
... |
export function configSet(key: string, value: Object) {
nconf.set(key, value);
}
export function configSave() {
nconf.save((error: Error) => {
if (error) {
console.error(error.message);
return;
}
});
}
export function configLoad() {
nconf.load();
} | random_line_split | |
configHandler.ts | import * as nconf from "nconf";
import { existsSync, copyFileSync, watchFile } from "fs";
export function configInit(configPath: string) {
if (!existsSync(configPath)) {
console.log("No config file present. Copying from config.default.json");
copyFileSync("./cfg/config.default.json", configPath);
... |
});
}
export function configLoad() {
nconf.load();
} | {
console.error(error.message);
return;
} | conditional_block |
configHandler.ts | import * as nconf from "nconf";
import { existsSync, copyFileSync, watchFile } from "fs";
export function configInit(configPath: string) |
export function configGet(key: string) {
return nconf.get(key);
}
export function configSet(key: string, value: Object) {
nconf.set(key, value);
}
export function configSave() {
nconf.save((error: Error) => {
if (error) {
console.error(error.message);
return;
}
... | {
if (!existsSync(configPath)) {
console.log("No config file present. Copying from config.default.json");
copyFileSync("./cfg/config.default.json", configPath);
}
watchFile(configPath, (curr, prev) => {
console.log(`Reloading config ${configPath}`);
nconf.use("file", { file:... | identifier_body |
openFileOnRemote.ts | import { Range, TextEditor, Uri, window } from 'vscode';
import { UriComparer } from '../comparers';
import { BranchSorting, TagSorting } from '../configuration';
import { Commands, GlyphChars } from '../constants';
import type { Container } from '../container';
import { GitUri } from '../git/gitUri';
import { GitBranc... |
protected override async preExecute(context: CommandContext, args?: OpenFileOnRemoteCommandArgs) {
let uri = context.uri;
if (context.command === Commands.CopyRemoteFileUrlWithoutRange) {
args = { ...args, range: false };
}
if (isCommandContextViewNodeHasCommit(context)) {
args = { ...args, range: fa... | {
super([
Commands.OpenFileOnRemote,
Commands.Deprecated_OpenFileInRemote,
Commands.CopyRemoteFileUrl,
Commands.CopyRemoteFileUrlWithoutRange,
Commands.OpenFileOnRemoteFrom,
Commands.CopyRemoteFileUrlFrom,
]);
} | identifier_body |
openFileOnRemote.ts | import { Range, TextEditor, Uri, window } from 'vscode';
import { UriComparer } from '../comparers';
import { BranchSorting, TagSorting } from '../configuration';
import { Commands, GlyphChars } from '../constants';
import type { Container } from '../container';
import { GitUri } from '../git/gitUri';
import { GitBranc... |
void (await executeCommand<OpenOnRemoteCommandArgs>(Commands.OpenOnRemote, {
resource: {
type: sha == null ? RemoteResourceType.File : RemoteResourceType.Revision,
branchOrTag: args.branchOrTag ?? 'HEAD',
fileName: gitUri.relativePath,
range: range,
sha: sha ?? undefined,
},
re... | {
let branch;
if (!args.pickBranchOrTag) {
branch = await this.container.git.getBranch(gitUri.repoPath);
}
if (branch?.upstream == null) {
const pick = await ReferencePicker.show(
gitUri.repoPath,
args.clipboard
? `Copy Remote File Url From${pad(GlyphChars.Dot, 2, 2)}${gitU... | conditional_block |
openFileOnRemote.ts | import { Range, TextEditor, Uri, window } from 'vscode';
import { UriComparer } from '../comparers';
import { BranchSorting, TagSorting } from '../configuration';
import { Commands, GlyphChars } from '../constants';
import type { Container } from '../container';
import { GitUri } from '../git/gitUri';
import { GitBranc... | args.sha = context.node instanceof StatusFileNode ? undefined : context.node.commit.sha;
} else if (isCommandContextViewNodeHasBranch(context)) {
args.branchOrTag = context.node.branch?.name;
}
uri = context.node.uri;
} else if (context.type === 'viewItem') {
args = { ...args, range: false };
... | random_line_split | |
openFileOnRemote.ts | import { Range, TextEditor, Uri, window } from 'vscode';
import { UriComparer } from '../comparers';
import { BranchSorting, TagSorting } from '../configuration';
import { Commands, GlyphChars } from '../constants';
import type { Container } from '../container';
import { GitUri } from '../git/gitUri';
import { GitBranc... | (private readonly container: Container) {
super([
Commands.OpenFileOnRemote,
Commands.Deprecated_OpenFileInRemote,
Commands.CopyRemoteFileUrl,
Commands.CopyRemoteFileUrlWithoutRange,
Commands.OpenFileOnRemoteFrom,
Commands.CopyRemoteFileUrlFrom,
]);
}
protected override async preExecute(context... | constructor | identifier_name |
inline.rs | // Copyright 2012-2013 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... | (cx: &DocContext, tcx: &ty::ctxt,
def: def::Def) -> Option<Vec<clean::Item>> {
let mut ret = Vec::new();
let did = def.def_id();
let inner = match def {
def::DefTrait(did) => {
record_extern_fqn(cx, did, clean::TypeTrait);
clean::TraitItem(build_external_tra... | try_inline_def | identifier_name |
inline.rs | // Copyright 2012-2013 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... |
fn build_impls(cx: &DocContext, tcx: &ty::ctxt,
did: ast::DefId) -> Vec<clean::Item> {
ty::populate_implementations_for_type_if_necessary(tcx, did);
let mut impls = Vec::new();
match tcx.inherent_impls.borrow().find(&did) {
None => {}
Some(i) => {
impls.extend(i... | {
let t = ty::lookup_item_type(tcx, did);
match ty::get(t.ty).sty {
ty::ty_enum(edid, _) if !csearch::is_typedef(&tcx.sess.cstore, did) => {
return clean::EnumItem(clean::Enum {
generics: (&t.generics, subst::TypeSpace).clean(cx),
variants_stripped: false,
... | identifier_body |
inline.rs | // Copyright 2012-2013 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... |
_ => fail!("not a tymethod"),
};
Some(item)
}
ty::TypeTraitItem(_) => {
// FIXME(pcwalton): Implement.
None
}
}
}).collect();
return Some(clean::Item {
inner: clean::ImplItem(... | {
clean::MethodItem(clean::Method {
fn_style: fn_style,
decl: decl,
self_: self_,
generics: generics,
})
} | conditional_block |
inline.rs | // Copyright 2012-2013 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... | ty::TypeTraitItem(_) => {
// FIXME(pcwalton): Implement.
None
}
}
}).collect();
return Some(clean::Item {
inner: clean::ImplItem(clean::Impl {
derived: clean::detect_derived(attrs.as_slice()),
trait_: associated_trai... | };
Some(item)
} | random_line_split |
.eslintrc.js | module.exports = {
// When adding items to this file please check for effects on sub-directories.
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2018,
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"env": {
"node": true
},
"plugins": [
"import", // re... | "array-callback-return": 2,
"block-scoped-var": 2,
"callback-return": 0,
"camelcase": 0,
"capitalized-comments": 0,
"class-methods-use-this": 0,
"consistent-this": [2, "use-bind"],
"default-case": 0,
"eqeqeq": 2,
"for-direction": 2,
"func-name-matching": 2,
"func-names": ... | "react/require-render-return": 2,
"accessor-pairs": [2, {"setWithoutGet": true, "getWithoutSet": false}], | random_line_split |
misc.rs | /// Module for miscellaneous instructions
use jeebie::core::cpu::CPU;
use jeebie::core::registers::Register8::*;
use jeebie::core::registers::Register16::*;
// 'NOP' 00 4
pub fn nop(cpu: &mut CPU) -> i32 { 4 }
// 'SWAP A' CB 37 8
pub fn SWAP_a(cpu: &mut CPU) -> i32 {
cpu.compute_swap(A);
8
}
// 'SWAP B' CB 3... | // 'SWAP C' CB 31 8
pub fn SWAP_c(cpu: &mut CPU) -> i32 {
cpu.compute_swap(C);
8
}
// 'SWAP D' CB 32 8
pub fn SWAP_d(cpu: &mut CPU) -> i32 {
cpu.compute_swap(D);
8
}
// 'SWAP E' CB 33 8
pub fn SWAP_e(cpu: &mut CPU) -> i32 {
cpu.compute_swap(E);
8
}
// 'SWAP H' CB 34 8
pub fn SWAP_h(cpu: &mut ... | cpu.compute_swap(B);
8
}
| random_line_split |
misc.rs | /// Module for miscellaneous instructions
use jeebie::core::cpu::CPU;
use jeebie::core::registers::Register8::*;
use jeebie::core::registers::Register16::*;
// 'NOP' 00 4
pub fn nop(cpu: &mut CPU) -> i32 { 4 }
// 'SWAP A' CB 37 8
pub fn SWAP_a(cpu: &mut CPU) -> i32 {
cpu.compute_swap(A);
8
}
// 'SWAP B' CB 3... | (cpu: &mut CPU) -> i32 {
cpu.compute_swap(RegisterAddress(HL));
16
}
// 'EI' FB 4
pub fn EI(cpu: &mut CPU) -> i32 {
cpu.interrupts_enabled = true;
4
}
// 'DI' F3 4
pub fn DI(cpu: &mut CPU) -> i32 {
cpu.interrupts_enabled = false;
4
} | SWAP_hl | identifier_name |
misc.rs | /// Module for miscellaneous instructions
use jeebie::core::cpu::CPU;
use jeebie::core::registers::Register8::*;
use jeebie::core::registers::Register16::*;
// 'NOP' 00 4
pub fn nop(cpu: &mut CPU) -> i32 { 4 }
// 'SWAP A' CB 37 8
pub fn SWAP_a(cpu: &mut CPU) -> i32 {
cpu.compute_swap(A);
8
}
// 'SWAP B' CB 3... |
// 'SWAP (HL)' CB 36 16
pub fn SWAP_hl(cpu: &mut CPU) -> i32 {
cpu.compute_swap(RegisterAddress(HL));
16
}
// 'EI' FB 4
pub fn EI(cpu: &mut CPU) -> i32 {
cpu.interrupts_enabled = true;
4
}
// 'DI' F3 4
pub fn DI(cpu: &mut CPU) -> i32 {
cpu.interrupts_enabled = false;
4
} | {
cpu.compute_swap(L);
8
} | identifier_body |
myclinic-modal.js | "use strict";
(function(exports){
function setAttributes(e, map){
for(var key in map){
e.setAttribute(key, map[key]);
}
}
function setStyles(e, map){
for(var key in map){
e.style[key] = map[key];
}
}
function getOpt(opts, key, defaultValue){
if( opts && key in opts ){
return opts[key];
} else {
return ... |
function createCloseBox(){
var closeBox = document.createElement("a");
closeBox.setAttribute("href", "javascript:void(0)");
setStyles(closeBox, {
fontSize:"13px",
fontWeight:"bold",
margin:"4px 0 4px 4px",
padding:0,
textDecoration:"none",
color:"#333"
});
closeBox.appendChild(docum... | {
var handle = document.createElement("div");
var title = document.createElement("div");
setStyles(title, {
cursor:"move",
backgroundColor:"#ccc",
fontWeight:"bold",
padding:"6px 4px 4px 4px"
});
title.appendChild(document.createTextNode(titleLabel));
handle.appendChild(title);
return handle;... | identifier_body |
myclinic-modal.js | "use strict";
(function(exports){
function setAttributes(e, map){
for(var key in map){
e.setAttribute(key, map[key]);
}
}
function setStyles(e, map){
for(var key in map){
e.style[key] = map[key];
}
}
function getOpt(opts, key, defaultValue){
if( opts && key in opts ){
return opts[key];
} else {
return ... | (titleLabel){
var handle = document.createElement("div");
var title = document.createElement("div");
setStyles(title, {
cursor:"move",
backgroundColor:"#ccc",
fontWeight:"bold",
padding:"6px 4px 4px 4px"
});
title.appendChild(document.createTextNode(titleLabel));
handle.appendChild(title);
re... | createTitle | identifier_name |
myclinic-modal.js | "use strict";
(function(exports){
function setAttributes(e, map){
for(var key in map){
e.setAttribute(key, map[key]);
}
}
function setStyles(e, map){
for(var key in map){
e.style[key] = map[key];
}
}
function getOpt(opts, key, defaultValue){
if( opts && key in opts ){
return opts[key];
} else {
return ... |
document.body.appendChild(dialog);
var header = new Header(this.title);
dialog.appendChild(header.dom);
bindHandle(header.handle, dialog);
header.closeBox.addEventListener("click", onClose.bind(this));
var content = createContent(this.content);
dialog.appendChild(content);
this.screen = screen;
this.dialog = ... |
dialog.style.position = this.position;
if( this.position === "fixed" ){
dialog.style.maxHeight = (window.innerHeight - 90) + "px";
dialog.style.overflowY = "auto";
}
}
| conditional_block |
myclinic-modal.js | "use strict";
(function(exports){
function setAttributes(e, map){
for(var key in map){
e.setAttribute(key, map[key]);
}
}
function setStyles(e, map){
for(var key in map){
e.style[key] = map[key];
}
}
function getOpt(opts, key, defaultValue){
if( opts && key in opts ){
return opts[key];
} else {
return ... | return closeBox;
}
function createContent(){
var content = document.createElement("div");
content.style.marginTop = "10px";
return content;
}
function ModalDialog(opts){
this.screenZIndex = getOpt(opts, "scrrenZIndex", 10);
this.screenOpacity = getOpt(opts, "screenOpacity", 0.5);
this.dialogZIndex = getOpt(opt... | });
closeBox.appendChild(document.createTextNode("×")); | random_line_split |
Controls.js | "use strict";
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProp... |
var Controls = (function () {
function Controls(actor, action, hasStarted) {
_classCallCheck(this, Controls);
this.actor = actor;
this.action = action;
if (hasStarted) {
this.id = this.bindAction();
this.action.activate();
}
}
_createClass... | { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | identifier_body |
Controls.js | "use strict";
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProp... | (actor, action, hasStarted) {
_classCallCheck(this, Controls);
this.actor = actor;
this.action = action;
if (hasStarted) {
this.id = this.bindAction();
this.action.activate();
}
}
_createClass(Controls, [{
key: "start",
value: fu... | Controls | identifier_name |
Controls.js | "use strict";
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProp... | module.exports = Controls; | return Controls;
})();
| random_line_split |
Expect.py | import os
import subprocess
import errno
from JumpScale import j
PIPE = subprocess.PIPE
if subprocess.mswindows:
from win32file import ReadFile, WriteFile
from win32pipe import PeekNamedPipe
import msvcrt
else:
import select
import fcntl
if j.core.platformtype.myplatform.isLinux():
try:
... | timeout = 10
elif len(item) == 4:
regex = item[0]
tosend = item[1]
stepname = item[2]
timeout = item[3]
else:
raise j.exceptions.RuntimeError("Error in syntax sequence,\n%s" % sequence)
r... | tosend = item[1]
stepname = item[2] | random_line_split |
Expect.py |
import os
import subprocess
import errno
from JumpScale import j
PIPE = subprocess.PIPE
if subprocess.mswindows:
from win32file import ReadFile, WriteFile
from win32pipe import PeekNamedPipe
import msvcrt
else:
import select
import fcntl
if j.core.platformtype.myplatform.isLinux():
try:
... | (self, which):
getattr(self, which).close()
setattr(self, which, None)
if subprocess.mswindows:
def send(self, input):
if not self.stdin:
return None
try:
x = msvcrt.get_osfhandle(self.stdin.fileno())
(errCode, written)... | _close | identifier_name |
Expect.py |
import os
import subprocess
import errno
from JumpScale import j
PIPE = subprocess.PIPE
if subprocess.mswindows:
from win32file import ReadFile, WriteFile
from win32pipe import PeekNamedPipe
import msvcrt
else:
import select
import fcntl
if j.core.platformtype.myplatform.isLinux():
try:
... |
def log(self, message, category="", level=5):
category = "expect.%s" % category
category = category.strip(".")
j.logger.log(message, category=category, level=level)
def enableCleanString(self):
"""
All output will be cleaned from ANSI code and other unwanted garbage
... | j.logger.addConsoleLogCategory("expect")
PIPE = subprocess.PIPE
self._prompt = ""
if not cmd:
if cmd == "" and j.core.platformtype.myplatform.isWindows():
cmd = 'cmd'
if cmd == "" and not j.core.platformtype.myplatform.isWindows():
cmd = '... | identifier_body |
Expect.py |
import os
import subprocess
import errno
from JumpScale import j
PIPE = subprocess.PIPE
if subprocess.mswindows:
from win32file import ReadFile, WriteFile
from win32pipe import PeekNamedPipe
import msvcrt
else:
import select
import fcntl
if j.core.platformtype.myplatform.isLinux():
try:
... |
self.enableCleanString()
def log(self, message, category="", level=5):
category = "expect.%s" % category
category = category.strip(".")
j.logger.log(message, category=category, level=level)
def enableCleanString(self):
"""
All output will be cleaned from ANSI ... | self.pexpect = pexpect.spawn(cmd)
if cmd == "sh":
self.expect("#")
self.setPrompt()
self.prompt() | conditional_block |
__main__.py | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import logging
import click
import socket
from mkdocs import __version__
from mkdocs import utils
from mkdocs import exceptions
from mkdocs import config
from mkdocs.commands import build, gh_deploy, new, serve
log = logging.getLogger(__na... |
clean_help = "Remove old files from the site_dir before building (the default)."
config_help = "Provide a specific MkDocs config"
dev_addr_help = ("IP address and port to serve documentation locally (default: "
"localhost:8000)")
strict_help = ("Enable strict mode. This will cause MkDocs to abort th... | f = verbose_option(f)
f = quiet_option(f)
return f | identifier_body |
__main__.py | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import logging
import click
import socket
from mkdocs import __version__
from mkdocs import utils
from mkdocs import exceptions
from mkdocs import config
from mkdocs.commands import build, gh_deploy, new, serve
log = logging.getLogger(__na... | (project_directory):
"""Create a new MkDocs project"""
new.new(project_directory)
if __name__ == '__main__': # pragma: no cover
cli()
| new_command | identifier_name |
__main__.py | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import logging
import click
import socket
from mkdocs import __version__
from mkdocs import utils
from mkdocs import exceptions
from mkdocs import config
from mkdocs.commands import build, gh_deploy, new, serve
log = logging.getLogger(__na... |
if __name__ == '__main__': # pragma: no cover
cli() | random_line_split | |
__main__.py | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import logging
import click
import socket
from mkdocs import __version__
from mkdocs import utils
from mkdocs import exceptions
from mkdocs import config
from mkdocs.commands import build, gh_deploy, new, serve
log = logging.getLogger(__na... |
return click.option('-q', '--quiet',
is_flag=True,
expose_value=False,
help='Silence warnings',
callback=callback)(f)
def common_options(f):
f = verbose_option(f)
f = quiet_option(f)
return f
clean_help ... | state.logger.setLevel(logging.ERROR) | conditional_block |
test_livemigrationops.py | # Copyright 2014 Cloudbase Solutions Srl
# 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 r... | mock_instance = fake_instance.fake_instance_obj(self.context)
self._livemigrops.post_live_migration_at_destination(
self.context, mock_instance, network_info=mock.sentinel.NET_INFO,
block_migration=mock.sentinel.BLOCK_INFO)
mock_log_vm.assert_called_once_with(mock_instance.name,
... | identifier_body | |
test_livemigrationops.py | # Copyright 2014 Cloudbase Solutions Srl
# 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 r... |
import mock
from os_win import exceptions as os_win_exc
from oslo_config import cfg
from jacket.tests.compute.unit import fake_instance
from jacket.tests.compute.unit.virt.hyperv import test_base
from jacket.compute.virt.hyperv import livemigrationops
CONF = cfg.CONF
class LiveMigrationOpsTestCase(test_base.HyperV... | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License. | random_line_split |
test_livemigrationops.py | # Copyright 2014 Cloudbase Solutions Srl
# 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 r... |
def test_live_migration(self):
self._test_live_migration(side_effect=None)
def test_live_migration_exception(self):
self._test_live_migration(side_effect=os_win_exc.HyperVException)
@mock.patch('compute.virt.hyperv.volumeops.VolumeOps'
'.ebs_root_in_block_devices')
@m... | self._livemigrops.live_migration(context=self.context,
instance_ref=mock_instance,
dest=fake_dest,
post_method=mock_post,
recover_method=moc... | conditional_block |
test_livemigrationops.py | # Copyright 2014 Cloudbase Solutions Srl
# 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 r... | (self, mock_log_vm):
mock_instance = fake_instance.fake_instance_obj(self.context)
self._livemigrops.post_live_migration_at_destination(
self.context, mock_instance, network_info=mock.sentinel.NET_INFO,
block_migration=mock.sentinel.BLOCK_INFO)
mock_log_vm.assert_called_o... | test_post_live_migration_at_destination | identifier_name |
__init__.py | # coding=utf-8
from __future__ import unicode_literals
from collections import OrderedDict
from .. import BaseProvider
localized = True
class Provider(BaseProvider):
all_colors = OrderedDict((
("AliceBlue", "#F0F8FF"),
("AntiqueWhite", "#FAEBD7"),
("Aqua", "#00FFFF"),
("Aquamarin... | ("LightGray", "#D3D3D3"),
("LightGreen", "#90EE90"),
("LightPink", "#FFB6C1"),
("LightSalmon", "#FFA07A"),
("LightSeaGreen", "#20B2AA"),
("LightSkyBlue", "#87CEFA"),
("LightSlateGray", "#778899"),
("LightSteelBlue", "#B0C4DE"),
("LightYellow", "#FF... | ("LightCyan", "#E0FFFF"),
("LightGoldenRodYellow", "#FAFAD2"), | random_line_split |
__init__.py | # coding=utf-8
from __future__ import unicode_literals
from collections import OrderedDict
from .. import BaseProvider
localized = True
class Provider(BaseProvider):
| all_colors = OrderedDict((
("AliceBlue", "#F0F8FF"),
("AntiqueWhite", "#FAEBD7"),
("Aqua", "#00FFFF"),
("Aquamarine", "#7FFFD4"),
("Azure", "#F0FFFF"),
("Beige", "#F5F5DC"),
("Bisque", "#FFE4C4"),
("Black", "#000000"),
("BlanchedAlmond", "#FFEBCD")... | identifier_body | |
__init__.py | # coding=utf-8
from __future__ import unicode_literals
from collections import OrderedDict
from .. import BaseProvider
localized = True
class Provider(BaseProvider):
all_colors = OrderedDict((
("AliceBlue", "#F0F8FF"),
("AntiqueWhite", "#FAEBD7"),
("Aqua", "#00FFFF"),
("Aquamarin... | (self):
return self.random_element(self.safe_colors)
def hex_color(self):
return "#{0}".format(
("%x" %
self.random_int(
1, 16777215)).ljust(
6, '0'))
def safe_hex_color(self):
color = ("%x" % self.random_int(0, 255)).ljust(3, '... | safe_color_name | identifier_name |
addKeyboard.js | import $ from 'jquery';
import keyboard from 'virtual-keyboard';
$.fn.addKeyboard = function () {
return this.keyboard({
openOn: null, | stayOpen: false,
layout: 'custom',
customLayout: {
'normal': ['7 8 9 {c}', '4 5 6 {del}', '1 2 3 {sign}', '0 0 {dec} {a}'],
},
position: {
// null (attach to input/textarea) or a jQuery object (attach elsewhere)
of: null,
my: 'center top',
at: 'center top',
// at2... | random_line_split | |
generate_logo.py | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.patches import PathPatch
from matplotlib.path import Path
from matplotlib.transforms import Bbox
from scipy import stats
x = np.linspace(0, 1, 200)
pdfx = stats.beta(2, 5).pdf(x)
path = Path(np.array([x, pdfx]).transpose())
patch = P... | clip_on=True,
)
plt.axis("off")
plt.ylim(0, 5.5)
plt.xlim(0, 0.9)
bbox = Bbox([[0.75, 0.5], [5.4, 2.2]])
# plt.savefig('logo_00.png', dpi=300, bbox_inches=bbox, transparent=True)
plt.text(
x=0.04,
y=-0.01,
s="ArviZ",
clip_on=True,
fontdict={"name": "ubuntu mono", "fontsize": 62},
color="... | interpolation="bicubic",
origin="lower",
extent=[0, 1, 0.0, 5],
aspect="auto",
clip_path=patch, | random_line_split |
sync.js | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
;(function($, Mozilla) {
'use strict';
window.dataLayer = window.dataLayer || [];
setTimeout(Mozilla.s... |
// Variation #1-4: Firefox for Desktop
} else if (client.isFirefoxDesktop) {
if (fxMasterVersion >= 31) {
// Set syncCapable so we know not to send tracking info
// again later
syncCapable = true;
// Query if the UITour API ... | random_line_split | |
sync.js | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
;(function($, Mozilla) {
'use strict';
window.dataLayer = window.dataLayer || [];
setTimeout(Mozilla.s... |
// Setup GA tracking for Firefox download button
$('#cta-firefox, .download-button .download-link').attr({
'data-interaction': 'download click',
'data-download-version': 'Firefox'
});
// Setup GA tracking for Firefox update button
$('#cta-update').attr({
'data-interaction'... | {
window.dataLayer.push({
'event': 'page-load',
'browser': state
});
} | conditional_block |
NSCFBackgroundDownloadTask.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Bartosz Janda
#
# 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 w... | return helpers.generic_summary_provider(value_obj, internal_dict, NSCFBackgroundDownloadTaskSyntheticProvider) | identifier_body | |
NSCFBackgroundDownloadTask.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Bartosz Janda
#
# 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 w... |
return None
def summary_provider(value_obj, internal_dict):
return helpers.generic_summary_provider(value_obj, internal_dict, NSCFBackgroundDownloadTaskSyntheticProvider)
| return "finished" | conditional_block |
NSCFBackgroundDownloadTask.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Bartosz Janda
#
# 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 w... | (self, value_obj, internal_dict):
super(NSCFBackgroundDownloadTaskSyntheticProvider, self).__init__(value_obj, internal_dict)
self.type_name = "__NSCFBackgroundDownloadTask"
self.register_child_value("finished", ivar_name="_finished",
primitive_value_function=S... | __init__ | identifier_name |
NSCFBackgroundDownloadTask.py | #! /usr/bin/env python
# -*- coding: utf-8 -*- | #
# 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, modify, merge, publish, distribute, sublicense, and/or sell copi... |
# The MIT License (MIT)
#
# Copyright (c) 2015 Bartosz Janda | random_line_split |
webpack.config.demo.js | /* globals __dirname */
'use strict';
var autoprefixer = require('autoprefixer-core');
var Webpack = require('webpack');
var HtmlWebpack = require('html-webpack-plugin');
var path = require('path');
var npmPath = path.resolve(__dirname, 'node_modules');
var config = {
sassOptions : ( | entry: [
'./demo/bootstrap.js',
'webpack/hot/dev-server',
'webpack-dev-server/client?http://localhost:9001'
],
module: {
loaders: [
{
test : /\.(jsx|js)$/,
loaders : ['babel', 'react-hot'],
exclude : /node_modules... | '?outputStyle=nested&includePaths[]=' + npmPath
)
};
module.exports = { | random_line_split |
test-tls-enable-trace-cli.js | // Flags: --expose-internals
'use strict';
const common = require('../common');
if (!common.hasCrypto) common.skip('missing crypto');
const fixtures = require('../common/fixtures');
// Test --trace-tls CLI flag.
const assert = require('assert');
const { fork } = require('child_process');
if (process.argv[2] === 'tes... | () {
const {
connect, keys
} = require(fixtures.path('tls-connect'));
connect({
client: {
checkServerIdentity: (servername, cert) => { },
ca: `${keys.agent1.cert}\n${keys.agent6.ca}`,
},
server: {
cert: keys.agent6.cert,
key: keys.agent6.key
},
}, common.mustCall((er... | test | identifier_name |
test-tls-enable-trace-cli.js | // Flags: --expose-internals
'use strict';
const common = require('../common');
if (!common.hasCrypto) common.skip('missing crypto');
const fixtures = require('../common/fixtures');
// Test --trace-tls CLI flag.
const assert = require('assert');
const { fork } = require('child_process');
if (process.argv[2] === 'tes... | {
const {
connect, keys
} = require(fixtures.path('tls-connect'));
connect({
client: {
checkServerIdentity: (servername, cert) => { },
ca: `${keys.agent1.cert}\n${keys.agent6.ca}`,
},
server: {
cert: keys.agent6.cert,
key: keys.agent6.key
},
}, common.mustCall((err, ... | identifier_body | |
test-tls-enable-trace-cli.js | // Flags: --expose-internals
'use strict';
const common = require('../common');
if (!common.hasCrypto) common.skip('missing crypto');
const fixtures = require('../common/fixtures');
// Test --trace-tls CLI flag.
const assert = require('assert');
const { fork } = require('child_process');
if (process.argv[2] === 'tes... | } | assert.ifError(pair.client.err);
return cleanup();
})); | random_line_split |
highlightable.ts | import {
ChangeDetectorRef,
SimpleChanges,
NgZone,
} from '@angular/core';
import {highlightTime} from '../../utils/configuration';
const initialTimespan = highlightTime;
export abstract class Highlightable {
isUpdated = false;
private timespan = initialTimespan; // scales down
private resetUpdateState... |
protected ngOnChanges(changes: SimpleChanges) {
if (typeof this.elementIsUpdated === 'function') {
if (this.elementIsUpdated(changes)) {
this.changed();
}
}
else {
this.changed();
}
}
protected ngOnDestroy() {
this.elementChangeDetector = null;
this.clear();
... | {} | identifier_body |
highlightable.ts | import {
ChangeDetectorRef,
SimpleChanges,
NgZone,
} from '@angular/core';
import {highlightTime} from '../../utils/configuration';
const initialTimespan = highlightTime;
export abstract class Highlightable {
isUpdated = false;
private timespan = initialTimespan; // scales down
private resetUpdateState... |
else {
this.changed();
}
}
protected ngOnDestroy() {
this.elementChangeDetector = null;
this.clear();
}
protected clear() {
clearTimeout(this.resetUpdateState);
this.resetUpdateState = null;
this.isUpdated = false;
if (this.elementChangeDetector) {
this.element... | {
if (this.elementIsUpdated(changes)) {
this.changed();
}
} | conditional_block |
highlightable.ts | import {
ChangeDetectorRef,
SimpleChanges,
NgZone,
} from '@angular/core';
import {highlightTime} from '../../utils/configuration'; | const initialTimespan = highlightTime;
export abstract class Highlightable {
isUpdated = false;
private timespan = initialTimespan; // scales down
private resetUpdateState;
constructor(
private elementChangeDetector: ChangeDetectorRef,
private elementIsUpdated?: (changes?: SimpleChanges) => boolean
... | random_line_split | |
highlightable.ts | import {
ChangeDetectorRef,
SimpleChanges,
NgZone,
} from '@angular/core';
import {highlightTime} from '../../utils/configuration';
const initialTimespan = highlightTime;
export abstract class Highlightable {
isUpdated = false;
private timespan = initialTimespan; // scales down
private resetUpdateState... | () {
this.elementChangeDetector = null;
this.clear();
}
protected clear() {
clearTimeout(this.resetUpdateState);
this.resetUpdateState = null;
this.isUpdated = false;
if (this.elementChangeDetector) {
this.elementChangeDetector.detectChanges();
}
}
protected changed() {
... | ngOnDestroy | identifier_name |
vec.rs | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
// -*- rust -*-
pub fn main() {
let v: ~[int] = ~[10, 20];
assert!((v[0] == 10));
assert!((v[1] == 20));
let mut x: int = 0;
assert!((v[x] == 10));
assert!((v[x + 1] == 20));
x = x + 1;
assert!((v[x] == 20));
assert!((v[x - 1] == 10));
} | // option. This file may not be copied, modified, or distributed
// except according to those terms.
| random_line_split |
vec.rs | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | {
let v: ~[int] = ~[10, 20];
assert!((v[0] == 10));
assert!((v[1] == 20));
let mut x: int = 0;
assert!((v[x] == 10));
assert!((v[x + 1] == 20));
x = x + 1;
assert!((v[x] == 20));
assert!((v[x - 1] == 10));
} | identifier_body | |
vec.rs | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | () {
let v: ~[int] = ~[10, 20];
assert!((v[0] == 10));
assert!((v[1] == 20));
let mut x: int = 0;
assert!((v[x] == 10));
assert!((v[x + 1] == 20));
x = x + 1;
assert!((v[x] == 20));
assert!((v[x - 1] == 10));
}
| main | identifier_name |
playback.py | # -*- coding: utf-8 -*-
#
# Copyright 2011 Liftoff Software Corporation | #
__doc__ = """\
playback.py - A plugin for Gate One that adds support for saving and playing
back session recordings.
.. note:: Yes this only contains one function and it is exposed to clients through a WebSocket hook.
Hooks
-----
This Python plugin file implements the following hooks::
hooks = {
'WebS... | random_line_split | |
playback.py | # -*- coding: utf-8 -*-
#
# Copyright 2011 Liftoff Software Corporation
#
__doc__ = """\
playback.py - A plugin for Gate One that adds support for saving and playing
back session recordings.
.. note:: Yes this only contains one function and it is exposed to clients through a WebSocket hook.
Hooks
-----
This Py... | (self):
"""
Returns the rendered 256-color CSS.
"""
colors_256_path = self.render_256_colors()
mtime = os.stat(colors_256_path).st_mtime
cached_filename = "%s:%s" % (colors_256_path.replace('/', '_'), mtime)
cache_dir = self.ws.settings['cache_dir']
cached_file_path = os.path.join(cache_... | get_256_colors | identifier_name |
playback.py | # -*- coding: utf-8 -*-
#
# Copyright 2011 Liftoff Software Corporation
#
__doc__ = """\
playback.py - A plugin for Gate One that adds support for saving and playing
back session recordings.
.. note:: Yes this only contains one function and it is exposed to clients through a WebSocket hook.
Hooks
-----
This Py... |
else:
# Debug mode is enabled
with open(os.path.join(cache_dir, '256_colors.css')) as f:
colors_256 = f.read()
return colors_256
def save_recording(self, settings):
"""
Handles uploads of session recordings and returns them to the client in a
self-contained HTML file th... | with open(cached_file_path) as f:
colors_256 = f.read() | conditional_block |
playback.py | # -*- coding: utf-8 -*-
#
# Copyright 2011 Liftoff Software Corporation
#
__doc__ = """\
playback.py - A plugin for Gate One that adds support for saving and playing
back session recordings.
.. note:: Yes this only contains one function and it is exposed to clients through a WebSocket hook.
Hooks
-----
This Py... |
def save_recording(self, settings):
"""
Handles uploads of session recordings and returns them to the client in a
self-contained HTML file that will auto-start playback.
..note:: The real crux of the code that handles this is in the template.
"""
#import tornado.template
from datetime imp... | """
Returns the rendered 256-color CSS.
"""
colors_256_path = self.render_256_colors()
mtime = os.stat(colors_256_path).st_mtime
cached_filename = "%s:%s" % (colors_256_path.replace('/', '_'), mtime)
cache_dir = self.ws.settings['cache_dir']
cached_file_path = os.path.join(cache_dir, cached_... | identifier_body |
usage.rs | // Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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 la... | let config = match (fs::File::open(&config_file), raw_args.flag_config.is_some()) {
// Load config file
(Ok(mut file), _) => {
println_stderr!("Loading config file from {}", &config_file);
let mut config = String::new();
file.read_to_string(&mut config).map_err(|e| ArgsError::Config(conf... | let config_file = raw_args.flag_config.clone().unwrap_or_else(|| raw_args.clone().into_args(Config::default()).flag_config);
let config_file = replace_home(&::dir::default_data_path(), &config_file); | random_line_split |
jquery.outline.js | /* jQuery.fracs 0.15.1 - http://larsjung.de/jquery-fracs/ */
(function () {
'use strict';
// Some often used references.
var $ = jQuery;
var $window = $(window);
var extend = $.extend;
var fracs = $.fracs;
var Rect = fracs.Rect;
var Viewport = fracs.Viewport;
// Outline
// -------
var defaults = {
crop: fal... |
function applyStyles() {
$.each(settings.styles, function (idx, style) {
find(style.selector).each(function () {
drawElement(this, style.strokeWidth, style.strokeStyle, style.fillStyle);
});
});
}
function drawViewport() {
var style = drag ... | } | random_line_split |
jquery.outline.js | /* jQuery.fracs 0.15.1 - http://larsjung.de/jquery-fracs/ */
(function () {
'use strict';
// Some often used references.
var $ = jQuery;
var $window = $(window);
var extend = $.extend;
var fracs = $.fracs;
var Rect = fracs.Rect;
var Viewport = fracs.Viewport;
// Outline
// -------
var defaults = {
crop: fal... |
function onDrag(event) {
var r = Rect.ofElement(canvas);
var x = (event.pageX - r.left) / currentScale - currentViewportRect.width * focusWidth;
var y = (event.pageY - r.top) / currentScale - currentViewportRect.height * focusHeight;
viewportObj.scrollTo(x, y, settings.duration);... | {
currentContentRect = Rect.ofContent(viewport);
currentViewportRect = Rect.ofViewport(viewport, true);
currentScale = Math.min(width / currentContentRect.width, height / currentContentRect.height);
if (settings.crop) {
$canvas.attr('width', currentContentRect.width * curre... | identifier_body |
jquery.outline.js | /* jQuery.fracs 0.15.1 - http://larsjung.de/jquery-fracs/ */
(function () {
'use strict';
// Some often used references.
var $ = jQuery;
var $window = $(window);
var extend = $.extend;
var fracs = $.fracs;
var Rect = fracs.Rect;
var Viewport = fracs.Viewport;
// Outline
// -------
var defaults = {
crop: fal... | () {
$canvas.css('cursor', 'pointer').mousedown(onDragStart);
$viewport.on('load resize scroll', draw);
draw();
}
init();
this.redraw = draw;
}
// Register the plug-in
// ===================
// The namespace used to register the plug-in and to attach
// data to elements.
var nam... | init | identifier_name |
jquery.outline.js | /* jQuery.fracs 0.15.1 - http://larsjung.de/jquery-fracs/ */
(function () {
'use strict';
// Some often used references.
var $ = jQuery;
var $window = $(window);
var extend = $.extend;
var fracs = $.fracs;
var Rect = fracs.Rect;
var Viewport = fracs.Viewport;
// Outline
// -------
var defaults = {
crop: fal... |
drag = true;
event.preventDefault();
$canvas.css('cursor', 'crosshair').addClass('dragOn');
$('body').css('cursor', 'crosshair');
$window.on('mousemove', onDrag).one('mouseup', onDragEnd);
onDrag(event);
}
function init() {
$canvas.css('cursor', 'poin... | {
focusWidth = settings.focusWidth;
focusHeight = settings.focusHeight;
} | conditional_block |
lib.rs | //! # RACC -- Rust Another Compiler-Compiler
//!
//! This is a port of Barkeley YACC to Rust. It runs as a procedural macro, and so allows you to
//! define grammars directly in Rust source code, rather than calling an external tool or writing
//! a `build.rs` script.
//!
//! # How to write a grammar
//!
//! Here is a... | //! it were an option).
//!
//! RACC provides a safe means to access such data. Rules may access an "app context".
//! When the app calls `push_token` or `finish`, the app also passes a `&mut` reference
//! to an "app context" value. The type of this value can be anything defined by the
//! application. (It is neces... | //! state, when executing rule actions. In C parsers, this is usually done with global
//! variables. However, this is not an option in Rust (and would be undesirable, even if | random_line_split |
lib.rs | //! # RACC -- Rust Another Compiler-Compiler
//!
//! This is a port of Barkeley YACC to Rust. It runs as a procedural macro, and so allows you to
//! define grammars directly in Rust source code, rather than calling an external tool or writing
//! a `build.rs` script.
//!
//! # How to write a grammar
//!
//! Here is a... | (i16);
impl SymbolOrRule {
pub fn rule(rule: Rule) -> SymbolOrRule {
assert!(rule.0 > 0);
Self(-rule.0)
}
pub fn symbol(symbol: Symbol) -> SymbolOrRule {
assert!(symbol.0 >= 0);
Self(symbol.0)
}
pub fn is_symbol(self) -> bool {
self.0 >= 0
}
pub fn is... | SymbolOrRule | identifier_name |
lib.rs | //! # RACC -- Rust Another Compiler-Compiler
//!
//! This is a port of Barkeley YACC to Rust. It runs as a procedural macro, and so allows you to
//! define grammars directly in Rust source code, rather than calling an external tool or writing
//! a `build.rs` script.
//!
//! # How to write a grammar
//!
//! Here is a... | else {
write!(fmt, "Rule({})", self.as_rule().index())
}
}
}
type StateOrRule = i16;
use reader::GrammarDef;
fn racc_grammar2(tokens: proc_macro2::TokenStream) -> syn::Result<proc_macro2::TokenStream> {
let grammar_def: GrammarDef = syn::parse2::<GrammarDef>(tokens)?;
let context_par... | {
write!(fmt, "Symbol({})", self.as_symbol().index())
} | conditional_block |
lib.rs | //! # RACC -- Rust Another Compiler-Compiler
//!
//! This is a port of Barkeley YACC to Rust. It runs as a procedural macro, and so allows you to
//! define grammars directly in Rust source code, rather than calling an external tool or writing
//! a `build.rs` script.
//!
//! # How to write a grammar
//!
//! Here is a... |
pub fn as_rule(self) -> Rule {
assert!(self.is_rule());
Rule(-self.0)
}
}
use core::fmt::{Debug, Formatter};
impl Debug for SymbolOrRule {
fn fmt(&self, fmt: &mut Formatter<'_>) -> core::fmt::Result {
if self.is_symbol() {
write!(fmt, "Symbol({})", self.as_symbol().inde... | {
assert!(self.is_symbol());
Symbol(self.0)
} | identifier_body |
react-swipe-tests.tsx | import * as React from "react";
import * as ReactSwipe from "react-swipe";
class ReactSwipeTest extends React.PureComponent {
private swipeComponent: ReactSwipe | null = null;
private onPrev: React.MouseEventHandler<HTMLButtonElement> = () => {
if (this.swipeComponent != null) {
this.swipe... |
>
<div>PANE 1</div>
<div>PANE 2</div>
<div>PANE 3</div>
</ReactSwipe>
<button onClick={this.onPrev}>Prev</button>
<button onClick={this.onNext}>Next</button>
<button onClick={this.onSlideToStart}>Slide to end</b... | {
const swipeOptions: SwipeOptions = {
auto: 12,
disableScroll: true,
stopPropagation: true
};
const style: ReactSwipe.Style = {
child: {
backgroundColor: "yellow"
},
container: {
backgroundC... | identifier_body |
react-swipe-tests.tsx | import * as React from "react";
import * as ReactSwipe from "react-swipe";
class ReactSwipeTest extends React.PureComponent {
private swipeComponent: ReactSwipe | null = null;
private onPrev: React.MouseEventHandler<HTMLButtonElement> = () => {
if (this.swipeComponent != null) {
this.swipe... | } | </div>;
} | random_line_split |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.