text
string
label_name
string
labels
int64
the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19); self.w } } #[doc = "Command Index Check Enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CICEN_A { #[doc = "0: Disable...
Rust
0
$12</td></tr><tr><td>zebra stripes</td>' '<td style="text-align: center;">are neat</td><td style="text-align: right;">' '$1</td></tr></tbody></table>') def test_table_non_styled(self): t = """Test markdown table | Tables | Are | Cool | | ...
Python
1
e_size=40, num_workers=10) + Predict( checkpoint=os.path.join( auto_setup_dir, 'train_net_checkpoint_%d'%config['lsds_iteration']), graph='train_auto_net.meta', inputs={ sd_config['raw']: raw }, ...
Python
1
coreOpMem; base, index, disp, direct ); impl cmp::Eq for XcoreOpMem {} impl<'a> From<&'a cs_xcore_op> for XcoreOperand { fn from(insn: &cs_xcore_op) -> XcoreOperand { match insn.type_ { xcore_op_type::XCORE_OP_REG => { XcoreOperand::Reg(RegId(unsafe { insn.__bindgen_anon_1....
Rust
0
# regression_example.py import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.datasets import make_regression from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn.preprocessing import StandardScaler from sklearn.metrics import...
Python
1
_estimates.") return response def get_pose_estimates( self, object_ids: List[int], cam_1: Camera, cam_2: Camera, cam_3: Camera, photoneo: Camera, ) -> List[PoseEstimateMsg]: pose_estimates = [] print(f"Received request to estimates poses ...
Python
1
必然能被9整除,所以,连续累加起来,最终必然就是9。 /// 不能被9整除的整数,各位上的数字加起来,结果对9取模,和初始数对9取摸,是一样的,所以,连续累加起来,最终必然就是初始数对9取摸。 pub fn add_digits(num: i32) -> i32 { if num % 9 == 0 { if num == 0 { 0 } else { 9 } } else { num % 9 } } } ...
Rust
0
, 3, 2, 1, 0] ); assert_eq!( shuffle_with_mul_add(&[Shuffle::Cut(2)], deck.clone()), vec![2, 3, 4, 0, 1] ); assert_eq!( shuffle_with_mul_add(&[Shuffle::Cut(-2)], deck.clone()), vec![3, 4, 0, 1, 2] ); assert_eq!( ...
Rust
0
330.0) + 0.5 * Self::triangle(t, 111.0)) + Self::exp_decay(t, 0.3) * self.filter0.sample(Self::noise())), ); t += dt; } } SynthPrese...
Rust
0
.await .expect("Failed in step `build`"); for i in 0..20 { info!("test_repeat: iteration {}", i); mx_tester::up(&docker, &config) .await .expect("Failed in step `up`"); let response = reqwest::get(format!( "http://localhost:{port}/health", ...
Rust
0
ntiSemaphoreInner>, condvar: Condvar, } #[derive(Debug)] struct AntiSemaphoreInner { current: usize, } impl AntiSemaphore { pub(crate) fn new(saturation: usize) -> Self { Self { saturation, lock: Mutex::new(AntiSemaphoreInner { current: 0 }), condvar: Condvar...
Rust
0
模块的优势在于,库的编写者,在使用这两种容器时,不用关心使用哪种hash算法 //! 而由具体的应用程序关心,应用程序可以设置不同的feature,来确定自己需要哪种hash算法。 //! //! 例如: //! 一个名为`gui`的库,使用了本模块的XHashMap; //! //! 另一个库`gui_web`,是对`gui`的再次封装,意在编译为asm供web平台使用,考虑到asm中,64位整数的计算速度明显低于32位,因此 //! 希望使用一个32位的hash算法,另外,gui的hashMap,大部分的key的长度, //! 使用xxhash对比其它hash算法会更快(不同的hash算法,在不同的场景中有着自身的优势和劣势)...
Rust
0
from tortoise import fields, models # 用户提现表 class UserRecharge(models.Model): id = fields.BigIntField(pk=True) user_id = fields.BigIntField() amount = fields.DecimalField(max_digits=10, decimal_places=2) payment_method = fields.CharField(max_length=50) original_currency = fields.CharField(max_leng...
Python
1
assert ts1 <= ts2 assert ts2 >= ts1 # 测试特殊值比较 def test_special_value_comparisons(): empty = TimeStamp.empty() normal = TimeStamp(1620000000000) assert empty != normal assert not (empty < normal) assert empty > normal # 因为无穷大特性 # 测试时间戳转换 def test_unit_conversions(): # 测试秒到毫秒 a...
Python
1
import sys, os sys.path.append(r'' + os.path.abspath("")) __all__ = ['srs_mgmt', 'shp_mgmt', 'raster_mgmt', 'dataset_mgmt', 'geo_tools'] from .geo_tools import *
Python
1
Gera sugestões de melhoria baseadas na análise IA """ suggestions = [] # Análise baseada em scores if beauty_scores.get('simetria_facial', 0) < 70: suggestions.append({ 'procedimento': 'Harmonização Facial', 'area': 'Simetria', ...
Python
1
/// let vfs = Vfs::memfs(); /// let dir = vfs.root().mash("dir"); /// let file = dir.mash("file"); /// assert_vfs_mkdir_p!(vfs, &dir); /// assert_vfs_mkfile!(vfs, &file); /// let mut iter = vfs.entries(vfs.root()).unwrap().into_iter(); /// assert_iter_eq(iter.map(|x| x.unwrap().path_buf()), ...
Rust
0
> m680x_insn::M680X_INS_XGDX, 356 => m680x_insn::M680X_INS_XGDY, 357 => m680x_insn::M680X_INS_ENDING, _ => m680x_insn::M680X_INS_INVLD, } } } impl From<u32> for m68k_insn { fn from(id: u32) -> Self { match id { 0 => m68k_insn::M68K_INS_INVALID, ...
Rust
0
-------- qspline1d : Compute quadratic spline coefficients for rank-1 array. Notes ----- `dx` is the old sample-spacing while `x0` was the old origin. In other-words the old-sample points (knot-points) for which the `cj` represent spline coefficients were at equally-spaced points of:: o...
Python
1
import logging from fastapi import APIRouter, Depends from sqlalchemy.orm import Session from schemas.template import RegisterUserRequest from services.template_service import register_user_service from models.db import get_db logger = logging.getLogger("user_router") logging.basicConfig( level=logging.INFO, ...
Python
1
#!/usr/bin/env python3 import os import random import unittest from math import pi import torch import gpytorch from gpytorch.distributions import MultitaskMultivariateNormal from gpytorch.kernels import MultitaskKernel, RBFKernel from gpytorch.likelihoods import MultitaskGaussianLikelihood from gpytorch.means impor...
Python
1
# Resource object code (Python 3) # Created by: object code # Created by: The Resource Compiler for Qt version 6.8.2 # WARNING! All changes made in this file will be lost! from PySide6 import QtCore qt_resource_data = b"\ \x00\x00\x01\xf8\ P\ rogressBarBase {\ \x0d\x0a\x09text-align: c\ enter;\x0d\x0a colo\ r: bla...
Python
1
Defaults to 20. connect (int, optional): Trajectory connection flag. Defaults to 0. block (int, optional): Whether the function is blocking (1 for blocking, 0 for non-blocking). Defaults to 1. r (float, optional): Blending radius. Defaults to 0. Returns: None ...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of Karesansui Core. # # Copyright (C) 2009-2012 HDE, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restric...
Python
1
get .file() .map_or_else(|| "".to_owned(), |ref f| f.buffer()); assert_eq!(buffer, "oo bar".to_owned()); } #[test] fn delete_back() { build_test_renderer!(renderer); let mut widget = FileEditor::new(config.clone()); widget.open_file(build_testable_fil...
Rust
0
try: response = rag_systems[selected_rag].query(query, k=k_value) st.markdown(response["answer"]) with st.expander("View Sources"): for i, doc in enumerate(response["sources"], 1): source...
Python
1
# ===----------------------------------------------------------------------=== # # Copyright (c) 2025, Modular Inc. All rights reserved. # # Licensed under the Apache License v2.0 with LLVM Exceptions: # https://llvm.org/LICENSE.txt # # Unless required by applicable law or agreed to in writing, software # distributed u...
Python
1
( "{}:{} {}:{}{}{}\n", self.color_config.meta("♺"), &tweet.retweet_count, self.color_config.meta("♥"), &tweet.favorite_count, &via, &from ); let context = tweet .retweeted_status .as_ref() ...
Rust
0
: 앨범명 """ page_url = "https://www.melon.com/chart/index.htm" res = await get_response(page_url, headers=MELON_HEADERS) html = res.text # HTML 응답 문자열로부터, 필요한 태그 정보를 추출하기 위해, BeautifulSoup4 객체를 생성합니다. soup = BeautifulSoup(html, "html.parser") # BeautifulSoup4 객체를 통해 노래 정보를 추출해냅니다. song_...
Python
1
from PySimpleGUI import PySimpleGUI as sg sg.theme = 'Reddit' layout = [ [sg.InputText(key='display', size=(18,5), disabled=True, text_color='black', background_color='white')], [sg.Button('C', expand_x=True, enable_events=True, size=(2,1)), sg.Button('/', enable_events=True, size=(2,1), )], [sg.Button('7...
Python
1
ch service.get(filter, None).await { Ok(pools) => Ok(Response::new(GetPoolsReply { reply: Some(get_pools_reply::Reply::Pools(pools.into())), })), Err(err) => Ok(Response::new(GetPoolsReply { reply: Some(get_pools_reply::Reply::Error...
Rust
0
Externs {} unsafe impl Send for Externs {} pub type LogExtern = extern "C" fn(*const ExternContext, u8, str_ptr: *const u8, str_len: u64); pub type SatisfiedByExtern = extern "C" fn(*const ExternContext, *const Handle, *const Handle) -> bool; pub type SatisfiedByTypeExtern = extern "C" fn(*const ExternContext, *...
Rust
0
import pytest import scipy.sparse as sp from sklearn.datasets import load_iris from lightning.impl.datasets.samples_generator import make_classification @pytest.fixture(scope="module") def train_data(): iris = load_iris() return iris.data, iris.target @pytest.fixture(scope="module") def bin_train_data(tra...
Python
1
import libcst as cst # Simplifying things, this code can be brittle, but it is extremely easy to read ... Definitely a saviour ... class MCPServerTransformer(cst.CSTTransformer): def leave_FunctionDef(self, original_node, updated_node): if updated_node.name.value == "run": # Identify the target line using ...
Python
1
n with _patch_unwrap_mock_aware(): # Type ignored because this is a private function. super()._find( # type:ignore[misc] tests, obj, name, module, source_lines, globs, seen ) if self.path.name == "conftest.py":...
Python
1
_frequency, Some(5)); assert_eq!(query.mlt.max_doc_frequency, None); assert_eq!(query.mlt.min_term_frequency, Some(2)); assert_eq!(query.mlt.max_query_terms, Some(25)); assert_eq!(query.mlt.min_word_length, None); assert_eq!(query.mlt.max_word_length, None); assert_eq!(qu...
Rust
0
(&mut self.tag_id.unwrap()) } let article_ids: Vec<Uuid> = ::std::iter::repeat(self.article_id) .take(tags_id.len()) .collect(); // Insert the relationships into the table sqlx::query( r#"INSERT INTO article_tag_relation (article_id, tag_id) ...
Rust
0
#[derive(Debug, Clone)] pub struct Config { /** The address to bind the UDP server to. */ pub bind: String, /** The maximum number of unprocessed messages. If this value is reached then incoming messages will be dropped. */ pub unprocessed_capacity: usize, } impl Default for Config...
Rust
0
runtime_gurobi, cost_gurobi, # save_path="Figures/ADMM") visualize_admm_performance({"ADMM CS": (admm_CS, result_CS), # update rho 10% "ADMM CS CT": (admm_CS_CT, result_CS_CT)}, runtime_gurobi=runtime_gurobi, ...
Python
1
@property def _stop(self) -> List[str]: return [ f"\n{self.observation_prefix.rstrip()}", f"\n\t{self.observation_prefix.rstrip()}", ] def _construct_scratchpad( self, history: List[Tuple[str, str]] ) -> str: if len(history) == 0: return ...
Python
1
#[doc = "Bit 5 - P2SEL1_5"] #[inline(always)] pub fn p2sel1_5(&mut self) -> P2SEL1_5_W { P2SEL1_5_W { w: self } } #[doc = "Bit 6 - P2SEL1_6"] #[inline(always)] pub fn p2sel1_6(&mut self) -> P2SEL1_6_W { P2SEL1_6_W { w: self } } #[doc = "Bit 7 - P2SEL1_7"] #[inline(a...
Rust
0
(limit to 10 total) if len(sample_changes) < 10: batch_samples = [s for s in segments if s['speaker_label'] != s['new_speaker']][:10 - len(sample_changes)] sample_changes.extend(batch_samples) logger.info(f" Batch: {len(segments)} segments, {changes} changes, {smoothed...
Python
1
let right = Box::new(Self::new(objects, t_start, t_end, rng)); let box_left = left .bounding_box(t_start, t_end) .expect("No bounding box in BVH node"); let box_right = right .bounding_box(t_start, t_end) ...
Rust
0
# Item 7: Use list comprehensions instead of map and filter # Python provides compact syntax for deriving one list from another. These # expressions are called list comprehensions. For example, say you want to # compute the square of each number in a list. You can do this by providing # the expression for your comput...
Python
1
# If the credentials are service account credentials, then always try to use self signed JWT. if ( always_use_jwt_access and isinstance(credentials, service_account.Credentials) and hasattr( service_account.Credentials, "with_always_use_jwt_access" ...
Python
1
import json from utils.tool import str_filter save_response = ['goodbye.','thank you, goodbye.', 'you\'re welcome, goodbye.', 'you\'re welconme','good bye', 'thank you good bye', 'have a nice day', 'thank you for using our system. good bye', 'thank you and good bye', 'enjoy your day!', ...
Python
1
elp (2020-09-25 14:34:21.593357)) | o Sub Remove(CATVariant iIndex) | | Removes a Abaqus property using its index or its name from the property | collection. | | Parameters: | |...
Python
1
eInfoContainer( LOG_LINE_FULL_ENTITY, entity=match_obj.group(1), card=match_obj.group(2) ) match_obj = SHOW_ENTITY_PATTERN.match(line_str) if match_obj is not None: return LineInfoContainer( LOG_LINE_SHOW_ENTITY, entity=fetch_entity_id...
Python
1
import requests def send_discord(webhook_url, message): data = {"content": message} requests.post(webhook_url, json=data) print(" Message sent to Discord!")
Python
1
nvariant() # the j-invariant is a p-adic integer # needs sage.libs.pari sage.rings.padics 2 + 4*5^2 + O(5^3) sage: E.pari_curve() # needs sage.libs.pari sage.rings.padics [0, 0, 0, 1, 1, 0, 2, 4, -1, -48, -864, -4...
Python
1
st] fn multipart_parse() { let log = init_log(); let res = crate::userdata::read_user_data(&log, &PathBuf::from_str("./sample_data/mime_message.txt").unwrap()); let udata = res.unwrap(); assert_ne!(udata, UserData::default()); } #[test] fn userdata_parse() { let ...
Rust
0
value { return Ok(alg); } } Err(()) } } pub struct LibSodiumCryptoSystem { aead_algorithm: AEADAlgorithm, } impl LibSodiumCryptoSystem { pub fn new( aead_algorithm: AEADAlgorithm, ) -> Result<LibSodiumCryptoSystem, CryptoInstantiationError> { ...
Rust
0
import subprocess import os def get_usb_size(device): try: result = subprocess.run(['lsblk', '-b', '-o', 'SIZE', device], capture_output=True, text=True, check=True) size = result.stdout.split('\n')[1].strip() return int(size) except subprocess.CalledPro...
Python
1
g points are weighted as 1.0 and the other points as 0.0 if distances.iter().any(|&e| e == T::zero()) { distances .iter() .map(|e| if *e == T::zero() { T::one() } else { T::zero() }) .collect() } ...
Rust
0
)?; if len == 0 { break; } let buff = buff.trim_end_matches(|c: char| c == '\n'); let lead = buff.split("\t").nth(index).unwrap_or(Default::default()); output.write_all(lead.as_bytes())?; output.write_all(b"\t")?; output.write_all(buff.as_bytes())?; ...
Rust
0
#[doc = "0x2e0 - Cache Data Storage (upper word)"] pub dataw3s4u: DATAW3SU, #[doc = "0x2e4 - Cache Data Storage (lower word)"] pub dataw3s4l: DATAW3SL, #[doc = "0x2e8 - Cache Data Storage (upper word)"] pub dataw3s5u: DATAW3SU, #[doc = "0x2ec - Cache Data Storage (lower word)"] pub dataw...
Rust
0
nspecified) } fn set_span(&mut self, group: &mut Self::Group, span: Self::Span) { if let Some(delim) = &mut group.delimiter { delim.id = span; } } fn span_open(&mut self, group: &Self::Group) -> Self::Span { // FIXME we only store one `TokenId` for the delimiters ...
Rust
0
ing seductive eye contact with the viewer", start_image="start_frame.jpg", # Placeholder, will be replaced by uploaded filename model=model, size=Sizes.VIDEO_480P_LANDSCAPE, frame_count=81, fps=16, seed=random.randint(0, 2**64) ) ...
Python
1
(cx, range)?; Ok(&mut self.bytes[range.start.bytes_usize()..range.end().bytes_usize()]) } /// A raw pointer variant of `get_bytes_mut` that avoids invalidating existing aliases into this memory. pub fn get_bytes_mut_ptr( &mut self, cx: &impl HasDataLayout, range: AllocRange...
Rust
0
>>> >>> # Already created some Lightly Worker runs with this dataset >>> client.set_dataset_id_by_name("my-dataset") >>> client.download_embeddings_csv(output_path="/tmp/embeddings.csv") >>> >>> # File content: >>> # filenames,embedding_0,em...
Python
1
e(segment.data); Ok(segment.data.len()) } } else { Ok(0) } } fn decompress_segment(&mut self, encoded_data: &[u8], output: &mut Vec<u8>) -> Result<usize, ZgfxError> { let mut bits = BitSlice::from_slice(encoded_data); // The value of the...
Rust
0
group type, which holds vertex and index buffers and a material id. //! //! Material id is a `u8` which corresponds to the index of a material in the owning [Mesh](super::Mesh). use std::sync::Arc; use vulkano::buffer::BufferUsage; use vulkano::device::Device; use buffer::CpuAccessibleBufferAutoPool; use geometry::...
Rust
0
String { // console::log(&list_dirs()); // } #[wasm_bindgen] pub fn list_dirs() -> String { let dir_path = "../"; let dir = Path::new(dir_path); println!("checking path {:#?}", dir_path); let path_list = &mut Vec::new(); let spacing: usize = 0; let dirs_result = check_dirs(&dir, path_list...
Rust
0
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" RMDL: Random Multimodel Deep Learning for Classification * Copyright (C) 2018 Kamran Kowsari <kk7nc@virginia.edu> * Last Update: Oct 26, 2018 * This file is part of HDLTex project, University of Virginia. * Free to use, change, share and distribute source c...
Python
1
Runtime>::StillProvisioning // ); // assert_ok!(DexModule::end_provisioning( // Origin::signed(ListingOrigin::get()), // SETUSD, // DNAR // )); // let lp_currency_id = SETUSDDNARPair::get().dex_share_currency_id(); // assert!(InitialShareExchangeRates::<Runtime>::contains_key(SETUSDDNARPair::get()...
Rust
0
gma: no cover - error path raise CommandError( f"ID inválido: '{token}'. Debe ser entero." ) from exc if pk not in ids: ids.append(pk) extend_from_iterable(raw_args) path = options.g...
Python
1
][task][3] if "/" in model else all_correct[model][task][3] for model in model_list] prompt5 = [all_correct[model.split("/")[1]][task][4] if "/" in model else all_correct[model][task][4] for model in model_list] data = [prompt1, prompt2, prompt3, prompt4, prompt5] bplot = axs[idx].boxplot(data, patch_artis...
Python
1
#!/usr/bin/env python3 """ 快速测试修复后的 OCR 检测器 """ import cv2 import numpy as np from privision.core.ocr_detector import OCRDetector from privision.core.detectors.phone_detector import PhoneDetector print("=" * 80) print("快速测试 - OCR 和手机号检测") print("=" * 80) # 创建测试图像 img = np.ones((200, 600, 3), dtype=np.uint8) * 255 cv2...
Python
1
# Copyright (c) 2017 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. from UM.Settings.ContainerRegistry import ContainerRegistry from cura.MachineAction import MachineAction from PyQt6.QtCore import pyqtSlot, pyqtSignal, pyqtProperty from UM.i18n import i18nCatalog from UM.Application im...
Python
1
_load def save_pred(preds, checkpoint="checkpoint", filename="preds_valid.mat", meta=None): preds = to_numpy(preds) filepath = os.path.join(checkpoint, filename) mdict = {"preds": preds} if meta is not None: mdict.update(meta) print(f"Saving to {filepath}") scipy.io.savemat(filepath, m...
Python
1
he min-heap, calculate the value, store for later n_old, n_row = 2, [0, 1, 1] while nk_pairs: n, k = heappop(nk_pairs) if n < 2 or k > n or k <= 0: continue elif k == n or k == 1: snsk_vals[(n, k)] = 1 continue elif n != n_old: num_...
Python
1
for tag, value in loss.items(): self.writer.add_scalar(tag, value, global_iter) et = time.time() - start_time et = str(datetime.timedelta(seconds=et))[:-7] log = "Elapsed [{}], Epoch [{}] Iteration [{}/{}]".format(...
Python
1
rst_transition+1): # overlap_integral = 0 # for grid,index_grid in zip(self.mol_grids.grids,range(N_grids)): # overlap_integral += grid.integrate(transition_density_list[index_grid,first_transition] * transition_density_list[index_grid,second_transition]) # # ...
Python
1
_y_3: C_y_3_, C_y_2_prime: C_y_2_prime_, } } /// Verify that this [`ProofOfEncryption`] proves that a `ciphertext` is a /// correct encryption of a verifiably-encrypted plaintext. /// /// # Inputs /// /// * The [`SystemParameters`] for this anonymous credential instantia...
Rust
0
e. """ def set_icon(*args): icon = icon_value if icon_value else "blank" self.ids.thumb.ids.icon.icon = icon Clock.schedule_once(set_icon, 0.2) def on_line_color(self, instance, value) -> None: """Fired when the values of :attr:`line_color` change.""" ...
Python
1
xFE => { 16 }, _ => { println!("Warning: Missing instruction data for opcode {:X} {:X}", opcode, v[0]); 4 } }; (v, c) }, // DAA, CP...
Rust
0
#!/usr/bin/python # -*- coding: utf-8 -*- # # Licensed under the GNU General Public License, version 3. # See the file http://www.gnu.org/licenses/gpl.txt from pisi.actionsapi import shelltools from pisi.actionsapi import autotools from pisi.actionsapi import pisitools from pisi.actionsapi import get def build(): ...
Python
1
from __future__ import annotations import os def build_langchain_chat_ollama(): try: try: import langchain_ollama as _lco # type: ignore LCChatOllama = _lco.ChatOllama # type: ignore except Exception: from langchain_community.chat_models import ChatOllama as ...
Python
1
goal_stack=list(_GOAL_STACK), allowed_next_states=_allowed_next(_CURRENT_STATE), ) @router.post("/state", response_model=StateResponse) async def set_state(req: StateRequest, request: Request): global _CURRENT_STATE, _LAST_UPDATED, _GOAL_STACK new_state = req.state trace_id = getattr(...
Python
1
_order.confirm_validations() { info!("Domain ownership has been validated!"); break order_csr; } let authentications = new_order .authorizations() .with_context(|| "Failed to get CSR order authorizations")?; let challenge = authentications ...
Rust
0
etAddr}; use tokio::io::{AsyncRead, AsyncReadExt, AsyncWriteExt}; use tokio::net::TcpStream; mod parser; #[derive(Debug)] pub enum Socks4Error { Handshake, HeaderInvalid, TargetUnreachable, Transceiver, } type Socks4Result<T> = Result<T, Socks4Error>; const MAX_ID_LENGTH: usize = 1000; #[derive(Deb...
Rust
0
import json from models.crud import CRUD # Modelo class Cliente: def __init__(self, id, nome, email, fone, senha, id_perfil): self.id = id self.nome = nome self.email = email self.fone = fone self.senha = senha self.id_perfil = id_perfil def __str__(self): return f"{self.nome} - {self.e...
Python
1
upe() .for_each_sync(clone!((time_entry) move |stopped| { if debounced_stopped_first_value.get() { debounced_stopped_first_value.set(false); } else { debounced_stopped.set(Some(Timer::once(app::DEBOUNCE_MS, clone!((time_entry) move || { ...
Rust
0
# File generated from our OpenAPI spec by Stainless. from typing import Optional from typing_extensions import Literal from ....._models import BaseModel __all__ = ["FunctionToolCall", "Function"] class Function(BaseModel): arguments: str """The arguments passed to the function.""" name: str """Th...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AnttechOceanbaseObglobalContactCreateResponse(AlipayResponse): def __init__(self): super(AnttechOceanbaseObglobalContactCreateResponse, self).__init__() self._biz_err...
Python
1
c_char, data: *mut ::std::os::raw::c_char, size: usize, ) -> *mut CEXR_IStream; } extern "C" { pub fn CEXR_IStream_delete(stream: *mut CEXR_IStream); } extern "C" { pub fn CEXR_OStream_from_writer( writer: *mut ::std::os::raw::c_void, write_ptr: ::std::option::Option< ...
Rust
0
TAIV_W { TAIV_W { w: self } } } <gh_stars>0 use joystick::SDL_Joystick; use libc::{c_int, c_uint, c_char, c_float, c_void, int16_t, int32_t, uint8_t, uint16_t, uint32_t}; pub const SDL_HAPTIC_CONSTANT: uint16_t = 1 << 0; pub const SDL_HAPTIC_SINE: uint16_t = 1 << 1; pub const SDL_HAPTIC_LEFTRIGHT: uint16_...
Rust
0
.try_to_vec() .unwrap(), vec![ 0, 42, 0, 0, 0, 0, 0, 0, 0, 239, 190, 173, 222, 239, 190, 173, 222, 255, 255, 255, 255, 255, 255, 255, 255 ] ); } #[test] fn test_serialize_large_slice() { let mut dst = vec![0xff; 4]; ...
Rust
0
report=ReportingApiReport.from_json(json['report']) ) @event_class('Network.reportingApiEndpointsChangedForOrigin') @dataclass class ReportingApiEndpointsChangedForOrigin: ''' **EXPERIMENTAL** ''' #: Origin of the document(s) which configured the endpoints. origin: str e...
Python
1
# ファイルを開いて内容を読み込む with open('/Dev/slack_llm_manager/prompt/community_info.txt', 'r', encoding='utf-8') as file: file_contents = file.read() # 特定の文字列を置換 file_contents = file_contents.replace(':チェッカーフラッグ:', '') # 置換後の内容をファイルに書き戻す with open('/Dev/slack_llm_manager/prompt/community_info.txt', 'w', encoding='utf-8') a...
Python
1
ge_20 = df['moving_average_20'].iloc[-1] volatility = df['volatility'].iloc[-1] predicted_returns = make_prediction(moving_average_5, moving_average_20, volatility) logging.info("Predicted returns: %f", predicted_returns) if predicted_returns > 0.01: logging.info("Placing a...
Python
1
md # MAGIC **TRIP DATA** # COMMAND ---------- df_trip.display() # COMMAND ---------- # MAGIC %md # MAGIC Convert the Data ,Month & Year # COMMAND ---------- df_trip = df_trip.withColumn('trip_date',to_date(col('lpep_pickup_datetime')))\ .withColumn('trip_year',year(col('lpep_pickup_datetime')))\...
Python
1
let b1 = iter.next(); // Continuation sequence. if let Some((_, &x)) = b1 { if x == b'\n' { continue; } } let b2 = iter.next(); match (b1, ...
Rust
0
import time from servers import start_rest_echo_server def test_user_specific_credit_api_key_overrides_group_key(client): srv = start_rest_echo_server() try: ts = int(time.time()) api_name = f'cred-override-{ts}' api_version = 'v1' group = f'cg-ovr-{ts}' group_key = 'GRO...
Python
1
"".join(buff).split("\n") for x in lines[:-1]: lst.append(x + "\n") buff.clear() if lines[-1]: buff.append(lines[-1]) lastout = "".join(proc_out_buff) if lastout: proc_out.append(lastout + "\n") ...
Python
1
a matrix by a triangular matrix with float complex"] #[doc = " elements. Extended version."] #[doc = ""] #[doc = " Matrix-triangular matrix products:"] #[doc = " - \\f$ B \\leftarrow \\alpha A B \\f$"] #[doc = " - \\f$ B \\leftarrow \\alpha A^T B \\f$"] #[doc = " - \\f$ B \\leftarr...
Rust
0
let draw_task = renderer.draw(async { root.borrow() .as_ref() .ok_or("Already deleted!")? .send_message(Msg::ApplySettings(settings)); let plugin = renderer.get_active_plugin()?; if let Some(plugin_config) = &pl...
Rust
0
specular_ray: Ray { ori: Vec3 { x: 0.0, y: 0.0, z: 0.0, }, dic: Vec3 { x: 0.0, y: 0.0, z: 0.0, }, tm: 0.0, ...
Rust
0
from nerfbaselines import register register({ "id": "mipnerf360", "download_dataset_function": ".mipnerf360:download_mipnerf360_dataset", "evaluation_protocol": "nerf", "metadata": { "id": "mipnerf360", "name": "Mip-NeRF 360", "description": "Mip-NeRF 360 is a collection of fou...
Python
1
run via " "'pelican --listen' or 'pelican -l'.\nThis can be combined " "with regeneration as 'pelican -lr'.\nRerun 'pelican-" "quickstart' to get new Makefile and tasks.py files." ) args = parse_arguments() RootedHTTPServer.allow_reuse_address = True try: httpd = RootedH...
Python
1