text string | label_name string | labels int64 |
|---|---|---|
er the License.
use super::*;
fn decor_function(item: &f64) -> String {
format!("{} MB", item)
}
fn highlight_if_function(item: &f64) -> bool {
*item > 0.0
}
#[derive(BelowDecor)]
struct SubField {
#[bttr(title = "Field A", width = 7)]
field_a: Option<f64>,
#[bttr(title = "Field B", width = 8)]
... | Rust | 0 |
"""Update default GPT model to gpt-4o-mini
Revision ID: update_default_gpt_model
Revises: b4075dd9aed3
Create Date: 2025-01-11 12:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "update_default_gpt_model"
down_revision = "b4075dd9aed3"
branch_labe... | Python | 1 |
est.mark.parametrize("shared_flag", [True, False])
def test_direct_infer(device, shared_flag):
compiled_model, img = generate_model_and_image(device)
tensor = Tensor(img)
res = compiled_model({"data": tensor}, share_inputs=shared_flag)
assert np.argmax(res[compiled_model.outputs[0]]) == 531
ref = c... | Python | 1 |
import sys
from collections import deque
n = int(sys.stdin.readline())
tree = {}
for i in range(n):
tree[i+1] = []
for _ in range(n-1):
a,b,c = map(int,sys.stdin.readline().split())
tree[a].append((b,c))
tree[b].append((a,c))
queue = deque()
queue.append((1,0))
maxx=0
maxNode=0
visited = {1:True}
while... | Python | 1 |
import tkinter as tk
from tkinter import scrolledtext
root = tk.Tk()
root.title("Chatbot")
root.geometry("500x500")
# Create a text area to display the conversation
chat_area = scrolledtext.ScrolledText(root, wrap=tk.WORD, width=50, height=20, state='disabled')
chat_area.pack(pady=10)
# Create an entry box for the us... | Python | 1 |
mut x) => {
*x = x.check_solution(meta, ren, lfrom, lto, names)?;
Ok(Term::Box(b, x))
}
Term::Struct(k, v) => Ok(Term::Struct(
match k {
StructKind::Struct(t) => StructKind::Struct(Box::new(t.check_solution(
... | Rust | 0 |
c = "Reader of field `PDIS2`"]
pub type PDIS2_R = crate::R<bool, PDIS2_A>;
impl PDIS2_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> PDIS2_A {
match self.bits {
false => PDIS2_A::VALUE1,
true => PDIS2_A::VALUE2,
}
}
#[... | Rust | 0 |
import pygame_menu
from game_state_management import GameStateManager
def create_settings_menu(surface, set_volume, save_game, load_game, change_language):
menu = pygame_menu.Menu('Settings', 600, 400)
# Adding a volume slider
menu.add.range_slider('Volume', default=50, onchange=set_volume, range_values=... | Python | 1 |
ZED:
rect = (self.get_word(4),self.get_word(5),self.get_word(6),self.get_word(7))
self.window.resize(rect)
elif self.message == gem.WM_REDRAW:
self.window.draw()
# Menu handling
elif self.message == gem.MN_SELECTED:
self.handl... | Python | 1 |
url="https://peps.python.org/pep-0685/",
)
else:
processed_extras[safe] = unsafe
file.write(f"Provides-Extra: {safe}\n")
# from pypa/distutils#244; needed only until that logic is always available
def get_fullname(self):
return _distribution_fullname(self.get_name(), self.get_version()... | Python | 1 |
l#GL_ELEMENT_ARRAY_BUFFER)
pub const GL_ELEMENT_ARRAY_BUFFER : i32 = 34963;
/// public static final [GL_ELEMENT_ARRAY_BUFFER_BINDING](https://developer.android.com/reference/javax/microedition/khronos/opengles/GL11.html#GL_ELEMENT_ARRAY_BUFFER_BINDING)
pub const GL_ELEMENT_ARRAY_BUFFER_BINDING ... | Rust | 0 |
}
}
let wait_duration = if translated { ANIM_DURATION } else { 0.3 };
commands.spawn().insert(WaitUntil(t0 + wait_duration));
}
fn apply_effect_producer(
mut er: EventReader<ApplyEffect>,
mut commands: Commands,
time: Res<Time>,
query: Query<(Entity, &Card)>,
handles: Res<TextureAss... | Rust | 0 |
# Camera and Telegram Bot Configuration File
# Fill in your personal camera details below
# RTSP URLs for cameras
# Camera 1 - position?
RTSP_URL_CAMERA1 = "rtsp://admin:YourPassword123@192.168.178.21:554/h264Preview_01_sub"
# Camera 2 - position?
#RTSP_URL_CAMERA2 = "rtsp://admin:YourPassword123@192.168.178.22:554/h2... | Python | 1 |
# @license BSD-3-Clause
#
# Copyright (c) 2019 Project Jupyter Contributors.
# Distributed under the terms of the 3-Clause BSD License.
import os
import json
import sqlite_utils
from fastapi import FastAPI
app = FastAPI(openapi_prefix="/commenting-service")
path = os.path.dirname(os.path.abspath(__file__))
database =... | Python | 1 |
total_acc_8.extend(accs_8)
Acc = np.array(total_acc)
Acc = np.nanmean(Acc)
Acc_8 = np.array(total_acc_8)
Acc_8 = np.nanmean(Acc_8)
print(Pred)
print('*'*10)
print('VC{} score: {} on {} set'.format(clip_num,Acc,split))
print('VC{} score: {} on {} set'.format(clip_num_8,Acc_8,split))
print('*'*10)
Acc = evaluator.Pixel... | Python | 1 |
ße".ends_with_ignore_case("Maße"));
assert_eq!(true, "123 Maße".ends_with_ignore_case("MASSE"));
assert_eq!(false, "123 Maße".ends_with_ignore_case("messe"));
assert_eq!(false, "123 Maße".ends_with_ignore_case("123"));
assert_eq!(false, "123 Maße".ends_with_ignore_case(" Maße 123"));
}
//! The Veracruz ... | Rust | 0 |
import ccxt.pro
import asyncio
import time
async def watch_book(exchange, ticker):
last = None
while True:
try:
orderbook = await exchange.watch_order_book(ticker)
# TODO add timeout within a minute
# TODO add last
top_bid = orderbook['bids'][0][0]
... | Python | 1 |
::Reg<lo_cal_ctrl_hw8::LO_CAL_CTRL_HW8_SPEC>;
#[doc = "lo_cal_ctrl_hw8."]
pub mod lo_cal_ctrl_hw8;
#[doc = "lo_cal_ctrl_hw9 register accessor: an alias for `Reg<LO_CAL_CTRL_HW9_SPEC>`"]
pub type LO_CAL_CTRL_HW9 = crate::Reg<lo_cal_ctrl_hw9::LO_CAL_CTRL_HW9_SPEC>;
#[doc = "lo_cal_ctrl_hw9."]
pub mod lo_cal_ctrl_hw9;
#[d... | Rust | 0 |
lidar_data = np.fabs(lidar_data) # pylint: disable=E1111
lidar_data = lidar_data.astype(np.int32)
lidar_data = np.reshape(lidar_data, (-1, 2))
lidar_img_size = (self.hud.dim[0], self.hud.dim[1], 3)
lidar_img = np.zeros(lidar_img_size)
lidar_img[tuple(lid... | Python | 1 |
words = ["I", "love", "Python"]
sen = ""
for word in words:
sen = sen + word + " "
print(sen)
words = ["I", "love", "Python"]
sen = ""
for word in words:
#sen = sen + word + " "
sen += word + " "
print(sen)
#this is an example of a list of words being joined together using augmented assignment operators in a fo... | Python | 1 |
function used to parse value is determined by the remaining arguments.
Args:
value: The string value to be parsed, typically a command line argument.
index: The index of the value in the function's argspec.
arg: The name of the argument the value is being parsed for.
metadata: Metadata about the func... | Python | 1 |
from quo.keys import bind
from quo.prompt import Prompt
session = Prompt()
@bind.add("ctrl-h")
def _(event):
print("Hello, World")
session.prompt("")
| Python | 1 |
title: item.title().to_string(),
description: item.summary().map(|s| s.to_string()),
link: find_link(item.links(), "alternate")
.unwrap()
.href()
.to_string(),
author:... | Rust | 0 |
n
.jobs
.iter()
.position(|&n| &n == max_cooldown_time)
.unwrap();
ready_to_run.jobs.remove(position);
// Add a job to the final sequence
pi.jobs.push(*max_cooldown_time);
t += max_cooldown_time.processing_ti... | Rust | 0 |
to pk
let key = Self::plaintexts(contest, 0);
self.get(key, hash)
}
fn get_statements(&self) -> Result<Vec<StatementVerifier>, BBError> {
let sts = self.get_stmts()?;
let mut ret = Vec::new();
for s in sts.iter() {
let s_bytes = self
.basic
... | Rust | 0 |
from src.file_operations import choose_word, display_word, get_word_length
def draw_hangman(attempts):
hangman_art = [
" ------\n |\n |\n |\n |\n |\n",
" ------\n | |\n |\n |\n |\n |\n",
" ------\n | |\n O |\n |\n ... | Python | 1 |
# BSD 3-Clause License
#
# Copyright (c) 2021-2024, Massachusetts Institute of Technology.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, th... | Python | 1 |
batch::LazyBatchPrimaryCausetVec;
use milevadb_query_datatype::expr::EvalContext;
use milevadb_query_vec_expr::RpnExpression;
use milevadb_query_vec_expr::RpnStackNode;
/// Decodes all PrimaryCausets that are not decoded.
pub fn ensure_PrimaryCausets_decoded(
ctx: &mut EvalContext,
exprs: &[RpnExpression],
... | Rust | 0 |
This is a type erased pointer.
pub fn set_dst_addr(&mut self, addr: *const ()) {
self.dstaddr = if addr.is_null() {
None
} else {
Some(addr)
};
}
/// Mark the descriptor as valid.
pub fn set_valid(&mut self) {
self.btctrl.insert(RawBlockTransferC... | Rust | 0 |
colors_LUNG = [
[0, 0, 255],
[255, 165, 0],
[0, 0, 128],
[0, 255, 0],
[128, 0, 128],
[128, 128, 0],
[255, 192, 203],
[192, 192, 192],
[128, 0, 0],
[0, 255, 255],
[255, 255, 0]
]
'''
Blue: [0, 0, 255] TUMOR
Orange: [255, 165, 0] TUMOR STROMA
Navy Blue: [0, 0, 128]... | Python | 1 |
ch + 1, acc / cout))
if args.wandb:
accuracy_key = f'accuracy__model_{modelnum}'
inner_epoch_key = f'inner_epoch__model_{modelnum}'
wandb.log({
accuracy_key: acc/cout,
'outer_epoch': iter,
... | Python | 1 |
e)]
fn yopa() {
const COMPRESSION10MB: &'static [u8] = include_bytes!("../benches/dickens.txt");
let compressed = compress(COMPRESSION10MB);
decompress(&compressed, COMPRESSION10MB.len()).unwrap();
lz4_cpp_block_compress(COMPRESSION10MB, None, false).unwrap();
const COMPRESSION66K: &'static [u8] =... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from pathlib import Path
from collections import deque, namedtuple
from dataclasses import dataclass
from typing import Optional, Any, Union
from loguru import logger
from ..llm import ClientManager
from .task import Task
from .plugins import PluginManager
from... | Python | 1 |
}
pub async fn fund_psbt(&self, address: Address, amount: Amount) -> Result<String> {
self.bitcoind_client
.fund_psbt(&self.name, &[], address, amount)
.await
}
pub async fn join_psbts(&self, psbts: &[String]) -> Result<PsbtBase64> {
self.bitcoind_client.join_psbts(... | Rust | 0 |
ReturnValue,
) -> Result<()> {
let text = unsafe { args.get(1).read_string_assume_noalias(scope)? };
let value: serde_json::Value = serde_json::from_str(&text)?;
retval.set(v8_serialize(scope, &value)?);
Ok(())
}
pub fn api_text_json_to_uint8array(
scope: &mut v8::HandleScope,
args: v8::FunctionCallbackArg... | Rust | 0 |
nation)+","+str(demand)+"\n")
break
# store_experiences.close()
rewards_lb = exec_lb_model_episodes(experience_memory, graph_topology)
rewards_sap = exec_sap_model_episodes(experience_memory, graph_topology)
rewards_dqn = exec_dqn_model_episodes(experience_memory, env_dqn, dqn_agen... | Python | 1 |
import os
import sys
import time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../')))
from sphero_sdk import SpheroRvrObserver
rvr = SpheroRvrObserver()
def main():
""" This program has RVR drive with how to drive RVR using the drive control helper.
"""
try:
r... | Python | 1 |
7, 0x32, 0xAB, 0x7F, 0xC7,
0x2E, 0xFF, 0xE7, 0x57, 0xFF, 0xE1, 0x54, 0x69, 0x26, 0x17, 0xFF, 0x1C, 0x71, 0xF2, 0xE0,
]
);
set_pokemon_pic_test!(
set_pokemon_pic_front_123,
123,
PokemonPicFace::FRONT,
"../secrets/data/pokemon_pic/front-123.png",
PicEncodingMethod::TWO(1),
0x2721C,
... | Rust | 0 |
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from data.config import CHANNELS
channels = InlineKeyboardMarkup(row_width=2)
tekshirish = (InlineKeyboardButton(text="Tekshirish",callback_data='check_subs'))
channels.insert(tekshirish) | Python | 1 |
::option::Option<unsafe extern "system" fn(pparameter: *const ::core::ffi::c_void)>;
#[doc = "*Required features: `\"Win32_System_Services\"`*"]
pub type PSC_NOTIFICATION_CALLBACK = ::core::option::Option<unsafe extern "system" fn(dwnotify: u32, pcallbackcontext: *const ::core::ffi::c_void)>;
#[repr(C)]
#[doc = "*Requi... | Rust | 0 |
name {
fn jce_put_raw(self, jce_mut: &mut jcers::JceMut) {
#ts
}
}
};
Ok(ts)
}
fn to_compile_errors(errors: Vec<syn::Error>) -> proc_macro2::TokenStream {
let errors = errors.into_iter().map(|e| e.to_compile_error());
quote! {
#(#error... | Rust | 0 |
[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _from(value: bool) -> IRLPR {
match value {
false => IRLPR::NORMAL,
true => IRLPR::LOWPOWER,
}
}
#[doc = "Checks if the value of the field is `NORMAL`"]
#[inline]
pub fn is_normal(&self) -> bool {
... | Rust | 0 |
None, build_dir=None):
"""👾 Execute code through LLDB
spin lldb -c 'import numpy as np; print(np.__version__)'
Or run another program, they way you normally would with LLDB:
\b
spin lldb -- ls -al
You can also run Python programs:
\b
spin lldb -- my_tests.py
spin lldb --... | Python | 1 |
E}[*] Scanning {url}...{Style.RESET_ALL}")
scanner = XSSGameScanner(url)
scanner.scan(url)
except FileNotFoundError:
print(f"{Fore.RED}[!] File {file_name} tidak ditemukan!{Style.RESET_ALL}")
elif pilihan == "3":
active_urls = []
file_name ... | Python | 1 |
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""Installation script for the 'isaaclab_rl' python package."""
import itertools
import os
import toml
from setuptools import... | Python | 1 |
let len = K::mr() * K::nr();
let v: Vec<TC> = (0..len).map(|f| f.as_()).collect();
fused_ops::<K, TC, TI, _>(&*v, &[FusedKerSpec::ScalarAdd(5.as_())], |_, _, c| c + 5.as_())
}
pub fn return_c_scalar_mul<K, TC, TI>()
where
K: MatMatMulKer<TI>,
TC: LADatum + AsPrimitive... | Rust | 0 |
()
self.startState = gameState.getPacmanPosition()
if start != None: self.startState = start
self._visited, self._visitedlist, self._expanded = {}, [], 0 # DO NOT CHANGE
def getStartState(self):
return self.startState
def getWidth(self):
"""
Returns the width of... | Python | 1 |
vice
include_context = not config_args.only_users
for database_config in config.database.databases:
if "main" in database_config.databases:
break
engine = create_engine(database_config.config)
with make_conn(database_config, engine, "review_recent_signups") as db_conn:
# T... | Python | 1 |
e.context_msg(
"Expected all child expressions of the n-ary bitvector \
equality expression to be of the same bitvector type.",
)
})?;
let bveq = BitvecEquals {
children_bitvec_ty: children_bitvec_ty.unwrap(),
... | Rust | 0 |
}%)")
print(f"Average word accuracy: {summary['avg_word_accuracy']:.3f} ({100*summary['avg_word_accuracy']:.1f}%)")
print(f"Average confidence: {summary['avg_confidence']:.3f}")
print()
print("ACCURACY DISTRIBUTION:")
total_success = summary['successful_predictions']
if total_success > 0:
... | Python | 1 |
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail="Zařízení s tímto ID nebylo nalezeno."
)
# Kontrola, zda zařízení nemá navázané lokace
if device.locations and len(device.locations) > 0:
raise HTTPException(
status_code=status.HTTP_400_B... | Python | 1 |
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
# useful for handling different item types with a single interface
from itemadapter import is_item, ItemAdapter
class AclspiderSpiderMiddleware:
... | Python | 1 |
ProjectionMatrix(W, H, fx, fy, cx, cy):
P = torch.zeros(4, 4)
P[0, 0] = 2 * fx / W
P[1, 1] = 2 * fy / H
P[0, 2] = 2 * (cx / W) - 1
P[1, 2] = 2 * (cy / H) - 1
P[2, 2] = 0
P[2, 3] = 0
P[3, 2] = 1
return P
def focal2fov(focal, pixels):
return 2 * math.atan(pixels / (2 * focal))
... | Python | 1 |
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
def build_model_pipeline():
pipeline = Pipeline([
('scaler', StandardScaler()),
('gbr', GradientBoostingRegressor(random_state=42))
])
return pipelin... | Python | 1 |
::is_empty")]
pub recording: String,
}
mod meeting_date_format {
use chrono::NaiveDate;
use serde::{self, Deserialize, Deserializer, Serializer};
const FORMAT: &str = "%m/%d/%Y";
pub const DEFAULT_DATE: &str = "01/01/1969";
// The signature of a serialize_with function must follow the pattern... | Rust | 0 |
#!/usr/bin/python3
import numpy
import scipy.spatial
from scipy.spatial.transform import Rotation
from pyridescence import *
# Create a viewer instance (global singleton)
viewer = guik.LightViewer.instance()
angle = 0.0
# Define a callback for UI rendering
def ui_callback():
# In the callback, you can call ImGui ... | Python | 1 |
#Implementation of loss Functions using liberaries in python 1
import tensorflow as tf
from tensorflow import keras
import numpy as np
# 1. Regression Loss Functions
y_true = np.array([3.0, 5.0, 7.0, 9,0])
y_pred = np.array([2.5, 5.5, 6.8, 8.9])
#Mean squared error
mse_loss = keras.losses.MeanSquaredError()
print("M... | Python | 1 |
"""
Tests automatic loading of controlnet and pose detection
"""
import os
import PIL
from enfugue.util import logger
from enfugue.diffusion.engine import DiffusionEngine
from enfugue.diffusion.constants import *
from pibble.util.log import DebugUnifiedLoggingContext
PROMPT = "A schoolteacher waving hello"
CONTROLNET... | Python | 1 |
g("quī".into())),
(String::from("gender"), KdlValue::String("neuter".into())),
(String::from("number"), KdlValue::String("singular".into())),
].into_iter().collect(),
children: Vec::new(),
}),
Fragment::Text(" quas\n\tsuscipit reprehenderit eos commodi. Dolores earum iste tempore culpa ut nostrum.\n\t... | Rust | 0 |
Pubkey::find_program_address(&auction_root_state_seeds(&auction_id), &CONTRACT_ID);
let (auction_bank_pubkey, _) =
Pubkey::find_program_address(&auction_bank_seeds(&auction_id), &CONTRACT_ID);
close_and_claim_n_cycles(&mut testbench, auction_id, &auction_owner, &payer, 3).await;
let auctio... | Rust | 0 |
.
SetRes = 0x71,
/// An individual response for Get; Property value read response.
GetRes = 0x72,
/// Property value notification. Both individual notification and broadcast notification.
Inf = 0x73,
/// Individual property value notification (response required).
InfC = 0x74,
/// An indi... | Rust | 0 |
{ unsafe {
let mut out = null_mut();
let hr = (self.get_vtbl().get_HmacSha256)(self.get_abi() as *const _ as *mut _, &mut out);
if hr == S_OK { Ok(HString::wrap(out)) } else { err(hr) }
}}
#[inline] pub fn get_hmac_sha384(&self) -> Result<HString> { unsafe {
let mut out = null... | Rust | 0 |
length).setAll(0, raw);
return ans;",
ty.safe_ident(),
)
}
GeneralList(list) => {
// NOTE 内存策略同PrimitiveList(比如Uint8List之类),见那边的注释
format!(
"final ans = inner.new_{}(raw.length);
for (var i = 0; i < raw.l... | Rust | 0 |
clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
... | Rust | 0 |
3149, 113, 7370, 10123, 3915, 6998, 2704, 8653, 4938, 1426, 7635,
10512, 1663, 6957, 3510, 2370, 2865, 3978, 9320, 3247, 9603, 6882,
3186, 10659, 10163, 1153, 9405, 8241, 10040, 2178, 1544, 5559, 420,
8304, 4905, 476, 3531, 5191, 9153, 2399, 8889, 3000, 671, 243,
30... | Rust | 0 |
for lote in lotes_detalhados:
num_lote = lote.split('|')[0].strip().replace("Lote ", "")
lotes_dict_final[num_lote] = lote
status_leilao_final_check = status
pagina += 1
except Exception as e:
log(f"❌ Erro ao acessar a página {p... | Python | 1 |
import enum
from dataclasses import dataclass
from typing import Optional
from pyhanko.sign.validation.qualified.tsp import (
QcCertType,
QualifiedServiceInformation,
)
__all__ = [
'QcPrivateKeyManagementType',
'QualificationResult',
'QualifiedStatus',
]
class QcPrivateKeyManagementType(enum.Enu... | Python | 1 |
rde(rename_all = "snake_case")]
pub enum QueryAnswer {
RoyaltyInfo {
royalty_info: Option<DisplayRoyaltyInfo>,
},
}// Copyright 2021 <NAME>.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http:... | Rust | 0 |
n_registros = int(input())
if not (1 <= n_registros <= 20):
exit()
registros = []
tempo_total = 0
tempos_resposta = {}
mensagens_recebidas = {}
for _ in range(n_registros):
entrada = input().split(' ')
tipo = str(entrada[0])
valor = int(entrada[1])
if not (1 <= valor <= 100):
exit()
... | Python | 1 |
01000;
const Z_NEG = 0b00010000;
const Z_POS = 0b00100000;
}
}
/// Represents an assignment of e.g. a cell to the outer faces of a grid it touches
#[derive(Copy, Clone, Debug)]
pub struct GridBoundaryFaceFlags(FaceFlags);
/// Represents an assignment of e.g. an edge to the outer faces of a cell it ... | Rust | 0 |
,
#[cfg(feature = "VK_EXT_display_control")]
DISPLAY_EVENT_INFO_EXT = 1000091002,
#[cfg(feature = "VK_EXT_display_control")]
SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003,
// feature: VK_GOOGLE_display_timing
#[cfg(feature = "VK_GOOGLE_display_timing")]
PRESENT_TIMES_INFO_GOOGLE = 10000920... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenMiniIcpFaceauthQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenMiniIcpFaceauthQueryResponse, self).__init__()
self._certify_result_desc =... | Python | 1 |
chol.nrows(),
"The input vector must be of the same size as the factorized matrix."
);
let mut beta = crate::one::<N::RealField>();
for j in 0..n {
// updates the diagonal
let diag = N::real(unsafe { *chol.get_unchecked((j, j)) });
let diag2 = di... | Rust | 0 |
]
if isinstance(self.columns, MultiIndex):
element_props.append(("thead tr th", "text-align", "left"))
if self.show_row_idx_names:
element_props.append(
("thead tr:last-of-type th", "text-align", "right")
)
else:
... | Python | 1 |
ict=return_dict,
cache_position=cache_position,
)
hidden_states = outputs[0]
logits = self.lm_head(hidden_states)
logits = logits / self.config.logits_scaling
loss = None
if labels is not None:
# Upcast to float if we need to compute the loss to ... | Python | 1 |
from typing import Tuple
import torch
from torch.autograd import Function
from ..utils import ext_loader
ext_module = ext_loader.load_ext('_ext', ['three_nn_forward'])
class ThreeNN(Function):
"""Find the top-3 nearest neighbors of the target set from the source set.
Please refer to `Paper of PointNet++ <... | Python | 1 |
"type": "array",
"title": "Location",
},
"msg": {"type": "string", "title": "Message"},
"type": {"type": "string", "title": "Error Type"},
},
... | Python | 1 |
ecoder,
entry::Entry,
header::DataHeader,
types::{BucketCountType, StringSectionOffsetType, STRING_SECTION_OFFSET_RESERVED},
utility::{ByteSwappable, Packable},
};
/// A bucket represents three offsets into the headermap file,
/// each offset pointing to the beginning of a NULL-terminated
/// UTF-8 str... | Rust | 0 |
"""
核心模組測試
"""
| Python | 1 |
ts {
use super::*;
use crate::TestKitBuilder;
fn assert_send<T: Send>(_object: &T) {}
#[test]
fn assert_send_for_testkit_api() {
let mut testkit = TestKitBuilder::validator().build();
let api = testkit.api();
assert_send(&api.public(ApiKind::Explorer).get::<()>("v1/transact... | Rust | 0 |
to create a temp directory");
let mut path: PathBuf = tmp_dir.into_path();
path.push(".garden");
let head_ref = HeadRef::try_from("my-garden").unwrap();
FsChainStore::<ChainAction>::try_new(path.clone(), head_ref)
.expect("Failed to create ChainStore");
assert!(subp... | Rust | 0 |
class without_operators:
def sum_(self,a,b):
self.a = a
print(f"a:{a}b:{b}")
self.b = b
while b != 0:
print(f"a:{a}b:{b}")
c = a & b
a = a ^ b
b = c << 1
return a
def minus_(self,c,d):
if (c < d):
c,d = d... | Python | 1 |
, Serialize, Deserialize)]
pub enum CreatedByType {
User,
Application,
ManagedIdentity,
Key,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum LastModifiedByType {
User,
Application,
ManagedIdentity,
Key,
}
}
<filena... | Rust | 0 |
, &result)
}
///报单录入请求响应
#[no_mangle]
pub unsafe extern "C" fn TradeSpiStub_Rust_OnRspOrderInsert(
spi: *mut c_void,
pInputOrder: *const CThostFtdcInputOrderField,
pRspInfo: *const CThostFtdcRspInfoField,
nRequestID: i32,
bIsLast: bool,
) {
let spi = &mut **(spi as *mut *mut dyn TradeSpi);
... | Rust | 0 |
[cfg(feature = "nccl")]
pub struct NcclFlatGroup {
cfg: FlatGroupConfig,
sections: Vec<GPULazyAsyncSection>,
states: Vec<NcclState>,
}
#[cfg(feature = "nccl")]
impl NcclFlatGroup {
pub fn new(cfg: FlatGroupConfig, mut pools: Vec<GPUDeviceStreamPool>) -> NcclFlatGroup {
let mut sections = vec![];
... | Rust | 0 |
import numpy as np
def calculate(lst):
if len(lst)!=9:
raise ValueError("List must contain nine numbers.")
matrix = [lst[i*3:(i+1)*3] for i in range(3)]
mean_values = [np.mean(matrix, axis=0).tolist(), np.mean(matrix, axis=1).tolist(), np.mean(lst)]
var_values = [np.var(matrix, axis=0).t... | Python | 1 |
es<V, I>) -> Self::Output {
self.assert_binop(&_rhs);
let new_values: Vec<O> = Elemwise::elemwise_rr(&self.values,
&_rhs.values,
|x, y| x.$m(y));
... | Rust | 0 |
import re
def extract_mentions(message: str, triggerChar: str = "@"):
# Escape triggerChar in case it's a regex special character
triggerChar = re.escape(triggerChar)
pattern = rf"<{triggerChar}([A-Z]):([^|>]+)"
matches = re.findall(pattern, message)
return [{"id_type": id_type, "id": id_value} f... | Python | 1 |
from __future__ import print_function
import cv2 as cv
import numpy as np
import argparse
import random as rng
rng.seed(12345)
def thresh_callback(val):
threshold = val
## [Canny]
# Detect edges using Canny
canny_output = cv.Canny(src_gray, threshold, threshold * 2)
## [Canny]
## [findContou... | Python | 1 |
q.consume() consumed 0 frames");
if self.tx_q.needs_wakeup() {
log::debug!("tx: waking up tx_q");
self.tx_q.wakeup().expect("failed to wake up tx queue");
log::debug!("tx: woke up tx_q");
}
}
*/
log::debug!("tx: comp_q.consu... | Rust | 0 |
# -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""
import os, random, string
from datetime import timedelta
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
class BaseConfig():
SECRET_KEY = os.getenv('SECRET_KEY', None)
if not SECRET_KEY:
SECRET_KEY = ''.join(random.... | Python | 1 |
import streamlit as st
import geopandas as gpd
import pyarrow.parquet as pq
import os
from shapely import wkb
import folium
from streamlit_folium import folium_static
from shapely.geometry import mapping
# Set page configuration
st.set_page_config(page_title="Arizona Rooftop Solar Potential Mapper", layout="wide")
# ... | Python | 1 |
opacity = self.cfg.mapping.pruning_min_opacity
prune_mask = torch.zeros_like(opacity, dtype=torch.bool)
if min_opacity > 0:
prune_mask = prune_mask | (opacity < min_opacity)
scaling = self.model.get_gmodel.get_scaling
min_scaling = self.cfg.mapping.pruning_min_size
if... | Python | 1 |
1.2, 12.2, 13.2, 14.2, 15.2,
8.4, 9.4, 10.4, 11.4, 12.4, 13.4, 14.4, 15.4,
8.6, 9.6, 10.6, 11.6, 12.6, 13.6, 14.6, 15.6,
8.8, 9.8, 10.8, 11.8, 12.8, 13.8, 14.8, 15.8]
start_loc = 160 # 数据起始位置(0.5s + 0.14s)
data_len = 250 # 数据长度
latency = 3 # 自相关矩阵的最大阶次 The ... | Python | 1 |
import json
from pathlib import Path
import sqlite3
import pytest
from llmsql import LLMSQLEvaluator
@pytest.mark.asyncio
async def test_connect_and_close(dummy_db_file):
evaluator = LLMSQLEvaluator()
evaluator.connect(dummy_db_file)
assert isinstance(evaluator.conn, sqlite3.Connection)
evaluator.cl... | Python | 1 |
new_cup_share(block.content.as_ref(), &beacon, node_test_id(0));
let share1 = new_cup_share(block.content.as_ref(), &beacon, node_test_id(1));
let share2 = new_cup_share(block.content.as_ref(), &beacon, node_test_id(2));
pool.insert_validated(share0.clone());
pool.insert... | Rust | 0 |
e[
[AbstractEnvironment[IT, KT, DT, VT, Any, LT]], ALSklearn[IT, KT, DT, VT, LT, Any]
]:
def builder(
env: AbstractEnvironment[IT, KT, DT, VT, Any, LT]
) -> ALSklearn[IT, KT, DT, VT, LT, Any]:
return ALSklearn.build(
clf, env, vectorizer=vectorizer, vectorstorage_builder=vectorst... | Python | 1 |
nit_factor)
if len(pattern) % 2 == 1:
# Needs to be even
pattern.extend(pattern)
wobble.userdata = [pattern_idx, pattern, -1.0]
pattern_idx = wobble.userdata[0]
pattern = wobble.userdata[1]
next_target = wobble.userdata[2]
for tx, ty in wobble.wobble(x0, y0, x1, ... | Python | 1 |
s(args))
# output processor
if args.save:
# save the RNN beat activations to file
out_processor = ActivationsProcessor(mode='w', **vars(args))
else:
# track the beats with a DBN and output them
beat_processor = DBNBeatTrackingProcessor(**vars(args))
out_processor = [... | Python | 1 |
unsignedRawTx", raw_tx_buffer)
.chain_neon(&mut ctx, "Unable to set unsignedRawTx of return object")?;
return_object
.set(&mut ctx, "txId", tx_id)
.chain_neon(&mut ctx, "Unable to set txId of return object")?;
Ok(return_object)
}
pub fn withdraw_unbonded_transaction_to_hex(mut ctx: Fun... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.