text
string
label_name
string
labels
int64
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # # 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 limita...
Python
1
["x_dotdot", "theta"] = (low * dhigh - high * dlow) / low**2 jacobian["x_dotdot", "theta_dot"] = ( -2.0 * theta_dot * lpole**2 * mp * np.sin(theta) / (mp * lpole * np.cos(theta) ** 2 - lpole * mc - lpole * mp) ) jacobian["x_dotdot", "f"] = -lpole / (mp * lpole * np.cos(theta) ** 2 - ...
Python
1
#!/usr/bin/env python3 """ 验证偏好设置是否真正影响搜索结果的针对性 """ import asyncio import sys import os # 添加项目目录到路径 sys.path.append(os.path.dirname(os.path.abspath(__file__))) from core.database import SessionLocal, create_tables from models.user import User from models.preference import Preference from models.recommendation import ...
Python
1
from nose.tools import * from mock import MagicMock, patch import elasticsearch from annotator.elasticsearch import ElasticSearch, _Model class TestElasticSearch(object): def test_conn(self): es = ElasticSearch() es.host = 'http://127.0.1.1:9202' es.index = 'foobar' assert_true(i...
Python
1
#!/usr/bin/python -u import sys import libxml2 #memory debug specific libxml2.debugMemory(1) called = "" def foo(ctx, x): global called # # test that access to the XPath evaluation contexts # pctxt = libxml2.xpathParserContext(_obj=ctx) ctxt = pctxt.context() called = ctxt.function() ...
Python
1
def save_combined_dose_response(): df1 = load_single_dose_response(combo_format=True, fraction=False) df2 = load_combo_dose_response(fraction=False) df = pd.concat([df1, df2]) df.to_csv('combined_drug_growth', index=False, sep='\t')
Python
1
unsqueeze(2) output = ( w_y0_x0 * i_y0_x0 + w_y0_x1 * i_y0_x1 + w_y1_x0 * i_y1_x0 + w_y1_x1 * i_y1_x1 ) # output is B*N x C output = output.view(B, -1, C) output = output.permute(0, 2, 1) # output is B x C x N if return_inbounds: x_valid = (x > -0.5).byte() & (x < float(W_f...
Python
1
Debug, Default, Deserialize, Serialize, PartialEq)] #[serde(deny_unknown_fields)] pub struct AssemblyInputBundle { /// The Image Assembly's ProductConfiguration is most of the fields here, so /// it's re-used to gain access to the methods it has for merging. #[serde(flatten)] pub image_assembly: image_a...
Rust
0
import rclpy from rclpy.node import Node from rclpy.publisher import Publisher from yolo_msgs.msg import Detection, DetectionArray class SubjugatorCentroidsNode(Node): def __init__(self): super().__init__("subjugator_centroids_node") self.topics: dict[int, Publisher] = {} self._tracking_s...
Python
1
import math import torch from torch import nn import torch.functional as F # batch time dimension x = torch.randn(128, 64, 512) d_model = 512 # 多头注意力机制 n_head = 8 class multi_head_attention(nn.Module): def __init__(self, d_model, n_head): super(multi_head_attention, self).__init__() self.d_mode...
Python
1
+ 3 + 64); res.put_u8(8); let len_pos = res.len(); res.put_u8(0); res.put_u16_le(0); res.put_slice(&signature.serialize_compact(&self.secp_ctx)); coinbase_prefix_postfix.encode_unsigned(res); if !le24_into_slice(res.len() - len_pos - 3, &mut res[len_pos..len_pos + 3]) { return Err(i...
Rust
0
From<vks::vk::VkResult> for EarlyInstanceError { fn from(res: vks::vk::VkResult) -> Self { EarlyInstanceError::VulkanError(res.into()) } } impl fmt::Display for EarlyInstanceError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { EarlyInstanceError::LoadLib...
Rust
0
self.to_glib_none_mut().0, )) } } pub fn get_line_yrange(&mut self) -> (i32, i32) { unsafe { let mut y0_ = mem::MaybeUninit::uninit(); let mut y1_ = mem::MaybeUninit::uninit(); pango_sys::pango_layout_iter_get_line_yrange( ...
Rust
0
malized coordinates [-1, 1]) (original parameter space) Returns ------- local_sens: ndarray [n_points x n_out x dim] Local sensitivity of output quantities in point x """ if x is None: x = np.zeros(self.problem.dim)[np.newaxis, :] # ...
Python
1
_BUFSIZE: usize = 4096; struct Worker { interrupt: Interrupt, queue: Queue, mem: GuestMemory, queue_evt: Event, kill_evt: Event, device: Device, } struct Device { simulator: tpm2::Simulator, } impl Device { fn perform_work(&mut self, mem: &GuestMemory, desc: DescriptorChain) -> Result...
Rust
0
L DEFAULT 0, -- Size in blocks blocks INT8 NOT NULL DEFAULT 0, -- Time of last access atime TIMESTAMP NOT NULL DEFAULT now(), -- Time of last modification mtime TIMESTAMP NOT NULL DEFAULT now(), -- Time of last change ctime TIMESTAMP NOT NULL DEFAU...
Rust
0
from enum import Enum from typing import Dict, List from ray._private.ray_constants import RAY_METRIC_CARDINALITY_LEVEL # Keep in sync with the WorkerIdKey in src/ray/stats/tag_defs.cc WORKER_ID_TAG_KEY = "WorkerId" # Keep in sync with the NameKey in src/ray/stats/metric_defs.cc TASK_OR_ACTOR_NAME_TAG_KEY = "Name" _...
Python
1
ject's terms. /// /// **Endpoint** `GET /api/v1/projects/{projectId}/terms` /// /// **Default model** [`Term`] /// /// # Examples /// ``` /// # use traduora::{Login, TestClient as Traduora, TraduoraError}; /// use chrono::{TimeZone, Utc}; /// use traduora::{api::terms::Terms, api::labels::Label, Query}; /// /// # let l...
Rust
0
rrors().into(); match errors[0].value.error { TypeError::UndefinedVariable(..) => true, _ => false, } } _ => false, } ...
Rust
0
import heapq def restricted_sorting(stacks, costs): # Helper function to get the most unsorted stack def get_most_unsorted_stack(unsorted_stacks): max_unsorted_stack = None max_unsorted_value = float('-inf') for stack in unsorted_stacks: colors = set(stack) if l...
Python
1
} assert_eq!( "[1]", format!("{:?}", Union { f1: 1 }) ); } #[test] #[allow(dead_code)] fn unnamed_3() { #[derive(Educe)] #[educe(Debug = "")] union Union { f1: u8, } assert_eq!( "[1]", format!("{:?}", Union { f1:...
Rust
0
translate = { "apple": "りんご", "banana": "バナナ", "cherry": "チェリー", } print(translate["apple"])
Python
1
This API requires the following crate features to be activated: `WebGlShaderPrecisionFormat`*"] pub type WebGlShaderPrecisionFormat; # [ wasm_bindgen ( structural , method , getter , js_class = "WebGLShaderPrecisionFormat" , js_name = rangeMin ) ] #[doc = "Getter for the `rangeMin` field of this object."] ...
Rust
0
ord(), Box::new(MappaMareR5::new(idx))), (SolarPearlR5::record(), Box::new(SolarPearlR5::new(idx))), (BlackcliffAgateR5::record(), Box::new(BlackcliffAgateR5)), (RoyalGrimoireR5::record(), Box::new(RoyalGrimoireR5)), (ThrillingTalesOfDragonSlayersR5::record(), Box::new(ThrillingTalesOfDragonSlayersR5::n...
Rust
0
-> T: f = BiEncoderNllLoss.get_similarity_function() return f(q_vector, ctx_vectors) @staticmethod def get_similarity_function(): return dot_product_scores @hydra.main(config_path="conf", config_name="biencoder_train_cfg") def main(cfg: DictConfig): if cfg.train.gradient_accumulati...
Python
1
#!/usr/bin/env python3 ''' Script de monitoreo del sistema ''' import psutil import time import json from datetime import datetime def monitor_system(): '''Monitorea el rendimiento del sistema''' print("📊 MONITOREO DEL SISTEMA") print("=" * 30) while True: # Información del sistema ...
Python
1
ame>src/test/compile-fail/liveness-issue-2163.rs fn main() { let a: ~[int] = ~[]; vec::each(a, fn@(_x: &int) -> bool { //~^ ERROR not all control paths return a value }); } <filename>src/test/codegen/swap-simd-types.rs // compile-flags: -O -C target-feature=+avx // only-x86_64 // ignore-debug: the d...
Rust
0
import random import torch import beignet from benchmarks._set_seed import set_seed class BenchEulerAngleMagnitude: params = [ [10, 100, 1000, 10000], [torch.float32, torch.float64], ] param_names = ["batch_size", "dtype"] def __init__(self): self.func = torch.compile( ...
Python
1
import multiprocessing as mp import heapq from src.utils import logger as app_logger from src.utils.env_utils import setup_project_root from typing import Dict app_logger.setup_logging() logger = app_logger.get_logger("GPUClientWorker") def gpu_manager(shutdown_event: mp.Event, request_queue: mp.Queue, worker_events:...
Python
1
mport paddle.distributed as dist >>> dist.init_parallel_env() >>> if dist.get_rank() == 0: ... data = ["hello", {"key": 100}, [1, 2, 3]] ... dist.send_object_list(data, dst=1) >>> else: ... data = [None] * 3 # type: ignore ...
Python
1
dp_model_to_save(inp) expected_model_sd = {k: v.cpu() for k, v in base_model.state_dict().items()} model_full_sd = utils.get_full_model_state_dict( fsdp_model_to_save, is_rank_zero ) if is_rank_zero: self.assertEqual(set(model_full_sd.keys()), set(expected_model_...
Python
1
// assert_eq! { t.val(), Some(val.clone()) } /// assert_eq! { t.typ(), typ::real() } /// assert_eq! { t.get(), & RTerm::Cst(val) } /// ``` #[inline] pub fn real<R: Into<Rat>>(r: R) -> Term { cst(val::real(r)) } /// Creates a real constant from a float. /// /// # Examples /// /// ```rust /// # use hoice::common::*; ...
Rust
0
import ctypes, sys from ctypes import POINTER, cast from comtypes import CLSCTX_ALL from pycaw.pycaw import AudioUtilities, IAudioEndpointVolume import asyncio def ensure_admin(): try: if not ctypes.windll.shell32.IsUserAnAdmin(): params = ' '.join(f'"{arg}"' for arg in sys.argv) ct...
Python
1
import streamlit as st import inspect def protein_structure_prediction(seq: str): """ Predict the structure of a protein sequence. Parameters: seq (str): Amino acid sequence of the protein. Returns: str: A message indicating the submission of the structure prediction. """ return f"Inp...
Python
1
орость 50 и поворот колес 1 радиан [5, rn(40,70), rn(-1,1)], [10, 0, 0] ] return robot, cs robot, cs=createRobot() goal = [500,400] while True: for ev in pygame.event.get(): if ev.type==pygame.QUIT: sys.exit(0) if ev.type==py...
Python
1
let d = zt.clone().mul(mul_factor).into_affine(); Ok(Proof { a: g_a.into_affine(), b: g2_b.into_affine(), c: g_c.into_affine(), delta_prime: delta_prime_g2, d: d, }) } fn calculate_coeff<G: AffineCurve>( initial: G::Projective, query: &[G], vk_param: G, ...
Rust
0
swagger20::SchemaKind::Ty(swagger20::Type::Object { additional_properties }) => Ok(format!("std::collections::BTreeMap<String, {}>", get_rust_type(&additional_properties.kind, map_namespace)?).into()), swagger20::SchemaKind::Ty(swagger20::Type::String { format: Some(swagger20::StringFormat::Byte) }) => Ok(for...
Rust
0
_base_ = [ '../_base_/models/MALA_retinanet.py', '../_base_/datasets/coco_detection.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] model = dict( backbone=dict( out_indices = (0, 1, 2, 3), embed_dims=[64, 128, 320, 512], depths=[3, 5, 9, 3], n...
Python
1
ed', types) def test_list_asset_history_nonexistent_asset(self): """Test listing history for non-existent asset""" url = reverse('asset:asset-history', kwargs={'asset_id': 99999}) response = self.client.get(url) self.assertEqual(response.status_code, status.HTTP_404_NOT...
Python
1
, 25), 2023: (SEP, 14), 2024: (SEP, 2), 2025: (AUG, 22), } SADIQ_BIRTHDAY_DATES = { 2001: (JUN, 10), 2002: (MAY, 30), 2003: (MAY, 19), 2004: (MAY, 7), 2005: (APR, 26), 2006: (APR, 16), 2007: (APR, 6), 2008: (MAR, 25), ...
Python
1
from django.db import models import uuid from django.contrib.auth.models import User # Create your models here. class NoteBook(models.Model): uuid = models.UUIDField(default=uuid.uuid4,editable=True,blank=True,null=True) date_field = models.DateField(auto_now_add=True,editable=True,blank=True,null=True) ...
Python
1
372007, 0.3505784 ], [-0.56419797, -0.33380045], [ 0.12883139, -0.59700755], [-1.24247838, -0.45829083], [-1.15131295, 0.59439388], [-0.07975814, -0.34732859], [ 1.30839788, -1.37452232], [-0.89490732, 0.97430895], [ 0.61539253, 0.57028098], [-0.1655175...
Python
1
ing(self,"Error","Error en el servidor",QMessageBox.StandardButton.Close, QMessageBox.StandardButton.Close) def registrar_usuario(self): self.new_user_form = RegistrarUsuarioView() self.new_user_form.show() def open_Main_Window(self)...
Python
1
2DBlD8zDBZ712DB c9oC2DBcSP2DBx1F1DBaRs2DBwff1DB/pm2DB cZQV3DBlDi2DB9oC2DBcSP2DBZQg2DBnEi2DB ccS67DBoFx2DB5QK4DBFDi2DBDXY6DB1Ny2DB cPfu/DBqGx2DBUNc9DBc9v2DBqGU+DBvJu2DB cmO1AEBjX82DB6bkAEBFD02DBzBiAEB3kR3DB cRrcBEBFDT2DBpbIBEBwKn2DBljEBEBMdN2DB ccSgCEBDX82DBsy0BEB9oY2DBvUFCEB+T92DB cwqlEE...
Rust
0
l_file.endswith(".txt"): continue # 修改帧号解析方式 frame_part = label_file.split("_camera_")[0] # 新解析方式 frame_idx = int(frame_part) # 现在得到正确帧号 # 初始化5个相机的掩码 masks = { "0": { # CAM_LEFT "all": np.zeros(self.HW, ...
Python
1
elf.sdk_configuration.security, models.Security ), ), request=req, error_status_codes=["400", "401", "403", "429", "4XX", "5XX"], retry_config=retry_config, ) if utils.match_response(http_res, "200", "*"): return if uti...
Python
1
, /// Timestamp. pub timestamp: DateTime<Utc>, /// Author. pub author: GhCommitUser, /// Committer. pub committer: GhCommitUser, /// Added. pub added: Vec<String>, /// Removed. pub removed: Vec<String>, /// Modified. pub modified: Vec<String>, } /// GitHub Branch. #[deri...
Rust
0
import sys import os from dotenv import load_dotenv load_dotenv() import os sys.path.insert( 0, os.path.abspath("../..") ) # Adds the parent directory to the system path import pytest from litellm import get_secret from litellm.proxy.secret_managers.aws_secret_manager import load_aws_secret_manager @pytest.mar...
Python
1
(1600, 400), deposit=1 ).assert_success(); call!( root, pool.swap( vec![SwapAction { pool_id: 1, token_in: usdt(), amount_in: Some(U128(to_yocto("1"))), token_out: eth(), min_amount_out: U128(1) ...
Rust
0
)[0] for x in X_test] predictions_custom = np.array(predictions_custom).reshape(-1, 1) # Inverse scale the predictions predictions_custom = scaler.inverse_transform(predictions_custom) # Create a DataFrame for comparison #test_results['Custom NumPy Predictions'] = predictions_custom.flatten() # Print RMSE for the cu...
Python
1
import numpy as np from UQpy.surrogates.gaussian_process.regression_models.baseclass.Regression import Regression class QuadraticRegression(Regression): def r(self, s): s = np.atleast_2d(s) fx = np.zeros( [np.size(s, 0), int((np.size(s, 1) + 1) * (np.size(s, 1) + 2) / 2)] ) ...
Python
1
ln!("Thanks a lot for donating that much money!"), Err(_) => println!("We could not process your donation"), } } // Copyright 2019 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use std::io; use std::mem; ...
Rust
0
operty def VirtualHost(self): return self._VirtualHost @VirtualHost.setter def VirtualHost(self, VirtualHost): self._VirtualHost = VirtualHost @property def QueueName(self): return self._QueueName @QueueName.setter def QueueName(self, QueueName): self._Queu...
Python
1
x] content += abspath + "\n" mw.writeFile(conf, content) def start(): initConf() lock_file = getLockFile() if not os.path.exists(lock_file): mw.writeFile(lock_file, "") import tool_task tool_task.createBgTask() return 'ok' return 'fail' def stop...
Python
1
no_repeat_ngram_size=3, do_sample=False, early_stopping=True, ) translation = tok.decode(output[0], skip_special_tokens=True, clean_up_tokenization_spaces=False) self.assertEqual(translation, new_truncated_translation) @slow def test_translation_en_to_r...
Python
1
""" Classifies: CHEBI:32876 tertiary amine """ """ Classifies: tertiary amine """ from rdkit import Chem from rdkit.Chem import AllChem def is_tertiary_amine(smiles: str): """ Determines if a molecule is a tertiary amine based on its SMILES string. A tertiary amine is a nitrogen atom bonded to three carbon...
Python
1
"""MagicDisplayManager テストケース Fowler Extract Classパターンで抽出されたクラスのテスト """ import pytest from unittest.mock import Mock from src.ui.window_system.magic_display_manager import MagicDisplayManager, SpellDisplayFormat from src.character.party import Party from src.character.character import Character from src.magic.spells...
Python
1
# Copyright (c) Opendatalab. All rights reserved. from io import BytesIO import pypdfium2 as pdfium from loguru import logger from PIL import Image from doculook.data.data_reader_writer import FileBasedDataWriter from doculook.utils.pdf_reader import image_to_b64str, image_to_bytes, page_to_image from .hash_utils imp...
Python
1
with open('txt/26_17643.txt') as file: n = int(file.readline()) products = {} average = [] for i in file: art, price, stat = map(int, i.split()) average.append(price) if art not in products: products[art] = [0, price, 0] if stat: products[art][2] +...
Python
1
t1=(1,2,3,2,6,2,4,5) print(t1) print(t1.index(4)) # index number
Python
1
from telegraph import upload_file from pyrogram import filters from CUTEXMUSIC import app from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton import asyncio from pyrogram.types import InputMediaPhoto BUTTON = InlineKeyboardMarkup( [ [ InlineKeyboardButton(text="ADD ME", url="h...
Python
1
ttime=4, src_node='1', dst_node='2') Flow(flowid=2, transmittime=5, src_node='2', dst_node='3') Flow(flowid=4, transmittime=7, src_node='3', dst_node='4') Flow(flowid=5, transmittime=5, src_node='4', dst_node='5') Flow(flowid=6, transmittime=2, src_node='3', dst_node='5') Flow(flowid=7, transmittime...
Python
1
} self } # [ doc = "Bits 6:7 - Data transfer direction" ] pub fn dir(&mut self, value: u8) -> &mut Self { const OFFSET: u8 = 6u8; const MASK: u8 = 3; self.bits &= !((MASK as u32) << OFFSET); self.bits |= ((value & MASK) as u32) << OFFSET; self } ...
Rust
0
rstd::fmt::Debug; // use primitives::{Blake2Hasher, H256}; use runtime_io::with_externalities; use support::{assert_noop, assert_ok}; // The testing primitives are very useful for avoiding having to work with signatures // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. #[allow(unus...
Rust
0
from agentmake import AGENTMAKE_USER_DIR, PACKAGE_PATH from agentmake.utils.handle_text import readTextFile import os system_path_1 = os.path.join(AGENTMAKE_USER_DIR, "systems", "styles", "british_english.md") system_path_2 = os.path.join(PACKAGE_PATH, "systems", "styles", "british_english.md") TOOL_SYSTEM = readText...
Python
1
is a ninth power. // // How many n-digit positive integers exist which are also an nth power? use euler::math::exp; use euler::util::error::*; use euler::util::problem::*; // For this problem, we're searching for all b^e=n for positive integers n. // This means we are trying to find values which satisfy: // // f...
Rust
0
"Answer contained wrong command class", )); } // get the meter type let (_, typ) = Meter::get_rate_meter_type(msg[5])?; // get the precission, scale and size let (precision, scale, size) = Meter::get_precision_scale_size(msg[6]); // check t...
Rust
0
///* /// Consensus throttle did not allow execution of this transaction. System is throttled at /// consensus level. ConsensusGasExhausted = 279, ///* /// A precompiled contract succeeded, but was later reverted. RevertedSuccess = 280, ///* /// All contract storage allocated to the c...
Rust
0
# Given an integer x, return true if x is a palindrome, and false otherwise. def is_palindrome(x): x = str(x) for i in range(0, len(x) // 2): if x[i] != x[len(x) - 1 - i]: return False return True print(is_palindrome(121)) print(is_palindrome(-212)) print(is_palindrome(10))
Python
1
import math import pandas def pd_read_csv(csv_path): df = pandas.read_csv(csv_path) # print(df) return df def fps_to_ms(fps: int) -> int: ''' Convert FPS to a millisecond interval. Args: fps: Input FPS as integer. Returns: Interval in milliseconds as integer number. ''...
Python
1
sparent)] pub struct FlowId(pub usize); #[derive(Debug, thiserror::Error)] pub enum Error { #[error("Source {0:?} is not found")] SourceNotFound(SmartString), #[error("Matcher {0:?} is not found")] MatcherNotFound(SmartString), #[error("Converter {0:?} is not found")] ConverterNotFound(SmartStr...
Rust
0
from random import randrange, randint from abc import abstractmethod, ABC class Display: @abstractmethod def update_display(self, temperature, pressure, humidity): pass class Observer(ABC): @abstractmethod def notify(self): pass class DisplayTemp(Display, Observer): def ...
Python
1
cted: HashSet<Position>, min_x: Scalar, min_y: Scalar, max_x: Scalar, max_y: Scalar, } impl Grid { fn new() -> Grid { Grid { infected: HashSet::with_capacity(STEPS), min_x: 0, min_y: 0, max_x: 0, max_y: 0, } } fn u...
Rust
0
reeType::Pine => "models/pine.billboards", }.to_owned() } fn generate(&self, context: &mut AssetLoadContext) -> Result<Self::Type, Error> { let model_files = self.ty.load(context)?; let mut lightbox = self.lightbox.lock().unwrap(); let mut encoder = self.encoder.lock().unwrap();...
Rust
0
t input_image = std::path::Path::new(matches.value_of("input_image").unwrap()); if !input_image.is_file() { eprintln!("\"{}\" is not a file", input_image.display()); return; } let file_stem = input_image.with_extension(""); let file_name = match file_stem.file_name().and_then(OsStr::to_s...
Rust
0
filter_pattern = kwargs.get("filter_pattern", "*") if not session_context: return ToolResult( success=True, output="No session context available", metadata={"files": [], "session_tracked": False}, ) try: files_...
Python
1
# -*- coding: utf-8 -*- """ Created on Thu Dec 5 20:38:41 2024 @author: mursh """ import sys import yaml import torch import torch.nn as nn import torch.nn.functional as F from torch_geometric.nn import BatchNorm, GCNConv sys.path.append('D:/ML/FaultDiagnosis/src/faultdiagdip94') yaml_file = 'D:/ML/FaultDiagnosis/sr...
Python
1
from __future__ import annotations from typing import Union from typing_extensions import Literal from abqpy.decorators import abaqus_class_doc, abaqus_method_doc from ..Connector.ConnectorSection import ConnectorSection from ..UtilityAndView.abaqusConstants import abaqusConstants as C from .TransverseShearBeam imp...
Python
1
// ``` // loadFunctions = LibraryFunctionLoad[ // "libwstp_example", // "load_wstp_functions", // LinkObject, // LinkObject // ]; // // $functions = loadFunctions["libwstp_example"]; // ``` wll::generate_loader!(load_wstp_functions); //====================================== // Using `&mut Link` //====...
Rust
0
} lowering_error! { program { #[auto] trait Foo { type Item; } } error_msg { "auto trait cannot define associated types" } } lowering_success! { program { #[auto] trait Send { } } } } ...
Rust
0
&[Token::Char('z', Category::Letter)]); } #[test] fn it_lexes_trigraphs_recursively() { assert_lexes_to( &["^^\u{001e}^:%"], &[Token::Char('z', Category::Letter)], ); } #[test] fn it_lexes_hex_trigraphs() { // ^^7a is a valid hex trigraph which ...
Rust
0
import logging as log # Configure logging log.basicConfig(level=log.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s', filemode='a', filename='main.log')
Python
1
new(self.proxy.index(index)) } } pub type ImmutableBidderList = ArrayOfImmutableAgentID; #[derive(Clone)] pub struct ArrayOfMutableAgentID { pub(crate) proxy: Proxy, } impl ArrayOfMutableAgentID { pub fn append_agent_id(&self) -> ScMutableAgentID { ScMutableAgentID::new(self.proxy.append()) } pub fn clear...
Rust
0
>(); } result.sort_by(|a, b| a.code.len().cmp(&b.code.len())); result } fn main() { let data = "this is an example for huffman encoding".to_string(); let sym2freq = count_frequency(&data); let table = get_huffman_code(&sym2freq); println!("Symbol | Weight | Huffman Code"); println!("======...
Rust
0
import sys input = sys.stdin.readline from itertools import combinations, permutations def count(): ma = 0 x=1 for i in range(n): for j in range(n-1): if arr[i][j] == arr[i][j+1]: x+=1 else: x=1 ma = max(x,ma) x=1 x=1 ...
Python
1
'pandžabi', 'sn': 'chiPunjabi', 'so': 'Bunjaabi', 'sq': 'punxhabisht', 'sr': 'пенџапски', 'sr-Cyrl': 'пенџапски', 'sr-Latn': 'pendžapski', 'sv': 'punjabi', 'sw': 'Kipunjabi', 'ta': 'பஞ்சாபி', 'te': 'పంజాబీ', 'teo': 'Kipunjabi', 'tg': 'панҷобӣ', 'th': 'ปัญจาบ', 'ti': 'ፑንጃቢ', 'tk': 'penjab dili', 'to': 'lea fakapūnusapi'...
Python
1
query_args.push(( "skip_duplicate_check".to_string(), skip_duplicate_check.to_string(), )); } if skip_merge_validation { query_args.push(( "skip_merge_validation".to_string(), skip_merge_validation.to_string(), ...
Rust
0
# 4)Contador de vocales: Crea un programa que solicite al usuario una cadena de texto y #cuente la cantidad de vocales presentes en la cadena. Imprime el resultado. cadena = input("Ingrese una cadena de texto: ").upper() contador = 0 for letra in cadena: # Chequear si la letra es una vocal if letra in ['A', 'E'...
Python
1
ialize, Deserialize, PartialEq, Debug, GraphQLEnum)] pub enum SamplingMode { UltraLowPower, Standard, HighRes, UltraHighRes, } #[derive(Copy, Clone, GraphQLObject, Serialize, Deserialize, PartialEq, Debug)] pub struct BMP085 { pub address: i32, pub mode: SamplingMode, } /// Direction and featu...
Rust
0
""" Configuration module for BaiduDriver SDK """ from .builtin import BaiduConfig, BuiltinConfig, WxPusherConfig from .constants import * # Create global configuration instance config = BuiltinConfig() __all__ = ["BuiltinConfig", "BaiduConfig", "WxPusherConfig", "config"]
Python
1
r""" :param _AccessGroupId: 权限组ID :type AccessGroupId: str """ self._AccessGroupId = None @property def AccessGroupId(self): return self._AccessGroupId @AccessGroupId.setter def AccessGroupId(self, AccessGroupId): self._AccessGroupId = AccessGro...
Python
1
t? if tick_start_time.duration_since(cpu_last_sample_time) > SAMPLE_EVERY { cpu_last_sample_value = cpu_percent_collector.cpu_percent().unwrap() as i32; cpu_last_sample_time = tick_start_time; } // Append point in data points (plus, trim to maximum size & clean expired p...
Rust
0
-> Result<(), io::Error> { let describe = (flags as u32) & fdio::fdio_sys::ZX_FS_FLAG_DESCRIBE != 0; let open_flags = flags & (!fdio::fdio_sys::ZX_FS_FLAG_DESCRIBE as i32); let mut status = zx::Status::OK; let mut proto = fdio::fdio_sys::FDIO_PROTOCOL_SERVICE; let mut handles: ...
Rust
0
""", (booking_id,)) booking = cursor.fetchone() if not booking: flash('Booking tidak ditemukan.', 'danger') return redirect(url_for('booking_list')) waktu_checkin = booking[0] durasi_hari = booking[1] harga_bayar_awal = booking[2] kode_kamar =...
Python
1
import gettext from Screen import Screen from Components.ActionMap import ActionMap from Components.Language import language from Components.config import config from Components.Sources.List import List from Components.Label import Label from Components.Pixmap import Pixmap from Screens.InfoBar import InfoBar from Scre...
Python
1
ut = (ctypes.wintypes.WCHAR * 5)() count = self._ToUnicodeEx( vk, scan, ctypes.byref(state), ctypes.byref(out), len(out), 0, layout) return out[0] if count > 0 else None def _reset_state(self, vk, layout, scan): """Clears the internal kernel keyboard state. ...
Python
1
from datetime import datetime from backend import db, login_manager from flask_login import UserMixin @login_manager.user_loader def load_user(user_id): return User.query.get(int(user_id)) class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(20), uni...
Python
1
from fastapi import APIRouter, HTTPException, Depends from fastapi.security import OAuth2PasswordRequestForm from models.user import UserToken, UserRegister from router.admin import admin_router from router.detect import detect_router from router.image import image_router from router.network import network_router from...
Python
1
xt ), result=str( calc.find("p", class_="op_new_val_screen_result") .find("span") .text ), ) ) # 加载相关搜索 if "related" not in exclude and related:...
Python
1
sition F | J | K | --------- */ let mut blend_xy: u8 = pre_proc_buffer[x as usize]; //for current (x, y) position set_bottom_r!(blend_xy, res.blend_f); //all four corners of (x, y) have been determined at this point due to processing sequence! set...
Rust
0