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
HeaderParser.js
var EventEmitter = require('events').EventEmitter, inherits = require('util').inherits; var StreamSearch = require('streamsearch'); var B_DCRLF = Buffer.from('\r\n\r\n'), RE_CRLF = /\r\n/g, RE_HDR = /^([^:]+):[ \t]?([\x00-\xFF]+)?$/, MAX_HEADER_PAIRS = 2000, // from node's http.js MAX_HEADER_SIZE ...
HeaderParser.prototype._parseHeader = function() { if (this.npairs === this.maxHeaderPairs) return; var lines = this.buffer.split(RE_CRLF), len = lines.length, m, h, modded = false; for (var i = 0; i < len; ++i) { if (lines[i].length === 0) continue; if (lines[i][0] === '\t' || lines[i]...
random_line_split
configuracion.py
#!/usr/bin/env python class configuracion(): """ Esta clase cumple la función de una base de datos o fichero de configuración, donde se almacenan de manera temporal las preferencias de uso del ReDA. """ color = 0 """Indica el color de la camisa del interprete, sus posibles valores son 0...
self.definicion = self.preferencias["definicion"] self.synvel = self.preferencias["synvel"] self.magnificador = self.preferencias["magnificador"] self.activar_lector = self.preferencias["activar_lector"] def guardar_preferencias(self): """ Guarda las p...
self.disc_audi = self.preferencias["disc_audi"] self.disc_vis = self.preferencias["disc_audi"] self.texto_cambio = self.preferencias["texto_cambio"] self.audio = self.preferencias["audio"] self.genero = self.preferencias["genero"]
random_line_split
configuracion.py
#!/usr/bin/env python class configuracion(): """ Esta clase cumple la función de una base de datos o fichero de configuración, donde se almacenan de manera temporal las preferencias de uso del ReDA. """ color = 0 """Indica el color de la camisa del interprete, sus posibles valores son 0...
arga valores por defecto para la animación del intérprete en el menú de configuración auditiva. """ self.vel_anim = 4 self.velocidad = 0.5
identifier_body
configuracion.py
#!/usr/bin/env python class
(): """ Esta clase cumple la función de una base de datos o fichero de configuración, donde se almacenan de manera temporal las preferencias de uso del ReDA. """ color = 0 """Indica el color de la camisa del interprete, sus posibles valores son 0, 1 y 2. value: 0""" ubx = 499 """...
configuracion
identifier_name
walk.rs
use super::tree::*; use super::super::Graph; use super::super::dominators::Dominators; use super::super::node_vec::NodeVec; use std::collections::HashSet; use std::default::Default; #[derive(Copy, Clone, Debug, PartialEq, Eq)] enum NodeState { NotYetStarted, InProgress(Option<LoopId>), FinishedHeadWalk, ...
(&mut self, mut loop_id: LoopId, successor: G::Node) { match self.loop_tree.loop_id(successor) { Some(successor_loop_id) => { // If the successor's loop is an outer-loop of ours, // then this is an exit from our loop and all // intervening loops. ...
update_loop_exit
identifier_name
walk.rs
use super::tree::*; use super::super::Graph; use super::super::dominators::Dominators; use super::super::node_vec::NodeVec; use std::collections::HashSet; use std::default::Default; #[derive(Copy, Clone, Debug, PartialEq, Eq)] enum NodeState { NotYetStarted, InProgress(Option<LoopId>), FinishedHeadWalk, ...
} } self.state[node] = FinishedHeadWalk; // Assign a loop-id to this node. This will be the innermost // loop that we could reach. match self.innermost(&set) { Some(loop_id) => { self.loop_tree.set_loop_id(node, Some(loop_id)); ...
{ unreachable!() }
conditional_block
walk.rs
use super::tree::*; use super::super::Graph; use super::super::dominators::Dominators; use super::super::node_vec::NodeVec; use std::collections::HashSet; use std::default::Default; #[derive(Copy, Clone, Debug, PartialEq, Eq)] enum NodeState { NotYetStarted, InProgress(Option<LoopId>), FinishedHeadWalk, ...
match self.innermost(&set) { Some(loop_id) => { self.loop_tree.set_loop_id(node, Some(loop_id)); // Check if we are the loop head. In that case, we // should remove ourselves from the returned set, // since our parent in the spanning t...
self.state[node] = FinishedHeadWalk; // Assign a loop-id to this node. This will be the innermost // loop that we could reach.
random_line_split
rastercalcdialog.py
import * from qgis.gui import * import os.path import osgeo.gdal as gdal import os from ui_rastercalcdialogbase import Ui_RasterCalcDialog import rastercalcengine import rastercalcutils as rasterUtils class RasterCalcDialog( QDialog, Ui_RasterCalcDialog ): def __init__( self ): QDialog.__init__( self ) s...
def fillBandList( self, item, col ): self.bandList.clear() if item.text( 0 ).startsWith( "Group" ): self.bandList.clear() return bandNum = int( item.text( 2 ) ) if bandNum == 1: self.bandList.addItem( "1" ) else: for i in range( bandNum ): self.bandList.addItem( st...
layer = item.text( 1 ) + "@" + self.bandNum textCursor.insertText( layer )
random_line_split
rastercalcdialog.py
import * from qgis.gui import * import os.path import osgeo.gdal as gdal import os from ui_rastercalcdialogbase import Ui_RasterCalcDialog import rastercalcengine import rastercalcutils as rasterUtils class RasterCalcDialog( QDialog, Ui_RasterCalcDialog ): def __init__( self ): QDialog.__init__( self ) s...
( self ): self.commandTextEdit.clear() def insertPreset( self, preset ): self.commandTextEdit.clear() if preset == "NDVI (TM/ETM+)": self.commandTextEdit.insertPlainText( "( [raster]@4 - [raster]@3 ) / ( [raster]@4 + [raster]@3 )" ) elif preset == "Difference": self.commandTextEdit.insert...
clearExpression
identifier_name
rastercalcdialog.py
import * from qgis.gui import * import os.path import osgeo.gdal as gdal import os from ui_rastercalcdialogbase import Ui_RasterCalcDialog import rastercalcengine import rastercalcutils as rasterUtils class RasterCalcDialog( QDialog, Ui_RasterCalcDialog ): def __init__( self ): QDialog.__init__( self ) s...
def insertFunction( self ): btn = self.sender() if btn.metaObject().className() == "QPushButton": opText = btn.text() self.commandTextEdit.insertPlainText( opText + "( )" ) self.commandTextEdit.moveCursor( QTextCursor.Left ) self.commandTextEdit.moveCursor( QTextCursor.Left ) def...
opText = " " + btn.text() + " " self.commandTextEdit.insertPlainText( opText )
conditional_block
rastercalcdialog.py
import * from qgis.gui import * import os.path import osgeo.gdal as gdal import os from ui_rastercalcdialogbase import Ui_RasterCalcDialog import rastercalcengine import rastercalcutils as rasterUtils class RasterCalcDialog( QDialog, Ui_RasterCalcDialog ): def __init__( self ): QDialog.__init__( self ) s...
def insertArifmOp( self ): btn = self.sender() if btn.metaObject().className() == "QPushButton": opText = " " + btn.text() + " " self.commandTextEdit.insertPlainText( opText ) def insertFunction( self ): btn = self.sender() if btn.metaObject().className() == "QPushButton": opTex...
btn = self.sender() if btn.metaObject().className() == "QPushButton": btnText = btn.text() self.commandTextEdit.insertPlainText( btnText )
identifier_body
cabi_x86_64.rs
X87Up, ComplexX87, Memory } trait TypeMethods { fn is_reg_ty(&self) -> bool; } impl TypeMethods for Type { fn is_reg_ty(&self) -> bool { match self.kind() { Integer | Pointer | Float | Double => true, _ => false } } } impl RegClass { fn is_sse(&self) -...
(ty: Type, cls: &mut [RegClass], ix: usize, off: usize) { let t_align = ty_align(ty); let t_size = ty_size(ty); let misalign = off % t_align; if misalign != 0 { let mut i = off / 8; let e = (off + t_size + 7) / 8; while...
classify
identifier_name
cabi_x86_64.rs
X87Up, ComplexX87, Memory } trait TypeMethods { fn is_reg_ty(&self) -> bool; } impl TypeMethods for Type { fn is_reg_ty(&self) -> bool { match self.kind() { Integer | Pointer | Float | Double => true, _ => false } } } impl RegClass { fn is_sse(&self...
Array => { let len = ty.array_length(); let elt = ty.element_type(); let eltsz = ty_size(elt); let mut i = 0; while i < len { classify(elt, cls, ix, off + i * eltsz); i += 1; ...
}
random_line_split
cabi_x86_64.rs
-> Vec<RegClass> { fn align(off: usize, ty: Type) -> usize { let a = ty_align(ty); return (off + a - 1) / a * a; } fn ty_align(ty: Type) -> usize { match ty.kind() { Integer => ((ty.int_width() as usize) + 7) / 8, Pointer => 8, Float => 4, ...
{ tys.push(Type::f64(ccx)); }
conditional_block
cabi_x86_64.rs
8, Struct => { let str_tys = ty.field_types(); if ty.is_packed() { str_tys.iter().fold(0, |s, t| s + ty_size(*t)) } else { let size = str_tys.iter().fold(0, |s, t| align(s, *t) + ty_size(*t)); align(...
{ fn x86_64_ty<F>(ccx: &CrateContext, ty: Type, is_mem_cls: F, ind_attr: Attribute) -> ArgType where F: FnOnce(&[RegClass]) -> bool, { if !ty.is_reg_ty() { let cls = classify_ty(ty); if is_mem...
identifier_body
project.rs
) -> Vec<PullTemplate> { let mut out = vec![]; ::std::mem::swap(&mut out, &mut self.pulls); out } } fn candidate_type_column(cc: &ConjoiningClauses, var: &Variable) -> Result<(ColumnOrExpression, Name)> { cc.extracted_types .get(var) .cloned() .map(|alias| { ...
&Element::Pull(_) => { }, }; // Record variables -- `(the ?x)` and `?x` are different in this regard, because we don't want // to group on variables that are corresponding-projected. match e { &Element::Variable(ref var) => { outer_var...
},
conditional_block
project.rs
use mentat_query_sql::{ ColumnOrExpression, GroupBy, Name, Projection, ProjectedColumn, }; use query_projector_traits::aggregates::{ SimpleAggregation, projected_column_for_simple_aggregate, }; use query_projector_traits::errors::{ ProjectorError, Result, }; use projectors::{ ...
ConjoiningClauses, QualifiedAlias, VariableColumn, };
random_line_split
project.rs
-> Vec<PullTemplate> { let mut out = vec![]; ::std::mem::swap(&mut out, &mut self.pulls); out } } fn ca
c: &ConjoiningClauses, var: &Variable) -> Result<(ColumnOrExpression, Name)> { cc.extracted_types .get(var) .cloned() .map(|alias| { let type_name = VariableColumn::VariableTypeTag(var.clone()).column_name(); (ColumnOrExpression::Column(alias), type_name) }) .ok_or_...
ndidate_type_column(c
identifier_name
project.rs
pub(crate) fn take_pulls(&mut self) -> Vec<PullTemplate> { let mut out = vec![]; ::std::mem::swap(&mut out, &mut self.pulls); out } } fn candidate_type_column(cc: &ConjoiningClauses, var: &Variable) -> Result<(ColumnOrExpression, Name)> { cc.extracted_types .get(var) .cl...
let mut out = vec![]; ::std::mem::swap(&mut out, &mut self.templates); out }
identifier_body
hmacsha512256.rs
//! `HMAC-SHA-512-256`, i.e., the first 256 bits of //! `HMAC-SHA-512`. `HMAC-SHA-512-256` is conjectured to meet the standard notion //! of unforgeability. use ffi::{crypto_auth_hmacsha512256, crypto_auth_hmacsha512256_verify, crypto_auth_hmacsha512256_KEYBYTES, crypto_auth_hmacsha512256...
() { // corresponding to tests/auth.c from NaCl // "Test Case 2" from RFC 4231 let key = Key([74, 101, 102, 101, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0]); let c = [0x77, 0x68,...
test_vector_1
identifier_name
hmacsha512256.rs
//! `HMAC-SHA-512-256`, i.e., the first 256 bits of //! `HMAC-SHA-512`. `HMAC-SHA-512-256` is conjectured to meet the standard notion //! of unforgeability. use ffi::{crypto_auth_hmacsha512256, crypto_auth_hmacsha512256_verify, crypto_auth_hmacsha512256_KEYBYTES, crypto_auth_hmacsha512256...
}
{ // corresponding to tests/auth.c from NaCl // "Test Case 2" from RFC 4231 let key = Key([74, 101, 102, 101, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0]); let c = [0x77, 0x68, 0x...
identifier_body
hmacsha512256.rs
//! `HMAC-SHA-512`. `HMAC-SHA-512-256` is conjectured to meet the standard notion //! of unforgeability. use ffi::{crypto_auth_hmacsha512256, crypto_auth_hmacsha512256_verify, crypto_auth_hmacsha512256_KEYBYTES, crypto_auth_hmacsha512256_BYTES}; auth_module!(crypto_auth_hmacsha512256, ...
//! `HMAC-SHA-512-256`, i.e., the first 256 bits of
random_line_split
fdmgrid.py
#!/usr/bin/env python """interpret a comapct grid specification using regex""" import re # use a compact regular expression with nested OR expressions, # and hence many groups, but name the outer (main) groups: real_short1 = \ r'\s*(?P<lower>-?(\d+(\.\d*)?|\d*\.\d+)([eE][+\-]?\d+)?)\s*' real_short2 = \ r'\s*(?P<uppe...
print '\nalternative; simpler regular expressions:\n', domain, indices for ex in examples: print re.findall(indices, ex) print re.findall(domain, ex) print
print # these give wrong results domain = r'\[(.*?),(.*?)\]' indices = r'\[(.*?):(.*?)\]'
random_line_split
fdmgrid.py
#!/usr/bin/env python """interpret a comapct grid specification using regex""" import re # use a compact regular expression with nested OR expressions, # and hence many groups, but name the outer (main) groups: real_short1 = \ r'\s*(?P<lower>-?(\d+(\.\d*)?|\d*\.\d+)([eE][+\-]?\d+)?)\s*' real_short2 = \ r'\s*(?P<uppe...
print re.findall(indices, ex) print re.findall(domain, ex) print
conditional_block
detoursCache.py
import os import threading from cachetools import LRUCache from customUtilities.logger import logger class Cache(): def __init__(self,cachefilename,CACHE_SIZE,logger=logger('detoursCache.log')): self.lock = threading.RLock() self.cachefilename = cachefilename self.entry = LRUCache(maxsize=...
(self): self.lock.acquire(blocking=1) try: if os.path.exists(self.cachefilename): with open(self.cachefilename, 'r') as f: for line in f: if line == "": continue rline = line.strip...
load_from_disk
identifier_name
detoursCache.py
import os import threading from cachetools import LRUCache from customUtilities.logger import logger class Cache(): def __init__(self,cachefilename,CACHE_SIZE,logger=logger('detoursCache.log')): self.lock = threading.RLock() self.cachefilename = cachefilename self.entry = LRUCache(maxsize=...
def get(self,key): self.lock.acquire(blocking=1) try: return self.entry[key] except: return False finally: self.lock.release() def write_to_disk(self): self.lock.acquire(blocking=1) try: cachefile ...
self.lock.acquire(blocking=1) try: self.entry[key]=val except: return finally: self.lock.release()
identifier_body
detoursCache.py
import os import threading from cachetools import LRUCache from customUtilities.logger import logger class Cache(): def __init__(self,cachefilename,CACHE_SIZE,logger=logger('detoursCache.log')): self.lock = threading.RLock() self.cachefilename = cachefilename self.entry = LRUCache(maxsize=...
except: self.logger.error("Failed to read existing cache file") raise("Error in loading previous cache file") finally: self.lock.release()
continue
conditional_block
detoursCache.py
class Cache(): def __init__(self,cachefilename,CACHE_SIZE,logger=logger('detoursCache.log')): self.lock = threading.RLock() self.cachefilename = cachefilename self.entry = LRUCache(maxsize=CACHE_SIZE) self.logger=logger self.hitcount=0 def hit(self): self...
import os import threading from cachetools import LRUCache from customUtilities.logger import logger
random_line_split
ChangesList.tsx
/* * SonarQube * Copyright (C) 2009-2022 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, o...
({ changes }: Props) { const renderSeverity = (key: string) => { const severity = changes[key]; return severity ? <SeverityChange severity={severity} /> : null; }; return ( <ul> {Object.keys(changes).map(key => ( <li key={key}> {key === 'severity' ? ( renderSeverit...
ChangesList
identifier_name
ChangesList.tsx
/* * SonarQube * Copyright (C) 2009-2022 SonarSource SA
* This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be...
* mailto:info AT sonarsource DOT com *
random_line_split
ChangesList.tsx
/* * SonarQube * Copyright (C) 2009-2022 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, o...
{ const renderSeverity = (key: string) => { const severity = changes[key]; return severity ? <SeverityChange severity={severity} /> : null; }; return ( <ul> {Object.keys(changes).map(key => ( <li key={key}> {key === 'severity' ? ( renderSeverity(key) ) : ...
identifier_body
pwiz-setup.py
# # $Id: pwiz-setup.py 9964 2016-08-09 20:32:10Z chambm $ # # # Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu> # # Copyright 2012 Vanderbilt University - Nashville, TN 37232 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
wxsTemplate = open(templatePath + "/pwiz-setup.wxs.template").read() wxsTemplate = wxsTemplate.replace("__CONTEXTMENU_PROPERTIES__",contextMenuProperties()) wxsTemplate = wxsTemplate.replace("__CONTEXTMENU_REGISTRY__",contextMenuRegistries()) wxsTemplate = wxsTemplate.replace("__CONTEXTMENU_CHECKBOXEN__",contextMenuO...
componentText = ' \ <Component Feature="MainFeature">\n \ <Condition>INSTALL_MY_APPU_MENU</Condition>\n \ <RegistryValue Root="HKCR" Key="*\shell\__MY_APP__\command" Value="&quot;__MY_PATH__&quot; &quot;%1&quot;" Type="string"/>\n \ <RegistryKey Root="HKCR" Key="*\shell\__MY_APP__\command" />\n...
identifier_body
pwiz-setup.py
# # $Id: pwiz-setup.py 9964 2016-08-09 20:32:10Z chambm $ # # # Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu> # # Copyright 2012 Vanderbilt University - Nashville, TN 37232 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
for filepath in glob.glob(buildPath + "/*.wixObj"): os.remove(filepath) wxsFilepath = buildPath + "/pwiz-setup-" + version + installerSuffix + ".wxs" wxsFile = open(wxsFilepath, 'w') wxsFile.write(wxsTemplate)
os.remove(filepath)
conditional_block
pwiz-setup.py
# # $Id: pwiz-setup.py 9964 2016-08-09 20:32:10Z chambm $ # # # Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu> # # Copyright 2012 Vanderbilt University - Nashville, TN 37232 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
version = sys.argv[4] installerSuffix = "-x86" if sys.argv[5] == "64": installerSuffix = "-x86_64" # a unique ProductGuid every time allows multiple parallel installations of pwiz guid = str(uuid.uuid4()) # apps the user can add to the explorer rightclick menu if they want appNames = ["MSConvertGUI","SeeMS"] de...
random_line_split
pwiz-setup.py
# # $Id: pwiz-setup.py 9964 2016-08-09 20:32:10Z chambm $ # # # Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu> # # Copyright 2012 Vanderbilt University - Nashville, TN 37232 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the ...
() : txt = "" for n in appNames : txt = txt + '<Property Id="INSTALL%sMENU" Value="0" />\n '%n.upper() return txt def contextMenuOptions() : t = "" y = 100 for n in appNames : N = n.upper() t = t + '<Control Id="%sCheckBox" Type="CheckBox" X="20" Y="%d" Width="290" He...
contextMenuProperties
identifier_name
utils.js
define(function () { var exports = {}; /** * Hashes string with a guarantee that if you need to hash a new string * that contains already hashed string at it's start, you can pass only * added part of that string along with the hash of already computed part * and will get correctly hash as if you passe...
} // then add all missing from the `other` into `one` keys = Object.keys(other); for(i = 0, length = keys.length; i < length; ++i) { key = keys[i]; if(one[key] == null) { set[key] = other[key]; haveChanges = true; } } return haveChanges ? { set: set, removed:...
{ removed.push(key); haveChanges = true; }
conditional_block
utils.js
define(function () { var exports = {}; /** * Hashes string with a guarantee that if you need to hash a new string * that contains already hashed string at it's start, you can pass only * added part of that string along with the hash of already computed part * and will get correctly hash as if you passe...
* @return {Object} */ exports.shallowObjectDiff = function(one, other) { // since we will be calling setAttribute there is no need to // differentiate between changes and additions var set = {}, removed = [], haveChanges = false, keys = Object.keys(one), length, key, ...
/** * Calculates shallow difference between two object * @param {Object} one * @param {Object} other
random_line_split
enum-nullable-simplifycfg-misopt.rs
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT.
// option. This file may not be copied, modified, or distributed // except according to those terms. #![allow(unknown_features)] #![feature(box_syntax)] /*! * This is a regression test for a bug in LLVM, fixed in upstream r179587, * where the switch instructions generated for destructuring enums * represented with...
// // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
random_line_split
enum-nullable-simplifycfg-misopt.rs
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
<X> { Nil, Cons(X, Box<List<X>>) } pub fn main() { match List::Cons(10, box List::Nil) { List::Cons(10, _) => {} List::Nil => {} _ => panic!() } }
List
identifier_name
enum-nullable-simplifycfg-misopt.rs
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
{ match List::Cons(10, box List::Nil) { List::Cons(10, _) => {} List::Nil => {} _ => panic!() } }
identifier_body
literals.rs
// https://rustbyexample.com/cast/literals.html // http://rust-lang-ja.org/rust-by-example/cast/literals.html fn main() { // Suffixed literals, their types are known at initialization let x = 1u8; let y = 2u32; let z = 3f32; // Unsuffixed literal, their types depend on how they are used let i ...
println!("size of `i` in bytes: {}", std::mem::size_of_val(&i)); println!("size of `f` in bytes: {}", std::mem::size_of_val(&f)); }
random_line_split
literals.rs
// https://rustbyexample.com/cast/literals.html // http://rust-lang-ja.org/rust-by-example/cast/literals.html fn
() { // Suffixed literals, their types are known at initialization let x = 1u8; let y = 2u32; let z = 3f32; // Unsuffixed literal, their types depend on how they are used let i = 1; let f = 1.0; // `size_of_val` returns the size of a variable in bytes println!("size of `x` in bytes...
main
identifier_name
literals.rs
// https://rustbyexample.com/cast/literals.html // http://rust-lang-ja.org/rust-by-example/cast/literals.html fn main()
{ // Suffixed literals, their types are known at initialization let x = 1u8; let y = 2u32; let z = 3f32; // Unsuffixed literal, their types depend on how they are used let i = 1; let f = 1.0; // `size_of_val` returns the size of a variable in bytes println!("size of `x` in bytes: {...
identifier_body
networks.test.js
/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * Copyright (c) 2014, Joyent, Inc. */ var test = require('tape').test; var libuuid = require('libuuid');...
if (n.id === NETWORK2.uuid) { netFound = true; } }); t.ok(poolFound); t.ok(netFound); // This will likely be our default setup external network NET_UUID = body[0].id; return t.end(); }); }); test('get network', function (t) ...
{ poolFound = true; }
conditional_block
networks.test.js
/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * Copyright (c) 2014, Joyent, Inc. */ var test = require('tape').test; var libuuid = require('libuuid');...
function createTestPool(cb) { var params = { name: 'network_pool' + process.pid, networks: [ NETWORK1.uuid ] }; client.napi.createNetworkPool(params.name, params, function (err, res) { if (err) { return cb(err); } else { POOL = res; ret...
{ client.napi.deleteNetwork(net.uuid, { force: true }, cb); }
identifier_body
networks.test.js
/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * Copyright (c) 2014, Joyent, Inc. */ var test = require('tape').test; var libuuid = require('libuuid');...
function deleteNetwork1(_, next) { deleteTestNetwork(NETWORK1, next); }, function deleteNetwork2(_, next) { deleteTestNetwork(NETWORK2, next); }, function deleteTag(_, next) { deleteTestNicTag(next); } ] }, function (err) { ...
function deletePool(_, next) { deleteTestPool(next); },
random_line_split
networks.test.js
/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * Copyright (c) 2014, Joyent, Inc. */ var test = require('tape').test; var libuuid = require('libuuid');...
(cb) { var params = { name: 'network_pool' + process.pid, networks: [ NETWORK1.uuid ] }; client.napi.createNetworkPool(params.name, params, function (err, res) { if (err) { return cb(err); } else { POOL = res; return cb(null, res); ...
createTestPool
identifier_name
osm.py
"""Handles downloading and importing OSM Data""" import os import subprocess import tempfile import requests from celery.utils.log import get_task_logger from django.conf import settings from django.db import connection from datasources.models import OSMData, OSMDataProblem from datasources.tasks.shapefile import E...
def run_osm_import(osmdata_id): """Download and run import step for OSM data Downloads and stores raw OSM data within a bounding box defined by imported GTFS data. Uses the SRID defined on the gtfs_stops table to determine correct UTM projection to import data as. Uses Raw SQL to - get exten...
random_line_split
osm.py
"""Handles downloading and importing OSM Data""" import os import subprocess import tempfile import requests from celery.utils.log import get_task_logger from django.conf import settings from django.db import connection from datasources.models import OSMData, OSMDataProblem from datasources.tasks.shapefile import E...
"""Helper method to handle shapefile errors.""" error_factory.error(title, description) osm_data.status = OSMData.Statuses.ERROR osm_data.save() return with connection.cursor() as c: try: # Get the bounding box for gtfs data # split component...
"""Download and run import step for OSM data Downloads and stores raw OSM data within a bounding box defined by imported GTFS data. Uses the SRID defined on the gtfs_stops table to determine correct UTM projection to import data as. Uses Raw SQL to - get extent from GTFS data since we do...
identifier_body
osm.py
"""Handles downloading and importing OSM Data""" import os import subprocess import tempfile import requests from celery.utils.log import get_task_logger from django.conf import settings from django.db import connection from datasources.models import OSMData, OSMDataProblem from datasources.tasks.shapefile import E...
logger.debug('Finished downloading OSM data') osm_data.status = OSMData.Statuses.IMPORTING osm_data.save() except Exception as e: err_msg = 'Error downloading data' logger.exception('Error downloading data') handle_error(err_msg, e.message) # Get Database setti...
fh.write(chunk) fh.flush()
conditional_block
osm.py
"""Handles downloading and importing OSM Data""" import os import subprocess import tempfile import requests from celery.utils.log import get_task_logger from django.conf import settings from django.db import connection from datasources.models import OSMData, OSMDataProblem from datasources.tasks.shapefile import E...
(title, description): """Helper method to handle shapefile errors.""" error_factory.error(title, description) osm_data.status = OSMData.Statuses.ERROR osm_data.save() return with connection.cursor() as c: try: # Get the bounding box for gtfs data ...
handle_error
identifier_name
category.js
(ajaxify.currentPage !== data.url) { navigator.hide(); removeListeners(); } }); function removeListeners() { socket.removeListener('event:new_topic', Category.onNewTopic); categoryTools.removeListeners(); } Category.init = function() { var cid = ajaxify.variables.get('category_id'); app.enterRo...
scrollTop: (scrollTo.offset().top - $('#header-menu').height() - offset) + 'px' }, duration !== undefined ? duration : 400, function() { Category.highlightTopic(clickedIndex); navigator.update(); }); } }; function enableInfiniteLoadingOrPagination() { if (!config.usePagination) { infinitescr...
var scrollTo = components.get('category/topic', 'index', bookmarkIndex); var cid = ajaxify.variables.get('category_id'); if (scrollTo.length && cid) { $('html, body').animate({
random_line_split
category.js
(ajaxify.currentPage !== data.url) { navigator.hide(); removeListeners(); } }); function
() { socket.removeListener('event:new_topic', Category.onNewTopic); categoryTools.removeListeners(); } Category.init = function() { var cid = ajaxify.variables.get('category_id'); app.enterRoom('category_' + cid); share.addShareHandlers(ajaxify.variables.get('category_name')); socket.removeListener('e...
removeListeners
identifier_name
category.js
(ajaxify.currentPage !== data.url) { navigator.hide(); removeListeners(); } }); function removeListeners() { socket.removeListener('event:new_topic', Category.onNewTopic); categoryTools.removeListeners(); } Category.init = function() { var cid = ajaxify.variables.get('category_id'); app.enterRo...
} if (typeof callback === 'function') { callback(); } html.find('.timeago').timeago(); app.createUserTooltips(); utils.makeNumbersHumanReadable(html.find('.human-readable-number')); }); }); }; Category.loadMoreTopics = function(direction) { if (!$('[component="category"]').lengt...
{ container.append(html); }
conditional_block
category.js
(ajaxify.currentPage !== data.url) { navigator.hide(); removeListeners(); } }); function removeListeners() { socket.removeListener('event:new_topic', Category.onNewTopic); categoryTools.removeListeners(); } Category.init = function() { var cid = ajaxify.variables.get('category_id'); app.enterRo...
Category.toTop = function() { navigator.scrollTop(0); }; Category.toBottom = function() { socket.emit('categories.getTopicCount', ajaxify.variables.get('category_id'), function(err, count) { navigator.scrollBottom(count - 1); }); }; Category.navigatorCallback = function(topIndex, bottomIndex, elementC...
{ $('.watch, .ignore').on('click', function() { var $this = $(this); var command = $this.hasClass('watch') ? 'watch' : 'ignore'; socket.emit('categories.' + command, cid, function(err) { if (err) { return app.alertError(err.message); } $('.watch').toggleClass('hidden', command === 'watch')...
identifier_body
macro_import.rs
// Copyright 2012-2015 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...
} impl<'a> MacroLoader<'a> { fn load_macros<'b>(&mut self, vi: &ast::Item, import: Option<MacroSelection>, reexport: MacroSelection) { if let Some(sel) = import.as_ref() { if sel.is_empty() && reexport.is_empty() { ...
{ // bummer... can't see macro imports inside macros. // do nothing. }
identifier_body
macro_import.rs
// Copyright 2012-2015 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...
} if !self.span_whitelist.contains(&vi.span) { self.sess.span_err(vi.span, "an `extern crate` loading macros must be at \ the crate root"); return; } let macros = self.reader.read_exported_macros(vi); let mut see...
{ return; }
conditional_block
macro_import.rs
// Copyright 2012-2015 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...
(sess: &'a Session) -> MacroLoader<'a> { MacroLoader { sess: sess, span_whitelist: HashSet::new(), reader: CrateReader::new(sess), macros: vec![], } } } /// Read exported macros. pub fn read_macro_defs(sess: &Session, krate: &ast::Crate) -> Vec<ast::M...
new
identifier_name
macro_import.rs
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// 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 http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except accordin...
// file at the top-level directory of this distribution and at
random_line_split
binary_tree.rs
// Copyright (c) 2015 Takeru Ohta <phjgt308@gmail.com> // // This software is released under the MIT License, // see the LICENSE file at the top-level directory. extern crate dawg; use dawg::binary_tree::Builder; #[test] fn build()
#[test] fn search_common_prefix() { let trie = words() .iter() .fold(Builder::new(), |mut b, w| { b.insert(w.bytes()).ok().unwrap(); b }) .finish(); assert_eq!(0, trie.search_common_prefi...
{ let mut b = Builder::new(); for w in words().iter() { assert!(b.insert(w.bytes()).is_ok()); } assert_eq!(words().len(), b.finish().len()); }
identifier_body
binary_tree.rs
// Copyright (c) 2015 Takeru Ohta <phjgt308@gmail.com> // // This software is released under the MIT License, // see the LICENSE file at the top-level directory. extern crate dawg; use dawg::binary_tree::Builder;
let mut b = Builder::new(); for w in words().iter() { assert!(b.insert(w.bytes()).is_ok()); } assert_eq!(words().len(), b.finish().len()); } #[test] fn search_common_prefix() { let trie = words() .iter() .fold(Builder::new(), |mut b, w| { ...
#[test] fn build() {
random_line_split
binary_tree.rs
// Copyright (c) 2015 Takeru Ohta <phjgt308@gmail.com> // // This software is released under the MIT License, // see the LICENSE file at the top-level directory. extern crate dawg; use dawg::binary_tree::Builder; #[test] fn
() { let mut b = Builder::new(); for w in words().iter() { assert!(b.insert(w.bytes()).is_ok()); } assert_eq!(words().len(), b.finish().len()); } #[test] fn search_common_prefix() { let trie = words() .iter() .fold(Builder::new(), |mut b, w| { ...
build
identifier_name
test_kinesis.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
(self): hook = AwsFirehoseHook( aws_conn_id='aws_default', delivery_stream="test_airflow", region_name="us-east-1" ) self.assertIsNotNone(hook.get_conn()) @unittest.skipIf(mock_kinesis is None, 'mock_kinesis package not present') @mock_kinesis def test_insert_batch_recor...
test_get_conn_returns_a_boto3_connection
identifier_name
test_kinesis.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
class TestAwsFirehoseHook(unittest.TestCase): @unittest.skipIf(mock_kinesis is None, 'mock_kinesis package not present') @mock_kinesis def test_get_conn_returns_a_boto3_connection(self): hook = AwsFirehoseHook( aws_conn_id='aws_default', delivery_stream="test_airflow", region_name="us-...
try: from moto import mock_kinesis except ImportError: mock_kinesis = None
random_line_split
test_kinesis.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
@unittest.skipIf(mock_kinesis is None, 'mock_kinesis package not present') @mock_kinesis def test_insert_batch_records_kinesis_firehose(self): hook = AwsFirehoseHook( aws_conn_id='aws_default', delivery_stream="test_airflow", region_name="us-east-1" ) response = hook.g...
hook = AwsFirehoseHook( aws_conn_id='aws_default', delivery_stream="test_airflow", region_name="us-east-1" ) self.assertIsNotNone(hook.get_conn())
identifier_body
noco.py
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unified_strdate, compat_str, ) class
(InfoExtractor): _VALID_URL = r'http://(?:(?:www\.)?noco\.tv/emission/|player\.noco\.tv/\?idvideo=)(?P<id>\d+)' _TEST = { 'url': 'http://noco.tv/emission/11538/nolife/ami-ami-idol-hello-france/', 'md5': '0a993f0058ddbcd902630b2047ef710e', 'info_dict': { 'id': '11538', ...
NocoIE
identifier_name
noco.py
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unified_strdate, compat_str, ) class NocoIE(InfoExtractor): _VALID_URL = r'http://(?:(?:www\.)?noco\.tv/emission/|player\.noco\.tv/\?idvideo=)(?P<id>\d+)' ...
formats.append({ 'url': file_url, 'format_id': format_id, 'width': fmt['res_width'], 'height': fmt['res_lines'], 'abr': fmt['audiobitrate'], 'vbr': fmt['videobitrate'], 'filesize': fmt['filesize...
raise ExtractorError( '%s returned error: %s - %s' % ( self.IE_NAME, file['popmessage']['title'], file['popmessage']['message']), expected=True)
conditional_block
noco.py
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unified_strdate, compat_str, ) class NocoIE(InfoExtractor): _VALID_URL = r'http://(?:(?:www\.)?noco\.tv/emission/|player\.noco\.tv/\?idvideo=)(?P<id>\d+)' ...
raise ExtractorError( '%s returned error: %s - %s' % ( self.IE_NAME, file['popmessage']['title'], file['popmessage']['message']), expected=True) formats.append({ 'url': file_url, 'format_id': for...
mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') medias = self._download_json( 'https://api.noco.tv/1.0/video/medias/%s' % video_id, video_id, 'Downloading video JSON') formats = [] for fmt in medias['fr']['video_list']['default']['quality_list']: ...
identifier_body
noco.py
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, unified_strdate, compat_str, ) class NocoIE(InfoExtractor): _VALID_URL = r'http://(?:(?:www\.)?noco\.tv/emission/|player\.noco\.tv/\?idvideo=)(?P<id>\d+)' ...
expected=True) formats.append({ 'url': file_url, 'format_id': format_id, 'width': fmt['res_width'], 'height': fmt['res_lines'], 'abr': fmt['audiobitrate'], 'vbr': fmt['videobitrate'], ...
raise ExtractorError( '%s returned error: %s - %s' % ( self.IE_NAME, file['popmessage']['title'], file['popmessage']['message']),
random_line_split
_configuration.py
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential self.api_version = "2018-06-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk...
super(SubscriptionClientConfiguration, self).__init__(**kwargs)
random_line_split
_configuration.py
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
conditional_block
_configuration.py
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-resource/{}'.format(VERSION)) self._configure(**kwargs) def _configure( self, **kwargs: Any ) -> None: self.user_agent_polic...
"""Configuration for SubscriptionClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential """ def __init__( ...
identifier_body
_configuration.py
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
( self, **kwargs: Any ) -> None: self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.Pr...
_configure
identifier_name
Parameters.tsx
import React from 'react'; import { FormikProps } from 'formik'; import { HelpField } from 'core/help'; import { IParameter, IPipelineCommand } from 'core/domain'; import { FormikFormField, ReactSelectInput, TextInput, DayPickerInput } from 'core/presentation'; export interface IParametersProps { formik: FormikProp...
const { parameters } = this.props; const hasRequiredParameters = parameters.some(p => p.required); const visibleParameters = parameters.filter(p => !p.conditional || this.shouldInclude(p)); /* We need to use bracket notation because parameter names are strings that can have all sorts of characters */ ...
}; public render() {
random_line_split
event.js
var should = require('should'); var helper = require('../support/spec_helper'); var ORM = require('../../'); describe("Event", function() { var db = null; var Person = null; var triggeredHooks = {};
return function () { triggeredHooks[hook] = Date.now(); }; }; var setup = function (hooks) { return function (done) { Person = db.define("person", { name : { type: "text", required: true } }); return helper.dropSync(Person, done); }; }; before(function (done) { helper.connect(functio...
var checkHook = function (hook) { triggeredHooks[hook] = false;
random_line_split
bundle.js
'use strict'; const { readFileSync, readdirSync, writeFileSync } = require('fs'); // Get all markdown stubs const header = readFileSync('bundler/header.md', 'utf-8'); const badges = readFileSync('bundler/badges.md', 'utf-8'); const installation = readFileSync('bundler/installation.md', 'utf-8'); const api = readFileS...
const license = readFileSync('bundler/license.md', 'utf-8'); // Get all API docs const methods = readdirSync('docs/api', 'utf-8'); // Build table of contents const tableOfContents = methods.map((file) => { const methodName = file.replace('.md', ''); return `- [${methodName}](#${methodName.toLowerCase()})`; }).jo...
random_line_split
line_plot.py
# # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Jockey 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, or (at your option) any # later version. # # Jockey is distr...
else: return pychart_util.get_data_range(self.data, self.ycol) def get_legend_entry(self): if self.label: line_style = self.line_style if not line_style and self.error_bar: line_style = getattr(self.error_bar, 'line_style', None) or \ ...
return pychart_util.get_data_range(self.data, self.xcol)
conditional_block
line_plot.py
# # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Jockey 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, or (at your option) any # later version. # # Jockey is distr...
"""The format string for the label printed beside a sample point. It can be a `printf' style format string, or a two-parameter function that takes the (x, y) values and returns a string. "...
'data_label_offset': (CoordType, (0, 5), """The location of data labels relative to the sample point. Meaningful only when data_label_format != None."""), 'data_label_format': (FormatType, None,
random_line_split
line_plot.py
# # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Jockey 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, or (at your option) any # later version. # # Jockey is distr...
(self, ar, can): # Draw the line clipbox = theme.adjust_bounding_box([ar.loc[0], ar.loc[1], ar.loc[0] + ar.size[0], ar.loc[1] + ar.size[1]]); can.clip(clipbox[0],clipbox[1],clipbox[2],clipbox[3])...
draw
identifier_name
line_plot.py
# # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Jockey 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, or (at your option) any # later version. # # Jockey is distr...
##AUTOMATICALLY GENERATED ##END AUTOMATICALLY GENERATED def get_data_range(self, which): if which == 'X': return pychart_util.get_data_range(self.data, self.xcol) else: return pychart_util.get_data_range(self.data, self.ycol) def get_legend_entry(self): ...
assert chart_object.T.check_integrity(self)
identifier_body
createvm_vlan_v1s2.py
# Copyright 2017 IBM Corp. from zvmconnector import connector import os import time print("Setup client: client=connector.ZVMConnector('9.60.18.170', 8080)\n") client=connector.ZVMConnector('9.60.18.170', 8080) print("Test: send_request('vswitch_get_list')") list = client.send_request('vswitch_get_list') print("Resu...
print("Grant user: send_request('vswitch_grant_user', '%s', '%s')" % (VSWITCH_NAME, GUEST_USERID)) info = client.send_request('vswitch_grant_user', VSWITCH_NAME, GUEST_USERID) print('Result: %s\n' % info) print("Check power state: send_request('guest_get_power_state', '%s')" % GUEST_USERID) info = client.send_reques...
print('Result: %s\n' % info)
random_line_split
cheatsheet.py
#!/usr/bin/env python from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtXml import * import sys, os from ui_cheatsheet import Ui_CSDialog class CSWindow ( QDialog , Ui_CSDialog):
self.ui.themeChooser.addItem(os.path.basename(filename)) if sys.version_info < (3, 0): if self.ui.themeChooser.findText(self.settings.value('theme').toString()) != -1: self.ui.themeChooser.setCurrentIndex(self.ui.themeChooser.findText(self.settings.value('theme').toSt...
settings = QSettings('Mte90','LearnHotkeys') settings.setFallbacksEnabled(False) theme_path = "./style" theme_folder = theme_path+'/' hotkeys_path = "./hotkeys" hotkeys_folder = hotkeys_path+'/' html_cs = "" html_style = "<html>\n<head>\n<style>\n%s\n</style>\n</head>\n<body>\n" html_the...
identifier_body
cheatsheet.py
#!/usr/bin/env python from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtXml import * import sys, os from ui_cheatsheet import Ui_CSDialog class CSWindow ( QDialog , Ui_CSDialog): settings = QSettings('Mte90','LearnHotkeys') settings.setFallbacksEnabled(False) theme_path = "./style" the...
self.ui.saveButton.clicked.connect(self.saveHTML) self.ui.closeButton.clicked.connect(self.accept) for root, dirs, files in os.walk(self.theme_path): files.sort() for name in files: filename = os.path.join(root, name) self.ui.themeChooser.a...
QDialog.__init__( self, parent, Qt.CustomizeWindowHint ) self.ui = Ui_CSDialog() self.ui.setupUi( self )
random_line_split
cheatsheet.py
#!/usr/bin/env python from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtXml import * import sys, os from ui_cheatsheet import Ui_CSDialog class CSWindow ( QDialog , Ui_CSDialog): settings = QSettings('Mte90','LearnHotkeys') settings.setFallbacksEnabled(False) theme_path = "./style" the...
(self): if sys.version_info < (3, 0): filename = QFileDialog.getSaveFileName(self, 'Save HTML CheatSheet', self.settings.value('file_name_default').toString()[:-4]+'.html') fname = open(filename, 'w') html = (self.html_style% self.get_file_content(self.theme_folder+self.sett...
saveHTML
identifier_name
cheatsheet.py
#!/usr/bin/env python from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtXml import * import sys, os from ui_cheatsheet import Ui_CSDialog class CSWindow ( QDialog , Ui_CSDialog): settings = QSettings('Mte90','LearnHotkeys') settings.setFallbacksEnabled(False) theme_path = "./style" the...
fname.write(html.toUtf8()+"\n") fname.close() def get_file_content(self,file): f = open(file, 'r') c = f.read() f.close() return c def saveConfig(self): self.settings.setValue("theme", self.ui.themeChooser.currentText()) if sys.version_info < (3...
filename = QFileDialog.getSaveFileName(self, 'Save HTML CheatSheet', self.settings.value('file_name_default')[:-4]+'.html') fname = open(filename, 'w') html = (self.html_style% self.get_file_content(self.theme_folder+self.settings.value('theme')))+self.html_def+self.html_thead+self.html_cs
conditional_block
edit-acc-type.service.ts
import { Injectable } from '@angular/core'; import { AccommodationType } from '../accommodation-type/accommodation-type.model'; import { Http, Response, Headers, RequestOptions } from '@angular/http'; import { Observable } from 'rxjs/Observable'; import { ConfigurationManager } from '../services/configuration-manager.s...
(accType: AccommodationType){ let token=localStorage.getItem("token"); let header = new Headers(); header.append('Content-Type', 'application/json'); header.append('Authorization', 'Bearer '+ JSON.parse(token).token); let options = new RequestOptions(); options.headers =...
edit
identifier_name
edit-acc-type.service.ts
import { Injectable } from '@angular/core'; import { AccommodationType } from '../accommodation-type/accommodation-type.model'; import { Http, Response, Headers, RequestOptions } from '@angular/http'; import { Observable } from 'rxjs/Observable'; import { ConfigurationManager } from '../services/configuration-manager.s...
}
{ }
identifier_body
edit-acc-type.service.ts
import { Injectable } from '@angular/core'; import { AccommodationType } from '../accommodation-type/accommodation-type.model'; import { Http, Response, Headers, RequestOptions } from '@angular/http'; import { Observable } from 'rxjs/Observable'; import { ConfigurationManager } from '../services/configuration-manager.s...
update() { } }
}
random_line_split
euclidext.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use euclid::default::{Rect, Size2D}; pub trait Size2DExt { fn to_u64(&self) -> Size2D<u64>; } impl Size2DEx...
} impl Size2DExt for Size2D<f64> { fn to_u64(&self) -> Size2D<u64> { self.cast() } } impl Size2DExt for Size2D<u32> { fn to_u64(&self) -> Size2D<u64> { self.cast() } } pub trait RectExt { fn to_u64(&self) -> Rect<u64>; } impl RectExt for Rect<f64> { fn to_u64(&self) -> Rect<...
{ self.cast() }
identifier_body
euclidext.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
impl Size2DExt for Size2D<f32> { fn to_u64(&self) -> Size2D<u64> { self.cast() } } impl Size2DExt for Size2D<f64> { fn to_u64(&self) -> Size2D<u64> { self.cast() } } impl Size2DExt for Size2D<u32> { fn to_u64(&self) -> Size2D<u64> { self.cast() } } pub trait RectExt {...
use euclid::default::{Rect, Size2D}; pub trait Size2DExt { fn to_u64(&self) -> Size2D<u64>; }
random_line_split
euclidext.rs
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use euclid::default::{Rect, Size2D}; pub trait Size2DExt { fn to_u64(&self) -> Size2D<u64>; } impl Size2DEx...
(&self) -> Size2D<u64> { self.cast() } } impl Size2DExt for Size2D<u32> { fn to_u64(&self) -> Size2D<u64> { self.cast() } } pub trait RectExt { fn to_u64(&self) -> Rect<u64>; } impl RectExt for Rect<f64> { fn to_u64(&self) -> Rect<u64> { self.cast() } } impl RectExt f...
to_u64
identifier_name
onboaring.js
function formatDomain(item){ if (item.id!=''){ console.log('fs '); console.log(item); var img= '<img class="flag" src="/static/img/domain_img/'+item.id.toLowerCase()+'Small.png"/>' return img+item.id; } } ...
(){ console.log('func called'); } function generateComponentContainerDiv(divClassName, labelText, listClassName, containerClassName, policyClassName){ var subClassRow= $('<div class="row mwareapps" style="margin-top: 10px; background: rgba(12,45,66,0.5);"></div>'); v...
showPolicyConstraints
identifier_name
onboaring.js
function formatDomain(item){ if (item.id!=''){ console.log('fs '); console.log(item); var img= '<img class="flag" src="/static/img/domain_img/'+item.id.toLowerCase()+'Small.png"/>' return img+item.id; } } ...
function generateComponentContainerDiv(divClassName, labelText, listClassName, containerClassName, policyClassName){ var subClassRow= $('<div class="row mwareapps" style="margin-top: 10px; background: rgba(12,45,66,0.5);"></div>'); var subClassLabel= $('<div class="col-md-2"><h3> <span...
{ console.log('func called'); }
identifier_body
onboaring.js
function formatDomain(item){ if (item.id!=''){ console.log('fs '); console.log(item); var img= '<img class="flag" src="/static/img/domain_img/'+item.id.toLowerCase()+'Small.png"/>' return img+item.id; } } $("#domain...
});
random_line_split
mallocstacks.py
#!/usr/bin/python # # mallocstacks Trace malloc() calls in a process and print the full # stack trace for all callsites. # For Linux, uses BCC, eBPF. Embedded C. # # This script is a basic example of the new Linux 4.6+ BPF_STACK_TRACE # table API. # # Copyright 2016 GitHub, Inc. # Licensed ...
printb(b"\t%s" % b.sym(addr, pid, show_offset=True))
conditional_block
mallocstacks.py
#!/usr/bin/python # # mallocstacks Trace malloc() calls in a process and print the full # stack trace for all callsites. # For Linux, uses BCC, eBPF. Embedded C. # # This script is a basic example of the new Linux 4.6+ BPF_STACK_TRACE # table API. #
# Licensed under the Apache License, Version 2.0 (the "License") from __future__ import print_function from bcc import BPF from bcc.utils import printb from time import sleep import sys if len(sys.argv) < 2: print("USAGE: mallocstacks PID [NUM_STACKS=1024]") exit() pid = int(sys.argv[1]) if len(sys.argv) == 3...
# Copyright 2016 GitHub, Inc.
random_line_split
index.js
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _index = _interopRequireDefault(require("../../../_lib/buildFormatLongFn/index.js")); function _interopRequireDefault(obj)
var dateFormats = { full: "EEEE, d 'de' MMMM 'de' y", long: "d 'de' MMMM 'de' y", medium: "d 'de' MMM 'de' y", short: 'dd/MM/y' }; var timeFormats = { full: 'HH:mm:ss zzzz', long: 'HH:mm:ss z', medium: 'HH:mm:ss', short: 'HH:mm' }; var dateTimeFormats = { full: "{{date}} 'às' {{time}}", long: "{{d...
{ return obj && obj.__esModule ? obj : { default: obj }; }
identifier_body
index.js
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _index = _interopRequireDefault(require("../../../_lib/buildFormatLongFn/index.js")); function
(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var dateFormats = { full: "EEEE, d 'de' MMMM 'de' y", long: "d 'de' MMMM 'de' y", medium: "d 'de' MMM 'de' y", short: 'dd/MM/y' }; var timeFormats = { full: 'HH:mm:ss zzzz', long: 'HH:mm:ss z', medium: 'HH:mm:ss', short: 'HH:mm' }; var da...
_interopRequireDefault
identifier_name
index.js
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _index = _interopRequireDefault(require("../../../_lib/buildFormatLongFn/index.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
short: 'dd/MM/y' }; var timeFormats = { full: 'HH:mm:ss zzzz', long: 'HH:mm:ss z', medium: 'HH:mm:ss', short: 'HH:mm' }; var dateTimeFormats = { full: "{{date}} 'às' {{time}}", long: "{{date}} 'às' {{time}}", medium: '{{date}}, {{time}}', short: '{{date}}, {{time}}' }; var formatLong = { date: (0, _...
var dateFormats = { full: "EEEE, d 'de' MMMM 'de' y", long: "d 'de' MMMM 'de' y", medium: "d 'de' MMM 'de' y",
random_line_split
lrslayer.py
# -*- coding: utf-8 -*- """ /*************************************************************************** LrsPlugin A QGIS plugin Linear reference system builder and editor ------------------- begin : 2017-5-29 copyright ...
for route in self.routes.values(): route.checkPartOverlaps() # get route by id, create it if does not exist # routeId does not have to be normalized def getRoute(self, routeId): normalId = normalizeRouteId(routeId) # debug ( 'normalId = %s orig type = %s' % (normalId, t...
rogressFunction(percent)
conditional_block