text
string
label_name
string
labels
int64
Info] }; // TODO: Always available? unsafe { Id::retain_autoreleased(obj).unwrap() } } pub fn process_name(&self) -> Id<NSString, Shared> { let obj: *mut NSString = unsafe { msg_send![Self::class(), processName] }; unsafe { Id::retain_autoreleased(obj).unwrap() } } } <gh_sta...
Rust
0
impl ResponseBodyOps for Host { fn response_data(&self, start: usize, max_size: usize) -> host::Result<ByteString> { hostcalls::get_buffer(BufferType::HttpResponseBody, start, max_size) } } impl ResponseTrailersOps for Host { fn response_trailers(&self) -> host::Result<HeaderMap> { hostcal...
Rust
0
pe( inputs, shape=[batch_size * max_time, np.prod(inputs.shape.as_list()[-3:])]) for i in range(1, 5, 1): with tf.variable_scope('fc%d' % (i)) as scope: outputs = tf.contrib.layers.fully_connected( inputs=outputs, num_outputs=2048,...
Python
1
import os from rdkit import Chem # os.environ["CUDA_VISIBLE_DEVICES"] = "4" from unimol_tools import MolTrain2 import numpy as np import pandas as pd from multiprocessing import freeze_support def main(): # read from excel def norm_smiles(raw_smiles): mol = Chem.MolFromSmiles(raw_smiles) if mo...
Python
1
] mod hot_reload; #[cfg(all(debug_assertions, feature = "hot-reload"))] mod libloader; #[cfg(not(all(debug_assertions, feature = "hot-reload")))] mod libloader { pub(crate) struct LibLoader {} } mod alloc; mod geometry; mod layout; mod parser; pub mod app; pub mod grc; pub mod key; pub mod lenses; pub mod render...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2024 Google LLC. 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 requir...
Python
1
"""Create a password for a software component""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting @click.command(cls=SoftLayer.CLI.command.SLCommand, ) @click.argument('identif...
Python
1
import numpy as np from sklearn.metrics import accuracy_score from keras.datasets import reuters from keras.preprocessing.sequence import pad_sequences from keras.utils import to_categorical from keras.models import Sequential from keras.layers import Dense, LSTM, Activation from keras import optimizers from keras.wra...
Python
1
_header_table_index: u16, } impl ElfHeader { /// Create an object from byte array. pub fn try_new(binary: &[u8]) -> Result<ElfHeader> { if binary.len() < SIZE_ELF32_HEADER { return Err(LoaderError::TooShortBinary {}); } // unwrap the result of read_u* because the binary has ...
Rust
0
sion)] aws_smithy_types::Number::NegInt((input.asn).into()), ); } if let Some(var_250) = &input.auth_key { object.key("authKey").string(var_250); } if let Some(var_251) = &input.address_family { object.key("addressFamily").string(var_251.as_str()); } if let So...
Rust
0
ytes - Unknown (type?) (Int) /// [1] Byte - Boolean? Unknown /// [1] Byte - Boolean? Unknown /// [1] Byte - Boolean? Unknown /// [1] Byte - Boolean? Unknown /// [4] Bytes - Unknown (Int) /// .Lev File Spec /// First Table (Height) /// /// Each Row is 36 Bytes long. Number of Rows is relative to ((X*Y) / 256) (dimension...
Rust
0
ification of the hybridisation state deliver approximately the same result (small deviation arises from the difference in the parameters for the oxygen atom of the hydroxyl group in the carboxyl group that propagates to the amino group). Moreover, it is verified whether the respective UserWarning ab...
Python
1
#!/usr/bin/python3 from keyman_config.gsettings import GSettings GSETTINGS_ENGINE_BASE = 'com.keyman.engine' GSETTINGS_ADDITIONAL_KEYBOARDS_KEY = 'additional-keyboards' class CustomKeyboards(): def __init__(self): self.gsettings = GSettings(GSETTINGS_ENGINE_BASE) def add(self, keyboard): if...
Python
1
) } } use serde::Deserialize; use std::error::Error; use std::fs::File; use std::io::{BufReader, Read}; use std::net::SocketAddr; use std::str; #[derive(Deserialize)] pub struct Config { pub statsd_addr: SocketAddr, pub carbon_addr: SocketAddr, pub flush_interval: u64, } impl Config { pub fn load(...
Rust
0
import itertools import re LANGUAGE_UNICODE_RANGE_MAP = { "ZH": [(0x4E00, 0x9FFF)], "JP": [(0x4E00, 0x9FFF), (0x3040, 0x309F), (0x30A0, 0x30FF), (0x31F0, 0x31FF)], "EN": [(0x0000, 0x007F)], } SYMBOLS_MAPPING = { ":": ",", ";": ",", ",": ",", "。": ".", "!": "!", "?": "?", "\n": ...
Python
1
macro_rules! stop { () => ( cpu.stop(); ) } // Fetch the next instruction from memory let op = mem.lb(cpu.bump()); // Decode and execute the instruction, returning the number of cycles required to run it. // See http://imrannazar.com/Gameboy-Z80-Opcode-Map for decode table // See http://probl...
Rust
0
lImage(index), )); index }); SpinelImage(*index) } fn get_current_image(&mut self, context: &ViewAssistantContext) -> SpinelImage { self.get_image(context.image_index) } fn render_with_clip( &mut self, composition: &SpinelComposition, ...
Rust
0
import copy def safety_check(*args): """ 安全性检测算法(Safety Algorithm) 参数: allocated: 已分配矩阵(list of list of int) need: 需求矩阵(list of list of int) available: 可用资源向量(list of int) 返回: (is_safe, safe_sequence) is_safe: bool, 是否是一个安全状态 safe_sequence: 若安全,返回一个安全序...
Python
1
fn precalc() -> Vec<u16> { let mut tab = Vec::new(); for i in 0..359 { tab.push(((f64::from(i).to_radians().sin() + 1.0) * 50.0).round() as u16); } tab } fn main() -> Result<(), std::io::Error> { cc::Build::new() .file("src/hello.c") .compile("hello"); let tab =...
Rust
0
sh(b'0'); buffer.push(HEX_DIGITS[(c >> 4) as usize]); buffer.push(HEX_DIGITS[(c & 0xF) as usize]); } } } from = pos + 1; if let Some(new_pos) = &bytes[from ..].iter().position(|c| match *c {b'"' | b'\\' | 0..=31 => true, _ => false}) { pos = from + *new_pos; } else { buffer.extend_from_sl...
Rust
0
from typing import Annotated from fastapi import Depends, HTTPException, status from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials from sqlalchemy.ext.asyncio import AsyncSession from app.core.database import get_db from app.features.auth.service import AuthService from app.features.auth.models impor...
Python
1
also: http://docs.python.org/3/library/subprocess#subprocess.Popen.kill r")rs rkillSubprocessTransport.kill "!rN r7r8r9r:r<rrrrrrr=r>rrr r %I"""" " "rr c`^\rSrSrSrSrS...
Python
1
from fastapi import APIRouter from app.api.chat import ChatApi from app.api.users import UsersApi from app.api.orders import OrdersApi from app.api.auth import AuthApi def get_router() -> APIRouter: """ Создает и настраивает основной роутер приложения. Returns: APIRouter: Сконфигурированный роуте...
Python
1
a. if aperture_radii.is_empty() || focus_distances.is_empty() { aperture_radii = &[0.0]; focus_distances = &[1.0]; if aperture_radii.is_empty() && !focus_distances.is_empty() { println!( "WARNING: camera has aperture radius but no focus di...
Rust
0
If missing, verneuilctl restore will attempt to download it /// from remote storage, based on `--hostname` and `--source_path`. /// /// As special cases, an `http://` or `https://` prefix will be /// downloaded over HTTP(S), an /// `s3://bucket.region[.endpoint]/path/to/blob` URI will be /// lo...
Rust
0
<'a, T> FinancialAssetValueOf<'a> for FinancialAssetWithMetadata<T> where T: 'a + FinancialAssetLike + FinancialAssetRawValueOf<'a> { fn value_of(&self, value: &'a BigDecimal) -> BigDecimal { let value = self.asset.raw_value_of(value); self.metadata.round(value.borrow()) } } impl<'a, T> Fin...
Rust
0
sert!(buffer.starts_with(b" heroic")); Ok(()) } #[test] fn from_custom_cleared() -> Result<(), Error> { let mut len = 4; let mut buffer = [b' '; 256]; let mut writer = StrWriterMut::from_custom_cleared(&mut buffer, &mut len); assert_eq!(writer.as_str(), ""); writer.write_str("hello")?; ...
Rust
0
E(): pass label('loc_23E') Battle(0x0000006E, 0x00000000, 0x00, 0x0000, 0xFF) Jump('loc_2B8') def _loc_24E(): pass label('loc_24E') Battle(0x0000003C, 0x00000000, 0x00, 0x0000, 0xFF) Jump('loc_2B8') def _loc_25E(): pass label('loc_25E') Battle(0x000007DF, 0x00000000, 0x...
Python
1
_chan_entry!(self, Err(e), channel_state, chan); unreachable!(); }, Ok(res) => res }; if let Err(e) = self.chain_monitor.update_channel(chan.get().get_funding_txo().unwrap(), monitor_update) { return_monitor_err!(self, e, channel_state, chan, RAACommitmentOrder::RevokeAndACKFirst, true,...
Rust
0
from unittest import TestCase import torch from chroma.models.graph_classifier import GraphClassifier class TestGraphClassifier(TestCase): def test_graph_classifier(self): class_config = { "dummy_1": { "tokens": ["a", "b", "c", "d"], "loss": "bce", ...
Python
1
report_lines.append("") if self.skipped_frames: report_lines.append(f"SKIPPED FRAMES ({len(self.skipped_frames)}):") report_lines.append("-" * 30) for skip in self.skipped_frames: report_lines.append(f"Frame {skip['frame']:03d}: {skip['reason'...
Python
1
20long\x20the\x20peer\x20has\x20beekn\x20inactive\x20for\n\n\ \x0c\n\x05\x04\x01\x02\x04\x06\x12\x03+\x04\x1c\n\x0c\n\x05\x04\x01\x02\ \x04\x01\x12\x03+\x1d)\n\x0c\n\x05\x04\x01\x02\x04\x03\x12\x03+,-\n-\n\ \x04\x04\x01\x02\x05\x12\x03,\x04,\"\x20\x20is\x20when\x20the\x20peer\ \x20was\x20last\x20seen\n\...
Rust
0
ld need a `&'a mut BuilderArena` and `StructBuilder::borrow()` would // have lifetime issues. (If `'a: 'b`, then a `&'a (BuilderArena + 'a)` can be // converted to a `&'b (BuilderArena + 'b)`, but a `&'a mut (BuilderArena + 'a)` // *cannot* be converted to a `&'b mut (BuilderArena + 'b)`. See some discussio...
Rust
0
TES], ); let src_pub_: BufWriteSized< { crypto_box::curve25519xchacha20poly1305::PUBLICKEYBYTES }, > = BufWriteSized::new_no_lock(); let src_sec: BufWriteSized< { crypto_box::curve25519xchacha20poly1305::SECRETKEYBYTES }, > = BufWriteSized::new_mem_locked(...
Rust
0
q.put(weights) def get_batch(self): batch = [] while len(batch) < self.batch_size: batch.append(self.samples_queue.get()) states, actions, rewards = list(map(np.array, zip(*batch))) return [states, actions, rewards] def get_done_rewards(self): res = [...
Python
1
LegPositions::new( Point3::new( LEG_DISTANCE_LATERAL + OFFSET_DISTANCE + random_float(0.03), LEG_DISTANCE_LONGITUDAL + OFFSET_DISTANCE + random_float(0.03), GROUND_LEG_HEIGHT + random_float(0.03), ), Point3::new( 0.0 + random_float(0.03), ...
Rust
0
dev_11_22_33_44_55_66/service0022/char0033/desc0034", ); assert_eq!(descriptor_id.characteristic(), characteristic_id); } } //! Defines error handling types used by the create //! uses the `snafu` crate for generation use neon::result::Throw; use serde::{de, ser}; use snafu::{Backtrace, Snafu}; use...
Rust
0
from embeddings import CodeBERTEmbedder from vectorstore import VectorStore from langchain_ollama import OllamaLLM from langchain_core.prompts import ChatPromptTemplate from retriever import retrieve def search_problem_context(query_statement): query_problem = query_statement query_problem_embedding = embe...
Python
1
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All rights reserved. # # 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 withou...
Python
1
trna_number =+ 1 gtf_inf = (row['evidence_acession']) elif pd.isnull(row['Evidence_source']): #hypos typeq = "CDS" tagstr = ("protein_id" + "\tlcl|" + row['gene_name']) productstr = row['evidence_description'] inferencestr = ("note\tno sea...
Python
1
import operator_benchmark as op_bench import torch """Microbenchmarks for quantized batchnorm operator.""" batchnorm_configs_short = op_bench.config_list( attr_names=["M", "N", "K"], attrs=[ [1, 256, 3136], ], cross_product_configs={ "device": ["cpu"], "dtype": (torch.qint8,)...
Python
1
value=0, command=set_satisfy) satisfied.place(anchor=u'nw', x=450, y=10) not_satisfied.place(anchor=u'nw', x=510, y=10) appearance = IntVar() appearance.set(int(user.get(u'appearance', -1))) for i in range(1, 11): score_i = Radiobutton(master, text=str(i), variable=appearance, ...
Python
1
g::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sw_pad_ctl_pad_gpio_b0_03](sw_pad_ctl_pad_gpio_b0_03) module"] pub type SW_PAD_CTL_PAD_GPIO_B0_03 = crate::Reg<u32, _SW_PAD_CTL_PAD_GPIO_B0_03>; #[al...
Rust
0
e std::pin::Pin; use std::task::Context; use std::task::Poll; use bytes::Bytes; use futures::io; use futures::ready; use futures::AsyncWrite; use crate::BytesSink; /// Convert [`BytesSink`][crate::BytesSink] into [`BytesWrite`][crate::BytesWrite]. /// /// # Note /// /// This conversion is **zero cost**. /// /// # Ex...
Rust
0
y_pred_neg_numpy = y_pred_neg y_true = np.concatenate([np.ones(len(y_pred_pos_numpy)), np.zeros(len(y_pred_neg_numpy))]).astype(np.int32) y_pred = np.concatenate([y_pred_pos_numpy, y_pred_neg_numpy]) rocauc = roc_auc_score(y_true, y_pred) return {'rocauc': rocauc} if __n...
Python
1
"eventType": "THEATER", }, }, "keywords": "Dancing with the Stars, Fantasy Springs Resort Casino, Indio, CA, Dancing with the Stars", "chartUrl": "http://d2o50i5c2dr30a.cloudfront.net/ef591997-0669-427d-b73c-d47d7af39105.jpg", "stubhubEvent...
Python
1
Clovis, CA"), ("UPDATE city_requests SET state = 'NY' WHERE city_name = 'New York City' AND state = 'UNKNOWN'", "New York City state"), ] for query, description in fixes: cursor.execute(query) if cursor.rowcount > 0: print(f" Fixed {cursor.rowcount}: {description}") ...
Python
1
max_box_size, test_device) num_rays = 500 max_test_size = 1000 origins, directions = _get_random_rays(num_rays, max_test_size, aabb, test_device) # time1 = time.time() t_min, t_max = intersect_aabb(origins, directions, aabb) # time2 = time.time() # time3 = time...
Python
1
for $class { fn div_assign(&mut self, rhs: $type) { self.0 /= rhs } } impl ops::Rem<$type> for $class { type Output = Self; fn rem(self, rhs: $type) -> Self { Self::from(self.0 % rhs) } } impl...
Rust
0
ation; use violetabftstore::interlock::::mpsc; fn counter_closure(counter: &Arc<AtomicUsize>) -> Message { let c = counter.clone(); Message::Callback(Box::new(move |_: &mut Runner| { c.fetch_add(1, Ordering::SeqCst); })) } fn noop() -> Message { Message::Callback(Box::new(|_| ())) } fn unreac...
Rust
0
_t { pub uid: u64, pub backend_data: [u32; 8usize], } pub const tm_renderer_dispatch_type_TM_RENDERER_DISPATCH_TYPE_NORMAL: tm_renderer_dispatch_type = 0; pub const tm_renderer_dispatch_type_TM_RENDERER_DISPATCH_TYPE_INDIRECT: tm_renderer_dispatch_type = 1; pub type tm_renderer_dispatch_type = ::std:...
Rust
0
has failed. pub fn set_reconnect_min_time(self, reconnect_min_time: Duration) -> Self { let mut this = self; this.reconnect_min_time = Some(reconnect_min_time); this } ///The maximum amount of time to wait before attempting to establish a connection after a previous /// attempt...
Rust
0
const HKEY_LOCAL_MACHINE: HKEY = -2147483646i32 as _; #[doc = "*Required features: `\"Win32_System_Registry\"`*"] pub const HKEY_PERFORMANCE_DATA: HKEY = -2147483644i32 as _; #[doc = "*Required features: `\"Win32_System_Registry\"`*"] pub const HKEY_PERFORMANCE_NLSTEXT: HKEY = -2147483552i32 as _; #[doc = "*Required f...
Rust
0
Num { match (self, rhs) { (Num::Int(i0), Num::Int(i1)) => Num::Int(i0.wrapping_sub(i1)), (Num::Int(i0), Num::Flo(f1)) => Num::Flo(i0 as f32 - f1), (Num::Flo(f0), Num::Int(i1)) => Num::Flo(f0 - i1 as f32), (Num::Flo(f0), Num::Flo(f1)) => Num::Flo(f0 - f1) } } } impl Mul for Num { type Outp...
Rust
0
d575_2adb_3ac0, 0x1663_e144_39c2_129e, 0xeac7_b7da_7070_6611, 0xd5d0_f419_eac3_ad95, 0xf7aa_0f5f_46d4_7c4d, 0xac04_b804_e624_5cde, 0xfa8b_b4b9_8a01_faf1, 0xe36b_3af9_6b0d_ecce, 0x66a3_2e04_4b06_ddd0, 0x68d1_2709_5d0d_fa2e, 0xf1fc_af7a_e709_8b29, 0xbea3_c5d2_d66d_93f6, 0x028a_d26c_b8bf_6451, 0xd342_9797_...
Rust
0
false)); } } (bind, Some(_)) if bind.parse::<SocketAddr>().is_ok() => { let bind = bind.parse().unwrap(); let mut nodes = Vec::new(); match (args.next().unwrap(), args.peek()) { (arg, Some(_)) => { let mut arg: Option<String> = Some(arg); loop { match ( arg.take()....
Rust
0
og::unpack; /// let arr: [u8; 4] = [1, 0, 0, 255]; /// assert_eq!(unpack::as_i32_le(&arr), -16777215); /// ``` pub fn as_i32_le(arr: &[u8]) -> i32 { as_u32_le(arr) as i32 } /// Convert a array of two u8 elements into a u16 /// Assumes little endianness. /// /// # Examples /// ``` /// use px4_ulog::unpack; /// ...
Rust
0
"""Runs the PettingZoo Waterworld multi-agent env in RLlib using single policy learning. Other than the `pettingzoo_independent_learning.py` example (in this same folder), this example simply trains a single policy (shared by all agents). See: https://pettingzoo.farama.org/environments/sisl/waterworld/ for more detai...
Python
1
#Empty Reyclce Bin Using GUI import tkinter as tk # Import Tkinter for GUI from tkinter import messagebox # Import messagebox for displaying alerts import winshell # Import winshell for Recycle Bin operations # Function to empty the Recycle Bin def empty_recycle_bin(): try: # Access the Recycle Bin an...
Python
1
BOOLEAN"; const JSON_TYPE_NONE: &[u8] = b"NULL"; const JSON_TYPE_INTEGER: &[u8] = b"INTEGER"; const JSON_TYPE_UNSIGNED_INTEGER: &[u8] = b"UNSIGNED INTEGER"; const JSON_TYPE_DOUBLE: &[u8] = b"DOUBLE"; const JSON_TYPE_STRING: &[u8] = b"STRING"; const JSON_TYPE_OBJECT: &[u8] = b"OBJECT"; const JSON_TYPE_ARRAY: &[u8] = b"A...
Rust
0
alf, 0) == Matrix([[1, 0], [0, 1]]) assert wigner_d_small(half, pi/2) == Matrix([[1, 1], [-1, 1]])/sqrt(2) assert wigner_d_small(half, pi) == Matrix([[0, 1], [-1, 0]]) alpha, beta, gamma = symbols("alpha, beta, gamma", real=True) D = wigner_d(half, alpha, beta, gamma) assert D[0, 0] == exp(I*alpha/...
Python
1
# -*- coding: utf-8 -*- """The definitions.""" # fixed COMPOUND_SIGNATURE = b'\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1' COMPOUND_BYTE_ORDER = 65534 #b'\xff\xfe' HC_STR_VTYPE_STREAM_SYNTAX_ERROR = '스트림 구문 오류' HC_STR_VTYPE_INCONSISTENCY ="속성 불일치" HC_STR_VTYPE_UNUSED_AREA = "미사용 영역 존재" HC_STR_VTYPE_ABNORMAL_RECORD = "비정상 레코드...
Python
1
match url.search_params().get("time") { None => return None, Some(t) => t, }; let time: f64 = time.parse().ok()?; Some(Duration::from_secs_f64(time)) } pub fn draw(&mut self) -> Result<(), JsValue> { self.canvas.draw(self.game.clone()) } } fn get_recorded_game() -> Result<Option<Rec...
Rust
0
3, "N-SEC-PER-M3", /// `Nat`: NAT, "NAT", /// `Nat per Second`: NAT_PER_SEC, "NAT-PER-SEC", /// `Neper`: NP, "NP", /// `Nephelometry Turbidity Unit`: NTU, "NTU", /// `Number`: NUM, "NUM", /// `Number per square centimetre per thousand years`: NUM_PER_CentiM_KiloYR, ...
Rust
0
d or Stopped) EndOfTrack { play_request_id: u64, track_id: SpotifyId, }, // The player was unable to load the requested track. Unavailable { play_request_id: u64, track_id: SpotifyId, }, // The mixer volume was set to a new level. VolumeSet { volume: u...
Rust
0
}) } } pub fn shoot_spinners( drawables: NonSendSync<UniqueView<Drawables>>, mut entities: EntitiesViewMut, mut spinners: ViewMut<Spinner>, mut bullets: ViewMut<Bullet>, mut physicses: ViewMut<Physics>, mut sprites: ViewMut<Sprite>, mut physics_bodies: ViewMut<PhysicsBody>, ...
Rust
0
as_any(&self) -> &dyn (::std::any::Any) { self as &dyn (::std::any::Any) } fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { self as &mut dyn (::std::any::Any) } fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> { self } fn des...
Rust
0
usize, u64, VkDeviceSize, u32, u32); pub type PFN_vkCmdDrawIndexedIndirect = extern "system" fn(usize, u64, VkDeviceSize, u32, u32); pub type PFN_vkCmdDispatch = extern "system" fn(usize, u32, u32, u32); pub type PFN_vkCmdDispatchIndirect = extern "system" fn(usize, u64, VkDeviceSize); pub type PFN_vkCmdCopyBuffer = ex...
Rust
0
ort_date} ## 📈 關鍵指標 • **Pylint 評分**: {avg_pylint:.1f}/10 {'✅' if avg_pylint >= 8.5 else '⚠️' if avg_pylint >= 8.0 else '❌'} • **平均複雜度**: {avg_complexity:.1f} {'✅' if avg_complexity <= 10 else '⚠️' if avg_complexity <= 15 else '❌'} • **可維護性指標**: {avg_mi:.1f} {'✅' if avg_mi >= 20 else '⚠️' if avg_mi >= 10 else '❌'} • *...
Python
1
hare/sounds/alsa/Front_Left.wav".to_owned())) .hint(Hint::SoundName("system sound".to_owned())) .hint(Hint::SuppressSound(false)) .show()?; freeze("Transient"); Notification::new() .summary("transient") .hint(Hint::Transient(false)) .show()?; freeze("X and Y...
Rust
0
_resource, texture_resource)) } fn upload_texture( device: &Device, texture_desc: &ResourceDesc, init_data: &[u8], ) -> IDRResult<(Resource, Resource)> { let command_queue = device.create_command_queue( &CommandQueueDesc::default() .set_queue_type(CommandListType::Direct) ...
Rust
0
lf.reset() if to_mel: yield mel else: for audio in self.vocos.streaming_decode(mel, is_last): yield audio def test_streaming_decode(self, wav_path: str): import torchaudio audio, sr = torchaudio.load(wav_path) if a...
Python
1
ts = self._extract_m3u8_formats( video_data['fullpath'], video_id, ext='mp4', entry_protocol='m3u8_native', m3u8_id='hls') for a_format in formats: # LiTV HLS segments doesn't like compressions a_format.setdefault('http_headers', {})['Accept-Encoding'] = 'identity...
Python
1
import os from pathlib import Path from parser import parse_schema from generate_kotlin import generate_kotlin from generate_python import generate_python INPUT_DIR = "schema" OUTPUT_DIR_PY = "outpy" OUTPUT_DIR_KT = "outkt" def main(lang: str): for root, _, files in os.walk(INPUT_DIR): for file in files...
Python
1
import time import inspect import ray # init ray ray.init() @ray.remote class Counter(object): def __init__(self): self._counter = 0 def getCounter(self): return self._counter def incCounter(self): self._counter += 1 def main(): # Create an actor process. cnt = Counter.r...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 安装akshare依赖包 """ import subprocess import sys def install_package(package_name): """安装Python包""" try: print(f"正在安装 {package_name}...") subprocess.check_call([sys.executable, "-m", "pip", "install", package_name]) print(f"✓ {package_nam...
Python
1
"twitch")] TwitchConfig(twitch::TwitchConfig), } impl ClientConfig { /// Build a client from a config. /// /// # Arguments /// /// * `id` - A client's unique ID. /// * `config` - A client's config. pub fn from_config(id: String, config: ClientConfig) -> FitterResult<Client> { ma...
Rust
0
(())); assert_eq!(validator.validate_flags("my"), Ok(())); assert_eq!(validator.validate_flags("uy"), Ok(())); } #[test] fn duplicate_flags() { let validator = EcmaRegexValidator::new(EcmaVersion::Es2018); assert_eq!( validator.validate_flags("gimgu"), Err("Duplicated flag g".to_strin...
Rust
0
let start_b = time::Instant::now(); for _ in 0..loop_num { b.iter_mut().for_each(|x| *x *= 1.12345 * 1.12345 * 1.12345); b.iter_mut().for_each(|x| *x *= 2.12345 * 2.12345 * 2.12345); b.iter_mut().for_each(|x| *x *= 3.12345 * 3.12345 * 3.12345); b.iter_mut().for_each(|x| *x *= 4.1...
Rust
0
+ 1 else: print "WARNING: Unsupported platform type '%s'" % CTX.PLATFORM print "Detected %d hardware threads to use during the build" % (numHardwareThreads) print retval = os.system("make --directory=%s -j%d nativelibs/libvoltdb.sym" % (CTX.OUTPUT_PREFIX, numHardwareThreads)) print "Make returned: ", retval if r...
Python
1
Player; use crate::models::pressure_plate::{Plate, PlateMaterial}; use bevy::prelude::*; use bevy::sprite::collide_aabb::collide; use crate::models::explosion::Explosion; use crate::level; use crate::models::points::Points; use crate::systems::gravity::GravityLevel; pub fn init( mut player_positions: Query<(&mut...
Rust
0
pub fn paint_test_input(buf: &mut [u8]) { for (i, b) in buf.iter_mut().enumerate() { *b = (i % 251) as u8; } } #[derive(Debug, Serialize, Deserialize)] pub struct Cases { pub _comment: String, pub key: String, pub cases: Vec<Case>, } #[derive(Debug, Serialize, Deserialize)] pub struct Cas...
Rust
0
cure cases, a function may be a generator but the "yield" # was optimized away. Here, we need to put in unreachable code to # add in "yield" just so that the compiler will mark # the GENERATOR bit of the function. See for example # Python 3.x's test_generator.py test program. if not is_lambda and co...
Python
1
out = [] # Defines the geometry and global options out.extend([f'title "{short_label}"', f'permanent_dir {perm}', f'scratch_dir {scratch}', f'{restart_kw} {short_label}', '\n'.join(_render_geom(atoms, params))]) # Add the charge if prov...
Python
1
")] pub lookup_index: Option<LookupVerifierIndex<G>>, #[serde(skip)] pub linearization: Linearization<Vec<PolishToken<ScalarField<G>>>>, /// The mapping between powers of alpha and constraints #[serde(skip)] pub powers_of_alpha: Alphas<ScalarField<G>>, // random oracle argument parameters ...
Rust
0
on::After) => { format!("execute-keys 'a{}<esc>i<esc>La<esc>'", contents) } (false, true, Direction::Before) => { format!("execute-keys 'ha{}<esc>i<esc>La<esc>'", contents) } }) } <reponame>dochy-ksti/docchi<gh_stars>10-100 use crate::imp::structs::linked_m::{LinkedMa...
Rust
0
# Generated by Django 3.2.5 on 2021-07-12 08:29 import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('employee', '0074_auto_20210709_1200'), ] operations = [ migrations.AlterField( ...
Python
1
nd(ran) used_choices.append(choices[ran][1]) used_choices = used_choices[:-3] print(fates[-4]) print('\n\nRESET STARTS HERE') else: used_indices.append(ran) used_choices.append(choices...
Python
1
from django.contrib import admin from django.urls import path, include, re_path from rest_framework import permissions from drf_yasg.views import get_schema_view from drf_yasg import openapi schema_view = get_schema_view( openapi.Info( title="Notes API", default_version='v1', description="N...
Python
1
d_resource(css_path) css = RutabagaStylesheet(css_node, autoparse=True) css_node.rtb_stylesheet = css asset_stlib_sources = process_embedded_assets(bld, style_name, css) for asset in css.external_assets: # transform external asset paths into absolute paths path = "{0}/{1}".format(styl...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' name: 大汉VerfiyCodeServlet越权漏洞 referer: http://www.2cto.com/Article/201507/418593.html author: Lucifer description: /VerifyCodeServlet 可以 创建任意 SESSION的key值,opr_licenceinfo.jsp需要一个SESSION cookie_username 不为空,就可以成功登录。 ''' import sys import requests import warnings from ter...
Python
1
JS Settings", trace=True, ) @frappe.whitelist() def export_settings(self): """ Export BPJS settings to a format that can be imported by other instances Returns: dict: Dictionary of exportable settings """ # Get app info from Payro...
Python
1
.01573, 0.01687, 0.01802, 0.01915, 0.02017, 0.02110, 0.02195, 0.02273, 0.02339, 0.02395, 0.02442, 0.02481, 0.02509, 0.02529, 0.02539, 0.02535, 0.02516, 0.02486, 0.02446, 0.02395, 0.02328, 0.02251, 0.02166, 0.02070, 0.01960, 0.01838, 0.01707, 0.01567, 0.01417, 0.01258, 0.01093, 0.0...
Rust
0
import os import torch import cflearn import numpy as np from PIL import Image from cflearn.api.multimodal import ControlNetHints hint_type = ControlNetHints.CANNY file_folder = os.path.dirname(__file__) api = cflearn.multimodal.ControlledDiffusionAPI.from_sd(device="cuda:0", use_half=True) # prepare ControlNet ann...
Python
1
#[doc = "0x44 - Outlink descriptor address before the last transmit descriptor"] pub dma_out_eof_bfr_des_addr: crate::Reg<dma_out_eof_bfr_des_addr::DMA_OUT_EOF_BFR_DES_ADDR_SPEC>, #[doc = "0x48 - AHB test register"] pub ahb_test: crate::Reg<ahb_test::AHB_TEST_SPEC>, #[doc = "0x4c - The third wo...
Rust
0
u16, interval: u16 } impl IntervalStream { pub fn new(psc: u16, interval: u16) -> IntervalStream { start(psc, interval, true); IntervalStream { psc, interval } } pub fn set_interval_us(&self, interval: u16) { update((rcc::apb2_us_psc() as u16) - 1...
Rust
0
> PartialOrd for LRFUCell<V, T> { fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.cmp(other)) } } impl<V, T: Timestamp + Copy> PartialEq for LRFUCell<V, T> { fn eq(&self, other: &Self) -> bool { self.cmp(other) == Ordering::Equal } } impl<V, T: Timestamp + Copy> Eq ...
Rust
0
⭙', '␓', '𔑤', '൧', '\u{11fc3}', '𝦦', '╱', 'Ṽ', '𑍃', '𒂎', '🤧', '㍻', '𓈖', '♪', 'ぅ', '𒍗', '\u{e01cc}', 'ꫧ', '\u{e0051}', 'ᚚ', '\u{1fb79}', '𒀹', 'Ꮑ', 'ᶄ', '𑖾', 'ᰨ', '㇈', '𝠦', '𐏃', '𝠹', '𐄱', '𒌌', '⟼', '𝍈', '𖢎', '𒃷', '⡍', '⏒', '𝪀', 'ﳌ', '𘩿', '⤹', 'ㅪ', 'Ɗ', 'ꐶ', 'ꖄ', '\u{e86}', '`', '⯆',...
Rust
0
name1 = "abdul islam" age = 25 course="phtiron" show_All = f"{name1}. this age is {age}. se course kore ekta {course}" print(show_All) num1 = input('take the input 1 :') num2 = input('abr niba 2 :') num_convert = int(num1) num2_convert= int(num2) result = num_convert * num2_convert print(f"the result is total {r...
Python
1
from flask_restx import Namespace, Resource from src.entities.discipline import discipline_model ns_discipline = Namespace( 'api/v1/discipline', description='This is references to discipline' ) @ns_discipline.route('/') class DisciplineAPI(Resource): @ns_discipline.doc('list_disciplines') @ns_discipline...
Python
1