text
string
label_name
string
labels
int64
.offer_list.entry(BASIC_BUILD_OFFER_LEVEL).or_default(); offers.push(employ_info); } } fn basic_normal_transfer(&mut self) { let count = self.get_upgrade_offer_number(); for index in 0 .. count { let employ_info = Manager::new_normal_transfer_employ(0); ...
Rust
0
config = { "attack_method": "Pixel", "task": "segmentation", "dataset": "VOC2012", "data_dir": "datasets/VOC2012", # Directory path where the dataset is located "model": "pspnet", "RGB": 3, # Input dimension "attack_pixel": 0.01, ...
Python
1
wrap_or("".to_string()); let sub_account = db.new_sub_account(request.account_index, &name)?; let rep = CreateAddressResponse { address: sub_account.address.clone(), address_index: sub_account.sub_account_index, }; Ok(Json(rep)) } #[derive(Serialize, Deserialize)] pub struct GetAccounts...
Rust
0
().void_unwrap()) } } pub fn vbios_version_string(&self) -> sys::Result<String> { trace!("gpu.vbios_version_string()"); let mut str = sys::types::short_string(); unsafe { sys::status_result(gpu::NvAPI_GPU_GetVbiosVersionString(self.0, &mut str)) .map(...
Rust
0
data: TypedArray::from(array), }) } // The ndarray must live longer than tensor pub fn create_tensor_with_ndarray<T>(mut array: ndarray::ArrayD<T>) -> Result<Tensor> where T: TypeToTensorElementDataType, TypedArray: From<ArrayD<T>>, { let mut ort_value_ptr: *mut OrtValue = null_mut(); let array_ptr...
Rust
0
or testing purposes #[serde(rename = "XTS")] Xts, /// Codes assigned for transactions where no currency is involved #[serde(rename = "XXX")] Xxx, /// Gold #[serde(rename = "959")] N959, /// European Composite Unit (EURCO) #[serde(rename = "955")] N955, /// European Monetary Unit (E.M.U.-6) #[serde(rename =...
Rust
0
, build_expressions, probe_expressions, build_schema, probe_schema, )?), HashMethodKind::KeysU128(hash_method) => Arc::new(ChainingHashTable::try_create( ctx, join_type, HashTable::KeyU128HashTable(KeyU128HashTable { ...
Rust
0
Ok(smithy_http::body::SdkBody::from(out)) } pub fn serialize_operation_describe_store_image_tasks( input: &crate::input::DescribeStoreImageTasksInput, ) -> Result<smithy_http::body::SdkBody, std::convert::Infallible> { let mut out = String::new(); #[allow(unused_mut)] let mut writer = smithy_qu...
Rust
0
from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from .. import commands class TestCommandUtilities(TestCase): REBOOT_SCHEMA = {"title": "Reboot", "type": "null", "additionalProperties": False} def test_get_command_schema(self): with self.subTest("Test existin...
Python
1
from tkinter.ttk import * from tkinter import * from pygame import * from datetime import * import sys sys.setrecursionlimit(10000) from pygame import mixer from time import sleep #window window= Tk() window.title("") window.geometry('350x200') def sound_alarm(): mixer.music.load('alarm2.mp3') mixer.music...
Python
1
_core_frequencies_below_threshold_disabled(threshold_freq, reason): if hasattr(linucb_model, 'disable_core_frequencies_below_threshold'): linucb_model.disable_core_frequencies_below_threshold(threshold_freq, reason) def notify_combination_disabled(core_freq, memory_freq, inc...
Python
1
from __future__ import absolute_import import theano import theano.tensor as T import numpy as np from six.moves import range if theano.config.floatX == 'float64': epsilon = 1.0e-9 else: epsilon = 1.0e-7 def mean_squared_error(y_true, y_pred): return T.sqr(y_pred - y_true).mean(axis=-1) def mean_absolu...
Python
1
t child = match attempts_since_last_improvement % 3 { 0 => generate_parent(&get_fitness, gene_set, length), 1 => mutate_parent(&candidate, &get_fitness, gene_set), _ => crossover(&candidate, &best_parent, &get_fitness) }; if ch...
Rust
0
this variant. /// /// [`custom()`]: #method.custom Custom(Cow<'a, ReaperStr>), } impl<'a> TrackSendAttributeKey<'a> { /// Convenience function for creating an [`Ext`] key. /// /// [`Ext`]: #variant.Ext pub fn ext(key: impl Into<ReaperStringArg<'a>>) -> TrackSendAttributeKey<'a> { T...
Rust
0
"""A processor for the machine translation task.""" from __future__ import annotations from collections.abc import Iterable import copy from typing import Any from explainaboard import TaskType from explainaboard.analysis import feature from explainaboard.analysis.analyses import AnalysisLevel from explainaboard.ana...
Python
1
("lala"), long_description: String::from("rawr"), descriptors: Vec::new(), params: Vec::new(), returns: Vec::new(), position: 0, }] ); } } #[test] fn param_and_input() { ...
Rust
0
import json filename = input("Enter input ordering file: ") with open(filename, "r") as f: data = json.loads(f.read()) print( "Note: if you are using an X-LoRA model, it is very important that the adapter names are specified in the correct order" ", which is the order used during training. If ...
Python
1
dler::new(tx, JobStatus::AckJob, true); let mut el = EventLoop::new(disque, 1, handler); el.watch_queue(queue.to_vec()); el.run_times(1); el.stop(); assert_eq!(rx.try_recv().unwrap().nack_additional_deliveries(), (1, 0)); assert_eq!(rx.try_recv().unwrap().body(), job); assert!(rx.try_recv()....
Rust
0
rule { ($name: expr) => { Rule { name: $name, path: "".into(), policy: "".into(), upstream: "".into(), size_limit: None, rewrite: None, options: None, } }; } #...
Rust
0
#re creating the functionality of the manipulator menu from 2.49 # ##### BEGIN GPL LICENSE BLOCK ##### # # This program 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 2 # of the License, o...
Python
1
write_u32(0).await?; // setup socket.write_all(&setup).await?; // data socket.write_all(&resp).await?; } [0x00, 0x00, 0x00, 0x02] => { trace!("Got USBIP_CMD_UNLINK"); let seq_num = socket.read_u32().a...
Rust
0
ton_relative_filepath(armature_object, anim_dirpath, root_object.name) + name_suffix exported_anims_names = {} # store exported animations paths, so we can report duplicates and overwrites for scs_anim in root_object.scs_object_animation_inventory: if scs_anim.exp...
Python
1
#Main code to bring all classes together from tracker import ExpenseTracker from expense import Expense from datetime import date def main(): tracker = ExpenseTracker() while True: print("\nExpense Tracker Menu") print("1. Add a new expense") print("2. Delete an expense") print(...
Python
1
from typing import ClassVar from .....core.utils.types import Compatibility, Contract from ...__utils__.mixins.openrouter_text_to_text.interface import UniversalModelMixin from ...__utils__.mixins.openrouter_text_to_text.meta import generate_standard_compatibility, generate_standard_contract from ...__utils__.mixins.o...
Python
1
Cards::DocId, FlashCards::Difficulty, FlashCards::Reps, FlashCards::Interval, FlashCards::Created, FlashCards::Scheduled, ]) .values_panic(vec![ card.get_questions().in...
Rust
0
y_calc+b_mag_calc+b_ind_calc)/3) c_calc=int(int((lvlget('c_stat')[int(base_array[9])]+base_array[6])*(c_per/100+1))*(stat_c/750+1)) pas1_calc=int(lvlget('hol_pas1_out')[int(base_array[13])]+273) pas1_out=str(int(lvlget('hol_pas1_out')[i...
Python
1
alloc leaf"), || Ok(leaf_data)).unwrap(); let res = merkle_proof::merkle_proof(cs.namespace(|| "exec merkle proof"), &proof, &leaf, &JUBJUB_PARAMS).unwrap(); if !cs.is_satisfied() { let not_satisfied = cs.which_is_unsatisfied().unwrap_or(""); assert!(false, format!("Constraints not satisfied: {...
Rust
0
@skip_mps def test_save_load_optional_components(self): return super().test_save_load_optional_components()
Python
1
""" PeekDatasetCommand class ============================== """ from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser import collections import re import numpy as np import textattack from textattack.commands import TextAttackCommand def _cb(s): return textattack.shared.utils.color_text(str(s), ...
Python
1
ored in the Hub's database. This can # include things like authentication tokens, etc. to be passed to Spawners as # environment variables. # # Encrypting auth_state requires the cryptography package. # # Additionally, the JUPYTERHUB_CRYPT_KEY environment variable must contain one # (or more, separated by ;) 32B e...
Python
1
"""MIT License Copyright (c) 2024-2025 gunyu1019 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,...
Python
1
import asyncio from typing import Literal from pydantic import BaseModel, Field from flock.orchestrator import Flock from flock.registry import flock_type @flock_type class DebateTopic(BaseModel): statement: str = Field( default="Blackboard multi-agent systems will revolutionize AI development and are w...
Python
1
ndptr_csr[row + 1]] model.addCons(quicksum(var_names[j] for j in cols) >= 1, f"Cover_Row_{row}") # Ensure prioritized sets (crucial sets) have higher coverage conditions for j in crucial_sets: rows_impacting_j = np.where(indices_csr == j)[0] for row in rows_impacting...
Python
1
ts { } use lazy_static::lazy_static; use serde_json::json; use super::common::{ALICE_DID, BOB_DID}; use crate::didcomm::{Attachment, Message, MessageBuilder}; lazy_static! { pub static ref MESSAGE_SIMPLE: Message = _message().finalize(); } lazy_static! { pub static ref MESSAGE_MINIMAL: Message = Message::bu...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' 返回函数 高阶函数除了可以接受函数作为参数外,还可以把函数作为结果值返回 返回一个函数时,牢记该函数并未执行,返回函数中不要引用任何可能会变化的变量。 ''' # 实现一个可变参数的求和。通常情况下,求和的函数是这样定义的: def calc_sum(*args): ax = 0 for n in args: ax = ax + n return ax # 如果不需要立刻求和,而是在后面的代码中,根据需要再计算,可以不返回求和的结果,而是返回求和的函数: def ...
Python
1
import os from database.models import SessionHistory, AuditLog, User, Album, Photo from utils.admin_utils import get_user_storage from flask_login import current_user def get_sessions_user_history(usuario_id): """ Obtiene el historial de sesiones del usuario dado su ID. """ sesiones = SessionHistory.qu...
Python
1
unwrap_err(); } #[test] fn test_bind() { assert_eq!(bind_in_range((2000, 2001)).unwrap().0, 2000); let x = bind_to(2002, true).unwrap(); let y = bind_to(2002, true).unwrap(); assert_eq!( x.local_addr().unwrap().port(), y.local_addr().unwrap().port() ...
Rust
0
iority"] == client.priorities[0][KEY_PRIORITY] # Simulate a USB Capture state callback from Hyperion. client.priorities = [ { KEY_ACTIVE: True, KEY_COMPONENTID: "V4L", KEY_ORIGIN: "System", KEY_OWNER: "V4L2", KEY_PRIORITY: 250, KEY...
Python
1
pException): """422 Unprocessable Entity: 請求格式正確,但語義錯誤。""" def __init__(self, message: str = "The request was well-formed but was unable to be followed due to semantic errors.", details: dict = None): super().__init__( message, error_code=AppErr...
Python
1
def peso_conta(altura, genero): if genero == "m": peso = (72.7 * altura) - 58 elif genero == "f": peso = (62.1 * altura) - 44.7 return peso altura = float(input('Insira sua altura: ')) genero = input('insira seu genero | M ou F: ').lower() peso_resultado = peso_conta(altura, genero) prin...
Python
1
nthesizer uses internally */ pub fn count_effects_channels(&self) -> u8 { 2 } } use { backslash_z::{Config as BzConfig, Request, Response}, failure, futures::prelude::*, irc::client::prelude::*, lazy_static::lazy_static, regex::Regex, std::str::FromStr, }; use std::env::args; use std::...
Rust
0
_doc__) parent_parser = argparse.ArgumentParser(add_help=False) subparser = parser.add_subparsers(title='commands', metavar="<command>") # Add global arguments to Parent parser parent_parser.add_argument( '-p', '--hasura-path', dest='hasura_path', help='directory containing the config.yaml and migr...
Python
1
from statistics import median from metrics import * import argparse def getFundEquityHoldings(fund_id: str): return list(yf.Ticker(fund_id).funds_data.top_holdings.index) def parse_args(): # supported_metrics = [members.name for member in Metrics] parser = argparse.ArgumentParser(description="Fund Fundam...
Python
1
e_method.to_dict()["judge_type"]) self.assertEqual(ErrorType.AbsoluteOrRelative.value, judge_method.to_dict()["error_type"]) def test_absolute_error_judge_method_case(self): judge_method = predict_judge_method( """ <div class="part"> ...
Python
1
# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2 from ...core.unchecked_base_model import UncheckedBaseModel class NewsfeedAssignment(UncheckedBaseModel): """ Assigns a news item to a newsfeed. """ ne...
Python
1
fn sub(self, other: Address) -> Address { Address(self.to_u16() - other.to_u16()) } } impl Sub<u16> for Address { type Output = Address; fn sub(self, other: u16) -> Address { Address(self.to_u16() - other) } } impl Add for Address { type Output = Address; fn add(self, other:...
Rust
0
package_path = filter(lambda x: x.startswith('Filename:'), packages_lines).__next__().split(' ')[1] # When response = requests.get(f'{SERVER_HOST}:{SERVER_PORT}/{package_path}') # Then self.assertEqual(200, response.status_code) with open(f'{PACK...
Python
1
import numpy as np import cvxpy as cp # dependent UCB1 class UCBDependent: def __init__(self, variables, bandit_expressions): self.parameters = [ {"min": cp.Parameter(), "max": cp.Parameter()} for _ in range(len(bandit_expressions)) ] constraints = ( [...
Python
1
Used to hook on telemetry connection established events. pub struct TelemetryOnConnect { /// Event stream. pub telemetry_connection_sinks: TelemetryOnConnectNotifications, } impl<Components: components::Components> Service<Components> { /// Get event stream for telemetry connection established events. pub fn tele...
Rust
0
ruct CRSCoprime<G: ConvertibleUnknownOrderGroup> { // G contains the information about Z^*_N pub parameters: Parameters, pub integer_commitment_parameters: IntegerCommitment<G>, // G, H } pub struct Statement<G: ConvertibleUnknownOrderGroup> { pub c_e: <IntegerCommitment<G> as Commitment>::Instance, ...
Rust
0
w.write_all(b"=")?; print_bop(w, bop) } Bop::Ampamp => w.write_all(b"&&"), Bop::Barbar => w.write_all(b"||"), Bop::Lt => w.write_all(b"<"), Bop::Lte => w.write_all(b"<="), Bop::Cmp => w.write_all(b"<=>"), Bop::Gt => w.write_all(b">"), Bop:...
Rust
0
batch(), dataset.get_next_valid_batch) if valid_f1 > best_f1: patience_counter = 0 best_f1 = valid_f1 best_model = copy.deepcopy(model.state_dict()) _save_file = open(os.path.join(save_path, 'model.bin'), 'w...
Python
1
f.metadata["quic_stream_id_server"] = 1 d.tcp_message(f) assert "quic stream 1" in sio.getvalue() f2 = tflow.tudpflow() f2.client_conn.tls_version = "QUIC" # TODO: This should not be metadata, this should be typed attributes. f2.metadata["quic_stream_id_client"] = 1 ...
Python
1
# model settings model = dict( type='Recognizer2D', backbone=dict( type='ResNet', pretrained='torchvision://resnet50', depth=50, norm_eval=False), cls_head=dict( type='TSNHead', num_classes=400, in_channels=2048, spatial_type='avg', con...
Python
1
import boto3 import json # Initialize IAM client iam = boto3.client('iam') # Role name role_name = "SageMakerExecutionRole" # Assume role policy that lets SageMaker assume the role assume_role_policy = { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal":...
Python
1
ocks(); b.iter_batched( || Space::empty(grid.multiply(2)), |mut space| { space.fill_uniform(grid, &block).unwrap(); }, BatchSize::SmallInput, ) }, ); group...
Rust
0
*; #[test] fn tokenizer_punct() { static PUNCTS: &[&str] = &[ "{", "}", "(", ")", ".", ";", ",", "[", "]", ":", "?", "~", ">", "<", "=", "!", "+", "-", "/", "*", "%", "&", "|", "^", ">>>=", //3 char "...", "===", "!==", ">>>", "<<=", ">>=", "**=", //2 char ...
Rust
0
let params = req.get_ref::<Params>().unwrap(); (params.find(&["oldpassword"]).cloned(), params.find(&["newpassword"]).cloned()) } { let username = req.session().get::<User>()?.unwrap().username; let logins = req.get::<Read<Logins>>().unwrap(); let mut login = logins.get_login(...
Rust
0
class_method("android/view/View\0", "isImportantForAutofill\0", "()Z\0"); __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr()) } } /// [setContentCaptureSession](https://developer.android.com/reference/android/view/View.html#setContentCaptureSess...
Rust
0
here F: Fn(Option<V>), { let id = self.next_id; self.next_id += 1; let listener = (id, Box::new(callback) as Box<_>); if self.listeners.contains_key(&event) { self.listeners.get_mut(&event).unwrap().push(listener); } else { self.listeners.inser...
Rust
0
] = m stackVals[0] = v[0] first = 0 last = 0 for i in range(1, n): if i == stackDeaths[first]: # best value expired first += 1 newVal = v[i] while stackVals[last] >= newVal and last >= first: last -= 1 last += 1 stackDeaths[last] = i + m stackVals[last] = newVal idxs[i] = stackDeaths[first] - m...
Python
1
} } } pub(crate) async fn handle_claims_query(host: &str, msg: &nats::asynk::Message) { let mb = MessageBus::from_hostlocal_registry(host); match mb.send(GetClaims {}).await { Ok(claims) => { let cs = claims.claims.values().map(|c| claims_to_if(c)).collect(); let cl...
Rust
0
ne)] pub use structure::{ ser::to_expression, Attribute, Block, BlockBuilder, BlockLabel, Body, BodyBuilder, Expression, Object, ObjectKey, RawExpression, Structure, }; #[doc(inline)] pub use value::{Map, Value}; <filename>crates/fmod-rs/src/core/dsp_connection.rs use fmod::{raw::*, *}; opaque!(weak class DspC...
Rust
0
eep self._last_checkpoints = [] def get_checkpoint_file(self): save_file = os.path.join(self.save_dir, 'last_checkpoint' + self.postfix) try: self._last_checkpoints = self._load_last_checkpoints(save_file) last_saved = self._last_checkpoints[-1] except (IOErr...
Python
1
from rest_framework import serializers from django.shortcuts import get_object_or_404 from .models import Channel, ChannelMembership, ChannelMessage, ChannelScheduledMessage from user.serializers import UserSerializer from user.models import User class ChannelSerializer(serializers.ModelSerializer): owner = UserS...
Python
1
: c_int, flags: c_int, fd: c_int, pos: c_int, ) -> *mut c_void { debug!( "mmap addr={:p} len={} prot={} flags={} fd={} pos={}", addr, len, prot, flags, fd, pos ); let args = sys_mmap_args { addr: addr as u64, len: len as...
Rust
0
""" Constants for ocrd_validators. """ import yaml from ocrd_utils import resource_string, resource_filename __all__ = [ 'PROCESSING_SERVER_CONFIG_SCHEMA', 'MESSAGE_SCHEMA_PROCESSING', 'MESSAGE_SCHEMA_RESULT', 'OCRD_TOOL_SCHEMA', 'RESOURCE_LIST_SCHEMA', 'OCRD_BAGIT_PROFILE', 'BAGIT_TXT', ...
Python
1
import numpy as np from statsmodels.tools.tools import Bunch cov_clu_stata = np.array([ .00025262993207, -.00065043385106, .20961897960949, -.00065043385106, .00721940994738, -1.2171040967615, .20961897960949, -1.2171040967615, 417.18890043724]).reshape(3, 3) cov_pnw0_stata = np.a...
Python
1
from .test__api import FailingPrettifyContentview from mitmproxy.contentviews import ContentviewRegistry from mitmproxy.contentviews import Metadata from mitmproxy.contentviews import prettify_message from mitmproxy.contentviews import raw from mitmproxy.contentviews import registry from mitmproxy.test import taddons f...
Python
1
_factory self.prompter = Prompter(prompt, parse, self.validate, self.default) @property def field_info(self) -> Any: """Gets the pydantic Field object associated with the stored field.""" return self.model_type.__dataclass_fields__[self.field] # type: ignore[attr-defined] def vali...
Python
1
import torch.utils.data as data import numpy as np import pickle import os class BaseDataset(data.Dataset): def __init__(self, opt): self.opt = opt self.mean = 0 self.std = 1 self.ninput_channels = None super(BaseDataset, self).__init__() def get_mean_std(self): ...
Python
1
import numpy as np import pandas as pd df = pd.read_csv("input.txt", ) file = open("input.txt", 'r') Lines = file.readlines() layout = Lines[0:8][::-1] stacks = { 1 : [], 2 : [], 3 : [], 4 : [], 5 : [], 6 : [], 7 : [], 8 : [], 9 : [] } for level in layout: chunks, chunk_siz...
Python
1
#!/usr/bin/env python3 """ ADK Agent Discovery Test This script tests that ADK can discover all example agents properly. It verifies the structure without running the actual agents. """ import importlib import sys from pathlib import Path def test_agent_discovery(): """Test that all examples can be imported and ...
Python
1
= " @param[in] aTxtDataLength The length (number of bytes) of @p aTxtData."] #[doc = ""] pub fn otDnsInitTxtEntryIterator( aIterator: *mut otDnsTxtEntryIterator, aTxtData: *const u8, aTxtDataLength: u16, ); } extern "C" { #[doc = " This function parses the TXT data from an iter...
Rust
0
_, C, W, H = newWeight.size() newWeight = newWeight.view(numAnchors, -1, C, W, H) newBias = newBias.view(numAnchors, -1) corr = correlations_expanded[cl,:].view(numAnchors, -1) valid = (corr > 0) ...
Python
1
import os # from Dassl.dassl.data.datasets import DATASET_REGISTRY, Datum, DatasetBase # from Dassl.dassl.data.datasets import DatasetBase from datasplit import partition_data from data_utils import prepare_data_office, prepare_data_office_partition_train # @DATASET_REGISTRY.register() class Office(): dataset_dir...
Python
1
fields_size(self.get_unknown_fields()); self.cached_size.set(my_size); my_size } fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { if self.success != false { os.write_bool(1, self.success)?; } ...
Rust
0
Sizer2.Add(self.button_publish, 0, wx.ALL | wx.EXPAND, 5) v_boxSizer2 = wx.StaticBoxSizer(sk_key_box, wx.VERTICAL) v_boxSizer2.AddSpacer(5) v_boxSizer2.Add(text2, 0, wx.ALL | wx.EXPAND, 5) v_boxSizer2.Add(h_boxSizer1, 0, wx.ALL | wx.EXPAND, 5) v_boxSizer2.Add(text3, 0, wx.ALL | wx.EXPAND, 5) v_boxSiz...
Python
1
from typing import List from fastapi import APIRouter, Depends from app.authentication.services import get_user_is_installer from app.exceptions import PageNotFoundException from app.hotels.schemas import HotelSchemaForm, UpdateSchemaForm, ListHotelSchema, DetailHotelSchema, BaseHotelSchema from app.hotels.services i...
Python
1
es: `\"Win32_Graphics_Gdi\"`*"] pub fn CreateHalftonePalette(hdc: HDC) -> HPALETTE; #[doc = "*Required features: `\"Win32_Graphics_Gdi\"`*"] pub fn CreateHatchBrush(ihatch: HATCH_BRUSH_STYLE, color: u32) -> HBRUSH; #[doc = "*Required features: `\"Win32_Graphics_Gdi\"`, `\"Win32_Foundation\"`*"] #[cf...
Rust
0
} ] }, "recovery": { "name": "recovery", "zbi": "path/to/recovery.zbi", "vbmeta": "path/to/recovery.vbmeta" } } "#; let mut cursor = std::io::Cursor::new(json); ...
Rust
0
import unreal_engine as ue from unreal_engine.classes import Object, StrProperty, IntProperty from unreal_engine import CLASS_CONFIG, CLASS_DEFAULT_CONFIG, CPF_CONFIG def config(arg): config_name = None def wrapper(u_class): cflags = u_class.class_get_flags() u_class.class_set_flags(cflags|CLA...
Python
1
rs == 3 { future[i][j] = 1; } else { future[i][j] = cell_state; } } } // return the future generation future } // main function fn main() { let mut rng = rand::thread_rng(); // set the number of rows and columns of the grid let (...
Rust
0
} def run_recovery(config, soc_family, log_queue): sys.stdout = open(os.devnull, "w") sys.stderr = open(os.devnull, "w") import snagrecover.config snagrecover.config.recovery_config = config logger = logging.getLogger("snagrecover") logger.propagate = False logger.handlers.clear() log_handler = logging.ha...
Python
1
Debug, PartialEq, Serialize, Deserialize, Default)] pub struct HyperVReplicaAzureTestFailoverInput { #[serde(flatten)] pub test_failover_provider_specific_input: TestFailoverProviderSpecificInput, #[serde(rename = "primaryKekCertificatePfx", default, skip_serializing_if = "Option::is_none")] pub primar...
Rust
0
为段落组合 paragraph.scale = scale paragraph.pdf_paragraph_composition = [] for unit in typeset_units: for char in unit.render(): paragraph.pdf_paragraph_composition.append( PdfParagraphComposition(pdf_cha...
Python
1
(txt.to_owned())); } if let Some(path) = path { path.split('/').for_each(|i| pi.path.push(i)) } Ok(pi) } /// Return `true` if this IRI reference is absolute. pub fn is_absolute(&self) -> bool { self.scheme.is_some() } /// Resolve `other` using th...
Rust
0
: entity_id: 实体 ID Returns: Dict[str, float]: 包含今日用电量的字典,包括: - total: 总用电量 """ local_tz = ZoneInfo("Asia/Shanghai") now = datetime.now(local_tz) today_start = now.replace(hour=0, minute=0, second=0, microsecond=0) ...
Python
1
import requests import json from pprint import pprint import base64 import time def display_image(content): # Display the image in the terminal using the Inline Image Protocol # https://iterm2.com/documentation-images.html base64_content = base64.b64encode(content).decode('utf-8') # 保存QR码图片到文件作为备用...
Python
1
`df` is a PyArrow Table without importing PyArrow.""" return bool((pa := get_pyarrow()) is not None and isinstance(df, pa.Table)) def is_numpy_array(arr: Any) -> TypeGuard[np.ndarray]: """Check whether `arr` is a NumPy Array without importing NumPy.""" return bool((np := get_numpy()) is not None and isins...
Python
1
ule clock"] #[inline(always)] pub fn value2(self) -> &'a mut W { self.variant(DISR_A::VALUE2) } #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bi...
Rust
0
const PALLET: &'static str = "Vault"; const FUNCTION: &'static str = "create"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ClaimSurcharge { pub dest: ::core::primitive::u64, pub address: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, } impl...
Rust
0
alEqInterface); let mut n100=100; let right:DynTrait<'static,&mut (),PartialEqInterface>= DynTrait::from_any_ptr(&mut n100,PartialEqInterface); assert_eq!(left,right); } { let left= DynTrait::from_any_value(200,PartialEqInterface); let right= DynTrait::from_any_ptr(RAr...
Rust
0
{ "data": { "attachment": null, "buttons": null, "elements": [ { "a": "b" } ] }, "event": "bot", "text": null, "timestamp": 1542649219.331037 } """ actual = interactive._chat_history_table([json.loads(test_even...
Python
1
# Scrapy settings for neuralcrawling project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # https://docs.scrapy.org/en/latest/topics/settings.html # https://docs.scrapy.org/en/latest/topics/downloader-mid...
Python
1
from langchain.prompts import PromptTemplate template = """Question: {question} Answer:""" prompt = PromptTemplate( template=template, input_variables=["question"] ) question = "What is the capital city of France"
Python
1
⛏', '᪪', '𐧥', 'ﲆ', '𛃼', '𘬃', '\u{1c2c}', '𘮨', 'Ꞡ', '𝗧', '𓅙', '\u{1e029}', 'ﴥ', '開', '𝠧', '𝒅', 'ḍ', '𔖰', 'ꭨ', 'Ȼ', 'ᧄ', '⫞', '𘲟', '𝌵', '\u{1cdd}', '𝖽', '🍈', 'ꭣ', '𐄊', '𝗍', '𝗑', 'ࡾ', '🭆', 'ߓ', '𘥼', '⻜', '𝅃', 'ॵ', '𑛁', '𛈷', 'ᚣ', '💉', 'Ɔ', '𝔚', 'ꪁ', '螺', '洛', '࠾', '𖭑', '𐭀', '⩃', 'ꚰ'...
Rust
0
import numpy as np import matplotlib.pyplot as plt # 学習パラメータ alpha = 0.1 n_epochs = 1000 n_samples = 200 n_features = 2 # 意味のある人工データを作成 np.random.seed(42) # クラス0のデータ(左下の領域) X0 = np.random.randn(n_samples//2, n_features) + np.array([-2, -2]) y0 = np.zeros(n_samples//2) # クラス1のデータ(右上の領域) X1 = np.random.randn(n_sample...
Python
1
import numpy as np def weight_experimental_semivariance(weights: np.ndarray, distances_in_range: np.ndarray, vals_0: np.ndarray, vals_h: np.ndarray) -> float: """ Function calculates weighted semivar...
Python
1
> Pool<ConnectionManager<MysqlConnection>> { let database_url = format!( "mysql://{}:{}@{}:{}/{}", config.user, config.password, config.host, config.port.unwrap_or(Self::DEFAULT_PORT), config.db_name ); info!( "...
Rust
0