text
string
label_name
string
labels
int64
y.pl8"), ("Armitems.256", "Trp_kn_b.pl8"), ("Armitems.256", "Trp_kn_k.pl8"), ("Armitems.256", "Trp_kn_p.pl8"), ("Armitems.256", "Trp_kn_r.pl8"), ("Armitems.256", "Trp_kn_y.pl8"), ("Armitems.256", "Trp_ma_b.pl8"), ("Armitems.256", "Trp_ma_k.pl8"), ("Armitems.256", "Trp_ma_p.pl8"), ("A...
Rust
0
in a locked state, since the GlobalThreadList is assumed to be // locked, whenever a Synch is created. // // Immediately after creation the Synch is added to the GlobalThreadList where it will // be unlocked, when the list is unlocked. lock, } } ...
Rust
0
def get_img(self, bookid, page, jwtkey): cur = self.db.cursor() cur.execute('SELECT data FROM book_img WHERE bookid=? AND page=?', (bookid, page)) res = cur.fetchone() if res: return res[0] cur_time = time.time() jwttoken = jwt.encode({ ...
Python
1
her}; use std::io::{Bytes, Error as IOError, Read}; use std::ops::Deref; use std::rc::Rc; use std::vec::Vec; use indexmap::IndexMap; use unicode_reader::CodePoints; pub type Atom = String; pub type Var = String; pub type Specifier = u32; pub const MAX_ARITY: usize = 1023; pub const XFX: u32 = 0x0001; pub const XF...
Rust
0
# Examples of valid version strings # __version__ = '1.2.3.dev1' # Development release 1 # __version__ = '1.2.3a1' # Alpha Release 1 # __version__ = '1.2.3b1' # Beta Release 1 # __version__ = '1.2.3rc1' # RC Release 1 # __version__ = '1.2.3' # Final Release # __version__ = '1.2.3.post1' # Post Release...
Python
1
; let (tx, rx) = mpsc::unbounded_channel(); assert_ready_none!(map.poll_next()); assert!(map.insert("foo", rx).is_none()); assert!(map.contains_key("foo")); assert!(!map.contains_key("bar")); assert_eq!(map.len(), 1); assert!(!map.is_empty()); assert_pending!(map.poll_next()); a...
Rust
0
u_list"])): edu = dialogue["edu_list"][i] idx[edu["id"]] = i for i, edu in enumerate(dialogue["edu_list"]): print(i, edu["speaker"], ":", edu["text"]) print("===") for relation in dialogue["relations"]: def get_head(x): if x in dialogue["edus"]: ...
Python
1
= compss_wait_on(ev) self.assertEqual(ev, 0) def testFailedBinaryExitValue(self): ev = failedBinary(123) ev = compss_wait_on(ev) self.assertEqual(ev, 123) @unittest.skip("UNSUPPORTED WITH GAT") def testFileManagementINOUT(self): inoutfile = "src/inoutfile" ...
Python
1
)?)?; trace!(target: "wasm", " val: {:?}", endowment); let salt: H256 = BigEndianHash::from_uint(&self.u256_at(args.nth_checked(1)?)?); trace!(target: "wasm", " salt: {:?}", salt); let code_ptr: u32 = args.nth_checked(2)?; trace!(target: "wasm", " code_ptr: {:?}", code_ptr); let code_len: u32 = ...
Rust
0
let mut map = HASHMAP.write().unwrap(); map.insert(key,req_body); HttpResponse::Ok().body("It is saved... in memory!") } #[delete("/{key}")] pub async fn delete_value_for_key(web::Path(key): web::Path<String>) -> impl Responder { let mut map = HASHMAP.write().unwrap(); map.remove(&key); HttpRes...
Rust
0
""" Advent of Code 2024 Day: 11 Problem: 01 Author: Nathan Rand Date: 12.11.24 """ _INPUT_FILE_NAME = "input.txt" _NUM_BLINKS = 25 def _get_pebble_after_blinking(pebble: int): # Edge case when pebble is 0 if pebble == 0: return [1] # If it is not 0, we check if it has an even number of digits ...
Python
1
BTC_USDT = 1 ETH_USDT = 2 TRX_USDT = 6 BNB_USDT = 11
Python
1
ATUS.lock()?; let mut light_group = LIGHTGROUP.lock()?; let lgt_duration = LIGHTDURATION.lock()?; for (group_name, lgt_id_vec) in light_group.iter_mut() { value_new = format!(r#"{}"{}":["#, value_new, group_name); // 1. 取出group中的值,为每个灯的剩余时间减一 ...
Rust
0
ixel[0]}, {pixel[1]}, {pixel[2]})") else: self.pixel_value_var.set(f"像素值: {pixel}") else: self.pixel_value_var.set("像素值: -") def on_mouse_wheel(self, event): """增强的鼠标滚轮事件 - 支持缩放和滚动""" if self.original_image is None: return # 检...
Python
1
od icr; #[doc = "BDR register accessor: an alias for `Reg<BDR_SPEC>`"] pub type BDR = crate::Reg<bdr::BDR_SPEC>; #[doc = "Baudrate Divider register"] pub mod bdr; <filename>spec/src/lib.rs #![allow(deprecated)] #[cfg_attr(test, macro_use)] #[cfg(test)] extern crate serde_derive; extern crate parity_wasm; extern crate ...
Rust
0
ResultList=resolveDNS(y) #if len(tmpResultList)<1: if y not in dnsList: print y dnsList.append(y) else: count=201 #sys.exit() count+=1 tmpResultList1=[] if options.r: p = multiprocessing.Pool(processes=noOfThreads) tmpResultList = p.map(resolveDNS,dn...
Python
1
print("Operadores (Aritméticos, comparação, lógicos e de atribuição)") inteiroA = 1 inteiroB = 2 # Operadores aritméticos # Adição print(inteiroA + inteiroB) # imprime # Subtração print(inteiroA - inteiroB) # imprime # Multiplicação print(inteiroA * inteiroB) # imprime # Divisão print(inteiroA / inteiroB) # imprime ...
Python
1
_text} # Return the combined scraped text as the output else: # Web search is disabled, check if input contains URLs or list of URLs separated by commas urls = [url.strip() for url in user_input.split(',') if url.strip()] valid_urls = [] # Regular expression to...
Python
1
::Uradora), ], Limit::Haneman, Points::Ron(12000), ); } // ---- 8 han #[test] fn score_8han_25fu_chiitoi_tsumo_riichi_4dora() { let mut context = ct("4m", true); context.is_riichi = true; context.n_dora = 4; let results = score(&tiles_from_string("11334m55p22s3355z"), &vec...
Rust
0
..size { for c in 0..size { match self.cell_state(r,c) { Some(&Occupied(_)) => draw_cell(rect_occupied, r, c), Some(&Freespace) => draw_cell(rect_freespace, r, c), _ => {} } } } } } impl Draw...
Rust
0
import os import dlib import cv2 import numpy as np from .error import FaceError # Define the path to the trained model file models_dir = "trained_models" hog_face_rec_model_file_path = os.path.join(os.path.dirname(__file__), models_dir, "dlib_face_recognition_resnet_model_v1.dat") cnn_face_rec_model_file_path = os.p...
Python
1
ActionMode::Local, ) .unwrap(); assert_eq!(actual, expected); } } <filename>garnet/bin/setui/src/audio/audio_default_settings.rs // Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE...
Rust
0
(update_trail(args)) if command == "aws-cloudtrail-start-logging": return_results(start_logging(args)) if command == "aws-cloudtrail-stop-logging": return_results(stop_logging(args)) if command == "aws-cloudtrail-lookup-events": return_results(lookup_events(ar...
Python
1
upsert_stake_limit(&stash, T::Currency::minimum_balance() * STAKE_LIMIT_RATIO.into()); Staking::<T>::validate(RawOrigin::Signed(controller.clone()).into(), Default::default())?; let max_additional = T::Currency::minimum_balance() * 10u32.into(); }: _(RawOrigin::Signed(stash), max_additional) u...
Rust
0
from datetime import timedelta from uuid import uuid4 import json from producers.paymentprocessor.utils import sources, destinations from producers.utils import get_meta, JSON_HEADER from producers.base import BaseProducer class PaymentProcessorGetBillingProducer(BaseProducer): emit_probability = 0.1 def g...
Python
1
aud: None, iss: None, sub: None, algorithms: vec![jwt::Algorithm::HS256], }; Box::new(move |server_token| { check_jwt_server_token(server_token, &secret_key, &validatio...
Rust
0
{ () => { "11" }; } } } // This approximately mirrors the logic in unwind.rs. cfg_if::cfg_if! { if #[cfg(feature = "asm-unwind")] { macro_rules! asm_may_unwind { ($($asm:tt)*) => { asm_clobbers!( options(ma...
Rust
0
not provided .. issue a warning and use 0 _outs += [numpy.zeros(seeds[j][0].shape)] warning('Past value %d for output $d not given' \ %(j,tap_value)) else: _outs += [seeds[j][k]] ...
Python
1
M29)), operand3: Some(Indirect(RSI, Some(OperandSize::Qword), None)), operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: Some(MaskReg::K2), broadcast: Some(BroadcastMode::Broadcast1To8) }, &[98, 242, 149, 82, 39, 46], OperandSize::Qword) } <reponame>lmy441900/wallet.rs // Copyright 2...
Rust
0
cli_args: Optional[List[str]] namespace: Optional[str] use_global_arguments: bool enable_rosout: bool start_parameter_services: bool parameter_overrides: 'Optional[List[Parameter[Any]]]' allow_undeclared_parameters: bool automatically_declare_parameters_from_overrides: bool enable_l...
Python
1
str1, arr_l, cnt_l), } <filename>src/barnsley.rs // Copyright © 2019 <NAME>, <NAME> // Generate Barnsley's fern saved as an image // Inspired by http://rosettacode.org/wiki/Barnsley_fern // Barnsley's IFS: https://en.wikipedia.org/wiki/Barnsley_fern#Construction //! Barnsley's Fern implementation. use crate::util::*;...
Rust
0
import base64 from io import BytesIO from typing import Union from PIL import Image from vllm.connections import global_http_connection from vllm.envs import VLLM_IMAGE_FETCH_TIMEOUT from vllm.multimodal.base import MultiModalDataDict def _load_image_from_bytes(b: bytes): image = Image.open(BytesIO(b)) imag...
Python
1
me_type(TxType::H_DCT, frame_type), ) } fn print_prediction_modes_summary(&self) { info!("----------"); self.print_luma_prediction_mode_summary_by_frame_type(FrameType::KEY, 'I'); self .print_chroma_prediction_mode_summary_by_frame_type(FrameType::KEY, 'I'); info!("----------"); self ...
Rust
0
# Mở file1 để đọc with open("C:\\Users\ADMIN\\Repo\\Data_processing\\raw_data.txt", mode="r", encoding="utf8") as file1: # Mở file2 để ghi with open("C:\\Users\ADMIN\\Repo\\Data_processing\\scores_data_900k_row.txt", mode="a", encoding="utf8") as file2: # Lặp lại 12 lần for i in range(12): ...
Python
1
with_capacity(self.attributes.len()); for (k, v) in &self.attributes { attributes.push(Attribute { name: Name::local(k), value: v, }); } let namespace = Namespace::empty(); writer.write(XmlEvent::StartElement { name, ...
Rust
0
assert_eq!(str::from_utf8(key).expect("key"), "你好,遊客"); assert_eq!(val, Value::Str("米克規則")); assert!(iter.next().is_none()); // Iterators don't loop. Once one returns None, additional calls // to its next() method will always return None. assert!(iter.next().is_none()); // Reader.iter_fr...
Rust
0
tic):") print(" • Strong bias (decision score mean: -0.560)") print(" • Poor label handling (Christian samples: 0, Secular: 0)") print(" • Constant features (duration, sample_rate)") print(" • No class balancing") print(" • Accuracy: ~85% but biased") print("\nImproved Model Resul...
Python
1
self.is_open_by_index(left_index) && !self.is_full_by_index(left_index) { self.fullness.insert(left_index, true); self.fill_neighbors(left_index); } } if self.has_bottom_neighbor(index) { let diff = index & self.mask; let bottom_index ...
Rust
0
from rcph.utils.launcher import getInfo, setInfo, checkExistenceProblem from rcph.utils.tools.color import colored_text from rcph.config.constant import * def problemCheck(problem): if not checkExistenceProblem(problem): raise Exception(f'problem {problem} does not exist!') def setStatus(problem): inf...
Python
1
use driver; use driver::interner::Ident; // --- List of tokens ----------------------------------------------------------- #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub enum Token { Bang, Dollar, Percent, At, Zero, Equal, Plus, Minus, Asterisk, Dot, DoubleDot, ...
Rust
0
n write_plain_chunk( writer: Arc<Mutex<RefAsyncWriter<'_>>>, chunk: Vec<u8>, ) -> anyhow::Result<()>; async fn write_encrypted_chunk( writer: Arc<Mutex<RefAsyncWriter<'_>>>, chunk: Vec<u8>, ) -> anyhow::Result<()>; async fn write_encrypted_b64_chunk( writer: Arc...
Rust
0
Values: u32, ), >; pub const enThresholdDirection_ABOVE: enThresholdDirection = 0; pub const enThresholdDirection_BELOW: enThresholdDirection = 1; pub const enThresholdDirection_RISING: enThresholdDirection = 2; pub const enThresholdDirection_FALLING: enThresholdDirection = 3; pub const enThresholdDirection_RISING_...
Rust
0
rview CekAjaYuk adalah sistem deteksi iklan lowongan kerja palsu menggunakan Machine Learning dan Deep Learning. ## Features - Analisis gambar poster menggunakan Random Forest dan CNN - Ekstraksi teks menggunakan Tesseract OCR (Indonesia & English) - Analisis teks untuk deteksi pola mencurigakan - Interface web yang u...
Python
1
# coding:utf-8 ''' @author = super_fazai @File : 常用短信验证码curl接口.py @Time : 2017/4/25 10:33 @connect : superonesfazai@gmail.com ''' """ 直接curl xxxx """ CURL_LIST = [ r'curl "http://member.1688.com//member/ajax/send_identity_code_by_mobile.do?callback=jQuery172007067019236274064_1376100939244&mobile=${PHONE_NU...
Python
1
address_data: Vec::new(), excess_data: Vec::new(), }; let mut msghash = hash_to_message!(&Sha256dHash::hash(&unsigned_announcement.encode()[..])[..]); let valid_announcement = NodeAnnouncement { signature: secp_ctx.sign(&msghash, node_1_privkey), contents: unsigned_announcement.clone() }; match net_...
Rust
0
itemgetter inconsistency (useful in some cases) of not returning a tuple if len(items) == 1: always returns an n-tuple where n = len(items) """ if len(items) == 0: return lambda a: () if len(items) == 1: return lambda gettable: (gettable[items[0]],) return operator.itemgetter(*items...
Python
1
number_of_people = 0 def increase_user(): number_of_people = +1 def create_user(name, age, address): increase_user() user_info = {'name': name, 'age': age, 'address': address} print(f'{name}님 환영합니다!') name = ['김시습', '허균', '남영로', '임제', '박지원'] age = [20, 16, 52, 36, 60] address = ['서울...
Python
1
te::Normal, self.pos, self.dim, maybe_frame, color); // If there's a label, draw it. let val_string_color = self.maybe_label_color.unwrap_or(uic.theme.label_color); if self.maybe_label.is_some() { uic.draw_text(graphics, label_pos, font_size, val_string_color...
Rust
0
Debug)] pub enum GitGlobalError { BadSubcommand(String), Generic, } /// Our `Result` alias with `GitGlobalError` as the error type. pub type Result<T> = result::Result<T, GitGlobalError>; impl fmt::Display for GitGlobalError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { use GitGlobalErr...
Rust
0
= load_dataset(script_args.dataset_name, name=script_args.dataset_config) accelerator = Accelerator() embedding_model = AutoModel.from_pretrained( "nomic-ai/nomic-embed-text-v1.5", trust_remote_code=model_args.trust_remote_code, safe_serialization=True, torch_dtype=torch.bfloat...
Python
1
import matplotlib.pyplot as plt import numpy as np import sys import mousedata_add, ImportData import Cal, CFD, KF_v2, zero_phase_filter # MAIN if __name__ == "__main__": # Constant SamplingTime = 0.001 CPI = 1600 ## 木盤半徑12.5 壓克力盤半徑12.53 wood = 12.5 plastic = 11.945 #11.62 #11.14 # 12.53 ...
Python
1
ue = BlockQueue::<Client>::new(config, engine, IoChannel::disconnected(), true); let num_cpus = ::num_cpus::get(); assert_eq!(queue.num_verifiers(), num_cpus); } #[test] fn worker_threads_scaling_with_specifed_num_of_workers() { let num_cpus = ::num_cpus::get(); // only run the test with at least 2 ...
Rust
0
# Copyright (C) 2024-present Naver Corporation. All rights reserved. # Licensed under CC BY-NC-SA 4.0 (non-commercial use only). # # -------------------------------------------------------- # Dataloader for preprocessed WildRGB-D # dataset at https://github.com/wildrgbd/wildrgbd/ # See datasets_preprocess/preprocess_wi...
Python
1
struct AssignmentPatternList { pub nodes: (ApostropheBrace<List<Symbol, Expression>>,), } #[derive(Clone, Debug, PartialEq, Node)] pub struct AssignmentPatternStructure { pub nodes: (ApostropheBrace<List<Symbol, (StructurePatternKey, Symbol, Expression)>>,), } #[derive(Clone, Debug, PartialEq, Node)] pub str...
Rust
0
70, 0xe4, 0x4e, 0xd5, 0x50, 0xa1, 0x63, 0x8d, 0x70, 0xa0, 0xea, 0xd6, 0xa4, 0x32, 0x53, 0x2e, 0xdd, 0x11, 0xe8, 0xc4, 0xcd, 0xb1, 0xba, 0x3, 0x30, 0x34, 0x6a, 0xf2, 0x45, 0x20, 0xee, ]); let nonce = Nonce::from_public_slice(&[ 0x4d, 0x7b, 0x9e, 0x2c, 0x38, 0x1d, 0x43, 0xfd, 0x21, 0x61, 0...
Rust
0
URSS$)Nr)rs rMrParseExpression.recurseKzz!}r_cJURRU5 SUlU$)Nrrrb)rrs rMrParseExpression.appendN! %   r_c...
Python
1
# Placeholder for Crawl4AI integration from crawl4ai import AsyncWebCrawler class Crawl4AIWrapper: def __init__(self): self.crawler = AsyncWebCrawler() async def fetch_and_parse(self, url: str) -> str: # TODO: Implement actual crawling and parsing return f"Fetched and parsed content f...
Python
1
:new("L", "Leading_Jamo"))); hangul_gen.add(Box::new(UcdTableGen::new("V", "Vowel_Jamo"))); hangul_gen.add(Box::new(UcdTableGen::new("T", "Trailing_Jamo"))); // 9.10. Unassigned (J) // J: General_Category(cp) is in {Cn} and // Noncharacter_Code_Point(cp) = False gc_gen.add(Box::new(UnassignedT...
Rust
0
import geocoder import cv2 from ultralytics import YOLO from twilio.rest import Client # Twilio credentials (replace with your actual details) account_sid = "your_account_sid_here" auth_token = "your_auth_token_here" twilio_number = "+your_twilio_phone_number" to_number = "+your_verified_phone_number" # List of dange...
Python
1
: 0u64.into(), }, GravitySignature { power: 291759231, eth_address: "0xF<KEY>" .parse() .unwrap(), v: 0u64, r: 0u64.into(), s: 0u64.into(), }, GravitySi...
Rust
0
ubadd213pd = 928, Vfmsubadd213ps = 929, Vfmsubadd231pd = 930, Vfmsubadd231ps = 931, Vfmsubaddpd = 932, Vfmsubaddps = 933, Vfmsubpd = 934, Vfmsubps = 935, Vfmsubsd = 936, Vfmsubss = 937, Vfnmadd132pd = 938, Vfnmadd132ps = 939, Vfnmadd132sd = 940, Vfnmadd132ss = 941, Vfnmadd213pd = 942, Vfnmadd213ps = 943,...
Rust
0
"parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", ...
Rust
0
We test the method self.controller.draw_file_explorer() # We check that the draw_file_explorer() method of the view was called self.controller._file_explorer_view.draw_file_explorer.assert_called_once() def test_draw_file_explorer_when_closed(self): # We simulate that the file ...
Python
1
_inner_jar: fat_jar_content_dir = os.path.join(temp_dir, "fat_jar_content_dir") os.mkdir(fat_jar_content_dir) # copy inner.jar into an appropriate location for packaging inner_jar_file = os.path.join(fat_jar_content_dir, "inner.jar") if generate_wrapper: ...
Python
1
# gt_mesh.vertices = o3d.utility.Vector3dVector(gt_mesh_tri.vertices) # gt_mesh.triangles = o3d.utility.Vector3iVector(gt_mesh_tri.faces) gt_mesh = o3d.io.read_triangle_mesh(gt_mesh_path) vertices = np.asarray(gt_mesh.vertices) # print('x range:', np.min(vertices[:, 0]), np.max(vertices[:, 0])) #...
Python
1
ls.set_seed(30) >>> input_ids = x_token.input_ids.to(device) >>> token_type_ids = x_token.token_type_ids.to(device) >>> gen_token = model.generate(input_ids, token_type_ids=token_type_ids, max_new_tokens=50) >>> tokenizer.decode(gen_token[0]) "織田信長は、政治・外交で数々の戦果を上げるが、1568年からは、いわゆる...
Python
1
<h2 style="margin: 0; font-size: 1.8rem; font-weight: 700;">🌿 玉米苗期病害诊断专家</h2> <p style="margin: 8px 0 0 0; font-size: 1.1rem; opacity: 0.9;">苗期病害早期识别与防治指导系统</p> </div> """) # 功能介绍卡片 - 蓝色主题 with gr.Row(): with gr.Column(scale=1): ...
Python
1
test!( test_real_program, [ Move(1), Add(1), Add(1), Add(1), Add(1), Add(1), JumpIfZero(25), Add(-1), Move(-1), Add(1), Add(1), Add(1), Move(1), Move(1), Add(1), Add(1), Add(1), Add(1), Add(1), Add(1), Move(1), Add(1), Add(1), Move(-1), Move(-1), JumpIfNonZero(6), Move(-1), JumpIfZero(...
Rust
0
ER_TCD6_CITER_ELINKYES_SPEC>; #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Enabled)"] pub mod citer_tcd6_citer_elinkyes; #[doc = "TCD6_DLASTSGA register accessor: an alias for `Reg<TCD6_DLASTSGA_SPEC>`"] pub type TCD6_DLASTSGA = crate::Reg<tcd6_dlastsga::TCD6_DLASTSGA_SPEC>; #[doc = "TCD Last...
Rust
0
#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum TextureMode { /// Expands the texture to fit the object Clamp, /// Repeats the texture instead of stretching Repeat, /// Repeats the texture, but mirrors it on edges MirrorRepeat, } /// Defines file format of the texture to load ...
Rust
0
"""Gradio interface for Remote Sensing Image Generation""" import gradio as gr from pathlib import Path from model import RemoteInferenceModel from utils.constants import UI_CONFIG from utils.logger import setup_logger logger = setup_logger( "gradio_app", Path("logs/gradio_app.log") ) def create_interface(): ...
Python
1
|token| token.check_structure()) .chain( self.arg_tokens() .filter_map(|token| token.check_structure()), ) .collect() } } impl<'a, T: ModuleAccess> SignatureCheck for TypeSignatureView<'a, T> { fn check_signatures(&self) -> Vec<VMStaticVio...
Rust
0
ៃឡើងវ\u{17b7}ញ"), keywords: &[ "កែច\u{17d2}នៃ", "សញ\u{17d2}ញា", "សញ\u{17d2}ញាកែច\u{17d2}នៃឡើងវ\u{17b7}ញ", ], }, #[cfg(feature = "kn")] crate::Annotation { lang: "kn", tts: Some("ಮರುಬಳಕ\u{cc6}ಯ ಚ\u{cbf...
Rust
0
: u64 = 0x8ff0; // Address for the TSS setup pub const KVM_TSS_ADDRESS: u64 = 0xfffb_d000; // The 'zero page', a.k.a linux kernel bootparam const ZERO_PAGE_START: u64 = 0x7000; const BOOT_GDT_OFFSET: u64 = 0x500; const BOOT_IDT_OFFSET: u64 = 0x520; const BOOT_GDT_MAX: usize = 4; const EFER_LMA: u64 = 0x400; const EFER...
Rust
0
from bot.session_manager import Session from common.log import logger class OpenAISession(Session): def __init__(self, session_id, system_prompt=None, model="text-davinci-003"): super().__init__(session_id, system_prompt) self.model = model self.reset() def __str__(self): # 构造...
Python
1
from __future__ import absolute_import, division, print_function from builtins import range # import organ import os import numpy as np import pandas as pd import csv import time import pickle import gzip import math import random from rdkit import rdBase from rdkit import DataStructs from rdkit.Chem import AllChem as ...
Python
1
self.unknown_fields.clear(); } } impl ::std::fmt::Debug for Response { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } impl ::protobuf::reflect::ProtobufValue for Response { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValue...
Rust
0
x_mean_i_ = (n*xtrain_mean - n_i*x_mean_i) / n_i_ y_mean_i_ = (n*ytrain_mean - n_i*y_mean_i) / n_i_ x_mean_i__ = x_mean_i - xtrain_mean y_mean_i__ = y_mean_i - ytrain_mean xtx_i_ = self.xtx - xtx_i - (n_i*n/n_i_) * np.outer(x_mean_i__, x_mean_i__) xty_i_ = self.xty - ...
Python
1
= vec![]; let curr_buf = &mut self.curr_buf; let prev_buf = &mut self.prev_buf; for area in areas { let curr_buf = curr_buf.subset(area)?; let prev_buf = prev_buf.subset(area)?; prev_buf.diff(&curr_buf, &mut updates); } // log::info!("updates=...
Rust
0
).unwrap() ); } if !vec_val.into_vector().is_empty() { return Err(self.usr_abort(DESTROY_NON_EMPTY_VEC)); } Ok(()) } fn native_vector_swap( &self, vec_val: TypedValue, lhs: TypedValue, rhs: TypedValue, ) -> Result<Typed...
Rust
0
def mitad_palabra(cant_letras_en_palabra): return cant_letras_en_palabra // 2 def principal(): m = open("silaba de.txt") texto = m.read() m.close() cant_palabras_con_digitos = 0 cant_letras_en_palabra = 0 cant_palabras = 0 bandera_hay_digito = False bandera_de = False cant_pal...
Python
1
TenDBClusterClusterHandler.get_remote_infos( cluster.storages ) # 创建或获取 RemoteDB 和 RemoteDR 组 db_group = _get_or_create_group(remote_db, "RemoteDB") dr_group = _get_or_create_group(remote_dr, "RemoteDR") # 将实例添加到相应的组中 _add_nodes_to_group(remote_db, db_group)...
Python
1
abe_position::*; // use memory::uchu::*; use teigi::conv::*; use teigi::shogi_syugo_seki::*; use teigi::banjometries::*; use searcher_impl::*; /** * 後手視点で、相手らいおんの南側1升に、頭が丸い自駒がない? */ pub fn is_s(searcher: &Searcher) -> bool { // 相手玉の位置 let ms_r = searcher.cur_position.ms_r[searcher.game_record.get_teban(Jiai...
Rust
0
-q, --quiet No output printed to stdout --color WHEN Coloring: auto, always, never --message-format FMT Error format: human, json [default: human] --frozen Require Cargo.lock and cache are up to date --locked Require C...
Rust
0
if root_ind in seen_ever: return [] seen_ever = seen_ever.union(set([root_ind])) for to_ind in self.digraph[root_ind].edges: cycle = cycle_dfs(to_ind, here) if cycle: return cycle return [] for ind in ran...
Python
1
""" The script reads the content of each .cpp file line by line. If it finds a line that starts with a double quote ("), it merges that line with the previous line by removing the newline from the previous line and appending \\n. It then writes the modified content back to the file. printf ("a[50][50]=%d ", ...
Python
1
nums[i] + nums[j] + nums[k]; if tmp == target { return tmp; } if (ans - target).abs() > (tmp - target).abs() { ans = tmp; } if tmp > target { k -= 1; } else { ...
Rust
0
/* I2C1 Serial Data */ I2C2_SCLK = 130, /* I2C2 Serial Clock */ I2C2_SDA = 131, /* I2C2 Serial Data */ CMOS_XCLK = 132, /* DVP System Clock */ CMOS_RST = 133, /* DVP System Reset */ CMOS_PWDN = 134, /* DVP Power Down Mode */ CMOS_VSYNC = 135, /* DVP Vertical Syn...
Rust
0
# freda (todo) : import torch.nn as nn import torch import numpy as np def conv(batchNorm, in_planes, out_planes, kernel_size=3, stride=1): if batchNorm: return nn.Sequential( nn.Conv2d(in_planes, out_planes, kernel_size=kernel_size, stride=stride, padding=(kernel_size-1)//2, bias=False), ...
Python
1
use', 'Dists all close reuse' ]) for d in range(2, 70, 4): for k in range(2, 70, 4): # for d in [14]: # for k in [30]: validator = TestFRNN(D=d, K=k, backward=True) # results = validator.compare_frnn_knn() r...
Python
1
for v in graph[u]: # Calculate the energy transferred to machine v transferred_energy = current_energy * scale[u] if transferred_energy > max_energy[v]: max_energy[v] = transferred_energy heapq.heappush(pq, (-transferred_energy, v)) # The ma...
Python
1
= 3, #[doc = "4: Select shared service request line 0"] VALUE3 = 4, #[doc = "7: Select shared service request line 3"] VALUE4 = 7, } impl From<REV5NP_A> for u8 { #[inline(always)] fn from(variant: REV5NP_A) -> Self { variant as _ } } #[doc = "Field `REV5NP` reader - Service Request ...
Rust
0
NT_PATH, write).expect("Couldn't write to recent file"); println!("{} Written {} to file", chrono::Local::now(), value); warn!("Written {} to file", value); } } pub fn format_selector(main: &Channel, which: &RecentHtmlTarget, index: u32) -> Selector { return match which { RecentHtmlTarget::Pin => { Selector...
Rust
0
odel_ft = train_model(model_ft, criterion, optimizer_ft, exp_lr_scheduler, num_epochs=1) ###################################################################### # visualize_model(model_ft) ###################################################################### # ConvNet as fixed feature extract...
Python
1
import os class Config(object): # Telegram Bot ka token BOT_TOKEN = "8181526702:AAGXxvYXRnMi6PQJ8KzK-09QqSEYPrze8X4" # Telegram API ki ID API_ID = 21705536 # Telegram API ki hash key API_HASH = "c5bb241f6e3ecf33fe68a444e288de2d" # Admin users ki IDs (comma se separate ki hui) ADMIN = '5...
Python
1
# 3. Inheritance # Problem: Create an ElectricCar class that inherits from the Car class and has an additional attribute battery_size. class Car: def __init__(self, brand, model): self.brand = brand self.model = model def fullname(self): return f"{self.brand} {self.model}" class Elec...
Python
1
import django_filters from .models import AppointmentOrder class AppointmentOrderFilter(django_filters.FilterSet): national_code = django_filters.CharFilter(field_name="patient__user__national_code", lookup_expr='exact') tracking_code = django_filters.CharFilter(field_name="tracking_code", lookup_expr='exact'...
Python
1
type="int", \ metavar="NAME", \ help="Verbosity level" ) # # --- Get and parse options # opts, args = opts.parse_args() # # --- Check option values # if ( opts.config == None ): print ( "Configuration file is not specied. Try get_geos_o...
Python
1
(tabptr.offset(1)) as usize); let name_cstr = CStr::from_ptr(tabptr.offset(2) as *const c_char); // TODO Check memory allocations let name: String = String::from_utf8(Vec::from(name_cstr.to_bytes())).unwrap(); // TODO Avoid the double lookup. ...
Rust
0
(); cd_home(); }); } // -- convenience functions - pub fn cd_home() { env::set_current_dir(Path::new(&HOME.path())).unwrap(); println!("HOME directory: {}", HOME.path().display()) } pub fn cd_repo() { env::set_current_dir(Path::new(&HOME.path()).join("repo")).unwrap(); } pub fn reset_repo() ...
Rust
0