text
string
label_name
string
labels
int64
# Copyright 2019-2020 the ProGraML authors. # # Contact Chris Cummins <chrisc.101@gmail.com>. # # 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...
Python
1
glMatrixMode(GL_PROJECTION) glPushMatrix() glLoadIdentity() gluOrtho2D(0, self.width, 0, self.height) glMatrixMode(GL_MODELVIEW) glPushMatrix() glLoadIdentity() glRasterPos2d(self.width - width - 10, self.height - 50) glDrawPixels(width, height, GL_RGBA...
Python
1
import streamlit as st import requests import json from components.chat import chatbox, reset_chat_state, history_list from components.api import converse, authenticate, load_conversation, delete, get_vendors from components.account import login_dialog, logout, account_buttons from components.privacy import configure_p...
Python
1
#!/usr/bin/env python import os import time import logging from inotify_simple import INotify, flags logger = logging.getLogger('mynotify') hdlr = logging.FileHandler('/tmp/mynotify.log') formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formatter) logger.addHandler(hdlr) logger....
Python
1
, VT1, VTDLY, }; #[cfg(any( target_os = "android", target_os = "illumos", target_os = "linux", target_os = "solaris" ))] #[pyattr] use termios::os::target::{CBAUD, CIBAUD, IUCLC, OLCUC, XCASE}; #[cfg(any( target_os = "android", target_os = "freebsd...
Rust
0
: 1:5, base_shr_12: 12:31 }); pub struct SysControl { r1_control: RegControl::Bf, r1_auxctrl: u32, r2_dcacheability: u32, r2_icacheability: u32, r3_bufferability: u32, r3_domain_access: u32, r5_daccessperms: u32, r5_iaccessperms: u32, r6_memregions: [MpuRegion::Bf; 8], r9_dc...
Rust
0
(|output| output.buffer_infos) .unwrap_or_else(Vec::new); self.create_streams(input_buffer_infos, output_buffer_infos, buffer_size) } /// Prepare the output stream. /// /// Because only the latest call to ASIOCreateBuffers is relevant this call will destroy all /// past active b...
Rust
0
, PartialOrd, Ord, Hash)] pub enum Level { ERROR, WARNING, INFO, ECHO, ASK } #[inline] fn color(lvl: Level) -> u8 { match lvl { ERROR => 31, WARNING => 33, INFO => 34, ECHO => 32, ASK => 37 } } #[inline] fn label(lv...
Rust
0
oard = BingoBoard::default(); let board_idx = bingo_boards.len(); for (line, data) in line_chunk.enumerate() { if line > 0 { for (col, int_str) in data .split_whitespace() .map(|val| { val.parse::<usize>...
Rust
0
duration_start_is_provided() { let members = vec!["member1", "member2"]; let mut suite = SuiteBuilder::new() .with_engagement(&members_init(&members, &[2, 3, 5, 8, 10])) .with_operators(&members) .build(); let admin = suite.admin().to_owned(); fn jail_start(val: StdResult<Valida...
Rust
0
rixNeon","Binary","Binary") configBinaryf64=Tools.Config(PATTERNBINDIR,PARAMBINDIR,"f64") configBinaryf32=Tools.Config(PATTERNBINDIR,PARAMBINDIR,"f32") configBinaryf16=Tools.Config(PATTERNBINDIR,PARAMBINDIR,"f16") configBinaryq31=Tools.Config(PATTERNBINDIR,PARAMBINDIR,"q31") configBinaryq15=Too...
Python
1
1.0/3.0, -1.0, 1.0] /// ,' | ,20 | 10 [ 1.0, -1.0/3.0, -1.0] 18 [ 1.0, -1.0/3.0, 1.0] /// 5-----18----19---6' 30 11 [ 1.0, 1.0/3.0, -1.0] 19 [ 1.0, 1.0/3.0, 1.0] /// | 24 | | 12 [ 1.0/3.0, 1.0, -1.0] 20 [ 1.0/3.0, 1.0, 1.0] /// ...
Rust
0
>> 10) & 0x01) != 0) } #[doc = "Bit 11 - The interrupt enable bit for high speed channel 3 duty change done interrupt."] #[inline(always)] pub fn duty_chng_end_hsch3_int_ena(&self) -> DUTY_CHNG_END_HSCH3_INT_ENA_R { DUTY_CHNG_END_HSCH3_INT_ENA_R::new(((self.bits >> 11) & 0x01) != 0) } #...
Rust
0
json.as_ref())?) } pub fn builder() -> RTDLogOutBuilder { let mut inner = LogOut::default(); inner.td_name = "logOut".to_string(); RTDLogOutBuilder { inner } } } #[doc(hidden)] pub struct RTDLogOutBuilder { inner: LogOut } impl RTDLogOutBuilder { pub fn build(&self) -> LogOut { self.inner.clone()...
Rust
0
from generated.formats.ovl_base.compounds.MemStruct import MemStruct from generated.formats.trackstation.imports import name_type_map class CornerEdgeTrack(MemStruct): """ PC: 320 bytes PC2: 320 bytes unused on PZ """ __name__ = 'CornerEdgeTrack' def __init__(self, context, arg=0, template=None, set_defau...
Python
1
# training_pipeline.py import numpy as np import pandas as pd from typing import Dict, Any import sys import os # Solution: Add the project root to Python path # Get the directory containing this script current_dir = os.path.dirname(os.path.abspath(__file__)) # Find the project root by looking for the 'src' directory...
Python
1
` instances //! from the input. //! //! Most CBOR items are fully contained in their headers and therefore have no //! body. These items can be evaluated directly from the `Header` instance. //! //! Bytes and text items have a body but do not contain child items. Since //! both bytes and text values may be segmented, p...
Rust
0
# Name : CRC-16 # Poly : b'\x8005 x^16 + x^15 + x^2 + 1 # Init : b'\xFFFF # Revert: true # XorOut: b'\x0000 # Check : b'\x4B37 ("123456789") # MaxLen: 4095 byte (32767 bit) - detect single, double, triple and all odd errors Crc16Table_2 = [ 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC24...
Python
1
ch_obj.iter() { if operator=="or" { res = false; } // if operator is or we start at false let search_object = search_object_json.as_object().unwrap(); for (field, search_object_json_1) in search_object.iter() { let search_object2 = search_object_json_1.as_object().unwrap(); ...
Rust
0
allow(non_snake_case)] use crate::{Error, Result}; use std::{io, slice, str}; pub(crate) type void = ::std::os::raw::c_void; pub(crate) type __wasi_advice_t = u8; pub(crate) const __WASI_ADVICE_NORMAL: __wasi_advice_t = 0; pub(crate) const __WASI_ADVICE_SEQUENTIAL: __wasi_advice_t = 1; pub(crate) const __WASI_ADVICE_...
Rust
0
= match bind.result_format { BindFormat::All(format) => format, BindFormat::PerColumn(_) => { return Err(ErrorResponse::error( SqlState::FEATURE_NOT_SUPPORTED, "per-column format codes not supported", ) .into()); } }; let prepared = self.prepa...
Rust
0
None => Grid::new_internal(Vec::new()), }; self.post(self.nav_url(), &req_grid).await } /// Returns a grid containing the operations available on the server. pub async fn ops(&mut self) -> Result<Grid> { self.get(self.ops_url()).await } /// Returns a grid containing t...
Rust
0
f'|'A'..='F'|'_']+) { Node::parse_u64(n, 16) } } / quiet!{ "0o" n:$(['0'..='7'|'_']+) { Node::parse_u64(n, 8) } } / quiet!{ "0b" n:$(['0'..='1'|'_']+) { Node::parse_u64(n, 2) } } / quiet!{ "0d"? n:$(['0'..='9'|'_']+) { Node::parse_u64(n, 10) } } / expected!("integer") rule escape() -> u...
Rust
0
m to tell you whether //! or not the color you put into the function is equal to the color you're gettting. In case you don't, the //! `pixel` function is an easy way to get the result out. //! </div> //! //! Note that this way is somewhat slower than the Easy Way above. It sends a request to the server which, no //! m...
Rust
0
("PAIRing ATE - {:} iterations ",iterations); println!(" {:0.2} ms per iteration",duration); let start = Instant::now(); let mut iterations=0; let mut dur=0 as u64; while dur<(MIN_TIME as u64)*1000 || iterations<MIN_ITERS { g=pair::fexp(&w); iterations+=1; let elapsed=start.elapsed(); dur=(elap...
Rust
0
ass_method_sig)); let descriptor = self.java.descriptor(); let method_name = if let Some(renamed_to) = renamed_to { renamed_to.clone() } else if let Some(name) = self.rust_name() { name.to_owned() } else { emit_reject_reasons.push("ERROR: Failed to ...
Rust
0
import logging, os logging.disable(logging.WARNING) import warnings warnings.simplefilter(action='ignore', category=FutureWarning) warnings.simplefilter(action='ignore', category=Warning) import numpy as np import pandas as pd import pickle import json import random import cornac from cornac.eval_methods import Bas...
Python
1
is pretty complex too. There are a lot of ways you can implement it. `svgdom` creates a custom Rc-tree where all the attributes are stored as owned data. This requires a lot of allocations (usually unnecessary). The parsing/preprocessing algorithm itself can be found in [docs/preprocessor.md](docs/preprocess...
Rust
0
""" logging.py : Interface to cpp-level logging * (c) Copyright 2017-2024 Sampsa Riikonen * * Authors: Sampsa Riikonen <sampsa.riikonen@iki.fi> * * This file is part of the Valkka library. * * Valkka is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Publi...
Python
1
match run(std::env::args_os()) { Ok(_) => {} Err(CliError::ClapError(err)) => err.exit(), Err(e) => { error!("ERROR: {}", e); std::process::exit(1); } } } <filename>crates/core/c8y_smartrest/src/event.rs use thin_edge_json::event::ThinEdgeEvent; use time:...
Rust
0
from pathlib import Path import polars as pl ROOT = Path(__file__).parent.absolute() BI_DATA_DIR = ROOT / "data" / "ldbc-sn-bi-sf1" NODES = BI_DATA_DIR / "nodes" RELATIONSHIPS = BI_DATA_DIR / "relationships" GROUP_ALTER_TABLE = { "University": "Organisation", "Company": "Organisation", } def deal_with_rel...
Python
1
lt, conf, flag) else: log.error("current seed need to analysis,without dialects and lowerPass") log.info("================== Enable optimization ====================") flag = "opt" opt_pass= setOptSeqR() result = execute_mlir(seed_file, opt_fi...
Python
1
Loss, self).__init__() pass def forward( self, preds, x, labels=None, augment=None, t=1 ): # in patch diffusion y is confusingly the clean image, n is noise and y is label """ from PatchDiffusion - simplified In patch diff they have the option for these cool geometric a...
Python
1
ephemeral) let temp = HMAC!(state.chaining_key, unencrypted_ephemeral.as_bytes()); // responder.chaining_key = HMAC(temp, 0x1) let mut chaining_key = HMAC!(temp, [0x01]); // temp = HMAC(responder.chaining_key, DH(responder.ephemeral_private, initiator.ephemeral_public)) let ephem...
Rust
0
"""The tests for recorder platform.""" from __future__ import annotations from datetime import timedelta from homeassistant.components.input_select import ATTR_OPTIONS, DOMAIN from homeassistant.components.recorder import Recorder from homeassistant.components.recorder.history import get_significant_states from homea...
Python
1
ions(db: &Database, company: &Company) -> Result<()> { let mut path = env::current_dir()?; path.push("bill.com.csv"); if !path.exists() { // Return early the path does not exist. info!( "bill.com csv at {} does not exist, returning early", path.to_str().unwrap() ...
Rust
0
let elapsed = Duration::from_nanos(summary.mean as u64); // We expect the `mean` time for loading the test Wasm module and running its main function // to be less than a fixed threshold. assert!( elapsed < Duration::from_millis(elapsed_limit_millis), "elapsed time: {:.0?}...
Rust
0
ConstantValue { assert_eq!(self.value.ndim(),1); assert!(start < stop); let mylen = self.value.len(); let len = stop - start + 1; let mut ret = ConstantValue::one_dim(len as usize); for ndx in start..(stop+1) { ret.value[(len - 1 - (ndx - start)) as usize] = s...
Rust
0
::{Message, Result}; // TODO: this function can not mutate the data vector it is given, and // thus copies its contents when using the fallback parsing strategy. // Ideally fallback parsing could create a slice between the length // and a vector without needing to move any data. pub(crate) fn message<M: Message>(vec: ...
Rust
0
import unittest from TestUtils import TestLexer class LexerSuite(unittest.TestCase): def test_simple_string(self): """test simple string""" self.assertTrue(TestLexer.test("'Yanxi Palace - 2018'","'Yanxi Palace - 2018',<EOF>",101)) def test_complex_string(self): """test complex s...
Python
1
color.stroke_width(3), ))? .label(label) .legend(move |(x, y)| Rectangle::new([(x, y - 5), (x + 10, y + 5)], color.filled())); } chart.configure_series_labels().border_style(BLACK).draw()?; root.present()?; drop(chart); drop(root); Ok(()) } pub fn render...
Rust
0
> low::Sort { match typ { high::Type::Int => low::Sort::Int, high::Type::Bool => low::Sort::Bool, high::Type::Real => low::Sort::Real, high::Type::Domain(high::DomainType { name }) => low::Sort::Uninterpreted { name: context.lower_domain_name(name), }, } } // ...
Rust
0
ult(), buffer, &mut None)?; let _ = pool.execute(buffer.as_ref()).await.map_err(Into::into)?; Ok(()) } /// Gets all stored entities. #[inline] pub async fn read_all<B>( &self, buffer: &mut B, pool: &PgPool, ) -> Result<Vec<TdEntity<'entity, TD>>, TdError<'entity, TD>> where B: cl_tr...
Rust
0
import os from _pydev_bundle import pydev_log from _pydevd_bundle.pydevd_trace_dispatch import USING_CYTHON from _pydevd_bundle.pydevd_constants import ( USE_CYTHON_FLAG, ENV_FALSE_LOWER_VALUES, ENV_TRUE_LOWER_VALUES, IS_PY36_OR_GREATER, IS_PY38_OR_GREATER, SUPPORT_GEVENT, IS_PYTHON_STACKLE...
Python
1
32_STR: &str = "u32"; const PARAM_KIND_LIST_STR: &str = "list"; const PARAM_KIND_NONE_STR: &str = "none"; impl std::fmt::Display for ParameterKind { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { let name = match self { ParameterKind::Text => PARAM_KIND_TEXT_STR, ...
Rust
0
::Result { f.debug_struct(&format!("GUdevDeviceClass @ {:p}", self)) .field("parent_class", &self.parent_class) .field("reserved1", &self.reserved1) .field("reserved2", &self.reserved2) .field("reserved3", &self.reserved3) .field("reserved4", &self.reserved4) ...
Rust
0
from torch.nn.modules.module import Module from torch.nn.functional import avg_pool2d, max_pool2d from ..functions.roi_align import RoIAlignFunction class RoIAlign(Module): def __init__(self, aligned_height, aligned_width, spatial_scale): super(RoIAlign, self).__init__() self.aligned_width = int(...
Python
1
ect::Script { name: b"call", body: b"{ return add(3, 5) + 8 }" }); let (code, _) = gml::build(&game, &items, io::stderr).unwrap_or_else(|_| panic!()); let assets = Assets { code }; let world = World::default(); let mut thread = vm::Thread::default(); let mut cx = Context { world, asset...
Rust
0
import requests import optparse import sys import time requests.packages.urllib3.disable_warnings() # Usage python s2-057.py -u http://localhost:8080 -t /struts3-showcase/ -c calc # This script is created for detection and POCing the vulnerability. # psc4re's script to check for s2-057, CVE-2018-11776 based on payload...
Python
1
env.NODE_MONITOR_PERIOD_SECONDS, node_config, *args) start_monitor(node_monitor) def start_chainlink_contracts_monitor( weiwatchers_url: str, evm_nodes: List[str], node_configs: List[ChainlinkNodeConfig], sub_chain: str, parent_id: str) -> None: ...
Python
1
-hls_enc_iv {enc_iv:s}" enc_key_seed = '0123456789abcdef' enc_key = ''.join([random.choice(enc_key_seed) for _ in range(32)]) enc_iv = ''.join([random.choice(enc_key_seed) for _ in range(32)]) return encrypt_opts.format(enc_key=enc_key, enc_iv=enc_iv) def _get_bpf(fps: int, br: int) -> float: """ ...
Python
1
import cocotb from cocotb.triggers import Timer, RisingEdge from cocotblib.misc import randSignal, assertEquals, truncUInt, ClockDomainAsyncReset @cocotb.test() def test1(dut): dut.log.info("Cocotb test boot") #random.seed(0) dut.address <= 0 yield Timer(10) assertEquals(dut.data_bool,0,"1") ...
Python
1
println!("\t dpg"); not_impremented(system) } // instructions: E // instructions: F // instructions: G // instructions: H pub fn hint_32(bytecode32: u32, system: &mut M0System) -> u32 { // Ref:DDI0403D_arm_architecture_v7m_reference_manual.pdf p.170 not_impremented(system) } // instructions: I pub f...
Rust
0
1\x11\x8b\xf7\xc5\xab\x5f\xad\x41\x89\xb2\x44\x6f\x5f\x65\x29\x48\xd6\xa9\xc5\x5f\x07\x2c\x9a\x4d\x6f\xec\x28\x79\x8f\x3f\x57\x50\xfd\xf0\x7e\xd9\x4d\x22\xe8\x6a\x32\xa8\x52\x4c\x92\x43\x6a\xab\x19\x84\x5d\x2d\x69", b"\xbf\xac\x71\x56\x07\xa6\xf6\xb9\x9b\xfa\x62\x71\x59\x56\xd6\xe1\x9c\xbe\x3a\x21\x90\x43\xb3\xa3\x...
Rust
0
ossl110))] pub fn SSL_set_tmp_ecdh_callback( ssl: *mut SSL, ecdh: unsafe extern "C" fn( ssl: *mut SSL, is_export: c_int, keylength: c_int, ) -> *mut EC_KEY, ); #[deprecated(note = "use SSL_CTX_callback_ctrl__fixed_rust instead")] pub fn SSL_CT...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Bizmeka 고급 로그인 솔루션 - 패스워드 잠금 감지 및 처리 - 캡차 처리 전략 - 세션 관리 및 쿠키 처리 """ import asyncio from playwright.async_api import async_playwright from datetime import datetime import os import json import time async def check_password_reset_captcha(): """비밀번호 재설정 페이지의 캡차 이미지 캡...
Python
1
homens = {'João', 'Joaquim', 'Alberto', 'Antonio', 'leonardo', 'Victor', 'Kléber', 'Marcelo', 'Alfredo'} alta_renda = {'Ana', 'Joaquim', 'Joana', 'Antonio', 'Kléber', 'Marcelo', 'Alfredo','Carla', 'Adriana'} #crio 2 sets print(f'Conjuntos de homens:\t{homens}') print(f'Conjunto de Alta renda: {alta_renda}\n{'-' * 150}...
Python
1
ntime_io; use super::Executor; use substrate_executor::{WasmExecutor, NativeExecutionDispatch}; use parity_codec::{Encode, Decode, Joiner}; use keyring::{AuthorityKeyring, AccountKeyring}; use runtime_support::{Hashable, StorageValue, StorageMap, traits::Currency}; use state_machine::{CodeExecutor, Externalities,...
Rust
0
+= blockDim.x * gridDim.x) { // find out the local index // find out the local offset const int c = index % channels; const int w = index / channels % width + pad_l; const int h = (index / channels / width) % height + pad_t; const int n = index / channels / width / height...
Python
1
if args.minio_bucket: print(f" - 清空MinIO存储桶: {args.minio_bucket}") else: print(" - 清空所有MinIO存储桶") if args.all or args.pg: print(" - 清空PostgreSQL articles表") # 确认操作 if not args.yes: response = input("\n⚠️ 确认要继续吗?(yes/no): ") if response....
Python
1
ermillion Problem', 'ID': 'AC_VeridiaCourier' }, 'Void Launch': { 'EN': 'Void Launch', 'ID': 'AC_KaldirShuttle' }, 'Void Thrashing': { 'EN': 'Void Thrashing', 'ID': 'AC_CharThrasher' }, 'Vuoto abominevole': { 'EN': 'Void Thrashing', 'ID': '...
Python
1
for suff in snpxtr_suff.iter() { out_vec.push(handle_file(gem_bs, format!("{}_{}", bc, suff), extract_path))} let id = format!("snpxtr_{}", bc); let (lname, lpath) = assets::make_ext_asset(&id, extract_path, "log"); let log_index = gem_bs.insert_asset(&lname, &lpath, AssetType::Log); let task = gem_bs.a...
Rust
0
0,3,1) ); let feb29 = Gregorian::day_number(0,2,29).unwrap(); assert_eq!(feb29, -307); let (y,m,d) = Gregorian::from_day_number(feb29).unwrap(); assert_eq!( (y,m,d), (0,2,29) ); let feb28 = Gregorian::day_number(0,2,28).unwrap(); assert_eq!(feb28, -308); let (y,...
Rust
0
packages: Vec<Package>, nodes: Vec<Node>, io_apics: Vec<IoApic>, memory_affinity: Vec<MemoryAffinity>, pmem_descriptors: Vec<MemoryDescriptor>, max_proximity_info: MaximumSystemCharacteristics, proximity_domains: Vec<MaximumProximityDomainInfo>, ) -> MachineInfo ...
Rust
0
[1].design_cell_uid ) assert design_cell.study_element_uid == self.study_elements[0].element_uid assert design_cell.study_arm_uid is None assert ( design_cell.study_branch_arm_uid == self.study_branch_arms[2].branch_arm_uid ) design_cell = service.get_specific...
Python
1
perceived_points.drain(0..too_old); } // Draw the state of your `Model` into the given `Frame` here. fn view(app: &App, model: &Model, frame: Frame) { // Begin drawing let draw = app.draw(); let win = app.window_rect(); // Clear the background to blue. draw.background().color(BLACK); // Draw ...
Rust
0
p.name.as_str(), metal::MTLSize { width: p.work_group_size.x as _, height: p.work_group_size.y as _, depth: p.work_group_size.z as _, }, ), // this can only happen if the shader came directly from the use...
Rust
0
SOSCEN_A>); impl SOSCEN_R { #[inline(always)] pub(crate) fn new(bits: bool) -> Self { SOSCEN_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> SOSCEN_A { match self.bits { false => SOSCEN_A::_0, ...
Rust
0
JobIdPair(0, None): 1, JobIdPair(1, None): 1 } cluster_spec = { 'v100': 1, 'p100': 1, 'k80': 1 } policy.get_allocation(unflattened_throughputs, scale_factors, cluster_spec, ...
Python
1
import math class Solution: def nCr(self, n, r): # code here number = math.factorial(n) if n>=r: fact = math.factorial(n-r) rand = math.factorial(r) final = (number)//(fact*rand) return final else: return 0
Python
1
context: &MacroContext, stream: &mut TokenStream) { (**self).to_tokens(context, stream); } } impl<T> ToTokens for &T where T: ToTokens, { fn to_tokens(&self, context: &MacroContext, stream: &mut TokenStream) { ToTokens::to_tokens(*self, context, stream) } } impl<T> ToTokens for Option...
Rust
0
'] = absolute_pos_embed.view( N2, H, W, C2).permute(0, 3, 1, 2).contiguous() # interpolate position bias table if needed relative_position_bias_table_keys = [ k for k in state_dict.keys() if 'relative_position_bias_table' in k ...
Python
1
# based on https://docs.odriverobotics.com/hoverboard.html import odrive import time motor_calibration_time = 6 encoder_calibration_time = 12 input("Make sure that the wheels are free to turn. Don't get hurt!\nPress ENTER to proceed.") print("Searching for ODrive...") odrv0 = odrive.find_any() print("Odrive detected...
Python
1
op(): asyncio.get_event_loop().stop() async def driver(): futs = [] fut = asyncio.run_coroutine_threadsafe(a(), ts[0]._loop) futs.append(fut) fut = asyncio.run_coroutine_threadsafe(recursive_a(5), ts[1]._loop) futs.append(fut) ...
Python
1
k_names(self): return exclusions.open() @property def integer_subtype_comparisons(self): return exclusions.open() @property def no_name_normalize(self): return exclusions.skip_if( lambda config: config.db.dialect.requires_name_normalize ) @property ...
Python
1
urbRequest::Watch { responder: _ } => { panic!("Unexpected call to watch"); } }); let output = utils::assert_set!(command(proxy, expected_do_not_disturb)); assert_eq!( output, format!("Successfully set DoNotDisturb to {:?}", expected_do_not_di...
Rust
0
#!/usr/bin/python3 rivers = { 'hudson': 'america', 'nile': 'egypt', 'ganges': 'india', } for river, country in rivers.items(): print(f"The {river.title()} flows through {country.title()}.")
Python
1
able::TableValue], trees: ArrayView1<Tree>, bias: f32, ) -> ComputeShapValuesForExampleOutput { let mut baseline_value = bias as f64; for tree in trees { baseline_value += compute_expectation(tree, 0); } let mut feature_contribution_values = vec![0.0; example.len()]; for tree in trees { tree_shap(example, tr...
Rust
0
from .SpecEvaluations import SpecEvaluations class ProblemObjectivesEvaluations(SpecEvaluations): """Special multi-evaluation class for all objectives of a same problem. See submethod ``.from_problem`` """ color_lightness = 0.8 color_shift = 0.14 specifications_role = "objective" @sta...
Python
1
.iter() .map(|v| v.to_owned().transpile(transpiler)) .collect::<HtmlValueResult<Vec<Box<dyn HtmlValue>>>>()?; Ok(self.add_capsules(capsules).boxed()) } fn vkind(&self) -> VKind { VKind::Program(self.capsules.to_vec()) } } impl Program { pub fn new(capsules: Vec<Box<dyn HtmlValue>>) -> Sel...
Rust
0
.extend(info.items.into_iter().map(|i| i.name)); if info.next_page_token.is_none() { break; } page_token = info.next_page_token; } _ => { bail!("Failed to list {:?} {:?}", base_url, re...
Rust
0
-> Result<Self> { BigDecimal::from_str(str_num) .map_err(|_| ProtocolError("String to BigDecimal failed in creating OrderRate")) .map(|inner| Self { inner }) } /// Create new OrderRate from bigdecimal pub fn from_bigdecimal(decimal: BigDecimal) -> Self { Self { inne...
Rust
0
SERVER.vfs.get(&path).ok_or_else(|| response_err(ErrorCode::InvalidRequest, "references: nonexistent file"))?; let text = file.text.ulock().1.ascii().clone(); let idx = or_none!(text.to_idx(pos)); let env = elaborate(path, Some(Position::default()), Default::default(), Default::default()) .await.map_err(...
Rust
0
.read(dst_vec) .queue(common_queue) .ewait(&wait_list) .enq_async()?; // Attach a status message printing callback to what approximates the // verify_init start-time event: unsafe { future_read_data.lock_event().unwrap() .set_callback(_verify_starting, task_iter as *mut c_vo...
Rust
0
ashcard_text}</div> <div class="go-corner"> </div> </div>""" st.markdown(card_html, unsafe_allow_html=True) # Save the flashcards to the database add_flashcard_study( st.session_state...
Python
1
); //~ } //~ #if USE_PREPARED //~ cass_prepared_free(select_prepared); //~ } //~ #endif //~ print_thread_stats(&thread_stats); //~ } //~ int main() { //~ int i; //~ uv_thread_t threads[NUM_THREADS]; //~ Cluster* cluster = NULL; //~ Session* session = NULL; //~ Future* close_future = NULL; //~ cass_log_set_level(CASS_LO...
Rust
0
cipher.key_schedule(12, &key); let plaintext = 0x0123456789abcdef; let ciphertext = cipher.encrypt(plaintext, &round_keys); assert_eq!(plaintext, cipher.decrypt(ciphertext, &round_keys)); } } <gh_stars>1-10 use super::CSRegister; use bit_field::BitField; #[allow(unused)] #[derive(Debug, P...
Rust
0
(); } } //set parameters self.games_played += 1; self.lr = self.get_lr(); self.exploration = self.get_exploration(); } } impl Drop for PlayerAIQOff { fn drop(&mut self) { //write neural net to file, if it may has learned and was initialized if self.initialized && !self.fixed { //learn if self....
Rust
0
t() generator_discriminator_notebook_evaluator_evaluate_and_print(self, mnist_hc_loader, pseudolabels) mnist_test_result_dict, _ = self.evaluate(self.mnist_testsplit_loader, 1) results = {"MNIST Test Split Final Classification Accuracy": [mnist_test_result_dict['encoder_classifier_accurac...
Python
1
where OnRead: FnMut() -> OnReadRes + Send, OnReadRes: Future<Output = Result<Vec<u8>, Status>> + Send, OnWrite: FnMut(Vec<u8>) -> OnWriteRes + Send, OnWriteRes: Future<Output = Result<(), Status>> + Send, { read_write_attr(DEFAULT_READ_WRITE_PROTECTION_ATTRIBUTES, on_read, capacity, on_write) } //...
Rust
0
}, ) } } <filename>src/quantizer/neu.rs use crate::{Color, Error, Quantizer}; use color_quant::NeuQuant; use image::{GenericImageView, Pixel, Rgb, Rgba}; use itertools::Itertools; /// Neuronal network based quantizer #[derive(Debug, Default)] pub struct Neu; impl Quantizer for Neu { ...
Rust
0
te); } self.bg_palette_index.auto_increment(); } /// Get the byte value in the object palette according to the /// specifications of the object palette index. pub fn get_ob_color(&self) -> u8 { let palette = self.bg_palettes[self.bg_palette_index.index()].data(); if self...
Rust
0
); println!("{}", min_t); } } } <filename>http/src/request/guild/member/get_guild_members.rs use crate::{ client::Client, error::Error as HttpError, request::{Request, TryIntoRequest}, response::{marker::MemberListBody, ResponseFuture}, routing::Route, }; use twilight_model::...
Rust
0
-> i32 { assert!(y >= 0, "{}mvchgat() : y = {}", MODULE_PATH, y); assert!(x >= 0, "{}mvchgat() : x = {}", MODULE_PATH, x); assert!(n >= -1, "{}mvchgat() : n = {}", MODULE_PATH, n); assert!(pair >= 0, "{}mvchgat() : pair = {}", MODULE_PATH, pair); bindings::mvchgat(y, x, n, attr, pair, opts) } /// ...
Rust
0
TextBoxSystemState>| { textbox.run(world); }); world.resource_scope(|world, mut systems: Mut<UiManagedSystems>| { systems.0.run(world); }); loop { let ui = &mut *world.get_resource_mut::<UiScratchSpace>().unwrap(); std::mem::swap(&mut ui.update_hashset_a, &mut ui.update_h...
Rust
0
/Tryndamere_7.jpg".to_string()) } pub fn tryndamere_8() -> Result<Vec<u8>, ()>{ cached_http_byte_request("https://ddragon.leagueoflegends.com/cdn/../src/api/ddragon_raw/img/champion/loading/Tryndamere_8.jpg".to_string()) } pub fn tryndamere_9() -> Result<Vec<u8>, ()>{ cached_http_byte_request("https:/...
Rust
0
from enum import Enum class Model(Enum): ANALOG = ("analog-diffusion-1.0.ckpt [9ca13f02]", "Analog V1", "01") ANYTHING_V3 = ("anythingv3_0-pruned.ckpt [2700c435]", "Anything V3", "02") ANYTHING_V4 = ("anything-v4.5-pruned.ckpt [65745d25]", "Anything V4.5", "03") ABYSSORANGEMIX = ("AOM3A3_orangemixs.safe...
Python
1
inal 5. Limpa arquivos temporarios finais A funcao e otimizada para execucao em producoo com: - Logging detalhado - Tratamento robusto de erros - Metricas de performance - Limpeza automatica """ logger.info("[MAIN] Iniciando execucao do compactador de resultados...") try: ...
Python
1
section_text, range, mail, true)) } FetchAttributes::BodyPeek(section_text, range) => { Some(body(section_text, range, mail, false)) } _ => None, } } #[allow(clippy::cast_possible_truncation)] #[instrument(skip(section_text, range, mail))] fn body( section_text: Opti...
Rust
0
ics=compute_metrics, ) # Comment these lines in “show & tell” if you don’t want to actually run training: # trainer.train() # trainer.evaluate() # trainer.save_model("freshbite-roberta-qa/ckpt") # ----------------------------- # 8) Inference snippet (after fine-tuning) # ----------------------------- def answer_quest...
Python
1