text
string
label_name
string
labels
int64
ink_dir<P: AsRef<str>, Q: AsRef<str>>(&self, src: P, dst: Q) -> io::Result<()> { let src = from_utf8(src)?; let dst = from_utf8(dst)?; symlink_dir(&src, &self.as_file_view(), &dst) } #[inline] fn open_dir_nofollow<P: AsRef<str>>(&self, path: P) -> io::Result<Self> { match op...
Rust
0
: Opt) { if args.version { self.version = true; } if args.doctor { self.doctor = true; } if args.export_config { self.export_config = true; } if args.current_shell { self.current_shell = true; } i...
Rust
0
unsafe fn Clear(mask: GLbitfield); /// glClearBufferData /// * `target` group: BufferStorageTarget /// * `internalformat` group: InternalFormat /// * `format` group: PixelFormat /// * `type` group: PixelType /// * `data` len: COMPSIZE(format,type) unsafe fn ClearBufferData(target: BufferStorageTarget, ...
Rust
0
"key": "$current_url", "operator": "exact", "value": ["https://hedgebox.net/files/"], }, { "typ...
Python
1
last_obstruction: -1, target_diameter: [0.0; Tract::N], }; res.shape_noise(true); res.tract.calculate_nose_reflections(); // (nose reflections are calculated only once, but with open velum) res.shape_noise(false); res.shape_main_tract(); res }...
Rust
0
, pub angular_momentum: V3, pub inv_tensor_massless: M3x3, pub inv_tensor: M3x3, pub radius: f32, pub bounds: (V3, V3), pub next_pose: Pose, pub old_pose: Pose, pub start_pose: Pose, pub damping: f32, pub gravity_scale: f32, pub friction: f32, pub old_state: (Pose, ...
Rust
0
phper::errors::Throwable`. /// /// # Examples /// /// ```no_test /// #[derive(thiserror::Error, crate::Throwable, Debug)] /// #[throwable(class = "Exception")] /// pub enum Error { /// #[error(transparent)] /// Io(#[from] std::io::Error), /// /// #[error(transparent)] /// #[throwable(transparent)] /// ...
Rust
0
# 8 Max Area Rectangle in binary matrix # https://practice.geeksforgeeks.org/problems/max-rectangle/1# (TLE) mat = [[0, 1, 1, 0], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 0, 0]] def mah(arr): # Left traversal stack = [] left = [] for i in range(len(arr)): if(len(stack) == 0): left.appe...
Python
1
_event_mask(mask: u32) -> esp_err_t; } extern "C" { #[doc = " @brief Get mask of WiFi events"] #[doc = ""] #[doc = " @param mask WiFi event mask."] #[doc = ""] #[doc = " @return"] #[doc = " - ESP_OK: succeed"] #[doc = " - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_w...
Rust
0
import ctypes import glew import sys try: # For OpenGL-ctypes from OpenGL import platform gl = platform.OpenGL except (ImportError, AttributeError): try: # For PyOpenGL gl = ctypes.cdll.LoadLibrary('libGL.so') except OSError: # Load for Mac from ctypes.util import find_l...
Python
1
class QueryBus: def __init__(self): self.handlers = {} # A dictionary to store query types and their handlers def register_handler(self, query_type, handler): """ Registers a handler for a specific query type. :param query_type: The type of the query (e.g., CheckVoterExistsQue...
Python
1
Result<Option<TransparentAddress>, Bs58Error> { bs58::decode(s).with_check(None).into_vec().map(|decoded| { if decoded.starts_with(pubkey_version) { decoded[pubkey_version.len()..] .try_into() .ok() .map(TransparentAddress::PublicKey) } els...
Rust
0
arget = filtered_dates[0] next_gw = target[1] except: target = None active_gw = -1 next_gw = 1 if active_gw != -1: for i in filtered_dates: if f"GW{active_gw}" == i[1]: target = i print(f"Active GW {active_gw}") list_da...
Python
1
# -*- coding: utf-8 -*- import os, re from typing import Dict, Any, Optional from .llm import call_llm_two_stage from .llm import call_llm_bilingual_summary KNOWN_DATASETS = [ "COCO","LVIS","ADE20K","Cityscapes","ScanNet","ImageNet","OpenImages", "Pascal VOC","NYUv2","KITTI","GQA","VQAv2","RefCOCO","RefCOCO+",...
Python
1
gl_window: &glutin::WindowedContext<glutin::PossiblyCurrent>, pixels_per_point: f32, cipped_meshes: Vec<egui::ClippedMesh>, egui_texture: &egui::Texture, ) { self.upload_egui_texture(egui_texture); self.upload_pending_user_textures(); let (w, h) = unsafe { se...
Rust
0
mut sym) => { *sym = symbol_stack.symbol(sym.clone())?; } // For all other expressions, call uniquify_helper on the children. _ => { for child in expr.children_mut() { uniquify_helper(child, symbol_stack)?; } } } Ok(()) } use s...
Rust
0
-opencv # cv2.imshow(window_name, image) # cv2.waitKey() # cv2.destroyWindow(window_name) return def check_inv(letter): if letter == '‘' or letter == '’' or letter == "'": return True else: return False def check_dinv(letter): if letter == '“' or letter == ...
Python
1
from logic import * AKnight = Symbol("A is a Knight") AKnave = Symbol("A is a Knave") BKnight = Symbol("B is a Knight") BKnave = Symbol("B is a Knave") CKnight = Symbol("C is a Knight") CKnave = Symbol("C is a Knave") # Puzzle 0 # A says "I am both a knight and a knave." knowledge0 = And( Or(A_knight, A_knave),...
Python
1
>(raft: &mut Raft<S>) -> Vec<Message> { let msg = raft.msgs.clone(); raft.msgs.clear(); msg } pub struct MocksEnts(Entry); impl Into<Entry> for MocksEnts { fn into(self) -> Entry { self.0 } } impl Into<RepeatedField<Entry>> for MocksEnts { fn into(self) -> RepeatedField<Entry> { ...
Rust
0
r::from_str("a"); // Initial state assert_eq!(cursor.current(), EOF_CHAR); assert_eq!(cursor.offset(), 0); cursor.bump(); assert_eq!(cursor.current(), 'a'); assert_eq!(cursor.offset(), 0); cursor.bump(); assert_eq!(cursor.current(), EOF_CHAR); asse...
Rust
0
#!/usr/bin/env python # SPDX-FileCopyrightText: (C) 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 """ sort_charts.py combines artifact and manifest information into datastructure that can be used to determine which charts to build """ import sys import ruamel.yaml from ba_lib import load_yaml, load_r...
Python
1
}); resource_manager.add_bind_group_layout("equirectangular_globals", global_bind_group_layout); let global_bind_group_layout = resource_manager .get_bind_group_layout("equirectangular_globals") .unwrap(); vec![global_bind_group_layout] } fn rasterization_state_d...
Rust
0
ram": {"binary": "a"}}), extra_schemas = &[(&BLOCK_SHELL_FEATURE_SCHEMA, None)], result = Ok(()), }, test_validate_extra_schemas_empty_features => { input = json!({"sandbox": {"features": []}, "program": {"binary": "a"}}), extra_schemas = &[(&BLOCK_SHELL_F...
Rust
0
nownError('less_than', {'lt': lt}) return x def less_than_or_equal_validator(x: Any, le: Any) -> Any: if not (x <= le): raise PydanticKnownError('less_than_equal', {'le': le}) return x def multiple_of_validator(x: Any, multiple_of: Any) -> Any: if not (x % multiple_of == 0): raise Py...
Python
1
import os import sys # Add the current directory to sys.path to ensure modules can be found current_dir = os.path.dirname(os.path.abspath(__file__)) if current_dir not in sys.path: sys.path.append(current_dir) # Import node classes from .nodes.artistic_text_node import ArtisticTextNode from .nodes.preview_node im...
Python
1
String> { if proc.is_none() { return Ok(mmb::State::Unknown); } match proc.as_mut().unwrap().try_wait() { Ok(exit) => { match exit { Some(status) => { if status.success() { return Ok(mmb::State::Finished); ...
Rust
0
ddPixmap(QtGui.QPixmap("./designer/record-vinyl-solid.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.ui.pushButton_9.setIcon(icon) self.rec.stop() self.save_recording() def save_recording(self): save_path, _ = QFileDialog.getSaveFileName(self, "Save as..?", "", "WAV F...
Python
1
from uaclient.api import exceptions from uaclient.api.api import APIEndpoint from uaclient.api.data_types import AdditionalInfo from uaclient.config import UAConfig from uaclient.contract import UAContractClient from uaclient.data_types import DataObject, Field, StringDataValue class MagicAttachRevokeOptions(DataObje...
Python
1
#https://twgo.io/xpuka #測試影片:https://twgo.io/vlpwc #tw live可搜尋台灣即時影像:https://trafficvideo2.tainan.gov.tw/b596d902 from ultralytics import YOLO import cv2,time #設定視窗名稱及型態 cv2.namedWindow('YOLOv8', cv2.WINDOW_NORMAL) #cv2.WINDOW_NORMAL可以讓視窗放大縮小 # target=1 target='city.mp4' # target='https://trafficvideo.tainan.gov.tw/e...
Python
1
/system_control.rs #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Secure Debug Configuration Status"] pub secdbgstat: SECDBGSTAT, #[doc = "0x04 - Secure Debug Configuration Set"] pub secdbgset: SECDBGSET, #[doc = "0x08 - Secure Debug Configuration Clear"] pub se...
Rust
0
(events_error) module"] pub type EVENTS_ERROR = crate::Reg<u32, _EVENTS_ERROR>; #[allow(missing_docs)] #[doc(hidden)] pub struct _EVENTS_ERROR; #[doc = "`read()` method returns [events_error::R](events_error::R) reader structure"] impl crate::Readable for EVENTS_ERROR {} #[doc = "`write(|w| ..)` method takes [events_er...
Rust
0
in SYMBOLS: market_data = await self.data_manager.fetch_market_data(symbol, "H1", 1) if market_data: current_prices[symbol] = market_data[-1].close self.risk_manager.update_positions(current_prices) # Tạo tín hiệu mới...
Python
1
builder = SslAcceptor::mozilla_modern_v5(SslMethod::tls_server())?; set_context_options(&mut builder, cert, private_key)?; Ok(builder.build()) } /// Creates a TLS acceptor for a client. /// /// A connector compatible with the acceptor created using `create_tls_acceptor`. Server /// certificates must always b...
Rust
0
rvisor::decentralized()) .with(JustFactory::new(IncService)) .build() } fn testkit_with_inc_service_and_n_validators(n: u16) -> TestKit { TestKitBuilder::validator() .with_logger() .with(Supervisor::decentralized()) .with(JustFactory::new(IncService)) .with_validator...
Rust
0
) ).try(RETRY_COUNT_WAIT_JOB).wait(RETRY_FIXED_INTERVAL_MILLI).execute() { Ok(Ok(JobStatus::Success)) => (), Ok(Ok(status)) => { log!(error_log, "issue_query: Unexpected status. job_id={:?}, status={:?}", job_id, status); ...
Rust
0
64, (input_overhead_secs / total_secs as f64) * 100 as f64); let execution_secs: f64 = total_secs as f64 - filter_overhead_secs - input_overhead_secs; println!("Net execution time of the protocol: {}s ({:.2}%)", execution_secs as i64, (execution_secs / total_s...
Rust
0
fo { pub s_type: RawVkStructureType, pub next: *mut c_void, pub subpass_count: u32, pub view_masks: *mut u32, pub dependency_count: u32, pub view_offsets: *mut i32, pub correlation_mask_count: u32, pub correlation_masks: *mut u32, } impl VkWrappedType<RawVkRenderPassMultiviewCreateInfo>...
Rust
0
::Metadata) -> Result<String, Error> { let bank = meta.bank(None); Ok(format!("{:#x}", bank.evm_chain_id)) } fn chain_id(&self, meta: Self::Metadata) -> Result<Hex<u64>, Error> { let bank = meta.bank(None); Ok(Hex(bank.evm_chain_id)) } // TODO: Add network info fn i...
Rust
0
# check the IDLE settings configuration (but command line overrides) edit_start = idleConf.GetOption('main', 'General', 'editor-on-startup', type='bool') enable_edit = enable_edit or edit_start # start editor and/or shell windows: root = Tk(className="Idle") f...
Python
1
tructor after // evaluating an expression with `rustc_mir::build::Builder::into`. a.alloc_leaked(exceptions) } } fn panic_after_return_expr(a: &Allocator) -> Ptr<'_> { // Panic in the drop of `p` or `q` can leak let exceptions = vec![8, 9]; a.alloc(); let p = a.alloc(); { ...
Rust
0
MAX); if bytes > __bf_max_value { return ::core::result::Result::Err(::modular_bitfield::error::InvalidBitPattern::new(bytes)) } let __bf_bytes = bytes.to_le_bytes(); ::core::result::Result::Ok(Self { ...
Rust
0
::Clone, std::cmp::PartialEq)] pub struct DescribeChapCredentialsInput { /// <p>The Amazon Resource Name (ARN) of the iSCSI volume target. Use the <a>DescribeStorediSCSIVolumes</a> operation to return to retrieve the TargetARN for /// specified VolumeARN.</p> pub target_arn: std::option::Option<std::string:...
Rust
0
use proc_macro2::{TokenStream, Span};<gh_stars>0 use druid::{Widget, EventCtx, LifeCycle, PaintCtx, LifeCycleCtx, BoxConstraints, Size, LayoutCtx, Event, Env, UpdateCtx, Point, Rect, Color, Affine, MouseEvent, TextLayout, Selector, Target, KbKey}; use druid::RenderContext; use druid::widget::{SvgData, Label}; use druid...
Rust
0
::battlefield::*; use rand; // lazy_static is awesome. // It basically defines a "static variable" that can contain function calls, // which is initialized at runtime upon the first time it is dereferenced. // Will probably be made obsolete by const fn, but currently that's still in // nightly. lazy_static! { s...
Rust
0
from contextlib import asynccontextmanager from dataclasses import dataclass from typing import AsyncIterator, TYPE_CHECKING from loguru import logger from werkzeug.local import LocalStack, LocalProxy from port_ocean.exceptions.context import ( ResourceContextNotFoundError, ) if TYPE_CHECKING: pass @datacl...
Python
1
{ y0: 0.0, y1: 555.0, z0: 0.0, z1: 555.0, k: 555.0, material: Arc::new(green), })); self.world.push(Box::new(YzRect { y0: 0.0, y1: 555.0, z0: 0.0, z1: 555.0, k: 0.0, ...
Rust
0
m_str_radix(&s[..3], 8) { return Some((num as char, 3)); } } if s.len() >= 2 { if let Ok(num) = u8::from_str_radix(&s[..2], 8) { return Some((num as char, 2)); } } if s.len() >= 1 { if let Ok(num) = u8::from_str_radix(&s[..1], 8) { retu...
Rust
0
clip_min_y = pixels_per_point * clip_rect.min.y; let clip_max_x = pixels_per_point * clip_rect.max.x; let clip_max_y = pixels_per_point * clip_rect.max.y; // Make sure clip rect can fit withing an `u32`: let clip_min_x = clip_min_x.clamp(0.0, width_in_pixels as f32); ...
Rust
0
no_batch_dims > 2: return x.reshape(*((x.shape[0], -1) + x.shape[-3:])) return x # [*, H, Q/K, C_hidden] -> [*, Q/K, H, C_hidden] q = q.transpose(-2, -3) k = k.transpose(-2, -3) v = v.transpose(-2, -3) # Reshape tensors to match expected input shape [B, N, Q/K, H, C_hidden] ...
Python
1
# Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import os import io import tarfile import nbformat def _jupyter_bundlerextension_paths(): """Metadata for notebook bundlerextension""" return [{ # unique bundler name "name": "tarball_bundler", ...
Python
1
from .auto_augment import RandAugment, AutoAugment, rand_augment_ops, auto_augment_policy,\ rand_augment_transform, auto_augment_transform from .config import resolve_data_config from .constants import * from .dataset import ImageDataset, IterableImageDataset, AugMixDataset from .dataset_factory import create_datas...
Python
1
intext:\"git\"", "site:{domain} inurl:\".git/config\"", "site:{domain} inurl:\".git/HEAD\"", "site:{domain} intext:\"Index of /.git\"", "site:{domain} inurl:\"/.git/objects/\"", "site:{domain} filename:.gitignore" ] LOG_DORKS = [ "site:{domain} ext:log", "site:{domain} filetype:log intext:\...
Python
1
import random import cv2 import numpy as np import math import torch def random_perspective( img, degrees=10, translate=0.1, scale=0.1, shear=10, perspective=0.0, border=(0, 0) ): height = img.shape[0] + border[0] * 2 # shape(h,w,c) width = img.shape[1] + border[1] * 2 # Center C = np.eye(3) ...
Python
1
import requests def fetch_batches(api_key): """Fetches all batches from the API and returns them as a list.""" url = "https://api.openai.com/v1/batches" headers = {"Authorization": f"Bearer {api_key}"} response = requests.get(url, headers=headers) if response.status_code == 200: return resp...
Python
1
_character_data.cid != 0 and tem_character.TextColor != new_character_data.text_color: # print(f"debug value.name = {value.name},tem_character.TextColor = {tem_character.TextColor},value.text_color = {value.text_color}") new_character_data.text_color = tem_character.TextColor text_co...
Python
1
), Name::MainlyFine => format!( "{}", match lang { Lang::EN => "Mainly Fine ( use only in night-time )", Lang::TC => "天色大致良好(只在晚間使用)", Lang::SC => "天色大致良好(只在晚间使用)", }, ), ...
Rust
0
ldId = GuildId(277469642908237826); // Channel IDs pub const GENERAL_CHANNEL: ChannelId = ChannelId(277469642908237826); pub const YOUTUBE_REQUEST_CHANNEL: ChannelId = ChannelId(732257710283685948); pub const OSUVS_CHANNEL: ChannelId = ChannelId(748683685204721729); pub const APPROVE_CHANNEL: ChannelId = ChannelId(438...
Rust
0
height == 0 { return Err(Error::last_os_error()); } Ok((width, height)) } fn send_input(inputs: &[INPUT]) -> Result<()> { let sent = unsafe { SendInput(inputs, mem::size_of::<INPUT>() as _) }; if sent == inputs.len() as u32 { Ok(()) } else { Err(Error::last_os...
Rust
0
register = (instruction >> 6) & 0x07; println!("JSRR R{}", base_register); } else { let offset = sign_extend(instruction & 0x07FF, 11); println!("JSR 0x{:X}", pc + offset); } } fn and(instruction: u16) { let dr = get_dr(instruction); let sr1 = (instruction & 0b0001_1100_0000) >>...
Rust
0
x45, 0x45, 0x45, // E 0x43, 0x44, 0x43, 0x44, 0x43, 0x46, // D 0x43, 0x46, // C // F 0x4d, 0x4a, // M // J 0x4d, 0x4a, // K 0x4d, 0x4b, 0x4d, 0x4b, 0x4f, 0x4f, 0x4f, 0x4f, // O 0x50, 0x50, 0x50, 0x50, // P 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Disabled 0x31, 0x0d, 0x1b, // 1, VK_RETUR...
Rust
0
const Button4MotionMask: libc::c_long = (1<<11); pub const Button5MotionMask: libc::c_long = (1<<12); pub const ButtonMotionMask: libc::c_long = (1<<13); pub const KeymapStateMask: libc::c_long = (1<<14); pub const ExposureMask: libc::c_long = (1<<15); pub const VisibilityChangeMask: libc::c_long = (1<<16); pub const S...
Rust
0
''' Python script for: Input Validation Date: 05JAN2024 By: Shahanawaz Shaikh ''' # Example of validating Input try: # Attempt to convert user input to an integer user_input = input("Enter an integer: ") user_input_int = int(user_input) #If conversion fails, it moves to except # Print the result p...
Python
1
truct lv_chart_ext_t { pub series_ll: lv_ll_t, pub ymin: lv_coord_t, pub ymax: lv_coord_t, pub hdiv_cnt: u8, pub vdiv_cnt: u8, pub point_cnt: u16, pub type_: lv_chart_type_t, pub y_axis: lv_chart_axis_cfg_t, pub x_axis: lv_chart_axis_cfg_t, pub secondary_y_axis: lv_chart_axis_cfg...
Rust
0
Response { Res::from(SRV.gen_table_column.delete(req).await) } #[handler] pub async fn delete_batch(Json(ids): Json<Vec<i64>>) -> impl IntoResponse { Res::from(SRV.gen_table_column.delete_batch(&ids).await) } <gh_stars>0 // Copyright 2022 The Engula Authors. // // Licensed under the Apache License, Version 2.0...
Rust
0
s.overall.onbase.d, triples: s.overall.onbase.t, home_runs: s.overall.onbase.hr, runs_batted_in: s.overall.rbi, sacrifice_hits: s.overall.outs.sachit, stolen_bases: s.overall.steal.stolen, caught_stealing: s.overall.steal.c...
Rust
0
let i = i as u32; self.shadow_maps .render(i..(i + 1), encoder, instances, meshes, anim_meshes, skins); } }; self.lights.reset_changed(); } } #[allow(dead_code)] pub struct ShadowMapArray { pub map: wgpu::Texture, pub view: wg...
Rust
0
o.name = self.TYPE_TO_ITEM[t] o.char = o.name[-1] self.items.append(self.place_object(o)) class RockPaperScissorsDev(RockPaperScissors): split_index = 1 class RockPaperScissorsMed(RockPaperScissors): @classmethod def compute_labels(cls, limit=20): all_labels...
Python
1
import requests def request(url, output_file): try: response = requests.get("https://" + url) if response.status_code == 200: print("[+] subdomain discovered ----> " + url) output_file.write(url + "\n") except requests.RequestException: pass def main(): tc =...
Python
1
output_file: Annotated[ str | None, typer.Option("--output-file", "-o", help="Output file path for the downloaded data") ] = None, url: Annotated[ str, typer.Option("--url", help="URL to download the squirrel data from") ] = "https://www.dropbox.com/scl/fi/is2yaa5gz1of32xo1xwvd/squirrel-data...
Python
1
use bevy_retrograde::prelude::{ ui::raui::prelude::{Prefab, PropsData}, *, }; use super::*; /// Add all assets and their loaders to the Bevy app pub fn add_assets(app: &mut AppBuilder) { app.add_asset::<GameInfo>() .add_asset_loader(GameInfoLoader::default()) .add_asset::<Character>() ...
Rust
0
"""Convenient parallelization of higher order functions. This module provides two helper functions, with appropriate fallbacks on Python 2 and on systems lacking support for synchronization mechanisms: - map_multiprocess - map_multithread These helpers work like Python 3's map, with two differences: - They don't gu...
Python
1
"""ComfyUI node pack for string manipulation and utilities - V3 Schema.""" from comfy_api.latest import ComfyExtension, io # Import node classes from individual files from .concat_string import ConcatString from .filter_string import FilterString from .yellow_bus import YellowBus from .zoom_out_composer import ZoomOu...
Python
1
点采样间隔的扰动范围 mids = .5 * (z_vals[..., 1:] + z_vals[..., :-1]) # 计算每两个采样点之间的中点距离起始点的距离 upper = torch.cat([mids, z_vals[..., -1:]], -1) # 计算每个采样点采样间隔的上限 lower = torch.cat([z_vals[..., :1], mids], -1) # 计算每个采样点采样间隔的下限 # stratified samples in those intervals t_rand ...
Python
1
command = input() counter = 0 resources = {} while command != "stop": counter += 1 if counter % 2 != 0: resource = command if resource not in resources: resources[resource] = 0 else: quantity = int(command) resources[resource] += quantity command = input()...
Python
1
2, img.height() as i32, 0, gl::RGB, gl::UNSIGNED_BYTE, &data[0] as *const u8 as *const c_void, ); gl::GenerateMipmap(gl::TEXTURE_2D); return texture; } <reponame>yiffOS/bulge pub struct RemotePackage { pub name: String, pub version: String, pub epoch: i32...
Rust
0
ExtBuilder::default() // .initialize_enabled_trading_pairs() // .build() // .execute_with(|| { // System::set_block_number(1); // assert_ok!(DexModule::add_liquidity( // Origin::signed(ALICE), // SETUSD, // DNAR, // 500_000_000_000_000, // 100_000_000_000_000, // 0, // )); // ...
Rust
0
derive(Debug, Clone, PartialEq, Eq)] pub struct BuildInfo { /// Version of the [`coprocessor_plugin_api`](crate) crate that was used to compile this plugin. pub api_version: &'static str, /// Target triple for which platform this plugin was compiled. pub target: &'static str, /// Version of the Rust...
Rust
0
let y: &mut &mut i32 = field2; assert_eq!(**y, 4); } EnumProj::None => {} } if let EnumProj::Variant2 { field1, field2 } = e { let x: Pin<&mut i32> = field1; assert_eq!(*x, 3); let y: &mut i32 = field2; assert_eq!(*y, 4); } } #[test] fn enum_...
Rust
0
import time from xdalgorithm.toolbox.reinvent.scoring.score_summary import FinalSummary from xdalgorithm.toolbox.reinvent.utils import fraction_valid_smiles class ConsoleMessage: def create(self, start_time, n_steps, step, smiles, mean_score, score_summary: FinalSummary, score, age...
Python
1
assert!(res.is_zero()); } #[test] fn test_peppinger_bn254() { use crate::representation::ElementRepr; use rand::{RngCore, SeedableRng}; use rand_xorshift::XorShiftRng; let rng = &mut XorShiftRng::from_seed([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); ...
Rust
0
', b'T', b'K', b'T', b'L', b'T', b'M', b'T', b'N', b'T', b'O', b'T', b'P', b'T', b'Q', b'T', b'R', b'T', b'S', b'T', b'T', b'T', b'U', b'T', b'V', b'T', b'W', b'U', b'0', b'U', b'1', b'U', b'2', b'U', b'3', b'U', b'4', b'U', b'5', b'U', b'6', b'U', b'7', b'U', b'8', b'U', b'9', b'U', b'A', b'U', b'B', b'U',...
Rust
0
cube map images.') parser.add_argument('--output-path', type=str, required=True, help='Output directory for the panorama images.') parser.add_argument('--width', type=int, default=2000, help='Width of the output panorama.') parser.add_argument('--height', type=int, default=1000, help='Height of the output ...
Python
1
from socket import AF_INET, socket, SOCK_STREAM,gethostbyname,gethostname from threading import Thread from Crypto.Cipher import AES clients = {} addresses = {} HOST = gethostbyname(gethostname()) #To find ip of my lan network. CLI command : ifconfig print "The Server Computer IP is :",HOST PORT = 5000 BUFSIZ = 1024 A...
Python
1
# Generated by Django 5.0.6 on 2024-07-01 07:19 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Product', fields=[ ('productId', models.Aut...
Python
1
/#read--modify--write-api).\n\nFor information about available fields see [ep12_out_buffer_control](ep12_out_buffer_control) module"] pub type EP12_OUT_BUFFER_CONTROL = crate::Reg<u32, _EP12_OUT_BUFFER_CONTROL>; #[allow(missing_docs)] #[doc(hidden)] pub struct _EP12_OUT_BUFFER_CONTROL; #[doc = "`read()` method returns ...
Rust
0
m) = iter.next().unwrap(); assert_eq!(id, 0); let (id, _item) = iter.next().unwrap(); assert_eq!(id, 4); let last = list.last().unwrap(); let list = last.in_list(); assert_eq!(list.len(), 0); for _item in list.iter(){ println!("nai "); } ...
Rust
0
set_a = {"col", "mex", "bol"} set_b = {"pe", "bol"} print("-" * 10, "Union", "-" * 10) # Union print(set_a, "Union or |", set_b) set_c = set_a.union(set_b) print("Use Union in set a and set b---", set_c) set_c = set_a | set_b print('Use "|" (Union) in set a and set b---', set_c) print("-" * 10, "Intersection", "-" * ...
Python
1
import random story_templates = [ """ Once upon a time in a {adjective} land, there lived a {noun1} named {name}. {name} loved to {verb1} every day. One day, a {adjective2} {noun2} appeared and asked {name} to join them in a quest to find the {adjective3} {noun3}. They {verb2} together and had the m...
Python
1
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt #01 # Load the breast cancer dataset df = pd.read_csv('Breast_cancer_data.csv') target_variable = 'diagnosis' # Calculate the correlation matrix correlation_matrix = df.corr() # Identify the feature with the highest correlation with the tar...
Python
1
y_proba'] = None plot_roc_curves(results, X_test, y_test, filename='roc_curve.png') save_best_model(models, best_model_name, out_path='best_model.joblib') # Save a brief CSV of model metrics metrics_df = pd.DataFrame.from_dict({k: {k2: v2 for k2, v2 in res.items() if k2 in ['accuracy','precision','rec...
Python
1
import numpy as np import pytest from pandas import DataFrame pytest.importorskip("jinja2") from pandas.io.formats.style import Styler @pytest.fixture def df(): return DataFrame( data=[[0, 1, 2], [3, 4, 5], [6, 7, 8]], columns=["A", "B", "C"], index=["x", "y", "z"], ) @pytest.fixtu...
Python
1
# Crea un programa que comprueba si los paréntesis, llaves y corchetes # de una expresión están equilibrados. # - Equilibrado significa que estos delimitadores se abren y cieran en orden y de forma correcta. # - Paréntesis, llaves y corchetes son igual de prioritarios. No hay uno más importante que otro. # - Expresión ...
Python
1
WAVFILESIZE])) if "tags" in stream: if isinstance(stream["tags"], dict): tagsdict = stream["tags"] if tagsdict.get("timecode"): # is non drop ? if tagsdict[...
Python
1
from tkinter import Tk, StringVar, OptionMenu, Label def on_option_change(): selected_option = selected_var.get() label.config(text=f"Selected Option: {selected_option}") root = Tk() root.title("Option Menu Example") # List of options for the option menu options = ["Option 1", "Option 2", "Option 3", "Option...
Python
1
import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import euclidean_distances from sklearn.neighbors import KNeighborsClassifier from .datasets import make_forge from .plot_helpers import discrete_scatter def plot_knn_classification(n_neighbors=1): X, y = make_forge() X_test = np.array...
Python
1
in() { // file let filename = "input.txt"; let file = File::open(filename).unwrap(); let reader = BufReader::new(file); // vector to store data let mut vec: Vec<i32> = Vec::new(); // read line into vector for (_index, line) in reader.lines().enumerate() { let line = line.unwrap...
Rust
0
#======================================================================= # isa_RV64D.py #======================================================================= 'RISC-V instructions for the double-precision floating point extension.' from utils import sext_xlen, sext_32, sext, signed, trim from pydgin.utils imp...
Python
1
o: Info, }, AccessToUnitializedMemory { info: Info, instruction: Instruction, operands: Vec<Info::Value>, }, AccessToUnalignedAddress { info: Info, address: u64, }, AccessToOutOfRangeAddress { info: Info, }, ExitCodeGreaterZero { ...
Rust
0
import requests API_URL = 'https://model-app-func-modelscc-ebbbfc-ymsqftrsrm.cn-shanghai.fcapp.run/invoke' def post_request(url, json): with requests.Session() as session: response = session.post(url, json=json, ) return response payload = {"input": {"text": "A panda eating bamboo on a rock."}}...
Python
1
.0 } } impl<T> DerefMut for PlainText<T> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl<T: Send> Payload for PlainText<T> { const CONTENT_TYPE: &'static str = "text/plain"; fn schema_ref() -> MetaSchemaRef { String::schema_ref() } } #[poem::async_trait]...
Rust
0