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 |
|---|---|---|---|---|
Inspector.js | Ext.define('Omni.view.bin_skus.Inspector', {
extend:'Buildit.ux.inspector.Panel',
alias:'widget.omni-bin_skus-Inspector',
initComponent:function () {
var me = this;
// LABELS (Start) ======================================================================
// LABELS (End)
// INSPE... | // CARDS (Start) =======================================================================
Ext.apply(this, {
cards: [
{
title: 'Profile',
xtype: 'omni-bin_skus-Form'
}
]
});
// CARDS (End)
// TITLES (Start) ==========================================... | // INSPECTOR INIT (End)
| random_line_split |
inlines.js | Rows(row);
if(options.added) options.added(row);
}
});
return $rows;
};
// Stacked inlines ---------------------------------------------------------
$.fn.stackedFormset = function(options) {
var $rows = $(this);
var update_inline_labels = function(formset_to_update) {
formset_to_update.children(... | random_line_split | ||
inlines.js | (function() {
$(this).addClass('row' + ((row_number%2)+1));
next = $(this).next();
while (next.hasClass('nested-inline-row')) {
next.addClass('row' + ((row_number%2)+1));
next = next.next();
}
row_number = row_number + 1;
});
};
var reinitDateTimeShortCuts = function() {
// Rein... | {
$(this).attr("for", $(this).attr("for").replace(normalized_formset_prefix, formset_prefix));
} | conditional_block | |
inlines.js | - 1], true, options.adminStaticPrefix);
});
}
};
var initPrepopulatedFields = function(row) {
row.find('.prepopulated_field').each(function() {
var field = $(this), input = field.find('input, select, textarea'), dependency_list = input.data('dependency_list') || [], dependencies = [];
$.each(dep... | {
var no_forms = get_no_forms(formset_prefix);
if (increase) {
$("#id_" + formset_prefix + "-TOTAL_FORMS").attr("autocomplete", "off").val(parseInt(no_forms) + 1);
} else {
$("#id_" + formset_prefix + "-TOTAL_FORMS").attr("autocomplete", "off").val(parseInt(no_forms) - 1);
}
} | identifier_body | |
inlines.js | + 1;
$(this).html($(this).html().replace(/(#\d+)/g, "#" + count));
});
};
var reinitDateTimeShortCuts = function() {
// Reinitialize the calendar and clock widgets by force, yuck.
if ( typeof DateTimeShortcuts != "undefined") {
$(".datetimeshortcuts").remove();
DateTimeShortcuts.init();
}
... | insertNewRow | identifier_name | |
linkedin.js | 'use strict';
/**
* Module dependencies.
*/
var passport = require('passport'), | config = require('../config'),
users = require('../../app/controllers/users.server.controller');
module.exports = function() {
// Use linkedin strategy
passport.use(new LinkedInStrategy({
consumerKey: config.linkedin.clientID,
consumerSecret: config.linkedin.clientSecret,
callbackURL: config.linkedin.call... | LinkedInStrategy = require('passport-linkedin').Strategy, | random_line_split |
optimize.rs | // @lecorref - github.com/lecorref, @geam - github.com/geam,
// @adjivas - github.com/adjivas. See the LICENSE
// file at the top-level directory of this distribution and at
// https://github.com/adjivas/krpsim
//
// This file may not be copied, modified, or distributed
// except according to those terms.
extern crate... | (
stock: Vec<String>,
time: bool,
) -> Self {
Optimize {
stock: stock,
time: time,
}
}
/// The `from_line` constructor function returns the optimization's item
/// for a parsed line.
pub fn from_line (
line: String,
) -> Self {
let stock: Vec<String> = line.spl... | new | identifier_name |
optimize.rs | // @lecorref - github.com/lecorref, @geam - github.com/geam,
// @adjivas - github.com/adjivas. See the LICENSE
// file at the top-level directory of this distribution and at
// https://github.com/adjivas/krpsim
//
// This file may not be copied, modified, or distributed
// except according to those terms.
extern crate... | Optimize {
stock: Vec::new(),
time: false,
}
}
}
impl std::fmt::Display for Optimize {
/// The `fmt` function prints the Optimization's items.
fn fmt (
&self,
f: &mut std::fmt::Formatter,
) -> Result<(), std::fmt::Error> {
write!(f, "(optimize: {})", self.stock.iter().map(|a|... |
/// The `default` constructor function returns a empty optimize.
fn default() -> Self { | random_line_split |
main.component.ts |
import { JhiLanguageHelper } from '../../shared';
@Component({
selector: 'jhi-main',
templateUrl: './main.component.html'
})
export class JhiMainComponent implements OnInit {
constructor(
private jhiLanguageHelper: JhiLanguageHelper,
private router: Router
) {}
private getPageTit... | import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRouteSnapshot, NavigationEnd } from '@angular/router'; | random_line_split | |
main.component.ts | import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRouteSnapshot, NavigationEnd } from '@angular/router';
import { JhiLanguageHelper } from '../../shared';
@Component({
selector: 'jhi-main',
templateUrl: './main.component.html'
})
export class JhiMainComponent implements OnInit {
... |
private getPageTitle(routeSnapshot: ActivatedRouteSnapshot) {
let title: string = (routeSnapshot.data && routeSnapshot.data['pageTitle']) ? routeSnapshot.data['pageTitle'] : 'app1App';
if (routeSnapshot.firstChild) {
title = this.getPageTitle(routeSnapshot.firstChild) || title;
... | {} | identifier_body |
main.component.ts | import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRouteSnapshot, NavigationEnd } from '@angular/router';
import { JhiLanguageHelper } from '../../shared';
@Component({
selector: 'jhi-main',
templateUrl: './main.component.html'
})
export class JhiMainComponent implements OnInit {
... |
});
}
}
| {
this.jhiLanguageHelper.updateTitle(this.getPageTitle(this.router.routerState.snapshot.root));
} | conditional_block |
main.component.ts | import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRouteSnapshot, NavigationEnd } from '@angular/router';
import { JhiLanguageHelper } from '../../shared';
@Component({
selector: 'jhi-main',
templateUrl: './main.component.html'
})
export class JhiMainComponent implements OnInit {
... | (
private jhiLanguageHelper: JhiLanguageHelper,
private router: Router
) {}
private getPageTitle(routeSnapshot: ActivatedRouteSnapshot) {
let title: string = (routeSnapshot.data && routeSnapshot.data['pageTitle']) ? routeSnapshot.data['pageTitle'] : 'app1App';
if (routeSnapshot.... | constructor | identifier_name |
urls.py | """flex_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^flexselect/', include('flexselect.urls')),
] | 1. Add an import: from blog import urls as blog_urls | random_line_split |
writer.py | """Copyright 2009 Chris Davis
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
dist... | ():
"Write datapoints until the MetricCache is completely empty"
updates = 0
lastSecond = 0
while MetricCache:
dataWritten = False
#for (metric, datapoints, dbFilePath, dbFileExists) in optimalWriteOrder():
for (metric, datapoints, dbIdentifier, dbExists) in optimalWriteOrder():
dataWritten ... | writeCachedDataPoints | identifier_name |
writer.py | """Copyright 2009 Chris Davis
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
dist... |
try: # metrics can momentarily disappear from the MetricCache due to the implementation of MetricCache.store()
datapoints = MetricCache.pop(metric)
except KeyError:
log.msg("MetricCache contention, skipping %s update for now" % metric)
continue # we simply move on to the next metric when thi... | continue | conditional_block |
writer.py | """Copyright 2009 Chris Davis
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
dist... | def reloadStorageSchemas():
global schemas
try:
schemas = loadStorageSchemas()
except:
log.msg("Failed to reload storage schemas")
log.err()
def reloadAggregationSchemas():
global agg_schemas
try:
schemas = loadAggregationSchemas()
except:
log.msg("Failed to reload aggregation schemas")... |
time.sleep(1) # The writer thread only sleeps when the cache is empty or an error occurs
| random_line_split |
writer.py | """Copyright 2009 Chris Davis
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
dist... | except:
log.msg("Error writing to %s" % (dbIdentifier))
log.err()
instrumentation.increment('errors')
else:
pointCount = len(datapoints)
instrumentation.increment('committedPoints', pointCount)
instrumentation.append('updateTimes', updateTime)
if sett... | "Write datapoints until the MetricCache is completely empty"
updates = 0
lastSecond = 0
while MetricCache:
dataWritten = False
#for (metric, datapoints, dbFilePath, dbFileExists) in optimalWriteOrder():
for (metric, datapoints, dbIdentifier, dbExists) in optimalWriteOrder():
dataWritten = True... | identifier_body |
redis_helpers.py | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio 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 2 of the
# License, or (at your option) any later... |
return ids
def get_masters_in_redis():
from .master import RedisMaster, keys_master
return set([RedisMaster(master_id) for master_id in _get_things_in_redis(keys_master)])
def get_workers_in_redis():
from .worker import RedisWorker, keys_worker
return set([RedisWorker(worker_id) for worker_id i... | for field in conn.scan_iter(pref.format(**kwargs)):
id_ = field.split(':')[2]
ids.add(id_) | conditional_block |
redis_helpers.py | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio 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 2 of the
# License, or (at your option) any later... |
def get(self):
"""Block while trying to claim the lock to this master."""
while True:
new_lock = self._lock_manager.lock(master_examining_lock, 1000)
if new_lock:
assert self.conn.persist(master_examining_lock)
self._lock = new_lock
... | """Redis representation of the lock object.
:type tuple_: :py:class:`redlock.Lock`
"""
self.conn.hmset(
lock_last_owner,
{
'last_master_id': self.master_id,
'lock_validity': tuple_.validity,
'lock_resource': tuple_.resource... | identifier_body |
redis_helpers.py | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio 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 2 of the
# License, or (at your option) any later... |
def get_all_values_in_celery():
insp = inspect()
active = None
scheduled = None
while active is None:
active = insp.active()
while scheduled is None:
scheduled = insp.scheduled()
return active.values() + scheduled.values()
def get_redis_conn():
# return RedisConn.redis_con... |
# class RedisConn(object):
# redis_conn = redis.StrictRedis.from_url(redis_uri_string)
| random_line_split |
redis_helpers.py | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio 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 2 of the
# License, or (at your option) any later... | (object):
def __init__(self, uuid, eliot_task_id=None):
"""Initialize a lock handle for a certain client."""
self.conn = get_redis_conn()
self.uuid = uuid
if eliot_task_id is not None:
self.eliot_task_id = eliot_task_id
@property
def eliot_task_id(self):
... | RedisClient | identifier_name |
actions-view.js | import $ from 'jquery';
import _ from 'underscore';
import Marionette from 'backbone.marionette';
import CreateProfileView from './create-profile-view';
import RestoreProfileView from './restore-profile-view';
import RestoreBuiltInProfilesView from './restore-built-in-profiles-view';
import Template from './templates/q... | restoreBuiltIn: function () {
new RestoreBuiltInProfilesView({
collection: this.collection,
languages: this.languages
}).render();
},
requestLanguages: function () {
var that = this,
url = baseUrl + '/api/languages/list';
return $.get(url).done(function (r) {
that.langua... | random_line_split | |
main.2.ts | /* Second version */ | // #docregion
import {bootstrap} from '@angular/platform-browser-dynamic';
import {ROUTER_PROVIDERS} from '@angular/router-deprecated';
import {AppComponent} from './app.component';
// Add these symbols to override the `LocationStrategy`
import {provide} from '@angular/core';
import {LocationSt... | // For Milestone #2
// Also includes digression on HashPathStrategy (not used in the final app)
// #docplaster
| random_line_split |
convertToSparseMatrix.py | """
Script used to convert data into sparse matrix format that
can easily be imported into MATLAB.
Use like this
python convertToSparseMatrix.py ../../../../../data/train_triplets.txt 1000 ../../../../../data/eval/year1_test_triplets_visible.txt ../../../../../data/eval/year1_test_triplets_hidden.txt 100
"""
import sys... | for i in range(len(entries)):
matrix_file_test.write(str(rows[i]+1) + "\t" + str(columns[i]+1) + "\t" + str(entries[i]) + "\n")
#matrix_file_test.write(str(userIndex-1) + "\t" + str(songIndex-1) + "\t" + str(0.000000) + "\n")
matrix_file_test.close()
f.close()
print "Done loadi... | if inputFile == inputHiddenTestFile:
# Write to a sparse matrix file that can be read with MATLAB
matrix_file_test = open('UserSongSparseMatrixTest' + str(numTriplets) + '_' + str(numTripletsTest) + '.txt', 'w') | random_line_split |
convertToSparseMatrix.py | """
Script used to convert data into sparse matrix format that
can easily be imported into MATLAB.
Use like this
python convertToSparseMatrix.py ../../../../../data/train_triplets.txt 1000 ../../../../../data/eval/year1_test_triplets_visible.txt ../../../../../data/eval/year1_test_triplets_hidden.txt 100
"""
import sys... |
if inputFile == inputTestFile:
numSongs = songIndex
numUsers = userIndex
numNonZeros = len(entries)
rows = rows
columns = columns
entries = entries
# Write to a sparse matrix file that can be read with MATLAB
matrix_file = open('UserSongSparseMatrix... | numUsersInTraining = userIndex
maxLines = numTripletsTest | conditional_block |
mod.rs | #![cfg(target_os = "android")]
pub use api::android::*;
use ContextError;
pub struct HeadlessContext(i32);
impl HeadlessContext {
/// See the docs in the crate root file.
pub fn new(_builder: BuilderAttribs) -> Result<HeadlessContext, CreationError> {
unimplemented!()
}
/// See the docs in ... | (&self, _addr: &str) -> *const () {
unimplemented!()
}
pub fn get_api(&self) -> ::Api {
::Api::OpenGlEs
}
}
unsafe impl Send for HeadlessContext {}
unsafe impl Sync for HeadlessContext {}
| get_proc_address | identifier_name |
mod.rs | #![cfg(target_os = "android")]
pub use api::android::*;
use ContextError;
pub struct HeadlessContext(i32);
impl HeadlessContext {
/// See the docs in the crate root file.
pub fn new(_builder: BuilderAttribs) -> Result<HeadlessContext, CreationError> {
unimplemented!()
}
/// See the docs in ... |
/// See the docs in the crate root file.
pub fn is_current(&self) -> bool {
unimplemented!()
}
/// See the docs in the crate root file.
pub fn get_proc_address(&self, _addr: &str) -> *const () {
unimplemented!()
}
pub fn get_api(&self) -> ::Api {
::Api::OpenGlEs
... | {
unimplemented!()
} | identifier_body |
mod.rs | #![cfg(target_os = "android")]
|
pub struct HeadlessContext(i32);
impl HeadlessContext {
/// See the docs in the crate root file.
pub fn new(_builder: BuilderAttribs) -> Result<HeadlessContext, CreationError> {
unimplemented!()
}
/// See the docs in the crate root file.
pub unsafe fn make_current(&self) -> Result<(), Con... | pub use api::android::*;
use ContextError; | random_line_split |
main.rs | time;
extern crate getopts;
#[macro_use]
extern crate glium;
extern crate cgmath;
mod instr;
mod cpu;
mod mem;
mod render;
#[derive(Copy, Clone)]
pub enum IntType {
Vblank,
Hblank,
IoTimer,
}
struct ClockInt {
pub int_target: u64,
pub int_type: IntType,
}
impl PartialEq for ClockInt {
#[inl... |
}
// Initialize virtual LCD
let mut lcd = render::GbDisplay::new(&display);
let mut viewport = {
let window = display.get_window();
let (width, height) = window.unwrap().get_inner_size_pixels().unwrap();
render::calculate_viewport(width, height)
};
let (io_tx, sim_rx)... | {
println!("Error loading rom data: {}", e);
return;
} | conditional_block |
main.rs | time;
extern crate getopts;
#[macro_use]
extern crate glium;
extern crate cgmath;
mod instr;
mod cpu;
mod mem;
mod render;
#[derive(Copy, Clone)]
pub enum IntType {
Vblank,
Hblank,
IoTimer,
}
struct ClockInt {
pub int_target: u64,
pub int_type: IntType,
}
impl PartialEq for ClockInt {
#[inl... | match self.int_target.partial_cmp(&other.int_target) {
Some(Ordering::Less) => Some(Ordering::Greater),
Some(Ordering::Greater) => Some(Ordering::Less),
ord => ord,
}
}
}
impl Ord for ClockInt {
#[inline]
fn cmp(&self, other: &Self) -> Ordering {
... | impl Eq for ClockInt {}
impl PartialOrd for ClockInt {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<Ordering> { | random_line_split |
main.rs | time;
extern crate getopts;
#[macro_use]
extern crate glium;
extern crate cgmath;
mod instr;
mod cpu;
mod mem;
mod render;
#[derive(Copy, Clone)]
pub enum IntType {
Vblank,
Hblank,
IoTimer,
}
struct ClockInt {
pub int_target: u64,
pub int_type: IntType,
}
impl PartialEq for ClockInt {
#[inl... |
}
const NS_PER_S: u64 = 1_000_000_000;
const NS_PER_MS: u64 = 1_000_000;
// 10ms
const BUSY_WAIT_THRESHOLD: u64 = 10_000_000;
pub struct Clock {
freq: u32,
period: u64,
int_heap: BinaryHeap<ClockInt>,
}
impl Clock {
pub fn new(freq: u32) -> Clock {
Clock {
freq: fre... | {
match self.int_target.cmp(&other.int_target) {
Ordering::Less => Ordering::Greater,
Ordering::Greater => Ordering::Less,
ord => ord,
}
} | identifier_body |
main.rs | time;
extern crate getopts;
#[macro_use]
extern crate glium;
extern crate cgmath;
mod instr;
mod cpu;
mod mem;
mod render;
#[derive(Copy, Clone)]
pub enum IntType {
Vblank,
Hblank,
IoTimer,
}
struct ClockInt {
pub int_target: u64,
pub int_type: IntType,
}
impl PartialEq for ClockInt {
#[inl... | () {
// Gather command line args
let args: Vec<String> = std::env::args().collect();
let mut opts = getopts::Options::new();
let matches = match opts.parse(&args[1..]) {
Ok(m) => { m },
Err(e) => panic!("Error: {}", e),
};
let input = if !matches.free.is_empty() {
matche... | main | identifier_name |
ext-lang-tr.js | 9 AM
*
* Updated to 2.2 by YargicX
* 2008-10-05, 06:22 PM
*/
Ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">Yükleniyor ...</div>';
if(Ext.View){
Ext.View.prototype.emptyText = "";
}
if(Ext.grid.Grid){
Ext.grid.Grid.prototype.ddText = "Seçili satýr sayýsý : {0}";
}
if(Ext.TabPan... |
if(Ext.form.NumberField){
Ext.apply(Ext.form.NumberField.prototype, {
minText : "En az {0} girilebilir",
maxText : "En çok {0} girilebilir",
nanText : "{0} geçersiz bir sayýdýr"
});
}
if(Ext.form.DateField){
Ext.apply(Ext.form.DateField.prototype, {
disabledDaysText : "Disabled",
disabledDa... | regexText : "",
emptyText : null
});
} | random_line_split |
ext-lang-tr.js | 9 AM
*
* Updated to 2.2 by YargicX
* 2008-10-05, 06:22 PM
*/
Ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">Yükleniyor ...</div>';
if(Ext.View){
Ext.View.prototype.emptyText = "";
}
if(Ext.grid.Grid){
Ext.grid.Grid.prototype.ddText = "Seçili satýr sayýsý : {0}";
}
if(Ext.TabPan... | Lütfen bu baðlantý için gerekli URL adresini giriniz:',
buttonTips : {
bold : {
title: 'Kalýn(Bold) (Ctrl+B)',
text: 'Þžeçili yazýyý kalýn yapar.',
cls: 'x-html-editor-tip'
},
italic : {
title: 'İtalik(Italic) (Ctrl+I)',
text: 'Þžeçili yazýyý italik yapar.'... | posta formatýnda olmalýdýr';
Ext.form.VTypes["urlText"]='Bu alan "http://www.example.com" þŸeklinde URL adres formatýnda olmalýdýr';
Ext.form.VTypes["alphaText"]='Bu alan sadece harf ve _ içermeli';
Ext.form.VTypes["alphanumText"]='Bu alan sadece harf, sayý ve _ içermeli';
}
if(Ext.form.HtmlEditor){
Ext.apply(Ext... | conditional_block |
urls.py | from django.conf.urls.defaults import *
from corehq import AccountingAdminInterfaceDispatcher
from corehq.apps.accounting.views import *
urlpatterns = patterns('corehq.apps.accounting.views',
url(r'^$', 'accounting_default', name='accounting_default'),
url(r'^accounts/(\d+)/$', ManageBillingAccountView.as_vie... | url(r'^accounts/new/$', NewBillingAccountView.as_view(), name=NewBillingAccountView.urlname),
url(r'^subscriptions/(\d+)/$', EditSubscriptionView.as_view(), name=EditSubscriptionView.urlname),
url(r'^accounts/new_subscription/$', NewSubscriptionViewNoDefaultDomain.as_view(),
name=NewSubscriptionView... | random_line_split | |
S15.4.4.11_A7.1.js | // Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* The length property of sort has the attribute DontEnum
*
* @path ch15/15.4/15.4.4/15.4.4.11/S15.4.4.11_A7.1.js
* @description Checking use propertyIsEnumerable, for-in
*/
//CH... | result = false;
}
}
if (result !== true) {
$ERROR('#2: result = true; for (p in Array.sort) { if (p === "length") result = false; } result === true;');
} | for (var p in Array.sort){
if (p === "length") { | random_line_split |
S15.4.4.11_A7.1.js | // Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* The length property of sort has the attribute DontEnum
*
* @path ch15/15.4/15.4.4/15.4.4.11/S15.4.4.11_A7.1.js
* @description Checking use propertyIsEnumerable, for-in
*/
//CH... |
//CHECK#2
var result = true;
for (var p in Array.sort){
if (p === "length") {
result = false;
}
}
if (result !== true) {
$ERROR('#2: result = true; for (p in Array.sort) { if (p === "length") result = false; } result === true;');
}
| {
$ERROR('#1: Array.prototype.sort.propertyIsEnumerable(\'length\') === false. Actual: ' + (Array.prototype.sort.propertyIsEnumerable('length')));
} | conditional_block |
test_GLM2_many_cols_libsvm.py | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm
| def write_syn_libsvm_dataset(csvPathname, rowCount, colCount, SEED):
r1 = random.Random(SEED)
dsf = open(csvPathname, "w+")
for i in range(rowCount):
rowData = []
for j in range(colCount):
ri = r1.randint(0,1)
if ri!=0: # don't include 0's
colNumber =... | random_line_split | |
test_GLM2_many_cols_libsvm.py | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm
def write_syn_libsvm_dataset(csvPathname, rowCount, colCount, SEED):
r1 = random.Random(SEED)
dsf = open(csvPathname, "w+")
for i in range(rowCount):
rowDa... | (self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
global SEED
SEED = h2o.setup_random_seed()
h2o.init(1,java_heap_GB=10)
@classmethod
def tearDownClass(cls):
### time.sleep(3600)
h2o.tear_down_cloud()
def test_GLM2_many_cols_l... | tearDown | identifier_name |
test_GLM2_many_cols_libsvm.py | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm
def write_syn_libsvm_dataset(csvPathname, rowCount, colCount, SEED):
r1 = random.Random(SEED)
dsf = open(csvPathname, "w+")
for i in range(rowCount):
rowDa... |
ri = r1.randint(0,1)
# output class goes first
rowData.insert(0, str(ri))
rowDataCsv = " ".join(rowData) # already all strings
dsf.write(rowDataCsv + "\n")
dsf.close()
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@cla... | ri = r1.randint(0,1)
if ri!=0: # don't include 0's
colNumber = j + 1
rowData.append(str(colNumber) + ":" + str(ri)) | conditional_block |
test_GLM2_many_cols_libsvm.py | import unittest, random, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm
def write_syn_libsvm_dataset(csvPathname, rowCount, colCount, SEED):
r1 = random.Random(SEED)
dsf = open(csvPathname, "w+")
for i in range(rowCount):
rowDa... |
def test_GLM2_many_cols_libsvm(self):
SYNDATASETS_DIR = h2o.make_syn_dir()
tryList = [
(100, 3000, 'cA', 300),
(100, 5000, 'cB', 500),
# too slow!
# (100, 10000, 'cC', 800),
]
### h2b.browseTheCloud()
lenNodes = len... | h2o.tear_down_cloud() | identifier_body |
admin.py | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import Permission
from django.contrib.auth.forms import PasswordResetForm
from .models import MyUser
from forms import CustomUserRegistrationForm
class PermissionAdmin(admin.ModelAdmin):
search_fields ... | (self, request, obj, form, change):
if change:
pass
else:
obj.is_active = False
obj.save()
admin.site.register(MyUser, CustomUserAdmin)
admin.site.register(Permission, PermissionAdmin)
| save_model | identifier_name |
admin.py | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import Permission
from django.contrib.auth.forms import PasswordResetForm
from .models import MyUser
from forms import CustomUserRegistrationForm | class PermissionAdmin(admin.ModelAdmin):
search_fields = ['name', 'codename']
class CustomUserAdmin(UserAdmin):
add_form = CustomUserRegistrationForm
list_display = ['email', 'first_name', 'last_name', 'is_active', 'confirmed', 'osf_id']
fieldsets = (
(None, {'fields': ('email', 'password',)})... | random_line_split | |
admin.py | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import Permission
from django.contrib.auth.forms import PasswordResetForm
from .models import MyUser
from forms import CustomUserRegistrationForm
class PermissionAdmin(admin.ModelAdmin):
search_fields ... |
obj.save()
admin.site.register(MyUser, CustomUserAdmin)
admin.site.register(Permission, PermissionAdmin)
| obj.is_active = False | conditional_block |
admin.py | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import Permission
from django.contrib.auth.forms import PasswordResetForm
from .models import MyUser
from forms import CustomUserRegistrationForm
class PermissionAdmin(admin.ModelAdmin):
search_fields ... |
admin.site.register(MyUser, CustomUserAdmin)
admin.site.register(Permission, PermissionAdmin)
| if change:
pass
else:
obj.is_active = False
obj.save() | identifier_body |
cities.js | function makeData() |
function run(svg, data, Plottable) {
"use strict";
d3.csv("/quicktests/overlaying/data/cities.csv").get(function(error, rows) {
data = rows;
var ds = new Plottable.Dataset(data);
var csRange = [];
for(var i = 0; i < 30; i++){
var c = "#" + Math.floor(Math.random() * 16777215).toString(16);
csRan... | {
"use strict";
} | identifier_body |
cities.js | function makeData() {
"use strict";
}
function run(svg, data, Plottable) {
"use strict";
d3.csv("/quicktests/overlaying/data/cities.csv").get(function(error, rows) {
data = rows;
var ds = new Plottable.Dataset(data);
var csRange = [];
for(var i = 0; i < 30; i++) |
var cs = new Plottable.Scales.Color();
cs.range(csRange);
var xScale = new Plottable.Scales.Linear().domain([-110, -90]);
var yScale = new Plottable.Scales.Linear().domain([25, 40]);
var xAxis = new Plottable.Axes.Numeric(xScale, "bottom");
var yAxis = new Plottable.Axes.Numeric(yScale, "left");
var p... | {
var c = "#" + Math.floor(Math.random() * 16777215).toString(16);
csRange.push(c);
} | conditional_block |
cities.js | function | () {
"use strict";
}
function run(svg, data, Plottable) {
"use strict";
d3.csv("/quicktests/overlaying/data/cities.csv").get(function(error, rows) {
data = rows;
var ds = new Plottable.Dataset(data);
var csRange = [];
for(var i = 0; i < 30; i++){
var c = "#" + Math.floor(Math.random() * 16777215).... | makeData | identifier_name |
cities.js | function makeData() {
"use strict";
|
function run(svg, data, Plottable) {
"use strict";
d3.csv("/quicktests/overlaying/data/cities.csv").get(function(error, rows) {
data = rows;
var ds = new Plottable.Dataset(data);
var csRange = [];
for(var i = 0; i < 30; i++){
var c = "#" + Math.floor(Math.random() * 16777215).toString(16);
csRang... | } | random_line_split |
selectors.js | import { createSelector } from 'reselect';
import { SORT_PRICE_ASC, SORT_PRICE_DESC } from '@shopgate/engage/core';
import { generateResultHash } from '@shopgate/pwa-common/helpers/redux';
import { transformDisplayOptions } from '@shopgate/pwa-common/helpers/data';
import { getSortOrder } from '@shopgate/pwa-common/sel... | };
};
/**
* @param {Object} state he application state.
* @param {int} type Number indicating search type.
* @param {Object} params Query parameters.
* @param {string} id Id of component.
* @return {Object} The product result.
*/
export const getProductsResult = (state, type, params, id) => {
if (type === 4)... | products,
totalProductCount: products.length,
sort: transformDisplayOptions(sort),
hash, | random_line_split |
selectors.js | import { createSelector } from 'reselect';
import { SORT_PRICE_ASC, SORT_PRICE_DESC } from '@shopgate/engage/core';
import { generateResultHash } from '@shopgate/pwa-common/helpers/redux';
import { transformDisplayOptions } from '@shopgate/pwa-common/helpers/data';
import { getSortOrder } from '@shopgate/pwa-common/sel... |
return childCategories;
}
);
| {
return rootCategories;
} | conditional_block |
shot.py | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 25 12:14:03 2015
@author: ktritz
"""
from __future__ import print_function
from builtins import str, range
import inspect
import types
#import numpy as np
from collections.abc import MutableMapping
from .container import containerClassFactory
class Shot(MutableMapping)... |
else:
print('No logbook entries for {}'.format(self.shot))
def get_logbook(self):
# return a list of logbook entries
if not self._logbook_entries:
self._logbook_entries = self._logbook.get_entries(shot=self.shot)
return self._logbook_entries
def check_e... | print('Logbook entries for {}'.format(self.shot))
for entry in self._logbook_entries:
print('************************************')
print(('{shot} on {rundate} in XP {xp}\n'
'{username} in topic {topic}\n\n'
'{text}').format(**ent... | conditional_block |
shot.py | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 25 12:14:03 2015
@author: ktritz
"""
from __future__ import print_function
from builtins import str, range
import inspect
import types
#import numpy as np
from collections.abc import MutableMapping
from .container import containerClassFactory
class Shot(MutableMapping)... | cls = self.__class__
if cls._machine is None:
cls._machine = machine
# if cls._modules is None:
# cls._modules = {module: None for module in self._machine._modules}
if cls._logbook is None:
cls._logbook = self._machine._logbook
self._logbook_ent... |
# set class attributes if needed | random_line_split |
shot.py | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 25 12:14:03 2015
@author: ktritz
"""
from __future__ import print_function
from builtins import str, range
import inspect
import types
#import numpy as np
from collections.abc import MutableMapping
from .container import containerClassFactory
class Shot(MutableMapping)... |
def __contains__(self, key):
return key in self._modules
def __len__(self):
return len(list(self._modules.keys()))
def __delitem__(self, item):
pass
def __getitem__(self, item):
return self._modules[item]
def __setitem__(self, item, value):
pass
def... | return iter(self._modules) | identifier_body |
shot.py | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 25 12:14:03 2015
@author: ktritz
"""
from __future__ import print_function
from builtins import str, range
import inspect
import types
#import numpy as np
from collections.abc import MutableMapping
from .container import containerClassFactory
class Shot(MutableMapping)... | (self):
# query logbook for rundate, return rundate
if self._logbook_entries:
return self._logbook_entries[0]['rundate']
else:
return
def __getattr__(self, attr_name):
if attr_name in self._modules:
if self._modules[attr_name] is None:
... | _get_date | identifier_name |
xinfo.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import subprocess
import gdb
import pwndbg.arch
import pwndbg.color.memory as M
import pwndbg.commands
imp... |
if page.is_memory_mapped_file:
xinfo_mmap_file(page, addr)
| addr = int(address)
addr &= pwndbg.arch.ptrmask
page = pwndbg.vmmap.find(addr)
if page is None:
print("\n Virtual address {:#x} is not mapped.".format(addr))
return
print("Extended information for virtual address {}:".format(M.get(addr)))
print("\n Containing mapping:")
pri... | identifier_body |
xinfo.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import subprocess
import gdb
import pwndbg.arch
import pwndbg.color.memory as M
import pwndbg.commands
imp... | print_line("File (Base)", addr, first.vaddr, rva, "+")
# find possible LOAD segments that designate memory and file backings
containing_loads = [seg for seg in pwndbg.elf.get_containing_segments(file_name, first.vaddr, addr)
if seg['p_type'] == 'PT_LOAD']
for segment in contain... | # print offset from ELF base load address
rva = addr - first.vaddr | random_line_split |
xinfo.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import subprocess
import gdb
import pwndbg.arch
import pwndbg.color.memory as M
import pwndbg.commands
imp... |
else:
xinfo_default(page, addr)
if page.is_memory_mapped_file:
xinfo_mmap_file(page, addr)
| xinfo_stack(page, addr) | conditional_block |
xinfo.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import subprocess
import gdb
import pwndbg.arch
import pwndbg.color.memory as M
import pwndbg.commands
imp... | (page, addr):
# If it's an address pointing into a memory mapped file, print offsets
# to beginning of file in memory and on disk
file_name = page.objfile
objpages = filter(lambda p: p.objfile == file_name, pwndbg.vmmap.get())
first = sorted(objpages, key = lambda p: p.vaddr)[0]
# print offset... | xinfo_mmap_file | identifier_name |
oncoprinttooltip.ts | import $ from "jquery";
const TOOLTIP_CLASS = "oncoprintjs__tooltip";
export type OncoprintTooltipParams = { noselect?:boolean };
export default class | {
private $div:JQuery;
private hide_timeout_id:number|undefined;
private show_timeout_id:number|undefined;
public center:boolean;
private shown:boolean;
constructor(private $container:JQuery, params?:OncoprintTooltipParams) {
params = params || {};
this.$div = $('<div></div>')... | OncoprintToolTip | identifier_name |
oncoprinttooltip.ts | import $ from "jquery";
const TOOLTIP_CLASS = "oncoprintjs__tooltip";
export type OncoprintTooltipParams = { noselect?:boolean };
export default class OncoprintToolTip {
private $div:JQuery;
private hide_timeout_id:number|undefined;
private show_timeout_id:number|undefined;
public center:boolean;
... |
this.$div.css({'top':y, 'left':x, 'z-index':9999});
this.shown = true;
}
private doHide(fade?:boolean) {
this.cancelScheduledHide();
this.hide_timeout_id = undefined;
if (!fade) {
this.$div.hide();
} else {
this.$div.fadeOut();
}
... | {
this.cancelScheduledShow();
this.show_timeout_id = undefined;
this.$div.empty();
this.$div.css({'top':0, 'left':0, 'z-index':9999}); // put up top left so that it doesnt cause any page expansion, before the position calculation which depends on page size
this.$div.append($conte... | identifier_body |
oncoprinttooltip.ts | import $ from "jquery";
const TOOLTIP_CLASS = "oncoprintjs__tooltip";
export type OncoprintTooltipParams = { noselect?:boolean };
export default class OncoprintToolTip {
private $div:JQuery;
private hide_timeout_id:number|undefined;
private show_timeout_id:number|undefined;
public center:boolean;
... | this.show_timeout_id = undefined;
this.center = false;
this.shown = false;
const self = this;
this.$div.on("mousemove", function(evt) {
evt.stopPropagation();
self.cancelScheduledHide();
});
this.$div.on("mouseleave", function(evt) {
... | this.hide_timeout_id = undefined; | random_line_split |
oncoprinttooltip.ts | import $ from "jquery";
const TOOLTIP_CLASS = "oncoprintjs__tooltip";
export type OncoprintTooltipParams = { noselect?:boolean };
export default class OncoprintToolTip {
private $div:JQuery;
private hide_timeout_id:number|undefined;
private show_timeout_id:number|undefined;
public center:boolean;
... | else {
this.$div.fadeOut();
}
this.shown = false;
};
private cancelScheduledShow() {
clearTimeout(this.show_timeout_id);
this.show_timeout_id = undefined;
}
private cancelScheduledHide() {
clearTimeout(this.hide_timeout_id);
this.hide_timeout_... | {
this.$div.hide();
} | conditional_block |
null_logger.py | # Copyright (C) 2015 Swift Navigation Inc.
# Contact: Mark Fine <mark@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | # WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
class NullLogger(object):
"""
NullLogger
The :class:`NullLogger` does not log records.
"""
def __call__(self, msg, **metadata):
pass
def __enter__(self):
return self
def flush(self):
pass
def read(self, s=None):
... | # EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED | random_line_split |
null_logger.py | # Copyright (C) 2015 Swift Navigation Inc.
# Contact: Mark Fine <mark@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
#... |
def read(self, s=None):
pass
def write(self, s=None):
pass
def close(self):
pass
def __exit__(self, *args):
pass
| pass | identifier_body |
null_logger.py | # Copyright (C) 2015 Swift Navigation Inc.
# Contact: Mark Fine <mark@swiftnav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
#... | (self):
return self
def flush(self):
pass
def read(self, s=None):
pass
def write(self, s=None):
pass
def close(self):
pass
def __exit__(self, *args):
pass
| __enter__ | identifier_name |
list-firewalls.client.controller.tests.js | // Initialize global variables
var FirewallsListController,
$scope,
$httpBackend,
$state,
Authentication,
FirewallsService,
mockFirewall;
// The $resource service augments the response object with methods for updating and deleting the resource.
// If we were to use t... | (function () {
'use strict';
describe('Firewalls List Controller Tests', function () { | random_line_split | |
cherryConfig.py | import sys
import re
# Copyright
# =========
# Copyright (C) 2015 Trustwave Holdings, Inc.
#
# 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 optio... | f = open('kb852310.dll', 'rb')
except IOError as e:
print e
sys.exit(1)
buff = [ord(i) for i in f.read()]
decrypt_config(buff)
g = open('config.bin', 'wb')
g.write(bytearray(buff))
f.close()
g.close() | try:
if len(sys.argv) != 1:
f = open(sys.argv[1], 'rb')
else: | random_line_split |
cherryConfig.py | import sys
import re
# Copyright
# =========
# Copyright (C) 2015 Trustwave Holdings, Inc.
#
# 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 optio... |
return result
def replace_bytes(buffer, start, value):
i = 4
indx = 0
value = re.findall('..', value.split('0x')[1])
while i > 0:
buffer[start + indx] = int(value[i-1], 16)
i = i - 1
indx = indx + 1
def round_dword(value):
number = value.split('0x')[1]
if len(num... | if type(list[start + 3]) == int:
result = result + format(list[start + 3], '02x')
else:
result = result + list[start + 3][2:]
i = i + 1
start = start - 1 | conditional_block |
cherryConfig.py | import sys
import re
# Copyright
# =========
# Copyright (C) 2015 Trustwave Holdings, Inc.
#
# 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 optio... |
def round_dword(value):
number = value.split('0x')[1]
if len(number) > 8:
number = number[len(number) - 8:len(number)]
elif len(number) < 8:
for i in range(0, 8-len(number)):
number = '0' + number
return '0x' + number
def decrypt_config(buffer):
counter = 2208
w... | i = 4
indx = 0
value = re.findall('..', value.split('0x')[1])
while i > 0:
buffer[start + indx] = int(value[i-1], 16)
i = i - 1
indx = indx + 1 | identifier_body |
cherryConfig.py | import sys
import re
# Copyright
# =========
# Copyright (C) 2015 Trustwave Holdings, Inc.
#
# 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 optio... | (buffer):
counter = 2208
while(counter >= 0):
v2 = 48
while v2:
v4 = (v2 & 3) * 4
xor = int(DWORD(xor_key, v4), 16)
op1 = int(DWORD(buffer, counter + 4 * ((v2 - 1) & 3)), 16)
op1 = round_dword(hex(op1 * 2))
op2 = DWORD(buffer, counter ... | decrypt_config | identifier_name |
inspect.js | /* */
var assert = require('assert'); | var util = require('../../util');
suite('inspect');
test('util.inspect - test for sparse array', function() {
var a = ['foo', 'bar', 'baz'];
assert.equal(util.inspect(a), '[ \'foo\', \'bar\', \'baz\' ]');
delete a[1];
assert.equal(util.inspect(a), '[ \'foo\', , \'baz\' ]');
assert.equal(util.inspect(a, true),... | random_line_split | |
config.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import ast
import os.path
import platform
import re
import sys
class Config(object):
'''A Config contains a dictionary that species a build configuratio... |
if machine.startswith('arm'):
return Config.ARCH_ARM
raise Exception('Cannot identify CPU arch: %s' % machine)
def _ParseGNArgs(self):
'''Parse the gn config file from the build directory, if it exists.'''
TRANSLATIONS = { 'true': 'True', 'false': 'False', }
if self.values['build_dir'] is ... | return Config.ARCH_X64 | conditional_block |
config.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import ast
import os.path
import platform
import re
import sys
class Config(object):
'''A Config contains a dictionary that species a build configuratio... | ():
if sys.platform == 'linux2':
return Config.OS_LINUX
if sys.platform == 'darwin':
return Config.OS_MAC
if sys.platform == 'win32':
return Config.OS_WINDOWS
raise NotImplementedError('Unsupported host OS')
@staticmethod
def GetHostCPU():
# Derived from //native_client/pynacl... | GetHostOS | identifier_name |
config.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import ast
import os.path
import platform
import re
import sys
class Config(object):
'''A Config contains a dictionary that species a build configuratio... |
@property
def apk_name(self):
'''Name of the APK file to run'''
return self.values['apk_name']
| '''Is ASAN build?'''
return self.values['is_asan'] | identifier_body |
config.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import ast
import os.path
import platform
import re
import sys
class Config(object):
'''A Config contains a dictionary that species a build configuratio... | if machine in ('x86-64', 'amd64', 'AMD64', 'x86_64', 'x8664', '64'):
return Config.ARCH_X64
if machine.startswith('arm'):
return Config.ARCH_ARM
raise Exception('Cannot identify CPU arch: %s' % machine)
def _ParseGNArgs(self):
'''Parse the gn config file from the build directory, if it ex... | random_line_split | |
types.ts | /* | * to you 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 und... | * 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 | random_line_split |
versions_client.py | # Copyright 2014 OpenStack Foundation
# 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 requ... | """List all versions."""
url = ''
if params:
url += '?%s' % urllib.urlencode(params)
resp, body = self.get(url)
return resp, self._parse_resp(body) | identifier_body | |
versions_client.py | # Copyright 2014 OpenStack Foundation
# 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 requ... |
resp, body = self.get(url)
return resp, self._parse_resp(body)
| url += '?%s' % urllib.urlencode(params) | conditional_block |
versions_client.py | # Copyright 2014 OpenStack Foundation
# 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 requ... | # under the License.
import urllib
from tempest.common import rest_client
from tempest import config
CONF = config.CONF
class DatabaseVersionsClientJSON(rest_client.RestClient):
def __init__(self, auth_provider):
super(DatabaseVersionsClientJSON, self).__init__(auth_provider)
self.skip_path... | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations | random_line_split |
versions_client.py | # Copyright 2014 OpenStack Foundation
# 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 requ... | (self, params=None):
"""List all versions."""
url = ''
if params:
url += '?%s' % urllib.urlencode(params)
resp, body = self.get(url)
return resp, self._parse_resp(body)
| list_db_versions | identifier_name |
app.component.ts | /*
* Angular 2 decorators and services
*/
import {Component, ViewEncapsulation} from 'angular2/core';
import {RouteConfig, Router} from 'angular2/router';
import {Home} from './home';
import {AppState} from './app.service';
import {RouterActive} from './router-active';
/*
* App Component
* Top Level Component
*/... | (
public appState: AppState) {
}
ngOnInit() {
console.log('Initial App State', this.appState.state);
}
}
/*
* Please review the https://github.com/AngularClass/angular2-examples/ repo for
* more angular app examples that you may copy/paste
* (The examples may not be updated as quickly. Please open ... | constructor | identifier_name |
app.component.ts | /*
* Angular 2 decorators and services
*/
import {Component, ViewEncapsulation} from 'angular2/core';
import {RouteConfig, Router} from 'angular2/router';
import {Home} from './home';
import {AppState} from './app.service';
import {RouterActive} from './router-active';
/*
* App Component
* Top Level Component
*/... | md-toolbar li.active {
background-color: lightgray;
}
`],
template: `
<header>
<md-toolbar color="primary">
<span>{{ name }}</span>
<nav>
<ul>
<li router-active>
<a [routerLink]=" ['Index'] ">Index</a>
</li>
|
... | display: inline;
} | random_line_split |
app.component.ts | /*
* Angular 2 decorators and services
*/
import {Component, ViewEncapsulation} from 'angular2/core';
import {RouteConfig, Router} from 'angular2/router';
import {Home} from './home';
import {AppState} from './app.service';
import {RouterActive} from './router-active';
/*
* App Component
* Top Level Component
*/... |
}
/*
* Please review the https://github.com/AngularClass/angular2-examples/ repo for
* more angular app examples that you may copy/paste
* (The examples may not be updated as quickly. Please open an issue on github for us to update it)
* For help or questions please contact us at @AngularClass on twitter
* or o... | {
console.log('Initial App State', this.appState.state);
} | identifier_body |
PerforceURLProvider.py | # -*- coding: utf-8 -*-
#
# Copyright 2021 Elliot Jordan
#
# 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 l... |
# Get content of directory listing and parse for links matching path regex.
html = self.download(url, text=True)
link_pattern = re.compile('<a href="(%s)">' % path[0])
links = re.findall(link_pattern, html)
if len(links) == 0:
# No match, toss back to parent caller a... | random_line_split | |
PerforceURLProvider.py | # -*- coding: utf-8 -*-
#
# Copyright 2021 Elliot Jordan
#
# 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 l... | (URLGetter):
"""Provides a download URL for Perforce products. Currently only supports
recent versions of P4V and HelixALM.
"""
input_variables = {
"product": {
"required": False,
"default": "P4V",
"description": "Perforce product to provide a download URL fo... | PerforceURLProvider | identifier_name |
PerforceURLProvider.py | # -*- coding: utf-8 -*-
#
# Copyright 2021 Elliot Jordan
#
# 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 l... |
if __name__ == "__main__":
PROCESSOR = PerforceURLProvider()
PROCESSOR.execute_shell()
| """Main process."""
info = PRODUCT_DETAILS[self.env["product"]]
url = self.recurse_subdirs(info["path"], BASE_URL + "/" + info["start"])
if not url:
raise ProcessorError(
"Did not find a matching download URL for %s." % self.env["product"]
)
self.... | identifier_body |
PerforceURLProvider.py | # -*- coding: utf-8 -*-
#
# Copyright 2021 Elliot Jordan
#
# 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 l... |
return None
def main(self):
"""Main process."""
info = PRODUCT_DETAILS[self.env["product"]]
url = self.recurse_subdirs(info["path"], BASE_URL + "/" + info["start"])
if not url:
raise ProcessorError(
"Did not find a matching download URL for %s.... | return result | conditional_block |
event.ts | module Fusion {
export enum EventType {
/**
* Raised when the Fusion application environment has been initialized
*/
INITIALIZED,
/**
* Raised when the Fusion application environment has an unhandled error
*/
ERROR
}
export type EventH... | (event: EventType | number): boolean {
return !!this._subscriptions[event];
}
protected trigger(event: EventType | number, args: any) {
this._subscriptions[event].forEach((evt, i, arr) => {
evt.raise(args);
});
}
}
} | hasRegistrations | identifier_name |
event.ts | module Fusion {
export enum EventType {
/**
* Raised when the Fusion application environment has been initialized
*/
INITIALIZED,
/**
* Raised when the Fusion application environment has an unhandled error
*/
ERROR
}
export type EventH... | * Supports registration of application-defined events
*/
export interface EventEmittable {
hasRegistrations(event: EventType | number): boolean;
registerForEvent(event: EventType | number, handler: EventHandler): void;
}
/**
* Supports registration and emitting of applica... | random_line_split | |
main.js | $(document).ready(main);
function parseDay() |
function parseExercise (text, day) {
return text.replace(/{\d+, \d+}\w?/g, parseRange(day));
}
var parseRange = (day) => (range) => {
var totalDays = workout.days;
var progress = (day - 1) / (totalDays - 1);
let start = parseInt(range.match(/\d+/g)[0]);
let end = parseInt(range.match(/\d+/g)[1]);
let flag... | {
var inputDay = parseInt($("#day").val());
if (inputDay > workout.days || inputDay < 1 || isNaN(inputDay)) {
alert("Oops! I don't understand that. Please enter a day number between 1 and 28, inclusive.");
$("#day").val("");
} else {
showWorkout(inputDay);
}
} | identifier_body |
main.js | $(document).ready(main);
function parseDay() {
var inputDay = parseInt($("#day").val());
if (inputDay > workout.days || inputDay < 1 || isNaN(inputDay)) {
alert("Oops! I don't understand that. Please enter a day number between 1 and 28, inclusive.");
$("#day").val("");
} else {
showWorkout(inputDay);... | $("#workout").append("<h3>" + section.name + "</h3><h4>" + section.fitnessType + "</h4><ol>");
var shuffledList = _.shuffle(section.exercises);
for (var i = 0; i < section.count; i++) {
$("#workout").append("<li>" + parseExercise(shuffledList[i], day) + "</li>");
}
$("#workout").append("</ol>"... | function showWorkout (day) {
$("#workout").empty();
$("#heading").empty();
$("#heading").append("<h1>" + workout.title + ": Day " + day + "</h1>");
for (let section of workout.workout) { | random_line_split |
main.js | $(document).ready(main);
function parseDay() {
var inputDay = parseInt($("#day").val());
if (inputDay > workout.days || inputDay < 1 || isNaN(inputDay)) {
alert("Oops! I don't understand that. Please enter a day number between 1 and 28, inclusive.");
$("#day").val("");
} else {
showWorkout(inputDay);... | (day) {
$("#workout").empty();
$("#heading").empty();
$("#heading").append("<h1>" + workout.title + ": Day " + day + "</h1>");
for (let section of workout.workout) {
$("#workout").append("<h3>" + section.name + "</h3><h4>" + section.fitnessType + "</h4><ol>");
var shuffledList = _.shuffle(section.exerc... | showWorkout | identifier_name |
main.js | $(document).ready(main);
function parseDay() {
var inputDay = parseInt($("#day").val());
if (inputDay > workout.days || inputDay < 1 || isNaN(inputDay)) | else {
showWorkout(inputDay);
}
}
function parseExercise (text, day) {
return text.replace(/{\d+, \d+}\w?/g, parseRange(day));
}
var parseRange = (day) => (range) => {
var totalDays = workout.days;
var progress = (day - 1) / (totalDays - 1);
let start = parseInt(range.match(/\d+/g)[0]);
let end = pars... | {
alert("Oops! I don't understand that. Please enter a day number between 1 and 28, inclusive.");
$("#day").val("");
} | conditional_block |
SingleExecutionDetails.tsx | import React from 'react';
import ReactGA from 'react-ga';
import { Subscription } from 'rxjs';
import { UISref } from '@uirouter/react';
import { Application } from 'core/application/application.model';
import { IExecution, IPipeline } from 'core/domain';
import { Execution } from '../executions/execution/Execution';... | this.executionLoader = this.executionScheduler.subscribe(() => this.getExecution());
}
if (!execution.isActive && this.executionScheduler) {
this.executionScheduler.unsubscribe();
this.executionLoader.unsubscribe();
}
this.setState({ execution });
a... | random_line_split | |
SingleExecutionDetails.tsx | import React from 'react';
import ReactGA from 'react-ga';
import { Subscription } from 'rxjs';
import { UISref } from '@uirouter/react';
import { Application } from 'core/application/application.model';
import { IExecution, IPipeline } from 'core/domain';
import { Execution } from '../executions/execution/Execution';... |
app.pipelineConfigs.activate();
app.pipelineConfigs.ready().then(() => {
const pipelineConfig = app.pipelineConfigs.data.find((p: IPipeline) => p.id === execution.pipelineConfigId);
this.setState({ pipelineConfig });
});
},
() => {
this.setState({ executi... | {
const { executionService, $state } = ReactInjector;
const { app } = this.props;
if (!app || app.notFound || app.hasError) {
return;
}
executionService.getExecution($state.params.executionId).then(
(execution) => {
ExecutionsTransformer.transformExecution(app, execution);
... | identifier_body |
SingleExecutionDetails.tsx | import React from 'react';
import ReactGA from 'react-ga';
import { Subscription } from 'rxjs';
import { UISref } from '@uirouter/react';
import { Application } from 'core/application/application.model';
import { IExecution, IPipeline } from 'core/domain';
import { Execution } from '../executions/execution/Execution';... |
if (this.executionLoader) {
this.executionLoader.unsubscribe();
}
this.stateChangeSuccessSubscription.unsubscribe();
}
private showDurationsChanged = (event: React.ChangeEvent<HTMLInputElement>): void => {
const checked = event.target.checked;
// TODO: Since we treat sortFilter like a st... | {
this.executionScheduler.unsubscribe();
} | conditional_block |
SingleExecutionDetails.tsx | import React from 'react';
import ReactGA from 'react-ga';
import { Subscription } from 'rxjs';
import { UISref } from '@uirouter/react';
import { Application } from 'core/application/application.model';
import { IExecution, IPipeline } from 'core/domain';
import { Execution } from '../executions/execution/Execution';... | (): void {
if (this.executionScheduler) {
this.executionScheduler.unsubscribe();
}
if (this.executionLoader) {
this.executionLoader.unsubscribe();
}
this.stateChangeSuccessSubscription.unsubscribe();
}
private showDurationsChanged = (event: React.ChangeEvent<HTMLInputElement>): void... | componentWillUnmount | identifier_name |
mod.rs | mod composite;
pub mod convolve_matrix;
pub mod displacement_map;
pub mod flood;
pub mod gaussian_blur;
pub mod image;
pub mod lighting;
pub mod merge;
pub mod morphology;
pub mod offset;
pub mod tile;
pub mod turbulence;
pub struct FilterSpec {
pub user_space_filter: UserSpaceFilter,
pub primitives: Vec<User... | {
Blend(blend::Blend),
ColorMatrix(color_matrix::ColorMatrix),
ComponentTransfer(component_transfer::ComponentTransfer),
Composite(composite::Composite),
ConvolveMatrix(convolve_matrix::ConvolveMatrix),
DiffuseLighting(lighting::DiffuseLighting),
DisplacementMap(displacement_map::Displaceme... | PrimitiveParams | identifier_name |
mod.rs | mod composite;
pub mod convolve_matrix;
pub mod displacement_map;
pub mod flood;
pub mod gaussian_blur;
pub mod image;
pub mod lighting;
pub mod merge;
pub mod morphology;
pub mod offset;
pub mod tile;
pub mod turbulence;
pub struct FilterSpec {
pub user_space_filter: UserSpaceFilter,
pub primitives: Vec<User... | DiffuseLighting(lighting::DiffuseLighting),
DisplacementMap(displacement_map::DisplacementMap),
Flood(flood::Flood),
GaussianBlur(gaussian_blur::GaussianBlur),
Image(image::Image),
Merge(merge::Merge),
Morphology(morphology::Morphology),
Offset(offset::Offset),
SpecularLighting(light... | ComponentTransfer(component_transfer::ComponentTransfer),
Composite(composite::Composite),
ConvolveMatrix(convolve_matrix::ConvolveMatrix), | random_line_split |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.