text
string
label_name
string
labels
int64
; use celma_core::parser::parser::{Combine, Parse}; use celma_core::parser::repeat::RepeatOperation; use celma_core::stream::stream::Stream; use crate::meta::syntax::ASTParsec::{PBind, PChar, PCheck, PChoice, PCode, PIdent, PMap, PNot, POptional, PRepeat, PSequence, PString, PTry, PLookahead}; use crate::meta::syntax:...
Rust
0
= x25519_dalek::PublicKey::from(public_key); Ok(public_key) } } <filename>xngin-expr/src/fold/add.rs use crate::error::{Error, Result}; use crate::{Const, ExprKind}; use xngin_datatype::Decimal; #[inline] pub fn fold_add(lhs: &ExprKind, rhs: &ExprKind) -> Result<Option<Const>> { match (lhs, rhs) { ...
Rust
0
ze); impl Drop for Foo { fn drop(&mut self) { assert_eq!(33, self.0); } } { let mut arc = { let m = CacheMap::new(); let a = m.cache("key", || Foo(99)).to_arc(); assert_eq!(99, (*a).0); ...
Rust
0
stack_frame ); } use emerald::*; pub fn main() { let mut settings = GameSettings::default(); let mut render_settings = RenderSettings::default(); render_settings.resolution = (320, 180); settings.render_settings = render_settings; emerald::start(Box::new(MyGame {}), settings) } pub struct MyG...
Rust
0
= ()=>{ }; return <h1 onClick={handleClick}>Hi</h1>; }; } ; let A = foo ? ()=>{ return <h1 >Hi</h1>; } : null; const B = (function Foo() { return <h1 >Hi</h1>; })(); let C = ()=>()=>{ return <h1 >Hi</h1>; } ; let D = bar && (()=>{ return <h1 >Hi</h1>; }); const throttledAlert...
Rust
0
_name()?, key: serde_dynamodb::to_hashmap(&item_key)?, ..Default::default() }; let future = db.client.get_item(input); let res = db.runtime.block_on(future)?; match res.item { Some(val) => { let bot: Bot = serde_dynamodb::from_hashmap(val)?; let csml_bo...
Rust
0
erviceAccount> = Api::namespaced(client.clone(), NAMESPACE); let controller_service_account = controller_service_account(); create_or_update( &service_accts, controller_service_account, "Controller Service Accout", ) .await?; Ok(()) } async fn create_secret( cli...
Rust
0
#[doc = "Bit 7 - MMC Receive Runt Frame Counter Interrupt Mask"] #[inline(always)] pub fn rxruntfim(&self) -> RXRUNTFIM_R { RXRUNTFIM_R::new(((self.bits >> 7) & 0x01) != 0) } #[doc = "Bit 8 - MMC Receive Jabber Error Frame Counter Interrupt Mask"] #[inline(always)] pub fn rxjaberfim(&se...
Rust
0
winuser::{ GetKeyState, GetKeyboardLayout, MapVirtualKeyExW, PeekMessageW, ToUnicodeEx, VkKeyScanW, MAPVK_VK_TO_CHAR, MAPVK_VSC_TO_VK_EX, PM_NOREMOVE, VK_ACCEPT, VK_ADD, VK_APPS, VK_ATTN, VK_BACK, VK_BROWSER_BACK, VK_BROWSER_FAVORITES, VK_BROWSER_FORWARD, VK_BROWSER_HOME, VK_BROWSER_REFRESH, VK_BROWSER_...
Rust
0
{ expand_data_struct(&event_name, &params) }; // read each token parameter as the required data type let params_len = Literal::usize_unsuffixed(params.len()); let read_param_token = params .iter() .map(|(name, _)| { quote! { let #name = Tokenizable::...
Rust
0
source, label=None, src_type=None, source_category=None ): """ Applies the triples: <evidence> <dc:source> <source> <source> <rdf:type> <type> <source> <rdfs:label> "label" TODO this should belong in a higher level class ...
Python
1
pe.EVENT ) def disconnected(): rpc_device_mock.return_value.subscribe_updates.call_args[0][0]( {}, RpcUpdateType.DISCONNECTED ) device = _mock_rpc_device() rpc_device_mock.return_value = device rpc_device_mock.return_value.mock_discon...
Python
1
import random import numpy as np import pytest import skorecard.bucket_mapping import skorecard.bucketers import skorecard.datasets import skorecard.linear_model import skorecard.metrics import skorecard.pipeline import skorecard.preprocessing import skorecard.rescale import skorecard.utils from skorecard import data...
Python
1
ter_ctrl.GetValue() panel.SetResult( com_port, adapter_name, device_ctrl.GetValue(), None if key_ctrl is None else key_ctrl.GetStringSelection() ) REMOTE_ACTIONS = () for remote_key in UserControlCodes: key_func = remote_key ...
Python
1
import pymongo if __name__ == "__main__": print("welcome to pymongo") client = pymongo.MongoClient("mongodb://localhost:27017") print(client) db = client["Sample"] collection = db["MySampleCollection"] "List of collection in the databasses " # allcollection=db.list_collection_names() # ...
Python
1
mut self, state: &mut State<T>, a: u8) { self.step(state, a); self.tb.add_state(state.clone()); } /// Calculate the global distance of the pattern to the given text. pub fn distance<C, I>(&self, text: I) -> T::DistType where C: Borrow<u8>, I: IntoIterator<Item = C>, ...
Rust
0
# Import libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns # Load dataset df = pd.read_csv("enhanced_anxiety_dataset.csv") # Display basic info print(df.info()) print(df.head()) # Check missing values print(df.isnull().sum()) # Fill or drop missing values based o...
Python
1
{ 1 } else { 0 }); }) } unsafe fn force_window_active(handle: HWND) { // In some situation, calling SetForegroundWindow could not bring up the window, // This is a little hack which can "steal" the foreground window permission // We only call this function in the window creation, so it should be fine....
Rust
0
inline(always)] pub fn avg_8_msrmt(self) -> &'a mut W { self.variant(ADSEL2_A::AVG_8_MSRMT) } #[doc = "Average in 16 measurements in the accumulate divide module for this slot."] #[inline(always)] pub fn avg_16_msrmts(self) -> &'a mut W { self.variant(ADSEL2_A::AVG_16_MSRMTS) } ...
Rust
0
โ™ฅ+0b1010"); } #[test] fn test_octal() { let a = BigUint::parse_bytes(b"A", 16).unwrap(); let hello = BigUint::parse_bytes("22405534230753963835153736737".as_bytes(), 10).unwrap(); assert_eq!(format!("{:o}", a), "12"); assert_eq!(format!("{:o}", hello), "22062554330674403566756233062041"); assert_e...
Rust
0
"problems": story_elements.get("theme", ""), "resolutions": "์šฉ๊ธฐ์™€ ์ง€ํ˜œ๋กœ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐ" }) # Progress callback if progress_callback: await progress_callback({"step": "multimedia_generation", "status": "starting"}) # Generate ...
Python
1
s /// means the range of dates that timestamps can represent is ~1677 AD /// to 2262 AM /// /// /// ## Timezone / Offset Handling /// /// Numerical values of timestamps are stored compared to offset UTC. /// /// This function intertprets strings without an explicit time zone as /// timestamps with offsets of the local ...
Rust
0
"MMC Receive Interrupt Register"] pub mod mmc_receive_interrupt; #[doc = "MMC_TRANSMIT_INTERRUPT register accessor: an alias for `Reg<MMC_TRANSMIT_INTERRUPT_SPEC>`"] pub type MMC_TRANSMIT_INTERRUPT = crate::Reg<mmc_transmit_interrupt::MMC_TRANSMIT_INTERRUPT_SPEC>; #[doc = "MMC Transmit Interrupt Register"] pub mod mmc...
Rust
0
tTableName': KNN_TEST_TABLE, 'trainTableName': odps.project + '.' + TEMP_TABLE_PREFIX + '_split', 'predictTableName': odps.project + '.' + TEMP_TABLE_PREFIX + '_split', 'predictFeatureColNames': ','.join('a%02d' % i for i in range(1, 35))})) predicted.persist(KNN_TEST_TABLE) @ci_skip_ca...
Python
1
cell); // } } pub fn update_oil(cell: Cell, mut api: SandApi) { let rb = cell.rb; let (dx, dy) = api.rand_vec(); let mut new_cell = cell; let nbr = api.get(dx, dy); if rb == 0 && nbr.species == Species::Fire || nbr.species == Species::Lava || (nbr.species == Species::Oil && nb...
Rust
0
await interceptor.run_passive_interception() elif choice == "2": results = await interceptor.run_active_interception() else: logger.error("Invalid choice") return if results: print(f"\nInterception completed!") print(f"Total messages intercepted: {results['total_inte...
Python
1
# ----------------------------------------------------------------------------- # Copyright (c) 2008 by David P. D. Moss. All rights reserved. # # Released under the BSD license. See the LICENSE file for details. # ----------------------------------------------------------------------------- """A basic implementati...
Python
1
= "OPEN")] pub enum RAB_SetupOrModifyList_Entry_EntryFirstValue { #[asn(key = 53)] Id_RAB_SetupOrModifyItem(RAB_SetupOrModifyItemFirst), } #[derive(Debug, AperCodec)] #[asn(type = "OPEN")] pub enum RAB_SetupOrModifyList_Entry_EntrySecondValue { #[asn(key = 53)] Id_RAB_SetupOrModifyItem(RAB_SetupOrModif...
Rust
0
#!/usr/bin/env python3 # SPDX-License-Identifier: MIT import sys, pathlib sys.path.append(str(pathlib.Path(__file__).resolve().parents[1])) from m1n1.setup import * from m1n1.find_regs import * from m1n1 import asm p.iodev_set_usage(IODEV.FB, 0) if u.mrs(SPRR_CONFIG_EL1): u.msr(GXF_CONFIG_EL12, 0) u.msr(SPRR...
Python
1
import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.optimizers import Adam from sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score from sklearn.m...
Python
1
lt}, ensure, sp_runtime::{ offchain as rt_offchain, offchain::{ storage::StorageValueRef, storage_lock::{BlockAndTime, StorageLock}, }, traits::AccountIdConversion, traits::SaturatedConversion, ModuleId, }, traits::{Currency, Existe...
Rust
0
1); }); } let mut filtered: Vec<String> = Vec::new(); for i in answer { filtered.push(project_keys[i].clone()); } if db.set(PROMPT_BB_PROJECT_SOME.db_key, &filtered).is_err() { eprintln!( "Failed writing value {} to prickle db", PROMPT_BB_PROJECT_S...
Rust
0
a, kappa)) b.Assemble() # 8. Define the solution vector x as a parallel finite element grid function # corresponding to fespace. Initialize x with initial guess of zero. x = mfem.ParGridFunction(fespace) x.Assign(0.0) # 9. Set up the bilinear form a(.,.) on the finite element space # corresponding to the Laplac...
Python
1
ces, components and systems in a /// world. /// /// Note that all components and resources need to be registered in the world before they /// can be referenced in a system or in the state. /// /// This bundle prepares the world for the space_shooter game. pub struct GameBundle; impl<'a, 'b> SystemBundle<'a, 'b> for Ga...
Rust
0
#!/usr/bin/env python #Python program that runs through the files in 'YeastGenes' folder and searches for the consensus sequence of MA0279.1(CAD1). #MA0279.1(CAD1) is a basic leucine zipper factor import fileinput import os import os.path from os import path import re #Reads in seqeunces as elements in list # header ...
Python
1
initSlice<'a> { /// Creates a new `MaybeUninitSlice` wrapping a byte slice. /// /// # Panics /// /// Panics on Windows if the slice is larger than 4GB. pub fn new(buf: &'a mut [MaybeUninit<u8>]) -> MaybeUninitSlice<'a> { MaybeUninitSlice(socket2::MaybeUninitSlice::new(buf)) } //...
Rust
0
)); let (tx, mut rx) = async_channel::bounded(10); let config2 = config.clone(); thread::spawn(move || { packetstream(config2.payload_size, config2.count, tx) ; }); let mut acked = 0; let mut sent = 0; let start = Instant::now(); let mut blocked_count = 0; 'main: loop { ...
Rust
0
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: akash/market/v1beta4/genesis.proto # Protobuf Python Version: 4.25.2 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool fr...
Python
1
# Copyright (c) Mathias Kaerlev 2012. # This file is part of Anaconda. # Anaconda 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 option) any later version. # ...
Python
1
0, CursorPosition::InSpace(Some(_), _) => true, CursorPosition::InSpace(None, _) => false, CursorPosition::OnWordLeftEdge(i) => i >= 1, CursorPosition::OnWordRightEdge(i) => i >= 1, }; if filename { ...
Rust
0
from flask import render_template, request, url_for from CTFd.admin import admin from CTFd.models import Challenges, Submissions from CTFd.utils.decorators import admins_only from CTFd.utils.helpers.models import build_model_filters from CTFd.utils.modes import get_model @admin.route("/admin/submissions", defaults={...
Python
1
OneToMany(OneToManyRelationFields::Forward(evidence.field_id)), } } }; let relation = Relation { r#type: relation_type, relation_name: evidence.relation_field.name, }; let relation_idx = relations.relations_storage.len(); relations.relations_storage.push(relati...
Rust
0
"""empty message Revision ID: 95ede8ef731d Revises: Create Date: 2025-03-06 08:40:01.301249 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '95ede8ef731d' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
Python
1
<'a>) -> &'b Self { prop } fn take(prop: ElemProp<'a>) -> Self { prop } } impl<'a> PropMatcher<'a> for Directive<'a> { fn get_name_and_exp(prop: &ElemProp<'a>) -> NameExp<'a> { if let ElemProp::Dir(Directive { name, expression, .. }) = prop { ...
Rust
0
query_expansion_count=3 ) # Mock components with patch('knowledge_core_engine.core.generation.generator.create_llm_provider') as mock_llm, \ patch('knowledge_core_engine.core.embedding.embedder.TextEmbedder') as mock_embed_class: mock_llm_prov...
Python
1
from pysb.core import Initial, Model, Monomer, Parameter, Rule from pysb.testing import with_model from pysb.util import alias_model_components, rules_using_parameter def test_alias_model_components(): """ Tests that alias_model_components() exports to the global namespace """ m = Model(_export=False)...
Python
1
z0 + 1 ); let (u, v, w) = ( (x % NOISE_FACTOR_X) as f64 / NOISE_FACTOR_X as f64, (y % NOISE_FACTOR_Y) as f64 / NOISE_FACTOR_Y as f64, (z % NOISE_F...
Rust
0
Error { fn from(err: ParsePbError) -> Self { Self::ParsePbError(err) } } impl From<EncodeError> for IrError { fn from(err: EncodeError) -> Self { Self::PbEncodeError(err) } } impl From<ExprError> for IrError { fn from(err: ExprError) -> Self { Self::ParseExprError(err) ...
Rust
0
Self::B73 => "%73", Self::B74 => "%74", Self::B75 => "%75", Self::B76 => "%76", Self::B77 => "%77", Self::B78 => "%78", Self::B79 => "%79", Self::B80 => "%80", Self::B81 => "%8...
Rust
0
import ast from pathlib import Path import pytest # locate server src dynamically to avoid hardcoded layout assumptions ROOT = Path(__file__).resolve().parents[1] candidates = [ ROOT / "MCPForUnity" / "UnityMcpServer~" / "src", ROOT / "UnityMcpServer~" / "src", ] SRC = next((p for p in candidates if p.exists...
Python
1
import os print("Archivos actuales:", os.listdir())
Python
1
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
Python
1
็ตๅˆฐๆ•ฐ็ป„ if sprite.z_order() < sprites[i].z_order() { sprites.insert(i, sprite); return; } } } //็ฒพ็ต็š„zOrderๆ˜ฏๆœ€้ซ˜็š„๏ผŒๆ”พๅ…ฅVec็š„ๆœซๅฐพ sprites.push(sprite); } fn draw_sprites(&mut self) { //็ป˜ๅˆถๆ‰€ๆœ‰็š„็ฒพ็ต for spri...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ MySQLๅˆฐPostgreSQLๆ•ฐๆฎๅŒๆญฅ่„šๆœฌ ่ฏฅ่„šๆœฌ็”จไบŽๅฎšๆœŸๅฐ†MySQLไธญ็š„ไธšๅŠกๆ•ฐๆฎๅŒๆญฅๅˆฐPostgreSQLๆ•ฐๆฎไป“ๅบ“ไธญ๏ผŒ็”จไบŽๆ•ฐๆฎๅˆ†ๆžใ€‚ ๆ”ฏๆŒๅขž้‡ๅŒๆญฅๅ’Œๅ…จ้‡ๅŒๆญฅไธค็งๆจกๅผใ€‚ """ import os import sys import time import json import logging import argparse from datetime import datetime, timedelta import pymysql import psycopg2 import pandas as pd from sqla...
Python
1
Args: mean (np.ndarray): The predicted state's mean vector (8 dimensional). covariance (np.ndarray): The state's covariance matrix (8x8 dimensional). measurement (np.ndarray): The 4 dimensional measurement vector (x, y, a, h), where (...
Python
1
# Copyright 2022 Sony Group Corporation. # # 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
from Crypto.PublicKey import ECC from Crypto.Signature import DSS from Crypto.Hash import SHA256 def get_signed_certificate(subject_name, pubkey, ca_privkey): signer = DSS.new(ca_privkey, 'fips-186-3') tbs = f'SUBJECT={subject_name}\n{pubkey.export_key(format="PEM")}' signature = signer.sign(SHA256.new(tbs...
Python
1
#!/usr/bin/env python3 # /// script # requires-python = ">=3.10" # dependencies = [ # "msgpack", # ] # /// """Test MessagePack format for AudioChunk.""" import msgpack import uuid import time from datetime import datetime, timezone # Test different message formats def test_formats(): chunk_id = str(uuid.uuid4()...
Python
1
e.block( e.tuple().push(e.int(1, 28)).push(e.int(2, 31)).build() ).build_body(fun); fun }; let hir = { let hir = env.hir(); let add = env.item_id(5, 3); let fun = { let (i, td) = (hir.item(), hir.type_modul...
Rust
0
ernal framebuffer"] #[doc = "\\param efbHeight height of embedded framebuffer"] #[doc = "\\param xfbHeight height of external framebuffer"] #[doc = "\\param viXOrigin x starting point of first pixel to draw on VI"] #[doc = "\\param viYOrigin y starting point of first pixel to draw on VI"] #[doc = "\\param viWidth width...
Rust
0
(); let start_pos = Pos { x: 0, y: 0 }; visited.insert((start_pos, Torch), 0); to_eval.insert((start_pos, Torch, 0)); let tool_valid = |rt: &RegionType, t: &Tool| { match (rt, t) { (Rocky, Neither) => false, (Wet, Torch) => false, ...
Rust
0
from fastapi import APIRouter, Depends, HTTPException from sqlalchemy.orm import Session from typing import List from app import crud, models, schemas from app.api import deps router = APIRouter() @router.post("/", response_model=schemas.Submission) def create_submission( submission: schemas.SubmissionCreate, ...
Python
1
::new_plain("foo"))); let baz_node = graph_editor.add_node_below(node3_id); graph_editor.set_node_expression.emit((baz_node,Expression::new_plain("baz"))); let (_, baz_position) = graph_editor.node_position_set.value(); let styles = StyleWatch::new(&scene.style_sheet); let min_spacing = style...
Rust
0
iggers.push(self); Ok(()) } } //! <https://www.codewars.com/kata/5a81b78d4a6b344638000183/train/rust> use std::collections::HashMap; pub fn conjugate(verb: &str) -> HashMap<String, Vec<String>> { let mut verb_bytes = verb.bytes(); let mut base = Vec::with_capacity(verb.len() + 2); base.extend...
Rust
0
} } gen_query_file_id_fns!(); gen_query_execute_non_failable_with_cost_check!( Option<Vec<u8>>, FileGetContents, (|res: services::FileGetContentsResponse| { match res.file_contents { Some(v) => Some(v.contents), None => None, ...
Rust
0
ncies] //! google-blogger3 = "*" //! # This project intentionally uses an old version of Hyper. See //! # https://github.com/Byron/google-apis-rs/issues/173 for more //! # information. //! hyper = "^0.10" //! hyper-rustls = "^0.6" //! serde = "^1.0" //! serde_json = "^1.0" //! yup-oauth2 = "^1.0" //! ``` //! //! ## A ...
Rust
0
is the original value. #[inline(always)] pub fn write_customized_deep_clone<CallbackError, DeepCloneCallback: FnOnce(*mut Value, &CtoPoolArc, &Value) -> Result<(), CallbackError>>(&self, deep_clone_callback: DeepCloneCallback) -> Result<ReadCopyUpdateLockWriteGuard<Value>, CallbackError> { let guard = self.write_...
Rust
0
] fn map_header_and_json_to_block_header_info( header: BlockHeaderWithHash, json_data: BlockJsonData, chain_id: &ChainId, ) -> BlockHeaderInfo { BlockHeaderInfo::new(&header, &json_data, chain_id) } <filename>tests/runtimes/simple-keyvalue/src/types.rs //! Test runtime types. use std::io::Cursor; use b...
Rust
0
import cProfile import math import contextlib # Avoid this def slow_func(): for i in range(100000): with contextlib.redirect_stdout(None): print(math.sin(math.pi / 3)) # Instead, do this def fast_func(): a = math.sin(math.pi / 3) for i in range(100000): with contextlib.redirect...
Python
1
ning(String::from("w4")); let formatter = ActionResultFormatter::new( vec![&action_results_1, &action_results_2], vec![String::from("trigger1"), String::from("trigger2"), String::from("trigger3")], ); assert_eq!(warnings, formatter.to_warnings()); } } <gh_stars>0 us...
Rust
0
from __future__ import absolute_import, print_function, division import numpy import theano.sandbox.cuda as cuda import theano.misc.pycuda_init if not theano.misc.pycuda_init.pycuda_available: # noqa from nose.plugins.skip import SkipTest raise SkipTest("Pycuda not installed. Skip test of theano op with pycu...
Python
1
170312.models.ComputeNodeMetrics` """ return self._ComputeNodeMetrics @ComputeNodeMetrics.setter def ComputeNodeMetrics(self, ComputeNodeMetrics): self._ComputeNodeMetrics = ComputeNodeMetrics @property def EnvType(self): r"""่ฎก็ฎ—็Žฏๅขƒ็ฑปๅž‹ :rtype: str """ ...
Python
1
let s = send_mpst_2_to_6(x.clone(), s); let (y, s) = recv_mpst_2_from_6(s)?; let x = crate::zip_with(x, y, |x, y| x + y); let (y, s) = recv_mpst_2_from_0(s)?; let s = send_mpst_2_to_0(x.clone(), s); let x = crate::zip_with(x, y, |x, y| y - x); let s = send_mpst_2_to_3(x.clone(), s); le...
Rust
0
# customize string representations of objects class myColor(): def __init__(self): self.red = 50 self.green = 75 self.blue = 100 # use getattr to dynamically return a value def __getattr__(self, attr): if attr == "rgbcolor": return (self.red, self.green, self.b...
Python
1
ing!"); b.iter(|| { if let Some(found) = pattern.match_against("$$$$") { test::black_box(&found); } }); } //! Additional features for the Rust standard library. //! //! ## Description //! //! This crate contains enhancements to the Rust standard library types, useful for //! broad a...
Rust
0
SHADER_SYSTEM_API_NAME: &'static [u8; 21usize] = b"tm_shader_system_api\0"; pub const TM_SHADER_API_NAME: &'static [u8; 14usize] = b"tm_shader_api\0"; pub const TM_SHADER_REPOSITORY_INSTANCE_NAME: &'static [u8; 23usize] = b"tm_shader_repository_o\0"; pub const TM_SHADER_REPOSITORY_API_NAME: &'static [u8; 25usize] = ...
Rust
0
# Plots a matrix as heatmap using seaborn. import os import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import matplotlib matplotlib.use('Agg') # If the algorithm was timed out or no true graph was provided in benchmark_setup. if (os.stat(snakemake.input["adjmat_true"]).st_size == 0) or (os.sta...
Python
1
n(mismatches[0]) > 20: print(" ... (truncated)") # ------------------------------------- # ๆต‹่ฏ•็”จไพ‹ # ------------------------------------- test_configs = [ { "real_bsz": 4, "max_draft_tokens": 3, "max_seq_len": 30, "max_candidate_len": 4, "verify_window": 2, ...
Python
1
import settingsPreparacion as settings from utils.entradaSalida import cargaParametrosConfiguracionYAML, cargaImagen from utils.utilidadesDirectorios import buscaFicheroMismoNombreBase from utils.procesadoXML import getListaBndbox from utils.graficosImagenes import dibujaRectangulos, creaListaRectangulos from utils.dia...
Python
1
from typing import List # Time: O(n*m) # Space: O(n) class Solution: def timeRequiredToBuy(self, tickets: List[int], k: int) -> int: time = 0 # Tracks the total time (seconds) taken # Keep looping until the person at index 'k' has no tickets left while True: # Iterate...
Python
1
]) { break; } i += 1u; } } /// Iterates over the chars in a string #[inline(always)] pub pure fn each_char(s: &str, it: fn(char) -> bool) { each_chari(s, |_i, c| it(c)) } /// Iterates over the chars in a string, with indices #[inline(always)] pub pure fn each_chari(s: &str, it: fn(uint, char) -> bool)...
Rust
0
// They are not equal because name has been changed. assert_ne!(redacted_bson, bson_data_copy); } use crate::transport; use crate::types as pt; use crate::validate::Validate; use xsd_types::types as xs; // The service capabilities reflect optional functionality of a service. // The information is static and does n...
Rust
0
from secret import FLAG, secret_key ct = b'' for i in range(len(FLAG)): ct += bytes([FLAG[i] ^ secret_key[i % len(secret_key)]]) print(f"{ct = }")
Python
1
batch_size, sequence_length, hidden_size = hidden_states.size() if self.config.mask_time_prob > 0: mask_time_indices = _compute_mask_indices( (batch_size, sequence_length), self.config.mask_time_prob, self.config.mask_time_leng...
Python
1
1)); } }use std::fmt::{Debug, Display, Formatter, Result as FmtResult}; use toml::value::Datetime; #[derive(Clone, Debug, PartialEq, PartialOrd)] pub struct Ident(String); impl<'a> From<&'a str> for Ident { fn from(s: &'a str) -> Self { Ident(s.to_owned()) } } impl From<String> for Ident { f...
Rust
0
mod_op!(Mul, mul, *); macro_rules! impl_mod_assign { ($trait: ident, $output_trait: ident, $function: ident, $op: tt) => { impl<T> $trait<T> for ModInt<T> where T: Copy, ModInt<T>: $output_trait<T, Output = ModInt<T>> { fn $function(&mut self, other: T) {...
Rust
0
class Ingresso: def __init__(self): self.__dia = "dom" self.__horario = 0 def set_dia(self, dia): dias = ["dom", "seg", "ter", "qua", "qui", "sex", "sab"] if dia in dias: self.__dia = dia else: raise ValueError() def set_horario(self, horario): if 0 <= horario <...
Python
1
import json try: with open("todos.json", "r", encoding="utf-8") as f: todos = json.load(f) except FileNotFoundError: todos = [] start = 10 while start != "0": print(f"TODO LIST \n ======================================= \n") for i, todo in enumerate(todos, start=1): print(f"{i}. ...
Python
1
port: TransportType, pub is_pub: bool, } // PEER_ID_LENGTH + SOCKET_ADDR_LENGTH + 2 = 20 + 18 + 2 = 40 pub const PEER_LENGTH: usize = 40; impl Peer { /// create peer. pub fn new(id: PeerId, socket: SocketAddr, transport: TransportType, is_pub: bool) -> Self { Self { id, soc...
Rust
0
ize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub enum Status { Created, Offered, Accepted, Locked, InitRedeem, Redeem, RedeemSecondary, Completed, Refunded, Cancelled, } impl fmt::Display for Status { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let disp = match &se...
Rust
0
_ON_BEHALF_SIGNER_RECEIPT_TEMPLATE_ID" # let the person who has been signed on behalf of know. _send_notification( current_app.config["MOU_SIGNED_ON_BEHALF_ON_BEHALF_RECEIPT_TEMPLATE_ID"], organisation.agreement_signed_on_behalf_of_email_address, personalisation, ...
Python
1
return self._log_dir @log_dir.setter def log_dir(self, val: str): _type_check(val, str) import os if not os.path.exists(val): os.makedirs(val) self._log_dir = val @property def use_circuit_cache_during_testing_with_encryption(self) -> bool: """ ...
Python
1
def perform_operation(num1, num2, operation): if operation == "add": return num1 + num2 elif operation == "subtract": return num1 - num2 elif operation == "multiply": return num1 * num2 elif operation == "divide": if num2 == 0: print("zero cant divide") ...
Python
1
''' ํ’€์ด - ์ค‘๋ณต๋˜๋Š” triplet์„ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด ๋ฐฐ์—ด nums๋ฅผ ์ •๋ ฌํ•ฉ๋‹ˆ๋‹ค - nums๋ฅผ ์ˆœํšŒํ•˜๋ฉฐ ์ด์ค‘ ๋ฐ˜๋ณต๋ฌธ์„ ์ˆ˜ํ–‰ํ•˜์—ฌ res ๋ฐฐ์—ด์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค - ์ค‘๋ณต๋˜๋Š” triplet์„ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด appended set์„ ์ด์šฉํ•ฉ๋‹ˆ๋‹ค Big O - N: ๋ฐฐ์—ด nums์˜ ํฌ๊ธฐ - Time complexity: O(N^2) - nums๋ฅผ ์ •๋ ฌํ•˜๋Š”๋ฐ ๊ฑธ๋ฆฌ๋Š” ์‹œ๊ฐ„์€ NlogN ํ˜•ํƒœ๋กœ ์ฆ๊ฐ€ํ•ฉ๋‹ˆ๋‹ค - ์ด์ค‘ ๋ฐ˜๋ณต๋ฌธ์„ ์‹คํ–‰ํ•˜๋Š”๋ฐ ๊ฑธ๋ฆฌ๋Š” ์‹œ๊ฐ„์€ N^2 ํ˜•ํƒœ๋กœ ์ฆ๊ฐ€ํ•ฉ๋‹ˆ๋‹ค - O(NlogN + N^2)์—์„œ ์ฆ๊ฐ€์œจ์ด ๊ฐ€์žฅ ํฐ ํ•ญ์€ N^2์ด๋ฏ€๋กœ ์‹œ๊ฐ„๋ณต์žก๋„๋Š” O(N^2)์ด๋ผ๊ณ  ๋ณผ ์ˆ˜ ...
Python
1
#!/usr/bin/env python3 """ SRLP Framework - Run Evaluation with PDF Report Generation Combines framework evaluation with automatic PDF report generation. """ import os import sys import argparse from typing import List, Optional # Add current directory to path sys.path.append(os.path.dirname(os.path.abspath(__file__)...
Python
1
import os from dotenv import load_dotenv load_dotenv() class Config: OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") FETCHAI_SDK_KEY = os.getenv("FETCHAI_SDK_KEY") GOOGLE_SCHOLAR_API = os.getenv("GOOGLE_SCHOLAR_API") CROSSREF_API_KEY = os.getenv("CROSSREF_API_KEY") PINECONE_API_KEY = os.getenv("PINEC...
Python
1
configs .first() .into_result() .map_err(|_| failure::err_msg("No device configs found"))? .open()? }, diode_current_limit_ma: 40.0, current_shunt_ohms: 101.0, bias_limiter_ohms: 100_000.0, ...
Rust
0
: &ToCircuitMessagePayload) -> Result<(), Self::Error> { messages::source::verify_chain_message::<WithCircuitMessageBridge>(payload) } fn verify_messages_delivery_proof( proof: Self::MessagesDeliveryProof, ) -> Result<(LaneId, InboundLaneData<bp_circuit::AccountId>), Self::Error> { ...
Rust
0
")).join(LIB_NAME); Self::new_from_path(path.to_str().unwrap()) //let path1 = shared_lib(); } // // Create from a given RustFFI pointer. This allows users to link with a static // version of Rute instead of using the dynamic one // //fn new_from_ffi(ffi: *const ffi::RuteFFI) {...
Rust
0
: Vec3, /// The normal vector to the surface that got hit. pub normal: Vec3, /// How far along the ray the surface was hit. pub t: f32, /// Whether or not the hit was on the front face of the surface. pub front_face: bool, /// The material that got hit. pub material: Arc<Material>, /...
Rust
0