text
string
label_name
string
labels
int64
, A32Fiq = 0x55, } /// The default exception handler. /// This is the entry point for any exception taken at any core. The type gives the hint on what /// the exyception is about, sync, irq, etc. This entry point is called from the ``ruspiro-boot`` /// crate when this is used for bootstrapping. Otherwise the custo...
Rust
0
ue if node in transparent_input_nodes: return transparent_input_nodes[node] if is_non_compute_node(node): for input_n in node.all_input_nodes: if not is_transparent_input_node(input_n, partition, removed_nodes): transpar...
Python
1
GUES (following)") print("3) Comparar SEGUIDOS vs SEGUIDORES (no te siguen de vuelta)") print("4) Ver a QUIÉNES SEGUISTE y NO ACEPTARON (pending)") print("0) Salir") op = input("> ").strip() if op == "1": opcion_1_ver_followers() elif op == "2": op...
Python
1
import cv2 import numpy as np # NOTE: Requires OpenCV (cv2). Install with: pip install opencv-python # Initialize feature detector orb = cv2.ORB_create() # Load two consecutive frames (replace with actual drone images) img1 = cv2.imread('frame1.png', cv2.IMREAD_GRAYSCALE) img2 = cv2.imread('frame2.png', cv2.IMREAD_G...
Python
1
_shit::function_calls_another_function_from_that_other_module(); my::nested::function(); simple_mod::some_func(); module_under_folder::another_func(); println!("{} + {} = {}", 1, 2, add(1, 2)); let s = "this is string".to_string(); println!("{}", s); let slice: &str = &s; println!("{}", ...
Rust
0
switch_signal[ix + (k >> 3)] |= bits; //if (((k + 1)>> 3) != (k >>3)) { // println_stderr!("{:} ss {:} c {:?}", k, switch_signal[ix + (k >> 3)],cost[k>>3]); //} } return; } let ymm_min_cost = v256::splat(min_cost); let ymm_block_switch_cost ...
Rust
0
the selection from turning "inside out." if resize_vector[ax] > 0 && pos1[ax] > pos2[ax] || resize_vector[ax] < 0 && pos1[ax] < pos2[ax] { pos2[ax] = pos1[ax].clone() } } } NdRect::span(pos1, pos2) } /// Resizes a selection given cur...
Rust
0
# Ultralytics YOLO 🚀, AGPL-3.0 license import collections from copy import deepcopy from .augment import LetterBox class MixAndRectDataset: """ A dataset class that applies mosaic and mixup transformations as well as rectangular training. Attributes: dataset: The base dataset. imgsz: T...
Python
1
from twttr_v2 import shorten def testVowels(): assert shorten("Twitter") == "Twttr" assert shorten("What's your name?") == "Wht's yr nm?"
Python
1
e_js_with_tokenizer; use crate::js::tokenizer::{Token as JSToken, Tokenizer as JSTokenizer}; type FUntil<'a> = for<'r> fn(&mut Tokenizer<'a>) -> Result<bool, ParseError>; pub struct Context<'a, 'b> { tokenizer: &'b mut Tokenizer<'a>, until: FUntil<'a>, } impl<'a, 'b> Context<'a, 'b> { pub fn ended(&mut self) -...
Rust
0
ENABLE_ACTIVE_PROCS: u32 = 64u32; #[doc = "*Required features: `\"Win32_System_Iis\"`*"] pub const MD_CPU_ENABLE_ALL_PROC_LOGGING: u32 = 1u32; #[doc = "*Required features: `\"Win32_System_Iis\"`*"] pub const MD_CPU_ENABLE_APP_LOGGING: u32 = 4u32; #[doc = "*Required features: `\"Win32_System_Iis\"`*"] pub const MD_CPU_E...
Rust
0
.map(|p| p.to_str().unwrap()) .collect::<Vec<_>>() .join("\", \"") ), Err(err) => println!("{:>14}: {}", name, err), } } println!("\nListing writable locations:"); for (name, value) in &locations { match sl.w...
Rust
0
perties": properties, "required": required } } schemas.append(schema) return schemas async def execute_tool(self, name: str, parameters: Dict[str, Any], group_name: Optional[ToolGroup] = None) -> Any: """执行工具 Args: ...
Python
1
used when the goal is "near by" const NEAR_VELOCITY_GAIN: f64 = 0.01; /// **\[private\]** The weight of the "distance" evaluation function used when the goal is "near by" const NEAR_DISTANCE_GAIN: f64 = 0.8; /// **\[private\]** The weight of the "theta" evaluation function used when the goal is "near by" const NEAR_TH...
Rust
0
# https://opentelemetry.io/docs/languages/python/getting-started/ from random import randint from fastapi import FastAPI, Request import uvicorn import logging from opentelemetry import trace from opentelemetry import metrics from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter from...
Python
1
from_ptr(self.0.env); let (__jni_class, __jni_method) = __jni_env.require_class_method("android/media/tv/TvTrackInfo$Builder\0", "setExtra\0", "(Landroid/os/Bundle;)Landroid/media/tv/TvTrackInfo$Builder;\0"); __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr()...
Rust
0
ceiving from an empty channel"), TryRecvError::Closed => write!(f, "receiving from an empty and closed channel"), } } } use core_cli::AxonCli; fn main() { AxonCli::init().start(); } fn main() { println!("****************"); let an_integer = 1u32; let a_bool:bool = true; // ...
Rust
0
try: from ._version import __version__, __version_tuple__ except Exception as e: import warnings warnings.warn(f"Failed to read commit hash:\n{e}", RuntimeWarning, stacklevel=2) __version__ = "dev" __version_tuple__ = (0, 0, __version__) def _prev_minor_versio...
Python
1
para CCDN""" st.subheader("🎂 Generador de Cumpleaños") st.info("💡 Crea tarjetas personalizadas con la identidad corporativa de CCDN") with st.form("form_cumpleanos_ccdn", clear_on_submit=False): # Datos del paciente nombre_paciente = st.text_input( ...
Python
1
d_2nd_key_unwrapped.bitmap(), &[0b1100_0000, 0u8, 0u8, 0u8] ); assert!(signed_by_1st_and_2nd_key_unwrapped .verify(&MESSAGE_HASH, &multi_public_key_2of3) .is_ok()); // Signing with the 1st and 3rd keys must succeed. let signed_by_1st_and_3rd_key = MultiEd25519Signature::new(vec!...
Rust
0
affine_matrix(); Transform2::from_specialized(matrix) } /// Calculate the inverse of the similarity transformation. /// /// ## Example /// /// ``` /// # use cglinalg::{ /// # Similarity2, /// # Rotation2, /// # Translation2, /// # Degrees, /// # ...
Rust
0
𖠴', 'ﰞ', 'ࠒ', '𝚲', '益', 'B', 'Ꮁ', '⾺', '⍱', '𘫻', '𒔣', '🛓', 'ユ', '🞲', '𐺀', '𝦧', '🆏', 'ᰅ', '🟦', 'ꋁ', 'ꬨ', '𐨫', '𘮙', '🌠', '𘮑', 'ㅦ', '\u{730}', 'Ⳃ', 'ࣉ', 'ᛌ', 'Ű', 'ﳹ', '𘢤', '𓂛', 'ﭾ', '𝞒', '\u{200f}', '˕', '𔕖', '𒂻', 'ᘲ', 'ᄽ', '⏋', '𝞐', 'ͷ', '𑣟', 'Ҏ', 'ࢨ', 'ᑟ', '⢟', '𒾸', '𞢘', 'ꀠ', ...
Rust
0
for leaf in result[2]: print(leaf.name) # Append data row to the list output_rows.append({ 'Tree': paths[0], 'Clade': args.clade[0], 'Status': result[1], 'NumberDisrupting': len(result[2]), ...
Python
1
wrap(); let install = crate::install::Client::open_from_pkgfs_root(&root).unwrap(); let client = Client::open_from_pkgfs_root(&root).unwrap(); let pkg = PackageBuilder::new("multiblob") .add_resource_at("data/first", "contents of first blob".as_bytes()) .add_resource_at(...
Rust
0
import time from loguru import logger from pymongo import MongoClient from zenml import step from src.configs.prompts import SUMMARY_VARIANTS from src.steps.generate_summaries.helpers import summarize_content @step(enable_cache=False) def summarize_step( mongodb_uri: str, mongodb_database: str, mongodb_...
Python
1
= "musl"), target_pointer_width = "64"), repr(align(8)))] pub struct pthread_rwlockattr_t { #[cfg(all(not(feature = "align"), target_env = "musl"))] __align: [::c_int; 0], #[cfg(all(not(feature = "align"), not(target_env = "musl")))] __align: [::c_l...
Rust
0
import os import datasets import regex import unicodedata import numpy as np from torch.utils.data.dataloader import DataLoader from torch.utils.data.dataset import Dataset from tqdm import tqdm class SimpleTokenizer: ALPHA_NUM = r'[\p{L}\p{N}\p{M}]+' NON_WS = r'[^\p{Z}\p{C}]' def __init__(self, **kwarg...
Python
1
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
Python
1
from pudzu.charts import * df = pd.read_csv("datasets/flagssubdivisions.csv") FONT = sans fg, bg="black", "#EEEEEE" default_img = "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/No_flag.svg/1024px-No_flag.svg.png" def process(d): if not d: return None description = get_non(d, 'description') de...
Python
1
no_mangle_generic_items, overflowing_literals, path_statements, patterns_in_fns_without_body, private_in_public, unconditional_recursion, unused, unused_allocation, unused_comparisons, unused_parens, while_true )] use std::fmt; use tower_service::Service; use tracing::Level;...
Rust
0
.unwrap() = std::cmp::min( *memoria.get(i as usize).unwrap().get(j as usize).unwrap(), med_recursivo(str1, str2, i - 2, j - 2, memoria) + CUSTO_SWAP, ); } return *memoria.get(i as usize).unwrap().get(j as usize).unwrap(); } // Implementação iterativa com abordagem 'bottom u...
Rust
0
# -*- coding: utf-8 -*- import wx from outwiker.core.treetools import testreadonly from outwiker.app.services.messages import showError from outwiker.gui.baseaction import BaseAction class MovePageUpAction (BaseAction): """ Переместить страницу на одну позицию вверх """ stringId = "MovePageUp" ...
Python
1
use specs::prelude::*; use super::*; use crate::components::{Pools, Player, Attributes, Confusion, SerializeMe, Duration, StatusEffect, Name, EquipmentChanged, Slow, DamageOverTime, Skills}; use crate::map::Map; use crate::gamesystem::{player_hp_at_level, mana_at_level}; use crate::gamelog::GameLog; use specs::sav...
Rust
0
arent(field_name: String, equal: bool, children: Vec<FieldComparison>) -> Self { Comparison::Parent { field_name, equal, children, } } pub fn from_slice<T: Debug + PartialEq<T>>(field_name: String, a: &[T], b: &[T]) -> Self { let mut children = vec![]...
Rust
0
x1000 * index)); table_zero.get_mut(index).set_present(); table_zero.get_mut(index).set_user_access(); } // Also, map it to highmem at 0xc0000000 dir.get_mut(0x300).set_address(table_zero_frame.get_address()); dir.get_mut(0x300).set_present(); // Finally, move the stack to the top of memory, just belo...
Rust
0
let x = ((self.mouse_x / self.frame_width) * 2.0) - 1.0; let y = ((self.mouse_y / self.frame_height) * 2.0) - 1.0; let triangle = Triangle { points: [ [-0.5, 0.5], [-0.5, -0.5], [x as f32, y as f32] ] }; r...
Rust
0
Repo { pub contents: Arc<Mutex<GameLobby>>, } impl GameLobbyRepo for FakeGameLobbyRepo { fn get(&self) -> Result<GameLobby, FetchErr> { Ok(self.contents.lock().expect("mutex lock").clone()) } fn put(&self, game_lobby: &GameLobby) -> Result<(), WriteErr> { ...
Rust
0
| y_scaled_u /* << 0 */; let rgba_array: [RGBA8; 4] = cast(rgba_x4); rgba_array.iter().copied().take(pixels_remaining).for_each(|p| image.push(p)); pixels_remaining = pixels_remaining.saturating_sub(4); } } NetpbmDataFormat::Binary_Y_F32BE { max } => { let channel_max = i32x...
Rust
0
().to_string(), "expected '/-&' not '{' at 1:1"); } use fibers::sync::oneshot; use futures::{Future, Poll}; use slog::Logger; use std::fmt::Debug; use std::sync::mpsc as std_mpsc; use std::sync::mpsc::{RecvTimeoutError, SendError}; use std::sync::Arc; use std::thread; use std::time::{Duration, Instant}; ...
Rust
0
def x_or_y(n, x, y): """A simple program which should return the value of x if n is a prime number and should return the value of y otherwise. Examples: for x_or_y(7, 34, 12) == 34 for x_or_y(15, 8, 5) == 5 """ if n % 2 == 0: return x else: return y def x_or_y_2(...
Python
1
ct OriginMac { #[prost(bytes, tag = "1")] pub public_key: std::vec::Vec<u8>, #[prost(bytes, tag = "2")] pub signature: std::vec::Vec<u8>, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum DhtMessageType { /// Indicated this message is n...
Rust
0
from typing import Any from llama_index.core.output_parsers.base import StructuredOutput from llama_index.core.output_parsers.utils import parse_json_markdown from llama_index.core.types import BaseOutputParser from llama_index.core.vector_stores.types import VectorStoreQuerySpec class VectorStoreQueryOutputParser(B...
Python
1
_output.view(-1, weight.shape[0]) input = input.view(-1, weight.shape[1]) if ctx.config.grad_weight: # grad_weight = _dynamic_int8_mm(grad_output.T, input) grad_weight = _dynamic_int8_mm( input.T, grad_output ).T # this is slig...
Python
1
"""基于启发式方法计算令牌数量""" if not text: return 0 # 检测语言并选择合适的比率 language = self._detect_simple_language(text) ratio = self._char_to_token_ratios.get(language, self._char_to_token_ratios["default"]) # 计算单词数 import re words = len(re.f...
Python
1
GEN_GITLAB_PROJECT.clone(), environment: GEN_ENVIRONMENT.clone(), output_file: Some(GEN_OUTPUT_FILE.clone()), shell: *GEN_SHELL_TYPE, folder: GEN_FOLDER.clone(), per_page: *GEN_PER_PAGE, with_group_vars: *GEN_GROUP_VARS, parallel: num_...
Rust
0
-> Result<Self, u8> { let virtc = VGcnC { axes: axes, joysticks: joysticks, buttons: buttons, device_number: device_number }; match virtc.verify_vjoystick_compatibility() { Ok(_) => (), Err(_) => return Err(2) } match virtc.claim_and_reset() { ...
Rust
0
(shape) } pub fn shape<S: Into<ShapeFact>>(shape: S) -> TensorFact { TensorFact::default().with_shape(shape) } pub fn with_datum_type(self, dt: DatumType) -> TensorFact { TensorFact { datum_type: dt.into(), ..self } } pub fn with_shape<S: Into<ShapeFact>>(self, shape: S) -> Te...
Rust
0
import bs4 from strategies.image import GaijiImageHandlingStrategy from strategies.link import DefaultLinkHandlingStrategy class OKO12LinkHandlingStrategy(DefaultLinkHandlingStrategy): def get_href(self, html_glossary: bs4.element.Tag) -> str: collected_text = [] for child in html_glossary.conten...
Python
1
del_dir): return model_dir # Otherwise, make it relative to the application root app_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) return os.path.join(app_root, model_dir) def should_use_mock_model(self) -> bool: """Check if we should us...
Python
1
#!/usr/bin/python # # q_avg_size.py # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import sys import Log import MemPool import ChainDb import cStringIO import struct from bitcoin.coredefs import NETWORKS from bitcoin.co...
Python
1
f.search_after, timedelta): timestamp = datetime.now() - conf.search_after filter += [Range(field="@timestamp", gte=timestamp.isoformat() + "Z")] if conf.include_match or conf.exclude_match: filter += [Bool(must=conf.include_match, must_not=conf.exclude_match...
Python
1
auc_ood = auc(score_id, score_ood)[0] fpr_ood, _ = fpr_recall(score_id, score_ood, recall) result.append( dict(method=method, oodset=name, auroc=auc_ood, fpr=fpr_ood)) print(f'{method}: {name} auroc {auc_ood:.2%}, fpr {fpr_ood:.2%}') df = pd.DataF...
Python
1
ime() for _ in range(warmup_iterations): self.pipe(**warmup_args) end_time = time.time() print("Warmup complete.") print(f"Warmup time: {end_time - start_time:.2f} seconds") def generate(self, gen_args): # gen_args["generator"] = torch.Generator(device=device).ma...
Python
1
ategy, SlotProcessingError, VerifyBlockRoot, }; use std::marker::PhantomData; use types::{BeaconState, ChainSpec, EthSpec, Hash256, SignedBeaconBlock, Slot}; type PreBlockHook<'a, E, Error> = Box<dyn FnMut(&mut BeaconState<E>, &SignedBeaconBlock<E>) -> Result<(), Error> + 'a>; type PostBlockHook<'a, E, Error> = Pr...
Rust
0
.0, '\x1c\xd1': 0.0, '\x1c\xde': 0.0, '\x1c\xdf': 0.0, '\x1c\xdc': 0.0, '\x1c\xdd': 0.0, '\x1c\xda': 0.0, '\x1c\xdb': 0.0, '\x1c\xd8': 0.0, '\x1c\xd9': 0.0, '\x1c\xc6': 0.0, '\x1c\xc7': 0.0, '\x1c\xc4': 0.0, '\x1c\xc5': 0.0, '\x1c\xc2': 0.0, '\x1c\xc3': 0.0, '\x1c\xc0': 0.0, '\x1c\xc1': 0.0, '\x1c\xce': 0.0, '\x1c\xcf'...
Python
1
class Solution: def findOrder(self, numCourses: int, prerequisites: List[List[int]]) -> List[int]: # bfs, sort by levels and add them by levels, make sure no cycles aswell adjacency_list = [0] * numCourses graph = defaultdict(list) for u, v in prerequisites: # [[1,0],[2,0],[3,1],[3,2...
Python
1
# -*- coding: utf-8 -*- """ Task 22.1d Copy the Topology class from task 22.1c and modify it. Add the add_link method, which adds the specified link if it is not already in the topology. If the connection exists, print the message "Such a connection already exists", If one of the sides is in the topology, display th...
Python
1
an action fn decide_action(&mut self, state: &ActionState, data: &mut CharacterData) -> CharacterAction { // is burst CD off and has enough energy if state.rel_time.burst >= 20. && state.energy >= 80. { CharacterAction::Burst // check if skill can be used } else if state....
Rust
0
}; Ok(res) } } fn current_operation<'a>( document: &'a Document, operation_name: Option<&str>, ) -> Option<(&'a SelectionSet, &'a [VariableDefinition], bool)> { for definition in &document.definitions { match definition { Definition::Operation(operation_definition) =...
Rust
0
from typing import Optional from easynmt import EasyNMT from faster_whisper.transcribe import Segment from .opusmt_utils import OpusMT class EasyNMTWrapper: def __init__(self, device: str): self.translator = OpusMT() self.model = EasyNMT('opus-mt', translator=self.tran...
Python
1
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
Python
1
from aiogram.filters.state import StatesGroup, State class MethodicalBook(StatesGroup): main = State()
Python
1
!( SSL_FAILURE, SSL_read(ssl, buf.as_mut_ptr() as *mut c_void, 10) ); assert_eq!( SSL_FAILURE, SSL_write(ssl, buf.as_ptr() as *const c_void, 10) ); let wr_len_ptr = Box::into_raw(Box::new(0)); assert_eq!( SSL_FAILURE, SSL_write_early_data(ssl, buf.as_p...
Rust
0
import os import openai from loguru import logger from make_answer.chat.chat_invoker import ChatInvoker class LlmOpenai(ChatInvoker): def __init__(self, *args, **kwargs): base_url = os.environ.get("OPENAI_BASE_URL") if "base_url" in kwargs: base_url = kwargs["base_url"] api_ke...
Python
1
BasePosition::Last, RephPosition::AfterPost, RephMode::Explicit, BlwfMode::PostOnly ), IndicConfig::new( Some(script::KANNADA), true, 0x0CCD, BasePosition::Last, RephPosition::AfterPost, RephMode::Implicit, BlwfMode::PostOnly ), IndicConfig::new( Some(script::MALAYALAM),...
Rust
0
sitions.items(): total = sum(next_states.values()) for next_state in next_states: next_states[next_state] /= total # Print most likely transitions for state, next_states in transitions.items(): print(f"From state {state}, most likely next state: {next_states.most_common(...
Python
1
import enum class Smooth(enum.Enum): NearestNeighbour = 0 Linear = 1 Cosine = 2 Spline = 3 Cubic = 4
Python
1
from typing import Optional, List from src.Country import Country from TelegramFunctionality.BaseChat import BaseChat from TelegramFunctionality.User import BaseUser class User(BaseUser): def __init__(self, user_id: int, country: Country = None): super().__init__(user_id) self.latest_bot_message ...
Python
1
lag { operand_stack.push_int(1) } else { operand_stack.push_int(-1) }; let frame = Frame { operand_stack, local_vars, }; (val1, val2, frame) } #[allow(non_snake_case)] pub fn FCMPG(code_reader: CodeReader, frame: Frame) -> (ExecuteResult, CodeReader) { println!(...
Rust
0
n_table(comparison_data) # 累積報酬圖 self._plot_cumulative_returns_comparison(comparison_data) # 風險調整後績效 self._display_risk_adjusted_metrics(comparison_data) def _display_benchmark_comparison_table(self, data: Dict[str, Any]) -> None: """顯示基準比較表""" st.w...
Python
1
squared).sqrt() - 1.0); let phi = 2.0 * PI * r1; let x = phi.cos() * (1.0 - z * z).sqrt(); let y = phi.sin() * (1.0 - z * z).sqrt(); Vec3::new(x, y, z) } /* pub fn rand_in_hemisphere(normal: Vec3) -> Vec3 { let in_unit_sphere = rand_in_unit_sphere(); if in_unit_sphere * normal < 0.0 { -...
Rust
0
", AttributeConfig { index_direction: IndexDirection::Both, query_support: QuerySupport::Basic, trace_slack: Some(Time::TxId(1)), ..Default::default() }, ) ...
Rust
0
IF: u16 = 0x0000_0200; pub const FLAG_DF: u16 = 0x0000_0400; pub const FLAG_OF: u16 = 0x0000_0800; static PARITY_LOOKUP: [u16; 256] = [ FLAG_PF, 0, 0, FLAG_PF, 0, FLAG_PF, FLAG_PF, 0, 0, FLAG_PF, FLAG_PF, 0, FLAG_PF, 0, 0, FLAG_PF, 0, FLAG_PF, FLAG_PF, 0, FLAG_PF, 0, 0, FLAG_PF, FLAG_PF, 0, 0, FLAG_PF, 0, FLAG...
Rust
0
buf[5..7].copy_from_slice(&encode_u16(msg.y)); conns.write(buf); } sleep(MAIN_LOOP_INTERVAL); } } <reponame>nand-nor/yabts use std::io; //error::Error; use std::iter::Iterator; use yabts::transform::*; #[derive(Copy, Clone)] pub struct COBS {} impl _Encode for COBS { f...
Rust
0
ackets_at_dst<ChainA: ChainHandle, ChainB: ChainHandle>( chain: &ChainA, channel: &ConnectedChannel<ChainA, ChainB>, ) -> Result<Vec<Sequence>, Error> { let port_id_a = channel.port_a.value(); let channel_id_a = channel.channel_id_a.value(); let request = QueryPacketAcknowledgementsRequest { ...
Rust
0
#-------------------------------------------------------------------------------------------------- # HK_SuperProject.py #-------------------------------------------------------------------------------------------------- # Author: Henry King # Version 1.0 # Release Date: 8/16/2024 #-------------------------------------...
Python
1
self.table.setCellWidget(row, 4, contentList[row].bakeUV) self.table.setCellWidget(row, 5, contentList[row].animation) self.contentList = contentList def findBoundMesh(self, xgDes): itDg = om2.MItDag() itDg.reset(om2.MFnDagNode(xgDes.object()).parent(0), om2.MItDag.kDe...
Python
1
[test] fn insert_get_u192_u64() { test_insert_get( CacheIndex192::try_from(190).unwrap(), U192::from_dec_str("340282366920938463463374607431768211456").unwrap(), 353_237_934_814_015u64 ) } #[test] fn insert_get_u192_u128() { test_insert_get( CacheIndex192::try_from(163).unwrap(), U1...
Rust
0
_data_error!($($arg)*)) }; } macro_rules! io_assert { ($condition:expr) => { if !$condition { return $crate::io_data_err!("Assertion failed: {}", stringify!($condition)); } }; ($condition:expr, $($arg:tt)*) => { if !$condition { return $crate::io_data_err!($(...
Rust
0
ert ( len(Chepy("tests/files/fake_secrets.txt").read_file().extract_twilio_sid().o) == 2 ) def test_extract_b64(): data = """ when an unknown printer took a galley of type c2VjdXJpc2VjLnRlc3QuZGF0YQo= and scrambled it to make a type specimen book. """ assert Chepy(data).extract_ba...
Python
1
import torch import torch.nn as nn from ew_model.builder import HEAD @HEAD.register_module() class Linear(nn.Module): def __init__(self, in_channel=512*7*7, hidden_channels=[4090, 4090, 4090], class_num=1000 ): super().__init__() self.in_channel = ...
Python
1
PER_CLIENT_LAN: usize = 5_000; const TOTAL_KEYS_PER_SHARD: usize = 1_000_000; // batching config const BATCH_MAX_DELAY: Duration = Duration::from_millis(5); // fantoch run config const BRANCH: &str = "nfr"; // tracing max log level: compile-time level should be <= run-time level const MAX_LEVEL_COMPILE_TIME: tracing...
Rust
0
# Copyright (C) 2025 Intel Corporation # SPDX-License-Identifier: MIT import logging import time from mfd_connect.tunneled_rpyc import TunneledRPyCConnection logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) def connect_to_windows_os(): logger.debug("Through Linux to Windows") t...
Python
1
# Copyright (c) 2023 Amphion. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math import torch import torch.nn as nn from modules.general.utils import Linear class PositionEncoder(nn.Module): r"""Encoder of positional embeddi...
Python
1
#===================Zadanie 1========================== name_list = ["John", "Michael", "Terry", "Eric", "Graham"] name_dictionary = {} for item in name_list: name_dictionary[item] = len(item) print(name_dictionary) #==============Zadanie 2========================= numbers = [1, 2, 3, 5, 6, 11, 12, 18, 19, 21] p...
Python
1
s.len() as i64); metrics::MICRO_BLOCK_INPUTS_HG.observe(inputs.len() as f64); metrics::MICRO_BLOCK_OUTPUTS_HG.observe(outputs.len() as f64); metrics::MICRO_BLOCK_TRANSACTIONS_HG.observe(txs.len() as f64); metrics::UTXO_LEN.set(self.output_by_hash.len() as i64); metrics::EMISSION....
Rust
0
all=True) print() print(mm.io.render_summary(summary, namemap=mm.io.motchallenge_metric_names, formatters=mh.formatters)) expected = pd.DataFrame([ [0.557659, 0.729730, 0.451253, 0.582173, 0.941441, 8.0, 1, 6, 1, 13, 150, 7, 7, 0.526462, 0.277201], [0.644619, 0.819760, 0.531142, 0.608997, ...
Python
1
#!/bin/python3 import sys import numpy as np import matplotlib.pylab as plt import yt sys.dont_write_bytecode = True import shocktube_ana as shock_ana def get_data(file_name): with open(file_name, 'r') as f: lines = f.readlines() name = lines[0].split()[1:] lines = lines[1:] for ...
Python
1
""" build123d imports name: test_vertex.py by: Gumyr date: January 22, 2025 desc: This python module contains tests for the build123d project. license: Copyright 2025 Gumyr Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the Lice...
Python
1
W { self.bit(variant.into()) } #[doc = "The SVSMH is on"] #[inline(always)] pub fn svsmhoff_0(self) -> &'a mut W { self.variant(SVSMHOFF_A::SVSMHOFF_0) } #[doc = "The SVSMH is off"] #[inline(always)] pub fn svsmhoff_1(self) -> &'a mut W { self.variant(SVSMHOFF_A::...
Rust
0
# Torch Library import torch import torch.nn as nn class LinearNetwork(nn.Module): def __init__( self, in_features: int = 24, out_features: int = 1, hidden_dim: int = 64, num_layers: int = 1, ): super().__init__() self.hidden_dim = hidden_dim se...
Python
1
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward/blob/main/LICENSE from __future__ import annotations import pickle import numpy as np import awkward as ak def test_protocol_5(): # Check arrays array = ak.Array([[1, 2, 4, 5, 6], [7, 8, 9], [10]]) buffers = [] array_round_trip = p...
Python
1
import ftplib import os # --- FTP Connection Details --- FTP_HOST = "ftp.ncbi.nlm.nih.gov" FTP_USER = "anonymous" FTP_PASS = "" FTP_DB_PATH = "/blast/db/" # --- Limit the number of files for testing --- # --- Set to None to download all files --- MAX_FILES_TO_DOWNLOAD = 3 # --- Create a directory to store the downl...
Python
1
ms_path if not os.path.exists(items_path): self.report({'ERROR'}, 'Your TF2 Items path does not exist!') files = list(map(lambda a: a +'cosmetics.blend', ids.keys())) TF2_V3 = list(map(lambda a: a + '.blend', mercdeployer.mercs)) #for lib in bpy.data.libraries: # l...
Python
1
COMPRESSION: u32 = 2256u32; #[doc = "*Required features: `\"Win32_System_Iis\"`*"] pub const MD_HC_DO_ON_DEMAND_COMPRESSION: u32 = 2215u32; #[doc = "*Required features: `\"Win32_System_Iis\"`*"] pub const MD_HC_DO_STATIC_COMPRESSION: u32 = 2214u32; #[doc = "*Required features: `\"Win32_System_Iis\"`*"] pub const MD_HC_...
Rust
0
def find_lowest_cost_node(costs): lowest_cost=float('inf') lowest_cost_node=None for node in costs: cost=costs[node] if cost<lowest_cost and node not in processed: lowest_cost=cost lowest_cost_node=node return lowest_cost_node besconech=float('inf') #Известные ве...
Python
1
channel disable indicator interrupts for DMA channel"] #[inline(always)] pub fn dma_disable_int_disable(self) -> &'a mut W { self.variant(DISABLE_INT_ENABLE_A::DMA_DISABLE_INT_DISABLE) } #[doc = "Enable channel disable indicator interrupts for DMA channel"] #[inline(always)] pub fn dma_...
Rust
0
e_endpoint_suffix="core.windows.net", container=container_name, path="scraping-test", provider=provider, ) as client: try: # Upload blobs tasks = [ client.upload_blob( blob=name, data=content.encode(clien...
Python
1
type Message = (); fn create(props: Self::Properties, _: yew::prelude::ComponentLink<Self>) -> Self { Self { props } } fn update(&mut self, _: Self::Message) -> yew::prelude::ShouldRender { true } fn change(&mut self, _: Self::Properties) -> yew::prelude::ShouldRender ...
Rust
0
= 3 SET_ADDRESS = 5 GET_DESCRIPTOR = 6 SET_DESCRIPTOR = 7 GET_CONFIGURATION = 8 SET_CONFIGURATION = 9 GET_INTERFACE = 10 SET_INTERFACE = 11 SYNCH_FRAME = 12 # USB3 only. SET_ENCRYPTION = 13 GET_ENCRYPTION = 14 SET_HANDSHAKE =...
Python
1