text
string
label_name
string
labels
int64
job::Job; use crate::lang::stream::{empty_channel, black_hole}; use crate::lang::execution_context::ExecutionContext; use crate::lang::help::Help; #[derive(Clone)] pub struct Closure { name: Option<Box<str>>, job_definitions: Vec<Job>, signature: Option<Vec<Parameter>>, env: Scope, short_help: Stri...
Rust
0
_general_transpose_rhs(*args, **rhs_kw_args) # We apply a Straight-Through Estimator (STE) with zero-out behavior: if # inputs are clipped during quantization in fprop, their corresponding gradients # are zeroed out; otherwise, they pass through unchanged. if configs[2].mode == "nvfp4": assert rhs.dtype ==...
Python
1
import time import numpy as np import pandas as pd import psutil import pywinauto from pywinauto.application import Application def get_wechat_pid(): pids = psutil.pids() for pid in pids: p = psutil.Process(pid) if p.name() == 'WeChat.exe': return pid return None def get_nam...
Python
1
rdWindowIndexer(window_size=window_size) result = df.groupby("a")["b"].rolling(window=indexer, min_periods=1).sum() result.index.names = ["a", "c"] groups = df.groupby("a")[["a", "b", "c"]] manual = concat( [ g.assign( b=[ g["b"].iloc[i : i + wind...
Python
1
commands.push(Command::Remove(ids)); Some(()) } pub fn swap_for(&self, namespace: &str, contents: &[&str]) -> Option<()> { let current_id = self.current_id.read().unwrap(); let mut commands = self.commands.write().unwrap(); let ids = contents.iter().filter_map(|x| self.search(namespace, x)).collect::<Vec<...
Rust
0
12}, 20: {'0': 13, '1': 8, '2': 11, '3': 11, '4': 11, '5': 10, '6': 12, '7': 10, '8': 12, '9': 12, 'a': 12, 'b': 12, 'c': 10, 'd': 12, 'e': 10, 'f': 7, 'g': 10, 'h': 12, 'i': 7, 'j': 6, 'k': 12, 'l': 6, 'm': 18, 'n': 12, 'o': 11, 'p': 12, 'q': 12, 'r': 10, 's': 9, 't': 7, 'u': 12, 'v': 10, 'w': 14, 'x': 12, 'y': 10, 'z...
Python
1
# Copyright (c) OpenMMLab. All rights reserved. import warnings from mmpose.registry import MODELS BACKBONES = MODELS NECKS = MODELS HEADS = MODELS LOSSES = MODELS POSE_ESTIMATORS = MODELS def build_backbone(cfg): """Build backbone.""" return BACKBONES.build(cfg) def build_neck(cfg): """Build neck."""...
Python
1
ric_names(): # Create a dummy LightningModule and a Trainer model = DummyLightningModule() class MockTrainer: def __init__(self, model): self.callback_metrics = {} self.model = model trainer = MockTrainer(model) # Set some dummy metrics in the Trainer trainer.c...
Python
1
itonally, one can also set powerful limits on their /// memory usage. #[derive(Debug, Clone)] pub struct MemController { base: PathBuf, path: PathBuf, v2: bool, } #[derive(Default, Debug, PartialEq, Eq)] pub struct SetMemory { pub low: Option<MaxValue>, pub high: Option<MaxValue>, pub min: Opti...
Rust
0
against the provided public /// key. // TODO(DFN-1408): Optimize signature verification by combining the miller // loops inside the pairings, thus performing only a single final // exponentiation. fn verify(message: &[u8], signature: Signature, public_key: PublicKey) -> Result<(), ()> { let point = hash_message_to_...
Rust
0
from django.http import JsonResponse from django.shortcuts import redirect, render from django.utils import timezone from capys.models import CapyPost from django.views.decorators.csrf import csrf_exempt import random def index(request): capy_posts = CapyPost.objects.order_by('-created_at') response = render(...
Python
1
let handle = Handle::new(object, Rights::DEFAULT_EXCEPTION); let msg = MessagePacket { data: info.pack(), handles: vec![handle], }; exception.set_rights(inner.thread_rights, inner.process_rights); channel.write(msg).map_err(|err| { if err == Zx...
Rust
0
############ @staticmethod def get_heroes_or_villains( session: Session, character_type: str, offset: int | None = None, limit: int | None = None ) -> list[Character] | None: """ Method to return all the heroes or all the villains from the databas...
Python
1
&(*(::std::ptr::null::<PhidgetGPS_GPVTG>())).speed as *const _ as usize }, 24usize, concat!( "Offset of field: ", stringify!(PhidgetGPS_GPVTG), "::", stringify!(speed) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<PhidgetGPS_GPV...
Rust
0
a53/core/fdrm/fx_crypt.cpp?format=TEXT*base64.b64decode let command_is_file_download_with_url_in_var4_and_uncompress_function_in_var5 = srcsrv_stream.get_raw_var("SRCSRVCMD") == Some("%SRC_EXTRACT_CMD%") && srcsrv_stream.get_raw_var("SRC_EXTRACT_CMD") == Some( ...
Rust
0
0xffff_ffff_ffff_f000; pub const USER_STACK_SIZE: usize = 0x1000; #[repr(C)] #[derive(Copy, Clone)] #[allow(dead_code)] pub struct TrapFrame { pub kernel_satp: usize, // 0 pub kernel_sp: usize, // 8 pub kernel_trap: usize, // 16 pub epc: usize, // 24 pub kernel_hartid: usize, // ...
Rust
0
- r.start).sum::<Node>() != self.node_count() { return Err(Error::InvalidPartitioning); } if node_values.len() != self.node_count().index() { return Err(Error::InvalidNodeValues); } let node_value_splits = split_by_partition(partition, node_values); let...
Rust
0
from django.urls import path, include from .views import BookList, BookViewSet from rest_framework.routers import DefaultRouter from rest_framework.authtoken.views import obtain_auth_token router = DefaultRouter() router.register(r'books', BookViewSet) urlpatterns = [ path('books/', BookList.as_view(), name='book...
Python
1
""" Importing the user input for instrument name from Excel File """ import warnings import xml.etree.ElementTree as ET import re import openpyxl # Ignoring the data validation error warnings.simplefilter(action='ignore', category=UserWarning) class XML: """ Creating class to load XML config file for URL and lo...
Python
1
import requests from langsmith.run_helpers import get_current_run_tree def download_image_as_bytes(url: str) -> bytes: # 이미지 URL에서 바이너리 데이터 다운로드 response = requests.get(url) if response.status_code == 200: return response.content raise Exception(f"[이미지 다운로드 실패] status={response.status_code}, ur...
Python
1
let mut boxes2 = HittableList::new(); let white = Lambertian::new(SolidColor::new_with_color(Color::new(0.73, 0.73, 0.73))); const NS: usize = 1000; for j in 0..NS { let sphere: Arc<dyn Hittable> = Arc::new(Sphere::new( &Point3::random(0.0, 165.0), 10.0, whit...
Rust
0
// This macro is non-hygienic, and not intended for use outside of this module. macro_rules! local_impl_value_visitor_methods { ($($name:ident($($arg:ident: $ty:ty)?) => $result:expr;)*) => { $( fn $name<E: de::Error>(self, $($arg: $ty)?) -> Result<Self::Value, E> { Ok($result) } )* }; }...
Rust
0
s_items) neg_items_emb = self.item_embedding(neg_items) pos_score = torch.sum(seq_output * pos_items_emb, dim=-1) # [B] neg_score = torch.sum(seq_output * neg_items_emb, dim=-1) # [B] loss = self.loss_fct(pos_score, neg_score) else: # self.loss_type = 'CE' ...
Python
1
ifold_gr35.batch_exp(x_batch, v_proj_batch) # Step 3: Logarithmic map back v_recovered_batch = self.manifold_gr35.batch_log(x_batch, y_batch) # Step 4: Compute distances distances_batch = self.manifold_gr35.batch_dist(x_batch, y_batch) # Verify exp-log consistency (fundamental...
Python
1
* 0 + 1] + mat4[r * 2 + 2] * rotate[r * 0 + 2]; result[r * 0 + 3] = mat4[r * 0 + 3] * rotate[r * 0 + 0] + mat4[r * 1 + 3] * rotate[r * 0 + 1] + mat4[r * 2 + 3] * rotate[r * 0 + 2]; result[r * 1 + 0] = mat4[r * 0 + 0] * rotate[r * 1 + 0] + mat4[r * 1 + 0] * rotate[r * 1 + 1] + mat...
Rust
0
age.chat.id, cat, message_thread_id=message.message_thread_id) else: result = "" for i in range(1, len(text)): result += text[i] + "%20" cat = requests.get(f"https://cataas.com/cat/says/{result}").content bot.send_photo(message.chat.id, cat, message_thread_id=message.mess...
Python
1
The "warn" level. /// /// Designates hazardous situations. Warn, /// The "info" level. /// /// Designates useful information. Info, /// The "debug" level. /// /// Designates lower priority information. Debug, /// The "trace" level. /// /// Designates very low pri...
Rust
0
tions=positions, daily_pnl=daily_pnl, total_balance=total_balance, ) @router.get("/trading/positions", response_model=List[PositionInfo]) async def get_positions(symbol: str = None) -> List[PositionInfo]: """Get current open positions, optionally filtered by symbol""" if symbol: re...
Python
1
s.r2_score(y_true, predictions) results = {key: float(results[key]) for key in results} if verbose: for key in results: print("{}: {:.4f}".format(key, results[key])) return results def compute_binary_metrics(y, pred_prob, verbose): pred_prob = np.array(pred_prob) labels = p...
Python
1
""" Functions to stream audio chucks at every second. """ import sys import time import librosa def load_audio(fname, sampling_rate=16000): """ loads the audio into buffer. """ try: aud, _ = librosa.load(fname, sr=sampling_rate) except Exception: # pylint: disable=W0718 print("!...
Python
1
} """ def make_user_info_dict(user, enrollment_mode=None): """ Utility function to extract user information from model. """ return { "id": user.id, "username": user.username, "email": user.email, "name": user.profile.nam...
Python
1
from collections import OrderedDict from typing import Optional from faker.providers.person.ru_RU import translit from faker.typing import CardType, CreditCard from .. import Provider as CreditCardProvider class Provider(CreditCardProvider): """Implement credit card provider for ``ru_RU`` locale. For all m...
Python
1
total cost opti.minimize(total_cost) #Set up the solver opti.solver('ipopt', { 'ipopt.max_iter': 500, 'ipopt.tol': 1e-12, 'ipopt.acceptable_tol': 1e-12, 'ipopt.acceptable_iter': 100, 'ipopt.print_level': 0, 'prin...
Python
1
u8) -> Self { match bits { 0 => ChannelMode::Mono, 1 => ChannelMode::DualChannel, 2 => ChannelMode::Stereo, 3 => ChannelMode::JointStereo, _ => panic!("invalid channel mode"), } } } bitfield! { pub struct SbcHeader(u32); impl Debu...
Rust
0
f opt['num_gpu'] == 'auto': opt['num_gpu'] = torch.cuda.device_count() # datasets for phase, dataset in opt['datasets'].items(): # for multiple datasets, e.g., val_1, val_2; test_1, test_2 phase = phase.split('_')[0] dataset['phase'] = phase if 'scale' in opt: ...
Python
1
# coding: utf-8 """ Upbit Open API ## REST API for Upbit Exchange - Base URL: [https://api.upbit.com] - Official Upbit API Documents: [https://docs.upbit.com] - Official Support email: [open-api@upbit.com] # noqa: E501 OpenAPI spec version: 1.0.0 Contact: ujhin942@gmail.com Generated by: https:...
Python
1
to hold events for a set number of flushes. This /// delays the events for the duration of those flushes but reduce the /// likelyhood of cross-flush splits of timestamps. pub struct FlushBoundaryFilter { tolerance: usize, holds: Vec<Hold>, } /// Configuration for `FlushBoundaryFilter` #[derive(Clone, Debug)]...
Rust
0
from abc import ABC, abstractmethod from telegram import Update from telegram.ext import ContextTypes class BotPlugin(ABC): """Базовый класс для плагинов бота""" @property @abstractmethod def name(self) -> str: """Название плагина""" pass @property @abstractmethod ...
Python
1
inal text message. No able * to test with identical python function output string. */ fn base64_zlib_encode( data: String, ) -> Result<String, keylime_error::KeylimeTpmError> { let mut encoder = ZlibEncoder::new(Vec::new(), Compression::default()); encoder.write_all(data.as_bytes())?; let compressed_b...
Rust
0
tmp = self._session.show_config(base_path + ['v3', 'user', 'vyos', 'privacy', 'encrypted-password']).split()[1] self.assertEqual(tmp, hashed_password) tmp = read_file(SNMPD_CONF) # views self.assertIn(f'view {snmpv3_view} included .{snmpv3_view_oid}', tmp) # group self...
Python
1
def quickSort (arr): if len(arr) <= 1: return arr else: pivot = arr[len(arr) // 2] left = [x for x in arr if x < pivot] mid = [x for x in arr if x == pivot] right = [x for x in arr if x > pivot] return quickSort(left) + mid + quickSort(right) ...
Python
1
0e34d64562b"] }, "10": { "list": ["0xd6d9d2cd449a754c494264e1809c50e34d64562b"] }, "20": { "contract": "0xc6d9d2cd449a754c494264e1809c50e34d64562b" } } }]"#; let deserialized: Vec<ValidatorSet> = serde_json::from_str(s).unwrap(); assert_eq!(deserialized.len(), 4); assert_eq!(deserialized[0], Valida...
Rust
0
import asyncio import datetime import logging import typing import aiohttp import dotenv import pythonjsonlogger.jsonlogger import tensorflow_datasets import embedding_retrieval.model import embedding_retrieval_loader.settings s = embedding_retrieval_loader.settings.Settings() if s.load_dotenv: dotenv.load_dote...
Python
1
)?) } } impl<T> FromBech32ZipStr for T where T: sealed::FromPayload {} impl<T> ToBech32String for Holder<T, strategies::CompressedStrictEncoding> where T: StrictEncode + Strategy, { #[inline] fn to_bech32_string(&self) -> String { let data = self ...
Rust
0
pub fn doit() { dep::work(); } "#, ) .publish(); let p = project() .file( "Cargo.toml", r#" [package] name = "foo" version = "0.1.0" edition = "2018" ...
Rust
0
::surface::search_parameter2d(self, pt, hint, INCLUDE_CURVE_TRIALS) { Some(got) => got, None => return false, }; let uknot_vec = self.uknot_vec(); let vknot_vec = self.vknot_vec(); let degree = curve.degree() * 6; let (knots, _) = curve.knot_vec().to_singl...
Rust
0
import tkinter as tk from tkinter import ttk from tkinter import filedialog from db import MysqlDatabases from model.run_classifier import ChnSentiCorpProcessor, SimplifyWBProcessor, InputExample, convert_examples_to_features, input_fn_builder, model_fn_builder, file_based_convert_examples_to_features, file_based_inpu...
Python
1
ways set", S::label()), } } } } use crate::error::ServerError; use crate::group::GroupId; use log::warn; use serde::{Deserialize, Serialize}; const API_ENDPOINT: &str = "http://localhost:8000/"; /// The group information sent as response to a token request. #[derive(Debug, Serialize, Deseriali...
Rust
0
# flake8: noqa # import apis into api package from hostinger_api.api.billing_catalog_api import BillingCatalogApi from hostinger_api.api.billing_orders_api import BillingOrdersApi from hostinger_api.api.billing_payment_methods_api import BillingPaymentMethodsApi from hostinger_api.api.billing_subscriptions_api import ...
Python
1
ty( name="Max Length", description="Maximum streamline length (world units). 0 disables length limit", default=0.0, min=0.0, soft_max=100000.0, ) normalize_field: bpy.props.BoolProperty( name="Normalize Field", description="Use direction-only vectors (uni...
Python
1
_base_ = [ '../_base_/models/mask-rcnn_r50_fpn.py', '../_base_/datasets/coco_instance.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py' ] checkpoint = 'https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb256-rsb-a1-600e_in1k_20211228-20e21305.pth' # noqa model = d...
Python
1
import sys from awsglue.transforms import * from awsglue.utils import getResolvedOptions from pyspark.context import SparkContext from awsglue.context import GlueContext from awsglue.job import Job from awsglue import DynamicFrame args = getResolvedOptions(sys.argv, ['JOB_NAME']) sc = SparkContext() glueContext = Glue...
Python
1
None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None, }, &[197, 251, 146, 222], OperandSize::Qword, ) } #[test] fn kmovd_9() { run_test( &Instruction { ...
Rust
0
ency, ReservableCurrency}, unsigned::{TransactionValidity, TransactionSource}, }; use frame_system::{ self as system, ensure_signed, offchain::{ AppCrypto, CreateSignedTransaction, SendSignedTransaction, SignedPayload, Signer, SigningTypes, }, }; use sp_std::vec::Vec; use ethereum_types::{...
Rust
0
from .base_llm import LLMBackbone from .llama2 import LLaMa2LLMBackbone from .llama3 import LLaMa3LLMBackbone
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2010 Modelon AB # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed...
Python
1
from gpiozero import MotionSensor from signal import pause pir = MotionSensor(21) def motion(): print("Motion detected!") def noMotion(): print("______________") pir.when_motion = motion pir.when_no_motion = noMotion pause()
Python
1
ar to BNF, called Feature GRammar (.fgr). There's a VSCode syntax highlighting extension for these files available as [`fgr-syntax`](https://marketplace.visualstudio.com/items?itemName=vgel.fgr-syntax). We'll start by defining our lexicon. The lexicon is the set of terminal symbols (symbols in the actual input) that t...
Rust
0
2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df345bdf985ded9%26domain%3Dmy.freenom.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fmy.freenom.com%252Ff3d9804737545e%26relation%3Dopener.parent%26frame%3Df379798f8b6896%26error%3Daccess_denied%26error_code%3D200%26error_description%3DP...
Python
1
\terrain_rock_ac_01.nif", 0x7C23_0326, 0x0A96_2C82), (r"meshes\f\terrain_rock_ac_11.nif", 0x7C23_0326, 0x0A96_2C86), (r"meshes\f\terrain_rock_bc_01.nif", 0x7C23_0326, 0x0A96_2D02), (r"meshes\f\terrain_rock_bc_11.nif", 0x7C23_0326, 0x0A96_2D06), (r"meshes\f\terrain_rock_ac_06.nif", 0x7C23_0326, 0x0A9...
Rust
0
import os os.environ["CMBAGENT_DEBUG"] = "false" os.environ["CMBAGENT_DISABLE_DISPLAY"] = "true" # from cmbagent import CMBAgent import cmbagent # cmbagent = CMBAgent(agent_llm_configs = { # 'engineer': { # "model": "gemini-2.5-pro-exp-03-25", # "api_key": os.getenv("GEM...
Python
1
#[cfg(feature = "tokio-02")] impl<R: tokio_02::io::AsyncRead + Unpin> tokio_02::io::AsyncRead for TrackEof<R> { fn poll_read(self: Pin<&mut Self>, cx: &mut Context, buf: &mut [u8]) -> Poll<Result<usize>> { let (inner, eof) = self.project(); assert!(!*eof); match inner.poll_read(cx, buf) { ...
Rust
0
cert.signature_key.fingerprint().hash, "xOwDaE2Z4bv6lUFLvoT87Hf2WGgy/zIP0Av7dIlWT5E"); } #[test] fn parse_rsa_key_signed_by_ecdsa256_ca() { let cert = concat!( "ssh-rsa-cert-v01@openssh.com A<KEY>", "DAQABAAABgQC3DH/PBs33u8Tiz1g+NNa806fNW2cEjgUedehBGeRAURFE33n4BgIn3F6Z3GN/319bHSjooMCeBYW2lPLdujTYZd...
Rust
0
rd_dict = dict() # 卡片id:item对应关系 def ui_init(self): self.setObjectName("plantSelectBasket") # 设置对象名称 self.layout = QVBoxLayout() self.grid_layout = QGridLayout() self.startRockBtn = StartRockBtn(self) self.selectLastBtn = StartRockBtn(self) self.showAlmanacBtn = StartRockBtn(self) self.startRockBtn.se...
Python
1
irectly for `async/await`. Whether it's a quick script, or a cross-platform //! SDK, Surf will make it work. //! //! - Multi-platform out of the box //! - Extensible through a powerful middleware system //! - Reuses connections through the `Client` interface //! - Fully streaming requests and responses //! - TLS/SSL en...
Rust
0
._get_biased_nnlm(lm_dict, keyword) nnlm_decoder = self._get_decoder(lm=custom_nnlm, lm_dict=lm_dict, use_lexicon=use_lexicon, lm_weight=10) nnlm_results = nnlm_decoder(emissions) if use_lexicon: output = [result[0].words for result in nnlm_results] else: tokens ...
Python
1
from rest_framework import serializers from webapi.models import Blob class BlobSerializer(serializers.ModelSerializer): class Meta: model = Blob fields = ['content', 'name'] def create(self, validated_data): return Blob.objects.create(**validated_data)
Python
1
# Generated by Ollama Llama 3 # Task: inside_op_misc_scenarios_rich # Attempt: 1 # Success: False # Overall Score: 0.488 Here is a Python module for the xform framework that performs the task of creating miscellaneous and edge case scenarios for inside operator: ```python import pyverilog.parse import re import argpa...
Python
1
e::*, style}; use hal::{ device::I2C1, gpio::gpioa::PA0, gpio::{ Alternate, Edge, Floating, Input, OpenDrain, Output, PullUp, PushPull, PA1, PA5, PA6, PA7, PB6, PB7, PB8, PB9, }, i2c::I2c, prelude::*, spi::Spi, stm32, timer::{Event, Timer}, }; use hal::{ gpio::PC1...
Rust
0
#!/usr/bin/python3 import rclpy from rclpy.node import Node from geometry_msgs.msg import Twist from sensor_msgs.msg import Joy class IntBall2VelocityController(Node): def __init__(self): super().__init__('ib2_vel_ctrl') # Parameters for scaling self.MAX_LIN_VEL = 0.5 # m/sec sel...
Python
1
25)).await; let buf = client.read().await.unwrap(); assert_eq!(buf, Bytes::from_static(b"GET /test HTTP/1\r\n\r\n")); client.write("GET /test HTTP/1\r\n\r\n"); let buf = client.read().await.unwrap(); assert_eq!(buf, Bytes::from_static(b"GET /test HTTP/1\r\n\r\n")); clie...
Rust
0
/// # ..Default::default() /// # }, /// # permitted_algorithms: KeyAgreement::Raw(alg).into(), /// # }, /// # }; /// /// psa_crypto::init().unwrap(); /// let my_key = key_management::import(attributes, None, &OUR_KEY_DATA).unwrap(); /// let mut output = vec![0; attributes.raw_key_agreeme...
Rust
0
unconditional_panic)] // The only way to have promoteds that fail is in `const fn` called from `const`/`static`. const fn overflow() -> u32 { 0 - 1 //[opt_with_overflow_checks,noopt]~^ WARN any use of this value will cause an error //[opt_with_overflow_checks,noopt]~| WARN this was previously accepted by t...
Rust
0
:new(); assert_eq!( dice.roll(1, &NumericDice::ConstDice(20))[0].to_string(), "20" ); } #[test] fn fudge_roll_to_string() { let dice = DiceGenerator::new(); assert_eq!( dice.roll(1, &FudgeDice::ConstDice(FudgeRoll::Blank))[0].to_string(), ...
Rust
0
xmmm128 0x25,// pblendvb_1 0xEC, 0x03,// 492 = "pblendvb" // EVEX_Vpsrlvw_xmm_k1z_xmm_xmmm128 0x81,// 'v', Normal_1 0xE5, 0x04,// 613 = "vpsrlvw" // EVEX_Vpsrlvw_ymm_k1z_ymm_ymmm256 0x80,// 'v', Previous // EVEX_Vpsrlvw_zmm_k1z_zmm_zmmm512 0x80,// 'v', Previous // EVEX_Vpmovuswb_xmmm64_k1z_xmm 0x81,// 'v...
Rust
0
ciphertext 0 and the coefficient 2 of the ciphertext 0 /// /// # Argument /// * `sk` - an glwe secret key /// * `nb` - the number of coeff we want to decrypt /// /// # Output /// * an array of f64 /// * an array of encoders /// * PolynomialSizeError - if the polynomial size of the s...
Rust
0
Err(e) => { log( &format!("Post-run script failed with error: \"{}\"", e.to_string()), "f", ) .unwrap(); std::process::exit(1) } }; } } pub fn log(message: &String, message_type: &str) ->...
Rust
0
let (raw_tiles, tile_states): (Vec<_>, Vec<_>) = ti .tile_iter_mut(fs, &mut blocks) .zip(cdfs.iter_mut()) .collect::<Vec<_>>() .into_par_iter() .map(|(mut ctx, cdf)| { let raw = encode_tile(fi, &mut ctx.ts, cdf, &mut ctx.tb, inter_cfg); (raw, ctx.ts) }) .unzip(); let stats =...
Rust
0
ODE.DO_BIND: if not uses_threaded_bind: import_stack.append( record(cmd_start_addr, seg_index, seg_offset, lib_ordinal, btype, flags, name, addend, special_dylib)) seg_offset += 8 ...
Python
1
&'b Translation2<S> where S: ScalarFloat { type Output = Point2<S>; #[inline] fn mul(self, other: &'a Point2<S>) -> Self::Output { self.translate_point(other) } } impl<S> ops::Mul<Translation2<S>> for Translation2<S> where S: ScalarFloat { type Output = Translation2<S>; ...
Rust
0
(); let bounded: f32 = f32_bound(42.0); assert!(bounded < 42.0); let _foo: f64 = f64(); let bounded: f64 = f64_bound(42.0); assert!(bounded < 42.0); let _foo: bool = bool(); } } // Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code i...
Rust
0
ree it. unsafe { EVP_MD_CTX_free(self.md_ctx); } } } impl<'a> Verifier<'a> { pub fn new(type_: MessageDigest, pkey: &'a PKeyRef) -> Result<Verifier<'a>, ErrorStack> { unsafe { ffi::init(); let ctx = try!(cvt_p(EVP_MD_CTX_new())); let mut ...
Rust
0
icpr = builder.build("")?; let (p_chan_tx, mut p_chan_rx) = mpsc::channel::<Packet>(10 * 5); tokio::spawn(async move { // start some parallel streams using the same interceptor to test for race conditions let wg = WaitGroup::new(); for i in 0..10 { let w = wg.worker(); ...
Rust
0
filetes" * ao lado esquerdo, o outro ao direito. */ match aninhar { // primeiro à direita. Aninhamento::Direita => { for _ in 1..=qe { for linha in matriz.iter_mut() { linha.insert(0, RECUO); } } }, // ao centro. ...
Rust
0
ian is None and weekday is not None: if week_of_year is not None: week_starts_Mon = True if week_of_year_start == 0 else False julian = _calc_julian_from_U_or_W(year, week_of_year, weekday, week_starts_Mon) elif iso_year is not None...
Python
1
#!/usr/bin/env python """ Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/) See the file 'LICENSE' for copying permission """ from lib.core.common import Backend from lib.core.common import Format from lib.core.data import conf from lib.core.data import kb from lib.core.data import logger from lib.core....
Python
1
}, { 'color': 'hsl(231, 48%, 48%)', 'label': 'Indigo' }, { 'color': 'hsl(207, 90%, 54%)', 'label': 'Blue' }, ] CKEDITOR_5_CONFIGS = { 'default': { 'toolbar': ['heading', '|', 'bold', 'italic', 'link', 'b...
Python
1
har, c_int, c_long, c_uint, c_ushort, c_void}; use crate::bluetooth::bdaddr_t; use crate::hci::{ hci_dev_info, hci_filter, inquiry_info, HCI_FLT_EVENT_BITS, HCI_FLT_TYPE_BITS, HCI_VENDOR_PKT, }; STRUCT! {struct hci_request { ogf: c_ushort, ocf: c_ushort, event: c_int, cparam: *mut c_void, clen...
Rust
0
self.read_into_iter(idx, start, stop), _ => Err(io::Error::new( io::ErrorKind::Other, "No sequence fetched for reading.", )), } } fn read_into_buffer( &mut self, idx: IndexRecord, start: u64, stop: u64, seq...
Rust
0
"bool" => match rec.field_s.as_str() { "flg_help" => { sss += r#" if pico_args.contains(["-h", "--help"]) { print_help_and_exit(&conf); } "#; } "flg_version" => { sss += r#" if pico_args.contains(["-...
Rust
0
="IE", result="IE") _post_update_submission(submission) success = True return success def disconnect_judge(judge, force=False): judge_request( {"name": "disconnect-judge", "judge-id": judge.name, "force": force}, reply=False, ) def abort_submission(submission): from ....
Python
1
path = "_SABLIER2.png")] pub hourglass_2: Handle<ColorMaterial>, #[asset(color_material)] #[asset(path = "_SABLIER3.png")] pub hourglass_3: Handle<ColorMaterial>, #[asset(color_material)] #[asset(path = "_SABLIER4.png")] pub hourglass_4: Handle<ColorMaterial>, #[asset(color_material)] ...
Rust
0
await asyncio.sleep(30) logger.info("Firmware update completed") return call_result.UpdateFirmware() async def handle_connection(ws): if ws.subprotocol != "ocpp1.6": await ws.close() return cp_id = ws.request.path.strip("/") csms_cp = ChargePoint(cp_id, ws) logge...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2025 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
)] pub enum StoneColor { Black, White, } #[derive(Copy, Clone, Debug)] pub struct Stone { pub x: u8, pub y: u8, pub color: StoneColor, } impl Stone { pub fn new(x: u8, y: u8, color: StoneColor) -> Stone { Stone { x, y, color } } } #[derive(Debug)] pub enum GobanError { Invalid...
Rust
0
return resp, code face_count = user_service.get_face_count(user_id) return jsonify(success_response( f"User {user.name} has {face_count} face samples", constants.StatusCode.SUCCESS, user={ "id": user.id, "name": user.name...
Python
1
config.host, config.token, config.namespace, )) } #[cfg(test)] pub mod tests { use super::*; use libra_secure_storage::{Policy, Value}; const VAULT_HOST: &str = "http://localhost:8200"; const VAULT_ROOT_TOKEN: &str = "<PASSWORD>"; #[test] #[ignore] fn test_verify() { ...
Rust
0
""" MengLong API测试脚本 这个脚本使用requests库发送HTTP请求,测试MengLong的API服务 """ import os import json import argparse from enum import Enum import requests from typing import List, Dict, Any, Optional, Union import time # 服务器URL配置 SERVER_URL = "http://ec2-100-20-214-248.us-west-2.compute.amazonaws.com:8000" # SERVER_URL = "http:/...
Python
1
re": 234.5, "aluminio": 225.0} # --- Limites de Variação de Impedância (NBR 5356-5:2007 Tabela 2) --- # (Chaves devem corresponder aos values do Dropdown 'power-category') IMPEDANCE_VARIATION_LIMITS = { "I": 10.0, # Categoria I (≤ 2.5 MVA) "II": 7.5, # Categoria II (> 2.5 a 100 MVA) "III": 2.0, # Catego...
Python
1
`variant` to the field"] #[inline(always)] pub fn variant(self, variant: CRCPOLYW) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = "CRC-16 (CRC-CCITT)"] #[inline(always)] pub fn crc16(self) -> &'a mut W { self.variant(CRCPOLYW::CRC1...
Rust
0