text string | label_name string | labels int64 |
|---|---|---|
mailimf_fields structure with no fields
*/
pub unsafe fn mailimf_fields_new_empty() -> *mut mailimf_fields {
let mut list: *mut clist = 0 as *mut clist;
let mut fields_list: *mut mailimf_fields = 0 as *mut mailimf_fields;
list = clist_new();
if list.is_null() {
return 0 as *mut mailimf_fields;
... | Rust | 0 |
from abc import ABC
from llama_index import GPTVectorStoreIndex, SimpleDirectoryReader, get_response_synthesizer
from llama_index.retrievers import VectorIndexRetriever
from llama_index.query_engine import RetrieverQueryEngine
from llama_index.postprocessor import SimilarityPostprocessor
from llama_index.node_parser i... | Python | 1 |
{
variant as u8 != 0
}
}
#[doc = "Reader of field `OD_UNDERRUN_PROTECT`"]
pub type OD_UNDERRUN_PROTECT_R = crate::R<bool, OD_UNDERRUN_PROTECT_A>;
impl OD_UNDERRUN_PROTECT_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> OD_UNDERRUN_PROTECT_A {
mat... | Rust | 0 |
gh_stars>0
use std::collections::HashMap;
use std::convert::TryFrom;
use std::time::{SystemTime, UNIX_EPOCH};
use serde::Deserialize;
use serde_json::{json, Value};
use crate::analysis::{Analysis, ComponentTable, CellValue, MgMvalMmol};
use crate::models::{Models};
// use crate::utils::mongodb::{document_str, documen... | Rust | 0 |
"""Demonstrate mesh generating objects in DOLFIN."""
from dolfin import *
mesh = UnitInterval(20)
mesh = Interval(20, -1, 1) # domain [-1,1]
print mesh
mesh = UnitSquare(6, 10) # 'right' diagonal is default
viz = plot(mesh, title='UnitSquare(6, 10)')
#print 'Add labels:'
#viz.add_point_labels()
#viz.update(mesh)
#... | Python | 1 |
from typing import Dict, Any
from fastapi import APIRouter, Depends, Request
from fastapi.responses import StreamingResponse, JSONResponse
from core.model_handler import ModelRouter
from core.model_type import ModelType
router = APIRouter()
def create_error_response(message: str, code: str, status_code: int = 400):... | Python | 1 |
ts = client_cls.ls_buckets(**catalog.client_config)
if long:
values = (long_line_str(b.name, b.created) for b in buckets)
else:
values = (b.name for b in buckets)
yield source, values
else:
found = False
fields = ["name"... | Python | 1 |
from django.shortcuts import render
from rest_framework.decorators import api_view
# Create your views here.
@api_view(['GET','POST','PUT','PATCH',''])
def StudentAPI(request,id=None):
| Python | 1 |
pub fn demo() {
structures();
enums();
option(2.0f64);
option(0.0f64);
arrays();
vectors();
slices();
strings();
}<reponame>FauxFaux/deb-version
use std::cmp::Ordering;
fn epoch(version: &str) -> (&str, &str) {
if let Some(colon) = version.find(':') {
(&version[..colon], &ve... | Rust | 0 |
info>", rank = 1)]
pub async fn update_book(
book_id: BookGuard,
_auth: Auth<BookWritable>,
mut info: Form<IncompleteProductOwned>,
conn: DbConn,
) -> Result<Redirect, Flash<Redirect>> {
let book = book_id.to_id(&conn).await.into_flash(uri!("/"))?;
info.description = sanitize_html(&info.descript... | Rust | 0 |
`
///
/// `AVX512VL and AVX512F`
///
/// `16/32/64-bit`
EVEX_Vpcmpeqq_k_k1_ymm_ymmm256b64,
/// `VPCMPEQQ k1 {k2}, zmm2, zmm3/m512/m64bcst`
///
/// `EVEX.512.66.0F38.W1 29 /r`
///
/// `AVX512F`
///
/// `16/32/64-bit`
EVEX_Vpcmpeqq_k_k1_zmm_zmmm512b64,
/// `VPMOVB2M k1, xmm1`
///
/// `EVEX.128.F3.0F38.W0 ... | Rust | 0 |
messages;
/// Delinearized batched and aggregated BLS signatures.
///
/// We caution that this type only represents one of several
/// optimizations possible. We believe it fits well when messages
/// are often repeated but signers are rarely repeated.
///
/// We should create another type for when repeated signers a... | Rust | 0 |
def to_identity_map(a):
return ord(a) - 0x41
def from_identity_map(a):
return chr(a % 26 + 0x41)
def encrypt(m):
c = ''
for i in range(len(m)):
ch = m[i]
if not ch.isalpha():
ech = ch
else:
chi = to_identity_map(ch)
ech = from_identity_map(ch... | Python | 1 |
from piccolo.columns.operators.base import Operator
class ComparisonOperator(Operator):
template = ""
class IsNull(ComparisonOperator):
template = "{name} IS NULL"
class IsNotNull(ComparisonOperator):
template = "{name} IS NOT NULL"
class Equal(ComparisonOperator):
template = "{name} = {value}"
... | Python | 1 |
2_Graphics_Direct2D_Common")]
pub struct D2D1_IMAGE_BRUSH_PROPERTIES {
pub sourceRectangle: Common::D2D_RECT_F,
pub extendModeX: D2D1_EXTEND_MODE,
pub extendModeY: D2D1_EXTEND_MODE,
pub interpolationMode: D2D1_INTERPOLATION_MODE,
}
#[cfg(feature = "Win32_Graphics_Direct2D_Common")]
impl ::core::marker::... | Rust | 0 |
let data = vec![tag_length as u32];
self.set_desktop_prop(&data, self.atoms.NetNumberOfDesktops);
// Set a current desktop.
let data = vec![0_u32, xlib::CurrentTime as u32];
self.set_desktop_prop(&data, self.atoms.NetCurrentDesktop);
// Set desktop names.
let mut... | Rust | 0 |
'ঃ', '𖭔', 'ꔇ', '𓁉', '\u{1163f}', 'ꈢ', '𑄓', '\u{8fb}', 'Ⴕ',
'𘧀', '᭩', '𒐭', '𝍨', '\u{f94}', 'ꈷ', 'ﱵ', '𐖏', '𐹪', '🚁', '𓇚',
'𖥚', 'ո', '𐠗', '𞢴', '\u{1daac}', '\u{a8e7}', '𑵷', '𑖙', '\u{1aba}', '𛋘',
'𘢛', '🄘', '𛇬', 'ᚠ', 'Ị', '\u{1dcd}', '🌨', 'ᅔ', '\u{65f}', '𞹢',
'𒊼', '⊑', '𝡣', '🮪', 'ኛ', ... | Rust | 0 |
spective(img):
TOPLEFT = (175, 230)
TOPRIGHT = (380, 225)
BOTTOMLEFT = (10, 410)
BOTTOMRIGHT = (530, 400)
WARP_W = 320
WARP_H = 240
points1 = np.float32([TOPLEFT, TOPRIGHT, BOTTOMLEFT, BOTTOMRIGHT])
points2 = np.float32([[0, 0], [WARP_W, 0], [0, WARP_H], [WARP_W, WARP_H]])
matrix... | Python | 1 |
#!/usr/bin/env python3
"""修正样本数据到Schema v1.1规范"""
import json
import os
import re
from pathlib import Path
def fix_sample_schema():
"""修正样本数据到v1.1规范"""
print("🔧 开始修正样本数据到Schema v1.1...")
data_dir = Path("data/gen/2025-09-03")
# 处理ALC样本
alc_file = data_dir / "ALC" / "part-001.jsonl"
if alc_f... | Python | 1 |
rx) = channel::<()>();
let server = server
.with_graceful_shutdown(rx)
.map_err(|e| log::error!("server error {}", e));
(server, tx)
}
// todo: plenty of duplicated code with make_plain_server, but heavy use of generics make it very hard to
// create meaningful return types
fn make_tls_... | Rust | 0 |
xy.edu.cn/datawarn/ReportServer?formlet=app/sjkrb.frm&op=h5&userno=' + str(
stuID) + '#/form'
driver.get(url) # 打开浏览器
time.sleep(1)
driver.maximize_window() # 全屏
time.sleep(5)
# 输入省
driver.find_element_by_xpath('//div[@id="SHENG"]').click()
time.sl... | Python | 1 |
r QueryExecutor<S> {
fn clone(&self) -> QueryExecutor<S> {
QueryExecutor {
store: self.store.clone(),
cfg: self.cfg.clone(),
ingester_transport: self.ingester_transport.clone(),
partition_handler: self.partition_handler.clone(),
}
}
}
<reponame>nch... | Rust | 0 |
more buffer).
let mut buf_writer = BufWriter::with_capacity(32 * 1024, file_out); // need this because io::copy only uses 8K buffers
io::copy(&mut lz4_reader, &mut buf_writer)?;
*/
Ok(())
}
use anyhow::Context;
use async_trait::async_trait;
use tgbotapi::{ChatMemberUpdated, ChatType};
use super::{
... | Rust | 0 |
import pandas as pd
import plotly.graph_objects as go
import shinywidgets as sw
from shiny.express import ui
ui.page_opts(full_width=True)
# Create a custom icon for the showcase using Font Awesome
chart_icon = ui.tags.i(class_="fa-solid fa-chart-simple", style="font-size: 8rem;")
chart_thumbs_up_icon = ui.tags.i(
... | Python | 1 |
let out = unsafe {
universal
.query_("query")
.with_arg_raw(arg)
.build::<()>()
.call_raw()
.await?
};
assert_eq!(out, b"hello");
Ok(())
})
}
#[ignore]
#[test]
fn canister_reject_call() {
... | Rust | 0 |
# Define the Car class
class Car:
# The constructor method to initialize the object
def __init__(self, make, model, year):
self.make = make
self.model = model
self.year = year
# Method to return a description of the car
def describe(self):
return f"This car is a {self.ye... | Python | 1 |
alue.
#[inline]
pub fn assert_conversion_correct<T: HeaderConvertible + fmt::Show>(string: &'static str, value: T) {
assert_eq!(from_stream_with_str(string), Some(value.clone()));
let s = to_stream_into_str(&value);
assert_eq!(s.as_slice(), string);
let s = value.http_value();
assert_eq!(s.as_slice(... | Rust | 0 |
ng"),
('鼇', "áo"),
('鼈', "biē"),
('鼉', "tuó"),
('鼊', "bì"),
('鼋', "yuán"),
('鼌', "cháo"),
('鼍', "tuó"),
('鼎', "dǐng,zhēn"),
('鼏', "mì"),
('鼐', "nài"),
('鼑', "dǐng"),
('鼒', "zī"),
('鼓', "gǔ"),
('鼔', "gǔ"),
('鼕', "dōng,tóng"),
('鼖', "fén"),
('鼗', "táo"),... | Rust | 0 |
= "Checks if the value of the field is `INPUT`"]
#[inline(always)]
pub fn is_input(&self) -> bool { *self == MODE6_A::INPUT }
#[doc = "Checks if the value of the field is `INPUTPULL`"]
#[inline(always)]
pub fn is_inputpull(&self) -> bool { *self == MODE6_A::INPUTPULL }
#[doc = "Checks if the val... | Rust | 0 |
heorem t=0 to to=k-1(dont waked up)
let mut didnt = (0..k)
.into_iter()
.fold(0,|s,i| s + bs[i as usize] * ts[i as usize] );
// the total number of theorem t=0 to to=n-1(dont waked up)
let didnt_total = (0..n)
.into_iter()
.fold(0,|s,i| s + bs[i as usize] * ts[i as usize] );
... | Rust | 0 |
from selenium.webdriver import Keys
from src.ui.components.add_club_popup.add_club_step_three import AddClubStepThree
from src.ui.components.add_club_popup.add_clup_popup_component import AddClubSider
from src.ui.components.add_location_popup.add_location_popup_component import AddLocationPopUp
from src.ui.pages.profi... | Python | 1 |
#coding=utf-8
import face_comm
from annoy import AnnoyIndex
import lmdb
import os
class face_annoy:
def __init__(self):
self.f = int(face_comm.get_conf('annoy','face_vector'))
self.annoy_index_path = os.path.abspath(face_comm.get_conf('annoy','index_path'))
self.lmdb_... | Python | 1 |
3\x1a\x94\xb9\x0dx\xbe\xc3\xc0\x99\x8b\xfc\xfb\x0a\
J\x1dz\x82t\x0d\xb6\xc3Vn%+\xdf\xa13\xb5\
\xbaX\x0bc]:+{?_\x8f\x98\x97_\xd5g\
\x9e#\xb7\xbc\x8b4t\xe1U\xfa\xf9x\x05\x95\x13Q\
\xf1UR\x9e\xe7b\x09\xd1\x05\x09\xfe\xf9\xe2e\xa2\xf3\
\xc5\x06\x9c\xe3w\xe4\xf0\x17\x90\xcf\x97\x5c#\xba\xf1;\
l\xc2\xda\x12j\xde\xe5 Y6\xdbA\... | Python | 1 |
Color};
pub type ColorReader<T> = fn(&T) -> &Color;
pub enum LineParam {
Fixed { start: Point, end: Point },
Vertical { x: f32 },
Horizontal { y: f32 },
}
pub struct Line<'a, T: Layout + 'a> {
param: LineParam,
element: &'a T,
stroke_width: f32,
color_reader: ColorReader<T>,
boundin... | Rust | 0 |
loc = mac_temp_flag.get('loc')
offset = mac_temp_flag.get('offset')
ind, val = wbi2cget(bus, loc, offset)
if ind is not True:
raise Exception("get mac_flag by i2c failed.")
val_t = (int(val, 16) & (1 << okbit)) >> okbit
if val_t... | Python | 1 |
tem", "Division", "invalid"],
)
self.assertEqual(
self.response.context_data.get("form").fields["level"].cleaned,
None,
)
# with some invalid input filter show valid with count 0
self.assertEqual(
self.response.context_data.get("form").fields["... | Python | 1 |
for article in articles:
# print(article)
selector = Selector(article)
href = selector.xpath('//div/div[2]/div/div[1]/a/@href').get()
if href:
hrefs.append(href)
logging.info("article: {},len: {}".format... | Python | 1 |
Stopping,
#[serde(rename = "stopped")]
Stopped,
#[serde(rename = "restarting")]
Restarting,
#[serde(rename = "unknown")]
Unknown,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum ProvisioningState {
Accepted,
Creating,
... | Rust | 0 |
friends = []
friend_status = [] # 1 = waiting, 0 = complete
x = int(input())
for _ in range(x):
message = input().split()
message[1] = int(message[1])
# wait specified time
if message[0] == "W":
for i in range(len(friends)):
if friend_status[i] == 1:
friends[i][1] +=... | Python | 1 |
as usize] - p2.c[i as usize]);
}
dist.sqrt()
}
pub fn calc_score(
solution: &Vec<usize>,
data: &Vec<Point>,
rest: &Vec<Vec<i8>>,
k: u32,
l: f32,
) -> f32 {
// calc infeasibility of the solution
let m = data[0].dim();
let mut nc = vec![0.0; k as usize];
let mut inner_dista... | Rust | 0 |
alResult {
let mut z = seed;
for i in 0..limit {
z = z * z + c;
if z.norm_sqr() > 4.0 {
return FractalResult {
escape: limit - i,
value: z,
};
}
}
FractalResult {
escape: 0,
value: z,
}
}
/// Try to det... | Rust | 0 |
httpx.AsyncClient(timeout=30.0) as client:
try:
response = await client.get(f"{HEROKU_BACKEND_URL}/rxlist/stats")
if response.status_code == 200:
stats = response.json()
total_drugs = stats.get("rxlist_stats", {}).get("total_drugs", 0)
log... | Python | 1 |
# """
# This is the interface that allows for creating nested lists.
# You should not implement it, or speculate about its implementation
# """
#class NestedInteger:
# def isInteger(self) -> bool:
# """
# @return True if this NestedInteger holds a single integer, rather than a nested list.
# """... | Python | 1 |
0,
),
]
}
pub fn new<'a>(
textures: &Textures<'a>,
x: i64,
y: i64,
id: Id,
stats: Option<PlayerStats>,
_env: Option<&mut Env>,
) -> Self {
let mut actions_moving = Vec::with_capacity(4);
actions_moving.push((
... | Rust | 0 |
true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value... | Rust | 0 |
th: str) -> None:
"""
Load a safety provider from a module path.
The module may expose either `get_safety()` -> SafetyProvider or `safety` object.
"""
import importlib
module = importlib.import_module(dotted_path)
provider: Union[SafetyProvider, None] = None
if hasattr(module, "get_safe... | Python | 1 |
e.1.fetch_add(1, Relaxed);
})
.or_insert_with(|| {
Arc::new((
AtomicUsize::new(0),
AtomicUsize::new(1),
AtomicSerialWaker::new(),
))
})
.clone();
TASK.wake(... | Rust | 0 |
_read_volumes(2)
/// .set_status(Status::WatchingOrReading)
/// .set_score(7);
///
/// assert_eq!(values.chapter(), 50);
/// assert_eq!(values.volume(), 2);
/// assert_eq!(values.status(), Status::WatchingOrReading);
/// assert_eq!(values.score(), 7);
/// ```
#[derive(Debug, Default, Clone)]
pub struct Mang... | Rust | 0 |
fn test_get_most_common() {
const VAL: [u16; 2] = [0b10110, 0b10111];
let (common, uncommon) = get_most_common(&VAL, 5);
assert_eq!(common, 0b10111);
assert_eq!(uncommon, 0b01000);
}
#[test]
fn test_day3_part1() {
let data = input_generator_day3(DATA);
le... | Rust | 0 |
Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum ImageType {
Scanline,
Tiled,
DeepScanline,
DeepTiled,
}
#[cfg(test)]
#[test]
fn header_rtrip1() -> Result<()> {
use crate::tests::load_ferris;
use crate::{
core::{
attribute::{
CompressionAttribute, CppS... | Rust | 0 |
mock_vacuum:
session.cache.delete('key_1')
mock_vacuum.assert_not_called()
def test_delete__skip_vacuum(self):
"""Vacuum should not be used after delete if disabled"""
session = self.init_session()
session.cache.responses['key_1'] = 'value_1'
session.cache.r... | Python | 1 |
_name,
name=game.away_team.name,
),
home_team=TeamModel(
id=game.home_team.id,
short_name=game.home_team.short_name,
name=game.home_team.name,
),
start_time=game.start_time,
end_time=game.end_time... | Python | 1 |
Copy> {
pub vertices: VertexBuffer<V>,
pub indices: IndexBuffer<u32>,
// mesh bounds, in model space
pub aabb: Aabb,
}
#[derive(Debug)]
pub struct MeshHandle<M>(Arc<MeshHandleInner<M>>);
// unsafe impl<M> Send for MeshHandle<M> {}
// unsafe impl<M> Sync for MeshHandle<M> {}
impl<M> Clone for MeshHan... | Rust | 0 |
ow - 10 * radius_mask_row
if radius_mask_col is not None:
err_col = err_col - 10 * radius_mask_col
err_row = tf.reduce_sum(tf.maximum(err_row, 0), axis=-1)
err_col = tf.reduce_sum(tf.maximum(err_col, 0), axis=-2)
loss = 0
accuracy = 0
tot_loss = (loss_row + loss_col) / 2
if corr_we... | Python | 1 |
self.tabWidgetWest_2.setTabText(self.tabWidgetWest_2.indexOf(self.tab_12), QtWidgets.QApplication.translate("DockWidget", "Tab 2", None, -1))
self.label_38.setText(QtWidgets.QApplication.translate("DockWidget", "Inside TabWidget East Tab 1", None, -1))
self.tabWidgetEast.setTabText(self.tabWidge... | Python | 1 |
fmt::Display + Send + Sync + 'static;
}
impl<T, E> VdrResultExt<T, E> for Result<T, E>
where
E: std::error::Error + Send + Sync + 'static,
{
fn map_err_string(self) -> Result<T, String> {
self.map_err(|err| err.to_string())
}
fn map_input_err<F, M>(self, mapfn: F) -> VdrResult<T>
where
... | Rust | 0 |
ons:
/// 0 ≤ eval arg1 < m
/// 0 ≤ eval arg2 < m
/// Postconditions:
/// eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m
/// 0 ≤ eval out1 < m
///
/// Input Bounds:
/// arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffff... | Rust | 0 |
from collections import deque
def bfs(graph, start, end):
queue = deque([(start, [start])])
while queue:
(node, path) = queue.popleft()
for next_node in graph[node] - set(path):
if next_node == end:
yield path + [next_node]
else:
queue.ap... | Python | 1 |
prec, rec = self.testClassMetric.compute()
TP = self.testClassMetric.TP
FP = self.testClassMetric.FP
TN = self.testClassMetric.TN
FN = self.testClassMetric.FN
self.log("test/TP_epoch", TP, prog_bar=True)
self.log("test/FP_epoch", FP, prog_bar=True)
self.log("test/... | Python | 1 |
display_for_value(value, empty_value_display)
else:
return display_for_value(value, empty_value_display)
def prettify_json(data: Any, encoder: Any) -> str | None:
try:
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import Json... | Python | 1 |
import matplotlib.pyplot as plt # type: ignore
import numpy as np
from sklearn.metrics import confusion_matrix # type: ignore
def plot_accuracy(history):
plt.figure(figsize=(6,5))
plt.plot(history.history['accuracy'], label='Train Accuracy')
plt.plot(history.history['val_accuracy'], label='Validation A... | Python | 1 |
_of::<T>()) };
self.copy_u8_vector(p, address)
}
}
#[cfg(test)]
mod tests {
use crate::Memory;
#[test]
fn it_should_copy_a_u8_aray() {
let data = &[1u8, 1, 1, 1, 1, 1, 1, 1];
let memory = Memory::new(3);
memory.copy_u8_vector(data, 1);
assert_eq!(memory.0.borrow... | Rust | 0 |
k(interface)
}
}
fn parse_comment(input: &str) -> IResult<&str, ()> {
map(
preceded(multispace0, preceded(char(';'), many0(is_not("\n")))),
|_| (),
)(input)
}
/// Consumes spaces and comments
/// comments must terminate with a new line character
fn space_comments<'a>(mut input: &'a str) ->... | Rust | 0 |
{
use crate::actor::Id;
use std::collections::{BTreeMap, BTreeSet, VecDeque};
use super::*;
#[test]
fn from_sort_sorts() {
let original = vec!['B', 'D', 'C', 'A'];
let plan = RewritePlan::<Id,_>::from_values_to_sort(&original);
assert_eq!(
plan.reindex(&original... | Rust | 0 |
#[doc = "Bits 11:21 - initialized PC for ULP-coprocessor"]
#[inline(always)]
pub fn pc_init(&self) -> PC_INIT_R {
PC_INIT_R::new(((self.bits >> 11) & 0x07ff) as u16)
}
#[doc = "Bit 22 - stop SAR ADC2 conversion"]
#[inline(always)]
pub fn sar2_stop(&self) -> SAR2_STOP_R {
SAR2_STO... | Rust | 0 |
));
comp.finish_compress();
comp.data_to_vec().unwrap()
})
.expect("MozJPEG Fail");
let mut f = File::create(&into).expect("Failed to create output file");
f.write_all(&jpeg_bytes).expect("Failed to write file");
f.flush().expect("Failed to flush file");
}
#[tokio::main]
async fn m... | Rust | 0 |
eesWalker<R, Hist, Energy, S, Res>]) -> Vec<f64>
where Hist: Histogram
{
let log_len = walker[0].log_density.len();
debug_assert!(
walker.iter()
.all(|w| w.log_density.len() == log_len)
);
let mut averaged_log_density = walker[0].log_density_refined();
if walker.len() > 1 {
... | Rust | 0 |
().writes((3 as Weight).saturating_mul(v as Weight)))
}
fn get_npos_voters(v: u32, n: u32, s: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 104_000
.saturating_add((23_551_000 as Weight).saturating_mul(v as Weight))
// Standard Error: 104_000
.saturating_add((28_118_000 as Weight).saturating_mul(n... | Rust | 0 |
"""
This module exists solely to figure how long a registrant/publication
number may be within an ISBN. The rules change based on the prefix and
language/region. This list of rules only encapsulates the 978 prefix
for English books. 978 is the largest and, until recently, the only
prefix.
The complete list of prefixes... | Python | 1 |
np.std(
amplitudes[
max(0, i - window_size) : min(len(amplitudes), i + window_size)
]
)
for i in range(len(amplitudes))
]
)
# Calculate adaptive thresholds
lower_bound = rolling_medi... | Python | 1 |
nes
line_to_be_removed = Line(
"Footnote", (100, 950, 200, 960), 9.0, "test", []
)
line_not_to_be_removed = Line(
"Test", (0, 100, 10, 110), 10.0, "test", []
)
# compose a page
page = Page(
None, [line_to_be_removed, line_not_to_be_removed], None,
{
... | Python | 1 |
let q_mul_fixed_running_sum =
meta.query_selector(self.running_sum_config.q_range_check());
let z_cur = meta.query_advice(self.window, Rotation::cur());
let z_next = meta.query_advice(self.window, Rotation::next());
// z_{i+1} = (z_i - a_i) / 2^3
... | Rust | 0 |
# Final Audit Sweep — Spiral Civilization
import yaml
import os
import time
MUSEUM_DIR = "/data/data/com.termux/files/home/Spiral-Civilization/Museum"
INDEX_PATH = "/data/data/com.termux/files/home/Spiral-Civilization/meta_reflection_index.yaml"
CANONICAL_PATH = "/data/data/com.termux/files/home/Spiral-Civilization/c... | Python | 1 |
.get_unchecked(i));
}
})
});
criterion::black_box(outputs);
}
};
}
#[macro_export]
macro_rules! bench_select {
($name:ident, $desc:expr, ty => $ty: ident, op => $op: ident, from => $from:expr) => {
pub(crate) fn $name(c: &mut Criterion... | Rust | 0 |
_ => "||",
},
b.to_code(language)
)
}
}
<filename>plonk-with-verifier-contract/plonk-origin/src/ahp/mod.rs
use ark_ff::{FftField as Field};
// use ark_poly_commit::LinearCombination;
use ark_std::{marker::PhantomData};
use crate::composer::Error as CSError;
// use crate::utils::generator;
// mod evaluation... | Rust | 0 |
from kornia.filters import canny
import comfy.model_management
class Canny:
@classmethod
def INPUT_TYPES(s):
return {"required": {"image": ("IMAGE",),
"low_threshold": ("FLOAT", {"default": 0.4, "min": 0.01, "max": 0.99, "step": 0.01}),
"... | Python | 1 |
"""Brute Force"""
# class Solution:
# def containsNearbyDuplicate(self, nums: List[int], k: int) -> bool:
# for i in range(len(nums)):
# for j in range(i+1, len(nums)):
# if nums[i] == nums[j] and abs(i-j) <= k:
# return True
# return False
class ... | Python | 1 |
)| { new_map.insert(k, v); });
*self = new_map; // 6
}
}
fn iter() -> std::slice::Iter<(&k, &v)> {
self.buckets.iter_mut()
.flat_map(|b| b)
.map(|(k, v)| (k, v))
}
pub fn iter(&self) -> impl Iterator<Item = (&K, &V)> {
self.buckets.iter()
... | Rust | 0 |
/// into an [`aws_smithy_types::DateTime`].
DateTimeParse(crate::Error),
/// Used when failing to deserialize strings from a URL query string and from URI path labels
/// into "primitive" types.
PrimitiveParse(crate::Error),
// The following three variants are used when failing to deserialize str... | Rust | 0 |
o a request.
//!
//! # See Also
//! * [Nanomsg](http://nanomsg.org/index.html)
//! * [nanomsg(7)](http://nanomsg.org/v1.1.2/nanomsg.html)
//! * [nanomsg-sys](https://docs.rs/nanomsg-sys/0.6.2/nanomsg_sys/)
extern crate nanomsg_sys;
extern crate libc;
#[macro_use]
extern crate bitflags;
extern crate failure;
pub mod a... | Rust | 0 |
std::mem::size_of::<cl_mem>(),
mem_ptr,
);
assert_eq!(err, 0);
}
}
#[test]
fn kernel_set_arg_works_for_buffer_u8() {
unsafe {
let src: &str = "
__kernel void test123(__global uchar *i) {
*i += 1;
}";... | Rust | 0 |
ef __LP64__
rsgBindProgramFragment(*(rs_program_fragment*)buf2105);
#endif
#ifndef __LP64__
rsgBindProgramRaster(*(rs_program_raster*)buf2106);
#endif
#ifndef __LP64__
rsgBindProgramStore(*(rs_program_store*)buf2107);
#endif
#ifndef __LP64__
rsgBindProgramVertex(*(rs_program_vertex*)buf2108);
#endif
#if... | Rust | 0 |
casav = int(input('Me fale o valor da casa: '))
sal = int(input('OK, agora me diga seu salario: '))
ano = int(input('E em quantos anos você pretende pagar: '))
prest = casav / (ano * 12)
saltrinta = (30 * sal) / 100
print('A sua parcela ira ficar R${:.2f} por mês'.format(prest))
if prest > saltrinta:
print('Já que ... | Python | 1 |
- 'fr-fr': French (France)
- 'ga': Irish
- 'grc': Greek
- 'hi': Hindi
- 'hr': Croatian
- 'hu': Hungarian
- 'hy': Armenian
- 'hy-west': Armenian (Western)
- 'id': Indonesian
... | Python | 1 |
ction>>, S: Into<Option<&'c Cancellable>>>(&self, chain: &TlsCertificate, purpose: &str, identity: Q, interaction: R, flags: TlsDatabaseVerifyFlags, cancellable: S) -> Result<TlsCertificateFlags, Error>;
fn verify_chain_async<'a, 'b, 'c, P: IsA<SocketConnectable> + 'a, Q: Into<Option<&'a P>>, R: Into<Option<&'b Tl... | Rust | 0 |
d be pure 0.
let mut n0 = [0; 2];
let mut n1 = [0; 2];
let mut n2 = [0; 2];
for (key, count) in hist
{
n0[key as usize & 1] += count;
n1[(key as usize >> 1) & 1] += count;
n2[(key as usize >> 2) & 1] += count;
}
assert!(n0.iter(... | Rust | 0 |
// convert a..b;c into @step(a..b, c)
(@parse [$($stack:tt)*] $r:expr;$s:expr, $($t:tt)*) => {
s![@parse [$($stack)* s!(@step $r, $s),] $($t)*]
};
// convert a..b into @step(a..b, 1)
(@parse [$($stack:tt)*] $r:expr, $($t:tt)*) => {
s![@parse [$($stack)* s!(@step $r, 1),] $($t)*]
... | Rust | 0 |
test]
fn originates_inside_sphere() {
let sphere = Shape::Sphere(Sphere::new_default());
let ray = Ray::new(
Vector4::point(0.0, 0.0, 0.0),
Vector4::vector(0.0, 0.0, 1.0),
);
let intersections = sphere.intersect(&ray);
let length = intersections.iter()... | Rust | 0 |
# Software License Agreement (BSD License)
#
# Copyright (c) 2013, Open Source Robotics Foundation, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mus... | Python | 1 |
.unwrap()
.split("::")
.last()
.unwrap(),
record.args()
)
})
.filter(None, log::LevelFilter::Info);
if std::env::var("RUST_LOG").is_ok() {
builder.parse(&std::env::var("RUST_LOG").unwrap... | Rust | 0 |
confirm(query_predicates)
if mode == 'change_mind':
mode = 'ask'
reply = change_mind_confirm(reply_predicates['Value'][1:-1])
if mode == 'ask':
reply = 'Do you have any preference for the ' + reply_predicates['Value'] + ' of th... | Python | 1 |
mod memory_region;
pub mod verifier;
pub mod user_error;
mod asm_parser;
#[cfg(not(windows))]
mod jit;
/// eBPF verification function that returns an error if the program does not meet its requirements.
///
/// Some examples of things the verifier may reject the program for:
///
/// - Program does not terminate.
//... | Rust | 0 |
, 2*j2)
""",
seq_dependencies=True,
)
ref_t_unit = t_unit
knl = t_unit.default_entrypoint
knl = lp.rename_inames_in_batch(
knl,
lp.get_kennedy_unweighted_fusion_candidates(knl, frozenset(["j1", "j2"])),
)
assert len(knl.id_to_insn["insn"].reduction_inames()) == ... | Python | 1 |
load_program;
use veriwasm::runner::run_locals;
use yaxpeax_core::analyses::control_flow::check_cfg_integrity;
fn get_proxy_func_signatures() -> VwFuncInfo {
let mut signatures: Vec<Signature> = Vec::new();
// sig0 :: i32 -> ()
let sig0 = Signature {
params: vec![ValueType::I32],
ret_ty: No... | Rust | 0 |
"""Test for AudioManager module"""
from pathlib import Path
import numpy as np
import pytest
from scipy.io import wavfile
from recipes.cad1.task2.baseline.audio_manager import AudioManager
def test_save_audios(tmp_path):
"""Test save_audios method."""
np.random.seed(42)
# Initialize an audio manager wi... | Python | 1 |
e side effects from pure functions
//! - Big integer
//! - Supporting no_std environments
//!
//! ## Examples
//!
//! ### Simple Eval
//!
//! ```
//! let code = "
//! (export factorial (n) (Pure (-> (Int) Int))
//! (factorial' n 1))
//!
//! (defun factorial' (n total) (Pure (-> (Int Int) Int))
//! (if (<= n 0)
... | Rust | 0 |
R_MESSAGE)
if "ckpt" in self._tf_checkpoint.lower():
TF_CHECKPOINT = self._tf_checkpoint
TF_DATASET_FILE = ""
else:
TF_DATASET_FILE = self._tf_checkpoint
TF_CHECKPOINT = ""
convert_transfo_xl_checkpoint_to_pytorch(
... | Python | 1 |
# agents/tool_agent.py
from typing import Callable, Dict
# Placeholder for actual tools
TOOLS: Dict[str, Callable] = {}
def register_tools(tool_dict: Dict[str, Callable]):
"""Register external tool functions."""
global TOOLS
TOOLS = tool_dict
def decide_and_act(user_input: str, rag_chain) -> str:
"... | Python | 1 |
); model::VERTEX_COUNT])
.unwrap();
let transformed_n = singleton!(: [Vec3f; model::NORMAL_COUNT] =
[Vec3(0.,0.,0.); model::NORMAL_COUNT])
.unwrap();
let projection = Mat4f::translate((400., 300., 0.).into())
* Mat4f::scale((300., 300., 300.).into())
* Mat4f::persp... | Rust | 0 |
) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(1 << 5);
self.w.bits |= ((value as u32) & 1) << 5;
self.w
}
}
impl R {
#[doc = r"Value of the register as ra... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.