text
string
label_name
string
labels
int64
import pytest import torch import dl_translate as dlt from dl_translate._translation_model import ( _resolve_lang_codes, _select_device, _infer_model_or_path, _infer_model_family, ) def test_resolve_lang_codes_mbart50(): sources = [dlt.lang.FRENCH, "fr_XX", "French"] targets = [dlt.lang.ENGLI...
Python
1
& 0b11111111) as u8; bytes[53] = ((self.0[7] >> 46) & 0b11111111) as u8; bytes[54] = (self.0[8] & 0b11111111) as u8; bytes[55] = ((self.0[8] >> 8) & 0b11111111) as u8; bytes[56] = ((self.0[8] >> 16) & 0b11111111) as u8; bytes[57] = ((self.0[8] >> 24) & 0b11111111) as u8; ...
Rust
0
tiplier = self.config.HIGH_VOLATILITY_MULTIPLIER elif volatility > 0.015: volatility_multiplier = self.config.MEDIUM_VOLATILITY_MULTIPLIER else: volatility_multiplier = self.config.LOW_VOLATILITY_MULTIPLIER # Calcola size finale ...
Python
1
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Date: 2025/6/16 18:03 Desc: 东方财富网-数据中心-特色数据-高管持股 https://data.eastmoney.com/executive/gdzjc.html """ import pandas as pd import requests from akshare.utils.tqdm import get_tqdm def stock_ggcg_em(symbol: str = "全部") -> pd.DataFrame: """ 东方财富网-数据中心-特色数据-高管持股 ...
Python
1
itment_cost=0.25, decay=0.99, epsilon=1e-5): super(Cross_VQEmbeddingEMA_AVT, self).__init__() self.commitment_cost = commitment_cost self.decay = decay self.epsilon = epsilon init_bound = 1 / 400 embedding = torch.Tensor(n_embeddings, embedding_dim) embe...
Python
1
!(iter.next(), Some(13)); assert_eq!(iter.next(), Some(14)); assert_eq!(iter.next(), None); } #[test] fn test_count_ones() { let mut bv = BitVector::with_capacity(20); bv.push_u8(0b1111_1000, Some(8)); bv.push_u8(0b0011_1000, Some(8)); let s = &bv[4..10]; ...
Rust
0
crate log; extern crate thread_scoped; extern crate client_lib; #[cfg(feature = "dummy-client")] extern crate dummy_client_lib; extern crate server_lib; use std::borrow::Borrow; use std::sync::Mutex; fn main() { env_logger::init().unwrap(); let listen_url = String::from("ipc:///tmp/client.ipc"); let server_ur...
Rust
0
ncies=item_data.get("dependencies") ) self.db_session.add(timeline_item) self.db_session.commit() def calculate_critical_path(self, tasks: list) -> list: """Calculate the critical path for the project""" # This would implement actual critical path calcul...
Python
1
e Perimeter", 31 => "Zone Perimeter Delay", 32 => "Zone Interior", 33 => "Zone Interior Delay", 34 => "Zone Auxiliary", 35 => "Zone Other", 40 => "Zone Safety Smoke", 41 => "Zone Safety CO", 4...
Rust
0
#!/usr/bin/env python3 import rospy #Import python for Ros from std_msgs.msg import Float64 ,Float64MultiArray #Import Standard Message type class main (object): def __init__(self): self.forward = 0.0 self.backward = 0.0 self.padel = 0.0 ...
Python
1
cmd_path = sdk_path_bin_name except Exception: # pylint: disable=broad-except log.critical(kubeconfig_util.SDK_BIN_PATH_NOT_FOUND) cfg = { 'command': cmd_path, 'apiVersion': 'client.authentication.k8s.io/v1', 'provideClusterInfo': True, 'args': cmd_args.split(' '), ...
Python
1
\ \x85\xf6\xb1_\xdc-\xc5\x9e\x9bq`\xcb\xfb\x96\xf2\xf6\ \xc9\x17\xfb\x04t\xad\x9d/\xe1\xf6\x8b\xa5\xca\xdbt\xbd\ 7o\xdem\xd0\xab/\xaeNEa\xe9w^&\xd5\ %\xba\xb3V\xb7\xb5\xbf\xb7m\xab\xf6\x85\xfd\xdbg\xb8\ \x22\xaa\xcb\xe1\xcf\x88\x9f\xd9W\x0b\x7fq\xa3yM\xf2\ \xff\x00\xa3\xc6Y\xe5\x1d\xc7>\xbd\xcdL:\x93(\xcf\ \x9bVn\x7f\x...
Python
1
from includes.logger import logger import subprocess from time import sleep def apply_gtk_theme(spinner) -> bool: """Apply GTK theme using gtk_theme_manager.""" logger.info("Applying GTK theme...") try: sleep(1) logger.info("Installing Catppuccin theme...") spinner.update_text("D...
Python
1
e, Debug)] pub struct Momentary; /// EBU Short-term (1s) loudness metering. #[derive(Copy, Clone, Debug)] pub struct Short; /// EBU Integrated (whole program range) metering. #[derive(Copy, Clone, Debug)] pub struct Integrated; impl EBUMeterMode for Momentary { fn mode() -> Mo...
Rust
0
1656 ); } #[test] fn part1() { assert_eq!(solve_part1(&parse_input(INPUT_PATH)), 1702); } #[test] fn part2() { assert_eq!(solve_part2(&parse_input(INPUT_PATH)), 250); } } use canticle_table::CanticleId; use liturgy::{Canticle, CanticleSection, CanticleVerse, Docu...
Rust
0
::CANVAS_HEIGHT - 1; draw_char_normal(rustbox, 0, 0, '┌'); draw_char_normal(rustbox, x, 0, '┐'); draw_char_normal(rustbox, 0, y, '└'); draw_char_normal(rustbox, x, y, '┘'); let c = '─'; for i in 1 .. x { draw_char_normal(rustbox, i, 0, c); draw_char_normal(rustbox, i, y, c); ...
Rust
0
hose terms. use error::Error; use nfa::{Nfa, NoLooks}; use runner::anchored::AnchoredEngine; use runner::forward_backward::{ForwardBackwardEngine, Prefix}; use runner::Engine; use std; use std::fmt::Debug; #[derive(Debug)] pub struct Regex { engine: Box<Engine<u8>>, } // An engine that doesn't match anything. #[...
Rust
0
on: String, pub off: String, pub legend: String, #[prop] pub toggled: bool, } #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] pub struct ToggleEventDetail { pub name: String, pub toggled: bool, } impl Toggle { pub fn new(toggled: bool, name: impl Display, off: String, ...
Rust
0
D110_personStatus => r#"State of person"#, M::AD110_personAktuell => r#"Actual"#, M::AD110_personAktuell_tt => r#"Person is printed"#, M::AD110_personAlt => r#"Old"#, M::AD110_personAlt_tt => r#"Person is not printed"#, M::AD110_name => r#"S_ite"#, ...
Rust
0
e in your VPC by using another mount target.</p> /// <p>This operation requires permissions for the following action on the file /// system:</p> /// <ul> /// <li> /// <p> /// <code>elasticfilesystem:DeleteMountTarget</code> /// </p> /// </li> /// </ul> /// <note> /// <p>The <code>DeleteMountTarget</code> call returns w...
Rust
0
loop { match dec.get_picture() { Ok(p) => unsafe { let frame_hdr = *p.frame_hdr; println!(" Frame {} {} {}", frame_hdr.frame_id, frame_hdr.show_frame, frame_hdr.showable_frame); }, Err(e) => if e == -(dav1d::EAGAIN as ...
Rust
0
(|&(_, slot)| slot >= current_split_slot) { if slot % store.slots_per_restore_point == 0 { let state: BeaconState<E> = store .hot_db .get_state(&state_root, None)? .ok_or_else(|| HotColdDbError::MissingStateToFreeze(state_ro...
Rust
0
from mistralrs import Runner, Which, ChatCompletionRequest, Architecture runner = Runner( which=Which.Plain( model_id="mistralai/Mistral-7B-Instruct-v0.1", arch=Architecture.Mistral, topology="topologies/isq.yml", ), in_situ_quant="Q4K", ) res = runner.send_chat_completion_request(...
Python
1
fm_subtitle')| remove(var='fm_date') %} <tr> <th class="keygrey">{{ k }}:</th> <th class="valgrey">{{ v }}</th> </tr> {% endfor %} </table> <div class="note-body">{{ note_body }}</div> <script>{{ note_js }}</script> </body> </html> "#; /// HTML template to render the viewer-error page. pub const ...
Rust
0
.as_str() .expect("Error message is not a string"); assert_eq!( message, "GraphQL server error (client error): The \"query\" field missing in request data" ); } #[tokio::test(threaded_scheduler)] async fn posting_valid_queries_yields_result_response()...
Rust
0
rror> { #[derive(Deserialize)] struct MangaListResponse { manga: Vec<Manga>, } let pages = (user.manga_stats.total_entries / 300) + 1; let mut manga_list = Vec::new(); for i in 1..=pages { let res = request.manga_list(&user.username, i)?; let mut res: MangaListResponse...
Rust
0
m) => m }; let worker = match mutex.lock() { Ok(w) => w, Err(_) => { continue; } }; if next_id <= worker.id { next_id = 1 + worker.id; } } let name = format!("{...
Rust
0
from tkinter import ttk from .. import constants as c def apply_dark_theme(window): """ Applies a consistent dark theme to all ttk widgets in the application. This should be called on any Toplevel window that uses ttk widgets. """ window.option_add('*TCombobox*Listbox.background', c.TEXT_INPUT_BG) ...
Python
1
# Copyright (C) 2022-2025 Intel Corporation # LIMITED EDGE SOFTWARE DISTRIBUTION LICENSE import pytest from iai_core.utils.concurrency import TimeoutLock class TestTimeoutLock: def test_timeout_lock(self) -> None: """ Test the TimeoutLock class Steps: 1. Instantiate the lock ...
Python
1
self } fn stream_mut(&mut self) -> &mut Self { self } } use bevy::{ ecs::schedule::ReportExecutionOrderAmbiguities, prelude::*, render::camera::PerspectiveProjection, }; use bevy_4x_camera::{CameraRigBundle, CameraRigFollow, FourXCameraPlugin}; use bevy_mod_picking::{ self, Inte...
Rust
0
y, buf_lhs, buf_rhs, scanlines, w, h, ymin, ); r = (x1 - x2) as f64 * (t - y2 as f64) / (y1 - y2) as f64 + x2 as f64; x0 = x; x1 = (r + 0.5f64).floor() as i32; y1 = y; y0 = y1 } rasterize_...
Rust
0
let mut message = ::capnp::message::Builder::new_default(); let mut task_data = message.init_root::<serialized_data::Builder>(); task_data.set_msg(&signal); serialize_packed::write_message(&mut stream, &message); } } pub fn new_rdd_id(&self) -> usize { ...
Rust
0
_z_avg, p_xy_avg, surface_tension); } // read next frame if !trj_reader.update_with_next(&mut frame) { break } } } /// calc surface tension from box z size and pressure tensor fn eval_surface_tension(box_z: f64, p_zz: f64, p_xy: f64) -> f64 { return box_z / 2.0 * (p_zz - p_xy); } #[...
Rust
0
pub fn sub(_emulator: &mut Emulator, _instruction: u16) -> u32 { 1 } pub fn swi(_emulator: &mut Emulator, _instruction: u16) -> u32 { 1 } pub fn tst(_emulator: &mut Emulator, _instruction: u16) -> u32 { 1 } } use raytracer::camera::Camera; use raytracer::material::{Dielectric...
Rust
0
from customtkinter import * from PIL import Image from tkinter import messagebox app = CTk() app.geometry("600x480") app.resizable(0,0) app.title("Zeddai(Enquiry Chat Library)") app.iconbitmap("logo1.ico") def open_window_2(): username = email_actual.get() password = password_entry.get() if ...
Python
1
ness"] if drive.name == drive_name and is_onedrive: folder = drive.root if folder_path in self.ROOT_PATH else drive.root.get_by_path(folder_path).get().execute_query() yield from self.list_directories_and_files(folder) def get_matching_files(self, globs: List[str], prefi...
Python
1
# Week 1 - Match Case # Objectives: # - Learn match (like switch in other languages) # - Use multiple values in same case # - Compare with if/elif/or approach # --- Example 1: Days --- def is_day(num): match num: case 1: return "Sunday" case 2: return "Monday" case 3...
Python
1
from dotenv import load_dotenv load_dotenv() import os import streamlit as st import google.generativeai as genai from PIL import Image # Configure the Google Generative AI genai.configure(api_key=os.getenv('GOOGLE_API_KEY')) model = genai.GenerativeModel('gemini-1.5-flash') # Retained original model name def get_g...
Python
1
; impl Display for Color { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let Vec3(r, g, b) = self; // gamma-correct for gamma=2.0 let r = r.sqrt(); let g = g.sqrt(); let b = b.sqrt(); write!( f, "{} {} {}", ...
Rust
0
addle._C_ops.meshgrid(combine_8) del combine_8 # builtin.split: (-1x-1xf32, -1x-1xf32) <- ([-1x-1xf32, -1x-1xf32]) ( split_8, split_9, ) = meshgrid_4 del meshgrid_4 # pd_op.reshape: (-1xf32) <- (-1x-1xf32, 1xi64) reshape_24 = paddle._C_op...
Python
1
import sys sys.setrecursionlimit(100000) def f(n): if n<=6: return n else: return 2*n + 3 + f(n-1) print(f(6188)-f(6185))
Python
1
faults to True. Returns: True if the tokens were successfully acquired, False otherwise. """ if not blocking: return self._consume() while not self._consume(): # This code ignores the ASYNC110 warning which is a false positive in this # ca...
Python
1
clients[new_master_id].nick.clone(); let room = &mut server.rooms[room_id]; room.master_id = Some(new_master_id); server.clients[new_master_id].set_is_master(true); if room.protocol_number < 42 { room.name = new_mas...
Rust
0
import os import pprint import pprint import matplotlib.pyplot as plt import numpy as np from scipy.signal import find_peaks # 修改默认颜色的顺序 plt.rcParams['axes.prop_cycle'] = plt.cycler('color', ['#d62728', '#2ca02c', '#ff7f0e', '#1f77b4']) """蓝色 (#1f77b4) 橙色 (#ff7f0e) 绿色 (#2ca02c) 红色 (#d62728) 紫色 (#9467bd) 棕色 (#8c564b) ...
Python
1
rocess_messages(receive_channel, frame); None } )); assert!(window.set_fn_value("cefCreateArrayBuffer", (), |_, _, args, _other_data| { if args.is_empty() { return Some(Err("Undefined buffer size".to_string())); } let coun...
Rust
0
Key pub(crate) unsafe fn _general_authenticate( state: &mut YubiKey, sign_in: *const u8, in_len: usize, out: *mut u8, out_len: *mut usize, algorithm: u8, key: u8, decipher: bool, ) -> Result<(), ErrorKind> { let mut _currentBlock; let mut indata = [0u8; 1024]; let mut dataptr...
Rust
0
"thread_hidefromdebugger", "Creates or hides an existing thread from debuggers", Scores.SUSPICIOUS, [], ["T1562.001"], ["evasion"], ) def _handle_writeprocmem(self, event, process): ioc = {} if len(event.args): try:...
Python
1
let mut writer = aws_smithy_query::QueryWriter::new( &mut out, "DescribeVpcEndpointServiceConfigurations", "2016-11-15", ); #[allow(unused_mut)] let mut scope_3841 = writer.prefix("DryRun"); if let Some(var_3842) = &input.dry_run { scope_3841.boolean(*var_3842); ...
Rust
0
#!/usr/bin/python3 # Utility to inspect packed ulaw samples from sw2packedulaw.c (or dump_data.c) before training import numpy as np import matplotlib.pyplot as plt import sys import ulaw import argparse parser = argparse.ArgumentParser(description='Plot LPCNet training packed ulaw samples') parser.add_argument('fil...
Python
1
else: return False def get_capabilities(self) -> List[str]: """获取适配器能力列表""" return [ "release_management", "code_detection", "automated_testing", "deployment_automation", "verification_checks", "pipeline...
Python
1
} fn main() { let contents = fs::read_to_string("input").expect("Couldn't read file"); let mut decks = Vec::new(); for player in contents.split("\n\n") { let mut deck = VecDeque::new(); for line in player.split("\n").skip(1) { deck.push_back(line.parse().unwrap()); } decks.push...
Rust
0
clocks: &rcc::CoreClocks, ) -> Self { Self::new_unchecked(usb_global, usb_device, usb_pwrclk, prec, clocks) } pub fn new_unchecked( usb_global: stm32::OTG2_HS_GLOBAL, usb_device: stm32::OTG2_HS_DEVICE, usb_pwrclk: stm32::OTG2_HS_PWRCLK, prec: rcc::rec::Usb2Otg,...
Rust
0
import subprocess import os class AIAgentLibrary: def send_docker_ai_agent_prompt_message(self, container_name, prompt_message, first_extension, second_extension): """ Use the 'goose run' command to send a prompt message to a specific Goose AI Agent running in a specific Docker container. ...
Python
1
/ fn _implements_basic() { trait Trait1 {} fn implementsement_trait1( _ : &impl Trait1 ) -> bool { true } impl< T : Sized > Trait1 for &[ T ] {} impl< T : Sized, const N : usize > Trait1 for [ T; N ] {} impl< T : Sized, const N : usize > Trait1 for &[ T; N ] {} let src : &[ i32 ] = &[ 1, 2, 3 ]; assert...
Rust
0
the receiving end (i.e. when decrypting value). The tag value is"] #[doc = " recomputed and compared with the provided tag value. If they match, 1"] #[doc = " is returned; on mismatch, 0 is returned. A returned value of 0 means"] #[doc = " that the data or the tag was altered in transit, normally leading t...
Rust
0
"average steps": total_steps / cnt, "level1_check_result": check_result_1 / cnt, "level2_check_result": check_result_2 / cnt, } print("[passrate]: ", pass_cnt / cnt) print("[level1_check_result]: ", check_result_1 / cnt) print("[level2_check_result]: ",...
Python
1
# Copyright (c) 2007 The Regents of The University of Michigan # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list ...
Python
1
def check_inputs(self, image, height, width): if not isinstance(image, torch.Tensor) and not isinstance(image, PIL. Image.Image) and not isinstance(image, list): raise ValueError( f'`image` has to be of type `torch.Tensor` or `PIL.Image.Image` or `List[PIL.Image.Image]` but is {type(imag...
Python
1
import numpy as np import faiss def faiss_saver(embed_data): # FAISS for info data embed_nor_info = np.array(embed_data[0]) info_dim = embed_nor_info.shape[1] info_index = faiss.IndexFlatIP(info_dim) info_index.add(embed_nor_info) print("Number of vectors in FAISS info_index:", info_index....
Python
1
elif WASHNUM == 1: p300.pick_up_tip(W1_ResusTrans_1) elif WASHNUM == 2: p300.pick_up_tip(W2_ResusTrans_1) p300.aspirate(TransferSup, sample_plate_mag[X].bottom( z=p300_offset_Mag), rate=0.25) p300.dispense( ...
Python
1
# REVER ESSE CÓDIGO E ENTENDER A LÓGICA # SE EU ENTENDER CERTINHO EU POSTO NA PAGE """ Calculadora com while""" while True: num_1 = input('Digite o 1° número: ') num_2 = input('Digite o 2° número: ') operador = input('Escolha um operador (+-/*): ') num_validos = None num_flt_1 = 0 num_flt_2 = 0...
Python
1
# [ doc = r" Reads the contents of the register" ] pub fn read(&self) -> R { R { bits: self.register.read() } } # [ doc = r" Writes to the register" ] pub fn write<F>(&mut self, f: F) where F: FnOnce(&mut W) -> &mut W { let mut w = W::reset_...
Rust
0
use ark_ff::{Field, PrimeField, UniformRand}; use ark_r1cs_std::{ alloc::AllocVar, bits::ToBitsGadget, boolean::Boolean, eq::EqGadget, groups::CurveVar, R1CSVar, }; use ark_relations::{ ns, r1cs::{ConstraintSynthesizer, ConstraintSystemRef, Namespace, SynthesisError}, }; use ark_serialize::{CanonicalDeseri...
Rust
0
# For Keystone Engine. AUTO-GENERATED FILE, DO NOT EDIT [keystone_const.py] KS_API_MAJOR = 0 KS_API_MINOR = 9 KS_ARCH_ARM = 1 KS_ARCH_ARM64 = 2 KS_ARCH_MIPS = 3 KS_ARCH_X86 = 4 KS_ARCH_PPC = 5 KS_ARCH_SPARC = 6 KS_ARCH_SYSTEMZ = 7 KS_ARCH_HEXAGON = 8 KS_ARCH_MAX = 9 KS_MODE_LITTLE_ENDIAN = 0 KS_MODE_BIG_ENDIAN = 107374...
Python
1
import os import json import numpy as np from utils.math_utils import world_to_view, projection_matrix # Y down, Z forward def load_camera(camera_info): """Load camera parameters from camera info dictionary""" # Extract camera parameters camera_id = camera_info["camera_id"] camera_to_world = np.asarra...
Python
1
lf, a: i16) -> Mod_e521_1 { &self - a } } impl Sub<i8> for Mod_e521_1 { type Output = Mod_e521_1; fn sub(self, a: i8) -> Mod_e521_1 { &self - a } } impl<'a, 'b> Sub<&'b Mod_e521_1> for &'a Mod_e521_1 { type Output = Mod_e521_1; fn sub(self, a: &'b Mod_e521_1) -> Mod_e521_1 { ...
Rust
0
get_matches(); // TODO: handle error cases gracefully let server = if args.is_present("no-tls") { println!("Found --no-tls, running in plaintext mode --- ALL TRAFFIC IS UNENCRYPTED"); Server::http(args.value_of("listen").unwrap()).unwrap() } else { let ssl_config = SslConfig { ...
Rust
0
data. """ texts = data_frame.head(n_rows)["text"] return html.Div( [dbc.Card(dcc.Markdown(f"### Card #{i}\n{text}")) for i, text in enumerate(texts, 1)], className="multiple-cards-container", ) custom_figures = vm.Page( title="Custom Figures", components=[vm.Figure(id="my-figu...
Python
1
次重试点击弹窗中的“NO”按钮。 """ global BASE_URL driver.get(BASE_URL) wait = WebDriverWait(driver, 150) try: # 1) 点击页面语言 lang_field = wait.until(EC.visibility_of_element_located((By.ID, 'lang_en'))) lang_field.click() # 2) 填写用户名和密码 username_field = wait.until(EC.visibili...
Python
1
); f += left + right; if player_state.song_has_ended || player_state.has_looped { break; } } } } use crate::prelude::*; use rand::{distributions::Distribution, Rng}; /// A linear transformation of the form `xW + b`, where `W` is a matrix, `x` is a vector ...
Rust
0
"""Provide CORS support for the HTTP component.""" from __future__ import annotations from typing import Final from aiohttp.hdrs import ACCEPT, AUTHORIZATION, CONTENT_TYPE, ORIGIN from aiohttp.web import Application from aiohttp.web_urldispatcher import ( AbstractResource, AbstractRoute, Resource, Res...
Python
1
create_offer(&self, schema: &CredentialSchema) -> Result<CredentialOffer>; /// Create a proof of possession for this issuers signing key async fn create_proof_of_possession(&self) -> Result<CredentialProof>; /// Sign the claims into the credential async fn sign_credential( &self, sche...
Rust
0
_4183); } #[allow(unused_mut)] let mut scope_4184 = writer.prefix("RoleName"); if let Some(var_4185) = &input.role_name { scope_4184.string(var_4185); } #[allow(unused_mut)] let mut scope_4186 = writer.prefix("TagSpecification"); if let Some(var_4187) = &input.tag_specifications ...
Rust
0
from turtle import * speed('slowest') pensize(2) shape('turtle') setup(500,500) bgcolor('#E6E6E6') pencolor('#174163') fillcolor('#306998') up() lt(121.83) fd(170.66) down() begin_fill() rt(31.83) fd(51) rt(11.76) circle(-36.87,70.3) lt(4.13) circle(-271.31,25.12) rt(12.3) circle(-60.97,39.31) rt(25.35) fd(92) lt(9....
Python
1
ect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeFixed64>( "steamid", |m: &CBroadcast_GetBroadcastViewerStats_Request| { &m.steamid }, |m: &mut CBroadcast_GetBroadcastViewerStats_Request| { &mut m.steamid }, )); ::protobuf::r...
Rust
0
import pandas as pd import numpy as np import time from scipy.io import arff from sklearn.preprocessing import StandardScaler from sklearn.metrics import accuracy_score, roc_auc_score from pyod.models.iforest import IForest # Start measuring runtime start_time = time.time() # Load ARFF data #data, meta = arff.loadarf...
Python
1
Enable"] #[inline(always)] pub fn ovf(&mut self) -> OVF_W { OVF_W { w: self } } } <reponame>ushkarev/rusty-kms use std::fmt::{Debug, Formatter, Result as FormatResult}; use std::str; use crate::key_store::errors::*; use crate::key_store::crypto::MIN_ENCRYPTED_DATA_LEN; const WRAPPING_VERSION: u8 ...
Rust
0
차원 공간에서의 직교 기저. # 이 기저를 사용하여 sphere_vec_projected_np_normalized를 3D 좌표로 변환. coords_for_plot_3d = sphere_vec_projected_np_normalized @ final_M_stiefel.cpu().numpy() # (l, p) @ (p, 3) -> (l, 3) coords_for_plot_3d /= (np.linalg.norm(coords_for_plot_3d, axis=1, keepdims=True)...
Python
1
_SAM if id == 6 => { // CIGAR let mut len = 0; let mut op_len = 0; for c in p_curr.iter() { match *c { x if x >= b'0' && x <= b'9' => op_len = (op_len * 10) + ((x - b'0') as HtsPos), ...
Rust
0
LayoutMethods<'a, C> + Copy, C: LayoutOf<Ty = Ty, TyAndLayout = TyAndLayout<'a, Ty>> + HasDataLayout, { arg.extend_integer_width_to(32); if arg.layout.is_aggregate() { if !unwrap_trivial_aggregate(cx, arg) { arg.make_indirect_byval(); } } } pub fn compute_abi_info<'a, Ty, C>...
Rust
0
workaround for // https://github.com/rust-lang/rust/issues/62184. #![cfg_attr(not(doc), no_main)] #![deny(missing_docs)] use kernel::capabilities; use kernel::common::dynamic_deferred_call::DynamicDeferredCall; use kernel::common::dynamic_deferred_call::DynamicDeferredCallClientState; use kernel::component::Component...
Rust
0
er::new() .delimiter(b'\t') .has_headers(false) .flexible(true) .from_path("data/jyutping_rime.tsv") .unwrap(); let mut char_to_jyutping: IndexMap<char, Prs> = IndexMap::new(); let trad_to_simp = get_script_conversion_from(Script::Traditional); for result in reader.records() { let record = result.expect(...
Rust
0
class Solution: def maximumTripletValue(self, nums: List[int]) -> int: n = len(nums) left_max = [0] * n for i in range(1, n): left_max[i] = max(left_max[i - 1], nums[i-1]) right_max = [0] * n for i in range(n - 2, -1, -1): right_max[i] = max(right_max...
Python
1
"""empty message Revision ID: e58337a85935 Revises: ef749dd030b3 Create Date: 2024-07-12 15:20:56.572862 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = 'e58337a85935' down_revision = 'ef749dd030b3' branch_labels = None depe...
Python
1
class Solution: def mergeArrays(self, nums1: List[List[int]], nums2: List[List[int]]) -> List[List[int]]: p1, p2 = 0, 0 res = [] while p1 < len(nums1) and p2 < len(nums2): if nums1[p1][0] == nums2[p2][0]: res.append([nums1[p1][0], nums1[p1][1] + nums2[p2][1]]) ...
Python
1
header: HEADER, payload: RPCPayload::FindNode(HEADER.node_id), }; const FIND_NODE_REQ_BYTES: [u8; 41] = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 2, 3, 4, 5, 6, 7, 8, 3, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, ]; fn find_node_resp_msg() -> Messa...
Rust
0
tree = self.stack.pop(); if let Some(node) = tree.map(|t| &t.node) { match node { MeshBuilderOctreeNode::Subtree(trees) => { for tree in trees.iter() { self.stack.push(tree); } } MeshBuilderOctreeNode::Leaf(leaves) => { for l...
Rust
0
from fastapi import APIRouter, Depends, HTTPException, Query from sqlalchemy.orm import Session from typing import List from backend.models.database import Owner, get_db_session from backend.models.schemas import Owner as OwnerSchema, OwnerCreate, OwnerUpdate router = APIRouter( prefix="/api/owners", tags=["o...
Python
1
from functools import wraps from rest_framework.response import Response from rest_framework import status def check_ban_status(view_func): @wraps(view_func) def _wrapped_view(request, *args, **kwargs): # Assuming the request.user is authenticated if request.user.is_authenticated: p...
Python
1
DA, 4 => PnatMask::PNAT_SPORT, 8 => PnatMask::PNAT_DPORT, 16 => PnatMask::PNAT_COPY_BYTE, 32 => PnatMask::PNAT_CLEAR_BYTE, _ => panic!("Invalid Enum Descriminant") } } fn size_of_enum_flag() -> u32{ 32 as u32 } } #[derive(Debug, Clone, Serialize_repr, Deserialize_repr)] #[repr(u32)] ...
Rust
0
ar sistema integrado system = IntegratedSystem() try: success = system.start_complete_system() if success: logger.info("🎉 Sistema integrado executado com sucesso!") else: logger.error("❌ Falha na execução do sistema integrado") exce...
Python
1
)0:0 let (_, new_queue) = $recv_func(s.stack); let s = $sessionmpst_name { #( session#N:0: new_session_#N:0, )0:0 stack: new_queue, name: s.name, }; m...
Rust
0
.apache.org/licenses/LICENSE-2.0>, // at your option. This file may not be copied, modified, or distributed // except according to those terms. use crate::field_tag::FieldTag; use crate::field_type::FieldType; use crate::fix_version::FIXVersion; use crate::message_version::MessageVersion; use crate::rule::Rule; pub t...
Rust
0
#!/usr/bin/env python3 # version and about message management # NOTE: this module is meant to be used on all platforms, it is not SCons centric # version: # input: # include/version.default # output: # include/version.h include/RADIANT_MAJOR include/RADIANT_MINOR # the header is used by C/C++ code, the straight ...
Python
1
='floor') type_idx = p_argmax % y_cls.size(1) pos_refined.append(pos_query[pos_idx].view(1, 3)) y_cls_refined.append(y_cls[pos_idx].view(1, -1)) y_ind_refined.append(y_ind[pos_idx].view(1, -1)) type_refined.append(type_idx.view(1)) ...
Python
1
any(unix, target_os = "redox"))] use std::os::unix::fs::MetadataExt; /// Get the UNIX-style mode bits from some metadata if available, otherwise 0. #[allow(unused_variables)] pub fn mode(md: &fs::Metadata) -> u32 { #[cfg(any(unix, target_os = "redox"))] return md.mode(); #[cfg(not(any(unix, target_os = "r...
Rust
0
#exercicio 1 nome1 = input("digite o nome : ") nome2 = input("digite o sobrenome: ") print(f" nome -> {nome1}. sobrenome -> {nome2}.") #exercicio 2 texto = input("digite um testo--> ") texto_invertido = texto[::-1] print(texto_invertido) #exercicio 3 palavra = input("digite uma palavra para verificar se é polidromo:...
Python
1
freq not in fos_count: fos_count[freq]=1 else: fos_count[freq]=fos_count[freq]+1 elif freq!=0 and freq!=fos: ouc=ouc+1 ...
Python
1
_matches::assert_matches; use nickel_lang::error::{Error, EvalError, TypecheckError}; use nickel_lang::term::Term; use nickel_lang_utilities::eval_file; #[test] fn simple() { assert_eq!(eval_file("destructuring/simple.ncl"), Ok(Term::Bool(true))); } #[test] fn assign() { assert_eq!(eval_file("destructuring/a...
Rust
0
Returns /// SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, SQL_NO_DATA, or SQL_INVALID_HANDLE. #[inline] #[must_use] #[allow(non_snake_case)] fn SQLGetDescRecW<ST: SqlType<V>>( &self, RecNumber: SQLSMALLINT, Name: Option<&mut OdbcStr<MaybeUninit<SQLWCHAR>>>, StringLe...
Rust
0