text
string
label_name
string
labels
int64
lConv } fmm::types::CallingConvention::Tail => llvm_sys::LLVMCallConv::LLVMFastCallConv, }) as u32 } <reponame>jfortin42/Wolf3D_rs<gh_stars>0 use super::*; use parser::material::PortalSymbolSet; pub use parser::material::PhysicsProperties; #[derive(Debug)] pub enum Shading { Texture(String), ...
Rust
0
from django.test import TestCase from django.core.files.uploadedfile import SimpleUploadedFile from django.contrib.auth import get_user_model from rest_framework.test import APIRequestFactory from .models import CustomUser from core.authentication import CustomJWTAuthentication import os # Custom user test case cla...
Python
1
(return_tx, rx_yield) = oneshot::channel(); let command = SwarmCommand::UnbanPeer { peer, return_tx }; self.send_command(command).await; rx_yield.await.unwrap() } /// Check whether the Network has an established connection to a peer. pub async fn is_connected(&mut self, peer: PeerI...
Rust
0
Weekday::Saturday => "Sat", Weekday::Sunday => "Sun", } } #[cfg(feature = "formatting")] fn full_weekday(weekday: Weekday) -> &'static str { match weekday { Weekday::Monday => "Monday", Weekday::Tuesday => "Tuesday", Weekday::Wednesday => "Wednesday", Weekday::Thursda...
Rust
0
['\u{002B}']), (0x1d43a, &['\u{0047}']), (0xfd23, &['\u{0636}', '\u{0649}']), (0x2f49, &['\u{6708}']), (0xfe5f, &['\u{0023}']), (0xfb5f, &['\u{067A}']), (0x33aa, &['\u{006B}', '\u{0050}', '\u{0061}']), (0x1d6f0, &['\u{039F}']), (0x316d, &['\u{11D9}']), (0x1d424, &['\u{006B}']), (...
Rust
0
emy(distance: location::Distance) -> &'static Self { weighted_choice(distance) } } pub const COMMON: &[Class] = &[RAT, WOLF, SNAKE, SLIME, SPIDER]; pub const RARE: &[Class] = &[ZOMBIE, ORC, SKELETON, DEMON, VAMPIRE, DRAGON, GOLEM]; pub const LEGENDARY: &[Class] = &[CHIMERA, BASILISK, MINOTAUR, BALROG, PHOE...
Rust
0
# Pyrofork - Telegram MTProto API Client Library for Python # Copyright (C) 2017-present Dan <https://github.com/delivrance> # Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan> # # This file is part of Pyrofork. # # Pyrofork is free software: you can redistribute it and/or modify # it under ...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" from dataclasses import dataclass from urllib.parse import urljoin import requests from bs4 import BeautifulSoup session = requests.session() session.headers[ "User-Agent" ] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/2010...
Python
1
# -*- coding: utf-8 -*- # snapshottest: v1 - https://goo.gl/zC4yUc from __future__ import unicode_literals from snapshottest import Snapshot snapshots = Snapshot() snapshots['TestTopkTokens.test_matches_snapshot 1'] = '''<div id="circuits-vis-mock" style="margin: 15px 0;"/> <script crossorigin type="module"> ...
Python
1
D BE UNCOMPRESSED SIZE, CAN BE PROBABLY GOT FROM THE FILE MANIFEST for window in self.chunk_filesize_list.values() { chunks.append( u32::try_from(*window) .unwrap_or_default() .to_le_bytes() .to_vec() .bo...
Rust
0
1.creat_point(p2); println!("p3.x = {}, p3.y = {}", p3.x, p3.y); } } //! Contains types for storing sorted or unsorted collections of data. pub mod bit_mask; pub mod rc; pub mod stack; use super::{Error, Highlight, HighlightConfiguration, HighlightEvent, Highlighter, HtmlRenderer}; use regex::Regex; use std...
Rust
0
rain_filter(|subscriber| { subscriber.next(value); subscriber.is_closed() }); } } impl<Err, T> ObserverError<Err> for Vec<T> where Err: Copy, T: ObserverError<Err> + SubscriptionLike, { fn error(&mut self, err: Err) { self.iter_mut().for_each(|subscriber| { subscriber.error(err); ...
Rust
0
import torch from byol_pytorch import BYOL from model import CovidNet n_classes = 14 model = CovidNet('small', n_classes=n_classes).cuda() # model = CovidNet('large', n_classes=n_classes) # # model = CNN(n_classes, 'mobilenet_v2') # # model = ViT( # image_size=224, # patch_size=32, # num_classes=3, # ...
Python
1
from ast import literal_eval from itertools import chain # Пример преобразованного массива JackBack JackBack = "[32, 50, 112, 51, 77, 114, 105, 98, 111, 110, 116, 48, 115, 46, 107, 41, 101, 10, 109, 52, 97, 34, 121, 61, 102, 40, 103, 44, 75, 58, 100, 49, 66, 164, 6, 15, 17, 40, 42, 45, 49, 50, 51, 52, 70, 72, 75, 79, ...
Python
1
np.float) elif type == 'TranslateY': theta = np.array([[1, 0, 0], [0, 1, v]]).astype(np.float) H = tensor.shape[2] W = tensor.shape[3] theta[0,1] = theta[0,1]*H/W theta[1,0] = theta[1,0]*W/H if type != 'Rotate': theta[0,2] = theta[0,2]*2/H + theta[0,0] + theta[0,1] - 1 t...
Python
1
delay.delay_ms(500_u16); watchdog.feed(); delay.delay_ms(500_u16); tx.write_str("This will get printed \r\n").ok(); watchdog.feed(); // Now a reset happens while delaying delay.delay_ms(1500_u16); tx.write_str("This won't\r\n").ok(); } loop { ...
Rust
0
it Cells JSON", os.getcwd(), # starting directory "JSON Files (*.json);;All Files (*)", ) if file_path: try: with open(file_path, "r", encoding="utf-8") as f: json_string = f.read() unit_cells = deserialize_unit_ce...
Python
1
nsorrt_available(): print(f"[E] Unsupported hardware: {f} cannot be loaded") filepath = os.path.join(root, f) device = 'cuda' if ext in trt_extensions else 'cpu' print(lightgreen(f"{f}")) try: start_time= time.time() model...
Python
1
from Maix import freq cpu_freq, kpu_freq = freq.get() print(cpu_freq, kpu_freq) freq.set(cpu = 400, pll1=400, kpu_div = 1)
Python
1
ME_STATE, pub szVolumeFriendlyName: [u16; 260], pub RedirectedIOReason: u64, pub VolumeRedirectedIOReason: u64, } impl ::core::marker::Copy for CLUSTER_SHARED_VOLUME_STATE_INFO_EX {} impl ::core::clone::Clone for CLUSTER_SHARED_VOLUME_STATE_INFO_EX { fn clone(&self) -> Self { *self } } #[doc...
Rust
0
import time from pyfirmata import Arduino import customtkinter as ctk # Setup appearance ctk.set_appearance_mode("dark") ctk.set_default_color_theme("dark-blue") # Create window root = ctk.CTk() root.geometry("500x400") root.title("Live Servo Control") # Connect to Arduino board = Arduino('COM8') horizontal = board....
Python
1
_1.shape, policy_2.actions(observations).shape) @pytest.mark.skip("Latent smoothing is temporarily disabled.") def test_latent_smoothing(self): observation_np = self.env.reset() smoothed_policy = FeedforwardGaussianPolicy( input_shapes=self.env.observation_shape, output_...
Python
1
#!/usr/bin/env python3 """ Database Migration Script ========================= Add new columns to strategies table for extended configuration fields. """ import sqlite3 import logging # Configure logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) def migrate_database(): """Migr...
Python
1
", 0x1999: "市民15", 0x199A: "市民16", 0x199B: "市民17", 0x199C: "市民18", 0x199D: "市民19", 0x199E: "市民20", 0x199F: "市民21", 0x19A0: "市民22", 0x19A1: "市民23", 0x19A2: "管家格利伏斯", 0x19A3: "金恩", 0x19A4: "亞博斯事務次長", 0x19A5: "可麗茲社長", 0x19A6: "拉旺館長", 0x19A9: "馬5", 0x19C8: "巴克利", 0x19C9: "胡蜂女王", 0x19CA: ...
Python
1
file_name="generated_app.py", mime="text/plain", ) def render_footer(): """Render the app footer with improved styling""" st.markdown( """ <div class="footer-container"> <h3>Powered By</h3> <div> <span class="model-badge">Gemini 1.5 Flash</span> ...
Python
1
#!/usr/bin/env python3 from utils.all import * # fin = advent.get_input() # eprint(*fin, sep='') timer_start() ################################################## moons = [ [-7, 17, -11], [9, 12, 5], [-9, 0, -4], [4, 6, 0] ] vels = [ [0,0,0], [0,0,0], [0,0,0], [0,0,0] ] for _ in range(1000): accels = [ ...
Python
1
#!/usr/bin/python # Copyright (C) 2012-2016 Reece H. Dunn # # This file is part of ucd-tools. # # ucd-tools 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 3 of the License, or # (at your optio...
Python
1
//! hope the **Stakker** runtime also does. //! //! [`ActorOwn`]: struct.ActorOwn.html //! [`Actor`]: struct.Actor.html //! [`Core`]: struct.Core.html //! [`Cx`]: struct.Cx.html //! [`Deferrer`]: struct.Deferrer.html //! [`Fwd`]: struct.Fwd.html //! [`PipedThread`]: struct.PipedThread.html //! [`Ret`]: struct.Ret.html...
Rust
0
Result<Self, SynthesisError> { let mut result = self.clone(); result.double_in_place(cs)?; Ok(result) } #[inline] fn double_in_place<CS: ConstraintSystem<ConstraintF>>( &mut self, mut cs: CS, ) -> Result<&mut Self, SynthesisError> { self.c0.double_in_pla...
Rust
0
anton= 21 beth= 6+anton chen=20+beth drew=chen+anton Ethen=chen print("Anton is " + str(anton)) print("Beth is " + str(beth)) print("Chen is " + str(chen)) print("Drew is " + str(drew)) print("Ethan is " + str(Ethen))
Python
1
from collections.abc import Iterable from amaranth import * from typing import Any, Generic, Optional, Protocol, TypeVar from amaranth.hdl import ValueCastable from amaranth_types.types import HasElaborate, ShapeLike, ValueLike __all__ = ["AbstractMemory", "AbstractReadPort", "AbstractWritePort", "AbstractMemoryCon...
Python
1
data and splitting it into chunks. Args: file_path (str): The path to the file. chunk_size (int): Optional. The size of each chunk. overlap_ratio (float): Optional. The overlap ratio between consecutive chunks. Returns: List[Document]: A list of Document...
Python
1
from articles import views from config import settings from django.conf.urls.static import static from django.urls import include, path from rest_framework.routers import DefaultRouter router = DefaultRouter(trailing_slash=False) router.register("articles", views.ArticleViewSet) router.register("tags", views.TagView) ...
Python
1
ordSet, new_flashes: &mut CoordSet) { azip!((index (i, j), e in &mut arr) { *e += 1; if *e > 9 { to_test.insert((i, j)); } }); while !to_test.is_empty() { small_step(arr.view_mut(), flashed, to_test, new_flashes); } } fn new_coord_set() -> CoordSet { Co...
Rust
0
lt.xlabel('Context Length', fontsize=22) # X-axis label with larger font plt.ylabel('Answer Depth (%)', fontsize=22) # Y-axis label with larger font plt.yticks(rotation=0, fontsize=16) # Enlarge y-axis labels cbar = ax.collections[0].colorbar cbar.ax.tick_params(labelsize=16) cbar.set_label('Score', fontsize=22...
Python
1
) / len(d3s)) print('mean jaccard distance @ 5 NOT projected', sum(d3s_5) / len(d3s_5)) print('mean jaccard distance @ 10 NOT projected', sum(d3s_10) / len(d3s_10)) print('knn classification accuracy NOT projected', accuracy) writer.close() def get_k(): """Returns the number of referen...
Python
1
'\u{aa36}', Cham), ('\u{aa40}', '\u{aa4d}', Cham), ('\u{aa50}', '\u{aa59}', Cham), ('\u{aa5c}', '\u{aa5f}', Cham), ('\u{aa60}', '\u{aa7f}', Myanmar), ('\u{aa80}', '\u{aac2}', Tai_Viet), ('\u{aadb}', '\u{aadf}', Tai_Viet), ('\u{aae0}', '\u{aaf6}', Meetei_Mayek), ('\u{ab01}', '\u{ab06}', Ethiopic...
Rust
0
import sys import argparse import logging from crytic_compile import cryticparser from slither import Slither from slither.utils.command_line import read_config_file from slither.tools.slither_format.slither_format import slither_format logging.basicConfig() logging.getLogger("Slither").setLevel(logging.INFO) # Slit...
Python
1
= 10, V4L2_BUF_TYPE_PRIVATE = 0x80, } #[repr(C)] #[derive(Clone, Copy)] pub struct v4l2_rect { left: i32, top: i32, width: i32, height: i32, } #[repr(C)] #[derive(Clone, Copy)] pub struct v4l2_fract { pub numerator: u32, pub denominator: u32, } #[repr(C)] pub struct v4l2_capability { ...
Rust
0
Gladis::from_builder(builder) } } // Re-export #[derive(Gladis)]. #[cfg(feature = "derive")] #[doc(hidden)] pub use gladis_proc_macro::Gladis; #[cfg(test)] mod tests { use crate::{GladisError, NotFoundError}; #[test] fn fmt_not_found_error() { let err = NotFoundError { id...
Rust
0
await CartItemRepository.remove_from_cart(cart_item.id, session) sold_items.append(cart_item) msg += MessageService.create_message_with_bought_items(purchased_items) user.consume_records = user.consume_records + cart_total await UserRepository.update(user, sessi...
Python
1
= "Possible values of the field `CFG17`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CFG17R { #[doc = "Output is A7OUT2. value."] A7OUT2, #[doc = "Output is A6OUT2. value."] A6OUT2, #[doc = "Output is A1OUT2. value."] A1OUT2, #[doc = "Output is A4OUT. value."] A4OUT, #[doc = ...
Rust
0
###Script to be loaded inside the Raspberry Pi or controller which controls the feed machine import socket from gpiozero import LED # Define the server address and port server_address = ('192.168.0.4', 65432) # Replace <raspberry-pi-ip> with the actual IP address of your Raspberry Pi led_pin = 13 # Create an LED obj...
Python
1
>(); if enum_values.len() == 2 { if let Ok(enum_index) = enum_values[0].parse::<i32>() { let enum_name = enum_values[1]; field_enum_values.insert(enum_index, enum_name.to_owned()); } ...
Rust
0
(f)(SOURCE) def test_export_pb(enabled=False): # TF suffers from install conflicts on Windows and macOS if enabled and LINUX: model = YOLO(MODEL) f = model.export(format='pb') YOLO(f)(SOURCE) def test_export_paddle(enabled=False): # Paddle protobuf requirements conflicting with o...
Python
1
r[propertyr^r`rbrarcrer:rirjr;rPSEEK_SETrtrwrXrXrXrYr&s$  U  rr2r,)r.r/r0r1encodingerrorsnewlinec Csd|vr d|vrPtd|fn0|dur0td|dur@td|durPtd...
Python
1
# Contents of electronics/foundry.py '''Copyright (c) 2025 Jaron Cheng'''
Python
1
on_delete=models.SET_NULL, from_fields=("a", "b", "d"), to_fields=("a", "b", "d"), related_name="children", ) field = Child._meta.get_field("parent") self.assertEqual( field.check(from_model=Child), [ ...
Python
1
import random dice_art = { 1: ( "┌─────┐", "│ │", "│ • │", "│ │", "└─────┘" ), 2: ( "┌─────┐", "│ • │", "│ │", "│ • │", "└─────┘" ), 3: ( "┌─────┐", "│ • │", "│ • │", ...
Python
1
from urlextract import URLExtract from wordcloud import WordCloud import pandas as pd from collections import Counter import matplotlib.pyplot as plt import re extractor = URLExtract() def fetch_stats(selected_user, df): if (selected_user != "overall"): df = df[df['user'] == selected_user] #no of mssg...
Python
1
let mut v = Vec::from_iter(&self.0); v.sort_by(|&(ax, ay), &(bx, by)| (ay,ax).cmp(&(by, bx))); let mut x = 0; let mut y = -1; for coord in &v { let (cx,cy) = coord; while y<*cy { write!(f,"\n")?; y+=1; x=0; } while x<*cx { write!(f," ")?; x+=1; } ...
Rust
0
{ last_mouse_buttons = mouse_report.buttons; mouse_report = Default::default(); } Err(e) => { panic!("Failed to write mouse report: {:?}", e) } }; } } ...
Rust
0
ures: `\"Win32_Graphics_Direct3D11\"`*"] pub const D3D11_MESSAGE_ID_DEVICE_SHADER_LINKAGE_MINPRECISION: D3D11_MESSAGE_ID = 3146050i32; #[doc = "*Required features: `\"Win32_Graphics_Direct3D11\"`*"] pub const D3D11_MESSAGE_ID_VIDEOPROCESSORSETSTREAMALPHA_UNSUPPORTED: D3D11_MESSAGE_ID = 3146051i32; #[doc = "*Required fe...
Rust
0
llId(0), generation: 0, energy: 0, genome: Genome::new(), } } #[inline] pub fn random( id_generator: &mut CellIdGenerator, generator: &mut RandomGenerator) -> Cell { let mut res = Cell::new(id_generator); res.genome = Genome::random(generat...
Rust
0
r][c] = '-' elif set(conn) == set(((r - 1, c), (r, c + 1))): grid[r][c] = 'L' elif set(conn) == set(((r - 1, c), (r, c - 1))): grid[r][c] = 'J' elif set(conn) == set(((r + 1, c), (r, c - 1))): grid[r][c] = '7' elif set(conn) == set(((r + 1, c), (r, c + 1))): grid[r][c] = 'F' else: assert False, 'Cann...
Python
1
Parameter::Vec2(v) => v.0.write(buffer)?, Parameter::Vec3(v) => v.0.write(buffer)?, Parameter::Vec4(v) => v.0.write(buffer)?, Parameter::Color(v) => v.0.write(buffer)?, Parameter::String32(s) | Parameter::String64(s) | Parameter::String256(s) | Parameter::...
Rust
0
2m; Self { x: d } } } impl<const K: u64, const KAPPA: u64> SecretInteger<K, KAPPA> { #[allow(non_snake_case)] pub fn TruncPr<const M: u64, const SIGNED: bool>( self, _: ConstU64<M>, _: ConstBool<SIGNED>, ) -> Self { let (r_dprime, r, _rb) = PRandM::<K, M, KAPPA>(...
Rust
0
8, u8, u8, u8) { let count = if time.as_secs_f32() > MAX_TIME { 0xFFFFFFFFu32 } else { (time.as_secs_f32() / TIME_PER_CYCLE) as u32 }; let bit_3 = ((count & 0xFF000000) >> 24) as u8; let bit_2 = ((count & 0xFF0000) >> 16) as u8; let bit_1 = ((count & 0xFF00) >> 8) as u8; let ...
Rust
0
TeaType::Lemongrass => COLD.as_ref(), TeaType::BlackCurrantHibiscus => ALL.as_ref(), TeaType::RoastedDandelionRoot => HOT.as_ref(), TeaType::DandelionLeafAndRoot => ALL.as_ref(), TeaType::Lavender => ALL.as_ref(), TeaType::CinnamonApple => ALL.as_...
Rust
0
207" RplTraceservice, /// RPL_TRACENEWTYPE = "208" RplTracenewtype, /// RPL_TRACECLASS = "209" RplTraceclass, /// RPL_TRACERECONNECT = "210" RplTracereconnect, /// RPL_TRACELOG = "261" RplTracelog, /// RPL_TRACEEND = "262" RplTraceend, /// RPL_STATSLINKINFO = "211" Rp...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2023 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
Python
1
:new().editable(false).build(); col.pack_start(&cell, false); col.add_attribute(&cell, "text", 4); col.add_attribute(&cell, "background", 1); col.add_attribute(&cell, "foreground", 2); cols.push(col); #[cfg(feature = "targeted_mixtures")] { let col = ...
Rust
0
g, Length, Tag, }; #[cfg(feature = "der")] #[cfg_attr(docsrs, doc(cfg(feature = "der")))] impl<'a, const LIMBS: usize> TryFrom<Any<'a>> for UInt<LIMBS> where UInt<LIMBS>: ArrayEncoding, { type Error = der::Error; fn try_from(any: Any<'a>) -> der::Result<UInt<LIMBS>> { UIntBytes::try_from(any)?.try...
Rust
0
append((a[0], a[1], 1, fCashClaim)) else: remainingAssets.append(a) # Group by currency id and sum settled values return ( [ (key, sum(int(num) for _, num in value)) for key, value in itertools.groupby(settledBalances, lambda x: x[...
Python
1
the given string, expecting that it will fail. /// Returns the error without location information. /// /// # Panics /// /// If the parser does not have an error. pub fn parse_err<T: AsRef<[u8]> + 'static>(input: T) -> QError { parse_err_node(input).into_err() } pub trait DemandSingle<T> { fn demand_single(sel...
Rust
0
#!/usr/bin/env python3 #-----------------------BEGIN NOTICE -- DO NOT EDIT----------------------- # NASA Goddard Space Flight Center # Land Information System Framework (LISF) # Version 7.5 # # Copyright (c) 2024 United States Government as represented by the # Administrator of the National Aeronautics and Space Admin...
Python
1
let (Some(w), Some(vw)) = (it.next(), vw_it.next()) { let child = if let Some(&&mut ch) = it.peek() { ch } else { 0.0 }; *w = (*w + child - vw).exp(); } } // End of the weight-pushing algorithm // ----------------------------------------------------...
Rust
0
r of field `SEL130`"] pub type SEL130_R = crate::R<u8, u8>; #[doc = "Write proxy for field `SEL130`"] pub struct SEL130_W<'a> { w: &'a mut W, } impl<'a> SEL130_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (sel...
Rust
0
te`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [output_val](output_val) module"] pub type OUTPUT_VAL = crate::Reg<u32, _OUTPU...
Rust
0
[11, 21])); assert_ok!(Staking::bond(Origin::signed(3), 4, 1000, RewardDestination::default())); assert_ok!(Staking::nominate(Origin::signed(4), vec![11, 31])); let winners = phragmen::elect::<Test, _, _, _>( 2, Staking::minimum_validator_count() as usize, <Validators<Test>>::enumerate(), <Nominator...
Rust
0
l') plt.ylim([0.48,1.02]) plt.savefig(output_dir+'Figure/PR_LightGBM_Eval'+Dtype+'.png',bbox_inches="tight") plt.close() def specificity_score(y_true, y_pred): tn, fp, fn, tp = confusion_matrix(y_true, y_pred).flatten() return tn / (tn + fp) def main(): cond = 'same'; date = ''; Dtype=''; Fty...
Python
1
flags: u32) -> ProgramArray { ProgramArray { def: bpf_map_def { type_: BPF_MAP_TYPE_PROG_ARRAY, key_size: mem::size_of::<u32>() as u32, value_size: mem::size_of::<u32>() as u32, max_entries, map_flags: flags, ...
Rust
0
#conduit:fachschaften.org`\n\nConduit lounge (Off-topic, only Conduit users are allowed to join)\n`/join #conduit-lounge:conduit.rs`".to_owned(), "<h2>Thank you for trying out Conduit!</h2>\n<p>Conduit is currently in Beta. This means you can join and participate in most Matrix rooms, but not all f...
Rust
0
st::{Expr, Expr_, Program}, aast_visitor::{visit, AstParams, Node, Visitor}, }; use parser_core_types::syntax_error::SyntaxError; struct Checker { errors: Vec<SyntaxError>, } impl<'ast> Visitor<'ast> for Checker { type Params = AstParams<(), ()>; fn object(&mut self) -> &mut dyn Visitor<'ast, Params ...
Rust
0
assert_eq!( BoardingPass::from_entry("FFFBBBFRRR"), BoardingPass { row: 14, column: 7 } ); assert_eq!( BoardingPass::from_entry("BBFFBBFRLL"), BoardingPass { row: 102, column: 4 } ); } #...
Rust
0
import tensorflow as tf def weightVariables(shape, name): initial = tf.truncated_normal(shape=shape, mean=0, stddev=0.05) return tf.Variable(initial, name=name) def chebyshevCoefficient(chebyshevOrder, inputNumber, outputNumber): chebyshevWeights = dict() for i in range(chebyshevOrder): initia...
Python
1
][j]^3; } } } fn find_most_constrained_cell(&self) -> (usize,usize,u8) { let mut r = (0,0,0); let mut max = -1; for i in 2..7 { for j in 2..7 { for &z in &[1, 2] { if (self.data[i][j] & z) == 0 { ...
Rust
0
import matplotlib.pyplot as plt import pandas as pd def plot_eer_curve(eer_df: pd.DataFrame, testset_name: str = None, model_name: str = None) -> None: """ Plots the Equal Error Rate (EER) curve given a DataFrame with FAR, FRR, and threshold columns. Args: eer_df (pd.DataFrame): DataFrame containi...
Python
1
if i == "ai": continue now_dir = os.path.join(talk_dir, i) # 判断当前路径是否为目录 if os.path.isdir(now_dir): # 如果是目录,则递归遍历子目录 for root, dirs, files in os.walk(now_dir): for f in files: now_f = os.path.join(root, f) ...
Python
1
# Copyright (c) 2023 NVIDIA CORPORATION. All rights reserved. # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and relate...
Python
1
name: "Holy Breath", flags: ALLY_OK | FOE_OK | TARGET_NOT_SELF, mp_cost: 0, aoe: AoE::Line(Some(2)), implementation: &ElementalBreathImpl { element: Element::Holy, ma_factor: 5, range: 2, }, }, ]; pub(crate) struct ElementalBreathIm...
Rust
0
import streamlit as st from dotenv import load_dotenv import os from google.cloud.sql.connector import Connector from cloud_db_handler import DatabaseClient load_dotenv() @st.cache_resource def get_db_client(): db_connection_name = os.getenv("DB_CONNECTION_NAME") db_name = os.getenv("DB_NAME") db_user = o...
Python
1
[(), (), (), (), (), ()]); } <reponame>capyloon/api-daemon #![feature(test)] extern crate test; use value_bag::ValueBag; #[bench] fn u8_capture_from(b: &mut test::Bencher) { b.iter(|| ValueBag::from(1u8)) } #[bench] fn u8_capture_debug(b: &mut test::Bencher) { b.iter(|| ValueBag::capture_debug(...
Rust
0
('𦔰', "shà,xū"), ('𦔷', "yāo"), ('𦔸', "gōng"), ('𦔹', "nài"), ('𦔼', "xiè"), ('𦔿', "tiàn"), ('𦕆', "yé"), ('𦕉', "shā"), ('𦕏', "sào"), ('𦕒', "diān"), ('𦕓', "xù"), ('𦕙', "qú"), ('𦕠', "hōng"), ('𦕡', "shèng"), ('𦕢', "tìng"), ('𦕰', "duo"), ('𦕵'...
Rust
0
File { File::open_root(self.id, flags) } pub fn read<CSPIN: PinOps>( &mut self, sdcard: SdCardRef<CSPIN>, file: &mut File, buffer: &mut [u8], ) -> Result<usize, FatError> { self.check_file(file)?; if !file.is_readable() { return Err(FatEr...
Rust
0
backward() assert op._arch_alpha.grad.abs().sum().item() != 0, op._arch_alpha.grad def test_proxyless_repeat(): repeat = Repeat(nn.Linear(3, 3), (2, 4), label='rep') repeat = ProxylessMixedRepeat.mutate(repeat, '', {}, {}) assert isinstance(repeat.blocks[1], nn.Linear) assert isinstance(repeat...
Python
1
HardwareRegister), ArrayBoundsCheck(HardwareRegister, HardwareRegister), NewArray(TypeId, HardwareRegister, usize), LoadElement(TypeId, HardwareRegister, HardwareRegister, HardwareRegister), StoreElement(TypeId, HardwareRegister, HardwareRegister, HardwareRegister), LoadArrayLength(HardwareRegister...
Rust
0
rx-vlan-stag-filter: false rx-vlan-stag-hw-parse: false tls-hw-record: false tls-hw-rx-offload: false tls-hw-tx-offload: false tx-checksum-fcoe-crc: false tx-checksum-ip-generic: true tx-checksum-ipv4: false tx-checksum-ipv6: false tx-checksum-sctp: true tx-esp-segmentation: false tx-fcoe-segmenta...
Rust
0
.lock().unwrap().writer.take(); if let Some(mut writer) = writer_option { // If the socket is already closed, shutdown() will fail, so just ignore it. let _ = writer.shutdown().await; } if let Disconnect::PeerDisconnected = disconnect_type { peer_manager.socket_disconnected(&our_descriptor); peer_mana...
Rust
0
import json from unittest import TestCase from pathlib import Path from wmsdump.kml_helper import kml_extract_features from wmsdump.errors import LayerMissingException, KMLUnsupportedException class TestKMLParsing(TestCase): def setUp(self): pass def load_file(self, fname): script_dir = Pat...
Python
1
get_data(id).mov); } (board, id) } fn expand(&mut self, board: Board, node_id: NodeId) -> (Board, NodeId) { use rand::seq::IteratorRandom; let mut rng = rand::thread_rng(); let already_expanded_moves: Vec<Move> = node_id.children(&self.arena).map(|id|self.get_data(id).mov).collect(); if let Some(mov) =...
Rust
0
WithClock}, instant, instant::Absolute, DirectRateLimiter, InconsistentCapacity, NegativeMultiDecision, }; /// The most naive implementation of a rate-limiter ever: Always /// allows every cell through. /// # Example /// ``` /// use ratelimit_meter::DirectRateLimiter; /// use ratelimit_meter::example_algor...
Rust
0
ed(seed); let xprv = Xprv::random(&mut rng).derive_intermediate_key(|t| { t.commit_u64(b"account_id", 34); }); assert_eq!( hex::encode(xprv.scalar.as_bytes()), "4a53c3fbbc59970ee5f85af813875dffc13a904a2e53ae7e65fa0dea6e62c901" ); assert_eq!( ...
Rust
0
Відтак O купити O сімку O в O невеликих O населених O пунктах O буде O неможливо O . O Крім O того O , O нова O процедура O ідентифікації O абонентів O вимагатиме O від O операторів O мобільного O зв'язку O додаткових O витрат O . O - O Близько O 90 O % O українських O абонентів O - O це O абоненти O передоплати O...
Python
1
} versioned_type! { 2.. => EncryptedMutations, } versioned_type! { 1.. => ExtentKey, } versioned_type! { 1.. => ExtentValue, } versioned_type! { 1.. => JournalRecord, } versioned_type! { 1.. => LayerInfo, } versioned_type! { 2.. => Mutation, } versioned_type! { 1.. => ObjectKey, } versioned...
Rust
0
State { current_edge_events: HashMap::new(), current_tmc_events: HashMap::new() }); let data_wrapped = Arc::new(data); let data_wrapped_2 = data_wrapped.clone(); let data_wrapped_3 = data_wrapped.clone(); let data_wrapped_4 = data_wrapped.clone(); let data_wrapped_5 = data_wrapped.clone(); let tmc_state_wrapped...
Rust
0
#!/usr/bin/env python3 INSTRUCTIONS = """ # Task: You are given a Question, a model Prediction, and a list of Ground Truth answers, judge whether the model Prediction matches any answer from the list of Ground Truth answers. Follow the instructions step by step to make a judgement. 1. If the model prediction matches...
Python
1
elif char in CHAR_TO_REPEAT: rmin, rmax = CHAR_TO_REPEAT[char] if last is None: raise SyntaxError( 'Repetition character (%s) without previous expression' % text[index]) new_regex = RegexRepeat(last, rmin, rmax) ...
Python
1
Reads a guide library from a file. The file: /// - May be either tab- or comma-delimited /// - Must have a header row /// - Must have at least three columns with the first three columns in order being: /// - a unique ID for the guide /// - the sequence of the guide /// - the ...
Rust
0
softwareRecipes:format="table[box,title='SOFTWARE RECIPES']( source, softwareRecipe.name, softwareRecipe.version, softwareRecipe.desiredState )" ) """) def Run(self, args): """See base class.""" release_track = self.ReleaseTrack() holder = ...
Python
1