text
string
label_name
string
labels
int64
all input graphs are instances of nx.Graph and are hopefully compatible. Backend '' does not implement `2'%s. This call will mutate an input, so automatic  with these argumentsc3V# UHn[U[R5v M! g7f)NrarGraph)rCrs...
Python
1
"""create tag_notification_sent table Revision ID: f67fe4871771 Revises: 66147b81aad2 Create Date: 2024-05-13 14:50:11.171686 """ # revision identifiers, used by Alembic. revision = "f67fe4871771" down_revision = "66147b81aad2" import sqlalchemy as sa def upgrade(op, tables, tester): op.create_table( ...
Python
1
lize, VppMessage)] #[message_name_and_crc(one_enable_disable_xtr_mode_c264d7bf)] pub struct OneEnableDisableXtrMode { pub client_index : u32, pub context : u32, pub is_enable : bool, } #[derive(Debug, Clone, Serialize, Deserialize, VppMessage)] #[message_name_and_crc(one_enable_disable_xtr_mode_reply_e8d4e80...
Rust
0
new_column_value = os.path.splitext(file)[0] # 提取文件名的前缀 # merged_df.fillna(0, inplace=True) # merged_df['date'] = pd.to_datetime(merged_df['date']).dt.strftime('%Y-%m-%d') # merged_df.insert(0, 'location', new_column_value) # merged_df.to_csv(output_csv, mode='a', index=False, header=with_header) # ...
Python
1
uttjiakqesuhdlkymvrjl" + "pvvhdiwdaxlwmsrqufzhnwilfphbhfsmeynyljkfxlud" + "bgkchhxojnwdrgiyytusxffdjbcyxtujppbtqivjealg" + "gvrkzfefodkfdddxjfwxalhtccozczukktoczzlyoexj" + "qycxswaiyxyvsflxxbitiwsinouhkxqlsgtuctflcayg" + "bcspwwpuefilrogmkcoyooslbmkpfzcenhpkqubkllif" + "p...
Python
1
import heapq def a_star(): # Define the initial state and the goal state of the problem initial_state = (0, 0, 0, ()) goal_sum = 403 # Define the coins and their tax values coins = [8, 8, 6, 36, 7, 36, 33, 3, 31, 17, 21, 28, 41, 17, 23, 16, 39, 2, 3, 40, 23, 20, 5, 30, 8, 28, 17, 34, 38, 26, 16, ...
Python
1
# # LinOTP - the open source solution for two factor authentication # Copyright (C) 2010-2019 KeyIdentity GmbH # Copyright (C) 2019- netgo software GmbH # # This file is part of LinOTP server. # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU ...
Python
1
metrics.append(value) metrics = torch.stack(metrics, 0) torch.distributed.reduce(metrics, dst=0) if self.opt['rank'] == 0: metrics_dict = {} cnt = 0 for key, metric in zip(keys, metrics): if key == 'cnt': cnt = float(metric...
Python
1
# backend/app.py from flask import Flask, jsonify, request import yfinance as yf from datetime import datetime from flask_cors import CORS # Import CORS # Initialize the Flask app app = Flask(__name__) CORS(app) # Enable CORS for the entire app # Route to get the current stock price and additional data @app.route(...
Python
1
) + 5 >>> horner(a*x**4 + b*x**3 + c*x**2 + d*x + e) e + x*(d + x*(c + x*(a*x + b))) >>> f = 4*x**2*y**2 + 2*x**2*y + 2*x*y**2 + x*y >>> horner(f, wrt=x) x*(x*y*(4*y + 2) + y*(2*y + 1)) >>> horner(f, wrt=y) y*(x*y*(4*x + 2) + x*(2*x + 1)) References ========== [1] - http://e...
Python
1
cert(&mut self, cert: &str) -> CassError {unsafe{ CassError{err:cass_ssl_set_cert( self, CassValue::str_to_cass_string(cert)) } }} pub fn set_private_key(&mut self, key: &str, password: &str) -> CassError {unsafe{ CassError{err:cass_ssl_set_private_key( self,CassValue::str_to_cass_str...
Rust
0
filas_por_iteracion = len(resultado[2])-indice_inicial print("ultima") grupo_filas = resultado[2].iloc[indice_inicial:indice_inicial + filas_por_iteracion] update_data(grupo_filas) indice_inicial = indice_inicial + filas_por_iteracion st.write(...
Python
1
t as usize; // trapret } stack_pointer -= mem::size_of::<Context>(); let context_pointer: *mut Context = stack_pointer as *mut Context; process_entry.replace(Process { process_state: ProcessState::EMBRYO, kernel_stack: kernel_stack, id: unsafe { PROCESS_ID }, pa...
Rust
0
ap::ArgMatches; use std::thread; use std::path::PathBuf; use path_abs::PathAbs; use std::sync::mpsc::*; use std::time::*; use indicatif::*; use std::sync::*; use std::ops::{Deref, DerefMut}; use copy::*; use avgspeed::*; pub type Result<T> = std::result::Result<T, Error>; /// utility to track changes of variable #[d...
Rust
0
PE9_W { w: self } } #[doc = "Bits 20:21 - Wakeup pin enable for LLWU_Pn"] #[inline(always)] pub fn wupe10(&mut self) -> WUPE10_W { WUPE10_W { w: self } } #[doc = "Bits 22:23 - Wakeup pin enable for LLWU_Pn"] #[inline(always)] pub fn wupe11(&mut self) -> WUPE11_W { WUPE11_W { w: self } } #[do...
Rust
0
assert_eq!(last_len, len); } } RawBuf::new(ptr, len) } fn reset(&mut self) { self.0 = None; } } pub struct TcpStreamCompat { stream: TcpStream, read_dst: Dst, write_dst: Dst, read_fut: MaybeArmedBoxFuture<BufResult<usize, RawBuf>>, write_fut...
Rust
0
sert_near!(face0.vertices[0][1] as f64, face1.vertices[0][1] as f64); assert_near!(face0.vertices[0][2] as f64, face1.vertices[0][2] as f64); assert_near!(face0.vertices[1][0] as f64, face1.vertices[1][0] as f64); assert_near!(face0.vertices[1][1] as f64, face1.vertices[1][1] as f64); as...
Rust
0
praj.first, praj.last, name_size(&praj) ); } pub fn name_size(person: &Person) -> i32 { //let Person {first, last} = person; //first.len() + last.len() (person.first.len() + person.last.len()) as i32 } #[cfg(test)] mod test { use super::add_one; use super::add_three; ...
Rust
0
, lsl #24", // playbuf b's copy with the ninth-bits added "add r1, r0, r9", // as above for the second set of four samples: // initializing the ninth-bit register with the 2nd sample first for shifty reasons "ands r9, r5, #0x0080", // grab...
Rust
0
ion") .license("Apache-2.0") .arg( Arg::new("oci-registry") .about("OCI registry namespace") .index(1), ) .arg( Arg::new("noexec") .short('n') .long("noexec") .takes_value(false) ...
Rust
0
test_established_bad_ack() { let mut s = socket_established(); // Already acknowledged data. send!( s, TcpRepr { seq_number: REMOTE_SEQ + 1, ack_number: Some(TcpSeqNumber(LOCAL_SEQ.0 - 1)), ..SEND_TEMPL }, ...
Rust
0
"""Provide summary details on damage filtering for MultiQC. """ import os from bcbio import utils from bcbio.distributed.transaction import file_transaction from bcbio.pipeline import datadict as dd from bcbio.pipeline import config_utils from bcbio.provenance import do from bcbio.variation import vcfutils from bcbio....
Python
1
rubble::link::filter::WhitelistFilter<core::iter::Once<rubble::link::DeviceAddress>>, > = (); static mut SERIAL: Uarte<UARTE0> = (); static mut LOG_SINK: Consumer = (); #[init(resources = [BLE_TX_BUF, BLE_RX_BUF])] fn init() { { // On reset the internal high frequency clock i...
Rust
0
self.callback = kwargs.pop("callback", None) def switch_controlnet_method(self, new_method: str): self.controlnet_method = new_method controlnet = ControlNetModel.from_pretrained( new_method, resume_download=True, local_files_only=self.local_files_only, ...
Python
1
None : collapsible = GafferUI.Collapsible( name, _CollapsibleLayout( self.orientation() ), collapsed = True ) # Hack to add margins at the top and bottom but not at the sides. ## \todo This is exposed in the public API via the borderWidth # parameter to the Collapsible. That parameter sucks because a)...
Python
1
ubdoc": { "a": "subkey", "another": { "subdoc": dt } }, "array": [1_i64, true, { "doc": 23_i64 }, ["another", "array"]], }; append_test(expected, |doc| { doc.append("a", true); doc.append("second key", 123.4); doc.append("third", 15_i64); ...
Rust
0
harf = input("Bir harf giriniz: ") if len(harf) != 1: raise ValueError("Lütfen sadece bir harf giriniz!") if not harf.isalpha(): raise ValueError("Sadece alfabetik karakter giriniz!") """ Ne Zaman raise Kullanılır? Kendi Hata Durumlarını Tanımlamak İçin: Programın belirli bir durumla karşılaşmasını istemiyors...
Python
1
""" Copyright: MAXON Computer GmbH Author: Maxime Adam. Description: - Loops over all materials, shaders of the active document and display their previews in the Picture Viewer. Class/method highlighted: - BaseDocument.GetFirstMaterial() - GeListNode.GetNext() - GeListNode.GetDown() - Material.Get...
Python
1
) ); assert_eq!( ::core::mem::align_of::<ble_gattc_evt_write_cmd_tx_complete_t>(), 1usize, concat!( "Alignment of ", stringify!(ble_gattc_evt_write_cmd_tx_complete_t) ) ); assert_eq!( unsafe { &(*(::core::ptr::null::<bl...
Rust
0
s: typing.Union[dict, frozendict.frozendict, ], Node: typing.Union[MetaOapg.properties.Node, str, schemas.Unset] = schemas.unset, Arch: typing.Union[MetaOapg.properties.Arch, str, schemas.Unset] = schemas.unset, Platform: typing.Union[MetaOapg.properties.Platform, str, schemas.Unset] = schemas.u...
Python
1
ts = results.into_iter().take(*n).collect(); } DiceFilter::KeepHighest(n) => { let len = results.len(); results = results.into_iter().skip(len - n).collect(); } } ...
Rust
0
)) = self.index.get(&source) { for (i, candidate) in self.targets[start_index .. end_index] .iter() .enumerate() { if self.inlines.contains(start_index + i) { f(*candidate); } ...
Rust
0
raków (city center)", ("warsaw", "center") => "Warsaw (city center)", _ => &name.map, }, "sg" => match (name.city.city.as_ref(), name.map.as_ref()) { ("jurong", "center") => "Jurong", _ => &name.map, }, "tw" => match (name.city.city.as_ref(...
Rust
0
import cv2 import numpy as np import xml.etree.ElementTree as ET import os # import PIL.Image as P CLASSES = ['background', 'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person', 'pottedpl...
Python
1
ader { pub Type: String, pub Flags: Vec<String>, pub VAddr: usize, pub Align: usize, pub Sections: Vec<ElfSectionRef>, } #[derive(Serialize, Deserialize)] pub struct ElfFile { pub FileHeader: ElfFileHeader, pub Symbols: Vec<ElfSymbol>, pub Sections: Vec<ElfSection>, pub ProgramHeade...
Rust
0
ld want to make sure that no such decoding takes place in this case. signature_imposter = '48304502207fa7a6d1e0ee81132a269ad84e68d695483745cde8b541e3bf630749894e342a022100c1f7ab20e13e22fb95281a870f3dcf38d782e53023ee313d741ad0cfbc0c509001' # OP_RETURN <data> rpc_result = self.nodes[0].decodescrip...
Python
1
; const MASK: u64 = (1u64 << WINDOW_SIZE) - 1; const NUM_BUCKETS: usize = 1 << WINDOW_SIZE; assert!((WINDOW_SIZE as usize) * NUM_WINDOWS >= 254); fn get_bits<Repr: PrimeFieldRepr>(el: Repr, start: usize) -> u64 { const WINDOW_SIZE: u32 = 12; const MASK: u64 = (1u64 << WINDOW_SIZE) - 1;...
Rust
0
import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.interface.configure import enable_ipv6_dhcp_server class TestEnableIpv6DhcpServer(unittest.TestCase): @classmethod def setUpClass(self): testbed = f""" devices: PE-B: connections: ...
Python
1
z$ProcessingInstruction._set_nodeValuecCs|jSr&r7r r r r _get_nodeNamesz#ProcessingInstruction._get_nodeNamecCs ||_dSr&r;rr r r _set_nodeNamesz#ProcessingInstruction._set_nodeNamerc...
Python
1
enc.token_act # ((num_samples), num_tokens, channels) # Token-token attention single_emb = self.single_cond_embedding_projection( self.single_cond_embedding_norm(trunk_single_cond) ) if self.use_batch_infer: single...
Python
1
# -*- coding: utf-8 -*- # Author: Lawlite # Date: 2018/10/20 # Associate Blog: http://lawlite.me/2018/10/16/Triplet-Loss原理及其实现/#more # License: MIT import numpy as np def test_pairwise_distances(squared = False): '''两两embedding的距离,比如第一行, 0和0距离为0, 0和1距离为8, 0和2距离为16 (注意开过根号) [[ 0. 8. 16.] [ 8. 0. 8.] ...
Python
1
rs.ToolManager` object that will get the tools added tools : {str: class_like}, optional The tools to add in a {name: tool} dict, see `add_tool` for more info. """ for name, tool in six.iteritems(tools): toolmanager.add_tool(name, tool) def add_tools_to_container(container, tools=...
Python
1
self._send_state_to_main_process(error=f"Maia {self.current_maia_elo} weights setup failed", critical_process_failure=True) return False print(f"CONSOLE (ChessGameController initialize_dependencies_and_engine): Веса Maia ELO {self.current_maia_elo} настроены: {self.current_maia_weights_path...
Python
1
import os import torch from datasets import load_dataset from transformers import ( AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, ) from peft import LoraConfig, get_peft_model, prepare_model_for_kbit_training from trl import DPOConfig, DPOTrainer # 限制 CUDA 碎片化 os.environ["PYTORCH_CUDA_ALLOC_CONF...
Python
1
icKey, GenericArray<u8, U32>, GenericArray<u8, U32>); const SIZE_CK: usize = 32; const SIZE_HS: usize = 32; // number of pages to clear after sensitive call const CLEAR_PAGES: usize = 1; // C := Hash(Construction) const INITIAL_CK: [u8; SIZE_CK] = [ 0x60, 0xe2, 0x6d, 0xae, 0xf3, 0x27, 0xef, 0xc0, 0x2e, 0xc3, 0x3...
Rust
0
ive] #[doc(alias = "GstFlowReturn")] pub enum FlowReturn { #[doc(alias = "GST_FLOW_CUSTOM_SUCCESS_2")] CustomSuccess2, #[doc(alias = "GST_FLOW_CUSTOM_SUCCESS_1")] CustomSuccess1, #[doc(alias = "GST_FLOW_CUSTOM_SUCCESS")] CustomSuccess, #[doc(alias = "GST_FLOW_OK")] Ok, #[doc(alias = ...
Rust
0
before an extension) let volume_label_opt = self.read_volume_label_from_root_dir_as_bytes()?; if let Some(volume_label) = volume_label_opt { // Strip label padding let len = volume_label.iter().rposition(|b| *b != SFN_PADDING).map(|p| p + 1).unwrap_or(0); ...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" from _utils import parse, print_stats, URL_DS1, URL_DS2, URL_DS3 rows = [] for game, url in { "DS1": URL_DS1, "DS2": URL_DS2, "DS3": URL_DS3, }.items(): for name, health, souls in parse(url): rows.append((game, name, heal...
Python
1
#!/bin/python # -*- coding: utf-8 -*- # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributers. from fenrirscreenreader.core import debug class command(): def __init__(self): pass def initialize(self, environment): self.env = environment def shutdown(self): pass d...
Python
1
y() { while let Some((key, _)) = self.todo_queue.lock().unwrap().pop() { let mut node = self.nodes.remove(&key).unwrap(); let nodes_info = self.node_infos.clone(); let todo_queue = self.todo_queue.clone(); let active_count = active_coun...
Rust
0
"しねん", "しのぐ", "しのぶ", "しはい", "しばかり", "しはつ", "しはらい", "しはん", "しひょう", "しふく", "じぶん", "しへい", "しほう", "しほん", "しまう", "しまる", "しみん", "しむける", "じむしょ", "しめい", "しめる", "しもん", "しゃいん", "しゃうん", "しゃおん", "じゃがいも", "しやくしょ", "しゃくほう", ...
Rust
0
// Turn the std_file handle back into a tokio file, put it back // in the resource table. let tokio_file = tokio::fs::File::from_std(std_file); fs_file.0 = Some(tokio_file); // return the result. result } Err(tokio_file) => { // This function will ret...
Rust
0
tmpfile.write(file_bytes) if 'image' in file.type: w, h = Image.open(file).size st.image( file_bytes, caption='Uploaded Image', width=int(250 / h * w), ) files.append(f'an image at `{file_path}`') elif 'aud...
Python
1
} } impl TryFrom<Sequence> for Dependencies { type Error = crate::Error; fn try_from(array: Sequence) -> Result<Self> { let mut deps = Self::default(); let mut dep_set = HashSet::new(); for dep in array { if let YamlValue::String(dep) = dep { dep_set.insert(d...
Rust
0
# Copyright 2009-2017 Ram Rachum. # This program is distributed under the MIT license. import inspect from python_toolbox import nifty_collections from python_toolbox import cute_testing from python_toolbox.math_tools import cute_round, RoundMode def almost_equals(x, y): return (abs(1-(x / y)) < (10 ** -10)) ...
Python
1
of the next. In Full-Duplex mode, the register value should be the desired period in nibble times minus 3. In Half-Duplex mode, the register value should be the desired period in nibble times minus 6. In Full-Duplex the recommended setting is 0x15 (21d), which represents the minimum IPG of 960 ns (in 100 Mbps mode) or...
Rust
0
import porepy as pp import numpy as np def romb_fractur(L,b): x = int(L / b) X = [] z = 0 for i in range(x): z = z + b / 2 X.append(z) z = z + b / 2 fracture = [] N = len(X)+1 for j in range(N): if j >= 1: frac1 = pp.LineFracture(np.array([[X[j-1]...
Python
1
if self.block_rank(i + 1) > cur_ones_threshold { select1_hints.push(i); cur_ones_threshold += SELECT_ONES_PER_HINT; } } select1_hints.push(self.num_blocks()); select1_hints.shrink_to_fit(); self.select1_hints = Some(select1_hints)...
Rust
0
.enable, ipc.create_time ], ) } /// 执行Update SQL修改数据库中的Ipc数据 pub fn update(&self, ipc: Ipc) -> Result<usize> { db::conn()?.execute( UPDATE_SQL, params![ ipc.key, ipc.name, ipc.rtsp, ...
Rust
0
ne """ self.write_pow_hermitian(1) if __name__ == "__main__": def main(): bit_map = list(range(7)) fin_emb = CktEmbedder(7, 8, bit_map) atom_wr = AtomWriter(do_write=False, test=True) for ZL in [True, False]: wr = PhaseEstSEO_writer(do_write=False, ...
Python
1
); assert!(started.load(Ordering::Relaxed), "Not started"); assert!(stopping.load(Ordering::Relaxed), "Not stopping"); assert!(stopped.load(Ordering::Relaxed), "Not stopped"); } #[test] fn test_stop() { let sys = System::new("test"); let started = Arc::new(AtomicBool::new(false)); let stopping...
Rust
0
print("|-{}".format(msg)) def echo_error(self, msg): print("=" * 90) print("|-错误:{}".format(msg)) if self._error_msg: self._error_msg += "\n" self._error_msg += msg # 取排除列表用于计算排除目录大小 def get_exclude_list(self, exclude=[]): if not exclude: ...
Python
1
, pszDstProjection: *const libc::c_char, padfDstGeoTransform: *mut f64, pfnTransformer: GDALTransformerFunc, pTransformArg: *mut libc::c_void, dfBurnValue: f64, papszOptions: *mut *mut libc::c_char, pfnProgress: GDALProgressFunc, pProgressArg: *mut libc::c...
Rust
0
io buffer. pub controlRegion: &'static RDMAControlChannelRegion, pub controlChannelRegionAddress: MemRegion, pub controlBufIdMgr: Mutex<IdMgr>, pub keys: Vec<[u32; 2]>, } impl Drop for RDMASrv { fn drop(&mut self) { //TODO: This is not called because it's global static println!("dr...
Rust
0
point += 1 if point > p: p = point action = i return action @njit() def getCard(state, validActions): const = state[12:17] ngLieu = state[6:11] + const ngLban = state[:5] auto = state[11] action = 0 point = 0 for i in range(15, 0, -1): ...
Python
1
# type: ignore[misc] with pytest.raises( AttributeError, match="(can't set attribute)|(property 'row' of 'GridQubit' object has no setter)", ): q = cirq.GridQubit(1, 2) q.row = 3 # type: ignore[misc] with pytest.raises( AttributeError, match="(can't set a...
Python
1
_indexer(); let block_stream = indexer.streamer(); // Spawn consumers based on specified type match producer_type { producer::Type::Kafka => { let mut producer = KafkaProducer::new().await; actix::spawn(async move { producer.consume(block_stream).await }); } ...
Rust
0
25]*a[16]+b[26]*a[14]-b[27]*a[13]+b[29]*a[10]-b[30]*a[7]+b[31]*a[3]; res[2]=b[2]*a[31]+b[6]*a[30]-b[10]*a[28]+b[11]*a[27]-b[12]*a[26]+b[16]*a[24]-b[17]*a[23]+b[18]*a[22]+b[22]*a[18]-b[23]*a[17]+b[24]*a[16]+b[26]*a[12]-b[27]*a[11]+b[28]*a[10]-b[30]*a[6]+b[31]*a[2]; res[1]=b[1]*a[31]+b[6]*a[29]-b[7]*a[28]+b[8]*a[27]-...
Rust
0
for CALIB {} #[doc = "`write(|w| ..)` method takes [calib::W](calib::W) writer structure"] impl crate::Writable for CALIB {} #[doc = "Calibration"] pub mod calib; <gh_stars>0 use std::env; pub fn main() { println!("CWD: {:?}", env::current_dir()); local_test(); solution(); } fn local_test() { let mea...
Rust
0
# Jane Mills # 2/9/2021 # GPW # check growth rate ID import arcpy, os arcpy.env.overwriteOutput = True inFolder = r'\\Dataserver1\gpw\GPW4\Release_411\data\boundaries\adjusted_boundaries_with_census_data' boundaryGDBs = [os.path.join(inFolder,b) for b in os.listdir(inFolder) if b[-4:] == '.gdb' and 'usa' not in b] b...
Python
1
let eidonkeycard = EIdDonkeyCard { card_handle: Arc::new(Mutex::new(handle)), }; EIDONKEYCARD_SINGLETON = mem::transmute(Box::new(eidonkeycard)); } Ok((*EIDONKEYCARD_SINGLETON).clone()) }, Err(e) => { if EIDONKEYCARD_SINGLETON != 0 as *const EIdDonkeyCard { drop(EID...
Rust
0
(at an optional index). :param title: optional title of the sheet :type title: str :param index: optional position at which the sheet will be inserted :type index: int /Cannot create new sheet in a read-only workbookparenttitle)sheetriN)r]r r;rr _add_s...
Python
1
o |mem| pointer after this /// function returns, so the application can safely free it. /// /// This function returns 0 if it succeeds, or one of the following /// negative error codes: /// /// :enum:`NGHTTP2_ERR_NOMEM` /// Out of memory. pub fn nghttp2_session_client_new3( s...
Rust
0
from fastapi import FastAPI, File, UploadFile, HTTPException from fastapi.responses import JSONResponse from pathlib import Path import os import subprocess app = FastAPI() # Diretórios e arquivos UPLOAD_DIR = r"C:\Users\tmamo\Documents\Projeto2-Novo\IA\betateste\arquivos\Fotos\tomas" SCRIPT_PATH = r"C:\Users\tmamo\D...
Python
1
out_size=None): assert x1.shape[:2] == x2.shape[:2] assert out_size is None or len(out_size) == 2 if out_size is None: # resize to larger one out_size = max(x1.size()[2:], x2.size()[2:]) x1 = self.input1_conv(x1) x2 = self.input2_conv(x2) x1 = self._resize...
Python
1
import os.path import itertools import Tools import random import numpy as np import scipy.special as sp NBTESTSAMPLES = 500 def softmax(v): m = sp.softmax(v) return(np.argmax(m)+1) def writeTest(config,nb,vecDim): dims=[] inputsA=[] outputs=[] outputsSamples = [] dims.append(NBTESTS...
Python
1
"""Represents a cancel transaction message.""" from typing import Optional from marshmallow import EXCLUDE, fields from .....messaging.agent_message import AgentMessage, AgentMessageSchema from .....messaging.valid import UUID4_EXAMPLE from ..message_types import CANCEL_TRANSACTION, PROTOCOL_PACKAGE HANDLER_CLASS =...
Python
1
"""Common test fixtures and utilities.""" from unittest.mock import MagicMock import pytest from pydantic import SecretStr from openhands.sdk.llm import LLM from openhands.sdk.tool import ToolExecutor @pytest.fixture def mock_llm(): """Create a standard mock LLM instance for testing.""" return LLM( ...
Python
1
of_frames_in_range(4, 1..3), 2); } #[test] fn number_of_frames_in_range_works_inclusive_range() { assert_eq!(number_of_frames_in_range(4, 1..=3), 3); } #[test] fn number_of_frames_in_range_works_open_ended_range() { assert_eq!(number_of_frames_in_range(4, 1..), 3); } #[test] fn number_of_frames_in_range_work...
Rust
0
# person={ # 'name':'ram', # 'age':25, # 'city':'janakapur', # 'family_members':{ # 'father':'Dasharatha', # 'mother':'gita', # 'sister':'jaya', # 'brother':'raaam' # } # } # print(person['family_members ']['father']) person={ 'name':'ram', 'age':25, 'city...
Python
1
bmax = obj[1] values = obj[2] if type == 'OccupancyGrid': res = OccupancyGrid() else: res = ImplicitSurface() res.bbox.append(bmin[0]) res.bbox.append(bmin[1]) res.bbox.append(bmin[2]) res.bbox.append(bmax[0]) res.bbox.append(b...
Python
1
# /* # MIT License # # Copyright (c) [2018] [Xiao Yang] # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, ...
Python
1
(ft.seconds_relative_to_1970(), ft.nanoseconds()) }).encode(e) } } impl Decodable for MtimeSlot { fn decode<D: Decoder>(e: &mut D) -> Result<MtimeSlot, D::Error> { let kind: Option<(u64, u32)> = try!(Decodable::decode(e)); Ok(MtimeSlot(Mutex::new(kind.map(|(s, n)| { ...
Rust
0
ite(dup, unsafe { slice::from_raw_parts(value as *const u8, mem::size_of::<termios>()) })); let _ = syscall::close(dup); if write == !0 { return -1; } 0 } fn unlink(path: &CStr) -> c_int { e(syscall::unlink(path.to_bytes())) as c_int ...
Rust
0
CSI::InsertCharacter(1)); test!(CSI::InsertCharacter(23)); } #[test] fn idcs() { test!(CSI::IdentifyDeviceControlString(None)); test!(CSI::IdentifyDeviceControlString(Some(1))); } #[test] fn igs() { test!(CSI::IdentifyGraphicSubrepertoire(None)); test!(CSI::IdentifyGraphicSubrepertoire(Some...
Rust
0
<ETMEVTIN3_AW> for bool { #[inline(always)] fn from(variant: ETMEVTIN3_AW) -> Self { variant as u8 != 0 } } #[doc = "Field `ETMEVTIN3` writer - ETM Event Input 3"] pub struct ETMEVTIN3_W<'a> { w: &'a mut W, } impl<'a> ETMEVTIN3_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(a...
Rust
0
socConst>::NONE => panic!(), _ => {} } } <filename>ch03/Twelve_days/case1/src/main.rs<gh_stars>0 //Bibliografia: //https://benjaminbrandt.com/twelve-days-of-christmas-in-rust/ fn main() { println!("\nTWELVE DAYS OF CHRISTMAS:"); for day in 1..13 { day_intro(day); for gift_day in...
Rust
0
.0, 1.0, 1.0, 1.0], radius: 0.03, }; pub const BAR_RECTANGLE: [f64; 4] = [0.3, -0.06, 1.5, 0.05]; pub const BAR_MARGIN: f64 = 0.01; pub const BAR_TEXT_COLOR: [f32; 4] = colors::WHITE; pub const AIR_BAR_POS: [f64; 2] = [-0.9, 0.95]; pub const AIR_BAR_TEXT_COLOR: [f32; 4] = BAR_TEXT_COLOR; pub const AIR_BAR_BACKGRO...
Rust
0
from sqlalchemy import create_engine, Table, MetaData, select, and_, func, JSON, Column from sqlalchemy.sql import text from sqlalchemy.orm import sessionmaker # Database connection setup engine = create_engine('postgresql://user:password@localhost/dbname') Session = sessionmaker(bind=engine) session = Session() # Me...
Python
1
ommand=add_btn) addbtn.grid(row=8, column=8, rowspan=1, sticky=W+E+S+N, padx=5, pady=5) addbtn = Button(root, text='编辑') addbtn.grid(row=9, column=8, rowspan=1, sticky=W+E+S+N, padx=5, pady=5) addbtn = Button(root, text='删除') addbtn.grid(row=10, column=8, rowspan=1, sticky=W+E+S+N, padx=5, pady=5) # lb.bind('<buttonre...
Python
1
ODEV) if *port_id* invalid."] #[doc = " - (-EIO) if device is removed."] pub fn rte_eth_led_on(port_id: u16) -> ::std::os::raw::c_int; } extern "C" { #[doc = " Turn off the LED on the Ethernet device."] #[doc = " This function turns off the LED on the Ethernet device."] #[doc = ""] #[doc = " @...
Rust
0
ize); let ptr = il2cpp_runtime_invoke.unwrap()( method_info as usize as *mut usize, this_arg as usize as *mut usize, paramArrPtr as *mut *mut usize, exception_ptr as usize as *mut usize, ); println!("PostInvoke {}", ptr as usize); let ha...
Rust
0
0)) proxy_entry.insert(0, PROXY) proxy_entry.place(relx=0.044, rely=0.36, relwidth=0.894) # 在弹窗中添加"确定"按钮,点击后获取Entry中的值 def ok_button_clicked(): save_proxy_config() update_proxy_status() proxy_window.destroy() def cancel_button_clicked(): proxy_window.destroy...
Python
1
index -= size; } } panic!("Allocator index out of bounds"); } fn is_free(&self, index: usize) -> bool { self.next_free <= index } } unsafe impl pg::FrameAllocator<PageSizeType> for Allocator { fn allocate_frame(&mut self) -> Option<PhysFrame> { if self.nex...
Rust
0
es)] ms_inputs = [F.interpolate(x, size=(orig_height // f, orig_width // f), mode='bilinear', align_corners=False) for f in factors] return super().forward(ms_inputs) class GeneratorMultiToSingleOutputMixin: def forward(self, x): return super().forward(x)[0] class Di...
Python
1
//use snafu::{ErrorCompat, ResultExt, Snafu}; use snafu::{Snafu}; use std::{ path::{PathBuf}, }; #[derive(Debug, Snafu)] pub enum Error { #[snafu(display("Could not read {}: {}", filename.display(), source))] ReadErr { filename: PathBuf, source: std::io::Error, }, #[snafu(display(...
Rust
0
nt].label() == "FIRST"); let target = vec![first_idx, first_idx, root_idx, root_idx, root_idx]; assert_eq!(indices, target) } #[test] fn project_node_ids() { let mut tree = Tree::new("t1", "TERM1"); let t1 = tree.root(); tree.insert_unary_above(t1, "ROOT"); l...
Rust
0
prev_gru_main_output_get_item, h_0_get_item_nodes[i], current_gru_weights, has_biases, 1, # New `num_layers`. dropout, train, bidirectional, ...
Python
1
) Endeavouros | (x) https://endeavouros.com/ \n", " (x) 3 | (x) Red | (x) https://redhat.com/ \n", " | (x) Hat | \n", " | (x) Enterprise | \n", ); let table = table!( &data, ...
Rust
0
"b t (c f) -> (b f) t c", f=self.order) if type(timestep) == torch.Tensor and len(timestep.shape) == 1: timestep = repeat(timestep, "b -> (b f)", f=self.order) if local_cond is not None: local_cond = rearrange(local_cond, "b t (c f) -> (b f) t c", f=self.order) if global...
Python
1