text
string
label_name
string
labels
int64
= (); type Error = Error; fn serialize_field<T: ?Sized>(&mut self, value: &T) -> Result<()> where T: ser::Serialize, { ser::SerializeSeq::serialize_element(self, value) } fn end(self) -> Result<Self::Ok> { // close sequence self.ser.buf.push(b']'); // c...
Rust
0
class Employe(): def __init__(self,nom,prenom,salaire): self.nom=nom self.prenom=prenom self.salaire=salaire class Manager(Employe): def __init__(self, nom, prenom, salaire): super().__init__(nom, prenom, salaire) self.emp_supervises = [] def ajouter_emp(self,employe...
Python
1
import urllib.request as urllib2 from io import TextIOWrapper dataurl = 'https://adventofcode.com/2024/day/5/input' def part1(rules,updates): total = 0 for update in updates: pages = [int(x) for x in update.split(',')] valid = True for rule in rules: orders = [int(x...
Python
1
ern crate rocket; extern crate pbkdf2; extern crate rocket_contrib; #[macro_use] extern crate log; extern crate simplelog; use crate::ws::RocketToWsMsg; use db::Pool; use pacosako::{DenseBoard, SakoSearchResult}; use rand::{thread_rng, Rng}; use rocket::response::NamedFile; use rocket::response::{Flash, Redirect}; use ...
Rust
0
// into the denominator, because the common sample rate of 44.1 kHz // is not a multiple of 500. Some(Hertz(hz)) => self.samples_played * 500 / (hz as u64), // When the sample rate is not known, we definitely have not started // playback. None => 0 } ...
Rust
0
ero().serialized_size(); field_serialization_test::<Fq6>(byte_size); } generate_field_serialization_test!($($tail)*); }; (fq12; $($tail:tt)*) => { #[test] fn test_fq12_serialization() { let byte_size = Fq12::zero().serialized_size(); field_se...
Rust
0
import pytest from torch import nn from reinvent.models.transformer.core.network.encode_decode.model import EncoderDecoder from reinvent.models.transformer.core.vocabulary import build_vocabulary from reinvent.models.transformer.libinvent.libinvent import LibinventModel from reinvent.models import meta_data from tests...
Python
1
obp_idx & 0x3F) } } use serde::{Deserialize, Serialize}; use crate::component::{NextScene, Object}; use crate::direction::Direction; use crate::point::Point; use crate::{component, util, Assets, Context2D, KeyboardState}; use super::cell::{cell_cursor, OverworldCell, OverworldCellType, Surroundings}; use super::c...
Rust
0
from discord.ext import commands import discord import datetime from discord import app_commands class MuteCog(commands.Cog): def __init__(self, bot:commands.bot): self.bot = bot @app_commands.command(description = "Mutes someone on this discord server.") @app_commands.checks.has_permissions(moder...
Python
1
tic HASH_TEST_VEC: &'static [&'static str] = &[ &"abc", &"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", &"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", ]; static HASH_SHA256_TRUTH: &'static [&'static str] = &[ &"ba7816bf8...
Rust
0
it_handling(self, sample_criterion_thread): """Test that backends handle rate limits appropriately.""" backends = [ BackendFactory().create_backend(ModelBackend.BEDROCK), BackendFactory().create_backend(ModelBackend.LITELLM), BackendFactory().create_backend(ModelBacke...
Python
1
) metric_load_result.additional_properties = d return metric_load_result @property def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) def __getitem__(self, key: str) -> Any: return self.additional_properties[key] def __setitem__...
Python
1
crate::semirings::{SerializableSemiring, WeaklyDivisibleSemiring, WeightQuantize}; use crate::tests_openfst::utils::test_eq_fst; use crate::tests_openfst::FstTestData; use std::path::Path; #[derive(Serialize, Deserialize, Debug)] pub struct ConcatOperationResult { fst_2_path: String, result_static_path: Strin...
Rust
0
@score.setter def score(self, value: (float | None)): self._score = value
Python
1
lue("", r#"KlogHas("lin")"#), MetricValue::Bool(true)); assert_eq!(state.evaluate_value("", r#"KlogHas("l.ne")"#), MetricValue::Bool(true)); assert_eq!(state.evaluate_value("", r#"KlogHas("fi.*ne")"#), MetricValue::Bool(true)); assert_eq!(state.evaluate_value("", r#"KlogHas("fi.*sec")"#), Metric...
Rust
0
# Split by newlines and format each paragraph as a quote thinking_paragraphs = thinking_text.split("\n\n") for paragraph in thinking_paragraphs: if paragraph.strip(): # Format as Slack quote (> at the beginning of each line) ...
Python
1
eline_2_ops.extend(timeline_2.integrate_ops::<FakeFileSystem<StdRng>, _>( &ops_from_timeline_1_to_timeline_2, None, )); } assert_eq!(timeline_1.paths_with_ids(), timeline_2.paths_with_ids()); assert_eq!(timeline_1.paths(), ["a/", "a~/", "a~~/"]); ...
Rust
0
function does not check if necessary tags are present. Instead, it only checks if the defined /// tags are valid. /// /// ``` /// #[editor_plugin(specific_to=Map)] /// pub struct Sync { /// /// #[option( /// label = "URL", /// description = "" /// )] /// url: String, /// } /// ``` ///...
Rust
0
def __init__(self, vqvae: VQModel, text_encoder: CLIPTextModel, tokenizer: CLIPTokenizer, transformer: Transformer2DModel, scheduler: VQDiffusionScheduler, learned_classifier_free_sampling_embeddings: LearnedClassifierFreeSamplingEmbeddings): super().__init__() self.register_modules(vqvae=vqvae, tra...
Python
1
import asyncio import time import ray from ray.exceptions import RayTaskError @ray.remote class Actor: async def f(self): try: await asyncio.sleep(5) except asyncio.CancelledError: print("Enter cancelled") for i in range(5): print(i) await asyncio.sleep(1) print("Actor task canceled.") acto...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2023 Google LLC. 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 requir...
Python
1
session) await invalidate_license_cache(session, license.license_key) return {"success": True, "message": "License cache invalidated successfully"} def create_headers(request: ThreatIntelRegisterRequest) -> Dict[str, str]: return { "x-api-key": request.requesting_api_key, "Content-Type": ...
Python
1
s, teacher_forcing_ratio=args.teacher_forcing_ratio, tf_decay_rate=args.tf_decay_rate, max_norm=args.max_norm, mid_sample_size=args.mid_sample_size, dual_sample_size=args.dual_sample_size, nlu_st=(args.nlu_st == 1), ...
Python
1
positions """ x = x.reshape(-1, self.dimension) grad_logpdf = np.dot(self.mean.reshape(1, -1) - x, self.precision) return grad_logpdf def pdf(self, x): """Probability density function. Args: x (np.ndarray): Positions at which the pdf is evaluated ...
Python
1
ty_args = ty_args .into_iter() .map(|t| instantiate_base(context, t)) .collect(); let tvars = make_tparams(context, loc, constraints); assert!(ty_args.len() == tvars.len()); let mut res = vec![]; let subst = std::mem::replace(&mut context.subst, /* dummy value */ Subst::new()); ...
Rust
0
ps://stackoverflow.com/questions/600293/how-to-check-if-a-number-is-a-power-of-2 const fn is_power_of_two(num: usize) -> bool { num != 0 && ((num & (num - 1)) == 0) } // tests module for small unit tests #[cfg(test)] mod tests2 { use super::*; #[test] fn test_is_power_of_two() { assert!(!is_p...
Rust
0
# _*_ codign:utf8 _*_ """==================================== @Author:Sadam·Sadik @Email:1903249375@qq.com @Date:2023/5/9 @Software: PyCharm @disc: =======================================""" import logging import piexif def get_gps_info(raw_path): # 读取图片的exif信息 exif_dict = piexif.load(raw_path) # 获取GPS信息...
Python
1
de películas. Para el tema dado, sugiere {count} películas. Utiliza el siguiente esquema JSON: {schema} """, "library_prompt": "Basado en la siguiente lista de películas en la biblioteca Plex del usuario: {movies}, sugiere {count} películas relacionadas con el tema: {theme}. Sol...
Python
1
4565 base 10 let val_be = to_fixed_bytes(&val); assert_eq!( Uint256::from_bytes_be(&val_be), get_uint256("12345") ); } }<filename>verifier/src/public_input_offsets.rs use num256::uint256::Uint256 as Uint256; use crate::uint256_ops; /* ---------------- The following constants are offsets of data e...
Rust
0
, value_match={value_match}") if name_match and value_match and index_match: filtered_candidates.append(candidate) logger.info(f"最终过滤后的候选元素数量: {len(filtered_candidates)}") # 根据索引选择元素 if filtered_candidates: matches.append(filtere...
Python
1
# richard -- video index system # Copyright (C) 2012, 2013, 2014, 2015 richard contributors. See AUTHORS. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
Python
1
{ZX_ERR_NOT_FOUND, ZX_OK}, futures::stream::StreamExt, futures::task::Poll, pin_utils::pin_mut, test_case::test_case, wlan_common::assert_variant, }; /// Hold the client and service ends for DeviceMonitor to allow mocking DeviceMonitor responses /// for unit tests. ...
Rust
0
get_first_word(word: &str) -> &str { let word = word.trim(); let words: Vec<&str> = word.split(|c: char| " ,.-;:'".contains(c)).collect(); words[0] } pub fn get_first_letter(word: &str) -> char { word.chars().next().unwrap() } pub fn is_title_case(first_word: &str) -> bool { let mut chars = fir...
Rust
0
top: Some(stop_tx)}.start(); Arbiter::set_system(sys, name.to_string()); SystemRunner { core: core, stop: stop_rx, } } } /// Helper object that runs System's event loop #[must_use="SystemRunner must be run"] pub struct SystemRunner { core: Core, stop: Receiv...
Rust
0
de YouTube/TikTok.'}\n\nENLACES/FUENTES RELEVANTES:\n{chr(10).join(sorted(normal_links)) if normal_links else 'No se encontraron fuentes relevantes.'}\n\nINSTRUCCIÓN CRÍTICA: Utiliza TODA la información proporcionada arriba. Si hay múltiples noticias, datos o elementos, inclúyelos TODOS en tu respuesta de forma natura...
Python
1
from timeit import default_timer as timer import numpy as np from numba import roc, float32 from numba.roc.hsadrv.error import HsaKernelLaunchError import unittest class TestMatMul(unittest.TestCase): def test_matmul_naive(self): @roc.jit def matmul(A, B, C): i = roc.get_global_id(0) ...
Python
1
ompiling a separate server binary. I wanted something simple, light //! weight, easy to use, and that could conveniently search structs and //! collections in my binary. So, I made `indicium`. //! //! # What's New? //! //! * `0.3.7`: An experimental feature is now disabled by default to reduce //! resource consumption....
Rust
0
d_to_string(path)?; // RPMs can only have 1 line in the license - so use the first. let license_string = license_string .lines() .next() .ok_or_else(|| format_err!(ErrorKind::License, "empty license file {}!", path))? .to_owned(); ...
Rust
0
# THIS FILE HAS BEEN AUTOGENERATED. To update: # 1. modify the `_deps` dict in setup.py # 2. run `make deps_table_update`` deps = { "Pillow": "Pillow<10.0.0", "accelerate": "accelerate>=0.20.3", "av": "av==9.2.0", "beautifulsoup4": "beautifulsoup4", "black": "black~=23.1", "codecarbon": "codecar...
Python
1
write is therefore quite simple: // 1). Write the significant digits, using an itoa algorithm for the radix. // We never need to backtrack, because we cannot have rounding error. // 2). Calculate the scientific exponent for the value. // This is exponent + mantissa digits. // 3). Determine if we should us...
Rust
0
flags=re.IGNORECASE) cleaned_response = re.sub(r"\s*```$", "", cleaned_response.strip()) linked_entity = json.loads(cleaned_response) entity["wiki_id"] = linked_entity["entity_id"] elif not data: ...
Python
1
e".to_string() }; let channel_position = &guild_channel.position; let channel_id = &guild_channel.id; let channel_bitrate = if guild_channel.bitrate != None { guild_channel.bitrate.unwrap().to_string() + " kbps" } else { "N/A".to_string() }; let channel_nsfw = &guild_channel...
Rust
0
rank_snapshots (id) { id -> Bigint, user_id -> Bigint, update_time -> Datetime, mapped_spotify_id -> Integer, timeframe -> Unsigned<Tinyint>, ranking -> Unsigned<Tinyint>, } } table! { track_stats_history (id) { id -> Bigint, followers -> Unsigned...
Rust
0
_ids_to_do}") return app_ids_to_do def main() -> None: gem_sack_price_in_euros = 0.40 # Positive value to ensure under-cutting is possible price_offset_in_euros = 0.1 app_ids_previously_processed = [ 205890, 359400, 395620, 398140, 448720, 468250,...
Python
1
for StartLocalTransactionResponse { fn clear(&mut self) { self.transaction_id.clear(); self.unknown_fields.clear(); } } impl ::std::fmt::Debug for StartLocalTransactionResponse { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(s...
Rust
0
# Copyright (c) 2024 Microsoft Corporation. # Licensed under the MIT License """The Indexing Engine text chunk package root."""
Python
1
:?}", section).is_empty()); } #[test] fn far_too_small() { let data = hex!("fd4df0"); assert_matches!( PmtSection::from_bytes(&data), Err(DemuxError::NotEnoughData { expected: 4, actual: 3, .. }) ); ...
Rust
0
import json ip=["apple","banana","grapes"] #store to file # with open ("file4.json","w") as f: # json.dump(ip,f) #read firts and add existing one # ip1="pineapple" # with open ("file4.json","r") as f: # data=json.load(f)#data will change from json string to list # if ip1 not in data["fruits"]: # data[...
Python
1
medias = [] classifica = [] times = [ ('Jeff',[10, 12, 9]), ('Rodr', [11, 9, 13]) ] for equipes, pontuacao in times: media = sum(pontuacao) / len(pontuacao) medias.append((pontuacao, media)) medias = sorted(medias) print(medias) print(i) print(pontuacao)
Python
1
nimation> { self.animations.get_mut(self.current_animation) } } fn update_sprite_atlas(mut query: Query<(&mut TextureAtlasSprite, &Animations)>) { for (mut sprite, animations) in query.iter_mut() { let current_anim_index = animations.current_animation; if let Some(anim) = animations.ani...
Rust
0
= self.z * self.y; let z3 = z3 + z3; let x3 = f - (d + d); let c = c + c; let c = c + c; let c = c + c; let y3 = e * (d - x3) - c; let tmp = G2Projective { x: x3, y: y3, z: z3, }; G2Projective::conditional_sele...
Rust
0
intPass<'tcx> for IndexRefutableSlice { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { if_chain! { if !expr.span.from_expansion() || is_expn_of(expr.span, "if_chain").is_some(); if let Some(IfLet {let_pat, if_then, ..}) = IfLet::hir(cx, expr); ...
Rust
0
u32; type Currency = Currency; type Event = Event; type MaxAuction = MaxAuction; type NFT = NFT; type TokenData = nft::TokenData<Balance>; type TokenId = u64; } pub type NativeCurrency = orml_currencies::BasicCurrencyAdapter<Runtime, Balances, Amount, BlockNumber>; parameter_type_with_key! { pub ExistentialDe...
Rust
0
import json import os import logging def save_results(chunk_size_metrics, retrieval_metrics, scores, output_dir='results/'): """ Saves the evaluation results to JSON files. Args: chunk_size_metrics (dict): Metrics related to chunk sizes. retrieval_metrics (dict): Metrics related to ret...
Python
1
v` as mutable //[nll2015]~^^ ERROR cannot borrow `v` as mutable //[migrate2018]~^^^ ERROR cannot borrow `v` as mutable //[nll2018]~^^^^ ERROR cannot borrow `v` as mutable } fn reservation_conflict() { let mut v = vec![0, 1, 2]; let shared = &v; v.push(shared.len()); //[nll2015]~^ ERROR can...
Rust
0
||_dS(N(RRURtscreen(RR]RV((s renpy/ast.pyR% scCst|jjfS(N(RURVR (R((s renpy/ast.pyRu0 scCs_t|jtd|jj|j|jftjj j |j...
Python
1
cmd_msec); // サーバー・プログラムなら TCPリスナーを作成し、クライアント・プログラムなら TCPストリームを取得する。 // https://docs.rs/tokio-tcp/0.1.2/src/tokio_tcp/stream.rs.html#49-58 match TcpStream::connect(&addr).await { Ok(mut stream) => { match stream.set_nodelay(true) { ...
Rust
0
= r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !0x01) | ((value as u8) & 0x01); self.w } } #[doc = "STALL_...
Rust
0
::{ControlAction, ControllerId}; /// `ControlAction` controller event data. #[derive(Clone, Copy, Debug, PartialEq)] pub struct ControlActionEventData { /// `ControllerId` that the input originated from. pub controller_id: ControllerId, /// `Entity` this control event applies to. pub entity: Entity, ...
Rust
0
'][0] except IndexError: LOG.debug('User %s(%i) has no roles', data['user']['login'], uid) return False roles = [r['name'] for r in membership['roles']] return 'Developer' in roles or 'Manager' in roles def get_attachment_from_user(self, issue, attachments): ...
Python
1
"""Refactor timestamps: add fecha_actualizacion/cierre, drop intermedias Revision ID: f7e8d9c0a123 Revises: a1b2c3d4e5f6 # ← tu última revisión Create Date: 2025-10-02 """ from alembic import op import sqlalchemy as sa revision = "f7e8d9c0a123" down_revision = "a1b2c3d4e5f6" branch_labels = None depends_on = None d...
Python
1
efault=[DatasetType.Div2KBicubic], type=DatasetType, choices=[DatasetType.Div2KBicubic, DatasetType.Div2KUnknown], help="Training dataset", ) data.add_argument( "--dataset-val", nargs="+", default=[DatasetType.Div2KBicubic], type=DatasetType, choices=list(DatasetType), help="Validati...
Python
1
from serial import Serial import time ser = Serial(port='COM6', baudrate=115200, timeout=1) print("Listening on COM6...") try: while True: # Send message to MCU ser.write(b"thunder\n") # Wait for MCU to reply time.sleep(0.1) # Small delay to allow MCU response # Read res...
Python
1
# 5.voxel neighbor aggregation pooled_features = pool_layer( xyz=cur_voxel_xyz.contiguous(), # voxle中心点云坐标 xyz_batch_cnt=cur_voxel_xyz_batch_cnt, # 每帧点云有效坐标的个数 new_xyz=roi_grid_xyz.contiguous().view(-1, 3), # roi grid点云坐标 new_xyz_batch_cnt=roi_...
Python
1
} } } #[cfg(test)] mod tests { #[test] fn it_works() { assert_eq!(2 + 2, 4); } } <filename>2019/rust/src/main.rs extern crate aoc_2019; extern crate aoc_runner; extern crate aoc_runner_derive; use aoc_runner_derive::aoc_main; aoc_main! { lib = aoc_2019 } use anyhow::Context; use anyho...
Rust
0
import subprocess import re import time from rgbprint import gradient_print, Color import winreg as wrg from utils.utils import banner while True: banner() gradient_print( "\n \n \n[1] : Change Drag Selection Color", start_color=Color.magenta, end_color=Color.yellow ) ...
Python
1
::place_geographic::SNOW_CAPPED_MOUNTAIN; // VOLCANO 🌋 #[doc(inline)] pub use crate::grouped::travel_and_places::place_geographic::VOLCANO; // end place_geographic // begin place_map 🧭🌎🌏 // COMPASS 🧭 #[doc(inline)] pub use crate::grouped::travel_and_places::place_map::COMPASS; // GLOB...
Rust
0
minus = (y + HEIGHT - 1) % HEIGHT; let vx1 = self.0[y][x_plus].velocity.x; let vx2 = self.0[y][x_minus].velocity.x; let vy1 = self.0[y_plus][x].velocity.y; let vy2 = self.0[y_minus][x].velocity.y; let vel_grad = (vx1 - vx2 + vy1 - vy2) / 2.0; vel_grad } } fn setup(m...
Rust
0
ug, Eq, PartialEq, Clone)] pub enum Token { // Single characters. OpeningParen(Range), // ( ClosingParen(Range), // ) Comma(Range), // , Dot(Range), // . Minus(Range), // - Plus(Range), // + NumberSign(Range), // # Colon(Range), // : // Literals. Comment(Ra...
Rust
0
: share_link, 'model_description': self.env['ir.model']._get(self.resource_ref._name).display_name.lower()}, subject=_("Invitation to access %s", self.resource_ref.display_name), subtype_xmlid='mail.mt_note', email_layout_xmlid='mail.mail_notificat...
Python
1
rice point of the iPhone 14 Pro Max, which is marketed as a premium smartphone with a top-of-the-line camera. Overall, I feel as though I have been let down by Apple and their latest iPhone offering. As a loyal customer who has invested a significant amount of money into their products over the years, I expect better ...
Python
1
import sys import datetime from os import execle, environ from config import ALIVE_PIC, SUDO_USERS from pyrogram import Client, filters from pyrogram.types import Message KEX = f"""ㅤ ꜱᴛᴏʀᴍ ᴜꜱᴇʀʙᴏᴛ ‌🪽 ➖➖➖➖➖➖➖➖➖➖➖ **• ᴘʏᴛʜᴏɴ ᴠᴇʀꜱɪᴏɴ** 🐍: `3.11.3` **• ᴜꜱᴇʀʙᴏᴛ ᴠᴇʀꜱɪᴏɴ** ⚙️: `M2.0` **• ɢʀᴏᴜᴘ 💫: [ꜱᴛᴏʀᴍ ᴄʜᴀᴛᴢ 🥀](https://...
Python
1
MSK3`"] pub struct INEPMSK3_W<'a> { w: &'a mut W, } impl<'a> INEPMSK3_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { sel...
Rust
0
_u16 = vec![1u16,2,3,4,5]; //! let vec_u8: Vec<u8> = unsafe { reinterpret_vec(vec_u16) }; //! ``` //! //! However converting to a `Vec<[u8; 3]>` can cause a panic if the size of the source capacity //! cannot be divided into the number of bytes of a `[u8; 3]`. For example the following code will //! panic because the c...
Rust
0
style: Some(Style2 { weight: Some(weight), width: Some(width), slant: Some(slant), }), code_points: None, languages: languages .map(|l| l.iter().map(|s| LocaleId { id: s.to_stri...
Rust
0
ate_left(44); return xp; } fn main() { let n = 50_000_000; let mask = (1 << 25) - 1; let mut m = std::collections::HashMap::<u64, u64, MyBuildHasher>::default(); m.reserve(n); let mut rng: [u64; 3] = [1872361123, 123879177, 87739234]; println!("Rust HashMap n = {}, mask = {:#x}", n, mask...
Rust
0
gIgnores": apSyslogMsgIgnores, "apSyslogMsgDrops": apSyslogMsgDrops, "apSyslogHistory": apSyslogHistory, "apSyslogHistTableMaxLength": apSyslogHistTableMaxLength, "apSyslogHistMsgsFlushed": apSyslogHistMsgsFlushed, "apSyslogHistoryTable": apSyslogHistoryTable, "apSyslogHistoryE...
Python
1
lue']) > 1: cursor_y += packet.sensors['Y']['value'] cursor_y = max(0, min(cursor_y, 600)) map(lambda x: x.update(packet), graphers) if recording: record_packets.append...
Python
1
ni fn download_url() -> String { let tag: &str = &format!("kani-{}", VERSION); let file: &str = &download_filename(); format!("https://github.com/model-checking/kani/releases/download/{}/{}", tag, file) } /// Effectively the entry point (i.e. `main` function) for both our proxy binaries. pub fn proxy(bin: ...
Rust
0
import logging import os import sys from PyQt5.QtMultimedia import QSound from PyQt5.QtWidgets import QMessageBox from pacekeeper.consts.labels import load_language_resource from pacekeeper.controllers.config_controller import ConfigController from pacekeeper.utils.resource_path import resource_path lang_res = load_...
Python
1
} else { continue; }; let pivot = self[[i, i]]; // rhs[i] /= pivot; if i < dim { // subtract `m[curr_i][i] / pivot` * `m[i][j]` from `m[curr_i][j]` for each row below row `i` // to make `m[curr_i][i]` zero l...
Rust
0
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from .benchmark import Benchmark
Python
1
ids.contains(&y.get_id()) { Some(y) } else { None } }, None => None } }) .for_each(|x| f(x)) } } impl <T: Mobile> System<T> { pub fn add_mobile(&mut self, position...
Rust
0
import pgzrun WIDTH = 800 HEIGHT = 800 info = ['你是一位雄心勃勃的国王', '你的使命是:提升国民的幸福感、\n提升军事实力、维持国家安定统一', '大臣们会为你提供各种治国建议,\n你需要对这些建议作出抉择', '每一项决策都会影响到\n你自己的声望值和财富值', '声望和财富上升,会得到国民拥戴;\n反之,也会引起民众的不满', '点击任意位置开始游戏,\n履行你作为国王的使命吧......' ] question = [['要建立军队吗?', '大臣建议攻打邻国,...
Python
1
.unwrap(); for id in ids { let key = format!("id:{}", id); let _: () = conn.hset_multiple(key, &[("cv", "false")]).await.unwrap(); } } async fn record_cv(id: Uuid, pool: &Pool<RedisConnectionManager>) -> () { let mut conn = pool.get().await.unwrap(); let key = format!("id:{}", id); ...
Rust
0
test_parse_weighted_op_choice_list() { #[derive(Copy, Clone, PartialEq, Eq, Debug)] enum Op { Dup, Split, } impl FromStr for Op { type Err = String; fn from_str(s: &str) -> Result<Self, Self::Err> { match s { "Dup" => Ok(Op::Dup), ...
Rust
0
class Solution: def findMaxAverage(self, nums: List[int], k: int) -> float: summ = sum(nums[:k]) ans = summ for i in range(k, len(nums)): summ += nums[i] - nums[i - k] ans = max(ans, summ) return ans / k
Python
1
rr(), Some(String::from("Entity name is required"))); } } #[cfg(test)] mod test_data_sructures { use super::*; #[test] fn insert_vec() { let wql = Wql::from_str( "INSERT { a: 123, b: [12.3, 34, \"hello\",] } INTO my_entity", ); assert...
Rust
0
04\x01\x02\0\x12\x03\"\ \x08\x1a\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\"\x08\x0e\n\x0c\n\x05\x04\ \x01\x02\0\x01\x12\x03\"\x0f\x15\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\"\ \x18\x19\n\x0b\n\x04\x04\x01\x02\x01\x12\x03#\x080\n\x0c\n\x05\x04\x01\ \x02\x01\x05\x12\x03#\x08\x0e\n\x0c\n\x05\x04\x01\x02\x01\x0...
Rust
0
, dwFlags: DWORD, fWriteHistory: BOOL, poctNotify: *mut IOleCommandTarget, punkISFolder: *mut IUnknown, ) -> HRESULT, fn ClearHistory() -> HRESULT, }} pub type LPURLHISTORYNOTIFY = *mut IUrlHistoryNotify; RIDL! {#[uuid(0xbc40bec1, 0xc493, 0x11d0, 0x83, 0x1b, 0x00, 0xc0, 0x4f, 0xd...
Rust
0
pub(crate) quad_textures: Vec<ShadowTexture>, pub(crate) sampler: Arc<wgpu::Sampler>, pub(crate) max_casters_per_frame: u32, } pub enum ShadowQuality { Low, Medium, High, } // Type alias pub type ShadowCamera = components::CameraData; impl OmniShadowManager { pub fn new(device: Arc<wgpu:...
Rust
0
ssage_data = read_message(path); let mut aux_data = read_aux_data(path); own_signing(&tempdir, &mut message_data, &mut private_key, &mut aux_data); reference_verify(&tempdir); reference_sign(&tempdir); own_verify(&tempdir); } #[test] #[ignore] fn should_produce_same_private_key() { let tempdi...
Rust
0
Range; use TextRectangle; glib_wrapper! { pub struct Text(Interface<atk_sys::AtkText>); match fn { get_type => || atk_sys::atk_text_get_type(), } } pub const NONE_TEXT: Option<&Text> = None; pub trait TextExt: 'static { fn add_selection(&self, start_offset: i32, end_offset: i32) -> bool; ...
Rust
0
feed_dict={accTemp:[test_acc,epoch]}) accMax_ema = sess.run(max_acc_ema) if(accMax_ema[0] < test_acc_ema): accMax_ema = [test_acc_ema,f1All_ema,epoch] sess.run(maxAccAssign_ema,feed_dict={accTemp_ema:[test_acc_ema,f1All_ema,epoch]}) ...
Python
1
acked_features: u64, backend_features: u64, config: VirtioNetConfig, queue_sizes: Vec<u16>, queue_evts: Option<Vec<EventFd>>, interrupt_cb: Option<Arc<dyn VirtioInterrupt>>, epoll_threads: Option<Vec<thread::JoinHandle<result::Result<(), DeviceError>>>>, ctrl_queue_epoll_thread: Option<...
Rust
0
nid_t_ELINA_FUNID_PERMUTE_DIMENSIONS: elina_funid_t = 45; pub const elina_funid_t_ELINA_FUNID_FORGET_ARRAY: elina_funid_t = 46; pub const elina_funid_t_ELINA_FUNID_EXPAND: elina_funid_t = 47; pub const elina_funid_t_ELINA_FUNID_FOLD: elina_funid_t = 48; pub const elina_funid_t_ELINA_FUNID_WIDENING: elina_funid_t = 49; ...
Rust
0
s some integers.') parser.add_argument('--video_path', type=str, help='Video path') parser.add_argument('--save_path', type=str, help='Save path') parser.add_argument('--upperbondrange', type=int, help='Upper bond range', default=0) parser.add_argument('--world_size', type=int, help='Number of GPUs to u...
Python
1
# Generated by Django 5.0.6 on 2025-05-13 16:26 import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('inventario', '0059_remove_productoinfo_codigo'), ] operations = [ migratio...
Python
1
sig_mask, _fpregs_mem: [0; 64], }; if !action_flags.contains(SignalActionFlags::NODEFER) { thread.sig_mask.add_set(&action.mask); } if action_flags.contains(SignalActionFlags::RESTORER) { frame.re...
Rust
0
} impl TextureRepository { pub fn new() -> Self { let t = HashMap::new(); Self { textures: t } } pub fn get(&self, id: TextureID) -> Option<&Texture> { let texture = self.textures.get(&id)?; Some(texture) } pub fn exists(&self, id: TextureID) -> bool{ self.te...
Rust
0