text
string
label_name
string
labels
int64
from machine import Pin, I2C import utime import gc class mpu6050: PWR_MGMT_1 = 0x6B SMPLRT_DIV = 0x19 CONFIG = 0x1A GYRO_CONFIG = 0x1B ACCEL_CONFIG = 0x1C TEMP_OUT_H = 0x41 ACCEL_XOUT_H = 0x3B GYRO_XOUT_H = 0x43 def __init__(self, i2c, address=0x68): # Free up hard...
Python
1
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from UM.Math.Vector import Vector from UM.Operations.Operation import Operation from UM.Operations.GroupedOperation import GroupedOperation from UM.Scene.SceneNode import SceneNode class PlatformPhysicsOperation(Operation)...
Python
1
work_client.load_balancers.begin_create_or_update( GROUP_NAME, LB_NAME, load_balancer_parameters ).result().frontend_ip_configurations print("Create Frontend IP Configuration:\n{}".format(lb_fip_config[-1])) # Create Outbound Pool load_balancer_parameters.backend_address_pools.a...
Python
1
test_project_manifest).unwrap(); let expected_manifest_after_update = std::fs::read_to_string(test_project_root.join("Cargo.expected.toml")).unwrap(); assert_eq!(observed_manifest_after_update, expected_manifest_after_update); } fn setup_test_directory(test_source_dir: PathBuf) -> PathBuf { /// We ...
Rust
0
println!("GLOBAL.live: {}", GLOBAL.live()); println!("GLOBAL.used: {}", GLOBAL.used()); let _y = unsafe { GLOBAL.alloc(Layout::for_type::<usize>()) }.unwrap(); println!("Allocated ptr: {:p}; size: {}", _y.as_ptr(), _y.size()); println!("GLOBAL.live: {}", GLOBAL.live()); println!("GLOBAL.used: {}", ...
Rust
0
self) -> list[str]: """ Return a list of all files that are used by the command to create the expected outputs. For example, if your build command transpiles Java files into Python, you should list here all the Java files. The primary purpose of this function is to help p...
Python
1
# from rich.console import Console # from rich.panel import Panel # from rich.text import Text # from rich.live import Live # # class RichLivePanelHelper: # _console = Console() # _title = None # _content = None # _live = None # _live_context = None # # @staticmethod # def open_panel(title: ...
Python
1
eg): # def __init__(self, # encoder_args=None, # decoder_args=None, # cls_args=None, # distill_args=None, # criterion_args=None, # **kwargs): # super().__init__() # self.encoder = build_model_from...
Python
1
# parent is on return True if ( self._device.powerMainsFailure or self._device.moistureDetected or self._device.waterlevelDetected or self._device.lowBat or self._device.dutyCycle ): return True if ( ...
Python
1
pub fn version(&self) -> &'static SupportedProtocolVersion { match self { SupportedCipherSuite::Tls12(_) => &TLS12, SupportedCipherSuite::Tls13(_) => &TLS13, } } /// Return true if this suite is usable for a key only offering `sigalg` /// signatures. This resolves t...
Rust
0
warning_text = ttk.Label(warning_frame, text="⚠️ O script sempre abrirá um Chrome com perfil limpo\n" "⚠️ Será necessário escanear o QR Code do WhatsApp Web para fazer login\n" "⚠️ Este método pode v...
Python
1
en::<char>(), random_string(), random_string(), rng.gen::<isize>()) => 0,1,2,3,4,5,6); tester!(tuples (random_string(), random::<usize>(), random_string(), rng.gen::<char>(), random_string(), random_string(), rng.gen::<isize>(), rng.gen::<bool>()) => 0,1,2,3,4,5,6,7); tester!(tuples (random_string(), rng.gen::<...
Rust
0
onv_cfg, norm_cfg=self.norm_cfg, act_cfg=self.act_cfg) stage.append(spp) csp_layer = RECSPLayer( out_channels, out_channels, num_blocks=num_blocks, add_identity=add_identity, use_depthwise=self.use_depthwise,...
Python
1
import base64 import hashlib import hmac import random import string import time from concurrent.futures import ThreadPoolExecutor from datetime import datetime from typing import Dict, List, Optional, Union import requests from opencompass.utils.prompt import PromptList from .base_api import BaseAPIModel PromptTyp...
Python
1
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # pyre-unsafe import logging from typing import Callable, Optional import torch from reagent.models.base import ModelBase logger = logging.getLogger(__name__) def run_model_jit_trace( model: ModelBase, script_mo...
Python
1
"Download to Phone"), # too similar to another ("📵", False, "No Mobile Phones"), # dull ("📞", True , "Old Phone"), ("🔟", False, "Keycap Ten"), # dull ("📶", False, "Antenna With Bars"), # dull ("📟", True , "Pager"), ("📠", ...
Python
1
new account with Hearling. Returns: str: The authentication token for the newly created account. """ email = f"{self.email_prefix}{random.randint(10000, 99999)}@gmail.com" payload = {"email": email, "password": "DevsDoCode"} response = self.session.post(self.url_acc...
Python
1
"""empty message Revision ID: 4ad687b0eecb Revises: Create Date: 2022-07-06 20:49:34.466313 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '4ad687b0eecb' down_revision = None branch_labels = None depends_on = None def upgrade() -> None: # ### commands a...
Python
1
not provided by deck configuration." ) def get_current_potential_cutout_fixtures_for_addressable_area( self, addressable_area_name: str ) -> tuple[str, Set[PotentialCutoutFixture]]: """Get the set of cutout fixtures that might provide a given addressable area. This take...
Python
1
############################################################################# # Copyright (C) 2020-2025 MEmilio # # Authors: Maximilian Betz # # Contact: Martin J. Kuehn <Martin.Kuehn@DLR.de> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Li...
Python
1
############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c), 2013-2025, John McNamara, jmcnamara@cpan.org # import unittest import warnings from xlsxwriter.utility import xl_range, xl_range_abs class TestUtilit...
Python
1
: print(f"{Fore.RED} ✖ {LANG[language]['pvkey_not_found']}{Style.RESET_ALL}") with open(file_path, 'w') as f: f.write("# Thêm private keys vào đây, mỗi key trên một dòng\n# Ví dụ: 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\n") sys.exit(1) ...
Python
1
hz: u32, vos: Vos) { let div: u32 = u32::from(hclk3_prescaler_div(rcc)); let flash_clk_src_freq: u32 = target_sysclk_hz / div; let ws: LATENCY_A = match vos { Vos::V1_2 => match flash_clk_src_freq { 0..=18_000_000 => LATENCY_A::WS0, 18_000_001..=36_000_000 => LATENCY_A::WS1,...
Rust
0
w: &'a mut W, } impl<'a> LO_LF_RZ_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.bits & !(0x03 << 12)) | (((value as u32) & 0x03) << 12); self.w } } #[doc = "Field `lo_lf_cz_hw` reader - "] p...
Rust
0
t found", test_fun); } #[test] fn test_token_transfer_exceed_amount_tokens() { let test_fun = Box::new( move |token_id, alice_pub_key, karl_pub_key, token_utxo_hash, token_utxo: TransactionOutput<H256>| { Transaction { inpu...
Rust
0
row.encode(&mut vec); println!("{:?}",vec); } }use crate::algorithm::coords_iter::CoordsIter; use crate::{CoordNum, Coordinate}; /// Find the extreme coordinates and indices of a geometry. /// /// # Examples /// /// ``` /// use geo::extremes::Extremes; /// use geo::polygon; /// /// // a diamond shape /// l...
Rust
0
map.insert("533528", "云南省沧源佤族自治县"); map.insert("540000", "西藏自治区"); map.insert("540100", "西藏自治区拉萨市"); map.insert("540101", "西藏自治区拉萨市市辖区"); map.insert("540102", "西藏自治区拉萨市城关区"); map.insert("540120", "西藏自治区拉萨市区"); map.insert("540121", "西藏自治区林周县"); map.insert("540...
Rust
0
]}", "failed", {"prompt": prompt, "error": str(e)} ) print(f" 特殊字符测试 {i+1}: 失败 - {str(e)[:30]}") def test_invalid_parameters(results: EdgeCaseResults): """测试无效参数""" print("\n=== 无效参数测试 ===") # 测试无效模型名 print("\n1. 无效模型名测试") invalid_models...
Python
1
turn_value = {"id": 0, "code": "3d4893da", "companyId": 123} get_cached_response_or_fetch_mock.return_value = return_value # when response = get_order_tax_data(order, conf) # then get_order_request_data_mock.assert_called_once_with(order, conf) assert response == return_value @patch("saleor....
Python
1
ra_service; <filename>dc_hir/src/lib.rs use dc_lexer::Loc; pub use expression::*; pub use function::*; pub use hir::*; pub use statement::*; pub use struct_def::*; pub use types::*; pub mod expression; pub mod function; pub mod hir; pub mod statement; pub mod struct_def; pub mod types; #[derive(Clone, Debug)] pub str...
Rust
0
ain-clean-100 1657, # alwpoe M train-clean-360 1728, # Vinnie Tesla M train-clean-360 1805, # Vince Dee M train-clean-100 2143, # Suebee F train-clean-360 2084, # Eberle Thomas M train-other-500 2479, # Daisy Flaim F train-clean-100 2152, # Kristel Tretter F train-clean-360 ...
Python
1
# # Strelka - Small Variant Caller # Copyright (c) 2009-2018 Illumina, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # at your option) any later vers...
Python
1
def taxed_coin_exchange(coins, target_sum, tax_values): dp = [[0 for _ in range(target_sum + 1)] for _ in range(len(coins) + 1)] for i in range(1, len(coins) + 1): for j in range(1, target_sum + 1): if coins[i - 1] <= j: dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - coins[i - ...
Python
1
.false) Ensures(WaitLevel() < Level(l)) # Loops. def locks_creating_loop() -> ObjectLock: Ensures(WaitLevel() < Level(Result())) l = ObjectLock(object()) i = 0 while i < 5: Invariant(l is not None) Invariant(WaitLevel() < Level(l)) l.acquire() l.release() ...
Python
1
} impl Add for DirectoryExclusionFilter { type Output = Self; fn add(self, rhs: Self) -> Self::Output { let mut junction_pts = false; let mut result_path_or_name = match self { Self::PathOrName(attribs) | Self::_BOTH(attribs) => attribs, Self::JUNCTION_POINTS => {...
Rust
0
str, List[List[Dict[str, float]]]]) -> None: if not preset: self.to_draw_points = False elif preset["advancedCLUT"]: self.to_draw_points = True self.points = preset["16bitClutCurves"] self.colours = preset["16bitClutColors"] self.CalculatePixel...
Python
1
f64; [`self.bader_maxima`].len()]; Number of Densities]. pub bader_charge: Vec<Vec<f64>>, /// The volume associated with each maxima. pub bader_volume: Vec<f64>, /// The charge associated with each atom. Same form as [`self.bader_charge`] /// however inner length is [`Atoms.positions`].len(). pu...
Rust
0
import json root_path = "/opt/data/private/peihua/KGUnL" model_name = "LLAMA38B" data_name = "advbench" with open(f"{root_path}/result/score/first_level/{model_name}/{data_name}_wo_unlearning_cyc_epoch_1_1.json") as f: dataset = json.load(f) out_data = {} success_attack = 0 success_origin = 0 unsuccess_cnt = 0 f...
Python
1
curr_pos += 1; let mut_index = param_get( param_vec_iter.next().unwrap(), int_input, curr_pos, relative_base, ); if ((comp_vec[0] < comp_vec[1]) & (opcode == 7)) ...
Rust
0
in {:?}", substs_types[0], span )), }; let depth = eval_const_param(substs_types[2]); let sampled = eval_const_param(substs_types[3]); let image_format = match ImageFormat::from_u32(eval_const_param(substs_types[4])) { Some(format) => format, None => cx.tcx.sess.fata...
Rust
0
import logging from pathlib import Path from peewee import SqliteDatabase from decouple import config from pyrogram import Client # получение конфигурационных переменных из .env файла API_TOKEN = config("API_TOKEN") API_ID = config("API_ID") API_HASH = config("API_HASH") ADMIN_CHAT_ID = int(config("ADMIN_CHAT_ID")) ...
Python
1
import os import asyncio from dotenv import load_dotenv from supabase import AsyncClient, create_async_client load_dotenv() SUPABASE_URL = os.getenv("SUPABASE_URL") SUPABASE_ANON_KEY = os.getenv("SUPABASE_ANON_KEY") # Lazy-initialized Supabase client _supabase_client: AsyncClient | None = None _supabase_lock = async...
Python
1
} } } pub fn process_finish(status: &crate::exec::ProcessExit) { extern "C" { fn strsignal(sig: std::os::raw::c_int) -> *const std::os::raw::c_char; } fn code(code: i32) -> String { match code { 64 => "exit 64 (EX_USAGE)".to_owned(), 65 => "exit 65 (EX_DATAE...
Rust
0
s", ): ONNXConverter(n_bits=n_bits, numpy_model=numpy_module) n_bits_wrong_key = [ pytest.param( { "model_inputs": 8, "model_outputs": 3, "op_inputs": 8, "op_weights": 8, }, id="n_bits_larger_op_inputs_than_model_outputs", ), ...
Python
1
import unittest import coc from coc.utils import UnitStatList import tracemalloc tracemalloc.start() class ClashMetaTests(unittest.TestCase): # def test_load_never(self): # client = coc.login_with_keys("", load_game_data=coc.LoadGameData(never=True)) # with self.assertRaises(RuntimeError) as c...
Python
1
"account": "${APPVEYOR_ACCOUNT}", "project": "${APPVEYOR_PROJECT}", "count": ${APPVEYOR_COUNT} } }, { "duck": { "id": "${DUCK_ID}", "serverUrl": "${DUCK_SERVER_URL}" ...
Rust
0
import osmapi import pytest from unittest import mock import responses import os import re __location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) @pytest.fixture def file_content(): def _file_content(filename): path = os.path.join(__location__, "fixtures", filename) ...
Python
1
new(); let mut current_guard_id: Option<u32> = None; for record in records { let time = record.time; if let Some(id) = record.id { if !guards.contains_key(&id) { guards.insert(id, Guard::new(id, time)); } current_guard_id = Some(id); ...
Rust
0
"""LCM type definitions This file automatically generated by lcm. DO NOT MODIFY BY HAND!!!! """ from io import BytesIO import struct class robot_control_response_lcmt(object): __slots__ = ["mode", "gait_id", "contact", "order_process_bar", "switch_status", "ori_error", "footpos_error", "motor_error"] __typen...
Python
1
ngs = set(date.strftime("%Y-%m-%d") for date in trading_dates) # Check if file already exists and read existing dates existing_date_strings = set() if self.us_calendar_path.exists(): logger.info(f"Existing calendar file found: {self.us_calendar_path}") ...
Python
1
. Choose from: {', '.join(available_types)}") return # Parse tasks tasks = parser.parse_file(input_file, pattern_choice) if not tasks: print("No tasks found with the specified patterns.") return # Generate output filename ...
Python
1
: UnorderedSet<AccountId>, } #[derive(BorshStorageKey, BorshSerialize)] pub(crate) enum StorageKey { Lockups, AccountLockups, DepositWhitelist, } #[near_bindgen] impl Contract { #[init] pub fn new(token_account_id: ValidAccountId, deposit_whitelist: Vec<ValidAccountId>) -> Self { let mut d...
Rust
0
::os::raw::c_char, pnFileSizeInBytes: *mut int32, pSteamIDOwner: *mut CSteamID, ) -> bool; } extern "C" { pub fn SteamAPI_ISteamRemoteStorage_UGCRead( self_: *mut ISteamRemoteStorage, hContent: UGCHandle_t, pvData: *mut ::std::os::raw::c_void, cubDataToRead: int32, cOffset: uint32, eAction: EUGCReadAc...
Rust
0
import torch from torch import nn import math class PositionalEncoding(nn.Module): """ Implements the sinusoidal positional encoding for non-recurrent neural networks. Implementation based on "Attention Is All You Need" :cite:`DBLP:journals/corr/VaswaniSPUJGKP17` Args: dropout_prob (f...
Python
1
eff, index) in (&circuit.bt[i]).into_iter() { match index { Index::Input(j) => bi += &(r_io_values[*j] * coeff), Index::Aux(j) => bi += &(proof.r_mid_q_values[*j] * coeff), } } let mut ci = zero; for (coeff, index) in (&circuit.ct[i]).into...
Rust
0
leep(1) # ... return # >>> my_function() # 1994-06-01 91:06:21 - my_function - INFO - Execution time: 1.0000 seconds # """ # @wraps(func) # def wrapper(*args, **kwargs): # start_time = time.time() # result = func(*args, **kwargs) # end_time = time.time() # if ...
Python
1
ry_samples) } ) def compute_memory_growth(self) -> MetricResult: """Compute memory growth rate.""" if len(self.memory_samples) < 2: return MetricResult( name="Memory Growth", value=0.0, unit="MB/min", de...
Python
1
/ # .child("1-0") /// # .sibling("1-1") /// # .sibling("1-2") /// # .parent() /// # .sibling("2"); /// # let root = builder.root_id(); /// let before = r#"root /// |-- 0 /// |-- 1 /// | |-- 1-0 /// | |-- 1-1 /// | `-- 1-2 /// `-- 2"#; /// ass...
Rust
0
from gevent.subprocess import value from pydantic import BaseModel, Field, condecimal, field_validator, model_validator class User(BaseModel): name: str = Field (default="test") age: int @field_validator('age') def age_validator(cls, value): if value > 18: raise ValueError("ошибк...
Python
1
mut a_rr = public_nonce.clone(); a_rr.mul_assign(secp, private_view_key)?; for i in 0..2 { let h = ( format!("ecp{}", i).as_bytes().to_vec(), a_rr.serialize_vec(&secp, true).as_ref().to_vec(), ) .hash(); if let Ok(_) = SecretKey::from_slice(&secp, h.as_bytes()) { return Ok(h[0]); } }...
Rust
0
#!/usr/bin/env python # This script tests the bounds calculation of vtkCompositePolyDataMapper # when the composite data set has empty blocks. from vtkmodules.vtkCommonCore import vtkPoints from vtkmodules.vtkCommonDataModel import ( vtkCellArray, vtkMultiBlockDataSet, vtkPolyData, ) from vtkmodules.vtkRe...
Python
1
from] tokio::sync::broadcast::error::RecvError), } /// The top-level server result type. pub type Result<T> = std::result::Result<T, Error>; // Ogg decoder and encoder written in Rust // // Copyright (c) 2016-2017 est31 <<EMAIL>> // and contributors. All rights reserved. // Redistribution or use only under the terms /...
Rust
0
""" The SummarizerBot class is responsible for summarizing chat messages. It uses internal methods to render system and user messages based on the latest messages. """ from typing import List, Dict, Any from llama_index.core.schema import Document from frag.settings.bot_model_settings import BotModelSettings from frag...
Python
1
gs), num_msgs) def test_recv_sock(self): sock = "carState" pub_sock = messaging.pub_sock(sock) sub_sock = messaging.sub_sock(sock, timeout=100) zmq_sleep() # no wait and no msg in queue, socket should timeout recvd = messaging.recv_sock(sub_sock) self.assertTrue(recvd is None) # no ...
Python
1
type="float32") p = ops.convert_to_tensor(self.num_regressors, dtype="float32") num = ops.multiply( ops.subtract(1.0, r2_score), ops.subtract(n, 1.0) ) den = ops.subtract(ops.subtract(n, p), 1.0) r2_score = ops.subtract(...
Python
1
"""Predefined Test Presets for Test Suite""" from .classification_binary import BinaryClassificationTestPreset from .classification_binary_topk import BinaryClassificationTopKTestPreset from .classification_multiclass import MulticlassClassificationTestPreset from .data_drift import DataDriftTestPreset from .data_qual...
Python
1
(); // create sector manager and index manager let sec_mgr = SectorMgr::new(&local_cache); let idx_mgr = IndexMgr::new( Box::new(IndexAccessor::<Lsmt>::new(&local_cache)), Box::new(IndexAccessor::<MemTab>::new(&local_cache)), Box::new(IndexAccessor::<Tab>::ne...
Rust
0
therwise run the operation on multiple outlets in parallel the return code will be failure if any operation fails. Operations that return a string will return a list of strings. """ if len(outlets) == 1: result = getattr(self, command)(outlets[0]) if isinstance(r...
Python
1
# uncompyle6 version 2.11.5 # Python bytecode 2.7 (62211) # Decompiled from: Python 2.7.18 (default, Apr 20 2020, 20:30:41) # [GCC 9.3.0] # Embedded file name: Exploits\Com_facileforms.py import requests from Exploits import printModule from Tools import wsoShellUploaderModule r = '\x1b[31m' g = '\x1b[32m' y = '\x1b[3...
Python
1
# $Id: fa.py 4564 2016-08-10 11:48:42Z # Author: Shahin <me@5hah.in> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <https://docutils.sourceforge.io/docs/howto/i18n.html>. # Two files must be translated for each languag...
Python
1
byte: u8) -> Option<Sign> { match byte { b'+' => Some(Sign::Plus), b'-' => Some(Sign::Minus), _ => None, } } /// Returns either `+1` or `-1` pub fn signum<I>(self) -> I where I: Signed, { match self { Sign::Plus => I::o...
Rust
0
from models.wallets import Wallet from datetime import datetime from services.metamask import MetaMaskService class UpdateBalanceWallet: def __init__(self): self.wallet_model = Wallet() self.metamask_service = MetaMaskService() def execute(self, wallet_id): data = self.wallet_model.find_one({"id": wallet_id}...
Python
1
}") img.seek(0) if img.mode == 'RGBA' or img.format == 'GIF': img = await self.hass.async_add_executor_job(lambda x: x.convert('RGB'), img) enhanced_img = await self.hass.async_add_executor_job( self.enhance_center, im...
Python
1
ice::from_raw_parts_mut(table_base as *mut MsixTableEntry, vector_count as usize) }; let pba_entries: &'static mut [Mmio<u64>] = unsafe { slice::from_raw_parts_mut( table_base as *mut Mmio<u64>, (vector_count as usize + 63) / 64, ) }; ...
Rust
0
verb) = find_noun_verb(&program, 19690720)?; println!("{}", 100 * noun + verb); Ok(()) } use ring::hkdf::{Algorithm, KeyType, Prk, HKDF_SHA256}; use ring::rand::{SecureRandom, SystemRandom}; use super::private::KEY_LEN as PRIVATE_KEY_LEN; use super::signed::KEY_LEN as SIGNED_KEY_LEN; static HKDF_DIGEST: Algo...
Rust
0
from flask_restx import Namespace, Resource, fields from models.model_turmas import * from controllers.turmas_controller import * turmas_ns = Namespace("Turmas", description="Operações relacionadas as turmas") turma_model = turmas_ns.model("Turmas", { "turma_id": fields.Integer(required=True, description="Id da t...
Python
1
ror as e: raise ImportError(f'"{dotted_path}" doesn\'t look like a module path') from e module = import_module(module_path) try: return getattr(module, class_name) except AttributeError as e: raise ImportError(f'Module "{module_path}" does not define a "{class_name}" attribute') fro...
Python
1
import pyautogui as gui import multiprocessing # gui.displayMousePosition() gui.PAUSE = 0.01 main_btn_pos = (430, 408) upgrade_btn_pos = [ (955, 315), (955, 385), (955, 455), (955, 521), (955, 591) ] def click_main(): while True: gui.click(main_btn_pos) def click_upgrade(): whi...
Python
1
Int: HInt, { let one = F::Int::ONE; let zero = F::Int::ZERO; // let bits = F::BITS; let significand_bits = F::SIGNIFICAND_BITS; let max_exponent = F::EXPONENT_MAX; let exponent_bias = F::EXPONENT_BIAS; let implicit_bit = F::IMPLICIT_BIT; let significand_mask = F::SIGNIFICAND_MASK; ...
Rust
0
for i in 0..16 { camera_object_data._jitter_mode_hammersley16x[i] = math::hammersley_2d(i as u32, 16) * 2.0 - Vector2::new(1.0, 1.0); } camera_object_data } pub fn get_camera_front(&self) -> &Vector3<f32> { &self._transform_object.get_front() } pub fn get_cam...
Rust
0
#!/usr/bin/env python3 -u # -*- coding: utf-8 -*- # copyright: skbase developers, BSD-3-Clause License (see LICENSE file) """Tests of the functionality for working with iterables. tests in this module include: - test_remove_single - test_flatten - test_unflatten - test_unflat_len - test_is_flat """ # import pytest f...
Python
1
("File not found: {}", in_file); } } }<gh_stars>0 use crate::schema::users; use crate::serde::trim_str; use serde::Deserialize; use typescript_definitions::TypeScriptify; #[derive(Deserialize, TypeScriptify, Validate, Debug)] #[serde(rename_all = "camelCase")] pub struct LoginForm<'a> { #[validate(ema...
Rust
0
#[inline] pub fn modify(&mut self, fd: Int, events: Events) -> io::Result<()> { self.modify3(fd, events, fd as u64) } #[inline] pub fn add2(&mut self, fd: Int, event: Event) -> io::Result<()> { self.add3(fd, event.events, event.data) } #[inline] pub fn modify2(&mut self...
Rust
0
import streamlit as st import json import httpx import jmespath from typing import Dict from urllib.parse import quote INSTAGRAM_APP_ID = "936619743392459" client = httpx.Client( headers={ "x-ig-app-id": INSTAGRAM_APP_ID, "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ...
Python
1
"], }, #[cfg(feature = "fr")] crate::Annotation { lang: "fr", tts: Some("visage avec un léger sourire"), keywords: &["sourire", "visage avec un léger sourire"], }, #[cfg(feature = "fr_CA")] crate::Annotation { lang: "fr_CA",...
Rust
0
foo, "{}", out(reg) foo); //~^ ERROR expected one of asm!(format!("{{{}}}", 0), in(reg) foo); //~^ ERROR asm template must be a string literal asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar); //~^ ERROR asm template must be a string literal asm!("{}", in(reg...
Rust
0
kind: crate::error::UpdateUserErrorKind::ThrottlingException({ #[allow(unused_mut)] let mut tmp = { #[allow(unused_mut)] let mut output = crate::error::throttling_exception::Builder::default(); let _ = response; ...
Rust
0
hLike)): try: self.get_key(key, remote_path).file.remove() except FileNotFoundError: pass def rename_key(self, key:str, remote_path: Union(str, PathLike), new_remote_path: Union(str, PathLike)): remote_path = PurePath(remote_path) new_remote_path = PurePath(n...
Python
1
ic RENDER_SCALE: u32 = 10; fn main() { let args = env::args().collect::<Vec<String>>(); let file_path = match args.len() { 2 => args[1].as_str().to_owned(), _ => { println!("Usage: cargo run --release [ch8 ROM file]"); return; } }; let sdl = sdl2::in...
Rust
0
write_type ))) } } let get_resource = |r| { table.get(r).cloned().ok_or_else(|| { failure::err_msg(format!( "Missing resource `{}`. Existing resources: [{}]", r, table...
Rust
0
) res = model.transform(validate_ts_sampled) loss = decoder_quantile_loss(res.result, y=validate_ts_sampled, n_estimators=N, delta=delta) # COMMAND ---------- print(res.best.params.to_dict()) # COMMAND ---------- trials = [] for trial in res.trials: params = trial["spec"].to_dict...
Python
1
from aiogram import Router, F from aiogram.types import Message, CallbackQuery from app.admin.logic import welcome_admin admin_router = Router() @admin_router.message(F.text == '🔑 Админ панель', F.from_user.id.in_([settings.ADMIN_ID])) async def admin_panel(message: Message): await welcome_admin(message) @admin...
Python
1
ata = [json.loads(line)["context"] for line in lines] # import random # random.shuffle(qa_data) # qa_data=qa_data[:20] id_chunks_list=[] for zdata in qa_data: segments = split_text_by_punctuation(zdata,'zh') #修改一下 id_chunks_list=id_chunks_li...
Python
1
# -*- coding:utf-8 -*- """ Author: Helixcs Site: https://github.com/Xarrow/weibo-scraper File: flasgger_api.py Time: 5/24/18 """ import logging from flask import Flask, jsonify, request, make_response, render_template from flasgger import Swagger, swag_from from weibo_base.weibo_api import * level = logging.DEBU...
Python
1
import matplotlib.pyplot as plt import numpy as np import os from matplotlib import rcParams import glob # rcParams['ps.useafm']=True rcParams['ps.fonttype'] = 42 rcParams['pdf.fonttype'] = 42 rcParams['lines.linewidth'] = 2 rcParams['axes.linewidth'] = 1 # rcParams['font.size']=8 def get_kd(mutant, wt, n=0, l=1, T...
Python
1
ync with client.get(image, allow_redirects=False) as fetch: image = fetch.headers["location"] async with client.get(image, allow_redirects=False) as fetch: image = fetch.headers["location"] ...
Python
1
let yxy: Yxy = Yxy::from(color); let (x, y, luma) = yxy.into_components(); // Get our intended luma let luma = match mode { Mode::Light => luma.min(0.12).max(0.1), Mode::Dark => luma.max(0.19), }; // Build yxy aga...
Rust
0
_tune.py", ) parser.add_argument( "--tune", action="store_true", required=False, help="generated tune instances" ) # parser.add_argument( # "--out_type", # default="all", # required=False, # help="Specifie the type of scale\n \ # all: [bf16, fp16] \n...
Python
1
# ***************************************************************************** # Copyright (c) 2015, 2019 IBM Corporation and other Contributors. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distrib...
Python
1
import json import time import sys import asyncio import websockets count_limit = 0 args = sys.argv print(args) if len(args) > 1: count_limit = int(args[1]) async def listen_server(websocket): while True: msg = await websocket.recv() print(f"Received: {msg}") async def ping(websocket): # ...
Python
1