text
string
label_name
string
labels
int64
Point::new(0, 0).unwrap(); let longer = Point::new(20, 40).unwrap(); let end = Point::new(10, 20).unwrap(); let e0 = Edge::original(0, Operand::Clipping, &start, &end).unwrap(); let e1 = Edge::original(1, Operand::Clipping, &start, &end).unwrap(); let e2 = Edge::original(2, Ope...
Rust
0
#[inline] pub fn bits(&self) -> u8 { self.bits } } #[doc = "Possible values of the field `BB_LDO_PD_TRIM`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum BB_LDO_PD_TRIMR { #[doc = "1.20 V ( Default )"] _0, #[doc = "1.25 V"] _1, #[doc = "1.28 V"] _2, #[doc = "1.33 V"]...
Rust
0
# Copyright 2024 Marimo. All rights reserved. import marimo __generated_with = "0.15.5" app = marimo.App() @app.cell def _(mo): mo.md("""# Horizontal""") return @app.cell def _(mo): mo.nav_menu( { "#overview": "Overview", "#sales": f"{mo.icon('lucide:shopping-cart')} Sa...
Python
1
el_chat_model = TravelChatModel() class ChatRequest(BaseModel): message: str session_id: str = None class ChatResponse(BaseModel): response: str session_id: str ar_link: str = None @app.post("/start_chat") async def start_chat(): session = travel_chat_model.create_session() return {"sessi...
Python
1
evroute = Vec::new(); } } // shad is reversed for MultiW so checking dest is in first shad.first_mut().map(|s| // set reply payload write for dest if s.rep.require_additional_payload() { // a bit redundant with require let rref = if otherroute { self.route_prov.new_reply...
Rust
0
let mut _line: i32 = 0; let mut _column: i32 = 0; for _l in _string.lines() { let _length: i32 = _l.to_string().len().try_into().unwrap(); if _length > _column { _column = _length; } _line += 1; } return (_line, _column); } <filename>atelier-rdf/src/wr...
Rust
0
0) } } impl PaddingProvable for SumNodeSmt { type PaddingProof = SumNodeSmt; fn prove_padding_node(&self, _idx: &TreeIndex, _secret: &Secret) -> SumNodeSmt { SumNodeSmt(0) } fn verify_padding_node(node: &SumNodeSmt, proof: &SumNodeSmt, _idx: &TreeIndex) -> bool { node.0 == 0 && proo...
Rust
0
:none() }; fn ceil_div(a: u64, b: u64) -> u64 { (a + b - 1) / b } mod dag_cs { vulkano_shaders::shader! { ty: "compute", path: "src/shader/dag.comp", include: ["src/shader"], vulkan_version: "1.2", types_meta: { #[derive(Copy, Clone, Default, Debug)] ...
Rust
0
# coding:utf-8 import sys from enum import Enum from PySide6.QtCore import QLocale from qfluentwidgets import (qconfig, QConfig, ConfigItem, OptionsConfigItem, BoolValidator, OptionsValidator, RangeConfigItem, RangeValidator, FolderListValidator, Theme, FolderVal...
Python
1
() { let code: Vec<u8> = vec![0xa9, 0x81, 0xa9, 0x00]; let mut cpu = CPU::new(); cpu.load(&code, 0); match cpu.single_step() { Ok(_) => { assert_eq!(cpu.get_flag(Flags::Sign), true); assert_eq!(cpu.get_flag(Flags::Zero), false) } ...
Rust
0
"object", "properties": {} }, } }, { "type": "function", "function": { "name": "Close_Bulter", "description": "用户想退出车辆管家,或不想再查看车辆信息", "parameters": { "type": "object", "properties": {} ...
Python
1
String, serde_json::Value>, } impl MetadataBuilder { pub fn attr<K, V>(mut self, key: K, value: V) -> MetadataBuilder where K: Into<String>, V: Into<serde_json::Value>, { self.metadata.insert(key.into(), value.into()); self } pub fn list<K, V, I>(mut self, key: K,...
Rust
0
" ); simple_error_test!( test_wrong_entity_amount, MshParserErrorKind::InvalidTag, "\ $MeshFormat 4.1 0 8 $EndMeshFormat $Entities 0 0 2 0 0 -1 -1 0 1 1 0 0 0 $EndEntities\ " ); simple_error_test!( test_wrong_bounding_tag_amount, MshParserErrorKind::InvalidTag, "\ $MeshFormat 4.1 0 8 $EndMeshF...
Rust
0
# Thanks to https://colab.research.google.com/drive/1zaVQuobR8M63qB-UDDX8ZX37ctl98YIT # Marian W. : Predykcje niestety dość mocno mijają się z danymi historycznymi. # Translation from polish : Predictions, unfortunately, are quite far from historical data. import pandas as pd import numpy as np import matplotlib.pyplo...
Python
1
let dgram = server.process_output(now).dgram(); assert!(dgram.is_some()); let sdb_before = client.stats().frame_rx.stream_data_blocked; let dgram = client.process(dgram, now).dgram(); assert_eq!(client.stats().frame_rx.stream_data_blocked, sdb_before + 1); assert!(dgram.is_some()); // Clie...
Rust
0
2.putText(image_display, f"LED{current_led}", (closest[0]+10, closest[1]+10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, TEXT_COLOR, 1) current_led = None cv2.imshow("LED Labeling", image_display) if roi_size > 0: cv2.rectangle(image_display, (x-roi_size, y-roi_size), (x+roi_size, y+roi_...
Python
1
e + [route[0]] route = [node + 1 for node in route] distance = distance_calc(distance_matrix, [route, 1]) seed = [route, distance] if (verbose == True): print('') print('Distance = ', round(distance, 2)) print('') if (local_search == True): if (verbose == True)...
Python
1
# -------------------------------------------------------------------------- # Copyright Commvault Systems, Inc. # # 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/...
Python
1
Ok(listen_pid) => listen_pid, Err(std::env::VarError::NotPresent) => return Ok(None), Err(err @ std::env::VarError::NotUnicode(_)) => { return Err(format!("could not read LISTEN_PID env var: {}", err)) } }; let listen_pid = listen_pid ...
Rust
0
js_root, "react_native")) run(["npm", "install", "--package-lock-only", "--ignore-scripts"], cwd=os.path.join(js_root, "react_native")) # upgrade version.ts in each package run(["npm", "ci"], cwd=js_root) run(["npm", "run", "update-version", "common"], cwd=js_root) run(["npm", "run", "update-versio...
Python
1
ger.error(f"🔥 Critical error in media handler: {str(e)}") # if 'analysis_msg' in locals(): # await analysis_msg.edit_text("❌ An error occurred during processing.") # async def start_bot(): # await bot.initialize() # # Further async calls or startup logic here # def main(): # """Enhanc...
Python
1
_outputs= os.path.join(working_dir,'run_{}'.format(datetime.date.today())) t1w32k_lab = 't1' if t1w32k else 'no' sym_lab = 'no' is no_symlinks else 'sy' run_label = '{}_{}_{}'.format(surf_reg, t1w32k_lab, sym_lab) logger = logging.getLogger('ciftify') logger.setLevel(logging.DEBUG) ch = loggi...
Python
1
idump]: https://msdn.microsoft.com/en-us/library/windows/desktop/ms680369%28v=vs.85%29.aspx //! [minidumpwritedump]: https://msdn.microsoft.com/en-us/library/windows/desktop/ms680360%28v=vs.85%29.aspx //! [breakpad]: https://chromium.googlesource.com/breakpad/breakpad/+/master/ //! [struct_minidump]: struct.Minidump.ht...
Rust
0
pt 122"] #[inline(always)] pub fn pri122(&mut self) -> PRI122_W { PRI122_W { w: self } } #[doc = "Writes raw bits to the register."] #[inline(always)] pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { self.0.bits(bits); self } } #[doc = "Interrupt Priority Regist...
Rust
0
------------------- if with_led_chaser: self.leds = LedChaser( pads = platform.request_all("user_led"), sys_clk_freq = sys_clk_freq) # Build -------------------------------------------------------------------------------------------- def main(): from lit...
Python
1
# Copyright 2021 Chariot Solutions Inc. (https://chariotsolutions.com) # and ARM (https://arm.com) 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.o...
Python
1
import pytest from httpx import AsyncClient @pytest.mark.parametrize("email, password, status_code", [ ("kot@pes.com", "kotopes", 200), ("kot@pes.com", "kot0pes", 409), ("pes@kot.com", "pes0kot", 200), ("abcde", "pes0kot", 422), ]) async def test_register_user(email, password, status_code, ac: AsyncCl...
Python
1
roRenderer as CairoRenderer; } else { pub(super) use librsvg::{CairoRenderer, Loader}; } } } #[cfg(test)] #[path = "raster_test.rs"] mod tests; <reponame>simon-fu/srt-rs use std::time::{Duration, Instant}; use bytes::Bytes; use futures::{join, prelude::*}; use srt_tokio::SrtSocket; use...
Rust
0
sponse { Response { base: HttpMessage::new(), cookies: SetCookies::new(), status_code: status, auth: Vec::new(), proxy_auth: Vec::new() } } /// Get the Response status code pub fn status_code(&self) -> HttpStatusCode { ...
Rust
0
import re import pytest from playwright.sync_api import Page, expect from tests.e2e.config import EndToEndTestSecrets from tests.e2e.helpers import retrieve_magic_link from tests.e2e.pages import RequestALinkToSignInPage @pytest.mark.skip_in_environments(["prod"]) def test_magic_link_redirect_journey(page: Page, do...
Python
1
from django.urls import path, include from rest_framework import routers from . import views routers = routers.DefaultRouter() routers.register(r'permission-key', views.PermissionKeyViewSet) routers.register(r'role', views.RoleViewSet) routers.register(r'workspace-membership', views.WorkspaceMembershipViewSet) rout...
Python
1
CRYPT_STRING_BASE64HEADER, buf.as_mut_ptr(), &mut len, ptr::null_mut(), ...
Rust
0
i . ident, colon_token: _i . colon_token, ty: _visitor.fold_ty(_i . ty), default: _i . default, semi_token: _i . semi_token, } } # [ cfg ( feature = "full" ) ] pub fn fold_trait_item_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemKind) -> TraitItemKind { use ::TraitItemK...
Rust
0
(put_big_endian( p as *mut libc::c_void, (*table).checkSumAdjustment as i32, 4i32, ) as isize); p = p .offset(put_big_endian(p as *mut libc::c_void, (*table).magicNumber as i32, 4i32) as isize); p = p.offset(put_big_endian(p as *mut libc::c_void, (*table).flags as i32, 2i32) ...
Rust
0
atch")] InvalidRecordBatchIpcMessage, #[error("Expected new data buffer length to be smaller than current. Id: {0}")] ExpectedSmallerNewDataSize(String), #[error("Cannot create empty shared memory objects")] EmptySharedMemory, #[error("Cannot unwrap Arc")] ArcUnwrap, #[error("Cannot ...
Rust
0
ия вместо каких полей подставить""" filter_dict = filters.model_dump(exclude_unset=True) values_dict = values.model_dump(exclude_unset=True) logger.debug( f"Обновление записей {self.model.__name__} по фильтру: {filter_dict} с параметрами: {values_dict}" ) try: ...
Python
1
s): has_left_char = True break if has_left_char and len(new_entry) > 4: # Make sure it's a number before decrementing if isinstance(new_entry[4], int): new_entry[4] -= 1 ...
Python
1
in self.vertex_buffer_views .iter_mut() .zip(pipeline.vertex_strides.iter()) { view.StrideInBytes = *stride; } } fn bind_graphics_descriptor_sets<'a, T>( &mut self, layout: &n::PipelineLayout, ...
Rust
0
// use oapth::{Config, MysqlAsync}; /// let _ = MysqlAsync::new(&Config::with_url_from_default_var()?).await?; /// # Ok(()) } /// ``` #[inline] pub async fn new(config: &Config) -> crate::Result<Self> { let pool = Pool::new(config.url()); let conn = pool.get_conn().await?; Ok(Self { conn }) } } ...
Rust
0
|d7}tj|||!\|_|j}|}|}|d7}tj|||!\|_|_|}|d7}tj|||!\}|}||7}tr|||!jd|_n|||!|_|}|d7}tj|||!\}|}||7}trP|||!jd|_4n|||!|_4|}|}...
Python
1
<(), RuntimeError>; async fn get_replace_request(&self, replace_id: H256) -> Result<PolkaBtcReplaceRequest, RuntimeError>; } #[async_trait] pub trait DotBalancesPallet { async fn get_free_dot_balance(&self) -> Result<<PolkaBtcRuntime as Core>::Balance, RuntimeError>; ...
Rust
0
# Copyright (c) Facebook, Inc. and its affiliates. from preprocessing.detectron2.layers import ShapeSpec from preprocessing.detectron2.utils.registry import Registry from .backbone import Backbone BACKBONE_REGISTRY = Registry("BACKBONE") BACKBONE_REGISTRY.__doc__ = """ Registry for backbones, which extract feature ma...
Python
1
pub mod ep_status_stall_nak; #[doc = "USB_MUXING register accessor: an alias for `Reg<USB_MUXING_SPEC>`"] pub type USB_MUXING = crate::Reg<usb_muxing::USB_MUXING_SPEC>; #[doc = "Where to connect the USB controller. Should be to_phy by default."] pub mod usb_muxing; #[doc = "USB_PWR register accessor: an alias for `Reg...
Rust
0
"""Functions for modifying game constants.""" from typing import List, Tuple, Union # from src.utils.logging_utils import setup_logger # logger = setup_logger(__name__) def edit_gameplay_constantes_gdconstants(source_path) -> None: """GameData/Gameplay/Constantes/GDConstants.ndf Args: source_path:...
Python
1
n = file_menu.addAction("Load") load_action.triggered.connect(central_manager.load) # Action メニュー action_menu = menu_bar.addMenu("Action") set_blinds_action = action_menu.addAction("Set Blinds") set_blinds_action.triggered.connect(central_manager.set_blinds) set_stacks_action = action_menu.addA...
Python
1
, shape=lig_sim_mat.shape, copy=False) #gets matrix and connects to the sql db and outputs it there def matrix_to_sql(matrix, mol_df): con = create_connection() print("populating df") nonzeroinx = matrix.nonzero() mol1idx = nonzeroinx[0] mol2idx = nonzeroinx[1] arr = matrix.toarray() val = ...
Python
1
from langchain_community.embeddings.xinference import XinferenceEmbeddings __all__ = ["XinferenceEmbeddings"]
Python
1
assert!( Verifier::verify_signature_pok(&pr, &sig_proof, &nonce) .unwrap() .len() == 1 ); let sig_proof_bytes = sig_proof.to_bytes_uncompressed_form(); let sig_proof_dup = SignatureProof::from_bytes_uncompressed_form(&sig_proof_...
Rust
0
yang.read(&ms, yang_name).unwrap(); match yang_parse(&data) { Ok((_, module)) => { ms.modules.insert(module.prefix.to_owned(), module); let entry = ms.modules.get(&"inet".to_string()); if let Some(_) = entry { // Success. } else { ...
Rust
0
# Você está desenvolvendo um programa em Python para calcular a soma dos números pares dentro de um intervalo determinado pelo usuário. O programa deve solicitar ao usuário que insira dois números inteiros, representando o início e o fim do intervalo (inclusive). # Utilize um loop 'for' para iterar sobre todos os núm...
Python
1
bench_as_nat` benchmark runs slower than `bench_9`, something is // wrong and the value is being evaluated at run-time. #[bench] fn bench_as_nat(b: &mut Bencher) { b.iter(|| N9::get_nat()) } #[bench] fn bench_9(b: &mut Bencher) { b.iter(|| 9) } } <filename>crates/web-sys/sr...
Rust
0
class TaskFamily: @staticmethod def get_tasks() -> dict[str, dict]: return { "1": {"existing_rules": "1. Each player starts with 10 points.\n2. Players take turns to roll a six-sided die.\n3. If a player rolls a 6, they gain 2 points.\n4. If a player rolls a 1, they lose 1 point.\n5. The gam...
Python
1
#!/usr/bin/env python from setuptools import setup, find_packages, Command import os import sys class BaseCommand(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass class TestCommand(BaseCommand): description = "run self-tests" de...
Python
1
ra(item_num, tras_mask): """ 从num件商品里随机抽取与每个用户的购买序列等长且不在已购买商品里的标号。后边补全的负样本用虚拟商品[item_num] """ us_negs = [] for utra in tras_mask: # 每条用户序列 unegs = [] for i, e in enumerate(utra): if item_num == e: # 表示该购买以及之后的,都是用虚拟商品[item_num]来补全的 ...
Python
1
import os import streamlit as st from langchain_groq import ChatGroq from langchain_core.prompts import ChatPromptTemplate from langchain_core.output_parsers import StrOutputParser ############################################################################################################## ###########################...
Python
1
::new(CylinderEmitter::new())), _ => Err(String::from("invalid custom emitter kind")), })) } } fn create_steam(graph: &mut Graph, resource_manager: ResourceManager, pos: Vec3) { graph.add_node(Node::ParticleSystem( ParticleSystemBuilder::new( BaseBuilder::new() ...
Rust
0
资源计数递减 pub(crate) fn stop_env( ops_id: usize, peeraddr: SockAddr, request: Vec<u8>, ) -> Result<()> { #[derive(Deserialize)] struct MyReq { uuid: u64, cli_id: CliId, msg: ReqStopEnv, } fwd_to_slave!(ops_id, request, MyReq, peeraddr) } /// 恢复运行先前被 stop 的 ENV /// - 启...
Rust
0
- E) * B res2 = A * res1 + B return (2 * rho * u * t * np.exp(-2 * rho * u * t) + np.exp(-2 * rho * u * t)) * res2[4] def func5(t): res1 = A.I * (expm(t * A) - E) * B res2 = A * res1 + B return (2 * rho * u * t * np.exp(-2 * r...
Python
1
e=f"**`${gambler.default_bet_amount:.2f}`**", inline=True) embed.add_field(name="📈 XP", value=f"**{gambler.xp} XP**", inline=True) embed.add_field(name="⭐ Level", value=f"**Level {gambler.level}**", inline=True) embed.add_field(name="🎁 Daily Reward Rate", value=f"**${gambler.daily:.2f}**", inline=True) ...
Python
1
ssert_eq!( shape( "text-rendering-tests/fonts/NotoSerifKannada-Regular.ttf", "\u{0C97}\u{0CBF}", "--font-size=1000 --ned --remove-default-ignorables --font-funcs=ft", ), "knGI" ); } #[test] fn shknda_1_011() { assert_eq!( shape( "t...
Rust
0
#Программа меняет цвет фона при нажатии на кнопку import pygame import random def randcolor(): return random.choice(list(COLOR_LIST.keys())) COLOR_LIST = { # Цвета (R, G, B) 'Чёрный':(0, 0, 0), 'Белый':(255, 255, 255), 'Касный':(255, 0, 0), 'Зелёный':(0, 255, 0), 'Синий':(0, 0, 255), 'Мокрый асфальт':(96,96,96), ...
Python
1
market_app_id, market_name, install_from_cloud, user): start = datetime.datetime.now() app["update_time"] = market_app_version.update_time ts = self.__init_component_from_market_app(tenant, region.region_name, user, app, tenant_service_group.ID) self.__init_service_source(ts, app, mar...
Python
1
if message.is_empty() { return Err(format!("in line {}: error patterns may not be empty", lineno).into()); } Matcher::Msg(message.to_string()) } Some('[') => { let code = chars.take_while(|&c| c != ']').collect...
Rust
0
########################################################################### # Helper functions @njit(cache=True, fastmath=True) def _initialize_simplex(x0, bounds): n = x0.size vertices = np.empty((n + 1, n), dtype=np.float64) vertices[:] = x0 nonzdelt = 0.05 zdelt = 0.00025 for i in range(n):...
Python
1
# pages/fund_transfer_page.py from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC class FundTransferPage: def __init__(self, driver): self.driver = driver self.url = "https://www.demo.g...
Python
1
else: if res1.json()['ret'][0] == 'FAIL_SYS_SESSION_EXPIRED::Session过期': print(f"[{self.name1}] ❎cookie已过期,请重新获取") return False else: print(f'[{self.name1}] ❌登录失败,原因:{res1.text}') return False exc...
Python
1
rank, drop_last=True, num_workers=data_cfg.num_workers, pin_memory=data_cfg.pin_memory, ) return dataloader if is_predict: # MegatronPretrainingBatchSampler doesn't work with trainer.predict() dataloader = torch.utils.data.DataLoader( ...
Python
1
Id") memeber_set = set(params.keys()) for name, value in vars(self).items(): property_name = name[1:] if property_name in memeber_set: memeber_set.remove(property_name) if len(memeber_set) > 0: warnings.warn("%s fileds are useless." % ",".join(...
Python
1
n, m = map(int,input().split()) hear = {} see = {} for i in range(n): hear[input()] = True for i in range(m): see[input()] = True common = [] for k in hear.keys(): if k in see: common.append(k) common = sorted(common) print(len(common)) for i,v in enumerate(common): print(v)
Python
1
les let maki_points = if self.states.len() <= 5 { PointCalculator::MAKI_POINTS_2_5_PLAYERS } else { PointCalculator::MAKI_POINTS_6_8_PLAYERS }; let ranks = { let second_score = self .states .iter() .map(...
Rust
0
.0 <LICENSE-APACHE or // http://www.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, modified, or distributed // except according to those terms. use generic_array::{ArrayLength, GenericArray}; /// IMPLEMENTED //...
Rust
0
# Import necessary libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns # Set random seed for reproducibility np.random.seed(725) # make two fair dice (red and blue) ---- red_dice = np.random.choice(range(1, 7), size=50000, replace=True) blue_dice = np.random.choice(r...
Python
1
ult<ExitStatus> { self.inner.lock().unwrap().wait() } /// Kill running process and close all channels pub fn kill(self) -> Option<()> { self.mtx.send(true).unwrap(); self.handlers.stdout.join().unwrap().unwrap(); self.handlers.stderr.join().unwrap().unwrap(); self.ha...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Author : S1g0day Version : 0.0.4 Creat time : 2024/5/24 09:29 Update time: 2025/6/12 14:20 Introduce : 合并Word文档脚本 直接操作docx文件的XML结构,将多个docx文件合并为一个 ''' import os import sys import glob import zipfile import shutil import argparse from datetime import datetime f...
Python
1
_body = json!({ "connector.class": "io.debezium.connector.postgresql.PostgresConnector", "name": "s3-sink-us-east-1" }); match client .service_kafka() .edit_kafka_connector("myproject", "myservicename", "myconnector", &json_body) .await { Ok(_) => assert!(true), Err(e) => assert!(false, forma...
Rust
0
 d<Xc@s*ddlmZdefdYZdS(i(tBytesIOtCallbackFileWrappercBsGeZdZdZdZdZdZddZdZ RS(sv Small wrapper around a fp object which will tee everything read into a buffer, and when that file is...
Python
1
alpha: N, x: &Vector<N, D2, SB>, y: &Vector<N, D3, SC>, beta: N, ) where N: SimdComplexField, SB: Storage<N, D2>, SC: Storage<N, D3>, ShapeConstraint: DimEq<R1, D2> + DimEq<C1, D3>, { self.xxgerx(alpha, x, y, beta, SimdComplexField::simd_c...
Rust
0
# Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com> # 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, ...
Python
1
// device.clone(), BufferUsage::index_buffer(), // false, self.indices.clone().into_iter() // ).unwrap(), // vec![set0, set1], // (), // ) } } <gh_stars>10-100 use proc_macro2::TokenStream as TokenStream2; use proc_macro::{TokenStream, TokenTree}; ...
Rust
0
args.program: controller.load_page(program) try: if args.profile: import cProfile cProfile.runctx('asyncio.run(controller.run())', globals(), locals(), sort='tottime') else: asyncio.run(controller.run()) except KeyboardInterrupt: logger.info("...
Python
1
bevy_egui::{egui, EguiContext, EguiPlugin}; use crate::address::{Address, AddressEntered}; pub struct SetupUIPlugin; impl Plugin for SetupUIPlugin { fn build(&self, app: &mut AppBuilder) { app // Set up UI data .insert_resource(Address("".to_owned())) .add_plugin(EguiP...
Rust
0
import random stages = [''' +---+ | | O | /|\ | / \ | | ========= ''', ''' +---+ | | O | /|\ | / | | ========= ''', ''' +---+ | | O | /|\ | | | ========= ''', ''' +---+ | | O | /| | | | =========''', ''' +---+ | | O | ...
Python
1
trategy { /// returns a specific instance of a strategy so that it can be called in different methods /// concurrently pub(crate) fn instance<A, S>(&self, dim: Ix) -> Arc<StrategyInstance<A, S>> where A: Clone + Mul<A, Output=A> + Add<A, Output=A> + Sub<A, Output=A> + Div<A, Output=A> + One + Zero + Div<f64...
Rust
0
value cannot match if question not in prev: changed = True else: existing = prev[question] # ensure we compare booleans supplied to the way debconf sees them (true/false strings) if vtype == 'boolean': value = to_text(value).lower() ...
Python
1
import torch import tqdm from transformers import logging from orjson import loads, dumps import kgen.models as models import kgen.executor.tipo as tipo from kgen.formatter import seperate_tags, apply_format from kgen.generate import generate from kgen.utils import remove_repeated_suffix # no retry, ban tag mechanis...
Python
1
m := 'machine', kind=Parameter.KEYWORD_ONLY, default=None, annotation=str | None, ), ] ) bounds = _check_args_kwargs_marker(item_mark=item_mark, sig=sig) should_skip = platform.system() == 'Dar...
Python
1
ict of str to torch.Tensor network input output : dict of str to torch.Tensor network output idx : int index of sample for which to plot the interpretation. ax : list of matplotlib.axes list of two matplotlib axes onto which to plot the interpretat...
Python
1
ssert_eq!(frame.data().unwrap().unwrap(), "test"); assert_eq!(frame.meta("moo").unwrap().unwrap(), "cow"); assert_eq!(frame.meta("woof").unwrap().unwrap(), "dog"); } #[cfg(not(feature = "draft"))] fn test_zcertstore() { } #[cfg(feature = "draft")] fn test_zcertstore() { ...
Rust
0
rrrrr)r)"&  !rr)c2\rSrSrSrSrSrSrSrSr g) _TellableMcXlSUlg)Nrrr)rZrs rr[_Tellable.__init__N rc...
Python
1
} #[test] fn message_encryption_decryption_test_vectors() { // We use the same keys as the initiator and responder test vectors, so we copy those tests // here and use them to encrypt. let mut outbound_peer = get_outbound_peer_for_initiator_test_vectors(); { let our_node_id = SecretKey::from_slice(&hex:...
Rust
0
0) def _mask_nans(temp_series): return temp_series[temperatures.notnull()].reindex(temperatures.index) if i == 0: temps_in_bin = _expand_and_fill(temperatures[in_bin]) temps_out_of_bin = _expand_and_fill( pd.Series(right_bin, index=not_in_bin_index) ...
Python
1
logging.info(f"使用 DashScope 嵌入维度: {dimension}") elif embedding_config.get("local", {}).get("enabled", True): # 本地嵌入使用配置的维度 local_embedding_dimension = embedding_config.get("local", {}).get("dimension", 384) dimension = local_embedding_dimensi...
Python
1
import numpy as np import matplotlib.pyplot as plt import pandas as pd from estimator_H import * import os params_volatility = [ {'window': 60, 'N_lags': 12}, {'window': 90, 'N_lags': 9}, {'window': 120, 'N_lags': 6}, {'window': 150, 'N_lags': 4}, ] subparam_params_volatility = [ {'window': 90, '...
Python
1
from .effect_meta import Effect_enum from .effect_meta import Effect_meta, Effect_param class Tone_effect_type(Effect_enum): """剪映自带的音频“音色”效果类型""" # 免费 台湾小哥 = Effect_meta("台湾小哥", False, "7255565276819755576", "18149602", "8dd8889045e6c065177df791ddb3dfb8", []) 圣诞精灵 = Effect_meta("圣诞精灵", False, "...
Python
1
peed','knee1_angle','knee1_speed','leg1_contact', 'hip2_angle','hip2_speed','knee2_angle','knee2_speed','leg2_contact', 'lidar_0','lidar_1','lidar_2','lidar_3','lidar_4', 'lidar_5','lidar_6','lidar_7','lidar_8','lidar_9', 'hip_1','knee_1','hip_2','knee_2'] ) games['biped'] = biped # > Hilly Terrain bipedmed = ...
Python
1
+= 1; // for i in &data{ // buffer.write_all((*i)).expect("Unable to write data"); ...
Rust
0
base: TestBasePtr<D>, destruction_listener: B2destructionListenerPtr<D>, contact_listener: B2contactListenerPtr<D>, } impl<D: UserDataType> Dominos<D> { pub fn new<F: Facade>(global_draw: TestBedDebugDrawPtr) -> TestPtr<D, F> { let base = Rc::new(RefCell::new(Test::new(global_draw.clone()))); let result_ptr = R...
Rust
0
prelude::*, *}; // ------ ------ // Model // ------ ------ #[derive(Copy, Clone)] pub struct Tooltip { pub position: (i32, i32), pub data: (f64, f64), } // ------ ------ // View // ------ ------ #[allow(clippy::too_many_lines)] pub fn chart<Ms: Clone + 'static>( data: &[(f64, f64)], on_enter...
Rust
0
oad": "START" }, { "type": "postback", "title": "🗄️ मुख्य मेनू", "payload": "MAIN_MENU" }, { "type": "postback", "title": "🔓 एफबी ओपन सोर्स", ...
Python
1
} }//! Valgrind-related functionality #[cfg(unix)] use super::*; #[cfg(unix)] use nix::{errno, libc}; #[cfg(unix)] use std::mem; #[cfg(unix)] use try_from::TryInto; #[cfg(any(target_os = "android", target_os = "linux"))] fn getrlimit(resource: libc::c_int) -> Result<libc::rlimit64, nix::Error> { let mut rlim: libc::...
Rust
0