text
string
label_name
string
labels
int64
n OpenFileMappingW( dwDesiredAccess: DWORD, bInheritHandle: BOOL, lpName: LPCWSTR, ) -> HANDLE; pub fn OpenJobObjectW(dwDesiredAccess: DWORD, bInheritHandle: BOOL, lpName: LPCWSTR) -> HANDLE; // pub fn OpenPackageInfoByFullName(); pub fn OpenPrivateNamespaceW(lpBoundaryDescriptor: LPVOID, lpAlia...
Rust
0
l Row { /// check if row is a single empty cell pub fn is_empty_cell(&self) -> bool { self.len() == 1 && self[0].is_empty() } /// Returns the beginning and the end of the word at position i given that /// a character would be placed in i. pub(crate) fn start_end(&self, i: usize) -> (usi...
Rust
0
array_expr(p: &mut Parser) -> ParsedSyntax { if !p.at(T!['[']) { return Absent; } let m = p.start(); p.bump(T!['[']); // test array_element_in_expr // for(["a" in {}];;) {} ArrayElementsList.parse_list(p); p.expect(T![']']); Present(m.complete(p, JS_ARRAY_EXPRESSION)) } //...
Rust
0
from cypherbench.schema import * import collections import json from tabulate import tabulate def print_benchmark_distribution(samples: list[Nl2CypherSample], config: Nl2CypherGeneratorConfig = None): if config is None: with open('nl2cypher_generator_config.json') as fin: config = Nl2CypherGen...
Python
1
<u32>, by: u32, len: usize) { for _ in 0..by { if cur.peek_prev().is_none() { cur.seek_forward(len); } cur.prev(); } } <reponame>kikei/composion-of-onsen-server<filename>webapp/src/models/comment_photos.rs use std::convert::TryFrom; use std::path::{Path, PathBuf}; use serde:...
Rust
0
# Distributed under the MIT License. # See LICENSE.txt for details. import unittest import numpy as np import numpy.testing as npt from spectre.DataStructures import DataVector from spectre.DataStructures.Tensor import InverseJacobian, Scalar from spectre.NumericalAlgorithms.LinearOperators import ( logical_part...
Python
1
izer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001, freeze_modules=['backbone', 'neck', 'rpn_head', 'bbox_head', 'mask_head']) optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2)) # learning policy lr_config = dict( policy='step', warmup='linear', warmup_iters=5...
Python
1
ying_matrix_by_identity_matrix() { let matrix = Matrix4x4::new([ 0.0, 1.0, 2.0, 4.0, 1.0, 2.0, 4.0, 8.0, 2.0, 4.0, 8.0, 16.0, 4.0, 8.0, 16.0, 32.0, ]); let identity = Matrix4x4::identity(); let result = matrix * identity; assert_eq!(result, matrix); } #[tes...
Rust
0
mponent never uses it; it's required # in component-node lines. configs.append("component-node name={0}.dropout_mask component={0}.dropout_mask " "input={0}.dropout_mask".format(name)) configs.append("component-node name={0}.lstm_nonlin component={0}.lstm_n...
Python
1
try #1 is of type created_at 0x08, // entry data is 8 bytes 0x00]; let expected_tail = &[0x00, // entry #2 is of type track_type 0x05, // entry data is 5 bytes 0x00, ...
Rust
0
import cv2 import streamlit as st import numpy as np import tempfile # Use this line to capture video from the webcam cap = cv2.VideoCapture(0) # Set the title for the Streamlit app st.title("Video Capture with OpenCV") frame_placeholder = st.empty() # Add a "Stop" button and store its state in a variable stop_but...
Python
1
yn CallPolicy>, count: Integer, limits: Vec<(Integer, usize)>, inference_limit_exceeded: bool, } impl CWILCallPolicy { pub(crate) fn new_in_place(policy: &mut Box<dyn CallPolicy>) { let mut prev_policy: Box<dyn CallPolicy> = Box::new(DefaultCallPolicy {}); mem::swap(&mut prev_policy...
Rust
0
r, job_name), exist_ok=True) record_file = os.path.join(save_dir, job_name, 'record') cktp_file = os.path.join(save_dir, job_name, f'{global_step}.tar') if not os.path.exists(record_file): with open(record_file, 'w+') as f: json.dump([], f) with open(record_file, 'r') as f: r...
Python
1
nger::{implement_message, Message, MessageFromString}; use sabi_scene::ObjectId; #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] pub enum EditMode { View, Select, Move, Rotate, Scale, } #[derive(Clone)] pub enum EditorEvent { Selected(ObjectId), HoverMesh(u32), ChangeMode(EditMo...
Rust
0
"bubble", "hero": { "type": "image", "url": image_url, "size": "full", "aspectRatio": "20:13", "aspectMode": "cover" }, "body": { "type": "box", "layout": "vertical", ...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (c) 2014-2016 pocsuite developers (https://seebug.org) See the file 'docs/COPYING' for copying permission """ import logging import sys from pocsuite.lib.core.enums import CUSTOM_LOGGING logging.addLevelName(CUSTOM_LOGGING.SYSINFO, "*") logging.addLevelNam...
Python
1
as u32) != 0 }; RDERRR { bits } } #[doc = "Bit 16 - NOTZEROERR"] #[inline] pub fn notzeroerr(&self) -> NOTZEROERRR { let bits = { const MASK: bool = true; const OFFSET: u8 = 16; ((self.bits >> OFFSET) & MASK as u32) != 0 }; NOT...
Rust
0
s: UINT, FutureFrames: UINT, ppPastSurfaces: *mut *mut ID3D11VideoProcessorInputView, pInputSurface: *mut ID3D11VideoProcessorInputView, ppFutureSurfaces: *mut *mut ID3D11VideoProcessorInputView, ppPastSurfacesRight: *mut *mut ID3D11VideoProcessorInputView, pInputSurfaceRight: *mut ID3D11VideoPr...
Rust
0
ts vertically if col2_y - h < padding: warnings.append(f"Content might exceed page height in column 2 for item: '{item_text[:30]}...'. Item and subsequent items in this column might be truncated.") break # Adjust y position for drawing ...
Python
1
fmt::Result { f.write_str(&base64::encode(self.0)) } } <filename>src/uhci0/state0.rs #[doc = "Register `STATE0` reader"] pub struct R(crate::R<STATE0_SPEC>); impl core::ops::Deref for R { type Target = crate::R<STATE0_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 ...
Rust
0
# 4. Escreva um programa que leia a hora de início de um jogo e a hora do final do jogo (considerando apenas horas inteiras), calcula a duração do jogo em horas, sabendo-se que o tempo máximo de duração do jogo é de 24 horas e que o jogo pode iniciar em um dia e terminar no dia seguinte. O programa deve mostrar o resul...
Python
1
; export path_sep; export dirname; export basename; export connect; export connect_many; export split; export splitext; export normalize; // FIXME: This type should probably be constrained (#2624) /// A path or fragment of a filesystem path type Path = ~str; #[cfg(unix)] mod consts { /** * The primary path s...
Rust
0
, validator: String::from(VALI1), amount: coin(1000, DENOM), can_redelegate: coin(1000, DENOM), accumulated_rewards: coins(reward_amt_vali1, DENOM), }, FullDelegation { delegator: env.clon...
Rust
0
() .cloned() .map(Try::into_result) .collect::<Result<Vec<_>, _>>()?; Ok(ProverInput::new(aL, aR, aO, v_blinding.to_vec())) } fn create_verifier_input( &self, pedersen_gens: &PedersenGenerators, v_blinding: &Vec<Scalar>, ) -> Result<Verif...
Rust
0
()> { let mut range = start_ppem ..= end_ppem; let mut done = false; macro_rules! pack_ppem { () => { pack_ppem_base!(self, range, done, 8) } } while !done { let packed: u16 = (pack_ppem!() << 8) ...
Rust
0
Tcl_Obj, unicode: *const Tcl_UniChar, numChars: ::std::os::raw::c_int, ); } extern "C" { pub fn Tcl_GetCharLength(objPtr: *mut Tcl_Obj) -> ::std::os::raw::c_int; } extern "C" { pub fn Tcl_GetUniChar(objPtr: *mut Tcl_Obj, index: ::std::os::raw::c_int) -> Tcl_UniChar; } extern "C" { pub f...
Rust
0
self { Flag::Annotation(v) => v.serialize(s)?, Flag::Bounds(v) => v.serialize(s)?, Flag::Derived(v) => v.serialize(s)?, Flag::Erasable(v) => v.serialize(s)?, Flag::Extern(v) => v.serialize(s)?, Flag::FieldDefPosition(v) => v.serialize(s)?, Flag::Final(v) => v.serialize(s)?, ...
Rust
0
ad__deployment_exception(self, task): custom_inputs = {"foo": "bar"} payload = {"input": [{"key": "baz"}]} error_message = re.escape("Custom input of key foo not found in package.") with pytest.raises(DeploymentException, match=error_message): task._add_custom_inputs_to_paylo...
Python
1
tive<ark_bn254::g1::Parameters> = ark_ec::short_weierstrass_jacobian::GroupProjective::zero(); // 88 parse_group_projective_to_bytes_254(res, res_x_range, res_y_range, res_z_range); Ok(()) } // Represents: https://docs.rs/snarkvm-curves/0.5.0/src/snarkvm_curves/templates/short_weierstrass/short_weiers...
Rust
0
ve::Number(number) => *number as usize, _ => return expected_parameter_type!("sıra".to_string(), "Sayı".to_string()) }; let is_in_size = position <= list.borrow().len(); return match is_in_size { true => Ok(list.bor...
Rust
0
starts = torch.zeros(points.shape[0], 1).to(points) ends = torch.ones(points.shape[0], 1).to(points) frustums = Frustums(origins=points, directions=directions, starts=starts, ends=ends, pixel_area=pixel_area) camera_indices = torch.zeros(points.shape[0], 1, dtype=int, device=points.device) ray_sample...
Python
1
�", "新远", "贵依", "俊颜", "文来", "玮轩", "鼎鸿", "秋风", "荣银", "志辉", "博伦", "荣春", "睿博", "世康", "瀚景", "智涛", "晋运", "杰翔", "晋刚", "明新", "展瀚", "杰依", "昌毅", "风涛", "寒承", "圣帆", "明志", "旭冠", "玮博", "宇灿", "雨瑞", "清泉", "月星", "志欧", "德宝", "文韵", "文祖", "文春", "韵宇", "光耀", "弘靖", "君翔", "棋博", "弘浩", "宇驰", "文驰", "彬逸", "瀚舟", "新...
Rust
0
data_1 = 'qweqwYadnOyjnsaU4trwg asjnaAn245krRmkfE 42grTasdnHasdnvEasdn asdevadnBasdanEsdkqefqefvaSasdqaeeqqvedwt5hfbsdT24tewfd' #대문자이거나 공백인경우만 출력 for data in data_1: if data.isspace() or data.isupper(): #공백인 경우 -> isspace() --> '' in data_1 print(data, end = "") print() data_2 = '걉파반샤팝다푸거맥파바자들퍼바배들밥샵파누타히...
Python
1
voting(_subject.clone(), _voting_setting.clone(),_winner.clone());)* } } }; } finalize_voting_dispatch_trait_impls! {} finalize_voting_dispatch_trait_impls! {_1 } finalize_voting_dispatch_trait_impls! {_1 _2} finalize_voting_dispatch_trait_impls! {_1 _2 _3} finalize_voting_dispatch_trait_impls!...
Rust
0
if args.use_ema: ema_model.step(model.parameters()) progress_bar.update(1) global_step += 1 if global_step % args.checkpointing_steps == 0: if accelerator.is_main_process: save_path = os.path.jo...
Python
1
port LiteScopeAnalyzer analyzer_signals = [self.ddrphy.dfi] self.submodules.analyzer = LiteScopeAnalyzer(analyzer_signals, depth = 256, clock_domain = "sys", csr_csv = "analyzer.csv") # Leds ------------------------------------...
Python
1
d as usual even two nodes /// crashed, and the leader can be replaced when in joint state #[test] fn test_joint_replace_peers() { let mut cluster = new_node_cluster(0, 5); cluster.cfg.raft_store.allow_remove_leader = false; let pd_client = Arc::clone(&cluster.pd_client); pd_client.disable_default_opera...
Rust
0
from __future__ import annotations import typing from typing import TYPE_CHECKING from PySide6 import QtWidgets from randovania.games.planets_zebeth.layout import PlanetsZebethConfiguration from randovania.gui.lib import signal_handling from randovania.gui.preset_settings.preset_tab import PresetTab if TYPE_CHECKIN...
Python
1
def PAL_Suvey(): print("당신의 운동량은 어떻게 되시나요?") answer=input("1.운동을 하지 않는다.\n " "2.주 1~3회 운동한다.\n" "3.주 3~5회 운동한다.\n" "4.주 6~7회 운동한다.\n" "5.하루에 두번 이상한다.") if(answer=='1'): return [1.2, answer] elif(answer=='2'): return [1....
Python
1
from recurrence import Rule import recurrence def test_rule_to_text_simple(): assert Rule( recurrence.WEEKLY ).to_text() == 'weekly' def test_rule_to_text_interval(): assert Rule( recurrence.WEEKLY, interval=3 ).to_text() == 'every 3 weeks' def test_rule_to_text_oneoff(): ...
Python
1
"{TITLE}", "{LEADING}", "{IndicatorColor}Enter contents of the new line. Empty content cancels creation of a new line.", "", "{BODY}", "{Normal,Dimmed}reset {Normal}foo{Normal,Underline}", "{TRAILING}", "{IndicatorColor}Enter to finish" ); assert_results!( test_context.handle_even...
Rust
0
.unwrap(), preshared_key: None, endpoint: Some(SocketAddr::from_str("192.168.127.12:3233").unwrap()), persistent_keepalive: Some(111), replace_allowed_ips: true, allowed_ips: vec![IpNetwork::from_str("192.168.4.6/32").unwrap()], update_...
Rust
0
import asyncio import random from pyrogram import Client, filters from pyrogram.types import Message from pyrogram.raw.functions.messages import DeleteHistory from VIP_INNOCENT import userbot as us, app from VIP_INNOCENT.core.userbot import assistants @app.on_message(filters.command("sg")) async def sg(client: Clien...
Python
1
1009]]) np.testing.assert_array_equal(results, expected) def test_exog_to_direct_numpy_when_steps_len_exog_numpy_array_2d(): """ Test exog_to_direct_numpy results when using steps len exog (5) and exog is a 2d numpy array. """ exog = np.column_stack([np.arange(100, 105), np.arange(1000, 100...
Python
1
me = time.time() while True: for output in iter(self.docker_process2.stdout.readline, ''): output = output.decode('utf-8') print(output) if output and "Connected" in output: generated_text = self.generate_request(self.models[1]['por...
Python
1
for start, end, step in test_ranges: try: iter1 = xrange(start, end, step) except OverflowError: pass else: iter2 = pyrange(start, end, step) test_id = "xrange({}, {}, {})".format(start, end, step) ...
Python
1
Defaults to None. record (str, 可选): 返回记录的形式, 选项包括'all'和'first'。 若为'first', 则无论查询结果又几条,仅返回第一条记录, 若为'all', 则返回全部数据, 若engine==None则返回list, 若engine=='geopandas', 则返回GeoDataFrame对象 ...
Python
1
class Solution: def reorganizeString(self, s: str) -> str: ans = [] pq = [(-count, char) for char, count in Counter(s).items()] heapq.heapify(pq) while pq: count_first, char_first = heappop(pq) if not ans or char_first != ans[-1]: ans.appen...
Python
1
de::*; use twilight_model::{id::GuildId, template::Template}; /// Get a list of templates in a guild, by ID. pub struct GetTemplates<'a> { fut: Option<Pending<'a, Vec<Template>>>, guild_id: GuildId, http: &'a Client, } impl<'a> GetTemplates<'a> { pub(crate) fn new(http: &'a Client, guild_id: GuildId) ...
Rust
0
/// the largest command code seen at `big_switch| pub(crate) const MAX_COMMAND: Cmd = Cmd::SetInteraction; #[repr(i32)] #[derive(Clone, Copy, Debug, Eq, PartialEq, enumn::N)] pub(crate) enum AssignFontInt { HyphenChar = 0, SkewChar = 1, LpCode = 2, RpCode = 3, } impl From<i32> for AssignFontInt { f...
Rust
0
)) = hop.addr { hop.addr = Some(table[id as usize]); } else if let Some(id) = hop.addr_id { hop.addr = Some(table[id as usize - 1]) } } } Object::MultipathTraceroute(_) => todo!(), ...
Rust
0
= translator.ja2ko(request.text) translate_time = time.time() - translate_start response = { "original": request.text, "translated": result, "translate_time": f"{translate_time:.2f}s", } # 캐시에 저장 save_to_cache( response["original"], response["translated"], ...
Python
1
Overwrote a reactor during initialization") } /// Register reactors into the global data structure that owns them during execution. fn register_bank<R: ReactorInitializer + 'static>(&mut self, bank: Vec<R>) { for child in bank { self.register_reactor(child) } } /// Top ...
Rust
0
augment=True, cache=None if opt.cache == 'val' else opt.cache, rect=opt.rect, rank=LOCAL_RANK, workers=workers, ...
Python
1
import numpy as np import rustynum as rnp # test addition of scalar to numarray and then slicing def test_add_scalar_and_slice(): a = rnp.NumArray([1.0, 2.0, 3.0, 4.0], dtype="float32") result = a + 1.0 sliced = result[1:3].tolist() assert sliced == [3.0, 4.0], "Addition of scalar and slicing failed"...
Python
1
top=stop_after_attempt(10), before=before_retry_fn) def get_embbeding(self,text): if os.environ.get("EMBEDDING_API_ENDPOINT"): client = AzureOpenAI( azure_endpoint=os.environ.get("EMBEDDING_API_ENDPOINT",None), api_key=os.environ.get("EMBEDDING_API_KEY",None), ...
Python
1
is an array of values, apply the mask directly except TypeError: y_data = np.array(y_data)[nan_mask] # If y_data is an array of arrays, apply the mask to each sub-array else: y_data = [np.array(y)[nan_mask] for y in y_data] # Convert t to datetime, specifying that it...
Python
1
import socket import os # example # client = Client("192.168.1.42", port=5000) # client.send_file("/home/user/Documents/fileku.txt") class Client: def __init__(self, ip_server: str, port: int = 5000): '''ip_server = ip server dapatkan misalnya dari menu ip''' self.__ip = ip_server self.__...
Python
1
wrap() } else { // The request was not valid, that's fine return Ok(()); }; let txs = self.build_transactions(fe_request.clone()).await?; // Right before sending the transactions we must check if the request is possible at all let is_request_possible = s...
Rust
0
ptr() as *mut u8 as *const libc::c_char, b"-fn\x00" as *const u8 as *const libc::c_char, dmenufont.as_ptr(), b"-nb\x00" as *const u8 as *const libc::c_char, col_gray1.as_ptr(), b"-nf\x00" as *const u8 as *const libc::c_char, col_gray3.as_ptr(), b"-sb\x00" as *const u8 as *const libc:...
Rust
0
new(-half_height, -half_base_len); let p2 = P2::new(-half_height, half_base_len); let p3 = P2::new(half_height, 0.0); let collider = ConvexPolygon::try_new(vec![p1, p2, p3]).unwrap(); let collider = ShapeHandle::new(collider); collider ...
Rust
0
al-scopes-in-block-expression::MUT_INT' // gdb-check:$1 = 0 // STRUCT EXPRESSION // gdb-command:finish // gdb-command:print val // gdb-check:$2 = -1 // gdb-command:print ten // gdb-check:$3 = 10 // gdb-command:continue // gdb-command:finish // gdb-command:print val // gdb-check:$4 = 11 // gdb-command:print 'lexical-s...
Rust
0
d SoH = {pred_val:.2f}% --> {status}") # # Save predictions to CSV for reporting # results_df = pd.DataFrame(results) # csv_path = os.path.join(MODELS_DIR, "soh_predictions.csv") # results_df.to_csv(csv_path, index=False) # print(f"\n📂 Predictions saved to: {csv_path}") # # --- Optional: Stat...
Python
1
tilda_t = torch.zeros(x.shape[0], self.input_dim, self.n_units).cuda() c_t = torch.zeros(x.shape[0], self.input_dim*self.n_units).cuda() outputs = torch.jit.annotate(List[Tensor], []) for t in range(x.shape[1]): # eq 1 j_tilda_t = torch.tanh(torch.einsum("bij,ijk->bik", h...
Python
1
ost_used: "exploit", parser: "no parser!", var: 5 } def use(module): execute_command(f"use {module}") def show_exploits(): execute_command("show exploits") def execute_get_input(module): run_console_f...
Python
1
(1 - i) * r * cos z, * приводящий к E_phi = r cos(z) (sin t + cos t), B_z = cos(z) (cos t - sin t), * B_r = r sin(z) (cos t - sin t) */ fn test_A_phi(n: (usize, usize), limits: (f64, f64)) -> (Vec<f64>, Vec<f64>) { let (nr, nz) = n; let (r_m, z_m) = limits; let dr = r_m / (nr - 1) as f64; let dz = z_...
Rust
0
rce_dir.is_dir() { return Err(anyhow!("Source path {:?} is not a directory", source_dir)) } let filename = track.filename.clone().ok_or_else( || anyhow!("Track {} is missing required field `filename`", track.track_number) )?; let filepath = source_dir.join(filename); extract_track_to_file(track, bgm_...
Rust
0
# Copyright (c) 2022-2025, The Isaac Lab Project Developers. # All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause """Configuration for the dexterous hand from Shadow Robot. The following configurations are available: * :obj:`SHADOW_HAND_CFG`: Shadow Hand with implicit actuator model. Reference: * https...
Python
1
nit2 as *const _ as *const Struct; let offset = unsafe { field_ptr.offset_from(base_ptr) }; offset as usize }; pub const NOT_PTR: usize = { //~^ NOTE unsafe { (42 as *const u8).offset_from(&5u8) as usize } }; pub const NOT_MULTIPLE_OF_SIZE: usize = { //~^ NOTE let data = [5u8, 6, 7]; let b...
Rust
0
} } fn bench_primes(c: &mut Criterion) { let mut group = c.benchmark_group("trace_primes"); for s in &[13, 103, 1153] { group.bench_with_input(BenchmarkId::from_parameter(s), s, |b, s| { b.iter(|| tr_h(black_box(*s))) }); } } criterion_group! { name = benches; confi...
Rust
0
/// ``` pub fn exec<Ret, F: FnOnce(&T) -> Ret>(&self, f: F) -> Ret { f(&self.rc.borrow()) } /// Executes the given function with a mutable reference to the wrapped value. /// /// # Arguments /// /// * `func` - The function to execute with a reference to the wrapped value. /...
Rust
0
_img, _img_meta= prepare_single( img, scale, True) imgs.append(_img) img_metas.append(DC(_img_meta, cpu_only=True)) data = dict(img=imgs, img_meta=img_metas) if not self.with_mask: h, w = _img.shape[0:2] gt_masks ...
Python
1
if is_inactive: self.coop_progress_widget.setPicture(i - 1, "") else: self.coop_progress_widget.setPicture(i - 1, path + "/img/" + image_name) except IndexError: print(f"Image Name for Slot {i}: No...
Python
1
f'"{src_arg_name}" is deprecated in ' f'`{func_name}`, please use "{dst_arg_name}" ' 'instead') arg_names[arg_names.index(src_arg_name)] = dst_arg_name if kwargs: for src_arg_name, dst_arg_name in nam...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ openFDA 라벨에서 증상/징후를 추출해 "증상 -> [{'ingredient': ..., 'score': ...}, ...]" 맵을 생성/저장. - 교육/개발용 샘플: rate-limit, 캐싱, 예외처리 포함(기본형) - 실행: python build_symptom_map_from_openfda.py - 산출물: symptom_to_ingredients_openfda.json """ from __future__ import annotations impo...
Python
1
# # Copyright (C) 2007-2016 CEA/DAM # # This file is part of ClusterShell. # # ClusterShell 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; either # version 2.1 of the License, or (at your option) any l...
Python
1
# # Copyright (c) 2024, Daily # # SPDX-License-Identifier: BSD 2-Clause License # """This module implements Whisper transcription with a locally-downloaded model.""" import asyncio import time from enum import Enum from typing_extensions import AsyncGenerator import numpy as np from pipecat.frames.frames import Er...
Python
1
f.server, desc.as_ptr()); } } /// Sets whether this server is dedicated or a listen server. pub fn set_dedicated_server(&self, dedicated: bool) { unsafe { sys::SteamAPI_ISteamGameServer_SetDedicatedServer(self.server, dedicated); } } /// Login to a generic anony...
Rust
0
- Options for Texinfo output ---------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ( master_doc, "AutonomySim", "Autonom...
Python
1
we don't raise, events delivered as expected: let gs = ts_check_fn(rcbs, move || { schedule_timer(); do_branches(rcbd2); schedule_timer(); do_branches(rcbx2); schedule_timer(); do_branches(rcbx2); }); assert_eq!(gs.num_sign...
Rust
0
picked_target = Some(target); picked_threat_level = threat_level; } } if let Some(attacker) = Unit::from_ptr((**unit).previous_attacker) { let prev_attacker_ok = can_attack_unit(globals, unit, attacker) && unit.is_enemy(globals.game, attacker) && !...
Rust
0
transpose(corners_3d) def compute_box_3d_obj_array(obj_array): ''' cx, cy, cz, l, w, h, heading_angle Returns: corners_3d: (8,3) array in in upright depth coord. ''' cx, cy, cz, l, w, h, heading_angle = obj_array center = (cx, cy, cz) # compute rotational matrix arou...
Python
1
def func(arg1, arg2, arg3): print('arg1 =', arg1) print('arg2 =', arg2) print('arg3 =', arg3) l = ['one', 'two', 'three'] func(*l) # arg1 = one # arg2 = two # arg3 = three func(*['one', 'two', 'three']) # arg1 = one # arg2 = two # arg3 = three t = ('one', 'two', 'three') func(*t) # arg1 = one # arg2 = ...
Python
1
, 99), (0, 99), false, DEFAULT_FLAKINESS); } #[test] fn graph_parallel_last_first() { let mut graph = CompressedDAG::new(); graph.add_node(CompressedDAGSegment::new(100), vec![]); graph.add_node(CompressedDAGSegment::new(100), vec![]); let mut s = CompressedDAGSearcher::new(...
Rust
0
ovider { fn clock_for(&self, _: ::ftm::Ftm1) -> Hz { self.bus() } } impl<CP> ClockFor<::ftm::Ftm2> for Clocks<CP> where CP: ClockProvider { fn clock_for(&self, _: ::ftm::Ftm2) -> Hz { self.bus() } } impl<CP> ClockFor<::pit::Pit> for Clocks<CP> where CP: ClockProvider { fn clock_for(&self, _: ::pit::Pit) -...
Rust
0
list("file") assert ( "File not found: custom/location/tmp/s3file/does_not_exist.txt" in caplog.text ) def test_process_request__no_signature(self, rf, caplog): request = rf.post( "/", data={"file": "tmp/s3file/does_not_exist.txt", "s3file": "file"} ...
Python
1
pow(33)"))] pub dts_next_au: u64, } #[derive(Debug, Clone, Eq, PartialEq)] #[cfg_attr(test, derive(Arbitrary))] pub struct AdaptationFieldExtension { pub ltw: Option<LTW>, #[cfg_attr(test, proptest(strategy(piecewise_rate)))] pub piecewise_rate: Option<u32>, pub seamless_splice: Option<SeamlessSpli...
Rust
0
Path::new("noext")), None); assert_eq!(ArtFileType::from_path(Path::new("other.ext")), None); } #[test] fn sanity_from_markdown() { // #ART-SKIP let raw_1 = r#" # REQ-foo req-foo text #REQ-bar partof: - SPC-baz ### REQ-bar text #REQ-empty # req-weird done: yes this is done partof: - REQ-baz - SPC-bar ...
Rust
0
"""Provides utility functions to read various data types from a binary stream.""" import struct from typing import BinaryIO from bitstring import ConstBitStream def read_uint64(f: BinaryIO): """Extract unsigned 64-bit integer from binary stream.""" return struct.unpack('Q', f.read(8))[0] def read_uint32(f: B...
Python
1
from typing import Any, Dict from triad import ParamDict KEYWORD_ROWCOUNT = "ROWCOUNT" KEYWORD_PARALLELISM = "CONCURRENCY" FUGUE_ENTRYPOINT = "fugue.plugins" FUGUE_SQL_DEFAULT_DIALECT = "spark" FUGUE_CONF_WORKFLOW_CONCURRENCY = "fugue.workflow.concurrency" FUGUE_CONF_WORKFLOW_CHECKPOINT_PATH = "fugue.workflow.check...
Python
1
e, Event, KeyboardInput, StartCause, VirtualKeyCode, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::Window, }; fn main() -> Result<(), std::io::Error> { let event_loop = EventLoop::new(); let window = Window::new(&event_loop).unwrap(); /////////////////////////////////////////////////...
Rust
0
n_metadata", {}) if metadata: bytes_saved = metadata.get("original_size_bytes", 0) - metadata.get( "compressed_size_bytes", 0 ) self._optimization_stats["total_bytes_saved"] += bytes_saved algorithm = optimized_response.get("compression_algorithm",...
Python
1
""" Simple script that checks if a checkpoint is corrupted with any inf/NaN values. Run like this: python inspect_checkpoint.py model.12345 """ import tensorflow as tf import sys import numpy as np if __name__ == '__main__': if len(sys.argv) != 2: raise Exception("Usage: python inspect_checkpoint.py <file_na...
Python
1
w(); let result = look_at * eye.to_homogeneous(); assert_eq!(result, expected); } #[test] fn test_look_at_rh_eye_to_origin() { let eye = Point3::new(-1.0, -1.0, -1.0); let target = Point3::new(1.0, 1.0, 1.0); let up = Vector3::unit_y(); let look_at = Matrix4...
Rust
0
t handler"); }), make_handler!(0x16, interrupt_handler_0x16), make_handler!(0x17, interrupt_handler_0x17), make_handler!(0x18, interrupt_handler_0x18), make_handler!(0x19, interrupt_handler_0x19), make_handler!(0x1a, interrupt_handler_0x1a), make_handler!(0x1b, interrupt_handler_0x1b), m...
Rust
0
ully the compiler will optimize this away but this is needed // so the package is rebuilt after changes to the included image. let _ = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/", #path)); ( (#x, #y), &[ #( #bytes, )* ] ) ...
Rust
0
__all__ = [ 'BlockMixin', 'ObjectMixin', ] import todd import torch from mmdet.models import ( HEADS, BBoxHead, Shared2FCBBoxHead, Shared4Conv1FCBBoxHead, ) from todd.losses import LossRegistry as LR from .classifiers import Classifier from .utils import MultilabelTopKRecall class NotWithReg...
Python
1
mpl<'a, R: 'a + Read + Seek> ImageDecoder<'a> for TgaDecoder<R> { type Reader = TGAReader<R>; fn dimensions(&self) -> (u32, u32) { (self.width as u32, self.height as u32) } fn color_type(&self) -> ColorType { self.color_type } fn scanline_bytes(&self) -> u64 { // This ...
Rust
0
from flask import Blueprint, render_template, request, flash, redirect, url_for from .models import User from werkzeug.security import generate_password_hash, check_password_hash from . import db from flask_login import login_user, login_required, logout_user, current_user auth = Blueprint('auth', __name__) @auth.r...
Python
1
""" URL configuration for pdfding project. The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/5.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home...
Python
1