text string | label_name string | labels int64 |
|---|---|---|
::g_points' and 'g_points'.
frame = thread.GetFrameAtIndex(0)
# Build ValueCheckers for the values we're going to find:
value_check_A = self.build_value_check("A::g_points", ["1", "2", "11", "22"])
value_check_none = self.build_value_check("g_points", ["3", "4", "33", "44"])
val... | Python | 1 |
ponse=Mock(status_code=429), body="")
success_response = Mock()
success_message = Mock()
success_message.content = "Mountain peak stands tall,\nClouds embrace its snowy crown,\nSilence speaks volumes."
success_response.choices = [Mock(message=success_message)]
def side_effect(*a... | Python | 1 |
=fig_html, fig_html2=fig_html2)
# Update axis labels
fig.update_layout(
xaxis_title="Value",
yaxis_title="Frequency"
)
# Convert Plotly figure to JSON using plotly.io.to_json
graph_json = json.dumps(pio.to_json(fig))
return render_template("histogram.html", graph_json=grap... | Python | 1 |
time,
});
continue;
}
if let Some(e) = load::<events::BankruptcyLog>(&bytes) {
bank.push(db::Bankruptcy {
sig: sig.clone(),
base_symbol: e.base_symbol.to_string(),
liqor_margin: e.liqor_margin.to_string... | Rust | 0 |
rill_config)
# sexpr.append(['layers'] + node.layers)
# if node.shape == Pad.SHAPE_ROUNDRECT:
# sexpr.append(['roundrect_rratio', node.radius_ratio])
# if node.shape == Pad.SHAPE_CUSTOM:
# # gr_line, gr_arc, gr_circle or gr_poly
# sexpr.append(SexprSerialize... | Python | 1 |
sed data (Silver layer)
return [f"{base_path}/data_parsing.parquet"]
elif step == CVREnrichmentStep.FINANCIAL_DOCUMENTS:
# Financial documents depend on company fetching (no batching)
return [f"{base_path}/company_fetching.parquet"]
elif step == CVREnrichmentStep.ADDRESS_GEOCODING:
... | Python | 1 |
let quad = sqr * sqr;
let eighth = quad * quad;
let sixteenth = eighth * eighth;
sixteenth * elem
}
// default to cubed
n => return Err(PoseidonError::InvalidSboxSize(*n)),
};
Ok(res)
}
_ => return Err(PoseidonError::InvalidSboxSize(0)),
}
}
}
pub trait SboxConstrain... | Rust | 0 |
Raises:
ValueError: If tree integrity is violated
"""
if not logger.is_debug_mode():
return
# Verify parent references of all subdirectories
for child in node.dir_nodes:
if child.parent != node:
raise ValueError(f"Subdirectory {child... | Python | 1 |
####################################################################################################
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear
####################################################################################################
imp... | Python | 1 |
choices=list(relaxation_guides.keys()),
label="选择放松训练类型"
)
relaxation_guide = gr.Textbox(label="训练指导", value="请选择一种放松训练方式")
def update_diary(current_user):
user_id = current_user['id']
DIARY_ENTRIES = get_all_emotion... | Python | 1 |
) -> Result<OffsetDateTime, LandslideError> {
let mut bytes_reader = Cursor::new(timestamp_bytes);
let version = bytes_reader.read_u8()
.context("When conveting from Golang's Binary Marshal'd format to an OffsetDateTime, unable to read the format byte u8 from the timestamp byte vec.")?;
... | Rust | 0 |
(filter)
// }
// /// Retrieves the type's field with the specified `name`, if it exists.
// pub fn get_field(&self, name: &str) -> Option<&FieldInfo> {
// self.fields.iter().find(|f| f.name == name).map(|f| *f)
// }
// /// Retrieves the type's fields.
// pub fn get_fields(&self) -> imp... | Rust | 0 |
out, [1, 3, 1, core::i16::MAX, core::i16::MIN, 108, 16, 22]);
}
#[test]
fn m128i_saturating_add_u8() {
let ai: m128i =
cast([0_u8, 1, 255, 127, 0, 100, 7, 2, 3, 1, 255, 255, 103, 10, 15, 16]);
let bi: m128i =
cast([1_u8, 2, 2, 1, 255, 8, 9, 20, 60, 40, 2, 9, 255, 26, 30, 31]);
let out: [u8; 16] = cast(ai... | Rust | 0 |
nd.add_input(Output {
operation: children[1].clone(),
index: 0,
});
nd.finish()
}
fn derivative_by_variable(&self, _var: &str) -> Result<Expr<T>, Status> {
Err(invalid_arg!("Cannot take the derivative of an assignment")... | Rust | 0 |
walk = repository
.revwalk()
.map_err(|err| err.message().to_string())?;
walk.set_sorting(git2::Sort::TOPOLOGICAL | git2::Sort::TIME)
.map_err(|err| err.message().to_string())?;
walk.push_glob("*")
.map_err(|err| err.message().to_string())?;
if ... | Rust | 0 |
@"cargo:rustc-link-lib=KIND=NAME\n"
);
}
#[test]
fn multiple_name_expression_with_kind() {
insta::assert_display_snapshot!(
crate::capture_output(|output| {
let name2 = "NAME2";
let kind2 = "KIND2";
crate::rustc_link_li... | Rust | 0 |
An error occurred publishing message {:?}", e);
}
}
Ok(())
}
<reponame>JWorthe/worthe_signals
use std::cmp::{PartialOrd};
use ::num_traits::{Trig, Pow, ArithmeticOps, SignedArithmeticOps, FractionOps};
use ::complex::Complex;
/// A data structure representing a sinusoid. AKA the sin or cos functi... | Rust | 0 |
r_create");
group.bench_function("bytes", |bench| {
let r = Rope::from_str(TEXT);
bench.iter(|| {
r.bytes();
})
});
group.bench_function("chars", |bench| {
let r = Rope::from_str(TEXT);
bench.iter(|| {
r.chars();
})
});
group... | Rust | 0 |
d:
^^
sdk/foo/foo.fidl: 10:8: Name <Bb>
Aa. Bb? Cc! Dd:
^
sdk/foo/foo.fidl: 10:10: EndOfSentence <?>
Aa. Bb? Cc! Dd:
^^
sdk/foo/foo.fidl: 10:12: Name <Cc>
Aa. Bb? Cc! Dd:
^
sdk/foo/foo.fidl: 10:14: EndOfSentence <!>
Aa. Bb? Cc! Dd:
^^
sdk/foo/foo.fidl: 10:16: Name <Dd>
Aa. Bb? Cc... | Rust | 0 |
fn test_hg_get_branch_fails() -> io::Result<()> {
let tempdir = tempfile::tempdir()?;
// Create a fake corrupted mercurial repo.
let hgdir = tempdir.path().join(".hg");
fs::create_dir(&hgdir)?;
fs::write(&hgdir.join("requires"), "fake-corrupted-repo")?;
expect_hg_branch_with_config(
t... | Rust | 0 |
##################################################
# The Toontown Offline Magic Word Manager
##################################################
# Author: Benjamin Frisby
# Copyright: Copyright 2020, Toontown Offline
# Credits: Benjamin Frisby, John Cote, Ruby Lord, Frank, Nick, Little Cat, Ooowoo
# License: MIT
# Versi... | Python | 1 |
"""Objects shared by modules in the docx.oxml subpackage."""
from __future__ import annotations
from typing import cast
from docx.oxml.ns import qn
from docx.oxml.parser import OxmlElement
from docx.oxml.simpletypes import ST_DecimalNumber, ST_OnOff, ST_String
from docx.oxml.xmlchemy import BaseOxmlElement, Optional... | Python | 1 |
eaders = ["Order ID", "User ID", "Total Qty", "Total Price", "Payment Method", "Show Detail"]
# for i in range(len(headers)):
# create_head(self.orderlist_frame, text=headers[i]).grid(row=0, column=i + 1)
# #create multiple button widgets and place them on frame
# va... | Python | 1 |
from unitxt import add_to_catalog
from unitxt.blocks import (
MapInstanceValues,
Rename,
Set,
SplitRandomMix,
TaskCard,
)
from unitxt.loaders import LoadCSV
from unitxt.test_utils.card import test_card
dataset_name = "CFPB"
subset_and_urls = {
"watsonx": "https://raw.githubusercontent.com/IBM/w... | Python | 1 |
''' Q1
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine if you are able to reach the last index.
E.g
Input: [2,3,1,1,4]
Output: True
Inp... | Python | 1 |
from user import User
class Librarian(User):
def get_user_type(self):
return "Librarian" | Python | 1 |
constraints
# Flow balance
for i in items:
for t in periods:
if t == 0:
model.addConstr(
gp.quicksum(x[i,m,t] for m in machines) ==
demands[i,t] + s[i,t] - b[i,t]
)
else:... | Python | 1 |
c = u32x2::gather_load(a, [2, 2]);
/// assert_eq!(c, u32x2::new([3, 3]));
/// ```
///
/// # Panics
///
/// * If the `idx` slice doesn't have the same length as the vector.
/// * If any of the indices is out of bounds of the `input`.
///
/// [`new`]: Vector::new
#[inline]
pub... | Rust | 0 |
mat})
def test_batch_shape_mismatch_v_and_diag_raises_dynamic(self):
with self.test_session():
v = self._rng.rand(4, 3, 2)
diag = self._rng.rand(5, 1) # Should be shape (4, 2,) to match v.
mat = self._random_pd_matrix((4, 3, 3)) # mat and v match
v_ph = tf.placeholder(tf.float32, name=... | Python | 1 |
ieRenderer};
use crate::render::{Renderer, Texture};
use crate::world::World;
use cgmath::{Point3, Vector3};
use collision::Aabb3;
use dashmap::DashMap;
use lazy_static::lazy_static;
use std::sync::Arc;
pub mod player_like;
pub mod slime;
mod systems;
pub mod versions;
pub mod zombie;
// TODO: There may be wrong entr... | Rust | 0 |
= board_offset_x + square[0] * square_size # Top-left corner of the square
y = board_offset_y + square[1] * square_size # Top-left corner of the square
pygame.draw.rect(screen, 'yellow', [x + 1, y + 1, square_size - 2, square_size - 2], 2) # Adjust for all sides
if selection... | Python | 1 |
color="k", **kwargs)
pwl.plot_error(energy_bounds=energy_bounds, **kwargs)
ax.set_ylim(1e-13, 1e-11)
ax.set_xlim(energy_bounds)
ax.legend()
plt.show()
######################################################################
# Exponential Cut-Off Powerlaw Fit
# --------------------------------
#
# Next we fit an
# `~ga... | Python | 1 |
//
// <<Compute cosThetaT using Snell’s law>>
// Float sinThetaI = std::sqrt(std::max((Float)0,
// 1 - cosThetaI * cosThetaI));
// Float sinThetaT = etaI / etaT * sinThetaI;
// <<Handle total internal reflection>>
// Float cosThetaT = std::sqrt... | Rust | 0 |
st {
key: [0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,],
pt: [0x93,0xc4,0xe3,0x4a,0x72,0x2f,0x74,0xb1,0x9a,0xb9,0x81,0x1e,0xb6,0x04,0x4e,0xaf,],
ct: [0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,]
},
Aes128Test {
... | Rust | 0 |
import os
from FlagEmbedding import FlagAutoModel
def test_icl_multi_devices():
examples = [
{
'instruct': 'Given a web search query, retrieve relevant passages that answer the query.',
'query': 'what is a virtual interface',
'response': "A virtual interface is a softwa... | Python | 1 |
llageKey, WorkerKey},
PlayerInitData,
attacks::AttackDescriptor,
};
use paddlers_shared_lib::sql::GameDB;
use crate::game_master::attack_funnel::PlannedAttack;
use crate::authentication::Authentication;
use crate::setup::initialize_new_player_account;
use crate::StringErr;
pub fn index() -> impl Responder {
... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2013 Google LLC. All Rights Reserved.
#
# 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 requir... | Python | 1 |
from tkinter import *
from tkinter import messagebox
top = Tk()
top.geometry("100x100")
messagebox.showwarning("warning","Warning")
top.mainloop()
| Python | 1 |
file_type()?;
if type_.is_file() {
let inode = inode.borrow_mut().create(name, FileType::File).expect("Failed to create INode");
let mut file = fs::File::open(entry.path())?;
inode.borrow_mut().resize(file.metadata().unwrap().len() as usize).expect("Failed to resize INode");
... | Rust | 0 |
dule_partition_to_compact(
&self,
p: &IdRow<Partition>,
) -> Result<(), CubeError> {
let node = self.cluster.node_name_by_partition(p);
let job = self
.meta_store
.add_job(Job::new(
RowKey::Table(TableId::Partitions, p.get_id()),
... | Rust | 0 |
!(false);}
};
match &worker_row
.values()[2] {
TableValue::String(pp_plan) => {
let regex = Regex::new(
r"PartialHas+hAggregate\s+Filter\s+Merge\s+Scan, index: default:1:\[1\], fie... | Rust | 0 |
5992]
# p1 = np.array([0.698746,1.852252,-2.116155],dtype=np.float32)
# p2 = np.array([0.706313, 1.852198, -2.119826],dtype=np.float32)
# p3 = np.array([0.711732,1.845759,-2.115992],dtype=np.float32)
# p4 = np.array([28.397535,-7.744916,8.693146],dtype=np.float32)
# beta1 = np.pi - np.arctan2(p1[1], p1[0])
# beta2 = np... | Python | 1 |
)
def reorient_cells(mesh: Mesh, kind: str, idxs: List[int]) -> int:
"""
Flip local node order for 'tri'/'quad' cells (CW↔CCW); returns count changed.
"""
if not idxs:
return 0
if kind == "tri":
if mesh.tris is None: return 0
A = mesh.tris
for i in idxs:
... | Python | 1 |
.");
Ok(())
}
#[stest::test]
fn test_execute_real_txn_with_starcoin_vm() -> Result<()> {
let chain_state = prepare_genesis();
let sequence_number1 = get_sequence_number(account_config::association_address(), &chain_state);
let account1 = Account::new();
let txn1 = Transaction::UserTransaction(crea... | Rust | 0 |
x0c\
\x06Mx,S-\xde\xa3\x95\x07m\x8a\x0f-\x06\x0d\
\x1f:\xfb\xef&^\x1b\xb3\xa8\x87y4\x07XS\x15\
\x97\xf7P*C\x82\x22F\x93\x152\x7f\xda\xd7\x90\xae\
\xa0\xffJ\x10&!\xe6lEb\xe23L\x10}\xe8\
\xf1\x1aV\xe9\xd6\x09\xf1\x18\xcc\xdd\x18\x19+\x80Q\x98\
\xb8c\xea\xedn\xb0\x9f$1'\xb8\xd9L\xf3\x86\xe3\
p\x85#\x9f\x12\xc6b\xb6\xf2(\x... | Python | 1 |
ptr })
}
}
}
pub fn pcap_set_snaplen(
handle: &DeviceHandle,
snaplen: i32,
) -> i32 {
unsafe {
raw::pcap_set_snaplen(handle.as_mut_ptr(), snaplen)
}
}
pub fn pcap_set_promisc(
handle: &DeviceHandle,
promisc: i32,
) -> i32 {
unsafe {
raw::pcap_set_promisc(handle... | Rust | 0 |
from datetime import datetime as DT
from discord.ext import commands
import calendar
import discord
import json
import time
class guildMemberAdd(commands.Cog):
def __init__(self, bot):
self.bot = bot
print("guildMemberAdd initialized")
@commands.Cog.listener()
async def on_member_join(sel... | Python | 1 |
n(q, 6)
println(has_6)
}
func in(array [4]int, x int) bool {
for i := 0; i < 4; i++ {
if array[i] == x {
return true
}
}
return false
}
"#,
r#"true
false
"#,
)
}
#[test]
fn test_array_return() {
compare_stderr_output(
r#"
package main
func main() {... | Rust | 0 |
from hyperparameter_hunter import Environment, CVExperiment, BayesianOptPro
from hyperparameter_hunter import Real, Integer, Categorical
from hyperparameter_hunter.utils.learning_utils import get_breast_cancer_data
import os.path
from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau
from keras.layers import De... | Python | 1 |
#!/usr/bin/env python
"""Pi digits example
Example shows arbitrary precision using mpmath with the
computation of the digits of pi.
"""
from sympy.mpmath import libmp, pi
from sympy.mpmath import functions as mpf_funs
import math
from time import clock
import sys
def display_fraction(digits, skip=0, colwidth=10, ... | Python | 1 |
request_bps as f64;
let expect_ms = (expect_sec * 1000.0).round() as u64;
let wait_ms = expect_ms.saturating_sub(elapsed_ms);
Duration::from_millis(wait_ms as u64)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_compute_sleep_duration_to_adjust_speed() {
assert_eq!(
... | Rust | 0 |
session;
pub mod web;
pub(crate) use tokio_stream as stream;
<reponame>rise0chen/fixed-queue
use super::common::MemoryState;
use core::mem::MaybeUninit;
use core::ptr;
use core::sync::atomic::{AtomicU8, Ordering};
#[derive(Debug)]
pub struct AtomicOption<T> {
buf: MaybeUninit<T>,
state: AtomicU8,
}
impl<T> A... | Rust | 0 |
}
"#,
expect![[r#"
fd foo u32
fd bar ()
"#]],
);
}
#[test]
fn test_record_pattern_field_in_simple_macro() {
check(
r"
macro_rules! m { ($e:expr) => { $e } }
struct S { foo: u32 }
fn process(f: S) {
m!(match f {
... | Rust | 0 |
size: size,
sides: Sides::empty(),
coords: Vec::new(),
};
(sheet_xy, sheet_xz, sheet_yz, cuboid_base)
}
#[test]
fn box_is_created_with_set_sides_that_are_translated() {
let (dx, dy, dz) = (3.0, 5.0, 7.0);
let lattice = LatticeType::Hexagonal {... | Rust | 0 |
i8,
);
}
log[i as usize] = 0;
if log[0] != 0 {
debug(&String::from_utf8(log).unwrap());
}
}
/*
void shader_print_log(shader* shader) {
char log[2048];
int i;
glGetShaderInfoLog(shader_handle(shader), 2048, &i, log);
log[i] = '\0';
if (strcmp(log, "") != 0) {
debug("%s", log);
}
... | Rust | 0 |
cache at the specified time
///
fn get_canvas_cache_at_time(&self, time_index: Duration) -> Arc<dyn CanvasCache> {
Arc::new(StreamLayerCache::new(Arc::clone(&self.core), self.layer_id, time_index))
}
}
impl VectorLayer for StreamLayer {
///
/// The brush that will be active for the next ele... | Rust | 0 |
acts_sdk::transactions::{
/// get_transaction_effective_fee,
/// };
/// use xpx_supercontracts_sdk::transactions_type::{GetTransactionEffectiveFee};
///
/// let params = GetTransactionEffectiveFee{
/// id: String::from("some_id"),
/// };
/// // Get info data
/// let result = get_transaction_effective_fee(¶ms);
//... | Rust | 0 |
n.start, region.k, region.covered) for region in regions]
for v in vs:
self.assertTrue(v in start_elements, '%s region failed' %fn)
def test_infer(self):
for fn, url, case in INFER_CASES:
d = Depta()
body = self._get_html(fn)
s... | Python | 1 |
yr:2012",
"ecl:brn hgt:182cm pid:021572410 eyr:2020 byr:1992 cid:277",
"",
"hgt:59cm ecl:zzz",
"eyr:2038 hcl:74454a iyr:2023",
"pid:3556412378 byr:2007"
];
assert_eq!(2 , part1(test_input.to_vec()));
assert_eq!(4 , part2(test_input1.to_vec()));
assert_eq!(0 , part... | Rust | 0 |
ain}%', f'%.{domain}'))
rows = cursor.fetchall()
for row in rows:
name, value, host, path, expiry, is_secure, is_httponly = row
cookies.append({
'name': name,
'value': value,
... | Python | 1 |
nt_time - added,
})?;
}
Ok(())
}
fn insert_100_messages_benchmark(b: &mut Bencher) {
let conn = chatlog_tools::tests::get_connection();
b.iter(|| add_messages(&conn, 100, false));
}
fn search_100k_messages_benchmark(b: &mut Bencher) {
let conn = chatlog_tools::tests::get_connection();
... | Rust | 0 |
:
self.before_weights = run_context.session.run(self.weight_tensors)
def after_run(self, run_context, unused_run_values):
"""Called after each call to run()."""
global_step = run_context.session.run(self.global_step)
if self.before_weights is not None:
after_weights ... | Python | 1 |
,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,
L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,
L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,L1,
L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L2,L... | Rust | 0 |
CKBProtocol, DefaultExitHandler, ExitHandler, NetworkService, NetworkState, SupportProtocols,
};
use ckb_network_alert::alert_relayer::AlertRelayer;
use ckb_resource::Resource;
use ckb_rpc::{RpcServer, ServiceBuilder};
use ckb_shared::shared::{Shared, SharedBuilder};
use ckb_store::{ChainDB, ChainStore};
use ckb_sy... | Rust | 0 |
#!/usr/bin/env python3
# SPDX-License-Identifier: ISC
# Copyright (c) 2025 by David Lamparter for NetDEF, Inc.
# minimal tool to receive IPv6 RAs and check for PREF64 option
# usage:
# python3 rx_ipv6_ra_8781.py eth123 64:ff9b::/64 1200 5
# LIFETIME (first number) is the value expected in the packet
# TIMEOUT (secon... | Python | 1 |
class Constants:
OPENAI_API_KEY = "YOUR_API_KEY"
INIT_MESSAGE = "ご来店ありがとうございます。本日はどのような商品をお探しでしょうか。"
SYSTEM_PROMPT = open("./prompt/system_prompt.txt", "r", encoding="utf-8").read()
RESET_MESSAGE = "会話をリセットします。ご利用ありがとうございました。"
RESET_KEYWORDS_USER = ["リセット", "会話終了", "終わって", "終わり", ]
RESET_KEYWOR... | Python | 1 |
.5, y: -1.5 }; // Shift letters up slightly to center in the circle
const SPIDER_SCALE: f32 = 150.0; // Make alpha etc larger for display purposes
const IMAGE_SET_SIZE: usize = 10;
struct ImageSet {
_images: [Asset<Image>; IMAGE_SET_SIZE],
}
fn filename(filename_prefix: &str, i: usize) -> String {
let mut fil... | Rust | 0 |
import os
import subprocess
def abrir_login(root):
root.destroy() # Fecha a janela atual
caminho_login = os.path.join("paginas", "login.py")
subprocess.run(["python", caminho_login])
def abrir_cliente(root):
root.destroy() # Fecha a janela atual
caminho_cliente = os.path.join("paginas", "cliente.py"... | Python | 1 |
msg = format!("Could not get metadata for destination file: {:?}", e);
error(&errmsg)
});
// TODO: Double-check for off-by-one
//println!("{} < {} ?", dst_metadata.len(), opt.dst_offset);
if dst_metadata.len() < opt.dst_offset {
error("destination offset > destina... | Rust | 0 |
DefaultEmitter {
state,
_schema: PhantomData,
}
}
}
impl<S: Schema + Debug> Emitter for DefaultEmitter<S> {
type Definition = S;
fn state(&self) -> &EmitterState {
&self.state
}
}
#![cfg_attr(not(feature = "std"), no_std)]
// storage cache example
// takeawa... | Rust | 0 |
onResponse(
name='test_func1',
response={
'answer': 'answer1',
},
)
)
]
),
types.UserContent(
parts=[
types.Part(text='context2_1'),
typ... | Python | 1 |
f, RW),
Reg::new("AX-12W", V1, "MovingSpeed", 32, Half, RW),
Reg::new("AX-12W", V1, "TorqueLimit", 34, Half, RW),
Reg::new("AX-12W", V1, "PresentPosition", 36, Half, R),
Reg::new("AX-12W", V1, "PresentSpeed", 38, Half, R),
Reg::new("AX-12W", V1, "PresentLoad", 40, Half, R),
Reg::new("AX-12W", V1... | Rust | 0 |
#!/usr/bin/python3
"""This module contains a function that multiplies two matrices"""
import numpy as np
def lazy_matrix_mul(m_a, m_b):
"""Return the multiplication of two matrices.
Args:
m_a (list of lists of ints/floats): The first matrix.
m_b (list of lists of ints/floats): The second mat... | Python | 1 |
ic bool failed = false;
void init_vars(struct simpleStruct *out, uint32_t x) {
out->i1 = 0;
out->f1 = 0.f;
out->i2 = 1;
out->f2 = 1.0f;
}
struct simpleStruct RS_KERNEL
root(struct simpleStruct in, uint32_t x) {
struct simpleStruct s;
s.i1 = in.i1 + x;
s.f1 = in.f1 + x;
s.i2 = i... | Rust | 0 |
{
Self {
name: name.into(),
init,
is_rest_param,
}
}
/// Gets the name of the formal parameter.
pub fn name(&self) -> &str {
&self.name
}
/// Gets the initialization node of the formal parameter, if any.
pub fn init(&self) -> Option... | Rust | 0 |
setup_stream_test();
let mut cmd_fut = Box::pin(peer.send_avc_passthrough_command(&[69, 0]));
let poll_ret: Poll<Result<CommandResponse>> = exec.run_until_stalled(&mut cmd_fut);
assert!(poll_ret.is_pending());
expect_remote_recv(
&[
0x00, // TxLabel 0, Single 0, Command 0, Ipid 0,
... | Rust | 0 |
# Copyright (c) 2024, Hitesh Prajapati and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
from frappe.model.docstatus import DocStatus
class LibraryTransaction(Document):
def before_submit(self):
if self.type == "Issue":
self.validat... | Python | 1 |
nt_vul = {}
for i in list_count_department_vul:
data_department_vul[i[1]] = int(i[0])
data_department_vul = sorted(data_department_vul.iteritems(), key=lambda d:d[1], reverse = True)
#-------------------剩余风险变化趋势---------------------
#-----------------部门有剩余风险的漏洞数量------------------
qu... | Python | 1 |
set(phys_addr as usize, flags);
}
/// Set the pointer to the next level page-table
pub fn set_next_level(&mut self, next: &PageTable) {
self.set(ptr::addr_of!(*next) as usize, FLAG_VALID);
}
/// Returns true if the entry is valid
pub fn is_valid(&self) -> bool {
self.entry & FL... | Rust | 0 |
-> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x1cgoogle/spanner/v1/keys.proto\x12\x11google.spanner.v1\x1a\x1cgoogl\
e/protobuf/struct.proto\x1a\x1cgoogle/api/annotations.proto\"\xa0\x02\n\... | Rust | 0 |
// Since it is a primary type, it can also be cheaply copied
/// let double = args[1].clone().cast::<bool>();
/// // Get a mutable reference to the first argument.
/// let x = args[0].downcast_mut::<i64>().unwrap();
///
/// ... | Rust | 0 |
from django.urls import include, path
from allauth.headless.socialaccount import views
def build_urlpatterns(client):
return [
path(
"account/",
include(
[
path(
"providers",
views.ManageProvidersV... | Python | 1 |
est/cd_std', cd_std, on_step=True)
self.log('test/precision', pr, on_step=True)
self.log('test/recall', re, on_step=True)
self.log('test/fscore', f1, on_step=True)
torch.cuda.empty_cache()
return {'test/cd_mean': cd_mean, 'test/cd_std': cd_std, 'test/precision': pr, 'test/recall... | Python | 1 |
nic!("{}",String::from_iter(&msg));
},
},
_ => panic!("illegal assert arity"),
};
//dbg_rtn("assert_fn",arity,&r);
r
}
// +
pub fn plus(arity:usize, x: Vn,w: Vn) -> Vs {
#[cfg(feature = "coz")]
coz::scope!("plus");
//dbg_args("plus",arity,&x,&w);
let r =
match... | Rust | 0 |
"""Test utils"""
import unittest
from kedro_kubeflow.generators.utils import (
is_local_fs,
merge_namespaced_params_to_dict,
)
def gcsfs_is_missing():
try:
import gcsfs # NOQA
return False
except ImportError:
return True
@unittest.skipIf(gcsfs_is_missing(), "Package gcsfs... | Python | 1 |
Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0.
//! Delta join execution planning.
//!
//! Delta joins are a join over multiple in... | Rust | 0 |
g,
limit=4,
search_params=models.SearchParams(
quantization=models.QuantizationSearchParams(
ignore=True,
rescore=Tr... | Python | 1 |
let loop_size = 1;
let cc: u8 = c;
let end_ptr_1 = unsafe { end_ptr.sub(loop_size) };
if buf_ptr <= end_ptr_1 {
_unroll_one_chr_1!(buf_ptr, cc, start_ptr, loop_size, 0);
}
}
//
None
}
#[inline(always)]
fn _c16_value(c: u8) -> u128 {
(c as u128) * 0x0... | Rust | 0 |
from __init__ import*
class MuiskMedia(commands.Cog):
def __init__(self, client: commands.Bot):
self.client = client
@commands.command(aliases=["p"])
@commands.cooldown(1,100, type = commands.BucketType.user )
@commands.has_permissions()
@commands.bot_has_permissions()
async def play(s... | Python | 1 |
'''
An example that uses the buttons to control the colour and brightness of the attached LED strip.
Button A - Change the hue
BOOT/User button - Cycle through brightness. 10 levels of brightness available.
'''
import time
import machine
import plasma
from plasma import plasma2040
# Set how many LEDs you have
NUM_L... | Python | 1 |
ion::from_millis(100), false) {
let mut cols = vec![];
let mut vals = vec![];
cols.push("pid".to_string());
vals.push(Value::Int {
val: proc.pid() as i64,
span,
});
cols.push("name".to_string());
vals.push(Value::String {
val:... | Rust | 0 |
// found above.
let mut stack = root_nodes.clone();
while let Some(node) = stack.pop() {
if let Some(&body) = editor_scene.physics.binder.value_of(&node) {
for &collider in editor_scene.physics.bodies[body].colliders.iter() {
command_group.push(SceneCommand::DeleteCollider(De... | Rust | 0 |
let path = PathExists(PathBuf::from(path_resolved));
assert_de_tokens(&path, &[Token::Str(path_with_env)]);
}
}
use proptest::prelude::*;
use text_unit::{TextUnit, TextRange};
use crate::{AtomTextEdit, TextEdit};
pub fn arb_text() -> proptest::string::RegexGeneratorStrategy<String> {
// generate multip... | Rust | 0 |
class Solution:
def expandAroundCenter(self, s, left, right):
while left >= 0 and right < len(s) and s[left] == s[right]:
left -= 1
right += 1
return left + 1, right - 1
def longestPalindrome_v1(self, s: str) -> str:
start, end = 0, 0
for i in range(len(s... | Python | 1 |
) => {
(stringify!($a0), stringify!($a1), stringify!($a2), stringify!($a3),
stringify!($a4), stringify!($a5), stringify!($a6), stringify!($a7))
};
(@_WRAPSTR ($a0:pat, $a1:pat, $a2:pat, $a3:pat, $a4:pat,
$a5:pat, $a6:pat, $a7:pat, $a8:pat)) => {
(stringify!($a0), stringi... | Rust | 0 |
om<Alpha<Xyz<Wp, T>, A>> for (T, T, T, A) {
fn from(color: Alpha<Xyz<Wp, T>, A>) -> (T, T, T, A) {
color.into_components()
}
}
impl<Wp, T> IsWithinBounds for Xyz<Wp, T>
where
T: Zero + PartialOrd,
Wp: WhitePoint<T>,
{
#[rustfmt::skip]
#[inline]
fn is_within_bounds(&self) -> bool {
... | Rust | 0 |
rt_eq!(var.load(Ordering::SeqCst), 1);
// Scope of second set of contracts
{
let mut rqst_con = rqst.try_request().ok().unwrap();
let resp_con = resp.try_respond().ok().unwrap();
resp_con.send(Box::new(move || {
var3.fetch_add(1, Ordering::SeqCst);
}) as Task);
... | Rust | 0 |
cfg(not(windows))]
#[inline]
fn symlink_dir<P: AsRef<Path>, Q: AsRef<Path>>(&self, src: P, dst: Q) -> io::Result<()> {
self.symlink(src, dst)
}
#[cfg(windows)]
#[inline]
fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(&self, src: P, dst: Q) -> io::Result<()> {
if self.metadata(src.as... | Rust | 0 |
make_tuple_impl!(TupleExt11, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11);
make_tuple_impl!(TupleExt12, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12);
}
use std::{
collections::HashMap,
sync::Arc,
};
use dgraph_query_lib::{
condition::{
Condition,
ConditionValue,
},
muta... | Rust | 0 |
from fontTools.otlLib.builder import (
AlternateSubstBuilder,
ChainContextPosBuilder,
ChainContextSubstBuilder,
LigatureSubstBuilder,
MultipleSubstBuilder,
CursivePosBuilder,
MarkBasePosBuilder,
MarkLigPosBuilder,
MarkMarkPosBuilder,
ReverseChainSingleSubstBuilder,
SingleSubs... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.