text
string
label_name
string
labels
int64
mb_goal_rotation = np.load(path + "action/do" + "/current_rotation.npy") # mb_goal pose mb_goal_pose = construct_pose2(mb_goal_position, mb_goal_rotation, frame_id='base_link') # mb up pose # mb_up_position = np.array([(mb_pose_grasp[0]+55)/1000,(mb_pose_grasp[1])/1000,(mb_pose_grasp[2]+130)/1...
Python
1
import torch import torchvision print("PyTorch version:", torch.__version__) print("Torchvision version:", torchvision.__version__) print("CUDA is available:", torch.cuda.is_available()) import sys import numpy as np import torch import matplotlib.pyplot as plt import cv2 import sys import os sys.path.append("..") from...
Python
1
model = MobileNetV3(model_name="small", scale=1.0, **kwargs) return model def MobileNetV3_small_x1_25(**kwargs): model = MobileNetV3(model_name="small", scale=1.25, **kwargs) return model def MobileNetV3_large_x0_35(**kwargs): model = MobileNetV3(model_name="large", scale=0.35, **kwargs) retu...
Python
1
side, not vertically stacked. This style must be used with ``AUI_TB_TEXT``. """ AUI_TB_PLAIN_BACKGROUND = 1 << 7 """ Don't draw a gradient background on the toolbar. """ AUI_TB_CLOCKWISE = 1 << 8 AUI_TB_COUNTERCLOCKWISE = 1 << 9 AUI_TB_HORZ_TEXT = AUI_TB_HORZ_LAYOUT | AUI_TB_TEXT """ Combination of ``AUI...
Python
1
from django.urls import path from . import views app_name = "contacts" urlpatterns = [ path('create-contact/', views.create_contact_view, name='create_contact'), path('get-contact/<str:email>/', views.get_contact_view, name='get_contact'), path('update-contact/<str:contact_id>/', views.update_contact_view,...
Python
1
b3i', # 砳 30772: b'\xc6\xc6', # 破 30773: b'\xb3j', # 砵 30774: b'\xb3k', # 砶 30775: b'\xc9\xe9', # 砷 30776: b'\xd4\xd2', # 砸 30777: b'\xed\xc1', # 砹 30778: b'\xed\xc2', # 砺 30779: b'\xed\xc3', # 砻 30780: b'\xed\xc5', # 砼 30781: b'\xb3l', # 砽 30782: b'\xc0\xf9', # 砾 30783: b'\xb3m', # 砿 30784: b'\xb4\xa1', # 础 30785: b'\...
Python
1
dex - 1].clone(); let file = read_file(&path); source.replace(format!("%!%{}%!%", flag.name).as_str(), file.as_str()) } /****************************************** *****Replace a custom flag with a file***** ******************************************/ pub fn file(flag: CustomFlag, source: String) -> String { ...
Rust
0
ertools # initializing list li = [2, 4, 5, 7, 8] # using dropwhile() to start displaying after condition is false print("The values after condition returns false : ", end="") print(list(itertools.dropwhile(lambda x: x % 2 == 0, li))) # Python code to demonstrate the working of # filterfalse() import itertools # i...
Python
1
.rest.partition_point(|&(start_sec, _)| gmt_sec >= start_sec); if next_i == 0 { let t1 = self.valid_time(gmt_sec, nanosecond, next_i); let t2 = self.valid_time(gmt_sec, nanosecond, next_i + 1); match (t1, t2) { (None, None) => Err(TzError::NoTimeInThisTz), ...
Rust
0
pointer, &source) .map_err(Error::Cuda) } /// Allocate host memory to GPU for input or output. pub fn alloc_host_memory(&self, queue_id: usize, size: usize) -> *mut u8 { let mut cuda_manager = self.backend.lock().unwrap(); cuda_manager.alloc_host_memory(queue_id, size) } ...
Rust
0
g nperseg = {input_length:d}', stacklevel=3) nperseg = input_length win = get_window(window, nperseg) else: win = np.asarray(window) if len(win.shape) != 1: raise ValueError('window must be 1-D') if input_length < win.shape[-1]: ...
Python
1
def skjkasdkd(lst): """You are given a list of integers. You need to find the largest prime value and return the sum of its digits. Examples: For lst = [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] the output should be 10 For lst = [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] the output should ...
Python
1
status_code: StatusCode, value: models::ErrorResponse, }, BuildRequestError { source: reqwest::Error, }, ExecuteRequestError { source: reqwest::Error, }, ResponseBytesError { ...
Rust
0
ot be found. Returns: int: Index of sampler. """ for index, upscaler in enumerate(shared.sd_upscalers): if upscaler.name == upscaler_name: return index raise KeyError(f"upscaler not found: {upscaler_name}") def prepare_mask(mask: Image.Image): """Prepare mask for usage...
Python
1
ob status doesn't change to a terminal state before the time expires, then the job status is set to <code>TIMED_OUT</code>.</p> /// <p>The timeout interval must be between 1 minute and 7 days (10080 minutes).</p> pub fn set_in_progress_timeout_in_minutes( mut self, input: std::op...
Rust
0
memo, &grid, n, m) } fn dp( i: usize, j: usize, k: usize, memo: &mut HashMap<(usize, usize, usize), i32>, grid: &[Vec<i32>], n: usize, m: usize, ) -> i32 { if let Some(&res) = memo.get(&(i, j, k)) { return res; } l...
Rust
0
utput_file} \ --timestamps 0:{timestamps_file} \ {encoded_file_list} \ -D {original_file}"; #[derive(Debug, Clone)] pub struct Merge<'a> { timestamp_file: String, pub cleanup...
Rust
0
()) } } unsafe impl<T, S: Settings> Send for EventQueue<T, S>{} <filename>components/dada-brew/src/brewery.rs use std::rc::Rc; use dada_collections::Map; use dada_id::prelude::*; use dada_ir::{ code::{ bir, syntax, validated::{self, ExprOrigin}, Code, }, origin_table::{HasOrigi...
Rust
0
rch.cuda.is_available(): print("CUDA is not available.", file=sys.stderr) sys.exit(1) args = parse_args() local_rank = int(os.environ["LOCAL_RANK"]) num_local_ranks = int(os.environ["LOCAL_WORLD_SIZE"]) rank, num_ranks, group = init_dist(local_rank, num_local_ranks) node_idx = rank...
Python
1
{ let (is_no_task, run_time) = loop_func(); if is_no_task { //当前没有任务 if sleep_count > 1 { //当前没有任务连续达到2次,则休眠线程 sleep_count = 0; //重置休眠计数 let (is_sleep, lock, condvar) = &*thread_waker; ...
Rust
0
and=["echo", "1"], environment=JobEnvironment(conda="env"), depends_on=["unknown_job"], ) workflow = Workflow(name="test", jobs=[job]) with pytest.raises(WorkflowValidationError, match="depends on unknown job"): workflow.validate() def test_workflow_vali...
Python
1
lude_dir_pathbuf_list { let mut shared_libs:Vec<String> = vec!(); let glob_ptn = format!("{}/**/*.so*",include_dir_pathbuf.display()); //println!("glob_ptn:{}",glob_ptn); for entry in glob(&glob_ptn).expect("Failed to read glob pattern") { match entry { O...
Rust
0
#!/usr/bin/env python """ Utility file for the Reuters text categorization benchmark dataset. See also -------- http://www.vision.caltech.edu/Image_Datasets/Caltech101/ """ from nltk.corpus import reuters, stopwords from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.preprocessing import MultiLa...
Python
1
N = int(input()) arr = [0] + list(map(int,input().split())) # index와 스위치 번호 일치시키기위해 [0] 추가 stu_num = int(input()) # 0,1 과 '0','1' 잘 체크하기 for _ in range(stu_num): s, switch_num = map(int,input().split()) if s == 1 : # 남학생 - 배수 k = 1 multi = switch_num while multi <= N : if arr...
Python
1
b = "Hello, World!" print(b[2:5]) b = "Hello, World!" print(b[-5:-2]) #[5:] or [:5] all symbols until string ends
Python
1
() -> CommandBuilder { CommandBuilder::new( "crate".to_owned(), "Lookup crates on crates.io".to_owned(), CommandType::ChatInput, ) .default_permission(true) .option( StringBuilder::new( "crate_name".to_owned(), "The name of the crate to search for".to_owned(), ) .autocomplete(true) ...
Rust
0
from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field T = TypeVar("T", bound="LoadTopLevelInfoArgs") @_attrs_define class LoadTopLevelInfoArgs: """Load user and workspsace args.""" additional_properties: dict[st...
Python
1
from machine import Pin, UART uart = UART(0, 9600) # init with given baudrate uart.init(9600, bits=8, parity=None, stop=1) # init with given parameters while True: if uart.read(32) is not None: uart.write("Hello, Bluetooth World!\n".encode())
Python
1
// The [`wasm-c-api`] standard API is a _living_ standard. There is no // commitment for stability yet. We (Wasmer) will try our best to keep // backward compatibility as much as possible. Nonetheless, some // necessary API aren't yet standardized, and as such, we provide a // custom API, e.g. `wasi_*` types and functi...
Rust
0
self.space(); } } pub(crate) fn trailing_comma_or_space(&mut self, is_last: bool) { if is_last { self.scan_break(BreakToken { blank_space: 1, pre_break: Some(','), ..BreakToken::default() }); } else { ...
Rust
0
import pandas as pd from liana.resource import get_hcop_orthologs, select_resource, translate_column, translate_resource def test_complex_cases(): map_df = pd.DataFrame( {"source": ["CSF2RA", "IFNL3", "IFNL3", "IFNLR1", "IL10RB", "HCST", "CD8A", "CD8B", "IL4"], "target": [...
Python
1
project.get_plan_path(), &project.get_vcs_type(), &project.get_vcs_data(), &(project.get_owner_id() as i64), &install_id, &project.get_visibility().to_string(), ], ).map_err(SrvError::OriginProjectCreate)?; let r...
Rust
0
2, const GDK_FUNC_MOVE = 4, const GDK_FUNC_MINIMIZE = 8, const GDK_FUNC_MAXIMIZE = 16, const GDK_FUNC_CLOSE = 32, } } bitflags! { #[repr(C)] flags GdkWindowAttributesType: c_uint { const GDK_WA_TITLE = 2, const GDK_WA_X = 4, const GDK_WA_Y = 8, ...
Rust
0
# -*- coding: utf-8 -*- # TencentBlueKing is pleased to support the open source community by making # 蓝鲸智云 - PaaS 平台 (BlueKing - PaaS System) available. # Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. # Licensed under the MIT License (the "License"); you may not use this file except # in c...
Python
1
use syntax::UExpr::Pred; // use DataType::*; // let matching = Pred(Eq(v(2), v(4))) * app(r(0), [2, 3]) * app(r(1), [4, 5]); // let left_miss = // !UExpr::sum(vec![Int, String], Pred(Eq(v(6), v(4))) * app(r(0), [6, 7])) // * Pred(Null(v(2))) * Pred(Null(v(3))) // * app(r(1), [4, 5]); // let...
Rust
0
interrupt::free(|cs| { BUTTON0 .borrow(cs) .borrow_mut() .as_mut() .expect("button pin must be set before interrupt is enabled") .sample(); BUTTON1 .borrow(cs) .borrow_mut() .as_mut() .expect(...
Rust
0
_batch output_val, code_val = dataset.next_batch_output_codes(batch_size) print output_val, code_val codes_val = self.update_codes_ICM(output_val, code_val) print np.sum(np.sum(codes_val, 0) != 0) dataset.feed_batch_codes(batch_size, codes_val) print ...
Python
1
fn start_screen( mut commands: Commands, gltf_assets: Res<GltfAssets>, font_assets: Res<FontAssets>, ) { // rival commands .spawn_bundle(( Transform::from_xyz(8.4, 4.0, -0.2) .with_scale(Vec3::splat(2.5)) .with_rotation(Quat::from_euler(EulerRot:...
Rust
0
from colorama import Fore, Style def print_title(): """ Prints Noter (title) in ascii :return: None """ ascii_title = """ 888b 888 888 8888b 888 888 88888b 888 888 888Y88b 888 .d88b. 8888...
Python
1
// TODO: Deal with the constraint // Type constants do not take type vars hence tparams:[] Some(emit_type_constant::hint_to_type_constant( alloc, emitter.options(), &[], &BTreeMap::new(), init, ...
Rust
0
axNspNetworkType { fn static_type() -> Type { unsafe { from_glib(nm_sys::nm_wimax_nsp_network_type_get_type()) } } } impl<'a> FromValueOptional<'a> for WimaxNspNetworkType { unsafe fn from_value_optional(value: &Value) -> Option<Self> { Some(FromValue::from_value(value)) } } impl<'a> F...
Rust
0
_pool_name().to_owned(), size: r.get_size(), thin: r.is_thin(), share: match r.get_share_type() { Some(share_type) => match share_type { ShareType::Nvmf => rpc::ShareProtocolReplica::ReplicaNvmf, }, None => rpc::Shar...
Rust
0
ed) # Test case 10: Test with SABIC criterion loss = 1.0 TSS = 10.0 N = 10 num_coeffs = 2 result = selection_criteria( loss, TSS, N, num_coeffs, model_selection_criteria="sabic" ) expected = 0.3966625373033108 assert np.allclose(result, expected) # Test case 11: Test wi...
Python
1
ensemble: str = "Hilbert–Schmidt", ) -> Density: """ Returns: A randomly sampled Density Args: qubits: A list or number of qubits. rank: Rank of density matrix. (Defaults to full rank) ensemble: Either 'Hilbert–Schmidt' (default) or 'Burr' Ref: - "Induced.info in the...
Python
1
_and_blind_inputs(&s12, &s22, &t2); // Both parties conver to BlindedInputs. Server checks MAC, Client doesn't. let p1_bl_input = BlindedInputs { blinded_x: p1_bl_auth .blinded_x .combine(&p2_bl_auth.blinded_x, &mac_key) ...
Rust
0
if p not in gold: FP += 1 precision = TP / float(TP+FP) if (TP+FP) != 0 else 0 recall = TP / float(TP+FN) if (TP+FN) != 0 else 0 F1 = 2 * precision * recall / \ float(precision + recall) if (precision+recall) != 0 else 0 else: if len(pred) == 0: ...
Python
1
from typing import Any from source import models from source.crud import user_role as user_role_crud from source.models import User from source.schemas import user_role as user_role_schemas from source.api import deps from source.constants.role import Role from fastapi import APIRouter, Depends, HTTPException, Securit...
Python
1
659; 'h 837FF; 'o7460", &[ Literal(Number(name("659"), None)), Semicolon, Literal(BasedInteger(None, false, 'h', name("837FF"))), Semicolon, Literal(BasedInteger(None, false, 'o', name("7460"))), ], ); } ...
Rust
0
= None if morsel["max-age"]: expires = time.time() + morsel["max-age"] elif morsel['expires']: expires = morsel['expires'] if type(expires) == type(""): time_template = "%a, %d-%b-%Y %H:%M:%S GMT" expires = time.mktime(time.strptime(expires, time_template)) c ...
Python
1
from __future__ import print_function, absolute_import import os, sys, subprocess, shlex, tempfile, time, sklearn.base, math import numpy as np import pandas as pd from pandas_extensions import * from ExeEstimator import * _default_path = 'utils/lib/' class SvmLightClassifier(ExeEstimator, sklearn.base.ClassifierMi...
Python
1
e in cf_matrix.flatten()] group_percentages = ["{0:.2%}".format(value) for value in cf_matrix.flatten()/np.sum(cf_matrix)] labs = [f"{v1}\n{v2}\n{v3}" for v1, v2, v3 in zip(group_names,group_counts,group_percentages)] labs = np.asarray(labs).reshape(2,2) plt.figure(figsize...
Python
1
fdsel).format = tt_get_unsigned_byte((*cff).handle); length = 1i32; match (*fdsel).format as i32 { 0 => { (*fdsel).num_entries = (*cff).num_glyphs; (*fdsel).data.fds = new(((*fdsel).num_entries as u32 as u64) .wrapping_mul(::std::mem::size_of::<card8>() as u64) ...
Rust
0
/// An extra value provided, currently only meant and used for `Take`. type Meta; /// The error that may occur when serializing. type Error: OutOfSpaceError; /// Serialize a type into raw bytes. fn serialize(data: &T, meta: Self::Meta, bytes: &'a mut [u8]) -> Result<usize, Self::Error>; } //...
Rust
0
import sys from configparser import ConfigParser from PyQt6.QtCore import Qt from PyQt6.QtWidgets import QApplication, QWidget from tool_funcs import start_btn_callback from tool_widget import Ui_Form ## Incase you get the "source code string cannot contain null bytes" error from trying to import the Ui_Form ## Ope...
Python
1
e.CHILLER: temperature = random.uniform(5, 12) + random.uniform(-1, 1) humidity = random.uniform(80, 95) + random.uniform(-3, 3) power_consumption = random.uniform(25, 40) + random.uniform(-5, 5) elif asset.asset_type == AssetTy...
Python
1
TxtCtl.Enter, ), ) CloseMessageWindow() ChrTalk( 0x0102, ( '#0020280177V#1033F#6P不……这点办不到。', TxtCtl.Enter, TxtCtl.Clear, '#0020280178V我的能力是针对隐密活动和\n', '对集团作战而特别强化过的。', TxtCtl.Enter, TxtCtl...
Python
1
import unittest import numpy as np import sys sys.path.append("../") from IntegratedGradients import * from keras.models import Sequential from keras.layers import Flatten, Dense, Dropout from keras.layers.core import Activation ########################################## # Potentially add tests for other axioms # # ...
Python
1
est] fn do_secp256k1_verify_larger_hash_fails() { let api = MockApi::default(); let (env, mut _instance) = make_instance(api); let mut hash = hex::decode(ECDSA_HASH_HEX).unwrap(); // extend / break hash hash.push(0x00); let hash_ptr = write_data(&env, &hash); ...
Rust
0
import numpy as np def normalize(v): norm = np.linalg.norm(v) if norm == 0: return v return v / norm def cos_sim(a, b): a = np.array(a) b = np.array(b) a_norm = np.linalg.norm(a) b_norm = np.linalg.norm(b) cos_theta = float(np.dot(a, b) / (a_norm * b_norm)) cos_theta = 0.5 +...
Python
1
#!/usr/bin/env python3 # -*-coding:utf8-*- # 注意demo无法直接运行,需要pip安装sdk后才能运行 # V2版本sdk # 单独设定某个电机的最大加速度 # 注意这个指令是通过协议直接写入到驱动flash中,不可实时更新 from typing import ( Optional, ) import time from piper_sdk import * if __name__ == "__main__": piper = C_PiperInterface_V2("can0") piper.ConnectPort() piper.EnableArm...
Python
1
2)) & 0x3) } pub fn write_to_slice(&self, slice: &mut [u8]) { for (val, letter) in slice.iter_mut().zip(self.as_bases_iter()) { *val = letter; } } pub fn as_bases_iter(&'a self) -> impl Iterator<Item = u8> + 'a { (0..self.size).map(move |i| unsafe { Utils::decompre...
Rust
0
lues(self): """Test parsing arguments with specified values""" test_args = [ 'chat_bridge.py', '--provider-a', 'openai', '--provider-b', 'anthropic', '--max-rounds', '50', '--temp-a', '0.5', '--starter', 'Test conversation' ...
Python
1
#!/usr/bin/env python3 """ ⚠️ ACADEMIC RESEARCH USE ONLY For authorized testing environments that comply with all applicable laws. See: https://github.com/botswin/BotBrowser/blob/main/DISCLAIMER.md """ import asyncio import os from playwright.async_api import async_playwright BOTBROWSER_EXEC_PATH: str = os.getenv("B...
Python
1
onditional_deps: conditional_deps[dep] = [] conditional_deps[dep].append((module, param_name)) if dependency in informations["depends"] and informations["enabled"]: unsatisfied |= set([module]) if dependency not in unsatisfi...
Python
1
# pip install pdfminer.six from pdfminer.high_level import extract_text text = extract_text("./pdfs/example.pdf") print(text) # ----- from io import StringIO from pdfminer.high_level import extract_text_to_fp output_string = StringIO() with open("./pdfs/example.pdf", 'rb') as fin: extract_text_to_fp(fin, output...
Python
1
reshape(3,4) P3_rect = cam2cam['P_rect_03'].reshape(3,4) # cam 2 is left of camera 0 -6cm # cam 3 is to the right +54cm b2 = P2_rect[0,3] / -P2_rect[0,0] b3 = P3_rect[0,3] / -P3_rect[0,0] baseline = b3-b2 if cam==2: focal_length = P2_rect[0,0] elif cam==3: focal_lengt...
Python
1
::std::io::stderr(), " {}.{} error: {}", model_name, var_name, err ) .unwrap(); } }...
Rust
0
pub fn new( presentation_api: &str, item_id: &Id, index: usize, items: Vec<Annotation>, ) -> AnnotationPage { AnnotationPage { id: AnnotationPage::id(presentation_api, item_id, index), items, } } } #[derive(Debug, Serialize)] #[serde(t...
Rust
0
# # BSD LICENSE # # Copyright (c) Crane Chu <cranechu@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # ...
Python
1
<&attr::Variant>, container_default: &attr::Default, ) -> (Style, Vec<Field<'a>>) { match fields { syn::Fields::Named(fields) => ( Style::Struct, fields_from_ast(cx, &fields.named, attrs, container_default), ), syn::Fields::Unnamed(fields) if fields.unnamed.len() ...
Rust
0
gr.inputs.Radio(["cpu", "cuda"], label="Device", default="cpu"), gr.inputs.Radio(["yolov5n", "yolov5s", "yolov5m", "yolov5l", "yolov5x", "custom"], label="Model Type", default="yolov5n"), gr.inputs.File(label="Model Path"), gr....
Python
1
from teil.ebis.decomposition import PCATranspiler as Transpiler from sklearn.decomposition import PCA from sklearn.datasets import load_iris dt = PCA(n_components=1) X, y = load_iris(return_X_y=True) dt.fit(X, y) transpiler = Transpiler( model = dt, model_name = "PCAIris" ) transpiler.transpile( folder_...
Python
1
from robojudo.controller.ctrl_cfgs import BeyondMimicCtrlCfg class G1BeyondmimicCtrlCfg(BeyondMimicCtrlCfg): # ==== motion config ==== robot: str = "g1" # default as only supported g1 motion_name: str = "dance1_subject2" motion_cfg: BeyondMimicCtrlCfg.MotionCommandCfg = BeyondMimicCtrlCfg.MotionComm...
Python
1
, w2) logits2_jig = self._compute_logit(x2_jig, w1) # set label labels = torch.zeros(bsz, dtype=torch.long).cuda() # update memory if (all_x1 is not None) and (all_x2 is not None) \ and (all_y is not None): self._update_memory(self.memory_1, all_...
Python
1
() } else { return Err("Error parsing error response. Group `description` not found".into()) }; Ok(DiagramError { line_number, description, raw_description: error.to_owned() }) } } #[cfg(test)] mod tests { use crate::types::Diagram...
Rust
0
topic_params.first_message_deliveries_weight = 0.0; topic_params.mesh_failure_penalty_weight = 0.0; topic_params.time_in_mesh_weight = 0.0; topic_params.time_in_mesh_quantum = Duration::from_secs(1); topic_params.invalid_message_deliveries_weight = 0.0; params.topics.insert(topic_hash, topic_p...
Rust
0
import builtins import datetime import sqlite3 from sqlite3 import Error from libs.sql import * # Provides us with a global var "db_name" we can access anywhere builtins.db_name = "weirdAAL.db" target = "sometarget" #create some tables to stick data in if __name__ == "__main__": timenow = datetime.datetime.now...
Python
1
_eq!(r.signed_min.s8be, -9223372036854775808); assert_eq!(r.signed_max.s1, 127); assert_eq!(r.signed_max.s2le, 32767); assert_eq!(r.signed_max.s4le, 2147483647); assert_eq!(r.signed_max.s8le, 9223372036854775807); assert_eq!(r.signed_max.s2be, 32767); assert_eq!(r.signed_...
Rust
0
k_flatten, # bs, num_tokens reference_points=reference_points, # num_queries, 4 spatial_shapes=spatial_shapes, # nlvl, 2 level_start_index=level_start_index, # nlvl valid_ratios=valid_ratios, # bs, nlvl, 2 attn_masks=[self_attn_mask, None], **...
Python
1
the rest of the compiler. That's not how it works. The only // thing macros do is emit code that could have been written by hand. If you // couldn't have come up with some piece of tricky code from one of those // magical macros, learning more "about macros" won't change that; but learning // more about every other pa...
Rust
0
# Copyright (c) 2015-2024 EPFL/Blue Brain Project # All rights reserved. Do not distribute without permission. # # Responsible Author: adrien.fleury@epfl.ch # # This file is part of Brayns <https://github.com/BlueBrain/Brayns> # # This library is free software; you can redistribute it and/or modify it under # the terms...
Python
1
ed = True for mod, param in zip(mods, params): if isinstance(mod, relay.function.Function): mod = tvm.IRModule.from_expr(mod) assert isinstance( mod, tvm.IRModule ), "only support relay Module or Function to be tuned" relay.backend...
Python
1
_stars>0 use lazy_static::lazy_static; use solana_sdk::{ clock::Slot, hash::{Hash, Hasher}, pubkey::Pubkey, }; use std::collections::{HashMap, HashSet}; pub mod instructions_sysvar_enabled { solana_sdk::declare_id!("EnvhHCLvg55P7PDtbvR1NwuTuAeodqpusV3MR5QEK8gs"); } pub mod secp256k1_program_enabled { ...
Rust
0
o { // If this is a histogram and we merge if let Some(ref other) = other.histo { // If the other was also a histogram merge them histo.merge(other).ok(); } else { // if the other was still a cache add it's valu...
Rust
0
# --- Store results --- predictions_all.append(prediction_clipped) actuals_all.append(y_test) maes.append(np.abs(prediction_clipped - y_test)) null_maes.append(np.abs(np.mean(y_train) - y_test)) return (np.array(predictions_all), np.array(actuals_all), np.mean(maes),...
Python
1
== 2 @patch( "pcapi.core.mails.transactional.bookings.booking_event_reminder_to_beneficiary.get_booking_event_reminder_to_beneficiary_email_data" ) def should_log_errors(self, mock_get_booking_event_reminder_to_beneficiary_email_data, caplog): tomorrow = date_utils.get_naive_utc_now() + da...
Python
1
::MySQL, ); match result { Ok(_) => panic!("This test should throw an error"), Err(err) => assert_eq!( true, err.to_string() .contains("Invalid query, no statements was specified") ), } } #[test] ...
Rust
0
import os import pandas as pd import matplotlib.pyplot as plt import seaborn as sns # Pathing yang rapi DATA_DIR = "data" OUTPUT_DIR = "output" os.makedirs(DATA_DIR, exist_ok=True) os.makedirs(OUTPUT_DIR, exist_ok=True) # Muat data df = pd.read_csv(os.path.join(DATA_DIR, 'cleaned_data.csv')) print("📊 Statistik Deskr...
Python
1
position_ids = position_ids.reshape(1, -1) image_selected = (input_ids == self.config.image_token_index) audio_selected = (input_ids == MODAL_INDEX_MAP['<audio>']) input_ids[image_selected] = 0 input_ids[audio_selected] = 0 input_embeds = self.get_model().embed_tok...
Python
1
)).collect() } #[test] fn test_is_nice() { assert_eq!(is_nice("ugknbfddgicrmopn"), true); assert_eq!(is_nice("aaa"), true); assert_eq!(is_nice("jchzalrnumimnmhp"), false); assert_eq!(is_nice("haegwjzuvuyypxyu"), false); assert_eq!(is_nice("dvszwmarrgswjxmb"), false);...
Rust
0
nst KSMETHOD_BDA_TUNER_SIGNALNOISERATIO: KSMETHOD_BDA_TUNER_SERVICE = 2i32; #[doc = "*Required features: 'Win32_Media_DirectShow'*"] pub type KSMETHOD_BDA_USERACTIVITY_SERVICE = i32; #[doc = "*Required features: 'Win32_Media_DirectShow'*"] pub const KSMETHOD_BDA_USERACTIVITY_USEREASON: KSMETHOD_BDA_USERACTIVITY_SERVICE...
Rust
0
{ 'name': 'Romania - E-Transport', 'version': '1.0', 'category': 'Accounting/Localizations/EDI', 'description': """ E-Transport implementation for Romania """, 'depends': ['stock_delivery', 'l10n_ro_efactura'], 'assets': { 'web.assets_backend': [ 'l10n_ro_edi_stock/static...
Python
1
: '', # German 'Bilder' : '', 'Dokumente' : '', 'Musik' : '', 'Schreibtisch' : '', 'Vorlagen' : '', 'Öffentlich' : '', } f...
Python
1
# Ultroid - UserBot # Copyright (C) 2021-2023 TeamUltroid # # This file is a part of < https://github.com/TeamUltroid/Ultroid/ > # PLease read the GNU Affero General Public License in # <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>. """ ✘ Commands Available - •`{i}glitch <reply to media>` gives a...
Python
1
#[bench] fn from_vec3_small(bencher: &mut Bencher) { from_vec3(bencher, 2_usize.pow(2)); } #[bench] fn from_vec3_medium(bencher: &mut Bencher) { from_vec3(bencher, 2_usize.pow(4)); } #[bench] fn from_vec3_large(bencher: &mut Bencher) { from_vec3(bencher, 2_usize.pow(5)); } fn iter_with_gil(bencher: &mut ...
Rust
0
from tabulate import tabulate # Begin met 4 dictionaries (personen) met naam, leeftijd en woonplaats personen = [ {"naam": "Jan", "leeftijd": 28, "woonplaats": "Amsterdam"}, {"naam": "Lisa", "leeftijd": 34, "woonplaats": "Rotterdam"}, {"naam": "Ahmed", "leeftijd": 22, "woonplaats": "Utrecht"}, {"naam":...
Python
1
"""Esquemas Pydantic para estadísticas de información personal en el dashboard.""" from pydantic import BaseModel from typing import List class CountItem(BaseModel): """ Elemento con etiqueta y su conteo. Ejemplo: { "label": "Bogotá", "count": 42 } """ lab...
Python
1
{ test_try_u64usize, u64, usize } test_impl_try_from_same_sign_err! { test_try_i32isize, i32, isize } test_impl_try_from_same_sign_err! { test_try_i64isize, i64, isize } } #[cfg(target_pointer_width = "32")] { test_impl_try_from_same_sign_err! { test_try_u64usize, ...
Rust
0
rch.arange(0, H), torch.arange(0, W)]) # [0,511] HxW if device >= 0: hg = hg.to(device) wg = wg.to(device) #[B,H,W,1] hg = hg.float().repeat(N, 1, 1).unsqueeze(3) / (H-1) * 2 - 1 # norm to [-1,1] NxHxWx1 wg = wg.float().repeat(N, 1, 1).unsqueeze(3) / (W-1) * 2 - 1...
Python
1
0], !vars[1], !vars[2], vars[3]]); solver.consume_clause([ vars[0], !vars[1], !vars[2], !vars[3]]); solver.consume_clause([!vars[0], vars[1], vars[2], vars[3]]); solver.consume_clause([!vars[0], vars[1], vars[2], !vars[3]]); solver.consume_clause([!vars[0], vars[1], !vars[2], vars[3]]); solv...
Rust
0