text
string
label_name
string
labels
int64
don::HALF_N_FULL_ROUNDS { <F as Poseidon>::constant_layer_field(&mut state, round_ctr); if r != 0 { for i in 0..SPONGE_WIDTH { let sbox_in = vars.local_wires[Self::wire_full_sbox_0(r, i)]; constraints.push(state[i] - sbox_in); ...
Rust
0
# There are 3 loop control statements. Break, continue and pass # BREAK # Can only be used in FOR and WHILE loop # It is used to exit from a loop. Any statement within that condition (if) after the break statement # will not be executed # Any statement outside the block of code will be executed with an exception to el...
Python
1
def hex2int(hexadecimal): hexadecimal = hexadecimal.upper() hex_dict = {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, 'A': 10, 'B': 11, 'C': 12, 'D': 13, 'E': 14, 'F': 15} decimal = 0 for digit in hexadecimal: decimal = decimal * 16 + hex_dict[digit] ...
Python
1
assert!(Srgb::from_str("hsl(0de 0% 0% / 0)").is_err()); assert!(Srgb::from_str("hsl(0degg 0% 0% / 0)").is_err()); assert!(Srgb::from_str("hsl(0 deg 0% 0% / 0)").is_err()); assert!(Srgb::from_str("hsl(0grad 0% 0% / 0)").is_ok()); assert!(Srgb::from_str("hsl(0GRAD 0% 0% / 0)").is_ok()); assert!(Sr...
Rust
0
fn hserdyie(&self) -> HSERDYIER { let bits = { const MASK: bool = true; const OFFSET: u8 = 3; ((self.bits >> OFFSET) & MASK as u32) != 0 }; HSERDYIER { bits } } #[doc = "Bit 2 - HSI16 ready interrupt flag"] #[inline] pub fn hsi16rdyie(&self) ->...
Rust
0
c def step_impl( context: Any, url: str, allowed_requests: int, time_window: int, spillover_count: Optional[ int ] = None, # TODO: Add spillover_enabled to the function signature ): spillover = None monthly_renewal = None if spillover_count is not None: spillover = S...
Python
1
"3"), ("(gint) NM_DEVICE_ERROR_INVALID_ARGUMENT", "10"), ("(gint) NM_DEVICE_ERROR_INVALID_CONNECTION", "2"), ("(gint) NM_DEVICE_ERROR_MISSING_DEPENDENCIES", "9"), ("(gint) NM_DEVICE_ERROR_NOT_ACTIVE", "4"), ("(gint) NM_DEVICE_ERROR_NOT_ALLOWED", "6"), ("(gint) NM_DEVICE_ERROR_NOT_SOFTWARE", "5"...
Rust
0
import json from girder_client import GirderClient import pytest from dive_tasks import tasks from .conftest import getClient, getTestFolder, match_user_server_data, users, wait_for_jobs @pytest.mark.integration @pytest.mark.run(order=3) def test_reset_job_logs(admin_client: GirderClient): # remove any failed ...
Python
1
HEAD".to_string()) ) } else { "OUTPUT".to_string() } } fn commit(instance: &str) -> Result<()> { get_instance_ns_name(instance)?; info!("Un-mounting all the instances..."); // Un-mount all the instances for_each_instance(&container_down)?; info!("{}: committing instance...",...
Rust
0
#!/usr/bin/env python3 """ Test script untuk Binance Gemini Analyzer Advanced """ import asyncio import sys sys.path.append('.') from binance_data import get_binance_data from indicators import calculate_indicators from trading_signals import signal_engine import pandas as pd async def test_analysis(): print('๐Ÿš€ T...
Python
1
ageDoubleMap, StorageDoubleMap, StorageMap}, }; use sp_std::{prelude::*, result}; use opensquare_primitives::BountyId; use crate::types::{Bounty, BountyOf, BountyState}; use crate::{ ApprovedHeight, AssignedHeight, BalanceOf, BountyStateOf, CurrencyIdOf, Error, HuntedForBounty, HunterBounties, HuntingForBount...
Rust
0
sionConfigRequest, 'createConfig_adminClusterName', 'createConfig.adminClusterName') encoding.AddCustomJsonFieldMapping( GkeonpremProjectsLocationsBareMetalClustersQueryVersionConfigRequest, 'upgradeConfig_clusterName', 'upgradeConfig.clusterName') encoding.AddCustomJsonFieldMapping( GkeonpremProjectsLocationsB...
Python
1
rrupt_handler_xhci( _stack_frame: ExceptionStackFrame, ) { let main_queue = unsafe { BUF_QUEUE.assume_init_mut() }; main_queue .push(Message { m_type: Some(MassageType::InterruptXhci) }) .unwrap(); unsafe { notify_end_of_interrupt(); } } #[repr(align(16))] pub st...
Rust
0
crets that will cause some providers to be removed # Tests both lowercase and uppercase variants to ensure comprehensive coverage custom_secrets = { 'github_token': 'custom_github_token', 'GITLAB_TOKEN': 'custom_gitlab_token', } # This should work without raising RuntimeError: dictionar...
Python
1
from typing import TYPE_CHECKING, Any from langchain._api import create_importer if TYPE_CHECKING: from langchain_community.utilities.vertexai import ( create_retry_decorator, get_client_info, init_vertexai, raise_vertex_import_error, ) # Create a way to dynamically look up de...
Python
1
&mut Self { self.inner.limit = limit; self } } impl AsRef<GetGroupsInCommon> for GetGroupsInCommon { fn as_ref(&self) -> &GetGroupsInCommon { self } } impl AsRef<GetGroupsInCommon> for RTDGetGroupsInCommonBuilder { fn as_ref(&self) -> &GetGroupsInCommon { &self.inner } } /// Returns the total n...
Rust
0
ate::Pins::gpio28]. FunctionPwm: Gp28Pwm6A, /// PIO0 Function alias for pin [crate::Pins::gpio28]. FunctionPio0: Gp28Pio0, /// PIO1 Function alias for pin [crate::Pins::gpio28]. FunctionPio1: Gp28Pio1 } }, /// GPIO 29 supports following functi...
Rust
0
g::debug_span!("debug-span", you_can_pass="any params"); /// 1 + 1; /// // some other complex code /// } /// ``` #[cfg(any(feature = "std", feature = "with-tracing"))] #[macro_export] macro_rules! within_span { ( $span:expr; $( $code:tt )* ) => { $span.in_scope(|| { $( $code )* } ) }; ( ...
Rust
0
"SGPpM", "WPTE", "AGCpA.CL", "DEZ", "KRG", "MGApB.CL", "PLSB", "WLK", "ACC", "AX", "EUBK", "EXR", "SBM", "STXS", "CNS", "BJRI", "IIG", "WFIIE", "CHDw", "GRINY", "PYV", "BHBC", "HIV", "ICOR", "LCGI", "NYN", "SNBT", "GOAMC", "GOOG", "IFULE", "ITIGE", "QD", ...
Rust
0
import sys def to_octets(ip): return [int(i) for i in ip.split('.')] def dotless_decimal(ip): octets = to_octets(ip) result = octets[0] * 16777216 + octets[1] * \ 65536 + octets[2] * 256 + octets[3] return result def dotted_hex(ip): octets = to_octets(ip) hex_octets = [hex(i) for i...
Python
1
x = 0 y = (1080 - h / rate) / 2 # h / rate ็œŸๅฎž่ง†้ข‘็š„ๅฎฝ else: x = (1920 - w / rate) / 2 y = 0 margin_x = (1920 - w / rate) / 2 margin_y = (1080 - y - h/rate) + 24/(h/rate) * 1080 elif video_layout == 2: # ็ซ–ๅฑ rate1 = w / 1080 rate2 ...
Python
1
continuous: return HexmeshDGSerendipityBasisSpace(geo, degree=degree, family=family) else: return HexmeshSerendipityBasisSpace(geo, degree=degree, family=family) if element_basis == ElementBasis.NONCONFORMING_POLYNOMIAL: return HexmeshPolynomialBasisSpace...
Python
1
FROM `my_project.dataset.orders` WHERE order_date BETWEEN '2023-01-01' AND '2023-12-31' GROUP BY user_id ), user_activities AS ( SELECT user_id, COUNT(*) as activity_count, COUNT(DISTINCT activity_type) as unique_activities FR...
Python
1
_trades.graphql", response_derives = "Debug" )] pub struct ListAccountTrades; #[derive(GraphQLQuery)] #[graphql( schema_path = "src/graphql/schema.json", query_path = "src/graphql/queries/list_candles.graphql", response_derives = "Debug" )] pub struct ListCandles; #[derive(GraphQLQuery)] #[graphql( ...
Rust
0
x, .. }) => is_type_name(x, "GlobalsBuilder"), _ => false, } } <gh_stars>0 //! TOML file configuration options. use super::options; use super::AppSettings; use commons::de::de_loglevel; use commons::MergeOptions; use failure::{Fallible, ResultExt}; use std::io::Read; use std::{fs, io, p...
Rust
0
alloc::string::String; use alloc::vec::Vec; pub type size_t = usize; pub type c_char = i8; pub type c_short = i16; pub type c_int = i32; pub type c_long = i64; pub type uint8_t = u8; pub type uint16_t = u16; pub type uint32_t = u32; pub type uint64_t = u64; pub type int8_t = i8; pub type int16_t = i16; pub t...
Rust
0
tion('้ฃžๆœบๅคงๆˆ˜') while True: #่ƒŒๆ™ฏ่‰ฒๅกซๅ…… window_screen.fill(bg_color) #ๅพ—ๅˆ†ๆ›ดๆ–ฐ if hit_score >= 999: hit_score = 999 if hit_score > hit_score_temp and hero: hit_score_temp = hit_score show_score_HP() elif hit_score < hit_score_temp: ...
Python
1
flat::CALL_ME_HAND.default as &crate::Emoji), ("calling" , &crate::flat::MOBILE_PHONE_WITH_ARROW as &crate::Emoji), ("cambodia" , &crate::flat::FLAG_CAMBODIA as &crate::Emoji), ("camel" , &crate::flat::CAMEL as &crate::Emoji), ("camera" , &crate::flat::CAMERA as &crate::Emoji), ("camera_flash" , &crate::flat::CAMERA_WI...
Rust
0
_list` wchar::wch_c!("%1 %2 %3\n").as_ptr() as _, 0, // message id - ignored 0, // language id - ignored out.as_mut_ptr() as _, 1, // minmum number of output `WCHAR` elements parts.as_ptr() as _, ); if result == 0 { ret...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2017 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
Python
1
from torchmetrics import Metric import torch import numpy as np import sklearn.metrics class CrossEntropyLossMetric(Metric): """ Wrapper around the torch.nn.CrossEntropyLoss for use with torchmetrics. """ def __init__(self): super().__init__() self.add_state("summed_loss", default=...
Python
1
data blob found", ))?; let comment = splitn.next().unwrap_or("").trim().to_string(); Ok(SshKey { pub_blob: base64::decode(data_encoded.trim()) .map_err(|e| io::Error::new(io::ErrorKind::Other, e))?, priv_file: priv_blob, unlocked_key: None, ...
Rust
0
model_name = "os_main.py" import sys def main(osdir,hmi,key): os_dir= osdir print(f"<osmain> ไฟกๆฏ EaseMCUOSๅฏๅŠจ ไฝ็ฝฎ{os_dir}") hmi.tx("page sysload") hmi.tx(f'bootlog.txt="EaseMCUOSๅฏๅŠจ ไฝ็ฝฎ{os_dir}"') print(f"<osmain> ไฟกๆฏ ๅŠ ่ฝฝ็ณป็ปŸๅ†…ๆ ธoscore") sys.path.append(f"{os_dir}/syscore") oscoreapi = __import__("sy...
Python
1
(self.data & 0x000000FF) as u8 } /// Get the alpha value pub fn a(&self) -> u8 { ((self.data & 0xFF000000) >> 24) as u8 } /// Interpolate between two colors pub fn interpolate(start_color: Color, end_color: Color, scale: f64) -> Color { let r = Color::interp(start_color....
Rust
0
serMarshal(param0: *const u32, param1: *mut u8, param2: *const super::super::super::UI::WindowsAndMessaging::HACCEL) -> *mut u8; #[doc = "*Required features: `\"Win32_System_Com_Marshal\"`, `\"Win32_UI_WindowsAndMessaging\"`*"] #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub fn HACCEL_UserMarshal64(par...
Rust
0
()).await } } #[derive(Debug, Parser)] pub struct Logout { #[clap(long, short = 's')] /// ่ฟžๆŽฅๆ–นๅผ host: Option<NetState>, } #[async_trait] impl TUNetCommand for Logout { async fn run(&self) -> Result<()> { let client = create_http_client()?; let cred = read_username()?; let c ...
Rust
0
assert!(t.try_push_char('ั').is_err()); assert!(t.try_push_char('\u{a66e}').is_err()); assert!(t.try_push_char('\u{1f4a9}').is_err()); assert_eq!(b"x\0\xa0", t.as_byte_slice()); } #[test] fn format() { assert_eq!("", &*format_tendril!("")); assert_eq!("two and...
Rust
0
_pb); let edge_location_pb = parse_pb::<EdgeLocationPb>(data_operation_pb.get_locationBlob())?; let edge_kind_pb = edge_location_pb.get_edgeKind(); let edge_kind = EdgeKind::from_proto(edge_kind_pb); let property_map = PropertyMap::from_proto(data_operation_pb.get_props()); graph.insert_overwrite_e...
Rust
0
n, linewidth=2) plt.ylabel('Social signals', fontsize=12) plt.xlim([0, times_waveform[-1]]) plt.ylim([0.05, 1.05]) plt.yticks(list(range(0, 2, 1))) plt.legend(loc="upper right", fontsize=12) #################### # 41 phones #################### plt.subplot(313) line_sil, = plt.p...
Python
1
}|jj}|s|jdS|d}|r"t j|dz| dred|vrtt| d...
Python
1
ternal.utils.logging.MaxLevelFilter", "level": logging.WARNING, }, "restrict_to_subprocess": { "()": "logging.Filter", "name": subprocess_logger.name, }, "exclude_subprocess": { ...
Python
1
r structure"] impl crate::Writable for FWPWRITE3 {} #[doc = "Internal. Only to be used through TI provided API."] pub mod fwpwrite3; #[doc = "Internal. Only to be used through TI provided API.\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::...
Rust
0
* (ep - sar[i-1]) if lows[i] <= sar_value: position = "long" ep = lows[i] af = acceleration sar.append(sar_value) current_price = closes[-1] current_sar = sar[-1] # ไฟกๅทๅˆคๆ–ญ if current_price > current...
Python
1
} } fn build_command(namespace: String, index_name: String) -> String { return format!("sindex/{}/{}", namespace, index_name); } fn parse_response(response: &str) -> Result<Status> { match response.find(SUCCESS_PATTERN) { None => { if response.contains(FAI...
Rust
0
s, ref name) => format!( "missing override of abstract method `{}` in class `{}`.", cls, name ), SemError::ModifierNotAllowedForStaticMethod(ref modifier) => { format!("modifier `{}` not allowed for static method.", modifier) } ...
Rust
0
ror('Unknown mode') <BLANKLINE> ...sysexit(stat, mode) 9 10 def sysexit(stat, mode): ---> 11 raise SystemExit(stat, 'Mode = %s' % mode) 12 13 def bar(mode): <BLANKLINE> SystemExit: (2, 'Mode = exit') In [23]: %xmode verbose Exception reporting mode: Verbose In [24]: %tb --------------------...
Python
1
s, stdout, _) = (self.command_runner)(&vec!["ip", "tuntap", "list"])?; let caps = TUNTAP_RE.captures(&stdout); match &caps { Some(c) => self.ensure_is_same_user(&c[1]), None => Ok(Warning(format!( "{}. To resolve, {}", NO_TUNTAP_MESSAGE, NO_TUNTAP_...
Rust
0
# # Copyright (C) 2010-2017 Samuel Abels # The MIT License (MIT) # # 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,...
Python
1
(); individ_trips.push(Some(IndividTrip::new( trip.orig.depart_at, trip.orig.purpose, trip.from, trip.to, trip.orig.mode, ))); trips_per_person.insert(trip.orig.person, (trip.orig.seq, idx)); } info!( "{} clipped trips, ...
Rust
0
e_inversion.scheduler_inference = scheduler_class.from_config(pipe_inference.scheduler.config) config = RunConfig(num_inference_steps=4, num_inversion_steps=4, guidance_scale=0.0, inversion_max_step=0.6) input_image = "example_images/lion.jp...
Python
1
def gcd(a, b): if b == 0: return a return gcd(b, a % b) num1 = 48 num2 = 18 print(f"GCD of {num1} and {num2} is:", gcd(num1, num2))
Python
1
(); } } // No collisions false } } impl TypeInfo for Player<'_> { fn type_of(&self) -> &'static str { "Player" } } // Obstacles pub struct Wall<'a> { sprite: Surface<'a>, pub rect: Rect, collider: Rect, pub sx: i32, pub sy: i32, solid: bo...
Rust
0
const ZPOOL_CONFIG_REBUILD_TXG: &'static [u8; 12usize] = b"rebuild_txg\0"; pub const ZPOOL_CONFIG_COMMENT: &'static [u8; 8usize] = b"comment\0"; pub const ZPOOL_CONFIG_SUSPENDED: &'static [u8; 10usize] = b"suspended\0"; pub const ZPOOL_CONFIG_SUSPENDED_REASON: &'static [u8; 17usize] = b"suspended_reason\0"; pub const Z...
Rust
0
e, path, flags else: flags &= ~self.DODIR self._fill_lock("") return None, None, flags def next(self, ctx): flags = self.anchor.r_s("ap_Flags") org_flags = flags # check DODIR flag and add first level of dir entries if flags & self.DODIR ...
Python
1
import importlib import pkgutil from typing import Dict, Type REGISTRY: Dict[str, Type] = {} def discover_and_register( root_package: str, target_filename: str = "adaptor.py", class_name: str = "Adaptor", base_class: type | None = None, ) -> Dict[str, Type]: """ ๅœจ root_package ไธ‹้€’ๅฝ’ๆŸฅๆ‰พๆ‰€ๆœ‰ๅญๆจกๅ—๏ผŒๅฎšไฝๆ–‡ไปถๅ...
Python
1
#[derive(Serialize, Deserialize, Debug, Clone)] pub struct SlimUser { pub email: String, } impl From<Claims> for SlimUser { fn from(claims: Claims) -> Self { SlimUser { email: claims.email, } } } impl From<User> for SlimUser { fn from(user: User) -> Self { SlimUser ...
Rust
0
{ if ss.len() == 0{ continue; } if ss.len() != 3{ panic!("This function changes 3 amino acid code to 1 amino acid letter. You provided {}",ss); } ret.push(AA_3_TO_1.lock().unwrap().get(ss).unwrap_or(&("X".to_string())).clone()); } return ret; } pub...
Rust
0
enumerate() { if value < smallest { smallest = value; smallest_index = index; } } smallest_index } /// ๅฏนๆ•ฐ็ป„่ฟ›่กŒๆŽ’ๅบ pub fn selection_sort<T: PartialOrd + Copy>(arr: &mut Vec<T>) -> Vec<T> { let mut new_arr: Vec<T> = Vec::new(); for _ in 0..arr.len() { // ๆ‰พๅ‡บๆ•ฐ็ป„...
Rust
0
BMARINE\x04\x04\x04\x04"); assert_eq!(expected, text.bytes()); } #[test] fn PaddedText_12345_16() { let text = match PaddedBytes::from_text("12345", 16) { Ok(x) => x, Err(x) => panic!(x), }; let expected = ::byte_conversion::readable_text_to_bytes(&...
Rust
0
cept Exception as e: print(f" โŒ Summary slide error: {e}") print(f" ๐Ÿ“Š Total slides created: {len(charts_created)}") return prs, charts_created async def create_robust_showcases(): """Create robust showcases for testing.""" print("\n๐Ÿ”ง Creating Robust Chart Showcases") pr...
Python
1
# @greyyvbss from userbot import CMD_HANDLER as cmd from userbot import CMD_HELP from userbot.utils import edit_or_reply, cilik_cmd @cilik_cmd(pattern="sponge(?: |$)(.*)") async def _(event): await edit_or_reply( event, "โ”ˆโ”ˆโ•ฑโ–”โ–”โ–”โ–”โ–”โ–”โ–”โ–”โ–”โ–”โ–”โ–\n" "โ”ˆโ•ฑโ•ญโ–โ•ฎโ•ญโ”ปโ”ปโ•ฎโ•ญโ”ปโ”ปโ•ฎโ•ญโ– \n" "โ–•โ•ฎโ•ฐโ–โ•ฏโ”ƒโ•ญโ•ฎโ”ƒโ”ƒโ•ญโ•ฎโ”ƒโ•ฐโ– \n...
Python
1
_file() { let working_dir = tempfile::tempdir().unwrap().into_path(); let input = Config { driver: DriverTypes::Blackhole, operations: vec![domain::Operation::Exec { working_dir: working_dir.clone(), command: "bash".into(), args: ve...
Rust
0
t thc = (s.radius * s.radius - d2).sqrt(); Some(r.origin + r.direction * (tca - thc)) } } #[cfg(test)] mod tests { use std; use crate::prelude::*; use crate::Ray2; use approx::assert_ulps_eq; use cgmath::{Basis2, Decomposed, Point2, Rad, Rotation2, Vector2}; use super::*; // ...
Rust
0
KomaKind::SOu => false, k if k < KomaKind::GFu => true, _ => false, } }).count() } else { 0 } }).fold(0, |sum,s| sum + s) >= 10 }, &MochigomaCollections::Empty => { oy <= 2 && kinds.iter().enumerate().map(|(y,row)| {...
Rust
0
self.frame_embs = ( nn.Parameter(torch.randn(max_num_frames, dim)) if exists(max_num_frames) else None ) self.media_time_embs = ( nn.Parameter(torch.randn(max_num_media, 1, dim)) if exists(max_num_media) else None ) ...
Python
1
self) -> Vec<Box<dyn PciCapability>> { vec![Box::new(PcieCap::new( PcieDevicePortType::RootPort, true, 0, ))] } fn set_capability_reg_idx(&mut self, id: PciCapabilityID, reg_idx: usize) { if let PciCapabilityID::PCIExpress = id { self.pcie...
Rust
0
device.build(&pipeline_ci)? }; let toon_pipeline = { let specialization_data = SpecializationData { light_model: 1, toon_desaturation_factor: 0.5, }; specialization_info.p_data = &specialization_data as *const SpecializationData as _; let shaders = [ ...
Rust
0
String { self.token.clone() } fn generate_token() -> String { thread_rng() .sample_iter(&Alphanumeric) .take(50) .map(char::from) .collect() } pub fn make() -> Self { NewSession { token: Self::generate_token(), ...
Rust
0
one ID, we _will_ use that one. // Note that `10` is a bootstrapped entid; we use it here as a known-good value. let t = "[[:db/add 10 :db.schema/attribute \"temp\"]]"; let report = conn.transact(&mut sqlite, t) .expect("transact succeeded"); assert_eq!(report.te...
Rust
0
write_settings(store.settings) def move_selected_down(self) -> None: row = self.locations_view.currentIndex().row() if row == -1 or row >= self.locations_model.rowCount(): return below = self.locations_model.locations[row + 1] current = self.locations_model.locatio...
Python
1
cascade flushing instead. fn flush(&self, asid: Option<Asid>, vaddr: Option<u64>) { self.flush_local(asid, vaddr); self.parent().flush(asid, vaddr); } } pub struct PageWalkerPerformanceModel { pub start_delay: usize, pub walk_delay_before: usize, pub walk_delay_after: usize, pu...
Rust
0
"; pub const SYNC_CMD_PING: &[u8] = b"*1\r\n$11\r\nsynccmdping\r\n"; pub const OK_FRAME: &[u8] = b"+OK\r\n"; pub const SLOT_SIZE: usize = 16384; extern crate bollard; extern crate hyper; extern crate tokio; use bollard::errors::Error; use bollard::volume::*; use bollard::Docker; use tokio::runtime::Runtime; use std...
Rust
0
pub rpc_path_length: usize, pub enable_child_process: bool, pub enable_sign_hash: bool, } #[no_mangle] pub unsafe extern "C" fn rsn_node_rpc_config_create(dto: *mut NodeRpcConfigDto) -> i32 { let config = match NodeRpcConfig::new() { Ok(c) => c, Err(_) => return -1, }; let dto = ...
Rust
0
t_train([(200, 250), (200, 249)], instances) def test_inf_nan_data(self): self.model.eval() self.model.score_threshold = -999999999 for tensor in [self._inf_tensor, self._nan_tensor]: images = ImageList(tensor(1, 3, 512, 512), [(510, 510)]) features = [ ...
Python
1
i_agent_example.py --chat-only --live # Direct to live multi-agent chat mode python star_multi_agent_example.py --live --provider openai # Use specific provider """, ) parser.add_argument("--live", action="store_true", help="Run with actual LLM calls (requires API keys)") parser.add_argument("-...
Python
1
::ptr_eq(cb, rhs_cb) } } impl<IN, OUT> fmt::Debug for Callback<IN, OUT> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "Callback<_>") } } impl<IN, OUT> Callback<IN, OUT> { /// This method calls the callback's function. pub fn emit(&self, value: IN) -> OUT { ...
Rust
0
lank=True, null=True) total_ports = models.TextField(blank=True, null=True) total_open_ports = models.TextField(blank=True, null=True) total_close_ports = models.TextField(blank=True, null=True) created_time = models.DateTimeField( auto_now=True, blank=True, ) created_by = models...
Python
1
dReducer<Self>; fn reducers() -> (Self::ReduceA, Self::ReduceC) { Default::default() } } impl<T, S> FromParallelStream<T> for HashSet<T, S> where T: Eq + Hash + Send + 'static, S: BuildHasher + Default + Send + 'static, { type ReduceA = PushReducer<T, Self>; type ReduceC = ExtendReducer<Self>; fn reducers()...
Rust
0
if slashes /// should be applied immediately, without opportunity for intervention. #[pallet::constant] type SlashDeferDuration: Get<EraIndex>; /// The origin which can cancel a deferred slash. Root can always do this. type SlashCancelOrigin: EnsureOrigin<Self::Origin>; /// Interface for interacting with ...
Rust
0
import sched import time import threading # Create a scheduler object scheduler = sched.scheduler(time.time, time.sleep) # Define the task to be executed def print_hello(): print("Hello, world!") # Schedule the task to run at fixed intervals def schedule_task(interval, task): scheduler.enter(interval, 1, sch...
Python
1
)] pub fn mapv(ndarray: JsValue, fun: &js_sys::Function) -> JsReturn { let mat = js_into!(ndarray, ArrayD<f32>)?; let mat: ArrayD<f32> = mat.mapv(|a| { let res = fun .call1(&ndarray, &JsValue::from(a as f32)) .unwrap(); res.as_f64().unwrap() as f32 }); Ok(JsValue::from_serde(&mat).unwrap()) ...
Rust
0
e for custom settings - docs/CONFIGURATION.md for options ๐Ÿ†˜ Need help? - GitHub Issues: https://github.com/if-unismuh/plagicheck/issues - Documentation: docs/ - Postman Collection: postman/ โœจ Happy Paraphrasing! """ print(completion_msg) def main(): """Main setup function.""" print_banner()...
Python
1
_fn(cs, nested_fn(cs, ut)); }); When a resource is declared in the closure-signature-like header, it should be in one of the following forms: * `request_id: resource_id` * `request_id: resource_id<ResourceKind>` where ResourceKind is one of CNodeSlots or UntypedBuddy."; #[proc_macro] pub fn smart_alloc(tokens: Token...
Rust
0
"""LLM Rules CLI package for managing IDE prompts and rules.""" import typer from typing_extensions import Annotated from llm_ide_rules.commands.explode import explode_main from llm_ide_rules.commands.implode import cursor, github from llm_ide_rules.commands.download import download_main __version__ = "0.3.0" app =...
Python
1
{ // let listener = TcpListener::bind("0.0.0.0:8080").unwrap(); // println!("starting server..."); // let _arr: [i32; 20] = [2; 20]; // for stream in listener.incoming() { // let stream = stream.unwrap(); // handle_connection(stream); // println!("do_something..."); // ...
Rust
0
decode; mod encode; mod write_and_flush; pub use buf::BufExt; pub use buf_mut::BufMutExt; pub use buf_stream::BufStream; pub use decode::Decode; pub use encode::Encode; #![allow(clippy::upper_case_acronyms)] use std::fmt; use std::str::FromStr; use tracing::instrument; /// GitHub repos. #[derive(Debug, Copy, Clone,...
Rust
0
cription': "Enter your token in the format 'Bearer <token>'" } }, } EMAIL_HOST = os.getenv('EMAIL_HOST') EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER') EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD') EMAIL_PORT = 587 EMAIL_USE_TLS = True DEFAULT_FROM_EMAIL = os.getenv('DEFAULT_FROM_EMAIL') PASSWORD...
Python
1
ch_result (This can't error.) last_fetch_result = _stored_object_to_fetch_result( exit_stack, stored_object, step.fetch_errors, dir=basedir ) result = await asyncio.get_event_loop().run_in_executor( None, fetch_or_wrap_error, exit_stack, ...
Python
1
with_capacity(size); while let Some(kv) = it.try_next().await? { map.entry(kv.metakey).or_default().push(kv.metavalue); } Ok(map) } /// Add metadata for a mod that this `Metadata` refers to. #[allow(clippy::should_implement_trait)] pub async fn add(self, metadata: M...
Rust
0
rint!("{}", x); } println!(); } println!(); } #[cfg(test)] mod tests { use super::*; #[test] fn test() { let input: Vec<String> = "L.LL.LL.LL LLLLLLL.LL L.L.L..L.. LLLL.LL.LL L.LL.LL.LL L.LLLLL.LL ..L.L..... LLLLLLLLLL...
Rust
0
#!/usr/bin/env python3 """ Interactive Configuration Mixer for mtop Demos Like a recipe builder but for demo configurations! Choose your adventure style interface to create custom demo scenarios. Usage: ./scripts/config-mixer.py # Interactive mode ./scripts/config-mixer.py --save my-custom-demo # Save the recip...
Python
1
and "exec_script_allowlist" not in settings_content ): # The build system uses old naming but .gn uses new - need to patch logger.info( "Patching .gn file: exec_script_allowlist -> exec_script_whitelist" ...
Python
1
"test_component", error, is_critical=False ) # Verify both systems handled the error appropriately assert pumpswap_response['status'] == 'error' assert component_response['status'] == 'degradation_applied' # Check system health health_status = resilience...
Python
1
current = 0 next_val = 1 while next_val < 4: while next_val < 4 and grid[i][next_val] == 0: next_val += 1 if next_val >= 4: next_val -= 1 current_value = math.log2(grid[i][current]) if...
Python
1
, PartialEq, Eq)] pub(crate) enum SingleMessageCompressionOverride { /// Inherit whatever compression is already configured. If the stream is compressed this /// message will also be configured. /// /// This is the default. Inherit, /// Don't compress this message, even if compression is enabled...
Rust
0
eek_to(get_fat_offset(fat_type, start_cluster, fat_start_sector, bytes_per_sec))?; let offset = get_fat_offset(fat_type, start_cluster, fat_start_sector, bytes_per_sec); let blk_offset = fs.get_block_offset(offset); // FAT12 tables do not exceed 6K let block_buf = get_bl...
Rust
0
data = [0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x30, 0x89, 0xe4, 0xf2, 0x29, 0x20, 0x32, 0x89, 0x14, 0x80]; let mut reader = U8Reader::new(&data[..]); let inst = decoder.decode(&mut reader).unwrap(); assert_eq!(format!("{}", inst), expected); let expected = "[MMI] shladd r14=r17,0x3,r14;; nop.m 0x0; shl r...
Rust
0
ormat!("โ†‘{}", index)); ctx.print_color(53, y, get_item_color(ecs, ent), black, &item_name.name); y += 1; index += 1; } }; let hunger = ecs.read_storage::<HungerClock>(); let hc = hunger.get(*player_entity).unwrap(); match hc.state { HungerState::WellFe...
Rust
0
# pip langchain, streamlit, OpenAI, Snowflake-python-connector import os from pathlib import Path from PIL import Image from app_secrets import OPENAI_API_KEY import streamlit as st from snowflake_connection import execute_sf_query from langchain.prompts import load_prompt from langchain_openai import OpenAI from langc...
Python
1
string()); } #[test] fn test_polynomial_str_has_ones() { let a = Polynomial::new(vec![-1, -1, -1, 0]); assert_eq!("-x^3 - x^2 - x", a.to_string()); } #[test] fn test_polynomial_str_has_negative() { let a = Polynomial::new(vec![-2, -1, -1, 0]); assert_eq!("-2x^3 ...
Rust
0