text
string
label_name
string
labels
int64
&self.inner; self.async_io .write_with(|_| inner.readlink(path).map_err(|err| err.into())) .await } pub async fn realpath(&self, path: &Path) -> io::Result<PathBuf> { let inner = &self.inner; self.async_io .write_with(|_| inner.realpath(path).map_e...
Rust
0
# \brief Replaces the current state of \a self with a copy of the state of the \c %MMFF94HeavyToHydrogenAtomTypeMap instance \a map. # \param map The \c %MMFF94HeavyToHydrogenAtomTypeMap instance to copy. # \return \a self # def assign(map: MMFF94HeavyToHydrogenAtomTypeMap) -> MMFF94HeavyToHydrogenA...
Python
1
powersets<T>( reader: &mut T, strings: &StringPool, messages: &MessageStore, ) -> ParseResult<Keyed<BasePowerSet>> where T: Read + Seek, { // data length let (expected_bytes, begin_pos) = read_struct_length(reader)?; // first read the length of the TOK_EARRAY ParseBasePowerSet[] let pbp...
Rust
0
; #[inline(always)] fn reset_value() -> Self::Type { 0x0aaa } } #[doc = "SEC_GPIO_MASK0 register write-lock.\n\nValue on reset: 2"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum SEC_GPIO_MASK0_LOCK_A { #[doc = "1: Restricted mode."] BLOCKED = 1, #[doc = "2: Writable."] ...
Rust
0
from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class Factory(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(50), unique=True, nullable=False) supply = db.Column(db.Integer, nullable=False) class Warehouse(db.Model): id = db.Column(db.Integer, primary_key...
Python
1
representation of this type is four 64-bit unsigned // integers in little-endian order. `Fp` values are always in // Montgomery form; i.e., Fp(a) = aR mod p, with R = 2^256. #[derive(Clone, Copy, Eq)] pub struct Fp(pub(crate) [u64; 4]); impl fmt::Debug for Fp { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result...
Rust
0
_bigrams.add(position) elif size == 3: matched_trigrams.add(position) return found_topics def annotate(self, contents, verbose=False): candidates = NLPUtils.extract_candidate_entities(contents, grammar=False, stopwords=True).union(NLPUtils.extract_candidate_relations(conten...
Python
1
is()), //index: Some(window.index), //window_name: Some(window.clone().name), //active: if window.active { Some(true) } else { None }, //..Default::default() //}; //hashmap.insert(window.name.clone(), Some(window_cfg)); //windows_cfg.push(hashmap.clone()); //} //return Ok(windows_cfg...
Rust
0
#!/usr/bin/env python import ctypes import testWrappedPoint import testPoint class Line(ctypes.Structure): _fields_ = [('start', testPoint.Point), ('end', testPoint.Point)] _libc = ctypes.CDLL("./libline.so") def __init__(self): a = self.get_line() self.start = a.start self.end = ...
Python
1
0, :3], expected_slice, atol=1e-4) print(f"Saving model to {pytorch_dump_folder_path}") model.save_pretrained(pytorch_dump_folder_path) print(f"Saving image processor to {pytorch_dump_folder_path}") image_processor.save_pretrained(pytorch_dump_folder_path) if __name__ == "__main__": parser = arg...
Python
1
Ok(()) } //! # } //! # //! # impl I2c1 { //! # fn new(scl: IoPin, sda: IoPin) -> Self { //! # I2c1 { //! # scl, sda //! # } //! # } //! # fn free(self) -> (IoPin, IoPin) { //! # (self.scl, self.sda) //! # } //! # } //! # //! # struct Delay; //! # impl DelayMs<u8> for Delay { //! # fn delay_m...
Rust
0
, MDNS_PORT).into(), Err(err) => { log::info!("resolving local socket addr failed with: {}", err); return; } }; loop { if let Err(err) = sock.send_to(&QUERY_BUF, to_addr).await { log::info!( "mdns query failed from {}: {}", ...
Rust
0
ed = [s for s in self.sheet_list if search_text in (s.SheetNumber + " - " + s.Name).lower()] self.update_checkboxes(filtered) def check_all_clicked(self, sender, args): self.check_all_state = not self.check_all_state for cb in self.checkboxes: cb.IsChecked = self.check_all_state...
Python
1
.set_src(MacAddr::new(0x12, 0x34, 0x56, 0xAB, 0xCD, 0xEF)); Ok(e) }); producer.enqueue(RawPacket::from_bytes(&TCP_PACKET).unwrap()); let next = batch.next().unwrap(); assert!(next.is_err()); if let Err(PacketError::Emit(mbuf)) = next ...
Rust
0
re(args) @register_model_architecture("fconv", "fconv_wmt_en_ro") def fconv_wmt_en_ro(args): args.decoder_out_embed_dim = getattr(args, "decoder_out_embed_dim", 512) base_architecture(args) @register_model_architecture("fconv", "fconv_wmt_en_de") def fconv_wmt_en_de(args): convs = "[(512, 3)] * 9" # fi...
Python
1
# QR-Code-Generator main logic placeholder print('QR-Code-Generator is running...')
Python
1
::Markpeg), b"Q" => Some(ExecInst::Cancelonsysfail), b"R" => Some(ExecInst::Primpeg), b"S" => Some(ExecInst::Suspend), b"U" => Some(ExecInst::Custdispinst), b"V" => Some(ExecInst::Netting), b"W" => Some(ExecInst::Pegvwap), b"X" => Some(...
Rust
0
ion; pub mod trusted_state; pub mod validator_config; pub mod validator_info; pub mod validator_signer; pub mod validator_verifier; pub mod vm_status; pub mod waypoint; pub mod write_set; pub use account_address::AccountAddress as PeerId; //////// 0L //////// pub mod ol_upgrade_payload; pub mod ol_validators_stats; p...
Rust
0
((self.extract_manual_features(adv_x_raw), pagerank_adv_features)) # 归一化处理 manual_adv_features = scaler.transform(manual_adv_features) adv_x_final = np.hstack((adv_x_encoded, manual_adv_features)) adv_y_final = to_categorical(encoder.transform(adv_y_raw), num_classes=len...
Python
1
t int overflow pollster = select.poll() pollster.register(1) self.assertRaises(OverflowError, pollster.poll, 1 << 64) x = 2 + 3 if x != 5: self.fail('Overflow must have occurred') # Issues #15989, #17919 self.assertRaises(ValueError, pollster.regist...
Python
1
""" Example demonstrating how to configure JSON configuration file loading by customizing the Pydantic's BaseModel.Config. Setting `CLI_JSON_ENABLE` to True will add a `--json-config /path/to/file.json` option to the commandline parser and can override default values. If a value is provided required in the Pydantic da...
Python
1
from django.urls import include, path from django.views.decorators.csrf import csrf_exempt from rest_framework.routers import DefaultRouter from rest_framework_simplejwt.views import TokenRefreshView from authentications.views import LogoutView, TokenObtainPairView router = DefaultRouter() urlpatterns = [ path(...
Python
1
emp_scores.append(score) scores = torch.cat(temp_scores, dim=1) # [B, 3, H, W] frame_weights = torch.softmax(scores * self.temp_scale, dim=1) # [B, 3, H, W] # 각 프레임의 spatial attention과 곱해서 weighted sum weighted_feats = [] for i in range(3): attn_map = self.spatial...
Python
1
], ['i', 'a', 'n', 'g'], ['i', 'n', 'g', ' '], ['i', 'o', 'n', 'g'], ['u', ' ', ' ', ' '], ['u', 'a', ' ', ' '], ['u', 'o', ' ', ' '], ['u', 'a', 'i', ' '], ['u', 'e', 'i', ' '], ['u', 'a', 'n', ' '], ['u', 'e', 'n', ' '], ['u', 'a', 'n', 'g'], ['u', 'e', 'n', 'g'], ['ü', ' ', ' ', ' '], ['ü', ...
Rust
0
_path: &ProofPath, key: K, lookup: &F, ) -> MapProofBuilder<K, V> where V: StorageValue, F: Fn(&ProofPath) -> Node<V>, { // `unwrap()` is safe: there is at least 1 element in the contour by design let common_prefix = proof_path.common_prefix_len(&contour.last().unwrap().key); // Eject nodes...
Rust
0
from pwn import * # Allows you to switch between local/GDB/remote from terminal def start(argv=[], *a, **kw): if args.GDB: # Set GDB script below return gdb.debug([exe] + argv, gdbscript=gdbscript, *a, **kw) elif args.REMOTE: # Remote execution return remote(sys.argv[1], sys.argv[2], *a, **k...
Python
1
#!/usr/bin/env python3 import os import re import sys from argparse import ArgumentParser from pathlib import Path from gitlab_api import GitlabApi, environ, fail parser = ArgumentParser() parser.add_argument("--fake-env", action="store_true") parser.add_argument("--download-tag", default=None) parser.add_argument("...
Python
1
argument(s) after format string but found 2 argument(s): printf("%d", 1, 2) test/lint/lint-format-strings-tests.txt: Expected 2 argument(s) after format string but found 3 argument(s): printf("%a %b", 1, 2, "anything") test/lint/lint-format-strings-tests.txt: Expected 1 argument(s) after format string but found...
Python
1
&expand=5474) #[inline] #[target_feature(enable = "avx512f")] #[cfg_attr(test, assert_instr(vpsravq))] pub unsafe fn _mm512_srav_epi64(a: __m512i, count: __m512i) -> __m512i { transmute(vpsravq(a.as_i64x8(), count.as_i64x8())) } /// Shift packed 64-bit integers in a right by the amount specified by the correspondi...
Rust
0
0); look_from_ = Vec3::new(13.0, 2.0, 3.0); look_at_ = Vec3::new(0.0, 0.0, 0.0); vfov_ = 20.0; aperture_ = 0.1; } if case == 3 { world = earth(); background = Vec3::new(0.7, 0.8, 1.0); look_from_ = Vec3::new(13.0, 2.0, 3.0); look_at_ = Vec3::new(0....
Rust
0
p_value:ActivitySubGroupValue) <-[:HAS_SELECTED_ACTIVITY_SUBGROUP]-(study_activity_subgroup:StudyActivitySubGroup)<-[:STUDY_ACTIVITY_HAS_STUDY_ACTIVITY_SUBGROUP] -(study_activity:StudyActivity)<-[:HAS_STUDY_ACTIVITY]-(:StudyValue)<-[:LATEST]-(:StudyRoot {uid:$study_uid}) MATC...
Python
1
G { ($e: expr) => {{ DEBUG_IMPL!("{:?}", $e); }}; ($($t: tt)+) => {{ DEBUG_IMPL!($($t)+); }} } #[macro_export] macro_rules! DEBUG_IMPL { ($($t: tt)+) => {{ use logging::*; if (Level::DEBUG as i32) <= Logger::level() { Logger::Log(conc!("D| ", &format!($($t)+), "\n")); } }} } #[macro_export] macro_rules! P...
Rust
0
let w = match control.layout.width { layout::Size::MatchParent => parent_width as i32, layout::Size::Exact(w) => w as i32, layout::Size::WrapContent => { let rep: cocoa_id = msg_send![self.img, representations]; ...
Rust
0
import time import random import setting import config from request import get_new_session from loghelper import log RET_CODE_ALREADY_SIGNED_IN = -5003 def hoyo_checkin(event_base_url: str, act_id: str) -> str: """ 国际服游戏签到 :param event_base_url: 基础Url :param act_id: 活动id :return: 签到结果 """ ...
Python
1
(slices) data is possible. #[derive(Debug, Clone)] pub struct FirstOutGraph<FirstOutContainer, HeadContainer, WeightContainer> { // index of first edge of each node +1 entry in the end first_out: FirstOutContainer, // the node ids to which each edge points head: HeadContainer, // the weight of each ...
Rust
0
i_pid tmp_gt = labels[pid == i_pid] # get all labels for patient i_pid final_pred.append(Counter(tmp_pred).most_common(1)[0][0]) # get the most common prediction for patient i_pid final_gt.append(Counter(tmp_gt).most_common(1)[0][0]) # get the most common label for patient i_pid ## classifi...
Python
1
et}/tmp/key_map_inv.json", 'w') as f: json.dump(key_map_inv, f, indent=4) print("Done.") print("Start Computing Clusters Embeddings...") if not os.path.exists(f"{args.output_dir}/{args.dataset}/clusters_embeddings_llm.json"): label2entity = {entity_info[entity]['...
Python
1
arena::Arena; use deno_core::{include_js_files, Extension, JsRuntime, RuntimeOptions}; use std::path::PathBuf; fn main() { let out = PathBuf::from(std::env::var_os("OUT_DIR").unwrap()); let snapshot_path = out.join("BYOND_RT_SNAPSHOT.bin"); let std = Extension::builder() .js(include_js_files!( ...
Rust
0
from machine import Pin, PWM import time, sys rychlost = 1000 class Motor: def __init__(self): self.AIN1 = PWM(Pin(10),freq=1000, duty=0) self.BIN1 = PWM(Pin(11),freq=1000, duty=0) self.AIN2 = PWM(Pin(13),freq=1000, duty=0) self.BIN2 = PWM(Pin(12),freq=1000, duty=0) def motor(self, motor, rychl...
Python
1
.stack.dotdotdoted || { *r.repeat_idx.last() == *r.repeat_len.last() - 1 } { match r.stack.up { None => { r.cur_tok = EOF; return ret_val; } Some(tt_f) => { if r.stack.dotdotdoted { r.r...
Rust
0
] fn apply(&self) -> u32 { 3 } } impl Trait for () {} impl Trait for u32 { fn apply(&self) -> u32 { *self + 5 } } } #[test] fn defaulted_prefix_method_works() { use defaulted_prefix_method::Trait_TO; { let obj = Trait_TO::from_val...
Rust
0
push(subpass); self } pub fn with_subpass_dependency( mut self, src_pass: i32, dst_pass: i32, src_stage_mask: PipelineStage, dst_stage_mask: PipelineStage, src_access_mask: Access, dst_access_mask: Access, flags: Dependency, ) -> Self...
Rust
0
ser_session.get("tools") message_history = cl.user_session.get("message_history") message_history.append({"name": "user", "role": "user", "content": message.content}) cur_iter = 0 while cur_iter < MAX_ITER: response_dict:dict = await process_user_message(llm, message_history, tools) pr...
Python
1
!(src, reserialized_item); //! } //! ``` #[macro_use] extern crate error_chain; #[macro_use] extern crate log; #[macro_use] extern crate serde; extern crate xml; #[cfg(test)] #[macro_use] extern crate serde_derive; #[macro_use] mod error; pub mod de; pub mod ser; pub use error::{Error, ErrorKind}; pub use xml::rea...
Rust
0
(); paper.grid.inner.len() } #[aoc(day13, part2)] fn part2(input: &Paper) -> String { let mut paper = input.clone(); for fold in &paper.folds { paper.grid.fold(fold); } paper.grid.sort(); paper.grid.print() } #[cfg(test)] mod tests { use super::*; #[test] fn part1_example(...
Rust
0
if c <= 0x7F as char && !c.is_control() && !c.is_whitespace() { self.write_literal_char(c) } else { write!(self.wtr, "(?-u:\\x{:02X})", b) } } fn write_literal_class_byte(&mut self, b: u8) -> fmt::Result { let c = b as char; if c <= 0x7F as char && !c.is_...
Rust
0
out1[6] = x584; out1[7] = x585; } /* * The function fiat_secp256k1_nonzero outputs a single non-zero word if the input is non-zero and zero otherwise. * Preconditions: * 0 ≤ eval arg1 < m * Postconditions: * out1 = 0 ↔ eval (from_montgomery arg1) mod m = 0 * * Input Bounds: * arg1: [[0x0 ~> 0xfffffff...
Rust
0
= int(math.ceil(scale_boxes[i][2])) scale_y2 = int(math.ceil(scale_boxes[i][3])) x1 = int(math.floor(boxes[i][0])) y1 = int(math.floor(boxes[i][1])) x2 = int(math.ceil(boxes[i][2])) y2 = int(math.ceil(boxes[i][3])) scale_crop_mask = masks[i][scale_...
Python
1
t)] mod test { use super::*; #[test] fn deserialize_config_test() -> Result<(), Box<dyn Error>> { let config = parse_config(Path::new("src/testcases/v1.yaml"))?; assert_eq!(config.base_path, Path::new("src/testcases").canonicalize()?); Ok(()) } #[test] fn deserialize_mo...
Rust
0
import click from pyhanko.cli.commands.signing import signing from pyhanko.cli.runtime import pyhanko_exception_manager from pyhanko.cli.utils import parse_field_location_spec from pyhanko.pdf_utils.incremental_writer import IncrementalPdfFileWriter from pyhanko.pdf_utils.reader import PdfFileReader from pyhanko.pdf_u...
Python
1
ode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) writer = MakefileWriter(generator_flags, flavor) writer.Write(qualified_target, base_path, output_file, spec, configs, part_of_all=qualified_target in needed_targets) # Our root_makefile lives at the source root. Comput...
Python
1
extern crate rand; extern crate sliced; extern crate spin; extern crate tempdir; extern crate time; //extern crate hyper; //use futures::{future, join, pending, Poll, poll, select, try_join}; //use futures::channel::oneshot; //use futures::executor::block_on; //use futures::Future; //use futures::future::Map; //use f...
Rust
0
pub capacity: u64, pub size: u64, pub unit_size: u64, pub offset: u64, // from where to upload. pub tx: Option<Sender<SegStateRet>>, } #[derive(Debug)] pub struct SegDownload{ pub id0: u64, pub id1: u64, pub capacity: u64, pub size: u64, pub unit_size: u64, pub offset: u64, //...
Rust
0
clone(), req, &irunq)) }; let server = Server::bind(&sock_addr) .serve(new_svc) .with_graceful_shutdown(close_recv) .map_err(|e| { eprintln!("server error: {}", e); }); ::hyper::rt::run(server); } pub fn handle_request( func: Lri, req: Request<Body>, ...
Rust
0
from google_auth_oauthlib.flow import InstalledAppFlow PATH = '../secrets/' # Replace with the path to your downloaded client secrets file CLIENT_SECRETS_FILE = PATH + 'gmail_client_secret.json' # This scope will allow the application to access and modify your Gmail SCOPES = ['https://www.googleapis.com/auth/gmail.m...
Python
1
error_type = "NameError", error_msg = "Failed to create `NcnameStr`" ) )] } owned NcnameString { /// Owned NCName, name string without colon (`:`). /// /// See <https://www.w3.org/TR/REC-xml-names/#NT-NCName>. #[opaque_typedef( ...
Rust
0
,], [ 3.8, 0.,], [ 4.2, -0.4,], [ 4.2, 0.4,], [ 5.8, 0.,], [ 6.2, -0.4,], [ 6.2, 0.4,], ]; //First triangle is arm, 2nd triangle is optional grab marker const ARM_INDEX_BUF: [u16;18] = [ 0, 1, 2, 5, 6, 7, 0, 1, 3, 8, 9, 10, 0,...
Rust
0
Search", command=search) search_button.grid(row=0, column=2, padx=10, pady=10, sticky=E) #Calculate and display BMI def calculate_bmi(weight, height): #Calculate the BMI and return a error message box if the weight or height field is not a number. try: return round(float(weight) / float(height)**2, 2) ...
Python
1
{ let mut encoder = Encoder::new(res, 80); encoder.set_progressive(true); encoder.encode(data, width, height, ColorType::Rgb).unwrap(); } fn encode_rgb_optimized(res: &mut Vec<u8>, data: &[u8], width: u16, height: u16) { let mut encoder = Encoder::new(res, 100); encoder.set_optimized_huffman_table...
Rust
0
::LanesAtMost32, crate::$to_inner<LANES>: crate::LanesAtMost32, crate::$from<LANES>: crate::Mask, crate::$to<LANES>: crate::Mask, { fn from(value: $from<crate::$from<LANES>, LANES>) -> Self { unsafe { core::mem::transmute_copy(&value) } ...
Rust
0
t = int(measurement_string[2]) # Last bit is the teleported state # Verify teleportation success success = received_bit == classical_bit # Generate circuit diagram circuit_diagram = str(circuit) # Update circuit data wit...
Python
1
class Personaje: def __init__(self, nombre, fuerza, inteligencia, defensa, vida): self.__nombre = nombre self.__fuerza = fuerza self.inteligencia = inteligencia self.defensa = defensa self.__vida = vida self.resistencia = self.fuerza ** 2 self.turno = False ...
Python
1
g.expt_value(psi_cat_t[:,j+1]).real # <psi(t)|H_Ising|psi(t)> Sent_t[j+1] = basis_ising.ent_entropy(psi_cat_t[:,j+1])['Sent_A'] # entanglement density of half chain ### plot results plt.plot(times, E_t/basis_ising.L, label='$E(t)/L$') plt.plot(times, Sent_t, label='$S_\mathrm{ent}^\mathrm{vN}(t)/L_A$') plt.xlabel(...
Python
1
# data loaders train_dataloader = dict( batch_size=64, num_workers=2, persistent_workers=True, sampler=dict(type='DefaultSampler', shuffle=True), dataset=dict( type='CombinedDataset', metainfo=dict(from_file='configs/_base_/datasets/coco_aic.py'), datasets=[dataset_coco, data...
Python
1
1"; const PORT2_NAME: &str = "eth2"; const EXPECTED_IFACE_STATE: &str = r#"--- - name: br0 iface_type: bridge state: up mtu: 1500 flags: - broadcast - lower_up - multicast - running - up ipv6: addresses: - address: "fe80::223:45ff:fe67:891c" prefix_len: 64 valid_...
Rust
0
bus.resource::<DaemonConfig>()?; let _listener = ListenerService::spawn(&bus)?; let connection = tab_websocket::connect_authorized( format!("ws://127.0.0.1:{}", config.port), "BAD TOKEN".into(), ) .await; assert!(connection.is_err()); assert_stat...
Rust
0
imitive::from_u32(read_be_u32(buf)?).unwrap_or_default())) }, _ => Ok(Self::Custom(type_signature, buf.to_owned())), } } } // Tag Type definitions // Simple tag types defined here, complex tag types in separate files use chromaticity::Chromaticity; #[derive(Debug, Serialize)] ...
Rust
0
,rotCenter.tolist()] if (list1 not in liste_BCPeriodiques) : liste_BCPeriodiques.append(list1) print(liste_BCPeriodiques) """ for b in bases: zones += Internal.getNodesFromType1(b, 'Zone_t') somme = 0 numZone.append(somme) for z in ...
Python
1
import math from turtle import forward import numpy as np import torch from torch import nn from ..builder import EMBEDDERS from .base import BaseEmbedder @EMBEDDERS.register_module() class MipNerfEmbedder(BaseEmbedder): def __init__(self, min_deg_point, max_deg_point, ...
Python
1
_VERSION"), os_family: OsFamily::from_env(), }; #[cfg(test)] mod test { use crate::build_metadata::{OsFamily, BUILD_METADATA}; #[test] fn valid_build_metadata() { let meta = &BUILD_METADATA; // obviously a slightly brittle test. Will be a small update for Rust 2.0 and GA :-) as...
Rust
0
il() as u16 } fn beats(&self, opponent: &Character) -> bool { let a = self.rounds(opponent); let b = opponent.rounds(&self); a <= b } } #[derive(Clone)] struct Inventory { cost: u16, damage: u16, armor: u16 } impl<'a, 'b> Add<&'b Inventory> for &'a Inventory { ...
Rust
0
## Autor: Vitor Augusto Tibério - Eng. Elétrica 023 - vitortiberio@usp.br ## Dependências para o programa: # pip install cvzone # pip instal midiapipe ## Importando as bibliotecas ## from cvzone.HandTrackingModule import HandDetector import cv2 as cv ## Código para abrir o vídeo ## vid = cv.VideoCapture(0, cv.C...
Python
1
ode scale efficeintly level_groups = self.topology.get_level(level) result = [] if not self._aggregated: self._aggregate_base() for group in level_groups: group = listify(group) if self._aggfunc is not None: level_res = self._aggfunc...
Python
1
(Postgres))] fn existing_postgis_views_must_not_be_migrated(api: TestApi) { let create_views = r#" CREATE VIEW "spatial_ref_sys" AS SELECT 1; /* The capitalized Geometry is intentional here, because we want the matching to be case-insensitive. */ CREATE VIEW "Geometry_columns" AS SELECT 1; ...
Rust
0
(2*i + 1) * jacobi_x(i), 17) # mpmath.nprint(jacobi_rn_part(i+1), 36) # mpmath.nprint(jacobi_sn(i+1), 36) #gs = jacobi_gs(49, 1) #for i in gs: # mpmath.nprint(i, 17) #for i in range(64): # print(f'// n = {i}') # for c in jacobi_coefs(i): # mpmath.nprint(c, 36) ...
Python
1
wait { tracing::error!("failed: {}", err); } }); Ok(()) } async fn run() -> anyhow::Result<()> { let mountpoint = env::args_os() .nth(1) .map(PathBuf::from) .ok_or_else(|| anyhow::anyhow!("missing mountpoint"))?; anyhow::ensure!( mountpoint.is_file(),...
Rust
0
#!/usr/bin/env python3 # This is a component of LinuxCNC # Copyright 2011 Michael Haberler <git@mah.priv.at> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the L...
Python
1
= "SYSTEM_COMB_PVT_ERR_NVT_SITE2\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [system_comb_pvt_err_nvt_site2](system_comb_pvt_err_nvt_site2) module"] pub type SYSTEM_COMB_PVT_ERR_NVT_SITE2 = cra...
Rust
0
_) = iter.finish()?; let mut tags_and_desc: Vec<String> = arg_vec .iter() .filter(|s| !s.is_empty()) .map(|s| (*s).to_string()) .collect(); for s in tags_and_desc.iter_mut() { *s = truncate_and_trim(s).map_err(|_| make_failure(input, Error::Syntax(pos.into())))?; } ...
Rust
0
ing: 20px;">'] column_num = 0 for block in contents: if 't' in block and block['t'] == 'Div' and 'grid-item-card' in block['c'][0][1]: item_html = '' for item in block['c'][1]: if item['t'] == 'Para': ...
Python
1
#print("Numeric (measure_triclinic_elastic_constants): \n", Cnum2_voigt) #print("Numeric (measure_triclinic_elastic_constants_2nd): \n", Cnum3_voigt) #print("Analytic: \n", Cana_voigt) #print("Absolute Difference (fit_elastic_constants): \n", Cnum-Cana_voigt) #print("Absolute Differen...
Python
1
# Copyright 2020 Makani Technologies 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...
Python
1
s_raw_fd(), to_submit, min_complete, flag, sig); if result >= 0 { Ok(result as _) } else { Err(io::Error::last_os_error()) } } /// Initiate asynchronous I/O. #[inline] pub fn submit(&self) -> io::Result<usize> { self.submit_and_wait(0) } ...
Rust
0
# Purpose: This script duplicates the active Revit view as a dependent and renames the duplicated view with a specified suffix. # Purpose: This script duplicates the active view in Revit and renames the duplicated view with a suffix. # Import necessary classes from Autodesk.Revit.DB import View, ViewDuplicateOption,...
Python
1
f let Some(parent_id) = parent_id { let parent = &mut self.groups[parent_id]; let group = Group::new(Some(identifier.clone()), listener_scope, block.variables); match block.prefix { Prefix::Element => { parent.elements.push(group_id); } Prefix::Class => { parent .classes .entr...
Rust
0
llot) }; hasWarpBallot as u64 }); __bindgen_bitfield_unit.set(10usize, 1u8, { let hasWarpShuffle: u32 = unsafe { ::std::mem::transmute(hasWarpShuffle) }; hasWarpShuffle as u64 }); __bindgen_bitfield_unit.set(11usize, 1u8, { let hasFunnelShi...
Rust
0
D convex polytope."] pub type Convex2<N> = Convex<Pnt2<N>>; #[doc = "A 2D segment."] pub type Segment2<N> = Segment<Pnt2<N>>; #[doc = "A 2D triangle."] pub type Triangle2<N> = Triangle<Pnt2<N>>; #[doc = "A 2D polyline."] pub type Polyline2<N> = Polyline<N, Pnt2<N>, Vec2<N>>; #[doc = "A 2D compound shape."] pub type Com...
Rust
0
ncoder cell_encoder = tf.nn.rnn_cell.BasicLSTMCell(lstm_dim, name='c_encoder') _, states_encoder = tf.nn.dynamic_rnn( cell_encoder, rec_inputs, dtype=tf.float32, time_major=True) # decoder cell_decoder = tf.nn.rnn_cell.BasicLSTMCell(lstm_dim, name='c_decoder') embed_s...
Python
1
1.0, 1.0], }, // v5 Vertex { pos: [-0.6, 0.6, -0.6, 1.0], color: [0.0, 0.0, 0.0, 1.0], }, // v6 Vertex { pos: [-0.6, -0.6, -0.6, 1.0], color: [1.0, 1.0, 1.0, 1.0], }, // v7 ]; pub const INDEX_DATA: [vkuint; 36] = [ 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 1, 6, 7, 1, 7, 2, 6, 5, 4, 6...
Rust
0
import cv2 import numpy as np from scipy.io.wavfile import write from scipy.spatial import KDTree from tkinter import filedialog, Tk, Button, Label import os root = Tk() root.title("Video to Oscilloscope WAV Converter") video_path = filedialog.askopenfilename(title="Select video file") cap = cv2.VideoCapture(video_p...
Python
1
/// Initializes `Logger` with given [`LoggerConfiguration`](`config::LoggerConfiguration`). /// After the initialization `log` macros will print with the use of this `Logger`. /// Returns the receiving side of telemetry channels (regular telemetry, future telemetry) /// /// # Errors /// If the logger is already set, r...
Rust
0
dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_INCOMPLETE_ATTACHMENT: types::GLenum = 0x8CD6; #[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_INCOMPLETE_DIMENSIONS: types::GLenum = 0x8CD9; #[allow(dead_code, non_upper_case_globals)] pub const FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: types...
Rust
0
num); pin.set_direction(Direction::In) .context(format!("Failed to set direction on data pin: {}", num))?; pin.unexport() .context(format!("Failed to export data pin: {}", num))?; } Ok(()) } /// Main display loop for messages. //noinspection DuplicatedCode fn display_loo...
Rust
0
# Copyright (c) "Neo4j" # Neo4j Sweden AB [https://neo4j.com] # # 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 applic...
Python
1
print("inferred knobs_wc = ",knobs_wc) else: print("WARNING: That effect not implemented yet. Skipping target generation.") if 'comp' in args.effect: y_st, _ = effect.go_wc(signal, knobs_wc) y_ct = calc_ct(signal, effect, knobs_wc, out_chunk_size, chunk_size)...
Python
1
et) record["AutoACMG Prediction time"] = end_time - start_time record["AutoACMG True Positives"] = ";".join(tp) record["AutoACMG False Negatives"] = ";".join(fn) record["AutoACMG False Positives"] = ";".join(fp) record["AutoACMG Full Response"] = pred.model_dump() except Exce...
Python
1
pp_label, self.opts.model_name)), (object, ), {'model': self.model}) for form in formset.forms: instance = form.instance if instance.pk: form.detail = self.get_view( DetailAdminUtil, fake_admin_class, instance) def instance_for...
Python
1
cidental, or consequential damages of any character arising as a // result of this License or out of the use or inability to use the // Work (including but not limited to damages for loss of goodwill, // work stoppage, computer failure or malfunction, or any and all // other commercial damages o...
Rust
0
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 writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See t...
Rust
0
# coding: utf-8 # Copyright 2009 Alexandre Fiori # # 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...
Python
1