text
string
label_name
string
labels
int64
get_graphic_data_mut().get_chart_space_mut().get_print_settings_mut().get_page_margins_mut().set_header(0.3); graphic_frame.get_graphic_mut().get_graphic_data_mut().get_chart_space_mut().get_print_settings_mut().get_page_margins_mut().set_footer(0.3); self.two_cell_anchor.set_graphic_frame(graphic_frame...
Rust
0
vol( //! # return_type: CalcReturnType, //! # vol_cor_type: CalcVolatilityType, //! # account_id: Self::AccountId, //! # ) -> Result<Self::Price, DispatchError> {Ok(0)} //! # fn calc_portf_var( //! # return_type: CalcReturnType, //! # vol_cor_type: CalcVolatilityType, //! # ...
Rust
0
f'Unsafe Rate/{model}': stats_per_model["unsafe_rates"][model], 'time': current_time }) # Log overall metrics to wandb total_tokens = sum(stats["total_tokens"] for stats in database.orig_database.database_worker_counter_dict.values()) total_prompt_tokens = sum(stats["to...
Python
1
#-*- encoding: utf-8 -*- import sys import codecs from gensim import models def _input_streaming(in_fpath, return_raw = False): with codecs.open(in_fpath, "r", "utf-8") as rfd: for line in rfd: word_seg = line.strip("\n").split() yield word_seg def train_word2vec_model(corpus_f...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Sale Loyalty', 'summary': 'Use discounts and loyalty programs in sales orders', 'description': 'Integrate discount and loyalty programs mechanisms in sales orders.', 'category': 'Sales/Sales', ...
Python
1
.get() } fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { &self.unknown_fields } fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { &mut self.unknown_fields } fn as_any(&self) -> &dyn (::std::any::Any) { self as &dyn (::std::any::Any) ...
Rust
0
import bpy from .. utils . module_util import installModule class BF_InstallModule(bpy.types.Operator): bl_idname = 'an_bluefox_extension.install_module' bl_label = 'Install Python Module' bl_description = 'Installs given Python module with pip' bl_options = {'INTERNAL'} name: bpy.props.StringProp...
Python
1
from cms.plugin_pool import plugin_pool from django.utils.translation import gettext_lazy as _ from ... import settings from ...cms_plugins import CMSUIPlugin from ...common import AttributesMixin, BackgroundMixin, ResponsiveMixin, SpacingMixin from .. import icon from . import forms, models mixin_factory = settings....
Python
1
on: car_R = car_detection[0].pose_R car_t = car_detection[0].pose_t if floor_detection: ground_R = floor_detection[0].pose_R ground_t = floor_detection[0].pose_t frame = draw_axes(image, car_R, car_t, K) ...
Python
1
fn next(&mut self) -> Option<Self::Item> { if self.1 >= self.2 { None } else { let ret = self.0.get_unchecked(self.1); self.1 += 1; Some(ret) } } } impl ::std::iter::ExactSizeIterator for CellDepVecIterator { fn len(&self) -> usize { ...
Rust
0
); self.w } } #[doc = "Field `kcal_ratio_2416` reader - "] pub struct KCAL_RATIO_2416_R(crate::FieldReader<u16, u16>); impl KCAL_RATIO_2416_R { pub(crate) fn new(bits: u16) -> Self { KCAL_RATIO_2416_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for KCAL_RATIO_2416_R { type T...
Rust
0
S of the IP.") parser.add_argument("--verbose", "-v", help="Print debug messages.", action="store_true") parser.add_argument("--check", "-c", help="If present, the user will be asked to confirm each deletion from the " "logs.", action="store_true") ...
Python
1
&parser, "<icon=3667>Anthem of Avoidance gives all targets +4% Melee Evasion for 8 seconds", vec![3667], vec![], 1, ); test_icon_id_effect( &parser, "<icon=3440><icon=2123><icon=2118>Psychoanalyze, Tell Me About Your Mother, and You Were Adopted Damage +15", ...
Rust
0
pos: plotters_backend::text_anchor::VPos::Center, }, }, ) .expect("Something went wrong with setting the root area's title."); let x_axis = (0f32..180f32).step(0.5); let mut cc = ChartBuilder::on(&root_area) .margin(5) .set_all_label_area_size(50) ...
Rust
0
aml(rt) } // OCaml = val find : tree -> key -> value option Lwt.t fn tezedge_tree_find( rt, tree: OCamlRef<DynBox<WorkingTreeFFI>>, key: OCamlRef<OCamlList<String>>, ) -> OCaml<Result<Option<OCamlBytes>, String>> { let ocaml_tree = rt.get(tree); let tree: &Workin...
Rust
0
For information about available fields see [sensres](index.html) module"] pub struct SENSRES_SPEC; impl crate::RegisterSpec for SENSRES_SPEC { type Ux = u32; } #[doc = "`read()` method returns [sensres::R](R) reader structure"] impl crate::Readable for SENSRES_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` ...
Rust
0
ult"] = -2 obj["errmsg"] = "connect failed:\t" + str(e) result = json.dumps(obj) finally: if con: con.close() return result if __name__ == "__main__": parser = argparse.ArgumentParser(description="script for sending alarm sms_type") parser.add...
Python
1
self.grad_scaler.step(self.optimizer) self.grad_scaler.update() def train(self, data_loader, **kwargs): self.model.train() self.mode = 'train' self.data_loader = data_loader self._epoch = data_loader.epoch data_batch = next(data_loader) self.call_hook('bef...
Python
1
my_dict = {} if len(my_dict) == 0 : print("Empty") else: print("Not Empty")
Python
1
ValueError("hello"),)) assert excinfo.type is ExceptionGroup assert excinfo.value.exceptions[0].args == ("hello",) assert isinstance(excinfo.tb, TracebackType) def test_deprecated_strict() -> None: """`strict` has been replaced with `flatten_subgroups`""" # parameter is not included in overloaded ...
Python
1
nSize: mem::size_of::<winapi::PIXELFORMATDESCRIPTOR>() as u16, nVersion: 1, dwFlags: winapi::PFD_DRAW_TO_WINDOW | winapi::PFD_SUPPORT_OPENGL | winapi::PFD_DOUBLEBUFFER, iPixelType: winapi::PFD_TYPE_RGBA, cColorBits: 24, cRedBits: 0, cRedShift: 0, cGreenBits: 0, ...
Rust
0
pub fn rte_mempool_cache_create( size: u32, socket_id: ::std::os::raw::c_int, ) -> *mut rte_mempool_cache; } extern "C" { pub fn rte_mempool_cache_free(cache: *mut rte_mempool_cache); } extern "C" { pub fn rte_mempool_avail_count(mp: *const rte_mempool) -> ::std::os::raw::c_uint; } extern "C...
Rust
0
is represented within the event by a fixed /// point number or an integer, the result is scaled to the appropriate range /// as part of creating the floating-point representation. fn CGEventGetDoubleValueField(event: ::sys::CGEventRef, field: CGEventField) -> f64; /// Set the floating-point value of a...
Rust
0
tkzmv-upv-kirzezex-529[zpysg] lxaaxbren-lqxlxujcn-mnenuxyvnwc-953[nxlac] clxalrtyr-prr-nfdezxpc-dpcgtnp-457[prcdl] sorozgxe-mxgjk-kmm-vaxingyotm-228[ugkxd] vdzonmhydc-eknvdq-otqbgzrhmf-469[jnsrl] gsvvswmzi-gspsvjyp-nippcfier-hizipstqirx-802[mvkcd] xgvnndadzy-xviyt-xjvodib-yzkgjthzio-707[ncejo] ...
Rust
0
; #[phase(plugin, link)] extern crate log; use hammer::{FlagConfig,FlagConfiguration}; use std::os; use std::io::process::{Command,InheritFd,ExitStatus,ExitSignal}; use serialize::Encodable; use cargo::{GlobalFlags, NoFlags, execute_main_without_stdin, handle_error, shell}; use cargo::core::MultiShell; use cargo::util...
Rust
0
ambda: self.oven.set_unlocked(True)) layout_util.add_to_layout( layout_util.add_sublayout(layout, QHBoxLayout), unlock_button, lock_button ) def create_lock_signal_widgets(self, layout): acquire_button = QPushButton("Emit Acquired") acquire_button.pressed.connect(lambda:...
Python
1
elif 'kuwo' in name: border_color = '#CB83F7' elif 'kugou' in name: border_color = '#01D07F' elif 'yizhibo' in name: border_color = '#2B2C2E' vbox_list = QVBoxLayout() vbox_list.setS...
Python
1
''' (file_lg_name, file_sub_name) = settings.get_zoom_output() file_lg_txt = open(file_lg_name, 'wb') file_lg_txt.write(file_lg_header) file_sub_txt = open(file_sub_name, 'wb') file_sub_txt.write(file_sub_header) # Subhalo mass function variables file_png_mfs1 = settings.get_png_output('mf_01') file_png_mfs2...
Python
1
oneNumberVerificationCodeBuilder { inner: ResendPhoneNumberVerificationCode, } impl RTDResendPhoneNumberVerificationCodeBuilder { pub fn build(&self) -> ResendPhoneNumberVerificationCode { self.inner.clone() } } impl AsRef<ResendPhoneNumberVerificationCode> for ResendPhoneNumberVerificationCode { ...
Rust
0
let small_limit = 240 * sieve.len() as u64; // Correct the first entry of the sieve to only contain 1's in positions corresponding to true // prime numbers - this just speeds things up a little as it prevents the iterator from // accidentally considering non-primes early in its life. sieve[0] = 0b11111...
Rust
0
""" return FsNodeService.download_folder_sub_node(resource_id=id_, sub_file_path=data.sub_file_path) class RenameSubNodePath(BaseModelDTO): sub_node_path: str new_name: str @core_app.put("/fs-node/{id_}/folder/rename-sub-node", tags=["Files"], summary="Rename a sub file of a folder") def rename_folder...
Python
1
_val"]) df["rhythmdiv"] = df["features"].apply(lambda x: x["rhythmdiv_val"]) df["polyph_cls"] = df["features"].apply(lambda x: x["polyph_cls"]) df["rfreq_cls"] = df["features"].apply(lambda x: x["rfreq_cls"]) df["harmdiv_cls"] = df["features"].apply(lambda x: x["harmdiv_cls"]) df["rhythmdiv_cls"] = ...
Python
1
en"), "Hello Fred!"); } #[test] fn it_interpolates_multiple_vars() { assert_eq!( t!("multiple.vars", bingo: "bingo", name: "Fred", thing: "thing", "fr"), "Nom: Fred, Truc: thing, bingo: bingo" ); } #[test] fn it_interpolates_inconsistent_vars() { ...
Rust
0
UNIX_EPOCH } } pub fn fuse_attr_into_proto_attr(fuse_attr: FileAttr, name: &str) -> PbAttr { PbAttr { name: name.to_string(), r#type: match fuse_attr.kind { FileType::Directory => PbEntryType::Dir.into(), FileType::RegularFile => PbEntryType::File.into(), _...
Rust
0
", ); } #[test] fn test_is_ascii_digit() { assert_all!(is_ascii_digit, "", "0123456789", ); assert_none!(is_ascii_digit, "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOQPRSTUVWXYZ", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}...
Rust
0
to use for the pipeline. Choose any of " "`chat`, `codegen`, `text-generation`", ) @click.option( "--stream/--no_stream", is_flag=True, default=False, help="Whether to stream output as generated or not", ) def main( model_path: str, data: Optional[str], sequence_length: int, samplin...
Python
1
that can be written to the field `IDLE`"] pub enum IDLEW { #[doc = "The CPU clock domain is stopped"] CPU, #[doc = "The CPU and AHB clock domains are stopped"] AHB, #[doc = "The CPU, AHB and APB clock domains are stopped"] APB, } impl IDLEW { #[allow(missing_docs)] #[doc(hidden)] #[...
Rust
0
from openai import OpenAI # pip install openai # if you saved the key under a different environment variable name, you can do something like: client = OpenAI( api_key="Your Api key from chatGPT", ) completion = client.chat.completions.create( model="gpt-3.5-turbo", messages=[ {"role": "system", "content":...
Python
1
; // println!("brain activity: {:#?}", brain.build_activity_map()); } #[test] fn test_offspring_builder() { let brain_a = BrainBuilder::new() .config(Config::default()) .neurons(1000) .connections(1000) .min_neurogenesis_range(0.1) .max_neurogenesis_range(10.0) ....
Rust
0
from pages.base_page import BasePage from pages.locators import sale_page as sales class SalePage(BasePage): page_url = 'https://magento.softwaretestingboard.com/sale.html' def check_all_sales_cards_are_displayed(self): self.find_element(sales.MAIN_SALE) self.find_element(sales.MEN_SALE) ...
Python
1
import os import yaml from datetime import datetime BASE_PATH = os.path.expanduser("~/Documents/GitHub/Mind/Narion_MIND_Cleaned_Structure") SKK_PATH = os.path.join(BASE_PATH, "skk") LAYER0_PATH = os.path.join(BASE_PATH, "layer0.yaml") def scan_ids(folder): """Sammelt alle YAML-Dateien im Ordner und extrahiert IDs...
Python
1
acing::error!("Copy/cut action denied: {:?}", err); } }; wasm_bindgen_futures::spawn_local(future); } } } fn cursor_web_name(cursor: egui::CursorIcon) -> &'static str { match cursor { egui::CursorIcon::Alias => "alias", egui::CursorIcon::AllScroll...
Rust
0
let draw_letters = vec![true; alphabet.len()]; let mut model = Model { joined_text, alphabet, counters, draw_letters, draw_lines: false, draw_text: true, }; count_characters(&mut model); model } fn view(app: &App, model: &Model, frame: Frame) { let...
Rust
0
mod identity { // Windows.Security.Authentication.Identity use crate::prelude::*; DEFINE_IID!(IID_IEnterpriseKeyCredentialRegistrationInfo, 942807756, 26411, 18467, 182, 3, 107, 60, 117, 61, 175, 151); RT_INTERFACE!{interface IEnterpriseKeyCredentialRegistrationInfo(IEnterpriseKeyCredentialRegistrationInfoVtbl): IInsp...
Rust
0
[ "Anne Arundel", ], '33A': [ "Anne Arundel", ], '33B': [ "Anne Arundel", ], '34A': [ "Cecil", "Harford", ], '34B': [ "Cecil", ], '35A': [ "Harford", ], '35B': [ "Harford", ], '36': [ "Caroli...
Python
1
"thumbv6" => Arch::THUMBV6, "thumbv7" => Arch::THUMBV7, "wasm32" => Arch::WASM32, "x86" => Arch::X86, "x86_64" => Arch::X86_64, _ => return Err(Error), }; Ok(arch) } } impl fmt::Display for Arch { fn fmt(&self, f: &mut fmt...
Rust
0
rks.acknowledgement.save_acknowledgements( [30], acknowledged_werks_mk=acknowledge_werks_file ) # let's update to 2.6.0: save_werks_to_site(WERKS_260) update_config() cmk.utils.werks.acknowledgement.save_acknowledgements( [50], acknowledged_werks_mk=acknowledge_werks_file ) w...
Python
1
test_name!()); let request = protocol::get_ddns_config(); service.complete_initial_setup(); let response = service.fetch(&request); assert_eq!(response.status(), StatusCode::UNAUTHORIZED); service.login(); let response = service.fetch(&request); assert_eq!(response.status(), StatusCode::FORBIDDEN); } #[test] ...
Rust
0
""" 测试SiadaRunner的流式功能 """ import asyncio import pytest from siada.services.siada_runner import SiadaRunner from agents import RunResult, RunResultStreaming class TestStreamRunner: """测试SiadaRunner的流式功能""" @pytest.mark.asyncio async def test_run_agent_normal_mode(self): """测试普通模式运行Agent""" ...
Python
1
_t = 52; pub const ALPM_ERR_LIBCURL: alpm_errno_t = 53; pub const ALPM_ERR_EXTERNAL_DOWNLOAD: alpm_errno_t = 54; pub const ALPM_ERR_GPGME: alpm_errno_t = 55; // alpm_pkgreason_t pub const ALPM_PKG_REASON_EXPLICIT: alpm_pkgreason_t = 0; pub const ALPM_PKG_REASON_DEPEND: alpm_pkgreason_t = 1; // alpm_pkgfrom_t pub const ...
Rust
0
} // By default, the method directly of the type will be called let person = Human; person.fly(); // "*waving arms furiously*" // To call trait specific methods, we need to use the trait Pilot::fly(&person); Wizard::fly(&person); // We can also do it with the struct Human::fly(&pe...
Rust
0
exture::set_texture_filters_to_nearest.system()) .add_system(update_map.system()) .run(); } use super::*; use crate::typenum::consts::True; use crate::value::ToValue; /// (Start..End) pub type Range<Start, End> = BitAnd<Ge<Arg, Start>, Lt<Arg, End>>; impl<T, Start, End> ToValue<core::ops::Range<T>> fo...
Rust
0
ub fn new(wallet: Arc<Mutex<T>>) -> ForeignAPIHandler<T, C, K> { ForeignAPIHandler { wallet, phantom: PhantomData, phantom_c: PhantomData, } } fn build_coinbase( &self, req: Request<Body>, mut api: APIForeign<T, C, K>, ) -> Box<dyn Future<Item = CbData, Error = Error> + Send> { Box::new(parse_b...
Rust
0
from typing import Any, List from langchain_core.retrievers import BaseRetriever from langchain_core.callbacks import CallbackManagerForRetrieverRun from langchain_core.documents import Document from langchain_core.pydantic_v1 import Field import logging from typing import Optional from uuid import uuid4 logger = logg...
Python
1
ending_value(pageviews_today: int, book_events_today: int) -> int: return pageviews_today + book_events_today * 10 def compute_trending_z_score(value_today: int, past_values: list[int]) -> float: """ Calculate the trending z-score for the last 24h compared to the past events. I.e. How many standard de...
Python
1
gure_number) plt.get_current_fig_manager().window.wm_geometry(str(subfigure_width) + "x" + str(subfigure_height) + "+" + str(subfigure_width*col_index) + "+" + str(subfigure_height*row_index)) fig.canvas.set_window_title('bspline_acc') for i in range(3): ax1 = plt.subplot(3, 1, i+1) plt.plo...
Python
1
lf, cf: &rocksdb::ColumnFamily, key: &K) -> Option<V> where K: IntoDisk, V: FromDisk, { let key_bytes = key.as_bytes(); // We use `get_pinned_cf` to avoid taking ownership of the serialized // format because we're going to deserialize it anyways, which avoids an ...
Rust
0
LockHash = 3, Type = 4, TypeHash = 5, } impl CellField { fn parse_from_u64(i: u64) -> Result<CellField, Error> { match i { 0 => Ok(CellField::Capacity), 1 => Ok(CellField::Data), 2 => Ok(CellField::DataHash), 3 => Ok(CellField::LockHash), ...
Rust
0
ead = get_unread(SLATE_NEW); if unread.is_err() { error!("Listening exited for some keybase api failure"); break; } for (msg, channel) in &unread.unwrap() { let blob = Slate::deserialize_upgrade(&msg); match blob { Ok(message) => { let slate: Slate = message.clone().into(); let...
Rust
0
[0] == 0 { skip = true; } }, 0b00111111 => { // IFN, conditionally skip next instruction let mask = (iword0 & 0xFF) as u8; if mask & cpu.F[0] != 0 { skip = true; } }, // RMX 0b01000000 => { // RMX L, load word let addr ...
Rust
0
import pytest import pandas as pd from pandas.core.arrays import period_array class TestReductions: def test_min_max(self): arr = period_array( [ "2000-01-03", "2000-01-03", "NaT", "2000-01-02", "2000-01-05", ...
Python
1
Error(f"cannot parse {type(x)} as dtype") def index(x, i): """ Batched, broadcasting index of x along dimension i.ndim. For example, if x has shape (1, 2, 3, 4, 5) and i has shape (1, 1, 3) then the result has shape (1, 2, 3, 5) and each value in i must be between 0 and 3. """ assert x.ndim >...
Python
1
each run to the middle fn continually_modify_middle_text_of_1_of_3(c: &mut Criterion) { let _ = env_logger::try_init(); let font = FontRef::try_from_slice(TEST_FONT).unwrap(); let mut brush = GlyphBrushBuilder::using_font(font).build(); let text = LIPSUM; let middle_index = { let mut ci = ...
Rust
0
import traceback from src.main.utility.logging_config import * class ParquetWriter: def __init__(self, mode, data_format): self.mode = mode self.data_format = data_format def dataframe_writer(self, df, file_path): try: df.write.format(self.data_format) \ .o...
Python
1
#!/usr/bin/env python3 import paramiko import os import re import matplotlib.pyplot as plt SSH_ALIAS = "debian-local" BENCHMARK_CMD = "/root/benchmark" # your remote command throughput_pattern = re.compile(r"([\d.]+)\s+MiB/s") def main(): # Load SSH config from ~/.ssh/config ssh_config_path = os.path.expan...
Python
1
Maker; #[test] fn document_basic() { let mut id_maker = ObjectIdMaker::new(); let _doc = Document::new(&mut id_maker); assert_eq!(2 + 2, 4); } #[test] fn print_value_size() { let size = std::mem::size_of::<crate::Value>(); assert_eq!(size, 16); } } <rep...
Rust
0
#!/usr/bin/env python3 """ Quick script to find all available cameras and their indices This will help identify which camera ID is the OBS Virtual Camera """ import cv2 def list_available_cameras(max_cameras=10): """List all available cameras""" print("Scanning for available cameras...\n") print("=" * 60)...
Python
1
4,6,12,3] 26 5 7 7 6 6 2 12 [1,2,3,4,5,6,7,2,10,12,28,15,36,2,4,6,8,10,4,10,9,20,4,6,12,3,12] 27 6 7 3 6 3 1 3 [1,2,3,4,5,6,7,2,10,12,2...
Python
1
gt_dico, tgt_emb = load_embeddings(params, source=False, full_vocab=True) # apply same normalization as during training normalize_embeddings(src_emb, params.normalize_embeddings, mean=params.src_mean) normalize_embeddings(tgt_emb, params.normalize_embeddings, mean=params.tgt_mean) # ma...
Python
1
, Encode, Decode)] #[protocol(id = 5759)] pub struct ExchangeBuyOkMessage<'a> { pub _phantom: std::marker::PhantomData<&'a ()>, } #[derive(Clone, PartialEq, Debug, Encode, Decode)] #[protocol(id = 5802)] pub struct ExchangeBidSearchOkMessage<'a> { pub _phantom: std::marker::PhantomData<&'a ()>, } #[derive(Clo...
Rust
0
c']} s") print(f" Avg CPU: {averages['average_cpu_usage_percent']} %") print(f" Avg Memory: {averages['average_memory_usage_bytes']} bytes") print(f" Avg Peak Memory: {averages['average_peak_memory_bytes']} bytes\n") # ----------------------------- ...
Python
1
sions(bot_token, chat_id, use_session) print(f"{ok} Session updated with download progress.") except Exception as e: print(f"\n{error} An error occurred: {e}") print(f"{info} Make sure you have the API_ID and API_HASH environment variables set correctly.") except KeyboardInt...
Python
1
return [] else: return [f"{key}=" for key in properties if key.startswith(current)] # ------------------------------------------------------------------------------ # All completers for this bundle COMPLETERS: Dict[str, Type[AbstractCompleter]] = { FACTORY: ComponentFactoryCompl...
Python
1
ffi::clutter_animatable_get_initial_state( self.as_ref().to_glib_none().0, property_name.to_glib_none().0, value.to_glib_none_mut().0, ); } } fn interpolate_value<P: IsA<Interval>>( &self, property_name: &str, interval:...
Rust
0
zed.Quantize(0.1, 2, torch.quint8), torch.nn.Conv3d(3, 3, kernel_size=1, stride=(1, 1, 1), groups=3), torch.nn.quantized.DeQuantize(), 2.0, 1.0, ), x, fusible_ops={ "aten::quantize_per_tensor", ...
Python
1
next_origin, "with <shift> pressed")?; } else if mouse_events.alt_button() { other_event(stdscr, next_origin, "with <alt> pressed")?; } } } }, ...
Rust
0
m(CHARSET[idx]) }) .collect(); output } #[test_with_logger] #[serial] fn mesh_1(logger: Logger) { mesh_test_helper(1, 0, logger); } #[test_with_logger] #[serial] fn mesh_2_k1(logger: Logger) { mesh_test_helper(2, 1, logger); } #[test_with_logger] #[serial] fn mesh_3_k1(logger: Logger) { ...
Rust
0
false, bottom_left: false, bottom_right: false, bottom: false, } } fn set(&mut self, token: Token) { match token { Token::Top => self.top = true, Token::TopLeft => self.top_left = true, Token::TopRight => self.top_right = t...
Rust
0
! { pub struct SndMotu(Object<hinawa_sys::HinawaSndMotu, hinawa_sys::HinawaSndMotuClass, SndMotuClass>) @extends SndUnit; match fn { get_type => || hinawa_sys::hinawa_snd_motu_get_type(), } } impl SndMotu { pub fn new() -> SndMotu { unsafe { from_glib_full(hinawa_sys::hinaw...
Rust
0
e, address in test_addresses.items(): print(f"\n{wallet_type} Address: {address}") if wallet_type == "Ethereum": print(" ❌ REQUIRES BRIDGE: Cross-chain transfer needed (complex)") print(" Status: Currently simulated only") elif wallet_...
Python
1
"""Extract content from message list.""" content_parts = [] for message in messages: if isinstance(message, AssistantMessage): content = getattr(message, "content", []) if content and isinstance(content, list): # Extract text from TextBlo...
Python
1
#!/usr/bin/env python3 import tkinter as tk def cap_filter(selection): options = { 'Arm': ['50kg', '100kg', '200kg', '300kg'], 'Arm (Food Grade)': ['75kg'], 'Rail': ['125kg', '300kg'], 'Drive': ['125kg', '300kg'], } print(options[selection]) # remove old elements ...
Python
1
_nodes, &mut alpha_network, intersect_id, beta_id.into()); } // TODO: Left off at creating new beta node } alpha_mem_dependents.sort_by_key(|&(_, ref rule_set)| rule_set.len()); } } fn add_alpha_destination(hash_eq_nodes: &mut HashMap<HashEqId,...
Rust
0
to_owned(); } else if lines[i].starts_with("ne") { x += 2; y -= 3; lines[i] = lines[i].strip_prefix("ne").unwrap().to_owned(); } else if lines[i].starts_with("e") { x += 4; lines[i] = lines[i].strip_prefix("e").unwra...
Rust
0
bonshot if bx == jugador_x and by == jugador_y and not besado: if not camuflado: bonshot[2] = True mensaje = "You kissed a bonshot!" imagen_bonshot_besado = True # 🔥 activamos flag por 1 turno else: mensaje = "You can't k...
Python
1
el_coord_z': center_z, 'world_coord_x': world_coord[0], 'world_coord_y': world_coord[1], 'world_coord_z': world_coord[2], 'prob': prob_value }) def reduce_overlapping_nodules(results_df, distance_threshold=15): """ 合并重叠的结节预测,使用更严格的距离阈值...
Python
1
import glob import os import sys import re NGWORD_LIST = [ ("", "<br>", "<br/>"), ("", "</br>", "<br/>"), ("", "acccess", "access"), ("", "ALING", "ALIGN"), ("", "alloacte", "allocate"), ("", "alocator", "allocator"), ("", "asssert", "assert"), ("", "asssume", "assume"), ("", "algin...
Python
1
} impl TcnDao for TcnDaoImpl { fn all(&self) -> Result<Vec<ObservedTcn>, ServicesError> { self.db .query( "select tcn, contact_start, contact_end, min_distance, avg_distance, total_count from tcn", NO_PARAMS, |row| Self::to_tcn(row), ...
Rust
0
s[1][1], coords[0][0], coords[1][1], ] as *const _, )?; } if let Some(c) = color { unsafe { let _ = self.colors.sub_data( 0, 4 * 4 * size_of::<GLfloat>(), ...
Rust
0
> { let mut params = Vec::new(); if let Some(body) = get_fn_body(tcx, def_id) { for arg in body.args_iter() { params.push(FullPlaceRef::new(def_id, Place::from(arg).as_ref())) } } params } pub fn get_fn_ret<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Option<FullPlaceRef> { ...
Rust
0
window: self, ..Default::default() }) } /// Unmap this window, async redox. #[cfg(feature = "async")] #[inline] pub async fn unmap_async<Dpy: AsyncDisplay + ?Sized>(self, dpy: &mut Dpy) -> crate::Result { dpy.exchange_request_async(UnmapWindowRequest { ...
Rust
0
""" 这是从huggingface上load预训练模型的模块 主要可以选择: 本地 or 线上(cache) 是否使用lora adapter 加载精度,8bit, 16bit, 32bit等 """ import torch from transformers import AutoTokenizer, AutoModel, AutoConfig from trl import PPOTrainer, PPOConfig, AutoModelForCausalLMWithValueHead, create_reference_model,AutoModelForSeq2SeqLMWithValueHe...
Python
1
dding, since we only # care about its length. Therefore we can use any key for the padding purposes. forged_message = md_pad(b'A' * key_length + message)[key_length:] + extra_payload # Get the MD4 internal state (h1, h2, h3, h4) by reversing the last step of the hash h = unpack('<4I', u...
Python
1
import numpy as np import socket import pickle def apply_svd(R): U, sigma, Vt = np.linalg.svd(R, full_matrices=True) sigma_matrix = np.zeros((U.shape[1], Vt.shape[0])) np.fill_diagonal(sigma_matrix, sigma) return U, sigma_matrix, Vt HOST = '127.0.0.1' # HOST = '0.0.0.0' PORT = 5000 with soc...
Python
1
nessValue(r) for lid, l in enumerate(lightID): OnlineRender.SetEnvLightByID(l+1) lightView, lightX, lightY = getLightTransList(3, 3) for vid, v in enumerate(lightView): OnlineRender.SetLightXform(lig...
Python
1
from tkinter import * form = Tk() form.title("TODO editing form") form.geometry("900x700") form_image = PhotoImage(file=r"images/edit.png") form.iconphoto(False, form_image) sidebar = Frame(master=form, bg="#040536", width=200) sidebar.pack(side=LEFT, fill=Y) sidebar.propagate(False) body = Frame(master=form, bg=...
Python
1
U>, U: GodotObject, { #[inline] fn as_arg_ptr(&self) -> *mut sys::godot_object { self.as_ptr() } } impl<'a, T: GodotObject> AsVariant for &'a Ref<T, Shared> { type Target = T; } /// Trait for combinations of `RefKind` and `ThreadAccess` that can be dereferenced safely. /// This is an intern...
Rust
0
ctx.addClock("clk_100", 100) ctx.addClock("gpmc_clk", 40)
Python
1
or::Corrupt } x = src[s-4] as u32 | (src[s-3] as u32) << 8 | (src[s-2] as u32) << 16 | (src[s-1] as u32) << 24; } length = x as usize + 1; if length <= 0 { return SnappyError::UnsupportedLiteralLength } if lengt...
Rust
0
_url = create_pr( title=f"Backfill {year} activity", body=f"为 {year} 年随机 {target_commits} 次提交补充 keep.log 记录。", head=branch, dry_run=dry_run, ) pr_number = extract_pr_number(pr_url) finalize_pr(pr_number, method="merge", dry_run=dry_run) return branch, pr_url, push_output ...
Python
1