text
string
label_name
string
labels
int64
ge) else: await roll_cmd.send( f"{event.sender.nickname}阁下,命令格式不正确哦~请提供{skill_name}的数值哦~") if rule == "fu": pass else: # await roll_cmd.send(location+"3") d...
Python
1
import cv2 import pandas as pd import csv import os import numpy as np from collections import defaultdict #畫bounding_box框框,return畫上bounding box的圖 def draw_rectangle(img, x, y, w, h): x1 = int(x - w / 2) y1 = int(y - h / 2) x2 = int(x1 + w) y2 = int(y1 + h) left_up = (x1, y1) right_down = (x2,...
Python
1
transform * Matrix4::new_translation(&Vector3::new(0.0, height * 0.5 - radius, 0.0)), color, ); // Bottom cap self.draw_sphere_section( radius, std::f32::consts::PI..std::f32::consts::PI * 1.5, 10, 0.0..std::f32::consts::T...
Rust
0
hould be at least {nprocs}x the sleep time self.assertGreaterEqual(elapsed, Expensive.SLEEP_SECS * nprocs) # test the parallel case os.environ[mp.ENV_VAR_PARALLEL_START] = "1" start = time.perf_counter() mp.start_processes(expensive.my_call, nprocs=nprocs, start_method=start_met...
Python
1
def abc(level): print('@', end=' ') if level==2: return print('@', end=' ') for i in range(2): abc(level+1) print('@', end=' ') abc(0)
Python
1
24, _ => unreachable!(), }; } else { let i = (word >> 26) & 0b1; let imm3 = (word >> 12) & 0b111; let a = (word >> 7) & 0b1; let encoded_shift = a | imm3 << 1 | i << 4; full = (base | 1 << 7) << (0x20 - encoded_shift); spill |= 0b1000; if ...
Rust
0
from setuptools import find_packages, setup package_name = 'lekyshka' setup( name=package_name, version='0.0.0', packages=find_packages(exclude=['test']), data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ('share/' + package_name, ['p...
Python
1
um.rs use crate::dynamics::{ASDynamics, PoissonRate, BrownianMotionWithDrift}; use rand::thread_rng; use rsrl::{ domains::{Domain, Transition, Observation}, spaces::{ real::{Reals, Interval}, ProductSpace, TwoSpace, PairSpace, }, }; const INV_BOUNDS: [f64; 2] = [-50.0, 50.0]; pub struct Ze...
Rust
0
(), m23: N::zero(), m33: N::zero(), } } /// Create a new SDP matrix with its diagonal filled with `val`, and its off-diagonal elements set to zero. pub fn diagonal(val: N) -> Self { Self { m11: val, m12: N::zero(), m13: N::zero(), ...
Rust
0
abel and show the question and input box instruction_label.pack_forget() interview_button.config(text="Next Question", command=next_question) next_question() # Start by showing the first question # Function to restart the interview def restart_interview(): global question_coun...
Python
1
se_args() suite = PerformanceTestSuite(base_url=args.base_url) if args.test_type == "complete": await suite.run_complete_test_suite() elif args.test_type == "load": results = [] for config in suite.test_configs: config.concurrent_users = args.users c...
Python
1
} else { html!{ <> {&self.section} </> } } } }<filename>components/dom/src/character_data.rs #[derive(Debug)] pub struct CharacterData { data: String, } impl CharacterData { pub fn new(data: String) ...
Rust
0
field_init(form: Option<FORM>) -> Option<Form_Hook> { assert!(form.map_or_else(|| true, |form| !form.is_null()), "{}field_init() : form.is_null()", MODULE_PATH); (bindings::field_init(return_mut_ptr!(form)) as Form_Hook).as_mut().map(|ptr| mem::transmute(ptr)) } /// # Safety /// /// <https://invisible-island...
Rust
0
|-- |-- |-- |-- (input1, Causality.input, SignalType.Real, None, 'None') ## |-- |-- |-- |-- (input2, Causality.input, SignalType.Real, None, 'None') ## |-- |-- |-- Parameter Bindings: resources/mappingssm2.ssv ## |-- |-- |-- |-- Parameter Mapping: resources/mappingssm2.ssm ## |-- |-- |-- Parameter Bindings: resources/...
Python
1
# model model_name = 'LSTM' use_checkpoint = None feature_size = 4096 hidden_size = 256 max_frames = 25 nbits = 16 S5VH_type = 'small' # dataset dataset = 'fcv' workers = 12 batch_size = 512 mask_ratio = 0.3 # preprocess latent_dim_pca = 512 initWithCSQ = True rho = 5e-5 gamma = (1 + 5 ** 0.5) / 2 # train seed = 1 n...
Python
1
ccccc], [0x0 ~> 0x46666666], [0x0 ~> 0x8ccccccc], [0x0 ~> 0x8ccccccc], [0x0 ~> 0x46666666], [0x0 ~> 0x8ccccccc], [0x0 ~> 0x8ccccccc], [0x0 ~> 0x46666666], [0x0 ~> 0x8ccccccc], [0x0 ~> 0x8ccccccc], [0x0 ~> 0x46666666], [0x0 ~> 0x8ccccccc], [0x0 ~> 0x46666666]] * Output Bounds: * out1: [[0x0 ~> 0x1a6666664], [0x0 ~> ...
Rust
0
data data[INDEXES_START + slot - 1] = index # put signature to data data[SIGNATURES_START + 64 * (slot - 1) : SIGNATURES_START + 64 * slot] = signature return bytes(data) def sign(data, is_pem): # Ask for index and private key and signs the firmware slot = int(input(f"Enter signature slot (1...
Python
1
s = args .iter() .map(|arg| arg.dump()) .collect::<Vec<String>>() .join(", "); match dst { Some(dst) => format!(" {} = call {}({})", dst.dump(), name, args), None => format!(" call {...
Rust
0
entry["subreddit"] = rj["data"]["subreddit"] if PREPEND_SUBREDDIT: entry["title"] =\ "[" + entry["subreddit"] + "] " + entry["title"] if PREPEND_SCORE: score = rj["data"]["score"] if "reddit-score" in entry...
Python
1
import pandas as pd from pyecharts.charts import WordCloud, Bar, Page from pyecharts import options as opts def generate_word_freq_bar(word_freq, n=10): bar = Bar() bar.add_xaxis([w for w, _ in word_freq[0:n]]) bar.add_yaxis("", [c for _, c in word_freq[0:n]]) bar.set_global_opts( title_opts=o...
Python
1
except ValueError: # Si el formato no es correcto, mantener la fecha actual pass else: usuario.fecha_nacimiento = fecha_nacimiento usuario.save() # Actualizar tipo de usuario específico if hasattr(usuario, 'estudiante'...
Python
1
from itertools import product for pos, num in enumerate(range(10000, 100000), start=1): num = str(num) if num[0] != '0': for i in '02468': num = num.replace(i, '*') for i in '13579': num = num.replace(i, '+') if num.count('**') == 0 and num.count('++') == 0 and p...
Python
1
# === file: report.py === from reportlab.lib.pagesizes import LETTER from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer from reportlab.lib.styles import getSampleStyleSheet from reportlab.lib.units import inch from datetime import datetime import re def strip_markdown(md_text): # Remove markdown ...
Python
1
# Generated by Django 1.11 on 2018-08-24 08:22 from __future__ import unicode_literals from django.db import migrations def forwards(apps, schema_editor): db_alias = schema_editor.connection.alias ContentType = apps.get_model('contenttypes', 'ContentType') CMSPlugin = apps.get_model('cms', 'CMSPlugin') ...
Python
1
self.storage .remove_block(Context::new(), block.header.height) .await?; self.storage .set_block(Context::new(), block.clone()) .await?; log::info!( "block set successfully: {}", serde_json::to_string(&block).unwrap() ...
Rust
0
, pub __tm_gmtoff: c_int, pub __tm_zone: *const c_char, pub __tm_nsec: c_int, } pub struct timeval { pub tv_sec: time_t, pub tv_usec: suseconds_t, } pub struct timespec { pub tv_sec: time_t, pub tv_nsec: c_long, } pub struct tms { ...
Rust
0
# coding=utf-8 import torch def generate_attn_masks(perm): """Generate attention masks given a sequence permutation (includes pos. for bos and eos tokens) :param perm: the permutation sequence. i = 0 is always the BOS :return: lookahead attention masks """ sz = perm.shape[0] mask = torch.zeros...
Python
1
def filtrar_concurso(concurso, conteudo_paragrafo): palavras_chave_ti = [ "TI", "Tecnologia da Informação", "Informatica", "Informática", "Analista de Sistemas", "Desenvolvedor", "Programador", "Banco de Dados", "DBA", "Redes", "Infraestrutura" ] palavras_chave_direito = [ ...
Python
1
import logging import httpx from app.config import settings from app.core.interfaces.translate_provider import TranslateProvider from app.metrics import BACKEND_TRANSLATOR_METRICS logger = logging.getLogger(__name__) class GoogleTranslator(TranslateProvider): def __init__( self, http_client: ht...
Python
1
Ok(Self { target: Target::Buffer(PhantomData), size: (w, h), buffer: Buffer::Borrowed(buf), saved: false, _pantomdata: PhantomData, }) } #[inline(always)] pub(crate) fn get_raw_pixel_buffer(&mut self) -> &mut [u8] { self.buffer...
Rust
0
_and_new { ($e:expr) => { $crate::new!($crate::map_from($e)) }; } /// Provides a closure, which captures a new [`Frame`] in the invocation place /// and wraps the given error into a [`Traced`] wrapper containing this /// [`Frame`]. If the error represents a [`Traced`] already, then just growths /// its...
Rust
0
d split with train, val, test mask of the dataset {experiment['dataset']['name']}") else: logging.info( f"Dataset {experiment['dataset']['name']} doesn't provide train, val, test splits. Using get_train_val_test() for the splitting the dataset to train_ratio=0.6, val_ratio=0.2, test_ratio=0.2." ...
Python
1
2\x0f\x9b\x87\xb2\x86\xaa\x12\ Y\x02l\x1eJ\x02U%2\x0f\x9b\x87\xb2\x86\xaa9\ \x96\xea\x16\x5cz\xe9\xa5l|\x14\x9du\xd6\xb0B\xa1\ e\xcd\x02\xe2\x1f\x85B\xeb\x07\x1e\x18\xba\xe1\x86\x9d\x8a\ \xe7l\xde\xbc\xf9\xf8\xf1\xe3\xef\xbf\xff\xfe:~\xae\xc8\ \xe6!M\xa8*\x91y\xd8<\x945T\x95\xc8\x12`\ \xf3P\x12\xa8*\x91y\xd8<\x945T\xcd...
Python
1
# Copyright (c) 2025, NVIDIA CORPORATION. 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 required by appli...
Python
1
ображения: {e}") return None, None async def auto_analyze_generated_image(image_content: bytes, prompt: str, token: str) -> Optional[str]: """Автоматически анализирует сгенерированное изображение и возвращает описание. Эта функция используется для сохранения контекста о сгенерированных изображени...
Python
1
#!/usr/bin/env python import neocities import requests import os import click from tabulate import tabulate import shutil CONTEXT_SETTINGS = dict( help_option_names=["-h", "--help"], token_normalize_func=lambda x: x.lower() ) supExt = [ ".html", ".htm", ".jpg", ".png", ".gif", ".svg", ...
Python
1
l_u32(mapping), 2); } #[test] #[should_panic] fn test_and_operators_fail() { parse_expr_helper("2 && -1"); } #[test] fn test_paren() { assert_eq!(parse_expr_helper("(1 & 2) | 3").eval_u32(mapping), 3); assert_eq!( parse_expr_helper("(0b10101 | 0b1010) + ...
Rust
0
type Target = crate::FieldReader<bool, bool>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl R { #[doc = "Bit 0 - Channel 0 Single Request Status"] #[inline(always)] pub fn ch0sreqstatus(&self) -> CH0SREQSTATUS_R { CH0SREQSTATUS_R::new((self.bits & 0x0...
Rust
0
mat!("{}", api_params)); } let full_uri = path + &url_params; let opt_request: Option<&EmptyRequest> = None; do_request(&self.client, &full_uri, &headers, "GET", opt_request).await } /// Returns an IAM policy for the specified bucket. pub async fn get_iam_policy(&self, par...
Rust
0
BlockChain for BlockChainDatabase<T> where T: KeyValueDatabase { fn insert(&self, block: IndexedBlock) -> Result<(), Error> { BlockChainDatabase::insert(self, block) } fn rollback_best(&self) -> Result<H256, Error> { BlockChainDatabase::rollback_best(self) } fn canonize(&self, block_hash: &H256) -> Result<(...
Rust
0
ion::None) .build("data.rs") .unwrap(); } <filename>common/mixnet-contract/src/mixnode.rs // due to code generated by JsonSchema #![allow(clippy::field_reassign_with_default)] use crate::{IdentityKey, SphinxKey}; use cosmwasm_std::{coin, Addr, Coin}; use schemars::JsonSchema; use serde::{Deserialize, Serialize...
Rust
0
, 0x5865_172E, 0x2F41_3153), (r"textures\tx_stars_warrior.dds", 0x5865_172E, 0x3428_E641), (r"textures\tx_statue_ua_c_p.dds", 0x5865_172E, 0x3BBF_76CD), (r"textures\tx_steamclouds2.dds", 0x5865_172E, 0x45F1_DAC3), (r"textures\tx_stars_nebula3.dds", 0x5865_172E, 0x5A31_EE0F), (r"textures\tx_star...
Rust
0
# SPDX-License-Identifier: MIT import requests from html.parser import HTMLParser from urllib.parse import urljoin website = "https://krittikaiitb.github.io/" class Parser(HTMLParser): def __init__(self): super().__init__() self.links = [] def handle_starttag(self, tag, attrs): if ta...
Python
1
x { object.key("Prefix").string(var_1991); } Ok(()) } pub fn serialize_structure_crate_model_aws_cloud_front_distribution_origins( object: &mut aws_smithy_json::serialize::JsonObjectWriter, input: &crate::model::AwsCloudFrontDistributionOrigins, ) -> Result<(), aws_smithy_http::operation::Seria...
Rust
0
= events .iter() .filter_map(|r| match r.event { Event::redeem(RedeemEvent::RequestRedeem(id, _, _, _, _, _, _, _)) => Some(id), _ => None, }) .collect::<Vec<H256>>(); assert_eq!(ids.len(), 1); ids[0] } pub fn execute_redeem(redeem_id: H256) { Execut...
Rust
0
import numpy as np class _MockFunction: def __init__(self, return_value = None): self.number_calls = 0 self.return_value = return_value self.last_args = ([], {}) def __call__(self, *args, **kwargs): self.number_calls += 1 self.last_args = (args, kwargs) return s...
Python
1
variables) char char_global = 12; uchar uchar_global = 234; short short_global = -321; ushort ushort_global = 432; int int_global = 1234; uint uint_global = 2345; float float_global = 4.5f; long long_global = -77777; ulong ulong_global = 8888; double double_global = -456.5f; char2 char2_global = {11, -22}; uchar2 uch...
Rust
0
for (mut input, wanted) in tests { let mut dst = test_writer(2, 2); { let mut future = dst.write_all_vectored(&mut *input); match Pin::new(&mut future).poll(&mut cx) { Poll::Ready(Ok(())) => {} other => panic!("unexpected...
Rust
0
in entities: if isinstance(entity, Pole): pole = bp.find_entity_at_position(entity.pos) bp_pole_by_pos[entity.pos] = pole for pole in poles: bp_pole = ElectricPole(position={"x": pole.pos[0], "y": pole.pos[1]}, name=pole.pole_type.name, ) bp.entities.append(bp_pole, copy=False) ...
Python
1
ar.com/get HTTP/1.1\r\n"); buffer.put_slice(b"connection: keep-alive\r\n"); buffer.put_slice(b"Host: \tfoo.bar.com \t\r\n"); buffer.put_slice(b"User-Agent: whatever"); buffer.put_slice(REQUEST_END_MARKER); let result = codec.decode(&mut buffer); assert!(result.is_ok()); ...
Rust
0
trie = [[0]*26] def insert(s): cur = 0 for c in s: x = ord(c) - ord('A') if not trie[cur][x]: trie[cur][x] = len(trie) trie.append( [0]*26 ) cur = trie[cur][x] return cur #insert all the strings here first queue = [0] fail = [0]*len(trie) fail[0] = -1 for i in range(len(trie)): c = queue[i] for x in...
Python
1
import jax.numpy as jnp import jaxsim.api as js import jaxsim.rbda from jaxsim import VelRepr def test_tn_curve(jaxsim_model_single_pendulum: js.model.JaxSimModel): model = jaxsim_model_single_pendulum new_act_params = jaxsim.rbda.actuation.ActuationParams() with new_act_params.editable(validate=False) ...
Python
1
// eval always means flags are evaluated to false. assert_eq!(eval(&cfg, "x86_64-unknown-linux-gnu"), Ok(Some(false))); assert_eq!(eval(&cfg_not, "x86_64-unknown-linux-gnu"), Ok(Some(true))); let spec: TargetSpec = cfg.parse().unwrap(); let spec_not: Target...
Rust
0
from django.urls import include, path from . import views urlpatterns = [ path("checkout/", views.create_checkout_session, name="checkout-session"), path("woopay/", include("payments.api_endpoints.WooPay.urls")), ]
Python
1
stes IDs de CP (CP_001, CP_002, CP_003) PRECISAM BATER # com os IDs que você configurou no charge_point_simulator.py cps_and_connectors = [ ("CP_001", 1), ("CP_001", 2), ("CP_002", 1), ("CP_002", 2), ("CP_003", 1), ("CP_003", 2) # Adicionado CP_003 para corresponder a...
Python
1
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the FAIR Noncommercial Research License # found in the LICENSE file in the root directory of this source tree. import logging import torch from torch import nn _logger = logging.getLogger(__name__) cl...
Python
1
from pymeow import * """ Example: mem = Memory("linux_64_client", True) print(mem.read(0x0000000005BACD38, "int")) mem.write(0x0000000005BACD38, "int", 10) print(mem.read(0x0000000005BACD38, "int")) """ class Memory: def __init__(self, process_name, debug=False): self.read_switch = { "int": r...
Python
1
j[1], ] ) else: out1, out2 = model([i.float().to(torch.device("cuda:0" if torch.cuda.is_available() else "cpu")) for i in j[:-2]]) loss1 = criterion( out1, l1.to(torch.device("cuda:0" if torch.cuda.is_availa...
Python
1
)", "set(ANDROID_ABI arm64-v8a)", "set(ANDROID_STL c++_static)", "\nset(CMAKE_TOOLCHAIN_FILE ${CMAKE_ANDROID_NDK}/build/cmake/android.toolchain.cmake)" )); result.push_str(concatln!( "\n# define used for external data, mostly just the qpm dependencies", ...
Rust
0
, PartialEq)] pub enum RespondentType { /// All market participants #[serde(rename = "1")] AllMarketParticipants, /// Specified market participants #[serde(rename = "2")] SpecifiedMarketParticipants, /// All Market Makers #[serde(rename = "3")] AllMarketMakers, /// Primary Market Maker(s) #[serde(rename = "4...
Rust
0
/// /// If the policy determines the operation should not be retried (for example the error is /// terminal, or the retries have reached their configured limits), `None` will be returned. /// Typically the caller should then propagate the error, or otherwise handle it in some way. fn check_retry(&mu...
Rust
0
# This examples shows how the visibiliy of distortions changes with display brightness. # As the peak luminance of the simulated display is increased, the distortion (noise) # becomes more visible and the quality is decreased. # Important: This and other examples should be executed from the main ColorVideoVDP direct...
Python
1
import tkinter as tk from tkinter import simpledialog from tkinter import font as tkFont from playwright.sync_api import sync_playwright import pandas as pd import time import os # 站点配置 sites = [ { # "name": "", "url": "", "login_selector": "iframe[name='mainFrame']", "input...
Python
1
pin interrupt input 7 as the source to bit slice 0."] INPUT_7_SELECTS_PIN, } impl SRC0W { #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _bits(&self) -> u8 { match *self { SRC0W::INPUT_0_SELECTS_PIN => 0, SRC0W::INPUT_1_SELECTS_PIN => 1, SRC0W::IN...
Rust
0
precompiled_model( model_path: str, model_name: str, model_version: VersionType, model_component: str, ignore_cached_model: bool = False, ): """ Caches pre-compiled model in default asset path to be used in sub-sequence demos. """ asset_config = ModelZooAssetConfig.from_cfg() mod...
Python
1
("syntax error, unexpected {:?}", p.peek()), }; } fn reduced_67<P>(p: &mut P, nt: Nonterminal) where P: Parser<Terminal = Terminal, Nonterminal = Nonterminal> { match nt { _ => unreachable!(), }; } <reponame>fhartwig/hyper use std::fmt; use header; /// The `Access-Control-Max-Age` response header...
Rust
0
latten(pd.read_excel(df_slhf, f'{sector} Region'))) df_sshf_flat = standardize(flatten(pd.read_excel(df_sshf, f'{sector} Region'))) df_u10_flat = standardize(flatten(pd.read_excel(df_u10, f'{sector} Region'))) df_v10_flat = standardize(flatten(pd.read_excel(df_v10, f'{sector} Region'))) df_t2m_flat = ...
Python
1
int("-" * 70) while current_total_cost <= budget: epoch += 1 # Select arm using UCB-B2 chosen_arm = algorithm.select_arm(current_total_cost, epoch) # Pull the arm cost, reward = env.pull_arm(chosen_arm) # Update algorithm state ...
Python
1
""" Created on Mar 30, 2022 1:21:54 PM Author: Josef Perktold License: BSD-3 """ import numpy as np from numpy.testing import assert_allclose def _mover_confint(stat1, stat2, ci1, ci2, contrast="diff"): """ References ---------- .. [#] Krishnamoorthy, K., Jie Peng, and Dan Zhang. 2016. “Modified L...
Python
1
); } fn combine_struct_sample() { let identity = verify( &ctx, VerifyLogin { type_: LoginType::Username, username: args.username.clone(), password: Some(<PASSWORD>()), domain: None, }, )?; } fn combine_macro_sample() { rocket::ign...
Rust
0
#from airflow.models.dag import DAG from airflow.sdk import DAG #from airflow.operators.python import PythonOperator from airflow.providers.standard.operators.python import PythonOperator from src.bot_telegram import Bots from pendulum import today, duration bot = Bots() default_args = { 'depends_on_past' : False...
Python
1
self._lastPencilPos[1], y, x, brushSize, doMask, ) # Draw the very first, or last point self._mask.updateDisk(level, y, x, brushSize / 2.0, doMask)...
Python
1
xmm2, xmm3/m128/m32bcst` /// /// `EVEX.128.F2.MAP6.W0 56 /r` /// /// `AVX512VL and AVX512-FP16` /// /// `16/32/64-bit` EVEX_Vfcmaddcph_xmm_k1z_xmm_xmmm128b32 = 4418, /// `VFCMADDCPH ymm1 {k1}{z}, ymm2, ymm3/m256/m32bcst` /// /// `EVEX.256.F2.MAP6.W0 56 /r` /// /// `AVX512VL and AVX512-FP16` /// /// `16/3...
Rust
0
I_LIST); } }); }); } } <reponame>WolframResearch/wolfram-library-link-rs use wolfram_library_link::{self as wll, NumericArray, NumericArrayKind}; /// This function is loaded by evaluating: /// /// ```wolfram /// LibraryFunctionLoad[ /// "/path/to/libnumeric_arrays.dylib", //...
Rust
0
a=input("enter the str : ") with open("d:/Programming/Python/01Basic Python/Chapter 9 ps/long.html") as f: lines =f.readlines() lineno=1 for line in lines: if( a in line): print(f"yes it is present. line no: {lineno}") break lineno +=1 else: print("no it is not present")
Python
1
} else { (libc::R_OK, true, false) } } libc::O_WRONLY => (libc::W_OK, false, true), libc::O_RDWR => (libc::R_OK | libc::W_OK, true, true), // Exactly one access mode flag must be specified _ => { ...
Rust
0
&Self) -> bool { self == other } } /* Copyright 2018-2019 <NAME> * * Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or * http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or * http://opensource.org/licenses/MIT>, at your option. This file may not be * copied, mod...
Rust
0
his register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information abo...
Rust
0
D1(..) | image::Kind::D1Array(..) => winapi::D3D12_SRV_DIMENSION_TEXTURE1D, image::Kind::D2(..) | image::Kind::D2Array(..) => winapi::D3D12_SRV_DIMENSION_TEXTURE2D, image::Kind::D3(..) | image::Kind::Cube(..) | image::Kind::CubeArray(..) => w...
Rust
0
crate) fn move_to_column_csi_sequence(count: u16) -> String { format!(csi!("{}G"), count) } pub(crate) fn move_to_previous_line_csi_sequence(count: u16) -> String { format!(csi!("{}F"), count) } pub(crate) fn move_to_next_line_csi_sequence(count: u16) -> String { format!(csi!("{}E"), count) } pub(crate) ...
Rust
0
from flask_sqlalchemy import SQLAlchemy from sqlalchemy import DateTime from datetime import datetime db = SQLAlchemy() class UploadedFile(db.Model): id = db.Column(db.Integer, primary_key=True) filename = db.Column(db.String(255)) filepath = db.Column(db.String(255)) uploaded_at = db.Column(DateTim...
Python
1
""" build123d.topology package name: __init__.py by: Gumyr date: January 07, 2025 desc: This package contains modules for representing and manipulating 3D geometric shapes, including operations on vertices, edges, faces, solids, and composites. The package provides foundational classes to work with 3D o...
Python
1
Code = 65554; pub const U_UNDEFINED_SEGMENT_REFERENCE: UErrorCode = 65553; pub const U_TRAILING_BACKSLASH: UErrorCode = 65552; pub const U_MULTIPLE_POST_CONTEXTS: UErrorCode = 65551; pub const U_MULTIPLE_CURSORS: UErrorCode = 65550; pub const U_MULTIPLE_ANTE_CONTEXTS: UErrorCode = 65549; pub const U_MISSING_SEGME...
Rust
0
itialized(storage: &dyn Storage) -> StdResult<bool>{ Ok(INITIALIZED.load(storage)?) } // epoch pub fn next_epoch_point(storage: &dyn Storage) -> StdResult<Uint128> { let starttime = START_TIME.load(storage)?; let epoch = EPOCH.load(storage)?; Ok(starttime + epoch * Uint128::from(PERIOD)) } // oracle pu...
Rust
0
', '𞅄', '𓋴', '🩆', '𑒡', '𛱱', '𝦆', 'ᩐ', '𑫊', '🤒', 'ꂿ', '贈', '\u{e01d4}', 'ퟔ', '🐘', '𓁽', '𝒥', '𑇁', '\u{11c98}', '𑋉', 'ﰃ', '𓏥', '例', '𩅅', '䧦', '\u{11639}', '𓀱', '\u{13430}', 'ן', '🝍', '∍', '😤', '𘯽', '𖹴', '𝂃', '𑊝', '𝃁', 'ቛ', '𖹧', '🪥', '𐒍', 'ൈ', '𒓿', '⁀', '𝙯', '⨋', '𐩼', 'ꕱ', '⤜', ...
Rust
0
et Label::Loop { last_continue } = label { loop_stack.push((i, *last_continue)); } check(&loop_stack, i, instr)?; // Pop if last continue match instr { // Back jump/"continue" Bytecode::Branch(j) | Bytecode::BrTrue(j) | Bytecode::BrFalse(j) if *j <= ...
Rust
0
include/PxConfig.h")); } // Audio channels. pub mod square1; pub mod square2; pub mod wave; pub mod noise; use crate::common::{ bits::u8, bytes::u16 }; pub trait GBChannel { /// Clock the channel and recalculate the output if necessary. /// /// Call at 2^14 Hz. fn sample_clock(&mut self, cycl...
Rust
0
ates, &[ "1997-09-13T09:00:00-04:00", "1997-10-11T09:00:00-04:00", "1997-11-08T09:00:00-05:00", "1997-12-13T09:00:00-05:00", "1998-01-10T09:00:00-05:00", "1998-02-07T09:00:00-05:00", "1998-03-07T09:00:00-05:00", "199...
Rust
0
boundary_out(x): return torch.isclose(x[:,0], torch.full_like(x[:, 1], bbox[1])) def boundary_other(x): return torch.logical_not(torch.logical_or(boundary_in(x), boundary_out(x))) def u_func(x): # initial boundary flow rate y, t = x[:, 1:2], x[:, 2:3] ...
Python
1
""" 直接使用ActionChain,结合apscheduler实现定时异步任务 """ import asyncio import datetime as dt import logging from datetime import datetime from pepperbot.action import * from pepperbot.action.chain import * from pydantic import BaseModel logging.basicConfig(level=logging.DEBUG) CONFIG = { # 教学周,设置哪一周为第0周 "zeroWeek": ...
Python
1
_main__": if '--once' in sys.argv: # 只执行一次 poll() 并输出最终结果(用于通过子进程调用时解析) result = poll() if result: print("FINAL_RESPONSE: " + result) else: print("FINAL_RESPONSE: No new transactions.") sys.exit(0) else: # 设置轮询间隔(例如每 5 秒一次,生产环境中可改为更...
Python
1
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations from typing_extensions import Literal, Required, TypedDict from .shared_params.carrier import Carrier from .shared_params.shipping_address import ShippingAddress __all__ = ["CardRenewParams"] c...
Python
1
"string") def test_id(self): test = unittest.FunctionTestCase(lambda: None) self.assertIsInstance(test.id(), basestring) # "Returns a one-line description of the test, or None if no description # has been provided. The default implementation of this method returns # the first line of t...
Python
1
import torch import os import sys import copy import re s = 'outputs/jigclu_pretrain/model_best.pth.tar' t = 'detection/jigclu_det.pth' s_dict = torch.load(s, map_location=torch.device('cpu'))['state_dict'] new_dict = {} prefix = 'module.encoder.' for k in s_dict: if not prefix in k: continue new_k = ...
Python
1
_id, ) continue cdata = stack_parsing.get_crash_token(crash.stacktrace) dst = crash_dir.copy_file(crash.input_path, cdata, build.sanitizer) if crash_set.add( task....
Python
1
= mem::zeroed(); entry.dwSize = mem::size_of::<PROCESSENTRY32>() as DWORD; let ret = Process32Next(self.snapshot.as_raw_handle() as winnt::HANDLE, &mut entry); if ret == 0 { None } else { Some(Process::from_id_with_access( ...
Rust
0
ces) print(cr) Y_pred = model.predict(val_generator) y_pred = np.argmax(Y_pred, axis=1) y_true=val_generator.classes cm=confusion_matrix(y_true,y_pred) cm f, ax=plt.subplots(figsize=(12,8)) sns.heatmap(cm,annot=True,linewidths=0.5,linecolor="red",fmt=".0f",ax=ax,xticklabels=target_names, yticklabels=target_names,) pl...
Python
1
list(res.keys()), f"{list(exp.keys())} vs. {list(res.keys())}" rtol = 1e-4 atol = 1e-5 if with_model2 and mixed_precision and torch_version() >= (1, 9, 0): # On CI, with longer model2, mixed precsion and 1.9, even ddp vs. ddp+ckpt has ...
Python
1
Type::Right) .valign(gtk::Align::Center) .child(&content) .autohide(true) .build(); let tree_cntr = self.account.tree.view_wrapper.clone(); tree_cntr.append(&popover); popover.connect_closed(move |p| tree_cntr.remove(p)); let app = self.c...
Rust
0
''' Metaclasses são os tipos das classes EM PYTHON, TUDO É UM OBJETO (CLASSES TAMBÉM) Então, qual é o tipo de uma classe? (type) Seu objeto é uma instância de sua classe Sua classe é uma instância de type (type é um metaclass) type('Name', (Bases,), __dict__()) Ao criar uma classe, coisas ocorrem por padrão ne...
Python
1