file_name large_stringlengths 4 140 | prefix large_stringlengths 0 39k | suffix large_stringlengths 0 36.1k | middle large_stringlengths 0 29.4k | fim_type large_stringclasses 4
values |
|---|---|---|---|---|
nodes.service.ts | import { Injectable } from '@angular/core';
import { Subject , Observable } from 'rxjs';
@Injectable()
export class NodesService {
newModal = new Subject<any>();
newEditModal = new Subject<any>();
nodes: any;
selectedItems = new Array();
searchString: string;
constructor() { }
// return all selected
... | () {
this.selectedItems = [];
}
// Record/Delete a selection from the "selected items" array.
selectItem(item, event) {
if (event) {
this.selectedItems.push(item);
} else {
for (const obj of this.selectedItems) {
if (item.id === obj.id) {
this.selectedItems.splice(
... | resetSelected | identifier_name |
nodes.service.ts | import { Injectable } from '@angular/core';
import { Subject , Observable } from 'rxjs';
@Injectable()
export class NodesService {
newModal = new Subject<any>();
newEditModal = new Subject<any>();
nodes: any;
selectedItems = new Array();
searchString: string;
constructor() { }
// return all selected
... |
}
return false;
}
resetSelected() {
this.selectedItems = [];
}
// Record/Delete a selection from the "selected items" array.
selectItem(item, event) {
if (event) {
this.selectedItems.push(item);
} else {
for (const obj of this.selectedItems) {
if (item.id === obj.id)... | { return true; } | conditional_block |
nodes.service.ts | import { Injectable } from '@angular/core';
import { Subject , Observable } from 'rxjs';
@Injectable()
export class NodesService {
newModal = new Subject<any>();
newEditModal = new Subject<any>();
nodes: any;
selectedItems = new Array();
searchString: string;
constructor() |
// return all selected
returnSelected() {
return this.selectedItems;
}
isChecked(item) {
for (const obj of this.selectedItems) {
if (item.id === obj.id) { return true; }
}
return false;
}
resetSelected() {
this.selectedItems = [];
}
// Record/Delete a selection from the "s... | { } | identifier_body |
nodes.service.ts | import { Injectable } from '@angular/core';
import { Subject , Observable } from 'rxjs';
@Injectable()
export class NodesService {
newModal = new Subject<any>();
newEditModal = new Subject<any>();
nodes: any;
selectedItems = new Array();
searchString: string;
constructor() { }
// return all selected
... | isChecked(item) {
for (const obj of this.selectedItems) {
if (item.id === obj.id) { return true; }
}
return false;
}
resetSelected() {
this.selectedItems = [];
}
// Record/Delete a selection from the "selected items" array.
selectItem(item, event) {
if (event) {
this.select... | random_line_split | |
liveness-dead.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() {} | random_line_split | |
liveness-dead.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 f2() {
let mut x: int = 3; //~ ERROR: value assigned to `x` is never read
x = 4;
x.clone();
}
fn f3() {
let mut x: int = 3;
x.clone();
x = 4; //~ ERROR: value assigned to `x` is never read
}
fn main() {}
| {
*x = 1; // no error
} | identifier_body |
liveness-dead.rs | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | () {
let mut x: int = 3; //~ ERROR: value assigned to `x` is never read
x = 4;
x.clone();
}
fn f3() {
let mut x: int = 3;
x.clone();
x = 4; //~ ERROR: value assigned to `x` is never read
}
fn main() {}
| f2 | identifier_name |
interaccion_usuario.py | #!/usr/bin/env python
# coding: utf-8
#encoding: latin1
def ingresar_numero(numero_minimo, numero_maximo):
''' Muestra un cursor de ingreso al usuario para que ingrese un número
tal que numero_mínimo <= ingreso <= numero_máximo. Ante un ingreso
inválido muestra un mensaje descriptivo de error y repregunta.... |
def ingresar_cadena_no_vacia():
''' Muestra un cursor de ingreso al usuario para que ingrese una cadena
no vacía. Ante un ingreso inválido muestra un mensaje descriptivo de
error y repregunta.
Devuelve la cadena ingresada, en mayúsculas.
'''
while True:
ingreso = input()
if len(... | random_line_split | |
interaccion_usuario.py | #!/usr/bin/env python
# coding: utf-8
#encoding: latin1
def ingresar_numero(numero_minimo, numero_maximo):
''' Muestra un cursor de ingreso al usuario para que ingrese un número
tal que numero_mínimo <= ingreso <= numero_máximo. Ante un ingreso
inválido muestra un mensaje descriptivo de error y repregunta.... | lse:
return ingreso.upper()
def mostrar_menu_generico(opciones, opcion_por_defecto):
''' Muestra una pantalla de selección dada una lista de opciones y una
opción por defecto. El usuario tendrá la opción de elegir una opción de
acuerdo a la numeración mostrada, generada por la función. Se vali... | ingreso no debe ser vacío.")
e | conditional_block |
interaccion_usuario.py | #!/usr/bin/env python
# coding: utf-8
#encoding: latin1
def ingresar_numero(numero_minimo, numero_maximo):
''' Muestra un cursor de ingreso al usuario para que ingrese un número
tal que numero_mínimo <= ingreso <= numero_máximo. Ante un ingreso
inválido muestra un mensaje descriptivo de error y repregunta.... | trar_menu_generico(opciones, opcion_por_defecto):
''' Muestra una pantalla de selección dada una lista de opciones y una
opción por defecto. El usuario tendrá la opción de elegir una opción de
acuerdo a la numeración mostrada, generada por la función. Se valida el
ingreso repreguntando tantas veces como... | estra un cursor de ingreso al usuario para que ingrese una cadena
no vacía. Ante un ingreso inválido muestra un mensaje descriptivo de
error y repregunta.
Devuelve la cadena ingresada, en mayúsculas.
'''
while True:
ingreso = input()
if len(ingreso) == 0:
print("El ingres... | identifier_body |
interaccion_usuario.py | #!/usr/bin/env python
# coding: utf-8
#encoding: latin1
def | (numero_minimo, numero_maximo):
''' Muestra un cursor de ingreso al usuario para que ingrese un número
tal que numero_mínimo <= ingreso <= numero_máximo. Ante un ingreso
inválido muestra un mensaje descriptivo de error y repregunta.
Devuelve el número ingresado en formato entero.
'''
while True:... | ingresar_numero | identifier_name |
en-KI.js | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js
(function(global) {
global... |
global.ng.common.locales['en-ki'] = [
'en-KI',
[['a', 'p'], ['am', 'pm'], u],
[['am', 'pm'], u, u],
[
['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
['Su', 'Mo', 'Tu', 'We', 'Th'... | {
let i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length;
if (i === 1 && v === 0) return 1;
return 5;
} | identifier_body |
en-KI.js | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js
(function(global) {
global... | (n) {
let i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length;
if (i === 1 && v === 0) return 1;
return 5;
}
global.ng.common.locales['en-ki'] = [
'en-KI',
[['a', 'p'], ['am', 'pm'], u],
[['am', 'pm'], u, u],
[
['S', 'M', 'T', 'W', 'T', 'F', 'S'], ['Sun', 'Mon', 'Tue', 'Wed',... | plural | identifier_name |
en-KI.js | /**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/gulp-tasks/cldr/extract.js | global.ng.common = global.ng.common || {};
global.ng.common.locales = global.ng.common.locales || {};
const u = undefined;
function plural(n) {
let i = Math.floor(Math.abs(n)), v = n.toString().replace(/^[^.]*\.?/, '').length;
if (i === 1 && v === 0) return 1;
return 5;
}
global.ng.common.locales['en-ki'] = [
'... |
(function(global) {
global.ng = global.ng || {}; | random_line_split |
abstractCodeEditorService.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... |
if (!this._transientWatchers.hasOwnProperty(uri)) {
return undefined;
}
return this._transientWatchers[uri].get(key);
}
public getTransientModelProperties(model: ITextModel): [string, any][] | undefined {
const uri = model.uri.toString();
if (!this._transientWatchers.hasOwnProperty(uri)) {
return ... | this._onDidChangeTransientModelProperty.fire(model);
}
public getTransientModelProperty(model: ITextModel, key: string): any {
const uri = model.uri.toString(); | random_line_split |
abstractCodeEditorService.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... |
public set(key: string, value: any): void {
this._values[key] = value;
}
public get(key: string): any {
return this._values[key];
}
public keys(): string[] {
return Object.keys(this._values);
}
}
| {
this.uri = uri;
this._values = {};
model.onWillDispose(() => owner._removeWatcher(this));
} | identifier_body |
abstractCodeEditorService.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... | {
public readonly uri: string;
private readonly _values: { [key: string]: any; };
constructor(uri: string, model: ITextModel, owner: AbstractCodeEditorService) {
this.uri = uri;
this._values = {};
model.onWillDispose(() => owner._removeWatcher(this));
}
public set(key: string, value: any): void {
this._... | ModelTransientSettingWatcher | identifier_name |
abstractCodeEditorService.ts | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... |
w.set(key, value);
this._onDidChangeTransientModelProperty.fire(model);
}
public getTransientModelProperty(model: ITextModel, key: string): any {
const uri = model.uri.toString();
if (!this._transientWatchers.hasOwnProperty(uri)) {
return undefined;
}
return this._transientWatchers[uri].get(key);
... | {
w = new ModelTransientSettingWatcher(uri, model, this);
this._transientWatchers[uri] = w;
} | conditional_block |
test.ts | /*
* @license Apache-2.0
*
* Copyright (c) 2021 The Stdlib Authors.
*
* 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 ap... | }
// The function does not compile if provided a value other than a number for the third parameter...
{
logspace( 3, 20, true ); // $ExpectError
logspace( 4, 20, false ); // $ExpectError
logspace( 2, 20, '5' ); // $ExpectError
logspace( 2, 20, [] ); // $ExpectError
logspace( 9, 20, ( x: number ): number => x ); /... | logspace( 5, '5' ); // $ExpectError
logspace( 8, [] ); // $ExpectError
logspace( 9, {} ); // $ExpectError
logspace( 8, ( x: number ): number => x ); // $ExpectError | random_line_split |
functions.js | /**
* Functionality specific to Twenty Thirteen.
*
* Provides helper functions to enhance the theme experience.
*/
( function( $ ) {
var body = $( 'body' ),
_window = $( window );
/**
* Adds a top margin to the footer if the sidebar widget area is higher
* than the rest of the page, to help the foot... |
} )( jQuery ); | {
var columnWidth = body.is( '.sidebar' ) ? 228 : 245;
$( '#secondary .widget-area' ).masonry( {
itemSelector: '.widget',
columnWidth: columnWidth,
gutterWidth: 20,
isRTL: body.is( '.rtl' )
} );
} | conditional_block |
functions.js | /**
* Functionality specific to Twenty Thirteen.
*
* Provides helper functions to enhance the theme experience.
*/
( function( $ ) {
var body = $( 'body' ),
_window = $( window );
/**
* Adds a top margin to the footer if the sidebar widget area is higher
* than the rest of the page, to help the foot... | } );
/**
* Enables menu toggle for small screens.
*/
( function() {
var nav = $( '#site-navigation' ), button, menu;
if ( ! nav )
return;
button = nav.find( '.menu-toggle' );
if ( ! button )
return;
// Hide button if menu is missing or empty.
menu = nav.find( '.nav-menu' );
if ( ! menu || ... |
if ( margin > 0 && _window.innerWidth() > 999 )
$( '#colophon' ).css( 'margin-top', margin + 'px' );
} | random_line_split |
SLA KPI Instance Form - SLA KPI Instance.ts | var EntityLogicalName = "slakpiinstance";
var Form_71c88095_c4f8_461a_9d50_65d0f31b758b_Properties = {
failuretime: "failuretime"
,name: "name"
,ownerid: "ownerid"
,regarding: "regarding"
,status: "status" | };
var Form_71c88095_c4f8_461a_9d50_65d0f31b758b_Controls = {
failuretime: "failuretime"
,header_ownerid: "header_ownerid"
,header_status: "header_status"
,name: "name"
,regarding: "regarding"
,succeededon: "succeededon"
,warningtime: "warningtime"
}; | ,succeededon: "succeededon"
,warningtime: "warningtime" | random_line_split |
conf.py | # -*- coding: utf-8 -*-
#
# ChatterBot documentation build configuration file, created by
# sphinx-quickstart on Mon May 9 14:38:54 2016.
import sys
import os
import sphinx_rtd_theme
from datetime import datetime | # Insert the project root dir as the first element in the PYTHONPATH.
# This lets us ensure that the source package is imported, and that its version is used.
current_directory = os.path.dirname(os.path.abspath(__file__))
parent_directory = os.path.abspath(os.path.join(current_directory, os.pardir))
sys.path.insert(0, ... | random_line_split | |
renderer.rs | use std::fmt;
use std::error::Error;
use super::format::{Format, DefaultFormat};
use super::builders::Builder;
use super::output::Output;
use super::super::error::ParseError;
use super::super::ast::Block;
#[derive(Debug)]
pub enum RenderError {
ParseError(ParseError),
}
///
/// # Example
///
/// ```
/// use squid... | I: Iterator<Item = Result<Block, ParseError>>,
{
///
/// Creates a new renderer with the default implementation of `Format`.
///
pub fn new(input: I) -> Self {
Renderer {
input,
format: DefaultFormat,
}
}
}
impl fmt::Display for RenderError {
fn fmt(&... | input: I,
}
impl<I> Renderer<DefaultFormat, I>
where | random_line_split |
renderer.rs | use std::fmt;
use std::error::Error;
use super::format::{Format, DefaultFormat};
use super::builders::Builder;
use super::output::Output;
use super::super::error::ParseError;
use super::super::ast::Block;
#[derive(Debug)]
pub enum RenderError {
ParseError(ParseError),
}
///
/// # Example
///
/// ```
/// use squid... | (&self) -> &str {
match *self {
RenderError::ParseError(ref err) => err.description(),
}
}
fn cause(&self) -> Option<&Error> {
match *self {
RenderError::ParseError(ref err) => Some(err),
}
}
}
impl From<ParseError> for RenderError {
fn from(err:... | description | identifier_name |
renderer.rs | use std::fmt;
use std::error::Error;
use super::format::{Format, DefaultFormat};
use super::builders::Builder;
use super::output::Output;
use super::super::error::ParseError;
use super::super::ast::Block;
#[derive(Debug)]
pub enum RenderError {
ParseError(ParseError),
}
///
/// # Example
///
/// ```
/// use squid... |
}
| {
let node = self.input.next()?.and_then(|block| {
let mut builder = Builder::new();
match block {
Block::Heading(level, content) => self.format.heading(&mut builder, level, content),
Block::Paragraph(text) => self.format.paragraph(&mut builder, text),
... | identifier_body |
issue-11085.rs | // Copyright 2012-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
// <LICEN... |
}
let _f = Bar3::Bar3_1 { bar: 3 };
}
| {} | conditional_block |
issue-11085.rs | // Copyright 2012-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
// <LICEN... | #[cfg(foo)]
foo: isize,
}
enum Bar1 {
Bar1_1,
#[cfg(fail)]
Bar1_2(NotAType),
}
enum Bar2 {
#[cfg(fail)]
Bar2_1(NotAType),
}
enum Bar3 {
Bar3_1 {
#[cfg(fail)]
foo: isize,
bar: isize,
}
}
pub fn main() {
let _f = Foo { foo: 3 };
let _f = Foo2 { foo: ... | }
struct Foo2 { | random_line_split |
issue-11085.rs | // Copyright 2012-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
// <LICEN... | {
Bar1_1,
#[cfg(fail)]
Bar1_2(NotAType),
}
enum Bar2 {
#[cfg(fail)]
Bar2_1(NotAType),
}
enum Bar3 {
Bar3_1 {
#[cfg(fail)]
foo: isize,
bar: isize,
}
}
pub fn main() {
let _f = Foo { foo: 3 };
let _f = Foo2 { foo: 3 };
match Bar1::Bar1_1 {
Bar1:... | Bar1 | identifier_name |
gateway.constants.js | * @type {Object}
*/
export const gatewayConstants = {
CLEAR: 'GATEWAYS_CLEAR',
GETALL_REQUEST: 'GATEWAYS_GETALL_REQUEST',
GETALL_SUCCESS: 'GATEWAYS_GETALL_SUCCESS',
GETALL_FAILURE: 'GATEWAYS_GETALL_FAILURE',
CREATE_REQUEST: 'GATEWAYS_CREATE_REQUEST',
CREATE_SUCCESS: 'GATEWAYS_CREATE_SUCCESS'... | /**
* Gateway-related constants | random_line_split | |
509.py | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 26 19:32:49 2018
@author: JinJheng
"""
x,y=map(int,input().split(','))
m,n=map(int,input().split(','))
if n > y:
greater = n
else:
greater = y
while(True):
if((greater % n == 0) and (greater % y == 0)):
q = greater
break
... |
compute() | if p>q:
small=q
else:
small=p
for i in range(1,small+1):
if (p%i==0)and(q%i==0):
ans=i
print(x,end='')
print('/',end='')
print(y,'+',m,end='')
print('/',end='')
print(n,'=',int(p/ans),end='')
print('/',end='')
print(int(q/ans)) | identifier_body |
509.py | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 26 19:32:49 2018
@author: JinJheng
"""
x,y=map(int,input().split(','))
m,n=map(int,input().split(','))
if n > y:
greater = n
else:
greater = y
while(True):
if((greater % n == 0) and (greater % y == 0)):
q = greater
break
... | small=q
else:
small=p
for i in range(1,small+1):
if (p%i==0)and(q%i==0):
ans=i
print(x,end='')
print('/',end='')
print(y,'+',m,end='')
print('/',end='')
print(n,'=',int(p/ans),end='')
print('/',end='')
print(int(q/ans))
compute() | if p>q:
| random_line_split |
509.py | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 26 19:32:49 2018
@author: JinJheng
"""
x,y=map(int,input().split(','))
m,n=map(int,input().split(','))
if n > y:
greater = n
else:
greater = y
while(True):
if((greater % n == 0) and (greater % y == 0)):
q = greater
break
... |
else:
small=p
for i in range(1,small+1):
if (p%i==0)and(q%i==0):
ans=i
print(x,end='')
print('/',end='')
print(y,'+',m,end='')
print('/',end='')
print(n,'=',int(p/ans),end='')
print('/',end='')
print(int(q/ans))
compute() | small=q | conditional_block |
509.py | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 26 19:32:49 2018
@author: JinJheng
"""
x,y=map(int,input().split(','))
m,n=map(int,input().split(','))
if n > y:
greater = n
else:
greater = y
while(True):
if((greater % n == 0) and (greater % y == 0)):
q = greater
break
... | ():
if p>q:
small=q
else:
small=p
for i in range(1,small+1):
if (p%i==0)and(q%i==0):
ans=i
print(x,end='')
print('/',end='')
print(y,'+',m,end='')
print('/',end='')
print(n,'=',int(p/ans),end='')
print('/',end='')
print(int(q/ans)... | compute | identifier_name |
app.js | (function() {
function config($stateProvider, $locationProvider) {
$locationProvider
.html5Mode({
enabled: true,
requireBase: false
});
$stateProvider
.state('landing', {
url: '/',
controller: 'L... |
}
angular
.module('blocChat',['ui.router','ui.bootstrap','firebase','ngCookies'])
.config(config)
.run(['$cookies','$uibModal', BlocChatCookies]);
})();
| {
this.animationsEnabled = true;
$uibModal.open({
animation: this.animationsEnabled,
backdrop: 'static',
templateUrl: '/templates/login.html',
size: "sm",
controller: "LoginCtrl",
controllerAs: "login",
... | conditional_block |
app.js | (function() {
function | ($stateProvider, $locationProvider) {
$locationProvider
.html5Mode({
enabled: true,
requireBase: false
});
$stateProvider
.state('landing', {
url: '/',
controller: 'LandingCtrl as landing',
... | config | identifier_name |
app.js | (function() { | function config($stateProvider, $locationProvider) {
$locationProvider
.html5Mode({
enabled: true,
requireBase: false
});
$stateProvider
.state('landing', {
url: '/',
controller: 'LandingCtrl as ... | random_line_split | |
app.js | (function() {
function config($stateProvider, $locationProvider) |
function BlocChatCookies($cookies,$uibModal) {
if (!$cookies.blocChatCurrentUser || $cookies.blocChatCurrentUser === '') {
this.animationsEnabled = true;
$uibModal.open({
animation: this.animationsEnabled,
backdrop: 'static',
templateUrl: '/tem... | {
$locationProvider
.html5Mode({
enabled: true,
requireBase: false
});
$stateProvider
.state('landing', {
url: '/',
controller: 'LandingCtrl as landing',
templateUrl: '/templates/la... | identifier_body |
lambda-infer-unresolved.rs | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | {
let mut e = Refs{refs: vec!(), n: 0};
let _f = || println!("{}", e.n);
let x: &[isize] = &e.refs;
assert_eq!(x.len(), 0);
} | identifier_body | |
lambda-infer-unresolved.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 ... | { refs: Vec<isize> , n: isize }
pub fn main() {
let mut e = Refs{refs: vec!(), n: 0};
let _f = || println!("{}", e.n);
let x: &[isize] = &e.refs;
assert_eq!(x.len(), 0);
}
| Refs | identifier_name |
lambda-infer-unresolved.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 ... | // This should typecheck even though the type of e is not fully
// resolved when we finish typechecking the ||.
struct Refs { refs: Vec<isize> , n: isize }
pub fn main() {
let mut e = Refs{refs: vec!(), n: 0};
let _f = || println!("{}", e.n);
let x: &[isize] = &e.refs;
assert_eq!(x.len(), 0);
} | random_line_split | |
calendar.demo.min.js | ///*
//Project Name: Spine Admin
//Version: 1.6.0
//Author: BharaniGuru R
//
//*/var handleCalendarDemo=function(){"use strict";var e={left:"prev today",center:"title",right:"agendaWeek next"};var t=new Date;var n=t.getMonth();var r=t.getFullYear();var i=$("#calendar").fullCalendar({header:e,selectable:true,selectHe... | (){
//alert('event in');
$("#open").trigger("click");
$("#dialog").removeClass('hidden');
$("#dialog").dialog({
autoOpen: false,
buttons: {
Ok: function() {
data=$('#name').val();
data1=$('#valuesofanem').val();
$("#nameentered").text($("#nam... | modalwindowevent | identifier_name |
calendar.demo.min.js | ///*
//Project Name: Spine Admin
//Version: 1.6.0
//Author: BharaniGuru R
//
//*/var handleCalendarDemo=function(){"use strict";var e={left:"prev today",center:"title",right:"agendaWeek next"};var t=new Date;var n=t.getMonth();var r=t.getFullYear();var i=$("#calendar").fullCalendar({header:e,selectable:true,selectHe... | r.allDay = t;
$("#calendar").fullCalendar("renderEvent", r, true);
if ($("#drop-remove").is(":checked")) {
$(this).remove()
}
},
select: function(e, t, n) {
//var r = prompt("LEAVE TYPE:");
modalwindowevent();
... | r.start = e; | random_line_split |
calendar.demo.min.js | ///*
//Project Name: Spine Admin
//Version: 1.6.0
//Author: BharaniGuru R
//
//*/var handleCalendarDemo=function(){"use strict";var e={left:"prev today",center:"title",right:"agendaWeek next"};var t=new Date;var n=t.getMonth();var r=t.getFullYear();var i=$("#calendar").fullCalendar({header:e,selectable:true,selectHe... |
i.fullCalendar("unselect")
},
eventRender: function(e, t, n) {
var r = e.media ? e.media : "";
var i = e.description ? e.description : "";
t.find(".fc-event-title").after($('<span class="fc-event-icons"></span>').html(r));
console.log(t.find("... | {
//alert('in rr');
i.fullCalendar("renderEvent", {
title: r,
start: e,
end: t,
allDay: n
}, true)
} | conditional_block |
calendar.demo.min.js | ///*
//Project Name: Spine Admin
//Version: 1.6.0
//Author: BharaniGuru R
//
//*/var handleCalendarDemo=function(){"use strict";var e={left:"prev today",center:"title",right:"agendaWeek next"};var t=new Date;var n=t.getMonth();var r=t.getFullYear();var i=$("#calendar").fullCalendar({header:e,selectable:true,selectHe... | {
//alert('event in');
$("#open").trigger("click");
$("#dialog").removeClass('hidden');
$("#dialog").dialog({
autoOpen: false,
buttons: {
Ok: function() {
data=$('#name').val();
data1=$('#valuesofanem').val();
$("#nameentered").text($("#name"... | identifier_body | |
publishservice.py | self.experiment = experiment
self.provider = self._get_provider()
def _get_provider(self):
from tardis.tardis_portal.publish.provider.rifcsprovider import RifCsProvider
if self.rc_providers:
from django.utils.importlib import import_module
... | class PublishService():
def __init__(self, providers, experiment):
self.rc_providers = providers | random_line_split | |
publishservice.py |
class | ():
def __init__(self, providers, experiment):
self.rc_providers = providers
self.experiment = experiment
self.provider = self._get_provider()
def _get_provider(self):
from tardis.tardis_portal.publish.provider.rifcsprovider import RifCsProvider
if self.rc_p... | PublishService | identifier_name |
publishservice.py |
class PublishService():
def __init__(self, providers, experiment):
self.rc_providers = providers
self.experiment = experiment
self.provider = self._get_provider()
def _get_provider(self):
from tardis.tardis_portal.publish.provider.rifcsprovider import RifCsProvider... |
def get_template(self):
return self.provider.get_template(self.experiment)
| from tardis.tardis_portal.xmlwriter import XMLWriter
xmlwriter = XMLWriter()
xmlwriter.write_template_to_dir(oaipath, "MyTARDIS-%s.xml" % self.experiment.id,
self.get_template(), self.get_context()) | identifier_body |
publishservice.py |
class PublishService():
def __init__(self, providers, experiment):
self.rc_providers = providers
self.experiment = experiment
self.provider = self._get_provider()
def _get_provider(self):
from tardis.tardis_portal.publish.provider.rifcsprovider import RifCsProvider... |
else:
self._remove_rifcs_from_oai_dir(oaipath)
def _remove_rifcs_from_oai_dir(self, oaipath):
import os
filename = os.path.join(oaipath, "MyTARDIS-%s.xml" % self.experiment.id)
if os.path.exists(filename):
os.remove(filename)
def _wr... | self._write_rifcs_to_oai_dir(oaipath) | conditional_block |
balance.component.ts | import { Component, OnInit, Input, Inject, Output, EventEmitter } from '@angular/core';
import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms';
import { MatSnackBar, MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { GlobalSettingsService } from '../../shared/service... |
ngOnInit() {
this.currency = this.globalSettingsService.getCurrency();
// Create formGroup for adding amount to balance
this.balanceGroup = this.fb.group({
amount: ['', [Validators.required, Validators.pattern('^([-]?[1-9]*[1-9][0-9]*(\.[0-9]+)?|[-]?[0]+\.[0-9]*[1-9][0-9]*)$'), Validators.pattern(... | { } | identifier_body |
balance.component.ts | import { Component, OnInit, Input, Inject, Output, EventEmitter } from '@angular/core';
import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms';
import { MatSnackBar, MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { GlobalSettingsService } from '../../shared/service... | (message: string, action: string, status: number) {
switch (status) {
case 1:
this.snackBar.open(message, action, {
duration: 5000,
extraClasses: ['success-snack-bar']
});
break;
case 2:
this.snackBar.open(message, action, {
extraClasses: ['w... | openSnackBar | identifier_name |
balance.component.ts | import { Component, OnInit, Input, Inject, Output, EventEmitter } from '@angular/core';
import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms';
import { MatSnackBar, MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { GlobalSettingsService } from '../../shared/service... | case 2:
this.snackBar.open(message, action, {
extraClasses: ['warning-snack-bar']
});
break;
case 3:
this.snackBar.open(message, action, {
extraClasses: ['error-snack-bar']
});
break;
}
}
updateBalance() {
const amount = Numbe... | extraClasses: ['success-snack-bar']
});
break; | random_line_split |
ExtractTextPluginFactory.js | let WebpackExtractPlugin = require('extract-text-webpack-plugin')
class ExtractTextPluginFactory {
/**
* Create a new class instance.
*
* @param {string|boolean} cssPath
*/
constructor(mix, cssPath) {
if (typeof cssPath === 'boolean') {
cssPath = path.join(global.entry.b... | }
/**
* Check if the the provided path is already registered as an extract instance.
*/
pluginIsAlreadyBuilt() {
return this.mix.preprocessors.find(
preprocessor => preprocessor.output.path === this.path
);
}
/**
* Fetch the Extract plugin instance that... | random_line_split | |
ExtractTextPluginFactory.js | let WebpackExtractPlugin = require('extract-text-webpack-plugin')
class ExtractTextPluginFactory {
/**
* Create a new class instance.
*
* @param {string|boolean} cssPath
*/
constructor(mix, cssPath) {
if (typeof cssPath === 'boolean') {
cssPath = path.join(global.entry.b... | () {
if (this.mix.preprocessors) {
// If no output path is provided, we can use the default plugin.
if (this.useDefault) return this.mix.preprocessors[0].getExtractPlugin();
// If what the user passed matches the output to mix.preprocessor(),
// then we can use t... | build | identifier_name |
Query.js | 'use strict';
var pkg = require('../package');
var log = require('debug')(pkg.name + ':Query');
console.log.bind(log);
var error = require('debug')(pkg.name + ':Query');
console.error.bind(error);
var async = require('async');
var spawn = require('child_process').spawn;
var moment = require('moment');
var xml2js = r... | else if (type === 'datetime') {
value = moment(value).toDate();
}
}
return value;
};
var extractProperty = function(prop) {
var name;
var type;
var value;
if ('$' in prop) {
name = prop.$.NAME;
type = prop.$.TYPE;
} else {
name = prop.NAME;
type = prop.TYPE;
}
if ('VALUE'... | {
if (value === 'TRUE') {
value = true;
} else {
value = false;
}
} | conditional_block |
Query.js | 'use strict';
var pkg = require('../package');
var log = require('debug')(pkg.name + ':Query');
console.log.bind(log);
var error = require('debug')(pkg.name + ':Query');
console.error.bind(error);
var async = require('async');
var spawn = require('child_process').spawn;
var moment = require('moment');
var xml2js = r... | log('setWhere called with callback function. Execute query.');
this.exec(cb);
}
return this;
};
var getArgsArray = function(params) {
log('Create array of arguments.');
var args = [
'/NAMESPACE:\\\\' + params.namespace,
'/NODE:\'' + params.host + '\'',
];
if (params.username) {
args.pu... | random_line_split | |
backbone_nested.js | /**
* Backbone Nested - Functions to add nested model and collection support
*
* Forked from backbone-nested-models@0.5.1 by Bret Little
*
* @license MIT
* @source https://github.com/blittle/backbone-nested-models
* (MIT LICENSE)
* Permission is hereby granted, free of charge, to any person obtaining a copy
* ... |
// For each `set` attribute, update or delete the current value.
for (attr in attrs) {
if (attrs.hasOwnProperty(attr)) {
val = attrs[attr];
// Inject in the relational lookup
var opts = options;
/* develblock:start */
opts = _.extend({
initialData: val
... | {
this.id = attrs[this.idAttribute];
} | conditional_block |
backbone_nested.js | /**
* Backbone Nested - Functions to add nested model and collection support
*
* Forked from backbone-nested-models@0.5.1 by Bret Little
*
* @license MIT
* @source https://github.com/blittle/backbone-nested-models
* (MIT LICENSE)
* Permission is hereby granted, free of charge, to any person obtaining a copy
* ... | Collection.prototype.resetRelations = function(options) {
_.each(this.models, function(model) {
_.each(model.relations, function(rel, key) {
if (model.get(key) instanceof Backbone.Collection) {
model.get(key).trigger('reset', model, options);
}
});
});
};
Collection.... | };
exports.setNestedCollection = function(Collection) {
BackboneCollection = Collection;
BackboneCollection.prototype.model = BackboneModel; | random_line_split |
result.rs | use std::io::Error as IoError;
use std::sync::mpsc::{SendError, RecvError};
use std::result;
use mio::NotifyError;
use queue::Message;
use {Handler};
#[derive(Debug)]
pub enum Error<H: Handler> {
QueueOutOfService,
Io(IoError),
NotifyError(NotifyError<Message<H::Processor, H::Message, H::Response>>),
S... |
}
impl<H: Handler> From<NotifyError<Message<H::Processor, H::Message, H::Response>>> for Error<H> {
fn from(err: NotifyError<Message<H::Processor, H::Message, H::Response>>) -> Error<H> {
Error::NotifyError(err)
}
}
impl<H: Handler> From<SendError<H::Response>> for Error<H> {
fn from(err: SendErr... | {
Error::Io(err)
} | identifier_body |
result.rs | use std::io::Error as IoError;
use std::sync::mpsc::{SendError, RecvError};
use std::result;
use mio::NotifyError;
use queue::Message;
use {Handler};
#[derive(Debug)]
pub enum Error<H: Handler> {
QueueOutOfService,
Io(IoError),
NotifyError(NotifyError<Message<H::Processor, H::Message, H::Response>>),
S... | (err: RecvError) -> Error<H> {
Error::RecvError(err)
}
}
#[derive(Debug)]
pub struct ResponseError(pub &'static str);
pub type ResponseResult<T> = result::Result<T, ResponseError>;
| from | identifier_name |
result.rs | use std::io::Error as IoError;
use std::sync::mpsc::{SendError, RecvError};
use std::result;
use mio::NotifyError;
use queue::Message;
use {Handler};
#[derive(Debug)]
pub enum Error<H: Handler> {
QueueOutOfService,
Io(IoError),
NotifyError(NotifyError<Message<H::Processor, H::Message, H::Response>>),
S... | impl<H: Handler> From<SendError<H::Response>> for Error<H> {
fn from(err: SendError<H::Response>) -> Error<H> {
Error::SendError(err)
}
}
impl<H: Handler> From<RecvError> for Error<H> {
fn from(err: RecvError) -> Error<H> {
Error::RecvError(err)
}
}
#[derive(Debug)]
pub struct Response... | random_line_split | |
util.py | from collections import defaultdict
from django.conf import settings
from mongodbforms.documentoptions import DocumentMetaWrapper, LazyDocumentMetaWrapper
from mongodbforms.fieldgenerator import MongoDefaultFormFieldGenerator
try:
from django.utils.module_loading import import_by_path
except ImportError:
# t... | (value, prefix=''):
if isinstance(value, list):
value = ' '.join([generate_key(k) for k in value])
if isinstance(value, dict):
value = ' '.join([
generate_key(v, k) for k, v in value.iteritems()
])
results = "%s.%s" % (prefix, value) if prefix... | generate_key | identifier_name |
util.py | from collections import defaultdict
from django.conf import settings
from mongodbforms.documentoptions import DocumentMetaWrapper, LazyDocumentMetaWrapper
from mongodbforms.fieldgenerator import MongoDefaultFormFieldGenerator
try:
from django.utils.module_loading import import_by_path
except ImportError:
# t... |
def init_document_options(document):
if not isinstance(document._meta, (DocumentMetaWrapper, LazyDocumentMetaWrapper)):
document._meta = DocumentMetaWrapper(document)
return document
def get_document_options(document):
return DocumentMetaWrapper(document)
def format_mongo_validation_errors(va... | if hasattr(settings, 'MONGODBFORMS_FIELDGENERATOR'):
return import_by_path(settings.MONGODBFORMS_FIELDGENERATOR)
return MongoDefaultFormFieldGenerator | identifier_body |
util.py | from collections import defaultdict
from django.conf import settings
from mongodbforms.documentoptions import DocumentMetaWrapper, LazyDocumentMetaWrapper
from mongodbforms.fieldgenerator import MongoDefaultFormFieldGenerator
try:
from django.utils.module_loading import import_by_path
except ImportError:
# t... | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWAR... | #
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | random_line_split |
util.py | from collections import defaultdict
from django.conf import settings
from mongodbforms.documentoptions import DocumentMetaWrapper, LazyDocumentMetaWrapper
from mongodbforms.fieldgenerator import MongoDefaultFormFieldGenerator
try:
from django.utils.module_loading import import_by_path
except ImportError:
# t... |
if isinstance(value, dict):
value = ' '.join([
generate_key(v, k) for k, v in value.iteritems()
])
results = "%s.%s" % (prefix, value) if prefix else value
return results
error_dict = defaultdict(list)
for k, v in validation_exception.to_dict().... | value = ' '.join([generate_key(k) for k in value]) | conditional_block |
project-card-simple.tsx | import m from 'mithril'
import { Observable } from 'rxjs'
import { ProjectDetails } from '../../../entities/project-details'
export type ProjectCardSimpleAttrs = {
name: string
headline: string
image: string
}
export class ProjectCardSimple implements m.Component<ProjectCardSimpleAttrs> {
view({ attr... | {name}
</div>
<div class="fontcolor-secondary fontsize-smaller w-hidden-small w-hidden-tiny">
{headline}
</div>
</div>
</div>
)
}
} | <div class="card-project card u-radius">
<div style={cardThumbStyle} class="card-project-thumb"></div>
<div class="card-project-description">
<div class="fontweight-semibold fontsize-base u-marginbottom-10 u-text-center-small-only lineheight-tight"> | random_line_split |
project-card-simple.tsx | import m from 'mithril'
import { Observable } from 'rxjs'
import { ProjectDetails } from '../../../entities/project-details'
export type ProjectCardSimpleAttrs = {
name: string
headline: string
image: string
}
export class | implements m.Component<ProjectCardSimpleAttrs> {
view({ attrs } : m.Vnode<ProjectCardSimpleAttrs>) {
const name = attrs.name
const headline = attrs.headline
const image = attrs.image
const cardThumbStyle = {
'background-image' : image ? `url(${image})` : 'url(h... | ProjectCardSimple | identifier_name |
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... | {()} | 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... | // lldb-check:[...]$5 = 7
// lldb-command:print closure_local
// lldb-check:[...]$6 = 8
// lldb-command:continue
// lldb-command:print variable
// lldb-check:[...]$7 = 1
// lldb-command:print constant
// lldb-check:[...]$8 = 2
// lldb-command:print a_struct
// lldb-check:[...]$9 = Struct { a: -3, b: 4.5, c: 5 }
// lld... | // lldb-command:print *struct_ref
// lldb-check:[...]$3 = Struct { a: -3, b: 4.5, c: 5 }
// lldb-command:print *owned
// lldb-check:[...]$4 = 6
// lldb-command:print managed->val | 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... | {
a: int,
b: f64,
c: uint
}
fn main() {
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 managed = box(GC) 7;
let closure = || {
let closure_local = 8... | Struct | identifier_name |
util.py | import re
import hashlib
FNAME_MATCH = re.compile(r'/([^/]+)$') # From the last slash to the end of the string
PREFIX = re.compile(r'([^:]+://)(/)?(.+)') # Check for a prefix like data://
def getParentAndBase(path):
|
def pathJoin(parent, base):
if parent.endswith('/'):
return parent + base
return parent + '/' + base
def md5_for_file(fname):
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return str(hash_md... | match = PREFIX.match(path)
if match is None:
if path.endswith('/'):
stripped_path = path[:-1]
else:
stripped_path = path
base = FNAME_MATCH.search(stripped_path)
if base is None:
raise ValueError('Invalid path')
parent = FNAME_MATCH.sub('',... | identifier_body |
util.py | import re
import hashlib
FNAME_MATCH = re.compile(r'/([^/]+)$') # From the last slash to the end of the string
PREFIX = re.compile(r'([^:]+://)(/)?(.+)') # Check for a prefix like data://
def getParentAndBase(path):
match = PREFIX.match(path)
if match is None:
if path.endswith('/'):
st... | parent_path = '/'.join(parts[:-1])
if leading_slash is not None:
parent_path = '{prefix}/{uri}'.format(prefix=prefix, uri='/'.join(parts[:-1]))
else:
parent_path = '{prefix}{uri}'.format(prefix=prefix, uri='/'.join(parts[:-1]))
return parent_path, parts[-1]
def... | return parent, base.group(1)
else:
prefix, leading_slash, uri = match.groups()
parts = uri.split('/') | random_line_split |
util.py | import re
import hashlib
FNAME_MATCH = re.compile(r'/([^/]+)$') # From the last slash to the end of the string
PREFIX = re.compile(r'([^:]+://)(/)?(.+)') # Check for a prefix like data://
def | (path):
match = PREFIX.match(path)
if match is None:
if path.endswith('/'):
stripped_path = path[:-1]
else:
stripped_path = path
base = FNAME_MATCH.search(stripped_path)
if base is None:
raise ValueError('Invalid path')
parent = FNAME_M... | getParentAndBase | identifier_name |
util.py | import re
import hashlib
FNAME_MATCH = re.compile(r'/([^/]+)$') # From the last slash to the end of the string
PREFIX = re.compile(r'([^:]+://)(/)?(.+)') # Check for a prefix like data://
def getParentAndBase(path):
match = PREFIX.match(path)
if match is None:
|
else:
prefix, leading_slash, uri = match.groups()
parts = uri.split('/')
parent_path = '/'.join(parts[:-1])
if leading_slash is not None:
parent_path = '{prefix}/{uri}'.format(prefix=prefix, uri='/'.join(parts[:-1]))
else:
parent_path = '{prefix}{uri... | if path.endswith('/'):
stripped_path = path[:-1]
else:
stripped_path = path
base = FNAME_MATCH.search(stripped_path)
if base is None:
raise ValueError('Invalid path')
parent = FNAME_MATCH.sub('', stripped_path)
return parent, base.group(1) | conditional_block |
onboarding.test.ts | import wireMockClient from '../../wireMockClient';
import { Onboarding } from '../../..';
async function getOnboarding(status) {
const { adapter, client } = wireMockClient();
adapter.onGet('/onboarding/me').reply(200, {
resource: 'onboarding',
name: 'Mollie B.V.',
signedUpAt: '2018-12-20T10:49:08+00:0... | ['in-review', 'isInReview', true],
['in-review', 'isCompleted', false],
['completed', 'needsData', false],
['completed', 'isInReview', false],
['completed', 'isCompleted', true],
].map(async ([status, method, expectedResult]) => {
const onboarding = await getOnboarding(status);
... | ['needs-data', 'needsData', true],
['needs-data', 'isInReview', false],
['needs-data', 'isCompleted', false],
['in-review', 'needsData', false], | random_line_split |
onboarding.test.ts | import wireMockClient from '../../wireMockClient';
import { Onboarding } from '../../..';
async function getOnboarding(status) |
test('onboardingStatuses', () => {
return Promise.all(
[
['needs-data', 'needsData', true],
['needs-data', 'isInReview', false],
['needs-data', 'isCompleted', false],
['in-review', 'needsData', false],
['in-review', 'isInReview', true],
['in-review', 'isCompleted', false],
... | {
const { adapter, client } = wireMockClient();
adapter.onGet('/onboarding/me').reply(200, {
resource: 'onboarding',
name: 'Mollie B.V.',
signedUpAt: '2018-12-20T10:49:08+00:00',
status,
canReceivePayments: true,
canReceiveSettlements: true,
_links: {
self: {
href: 'https:... | identifier_body |
onboarding.test.ts | import wireMockClient from '../../wireMockClient';
import { Onboarding } from '../../..';
async function | (status) {
const { adapter, client } = wireMockClient();
adapter.onGet('/onboarding/me').reply(200, {
resource: 'onboarding',
name: 'Mollie B.V.',
signedUpAt: '2018-12-20T10:49:08+00:00',
status,
canReceivePayments: true,
canReceiveSettlements: true,
_links: {
self: {
href... | getOnboarding | identifier_name |
animationMock.ts | /*
* Wire
* Copyright (C) 2020 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This progr... | }); | random_line_split | |
skin.js | /*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.skins.add( 'office2003', (function()
{
return {
editor : { css : [ 'editor.css' ] },
dialog : { css : [ 'dialog.css' ] },
templates : { css : [ 'templates.... |
{
CKEDITOR.dialog.on( 'resize', function( evt )
{
var data = evt.data,
width = data.width,
height = data.height,
dialog = data.dialog,
contents = dialog.parts.contents;
if ( data.skin != 'office2003' )
return;
contents.setStyles(
{
width : width + 'px',
hei... | alogSetup() | identifier_name |
skin.js | /*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.skins.add( 'office2003', (function()
{
return {
editor : { css : [ 'editor.css' ] },
dialog : { css : [ 'dialog.css' ] },
templates : { css : [ 'templates.... | el.setSize( 'width', bodyWidth - 28 );
// ml
el = innerDialog.getChild( 4 );
el.setSize( 'height', height );
// mr
el = innerDialog.getChild( 5 );
el.setSize( 'height', height );
};
setTimeout( fixSize, 100 );
// Ensure size is correct for RTL mode. (#4003)
... | el.setSize( 'width', bodyWidth );
// bc
el = innerDialog.getChild( 7 ); | random_line_split |
skin.js | /*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.skins.add( 'office2003', (function()
{
return {
editor : { css : [ 'editor.css' ] },
dialog : { css : [ 'dialog.css' ] },
templates : { css : [ 'templates.... | )();
| CKEDITOR.dialog.on( 'resize', function( evt )
{
var data = evt.data,
width = data.width,
height = data.height,
dialog = data.dialog,
contents = dialog.parts.contents;
if ( data.skin != 'office2003' )
return;
contents.setStyles(
{
width : width + 'px',
height ... | identifier_body |
live-manager.ts |
import { readFile } from 'fs-extra'
import { createServer, Server } from 'net'
import { createServer as createServerTLS, Server as ServerTLS } from 'tls'
import {
computeLowerResolutionsToTranscode,
ffprobePromise,
getLiveSegmentTime,
getVideoStreamBitrate,
getVideoStreamDimensionsInfo,
getVideoStreamFPS
}... |
stop () {
this.running = false
if (this.rtmpServer) {
logger.info('Stopping RTMP server.', lTags())
this.rtmpServer.close()
this.rtmpServer = undefined
}
if (this.rtmpsServer) {
logger.info('Stopping RTMPS server.', lTags())
this.rtmpsServer.close()
this.rtmps... | {
this.running = true
if (CONFIG.LIVE.RTMP.ENABLED) {
logger.info('Running RTMP server on port %d', CONFIG.LIVE.RTMP.PORT, lTags())
this.rtmpServer = createServer(socket => {
const session = new NodeRtmpSession(config, socket)
session.inputOriginUrl = 'rtmp://127.0.0.1:' + CONFIG.... | identifier_body |
live-manager.ts |
import { readFile } from 'fs-extra'
import { createServer, Server } from 'net'
import { createServer as createServerTLS, Server as ServerTLS } from 'tls'
import {
computeLowerResolutionsToTranscode,
ffprobePromise,
getLiveSegmentTime,
getVideoStreamBitrate,
getVideoStreamDimensionsInfo,
getVideoStreamFPS
}... |
if (this.running && CONFIG.LIVE.ENABLED === false) {
this.stop()
}
})
// Cleanup broken lives, that were terminated by a server restart for example
this.handleBrokenLives()
.catch(err => logger.error('Cannot handle broken lives.', { err, ...lTags() }))
}
async run () {
... | {
this.run().catch(err => logger.error('Cannot run live server.', { err }))
return
} | conditional_block |
live-manager.ts |
import { readFile } from 'fs-extra'
import { createServer, Server } from 'net'
import { createServer as createServerTLS, Server as ServerTLS } from 'tls'
import {
computeLowerResolutionsToTranscode,
ffprobePromise,
getLiveSegmentTime,
getVideoStreamBitrate,
getVideoStreamDimensionsInfo,
getVideoStreamFPS
}... | () {
this.running = true
if (CONFIG.LIVE.RTMP.ENABLED) {
logger.info('Running RTMP server on port %d', CONFIG.LIVE.RTMP.PORT, lTags())
this.rtmpServer = createServer(socket => {
const session = new NodeRtmpSession(config, socket)
session.inputOriginUrl = 'rtmp://127.0.0.1:' + CON... | run | identifier_name |
live-manager.ts | import { readFile } from 'fs-extra'
import { createServer, Server } from 'net'
import { createServer as createServerTLS, Server as ServerTLS } from 'tls'
import {
computeLowerResolutionsToTranscode,
ffprobePromise,
getLiveSegmentTime,
getVideoStreamBitrate,
getVideoStreamDimensionsInfo,
getVideoStreamFPS
} ... | }
if (this.rtmpsServer) {
logger.info('Stopping RTMPS server.', lTags())
this.rtmpsServer.close()
this.rtmpsServer = undefined
}
// Sessions is an object
this.getContext().sessions.forEach((session: any) => {
if (session instanceof NodeRtmpSession) {
session.stop()... | random_line_split | |
ResultListItem.tsx | import React, { useCallback, useEffect, useMemo, useRef } from "react";
import scrollIntoView from "scroll-into-view-if-needed";
import styled, { css } from "styled-components";
import { Item, ItemType } from "../../lib/types";
const ItemLeft = styled.div`
width: 30px;
min-width: 30px;
display: flex;
align-ite... |
return <ItemImage src={item.favIconUrl} />;
}, [item]);
return useMemo(
() => (
<ItemContainer
onClick={handleClick}
ref={itemContainerRef}
selected={selected}
>
<ItemLeft>{itemImage}</ItemLeft>
<ItemRight>
<ItemTitle>{item.title}</ItemTitle>
... | {
return null;
} | conditional_block |
ResultListItem.tsx | import React, { useCallback, useEffect, useMemo, useRef } from "react";
import scrollIntoView from "scroll-into-view-if-needed";
import styled, { css } from "styled-components";
import { Item, ItemType } from "../../lib/types";
const ItemLeft = styled.div`
width: 30px;
min-width: 30px;
display: flex;
align-ite... | margin-top: 2px;
font-size: 13px;
font-weight: lighter;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
`;
const ItemContainer = styled.li<{ selected: boolean }>`
width: 100%;
height: 46px;
padding: 3px;
margin-bottom: 2px;
overflow: hidden;
display: flex;
flex-dire... | flex: 1;
`;
const ItemUrl = styled.div`
color: #9999aa; | random_line_split |
config.rs | use toml;
pub struct Config {
value: Option<toml::Value>,
}
impl Config {
pub fn new(str: &str) -> Config {
Config {
value: str.parse::<toml::Value>().ok()
}
}
/// # Get the value of the preference
pub fn get(&self, str: &str) -> Option<&toml::Value> |
/// # Checks if the value of the preference is boolean true
pub fn is(&self, str: &str) -> Option<bool> {
let value: Option<&toml::Value> = self.get(str);
if value.is_some() {
return value.unwrap().as_bool()
} else {
return None
}
}
} | {
let strings: Vec<&str> = str.split(".").collect::<Vec<&str>>();
let mut config_value: Option<&toml::Value> = self.value.as_ref();
for item in &strings {
if config_value.is_some() {
match config_value.unwrap().get(item) {
Some(value) => {
... | identifier_body |
config.rs | use toml;
pub struct Config {
value: Option<toml::Value>,
}
impl Config {
pub fn new(str: &str) -> Config {
Config {
value: str.parse::<toml::Value>().ok()
}
}
/// # Get the value of the preference
pub fn get(&self, str: &str) -> Option<&toml::Value> {
let stri... | ,
None => {
config_value = None;
break;
},
}
}
}
config_value
}
/// # Checks if the value of the preference is boolean true
pub fn is(&self, str: &str) -> Option<bool> {
... | {
config_value = Some(value);
match *value {
toml::Value::Array(_) | toml::Value::Table(_) => {
config_value = Some(value);
},
_ => {
... | conditional_block |
config.rs | use toml;
pub struct Config {
value: Option<toml::Value>,
}
impl Config {
pub fn new(str: &str) -> Config {
Config {
value: str.parse::<toml::Value>().ok()
}
}
/// # Get the value of the preference
pub fn get(&self, str: &str) -> Option<&toml::Value> {
let stri... | (&self, str: &str) -> Option<bool> {
let value: Option<&toml::Value> = self.get(str);
if value.is_some() {
return value.unwrap().as_bool()
} else {
return None
}
}
} | is | identifier_name |
config.rs | use toml;
pub struct Config {
value: Option<toml::Value>,
}
impl Config {
pub fn new(str: &str) -> Config {
Config {
value: str.parse::<toml::Value>().ok()
}
}
/// # Get the value of the preference
pub fn get(&self, str: &str) -> Option<&toml::Value> {
let stri... | _ => {
break;
},
}
},
None => {
config_value = None;
break;
},
}
}
... | match *value {
toml::Value::Array(_) | toml::Value::Table(_) => {
config_value = Some(value);
}, | random_line_split |
grid-demo.component.ts | import { Component } from '@angular/core';
import { ListSortFieldSelectorModel } from '../../core';
@Component({
selector: 'sky-grid-demo',
templateUrl: './grid-demo.component.html'
})
export class SkyGridDemoComponent {
public items: any[] = [
{ id: '1', column1: 101, column2: 'Apple', column3: 'Anne eats a... | (activeSort: ListSortFieldSelectorModel) {
let sortField = activeSort.fieldSelector;
let descending = activeSort.descending;
this.items = this.items.sort((a: any, b: any) => {
let value1 = a[sortField];
let value2 = b[sortField];
if (value1 && typeof value1 === 'string') {
value1 ... | sortChanged | identifier_name |
grid-demo.component.ts | import { Component } from '@angular/core';
import { ListSortFieldSelectorModel } from '../../core';
@Component({
selector: 'sky-grid-demo',
templateUrl: './grid-demo.component.html'
})
export class SkyGridDemoComponent {
public items: any[] = [
{ id: '1', column1: 101, column2: 'Apple', column3: 'Anne eats a... |
}
| {
let sortField = activeSort.fieldSelector;
let descending = activeSort.descending;
this.items = this.items.sort((a: any, b: any) => {
let value1 = a[sortField];
let value2 = b[sortField];
if (value1 && typeof value1 === 'string') {
value1 = value1.toLowerCase();
}
if... | identifier_body |
grid-demo.component.ts | import { Component } from '@angular/core';
import { ListSortFieldSelectorModel } from '../../core';
@Component({
selector: 'sky-grid-demo',
templateUrl: './grid-demo.component.html'
})
export class SkyGridDemoComponent {
public items: any[] = [
{ id: '1', column1: 101, column2: 'Apple', column3: 'Anne eats a... | }
if (value1 === value2) {
return 0;
}
let result = value1 > value2 ? 1 : -1;
if (descending) {
result *= -1;
}
return result;
}).slice();
}
} | value2 = value2.toLowerCase(); | random_line_split |
grid-demo.component.ts | import { Component } from '@angular/core';
import { ListSortFieldSelectorModel } from '../../core';
@Component({
selector: 'sky-grid-demo',
templateUrl: './grid-demo.component.html'
})
export class SkyGridDemoComponent {
public items: any[] = [
{ id: '1', column1: 101, column2: 'Apple', column3: 'Anne eats a... |
let result = value1 > value2 ? 1 : -1;
if (descending) {
result *= -1;
}
return result;
}).slice();
}
}
| {
return 0;
} | conditional_block |
entries.actions.ts | /**
* Copyright 2017 The Mifos Initiative.
*
* 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 agr... |
export class SearchCompleteAction implements Action {
readonly type = SEARCH_COMPLETE;
constructor(public payload: AccountEntryPage) { }
}
export type Actions = SearchAction
| SearchCompleteAction; |
constructor(public payload: SearchActionPayload) { }
} | random_line_split |
entries.actions.ts | /**
* Copyright 2017 The Mifos Initiative.
*
* 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 agr... |
}
export type Actions = SearchAction
| SearchCompleteAction;
| { } | identifier_body |
entries.actions.ts | /**
* Copyright 2017 The Mifos Initiative.
*
* 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 agr... | implements Action {
readonly type = SEARCH_COMPLETE;
constructor(public payload: AccountEntryPage) { }
}
export type Actions = SearchAction
| SearchCompleteAction;
| SearchCompleteAction | identifier_name |
issue-62307-match-ref-ref-forbidden-without-eq.rs | // RFC 1445 introduced `#[structural_match]`; this attribute must
// appear on the `struct`/`enum` definition for any `const` used in a
// pattern.
//
// This is our (forever-unstable) way to mark a datatype as having a
// `PartialEq` implementation that is equivalent to recursion over its
// substructure. This avoids ... | (i32);
// Overriding `PartialEq` to use this strange notion of "equality" exposes
// whether `match` is using structural-equality or method-dispatch
// under the hood, which is the antithesis of rust-lang/rfcs#1445
impl PartialEq for B {
fn eq(&self, other: &B) -> bool { std::cmp::min(self.0, other.0) == 0 }
}
fn... | B | identifier_name |
issue-62307-match-ref-ref-forbidden-without-eq.rs | // RFC 1445 introduced `#[structural_match]`; this attribute must
// appear on the `struct`/`enum` definition for any `const` used in a
// pattern.
//
// This is our (forever-unstable) way to mark a datatype as having a
// `PartialEq` implementation that is equivalent to recursion over its
// substructure. This avoids ... | {
const RR_B0: & & B = & & B(0);
const RR_B1: & & B = & & B(1);
match RR_B0 {
RR_B1 => { println!("CLAIM RR0: {:?} matches {:?}", RR_B1, RR_B0); }
//~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
//~| WARN this was previously accepted
_ => { }
}
match RR_... | identifier_body |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.