text
string
label_name
string
labels
int64
core::ffi::c_void; pub type IWMPSyncDevice3 = *mut ::core::ffi::c_void; pub type IWMPSyncServices = *mut ::core::ffi::c_void; pub type IWMPTranscodePolicy = *mut ::core::ffi::c_void; pub type IWMPUserEventSink = *mut ::core::ffi::c_void; pub type IWMPVideoRenderConfig = *mut ::core::ffi::c_void; pub type IWMPWindowMess...
Rust
0
#!/usr/bin/env python # # -*- coding: iso-8859-15 -*- # # Copyright 2003-2015 CORE Security Technologies # # 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/L...
Python
1
, Reply, ReplyOn, Response, StdError, StdResult, SubMsg, Uint128}; use valkyrie::common::{ContractResult, Execution, ExecutionMsg}; use valkyrie::errors::ContractError; use valkyrie::governance::enumerations::{PollStatus, VoteOption}; use valkyrie::governance::execute_msgs::{ExecuteMsg, PollConfigInitMsg}; use valkyri...
Rust
0
from abc import abstractmethod from typing import Optional, List, Literal from pydantic import ConfigDict, model_validator, Field from swarmauri_core.image_gens.IGenImage import IGenImage from swarmauri_base.ComponentBase import ComponentBase, ResourceTypes @ComponentBase.register_model() class ImageGenBase(IGenImag...
Python
1
xt): path = context.fetch_resource("source.xlsx", context.data_url) context.export_resource(path, XLSX, title=context.SOURCE_TITLE) workbook: Workbook = openpyxl.load_workbook(path, read_only=True) has_listing = False for sheet in workbook.worksheets: headers: Optional[List[Optional[str]]] =...
Python
1
Pattern::new(applier), ) .unwrap() } // If the condition of a ternary operator is `false` then we can just inline the false clause. // // false ? yeh : nah // 👉 nah // fn rewrite_ternary_with_static_false_condition() -> Rewrite { let true_clause_var = Var::from_str("?true").unwrap(); let fal...
Rust
0
b).") except Exception as e: print(f"ERROR: Failed to load sentiment model from {model_name_or_path}: {e}") self.tokenizer = None self.model = None if not model_loaded: print("CRITICAL: SentimentAnalyzer could not load any model. Check pat...
Python
1
Tensor is transparent, which makes this impl safe for T: bytemuck::Zeroable types. unsafe impl<T: bytemuck::Zeroable> bytemuck::Zeroable for Tensor<T> {} // The following type aliases are useful for disambiguating between the `new` constructors without // having to spell out the entire type. pub type UTensor<S, N> = ...
Rust
0
pass return values, mask @_datetimelike_compat def _backfill_2d(values, limit=None, mask: npt.NDArray[np.bool_] | None = None): mask = _fillna_prep(values, mask) if np.all(values.shape): algos.backfill_2d_inplace(values, mask, limit=limit) else: # for test coverage pass ...
Python
1
from typing import Any, Dict import pytest from fastapi import Depends, FastAPI from pydantic import SecretStr from starlette.status import HTTP_200_OK, HTTP_401_UNAUTHORIZED from starlette.testclient import TestClient from labtasker.api_models import QueueCreateRequest from labtasker.security import get_auth_headers...
Python
1
"""empty message Revision ID: d6fd509d2552 Revises: fff1ed89a635 Create Date: 2025-01-27 23:46:46.371886 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'd6fd509d2552' down_revision = 'fff1ed89a635' branch_labels = None depends_on = None def upgrade() -> None...
Python
1
# Copyright 2016-2023 Blue Marble Analytics LLC. # # 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 required by applicable law or ag...
Python
1
ron::modifiers::Header; use time::{precise_time_ns, precise_time_s, now_utc}; use maud::{DOCTYPE, PreEscaped}; use rand::Rng; use hyper::client::Client; use hyper::header::ContentType; struct Router { routes: HashMap<String, Box<Handler>> } struct ResponseTime; impl typemap::Key for ResponseTime { type Value = u...
Rust
0
e", "usage", "protection"] props_to_integer = ["offset", "size"] class SvdWriteConstraint(SvdElement): props = ["writeAsRead", "useEnumeratedValues"] props_to_boolean = ["writeAsRead", "useEnumeratedValues"] def from_element(self, element, defaults={}): SvdElement.from_element(self, element, ...
Python
1
field_len: Option<u16>, pub extra_field: Vec<ExtraField>, pub file_name: Option<Vec<u8>>, pub comment: Option<Vec<u8>>, pub crc16: Option<u16>, } pub const DEFLATE: u8 = 8; pub const FLAG_FTEXT: u8 = 1; pub const FLAG_FHCRC: u8 = 2; pub const FLAG_FEXTRA: u8 = 4; pub const FLAG_FNAME: u8 = 8; pub const...
Rust
0
rcConfig { nickname: Some(self.nickname.clone()), nick_password: Some(self.password.clone()), server: Some("chat.freenode.net".to_owned()), port: Some(6697), use_ssl: Some(true), should_ghost: Some(true), user_info: Some("a bot by Grah...
Rust
0
}B(2)", "{Normal}B(3)", "{TRAILING}", "{Normal}T(1)", "{Normal}T(2)", ]); } #[test] fn with_just_enough_height_for_all_lines_with_title() { let mut view_data = create_view_data(2, 3, 2); view_data.update_view_data(|updater| updater.set_show_title(true)); let render_slice = create_render_slice(100, 8, &view...
Rust
0
rc: SaiSrc::Pll1Q, sai23_src: SaiSrc::Pll1Q, dfsdm1_src: DfsdmSrc::Pclk2, } } } #[cfg(not(feature = "h7b3"))] impl Clocks { /// Full speed of 480Mhz, with VC0 range 0. Note that special consideration needs to be taken /// when using low power modes (ie anything with wfe or w...
Rust
0
x82\x01YR U\xd1a\x8c\xbeO?$\x035b\ \xce\x0f\xdb0C&\x9c\x00\x02u%\xcc\xe4c0\x8e\ \x03\xa1\xa0.\xde9\x10$\xd5\x85\x90\xe0hW'y\ MIE\xca#+\xa2\xa3\x8e\xab\x1aj&\x9d\x9c8\ \x10\xc1\x93\xc7\x9a\x80\x0c\x07\xe0\x9e\xf4\x85\xb3s\xa3\x16\ \xfd\x9b9z\xe9\x9fL\x16\x00n\x5c\xfa\xbf\xd6\x98\xe5\ \x7f\xab\x8f\x9a{\xffYAK\xba\xa9\xe8...
Python
1
-> &Self::Target { &self.0 } } #[doc = "Field `rcdc` writer - Read Command Dummy Cycles"] pub struct RCDC_W<'a> { w: &'a mut W, } impl<'a> RCDC_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w...
Rust
0
result = checker.check(layer, [input_blob, target_blob], [], check_indices = [0]) print(result) self.assertTrue(result[0]) # also, check if weight works. self._testWeight(layer, [input_blob, target_blob]) # check full input target...
Python
1
block_num: 1234, data: DataBytes(BYTE_DATA), len: 512, } ); packet!( err, Packet::ERROR { code: ErrorCode::NoUser, msg: "This is a message".to_string(), } ); use gdnative::prelude::*; extern crate rand; mod ball; mod paddle; mod utils; use self::{ball::Ball, pa...
Rust
0
: Option<String>, } impl Me { pub fn find_from_token(token: &str) -> FieldResult<Self> { let client = get_client!(); let response = client .get(api_path!("/users/@me")) .header(make_auth!(token)) .send()? .json::<MeInfo>()?; Ok(Me { ...
Rust
0
Ext::token(None, TargetWindowToken::Start); /// ``` /// /// [`TargetWindowExt`]: enum.TargetWindowExt.html /// [`TargetWindowToken`]: enum.TargetWindowToken.html pub fn token(session: Option<&'a TargetSession<'a>>, token: TargetWindowToken) -> Self { TargetWindowExt { session, ...
Rust
0
#!/usr/bin/env python """ ================================================ AB Electronics UK IO Pi Tests | set_pin_pullup Requires python smbus to be installed For Python 2 install with: sudo apt-get install python-smbus For Python 3 install with: sudo apt-get install python3-smbus run with: python3 set_pin_pullup.p...
Python
1
eldBytes::from_slice(&compact_bytes[33..65])); let sig = SecpSignature::from_scalars(r, s)?; Ok(Signature { sig, recovery_i: i }) } } #[wasm_bindgen] impl Signature { #[wasm_bindgen(js_name = toHex)] pub fn to_hex(&self) -> String { let bytes = self.sig.to_der(); hex::enc...
Rust
0
###); let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]); insta::assert_snapshot!(stdout, @r###" @ e7a40106bee6 c o 05d951646873 b o 0c5ddc685260 a o 000000000000 "###); let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]); insta::...
Rust
0
t RTC_MR_SPEC; impl crate::RegisterSpec for RTC_MR_SPEC { type Ux = u32; } #[doc = "`read()` method returns [rtc_mr::R](R) reader structure"] impl crate::Readable for RTC_MR_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [rtc_mr::W](W) writer structure"] impl crate::Writable for RTC_MR_SPEC { ...
Rust
0
m=tile_um, stride_div=stride_div, verbose=False, use_edge_tiles=True, roi_method='ignore', roi_filter_method=wsi.roi_filter_method ) return qc_wsi, mpp def __call__( self, wsi: "sf.WSI", mask: Optional[np.ndarray] =...
Python
1
T>, DynStack<'a>) { self.make_aligned_with(size, core::mem::align_of::<T>(), f) } } #[cfg(test)] mod tests { use super::*; #[test] fn empty() { let mut buf = uninit_mem_in_global(StackReq::new::<i32>(0)); let stack = DynStack::new(&mut buf); let (_arr0, _stack) = stack...
Rust
0
) -> Color { self.color } } pub struct CheckerTexture { pub odd: Box<Texture>, pub even: Box<Texture> } impl Texture for CheckerTexture { fn value(&self, p: &V3) -> Color { let sines = f32::sin(10.0*p.x) * f32::sin(10.0*p.y) * f32::sin(10.0*p.z); if sine...
Rust
0
f raw_terminal() -> t.Iterator[int]: f: t.Optional[t.TextIO] fd: int if not isatty(sys.stdin): f = open("/dev/tty") fd = f.fileno() else: fd = sys.stdin.fileno() f = None try: old_settings = termios.tcgetattr(fd) ...
Python
1
x = block(x) >>> x.shape torch.Size([10, 100, 64]) """ def __init__( self, num_layers, d_model, nhead, d_ffn=2048, input_shape=None, kdim=None, vdim=None, dropout=0.1, activation="swish", kernel_size=31, bi...
Python
1
2img, reference_points).squeeze(-1) eps = 1e-5 mask = reference_points_cam[..., 2:3] > eps reference_points_cam = reference_points_cam[..., 0:2] / torch.clamp_min(reference_points_cam[..., 2:3], eps) reference_points_cam[..., 0] /= img_shape[1] reference_points_cam[..., 1] /= img_shape[0] refer...
Python
1
# ============================================================================== # Copyright 2019 - Philip Paquette # # NOTICE: 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 rest...
Python
1
encode_node()?); } Ok(base) } } <gh_stars>0 use std::fmt; use super::{error::PolarError, sources::Context, warning::PolarWarning}; #[derive(Debug)] pub enum Diagnostic { Error(PolarError), Warning(PolarWarning), } impl From<PolarError> for Diagnostic { fn from(err: PolarError) -> Sel...
Rust
0
print("=" * 60) print("\n📋 TASK COMPLETION STATUS:") print("✓ 3.3.1 - Implement encryption/decryption utilities (crypto_utils.py)") print("✓ 3.3.2 - Create secure key generation and management (key_manager.py)") print("✓ 3.3.3 - Implement secure API key storage (secure_storage.py)") print(...
Python
1
usize = 1; const PART_BAR_DONE: usize = 2; const PART_BAR_UNDONE: usize = 3; const PART_DONE: usize = 4; const PART_TOTAL: usize = 5; const PART_PERCENT: usize = 6; const PART_DOING: usize = 7; /// # Misc Variables. const MIN_BARS_WIDTH: u8 = 10; const MIN_DRAW_WIDTH: u8 = 40; // This translates to: • • ...
Rust
0
.z }, )) } } #[cfg(test)] mod tests { use crate::unit_test_data::{test_point_in, test_point_out}; #[test] fn test_point_to_string() { assert_eq!(test_point_out().to_string(), test_point_in()) } } <reponame>hugefiver/orbtk // Layout specific properties. pub use self::block::*; pub ...
Rust
0
blocking": 0, "forwarding": 2, "learning": 0, "listening": 0, "stp_active": 2, }, "VLAN1125": { "blocking": 0, "forwarding": 1, "learning": 0, "listening": 0, ...
Python
1
.object(object_number) { None => UNIX_EPOCH, Some(obj) => match OffsetDateTime::from_unix_timestamp(obj.acquisition_end() as i64) { Ok(time) => time.into(), Err(_) => UNIX_EPOCH, } }; let file_attr = FileAttr...
Rust
0
Img2ImgOutpaintingResponse. # noqa: E501 :rtype: int """ return self._status @status.setter def status(self, status): """Sets the status of this Img2ImgOutpaintingResponse. :param status: The status of this Img2ImgOutpaintingResponse. # noqa: E501 :type: int...
Python
1
, channel, protocol); let peer_id = device_id.parse().expect("peer ids from profile should parse"); // The remote peer connected to us, `initiate_streaming` = false. handle_connection( &peer_id, channel, false, &mut peer...
Rust
0
: 0.0, minx: 0.0, maxx: 0.0 }, ..3]; let mut glyphs: [NVGglyphPosition, ..100] = [NVGglyphPosition{ _str: ptr::null(), x: 0.0, minx: 0.0, maxx: 0.0 }, ..100]; let text = "This is longer chunk of text.\n \n Would have used lorem ipsum but she was busy jumping over the laz...
Rust
0
unsafe { &(*(::std::ptr::null::<snd_seq_event>())).data as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(snd_seq_event), "::", stringify!(data) ) ); } pub type snd_seq_event_t = snd_seq_event; #[repr(C)] #[derive(D...
Rust
0
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.routers import webhook app = FastAPI() app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) app.include_router(webhook.router) @app.get(...
Python
1
self.write_msg(Request::new_with_data( OpCode::KeymapDataEnd, [OpCode::KeymapDataEnd as u8; 61], ))?; Ok(()) } } #[derive(PackedStruct)] #[packed_struct(endian = "msb")] pub struct Request { _id: u8, op: u16, data: [u8; 61], } impl Request { pub fn new(op: ...
Rust
0
: std::path::PathBuf, } fn main() { eprintln!("This is an error! :("); let args = Cli::from_args(); println!("======= args ======="); println!("{:#?}", args); // Option 1. let result = read_line(&args.path); match result { Ok(content) => { // println!("file content: {:?}...
Rust
0
.mqttSlot_Send) # 信号连接槽函数 ui.setupUi(MainWindow) # 绘制界面 exQthread = ExQThread() # 线程实例 exQthread.weatherSignal.connect(ui.updateWeather) # 信号连接槽函数 exQthread.historySignal.connect(ui.upd...
Python
1
let code = " extern int f(); static int f(); "; assert_errs_decls(code, 1, 0, 2); } #[test] fn enum_declaration() { assert!(parse("enum;").unwrap().is_err()); assert!(parse("enum e;").unwrap().is_err()); assert!(parse("enum e {};").unwrap().i...
Rust
0
= $fx.bcx.ins().fcmp(FloatCC::$cc, $lhs, $rhs); CValue::ByVal($fx.bcx.ins().bint(types::I8, b), ret_layout) }}; (@single $fx:expr, $bug_fmt:expr, $var:expr, $signed:expr, $lhs:expr, $rhs:expr, $ret_ty:expr, custom(|| $body:expr)) => {{ $body }}; (@single $fx:expr, $bug_fmt:expr, $var:ex...
Rust
0
::Fdflags, ) -> Result<(), Error> { self.table() .get_file_mut(u32::from(fd))? .get_cap_mut(FileCaps::FDSTAT_SET_FLAGS)? .set_fdflags(FdFlags::from(flags)) .await } async fn fd_fdstat_set_rights( &mut self, fd: types::Fd, fs_ri...
Rust
0
# Title : Numerical inversion of the Laplace transform for pricing Asian options # The Geman and Yor model # # Numerical inversion is done by Talbot's method. # ################################################################################ ## Created by Fernando Damian Nieuwveldt ...
Python
1
FromStr}; use tokio::sync::Mutex; lazy_static! { pub static ref SPOTIFY: Mutex<Result<ClientCredsSpotify, ParrotError>> = Mutex::new(Err(ParrotError::Other("no auth attempts"))); pub static ref SPOTIFY_QUERY_REGEX: Regex = Regex::new(r"spotify.com/(?P<media_type>.+)/(?P<media_id>.*?)(?:\?|$)")....
Rust
0
import argparse import fileinput import sys # Maximum value of a signed 32 bit integer (2**31 - 1). MAX_CHROM_LEN = 2147483647 def stop_err(msg): sys.exit(msg) parser = argparse.ArgumentParser() parser.add_argument('--input', dest='input', help="Input dataset") parser.add_argument('--start_coordinate', dest=...
Python
1
(end_x, end_y); build_data.map.tiles[end_idx] = TileType::DownStairs; build_data.map.populate_blocked(); if let Some(result) = a_star_search( Point::new(starting_pos.x, starting_pos.y), Point::new(end_x, end_y), 0.0, &build_data.map, ) { ...
Rust
0
.LinearDim9: return "linear_dim_9" raise ValueError("Unknown MappingId enum entry.") @register_attribute_builder("MappingIdEnum") def _mappingidenum(x, context): return _ods_ir.IntegerAttr.get(_ods_ir.IntegerType.get_signless(64, context=context), int(x)) class Processor(IntEnum): """pro...
Python
1
# Floats with 4 or fewer decimal places print normally # Floats with 5 or more decimal places may switch to scientific notation # Using print(f"{float}:f") uses default formatter which is 6 decimal points # You can force decimal formatting with :f and precision # / returns a float result & type # // is same as math.flo...
Python
1
U-n U S:XdU S:XagUR S:Xa9[5RSURS*5RSS5n O [5n U [5RURURS- UR ...
Python
1
import heapq import numpy as np def a_star(): # Define the initial grid state grid = np.array([[91, 57, 'x', 45], [41, 49, 'x', 'x'], ['x', 'x', 49, 'x'], ['x', 46, 47, 73]]) # Define the range of numbers that can replace 'x' numbers =...
Python
1
import os from dpa.ptask.area import PTaskArea # ----------------------------------------------------------------------------- class IconFactory(object): ICON_SCHEME = "icon:///" # ------------------------------------------------------------------------- @classmethod def is_icon_path(cls, path): ...
Python
1
&str)>, goal_version: Option<&str>, mut progress_callback: F, ) -> Result<(), UpdateError> where F: FnMut(SharedUpdateProgress) -> bool, { info!( "update_workspace {} {} @ {}", workspace_path, repository_url, goal_version.unwrap_or("latest") ); let repository = A...
Rust
0
rap() * 1000000.0).floor() as i32; locactions.push(Location::new(i as u32, v[1].to_string(), x, y, v[5].parse::<f64>().unwrap(), v[6].parse::<f64>().unwrap())); } } let mut tracking = Vec::new(); let person = std::fs::read_to_string("./1126.csv").unwrap(); ...
Rust
0
import os from dotenv import load_dotenv load_dotenv() configs_list = list() # Receivers coordinates receiver_coordination_1 = os.getenv("receiver_coordination_1") configs_list.append(os.getenv("receiver_coordination_1")) receiver_coordination_2 = os.getenv("receiver_coordination_2"), configs_list.append(os.getenv("...
Python
1
from os import environ from unittest.mock import patch from uuid import uuid4 from aws_embedded_metrics.config import get_config # type: ignore from aws_embedded_metrics.environment.ec2_environment import ( # type: ignore EC2Environment, ) from aws_embedded_metrics.environment.lambda_environment import ( # type...
Python
1
LEMODE_A::FILTER3CLK } } #[doc = "Write proxy for field `FILTERCGF_SAMPLEMODE`"] pub struct FILTERCGF_SAMPLEMODE_W<'a> { w: &'a mut W, } impl<'a> FILTERCGF_SAMPLEMODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: FILTERCGF_SAMPLEMODE_A) -> &'a mut ...
Rust
0
TrieNodeId, pub rest: SmolStr, pub data_set: Set, pub data_set_acc: AccValue, } impl Digestible for TrieLeafNode { fn to_digest(&self) -> Digest { trie_leaf_hash(&self.rest.to_digest(), &self.data_set_acc.to_digest()) } } impl TrieLeafNode { pub fn new(rest: SmolStr, data_set: Set, da...
Rust
0
#Faça um Programa que peça a temperatura em graus Fahrenheit, transforme e mostre a temperatura em graus Celsius. #C = 5 * ((F-32) / 9). def convert_temp(temperaturaF): temperaturaC = 5*((temperaturaF - 32)/9) return temperaturaC #-------------------------------------------------- #Pedimos o valor da temperat...
Python
1
check async fn check_vc(&self, vc_id: &str, value: &str) -> Result<(), Box<dyn std::error::Error>> { // TODO: add some pre-flight checks (key type, etc) let mut vc: Value = serde_json::from_str(value)?; if vc["proof"].is_null() { debug!("vcs without a proof are considered as val...
Rust
0
ccess() prog = log.progress('Pwning...') # Each of these messages causes BNEP code to send 100 "command not understood" responses. # This causes list_node_t allocations on the heap (one per reponse) as items in the xmit_hold_q. # These items are popped asynchronously to the arrival of our incoming mess...
Python
1
import torch from multimedeval.radgraph.allennlp.common import Registrable class TokenEmbedder(torch.nn.Module, Registrable): """ A `TokenEmbedder` is a `Module` that takes as input a tensor with integer ids that have been output from a [`TokenIndexer`](../../data/token_indexers/token_indexer.md) and out...
Python
1
a non pulvinar eu, tempor id nunc. " } <reponame>bschwehn/hurl<gh_stars>0 /* * hurl (https://hurl.dev) * Copyright (C) 2020 Orange * * 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 * *...
Rust
0
d }|dkr|d|t|t|fWSt|dd}||jkr||s|dt||||t|fWS|d|t|dt|dkr2|tvr |d|t|tt|dfWSWntyHYn0|d|t|dS)Nr=rarrrrrrrrrrrrrrrrr0rrr3...
Python
1
DRESS.to_string(), port: 25565, threading: true}; m.host(); thread::sleep(time::Duration::from_millis(200)); println!("TEST: set_port_range END"); } /** * tests using an invalid IP address for Master */ #[allow(dead_code)] fn test_invalid_host_ip() { println!("TEST: invalid_host_ip"); println!(...
Rust
0
unsafe fn getmouse(event: MEVENT) -> i32 { assert!(!event.is_null(), "{}getmouse() : event.is_null()", MODULE_PATH); bindings::getmouse(event) } /// <https://invisible-island.net/ncurses/man/curs_mouse.3x.html> pub fn has_mouse() -> bool { unsafe { bindings::has_mouse() } } /// # Safety /// /// <https:/...
Rust
0
cket_id, Arc::downgrade(&player)); if let Some(mut client) = self.clients.get_mut(&socket_id) { client.set_level(level); } self.players.insert(socket_id, player); Some(JoinGameAccepted { level, name }) ...
Rust
0
self.inner.insert(hash, block); hash } /// Get a code block by hash. pub fn get_block(&self, hash: impl Into<BlockId>) -> Option<&CodeBlock> { self.inner.get(&hash.into()) } } /// Represents a non-branching Wasm code block. #[derive(Debug, MemoryUsage, Hash, PartialEq)] pub st...
Rust
0
iters = q_proj.split_k_iters qkv_layer.bias = bias fused_attention_layer = target_cls( modules_to_fuse["hidden_size"], modules_to_fuse["num_attention_heads"], modules_to_fuse["num_key_value_heads"], qkv_layer, o_proj, previous_dev...
Python
1
\] as source"] RF_GPIO9_SRC_DIO_2 = 2, #[doc = "3: Select DIO\\[3\\] as source"] RF_GPIO9_SRC_DIO_3 = 3, #[doc = "4: Select DIO\\[4\\] as source"] RF_GPIO9_SRC_DIO_4 = 4, #[doc = "5: Select DIO\\[5\\] as source"] RF_GPIO9_SRC_DIO_5 = 5, #[doc = "6: Select DIO\\[6\\] as source"] RF_GP...
Rust
0
usize, line: u32, mut body: Vec<Expr<'a>>) -> Self { Expr { expr: Box::new(move |offset, line| ExpressionValueEnum::Block(body.drain(..).map(|e| e.mk(offset, line)).collect())), offset, line } } pub fn output(offset: usize, line: u32, name: &'a str, expr: Expr<'a>) -> Self { Expr { expr: Box::new(move |off...
Rust
0
tion() if(len(re)==0): messagebox.showerror('Error','No cart selected') return if (messagebox.askyesno('Alert!','Remove cart?') == True): x = self.tree.get_children() re=re[0] l=[] fi=[] for i in x: if(i!...
Python
1
e_bytes is None: return decoded = title_bytes.decode() split = decoded.split('"', 1) if len(split) < 2: return title = split[1].rstrip('"\n') return title except subprocess.CalledProcessError as e: log.error(...
Python
1
if FINAL_EXPONENT_LAST_CHUNK_W0_IS_NEG { elt_inv.cyclotomic_exp(&FINAL_EXPONENT_LAST_CHUNK_ABS_OF_W0) } else { elt.cyclotomic_exp(&FINAL_EXPONENT_LAST_CHUNK_ABS_OF_W0) }; w1_part * &w0_part } } /// FQ_ZERO = 0 pub const FQ_ZERO: Fq = field_new!(Fq, BigInteger832([0...
Rust
0
#!/usr/bin/python3 # Python code to encrypt, compress, and base64 encode shellcode from a file import argparse import gzip from base64 import b64encode import os def xor(data, key): # xor encrypt shellcode output_str = "" for i in range(len(data)): current = data[i] current_key = key[i%le...
Python
1
_fund_month.get(&code).unwrap() { fund_accounts.buy_with_cost(code, &fund_data, *fund_budget[&code]); let entry = prev_fund_month.get_mut(&code).unwrap(); *entry = fund_data.date.month(); } else { fund_accounts.update_account(code, fund_data); } ...
Rust
0
nel(); tokio::spawn(async { let _ = tx1.send("one"); }); tokio::spawn(async { let _ = tx2.send("two"); }); let mut time_to_stop = time_to_stop.fuse(); let mut rx1 = rx1.fuse(); let mut rx2 = rx2.fuse(); loop { let next = tokio::select! { Some(v) = ...
Rust
0
solve(input, 3) } fn part2(input: String) -> Result<u64> { solve(input, 4) } #[test] fn day24_test() { assert_results!(part1, "\ 1 2 3 4 5 7 8 9 10 11" => 99); } // Copyright 2019 MesaTEE Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in co...
Rust
0
# chebyshev.py """ Simple implementation of polynomial interpolation using Chebyshev basis. PeterJ, MECH3750, October 2011 2015-08-10 Python3 version 2022-11-26 Port to GDTK project """ from gdtk.numeric.polynomial import fit_interpolating_polynomial, eval_polynomial def make_chebyshev_basis(n): """ Returns a...
Python
1
''' Performs clustering operation on learned embeddings for both NP and relations Uses HAC method for clustering. ''' import numpy as np from scipy.cluster.hierarchy import linkage, fcluster from scipy.spatial.distance import pdist class Clustering(object): def __init__(self, ent2embed, rel2embed, side_info, params...
Python
1
from pokemon_api.service.get_pokemon_info_utils import get_pokemon_info from Queries import database def insert_into_ownership(pokemon_name, trainer_name): connection = database.connect_to_database() try: pokemon_info = get_pokemon_info(pokemon_name) database.execute_query(connection, ...
Python
1
print(f"❌ Exception: {e}") # Test avec libellé trop long invalid_data = { "libelle": "A" * 300, # Plus de 255 caractères "description": "Description test" } try: response = requests.post(f"{BASE_URL}/criteres/", json=invalid_data, headers=HEADERS) print(f"St...
Python
1
raise ValueError('Invalid "response" parameter provided to oauth.from_response()') self.owner.data.update({ 'oauth.token': response.get('access_token'), 'oauth.refresh_token': response.get('refresh_token'), 'oauth.created_at': response.get('created_at'), ...
Python
1
name: Portuguese (Português) Pt, /// 639-2: que, name: Quechua (<NAME>, Kichwa) Qu, /// 639-2: roh, name: Romansh (rumantsch grischun) Rm, /// 639-2: run, name: Kirundi (Ikirundi) Rn, /// 639-2: ron, name: Romanian (Română) Ro, /// 639-2: rus, name: Russian (Русский) Ru, ...
Rust
0
<bool> = data.iter().map(|x| x.is_none()).collect(); TColumn::new(TColumnData::new(None, None, None, Some(cdata)), nulls) } } pub trait OmniSciConnection { // TODO consider weld.rs as a DataFrame API https://github.com/weld-project/weld/tree/master/weld // TODO consider postres Row for request/re...
Rust
0
est::md5(), src); match secret { Ok(res) => Ok(hex::encode(res)), Err(e) => Err(e), } } /// **************** /// Sha1 /// **************** pub fn Sha1(src: &[u8]) -> Result<String, ErrorStack> { let secret = hash(MessageDigest::sha1(), src); match secret { Ok(res) => Ok(hex::enc...
Rust
0
, height: c_float); } extern "C" { pub fn YGNodeStyleSetHeightAuto(node: NodeRef); } extern "C" { pub fn YGNodeStyleGetHeight(node: NodeRef) -> YGValue; } extern "C" { pub fn YGNodeStyleSetMinWidth(node: NodeRef, minWidth: c_float); } extern "C" { pub fn YGNodeStyleSetMinWidthPercent( node: NodeRef, ...
Rust
0
= transform .try_inverse() .ok_or_else(|| anyhow!("input: couldn't invert geo transform"))?; args.polygons .iter() .map(|poly| { use geo::algorithm::map_coords::MapCoords; poly.as_ref().map(|poly| { poly.map_coo...
Rust
0
pub fn new(host_callback: Arc<Mutex<HostCallback>>, params: Arc<Parameters>, parent: *mut std::ffi::c_void) -> Self { let parent_id = parent as u32; let t = thread::spawn(move || { let (conn, screen_num) = xcb::Connection::connect_with_xlib_display().unwrap(); //conn.set_eve...
Rust
0
nt async for embedding query text. Args: text: The text to embed. Returns: Embedding for the text. """ async with aiohttp.ClientSession() as session: embedding = await self._aembedding_func(session, text, "passage") return embedding ...
Python
1
# Copyright (c) 2025 PaddlePaddle Authors. 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 required by appli...
Python
1