text
string
label_name
string
labels
int64
input_features = processor.feature_extractor( raw_speech=input_speech, sampling_rate=processor.feature_extractor.sampling_rate, return_tensors="jax" ).input_features generated_ids = model.generate(input_features, num_beams=5, max_length=20).sequences transcript = processor.to...
Python
1
2(af + be)| // // The sequence is: // rev64 rd.4s, rm.4s // mul rd.4s, rd.4s, rn.4s // xtn tmp1.2s, rn.2d // addp rd.4s, rd.4s, rd.4s // xtn tmp2.2s, rm.2d // shll rd.2d, rd.2s, #32 // umlal rd.2d, tmp2.2s, tmp1.2s // Reverse the 32-bit elements in the 64-bit words. ...
Rust
0
Some(filtered.len()))?; for (k, v) in filtered { map_ser.serialize_entry(k, v)?; } map_ser.end() } fn skip_nested_empties<S>( map: &BTreeMap<String, BTreeMap<String, ImageProperties>>, serializer: S, ) -> Result<S::Ok, S::Error> where S: Serializer, { let filtered: Vec<_> = map ...
Rust
0
import requests import pytest URL = 'https://api.pokemonbattle.ru/v2' HEADER = {'Content-Type': 'application/json'} TRAINER_ID = '5140' def test_status_code(): response = requests.get(url = f'{URL}/trainers', params = {'trainer_id' : TRAINER_ID}) assert response.status_code == 200 def test_trainer_id(): ...
Python
1
teral", Token::TemplateTail => "template literal", // Punctuation Token::Ampersand => r#""&""#, Token::AmpersandAmpersand => r#""&&""#, Token::Asterisk => r#""*""#, Token::AsteriskAsterisk => r#""**""#, Token::At => r#""@""#, ...
Rust
0
y_asof(&ts_join,None,|a,b| (*a, match b { Some(x) => Some(*x), None => None }), MergeAsofMode::NoRoll); let joinedasof_custom = ts.merge_apply_asof(&ts_join,Some(int_utils::merge_asof_fwd(1)),|a,b| (*a, match b { Some(x) => Some(*x), None => None ...
Rust
0
#"), List(&[F64(4.5)]), Str("(more"), Str("data)")])]), ]); fn try_encode() -> Result<String, Error> { SEXP_STRUCT.buffer_encode() } const SEXP_STRING_IN: &'static str = r#"((data "quoted data" 123 4.5) (data (!@# (4.5) "(more" "data)")))"#; fn try_decode<'a>(ctx: &'a mut ParseContext<'a>) -> Result<SExp<'a>, Er...
Rust
0
if_false: box Core::Lit { lit: Lit::Nothing }, } } }, Exp::Arrow { id, box arg, box ret } => { unimplemented!() }, Exp::Assign { box lhs, box rhs } => { unimplemented!() }, Exp::Bind ...
Rust
0
from fastapi import APIRouter, Depends, Query, status from app.db.database import get_db from app.services.users import UserService from sqlalchemy.orm import Session from app.schemas.users import UserCreate, UserOut, UsersOut, UserOutDelete, UserUpdate from app.core.security import check_admin_role router = APIRoute...
Python
1
# noinspection PyUnresolvedReferences import ygolegacy.data.cards import ygolegacy.data.ebay_listing import ygolegacy.data.card_sets
Python
1
frequency, start_value, middle_value, max, ) + self.integrate_force_between_frequencies( i, middle_frequency, end_frequency, middle_value, end_value, max, ...
Rust
0
API_KEY = '' API_SECRET = '' trading_strategy = 'tripleEMAStochasticRSIATR' ''' valid options for trading_strategy are: 'StochRSIMACD', 'tripleEMAStochasticRSIATR', 'tripleEMA', 'breakout', 'stochBB', 'goldenCross', 'candle_wick', 'fibMACD', 'EMA_cross', 'heikin_ashi_ema2', 'heikin_ashi_ema', 'ema_crossover' ''' TP_SL...
Python
1
import asyncio from crawlee.crawlers import PlaywrightCrawler, PlaywrightCrawlingContext from crawlee.proxy_configuration import ProxyConfiguration async def main() -> None: crawler = PlaywrightCrawler( # Use the local wayback server as a proxy proxy_configuration=ProxyConfiguration(proxy_urls=['...
Python
1
.exists(latest_ckpt): ckpt = torch.load(latest_ckpt, map_location=device) G.load_state_dict(ckpt['G']); D.load_state_dict(ckpt['D']) opt_G.load_state_dict(ckpt['opt_G']); opt_D.load_state_dict(ckpt['opt_D']) start_epoch = ckpt['epoch'] + 1 print(f"Resumed from epoch {start_epoch}") # --------------...
Python
1
44, 0x54a854a8, 0x95809580, 0x96969600, 0xa85454a8, 0x80959580, 0xaa141414, 0x96960000, 0xaaaa1414, 0xa05050a0, 0xa0a5a5a0, 0x96000000, 0x40804080, 0xa9a8a9a8, 0xaaaaaa44, 0x2a4a5254, ]; /* Anchor indices: Table.A2 */ static BC7_AI0: [u8; 64] = [ 15, ...
Rust
0
omba de agua super().__init__( pump_name="Bomba de Circulación", theme_manager=theme_manager, img="pump_circulacion.png", description="Circula el agua en el sistema", serial_conn=serial_conn, parent=parent ) def toggle_auto...
Python
1
rror import MyError #import logging #import time #from actions import Cursor #from actions import DMLCursor #from actions import QueryCursor #from my_utils import SetSessionTimeout #import mysql.connector #from mysql.connector import errorcode #import actions # #def do_upgrade(conn, cur, timeout, user, pwd): # # upgra...
Python
1
if len(dets): b, p, z, y, x, d, h, w, _ = dets[0] anchor_centers.append([z, y, x]) res.append(dets[0]) else: # Does not have anchor box return detections pred_cats = np.unique(detections[:, -1]).astype(np....
Python
1
ClassInfo), Button(xi2::XIButtonClassInfo), Scroll(xi2::XIScrollClassInfo), Valuator(xi2::XIValuatorClassInfo), } impl XI2DeviceAnyClassInfo { pub unsafe fn try_from_anyclassinfo(info: *const xi2::XIAnyClassInfo) -> Option<Self> { assert!(!info.is_null()); match (&*info)._type { ...
Rust
0
ice return TradeDeltas( user=Deltas(bonds=bonds_needed, base=base_after_fees, shares=shares_after_fees), pool=Deltas( base=predicted_delta_base, shares=predicted_delta_shares, bonds=predicted_delta_bonds, ), fee=Deltas( bonds=base_fees_...
Python
1
cky='w') create_rounded_button(manageFrame, "DELETE", delete).grid(row=0, column=2, padx=5, pady=5, sticky='w') create_rounded_button(manageFrame, "SELECT", select).grid(row=0, column=3, padx=5, pady=5, sticky='w') create_rounded_button(manageFrame, "FIND", find).grid(row=0, column=4, padx=5, pady=5, sticky='w') create...
Python
1
dividend_yield, ), OptionDir::PUT => put_theta_f32x8( spot, strike, years_to_expiry, risk_free_rate, volatility, dividend_yield, ), } } pub(crate) fn rho( option_dir: OptionDir, spot: f32x8, stri...
Rust
0
from .. import fault_slip_object def read_param_file(infile): """ Read faults in the param file format """ print("Reading Param distribution %s " % infile) fault_list = [] ifile = open(infile, 'r') start_read = 0 current_segment = 1 current_length, current_width = 0, 0 for lin...
Python
1
(var_251.as_str()); } if let Some(var_252) = &input.contact_id { object.key("ContactId").string(var_252.as_str()); } if let Some(var_253) = &input.instance_id { object.key("InstanceId").string(var_253.as_str()); } Ok(()) } pub fn serialize_structure_crate_input_start_outbound_vo...
Rust
0
ᇧ', '𝞶', 'ℐ', 'ⅇ', '╍', '𖢊', '𞸑', '⡳', '𘢮', '\u{819}', '🆔', '領', 'ﮢ', '\u{1fa9f}', '\u{732}', '𐮂', '⺘', '彩', 'ㄣ', 'ꀤ', '𐬽', '𒊳', '𑆦', 'မ', '𝚥', '𑫓', '𑈋', '⋅', '𐦈', 'ꋅ', 'ὕ', '㉳', '𖥜', '㌜', '𖥠', '𑙦', 'ꪒ', 'Ⳕ', 'ꄃ', '🖿', '\u{1734}', '𛄆', '◲', 'ᖈ', '𑋕', 'ﴩ', '𛃹', '\u{ccd}', '\u{18be1}',...
Rust
0
bbox_whs=bbox_whs[[i]], orig_image=data['orig_image'][i][None], visualise_wh=visualise_wh, ...
Python
1
data\":{\ \"e\":\"depthUpdate\",\ \"E\":1612660810605,\ \"s\":\"BTCUSDT\",\ \"U\":8541958786,\ \"u\":8541959197,\ \"b\":[[\"39202.93000000\",\"0.00000000\"]],\ \"a\":[[\"39202.93000000\",\"0.00000000\"]]\ ...
Rust
0
"{}", match *self { Category::OpenParen => "`(`", Category::CloseParen => "`)`", Category::OpenCurly => "`{`", Category::CloseCurly => "`}`", Category::Ne => "`!=`", Category::Eq => "`=`", ...
Rust
0
cert_path, key_path) .with_ciphers([ CipherSuite::TLS_AES_128_GCM_SHA256, CipherSuite::TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, ]); let rocket = rocket::custom(Config { tls: Some(tls), ..Config::debug_default() }); let client = Client::debug(rocket).await.unwrap(); ...
Rust
0
msg_ptr).data as *const StdResponsePayload); if write!(w, ",{},{}", payload.channel, payload.value).is_ok() { w.len() as isize } else { -1 } } enum IncomingMsg<'payload> { GetTemperature(&'payload u32), GetPressure(&'payload u32), GetHumidity(&'payload u32), GetLightLevel(&...
Rust
0
from node import Node def construct_graph_from_tensor(tensor, start, goal, width, height): """ Args: tensor (torch.list): tensor of the potential field values for given environment. start (int, int): starting coordinates of robot. goal (int, int): goal coordinates / operating table co...
Python
1
, SettingsPayload_Action}; use crate::proto::transaction::TransactionHeader; use config; use err::CliError; pub fn run<'a>(args: &ArgMatches<'a>) -> Result<(), CliError> { let genesis_file_path = if args.is_present("output") { args.value_of("output") .ok_or_else(|| CliError::ArgumentError("Fai...
Rust
0
.unwrap() .build() .unwrap(); keystore .to_json_writer(&mut get_file()) .expect("should write to file"); let decoded = Keystore::from_json_reader(&mut get_file()).expect("should read from file"); assert_eq!( decoded.decrypt_keypair(BAD_PASSWORD).err().unwrap(), ...
Rust
0
EFLAGS = > JG(i16), /// JUMP IF EFLAGS = ≤ JLE(i16), /// JUMP IF EFLAGS = ≥ JGE(i16), /// JUMP IF EFLAGS = < (UNSIGNED) JB(i16), /// JUMP IF EFLAGS = > (UNSIGNED) JA(i16), /// JUMP IF EFLAGS = ≤ (UNSIGNED) JBE(i16), /// JUMP IF EFLAGS = ≥ (UNSIGNED) JAE(i16), ///...
Rust
0
// Note that we previously asserted that data.len() == leafs. (0, Store::len(self)) } else { (level_node_index, level_node_index + width) }; self.process_layer::<A, U>(width, level, read_start, write_start)?; level_node_ind...
Rust
0
#Created by: Patricia Sunday #Date: September 10, 2025 import random print('Welcome to Integer Whisperer! - your one stop shop for basic integer insights') mainLoop = True while mainLoop: number = int(input('Enter an integer: ')) print() #randomize comment numDesc = 'Your number is ' if random.ra...
Python
1
// Compute coefficients for first fundamental form. let e1 = dpdu.dot(&dpdu); let f1 = dpdu.dot(&dpdv); let g1 = dpdv.dot(&dpdv); // Compute coefficients for second fundamental form. let e2 = n.dot(&d2p_duu); let f2 = n.dot(&d2p_duv); let g2 = n.dot(&d2...
Rust
0
import json import random import re with open("emoji-suggestions.json") as f: suggestions = json.load(f)["suggestions"] with open("all_emojis.json") as f: all_emojis = json.load(f) all_emojis.reverse() with open("neutral_emojis.json") as f: neutral_emojis = json.load(f) def neutral_emoji(seed): ...
Python
1
Self::fund_account_id(), &buyer, lock.value, AllowDeath) .map_err(|_| DispatchError::Other("Can't transfer value."))?; Self::deposit_event(Event::TimeoutBuy(buyer, hashed_secret)); Ok(().into()) } } #[pallet::event] #[pallet::generate_deposit(pub fn deposit_event)] pub enum Event<T...
Rust
0
#!/usr/bin/env python3 # Copyright (C) 2025 Checkmk GmbH - License: GNU General Public License v2 # This file is part of Checkmk (https://checkmk.com). It is subject to the terms and # conditions defined in the file COPYING, which is part of this source code package. # mypy: disable-error-code="no-untyped-call" from ...
Python
1
/ stdev_y, "covariance", " \n") if stdev_x > 0 and stdev_y > 0: return covariance(x_, y_) / stdev_x / stdev_y else: return 0 print("\t" * 5, "correlation = ", correlation(num_friends, daily_minutes)) # Фильтр кореляции от выброса # outlier_index = num_friends_three.index(100) # print(outlie...
Python
1
# -*- coding: utf-8 -*- # Copyright 2025 Google 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...
Python
1
)?; let notdef = RawGlyph { unicodes: vec![], glyph_index: Some(0), liga_component_pos: 0, glyph_origin: GlyphOrigin::Direct, small_caps: false, multi_subst_dup: false, is_vert_alt: false, fake_bold: false, fake_italic: false, extra_dat...
Rust
0
import socket import json import pygame import time # ---------------- Server Configuration ---------------- SERVER_IP = '192.168.16.101' # Raspberry Pi IP PORT = 5050 # ---------------- Controller Configuration ---------------- BUTTON_GEAR_UP = 10 BUTTON_GEAR_DOWN = 9 AXIS_STEERING = 0 AXIS_GAS =...
Python
1
"char:"); print::<()>(&world, "() :"); println!(); world.entity(id7).unwrap().attach(2u32); println!("#attach component u32=2 for id=7"); print::<u32>(&world, "u32 :"); print::<char>(&world, "char:"); print::<()>(&world, "() :"); println!(); w...
Rust
0
""" Process Checkout Page Module This module provides extended functionality for checkout page automation. It acts as a wrapper around the basic checkout automation to provide more comprehensive analysis and features. Functions: 1. process_checkout_page() - Main entry point for advanced checkout processing 2. analyze...
Python
1
import streamlit as st import pandas as pd import matplotlib.pyplot as plt from v1_fansasy_helper.motor_decision import seleccionar_mejor_xi # Configuración de la página st.set_page_config(page_title="Fantasy XI Assistant", layout="wide") st.title("Fantasy XI Assistant") st.markdown("Tu mejor alineación basada en pro...
Python
1
old_best_name = '/model-{}-best_{}_{:.5f}'.format(old_best_step, eval_metrics[i], old_best) model_path = args.log_directory + '/' + args.model_name + old_best_name if os.path.exists(model_path): command = 'rm {}'.format(model_path...
Python
1
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 agreed to in writing, software * distributed under the License is ...
Rust
0
= self.pod_api.log_stream(&self.pod_name, &lp).await?.boxed(); while let Some(line) = logs.try_next().await? { let mut buf = self.buf.write().await; buf.push(format!("{}{}", prefix, String::from_utf8_lossy(&line))); #[cfg(feature = "logging")] ::log::debug!( ...
Rust
0
super::export_bin, // ); dbg!(timer.elapsed().as_millis()); Ok(()) } // #[ignore] // #[test] // pub fn test_process_csv_export_csv() -> std::io::Result<()> { // let tid: u32 = 0; // let tfpath = format!( // "{}{}", // env!("CARGO_MANIFEST...
Rust
0
FETIME, which is not a real measurement. for child in &profile.root_interval().children { builder.visit_interval(*child, 0); } let Self { blocks, .. } = builder; Graph { activity_blocks: blocks, marks: Vec::default(), perfor...
Rust
0
from unittest.mock import MagicMock, patch import pytest from insight.models import WeeklyUserStats @pytest.mark.asyncio @pytest.mark.usefixtures("mock_setup_django") class TestWeeklyUserTrendAnalyze: @patch("insight.tasks.weekly_user_trend_analysis.Post.objects") @patch("insight.tasks.weekly_user_trend_ana...
Python
1
(day < SPARK_REPO_CHANGE_DATE1 or (day < SPARK_REPO_CHANGE_DATE2 and pr_num < SPARK_REPO_PR_NUM_THRESH)): github_url = "github.com/apache/incubator-spark/pull/%s" % pr_num append_to_changelist(" %s" % subject) append_to_changelist(" %s" % ', '.join(authors)) #...
Python
1
class Orang: def __init__(self, nama, umur): self.nama = nama self.umur = umur def kenalan(self): print(f"Halo, namaku {self.nama}, umurku {self.umur}") class Mahasiswa(Orang): def __init__(self, nama, umur, universitas): super().__init__(nama, umur) self.universita...
Python
1
xt windows...") if medium_scale: print("⏰ This should take ~1-2 hours...") else: print("⏰ This may take several hours...") command = [ sys.executable, "scripts/train_models.py", "--graph", graph_path, "--output", output_dir, "--validate" ...
Python
1
from typing import Dict, Any import json from pytest import raises from e2e.Libs.Ristretto.Ristretto import BASEPOINT, RistrettoScalar, RistrettoPoint, hashToCurve from e2e.Tests.Errors import TestError def RistrettoTest() -> None: vectors: Dict[str, Any] with open("e2e/Vectors/Libs/Ristretto.json", "r") as fil...
Python
1
from cantoolz.isotp import ISOTPMessage from cantoolz.module import CANModule, Command class uds_engine_auth_baypass(CANModule): name = "UDS Engine STARTER" help = """ This module emulating UDS hack for Enginer start( for vircar). Init params (example): { 'id_command': 0x71 } "...
Python
1
on x=-12..35,y=6..50,z=-50..-2 off x=-48..-32,y=-32..-16,z=-15..-5 on x=-18..26,y=-33..15,z=-7..46 off x=-40..-22,y=-38..-28,z=23..41 on x=-16..35,y=-41..10,z=-47..6 off x=-32..-23,y=11..30,z=-14..3 on x=-49..-5,y=-3..45,z=-29..18 off x=18..30,y=-20..-8,z...
Rust
0
""" This module contains configuration settings via waffle flags for the Video Pipeline app. """ from edx_toggles.toggles import WaffleFlag from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag # Videos Namespace WAFFLE_NAMESPACE = 'videos' LOG_PREFIX = 'Videos: ' # .. toggle_name: videos.deprecate_yout...
Python
1
await bot.send_message( callback_query.message.chat.id, 'Ивента не существует.', ) return user = await user_verification(callback_query) if await sync_to_async(meeting.players.filter(id=user.id).exists)(): await bot.send_message( callback_query.messag...
Python
1
same_keys, same_values )) } } /// Matches if the map-like collection contains the given key. /// /// The `Matcher` tests for this by converting the map-like data structure /// into a key/value pair iterator. /// /// The alternative would be to use the Index trait though experiments showed /// ...
Rust
0
=> { assert_eq!(bps, 1000000.0); } _ => panic!(), } match parse_flowspec_action("traffic-rate 10Kbps") { Err(_) => (), _ => panic!(), } match parse_flowspec_action("traffic-action sample") { Ok(FlowAction::Traff...
Rust
0
_back()) { (Some(gorm), Some(mut partial)) => { match partial { Partial::HasType(prefix, Some(typ)) => { form = Some(Form::Macro(Macro::HasType(prefix, Box::new(typ), Box::new(gorm))))...
Rust
0
(ref secret) => { let signature = sodium::ed25519::sign_detached(&buffer, secret); buffer.push_u32_be((ED25519.0.len() + signature.0.len() + 8) as u32); buffer.extend_ssh_string(ED25519.0.as_bytes()); buffer.extend_ssh_string(&signature.0); } ...
Rust
0
RRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // use anyhow::Context; use oak_abi::proto::oak::application::ModuleSignature; use once_cell::sync::Lazy; use pem::Pem; use ring::{ rand, signa...
Rust
0
real: self * other.real, imag: self * other.imag, } } } impl MulAssign<Complex> for Complex { fn mul_assign(&mut self, other: Complex) { let real = self.real * other.real - self.imag * other.imag; let imag = self.real * other.imag + self.imag * other.real; self.rea...
Rust
0
::I32(2), Token::I32(3), Token::TupleStructEnd, ], ); } #[test] fn test_struct() { assert_ser_tokens( &Struct { a: 1, b: 2, c: 3 }, &[ Token::Struct { name: "Struct", len: 3, }, Token::Str("a"), ...
Rust
0
> std::io::Result<Self> { if !root.exists() { std::fs::create_dir_all(&root)? } Ok(Self { root: Box::from(root), client: Client::new() }) } } use crate::db::Database; pub fn can_read(db: &mut Database, authkey: &str, _namespace: &str) -> bool { ...
Rust
0
d returns the last position of where it was found # rindex() Searches the string for a specified value and returns the last position of where it was found # rjust() Returns a right justified version of the string # rpartition() Returns a tuple where the string is parted into three parts # rsplit() Splits the string at ...
Python
1
list = [] for i in range(5): num = int(input("\nDigite: ")) list.append(num) for j in list: print(f"Valor indice [{j+1}]: {j}")
Python
1
6") = {}'.format('test.slave6' in params) ) print( 'params["test.slave6"] = %s' % params['test.slave6'] ) flush() except KeyError as ke: print( ke ) print( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" ) print( "Walkthrough the map using iterator" ) for k, v in params: print( '===> %s %s' % (k,v) ) fl...
Python
1
::fmt::Result { match self { TypeError::DoubleClose(v) => write!(f, "linear variable {} closed twice", v), TypeError::CloseBeforeOpen(v) => write!(f, "linear variable {} closed before being opened", v), } } } #[derive(PartialEq,Eq,Hash,Clone)] pub enum Type { True, False, Grou...
Rust
0
"""Make a github release. Requires that you have a github access token as specified below in your home directory. """ import json import os import sys import urllib import urllib.request from os.path import expanduser from subprocess import call GITHUB_USER = "jeeftor" GITHUB_REPO = "EmojiTaco" # Read github access ...
Python
1
), ) cw.writer(fstream, cw.comment("and stoichiometric coefficients. (Eq 50)")) cw.writer( fstream, f"void {function_prefix}KINU" + cc.sym + f"(const int i, int& nspec, {function_args})", ) cw.writer(fstream, "{") if n_reactions > 0: str_ns = ",".join...
Python
1
ile() keys = list(cfg.keys()) keys.sort() for key in keys: b,r = key v = cfg[key] self._writeReg(b,r,v) elif isinstance(cfg,np.ndarray): # config vector from pytorch try: rf = self.vToRf(cfg) except Exception as e: print(f'renderOPLFrame() Excep...
Python
1
e.contents = patched def _fill_constructor(self, table, constructor, statements): consumed = 0 for statement in statements: if not isinstance(statement, nodes.Assignment): break if len(statement.destinations.contents) > 1: break dst = statement.destinations.contents[0] if not isinstance(ds...
Python
1
#!/usr/bin/env python3 # Copyright 2021 The Bazel 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 r...
Python
1
= id_set.iter().max().expect("No max where max expected"); let mut answer: Option<i32> = None; for i in *min..*max { if !id_set.contains(&i) { answer = Some(i); } } assert_eq!(true, answer.is_some()); assert_eq!(548, answer.unwrap()); ...
Rust
0
); Self::deposit_event(RawEvent::SetBaseFeeSuccess(base_fee)); Ok(()) } } } impl<T: Config> Module<T> { /// The pot of a collateral account pub fn collateral_pot() -> T::AccountId { // "modl" ++ "crmarket" ++ "coll" is 16 bytes T::ModuleId::get().into_sub_ac...
Rust
0
"""Downloads the Selenium Server JAR file and renames it.""" import os import shutil import sys from urllib.request import urlopen SELENIUM_JAR = ( "http://selenium-release.storage.googleapis.com" "/3.141/selenium-server-standalone-3.141.59.jar" ) JAR_FILE = "selenium-server-standalone-3.141.59.jar" RENAMED_JA...
Python
1
) # type: ignore var_prop12: EnumProperty( name="Preview Type", default="0", items=create_enum(["Full", "Forward Horizontal", "Forward Vertical", "Backward Horizontal", "Backward Vertical", "Duplicate Top", "Duplicate Left", "Duplicate Bottom", "Duplicate Right", "Duplicate Horizontal", "Du...
Python
1
_rate.unwrap_or(60); let screen_mode = self.screen_mode.unwrap_or(ScreenMode::Windowed); let d3d = self.d3d.unwrap_or(Direct3D::Dx9Ex); let code = unsafe { dx_SetUseDirect3DVersion(d3d as i32) }; if code != 0 { return Err(DxLibError::NonZeroReturned); } if s...
Rust
0
# routers/play_router.py from typing import List from fastapi import APIRouter, Depends, HTTPException, status from fastapi.params import Depends from sqlalchemy.orm import Session from Database import get_db import Schema, Models from Oauth2 import get_current_user from Services.play_services import ( create_play,...
Python
1
= font.render('Final Score: ' + str(target.score), 1, (224, 16, 16)) textpos_score = text_fps.get_rect(centery=CENTER_H+56, centerx=CENTER_W-20) if (info.visibility == True): menu_alert_s.draw(screen) #Blit Blit.. screen.blit(text_fps, textpos_fps) sc...
Python
1
reate the textures we are going to use. let foo_texture = LTexture::new_from_file(&creator, Path::new(FOO_IMG)); let background_texture = LTexture::new_from_file(&creator, Path::new(BG_IMG)); // Set renderer color using the context canvas.set_draw_color(Color::RGB(0, 0, 0)); let mut running: bool ...
Rust
0
oint == 0: # and params['trained_model_path'] == None: # save the model every 10 episodes save_model(params['write_model_dir'], agt, best_res['success_rate'], best_model['model'], best_res['epoch'], episode) save_performance_records(params['write_model_dir'], ...
Python
1
import asyncio import discord import pytest from src.ui.views import ImageView class TestImageView: @pytest.fixture def event_loop(self): """Create and set an event loop for each test case.""" loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) yield loop loop....
Python
1
CONFIG_DEFAULTS_REPLICA, } } } impl ConfigInterface { pub fn get_defaults(&self) -> &ConfigDefaults { match &self.defaults { Some(v) => v, _ => &EMPTY_CONFIG_DEFAULTS, } } pub fn get_provider_url(&self, network: &str) -> DfxResult<Option<String>> { ...
Rust
0
x<str>> for Cow<'_, Path> { #[inline] fn from(p: Box<str>) -> Self { Cow::owned(PathBuf::from(p.into_string())) } } #[cfg(feature = "std")] impl<'a> From<&'a OsStr> for Cow<'a, Path> { #[inline] fn from(p: &'a OsStr) -> Self { Cow::borrowed(Path::new(p)) } } #[cfg(feature = "st...
Rust
0
.trim() .chars() .map(|c| c.to_digit(10).unwrap() as i32 - 1) .collect::<Vec<i32>>(); small_map.push(l); line.clear(); } let small_ylen = small_map.len(); let small_xlen = small_map[0].len(); let ylen = 5 * small_ylen; let xlen = 5 * small_xlen; ...
Rust
0
from(1.0))); circuit.add_operation(RotateX::new(1, CalculatorFloat::from(1.0))); assert!(circuit.count_occurences(&vec!["RotateX"]) == 4); assert!(circuit.count_occurences(&vec!["RotateZ"]) == 2); assert!(circuit.count_occurences(&vec!["Rotation"]) == 6); assert!(circuit.count_occurences(&vec!["Defi...
Rust
0
}, 1, )); code.push(Instr::new( 0, Op::Ldc { dest: 1, val: SifVal::Num(2.0), }, 2, )); code.push(Instr::new( 0, Op::Binary { kind: BinOpKind::...
Rust
0
#[repr(C)] pub struct statfs_t { pub f_type: isize, pub f_bsize: isize, pub f_blocks: isize, pub f_bfree: isize, pub f_bavail: isize, pub f_files: isize, pub f_ffree: isize, pub f_fsid: isize, pub f_namelen: isize, pub f_frsize: isize, pub f_flags: isize, pub f_spare: [i...
Rust
0
ible = True # 周術期薬剤管理関連 selectColumns[23].visible = True # 麻酔科周術期外来 selectColumns[24].visible = True # 手術後使用麻薬確認・補充 selectColumns[25].visible = True # 術後疼痛管理チーム回診 selectColumns[26].visible = True # 脳卒中ホットライン対応 #非表示 sele...
Python
1
import torch from safetensors.torch import load_file from torch.nn.utils import remove_weight_norm def load_ckpt_state_dict(ckpt_path): if ckpt_path.endswith(".safetensors"): state_dict = load_file(ckpt_path) else: state_dict = torch.load(ckpt_path, map_location="cpu")["state_dict"] r...
Python
1
#a) def aritmeticka_sredina(lista): return sum(lista)/len(lista) def standardna_devijacija(lista): aritmeticka = aritmeticka_sredina(lista) devijacija = sum((x - aritmeticka) ** 2 for x in lista) / len(lista) return devijacija ** 0.5 def main(): tocke = [4, 7, 18, 20, 22, 26, 28, 30, 31, 35] ...
Python
1
| NonereturnNone)NNTN)rr+rr+r_TYPE_BODY | Nonerr?rboolr str | Noner typing.Anyr@r )NNNN)rr+rr+rrBr'_TYPE_FIELDS | Nonerr?r4ztyping.Any | Noner5rEr@r )NN) rr+rr+r'z_TYPE_ENCODE_URL_FIELDS | Nonerr?...
Python
1
lder has been specified."); return; }; let output_path = if let Some(output_file) = matches.value_of("output") { Some(Path::new(output_file)) } else { None }; if let Some(path) = output_path { let area = Area::new(0, 256, 0, 256); let mut diamond_vein_analyz...
Rust
0
Format, tiling: vk::ImageTiling, usage: vk::ImageUsageFlags, image_create_flags: vk::ImageCreateFlags, memory_property_flags: vk::MemoryPropertyFlags ) -> (vk::DeviceMemory, vk::Image) { unsafe { let image_create_info = vk::ImageCreateInfo { flags: image_create_flags, ...
Rust
0