text
string
label_name
string
labels
int64
strategy` syntax as with `proptest!`, and is /// used to generate the other inputs for the function. The second argument /// list has access to all arguments in the first. The return type indicates /// the type of value being generated; the final return type of the function is /// `impl Strategy<Value = $type>`. /// /...
Rust
0
nstance(label, int), "label should be an integer" assert 0 <= label < num_classes, f"input label is not correct, label should be at [0, {num_classes})" T = label T = np.expand_dims(T, 0) T = (T[:, np.newaxis] == np.arange(num_classes)) * 1.0 ...
Python
1
"Page": page_number, "PageSize": page_size, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) headers["Accept"] = "application/json" response = await self._version.page_async( method="GET", uri=self....
Python
1
*ray = (self.camera_to_world(), &*ray).into(); 1.0 } fn generate_ray_differential( &self, sample: &CameraSample, ray: &mut RayDifferentials, ) -> Float { let p_film = Point3f::new(sample.p_film.x, sample.p_film.y, 0.0); let p_camera = &self.raster_to_cam...
Rust
0
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. extern crate cc; use std::fs::read_dir; use std::path::Path; fn main() { println!("cargo:rerun-if-changed=src/scudo_rust_wrapper.c"); let s...
Rust
0
], [26161, 4], [26162, 40], [31712, 50], [43229, 50], [43230, 297], [21128, 110], [52220, 40], [26163, 40], [50084, 7], [52220, 16], [31713, 245], [27094, 40], [24149, 15], [23141, 57], [42192, 21], [42193, 135], [15082, 37], [51055, 46], [5222...
Rust
0
def Password_controller(password): length = len(password) if length > 8: return ("Password succesfully set") else: return ("Password have to be more than 8 characters") password = input("Enter your password: ") result = Password_controller(password) print (result)
Python
1
# if FLAGS.save_output and (not FLAGS.render_path) and (jax.host_id() == 0): # with utils.open_file(path.join(out_dir, "psnr.txt"), "w") as f: # f.write("{}".format(np.mean(np.array(psnrs)))) # with utils.open_file(path.join(out_dir, "ssim.txt"), "w") as f: # ...
Python
1
_module() -> Result<(), std::io::Error> { let mut module = std::fs::File::create(&format!("src/{}.rs", "secrets"))?; write_link_info_type(&mut module)?; Ok(()) } fn main() { dotenv().ok(); if let Err(e) = generate_module() { eprintln!("Error: {}", e); } } // Copyright 2012 The Rust Proj...
Rust
0
import os from ipywidgets import Output, GridspecLayout from IPython import display # range is from 0 (min) to 1 (max) # num is how many videos to display in a row def plot_by_n(Dacc, video_dir, min, max, num=3): if max < 1: trials = Dacc[(Dacc["correct"]>=min) & (Dacc["correct"]<max)] # subset of the domi...
Python
1
rate) fn creator(&self) -> ValidatorIndex { self.creator } /// The timestamp when the ping was created. pub(crate) fn timestamp(&self) -> Timestamp { self.timestamp } /// Validates the ping and returns an error if it is not signed by the creator. pub(crate) fn validate( ...
Rust
0
s( filter_text=filter_text, limit=limit, author=author, sort_by=sort_by ) return jsonify(models) @app.route('/api/models/installed', methods=['GET']) def get_installed_models(): models = model_manager.get_installed_models() ret...
Python
1
ws subprocess.run(['explorer', os.path.abspath(path)]) elif os.name == 'posix': # macOS, Linux subprocess.run(['xdg-open', path]) print(f"Đã mở thư mục: {path}") else: print(f"Thư mục không tồn tại: {path}") if __name__ == "__main__": # Cấu hình thời gian quay v...
Python
1
Keypair::from_bytes(key) .map_err(|_| CryptoError::CryptoLibraryError)?; let signature = k.sign(data); Ok(signature.to_bytes().into()) } _ => Err(CryptoError::UnsupportedSignatureScheme), } } fn hpke_seal( &self, ...
Rust
0
from fastapi import HTTPException, Request from starlette.types import ASGIApp, Receive, Scope, Send from starlette.responses import JSONResponse class BaseMiddleware: """Custom base middleware to avoid some problems with scarlette's own BaseHTTPMiddleware.""" def __init__(self, app: ASGIApp): self.a...
Python
1
date>>, // the thread helps evaluate images asynchronously eval_thread: thread::JoinHandle<Option<PngData>>, } impl Evaluator { pub fn new(deadline: Arc<Deadline>) -> Self { let (tx, rx) = sync_channel(4); Self { deadline, best_candidate_size: Arc::new(AtomicMin::new...
Rust
0
labels=class_names, epoch=epoch, column_label='Actual Category', row_label='Predicted Category', file_name=f"confusion-matrix-epoch-{epoch}.json", ) def on_fit_epoch_end(self, result, epoch): self.log_metrics(result, epoch=e...
Python
1
(completed_bets) - wins win_rate = (wins / len(completed_bets)) * 100 if completed_bets else 0 print(f"📊 Scommesse Completate: {len(completed_bets)} (🟢 {wins} vinte, 🔴 {losses} perse)") print(f"📈 Win Rate: {win_rate:.1f}%") ...
Python
1
se super::*; #[test] fn all_flags_present() { assert_eq!( FeatureBlockFlags::ALL_FLAGS, &[ FeatureBlockFlags::SENDER, FeatureBlockFlags::ISSUER, FeatureBlockFlags::METADATA, FeatureBlockFlags::TAG ] ...
Rust
0
""" 工作流模組 此模組提供自動化工作流功能,包括n8n工作流設計和管理。 """ from .manager import WorkflowManager, workflow_manager from .templates import ( get_market_data_workflow, portfolio_rebalance_workflow, reporting_workflow, risk_monitoring_workflow, strategy_execution_workflow, ) __all__ = [ "WorkflowManager", "w...
Python
1
_to()]).unwrap(), }; let utf16 = utf8.encode_utf16().collect::<Vec<u16>>(); let mut written = 0; cvt(unsafe { c::WriteConsoleW(handle, utf16.as_ptr() as c::LPCVOID, utf16.len() as u32, &mut written, ...
Rust
0
s.units_mask[unit_sel]: last_pos = last_obs.units_position[unit_sel] curr_pos = self.obs.units_position[unit_sel] if not np.array_equal(last_pos, curr_pos) and gmap.obstacle_map[tuple(curr_pos)] != Landscape.NEBULA.value: gmap.move_cost...
Python
1
.cleanup(); assert!(cache.get(&"a").is_none()); } /// Tests that objects without a TTL do not get evicted. #[test] fn no_evict_excplicit() { let now = Instant::now(); let ttl = Duration::from_secs(1); let later = now + ttl; let mut cache = HashTtlCache::new(now, Some(ttl)); // Insert an object...
Rust
0
"""empty message Revision ID: a74154e5bd83 Revises: 4ad687b0eecb Create Date: 2022-07-06 21:13:27.339683 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'a74154e5bd83' down_revision = '4ad687b0eecb' branch_labels = None depends_on = None def upgrade() -> None...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2021 Intel Corporation # # 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 # # Unl...
Python
1
[30, 7, 116, 7, 117, ], 'M': [28, 21, 45, 7, 46, ], 'Q': [30, 1, 23, 37, 24, ], 'H': [30, 19, 15, 26, 16, ], }, 30: { 'L': [30, 5, 115, 10, 116, ], 'M': [28, 19, 47, 10, 48, ], 'Q': [30, 15, 24, 25, 25, ], 'H': [30, 23, 15, 25, 16, ], }, 31: { ...
Python
1
import logging from flask import jsonify, request import flask_login from server import app from server.util.request import api_error_handler import server.views.explorer.apicache as apicache from server.platforms.reddit_pushshift import RedditPushshiftProvider, NEWS_SUBREDDITS from server.views.explorer import parse_...
Python
1
:Contract => mutate_opcode(fuzzed, false, &mut rng), }; if mutated_fuzzed.get_blocks().iter() .any(|b| b.get_transactions().is_empty()) { panic!("FUZZED - before: {:?} / after: {:?}", fuzzed_copy, mutated_fuzzed); } bytes.clear(); bytes.extend(mutated_fuzzed.write_to_bytes().unwrap()); mat...
Rust
0
end_frame = max(last_frames) return start_frame, end_frame def find_marker_attr_mapping(mkr_list, attr_list): """ Get a mapping of markers to attributes, as a matrix. :param mkr_list: Markers to consider in mapping. :type mkr_list: [Marker, ..] :param attr_list: Attributes to consider i...
Python
1
int("=" * 60) if __name__ == "__main__": show_production_info() success = production_samsung_test() if success: print("\n🏆 SUCCESS: Samsung stock data retrieval is working correctly!") print("📊 Your production API credentials are valid and functional") print("✅ You can ...
Python
1
ds = tf.data.Dataset.zip((ds_pde, ds_init, ds_bc)) else: ds = tf.data.Dataset.zip((ds_pde, ds_init, ds_init)) #second init just to match the bc needed in loop ds = ds.prefetch(tf.data.experimental.AUTOTUNE) epoch_loss = np.zeros(epochs) iv_loss = np.zeros(epochs) pde_los...
Python
1
from setuptools import find_packages, setup package_name = 'ur_simulator' setup( name=package_name, version='0.0.0', packages=find_packages(exclude=['test']), data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name,...
Python
1
>src/util.rs use std::iter; pub fn primes() -> impl Iterator<Item = u64> { primes_starting_from(2) } pub fn primes_starting_from(first: u64) -> impl Iterator<Item = u64> { debug_assert!(first >= 2); let mut next_prime = first; iter::from_fn(move || { let prime = next_prime; next_prime ...
Rust
0
rc<Mutex<HashSet<String>>> } impl Drop for McServer { fn drop(&mut self) { match self.stdin.write("/stop\n".as_bytes()) { Ok(_) => {}, Err(_) => {/*When Server shuts down on its own and the pipe is disconnected*/} } self.stdout_thread.take().map(thread::JoinHan...
Rust
0
_0 = 0, #[doc = "1: FlexCAN is in a low-power mode."] _1 = 1, } impl From<LPMACK_A> for bool { #[inline(always)] fn from(variant: LPMACK_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `LPMACK`"] pub type LPMACK_R = crate::R<bool, LPMACK_A>; impl LPMACK_R { #[doc = r"Get enu...
Rust
0
"ab".to_string()).unwrap(); assert_eq!(option_ab[0], "a".to_string()); assert_eq!(option_ab[1], "b".to_string()); } } use rand; use rand::seq::SliceRandom; use rand::Rng; #[derive(Debug)] struct Dwarf {} #[derive(Debug)] struct Elf {} #[derive(Debug)] struct Human {} #[derive(Debug)] enum Thing ...
Rust
0
.0), &self.font, ); } } <reponame>monacohq/bdk // Bitcoin Dev Kit // Written in 2020 by <NAME> <<EMAIL>> // // Copyright (c) 2020-2021 Bitcoin Dev Kit Developers // // This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE // or http://www.apache.org/licenses/LICENSE-2.0> or...
Rust
0
######################################################################################## ## ## TESTS FOR ## 'blocks.integrator.py' ## ## Milan Rother 2024 ## ########################################################################...
Python
1
e failed videos list (remove successful retries) remaining_failed = [] for failed_video in failed_videos: original_index = failed_video['progress_index'] if progress_data[original_index]["Status"].startswith("Failed") or progress_data[original_index]["Status"].startswith("Error"): re...
Python
1
import torch as t import numpy as np data_small=t.load("small_model_results") k_list=t.load("image_file_name") image_area = t.load("image_size") num_target_p_1={} theshold=confidence_threshold for k in k_list: data_small_1_20=t.from_numpy(np.array(data_small[k])[:,0]) mask=data_small_1_20.ge(theshold/1000) ...
Python
1
] return args def worker(c): args = build_cmd_args(c) backoff = 2 while True: try: print(f'[{c["nombre"]}] GPU{c["gpu"]} {device_path(c["gpu"])} → {c["salida"]}') rc = subprocess.run(args).returncode if rc == 0: backoff = 2 tim...
Python
1
import sympy as sym x, L, C, D, c_0, c_1, = sym.symbols('x L C D c_0 c_1') def model1(f, L, D): """Solve -u'' = f(x), u(0)=0, u(L)=D.""" # Integrate twice u_x = - sym.integrate(f, (x, 0, x)) + c_0 u = sym.integrate(u_x, (x, 0, x)) + c_1 # Set up 2 equations from the 2 boundary conditions and solve ...
Python
1
import cv2 as cv from SuperFunctions import * #Finding the Focal Length imgx1=cv.imread("Limg.jpg") imgx2=cv.imread("Rimg.jpg") model = YOLO("yolov8n.pt") results1 = model.predict(imgx1) results2 = model.predict(imgx2) Name1,Markings1=DetectClasses(results1) Name2,Markings2=DetectClasses(results2) cen1=(Markings1[0][0]...
Python
1
); _mm256_storeu_si256(v3.as_mut_ptr() as *mut _, self.v3); _mm256_storeu_si256(v4.as_mut_ptr() as *mut _, self.v4); } writeln!(f, "Unreduced4x130([")?; write!(f, " ")?; write_130_wide( f, [ u64::from_le_bytes(v0[0..8].t...
Rust
0
ck {} <gh_stars>0 //! A private enum type used internally by JsonLdSerializer use sophia_term::literal::Literal; use sophia_term::TermData; #[derive(Clone, Debug, PartialEq)] pub enum RdfObject { Literal(Literal<Box<str>>), Node(usize, String), } impl RdfObject { pub fn is_literal(&self) -> bool { ...
Rust
0
a more expressive error type, but we still use this instead of /// `Option` to express the intent and allow for `Try`. #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct SvgLoadError; impl fmt::Display for SvgLoadError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { wr...
Rust
0
"count": len, "d": do_default, "default": do_default, "dictsort": do_dictsort, "e": escape, "escape": escape, "filesizeformat": do_filesizeformat, "first": do_first, "float": do_float, "forceescape": do_forceescape, "format": do_format, "groupby": do_groupby, "indent": d...
Python
1
t) / (hist.sum(axis=1) + hist.sum(axis=0) - np.diag(hist) + EPS) mean_iu = np.nanmean(iu[iu.nonzero()]) # mean_iu = np.nanmean(iu) freq = hist.sum(axis=1) / hist.sum() fwavacc = (freq[freq > 0] * iu[freq > 0]).sum() cls_iu = dict(zip(range(self.n_classes), iu)) return { ...
Python
1
from fastapi import APIRouter from {{cookiecutter.project_name}}.db.models.users import ( UserCreate, # type: ignore UserRead, # type: ignore UserUpdate, # type: ignore api_users, # type: ignore auth_jwt, # type: ignore auth_cookie, # type: ignore ) router = APIRouter() router.include_...
Python
1
import numpy as np def cpa_calculations(x, y, x_1, y_1, x_obs, y_obs, x_obs_1, y_obs_1, ts): """ Calculate Closest Point of Approach (CPA) parameters using positions. Parameters: x, y (float): Current position of the vessel x_1, y_1 (float): Previous position of the vessel x_obs, y_obs (float...
Python
1
camera with respect to the second camera # transformation matrix to convert coords in camera/lidar1 reference frame to coords in # camera/lidar2 reference frame # m = np.linalg.inv(m2) @ m1 return m def RPY2Rot(x, y, z, roll, pitch, yaw): R = [[np.cos(pitch)*np.cos(yaw), -np...
Python
1
from abc import ABC, abstractmethod from typing import Dict, List, Any, Optional, Callable, Union from dataclasses import dataclass from enum import Enum import asyncio import base64 import logging import copy # ==================== CORE DATA STRUCTURES ==================== @dataclass class Observation: """Struct...
Python
1
df, 0x5c, 0x4f, 0xb3, 0xe5, 0xac, 0x34, 0xf0, 0xe5, 0x49, 0xbf, 0x2c, 0x58, 0x58, 0x1a, 0x38, 0x11, ]; assert_eq!(&secret, &expected_server_initial_secret); assert!(derive_pkt_key(aead, &secret, &mut pkt_key).is_ok()); let expected_server_pkt_key = [ 0x9a, 0x8b, ...
Rust
0
lTok, ChdirTok, MkdirTok, RmdirTok, ShellTok, EnvironTok, ViewTok, WindowTok, PmapTok, PaletteTok, LcopyTok, CallsTok, NoiseTok, PcopyTok, TermTok, LockTok, UnlockTok, LeftDTok, RightDTok, MidDTok, SgnTok, IntTok, AbsTok, SqrTok...
Rust
0
const _ as usize } , 80usize , concat ! ( "Alignment of field: " , stringify ! ( tdTSS_DAA_CRED_ISSUER ) , "::" , stringify ! ( sELength ) )); assert_eq! (unsafe { & ( * ( 0 as * const tdTSS_DAA_CRED_ISSUER ) ) . sE as * const _ as usize } , 88usize...
Rust
0
aatgataggcagactcctaacacagagaaaaaggtagttctgaatactgatctcctgtatgggagaaacgaactgaataagcagaaacctgcgtgctctgacagtcctagagattcccaagatgttccttgg" ) def test_get_align(self): """get_align_for_phylip should return Aligment object for phylip files""" align = get_align_for_phylip(self.big_interleaved) ...
Python
1
= ('i386', 'ppc'): machine = 'fat' elif archs == ('i386', 'x86_64'): machine = 'intel' elif archs == ('i386', 'ppc', 'x86_64'): machine = 'fat3' elif archs == ('ppc64', 'x86_64'): machine = 'fat64' elif archs...
Python
1
import hashlib import hmac from binascii import hexlify, unhexlify def sha256(x): """ Simple wrapper of hashlib sha256. """ return hashlib.sha256(x).digest() def sha512(x): """ Simple wrapper of hashlib sha512. """ return hashlib.sha512(x).digest() def ripemd160(x): """ Simple wrapper of hashl...
Python
1
from collections import deque INF = int(1e9) n, m = map(int, input().split()) distance = [INF] * (n + 1) graph = [[] for _ in range(n + 1)] for _ in range(m): a, b, c = map(int, input().split()) graph[a].append((b, c)) graph[b].append((a, c)) q = deque([(1, 0)]) distance[1] = 0 while q: node, dis...
Python
1
panic!("{}", e); } Ok(size) => { if size == 0 { break; } match io::stdout().write_all(&buf[..size]) { Err(e) => panic!("{}", e), Ok(_) => {}, ...
Rust
0
uth, **result) result.update(imc_response(module, resp.read())) # Store cookie for future requests cookie = '' try: cookie = result['aaaLogin']['attributes']['outCookie'] except Exception: module.fail_json(msg='Could not find cookie in output', **result) try: # Prepare ...
Python
1
import argparse import os from configparser import ConfigParser from mhxy import * class Baotu(MhxyScript): _chasepos = 2 def __init__(self, idx=0, changWinPos=True, resizeToSmall=False, config=None, stopCheck=None) -> None: super().__init__(idx, changWinPos, resizeToSmall, config, stopCheck=stopCh...
Python
1
] #[derive(Copy, Clone, Debug)] pub struct RxQuality { rssi: i16, snr: i8, } impl RxQuality { pub fn new(rssi: i16, snr: i8) -> RxQuality { RxQuality { rssi, snr } } pub fn rssi(self) -> i16 { self.rssi } pub fn snr(self) -> i8 { self.snr } } <reponame>timotree3...
Rust
0
.chain_err(|| "send response")) ) } macro_rules! error { ($writer: expr, $id: expr, $data: expr) => ( try!($writer.write_all(&error_response!($id, $data)) .chain_err(|| "send error response")) ) } macro_rules! async { ($writer: expr, $method: expr, $args: expr) => ( ...
Rust
0
class Solution: def dominantIndex(self, nums: List[int]) -> int: m = max(nums) for x in nums: if x != m and m < 2 * x: return -1 return nums.index(m)
Python
1
value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !0x01) | ((value as u16) & 0x01); self.w } } #[doc = "Prescale timer 1 interrupt enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum RT1PSIE_A { #[doc = "0: Interrupt not enabled"] RT1PSIE_0 = 0, #[doc ...
Rust
0
brightness at a given longitude. Parameters ---------- glon : `~astropy.coordinates.Angle` Galactic Longitude. """ return self._interpolate_parameter("Surface_Brightness", glon) def peak_brightness_error(self, glon): """Peak brightness error at a given l...
Python
1
he list assert not any(secret.id == test_secret.id for secret in secrets) # Create and delete an agent-specific secret agent_secret_name = f"agent_delete_test_b{uuid4().hex[:6]}" agent_secret = await create_secret( developer_id=developer_id, name=agent_secret_name, description="...
Python
1
BusKind::Cpu => self.read_cpu(system, state, addr), BusKind::Ppu => self.read_ppu(system, state, addr), } } fn read(&self, bus: BusKind, system: &System, state: &mut SystemState, addr: u16) -> u8 { match bus { BusKind::Cpu => self.read_cpu(system, state, addr), ...
Rust
0
!(); map.clear(); assert_map_same(&map, []); } #[test] fn one_slice() { let mut map = cmap!(10 => 0, 1, 2); map.clear(); assert_map_same(&map, []); } #[test] fn two_slices() { let mut map = cmap!( 10 => 0, 1, 2; 20 => 0, 1; ); map.clear(); assert_map_same(&map, []);...
Rust
0
import lib.oppnet.routing from lib.oppnet.communication import Message from lib.oppnet.mobility_model import MobilityModel def solution(sim): particles = sim.get_particle_list() if sim.get_actual_round() == 1: # initialize the particle mobility models for particle in particles: m_...
Python
1
.long("domain") .takes_value(true) .default_value("") .help("Windows domain")) .arg(Arg::with_name("username") .long("user") .takes_value(true) .default_value("") .help("Usern...
Rust
0
:-1]+araby.ALEF_MAKSURA possible_noun_list.add(possible_noun) if stem.endswith(araby.HAMZA): possible_noun = stem[:-1]+araby.YEH_HAMZA possible_noun_list.add(possible_noun) #to be validated validated_list = possible_noun_list return validated_list def get_suffix...
Python
1
ixy::memory::alloc_contiguous_memory; use ixy::*; use chrono::prelude::*; use simple_logger::SimpleLogger; // 4 KiB pages (TX queue + packet buffer) used for one batch of packets const NUM_PAGES: usize = 64; // batch size const BATCH_SIZE: usize = NUM_PAGES - 1; // size of our packets const PACKET_SIZE: usize = 60; ...
Rust
0
(&mut *buf) { Ok((len, src)) => { let client: &Client = match self.clients.entry(src) { Entry::Occupied(o) => o.into_mut(), Entry::Vacant(v) => v.insert(Client::new(src, &self.remote_addr)) }; client.handle_incoming(&mut...
Rust
0
import requests from bs4 import BeautifulSoup as BSP from TOSUMUSIC import app as GOKU from pyrogram import filters url = "https://all-hashtag.com/library/contents/ajax_generator.php" @GOKU.on_message(filters.command("hastag")) async def hastag(bot, message): global content try: text = message.text.sp...
Python
1
ethereum_hashes)) } FuturePath::Log { filter, from_number, current_number, } => { let mut ret: Vec<Log> = Vec::new(); let _ = filter_range_logs( client.as_ref(), backend.as_ref(), &block_data_cache, &mut ret, max_past_logs, &filter, from_num...
Rust
0
. Otherwise, it returns None. """ labels_diff = labels_util.Diff.FromUpdateArgs(args) if not labels_diff.MayHaveUpdates(): return None labels = original_deployment.labels labels_update = labels_diff.Apply( client.messages.MirroringDeployment.LabelsValue, labels, ) ...
Python
1
from tkinter import * def cmClick1(): print(s.get()) label1['text']="Мы сидим на паре с преподавателем по имени " + ls[s.get()] form1 = Tk() w, h, l, t = 320, 240, 600, 250 form1.geometry(f"{w}x{h}+{l}+{t}") label1 = Label(text="Как зовут преподавателя?") label1.place(x=5, y=5) s=IntVar() ls=["Оля", "Юля", "Оле...
Python
1
warmup_workout_data = [ {"exercise": "EMOM 10\nOdd: Thrusters increase weight\nEven: 15 cal Row\n15 Knee Tucks Every Other Round"}, {"exercise": "EMOM 10\nOdd: Back Squat increase weight\nEven: 15 cal row\n15 Knee Tucks Every Other Round"}, {"exercise": "EMOM 6\n5 x Back Squat\nFor Time: 10 - 1\n10 DB Snatc...
Python
1
True. """ qMi = m.qM_fullm_i if m.opt.is_sparse else m.dof_tri_row qMj = m.qM_fullm_j if m.opt.is_sparse else m.dof_tri_col if ~(m.opt.disableflags & (DisableBit.ACTUATION | DisableBit.DAMPER)): wp.launch( _qderiv_actuator_passive, dim=(d.nworld, qMi.size), inputs=[ m.nu, ...
Python
1
Autorepeat, Unknown(i32), } impl From<KeyState> for KeyStateSuper { #[inline(always)] fn from(k: KeyState) -> Self { match k { KeyState::Released => KeyStateSuper::RELEASED, KeyState::Pressed => KeyStateSuper::PRESSED, KeyState...
Rust
0
= Sudoku::from_vec(&DEFAULT_SOLUTION); // WHEN sudoku.solve(); // THEN assert!(sudoku.equal(&solution)); } fn main() { let args = env::args(); let use_default = args.len() == 1; let mut sudoku = if use_default { Sudoku::from_vec(&DEFAULT_SUDOKU) } else { let mut...
Rust
0
from_slice(y); PublicKey::from_slice(&key_bytes[..]).map_err(JwkError::custom) } } impl<'a> From<&'a SecretKey> for JsonWebKey<'a> { fn from(key: &'a SecretKey) -> JsonWebKey<'a> { create_jwk(&key.to_verifying_key(), Some(key)) } } impl TryFrom<&JsonWebKey<'_>> for SecretKey { type Err...
Rust
0
#Declarar variable y constantes precioChurrasco=1500; precioCompleto=1500; precioCvegetariano=1500; precioBarrosluco=1500; totalCompra=0; CantidadChurrascos=0; CantidadCompleto=0; CantidadCvegetariano=0; CantidadBarrosluco=0; descuento=0.1; respuesta=""; codigoh="hunterxhunter"; #Mostrar precios print("Bienvenido a la ...
Python
1
# -*- coding: utf-8 -*- # # test_issue_2282.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 2 of the License...
Python
1
name = "runProgram")] pub fn run_program(program: JsValue) -> Result<RunResult, JsValue> { let mut vm = Vm::new(()).expect("Failed to initialize VM"); let program: CaoProgram = program.into_serde().map_err(err_to_js)?; vm.run(&program).map_err(err_to_js).map(|()| RunResult {}) } fn err_to_js(e: impl std::e...
Rust
0
fn test_join_reorder_dpsize() { use crate::op::OpKind::*; let cat = j_catalog(); let tbl_map = table_map(&cat, "j", vec!["t0", "t1", "t2", "t3"]); for (s, qrs, js, jss, shape) in vec![ ( "select 1 from t1 join t2 on t1.c1 = t2.c1 join t3 on t2.c1 = t3.c1",...
Rust
0
/* * Class: org_apache_kafka_common_metrics_stats_Histogram * Method: value * Signature: (D)D */ #[no_mangle] #[allow(non_snake_case)] pub extern "system" fn Java_org_apache_kafka_common_metrics_stats_Histogram_value( env: JNIEnv, obj: JObject, val: jdouble, ) { let result = || -> jni::erro...
Rust
0
-> Optional[pd.DataFrame]: ABORT_MESSAGE = "Aborting import_matchups()" matchups_dataframes: list[pd.DataFrame] = [] if not PATH_DIR_MATCHUPS.is_dir(): logger.error( "Matchups directory does not exist\n" f"Matchups directory: {PATH_DIR_MATCHUPS}\n" ...
Python
1
} } impl<A, B, F> Compose<A, B> for F where F: Fn(A) -> B {} trait Curry<A, B, C>: Fn(A, B) -> C { fn with(self, a: A) -> Box<dyn Fn(B) -> C> where A: Copy + 'static, Self: Copy + 'static, { Box::new(move |b| self(a, b)) } } impl<A, B, C, F> Curry<A, B, C> for F where F: Fn(A,...
Rust
0
The locations {file_path} exist") if os.path.isfile(file_path): print("This is a file.") elif os.path.isdir(file_path): print('This is directory') else: print("The location doesn't exist.") """ """ from arithmetic import Calculator def get_numbers(): x = int(input("Enter first number: "...
Python
1
def solve(grid): h, w = len(grid), len(grid[0]) cnt = {} for r in grid: for c in r: cnt[c] = cnt.get(c, 0) + 1 bg = max(cnt, key=lambda x: cnt[x]) shape = max((k for k in cnt if k != bg), key=lambda x: cnt[x]) pts = [(i,j) for i in range(h) for j in range(w) if grid[i][j]==sh...
Python
1
ustion" => CommandKind::Skip { type_: "assert_exhaustion".to_string(), }, "assert_return_canonical_nan" => CommandKind::Skip { type_: "assert_return_canonical_nan".to_string(), }, "assert_return_arithmetic_nan" => CommandKind::Skip { ...
Rust
0
_end_section(w, name) } fn write_start_section(c: &mut dyn Write, name: &str) -> io::Result<()> { // we need string here to get correct length let label = format!(" Start {} ", name); writeln!(c, "# {:-^118}", label) } fn write_end_section(c: &mut dyn Write, name: &str) -> io::Result<()> { // we need ...
Rust
0
""" @File :baidu.py @Editor : 百年 @Date :2025/2/18 16:36 """ ''' { "log_id": 4457308639853058292, "items": [ { "score": 0.997762, "tag": "iphone" }, { "score": 0.861775, "tag": "手机" }, { "score": 0.845657...
Python
1
), key is cls_name dataset_name: camera intrinsic parameter renderer: K: camera intrinsic """ # logger.info('poses: {}'.format(poses)) assert bboxes.ndim == 2 assert labels.ndim == 1 assert bboxes.shape[0] == labels.shape[0] assert bboxes.shape[1] == 4 or bboxes.shape[1] ...
Python
1
from setuptools import setup import sys import re with open("README.rst") as readme_file: readme_text = readme_file.read() VERSIONFILE = "geojson/_version.py" verstrline = open(VERSIONFILE).read() VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" mo = re.search(VSRE, verstrline, re.M) if mo: verstr = mo.group(1) ...
Python
1
: {:}", e) } }); fn do_job(this: usize, check_update_url: String, run_loop_ref: usize) -> Result<(), hyper::Error> { let client = Client::new(); let mut resp = try!{ client.get(&check_update_url).header(Connection::close()).send() }; if resp.status == StatusCode::Ok { let mut conte...
Rust
0
&str, call_data: &[u8], strategy: ExecutionStrategy, extensions: Option<Extensions>, ) -> ClientResult<Vec<u8>> { match self.backend.is_local_state_available(id) { true => self.local.call(id, method, call_data, strategy, extensions), false => Err(ClientError::NotAvailableOnLightClient), } } fn conte...
Rust
0