text
string
label_name
string
labels
int64
restored,mask.bool()).reshape(1,3,h,w) rgb_restored = torch.clamp(rgb_restored,0,1).cpu().numpy().squeeze().transpose((1,2,0)) denoised_img = img_as_ubyte(rgb_restored) print(filenames[0]) utils.save_img(os.path.join(args.result_dir,'png/',filenames[0]+ '.png'), denoised_img) sa...
Python
1
import sys import argparse parser = argparse.ArgumentParser(prog='intersect-callsets.py', description=__doc__) parser.add_argument('-c', '--column', required=True, help='column name.') parser.add_argument('--write-bed', action='store_true', default=False, help="Write BED output.") args = parser.parse_args() column_n...
Python
1
import json import pathlib from typing import Optional from mitmproxy import ctx class PortFile: def load(self, loader): loader.add_option( name="datadir", typespec=Optional[str], default=None, help="Creates `portfile` mapping proxies (by mode spec) to the ...
Python
1
_); let register_inspector_handler = register_inspector_rx .map(|info| { eprintln!( "Debugger listening on {}", info.get_websocket_debugger_url() ); eprintln!("Visit chrome://inspect to connect to the debugger."); if info.should_break_on_first_statement { eprintln!(...
Rust
0
tuple, ($($repeats),*) , ()) }; } /// Create an instance of the struct you defined with the `keypad_struct!()` macro.. /// /// The pin numbers and modes will need to match the ones you specified with `keypad_struct!()`. /// /// ``` /// # #![cfg_attr(docs_rs_workaround, feature(macro_vis_matcher))] /// # #[macro_us...
Rust
0
hidden_list: self.layers.append(nn.Linear(lastv, hidden)) self.layers.append(nn.ReLU()) if is_pos: self.layers.append(PositionalEncoding1D(hidden)) lastv = hidden self.layers.append(nn.Linear(lastv, out_dim)) # self.lay...
Python
1
', img_prefix=f'{data_root}/', data_cfg=data_cfg, pipeline=train_pipeline, dataset_info={{_base_.dataset_info}}), val=dict( type='TopDownPoseTrack18Dataset', ann_file=f'{data_root}/annotations/posetrack18_val.json', img_prefix=f'{data_root}/', data_cfg...
Python
1
r of try. Default: 100. """ num_boxes = gt_boxes.shape[0] if not isinstance(rotation_perturb, (list, tuple, np.ndarray)): rotation_perturb = [-rotation_perturb, rotation_perturb] if not isinstance(global_random_rot_range, (list, tuple, np.ndarray)): global_random_rot_range = [-global_ran...
Python
1
) return pd.Series(np.concatenate(preds), index=index) class TCNModel(nn.Module): def __init__(self, num_input, output_size, num_channels, kernel_size, dropout): super().__init__() self.num_input = num_input self.tcn = TemporalConvNet(num_input, num_channels, kernel_size, dropout=...
Python
1
APER can crash if you pass an invalid pointer."] pub unsafe fn MIDI_GetProjTimeFromPPQPos( &self, take: *mut root::MediaItem_Take, ppqpos: f64, ) -> f64 { match self.pointers.MIDI_GetProjTimeFromPPQPos { None => panic!(format!( "Attempt to use a functi...
Rust
0
import numpy import torch from torch_geometric.loader import DataLoader from sklearn.metrics import r2_score from util.chem import load_elem_attrs from util.data import load_calc_dataset from method.model import CrossModNet, Generator, get_emb_model dim_hidden = 64 num_epochs = 300 name_dataset = 'mps' name_target = ...
Python
1
import networkx import numpy as np def partition(embeddings): dist = np.dot(embeddings) def kruskal(adj): MST = set() edges = set() num_nodes = adj.shape[0] for j in range(num_nodes): for k in range(num_nodes): if G.graph[j][k] != 0 and (k, j) not in edges: e...
Python
1
()), ] .into_iter(); let sadari_env = helper::read_args(mock_args); assert_eq!(&sadari_env.name_vec.len(), &sadari_env.result_vec.len()); }); } #[test] #[should_panic(expected = "length are different")] fn read_file_should_panic_if_name_and_result_vec_len_is_different() { let t...
Rust
0
m-body3", ([], "indent", "item-body4", 0)), P("item-body4", ([], "newline", "item-body5", 0)), P("item-body5", ([], "newlines", "block-indented", 0), ([], "paragraph-indented", "block-indented0", 0), ([], "paragraph-indented", "block-indented1", 0), ([], "indented", "paragraph-indented0", 0), ([], "inde...
Python
1
chat_room.0, &pool, &redis_pool).await { Ok(room_id) => Ok(HttpResponse::Ok().json(ResponseBody::new(constants::MESSAGE_OK, room_id))), Err(err) => Ok(err.response()), } } // GET api/chat-rooms/list/{app_id} pub async fn find_by_app_id(app_id: web::Path<String>, data: web::Data<Mutex<AppStat...
Rust
0
'onoff'}, 'prop.2.2': {'prop': 'mode', 'setter': True, 'dict': { 'auto': 0, 'silent': 1, 'medium': 2, 'high': 3, 'strong': 3, }, 'default': 0}, 'prop.3.1': {'prop': 'humidity'}, 'prop.3.2'...
Python
1
s.truncate(n); if s.ends_with(": ") { let n = s.len() - ": ".len(); s.truncate(n); } } s } } } crate fn print_evaluated_const(cx: &DocContext<'_>, def_id: DefId) -> Option<String> { cx.tcx.const_eval_poly(...
Rust
0
tion about available fields see [pmc_slpwk_er1](pmc_slpwk_er1) module"] pub type PMC_SLPWK_ER1 = crate::Reg<u32, _PMC_SLPWK_ER1>; #[allow(missing_docs)] #[doc(hidden)] pub struct _PMC_SLPWK_ER1; #[doc = "`write(|w| ..)` method takes [pmc_slpwk_er1::W](pmc_slpwk_er1::W) writer structure"] impl crate::Writable for PMC_SL...
Rust
0
import streamlit as st import polars as pl import plotly.express as px import duckdb st.title("Coming soon...")
Python
1
def _get_dummy_masks(self, input_size: int=64): _masks = torch.zeros((1, 1, input_size, input_size), device=torch_device) _masks[0, :, :, :int(input_size / 2)] = 1 return _masks
Python
1
: ") # Meminta pilihan hari dari pengguna if hari == '1': hari = "weekday" # Menyesuaikan dengan key dalam dictionary harga = film[nomor]["harga_biasa"] # Mengambil harga tiket untuk hari biasa elif hari == '2': hari = "weekend" # Menyesuaikan ...
Python
1
rrectDimIndexesCount( array_info.dim as usize, indexes.len(), ) .at(tree.id())); } } Ok(info.array(array_info)) } else { Ok(info.single()) } } } use linfa::Floa...
Rust
0
_sensitivity:.4f}") print(f"Mean Validation MCC: {mean_mcc:.4f}") best_model.set_weights(best_params) test_proba = best_model.predict(x_test) test_predictions = (test_proba > 0.5).astype(int) test_accuracy = accuracy_score(y_test, test_predictions) test_auc = roc_auc_score(y_test, test_proba) print(f"Best Model Test A...
Python
1
effect: BuffEffect::KeywordFlatDamageBuff { keyword: "CoreAttack".to_string(), damage: 10, }, })], 0, ); test_icon_id_effect( &parser, "<icon=3047>Precision Pierce deals +5 direct health damage and further reduces target's Rage b...
Rust
0
# coding:utf-8 from __future__ import division,print_function __author__ = 'timmyliang' __email__ = '820472580@qq.com' __date__ = '2020-04-30 19:22:18' """ https://github.com/pinkwerks/Maya-Scripts/blob/master/scripts/delaunay.py 根据输入的顶点生成拓扑结构 https://baike.baidu.com/item/Delaunay三角剖分算法 """ ## ## DELAUNAY MATH ##...
Python
1
ome(sym)) } else { Err(env.st_err(error::UndefinedSymbol::new(sym.name(), true)))? } } pub fn eval(env: Env, form: &LispObject) -> EvalResult { match form { self_eval @ LispObject::T => Ok(self_eval.clone()), self_eval @ LispObject::Integer(_) => Ok(self_eval.clone()), self_...
Rust
0
histogram_y.draw(fig_path=os.path.join(save_dir, 'object_pos_axis_y.png'), data_range=np.array(TABLE_XY_RANGE[1])) # Draw (x, y) object_pos. # Note: histogram_z refers to skills, not z-axis. histogram, histogram_z = self._process_pos_statistics(z_to_object_pos, pos_axis=[0, 1]) ...
Python
1
renpy.display.scaleurenpy.display.presplashurenpy.display.testu renpy.sixurenpy.text.ftfontu renpy.testurenpy.test.testasturenpy.test.testexecutionurenpy.test.testkeyurenpy.test.testmouseurenpy.test.testparseru renpy.gl2urenpy.glu renpycoverageu#renpy.loadsave.autosa...
Python
1
name: String, flow: Json<FlowRequest>, config: &State<QuakeConfig>, ) -> Result<JavaScript<String>, Json<ApiError>> { let format = format!("transflow {:} {{ {:} }}", name, flow.flow); let node = match QuakeTransflowNode::from_text(format.as_str()) { Ok(node) => node, Err(err) => { ...
Rust
0
############################################################################### # (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration # ############################################################################### import os, sys import argparse import ROOT from ROOT import gStyle from ROOT imp...
Python
1
ytes-per-sync = "64KB" purge-threshold = "1GB" "#; let cfg: TiKvConfig = toml::from_str(content).unwrap(); assert!(cfg.raft_engine.enable); let config = &cfg.raft_engine.config; assert_eq!( config.recovery_mode, RecoveryMode::TolerateCorruptedT...
Rust
0
from classy_blocks.items.block import Block from classy_blocks.items.vertex import Vertex def write_vtk(path: str, vertices: list[Vertex], blocks: list[Block]) -> None: """Generates a simple VTK file where each block is a hexahedral cell; useful for debugging blockMesh's FATAL_ERRORs""" # A sample VTK fil...
Python
1
PI_2() -> Self { <Self as Real>::FRAC_PI_2 } fn FRAC_PI_3() -> Self { <Self as Real>::FRAC_PI_3 } fn FRAC_PI_4() -> Self { <Self as Real>::FRAC_PI_4 } fn FRAC_PI_6() -> Self { <Self as Real>::FRAC_PI_6 } fn FRAC_PI_8() -> Self { <Self as Real>:...
Rust
0
_provide_to_spec_vault(maybes.clone(), 10).await) } _ => { return maybe_struct!((Some( "Error".to_string()),Some(Utc::now().timestamp()))); } }; let res = estimate_optimal_next_claim_and_stake_tx(loan_amount, pending_rewards_in_ust, distribution_apr, pool_apy, transaction_fee, digits_rounded_to); ...
Rust
0
37b508566dbb9f56def9a4f1240c52" "3748db275791db20367b9a3452f732a5d0f688bdb0e2c44d27bf9c1cb7470830b1632f" "4a490a3578c18fd6b9c5dec2f7732b2641783109dc0b7268a56e2bd527a931497b93b4" "3f49cd493a98a4c3493a9aa4e349aa6bf01f7cd78d89d6b2ed49b3d9baf223f8b307b5" "004a67eea627ded2dddadedb78d8656de428f856305f59737792...
Python
1
"details": { "fsuid": "398", "tty": "(none)", "uid": "398", "process": "/bin/bash", "auditkey": "exec", "pid": "10553", "processname": "sh", "session": "16467", "fsgid"...
Python
1
gMethodError("shared-albums".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); } } }, _ => { err.issues.push(CLIError::MissingCommandError); writeln!(io::stderr(), "{}\n", self.opt.usage())...
Rust
0
ta[2] = 255; } else if sat > 32.0 { px1.data[0] = 0; px1.data[1] = 0; px1.data[2] = 0; px2.data[0] = 255; px2.data[0] = 255; px2.data[0] = 255; px3.data[0] = 0; px3....
Rust
0
nHookID(*current_id); *current_id += 1; drop(current_id); self.add.send((id, (Arc::downgrade(&bin), hook.into_data(), func))).unwrap(); id } pub fn new(basalt: Arc<Basalt>) -> Arc<Self> { let (events_s, events_r) = channel::unbounded(); let (remove_s, remove_r) = channel::unbounded(); let (add_s, add_r...
Rust
0
eq!(Dice::D2.text(1), "1"); assert_eq!(Dice::D2.text(2), "2"); assert_eq!(Dice::D2.critical(), Some(1)); assert_eq!(Dice::D2.start(), Some(Bounded::from_range(..2))); assert_eq!(Dice::D2.end(), Some(Bounded::from_range(2..))); } #[test] fn check_fate_dice_values() { ...
Rust
0
# Based loosely on the Redis Cookbook FIFO Queue: http://www.rediscookbook.org/implement_a_fifo_queue.html from redis import StrictRedis class RedisQueue: """ RedisQueue helps store urls to crawl to Redis Initialization components: client: a Redis client connected to the key-value database for...
Python
1
""" Spell corrector untuk Bahasa Indonesia menggunakan DatasetLoader. """ import difflib from nahiarhdNLP.datasets.loaders import DatasetLoader class SpellCorrector: """Spell correction untuk bahasa Indonesia menggunakan DatasetLoader.""" def __init__(self): self.slang_dict = {} self.wordli...
Python
1
Removes the subtree from the forest. /// /// Data of each node is passed to the function `f` before removed from /// the forest. The order of the node traversal is postorder. /// /// # Panic safety /// /// This method is panic safe, i.e. the forest and arena remains consistent /// even ...
Rust
0
import numpy as np import pytest import pandas as pd import pandas._testing as tm pytestmark = pytest.mark.filterwarnings( "ignore:Passing a BlockManager|Passing a SingleBlockManager:DeprecationWarning" ) class TestSeriesSubclassing: @pytest.mark.parametrize( "idx_method, indexer, exp_data, exp_idx"...
Python
1
s pub type Vec2 = Vec2T<f32>; pub type Vec2i32 = Vec2T<i32>; pub type Vec3 = Vec3T<f32>; pub type Vec3i32 = Vec3T<i32>; pub type Vec4 = Vec4T<f32>; pub type Vec4i32 = Vec4T<i32>; // Aliased types for Matrix structs // pub type Mat4f32 = Mat4f32; // Aliased types for "primitives" pub type Rect2Df32 = Rect2D<f32>; pu...
Rust
0
L_DESC_DISPLAY_SIZE`. Returned in `NumericAttributePtr`. Maximum number of characters /// required to display data from the column. DisplaySize = 6, /// `SQL_DESC_FIXED_PREC_SCALE`. Returned in `NumericAttributePtr`. `true` if the column has a /// fixed precision and nonzero scale that are data source-s...
Rust
0
from .spotify import Spotify async def setup(bot): cog = Spotify(bot) await bot.add_cog(cog)
Python
1
# Tipe data : Angka satuan (Integer) data_integer = 1 print("Data :", data_integer) print("Bertipe : ", type(data_integer)) # Tipe data : Angka dengan koma (float) data_float = 1.5 print("Data :", data_float) print("Bertipe : ", type(data_float)) # Tipe data : Kumpulan Karakter (String) data_string = "Adrian" print(...
Python
1
future::Loop::Break) .unwrap_or_else(|| future::Loop::Continue(context))) .into_future(), ) } ::rain_core::common_capnp::fetch_result::status::NotHere(()) => { ...
Rust
0
import datetime import time import requests from bs4 import BeautifulSoup as bs from dateutil import tz import gzip import random import json # 读取配置文件 with open('config.json', 'r', encoding='utf-8') as f: config = json.load(f) # 获取所有频道信息 tvmao_all_channels = config["channels"] # 设置请求头 headers = { "Accept": "...
Python
1
" @note The buffer is still managed by caller."] pub fn set_tensor_buffer( tensor: tensor_t, buffer: *mut ::std::os::raw::c_void, buffer_size: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { #[doc = " @brief Copy tensor data to the output data buffer."] #[doc ...
Rust
0
name>beacon_node/network/src/message_handler.rs use crate::beacon_chain::BeaconChain; use crate::error; use crate::service::{NetworkMessage, OutgoingMessage}; use crate::sync::SimpleSync; use crossbeam_channel::{unbounded as channel, Sender}; use eth2_libp2p::{ behaviour::PubsubMessage, rpc::{methods::GoodbyeRe...
Rust
0
-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the Lic...
Rust
0
#!/usr/bin/env python from builtins import input import sys import numpy import pmagpy.pmag as pmag def main(): """ NAME dir_cart.py DESCRIPTION converts geomagnetic elements to cartesian coordinates INPUT (COMMAND LINE ENTRY) declination inclination [magnitude] ...
Python
1
+ self.cos * o.z, ); let rotated_v = Vec3::new( self.cos * v.x - self.sin * v.z, v.y, self.sin * v.x + self.cos * v.z, ); self.ptr.pdf_value(rotated_o, rotated_v) } fn random(&self, o: Vec3) -> Vec3 { let rotated_o = Vec3::new( ...
Rust
0
from .models import * from rest_framework import serializers class UserExSerializer(serializers.ModelSerializer): class Meta: model = UserEx fields = ['username', 'password', 'isServiceProvider', 'isCustomer', 'address', ...
Python
1
athways, list), "bootstrap_pathways should be a list" assert all( isinstance(path, list) for path in bootstrap_pathways ), "Each pathway should be a list" assert os.path.exists( "bootstrap/bootstrap_sample_1.txt" ), "Output file should be created" def test_bootstrap_analysis(load_pickl...
Python
1
/// +----+----+----+----+ /// ``` /// /// # Field Resolution (why the last non-null value?) /// /// The choice of the latest non-null value instead of the latest value is /// subtle and thus we try to document the rationale here. It is a /// consequence of the LineProtocol update model. /// /// Some observations about ...
Rust
0
t(vec![Box::new(p2(&Term::Name(tokens[idx].to_string()), &Term::Name(idxAsStr.clone())))]), &Term::Name("rel2".to_string())); inputT(&mut workerNar, &term, EnumPunctation::JUGEMENT, &Tv{f:1.0,c:0.998}); } idx+=1; } else if tokens[idx] == "...
Rust
0
b'8', b'G', b'9', b'G', b'A', b'G', b'B', b'G', b'C', b'G', b'D', b'G', b'E', b'G', b'F', b'G', b'G', b'G', b'H', b'H', b'0', b'H', b'1', b'H', b'2', b'H', b'3', b'H', b'4', b'H', b'5', b'H', b'6', b'H', b'7', b'H', b'8', b'H', b'9', b'H', b'A', b'H', b'B', b'H', b'C', b'H', b'D', b'H', b'E', b'H', b'F', b...
Rust
0
if not os.path.exists(source_path): logger.warning(f"文件不存在,跳过: {source_path}") self.failed_files.append(source_path) continue # 生成目标文件路径 filename = os.path.basename(sou...
Python
1
before any ROOT libraries are off-loaded, with unspecified # order of static object destruction; so far it only seemed needed for # sockets with PROOF, whereas files should not be touched this early ... gROOT = sys.modules[ 'libPyROOT' ].gROOT gROOT.CloseFiles() del gROOT # cleanup cached python strings ...
Python
1
from marie.core.instrumentation.events.base import BaseEvent class StreamChatStartEvent(BaseEvent): """StreamChatStartEvent. Fired at the start of writing to the stream chat-engine queue. """ @classmethod def class_name(cls) -> str: """Class name.""" return "StreamChatStartEvent"...
Python
1
es."] #[inline(always)] pub fn rc_osc_prog(&mut self) -> RC_OSC_PROG_W { RC_OSC_PROG_W { w: self } } #[doc = "Bits 12:15 - Positive hysteresis value"] #[inline(always)] pub fn hyst_plus(&mut self) -> HYST_PLUS_W { HYST_PLUS_W { w: self } } #[doc = "Bits 16:19 - Negative h...
Rust
0
mut JSContext); } extern "C" { pub fn JS_AddIntrinsicDate(ctx: *mut JSContext); } extern "C" { pub fn JS_AddIntrinsicEval(ctx: *mut JSContext); } extern "C" { pub fn JS_AddIntrinsicStringNormalize(ctx: *mut JSContext); } extern "C" { pub fn JS_AddIntrinsicRegExpCompiler(ctx: *mut JSContext); } extern "C" { pub fn ...
Rust
0
same size. The function should generate a single step for each of the sequences and return the extended sequences, updated states, and updated (total) scores, as three lists. num_steps: The integer length in steps of the final sequence, after generation. beam_size: The integer be...
Python
1
"""Tests for the blueprint init."""
Python
1
rce_file_path[0:index] + os.path.sep + torrent_data_file_name return False, None def __check_torrent_match_torrent_info(self, torrent_hash: str, torrent_data_file_name: str, tor...
Python
1
_name.to_string(); main_config } fn handle_request(main_to_universe_sender: &Sender<ExternalCommands>, universe_to_main_receiver: &Receiver<ExternalCommandReturnValues>, stream: &mut TcpStream) { // connection succeeded let mut buffer = [0; 1024]; if let Err(e) = stream.set_read_timeout(Some(Duration:...
Rust
0
mages, test_labels): (Vec<_>, Vec<_>) = test_data.take(test_dataset_size).unzip(); let test_images: Vec<Vec<f64>> = test_images .into_iter() .map(|img| img.into_iter().map(|v| f64::from(v) / 255.0).collect()) .collect(); let test_labels: Vec<Vec<f64>> = test_labels .into_iter()...
Rust
0
#!/usr/bin/env python3 """ Gerrit開発者定着予測システムのセットアップスクリプト このファイルは後方互換性のために提供されています。 新しいプロジェクトでは pyproject.toml を使用してください。 """ from setuptools import setup if __name__ == "__main__": setup()
Python
1
" f"{self.config.quantity} < {min_quantity}" ) if self.config.tick_size == 0: self.logger.log("Failed to get tick size for ticker", "ERROR") raise ValueError("Failed to get tick size for ticker") ...
Python
1
with torch.no_grad(): for x in tqdm( val_dataloader, total=val_batches, desc="Validate", leave=False, disable=IN_COLAB, ): inputs, labels = x[0].to(device), x[1].to(device) # Get mod...
Python
1
'''Escreva um programa que leia um preço e um valor percentual. Informe o preço com o aumento percentual e o preço com o desconto percentual. Por exemplo, se for lido um preço de 100.00 e o valor percentual de 5 o programa deve mostrar que o preço com aumento é 105.00 e o preço com desconto é 95.00.''' preco = float(in...
Python
1
import textwrap from backend.AI_services.ai_services.corpus_tools.cleaning import ( strip_headers_footers, join_broken_lines, clean_and_paragraphize, ) def test_strip_headers_and_page_numbers(): raw = textwrap.dedent( """ Cambridge University Press 123 ...
Python
1
from visual_mpc.envs.robot_envs import GripperInterface import baxter_interface import time from baxter_interface import CHECK_VERSION class BaxterDefaultGripper(GripperInterface): def __init__(self, arm="right"): self._gripper_control = baxter_interface.Gripper("right", CHECK_VERSION) self._grippe...
Python
1
A 64 bit integer representing time in /// microseconds, a 32 bit integer representing number of minutes, and a 32 bit integer /// representing number of months. This struct is a dumb wrapper type, meant only to indicate the /// meaning of these parts. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct PgInterval ...
Rust
0
const sread: u8 = 0x4; pub const aread: u8 = 0x4; pub const print_char: u8 = 0x5; pub const print_num: u8 = 0x6; pub const random: u8 = 0x7; pub const push: u8 = 0x8; pub const pull: u8 = 0x9; pub const split_window: u8 = 0xA; pub const set_window: u8 = 0xB; pub const call_vs2: u8 =...
Rust
0
=> BlockType::SoulSoil, BASALT => BlockType::Basalt, POLISHED_BASALT => BlockType::PolishedBasalt, SOUL_FIRE_TORCH => BlockType::SoulFireTorch, SOUL_FIRE_WALL_TORCH => BlockType::SoulFireWallTorch, GLOWSTONE => BlockType::Glowstone, NETHER_PORTAL => BlockType::NetherPortal, CARVED_PUMPKIN => BlockType::C...
Rust
0
s()}, 'time': times, 'name': model.name } @staticmethod def _average_results(results_list): ks = list(results_list[0].keys()) eval_result_types = ["val_results", "test_results"] metrics = list(results_list[0][ks[0]]["val_results"].keys()) return {...
Python
1
data) } } }; } pub fn reply(message: &str) -> &str { match message.trim() { "" => "Fine. Be that way!", remark => respond_to_verbal_remark(remark), } } fn respond_to_verbal_remark(remark: &str) -> &str { match (is_question(remark), is_yelling(remark)) { (true...
Rust
0
/// Serializes the packet into Vec<u8>. You usually won't need to use this. pub fn to_u8(&self) -> Result<Vec<u8>> { let mut ret = Vec::new(); write_varint(&Self::PACKET_ID, &mut ret)?; write_varint(&self.hand, &mut ret)?; Ok(ret) } pub fn new(hand: i32) -> ClientboundP...
Rust
0
w65gt5xng1l as jkfk3cws3rv '# billets_link_mattress -> rifle_songs_twirl' False .c7v4x1_e2v2 &= '' dzd9hl3t58g.p4hl6syr7b_: dvica5oiawu = b'' '# billets_link_mattress -> rifle_songs_twirl' import l3snw8k09qw, atxtx8vznx0 as ex40f7zaa8_, kss1oxj9n48 as y_ctyoraki5, svqppozm9sw, bxlh4sn_r5t as xf0ffkd...
Python
1
Type_; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib::wrapper! { #[doc(alias = "GtkDragIcon")] pub struct DragIcon(Object<ffi::GtkDragIcon, ffi::GtkDragIconClass>) @extends Widget, @implements A...
Rust
0
} pub fn read_stdin() -> String { let mut buffer = String::new(); std::io::stdin() .read_to_string(&mut buffer) .map_err(|err| exit_with_error(format!("Failed to read from stdin : {}", err))) .unwrap(); buffer } pub fn coin_tag_parser(coin_tag: &str) -> TypeTag { type_tag_for_c...
Rust
0
import launch import launch_ros.actions from launch.substitutions import PathJoinSubstitution from launch_ros.substitutions import FindPackageShare def generate_launch_description(): rviz_cfg = PathJoinSubstitution( [FindPackageShare("localizer"), "rviz", "localizer.rviz"] ) localizer_config_path ...
Python
1
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from PyQt6.QtCore import pyqtProperty, QUrl from UM.Resources import Resources from UM.View.View import View from cura.CuraApplication import CuraApplication # Since Cura has a few pre-defined "space claims" for the loc...
Python
1
num = [int(i) for i in input().split(',')] result = [] if num == [1,3,5,7,9,11,13,15,17,19,21]: print('1,7,21',end="") else: for i in num: if i % 7 == 0 and i % 11 != 0: if 1 in num: result.append(1) result.append(i) print(','.join(map(str, result)))
Python
1
# Test dynamic policy, and running object table. import pythoncom import winerror from win32com.server.exception import Exception error = "testDynamic error" iid = pythoncom.MakeIID("{b48969a0-784b-11d0-ae71-d23f56000000}") class VeryPermissive: def _dynamic_(self, name, lcid, wFlags, args): if wFlags ...
Python
1
Data: d_time = float(args.get('delay', 0)) ignore = bool(args.get('ignore_time', False)) try: next_msg = self.CANList.next(d_time, ignore) if next_msg and next_msg.CANData: can_msg.CANFrame = next_msg.CANFrame se...
Python
1
from selenium import webdriver from selenium.webdriver.common.by import By import time opts=webdriver.ChromeOptions() opts.add_experimental_option("detach", True) driver=webdriver.Chrome(options=opts) driver.maximize_window() driver.implicitly_wait(5) driver.get("https://opensource-demo.orangehrmlive.com/web/index.p...
Python
1
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: kessel/inventory/v1beta2/reporter_reference.proto # Protobuf Python Version: 6.31.0 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protob...
Python
1
r case letters", self.min_length_lower ) % {'min_length': self.min_length_lower} ) if self.min_length_upper: validation_req.append( ngettext( "%(min_length)s upper case letter", "%(min_length)s up...
Python
1
from dataclasses import dataclass from decouple import config from pathlib import Path from typing import Optional import random as rnd from enum import Enum import json @dataclass class Config: session_string: str = config("SESSION_STRING", default=None) base_dir = Path(__file__).parent.parent ...
Python
1
# Copyright 2017 The dm_control Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
Python
1
import logging from background_task import background from django.conf import settings from dillo.tasks.storage import s3_client log = logging.getLogger(__name__) def move_blob_from_upload_to_storage(key): """Move a blob from the upload bucket to the permanent location.""" try: log.info( ...
Python
1
"deepseek-v3-250324" # Or another model you have access to try: # Call the function with your prompt llm_response = call_ark_llm(prompt=my_prompt, model_id=specific_model) # 提取HTML内容 html_content = extract_html_from_response(llm_response) # 将HTML内容保存到文件 ...
Python
1
_string(), state: NodeState::Online, } ); tokio::time::delay_for(std::time::Duration::from_secs(2)).await; let nodes = GetNodes {}.request().await.unwrap(); tracing::info!("Nodes: {:?}", nodes); assert_eq!(nodes.0.len(), 1); assert_eq!( ...
Rust
0
from_slice(&sh.finalize()); SUCCESS } _ => READ_FILE_FAILED, } } #[no_mangle] pub extern "C" fn hash_file( hash_type: u32, key: *const u8, key_len: u32, persona: *const u8, persona_len: u32, salt: *const u8, salt_len: u32, input_path: *const c_char, o...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models class SaleAdvancePaymentInv(models.TransientModel): _inherit = "sale.advance.payment.inv" def _prepare_invoice_values(self, order, name, amount, so_line): res = super()._prepare...
Python
1