file_name
large_stringlengths
4
140
prefix
large_stringlengths
0
12.1k
suffix
large_stringlengths
0
12k
middle
large_stringlengths
0
7.51k
fim_type
large_stringclasses
4 values
shipping_container.py
# -*- coding: utf-8 -*- # © 2016 Comunitea - Kiko Sanchez <kiko@comunitea.com> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0. from odoo import api, fields, models, _ import odoo.addons.decimal_precision as dp class ShippingContainerType(models.Model): _name = "shipping.container.type" name = fi...
return super(ShippingContainer, self).write(vals)
or pick in container.picking_ids: pick.min_date = vals['date_expected']
conditional_block
shipping_container.py
# -*- coding: utf-8 -*- # © 2016 Comunitea - Kiko Sanchez <kiko@comunitea.com> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0. from odoo import api, fields, models, _ import odoo.addons.decimal_precision as dp class ShippingContainerType(models.Model): _name = "shipping.container.type" name = fi...
self): self.state = 'destination' def set_loading(self): self.state = 'loading' @api.multi def write(self, vals): if vals.get('date_expected', False): for container in self: if vals['date_expected'] != container.date_expected: for pic...
et_destination(
identifier_name
messageevent.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 dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::MessageEve...
false, false, message, DOMString::new(), DOMString::new()); messageevent.upcast::<Event>().fire(target); } } impl MessageEventMethods for MessageEvent { #[allow(unsafe_code)] // https://html.spec.whatwg.org/multipage/#dom-messageevent-data...
atom!("message"),
random_line_split
messageevent.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 dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::MessageEve...
(global: &GlobalScope, data: HandleValue, origin: DOMString, lastEventId: DOMString) -> Root<MessageEvent> { let ev = box MessageEvent { event: Event::new_inherited(), data: Heap::new(data.get()), ...
new_initialized
identifier_name
messageevent.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 dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::MessageEve...
// https://dom.spec.whatwg.org/#dom-event-istrusted fn IsTrusted(&self) -> bool { self.event.IsTrusted() } }
{ self.lastEventId.clone() }
identifier_body
schemas-plugin.ts
/// <reference path="../../typings/node/node.d.ts"/> /// <reference path="../../typings/schemas-files-service/schemas-plugin.d.ts"/> /// <reference path="../../typings/schemas-files-service/schemas-protocol.d.ts"/> /// <reference path="../../typings/tv4-via-typenames-node/tv4-via-typenames-node.d.ts"/> // Assume expres...
(msg, respond) { schema_files = new SchemaFiles({ schemasDir: options.schemasDir}); var init_promise = schema_files.init(); var schemas_ready_promise = init_promise.then(function (result) { let filenames = fs.readdirSync(options.schemasDir); let typenames = []; ...
init
identifier_name
schemas-plugin.ts
/// <reference path="../../typings/node/node.d.ts"/> /// <reference path="../../typings/schemas-files-service/schemas-plugin.d.ts"/> /// <reference path="../../typings/schemas-files-service/schemas-protocol.d.ts"/> /// <reference path="../../typings/tv4-via-typenames-node/tv4-via-typenames-node.d.ts"/> // Assume expres...
respond(new Error('No schema found in schemasDir=' + options.schemasDir)); } return schema_files.loadRequiredSchema(typenames); }); schemas_ready_promise.then((result) => { respond(); }) .catch((error) => { respond(error); ...
{ var schema_files: SchemaFiles; this.add( 'init:schemas', init ); function init(msg, respond) { schema_files = new SchemaFiles({ schemasDir: options.schemasDir}); var init_promise = schema_files.init(); var schemas_ready_promise = init_promise.then(function (result) { ...
identifier_body
schemas-plugin.ts
/// <reference path="../../typings/node/node.d.ts"/> /// <reference path="../../typings/schemas-files-service/schemas-plugin.d.ts"/> /// <reference path="../../typings/schemas-files-service/schemas-protocol.d.ts"/>
import tv4vtn = require('tv4-via-typenames-node'); import SchemaFiles = tv4vtn.SchemaFiles; import SchemasPlugin = require('schemas-plugin'); function schemas( options: SchemasPlugin.Options ) { var schema_files: SchemaFiles; this.add( 'init:schemas', init ); function init(msg, respond) { sche...
/// <reference path="../../typings/tv4-via-typenames-node/tv4-via-typenames-node.d.ts"/> // Assume express is using validation of the msg via json-schema import fs = require('fs');
random_line_split
schemas-plugin.ts
/// <reference path="../../typings/node/node.d.ts"/> /// <reference path="../../typings/schemas-files-service/schemas-plugin.d.ts"/> /// <reference path="../../typings/schemas-files-service/schemas-protocol.d.ts"/> /// <reference path="../../typings/tv4-via-typenames-node/tv4-via-typenames-node.d.ts"/> // Assume expres...
}) } export = schemas
{ let schema = schema_files.test.getLoadedSchema(msg.typename); if (schema) { respond(null, {schema}); } else { respond(null, {error: 'no schema for typename=' + msg.typename}); } }
conditional_block
test_currency.py
# -*- coding: utf-8 -*- import pytest import six from sqlalchemy_utils import Currency, i18n @pytest.fixture def set_get_locale(): i18n.get_locale = lambda: i18n.babel.Locale('en') @pytest.mark.skipif('i18n.babel is None') @pytest.mark.usefixtures('set_get_locale') class TestCurrency(object): def test_ini...
def test_equality_operator(self): assert Currency('USD') == 'USD' assert 'USD' == Currency('USD') assert Currency('USD') == Currency('USD') def test_non_equality_operator(self): assert Currency('USD') != 'EUR' assert not (Currency('USD') != 'USD') def test_unicode(s...
sert Currency(code).symbol == symbol
identifier_body
test_currency.py
# -*- coding: utf-8 -*- import pytest import six from sqlalchemy_utils import Currency, i18n @pytest.fixture def set_get_locale(): i18n.get_locale = lambda: i18n.babel.Locale('en') @pytest.mark.skipif('i18n.babel is None') @pytest.mark.usefixtures('set_get_locale') class TestCurrency(object): def test_ini...
('USD', u'$'), ('EUR', u'€') ) ) def test_symbol_property(self, code, symbol): assert Currency(code).symbol == symbol def test_equality_operator(self): assert Currency('USD') == 'USD' assert 'USD' == Currency('USD') assert Currency('USD') == C...
(
random_line_split
test_currency.py
# -*- coding: utf-8 -*- import pytest import six from sqlalchemy_utils import Currency, i18n @pytest.fixture def set_get_locale(): i18n.get_locale = lambda: i18n.babel.Locale('en') @pytest.mark.skipif('i18n.babel is None') @pytest.mark.usefixtures('set_get_locale') class TestCurrency(object): def test_ini...
elf): assert Currency('USD') == 'USD' assert 'USD' == Currency('USD') assert Currency('USD') == Currency('USD') def test_non_equality_operator(self): assert Currency('USD') != 'EUR' assert not (Currency('USD') != 'USD') def test_unicode(self): currency = Currenc...
st_equality_operator(s
identifier_name
buffer.rs
use crate::parsing::ParsingContext; use amq_protocol::frame::{BackToTheBuffer, GenError, GenResult, WriteContext}; use futures_lite::io::{AsyncRead, AsyncWrite}; use std::{ cmp, io::{self, IoSlice, IoSliceMut}, pin::Pin, task::{Context, Poll}, }; #[derive(Debug, PartialEq, Clone)] pub(crate) struct Buf...
; self.fill(amt); Ok(amt) } fn flush(&mut self) -> io::Result<()> { Ok(()) } } impl BackToTheBuffer for &mut Buffer { fn reserve_write_use< Tmp, Gen: Fn(WriteContext<Self>) -> Result<(WriteContext<Self>, Tmp), GenError>, Before: Fn(WriteContext<Self>, Tm...
{ let mut space = &mut self.memory[self.end..self.position]; space.write(data)? }
conditional_block
buffer.rs
use crate::parsing::ParsingContext; use amq_protocol::frame::{BackToTheBuffer, GenError, GenResult, WriteContext}; use futures_lite::io::{AsyncRead, AsyncWrite}; use std::{ cmp, io::{self, IoSlice, IoSliceMut}, pin::Pin, task::{Context, Poll}, }; #[derive(Debug, PartialEq, Clone)] pub(crate) struct Buf...
fn reserve_write_use< Tmp, Gen: Fn(WriteContext<Self>) -> Result<(WriteContext<Self>, Tmp), GenError>, Before: Fn(WriteContext<Self>, Tmp) -> GenResult<Self>, >( s: WriteContext<Self>, reserved: usize, gen: &Gen, before: &Before, ) -> Result<WriteConte...
} } impl BackToTheBuffer for &mut Buffer {
random_line_split
buffer.rs
use crate::parsing::ParsingContext; use amq_protocol::frame::{BackToTheBuffer, GenError, GenResult, WriteContext}; use futures_lite::io::{AsyncRead, AsyncWrite}; use std::{ cmp, io::{self, IoSlice, IoSliceMut}, pin::Pin, task::{Context, Poll}, }; #[derive(Debug, PartialEq, Clone)] pub(crate) struct Buf...
(&mut self, new_size: usize) -> bool { if self.capacity >= new_size { return false; } let old_capacity = self.capacity; let growth = new_size - old_capacity; self.memory.resize(new_size, 0); self.capacity = new_size; if self.end <= self.position && ...
grow
identifier_name
buffer.rs
use crate::parsing::ParsingContext; use amq_protocol::frame::{BackToTheBuffer, GenError, GenResult, WriteContext}; use futures_lite::io::{AsyncRead, AsyncWrite}; use std::{ cmp, io::{self, IoSlice, IoSliceMut}, pin::Pin, task::{Context, Poll}, }; #[derive(Debug, PartialEq, Clone)] pub(crate) struct Buf...
pub(crate) fn poll_write_to<T: AsyncWrite>( &self, cx: &mut Context<'_>, writer: Pin<&mut T>, ) -> Poll<io::Result<usize>> { if self.available_data() == 0 { Poll::Ready(Ok(0)) } else if self.end > self.position { writer.poll_write(cx, &self.memor...
{ let cnt = cmp::min(count, self.available_space()); self.end += cnt; self.end %= self.capacity; self.available_data += cnt; cnt }
identifier_body
scalar.rs
use std::cmp; use std::fmt; use std::ops; use num; use math::common::LinearInterpolate; pub type IntScalar = i32; #[cfg(not(feature = "float64"))] pub type FloatScalar = f32; #[cfg(feature = "float64")] pub type FloatScalar = f64; pub trait BaseNum where Self: Copy + Clone + fmt::Debug + cmp::PartialOrd, Sel...
pub fn partial_max<T: cmp::PartialOrd>(a: T, b: T) -> T { if a > b { a } else { b } } impl LinearInterpolate for f32 { type Scalar = f32; } impl LinearInterpolate for f64 { type Scalar = f64; }
{ if a < b { a } else { b } }
identifier_body
scalar.rs
use std::cmp; use std::fmt; use std::ops; use num; use math::common::LinearInterpolate; pub type IntScalar = i32; #[cfg(not(feature = "float64"))] pub type FloatScalar = f32; #[cfg(feature = "float64")] pub type FloatScalar = f64; pub trait BaseNum where Self: Copy + Clone + fmt::Debug + cmp::PartialOrd, Sel...
if a > b { a } else { b } } impl LinearInterpolate for f32 { type Scalar = f32; } impl LinearInterpolate for f64 { type Scalar = f64; }
pub fn partial_max<T: cmp::PartialOrd>(a: T, b: T) -> T {
random_line_split
scalar.rs
use std::cmp; use std::fmt; use std::ops; use num; use math::common::LinearInterpolate; pub type IntScalar = i32; #[cfg(not(feature = "float64"))] pub type FloatScalar = f32; #[cfg(feature = "float64")] pub type FloatScalar = f64; pub trait BaseNum where Self: Copy + Clone + fmt::Debug + cmp::PartialOrd, Sel...
} pub fn partial_max<T: cmp::PartialOrd>(a: T, b: T) -> T { if a > b { a } else { b } } impl LinearInterpolate for f32 { type Scalar = f32; } impl LinearInterpolate for f64 { type Scalar = f64; }
{ b }
conditional_block
scalar.rs
use std::cmp; use std::fmt; use std::ops; use num; use math::common::LinearInterpolate; pub type IntScalar = i32; #[cfg(not(feature = "float64"))] pub type FloatScalar = f32; #[cfg(feature = "float64")] pub type FloatScalar = f64; pub trait BaseNum where Self: Copy + Clone + fmt::Debug + cmp::PartialOrd, Sel...
<T: cmp::PartialOrd>(a: T, b: T) -> T { if a < b { a } else { b } } pub fn partial_max<T: cmp::PartialOrd>(a: T, b: T) -> T { if a > b { a } else { b } } impl LinearInterpolate for f32 { type Scalar = f32; } impl LinearInterpolate for f64 { type Scalar ...
partial_min
identifier_name
nagesenBox.worker.ts
namespace NaaS { class WorkerTimer { private timerID: number | null = null; public onMessage(e: MessageEvent): void { switch (e.data.cmd) { case 'Start': this.start(e.data.fps); break; case 'Stop': this.stop(); bre...
: void { if (this.timerID !== null) { self.clearInterval(this.timerID); this.timerID = null; } } private enqueue(args: ThrowCoinEventArgs): void { (self as any).postMessage({ cmd: 'Enqueue', args }); } } var workerTime...
op()
identifier_name
nagesenBox.worker.ts
namespace NaaS { class WorkerTimer { private timerID: number | null = null; public onMessage(e: MessageEvent): void { switch (e.data.cmd) { case 'Start': this.start(e.data.fps); break; case 'Stop': this.stop(); bre...
} private enqueue(args: ThrowCoinEventArgs): void { (self as any).postMessage({ cmd: 'Enqueue', args }); } } var workerTimer = new WorkerTimer(); self.addEventListener('message', e => workerTimer.onMessage(e)); }
self.clearInterval(this.timerID); this.timerID = null; }
conditional_block
nagesenBox.worker.ts
namespace NaaS { class WorkerTimer { private timerID: number | null = null; public onMessage(e: MessageEvent): void { switch (e.data.cmd) { case 'Start': this.start(e.data.fps); break; case 'Stop': this.stop(); bre...
this.timerID = self.setInterval(() => { (self as any).postMessage({ cmd: 'Interval' }); }, 1000 / fps); } } private stop(): void { if (this.timerID !== null) { self.clearInterval(this.timerID); t...
} private start(fps: number): void { if (this.timerID === null) {
random_line_split
seedBreedLookup.js
const mongoose = require("mongoose"); const db = require("../../models"); mongoose.Promise = global.Promise; //This file seeds the database mongoose.connect( process.env.MONGODB_URI || "mongodb://localhost/petrescuers", { useMongoClient: true } ); //Seeding the breed collection with the breed recommendatio...
process.exit(0); }) .catch(err => { console.error(err); process.exit(1); });
console.log(data.insertedIds.length + " records inserted!");
random_line_split
djangojs.js
\u09a8", "Cancel": "\u09ac\u09be\u09a4\u09bf\u09b2", "Choose": "\u09ac\u09be\u099b\u09be\u0987 \u0995\u09b0\u09c1\u09a8", "Choose a time": "\u09b8\u09ae\u09df \u09a8\u09bf\u09b0\u09cd\u09ac\u09be\u099a\u09a8 \u0995\u09b0\u09c1\u09a8", "Choose all": "\u09b8\u09ac \u09ac\u09be\u099b\u09be\u0987 \u0995\u09...
}; django.interpolate = function(fmt, obj, named) { if (named) { return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])}); } else { return fmt.replace(/%s/g, function(match){return String(obj.shift())}); } }; /* formatting library */ ...
random_line_split
djangojs.js
\u09a8", "Cancel": "\u09ac\u09be\u09a4\u09bf\u09b2", "Choose": "\u09ac\u09be\u099b\u09be\u0987 \u0995\u09b0\u09c1\u09a8", "Choose a time": "\u09b8\u09ae\u09df \u09a8\u09bf\u09b0\u09cd\u09ac\u09be\u099a\u09a8 \u0995\u09b0\u09c1\u09a8", "Choose all": "\u09b8\u09ac \u09ac\u09be\u099b\u09be\u0987 \u0995\u09...
else { return value[django.pluralidx(count)]; } }; django.gettext_noop = function(msgid) { return msgid; }; django.pgettext = function(context, msgid) { var value = django.gettext(context + '\x04' + msgid); if (value.indexOf('\x04') != -1) { value = msgid; } ...
{ return (count == 1) ? singular : plural; }
conditional_block
Globals.js
/* * * * (c) 2010-2019 Torstein Honsi * * License: www.highcharts.com/license * * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!! * * */ 'use strict'; /* globals Image, window */ /** * Reference to the global SVGElement class as a workaround for a name conflict * in the Highcharts ...
); var H = { product: 'Highcharts', version: '8.0.0', deg2rad: Math.PI * 2 / 360, doc: doc, hasBidiBug: hasBidiBug, hasTouch: !!glob.TouchEvent, isMS: isMS, isWebKit: userAgent.indexOf('AppleWebKit') !== -1, isFirefox: isFirefox, isChrome: isChrome, isSafari: !isChrome && use...
random_line_split
__init__.py
def HasBattOrConnected(self): return self._has_battor def SetBattOrDetected(self, b): assert isinstance(b, bool) self._has_battor = b # TODO(rnephew): Investigate moving from setters to @property. def SetDeviceTypeName(self, name): self._device_type_name = name def GetDeviceTypeName(self): ...
def SetIsSvelte(self, b): assert isinstance(b, bool) self._is_svelte = b def IsSvelte(self): if self._os_name != 'android': raise NotImplementedError return self._is_svelte def SetIsAosp(self, b): assert isinstance(b, bool) self._is_aosp = b def IsAosp(self): return self._...
return self._device_type_name
identifier_body
__init__.py
def HasBattOrConnected(self): return self._has_battor def SetBattOrDetected(self, b): assert isinstance(b, bool) self._has_battor = b # TODO(rnephew): Investigate moving from setters to @property. def SetDeviceTypeName(self, name): self._device_type_name = name def GetDeviceTypeName(self): ...
(self, possible_browser): """Override this to configure the PossibleBrowser. Can make changes to the browser's configuration here via e.g.: possible_browser.returned_browser.returned_system_info = ... """ pass def DidRunStory(self, results): # TODO(kbr): add a test which throws an except...
ConfigurePossibleBrowser
identifier_name
__init__.py
def HasBattOrConnected(self): return self._has_battor def SetBattOrDetected(self, b): assert isinstance(b, bool) self._has_battor = b # TODO(rnephew): Investigate moving from setters to @property. def SetDeviceTypeName(self, name): self._device_type_name = name def GetDeviceTypeName(self): ...
return self._is_aosp and self._os_name == 'android' class FakeLinuxPlatform(FakePlatform): def __init__(self): super(FakeLinuxPlatform, self).__init__() self.screenshot_png_data = None self.http_server_directories = [] self.http_server = FakeHTTPServer() @property def is_host_platform(self)...
def SetIsAosp(self, b): assert isinstance(b, bool) self._is_aosp = b def IsAosp(self):
random_line_split
__init__.py
(self, _): pass class FakeSharedPageState(shared_page_state.SharedPageState): def __init__(self, test, finder_options, story_set): super(FakeSharedPageState, self).__init__(test, finder_options, story_set) def _GetPossibleBrowser(self, test, finder_options): p = FakePossibleBrowser() self.Configu...
assert self._notifications[-1][1] < time, ( 'Current response is scheduled earlier than previous response.')
conditional_block
get_thumbnails.py
#! /usr/bin/env python """ Author: Gary Foreman Created: August 6, 2016 This script scrapes thumbnail images from thread links in the For Sale: Bass Guitars forum at talkbass.com """ from __future__ import print_function from glob import glob import os import sys import urllib from PIL import Image, ImageOps import p...
client.close() thumbnail_count = 1 for thumbnail_url in thumbnail_url_list: download_thumb(thumbnail_url) filename = filename_from_url(thumbnail_url) crop_image(filename) pause_scrape(MIN_PAUSE_SECONDS, MAX_PAUSE_SECONDS) report_progress(thumbnail_count, REPORT_ME...
thumbnail_url = document[u'image_url'] try: filename = filename_from_url(thumbnail_url) if filename not in scraped_image_list: thumbnail_url_list.append(thumbnail_url) except AttributeError: # thread has no associated thumbnail pass
conditional_block
get_thumbnails.py
#! /usr/bin/env python """ Author: Gary Foreman Created: August 6, 2016 This script scrapes thumbnail images from thread links in the For Sale: Bass Guitars forum at talkbass.com """ from __future__ import print_function from glob import glob import os import sys import urllib from PIL import Image, ImageOps import p...
Pulls dowm image from thumbnail_url and stores in DATA_DIR """ filename = filename_from_url(thumbnail_url) try: urllib.urlretrieve(thumbnail_url, filename) except IOError: # URL is not an image file pass except UnicodeError: # URL contains non-ASCII characters ...
def download_thumb(thumbnail_url): """ thumbnail_url : a string with a url to a bass image
random_line_split
get_thumbnails.py
#! /usr/bin/env python """ Author: Gary Foreman Created: August 6, 2016 This script scrapes thumbnail images from thread links in the For Sale: Bass Guitars forum at talkbass.com """ from __future__ import print_function from glob import glob import os import sys import urllib from PIL import Image, ImageOps import p...
def download_thumb(thumbnail_url): """ thumbnail_url : a string with a url to a bass image Pulls dowm image from thumbnail_url and stores in DATA_DIR """ filename = filename_from_url(thumbnail_url) try: urllib.urlretrieve(thumbnail_url, filename) except IOError: # URL is...
""" thumbnail_url : a string with a url to a bass image Strips filename from the end of thumbnail_url and prepends DATA_PATH. Also ensures the file extension is jpg """ filename = thumbnail_url.strip('/').split('/')[-1] basename, ext = os.path.splitext(filename) return os.path.join(DATA_PAT...
identifier_body
get_thumbnails.py
#! /usr/bin/env python """ Author: Gary Foreman Created: August 6, 2016 This script scrapes thumbnail images from thread links in the For Sale: Bass Guitars forum at talkbass.com """ from __future__ import print_function from glob import glob import os import sys import urllib from PIL import Image, ImageOps import p...
(): """ Checks to see whether DATA_PATH exists. If not, creates it. """ if not os.path.isdir(DATA_PATH): os.makedirs(DATA_PATH) def filename_from_url(thumbnail_url): """ thumbnail_url : a string with a url to a bass image Strips filename from the end of thumbnail_url and prepends ...
make_data_dir
identifier_name
generate_provider_logos_collage_image.py
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (th...
return resized_images def assemble_final_image(resized_images, output_path): final_name = pjoin(output_path, 'final/logos.png') random.shuffle(resized_images) values = {'images': ' '.join(resized_images), 'geometry': GEOMETRY, 'out_name': final_name} cmd = 'montage %(images)s -geom...
name, ext = os.path.splitext(os.path.basename(logo_file)) new_name = '%s%s' % (name, ext) out_name = pjoin(output_path, 'resized/', new_name) print('Resizing image: %(name)s' % {'name': logo_file}) values = {'name': logo_file, 'out_name': out_name, 'dimensions': DIMEN...
conditional_block
generate_provider_logos_collage_image.py
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (th...
print('Resizing image: %(name)s' % {'name': logo_file}) values = {'name': logo_file, 'out_name': out_name, 'dimensions': DIMENSIONS} cmd = 'convert %(name)s -resize %(dimensions)s %(out_name)s' cmd = cmd % values subprocess.call(cmd, shell=True) resiz...
random_line_split
generate_provider_logos_collage_image.py
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (th...
(input_path): logo_files = os.listdir(input_path) logo_files = [name for name in logo_files if 'resized' not in name and name.endswith('png')] logo_files = [pjoin(input_path, name) for name in logo_files] return logo_files def resize_images(logo_files, output_path): resized_imag...
get_logo_files
identifier_name
generate_provider_logos_collage_image.py
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (th...
if __name__ == '__main__': parser = argparse.ArgumentParser(description='Assemble provider logos ' ' in a single image') parser.add_argument('--input-path', action='store', help='Path to directory which contains provider ' ...
if not os.path.exists(input_path): print('Path doesn\'t exist: %s' % (input_path)) sys.exit(2) if not os.path.exists(output_path): print('Path doesn\'t exist: %s' % (output_path)) sys.exit(2) logo_files = get_logo_files(input_path=input_path) setup(output_path=output_path)...
identifier_body
main.rs
extern crate rand; use std::io; use std::cmp::Ordering; use rand::Rng; fn
() { println!("Guess the number!"); let secret_number = rand::thread_rng().gen_range(1, 101); //println!("The secret number is: {}", secret_number); loop { println!("Please input your guess."); let mut guess = String::new(); io::stdin().read_line(&mut guess) .exp...
main
identifier_name
main.rs
extern crate rand; use std::io; use std::cmp::Ordering; use rand::Rng; fn main() { println!("Guess the number!"); let secret_number = rand::thread_rng().gen_range(1, 101); //println!("The secret number is: {}", secret_number); loop { println!("Please input your guess."); let mut gu...
println!("You guessed: {}", guess); match guess.cmp(&secret_number) { Ordering::Less => println!("Too small!"), Ordering::Greater => println!("Too big!"), Ordering::Equal => { println!("You win!"); break; } } ...
};
random_line_split
main.rs
extern crate rand; use std::io; use std::cmp::Ordering; use rand::Rng; fn main()
println!("You guessed: {}", guess); match guess.cmp(&secret_number) { Ordering::Less => println!("Too small!"), Ordering::Greater => println!("Too big!"), Ordering::Equal => { println!("You win!"); break; } } ...
{ println!("Guess the number!"); let secret_number = rand::thread_rng().gen_range(1, 101); //println!("The secret number is: {}", secret_number); loop { println!("Please input your guess."); let mut guess = String::new(); io::stdin().read_line(&mut guess) .expect...
identifier_body
problem3.rs
/* Run tests with; * * rustc --test problem3.rs ; ./problem3 * */ fn prime_factors(mut n: i64) -> Vec<i64> { let mut divisor = 2; let mut factors: Vec<i64> = Vec::new(); while divisor <= (n as f64).sqrt() as i64 { if n%divisor == 0
else { divisor += 1; } } factors.push(n); return factors; } pub fn main() { let factors = prime_factors(600851475143); let largest_prime_factor = factors.last().unwrap(); println!("largest prime factor == {}", largest_prime_factor); } #[cfg(test)] mod test { use super:...
{ factors.push(divisor); n = n / divisor; divisor = 2; }
conditional_block
problem3.rs
/* Run tests with; * * rustc --test problem3.rs ; ./problem3 * */ fn prime_factors(mut n: i64) -> Vec<i64> { let mut divisor = 2;
n = n / divisor; divisor = 2; } else { divisor += 1; } } factors.push(n); return factors; } pub fn main() { let factors = prime_factors(600851475143); let largest_prime_factor = factors.last().unwrap(); println!("largest prime factor == {}", l...
let mut factors: Vec<i64> = Vec::new(); while divisor <= (n as f64).sqrt() as i64 { if n%divisor == 0 { factors.push(divisor);
random_line_split
problem3.rs
/* Run tests with; * * rustc --test problem3.rs ; ./problem3 * */ fn prime_factors(mut n: i64) -> Vec<i64> { let mut divisor = 2; let mut factors: Vec<i64> = Vec::new(); while divisor <= (n as f64).sqrt() as i64 { if n%divisor == 0 { factors.push(divisor); n = n / divi...
#[cfg(test)] mod test { use super::prime_factors; #[test] fn correct_answer() { let factors = prime_factors(600851475143); let expected_answer = 6857; let computed_answer = *factors.last().unwrap(); assert_eq!(computed_answer, expected_answer); } }
{ let factors = prime_factors(600851475143); let largest_prime_factor = factors.last().unwrap(); println!("largest prime factor == {}", largest_prime_factor); }
identifier_body
problem3.rs
/* Run tests with; * * rustc --test problem3.rs ; ./problem3 * */ fn prime_factors(mut n: i64) -> Vec<i64> { let mut divisor = 2; let mut factors: Vec<i64> = Vec::new(); while divisor <= (n as f64).sqrt() as i64 { if n%divisor == 0 { factors.push(divisor); n = n / divi...
() { let factors = prime_factors(600851475143); let largest_prime_factor = factors.last().unwrap(); println!("largest prime factor == {}", largest_prime_factor); } #[cfg(test)] mod test { use super::prime_factors; #[test] fn correct_answer() { let factors = prime_factors(600851475143);...
main
identifier_name
main.js
(function() { $(function() { $('.tooltip-examples a, .tooltip-paragraph-examples a').tooltip({
$('.top-sign-in').on("click", function(e) { $('.login-box').fadeIn("fast"); return false; }); $('.login-box-close').on("click", function(e) { $(this).closest(".login-box").fadeOut("fast"); return false; }); prettyPrint(); $(".slider-browser-center").animate({ bottom...
animation: false });
random_line_split
change-dev-machine-dialog.controller.ts
/* * Copyright (c) 2015-2017 Red Hat, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red H...
this.message = this.machinesList.length > 1 ? 'Select the machine to get ws-agent activated:' : 'You can\'t change it without having other machines configured.'; } /** * Returns list of machines not including current dev machine. * * @return {Array<IEnvironmentManagerMachine>} */ getMachinesLis...
{ this.okButtonTitle = 'OK'; }
conditional_block
change-dev-machine-dialog.controller.ts
/* * Copyright (c) 2015-2017 Red Hat, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red H...
{ /** * Material design Dialog service. */ private $mdDialog: ng.material.IDialogService; /** * Current devMachine name. * Passed from parent controller. */ private currentDevMachineName: string; /** * List of machines. * Passed from parent controller. */ private machinesList: Array...
ChangeDevMachineDialogController
identifier_name
change-dev-machine-dialog.controller.ts
/* * Copyright (c) 2015-2017 Red Hat, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red H...
/** * Material design Dialog service. */ private $mdDialog: ng.material.IDialogService; /** * Current devMachine name. * Passed from parent controller. */ private currentDevMachineName: string; /** * List of machines. * Passed from parent controller. */ private machinesList: Array<IE...
random_line_split
change-dev-machine-dialog.controller.ts
/* * Copyright (c) 2015-2017 Red Hat, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red H...
/** * Changes DEV machine. */ onDevChange(): void { if (angular.isFunction(this.changeDevMachine)) { this.changeDevMachine(this.newDevMachine); } this.$mdDialog.hide(); } }
{ this.$mdDialog.cancel(); }
identifier_body
centos5.py
#!/usr/bin/python # # centos5.py - A webKickstart module to handle changes needed from # RHEL 5 to CentOS 5 Kickstart generation. # # Copyright 2007 NC State University # Written by Jack Neely <jjneely@ncsu.edu> # # SDG # # This program is free software; you can redistribute it and/or modify # it under the...
(self, url, cfg, sc=None): baseRealmLinuxKickstart.__init__(self, url, cfg, sc) self.buildOrder.remove(self.installationNumber) self.buildOrder.remove(self.RHN)
__init__
identifier_name
centos5.py
#!/usr/bin/python # # centos5.py - A webKickstart module to handle changes needed from # RHEL 5 to CentOS 5 Kickstart generation. # # Copyright 2007 NC State University # Written by Jack Neely <jjneely@ncsu.edu> # # SDG # # This program is free software; you can redistribute it and/or modify # it under the...
def __init__(self, url, cfg, sc=None): baseRealmLinuxKickstart.__init__(self, url, cfg, sc) self.buildOrder.remove(self.installationNumber) self.buildOrder.remove(self.RHN)
identifier_body
centos5.py
#!/usr/bin/python # # centos5.py - A webKickstart module to handle changes needed from # RHEL 5 to CentOS 5 Kickstart generation. # # Copyright 2007 NC State University # Written by Jack Neely <jjneely@ncsu.edu> # # SDG # # This program is free software; you can redistribute it and/or modify # it under the...
def __init__(self, url, cfg, sc=None): baseRealmLinuxKickstart.__init__(self, url, cfg, sc) self.buildOrder.remove(self.installationNumber) self.buildOrder.remove(self.RHN)
from baseRealmLinuxKickstart import baseRealmLinuxKickstart class Kickstart(baseRealmLinuxKickstart):
random_line_split
css-subpixelfont.js
//= require modernizr /*
*/ Modernizr.addTest('subpixelfont', function() { var bool, styles = "#modernizr{position: absolute; top: -10em; visibility:hidden; font: normal 10px arial;}#subpixel{float: left; font-size: 33.3333%;}"; // see https://github.com/Modernizr/Modernizr/blob/master/modernizr.js#L97 Modernizr.testS...
* Test for SubPixel Font Rendering * (to infer if GDI or DirectWrite is used on Windows) * Authors: @derSchepp, @gerritvanaaken, @rodneyrehm, @yatil, @ryanseddon * Web: https://github.com/gerritvanaaken/subpixeldetect
random_line_split
ckeditor.files.js
/** * Nooku Framework - http://www.nooku.org * * @copyright Copyright (C) 2011 - 2017 Johan Janssens and Timble CVBA. (http://www.timble.net) * @license GNU AGPLv3 <https://www.gnu.org/licenses/agpl.html> * @link https://github.com/timble/openpolice-platform */ if(!Ckeditor) var Ckeditor = {}; Ckeditor.Files ...
document.id('image-url').set('value', url); document.id('image-type').set('value',row.metadata.mimetype); } });
{ if(document.id('image-text').get('value') == ""){ document.id('image-text').set('value', row.name); } }
conditional_block
ckeditor.files.js
/** * Nooku Framework - http://www.nooku.org * * @copyright Copyright (C) 2011 - 2017 Johan Janssens and Timble CVBA. (http://www.timble.net) * @license GNU AGPLv3 <https://www.gnu.org/licenses/agpl.html> * @link https://github.com/timble/openpolice-platform */ if(!Ckeditor) var Ckeditor = {}; Ckeditor.Files ...
this.preview.empty(); copy.render('compact').inject(this.preview); // Inject preview image if (type == 'image') { this.preview.getElement('img').set('src', copy.image); } // When no text is selected use the file name if (type == 'file') { ...
random_line_split
ndvi_difference.py
#!/usr/bin/env python2 """Example of server-side computations used in global forest change analysis. In this example we will focus on server side computation using NDVI and EVI data. This both metrics are computed bands created by third party companies or directly taken by the satellites. NDVI and EVI are two metric...
visualized = maskedDifference.visualize( min=-2000, max=2000, palette='FF0000, 000000, 00FF00', ) # Finally generate the PNG. print visualized.getDownloadUrl({ 'region': rectangle.toGeoJSONString(), 'scale': 500, 'format': 'png', })
random_line_split
utils.ts
import { Observable, of, Subscriber } from 'rxjs'; import { delay, take, tap } from 'rxjs/operators'; import { ShareButtonFuncArgs } from './share.models';
*/ function isObject(item): boolean { return (item && typeof item === 'object' && !Array.isArray(item)); } /** * Deep merge two objects. */ export function mergeDeep(target, ...sources) { if (!sources.length) { return target; } const source = sources.shift(); if (isObject(target) && isObject(source))...
/** * Simple object check.
random_line_split
utils.ts
import { Observable, of, Subscriber } from 'rxjs'; import { delay, take, tap } from 'rxjs/operators'; import { ShareButtonFuncArgs } from './share.models'; /** * Simple object check. */ function isObject(item): boolean { return (item && typeof item === 'object' && !Array.isArray(item)); } /** * Deep merge two ob...
(url: string, fallbackUrl: string): string { if (url) { const r = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; if (r.test(url)) { return url; } console.warn(`[ShareButtons]: Sharing link '${ url }' is invalid!`); } return fallbackUrl; } export function pr...
getValidUrl
identifier_name
utils.ts
import { Observable, of, Subscriber } from 'rxjs'; import { delay, take, tap } from 'rxjs/operators'; import { ShareButtonFuncArgs } from './share.models'; /** * Simple object check. */ function isObject(item): boolean { return (item && typeof item === 'object' && !Array.isArray(item)); } /** * Deep merge two ob...
console.warn(`[ShareButtons]: Sharing link '${ url }' is invalid!`); } return fallbackUrl; } export function printPage(): Observable<void> { return new Observable((sub: Subscriber<any>) => document.defaultView.print()); } export function copyToClipboard({params, data, clipboard, updater}: ShareButtonFuncAr...
{ return url; }
conditional_block
utils.ts
import { Observable, of, Subscriber } from 'rxjs'; import { delay, take, tap } from 'rxjs/operators'; import { ShareButtonFuncArgs } from './share.models'; /** * Simple object check. */ function isObject(item): boolean { return (item && typeof item === 'object' && !Array.isArray(item)); } /** * Deep merge two ob...
} /** Returns a valid URL or falls back to current URL */ export function getValidUrl(url: string, fallbackUrl: string): string { if (url) { const r = /(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; if (r.test(url)) { return url; } console.warn(`[ShareButtons]:...
{ if (!sources.length) { return target; } const source = sources.shift(); if (isObject(target) && isObject(source)) { for (const key in source) { if (isObject(source[key])) { if (!target[key]) { Object.assign(target, {[key]: {}}); } mergeDeep(target[key], source[...
identifier_body
model.py
"""Machine learning model""" from copy import deepcopy import logging from operator import itemgetter from pathlib import Path import shutil from tempfile import TemporaryDirectory from typing import List, Tuple, Dict, Any, Callable import tensorflow as tf from tensorflow.estimator import ModeKeys, Estimator from ten...
dnn_feature_columns=[dense_column], dnn_hidden_units=HyperParameter.DNN_HIDDEN_UNITS, dnn_dropout=HyperParameter.DNN_DROPOUT, label_vocabulary=labels, n_classes=len(labels), config=config, ) def train(estimator: Estimator, data_root_dir: str, max_steps: int) -> Any:...
random_line_split
model.py
"""Machine learning model""" from copy import deepcopy import logging from operator import itemgetter from pathlib import Path import shutil from tempfile import TemporaryDirectory from typing import List, Tuple, Dict, Any, Callable import tensorflow as tf from tensorflow.estimator import ModeKeys, Estimator from ten...
: """Model hyper parameters""" BATCH_SIZE = 100 NB_TOKENS = 10000 VOCABULARY_SIZE = 5000 EMBEDDING_SIZE = max(10, int(VOCABULARY_SIZE**0.5)) DNN_HIDDEN_UNITS = [512, 32] DNN_DROPOUT = 0.5 N_GRAM = 2 class Training: """Model training parameters""" SHUFFLE_BUFFER = HyperParameter...
HyperParameter
identifier_name
model.py
"""Machine learning model""" from copy import deepcopy import logging from operator import itemgetter from pathlib import Path import shutil from tempfile import TemporaryDirectory from typing import List, Tuple, Dict, Any, Callable import tensorflow as tf from tensorflow.estimator import ModeKeys, Estimator from ten...
def _preprocess_text(data: tf.Tensor) -> tf.Tensor: """Feature engineering""" padding = tf.constant(['']*HyperParameter.NB_TOKENS) data = tf.strings.bytes_split(data) data = tf.strings.ngrams(data, HyperParameter.N_GRAM) data = tf.concat((data, padding), axis=0) data = data[:HyperParameter.NB...
"""Process input data as part of a workflow""" data = _preprocess_text(data) return {'content': data}, label
identifier_body
model.py
"""Machine learning model""" from copy import deepcopy import logging from operator import itemgetter from pathlib import Path import shutil from tempfile import TemporaryDirectory from typing import List, Tuple, Dict, Any, Callable import tensorflow as tf from tensorflow.estimator import ModeKeys, Estimator from ten...
eval_spec = tf.estimator.EvalSpec( input_fn=_build_input_fn(data_root_dir, ModeKeys.EVAL), start_delay_secs=Training.SHORT_DELAY, throttle_secs=throttle_secs, ) LOGGER.debug('Train the model') results = tf.estimator.train_and_evaluate(estimator, train_spec, eval_spec) trai...
throttle_secs = Training.SHORT_DELAY
conditional_block
guiTest.py
import os import sys import shutil import errno import time import hashlib from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions if "TRAVIS_BUILD_NUMBER" in os.environ: if "SAUCE_...
def wait_for_text(time, xpath, text): WebDriverWait(driver, time).until(expected_conditions.text_to_be_present_in_element((By.XPATH, xpath), text)) BACKUP_NAME = "BackupName" PASSWORD = "the_backup_password_is_really_long_and_safe" SOURCE_FOLDER = os.path.abspath("duplicati_gui_test_source") DESTINATION_FOLDER =...
random_line_split
guiTest.py
import os import sys import shutil import errno import time import hashlib from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions if "TRAVIS_BUILD_NUMBER" in os.environ: if "SAUCE_...
(time, xpath, text): WebDriverWait(driver, time).until(expected_conditions.text_to_be_present_in_element((By.XPATH, xpath), text)) BACKUP_NAME = "BackupName" PASSWORD = "the_backup_password_is_really_long_and_safe" SOURCE_FOLDER = os.path.abspath("duplicati_gui_test_source") DESTINATION_FOLDER = os.path.abspath("...
wait_for_text
identifier_name
guiTest.py
import os import sys import shutil import errno import time import hashlib from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions if "TRAVIS_BUILD_NUMBER" in os.environ: if "SAUCE_...
def wait_for_text(time, xpath, text): WebDriverWait(driver, time).until(expected_conditions.text_to_be_present_in_element((By.XPATH, xpath), text)) BACKUP_NAME = "BackupName" PASSWORD = "the_backup_password_is_really_long_and_safe" SOURCE_FOLDER = os.path.abspath("duplicati_gui_test_source") DESTINATION_FOLDER...
sha1_dict = {} for root, dirs, files in os.walk(folder): for filename in files: file_path = os.path.join(root, filename) sha1 = sha1_file(file_path) relative_file_path = os.path.relpath(file_path, folder) sha1_dict.update({relative_file_path: sha1}) retur...
identifier_body
guiTest.py
import os import sys import shutil import errno import time import hashlib from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions if "TRAVIS_BUILD_NUMBER" in os.environ: if "SAUCE_...
return sha1_dict def wait_for_text(time, xpath, text): WebDriverWait(driver, time).until(expected_conditions.text_to_be_present_in_element((By.XPATH, xpath), text)) BACKUP_NAME = "BackupName" PASSWORD = "the_backup_password_is_really_long_and_safe" SOURCE_FOLDER = os.path.abspath("duplicati_gui_test_sourc...
file_path = os.path.join(root, filename) sha1 = sha1_file(file_path) relative_file_path = os.path.relpath(file_path, folder) sha1_dict.update({relative_file_path: sha1})
conditional_block
mm.lang.js
) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with th...
MM.moodleWSCall('core_get_component_strings', data, function(strings) { var stringsFormatted = {}; if (strings.length > 0) { $.each(strings, function(index, string) { stringsFormatted[string.stringid] = string.string; ...
}; MM.log('Loading lang file from remote site for core', 'Sync');
random_line_split
issue-52742.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 ...
impl Foo<'_, '_> { fn take_bar(&mut self, b: Bar<'_>) { self.y = b.z //~^ ERROR unsatisfied lifetime constraints } } fn main() { }
z: &'b u32 }
random_line_split
issue-52742.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 ...
<'a, 'b> { x: &'a u32, y: &'b u32, } struct Bar<'b> { z: &'b u32 } impl Foo<'_, '_> { fn take_bar(&mut self, b: Bar<'_>) { self.y = b.z //~^ ERROR unsatisfied lifetime constraints } } fn main() { }
Foo
identifier_name
issue-52742.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 ...
} fn main() { }
{ self.y = b.z //~^ ERROR unsatisfied lifetime constraints }
identifier_body
hiv-program-snapshot.component.ts
any = ''; public moriskyScore4: any = ''; public moriskyScore8: any = ''; public ismoriskyScore8 = false; public ismoriskyScore4 = false; public moriskyDenominator: any = ''; public moriskyRating: any = ''; public isMoriskyScorePoorOrInadequate = false; public hivDisclosureStatus: any; public latestC...
private isIntraAmpathTransferFromCurrentLocation(care_status_id) { const intraAmpathTransferOutConceptIds = [1285, 1286, 9068, 950
{ return ( care_status_id === 1287 || care_status_id === 5622 || care_status_id === 10502 ); }
identifier_body
hiv-program-snapshot.component.ts
: any = ''; public moriskyScore4: any = ''; public moriskyScore8: any = ''; public ismoriskyScore8 = false; public ismoriskyScore4 = false; public moriskyDenominator: any = ''; public moriskyRating: any = ''; public isMoriskyScorePoorOrInadequate = false; public hivDisclosureStatus: any; public latest...
return ( care_status_id === 1287 || care_status_id === 5622 || care_status_id === 10502 ); } private isIntraAmpathTransferFromCurrentLocation(care_status_id) { const intraAmpathTransferOutConceptIds = [1285, 1286, 9068, 9504
private patientReturnedToCare(): boolean { return this.hasSubsequentClinicalEncounter ? true : false; } private isNonAmpathTransferOut(care_status_id) {
random_line_split
hiv-program-snapshot.component.ts
: any = ''; public moriskyScore4: any = ''; public moriskyScore8: any = ''; public ismoriskyScore8 = false; public ismoriskyScore4 = false; public moriskyDenominator: any = ''; public moriskyRating: any = ''; public isMoriskyScorePoorOrInadequate = false; public hivDisclosureStatus: any; public latest...
(care_status_id) { return ( care_status_id === 1287 || care_status_id === 5622 || care_status_id === 10502 ); } private isIntraAmpathTransferFromCurrentLocation(care_status_id) { const intraAmpathTransferOutConceptIds = [1285, 1286, 9068, 950
isNonAmpathTransferOut
identifier_name
hiv-program-snapshot.component.ts
' }; /* if the patient transferred out and their care status is 'Continue with Care' despite them not returning to care, apply a yellow background on their summary snapshot to mark them out as a Transfer Out. */ /* if the patient is active in care with a care status of 'Continue with ...
{ this.moriskyRating = 'Inadequate'; }
conditional_block
loader.rs
self.sess.span_note(self.span, format!("expected triple of {}", self.triple).as_slice()); for (i, &CrateMismatch{ ref path, ref got }) in mismatches.enumerate() { self.sess.fileline_note(self.span, f...
{ debug!("triple not present"); return false }
conditional_block
loader.rs
crate-name` can be specified //! twice to specify the rlib/dylib pair. //! //! ## Enabling "multiple versions" //! //! This basically boils down to the ability to specify arbitrary packages to //! the compiler. For example, if crate A wanted to use Bv1 and Bv2, then it //! would look something like: //! //! ```ignore /...
(&mut self) -> Option<Library> { // If an SVH is specified, then this is a transitive dependency that // must be loaded via -L plus some filtering. if self.hash.is_none() { self.should_match_name = false; match self.find_commandline_library() { Some(l) => ...
find_library_crate
identifier_name
loader.rs
map each of these lists // (per hash), to a Library candidate for returning. // // A Library candidate is created if the metadata for the set of // libraries corresponds to the crate id and hash criteria that this // search is being performed for. let mut libraries = Vec...
{ unsafe { &*self.data } }
identifier_body
loader.rs
crate-name` can be specified //! twice to specify the rlib/dylib pair. //! //! ## Enabling "multiple versions" //! //! This basically boils down to the ability to specify arbitrary packages to //! the compiler. For example, if crate A wanted to use Bv1 and Bv2, then it //! would look something like: //! //! ```ignore /...
pub rlib: Option<Path>, pub metadata: MetadataBlob, } pub struct ArchiveMetadata { _archive: ArchiveRO, // points into self._archive data: *const [u8], } pub struct CratePaths { pub ident: String, pub dylib: Option<Path>, pub rlib: Option<Path> } impl CratePaths { fn paths(&self) ...
} pub struct Library { pub dylib: Option<Path>,
random_line_split
test_import.py
""" import pytest from path import path import omero.clients import uuid from omero.cli import CLI, NonZeroReturnCode # Workaround for a poorly named module plugin = __import__('omero.plugins.import', globals(), locals(), ['ImportControl'], -1) ImportControl = plugin.ImportControl help_arguments ...
Copyright 2009 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
random_line_split
test_import.py
Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import pytest from path import path import omero.clients import uuid from omero.cli import CLI, NonZeroReturnCode # Workaround for a poorly named module plugin = __import__('omero.plugins.import', globals(), locals(), ...
(self, tmpdir, capfd, with_ds_store): """Test fake screen import""" screen_dir = tmpdir.join("screen.fake") screen_dir.mkdir() fieldfiles = self.mkfakescreen( screen_dir, with_ds_store=with_ds_store) self.add_client_dir() self.args += ["-f", "--debug=ERROR"]...
testImportFakeScreen
identifier_name
test_import.py
Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import pytest from path import path import omero.clients import uuid from omero.cli import CLI, NonZeroReturnCode # Workaround for a poorly named module plugin = __import__('omero.plugins.import', globals(), locals(), ...
return fieldfiles def mkfakepattern(self, tmpdir, nangles=7, ntimepoints=10): spim_dir = tmpdir.join("SPIM") spim_dir.mkdir() tiffiles = [] for angle in range(1, nangles + 1): for timepoint in range(1, ntimepoints + 1): tiffile = (spim_dir / ("s...
well_dir = self.mkdir( run_dir, "WellA00%s" % str(iwell), with_ds_store=with_ds_store) for ifield in range(nfields): fieldfile = (well_dir / ("Field00%s.fake" % str(ifield))) ...
conditional_block
test_import.py
Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import pytest from path import path import omero.clients import uuid from omero.cli import CLI, NonZeroReturnCode # Workaround for a poorly named module plugin = __import__('omero.plugins.import', globals(), locals(), ...
self.cli.register("mock-import", MockImportControl, "HELP") self.args = ['-s', 'localhost', '-p', '4064', '-k', 'b0742975-03a1-4f6d-b0ac-639943f1a147'] self.args += ['mock-import', '---errs=/tmp/dropbox.err'] self.args += ['---file=/tmp/dropbox.out'] self.a...
assert args.server == "localhost" assert args.port == "4064" assert args.key == "b0742975-03a1-4f6d-b0ac-639943f1a147" assert args.errs == "/tmp/dropbox.err" assert args.file == "/tmp/dropbox.out"
identifier_body
pingping.py
#!/usr/bin/env python # -*- coding: latin-1 -*- import sys import datetime from threading import Thread class ProcPing(Thread): def __init__(self, name, data, qtdMsg): Thread.__init__(self) self.name = name self.data = data self.qtdMsg = qtdMsg self.mailBox = [] def setPeer(self, Peer): self.Pee...
def run(self): for i in range (0, self.qtdMsg + 1): self.send(self.data) if i < self.qtdMsg: self.recv() class PingPing(Thread): def __init__(self, tamMsg, qtdMsg): Thread.__init__(self) self.tamMsg = tamMsg self.qtdMsg = qtdMsg def run(self): index = 0 array = [1] while index < self....
while True: if not len(self.mailBox) < len(self.data): print(self) self.mailBox = [] break
identifier_body
pingping.py
#!/usr/bin/env python # -*- coding: latin-1 -*- import sys import datetime from threading import Thread class ProcPing(Thread): def __init__(self, name, data, qtdMsg): Thread.__init__(self) self.name = name self.data = data self.qtdMsg = qtdMsg self.mailBox = [] def
(self, Peer): self.Peer = Peer def send(self, dado): self.Peer.mailBox = dado def recv(self): while True: if not len(self.mailBox) < len(self.data): print(self) self.mailBox = [] break def run(self): for i in range (0, self.qtdMsg + 1): self.send(self.data) if i < self....
setPeer
identifier_name
pingping.py
#!/usr/bin/env python # -*- coding: latin-1 -*- import sys import datetime from threading import Thread class ProcPing(Thread): def __init__(self, name, data, qtdMsg): Thread.__init__(self) self.name = name self.data = data self.qtdMsg = qtdMsg self.mailBox = [] def setPeer(self, Peer): self.Pee...
def run(self): for i in range (0, self.qtdMsg + 1): self.send(self.data) if i < self.qtdMsg: self.recv() class PingPing(Thread): def __init__(self, tamMsg, qtdMsg): Thread.__init__(self) self.tamMsg = tamMsg self.qtdMsg = qtdMsg def run(self): index = 0 array = [1] while index < self....
print(self) self.mailBox = [] break
conditional_block
pingping.py
#!/usr/bin/env python # -*- coding: latin-1 -*- import sys import datetime from threading import Thread class ProcPing(Thread): def __init__(self, name, data, qtdMsg): Thread.__init__(self) self.name = name self.data = data self.qtdMsg = qtdMsg self.mailBox = [] def setPeer(self, Peer): self.Pee...
pingPing.start() if __name__=="__main__": main()
random_line_split
persengine.py
#!/usr/bin/env python2 """ This is the main module, used to launch the persistency engine """ #from persio import iohandler import persui.persinterface as ui def main(): """ Launches the user interface, and keeps it on.""" interface = ui.Persinterface() while True:
if __name__ == '__main__': main() """ def main_old(): keynames = ["A", "B"] graph_data1 = [(0, 0, 0, 1), (0, 1, 2, 3)] graph_data2 = [(2, 3, 0, 1), (0, 6, 2, 8)] graph_data = [graph_data1, graph_data2] name = "tree.xml" root = iohandler.xh.createindex(keynames) for i in xrange(2): ...
interface.run()
conditional_block
persengine.py
#!/usr/bin/env python2 """ This is the main module, used to launch the persistency engine """ #from persio import iohandler import persui.persinterface as ui
""" Launches the user interface, and keeps it on.""" interface = ui.Persinterface() while True: interface.run() if __name__ == '__main__': main() """ def main_old(): keynames = ["A", "B"] graph_data1 = [(0, 0, 0, 1), (0, 1, 2, 3)] graph_data2 = [(2, 3, 0, 1), (0, 6, 2, 8)] gra...
def main():
random_line_split
persengine.py
#!/usr/bin/env python2 """ This is the main module, used to launch the persistency engine """ #from persio import iohandler import persui.persinterface as ui def main():
if __name__ == '__main__': main() """ def main_old(): keynames = ["A", "B"] graph_data1 = [(0, 0, 0, 1), (0, 1, 2, 3)] graph_data2 = [(2, 3, 0, 1), (0, 6, 2, 8)] graph_data = [graph_data1, graph_data2] name = "tree.xml" root = iohandler.xh.createindex(keynames) for i in xrange(2): ...
""" Launches the user interface, and keeps it on.""" interface = ui.Persinterface() while True: interface.run()
identifier_body
persengine.py
#!/usr/bin/env python2 """ This is the main module, used to launch the persistency engine """ #from persio import iohandler import persui.persinterface as ui def
(): """ Launches the user interface, and keeps it on.""" interface = ui.Persinterface() while True: interface.run() if __name__ == '__main__': main() """ def main_old(): keynames = ["A", "B"] graph_data1 = [(0, 0, 0, 1), (0, 1, 2, 3)] graph_data2 = [(2, 3, 0, 1), (0, 6, 2, 8)] ...
main
identifier_name
faq.js
$.FAQ = function(){ $self = this; this.url = "/faq" this.send = function(inputs){ var params = new FormData(); // var csrf = $("#csrf").val(); // params.append("csrf_ID", csrf); $.each(inputs, function(key, val){ params.append(key,val); }); $.ajax({ url : $self.url, type: 'PO...
};
}; $self.load(inputs); };
random_line_split
lib.rs
use std::env; use std::error::Error; use std::fs; pub struct Config { pub query: String, pub filename: String, pub case_sensitive: bool, } // ANCHOR: here impl Config { pub fn new(mut args: env::Args) -> Result<Config, &'static str> { // --snip-- // ANCHOR_END: here if args.len...
; for line in results { println!("{}", line); } Ok(()) } pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { let mut results = Vec::new(); for line in contents.lines() { if line.contains(query) { results.push(line); } } results } pub ...
{ search_case_insensitive(&config.query, &contents) }
conditional_block
lib.rs
use std::env; use std::error::Error; use std::fs; pub struct Config { pub query: String, pub filename: String, pub case_sensitive: bool, } // ANCHOR: here impl Config { pub fn new(mut args: env::Args) -> Result<Config, &'static str> { // --snip-- // ANCHOR_END: here if args.len...
}; for line in results { println!("{}", line); } Ok(()) } pub fn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { let mut results = Vec::new(); for line in contents.lines() { if line.contains(query) { results.push(line); } } results } ...
} else { search_case_insensitive(&config.query, &contents)
random_line_split
lib.rs
use std::env; use std::error::Error; use std::fs; pub struct Config { pub query: String, pub filename: String, pub case_sensitive: bool, } // ANCHOR: here impl Config { pub fn new(mut args: env::Args) -> Result<Config, &'static str>
} pub fn run(config: Config) -> Result<(), Box<dyn Error>> { let contents = fs::read_to_string(config.filename)?; let results = if config.case_sensitive { search(&config.query, &contents) } else { search_case_insensitive(&config.query, &contents) }; for line in results { ...
{ // --snip-- // ANCHOR_END: here if args.len() < 3 { return Err("not enough arguments"); } let query = args[1].clone(); let filename = args[2].clone(); let case_sensitive = env::var("CASE_INSENSITIVE").is_err(); Ok(Config { quer...
identifier_body
lib.rs
use std::env; use std::error::Error; use std::fs; pub struct Config { pub query: String, pub filename: String, pub case_sensitive: bool, } // ANCHOR: here impl Config { pub fn new(mut args: env::Args) -> Result<Config, &'static str> { // --snip-- // ANCHOR_END: here if args.len...
() { let query = "rUsT"; let contents = "\ Rust: safe, fast, productive. Pick three. Trust me."; assert_eq!( vec!["Rust:", "Trust me."], search_case_insensitive(query, contents) ); } }
case_insensitive
identifier_name
settings-panel-mixin.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/. */ define(function (require, exports, module) { 'use strict'; const $ = require('jquery'); const chai = requir...
assert.isTrue(view.navigate.calledWith('settings')); }); }); describe('methods', function () { it('open and close', function () { view.openPanel(); assert.isTrue($('.settings-unit').hasClass('open')); assert.isTrue(view.isPanelOpen()); view.closePanel(); ...
assert.isTrue(view.closePanel.called); assert.isTrue(view.clearInput.called);
random_line_split