text
string
label_name
string
labels
int64
g the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'zfp.tex', u'zfp Documentation', u'\shortstack[l]{Peter Lindstrom\\\\Danielle Asher}', 'manual'), ] # -- Options for manual ...
Python
1
p, lh + vertical_offset) else: # 原有逻辑,从顶部开始 right_target = fitz.Rect(lw + gap, 0, 2 * lw + gap, lh) page.show_pdf_page(right_target, right_doc, i) # 鲁棒的临时文件处理 temp_uuid = uuid.uuid4().hex[:8] tmp_path = output_path.parent / f"...
Python
1
wax_rot); } for (jhc, _) in front_left.iter_mut() { joint_wax(joints.get_mut(jhc.handle()), wax_rot); } } if keyboard_input.just_pressed(KeyCode::Right) { let wax_rot: Unit<Vector<Real>> = Unit::new_normalize(Vec3::new(1., 0., 0.3).into()); for (jhc, _) in fro...
Rust
0
# Copyright 2020 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
Python
1
) for key, value in data.items(): events.append( { # OS Details, Install, Hearthbeat, Upgrade, Consent Withdrawn "category": category, # Name of OW module or OS parameter "action": escape(key), # Actual version of OW...
Python
1
(x, np.asarray(numbers[name])) plt.legend([self.title + "(" + name + ")" for name in names]) plt.grid(True) def close(self): if self.file is not None: self.file.close() class LoggerMonitor(object): """Load and visualize multiple logs.""" def __init__(self, paths): ...
Python
1
CE_OTHERS: DWORD = 0x00000001; pub const SHUTDOWN_FORCE_SELF: DWORD = 0x00000002; pub const SHUTDOWN_RESTART: DWORD = 0x00000004; pub const SHUTDOWN_POWEROFF: DWORD = 0x00000008; pub const SHUTDOWN_NOREBOOT: DWORD = 0x00000010; pub const SHUTDOWN_GRACE_OVERRIDE: DWORD = 0x00000020; pub const SHUTDOWN_INSTALL_UPDATES: D...
Rust
0
# Copyright (C) 2018, 2019, 2020 Dominic O'Kane import matplotlib.pyplot as plt import numpy as np import add_fp_to_path from financepy.utils.math import scale from financepy.market.curves.discount_curve import DiscountCurve from financepy.market.curves.interpolator import InterpTypes from financepy.utils.frequency ...
Python
1
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
# -*- coding: utf-8 -*- # @Author : llc # @Time : 2022/9/2 15:20 import pytest from flask_openapi3 import OpenAPI # Basic Authentication Sample basic = {"type": "http", "scheme": "basic"} # JWT Bearer Sample jwt = {"type": "http", "scheme": "bearer", "bearerFormat": "JWT"} # API Key Sample api_key = {"type": "api...
Python
1
Box<&dyn std::error::Error>> + '_> { Box::new(self.inner.iter().map(|l| l.result().err()).flatten().map(|x| { let ptr: Box<&dyn std::error::Error> = Box::new(x); ptr })) } } pub trait Uniquify<'a, T: Clone + Eq + Hash> { fn unique(self) -> Uniquified<'a, T>; } // It's i...
Rust
0
}, //! wideFov{ //! adc, //! errors, //! flags, //! temp //! }, //! }, //! thermopilesA, //! thermopilesB, //! }, //! rawImu{ //! accel, //! gyro, //! gyroTemp //! }, //! ro...
Rust
0
.lock().unwrap(); assert!(seen.contains(&0)); assert!(seen.contains(&1)); assert!(seen.contains(&2)); assert_eq!(seen.len(), 3); } /// https://en.cppreference.com/w/cpp/atomic/memory_order#Sequentially-consistent_ordering /// /// This test currently fails because loom executes a permutation that isn't ...
Rust
0
((out_upconv6, out_conv5), 1))#[:, :, 0:out_conv4.size(2), 0:out_conv4.size(3)] out_upconv4 = self.deconv4(torch.cat((out_upconv5, out_conv4), 1))#[:, :, 0:out_conv3.size(2), 0:out_conv3.size(3)] out_upconv3 = self.deconv3(torch.cat((out_upconv4, out_conv3), 1))#[:, :, 0:out_conv2.size(2), 0:out...
Python
1
import ray from ray.serve._private.constants import SERVE_CONTROLLER_NAME, SERVE_NAMESPACE from ray.serve._private.default_impl import get_controller_impl from ray.serve.config import HTTPOptions from ray.serve.schema import LoggingConfig @ray.remote(num_cpus=0) class ServeControllerAvatar: """A hack that proxy t...
Python
1
g).to(device).view(1, 1, N).repeat([B, S, 1]) sqrdists = square_distance(new_xyz, xyz) group_idx[sqrdists > radius ** 2] = N group_idx = group_idx.sort(dim=-1)[0][:, :, :nsample] group_first = group_idx[:, :, 0].view(B, S, 1).repeat([1, 1, nsample]) mask = group_idx == N group_idx[mask] = group_...
Python
1
, -1], [1, -1, -1], [-1, -1, -1], ] # construct the module compute_depth_maps = ComputeDepthMaps(projection="perspective", eyepos_scale=0.01, image_size=cfg.RENDER.IMG_SIZE).float() # Testing loop for model_idx, (taxonomy_id, model_id, data) in enumerate(test_data_loader): ...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import mail_group from . import mail_group_member from . import mail_group_message from . import mail_group_moderation
Python
1
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns def plot_turtle_training_curves(): # Load training and validation data log_dir = "saved_models/perception/turtlebot2d/commit_8439378/" train_log_file = "run-commit_8439378_version_0_total_loss_train.csv" val_log_file = "run-comm...
Python
1
pub(crate) mod tests { use super::*; use crate::parser::Tokenizer; pub(crate) const SIMPLE_INTEGER_STRUCT_ASN: &str = r" SimpleSchema DEFINITIONS AUTOMATIC TAGS ::= BEGIN Simple ::= SEQUENCE { small INTEGER(0..255), bigger INTEGER(0..65535), neg...
Rust
0
nal, pub proximity: wl_signal, pub tip: wl_signal, pub button: wl_signal, } /* * This an unstable interface of wlroots. No guarantees are made regarding the * future consistency of this API. */ #[repr(C)]#[derive(Copy, Clone)] pub struct wlr_touch { pub impl_0: *const crate::src::backend::headless::...
Rust
0
def simulate_ddm(lam, sig, x0, xinfty, T): """ Simulate the drift-diffusion model with given parameters and initial condition. Args: lam (scalar): decay rate sig (scalar): standard deviation of normal distribution x0 (scalar): initial condition (x at time 0) xinfty (scalar): drift towards converge...
Python
1
get 3 months of <code>DAILY</code> forecasts or 12 months of <code>MONTHLY</code> forecasts.</p> /// <p>The <code>GetCostForecast</code> operation supports only <code>DAILY</code> and <code>MONTHLY</code> granularities.</p> pub fn granularity(mut self, inp: crate::model::Granularity) -> Self { ...
Rust
0
import pandas as pd from abc import ABC, abstractmethod class SurvivalBase(ABC): """ Interface class for causal survival analysis with fixed baseline covariates. """ @abstractmethod def fit(self, X: pd.DataFrame, a: pd.Series, t: pd.Series, y: pd.Ser...
Python
1
e `Color::to_string()` #[derive(Debug, Clone)] #[repr(u8)] pub enum Color { LightGreen = 0, LightRed, LightOrange, LightYellow, BlueGrey, LightBrown, Pink, LightGrey, Brown, Yellow, Teal, LightBlue, Purple, Red, Orange, Green, Turquoise, DarkTurquo...
Rust
0
let signals = receivers_a.into_iter().zip(receivers_b).zip(locs_a); for ((receiver_a, receiver_b), loc_a) in signals { encoded_signals.push(( encoded::Receiver::new( encoded::IndexShare::encode(&mut dummy, receiver_a).unwrap(), encoded::IndexShare::encode(&mut d...
Rust
0
# Taken from example in scikit-learn examples # Authors: Fabian Pedregosa <fabian.pedregosa@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Gael Varoquaux # License: BSD 3 clause (C) INRIA 2011 import numpy as np import matplotlib.pyplot as pl...
Python
1
{ let searchpath = Path::new(path); let filepath = Path::new(file); searchpath.components().zip(filepath.components()) .fold(true, |v, p| { v && (p.0 == p.1) }) }).map(|s| s.as_str()).collect() } fn main() { let args = clap_app!( megutil => (version: "0.1") (author: "<NAME>") (about: "mani...
Rust
0
#!/usr/bin/python # -*- coding: utf-8 -*- # Licensed under the GNU General Public License, version 3. # See the file http://www.gnu.org/copyleft/gpl.txt from pisi.actionsapi import cmaketools from pisi.actionsapi import mesontools from pisi.actionsapi import pisitools from pisi.actionsapi import shelltools def setup...
Python
1
; self.ey = c2; } /// Set this to the identity matrix. pub fn set_identity(&mut self) { self.ex.x = 1.0; self.ey.x = 0.0; self.ex.y = 0.0; self.ey.y = 1.0; } /// Set this matrix to all zeros. pub fn set_zero(&mut self) { self.ex.x = 0.0; ...
Rust
0
#!/usr/bin/env python3 from __future__ import annotations import graphlib import os import sys import shutil import logging from typing import Optional from pathlib import Path logging.basicConfig(level=logging.WARNING) SCRIPT_PATH = Path(__file__) HEADER_BASE_PATH = (SCRIPT_PATH / "../../src/include").resolve() MA...
Python
1
from: Box::new(f), arms: b, } )); named!(error_propagation_expr<&str, Expr>, map!(mrws!(tuple!( t4_expr, opt!(complete!(tag!("?"))) )), |(e, q)| match q { Some(_) => Expr::Question(Box::new(e)), None => e, })); named!(borrow_expr<&str, Expr>, map!(mrws!(tuple!( tag!("&"), opt!(complete!(tag!("mut"))...
Rust
0
q).send().await.unwrap().text().await.unwrap() })); if requests.len() > 20 { let package_registry_details_str = requests.next().await.unwrap().unwrap(); let entry: Value = serde_json::from_str(&package_registry_details_str).unwrap(); let name = entry["name"].as_str...
Rust
0
import pytest import types import os #useful for debugging tests def pretty(*things, **named_things): import pprint for t in things: pprint.PrettyPrinter(indent=2, width=200).pprint(t) for k,v in named_things.items(): print(str(k) + ":") pprint.PrettyPrinter(indent=2, width=200).ppr...
Python
1
tter = getattr(sys, 'get' + func) called = [0] def callback(*_args): called[0] += 1 def task(): test.assertIsNotNone(getter) return 1701 before_task = [] after_task = [] test = self class Pool(ThreadPool): class...
Python
1
the WAL file let mut file = File::open(&path)?; if offset > 0 { file.seek(SeekFrom::Start(offset as u64))?; } let nread = file.read_to_end(&mut buf)?; if nread != pg_constants::WAL_SEGMENT_SIZE - offset as usize { // Maybe allow this for .partial files?...
Rust
0
um=0.9) lstm_model = LSTM().to(device) lstm_optimizer = torch.optim.Adam(lstm_model.parameters(), lr=learning_rate, weight_decay=weight_decay) # lstm_optimizer = torch.optim.SGD(lstm_model.parameters(), lr=learning_rate, momentum=0.9) # for name, param in cnn_model.named_parameters(): ...
Python
1
i, frame in enumerate(ani.frames): bone = chr.bones[i] pbone = chr.blender_armature.pose.bones.get(bone.name) if not pbone: continue for j, f in enumerate(frame.frames): pos_adj = (f.pos[0], f.pos[1], -f.pos[2]) pos_val = c...
Python
1
msghdr<CtrlCmd, CtrlAttr>>(false); for response_result in iter { let response = response_result?; if let Some(p) = response.nl_payload.get_payload() { let handle = p.get_attr_handle(); for attr in handle.iter() { match &attr.nla_type.nla_type { ...
Rust
0
assert_eq!(&*util::string_to_utf16le(text), b"\x5B\x01\xD1\x1E\x3C\x04\xC5\x1E\x20\x00\x5B\x01\x67\x01\x57\x01\xC9\x1E\x48\x01\x1D\x01"); assert_eq!(&*util::string_from_encoding(Encoding::UTF16BE, b"\x01\x5B\x1E\xD1\x04\x3C\x1E\xC5\x00\x20\x01\x5B\x01\x67\x01\x57\x1E\xC9\x01\x48\x01\x1D").unwrap(), text);...
Rust
0
_byte(0xba, 1024 * 1024); tx.send(data, vec![], vec![shmem_data]).unwrap(); let (mut received_data, received_channels, received_shared_memory) = rx.recv().unwrap(); received_data.truncate(7); assert_eq!((&received_data[..], received_channels), (data, Vec::new())); assert_eq!(received_shared_memory[0...
Rust
0
"""A tiny event hub. ``kerno.events`` will be an instance of EventHub, however you can also use the EventHub class in other circumstances if you want to. First a library defines an event class to contain event data:: class EventUserLoggedIn: def __init__(self, peto): self.peto = peto ...
Python
1
} } sum } pub fn board_has_bingo(board: &Board) -> Option<u32> { let dobbed = &board.dobbed; for row_idx in 0..5 { let row = dobbed.slice(ndarray::s![row_idx, ..]); let num_dobbed = row.fold(0, |x, y| x + *y as u32); if num_dobbed == 5 { return Some(sum_where_false(...
Rust
0
年春夏学期本科课程第一轮选课情况的通报</a></td><td>课程中心</td><td>2019-01-03 17:02:48</td> </tr><tr class="datagrid1212"> <td align="Left"><a href="#" onclick="window.open('http://jwbinfosys.zju.edu.cn/wbwj/关于2017级及以前学生修读通识选修课程的补充说明 (含“沟通与领导类”课程清单).docx','gxlb','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizabl...
Rust
0
ObjcSubclass::dispatch_cb(ptr, FruitCallbackKey::Method("applicationWillFinishLaunching:"), event as *mut Object); } /// Register the Rust ObjcWrapper instance that wraps this object /// ...
Rust
0
Full Service Brick and Mortar Office 12 - Full Service Retail Office 13 - Full Service Cyber Office 14 - Full Service Mobile Office 15 - Full Service Home/Phone Banking 16 - Full Service Seasonal Office 21 - Limited Service Administrative Office 22 - Limited Service Military Facility 23 - Limited Service Facil...
Python
1
ck(r#"fn foo(<|>x: i32, y: i32) {}"#, &["x", "x: i32", "x: i32, "]); do_check(r#"fn foo(<|>x: i32,y: i32) {}"#, &["x", "x: i32", "x: i32,", "(x: i32,y: i32)"]); do_check(r#"fn foo(x: i32, <|>y: i32) {}"#, &["y", "y: i32", ", y: i32"]); do_check(r#"fn foo(x: i32, <|>y: i32, ) {}"#, &["y", "y: i32...
Rust
0
# Copyright 2024 DeepMind Technologies Limited. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
Python
1
"mimetype": "image/jpeg", } if file_path.lower().endswith(".png"): img_data["mimetype"] = "image/png" url = API_PATH["widget_lease"].format(subreddit=self._subreddit) # until we learn otherwise, assume this request always succeeds upload_lease = self._reddit.post(url...
Python
1
ind::String, ObjectKind::Upvalue => panic!("Should not pass in upvalue directly"), }, } } } impl Display for ParameterKind { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match *self { ParameterKind::Any => write!(f, "anything"), ParameterKind::Bool => write...
Rust
0
accessor: an alias for `Reg<CMPA_PROG_IN_PROGRESS_SPEC>`"] pub type CMPA_PROG_IN_PROGRESS = crate::Reg<cmpa_prog_in_progress::CMPA_PROG_IN_PROGRESS_SPEC>; #[doc = "CMPA Page programming on going. This field shall be set to 0x5CC55AA5 in the active CFPA page each time CMPA page programming is going on. It shall always b...
Rust
0
et0/0', 'address': '12.34.56.78', 'protocol': 'up', 'description': 'Outside interface test de..'}, {'status': 'down', 'name': 'GigabitEthernet0/1', '...
Python
1
NH4_bottom, 'temp_all_depth': temp_all_depth, 'temp_shallow': temp_shallow, 'temp_deep': temp_deep, 'temp_surface': temp_surface, 'temp_bottom': temp_bottom, 'salt_all_depth': salt_all_depth, 'salt_shallow': salt_sh...
Python
1
s(0, 0) axisLeft.SetMargins(0, 0) axisBottom.SetMargins(0, 0) renWin.Render() # Create a vtkTesting object rtTester = vtkTesting() rtTester.SetRenderWindow(renWin) for arg in sys.argv[1:]: rtTester.AddArgument(arg) # Perform the image compa...
Python
1
SGI Irix pub const ELFOSABI_IRIX: OSABI = OSABI(8); /// FreeBSD pub const ELFOSABI_FREEBSD: OSABI = OSABI(9); /// Compaq TRU64 UNIX pub const ELFOSABI_TRU64: OSABI = OSABI(10); /// Novell Modesto pub const ELFOSABI_MODESTO: OSABI = OSABI(11); /// OpenBSD pub const ELFOSABI_OPENBSD: OSABI = OSABI(12); impl fmt::Debug ...
Rust
0
def forward(self, joints, camera_poses, inv_camera_poses, uv_hm): num_batch = joints.shape[0] num_views = joints.shape[1] num_joints = joints.shape[2] camera_poses = camera_poses.unsqueeze(dim=2) camera_poses = camera_poses.repeat(1, 1, num_joints, 1, 1) inv_cam...
Python
1
_json => "application", "json", "form", Form, is_form => "application", "x-www-form-urlencoded", "JavaScript", JavaScript, is_javascript => "application", "javascript", "CSS", CSS, is_css => "text", "css" ; "charset=utf-8", "data form", DataForm, is_data_form => "multipart", "form-data",...
Rust
0
ster_matcher('job_invocation_body', job_invocation_body_matcher) body_matcher = 'job_invocation_body' with fam_vcr.use_cassette(cassette_file, record_mode=test_params['record_mode'], match_on=[method_matcher, 'path', query_matcher, body_matcher], ...
Python
1
Copyright 2019 Walmart Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
Rust
0
Config::with_cases(10_000))] /// Verify that the serialized size of a block hash used to calculate the allocation limit is correct #[test] fn block_hash_size_is_correct(hash in Hash::arbitrary()) { let serialized = hash.zcash_serialize_to_vec().expect("Serialization to vec must succe...
Rust
0
my_full_name = "My name is Oleksandr Rudyk" print(my_full_name.find("Oleksandr")) print(my_full_name.find("s")) print(my_full_name.find("Alex")) if my_full_name.find("Oleksandr") > 0: print("There is Oleksandr in text") print(my_full_name[:my_full_name.find("Oleksandr")]) print(my_full_name[my_full_name.find("Ol...
Python
1
special_chunks.extend([speech_token_idx, nl_tokens]) for x in insert_separator(prompt_chunks, special_chunks): input_ids.extend(x[offset:]) import pdb;pdb.set_trace() if return_tensors is not None: if return_tensors == 'pt': return torch.tensor(input_ids, dtype=torch.long) ...
Python
1
ne = line.strip() if cleaned_line: lines.append(cleaned_line) return '\n'.join(lines) def datetime_to_timestamp(dt_str: str) -> int: """将ISO格式的日期时间字符串转换为Unix时间戳""" try: dt = datetime.fromisoformat(dt_str.replace('Z', '+00:00')) return int(dt.timestamp()) except ...
Python
1
text = input("enter isbn:") err_digit = int(input("enter digit:")) isbn_digits = [int(x) if x != 'X' else 10 for x in text if x != '-'] # isbn_digits = [9,8,7,3,0,8,4,8,5,8] if len(isbn_digits) != 10: print("error! invalid isbn") for i in range(0, 10): isbn_digits[err_digit - 1] = i print(isbn_digits) ...
Python
1
import pandas as pd import pytest from .conftest import TEST_COLLECTION_NAME from st_weaviate_connection import WeaviateConnection from st_weaviate_connection.connection import weaviate_response_objects_to_df @pytest.fixture def weaviate_connection(weaviate_db): yield WeaviateConnection("test_weaviate_conn", url...
Python
1
else: raise RuntimeError('%r wanted to resolve the ' 'new state dynamically but' ' no group matched' % regex) # direct sta...
Python
1
DC12VRSEL_A::ADC12VRSEL_9, 10 => ADC12VRSEL_A::ADC12VRSEL_10, 11 => ADC12VRSEL_A::ADC12VRSEL_11, 12 => ADC12VRSEL_A::ADC12VRSEL_12, 13 => ADC12VRSEL_A::ADC12VRSEL_13, 14 => ADC12VRSEL_A::ADC12VRSEL_14, 15 => ADC12VRSEL_A::ADC12VRSEL_15, ...
Rust
0
val| Msg::OnGotUsername(val)) } pub fn on_got_email(&self) -> Callback<String> { self.link.callback(|val| Msg::OnGotEmail(val)) } pub fn on_got_password(&self) -> Callback<String> { self.link.callback(|val| Msg::OnGotPassword(val)) } pub fn on_got_confirm_password(&self) -> Callback<String> { self.lin...
Rust
0
{InMessage, OutMessage}; use algebra::{Fp64, Fp64Parameters, PrimeField, UniformRandom}; use crypto_primitives::{ additive_share::{AdditiveShare, AuthAdditiveShare, AuthShare, Share}, beavers_mul::Triple, }; use io_utils::imux::IMuxAsync; use itertools::izip; use num_traits::Zero; use protocols_sys::SealCT; use...
Rust
0
value, ))(inner) })(i)?; let partial_attr = PartialAttribute { attr_type, attr_vals, }; Ok((i, partial_attr)) })(i) } // Attribute ::= PartialAttribute(WITH COMPONENTS { // ..., // vals (SIZE(1..MAX))}) pub(crate) fn parse_ldap_attribute...
Rust
0
dict) prob_out = outputs[0] else: self.input_tensor.copy_from_cpu(norm_img_batch) self.predictor.run() prob_out = self.output_tensors[0].copy_to_cpu() self.predictor.try_shrink_memory() cls_result = self.postprocess_...
Python
1
} } // Not enough space to put the guard after the pattern, try a newline. // 3 = `if `, 5 = ` => {` let cond_shape = Shape::indented(shape.indent.block_indent(context.config), context.config) .offset_left(3) .and_then(|s| s.sub_width(5)); if let Some(con...
Rust
0
test1(); test2(); } use super::DeployResult; use aws_sdk_s3::{types::ByteStream, Client as S3Client}; use cargo_lambda_interactive::progress::Progress; use cargo_lambda_remote::{ aws_sdk_config::SdkConfig, aws_sdk_lambda::{ error::{ DeleteFunctionUrlConfigError, GetAliasError, GetFuncti...
Rust
0
); for j in 0..num { result.push(FragmentBuilder::new(j * increment, (j + 1) * increment)); } } result } fn push_to_fragments(num: u64, width: u8, fragments: &mut Vec<FragmentBuilder>) { let mut num_it: usize = num.try_into().unwrap(); // this will ensure that we get some sort ...
Rust
0
] #[derive(Encode, Decode, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)] pub struct ClassData { pub is_pool: bool, // NFT pools for tokenized merch } #[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))] #[derive(Encode, Decode, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)] pub struct TokenData...
Rust
0
#!/usr/bin/env python3 """Basic checks of Additional section content.""" import os from dnstest.libknot import libknot from dnstest.test import Test t = Test() knot = t.server("knot") zone = t.zone("test", storage=".") t.link(zone, knot) ctl = libknot.control.KnotCtl() t.start() serial = knot.zone_wait(zone) ct...
Python
1
import os import sys from datetime import datetime from PyQt6.QtWidgets import QMainWindow, QApplication, QTableView from PyQt6.QtGui import QIcon from PyQt6.QtCore import Qt, QAbstractTableModel basedir = os.path.dirname(__file__) class TableModel(QAbstractTableModel): def __init__(self, data): supe...
Python
1
cess_RegisteredSealProof::StackedDrg64GiBV1_1 } } } } impl From<cess_RegisteredSealProof> for RegisteredSealProof { fn from(other: cess_RegisteredSealProof) -> Self { match other { cess_RegisteredSealProof::StackedDrg2KiBV1 => RegisteredSealProof::Stacked...
Rust
0
.map(FreezeChunkCount::Channels) .map_err(|inner| FreezeError { kind: ColdResumeErrorKind::Channels, inner, }) } async fn freeze_channels_(&self, redis: &Redis) -> Result<usize, FreezeInnerError> { let mut channels_count = self.inner.stats...
Rust
0
<EMAIL>" pub fn email_address_line(input: &str) -> IResult<&str, EmailAddress> { line("e=", wsf(map(cowify(read_string), EmailAddress)))(input) } #[test] fn test_email_address_line() { assert_line!( email_address_line, "e=<EMAIL>", EmailAddress("<EMAI...
Rust
0
Failure(e)) => Err(Error::from(e.message())), Err(nom::Err::Incomplete(_)) => unreachable!(), } } fn do_parse_program(input: Span) -> IResult<AST> { // Parse decoder - the only one mandatory part of the program. let (rest, decoder) = match decoder(input) { Ok((rest, decoder)) => (rest, deco...
Rust
0
_process_frame84(obs), reward, done, info def _reset(self): return _process_frame84(self.env.reset()) class ClippedRewardWrapper(gym.Wrapper): def _step(self, action): obs, reward, done, info = self.env.step(action) return obs, np.sign(reward), done, info def wrap_deepmind_ram...
Python
1
ct::BoolProperty, pub network: NetworkInformationInspect, hf_battery_level: Option<inspect::UintProperty>, inspect_node: inspect::Node, } impl Inspect for &mut PeerTaskInspect { fn iattach(self, parent: &inspect::Node, name: impl AsRef<str>) -> Result<(), AttachError> { self.inspect_node = pare...
Rust
0
ug for SigningKey<P> where P: Parameters, { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { fmt.debug_struct(&format!("SigningKey<{}>", P::parameter_name())) .field("data", &"[...]") .finish() } } impl<P> PartialEq for SigningKey<P> where P: Parameters, { ...
Rust
0
if live and hls else ["live"] if live else ["hls"] if hls else [] open_url_info = config.open_url_info for cate, channel_obj in data.items(): custom_print(f"\n{cate}:", end=" ") content += f"{'\n\n' if not first_cate else ''}{cate},#genre#" first_cate = False channel_obj_keys = c...
Python
1
>, proxy_protocol: Option<k8s::policy::server::ProxyProtocol>, ) -> k8s::policy::Server { k8s::policy::Server { metadata: k8s::ObjectMeta { namespace: Some(ns.to_string()), name: Some(name.to_string()), labels: Some( srv_labels .int...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
PartitionBLayer | /* 4 */ UnitType::SliceDataPartitionCLayer | /* 5 */ UnitType::SliceLayerWithoutPartitioningIdr => { seen_vcl = true; } /* 6 */ UnitType::SEI => { if seen_vcl { errs.push_str("\n* SEI after VCL"); ...
Rust
0
import pygame as pg import random as rnd def generiere_felder(): b = bild.copy() breite, höhe = scr_b / spalten, scr_h / zeilen felder = [b.subsurface((s * breite, z * höhe, breite, höhe)) for z in range(zeilen) for s in range(spalten)] pg.draw.rect(felder[-1], '#3274B3', (0, 0, breite, höhe)) r...
Python
1
: key_selector, stream: stream, } } } use crate::{BaseRenderer, BatchMarker, Error, Material, Mesh, Renderer, Result, Vertex}; use ash::vk::{DescriptorSet, IndexType}; use glam::{Mat4, Vec4}; use hecs::{Query, World}; use ivy_base::{Color, Position, Rotation, Scale, Visible}; use ivy_resources::...
Rust
0
for ev in llm_events: ev2, cost_dec, src = price_event(ev, reg, overwrite=overwrite) sources[src] = sources.get(src, 0) + 1 model = resolve_model_name(ev2) if cost_dec is not None: total += cost_dec by_model[model] = by_model.get(model, Decimal("0")) + cost_dec ...
Python
1
{ key, .. }) => { match key.to_unescaped()?.as_ref() { "UserName" => { builder = builder.set_user_name( smithy_json::deserialize::token::expect_string_or_null( ...
Rust
0
ow<'_, [u8]>> { let mut filename = Vec::new(); let mut chars = escaped.as_bytes().iter().copied(); while let Some(c) = chars.next() { if c == b'\\' { let ch = match chars .next() .ok_or_else(|| ParsePatchError::new("expected escaped character"))? ...
Rust
0
from dataclasses import dataclass @dataclass class Misspelling: word: str similar_words: list[str] def levenshtein(s1: str, s2: str) -> int: len_s1, len_s2 = len(s1), len(s2) dp = [[0] * (len_s2 + 1) for _ in range(len_s1 + 1)] for i in range(len_s1 + 1): dp[i][0] = i for j in range...
Python
1
_x_coord - x1) / (x2 - x1) * (y2 - y1); let row = dem.get_row_from_y(y_prime); roads.set_value(row, col, 1i8); // output_something = true; } } ...
Rust
0
ied()); assert_eq!(d.next(), Some(Ok('a'))); assert_eq!(d.next(), Some(Err(DecodeUtf8Error))); assert_eq!(d.next(), Some(Ok('j'))); assert_eq!(d.next(), None); } <gh_stars>10-100 //! This adds a few utility functions for the [DensePolynomial] arkworks type. use ark_ff::Field; use ark_poly::{univariate::DensePo...
Rust
0
| { let mut head = head; if let Some((ref c_head, ref c_parent)) = current { if head == c_head { if base == c_parent { return Ok(true); } else { head = c_parent; } } } f(base, head) }) } } type Hash = [u8; 1]; type Slot = u64; #[derive(Debug, Clone,...
Rust
0
f let Ok((parsed, raw_rdata)) = rdata_text { assert!(raw_rdata.is_none()); assert_eq!("2001::1234", parsed.unwrap()); } } #[test] fn test_format_rdata_for_cname_type() { let rdata = RData::CNAME(Name::from_str("www.example.com.").unwrap()); let rdata_text = f...
Rust
0
evt.data["args"] = [victim, "guardian angel"] @event_listener("transition_night_begin") def on_transition_night_begin(evt: Event, var: GameState): # needs to be here in order to allow protections to work during the daytime # (right now they don't due to other reasons, but that may change) GUARDED.clear()...
Python
1
02} ‘ਤ\u{a47} ਪਾਬ\u{a70}ਦੀ", "ਸ\u{a48}ਲ", ], }, #[cfg(feature = "pa_Arab")] crate::Annotation { lang: "pa_Arab", tts: Some("موبائل فون نہیں"), keywords: &[ "حرام", "خ\u{64f}لیہ", "فون"...
Rust
0