text
string
label_name
string
labels
int64
#!/usr/bin/env python3 """Direct test of DeepSeek API.""" import sys from pathlib import Path # Add src to path sys.path.insert(0, str(Path(__file__).parent.parent)) def test_deepseek_direct(): """Test DeepSeek API directly.""" try: import openai from src.config import get_config co...
Python
1
_transfer_granularity: RawVkExtent3D::vk_to_wrapped(&src.min_image_transfer_granularity), } } } impl Default for VkQueueFamilyProperties { fn default() -> VkQueueFamilyProperties { VkQueueFamilyProperties { queue_flags: Default::default(), queue_count: 0, tim...
Rust
0
return Err("invalid header length"); //! } //! match header[0] { //! 1 => Ok(Version1), //! 2 => Ok(Version2), //! _ => Err("invalid version") //! } //! } //! //! let version = parse_version(&[1, 2, 3, 4]); //! match version { //! Ok(v) => { //! println!("working with ...
Rust
0
e read the documentation.",10,70,215,15) #checkbox1.setValue(True) Frame.add(checkbox1) Frame.add(checkbox2) #radioGroup1 rb1 = RadioGroup(60,50) rb1.addRadioButton("Nice",10,110) rb1.addRadioButton("Good",70,110) rb1.addRadioButton("Great",140,110) ...
Python
1
Opcode::JumpTableEntry | Opcode::JumpTableBase => { panic!("Should not appear: we handle BrTable directly"); } Opcode::Debugtrap | Opcode::Trap | Opcode::Trapif => { let is_cond = op == Opcode::Trapif; let maybe_trapinfo = inst_trapcode(ctx.data(insn)).map(|c...
Rust
0
# -*- coding: utf-8 -*- """ Created on Fri Sep 27 02:39:55 2024 @author: Owner """ import os import numpy as np from sklearn.datasets import fetch_olivetti_faces from sklearn.model_selection import train_test_split, cross_val_score from sklearn.ensemble import RandomForestClassifier from sklearn.decomposition import ...
Python
1
, start: i, pos: i, next: Some(WsBlock(false, Block::Comment, false)), } } } fn abort_with_nom_error(err: nom::Err<nom::error::Error<&str>>, start: &str, path: &Path) -> ! { match err { nom::Err::Incomplete(_) => { panic!("Impossible"); } ...
Rust
0
*val < min_val { min_val = *val; } } min_val } #[allow(unused)] /// Get vision for a &Snake in a &WorldState by ray tracing fn get_vision(snake: &Snake, world: &WorldState) -> Vec<f64> { let mut vision: Vec<f64> = Vec::new(); let head = &snake.parts[0]; let head_point = Poi...
Rust
0
class TaskFamily: @staticmethod def get_tasks() -> dict[str, dict]: return { "1": { "statement": "Climate change is the most critical issue of our time, and immediate action is necessary to mitigate its effects.", "topic": "renewable energy" }, ...
Python
1
_USAGE_LED_LOW_CUT_FILTER: USAGE = 0x0C; pub const HID_USAGE_LED_EQUALIZER_ENABLE: USAGE = 0x0D; pub const HID_USAGE_LED_SOUND_FIELD_ON: USAGE = 0x0E; pub const HID_USAGE_LED_SURROUND_FIELD_ON: USAGE = 0x0F; pub const HID_USAGE_LED_REPEAT: USAGE = 0x10; pub const HID_USAGE_LED_STEREO: USAGE = 0x11; pub const HID_USAGE_...
Rust
0
c = "Indicate the type of cache implemented at level 1.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum CL1_A { #[doc = "0: No cache"] CL1_0 = 0, #[doc = "1: Instruction cache only"] CL1_1 = 1, #[doc = "2: Data cache only"] CL1_2 = 2, #[doc = "3: Separate...
Rust
0
from django.shortcuts import render from django.http import HttpResponse # Create your views here. def ecommerce_index_view(request): '''This function render index page of ecommerce views''' return HttpResponse('Welcome to 6610742113 thanaphat yamboo views!') # Create your views here. def item_view(request...
Python
1
LT), 142606336 => Val(FREQ_A::_1067K), 159383552 => Val(FREQ_A::_1231K), 167772160 => Val(FREQ_A::_1280K), 176160768 => Val(FREQ_A::_1333K), i => Res(i), } } #[doc = "Checks if the value of the field is `_1000K`"] #[inline(always)] pub ...
Rust
0
void { use ReaperPointer::*; match self { MediaTrack(p) => p.as_ptr() as *mut _, ReaProject(p) => p.as_ptr() as *mut _, MediaItem(p) => p.as_ptr() as *mut _, MediaItemTake(p) => p.as_ptr() as *mut _, TrackEnvelope(p) => p.as_ptr() as *mut _, ...
Rust
0
on as details: sys.stderr.write("Error parsing line: %s\n" % details) sys.stderr.write("<%s>\n" % line.strip()) elif record == "SITE" or record == "TURN": pass elif record == "SSBOND" or record == "LINK": sys.stderr.write("War...
Python
1
let mut ptr: Option<ID3D12Device> = None; D3D12CreateDevice( &adapter, // None for default adapter D3D_FEATURE_LEVEL::D3D_FEATURE_LEVEL_11_0, &ID3D12Device::IID, ptr.set_abi(), ) .and_some(ptr) }?; ...
Rust
0
NFTNL_TABLE_FLAGS: nftnl_table_attr = 2; pub const NFTNL_TABLE_USE: nftnl_table_attr = 3; pub const __NFTNL_TABLE_MAX: nftnl_table_attr = 4; pub type nftnl_table_attr = u32; extern "C" { pub fn nftnl_table_is_set(t: *const nftnl_table, attr: u16) -> bool; pub fn nftnl_table_unset(t: *mut nftnl_table, attr: u1...
Rust
0
rse().unwrap(); let x_max: isize = captures[3].parse().unwrap(); let y_min: isize = captures[4].parse().unwrap(); let y_max: isize = captures[5].parse().unwrap(); let z_min: isize = captures[6].parse().unwrap(); let z_max: isize = captures[7].parse().unwrap(); let cube = ...
Rust
0
row_values.append(src_field) append(row_format.format(*row_values)) if has_stack: empty_headers = [""] * (len(headers) - 1) for entry in evt.stack[1:]: append( row_format.format( *(empty_headers + [trim_path(entry, src...
Python
1
iter().zip(bits).enumerate() { assert!(mem_word == bits_word, "index {:#x} ({}.{}): actual word {:#x} differs from expectation {:#x}", idx, idx/8, idx%8, mem_word, bits_word); } } #[test] fn decode() { let decoded = decode_all(PROGRAM_BITS); ...
Rust
0
= r#" let (+) x y = 1 1 + 2 "#; let vm = support::make_vm(); let result = expr.reparse_infix( &mut Compiler::new().implicit_prelude(false), &vm, "test", expr, ); match result { Err((_, Error::Parse(err))) => { let error = parser::Error::I...
Rust
0
scope: SideMetadataScope::Global, offset: helpers::meta_bytes_per_chunk( metadata_1_spec.log_min_obj_size, metadata_1_spec.log_num_of_bits, ), log_num_of_bits: 3, log_min_obj_size: 7, }; ...
Rust
0
.sobs: empl = sobber.emailemployer (sobemail, p.date) empl.AddSOB() if not p.merge: p.author.addpatch (p) for sobemail, sob in p.sobs: sob.addsob (p) for hacker in p.reviews: hacker.addreview (p) for hacker in p.testers: ha...
Python
1
c, } } } pub async fn acquire_arc(self: &Arc<Self>) -> SemaphoreGuardArc { let mut listener = None; loop { if let Some(guard) = self.try_acquire_arc() { return guard; } match listener.take() { None => lis...
Rust
0
me > 0 && old_track.is_playing) { // Playlist finished and reset. Normally caught above, but this // is a special case for a 1-track playlist. let played = std::cmp::min( std::cmp::max(old_track.duration_ms as i64 - old_time as i64, 0), 31000) as u64; return Stat...
Rust
0
@return"] #[doc = " The pointer to the new allocated mempool, on success. NULL on error"] #[doc = " with rte_errno set appropriately. See rte_mempool_create() for details."] pub fn rte_mempool_create_empty( name: *const ::std::os::raw::c_char, n: ::std::os::raw::c_uint, elt_size...
Rust
0
e-dimensional read-write array view pub type ArrayViewMut1<'a, A> = ArrayViewMut<'a, A, Ix1>; /// two-dimensional read-write array view pub type ArrayViewMut2<'a, A> = ArrayViewMut<'a, A, Ix2>; /// three-dimensional read-write array view pub type ArrayViewMut3<'a, A> = ArrayViewMut<'a, A, Ix3>; /// four-dimensional rea...
Rust
0
larity """ return vector_search(query_text, filters, limit) if __name__ == "__main__": # Test the pure vector search print("🚀 Testing Pure Vector Search") print("=" * 50) # Test basic search results = search_properties_by_description( "spacious family home with good schools", ...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, tools class ImLivechatReportOperator(models.Model): """ Livechat Support Report on the Operator """ _name = "im_livechat.report.operator" _description = "Livechat Supp...
Python
1
] fn every_10_ms(cx: every_10_ms::Context) { cx.schedule.every_10_ms(cx.scheduled + PERIOD.cycles()).unwrap(); cx.resources.cs.set_low().ok(); cx.resources.spi.write(&[0x42]).unwrap(); cx.resources.cs.set_high().ok(); // defmt::info!("supposed to be every 10ms"); ...
Rust
0
#!/usr/bin/env python3 """ Range simple helper fun """ from typing import Tuple def index_range(page: int, page_size: int) -> Tuple[int, int]: """ Range of the page Args: page: Current page page_size: Total size of the page Return: tuple with the range...
Python
1
def program(word1, word2): print(f"The word {word1} is a palindrome" if is_palindrome(word1) else f"The word {word1} is not a palindrome") print(f"The word {word2} is a palindrome" if is_palindrome(word2) else f"The word {word2} is not a palindrome") print(f"The words {word1} and {word2} are anagrams" if ar...
Python
1
MPLES: cxx2flow test.cpp | dot -Tpng -o test.png cxx2flow main.cpp my_custom_func | dot -Tsvg -o test.svg Please give me star if this application helps you! 如果这个应用有帮助到你,请给我点一个 star! https://github.com/Enter-tainer/cxx2flow "))] struct Args { #[clap( short, long, help( "S...
Rust
0
optimizer_config = Fp16OptimizerHook( **cfg.optimizer_config, loss_scale=fp16_cfg['loss_scale'], distributed=distributed) elif distributed and 'type' not in cfg.optimizer_config: optimizer_config = DistOptimizerHook(**cfg.optimizer_config) else:...
Python
1
out_dir: "src/storage", includes: &[], customize: Customize { ..Default::default() }, })?; Ok(()) } #[cfg(target_os = "windows")] fn set_env() { // Reference to https://doc.rust-lang.org/cargo/reference/build-scripts.html println!("cargo:rustc-env=CHIBIDB_ROOT_PATH...
Rust
0
gner.Beam {hex(id(self))}"] lines.append(f" Exists : {self.is_alive}") lines.append( f" Start : [{','.join([str(x) for x in self.start])}] in meters" ) lines.append(f" End : [{','.join([str(x) for x in self.end])}] in meters") ...
Python
1
io/jokes"; const RANDOM_URL: &'static str = "/random"; #[derive(Debug, Serialize, Deserialize)] pub struct Response { icon_url: String, id: String, url: String, value: String, } pub struct Client<'a> { pub url: &'a str, pub cli: reqwest::Client, } impl<'a> Client<'a> { pub fn new() -> Sel...
Rust
0
Err(err) = front_control(sub_matches) { err.to_string().split('\n').for_each(|line| { if !line.is_empty() { error!("{}", line); } }); process::exit(-3); } } else if let Some(sub_matches) = matches.subcommand_matches("b...
Rust
0
usize; self.sample_rate = (32768 << resolution) as f32; if self.sample_rate != self.resampler.in_freq { self.resampler.in_freq = self.sample_rate; } self.cycles_per_sample = 512 >> resolution; info!( ...
Rust
0
# Search Pattern (Rabin-Karp Algorithm) text="geeksforgeeks" pattern="geek" def rabin_karp_search(text, pattern): d=256 q=101 M = len(pattern) N = len(text) p = 0 # hash value for pattern t=0 # hash value for current window of text h=1 # higher order digit multiplier res=[] # pr...
Python
1
ite_text_sideband_pktline(Band::Data, "unpack ok").await?; for update in updates { process_delete(&update, &repo, &mut transaction, &mut output_writer).await?; } } } let repo_dir_str = repo.get_fs_path(&mut transaction).await?; let repo_dir = Path::new(&repo...
Rust
0
from django.shortcuts import render from rest_framework import viewset from messaging.models import Message, Notification, User, MessageHistory from .serializers import MessageSerializer, NotificationSerializer, MessageHistorySerializer, UserSerializer # Create your views here. class MessageViewset(viewset.ModelViewS...
Python
1
writable: false, signer: true, }, ParsedAccount { pubkey: pubkey2.to_string(), writable: true, signer: false, }, ParsedAccount { pubkey: pubkey3.to...
Rust
0
expr: &mut Expr, ) -> TyResult<TyCtx> { // TODO input contexts are well-formed // well_formed_ctxs(gl_ctx, kind_ctx, &ty_ctx); let (res_ty_ctx, ty) = match &mut expr.expr { ExprKind::PlaceExpr(pl_expr) => { if pl_expr.is_place() { se...
Rust
0
import bpy from ..utils import auto_mapper from ..utils import bone_mapping_profiles class Rig2UE_OT_RefreshMapping(bpy.types.Operator): bl_idname = "rig2ue.refresh_mapping" bl_label = "Refresh Mapping" bl_description = "⚠️ Warning: This will overwrite your manual edits." def execute(self, context): ...
Python
1
assert_eq!(Arcsine::new_unchecked(-1.0, 2.0).mean(), 0.0); } #[test] fn test_variance() { assert_eq!(Arcsine::new_unchecked(0.0, 1.0).variance(), 1.0 / 8.0); assert_eq!(Arcsine::new_unchecked(-1.0, 1.0).variance(), 1.0 / 8.0); assert_eq!(Arcsine::new_unchecked(-1.0, 2.0).variance(),...
Rust
0
############################################################################### # # Tests for libxlsxwriter. # # SPDX-License-Identifier: BSD-2-Clause # Copyright 2014-2025, John McNamara, jmcnamara@cpan.org. # import base_test_class class TestCompareXLSXFiles(base_test_class.XLSXBaseTest): """ Test file crea...
Python
1
# Copyright (C) 2014 Optiv, Inc. (brad.spengler@optiv.com) # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from lib.cuckoo.common.abstracts import Signature class AntiAVDetectFile(Signature): name = "antiav_detectfile" description = "...
Python
1
&["type"], exponential_buckets(0.05, 1.2, 30).unwrap() ) .unwrap(); pub static ref CONSENSUS_CHECK_BLOCK_HISTOGRAM_VEC: HistogramVec = register_histogram_vec!( "axon_consensus_check_block", "consensus check block", &["type"], exponential_buckets(0.001, 2.0, 20...
Rust
0
tester are reset. This would be the last chance do gleam anything from the global tester.", )?; f.register_callback( AFTER_TESTER_RESET, "Emitted just after the global tester is reset but before any targets are (re)loaded.", )?; Ok(()) } pub trait FrontendHandler { fn emit(&self, c...
Rust
0
value, ); calculated_size.size = Size::new(width, text.style.font_size); } } pub fn draw_text_system( mut draw_context: DrawContext, fonts: Res<Assets<Font>>, msaa: Res<Msaa>, font_atlas_sets: Res<Assets<FontAtlasSet>>, texture_atlases: Res<Assets<TextureAtlas>>, mut render...
Rust
0
w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1); self.w } } impl R { #[doc = "Bit 0 - Channel 0 Trigger"] #[inline(always)] pub fn trig0(&self) -> TRIG0_R { TRIG0_R::new((self.bits & 0x01) != 0) } #[doc = "Bit 1 - Channel 1 Trigger"] #[inline(always)] pub fn trig1(&self) -...
Rust
0
pe = "Target" if is_target else "Cushion" if is_cushion else "None" ws.append( [ row["section_code"], row["row"], row["seat_label"], row["seat_price"], pack_type, ] ) current_row = ws.max_row...
Python
1
ait bar(thing)); } "#, r#" for await (const thing of await things) { console.log(await bar(thing)); } "#, r#" for (let i = await bar(); i < n; i++) { baz(i); } "#, r#" for (const thing of await things) { bar(thing); } "#, r#" for (let thing in await things) { bar(...
Rust
0
ld_tx( &pool.chain_id, sender_public_key, msg, account_number, sequence_number, max_gas, max_coin_amount, max_coin_denom, timeout_height, memo, ) ...
Rust
0
r,'unknown') elif proto==UDP: scan.type = 'UDP' # Reset flags for UDP scan scan.tcpflags_or = 0 # See if this was logged recently scanentry = (key, scan.type, scan.tcpflags_or) ...
Python
1
b, ) -> *mut crocksdb_sst_partitioner_factory_t; } extern "C" { pub fn crocksdb_sst_partitioner_factory_destroy( factory: *mut crocksdb_sst_partitioner_factory_t, ); } extern "C" { pub fn crocksdb_sst_partitioner_factory_name( factory: *mut crocksdb_sst_partitioner_factory_t, ) -> *c...
Rust
0
read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see...
Rust
0
_decode() { //setup let mut encoder: Encoder<usize> = Encoder::new(); let start = 10; let numbers: Vec<usize> = (start..(start + 40)).collect(); //exercise/verify for number in &numbers { assert_eq!(encoder.encode(number), number - start); } ...
Rust
0
start: LogIndex, end: Option<LogIndex>) -> LoadLog { if let Err(e) = track!(self.poll_and_handle_event()) { return LoadLog::new(log::LoadLogInner::Failed(e), self.metrics.clone()); } // XXX: 全体的に`raftlog`の実装内容に依存しており、あまり良くはない let future = if let Some(end) = end { ...
Rust
0
import numpy as np import pandas as pd from pandas import ( Categorical, Series, ) import pandas._testing as tm class TestSeriesCount: def test_count(self, datetime_series): assert datetime_series.count() == len(datetime_series) datetime_series[::2] = np.nan assert datetime_seri...
Python
1
# 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 applicable law or agreed to in writing, software # distributed under th...
Python
1
r: #00FF00; border-radius: 10px; padding: 15px; """) self.output_console.setReadOnly(True) self.bottom_layout.addWidget(QLabel("📄 Logs de Execução:")) self.bottom_layout.addWidget(self.output_console) self.bottom_frame.setLayout(self.bottom_layout) ...
Python
1
s.line(path, pen) # loop over every coordinate pair for i, (lon1, lat1, lon2, lat2) in enumerate(self.data[self.order]): # calculate the fraction of the paths already drawn, and use # it to create a pen of the appropriate color frac = i / float(self.data_size) ...
Python
1
status_code=500, detail=f"Failed to duplicate config file: {e}" ) # Add other endpoints (file upload/download, etc.) as needed. # I SHOULD ADD AN EXTERNAL_PROMPTS/ FOLDER. You pick a pipeline to take the prompts of, it duplicates those prompts and puts a copy of them in external prompts, to serve as a ba...
Python
1
from django.shortcuts import render, redirect import json import os from .get_character_info import get_character_info from .extract import * from django.core.cache import cache import logging logger = logging.getLogger(__name__) async def character_info_view(request): character_name = request.GET.get('character_...
Python
1
tgid } #[no_mangle] pub unsafe extern "C" fn ps_get_thread_area( h: *mut ps_prochandle, rec_tid: thread_db::lwpid_t, val: i32, base: *mut thread_db::psaddr_t, ) -> thread_db::ps_err_e { if (*h).thread_group.is_null() { fatal!("unexpected ps_get_thread_area() call with uninitialized thread_g...
Rust
0
ribute('srcset') if srcset: print(f"发现srcset: {srcset}") # 解析srcset,获取最高DPI版本 srcset_urls = [] for src_item in srcset.split(','): src_item = src_item.strip() ...
Python
1
ze, /// Number of connection errors that have been detected. pub connect_errors: usize, /// Currently known availability of the node. pub availability: Option<Availability>, /// Currently known availability of the node. pub availability_info: Option<Availability>, /// Public listen a...
Rust
0
// /// The index of the cursor will be advanced to the end of the frames inserted. /// /// # Errors /// /// If any of the frames could not be inserted (because they were an incorrect size), /// then an error will be returned. /// /// # Examples /// /// ``` /// # fn main() { ...
Rust
0
e(); render_base_template("Login successful", box_html! { h1(id = "heading") { : "Login succesful" } a(href=&redirect) { : "redirecting to "; } span { : format!("{}", redirect) } }) } pub(in super) fn login_auth_fail() -> Strin...
Rust
0
# -*- coding: utf-8 -*- """ Created on Wed Feb 15 16:57:19 2023 @author: Administrator """ #====| 토큰 발급에 필요한 API 호출 샘플 아래 참고하시기 바랍니다. |===================== #====| 토큰 발급에 필요한 API 호출 샘플 아래 참고하시기 바랍니다. |===================== #====| 토큰 발급에 필요한 API 호출 샘플 아래 참고하시기 바랍니다. |===================== #====| API 호출 공통 함수 포함 ...
Python
1
veHtmlPreview { #[doc(hidden)] pub fn new(client: Client) -> Self { DocumentResponsiveHtmlPreview { client } } /** * Creates a preview of the responsive version of a document. * * This function performs a `POST` to the `/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/...
Rust
0
role_info.get('capabilities', []))}") print(f" 当前角色ID: {client.role_id}") return True elif command == 'clear': import os os.system('clear' if os.name == 'posix' else 'cls') print(f"🤖 {agent_name}: 屏幕已清理,我们继续对话吧!") return True...
Python
1
# Copyright (c) 2012, GPy authors (see AUTHORS.txt). # Licensed under the BSD 3-clause license (see LICENSE.txt) """ The package for the Psi statistics computation of the linear kernel for SSGPLVM """ from ....util.linalg import tdot import numpy as np def psicomputations(variance, Z, variational_posterior, return_...
Python
1
Sized) { panic!("got into MutAccess::field"); } fn finish(&mut self) -> Result<(), std::fmt::Error> { panic!("got into MutAccess::finish"); } fn debug_struct(&mut self, _: impl Sized, _: impl Sized) { panic!("got into MutAccess::debug_struct"); } } fn main() { let bar...
Rust
0
str) -> Result<Connection, Error> { let conn: Connection; let mut connection_pointer: usize = 0; unsafe{ let factory = tibco_ems_sys::tibemsConnectionFactory_Create(); let c_url = CString::new(url).unwrap(); let status = tibco_ems_sys::tibemsConnectionFactory_SetServerURL(factory, c_url.as_ptr()); ...
Rust
0
nd, scaling: glm::vec3(1.0, 1.0, 1.0), rotation: glm::identity(), translation: glm::vec3(0.0, 0.0, 0.0), model_matrix: glm::identity(), } } pub fn set_scaling(&mut self, x: f32, y: f32, z: f32) { self.scaling = glm::vec3(x, y, z); self.upd...
Rust
0
tch_field_name, new_upstream_value) if only_fetch: continue # Okay, now for the nuanced part... # We need to update the downstream field *iff it has not been customized**. # Determining whether a field has been customized will differ in Beta vs Future release. # (Se...
Python
1
std::option::Option::Some(BaseCommand_Type::END_TXN_ON_PARTITION_RESPONSE), 60 => ::std::option::Option::Some(BaseCommand_Type::END_TXN_ON_SUBSCRIPTION), 61 => ::std::option::Option::Some(BaseCommand_Type::END_TXN_ON_SUBSCRIPTION_RESPONSE), _ => ::std::option::Option::None } ...
Rust
0
](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [tcd...
Rust
0
from flask import Flask, request, jsonify import joblib # Initialize Flask app app = Flask(__name__) # Load the Naive Bayes model and TFIDF vectorizer nb_model = joblib.load('thai_spam_naive_bayes_model.pkl') tfidf_vectorizer = joblib.load('tfidf_vectorizer.pkl') # Function to predict whether a message is spam def p...
Python
1
s this the `Stack` affinity? pub fn is_stack(self) -> bool { match self { Affinity::Stack => true, _ => false, } } /// Merge an operand constraint into this affinity. /// /// Note that this does not guarantee that the register allocator will pick a register t...
Rust
0
Si el enemigo está vivo # Calcular la ruta hacia el jugador start = (enemy[0], enemy[1]) goal = (player_x, player_y) path = a_star(start, goal, MAP) if path and len(path) > 1: # Movimiento lento: 50% de probabilidad de moverse en cada frame ...
Python
1
import sqlite3 import os import sys def merge_sqlite_dbs(source_db1, source_db2, destination_db): # Copy source_db1 as the base of destination_db if os.path.exists(destination_db): os.remove(destination_db) with open(source_db1, 'rb') as fsrc, open(destination_db, 'wb') as fdst: fdst.write(...
Python
1
wrap() } #[get("/drone")] pub fn get_telemetry() -> Json<Telemetry> { Json(drone::get_telemetry()) } #[get("/drone/home")] pub fn get_home() -> Json<Coordinate> { Json(drone::get_home()) } #[post("/drone", data = "<location>")] pub fn do_reposition(location: Json<Location>) { drone::do_reposition(locatio...
Rust
0
'res.data'].search_read(domain, ['CHAN', 'MDR1', 'MDR2', 'MDR3','MDR4','create_date']) grouped_data = {} for record in sensor_data: chan_value = record['CHAN'] if chan_value not in grouped_data: grouped_data[chan_value] = [] g...
Python
1
= "152")] N152, /// Colombian Peso #[serde(rename = "170")] N170, /// Comoro Franc #[serde(rename = "174")] N174, /// Convertible Marks #[serde(rename = "977")] N977, /// Cordoba Oro #[serde(rename = "558")] N558, /// Costa Rican Colon #[serde(rename = "188")] N188, /// Cuban Peso #[serde(rename = "1...
Rust
0
#!/usr/bin/python3 import pickle from statistics import mean import pandas as pd import matplotlib.pyplot as plt import btalib as bl import math from sys import exit weekDays = ("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday") # First import data and process it # takes csv data file from binanc...
Python
1
! Bitwise operators. use crate::{ arch::word::Word, buffer::Buffer, ibig::IBig, math, ops::{AndNot, NextPowerOfTwo, UnsignedAbs}, primitive::{double_word, WORD_BITS_USIZE}, sign::Sign::*, ubig::{Repr::*, UBig}, }; use core::{ mem, ops::{BitAnd, BitAndAssign, BitOr, BitOrAssign, ...
Rust
0
= "pass" row["校正理由"] = "人間が修正を確認(fix2)" print("校正結果を pass に変更しました。") elif choice == "y": # 校正結果は正しいので、修正する row["fix2"] = "fix" elif choice == "a": # 第三者の意見を採用 row["fix2"] = "fix" row["校正後の意味"] = mean4 elif choice == "n": # 今回は見送り conti...
Python
1
l.Button( "Export zip", click="utils.download('scene-wasm.zip', trigger('export', ['zip']), 'application/octet-stream')", style="position: absolute; top: 3rem; right: 7rem; z-index: 10;", ) html.Button( "Reset Camera", ...
Python
1
.amax - args.amin) / KSI_DEL; x[0] = r * f64::cos(a); x[1] = r * f64::sin(a); if x.dim() == 3 { x[2] = args.zmin + (ksi[2] - KSI_MIN) * (args.zmax - args.zmin) / KSI_DEL; } Ok(()) } fn main() -> Result<(), StrError> { let mut p = Processor { callback: Some(Box::new(simple_callba...
Rust
0
I register."] #[inline] pub fn dchpri<I: Into<::bobbin_bits::R16>>(&self, index: I) -> Dchpri { self.dchpri_reg().read(index.into()) } #[doc="Write the DCHPRI register."] #[inline] pub fn write_dchpri<I: Into<::bobbin_bits::R16>>(&self, index: I, value: Dchpri) -> &Self { self.dchpri_r...
Rust
0
ts::{result_component::ResultsComponent, search_component::SearchComponent}; use crate::fal_command::FalCommandParser; use crate::fal_config::*; use crate::fal_message::*; use crate::platform_api; const SEARCH_BAR_HEIGHT: i32 = 50; const LIST_ITEM_HEIGHT: i32 = 50; pub struct FalApp { max_result_displayed: u32, ...
Rust
0
[$f0], bb[$f1], bb[$f2], bb[$f3], $data[$data_index1], $bits1, 0x0000_0000, bb[$f1] ^ bb[$f2] ^ bb[$f3]); )* // Round 2 GG G (((x) & (y)) | (~(x) & (z))) $( round!(bb[$g0], bb[$g1], bb[$g2], bb[$g3], $data[$data_index2], $bits2, 0x5a82_7999, ...
Rust
0
): ") fitness_threshold = float(input("Enter minimum fitness threshold (e.g., 0.2): ")) egg_count = int(input("Enter egg count per reproduction event (e.g., 3000 for Astyanax mexicanus, 50 for mammoth cave fish): ")) carrying_capacity = int(input("Enter carrying capacity (e.g., 1000): ")) run_simulation...
Python
1
with thr_l_lim value."] pub struct THR_L_LIM_EN_U1_W<'a> { w: &'a mut W, } impl<'a> THR_L_LIM_EN_U1_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(s...
Rust
0
crResult(self, PornOcrResult): self._PornOcrResult = PornOcrResult @property def TerrorismOcrResult(self): return self._TerrorismOcrResult @TerrorismOcrResult.setter def TerrorismOcrResult(self, TerrorismOcrResult): self._TerrorismOcrResult = TerrorismOcrResult @property ...
Python
1
from pyrogram import filters from pyrogram.types import Message from AarohiX import app from AarohiX.core.call import Dil welcome = 20 close = 30 @app.on_message(filters.video_chat_started, group=welcome) @app.on_message(filters.video_chat_ended, group=close) async def welcome(_, message: Message): await Dil.st...
Python
1