text
string
label_name
string
labels
int64
system, Ocean_Acclaim2, Varie, Yonezawas_pal, Kaneko, Pack_in_soft, Konami_Yu_Gi_Oh, } impl NewLicenseCode { fn decode(val: &[u8]) -> Result<Self, String> { Ok(match *val { [0x0, 0x0] => NewLicenseCode::None, [0x0, 0x1] => NewLicenseCode::NintendoRnD1, ...
Rust
0
AY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* automatically generated by rust-bindgen 0.59.2 */ pub const _LIBC_LIMITS_H_: u32 = 1; pub const _FEATURES_H: u32 = 1; pub const _DEFAULT_SOURCE: u32 = 1; pub const __GLIBC_USE_ISOC2X: u32 = 0; pub const __USE_ISOC11: u32 = 1; ...
Rust
0
form of the Gaussian Error Linear Unit (GELU). For more details, see section 2 of this [paper](https://arxiv.org/abs/1606.08415). Parameters: dim_in (`int`): The number of channels in the input. dim_out (`int`): The number of channels in the output. bias (`bool`, defaults to True): Whet...
Python
1
_possible"), ValidatorStatus::WithdrawalDone => write!(f, "withdrawal_done"), ValidatorStatus::Active => write!(f, "active"), ValidatorStatus::Pending => write!(f, "pending"), ValidatorStatus::Exited => write!(f, "exited"), ValidatorStatus::Withdrawal => write...
Rust
0
ontrast(nn.Module): def __init__(self, hidden_dim, tau, lam): super(Proto_Contrast, self).__init__() self.proj = nn.Sequential( nn.Linear(hidden_dim, hidden_dim), nn.ELU(), nn.Linear(hidden_dim, hidden_dim) ) self.tau = tau self.lam = lam ...
Python
1
, LensExt, Point, TextLayout}; use std::borrow::Cow; use std::path::Path; use scribl_curves::Time; use crate::data::{AsyncOpsStatus, FinishedStatus}; use crate::EditorState; const LINE_HEIGHT_FACTOR: f64 = 1.2; const X_PADDING: f64 = 5.0; // We have two possible status widgets: one is just a label; the other is a l...
Rust
0
") .is_some() { message = SSDPServer::get_search_response_package( "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1", &format!( "uuid:{}::urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1", uuid ...
Rust
0
L_SPEC { type Writer = W; } #[doc = "`reset()` method sets PWM_PDMACTL to value 0"] impl crate::Resettable for PWM_PDMACTL_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } } pub(crate) mod syn;#[macro_use] extern crate error_chain; #[macro_use] extern crate serde_derive; extern crate...
Rust
0
import math radius_of_earth = 6378100.0 def distance(pos1_lla, pos2_lla): '''return distance between two points in meters, coordinates are in degrees thanks to http://www.movable-type.co.uk/scripts/latlong.html''' lat1, lon1, _ = pos1_lla lat2, lon2, _ = pos2_lla lat1 = math.radians(lat1) ...
Python
1
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: instamadilloDeleteMessage/InstamadilloDeleteMessage.proto # Protobuf Python Version: 6.32.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from googl...
Python
1
[mspeed,maccel],dtype=np.float16) targets[idx % num_frames] = np.array([steer_raw,gas_raw],dtype=np.float16) # increment counter, maybe save idx += 1 if idx % num_frames == 0: np.savez(imgs_file,imgs) np.savez(speedx_file,speedx) np.savez(targets_file,...
Python
1
zuni', 'gsw': 'Zuni-Schpraach', 'gu': 'ઝૂની', 'ha': 'Zuni', 'he': 'זוני', 'hi': 'ज़ूनी', 'hi-Latn': 'Zuni', 'hr': 'zuni', 'hsb': 'zunišćina', 'hu': 'zuni', 'hy': 'զունիերեն', 'ia': 'zuni', 'id': 'Zuni', 'ig': 'Zuni', 'is': 'súní', 'it': 'zuni', 'ja': 'ズニ語', 'jv': 'Zuni', 'ka': 'ზუნი', 'kgp': 'sunhi', 'kk': 'зуни тілі',...
Python
1
ADING_HALT" in risk_assessment["risk_factors"] assert "투자 주의" in risk_assessment["recommendation"] @pytest.mark.asyncio async def test_risk_assessment_low_risk(self, use_case): """낮은 위험도 평가 테스트""" # Given normal_response = StockPriceResponseDTO( stock_code="005930", ...
Python
1
ver key and sign key. /// /// Note: Proof of possession instance deallocation must be performed by calling hl_crypto_bls_pop_free. /// /// # Arguments /// * `ver_key` - Ver key instance /// * `sign_key` - Sign key instance /// * `pop_p` - Reference that will contain proof of possession instance pointer #[no_mangle] pub...
Rust
0
|$arg:$ty| $($result)*)(arg) } } }; ($([$($impl_params:tt)*])? From + &From <$ty:ty> for $target:ty $(where [$($bounds:tt)*])? { |$arg:tt| $($result:tt)* } ) => { #[allow(clippy::redundant_closure_call)] #[allow(clippy::identity_conversion)] impl <$($($im...
Rust
0
import streamlit as st import google.generativeai as genai from youtube_transcript_api import YouTubeTranscriptApi from youtube_transcript_api.formatters import TextFormatter, SRTFormatter GOOGLE_API_KEY = st.secrets["GOOGLE_API_KEY"] genai.configure(api_key=GOOGLE_API_KEY) model = genai.GenerativeModel('gemini-1.5-f...
Python
1
def double(var): if var<=0: raise Exception("IllegalValue Exception") return var*var def fun(): try: print(double(-4)) except Exception as e: print("error is\t",e.__str__()) print("Done") fun() # Output: error is IllegalValue Exception Done
Python
1
as_dispersal_buffer.len(); if event_weights.is_empty() { AliasSamplerRange::from(range_from..range_from) } else { alias_dispersal_buffer .append(&mut AliasMethodSamplerAtom::create(&event_weights)); Ali...
Rust
0
ontact"] = [] def generate_mobile(user_data, chat_id): generate_mobile_postfix = str(randint(1000000, 9999999)) generate_mobile = user_data[chat_id]["prefix"] + generate_mobile_postfix while generate_mobile in mobile_list: generate_mobile_postfix = str(randint(1000000, 99999...
Python
1
.and_then(|name| if name.is_empty() { None } else { Some(name) }) .unwrap_or(filename.as_str()); println!(" Downloading file: {}", fname); let mut file = File::create(fname)?; response.copy_to(&mut file); println!(" Response St...
Rust
0
#! /usr/bin/python # encoding:utf-8 import paramiko import os import time from datetime import datetime import base64 import tools as tools import commands import cx_Oracle import codecs import sys reload(sys) sys.setdefaultencoding('utf-8') # 执行命令, def exec_command(host,user,password,ssh_port,command): list = [...
Python
1
import json import os import mlx import mlx.core as mx import mlx.nn from ..mlx_vlm.models.siglip.vision import VisionConfig, VisionModel class SiglipWrapper(mlx.nn.Module): """Siglip encoder returning penultimate features""" def __init__(self) -> None: super().__init__() with open("siglip4...
Python
1
/* ecs.spawn().insert_bundle(DrawableMeshBundle { mesh: terrain_test_handle, shader: terrain_shader, transform: Transform::from_translation(glam::Vec3::new(0.0, -0.005, 0.0)), }); ecs.spawn().insert_bundle(DrawableMeshBundle { mesh: terrain_grid_handle, shader: t...
Rust
0
.stdout; let devices = devices.lines().skip(1); let mut mounted = vec![]; for line in devices { let split: Vec<_> = line .split(char::is_whitespace) .filter(|s| !s.is_empty()) .collect(); // Need to make sure there are no duplicates (which can happen with...
Rust
0
"""Main program.""" from modelo720.degiro import DegiroReader from modelo720.model.compute import FileConfig, GlobalCompute def main(): """Main program.""" df_prev = DegiroReader("datasets/Portfolio2023.csv").data df_curr = DegiroReader("datasets/Portfolio2024.csv").data print(df_prev) print(df_cur...
Python
1
is(axis), tract_ndarray::Slice::from((b as isize)..(e as isize)), ); } Ok(Tensor::from(input.to_owned()).into()) } } impl Op for Slice1 { fn name(&self) -> Cow<str> { "Slice1".into() } op_onnx!(); not_a_typed_op!(); } impl StatelessOp for Slice1...
Rust
0
et filter = match self { StencilCell::Number(i) => CellStateFilter::single_cell_state(state_count, *i), StencilCell::Ident(_) => CellStateFilter::all(state_count), StencilCell::Other('.') => CellStateFilter::single_cell_state(state_count, 0), StencilCell::Other('#') => { ...
Rust
0
#!/usr/bin/env python3 # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 # DeepSpeed Team from __future__ import annotations '''Copyright The Microsoft DeepSpeed Team''' """ Checks each file in sys.argv for the string "--extra-index-url". Modified from https://github.com/jlebar/pre-commit-h...
Python
1
orKind::IntegerOverflow("-m".to_string()).into()) } } #[cfg(test)] mod tests { use super::*; #[test] fn test_health_check() { let memory_config = MachineMemConfig { mem_size: MIN_MEMSIZE, mem_path: None, mem_share: false, dump_guest_core: false, ...
Rust
0
guments(content, index + 1, current_args, arg_end_indexes) } else { (current_args, arg_end_indexes) } } fn escape_special_characters(content: &Vec<u16>) -> Vec<u16> { let content = undo_html_escapes(content); let mut result = Vec::with_capacity(content.len() + content.len() / 6); f...
Rust
0
plt.ylabel('Latência (ms)') plt.grid(True) plt.legend() # Criar um gráfico de barras para comparar médias plt.figure(figsize=(10, 6)) meios = [] latencias_medias = [] if 'radio' in stats: meios.append('Rádio') latencias_medias.append(stats['radio']['avg']) ...
Python
1
fer if use_real_data else sac_buffer if (env_steps + 1) % cfg.overrides.sac_updates_every_steps != 0 or len( which_buffer ) < cfg.overrides.sac_batch_size: break # only update every once in a while agent.sac_agent.update_parameter...
Python
1
def setParams(self, params): qaz = '' for key, value in params.items(): if 'type' not in key: qaz += '{}={},'.format(key, value) elif type(value) is str: qaz += '{},'.format(Utility.typeToString(value)) else: qaz += '{}'.format(value) self.params =...
Python
1
] progress_record: ProgressRecord accelerate_uploading: bool Returns ------- Retrier """ retry_policies = [] upload_service_names = [ServiceName.UP] handle_change_region = None if accelerate_uploading: retry_policies.append(AccUnavailableRetryPolicy()) upload_se...
Python
1
m.unwrap().unwrap(); let mut socket = inbound.await.unwrap(); let mut buf = Vec::new(); socket.read_to_end(&mut buf).await.unwrap(); assert_eq!(buf, b"hello world"); }; let outbound = t.dial(addr)?; let dialer = async move { ...
Rust
0
47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 1...
Rust
0
yk.sort(key=atol) except Exception: vyk.sort() if seplinefunc: sepline = seplinefunc(tmp_len, [vx[x] for x in vxk]) print(sepline) fmt = yfmtfunc(tmp_len) print(fmt % "", end=' ') for x in vxk: vxf[x] = fmtfunc(vx[x]) print(vxf[x] % x, end=' ...
Python
1
email_changed.send( sender=user.__class__, request=request, user=user, from_email_address=from_email_address, to_email_address=to_email_address, ) if from_email_address: get_adapter().send_notification_mail( "account/email/email_changed", u...
Python
1
:borrow; pub use alloc::boxed; pub use alloc::collections; pub use alloc::rc; pub use alloc::string; pub use alloc::sync::Arc; pub use alloc::vec; } use imports::*; pub use stable_deref_trait::{CloneStableDeref, StableDeref}; mod common; pub use common::*; mod arch; pub use arch::*; pub mod...
Rust
0
::upper; /// assert_eq!(upper().parse(&b"A"[..]), Ok((b'A', &b""[..]))); /// assert!(upper().parse(&b"a"[..]).is_err()); /// ``` pub fn upper<Input>() -> impl Parser<Input, Output = u8, PartialState = ()> where Input: Stream<Token = u8>, Input::Error: ParseError<Input::Token, Input::Range, Input::Position>, { ...
Rust
0
type_name; #[allow(dead_code)] fn print_typeof<T: ?Sized>(_: &T) { println!("{}", type_name::<T>()); } <filename>hv/crates/hv-yaks/examples/crate_doc_example.rs //! Copy of the crate level documentation & readme example. use hv_ecs::{With, Without, World}; use hv_yaks::{Executor, QueryMarker}; fn main() { let...
Rust
0
assert!(v.get::<bool>().unwrap()); true.into_glib() } Err(e) => { *error_ptr = e.into_raw(); false.into_glib() } } } unsafe extern "C" fn content_provider_get_value<T: ContentProviderImpl>( ptr: *mut ffi::GdkContentProvider, value_ptr: *mut glib::...
Rust
0
ring), # quotes, percents and backslashes must be parsed one at a time (r'[\'"\\]', String), # unhandled string formatting sign (r'%', String) # newlines are an error (use "nl" state) ], 'nl': [ (r'\n', String) ], 'd...
Python
1
.text_repetitions { true => self.replace(text).map(|text| self.remove_text_reps(&text).unwrap_or(text)).or_else(|| self.remove_text_reps(text)), false => self.replace(text) } } } #[cfg(test)] mod tests { fn get_cleaner() -> super::Cleaner { let config = super::config::Co...
Rust
0
'coloured fish', 18: 'illustration', 19: 'artist logo', 20: 'publisher logo'} def _split(it, i): return it[:i], it[i:] def parse_picture_block(dat): head, rest = _split(dat, 2 * 4) typeid, mime_len = struct.unpack('>ii', head) mime, rest = _split(rest, mime_len) mime = mime.dec...
Python
1
.name.lower(),None): customTXT = "\n\n{}\n".format(patreonsDict['runnerEndMsgs'][me.name.lower()]) else: customTXT = '' #if ds == 'runner': barNotifyAll('#880000',"{} has ended their turn".format(me)) #else: barNotifyAll('#0000AA',"{} has ended their turn".format(me)) notify("=> {}{}".format(...
Python
1
/// Invalid public key length. InvalidPublicKeyLength(usize), /// Invalid signature length. InvalidSignatureLength(usize), /// Last trit of the entropy is not null. NonNullEntropyLastTrit, } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ma...
Rust
0
from turtle import * co = Turtle() s=Screen() co.speed(0) s.bgcolor("black") co.pensize(4) #virus center co.color("green","green") co.begin_fill() co.up() co.setpos(0,-100) co.down() co.circle(120) co.end_fill() #virus bumps method def bumps(x,y): co.up() co.setpos(x,y) co.down() co.fd(30) co.rt(...
Python
1
dings .write_to_file(out_path.join("bindings.rs")) .expect("Couldn't write bindings!"); println!( "cargo:rustc-link-search=native={}", mgclient_out.join("lib").display() ); println!("cargo:rustc-link-lib=static=mgclient"); println!("cargo:rustc-link-lib=dylib=crypto"); ...
Rust
0
t_height, frame_count, } } const BMP_MAGIC: u32 = 0x20504d42; fn encode_monochrome( frames: &[(Vec<(usize, FrameOffset)>, LayerFrames, TexCoords)], layer: usize, width: u32, height: u32, scale: u32, ) -> Vec<u8> { let mut out = vec![0; (width * height) as usize + 4]; (&mut out[....
Rust
0
bigs( Big::new_ints(&rom::CURVE_PYAA), Big::new_ints(&rom::CURVE_PYAB), ), FP2::new_bigs( Big::new_ints(&rom::CURVE_PYBA), Big::new_ints(&rom::CURVE_PYBB), ), ), ); } ...
Rust
0
alue = Value::new("Some value", &DataType::Markdown).unwrap(); commitbuilder_1.set(property.into(), value.clone()); // let mut commitbuilder_2 = commitbuilder_1.clone(); // let commit_1 = commitbuilder_1.sign(&agent, &store).unwrap(); // Should fail if there is no self_url set in the sto...
Rust
0
fib = [] a, b = 1, 1 while b < int(4e12): if 1e6 < b: fib.append(b) a, b = b, a+b print(len(fib)) print(fib)
Python
1
from litestar.plugins.sqlalchemy import ( AsyncSessionConfig, SQLAlchemyAsyncConfig, ) from litestar_todo.main.config import settings session_config = AsyncSessionConfig(expire_on_commit=False) sqlalchemy_config = SQLAlchemyAsyncConfig( connection_string=settings.DB_URL, session_config=session_config,...
Python
1
CiovecArray<'_>, _si_flags: types::Siflags, ) -> Result<types::Size> { unimplemented!("sock_send") } fn sock_shutdown(&self, _fd: types::Fd, _how: types::Sdflags) -> Result<()> { unimplemented!("sock_shutdown") } } #[cfg(feature = "alloc")] use compact_arena::{mk_arena, Idx32 as...
Rust
0
# -*- coding: utf-8 -*- """ The “SerialPortBridgeGeneric” component is used to send data (force, displacement, pressure…) through the usb port. Usally used to send data to an Arduino card to control the real robot. .. image:: http://project.inria.fr/softrobot/files/2016/05/Diamond2.png :width: 200px .. image:: htt...
Python
1
""" Logger 設定模組。 提供整合 tqdm 進度條的 Logger 配置,避免 log 輸出影響進度條顯示。 """ import os from loguru import logger from tqdm import tqdm class TqdmLogSink: """使用 tqdm.write 來輸出 log,避免影響 tqdm 進度條。""" def write(self, message: str) -> None: """ 將 log 訊息寫入輸出。 Args: message: 要輸出的 log 訊息 ...
Python
1
nup(self): """Clean up resources""" await self.exit_stack.aclose() async def main(): if len(sys.argv) < 2: print("Usage: python client.py <path_to_server_script>") sys.exit(1) client = MCPClient() try: print("Getting server up...") await client.connect_to_s...
Python
1
# Copyright 2021 JD.com, Inc., JD AI """ @author: Yehao Li @contact: yehaoli.sysu@gmail.com """ import torch import torch.nn as nn from xmodaler.config import configurable from xmodaler.config import kfg from .build import LOSSES_REGISTRY @LOSSES_REGISTRY.register() class WeightCrossEntropy(nn.Module): @configura...
Python
1
cs", "Bullet3OpenCL_clew", "BulletDynamics", "BulletSoftBody"]; const REPOSITORY: &'static str = "https://github.com/bulletphysics/bullet3.git"; const TAG: &'static str = "2.86.1"; macro_rules! get(($name:expr) => (ok!(env::var($name)))); macro_rules! ok(($expression:expr) => ($expression.unwrap())); macro_rules! l...
Rust
0
self.mut_unknown_fields())?; }, }; } ::std::result::Result::Ok(()) } // Compute sizes of nested messages #[allow(unused_variables)] fn compute_size(&self) -> u32 { let mut my_size = 0; my_size += ::protobuf::rt::unknown_fields_size(self.get_un...
Rust
0
Some(ix) } else { None } }); assert!(token_ix.is_some()); let token_ix = token_ix.unwrap(); // Check that the placed token is connected to the required fa...
Rust
0
_i.colon_token.spans); _visitor.visit_type(&*_i.ty); tokens_helper(_visitor, &_i.eq_token.spans); _visitor.visit_expr(&*_i.expr); tokens_helper(_visitor, &_i.semi_token.spans); } #[cfg(feature = "full")] pub fn visit_item_enum<'ast, V: Visit<'ast> + ?Sized>(_visitor: &mut V, _i: &'ast ItemEnum) { fo...
Rust
0
ise) if self.lower_order_nums < self.config.solver_order: self.lower_order_nums += 1 # upon completion increase step index by one self._step_index += 1 if not return_dict: return (prev_sample,) return SchedulerOutput(prev_sample=prev_sample) # Cop...
Python
1
( pVideoFormat: *const MFVIDEOFORMAT, ppIVideoMediaType: *mut *mut IMFVideoMediaType, ) -> HRESULT; pub fn MFCreateVideoMediaTypeFromSubtype( pAMSubtype: *const GUID, ppIVideoMediaType: *mut *mut IMFVideoMediaType, ) -> HRESULT; pub fn MFIsFormatYUV(Format: DWORD) -> BOOL...
Rust
0
697626306043907037879730861808111\ 6462714015276061417569195587321840254520\ 6554249067198924288448418393532819729885\ 3131051173864896596258282150250499026445\ 2100885281673303711...
Rust
0
BSD 3-Clause License: // <http://opensource.org/licenses/BSD-3-Clause> // This file may not be copied, modified, or distributed // except according to those terms. //! Module that holds the struct and trait implementations for the ssa form. use middle::ir::{self, MAddress, MOpcode}; use middle::regfile::SubRegisterFi...
Rust
0
from mcp.server.fastmcp import FastMCP, Image, Context import json import urllib from urllib import request import time import os mcp = FastMCP("Comfy MCP Server") host = os.environ.get("COMFY_URL") workflow = os.environ.get("COMFY_WORKFLOW_JSON_FILE") prompt_template = json.load( open(workflow, "r") ) if workfl...
Python
1
d.2; average.3 += rnd.3; } average.0 /= count as f32; average.1 /= count as f32; average.2 /= count as f32; average.3 /= count as f32; println!("\nRNG vec4f32 Uniformality (Closer to 0.0): w: {}, x: {}, y: {}, z: {}\n", average.3, average.0, average.1, average.2); assert!(aver...
Rust
0
567890"), "xesef-disof-gytuf-katof-movif-baxux"); assert_eq!(encode("Pineapple"), "xigak-nyryk-humil-bosek-sonax"); assert_eq!( encode("💎🦀❤️✨💪"), "xusan-zugom-vesin-zenom-bumun-tanav-zyvam-zomon-sapaz-bulin-dypux" ); } #[test] fn decoder() { asser...
Rust
0
pub fn set_async_scan(&mut self, async_scan: bool){ self.async_scan = async_scan; } pub fn set_os_detection(&mut self, os_detection: bool){ self.os_detection = os_detection; } } pub mod generic; pub mod sifive; pub mod sunxi; pub mod virt; mod delay; mod pause; mod terminate; pub fn sta...
Rust
0
, pie_chart)) if negative_faces: neg_faces_panel = np.hstack(list(negative_faces)) target_width = result_display.shape[1] target_height = 200 aspect_ratio = neg_faces_panel.shape[1] / neg_faces_panel.shape[0] ...
Python
1
memory.children[0] = XMLNode::Text(format!("{}", given_memory as u64 * 0x100000u64)); } } if let Some(nr_cpus) = overrides.nr_cpus { if let Some(vcpu) = xml.get_mut_child("vcpu") { vcpu.children[0] = XMLNode::Text(format!("{}", nr_cpus))...
Rust
0
import requests import math import json from typing import List, Dict, Any # Taiko Inbox contract address CONTRACT_ADDRESS = "0x06a9ab27c7e2255df1815e6cc0168d7755feb19a" def fetch_transactions(contract_address: str, limit: int = 20) -> Dict[str, Any]: url = f"https://api.tenderly.co/api/v1/public-contract/1/addre...
Python
1
import sys sys.path.append(r'D:\Dev\Source\Falcom\Decompiler2') from Falcom.ED6.Parser.scena_writer_helper import * try: import E0410_hook except ModuleNotFoundError: pass scena = createScenaWriter('E0410 ._SN') # id: 0xFFFF offset: 0x0 @scena.Header('Header') def Header(): header = ScenaHeader() h...
Python
1
import argparse import time import traceback from services import Client, Server, Bootstrapper, Relay # Main client-server setup with video streaming capabilities def run_client(args): """Run the client that connects to the server, requests video streaming, and displays it.""" try: # Initialize client...
Python
1
import os from faker import Faker import random from datetime import datetime import pandas as pd fake = Faker() # Generate fake data ["Customer", "Category", "Amount"] def generate_fake_record(pid): customer = fake.name() category = random.choice(["Electronics", "Clothing", "Home & Garden", "Sports", "Books...
Python
1
); } Ok(column_value_map) } <reponame>linyinfeng/syn-flood use crate::{ error::SynFloodError, option::Opt, random::{random_global_ipv4_addr, random_source_port}, runner::run, }; use log::{debug, info}; use pnet::{ packet::{ ip::IpNextHeaderProtocols, ipv4::{self, Ipv4Pack...
Rust
0
import pyodbc class DBConnUtil: @staticmethod def get_connection(): return pyodbc.connect( "Driver={ODBC Driver 17 for SQL Server};" "Server=LAPTOP-QB4MOV49;" "Database=PetPals;" "Trusted_Connection=yes;" )
Python
1
/// Fetch a specific vault by ID. /// /// # Arguments /// * `vault_id` - account ID of the vault /// /// # Errors /// * `VaultNotFound` - if the rpc returned a default value rather than the vault we want /// * `VaultLiquidated` - if the vault is liquidated /// * `VaultCommittedTheft...
Rust
0
() { assert_eq!(part2(TEST_INPUT_1), 4988); //assert_eq!(part2(TEST_INPUT_3), 31284); assert_eq!(part2(TEST_INPUT_4), 3478); assert_eq!(part2(TEST_INPUT_5), 6474); assert_eq!(part2(TEST_INPUT_6), 1140); assert_eq!(part2(INPUT), 88537); } } use std::f64::consts::{PI, ...
Rust
0
asm!("ret"); std::hint::unreachable_unchecked() } } fn main() { let ctx = ThreadContext{rsp: 0x80, r15: 0x88}; gt_switch(&ctx); } <gh_stars>0 #![allow(non_snake_case)] //! OrcV2 pub mod ee; pub mod lljit; use error::LLVMErrorRef; use prelude::*; use target_machine::LLVMTargetMachineRef; ...
Rust
0
mputed based on the PK columns cardinality /// that will be best for RLE encoding. /// /// Refer to query::provider::build_scan_plan for the detail of the plan /// fn sorted_scan_plan<C, I>(&self, schema: Arc<Schema>, chunks: I) -> Result<ScanPlan<C>> where C: QueryChunk + 'static, ...
Rust
0
).is_extension, Type::Union(id) => self.union(id).is_extension, Type::InputObject(_) => false, } } fn is_string(&self, type_: Type) -> bool { match type_ { Type::Scalar(id) => self.scalar(id).name.lookup() == "String", _ => false, } } ...
Rust
0
from __future__ import annotations import pytest from trame_slicer.utils import SlicerWrapper, wrap def test_wraps_slicer_obj_function_calls(a_slicer_app): model_node = a_slicer_app.scene.AddNewNodeByClass("vtkMRMLModelNode") model_node.SetName("New Name") wrapped_model = wrap(model_node) assert mo...
Python
1
F16, F17, F18, F19, F20, F21, F22, F23, F24, LeftArrow, Control, RightArrow, DownArrow, End, UpArrow, PageUp, Alt, Return, PageDown, Delete, Home, Escape, Backspace, Meta, CapsLock, Shift, Tab, Space, } pub trai...
Rust
0
image_source=image_url, is_url=True, prompt="请详细描述这张图片中的内容,包括主要元素、场景和任何值得注意的细节" ) if result["status"] == "success": logger.info(f"分析结果:{result}") result_ana = result.get("analysis")...
Python
1
import requests shared_library_version = "1.9.1" github_download_url = "https://github.com//bogdanfinn/tls-client/releases/download/v{}/{}" github_repo_filenames = [ # Windows f"tls-client-windows-32-{shared_library_version}.dll", f"tls-client-windows-64-{shared_library_version}.dll", # MacOS f"tls...
Python
1
; pub const TRUST_E_EXPLICIT_DISTRUST: HRESULT = 0x800B0111; pub const CERT_E_UNTRUSTEDCA: HRESULT = 0x800B0112; pub const CERT_E_INVALID_POLICY: HRESULT = 0x800B0113; pub const CERT_E_INVALID_NAME: HRESULT = 0x800B0114; pub const SPAPI_E_EXPECTED_SECTION_NAME: HRESULT = 0x800F0000; pub const SPAPI_E_BAD_SECTION_NAME_L...
Rust
0
import hid import time for d in hid.enumerate(0, 0): keys = d.keys() keys.sort() for key in keys: print "%s : %s" % (key, d[key]) print "" try: print "Opening device" h = hid.device(0x461, 0x20) #h = hid.device(0x1941, 0x8021) # Fine Offset USB Weather Station print "Manufactu...
Python
1
lace(self._space_token, ' ') return x_str def decode(self, token_ids: Union[List[int], Tensor], skip_special_tokens: bool=False, **kwargs) -> str: return self._decode(token_ids, skip_special_tokens) def batch_decode(self, sequen...
Python
1
, w, h) elif format is tv_tensors.BoundingBoxFormat.XYWHR: parts = (x, y, w, h, r) elif format is tv_tensors.BoundingBoxFormat.CXCYWHR: cx = x + w / 2 cy = y + h / 2 parts = (cx, cy, w, h, r) elif format is tv_tensors.BoundingBoxFormat.XYXYXYXY: r_rad = r * torch.pi /...
Python
1
from pydantic import BaseModel, Field class BilibiliServiceConfig(BaseModel): class Credential(BaseModel): sessdata: str = Field(default="<SESSDATA>", description="Value of the `SESSDATA` from the cookie.") bili_jct: str = Field(default="<bili_jct>", description="Value of the `bili_jct` from the c...
Python
1
]; codes.append(&mut self.tail_to_asm(tail)); let cfg = Cfg(label, codes); blocks.push(cfg); // other code blocks for lambda in lambdas { match lambda { Lambda (labl, box lambda_tai...
Rust
0
onal list of fieldnames. If no fieldnames are provided, the class will try to infer them from the data. :param filename: The name of the CSV file where data will be written. :param fieldnames: List of column names (fields) in the CSV file. Defaults to None. """ self.filename = f...
Python
1
zers.get(expected_config["initializer"])) self.assertEqual(network.get_config(), expected_config) # Create another network object from the first object's config. new_network = bert_encoder.BertEncoder.from_config(network.get_config()) # Validate that the config can be forced to JSON. _ = network.to...
Python
1
from typing import Optional from scipy.special import lambertw import numpy as np from neuron import h, gui from neuron.units import ms def test_cnexp_to_derivimplicit( mech: str, rtol: float, dt: Optional[float] = None, ): """ Test that NMODL changes the solver from cnexp to derivimplicit if it ...
Python
1
-> Result<()> { input_array_arg!(images); output_array_arg!(descriptors); unsafe { sys::cv_Feature2D_compute_const__InputArrayR_vector_vector_KeyPoint__R_const__OutputArrayR(self.as_raw_mut_Feature2D(), images.as_raw__InputArray(), keypoints.as_raw_mut_VectorOfVectorOfKeyPoint(), descriptors.as_raw__OutputArray(...
Rust
0
cs for {}: mcc ' '= {} , elapsed time (sec): {:.3f}'.format( epoch, name, mcc, elapsed_time)) else: from scipy.stats import pearsonr, spearmanr pearson_corr = pearsonr(predicted_gather, labels_gather)[0] ...
Python
1
p(); } // Copyright 2021 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { crate::{ component_model::BuildAnalyzerModelError, environment::EnvironmentForAnalyzer, node_path::NodePath, route::RouteM...
Rust
0