text
string
label_name
string
labels
int64
_STACK_SIZE - 0x10) as u64; // Allocate all ISTs for this core. // Every task later gets its own IST1, so the IST1 allocated here is only used by the Idle task. for i in 0..IST_ENTRIES { let ist = mm::allocate(KERNEL_STACK_SIZE, PageTableEntryFlags::EXECUTE_DISABLE); boxed_tss.ist[i] = (ist + KERNEL_STACK_SIZE ...
Rust
0
serialize)] pub struct Emoji { id: i32, pub title: String, slug: String, pub image: String, pub description: String, category: i32, license: String, source: String, faves: i32, pub submitted_by: String, width: i32, height: i32, filesize: i32, } <reponame>ivmidable/Plu...
Rust
0
import math def is_prime(n: int) -> bool: """Возвращает True, если n — простое число, иначе False.""" k = math.sqrt(n) # определяем верхнюю границу для делителей d = 2 # начальное значение делителя l = 1 # флаг, который будет равен 0, если найден делитель, иначе 1 # пока делитель в пределах г...
Python
1
ification2 = batch_v1.JobNotification() notification2.pubsub_topic = f"projects/{project_id}/topics/{topic_name}" second_message = batch_v1.JobNotification.Message() second_message.type_ = batch_v1.JobNotification.Type.TASK_STATE_CHANGED second_message.new_task_state = batch_v1.TaskStatus.State.FAILED ...
Python
1
# Import the Pinecone library from pinecone import Pinecone import os from data import records from dotenv import load_dotenv load_dotenv() # Initialize a Pinecone client with your API key pc = Pinecone(api_key=os.getenv("PINECONE_API_KEY")) # Create a dense index with integrated embedding index_name = "quickstart-py...
Python
1
"""pytest共通設定とフィクスチャ""" import pytest import sys from pathlib import Path # プロジェクトルートをPythonパスに追加 project_root = Path(__file__).parent.parent sys.path.insert(0, str(project_root)) from src.debug.game_debug_client import GameDebugClient from src.debug.debug_helper import DebugSession @pytest.fixture(scope="session"...
Python
1
from .extensions import NewelleExtension from .handlers import ExtraSettings, PromptDescription class PromptAdderExtensiion(NewelleExtension): id = "pormptadder" name = "Prompt Adder" def __init__(self, pip_path: str, extension_path: str, settings): super().__init__(pip_path, extension_path, sett...
Python
1
nSub { ta_state: vec![0; state_size] , clause_output: vec![0; clause_chunks] , feedback_to_la: vec![0; la_chunks] , feedback_to_clauses: vec![0; clause_chunks] , prob_svalues: prob_svalues.to_vec() //Copy of probability array , threshold: ...
Rust
0
(['openhands', 'serve'], {"mount_cwd": False, "gpu": False}), (['openhands', 'serve', '--mount-cwd'], {"mount_cwd": True, "gpu": False}), (['openhands', 'serve', '--gpu'], {"mount_cwd": False, "gpu": True}), (['openhands', 'serve', '--mount-cwd', '--gpu'], {"mount_cwd": True, "gpu": True}...
Python
1
#!/usr/bin/env python # !/usr/bin/python3 # -*- coding: utf-8 -*- # @Author : justin.郑 # @mail : 3907721@qq.com # @Time : 2025/7/19 10:40 # @File : prompts # @desc : COORDINATOR_SYSTEM = """ # AI 助手任务 你是一名 AI 助手,负责通过结合用户查询与网络搜索结果,提供信息丰富且便于理解的回答。你的职责包括: 1. 分析用户查询:`{query}` 2. 审阅网络搜索结果的摘要:`{summary}` 3. ...
Python
1
= lexer.pop_current_token().unwrap(); assert_eq!(loc1, Location(1, 1)); assert_eq!(tok1, Token::VALUE("A".to_string())); assert_eq!(loc2, Location(1, 2)); assert_eq!(tok2, Token::COLON); assert_eq!(loc3, Location(1, 3)); assert_eq!(tok3, Token::VALUE("B".to_string())); assert_eq!(loc4, ...
Rust
0
device = FakeDevice::new(); let mut fake_scheduler = FakeScheduler::new(); let ctx = make_context(fake_device.as_device(), fake_scheduler.as_scheduler()); ctx.send_mlme_eapol_ind(CLIENT_ADDR2, CLIENT_ADDR, &[1, 2, 3, 4, 5][..]) .expect("expected OK"); let msg = fake_device ...
Rust
0
from enum import unique, Enum from BaseClasses import Region, MultiWorld from .Hints import HintArea # copied from OoT-Randomizer/Region.py @unique class RegionType(Enum): Overworld = 1 Interior = 2 Dungeon = 3 Grotto = 4 @property def is_indoors(self): """Shorthand for checking if...
Python
1
An array of `Hocon` values Array(Vec<Hocon>), /// An HashMap of `Hocon` values with keys Hash(HashMap<String, Hocon>), /// A null value Null, /// A `BadValue`, marking an error in parsing or a missing value BadValue(crate::Error), } static NOT_FOUND: Hocon = Hocon::BadValue(crate::Error::Mi...
Rust
0
e instance. RETURNS (None): Raises an assertion if the data differs or the instance is not ClipboardState. """ initial_data = {"key1": "value1", "key2": "value2"} clipboard_state.write(initial_data) copied_state = clipboard_state.deep_copy() assert isinstance(copied_state, ClipboardSt...
Python
1
) << 1), (((3 << 3) + 1) << 2) - 1, (((7 << 2) - 1) << 2), ((((3 << 2) + 1)) << 3) + 1, (7 << 4), (3 << 5) + (1 << 1), (7 << 4) - 1, (3 << 5) + 1, (7 << 4) + (1 << 1), (((3 << 3) + 1) << 2), (5 << 4) + (1 << 1), (((3 << 3) + 1) << 2) + 1, (3 << 5) + 1, (((3 << 3) + 1) << 2), (((1 << 4) + 1) << 1), (((3 << 3) - 1) << 2)...
Python
1
import json import torch import random random.seed(1234) class Dataset(torch.utils.data.Dataset): def __init__(self, file_path, tokenizer, max_len=2048, shuffle=False, max_cnt=None, truncat=True): self.data = [] with open(file_path, 'r') as fp: for line in fp.readlines(): ...
Python
1
ts(tests: Vec<(&str, Stmt)>) { for (input, result) in tests { assert_stmt(input, result); } } // Tests a vector of tuples that hold a single expression test fn assert_exprs(tests: Vec<(&str, Expr)>) { for (input, result) in tests { assert_expr(input, result); } } // Generates an intege...
Rust
0
10]; for (i, &c) in counter.iter().enumerate() { errs[i] = (((nn as isize) - (c as isize)) as f64).abs() / f64::from(nn); } for &err in errs.iter() { assert!(err < 0.025); } } #![no_main] use libfuzzer_sys::fuzz_target; extern crate secp256k1zkp; use secp256k1zkp::{Secp256k1, Public...
Rust
0
SubscriptionFailed)), Err(unexpected) => Err(TockValue::Unexpected(unexpected)), } } } pub struct Buttons<'a> { count: usize, #[allow(dead_code)] // Used in drop subscription: CallbackSubscription<'a>, } #[derive(Copy, Clone, Debug)] pub enum ButtonsError { NotSupported, Su...
Rust
0
ADULA_ARCHITECTURE_X86_64_V3_LINUX, ); env::set_var( constants::RADULA_ENVIRONMENT_ARCHITECTURE_MUSL_LINKER, constants::RADULA_ARCHITECTURE_X86_64_V3_LINUX, ); env::set_var( constants::RADULA_ENVIRONMENT_TUPLE_TARGET, ...
Rust
0
import hashlib import hmac import json import time from urllib import parse import requests from arknights_mower.utils.log import logger from arknights_mower.utils.SecuritySm import get_d_id app_code = "4ca99fa6b56cc2ba" # 签到url sign_url = "https://zonai.skland.com/api/v1/game/attendance" # 绑定的角色url binding_url = "...
Python
1
fn default() -> Self { Self { body_text_style: TextStyle::Body, spacing: Spacing::default(), interaction: Interaction::default(), visuals: Visuals::default(), animation_time: 1.0 / 15.0, } } } impl Default for Spacing { fn default...
Rust
0
) .unwrap(); let hv_message: hv_message = unsafe { std::mem::zeroed() }; let mut done = false; loop { let ret_hv_message: hv_message = vcpu.run(hv_message).unwrap(); match ret_hv_message.header.message_type { hv_message_type_HVMSG_X64_HALT => { ...
Rust
0
scores[token_idx_in_trigger, indices_with_low_readability] = -np.inf token_top_k_obj = scores[token_idx_in_trigger].topk(k_candidates) token_top_ids = token_top_k_obj.indices.tolist() token_top_scores = token_top_k_obj.values.tolist() candidates[token_idx] = dict...
Python
1
self.flux_lower.to(self.target_device) return self.flux_lower(img, txt, vec, pe, txt_attention_mask) wrapper = FluxUpperLowerWrapper(self.flux_upper, flux, accelerator.device) clean_memory_on_device(accelerator.device) flux_train_utils.sample_images( accelerator, ...
Python
1
) else settings.SITEURL json_data = {} json_data["siteurl"] = site_url json_data["name"] = settings.PYCSW["CONFIGURATION"]["metadata"]["identification"]["title"] json_data["poc"] = { "name": settings.PYCSW["CONFIGURATION"]["metadata"]["contact"]["name"], "email": settings.PYCSW["CONFIGU...
Python
1
_rapier3d::rapier::geometry::ColliderBuilder; use crate::in_game::TiedToGame; use crate::physics::OneWayPlatformHook; pub struct GameAreaPlugin<T>(pub T); impl<T: crate::util::StateType> Plugin for GameAreaPlugin<T> { fn build(&self, app: &mut AppBuilder) { app.add_system_set(SystemSet::on_enter(self.0.c...
Rust
0
# Prompt template cho AI của bạn CUSTOM_SYSTEM_PROMPT = """ Bạn là AI Assistant thông minh của tôi với tên là "MyAI",người tạo ra bạn tên là Mai Anh Luân. ĐẶC ĐIỂM: - Trả lời bằng tiếng Việt chuyên nghiệp và thân thiện - Luôn dựa vào thông tin trong tài liệu được cung cấp - Nếu không có thông tin trong tài liệu, hãy...
Python
1
absTransition, } #[derive(Data, Clone, Lens)] struct AppState { tab_config: TabConfig, advanced: DynamicTabData, first_tab_name: String, } pub fn main() { // describe the main window let main_window = WindowDesc::new(build_root_widget()) .title("Tabs") .window_size((700.0, 400.0));...
Rust
0
pub __ss_padding: [libc::c_char; 118], pub __ss_align: libc::c_ulong, } pub type C2RustUnnamed = libc::c_uint; pub const SHUT_RDWR: C2RustUnnamed = 2; pub const SHUT_WR: C2RustUnnamed = 1; pub const SHUT_RD: C2RustUnnamed = 0; #[derive(Copy, Clone)] #[repr(C)] pub struct sockaddr_in6 { pub sin6_family: sa_famil...
Rust
0
().numpy() save_csv(logs_filepath, experiment_name, [epoch + 1, train_loss_n, train_acc_n, noise_n, noise_pre_n, noise_zip_n, jiu_true_n, pre_cs_n, pre_lab_cs_n, "val_loss", "val_acc", ...
Python
1
"1000", "XX"], ) .await; next_frame_eq(&mut connection, Frame::Integer(1)).await; write_cmd(&mut connection.stream, vec!["TTL", "mykey"]).await; next_frame_eq(&mut connection, Frame::Integer(1)).await; write_cmd( &mut connection.stream, vec!["EXPIRE", "mykey", "1000", "NX"], ...
Rust
0
hild(&0), cx, map) } fn access( &self, id: ViewId, cx: &mut Context, nodes: &mut Vec<accesskit::Node>, ) -> Option<accesskit::NodeId> { self.child.access(id.child(&0), cx, nodes) } } impl<V> Offset<V> where V: View, { pub fn new(child: V, offset: LocalOf...
Rust
0
n an <code>UNAVAILABLE</code> state because CloudFormation is still creating it or in an <code>OBSOLETE</code> state because the stack was already updated.</p> pub fn execution_status(&self) -> std::option::Option<&crate::model::ExecutionStatus> { self.execution_status.as_ref() } /// <p>The state of...
Rust
0
ce = "tas: http://www.onvif.org/ver10/advancedsecurity/wsdl" )] pub struct Dot1XStage { // The identity used in this authentication method, if required. #[yaserde(prefix = "tas", rename = "Identity")] pub identity: Option<String>, // The unique identifier of the certification path used in this // a...
Rust
0
values are first deserialized from the config file /// (/etc/metalctl.toml), and then any args present on the kernel cmdline /// are processed. pub fn apply_kernel_cmdline_overrides(&mut self) -> Result<()> { self.apply_overrides(MetalosCmdline::from_proc_cmdline()?) } fn apply_overrides(&...
Rust
0
lf.hist_bins != 0: stats_by_cases[DataStatsKeys.IMAGE_HISTOGRAM] = d[DataStatsKeys.IMAGE_HISTOGRAM] if self.label_key is not None: stats_by_cases.update( { DataStatsKeys.FG_IMAGE_STATS: d[DataStatsKeys.FG_IMAGE_STATS], ...
Python
1
inks. Therefore we are quite generous for now. if desc.len() > 200 { bail!("Desription of `{}` is too long: {}", name, desc); } Ok(Tool::new(name, link, desc)) } fn check_section(section: String) -> Result<(), Error> { // Ignore license section if section.starts_with("License") { r...
Rust
0
# things like dynamic pivot and possibly other operators. if to_pandas: result = pandas.DataFrame( [[v for v in result_row[0]]], columns=[rm.name for rm in result_meta], ) else: result = result_r...
Python
1
rror> for TemplateError { fn from(e: io::Error) -> Self { TemplateError::ReadError(e) } } #[derive(Debug, Deserialize)] struct Folder { name: String, template: Option<Template>, } #[derive(Debug, Deserialize)] pub struct Template { folders: Option<Vec<Folder>>, files: Option<Vec<String>>, } impl Temp...
Rust
0
game.mouse.get_pos(), 0, random.randrange(0, 1000)) # Reset game if the restart button is clicked if mouse_click != None and restart_rect.collidepoint(pygame.mouse.get_pos()) and last_mouse_click != mouse_click[2] and mouse_key[0]: last_mouse_click = mouse_click[2] game_grid = [[...
Python
1
buf } /// Extract data part of a received message from a sensor. /// # Returns /// `Ok(data)` if succeeds, `Err(reason)` if an invalid message is specified. pub(crate) fn parse_reception(message: &[u8]) -> Result<Vec<u8>, ParseError> { if message == &NEGATIVE_ACKNOWLEDGEMENT[..] { return Err(ParseErr...
Rust
0
rouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'Dashboards', 'Dashboards Documentation', author, 'Dashboards', 'One line description of project.', 'Miscellaneous'), ...
Python
1
# When passed an `init_times.json` file (received from enabling `PROFILE_MAPLOAD_INIT_ATOM`), # and an optional max-depth level, this will output init times from worst to best. import errno import json import sys if len(sys.argv) < 2: print("Usage: read_init_times.py <init_times.json> [max_depth]") sys.exit(1)...
Python
1
ET_EXISTS => CouchbaseError::DatasetExists { ctx }, lcb_STATUS_LCB_ERR_DATAVERSE_EXISTS => CouchbaseError::DataverseExists { ctx }, lcb_STATUS_LCB_ERR_ANALYTICS_LINK_NOT_FOUND => CouchbaseError::LinkNotFound { ctx }, lcb_STATUS_LCB_ERR_VIEW_NOT_FOUND => CouchbaseError::ViewNotFound { ctx }, ...
Rust
0
Vec<_>>(), contexts_should ); let custom_should: Vec<(&str, &str)> = vec![]; assert_eq!( task_is.description.custom().collect::<Vec<_>>(), custom_should ); assert_eq!(Task::parse(&mut parser), Err(ParseTaskError)); } #[test] fn task_parse_full() { let input = b"x (J) 1990-01-01 198...
Rust
0
if len(self.buf) == 0: self._recv() if len(self.buf) > 0: if n > len(self.buf): n = len(self.buf) ret = self.buf[:n] self.buf = self.buf[n:] ...
Python
1
from http.client import HTTPException from flask import Blueprint, request, jsonify from config.config import MODEL_OUTPUT_DIR, QUANTIZED_MODEL_OUTPUT_DIR, PRUNED_MODEL_OUTPUT_DIR from log.logger import logger from service.pruner_service import PrunerService from service.quantizer_service import QuantizerService pru...
Python
1
1) extra_seq = ans / (bins - 1) extra_seq = extra_seq.to(pred) #cious, iou = ciou(extra_seq, target) cious, iou = SIoU_loss(extra_seq, target, 4) cious = cious.mean() #cious, iou = self.objective['giou'](extra_seq, target) giou_loss = cious #giou_loss = 1 ...
Python
1
struct Solution {} // problem: https://leetcode.com/problems/bulb-switcher-ii/ // discuss: https://leetcode.com/problems/bulb-switcher-ii/discuss/?currentPage=1&orderBy=most_votes&query= // submission codes start here impl Solution { pub fn flip_lights(n: i32, presses: i32) -> i32 { match (n, presses) {...
Rust
0
execute!(tmp_stdout, cursor::MoveTo(0,0))?; execute!(tmp_stdout, terminal::Clear(terminal::ClearType::All))?; execute!(tmp_stdout, terminal::LeaveAlternateScreen)?; execute!(tmp_stdout, cursor::Show)?; terminal::disable_raw_mode()?; Ok(()) } // In search for a better name struct App { min_widt...
Rust
0
queue_type: None, tier: None, } } } <filename>src/draw.rs use crate::font; use crate::{Pixel, PixelBuffer, PixelScale, Sprite}; /// Same as [draw_pixel](crate::draw_pixel) except accept /// [PixelScale](crate::PixelScale) additionally. pub fn draw_pixel_scaled<T: PixelBuffer>( buf: &m...
Rust
0
update({ "current_step": "正在生成视频", "progress": "50%" }) result_condition.notify_all() # 执行实际任务 result = func(**args) logger.info(f"任务 {task_id} 执行成功") # 提取warehouse路径 warehouse_path = extract_warehouse_path...
Python
1
26 => Some(17051711), 27 => Some(17051711), 28 => Some(17051711), 29 => Some(17051711), 30 => Some(20831327), 31 => Some(20831327), 32 => Some(20831327), 33 => Some(20831327), 34 => Some(20831327), 35 => Some(47326697), 36 => Some(47326...
Rust
0
# Copyright (c) 2022 Tsinghua University. (authors: Jie Chen) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
1
from dateparser.search.search import DateSearchWithDetection _search_with_detection = DateSearchWithDetection() def search_dates(text, languages=None, settings=None, add_detected_language=False, detect_languages_function=None): """Find all substrings of the given string which represent date and/or time and pars...
Python
1
8]); key.decrypt_block(GenericArray::from_mut_slice(&mut b[..16])); out[r_offset..r_offset + 8].copy_from_slice(&b[8..16]); i += 8; t -= 1; } } iv.copy_from_slice(&b[..8]) } #[cfg(test)] mod test { use super::*; use aes_soft::block_cipher::NewB...
Rust
0
ow)" ], "category": CommandCategory.SERVICE_MANAGEMENT, "risk": RiskLevel.SAFE, "commands": [ "echo '🔧 Active Services'", "systemctl list-units --type=service --state=active --no-pager | head -15", ...
Python
1
first_output_processed) save_to_text_file('prompt02output-processed.txt', second_output_processed) save_to_text_file('prompt03output-processed.txt', third_output_processed) save_to_text_file('prompt04output-processed.txt', fourth_output_processed) # Writing results to CS...
Python
1
'status': '00000', 'msg': '成功' } try: _device_name = request.json['device_name'] if _device_name in self.apps.keys(): raise RuntimeError('设备[%s]正被控制中, 请先关闭直播或等待控制结束!' % _device_name) # 安装设备 self._install_app(_device_n...
Python
1
K_KHR_shared_presentable_image #[cfg(feature = "VK_KHR_shared_presentable_image")] SHARED_PRESENT_KHR = 1000111000, // feature: VK_KHR_maintenance2 #[cfg(feature = "VK_KHR_maintenance2")] DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = 1000117000, #[cfg(feature = "VK_KHR_maintenance2")] DE...
Rust
0
"""CLI commands package.""" from .init import init_cmd from .scan import scan_cmd from .search import search_cmd from .sync import sync_cmd from .publish import publish_cmd from .status import status_cmd from .config import config_cmd __all__ = [ 'init_cmd', 'scan_cmd', 'search_cmd', 'sync_cmd', ...
Python
1
with_initial_conditions(&[1.0]) .unwrap() .build(); let path = euler.solve_ivp(&quadratic_deriv, &mut ()).unwrap(); for step in &path { assert!(approx_eq!( f64, step.1.column(0)[0], 1.0 - step.0.powi(2), epsilon = 0.001 )); } ...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
vec![ String::from("ja2"), String::from("--res"), String::from("1100x480"), ]; let home = temp_dir.path().join(".ja2"); let expected_error_message = "Vanilla data directory has to be set either in config file or per command line switch"; ...
Rust
0
pg_insert_start_time = time.time() for table_name, (data, columns) in data_to_insert.items(): insert_data_in_batches(pg_cursor, pg_conn, table_name, columns, data, is_crate=False) pg_insert_end_time = time.time() print(f"PostgreSQL data insertion completed in {pg_insert_end_time - pg_insert_start_time:.2f} seconds...
Python
1
er().map(|i| Uint8Array::from(i.as_slice())).collect(); let mut js_builder = ProofInputBuilder::new(); js_builder.set_leaf_index(JsString::from(index.to_string())).unwrap(); js_builder.set_leaves(Leaves::from(JsValue::from(leaves_ua))).unwrap(); js_builder.set_fee(JsString::from("5")).unwrap(); js_builder.set_re...
Rust
0
} results.append(rec) # ------------------------------ # Save outputs # ------------------------------ os.makedirs(args.out_dir, exist_ok=True) results_path_jsonl = os.path.join(args.out_dir, f"{args.wandb_name}_results.jsonl") results_path_json = os.path.join(args.out_dir, f"{args...
Python
1
(Debug, PartialEq)] pub struct SurfacePlatformRecord { pub frozen_status : FrozenStatus, pub power_plant_status : PowerPlantStatus, pub state : State, } #[derive(Debug, PartialEq)] pub struct SubsurfacePlatformsRecord { pub frozen_status : FrozenStatus, pub power_plant_status : PowerPlantStatus, ...
Rust
0
**model_inputs, decoder_attention_mask=decoder_attn_mask, return_dict=True) next_token_logits = outputs.logits[:, -1, :] # get log probs dist = self._ref_action_dist.proba_distribution( action_logits=next_token_logits) log_prob = dist.log_prob(action)...
Python
1
import cv2 import time import numpy as np import PoseEstimationModule as pem ################# # Variables video_path = "TennisVideos/carlos2.mp4" point_to_draw = 16 brush_thickness = 5 draw_color = (0, 0, 255) ################# # Upload a video cap = cv2.VideoCapture(video_path) # Instantiate a class from PoseEsti...
Python
1
ptr(), bus.as_ptr()); /// /// extern "C" fn callback(dir: I2CDirection, buffer: *mut u8, len: usize) -> usize { /// assert_eq!(dir, I2CDirection::Read); /// let mut buffer = unsafe { slice::from_raw_parts_mut(buffer, len) }; /// for i in 1u8..5u8 { /// buffer[(i - 1) as usize] = i; /// } /// ...
Rust
0
#[inline(always)] pub fn rs485_clash_int_st(&self) -> RS485_CLASH_INT_ST_R { RS485_CLASH_INT_ST_R::new(((self.bits >> 17) & 0x01) != 0) } #[doc = "Bit 18 - This is the status bit for at_cmd_det_int_raw when at_cmd_char_det_int_ena is set to 1."] #[inline(always)] pub fn at_cmd_char_det_int...
Rust
0
# Lint as: python3 # Copyright 2020 The AdaNet Authors. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # https://www.apache.org/licenses/LICENSE-2.0 # Unless requir...
Python
1
import kagglehub path = kagglehub.dataset_download("jeremylarcher/canadian-house-prices-for-top-cities") import os print(os.listdir(path)) file_name = "HouseListings-Top45Cities-10292023-kaggle.csv" # Substitua pelo nome do arquivo listado file_path = os.path.join(path, file_name) import pandas as pd data = pd.re...
Python
1
import numpy as np from os import listdir from os.path import isfile, join from tqdm import tqdm NUM_NODES = 100000000 SIZE = 'large' if __name__ == '__main__': exp_edges = [] # # paper labels with open('/mnt/nvme4/paper_labels_19_classes.npy', 'rb') as f: paper_labels = np.load(f, allow_pick...
Python
1
# # This file is part of the Chemical Data Processing Toolkit # # Copyright (C) Thomas Seidel <thomas.seidel@univie.ac.at> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # versi...
Python
1
, abs", ) # CyclicLR and OneCycleLR params parser.add_argument( "--base_lr", type=float, default=0.001, help="base_lr for cyclic lr_schedulers", ) parser.add_argument( "--max_lr", type=float, default=0.01, help="max_lr for cyclic lr_sch...
Python
1
&Event, data: &mut DruidAppData, env: &Env) { self.widget.event(ctx, event, data, env); } fn lifecycle( &mut self, ctx: &mut LifeCycleCtx, event: &LifeCycle, data: &DruidAppData, env: &Env, ) { self.widget.lifecycle(ctx, event, data, env) } ...
Rust
0
0xB)) } } pub fn push_move_handle(&mut self, handle: svc::Handle) -> Result<()> { match self.move_handles.try_push(handle) { Ok(()) => Ok(()), Err(_) => Err(ResultCode::new(0xB)) } } pub fn push_handle<const M: HandleMode>(&mut self, handle: sf::Handle<M...
Rust
0
&self.a } pub fn b(&self) -> &Point3D { &self.b } pub fn c(&self) -> &Point3D { &self.c } } //------------------------------------------------------------------------------ impl IsSATObject for TriFace3D { fn for_each_point<F>(&self, f: &mut F) where F: FnMut(&Poi...
Rust
0
import json import boto3 import requests # Acesso ao S3 s3_client = boto3.client('s3') bucket_name = 'futeboltotal220' # URL da API api_url = 'https://api.football-data.org/v4/persons/' # Token da API api_token = '' # Função para consultar a API def get_player_data(pearson_id): headers = { 'X-Auth-Token...
Python
1
page from the start let mut nested_page = NestedPage::new(page); extend_offsets1(&mut nested_page, init, nested_items, chunk_size); let maybe_page = decoder.build_state(page); let page = match maybe_page { Ok(page) => page, Err(e) => retu...
Rust
0
import knn_kdtree import numpy as np X = np.array([[1, 1], [1, 2], [1, 3], [2, 2], [3, 1], [3, 2], [3, 3]]) Y = np.array([0] * len(X)) tree = knn_kdtree.KDTree(X, Y) def points_equal(a, b): a = set(map(tuple, a)) b = set(map(tuple, b)) return a == b assert(points_equal(tree.root.points, [[2, 2]])) assert...
Python
1
he_item)?; // Solana NFTs all use the same NFT contract, so unify the name ( "Wormhole Bridged Solana-NFT".to_string(), "WORMSPLNFT".to_string(), ) } else { ( get_string_from_32(&trans...
Rust
0
9-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92....
Python
1
the affiliation metrics (precision, recall, individual probabilities and distances) """ datasets, Tranges = read_all_as_events() # read all the events in folder `data` results = dict() for data_name in datasets.keys(): results_data = dict() for algo_name in datasets[data_name].keys(...
Python
1
import json qrels = {} with open('qrels/ct_2021_qrels.txt', 'r') as f: for line in f: qid, _, docid, rel = line.strip().split() if qid not in qrels: qrels[qid] = {} if rel not in qrels[qid]: qrels[qid][rel] = [] qrels[qid][rel].append(docid) docs = {} with...
Python
1
ert_angle = vert / (resolution_vertical - 1.0) vert_angle = math.cos(vert_angle * math.pi) * 90.0 + 90.0 horiz_angle = horiz / (resolution_horizontal - 1.0) * 360.0 candela = get_candela_value(vert_angle, horiz_angle) x = vert y = horiz i = x + y *...
Python
1
""" Extracting timestamp with probe. Issues: - Since probe is blocking, if probe function takes too long, the pipeline will be blocked. """ import gi gi.require_version("Gst", "1.0") import datetime import time from gi.repository import GObject, Gst from loguru import logger from tqdm import tqdm Gst.init(None) pb...
Python
1
Type: str :param _SubAppId: <b>点播[应用](/document/product/266/14574) ID。从2023年12月25日起开通点播的客户,如访问点播应用中的资源(无论是默认应用还是新创建的应用),必须将该字段填写为应用 ID。</b> :type SubAppId: int :param _Name: 水印模板名称,长度限制:64 个字符。 :type Name: str :param _Comment: 模板描述信息,长度限制:256 个字符。 :type Comment: str ...
Python
1
ait; // send "exit" request exit_notification(&mut service).await; } #[tokio::test] async fn did_close() { let (mut service, _) = LspService::new(|client| Backend::new(client, config())); // send "initialize" request let _ = initialize_request(&mut service).await; ...
Rust
0
election, Merge, Quick):").capitalize() algorithms = { 'Bubble': bubble_sort, 'Insertion': insertion_sort, 'Selection': selection_sort, 'Merge': merge_sort, 'Quick': lambda arr, draw_array, delay: quick_sort(arr, 0, len(arr) - 1, draw_array, delay) } if algo_name in...
Python
1
arger or smaller. const PREFETCH_THRESHOLD_FACTOR: f64 = 4.0; // If the amount of data that is pending (requested but not received) is less than a certain amount, // data is pre-fetched in addition to the read ahead settings above. The threshold for requesting more // data is calculated as // <pending bytes> < PREFETC...
Rust
0
import argparse import logging import sys import tldextract from iyp import BasePostProcess NAME = 'post.url2hostname' class PostProcess(BasePostProcess): def run(self): """Link URLs and their corresponding HostNames.""" # Get all URL nodes. url_id = self.iyp.batch_get_nodes_by_single_...
Python
1
inline] pub fn append_bulk_neighbours(depth: u8, hash: u64, mut dest: &mut Vec<u64>) { get(depth).append_bulk_neighbours(hash, &mut dest); } /// Conveniency function simply calling the [internal_edge](struct.Layer.html#method.internal_edge) method /// of the [Layer] of the given *depth*. #[inline] pub fn internal_e...
Rust
0
import pytest, time, os from dotenv import load_dotenv from selenium import webdriver from selenium.webdriver.firefox.service import Service as FirefoxService from POM.pages.login_page import LoginPage from POM.pages.locators import HomePageLocators as HomePage """Loading Environment Variables""" load_dotenv() FIREFOX...
Python
1
wav_instrument = spec_utils.cmb_spectrogram_to_wave(y_spec_m, self.mp) logger.info("%s instruments done" % name) if format in ["wav", "flac"]: sf.write( os.path.join( ins_root, "instrument_{}_{}.{}".format(name, ...
Python
1
rotocol is specified by the URI scheme. /// /// - **`http`**: Proxy. Default when no scheme is specified. /// - **`https`**: HTTPS Proxy. (Added in 7.52.0 for OpenSSL, GnuTLS and NSS) /// - **`socks4`**: SOCKS4 Proxy. /// - **`socks4a`**: SOCKS4a Proxy. Proxy resolves URL hostname. /// - **`sock...
Rust
0