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
histogramTests.ts
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agree...
(h1, h2) { h1.forEach((b1, i) => { const b2 = h2[i]; chai.assert.closeTo(b1.x, b2.x, 1e-10); chai.assert.closeTo(b1.dx, b2.dx, 1e-10); chai.assert.closeTo(b1.y, b2.y, 1e-10); }); } it('Handles data with no bins', () => { chai.assert.deepEqual(intermediateToD3({ wall_time: ...
assertHistogramEquality
identifier_name
histogramTests.ts
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agree...
step: 0, min: 1.1e-12, max: 1.21e-12, buckets, }, 1.1e-12, 1.21e-12, 1); assertHistogramEquality(actual, expected); }); it('Handles data with two bins.', () => { const counts = [1, 2]; const rightEdges = [1.1e-12, 1.21e-12]; const buckets = [ {left: 1.0e-12, right:...
const expected = [{x: 1.1e-12, dx: 1.21e-12 - 1.1e-12, y: 1}]; const actual = intermediateToD3({ wall_time: 1234.5,
random_line_split
switchMapTo.ts
import { Operator } from '../Operator'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { Subscription } from '../Subscription'; import { OuterSubscriber } from '../OuterSubscriber'; import { InnerSubscriber } from '../InnerSubscriber'; import { subscribeToResult } from '....
* ```javascript * import { fromEvent, interval } from 'rxjs'; * import { switchMapTo } from 'rxjs/operators'; * * const clicks = fromEvent(document, 'click'); * const result = clicks.pipe(switchMapTo(interval(1000))); * result.subscribe(x => console.log(x)); * ``` * * @see {@link concatMapTo} * @see {@link s...
* emits values only from the most recently emitted instance of * `innerObservable`. * * ## Example * Rerun an interval Observable on every click event
random_line_split
switchMapTo.ts
import { Operator } from '../Operator'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { Subscription } from '../Subscription'; import { OuterSubscriber } from '../OuterSubscriber'; import { InnerSubscriber } from '../InnerSubscriber'; import { subscribeToResult } from '....
<T, I, R>( innerObservable: ObservableInput<I>, resultSelector?: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R ): OperatorFunction<T, I|R> { return resultSelector ? switchMap(() => innerObservable, resultSelector) : switchMap(() => innerObservable); }
switchMapTo
identifier_name
switchMapTo.ts
import { Operator } from '../Operator'; import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { Subscription } from '../Subscription'; import { OuterSubscriber } from '../OuterSubscriber'; import { InnerSubscriber } from '../InnerSubscriber'; import { subscribeToResult } from '....
{ return resultSelector ? switchMap(() => innerObservable, resultSelector) : switchMap(() => innerObservable); }
identifier_body
profile.module.ts
import { AskUsernameComponent } from './ask-username/ask-username.component'; import { BsDropdownModule } from 'ngx-bootstrap'; import { CoreModule } from '../core/core.module'; import { EditProfileComponent } from './edit-profile/edit-profile.component'; import { InputCounterModule } from 'ng4-input-counter'; import {...
}
{ return { ngModule: ProfileModule, providers: [ ProfileCompletedGuard ] } }
identifier_body
profile.module.ts
import { AskUsernameComponent } from './ask-username/ask-username.component'; import { BsDropdownModule } from 'ngx-bootstrap'; import { CoreModule } from '../core/core.module'; import { EditProfileComponent } from './edit-profile/edit-profile.component'; import { InputCounterModule } from 'ng4-input-counter'; import {...
BsDropdownModule, TooltipModule, RouterModule, CoreModule, ProfileRoutingModule, InputCounterModule, SnippetModule ], declarations: [ ProfileComponent, EditProfileComponent, AskUsernameComponent ] }) export class ProfileModule {...
imports: [ SharedModule,
random_line_split
profile.module.ts
import { AskUsernameComponent } from './ask-username/ask-username.component'; import { BsDropdownModule } from 'ngx-bootstrap'; import { CoreModule } from '../core/core.module'; import { EditProfileComponent } from './edit-profile/edit-profile.component'; import { InputCounterModule } from 'ng4-input-counter'; import {...
(): ModuleWithProviders { return { ngModule: ProfileModule, providers: [ ProfileCompletedGuard ] } } }
forRoot
identifier_name
0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class
(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( name='User', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('pas...
Migration
identifier_name
0001_initial.py
from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( name='User', fields=[ ...
# -*- coding: utf-8 -*-
random_line_split
0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class Migration(migrations.Migration):
('user_permissions', models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Permission', blank=True, help_text='Specific permissions for this user.', verbose_name='user permissions')), ], options={ 'ordering': ['email'], ...
dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( name='User', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('password', models.CharField(max_...
identifier_body
request_pool.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
u'example': {}, }, u'V6': { u'description': u'If set to "True", requesting IPv6 pool and ' u'vice-versa.', u'type': u'boolean', u'example': False } } } REQUEST_POOL_SCHEMA[u'definitions'][u'commons'] = commons.COMMO...
u'Options': { u'type': [u'object', u'null'], u'description': u'Options',
random_line_split
userListService.js
/* * Copyright 2016 Studentmediene i Trondheim AS * * 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 ...
* limitations under the License. */ /** * Created by Wiker on 15/04/16. */ 'use strict'; angular.module('mdbApp.services') .service('UserListService', function ($resource) { return { getUsers: function () { return $resource("/api/list", {}, { get: { ...
random_line_split
rpc.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 https://mozilla.org/MPL/2.0/. */ use app_units::Au; use euclid::default::Rect; use euclid::Size2D; use script_traits::UntrustedNodeAddress; use se...
{ pub client_rect: Rect<i32>, } pub struct NodeScrollIdResponse(pub ExternalScrollId); pub struct ResolvedStyleResponse(pub String); #[derive(Clone)] pub struct OffsetParentResponse { pub node_address: Option<UntrustedNodeAddress>, pub rect: Rect<Au>, } impl OffsetParentResponse { pub fn empty() ->...
NodeGeometryResponse
identifier_name
rpc.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 https://mozilla.org/MPL/2.0/. */ use app_units::Au; use euclid::default::Rect; use euclid::Size2D; use script_traits::UntrustedNodeAddress; use se...
} impl OffsetParentResponse { pub fn empty() -> OffsetParentResponse { OffsetParentResponse { node_address: None, rect: Rect::zero(), } } } #[derive(Clone)] pub struct TextIndexResponse(pub Option<usize>);
pub struct OffsetParentResponse { pub node_address: Option<UntrustedNodeAddress>, pub rect: Rect<Au>,
random_line_split
struct-log-self.rs
//! Example of how to implement `KV` for a struct //! to conveniently log data associated with it. #[macro_use] extern crate slog; use slog::*; mod common; struct Peer { host: String, port: u32, } impl Peer { fn new(host: String, port: u32) -> Self { Peer { host: host, por...
fn main() { let log = Logger::root(Fuse(common::PrintlnDrain), o!("build-id" => "7.3.3-abcdef")); let server = Server::new("localhost".into(), 12345, log.clone()); let peer = Peer::new("1.2.3.4".into(), 999); server.connection(&peer); let mut counter = PeerCounter::new(log); counter.count(&pe...
fn count(&mut self, peer: &Peer) { self.count += 1; self.log_info("counted peer", b!(peer)); } }
random_line_split
struct-log-self.rs
//! Example of how to implement `KV` for a struct //! to conveniently log data associated with it. #[macro_use] extern crate slog; use slog::*; mod common; struct Peer { host: String, port: u32, } impl Peer { fn new(host: String, port: u32) -> Self { Peer { host: host, por...
} fn main() { let log = Logger::root(Fuse(common::PrintlnDrain), o!("build-id" => "7.3.3-abcdef")); let server = Server::new("localhost".into(), 12345, log.clone()); let peer = Peer::new("1.2.3.4".into(), 999); server.connection(&peer); let mut counter = PeerCounter::new(log); counter.count(...
{ self.count += 1; self.log_info("counted peer", b!(peer)); }
identifier_body
struct-log-self.rs
//! Example of how to implement `KV` for a struct //! to conveniently log data associated with it. #[macro_use] extern crate slog; use slog::*; mod common; struct Peer { host: String, port: u32, } impl Peer { fn new(host: String, port: u32) -> Self { Peer { host: host, por...
(&self, msg: &str, kv: BorrowedKV) { info!(self.log, "{}", msg; "current-count" => self.count, kv); } fn count(&mut self, peer: &Peer) { self.count += 1; self.log_info("counted peer", b!(peer)); } } fn main() { let log = Logger::root(Fuse(common::PrintlnDrain), o!("build-id" =>...
log_info
identifier_name
primitive.rs
//! Facilities for working with primitive values. /// Mutates the `out` argument provided to refer to the `v8::Undefined` object. pub use neon_sys::Neon_Primitive_Undefined as undefined; /// Mutates the `out` argument provided to refer to the `v8::Null` object. pub use neon_sys::Neon_Primitive_Null as null; /// Muta...
pub use neon_sys::Neon_Primitive_NumberValue as number_value;
/// Gets the underlying value of a `v8::Number` object.
random_line_split
__init__.py
# Copyright 2017 The Tangram Developers. See the AUTHORS file at the # top-level directory of this distribution and at # https://github.com/renatoGarcia/tangram/blob/master/AUTHORS. # # This file is part of Tangram. # # Tangram is free software: you can redistribute it and/or modify # it under the terms of the GNU Less...
# # You should have received a copy of the GNU Lesser General Public License # along with Tangram in the COPYING and COPYING.LESSER files. # If not, see <http://www.gnu.org/licenses/>. from .imshow import imshow
# GNU Lesser General Public License for more details.
random_line_split
dev_ldap_directory.py
import glob import logging import os from typing import Any, Dict, List, Optional from django.conf import settings from zerver.lib.storage import static_path # See https://jackstromberg.com/2013/01/useraccountcontrol-attributeflag-values/ # for docs on what these values mean. LDAP_USER_ACCOUNT_CONTROL_NORMAL = "512"...
( directory: Optional[Dict[str, Dict[str, List[str]]]] = None ) -> None: # nocoverage # We only use this in development. Importing mock inside # this function is an import time optimization, which # avoids the expensive import of the mock module (slow # because its dependency pbr uses pkgresources...
init_fakeldap
identifier_name
dev_ldap_directory.py
import glob import logging import os from typing import Any, Dict, List, Optional from django.conf import settings from zerver.lib.storage import static_path # See https://jackstromberg.com/2013/01/useraccountcontrol-attributeflag-values/ # for docs on what these values mean. LDAP_USER_ACCOUNT_CONTROL_NORMAL = "512"...
"phoneNumber": [user_data[2]], "birthDate": [user_data[3]], } if mode == "a": ldap_dir["uid=" + email + ",ou=users,dc=zulip,dc=com"] = dict( uid=[email], thumbnailPhoto=[profile_images[i % len(profile_images)]], userAcco...
mode = mode.lower() ldap_data = [] for i in range(1, num_users + 1): name = f"LDAP User {i}" email = f"ldapuser{i}@zulip.com" phone_number = f"999999999{i}" birthdate = f"19{i:02}-{i:02}-{i:02}" ldap_data.append((name, email, phone_number, birthdate)) profile_images ...
identifier_body
dev_ldap_directory.py
import glob import logging import os from typing import Any, Dict, List, Optional from django.conf import settings from zerver.lib.storage import static_path # See https://jackstromberg.com/2013/01/useraccountcontrol-attributeflag-values/ # for docs on what these values mean. LDAP_USER_ACCOUNT_CONTROL_NORMAL = "512"...
) elif mode == "c": ldap_dir["uid=" + email_username + ",ou=users,dc=zulip,dc=com"] = dict( uid=[email_username], email=[email], **common_data ) return ldap_dir def init_fakeldap( directory: Optional[Dict[str, Dict[str, List[str]]]] = None ) -> Non...
email = user_data[1].lower() email_username = email.split("@")[0] common_data = { "cn": [user_data[0]], "userPassword": [email_username], "phoneNumber": [user_data[2]], "birthDate": [user_data[3]], } if mode == "a": ldap_dir["ui...
conditional_block
dev_ldap_directory.py
import glob import logging import os from typing import Any, Dict, List, Optional from django.conf import settings from zerver.lib.storage import static_path # See https://jackstromberg.com/2013/01/useraccountcontrol-attributeflag-values/ # for docs on what these values mean. LDAP_USER_ACCOUNT_CONTROL_NORMAL = "512"...
name = f"LDAP User {i}" email = f"ldapuser{i}@zulip.com" phone_number = f"999999999{i}" birthdate = f"19{i:02}-{i:02}-{i:02}" ldap_data.append((name, email, phone_number, birthdate)) profile_images = [] for path in glob.glob(os.path.join(static_path("images/team"), "*"))...
ldap_data = [] for i in range(1, num_users + 1):
random_line_split
permutations_with_repetitions.rs
// Implements http://rosettacode.org/wiki/Permutations_with_repetitions struct PermutationIterator<'a, T: 'a> { universe: &'a [T], size: usize, prev: Option<Vec<usize>>, } fn permutations<T>(universe: &[T], size: usize) -> PermutationIterator<T> { return PermutationIterator { universe: univers...
} match self.prev { None => { let zeroes: Vec<usize> = std::iter::repeat(0) .take(self.size) .collect(); let result = Some(map(self.universe, &zeroes[..])); ...
return None;
random_line_split
permutations_with_repetitions.rs
// Implements http://rosettacode.org/wiki/Permutations_with_repetitions struct PermutationIterator<'a, T: 'a> { universe: &'a [T], size: usize, prev: Option<Vec<usize>>, } fn permutations<T>(universe: &[T], size: usize) -> PermutationIterator<T>
fn map<T>(values: &[T], ixs: &[usize]) -> Vec<T> where T: Clone { return ixs.iter().map(|&i| values[i].clone()).collect(); } impl<'a, T> Iterator for PermutationIterator<'a, T> where T: Clone { type Item = Vec<T>; fn next(&mut self) -> Option<Vec<T>> { let n = self.universe.len(); if n...
{ return PermutationIterator { universe: universe, size: size, prev: None, } }
identifier_body
permutations_with_repetitions.rs
// Implements http://rosettacode.org/wiki/Permutations_with_repetitions struct PermutationIterator<'a, T: 'a> { universe: &'a [T], size: usize, prev: Option<Vec<usize>>, } fn permutations<T>(universe: &[T], size: usize) -> PermutationIterator<T> { return PermutationIterator { universe: univers...
Some (ref mut indexes) => match indexes.iter().position(|&i| i + 1 < n) { None => return None, Some(position) => { for i in 0..(position) { indexes[i] = 0; } ...
{ let zeroes: Vec<usize> = std::iter::repeat(0) .take(self.size) .collect(); let result = Some(map(self.universe, &zeroes[..])); self.prev = Some(zeroes); return result...
conditional_block
permutations_with_repetitions.rs
// Implements http://rosettacode.org/wiki/Permutations_with_repetitions struct PermutationIterator<'a, T: 'a> { universe: &'a [T], size: usize, prev: Option<Vec<usize>>, } fn permutations<T>(universe: &[T], size: usize) -> PermutationIterator<T> { return PermutationIterator { universe: univers...
(&mut self) -> Option<Vec<T>> { let n = self.universe.len(); if n == 0 { return None; } match self.prev { None => { let zeroes: Vec<usize> = std::iter::repeat(0) .take(self.size) ...
next
identifier_name
ad-track-signup-start.js
import { getCurrentUser } from '@automattic/calypso-analytics'; import { isAdTrackingAllowed, refreshCountryCodeCookieGdpr } from 'calypso/lib/analytics/utils'; import { debug, isWpcomGoogleAdsGtagEnabled, isFloodlightEnabled, TRACKING_IDS } from './constants'; import { recordParamsInFloodlightGtag } from './floodlight...
recordParamsInFloodlightGtag( { send_to: 'DC-6355556/wordp0/landi00+unique', } ); } // Google Ads. if ( isWpcomGoogleAdsGtagEnabled && ! currentUser && 'onboarding' === flow ) { const params = [ 'event', 'conversion', { send_to: TRACKING_IDS.wpcomGoogleAdsGtagSignupStart, }, ]; debug( ...
random_line_split
ad-track-signup-start.js
import { getCurrentUser } from '@automattic/calypso-analytics'; import { isAdTrackingAllowed, refreshCountryCodeCookieGdpr } from 'calypso/lib/analytics/utils'; import { debug, isWpcomGoogleAdsGtagEnabled, isFloodlightEnabled, TRACKING_IDS } from './constants'; import { recordParamsInFloodlightGtag } from './floodlight...
debug( 'adTrackSignupStart: [Floodlight]' ); recordParamsInFloodlightGtag( { send_to: 'DC-6355556/wordp0/landi00+unique', } ); } // Google Ads. if ( isWpcomGoogleAdsGtagEnabled && ! currentUser && 'onboarding' === flow ) { const params = [ 'event', 'conversion', { send_to: TRACKING_IDS.wpco...
{ await refreshCountryCodeCookieGdpr(); if ( ! isAdTrackingAllowed() ) { debug( 'adTrackSignupStart: [Skipping] ad tracking is not allowed' ); return; } await loadTrackingScripts(); const currentUser = getCurrentUser(); // Floodlight. if ( isFloodlightEnabled ) { debug( 'adTrackSignupStart: [Floodlight...
identifier_body
ad-track-signup-start.js
import { getCurrentUser } from '@automattic/calypso-analytics'; import { isAdTrackingAllowed, refreshCountryCodeCookieGdpr } from 'calypso/lib/analytics/utils'; import { debug, isWpcomGoogleAdsGtagEnabled, isFloodlightEnabled, TRACKING_IDS } from './constants'; import { recordParamsInFloodlightGtag } from './floodlight...
( flow ) { await refreshCountryCodeCookieGdpr(); if ( ! isAdTrackingAllowed() ) { debug( 'adTrackSignupStart: [Skipping] ad tracking is not allowed' ); return; } await loadTrackingScripts(); const currentUser = getCurrentUser(); // Floodlight. if ( isFloodlightEnabled ) { debug( 'adTrackSignupStart: [F...
adTrackSignupStart
identifier_name
ad-track-signup-start.js
import { getCurrentUser } from '@automattic/calypso-analytics'; import { isAdTrackingAllowed, refreshCountryCodeCookieGdpr } from 'calypso/lib/analytics/utils'; import { debug, isWpcomGoogleAdsGtagEnabled, isFloodlightEnabled, TRACKING_IDS } from './constants'; import { recordParamsInFloodlightGtag } from './floodlight...
await loadTrackingScripts(); const currentUser = getCurrentUser(); // Floodlight. if ( isFloodlightEnabled ) { debug( 'adTrackSignupStart: [Floodlight]' ); recordParamsInFloodlightGtag( { send_to: 'DC-6355556/wordp0/pre-p0+unique', } ); } if ( isFloodlightEnabled && ! currentUser && 'onboarding' === ...
{ debug( 'adTrackSignupStart: [Skipping] ad tracking is not allowed' ); return; }
conditional_block
aria.js
/** * aria support for slide * @author yiminghe@gmail.com */ KISSY.add("switchable-ext/slide/aria", function (S, DOM, Event, Switchable) { // var KEY_PAGEUP = 33; // var KEY_PAGEDOWN = 34; // var KEY_END = 35; // var KEY_HOME = 36; var KEY_LEFT = 37; var KEY_UP = 38; var KEY_RIGHT = 39;...
var triggers = self.triggers; var panels = self.panels; var i = 0; var activeIndex = self.activeIndex; S.each(triggers, function (t) { setTabIndex(t, "-1"); i++; }); i = 0; S.each(panels, fun...
{ return; }
conditional_block
aria.js
/** * aria support for slide * @author yiminghe@gmail.com */ KISSY.add("switchable-ext/slide/aria", function (S, DOM, Event, Switchable) { // var KEY_PAGEUP = 33; // var KEY_PAGEDOWN = 34; // var KEY_END = 35; // var KEY_HOME = 36; var KEY_LEFT = 37; var KEY_UP = 38; var KEY_RIGHT = 39;...
case KEY_UP: case KEY_LEFT: self.prev(DOM_EVENT); e.halt(); break; } } }, { requires:["dom", "event", 'switchable'] }); /** 2011-05-12 yiminghe@gmail.com:add support for aria & keydown <h2>键盘操作</h2> <ul class="list"> <li>tab 进...
case KEY_RIGHT: self.next(DOM_EVENT); e.halt(); break;
random_line_split
aria.js
/** * aria support for slide * @author yiminghe@gmail.com */ KISSY.add("switchable-ext/slide/aria", function (S, DOM, Event, Switchable) { // var KEY_PAGEUP = 33; // var KEY_PAGEDOWN = 34; // var KEY_END = 35; // var KEY_HOME = 36; var KEY_LEFT = 37; var KEY_UP = 38; var KEY_RIGHT = 39;...
lf = this, key = e.keyCode; switch (key) { case KEY_DOWN: case KEY_RIGHT: self.next(DOM_EVENT); e.halt(); break; case KEY_UP: case KEY_LEFT: self.prev(DOM_EVENT); e.halt(...
ss(e) { var se
identifier_name
aria.js
/** * aria support for slide * @author yiminghe@gmail.com */ KISSY.add("switchable-ext/slide/aria", function (S, DOM, Event, Switchable) { // var KEY_PAGEUP = 33; // var KEY_PAGEDOWN = 34; // var KEY_END = 35; // var KEY_HOME = 36; var KEY_LEFT = 37; var KEY_UP = 38; var KEY_RIGHT = 39;...
["dom", "event", 'switchable'] }); /** 2011-05-12 yiminghe@gmail.com:add support for aria & keydown <h2>键盘操作</h2> <ul class="list"> <li>tab 进入卡盘时,停止自动播放</li> <li>上/左键:当焦点位于卡盘时,切换到上一个 slide 面板</li> <li>下/右键:当焦点位于卡盘时,切换到下一个 slide 面板</li> <li>tab 离开卡盘时,开始自动播放</li> </ul> **/
this, key = e.keyCode; switch (key) { case KEY_DOWN: case KEY_RIGHT: self.next(DOM_EVENT); e.halt(); break; case KEY_UP: case KEY_LEFT: self.prev(DOM_EVENT); e.halt(); ...
identifier_body
android_ip_webcam.py
""" Support for IP Webcam settings. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.android_ip_webcam/ """ from homeassistant.components.switch import SwitchDevice from homeassistant.components.android_ip_webcam import ( KEY_MAP, ICON_MAP, DAT...
self._state = True self.async_schedule_update_ha_state() async def async_turn_off(self, **kwargs): """Turn device off.""" if self._setting == 'torch': await self._ipcam.torch(activate=False) elif self._setting == 'focus': await self._ipcam.focus(acti...
await self._ipcam.change_setting(self._setting, True)
conditional_block
android_ip_webcam.py
""" Support for IP Webcam settings. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.android_ip_webcam/ """ from homeassistant.components.switch import SwitchDevice from homeassistant.components.android_ip_webcam import ( KEY_MAP, ICON_MAP, DAT...
def name(self): """Return the name of the node.""" return self._name async def async_update(self): """Get the updated status of the switch.""" self._state = bool(self._ipcam.current_settings.get(self._setting)) @property def is_on(self): """Return the boolean re...
self._state = False @property
random_line_split
android_ip_webcam.py
""" Support for IP Webcam settings. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.android_ip_webcam/ """ from homeassistant.components.switch import SwitchDevice from homeassistant.components.android_ip_webcam import ( KEY_MAP, ICON_MAP, DAT...
(self): """Return the icon for the switch.""" return ICON_MAP.get(self._setting, 'mdi:flash')
icon
identifier_name
android_ip_webcam.py
""" Support for IP Webcam settings. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.android_ip_webcam/ """ from homeassistant.components.switch import SwitchDevice from homeassistant.components.android_ip_webcam import ( KEY_MAP, ICON_MAP, DAT...
@property def is_on(self): """Return the boolean response if the node is on.""" return self._state async def async_turn_on(self, **kwargs): """Turn device on.""" if self._setting == 'torch': await self._ipcam.torch(activate=True) elif self._setting == '...
"""Get the updated status of the switch.""" self._state = bool(self._ipcam.current_settings.get(self._setting))
identifier_body
struct_with_derive_debug.rs
/* automatically generated by rust-bindgen */ #![allow(non_snake_case)] #[repr(C)] #[derive(Debug, Copy)] pub struct LittleArray { pub a: [::std::os::raw::c_int; 32usize], } #[test] fn bindgen_test_layout_LittleArray() { assert_eq!(::std::mem::size_of::<LittleArray>() , 128usize); assert_eq!(::std::mem:...
assert_eq!(::std::mem::size_of::<WithLittleArray>() , 128usize); assert_eq!(::std::mem::align_of::<WithLittleArray>() , 4usize); } impl Clone for WithLittleArray { fn clone(&self) -> Self { *self } } #[repr(C)] pub struct WithBigArray { pub a: BigArray, } #[test] fn bindgen_test_layout_WithBigArray() { ...
pub struct WithLittleArray { pub a: LittleArray, } #[test] fn bindgen_test_layout_WithLittleArray() {
random_line_split
struct_with_derive_debug.rs
/* automatically generated by rust-bindgen */ #![allow(non_snake_case)] #[repr(C)] #[derive(Debug, Copy)] pub struct LittleArray { pub a: [::std::os::raw::c_int; 32usize], } #[test] fn bindgen_test_layout_LittleArray() { assert_eq!(::std::mem::size_of::<LittleArray>() , 128usize); assert_eq!(::std::mem:...
} #[repr(C)] pub struct BigArray { pub a: [::std::os::raw::c_int; 33usize], } #[test] fn bindgen_test_layout_BigArray() { assert_eq!(::std::mem::size_of::<BigArray>() , 132usize); assert_eq!(::std::mem::align_of::<BigArray>() , 4usize); } #[repr(C)] #[derive(Debug, Copy)] pub struct WithLittleArray { p...
{ *self }
identifier_body
struct_with_derive_debug.rs
/* automatically generated by rust-bindgen */ #![allow(non_snake_case)] #[repr(C)] #[derive(Debug, Copy)] pub struct LittleArray { pub a: [::std::os::raw::c_int; 32usize], } #[test] fn bindgen_test_layout_LittleArray() { assert_eq!(::std::mem::size_of::<LittleArray>() , 128usize); assert_eq!(::std::mem:...
(&self) -> Self { *self } } #[repr(C)] pub struct BigArray { pub a: [::std::os::raw::c_int; 33usize], } #[test] fn bindgen_test_layout_BigArray() { assert_eq!(::std::mem::size_of::<BigArray>() , 132usize); assert_eq!(::std::mem::align_of::<BigArray>() , 4usize); } #[repr(C)] #[derive(Debug, Copy)] pub struc...
clone
identifier_name
issue-3021.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 ...
} fail2!(); } fn main() {}
{ self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment //~^ ERROR unresolved name `k0`. }
identifier_body
issue-3021.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 ...
} } fail2!(); } fn main() {}
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment //~^ ERROR unresolved name `k0`.
random_line_split
issue-3021.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 ...
() {}
main
identifier_name
issue-17252.rs
// Copyright 2014 The Rust Project Developers. See the 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 http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. static FOO: uint = ...
// file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. //
random_line_split
issue-17252.rs
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
() { let _x: [u8, ..FOO]; // caused stack overflow prior to fix let _y: uint = 1 + { static BAR: uint = BAR; //~ ERROR recursive constant let _z: [u8, ..BAR]; // caused stack overflow prior to fix 1 }; }
main
identifier_name
issue-17252.rs
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
{ let _x: [u8, ..FOO]; // caused stack overflow prior to fix let _y: uint = 1 + { static BAR: uint = BAR; //~ ERROR recursive constant let _z: [u8, ..BAR]; // caused stack overflow prior to fix 1 }; }
identifier_body
bench_extern.rs
#![feature(test)] extern crate racer_testutils; extern crate test; use test::Bencher; use racer_testutils::*; #[bench] fn completes_rand(b: &mut Bencher)
#[bench] fn completes_rayon(b: &mut Bencher) { let src = " extern crate rayon; extern crate rand; use rand::{Rng, thread_rng}; fn main() { rayon::colle~ } "; let mut match_ = None; b.iter(|| { with_test_project(|dir| { let src_dir = dir.nested_dir("test-...
{ let src = " extern crate rand; use rand::{Rng, thread_rng}; fn main() { let mut rng: Box<Rng> = Box::new(thread_rng()); rng.gen_rang~ } "; let mut match_ = None; b.iter(|| { with_test_project(|dir| { let src_dir = dir.nested_dir("test-crate3").nested...
identifier_body
bench_extern.rs
#![feature(test)] extern crate racer_testutils; extern crate test; use test::Bencher; use racer_testutils::*; #[bench] fn
(b: &mut Bencher) { let src = " extern crate rand; use rand::{Rng, thread_rng}; fn main() { let mut rng: Box<Rng> = Box::new(thread_rng()); rng.gen_rang~ } "; let mut match_ = None; b.iter(|| { with_test_project(|dir| { let src_dir = dir.nested_dir("te...
completes_rand
identifier_name
bench_extern.rs
#![feature(test)] extern crate racer_testutils; extern crate test; use test::Bencher; use racer_testutils::*; #[bench] fn completes_rand(b: &mut Bencher) { let src = " extern crate rand; use rand::{Rng, thread_rng}; fn main() { let mut rng: Box<Rng> = Box::new(thread_rng()); rng.gen_ra...
}
random_line_split
KPassivePopupMessageHandler.py
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg cl...
def __init__(self, *args, **kwargs): # real signature unknown pass
pass
identifier_body
KPassivePopupMessageHandler.py
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg cl...
(self, *args, **kwargs): # real signature unknown pass
__init__
identifier_name
http.js
/** * HTTP Server Settings * (sails.config.http) * * Configuration for the underlying HTTP server in Sails. * Only applies to HTTP requests (not WebSockets) * * For more information on configuration, check out: * http://links.sailsjs.org/docs/config/http */ module.exports.http = { middleware: { // The...
}, // The number of seconds to cache flat files on disk being served by // Express static middleware (by default, these files are in `.tmp/public`) // // The HTTP static cache is only active in a 'production' environment, // since that's the only time Express will cache flat-files. cache: 31557600000 };
// See http://www.senchalabs.org/connect/multipart.html for other options. // bodyParser: require('skipper')
random_line_split
_WithSize.js
export default { size: function() { var cs = getComputedStyle(this.domNode), bb = cs.getPropertyValue('box-sizing') === 'border-box', height = cs.getPropertyValue('height'), width = cs.getPropertyValue('width'); if (height === 'auto') { height = this....
height += parseFloat(cs.getPropertyValue('border-bottom-width') || 0); } } if (width === 'auto') { width = this.domNode.offsetWidth; } else { width = parseFloat(width); if (!bb) { width += parseFloat(cs.getPropertyV...
random_line_split
_WithSize.js
export default { size: function() { var cs = getComputedStyle(this.domNode), bb = cs.getPropertyValue('box-sizing') === 'border-box', height = cs.getPropertyValue('height'), width = cs.getPropertyValue('width'); if (height === 'auto') { height = this....
} if (width === 'auto') { width = this.domNode.offsetWidth; } else { width = parseFloat(width); if (!bb) { width += parseFloat(cs.getPropertyValue('padding-left') || 0); width += parseFloat(cs.getPropertyValue('padding-right')...
{ height += parseFloat(cs.getPropertyValue('padding-top') || 0); height += parseFloat(cs.getPropertyValue('padding-bottom') || 0); height += parseFloat(cs.getPropertyValue('border-top-width') || 0); height += parseFloat(cs.getPropertyValue('border-bottom-w...
conditional_block
font.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/. */ //! Generic types for font stuff. use cssparser::Parser; use num_traits::One; use parser::{Parse, ParserContext};...
dest.write_char(' ')?; self.value.to_css(dest)?; } Ok(()) } } /// Variation setting for a single feature, see: /// /// https://drafts.csswg.org/css-fonts-4/#font-variation-settings-def #[derive(Animate, Clone, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue, ToCss)] pub...
if self.value != Integer::one() {
random_line_split
font.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/. */ //! Generic types for font stuff. use cssparser::Parser; use num_traits::One; use parser::{Parse, ParserContext};...
<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: Write, { if self.0.is_empty() { return dest.write_str("normal"); } let mut first = true; for item in self.0.iter() { if !first { dest.write_str(", ")?; } ...
to_css
identifier_name
font.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/. */ //! Generic types for font stuff. use cssparser::Parser; use num_traits::One; use parser::{Parse, ParserContext};...
self.value.compute_squared_distance(&other.value) } } /// A value both for font-variation-settings and font-feature-settings. #[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToComputedValue)] pub struct FontSettings<T>(pub Box<[T]>); impl<T> FontSettings<T> { /// Default value of font settings as...
{ return Err(()); }
conditional_block
font.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/. */ //! Generic types for font stuff. use cssparser::Parser; use num_traits::One; use parser::{Parse, ParserContext};...
}
{ if self.0.is_empty() { return dest.write_str("normal"); } let mut first = true; for item in self.0.iter() { if !first { dest.write_str(", ")?; } first = false; item.to_css(dest)?; } Ok(()) ...
identifier_body
gutters.js
import { elt, removeChildren } from "../util/dom" import { indexOf } from "../util/misc" import { updateGutterSpace } from "./update_display" // Rebuild the gutter elements, ensure the margin to the left of the // code matches their width. export function updateGutters(cm) { var gutters = cm.display.gutters, specs ...
else if (found > -1 && !options.lineNumbers) { options.gutters = options.gutters.slice(0) options.gutters.splice(found, 1) } }
{ options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]) }
conditional_block
gutters.js
import { elt, removeChildren } from "../util/dom" import { indexOf } from "../util/misc" import { updateGutterSpace } from "./update_display" // Rebuild the gutter elements, ensure the margin to the left of the // code matches their width. export function updateGutters(cm) { var gutters = cm.display.gutters, specs ...
// Make sure the gutters options contains the element // "CodeMirror-linenumbers" when the lineNumbers option is true. export function setGuttersForLineNumbers(options) { var found = indexOf(options.gutters, "CodeMirror-linenumbers") if (found == -1 && options.lineNumbers) { options.gutters = options.gutters.c...
} } gutters.style.display = i ? "" : "none" updateGutterSpace(cm) }
random_line_split
gutters.js
import { elt, removeChildren } from "../util/dom" import { indexOf } from "../util/misc" import { updateGutterSpace } from "./update_display" // Rebuild the gutter elements, ensure the margin to the left of the // code matches their width. export function updateGutters(cm) { var gutters = cm.display.gutters, specs ...
(options) { var found = indexOf(options.gutters, "CodeMirror-linenumbers") if (found == -1 && options.lineNumbers) { options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]) } else if (found > -1 && !options.lineNumbers) { options.gutters = options.gutters.slice(0) options.gutters.splice(f...
setGuttersForLineNumbers
identifier_name
gutters.js
import { elt, removeChildren } from "../util/dom" import { indexOf } from "../util/misc" import { updateGutterSpace } from "./update_display" // Rebuild the gutter elements, ensure the margin to the left of the // code matches their width. export function updateGutters(cm)
// Make sure the gutters options contains the element // "CodeMirror-linenumbers" when the lineNumbers option is true. export function setGuttersForLineNumbers(options) { var found = indexOf(options.gutters, "CodeMirror-linenumbers") if (found == -1 && options.lineNumbers) { options.gutters = options.gutters....
{ var gutters = cm.display.gutters, specs = cm.options.gutters removeChildren(gutters) for (var i = 0; i < specs.length; ++i) { var gutterClass = specs[i] var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass)) if (gutterClass == "CodeMirror-linenumbers") { cm.displa...
identifier_body
PlatformHealthOverrideMessage.tsx
import React from 'react'; import { get } from 'lodash'; import { Application } from 'core/application/application.model'; import { IInstanceCounts, IStage, ITask, ITaskStep, ITimedItem } from 'core/domain'; import { Tooltip } from 'core/presentation'; import { Duration } from 'luxon'; export interface IPlatformHealt...
extends React.Component< IPlatformHealthOverrideMessageProps, IPlatformHealthOverrideMessageState > { private tooltipTemplate = ( <span> <p>Task not completing?</p> <p> By default, Spinnaker does not consider cloud provider health (i.e. whether your instances have launched and are ...
PlatformHealthOverrideMessage
identifier_name
PlatformHealthOverrideMessage.tsx
import React from 'react'; import { get } from 'lodash'; import { Application } from 'core/application/application.model'; import { IInstanceCounts, IStage, ITask, ITaskStep, ITimedItem } from 'core/domain'; import { Tooltip } from 'core/presentation'; import { Duration } from 'luxon'; export interface IPlatformHealt...
return ( <Tooltip template={this.tooltipTemplate}> <i className="fa fa-exclamation-circle" style={{ fontSize: 'smaller' }} /> </Tooltip> ); } }
{ return null; }
conditional_block
PlatformHealthOverrideMessage.tsx
import React from 'react'; import { get } from 'lodash'; import { Application } from 'core/application/application.model'; import { IInstanceCounts, IStage, ITask, ITaskStep, ITimedItem } from 'core/domain'; import { Tooltip } from 'core/presentation'; import { Duration } from 'luxon'; export interface IPlatformHealt...
} }
random_line_split
globalConstant.py
#global declaration global index0 global index1 global index2 global index3 global index4 global index5 global index6 global index7 global index8 global index9 global index10 global index11 global index12
global index17 global index18 global index19 global index20 global index21 global index22 global nextNoteDurationBase global note global pitch_train global pitch_test global duration_train global duration_test #used for getting duration information index0 = 1/4 index1 = 1/3 index2 = 1/2 index3...
global index13 global index14 global index15 global index16
random_line_split
var-captured-in-nested-closure.rs
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
zzz(); // #break nested_closure(); }; closure(); } fn zzz() {()}
{ let mut variable = 1; let constant = 2; let a_struct = Struct { a: -3, b: 4.5, c: 5 }; let struct_ref = &a_struct; let owned = box 6; let closure = || { let closure_local = 8; let nested_closure = || { zzz(); // #break var...
identifier_body
var-captured-in-nested-closure.rs
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
// gdb-command:print variable // gdb-check:$1 = 1 // gdb-command:print constant // gdb-check:$2 = 2 // gdb-command:print a_struct // gdb-check:$3 = {a = -3, b = 4.5, c = 5} // gdb-command:print *struct_ref // gdb-check:$4 = {a = -3, b = 4.5, c = 5} // gdb-command:print *owned // gdb-check:$5 = 6 // gdb-command:print c...
// === GDB TESTS =================================================================================== // gdb-command:run
random_line_split
var-captured-in-nested-closure.rs
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
() {()}
zzz
identifier_name
plano.py
# -*- coding: utf-8 -*- from django import forms from django.utils.translation import ugettext_lazy as _ from django.forms import inlineformset_factory from djangosige.apps.financeiro.models import PlanoContasGrupo, PlanoContasSubgrupo class PlanoContasGrupoForm(forms.ModelForm): class Meta: model = Pl...
fields = ('descricao',) widgets = { 'descricao': forms.TextInput(attrs={'class': 'form-control'}), } labels = { 'descricao': _('Descrição'), } PlanoContasSubgrupoFormSet = inlineformset_factory( PlanoContasGrupo, PlanoContasSubgrupo, form=PlanoContas...
class PlanoContasSubgrupoForm(forms.ModelForm): class Meta: model = PlanoContasSubgrupo
random_line_split
plano.py
# -*- coding: utf-8 -*- from django import forms from django.utils.translation import ugettext_lazy as _ from django.forms import inlineformset_factory from djangosige.apps.financeiro.models import PlanoContasGrupo, PlanoContasSubgrupo class PlanoContasGrupoForm(forms.ModelForm): class Meta: model = Pl...
anoContasSubgrupoFormSet = inlineformset_factory( PlanoContasGrupo, PlanoContasSubgrupo, form=PlanoContasSubgrupoForm, fk_name='grupo', extra=1, can_delete=True)
el = PlanoContasSubgrupo fields = ('descricao',) widgets = { 'descricao': forms.TextInput(attrs={'class': 'form-control'}), } labels = { 'descricao': _('Descrição'), } Pl
identifier_body
plano.py
# -*- coding: utf-8 -*- from django import forms from django.utils.translation import ugettext_lazy as _ from django.forms import inlineformset_factory from djangosige.apps.financeiro.models import PlanoContasGrupo, PlanoContasSubgrupo class
(forms.ModelForm): class Meta: model = PlanoContasGrupo fields = ('tipo_grupo', 'descricao',) widgets = { 'descricao': forms.TextInput(attrs={'class': 'form-control'}), 'tipo_grupo': forms.Select(attrs={'class': 'form-control'}), } labels = { ...
PlanoContasGrupoForm
identifier_name
RolesStore.ts
/// <reference path="../../../declarations/bluebird/bluebird.d.ts" /> const UserNotification = require('util/UserNotification'); const URLUtils = require('util/URLUtils'); import UsersStore = require('stores/users/UsersStore'); import jsRoutes = require('routing/jsRoutes'); const fetch = require('logic/rest/FetchProvi...
}); return promise; } }; export default RolesStore;
{ UserNotification.error("Could not load role's members with status: " + error, "Could not load role members"); }
conditional_block
RolesStore.ts
/// <reference path="../../../declarations/bluebird/bluebird.d.ts" /> const UserNotification = require('util/UserNotification'); const URLUtils = require('util/URLUtils'); import UsersStore = require('stores/users/UsersStore'); import jsRoutes = require('routing/jsRoutes'); const fetch = require('logic/rest/FetchProvi...
} }; export default RolesStore;
return promise;
random_line_split
RolesStore.ts
/// <reference path="../../../declarations/bluebird/bluebird.d.ts" /> const UserNotification = require('util/UserNotification'); const URLUtils = require('util/URLUtils'); import UsersStore = require('stores/users/UsersStore'); import jsRoutes = require('routing/jsRoutes'); const fetch = require('logic/rest/FetchProvi...
, updateRole(rolename: string, role: Role): Promise<Role> { const promise = fetch('PUT', URLUtils.qualifyUrl(jsRoutes.controllers.api.RolesApiController.updateRole(rolename).url), role); promise.then((newRole) => { UserNotification.success("Role \"" + newRole.name + "\" was updated successfully"); ...
{ const url = URLUtils.qualifyUrl(jsRoutes.controllers.api.RolesApiController.createRole().url); const promise = fetch('POST', url, role); promise.then((newRole) => { UserNotification.success("Role \"" + newRole.name + "\" was created successfully"); }, (error) => { UserNotification.error("...
identifier_body
RolesStore.ts
/// <reference path="../../../declarations/bluebird/bluebird.d.ts" /> const UserNotification = require('util/UserNotification'); const URLUtils = require('util/URLUtils'); import UsersStore = require('stores/users/UsersStore'); import jsRoutes = require('routing/jsRoutes'); const fetch = require('logic/rest/FetchProvi...
(): Promise<string[]> { const promise = fetch('GET', URLUtils.qualifyUrl(jsRoutes.controllers.api.RolesApiController.listRoles().url)) .then( response => response.roles, error => { if (error.additional.status !== 404) { UserNotification.error("Loading role list failed wit...
loadRoles
identifier_name
settings.component.ts
import {Component,Input} from '@angular/core'; import { WindowService } from "../services/window.service"; import { ActivatedRoute, Router } from "@angular/router"; import { RestService } from "../services/rest.service"; import { Title } from '@angular/platform-browser'; @Component({ selector : 'setting...
{ @Input() display:string; url; customHeight:number =800; subscription; constitutionId constructor (private rest:RestService,private route: ActivatedRoute,private _router: Router,private titleService:Title) { this.subscription = this.route.params.subscribe(params => { ...
SettingsComponent
identifier_name
settings.component.ts
import {Component,Input} from '@angular/core'; import { WindowService } from "../services/window.service"; import { ActivatedRoute, Router } from "@angular/router"; import { RestService } from "../services/rest.service"; import { Title } from '@angular/platform-browser'; @Component({ selector : 'setting...
else{ this.display = this._router.url; } } }
{ this.rest.logOut(); this._router.navigateByUrl(''); }
conditional_block
settings.component.ts
import {Component,Input} from '@angular/core'; import { WindowService } from "../services/window.service"; import { ActivatedRoute, Router } from "@angular/router"; import { RestService } from "../services/rest.service"; import { Title } from '@angular/platform-browser'; @Component({ selector : 'setting...
ngOnInit(){ this.titleService.setTitle('La constituante'); if(this._router.url === '/deconnexion'){ this.rest.logOut(); this._router.navigateByUrl(''); }else{ this.display = this._router.url; } } }
{ this.subscription = this.route.params.subscribe(params => { this.constitutionId = params['id']; }); }
identifier_body
settings.component.ts
import {Component,Input} from '@angular/core'; import { WindowService } from "../services/window.service"; import { ActivatedRoute, Router } from "@angular/router"; import { RestService } from "../services/rest.service"; import { Title } from '@angular/platform-browser'; @Component({ selector : 'setting...
this.rest.logOut(); this._router.navigateByUrl(''); }else{ this.display = this._router.url; } } }
} ngOnInit(){ this.titleService.setTitle('La constituante'); if(this._router.url === '/deconnexion'){
random_line_split
main.rs
// 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
// with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either expre...
// to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance
random_line_split
main.rs
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
{ #[cfg(feature = "cli")] repl::main() }
identifier_body
main.rs
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
() { #[cfg(feature = "cli")] repl::main() }
main
identifier_name
config.py
ING = False # The number of snapshots kept, older ones are deleted to save space __C.TRAIN.SNAPSHOT_KEPT = 3 # The time interval for saving tensorflow summaries __C.TRAIN.SUMMARY_INTERVAL = 180 # Scale to use during training (can NOT list multiple scales) # The scale is the pixel size of an image's shortest side __C...
# tall and thin or both short and wide) in order to avoid wasting computation # on zero-padding. # Use RPN to detect objects __C.TRAIN.HAS_RPN = True # IOU >= thresh: positive example __C.TRAIN.RPN_POSITIVE_OVERLAP = 0.7 # IOU < thresh: negative example __C.TRAIN.RPN_NEGATIVE_OVERLAP = 0.3 # If an anchor statisfied by...
# Make minibatches from images that have similar aspect ratios (i.e. both
random_line_split
config.py
_TARGETS_PRECOMPUTED = True __C.TRAIN.BBOX_NORMALIZE_MEANS = (0.0, 0.0, 0.0, 0.0) __C.TRAIN.BBOX_NORMALIZE_STDS = (0.1, 0.1, 0.2, 0.2) # Train using these proposals __C.TRAIN.PROPOSAL_METHOD = 'gt' # Make minibatches from images that have similar aspect ratios (i.e. both # tall and thin or both short and wide) in ord...
try: _merge_a_into_b(a[k], b[k]) except: print(('Error under config key: {}'.format(k))) raise
conditional_block
config.py
# overlap in [LO, HI)) __C.TRAIN.BG_THRESH_HI = 0.5 __C.TRAIN.BG_THRESH_LO = 0.1 # Use horizontally-flipped images during training? __C.TRAIN.USE_FLIPPED = True # Train bounding-box regressors __C.TRAIN.BBOX_REG = True # Overlap required between a ROI and ground-truth box in order for that ROI to # be used as a boun...
"""Return the directory where experimental artifacts are placed. If the directory does not exist, it is created. A canonical path is built using the name from an imdb and a network (if not None). """ outdir = osp.abspath(osp.join(__C.ROOT_DIR, 'output', __C.EXP_DIR, imdb.name)) if weights_filename is None:...
identifier_body
config.py
IZE_MEANS = (0.0, 0.0, 0.0, 0.0) __C.TRAIN.BBOX_NORMALIZE_STDS = (0.1, 0.1, 0.2, 0.2) # Train using these proposals __C.TRAIN.PROPOSAL_METHOD = 'gt' # Make minibatches from images that have similar aspect ratios (i.e. both # tall and thin or both short and wide) in order to avoid wasting computation # on zero-padding...
cfg_from_file
identifier_name
redirectMiddleware.py
# -*- coding: utf-8 -*- # Copyright (C) 2010-2014 Tobias Weber <tobi-weber@gmx.de> # # 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 ...
""" @param url: Redirect URL @param permanent: """ Middleware.__init__(self) self._url = url self._permanent = permanent def get(self): return self.redirect(self._url, permanent=self._permanent)
def __init__(self, url, permanent=True):
random_line_split
redirectMiddleware.py
# -*- coding: utf-8 -*- # Copyright (C) 2010-2014 Tobias Weber <tobi-weber@gmx.de> # # 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 ...
return self.redirect(self._url, permanent=self._permanent)
identifier_body
redirectMiddleware.py
# -*- coding: utf-8 -*- # Copyright (C) 2010-2014 Tobias Weber <tobi-weber@gmx.de> # # 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 ...
(Middleware): """ Redirects the client to the given URL for all GET requests. Example settings entry: urls = [(r"/oldpath", RedirectMiddleware, {"url": "/newpath", "permanent": True})] """ LOG = True def __init__(self, url, permanent=True): """ @param ur...
RedirectMiddleware
identifier_name
mod.rs
// This module contains helpers functions and types that // are not test in themselves, but are used by several tests. #![allow(dead_code, unused_macros)] pub extern crate wayland_client as wayc; pub extern crate wayland_server as ways; use std::os::unix::net::UnixStream; use std::sync::atomic::{AtomicBool, Ordering...
_: &$crate::helpers::ways::Client, new_id: $crate::helpers::ways::New<$iface>, _: &(), data_init: &mut $crate::helpers::ways::DataInit<'_, Self>, ) { data_init.init(new_id, ()); } ...
_: &mut $crate::helpers::ways::DisplayHandle<'_>,
random_line_split
mod.rs
// This module contains helpers functions and types that // are not test in themselves, but are used by several tests. #![allow(dead_code, unused_macros)] pub extern crate wayland_client as wayc; pub extern crate wayland_server as ways; use std::os::unix::net::UnixStream; use std::sync::atomic::{AtomicBool, Ordering...
(socket: UnixStream) -> TestClient<D> { let conn = self::wayc::Connection::from_socket(socket).expect("Failed to connect to server."); let event_queue = conn.new_event_queue(); let display = conn.handle().display(); TestClient { conn, display, event_queue } } pub fn ...
new
identifier_name
disease-management.js
var deseasesDatatable; $(document).ready(function() { setMenuItemActive(); TableManageButtons.init(); deseasesDatatable = $('#datatable').dataTable({ ajax: { "type" : "POST", "url": contextPath + "/ListDiseasesServlet", "dataSrc": "" }, "columns": [ { "data"...
seServlet", type: "POST", data: $("#form-add-disease").serialize(), dataType: 'json' }).done(function(data) { if (data["status"] == "success") { $(".modal").modal("hide"); showMsg($(".msg-success")); deseasesDatatable.api().ajax.reload(); } else { ...
reateDisea
identifier_name
disease-management.js
var deseasesDatatable; $(document).ready(function() { setMenuItemActive(); TableManageButtons.init(); deseasesDatatable = $('#datatable').dataTable({ ajax: { "type" : "POST", "url": contextPath + "/ListDiseasesServlet", "dataSrc": "" }, "columns": [ { "data"...
url: contextPath + "/UpdateDiseasesServlet", type: "POST", data: $("#form-update-disease").serialize(), dataType: 'json' }).done(function(data) { if (data["status"] == "success") { $(".modal").modal("hide"); showMsg($(".msg-success")); deseasesDatatable.api().a...
ervlet", type: "POST", data: $("#form-add-disease").serialize(), dataType: 'json' }).done(function(data) { if (data["status"] == "success") { $(".modal").modal("hide"); showMsg($(".msg-success")); deseasesDatatable.api().ajax.reload(); } else { $("...
identifier_body
disease-management.js
var deseasesDatatable; $(document).ready(function() { setMenuItemActive(); TableManageButtons.init(); deseasesDatatable = $('#datatable').dataTable({ ajax: { "type" : "POST", "url": contextPath + "/ListDiseasesServlet", "dataSrc": "" }, "columns": [ { "data"...
(".msg-fail")); } }).fail(function(err) { }); } function getDiseasesById(diseasesId) { $.ajax({ url: contextPath + "/ShowDiseasesServlet", type: "POST", data: { diseasesId: diseasesId }, dataType: 'json' }).done(function(data) { ...
g-success")); deseasesDatatable.api().ajax.reload(); } else { $(".modal").modal("hide") showMsg($
conditional_block
disease-management.js
var deseasesDatatable; $(document).ready(function() { setMenuItemActive(); TableManageButtons.init(); deseasesDatatable = $('#datatable').dataTable({ ajax: { "type" : "POST", "url": contextPath + "/ListDiseasesServlet", "dataSrc": "" }, "columns": [ { "data"...
} }); $("#form-add-disease").validate({ rules: { diseaseName: { required: true, maxlength: 100 }, description: { maxlength: 500 } }, messages: { }, submitHandler: function(form) { $(".loading-bar").slideDown(100); addDisease(); $("#form-add-disease")[0].reset();...
"sFirst" : "Đầu", "sPrevious" : "Trước", "sNext" : "Tiếp", "sLast" : "Cuối" }
random_line_split
readonlyadmin.py
from collections import OrderedDict from django.contrib import admin from django.core.exceptions import PermissionDenied class SetOfEverything(list): def __contains__(self, other): return True ## adopted from http://mike.hostetlerhome.com/blog/2012/11/13/add-a-read-only-role-to-django-admin/ class Read...
try: return super(ReadOnlyAdmin, self).change_view(request, object_id, extra_context=extra_context) except PermissionDenied: pass if request.method == 'POST': raise PermissionDenied request.readonly = True return super(ReadOnlyAdmin, self).ch...
self.readonly_fields = SetOfEverything()
conditional_block