text
string
label_name
string
labels
int64
oded_compression = 2 ** (len(vae_config.model.channel_mult)-1) encoded_channels = vae_config.model.z_channels network, model_config = init_model( downsample=args.downsample, encoded_channels=encoded_channels, encoded_compression=encoded_compression, savepath=savepath, device=device, load_epoch=load_epoch...
Python
1
rt = 0 save_route_name_score_short = 0 save_stops_score_short = 0 print("No route data found.") else: # Metric@1: acc (only decided by the departure stop and arrival stop) acc_short = 0 first_route = route_data[0] # first route section last_route = route_data...
Python
1
let current = i * 128 + col as usize; match c { '1' => { sum += 1; m.insert(current as i32); let top_coordinate = (i as i32 - 1) * 128 + col; let left_coordinate = i as i32 * 1...
Rust
0
# Copyright 2023 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
1
, u8, u8, u8) = (0, 139, 139, 255); pub const Teal: (u8, u8, u8, u8) = (0, 128, 128, 255); pub const Aqua: (u8, u8, u8, u8) = (0, 255, 255, 255); pub const Cyan: (u8, u8, u8, u8) = (0, 255, 255, 255); pub const LightCyan: (u8, u8, u8, u8) = (224, 255, 255, 255); pub const PaleTurquoise: (u8, u8, u8, u8) = (175, 238, 23...
Rust
0
ls regarding sparse gradients. Note: this option is not supported when ``mode="max"``. include_last_offset (bool, optional): if ``True``, :attr:`offsets` has one additional element, where the last element is equivalent to the size of `indices`. This mat...
Python
1
.get_shared_data(&node_id) .get_all_values() .iter() .cloned() .collect::<HashSet<String>>() ); } // Check all blocks in the ledger are the same let node0_data = network.get_shared_data(&test_utils::test_node_id(0)).ledger;...
Rust
0
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.model import BaseRequest from lark_oapi.core.enum import HttpMethod, AccessTokenType from .query_user_daily_shift_request_body import QueryUserDailyShiftRequestBody class QueryUserDailyS...
Python
1
# train_models.py import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.svm import SVR from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score imp...
Python
1
""" gps_l1_ca_kf_plot_sample.py Reads GNSS-SDR Tracking dump binary file using the provided function and plots some internal variables Irene Pérez Riega, 2023. iperrie@inta.es Modifiable in the file: sampling_freq - Sampling frequency [Hz] channels - Number of channels to check if they exist ...
Python
1
the polynomials /// /// # Examples /// ``` /// use bacon_sci::interp::spline_free; /// fn example() { /// let xs: Vec<_> = (0..=10).map(|x| x as f64).collect(); /// let ys: Vec<_> = xs.iter().map(|x| x.exp()).collect(); /// /// let spline = spline_free(&xs, &ys, 1e-8).unwrap(); /// for i in 0..1000 { /...
Rust
0
() .bits(found.clkr) .clkf() .bits(found.clkf) .clkod() .bits(found.clkod) .bwadj() .bits(found.bwadj) }...
Rust
0
NG FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. extern crate proc_macro; use crate::metadata::TraitDefinition; use heck::CamelCase as _; use proc_macro2::TokenStream as TokenStream2; use quote::{ format_ident, quote, }; use std::collections::HashMap; use syn...
Rust
0
import torch.nn as nn import torch import dynamics import torch.nn.functional as F class GTG(nn.Module): def __init__(self, total_classes, tol=-1., max_iter=5, mode='replicator', device='cuda:0'): super(GTG, self).__init__() self.m = total_classes self.tol = tol self.max_iter = max...
Python
1
use crate::parselet::{Parselet, Parselets}; /// Type for an association, e.g. assignment, parameter binding. #[derive(Debug, PartialEq, Eq, Hash)] pub struct AssignmentParselet { assignee: Box<VariableParselet>, value: Box<Parselets>, } impl AssignmentParselet { // No derive(new) because of boxing pub...
Rust
0
W: AsyncWrite + Unpin, { write_bins( writer, reference_sequence.bins(), reference_sequence.metadata(), ) .await?; write_intervals(writer, reference_sequence.intervals()).await?; Ok(()) } async fn write_bins<W>(writer: &mut W, bins: &[Bin], metadata: Option<&Metadata>) ...
Rust
0
let frame_rate = super::calculate_frame_rate(32_768, 2, 11, config::Duty::OneTo3 as u8); assert_eq!(frame_rate, 100); let frame_rate = super::calculate_frame_rate(32_768, 4, 4, config::Duty::Static as u8); assert_eq!(frame_rate, 102); let frame_rate = super::calculate_frame_rat...
Rust
0
// the "natural" order of the singular values it not sorted by default. let mat = Matrix::new(4, 5, vec![ 3.61833700244349288, 3.96046289599926427, 1.44435028724617442, 1.13455445826500645, -3.30895752093770579, -3.28382346228211697, 0.707300...
Rust
0
import spacy from spacy.training import Example from spacy_legacy.scorers import score_cats_v1 def test_score_cats_v1(): nlp = spacy.blank("en") ref = nlp("one") ref.cats = {"winter": 1.0, "summer": 0.0, "spring": 0.0, "autumn": 0.0} pred = nlp("one") pred.cats = {"winter": 0.35, "summer": 0.25, "...
Python
1
^^^^^^^^^^ tuple of one /// assert_eq!(result, 46); /// /// let result: i64 = engine.call_fn(&mut scope, &ast, "bar", () )?; /// assert_eq!(result, 21); /// # } /// # Ok(()) /// # } /// ``` #[inline] pub fn call_fn<T: Variant...
Rust
0
h_price` fn on_initialize(n: T::BlockNumber) { let price = T::SettCurrencyPrice::fetch_price(); Self::on_block_with_price(n, price).unwrap_or_else(|e| { native::error!("could not adjust supply: {:?}", e); }); } } } /// Tries to contract the supply by `amount` by burning `Settcurrency::CurrencyId` and ...
Rust
0
# Copyright © 2024 Pathway from __future__ import annotations from typing import Any import pathway.internals as pw class Vertex(pw.Schema): pass class Edge(pw.Schema): r""" Basic edge class, holds pointers to the endpoint vertices. """ u: pw.Pointer[Any] v: pw.Pointer[Any] class Weigh...
Python
1
SDL_LOG_CATEGORY_RESERVED7: Type = 15; pub const SDL_LOG_CATEGORY_RESERVED8: Type = 16; pub const SDL_LOG_CATEGORY_RESERVED9: Type = 17; pub const SDL_LOG_CATEGORY_RESERVED10: Type = 18; pub const SDL_LOG_CATEGORY_CUSTOM: Type = 19; } pub mod SDL_LogPriority { #[doc = " \\brief The predefined log priorities...
Rust
0
ecause all possible outcomes are already covered. It prints "Something went wrong" if there is an unexpected condition. # Summary: # The program lets the user play a game of Rock-Paper-Scissors against the computer. # The computer makes a random choice, and the user inputs their choice. # The program checks whether it...
Python
1
from google.cloud import logging as stackdriverlogging from google.api_core.gapic_v1.client_info import ClientInfo from ScoutSuite.core.console import print_exception from ScoutSuite.providers.utils import run_concurrently from ScoutSuite.utils import get_user_agent class StackdriverLoggingFacade: def get_clien...
Python
1
date=datetime.now().strftime("%Y-%m-%d"), time=datetime.now().strftime("%H:%M:%S"), sampling_args={ "max_tokens": meta.sampling_args.get("max_tokens"), "temperature": meta.sampling_args.get("temperature"), }, reward=summary.get("reward", {}), metrics=su...
Python
1
829\xed\xe53y\x91H|\xba\xca\ \xb8\xd4<]e\x1d\xd5\xb6\xbd\xe1\x0f\x8e6Z\x7f\xdb\ \x85\x8d\xae\xb9\xe0\xddC\xc2\x9e9\x82;FE\x11\xea\ 7\x91iW\x10j\xb0Y\xee\x91biSF\x9a\xea\ \xdc\xa9\x92\xe26FY\x87\xb1\xdeZ\xealZ\xd7M\ \xf1\xd6\xad\xa5^\xc7:Kl\x97:V\x8b\xaai\xd2\ \xa2\xb6\xe1\x0c\xd6\xb76\xd6\xd7s\xc6\xf9\xdb(]B\ 9eU\x027\...
Python
1
from flask_restx import fields, Namespace from app.utils import get_logger, auth from . import base_query_fields, ARLResource, get_arl_parser ns = Namespace('github_monitor_result', description="Github 监控结果详情") logger = get_logger() base_search_fields = { 'path': fields.String(required=False, description="路径名称")...
Python
1
self, x: dict[str, torch.Tensor]) -> torch.Tensor: return x[FM_INPUT] def annotate_output(self, x: tuple[tuple[torch.Tensor]]) -> dict[str, torch.Tensor]: # flatten the outputs outputs = list(chain(*x)) return {key: outputs[i] for i, key in enumerate(self.output_signature.keys())} ...
Python
1
""" return NetworkUtils.check_port_open(host, port, timeout) @staticmethod def get_arp_table() -> List[Dict[str, str]]: """ 获取ARP表信息 Returns: list: ARP表条目列表 """ arp_table = [] try: if sys.platform.start...
Python
1
.into() => format!("00000000-0000-4000-8000-000000000{:03}", $v).parse().unwrap()),* }) ); ($n:literal => $v:literal) => (service_set! {$n => $v,}); () => (crate::set::ServiceSet::new(std::collections::BTreeMap::new())); } pub(crate) use service_set; macro_rules! diff {...
Rust
0
settings .set_baud_rate(opt.baud_rate) .expect("could not set baud rate"); settings.set_char_size(opt.char_width); settings.set_stop_bits(opt.stop_bits); settings.set_flow_control(opt.flow_control); port.write_settings(&settings).expect("bad settings write"); // want reader to ...
Rust
0
Clone, Copy, Eq, Hash, PartialEq)] #[derive(Default)] pub struct RANGING_CORE__REF_SPAD_EN_2__EWOK(u8); impl Debug; u8; pub get, set: 0; } bitfield! { #[derive(Clone, Copy, Eq, Hash, PartialEq)] #[derive(Default)] pub struct RANGING_CORE__REF_SPAD_EN_3__EWOK(u8); impl Debug; u8;...
Rust
0
vector) # The shear stress causing reverse slip (in the receiver fault plane). shear_reverse = np.dot(rec_dip_vector, traction_vector) # The shear that we want (in the rake direction). rake_rad = np.deg2rad(rake) R = np.array([[np.cos(rake_rad), -np.sin(rake_rad)], [np.sin(rake_rad), np.cos(rake_r...
Python
1
d, tier_id = EXCLUDED.tier_id; """ cursor.execute(insert_sql, ( region_map[summoner["region"]], tier_map[summoner["tier"]], summoner["division"], summoner["summonerId"], summoner["puuid"] )) def main(): all_summoners = [] logging.info("🚀 Starting sum...
Python
1
# Test language extraction lang = extract_subtitle_language("简体中文版") logger.success(f" 语言提取: {lang}") return True except Exception as e: logger.error(f" 工具错误: {e}") return False def main(): """Main test runner""" logger.info("Anime...
Python
1
crossed_over[i] = other.scheme[i]; } for i in crossover_indices.1..PACKAGES.len() { crossed_over[i] = self.scheme[i]; } LoadingScheme { scheme: crossed_over, } } fn mutate(&self) -> LoadingScheme { // Put some stuff on other truck...
Rust
0
['empty'], 'r') as f: content = f.read() empty_features = self.extractor.extract_features(content) # 空文件应该有很低的特征值 self.assertEqual(empty_features['LM'], 0, "空文件的LM应为0") self.assertEqual(empty_features['SPL'], 0, "空文件的SPL应为0") # 测试包含HTML标签的文件 ...
Python
1
Some(movement) => { for (_account_id, _balances) in movement.get_account_movement() { if account_id != _account_id { continue; } // skip non-account movement ...
Rust
0
_negative_zero()); } #[test] fn test_read_two_byte_positive_int() { let data = &[0b0111_1111, 0b1111_1111]; let int = Int::read(&mut Cursor::new(data), data.len()).expect(READ_ERROR_MESSAGE); assert_eq!(int.size_in_bytes(), 2); assert_eq!(int.value(), 32_767); } #[t...
Rust
0
import numpy as np # Initialize matrices A = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) B = np.array([[10, 11, 12], [13, 14, 15], [16, 17, 18]]) # Sum of matrices sum_matrix = A + B print("Sum of matrices: \n", sum_matrix) # Difference of matrices diff_matrix = A - B print("Difference of matrices: \n", diff_matrix...
Python
1
import pyttsx3 import datetime import speech_recognition as sr import wikipedia import webbrowser as wb import random import os from googletrans import Translator engine =pyttsx3.init('sapi5') voices= engine.getProperty('voices') #print(voices[1].id) engine.setProperty('voice',voices[0]....
Python
1
buffered: bool, fatal_errors: bool) -> Result<()> where R: Read, W: Write, { let source = FramedRead::new(input, JsonDecoder::new()); let sink = SbpEncoder::framed(output); maybe_send_buffered(source, sink, buffered, fatal_errors)?; Ok(()) } pub fn json2json<R, W, F>( input: R, outpu...
Rust
0
import asyncio import logging import os from github import Github from agents.triage import triage_issue from agents.fix import fix_bug logger = logging.getLogger(__name__) async def _call_in_thread(func, *args, **kwargs): """Proxy around asyncio.to_thread to simplify testing.""" return await asyncio.to_t...
Python
1
.lock().unwrap(); let content_type = "application/json".parse::<Mime>().unwrap(); Ok(Response::with((content_type, status::Ok, serde_json::to_string(state).unwrap()))) } fn show_stdin(_: &mut Request, state: &Arc<Mutex<InterfaceState>>) -> IronResult<Response> { let ref state = *state.lock().unwrap(); ...
Rust
0
SRAM_DWR_CMD_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl core::ops::DerefMut for W { #[inline(always)] fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl From<crate::W<SRAM_DWR_CMD_SPEC>> for W { #[inline(always)] fn from(...
Rust
0
""" 展示 hide_info.img_watermark 添加水印时的抗攻击性 """ from hide_info import img_watermark import cv2 # 嵌入隐式水印 img_watermark.file_encode(img_filename="图片.png", watermark_filename="watermark.png", img_filename_new="output/图片_打入水印.png") # 提取隐式水印 img_watermark.file_decode(img_filename="output/图片_打入水印....
Python
1
resources.insert(ShadowMapAtlas::new(asset_manager.resources())?); Ok(()) } fn prepare_renderer_destroy( &self, render_resources: &ResourceMap, ) -> RafxResult<()> { // Clear shadow map assignments so that all shadow map atlas elements are free let mut shadow_map_re...
Rust
0
= json.load(f) full_propstore.connect() full_propstore.update(jsanitize(data, strict=True, allow_bson=True)) correlation_store = MemoryStore() builder = CorrelationBuilder(full_propstore, correlation_store, props=PROPNET_PROPS, funcs='all...
Python
1
.raises(TypeError, match=msg): None > series with pytest.raises(TypeError, match=msg): series > None else: result = None > series assert not result.iat[0] assert not result.iat[1] result = series < None assert not result.iat[0] assert ...
Python
1
<filename>src/headers.rs //! Helper functions for end users for GitHub response Headers use hyper::header::{HeaderValue, ETAG, LAST_MODIFIED, USER_AGENT}; use hyper::HeaderMap; use std::str::FromStr; /// Checks to see if a received payload from GitHub contains /// the GitHub-Hookshot header in the `UserAgent`. pub fn ...
Rust
0
"""Gmail toolkit."""
Python
1
om, max_zoom, url, attribution = provider[:5] if len(provider) > 5: options = provider[5] return MapSource( cache_key=key, min_zoom=min_zoom, max_zoom=max_zoom, url=url, cache_dir=cache_dir, attribution=attribution, ...
Python
1
import brotli # Brotli packing first introduced (I think?) by Muhmac / Speckdrumm in Felid: https://demozoo.org/graphics/342293/ # This is more optimized version with following improvements: # * Use hardcoded file size # * Inline URL assignment # * Inline retriving file contents # * Inline content length assignment # ...
Python
1
} } } pub fn rescue_hash<F: PrimeField>(xl: F, xr: F, constants: &RescueConstant<F>) -> F { let mut state = [xl, xr, F::one()]; block_cipher(&mut state, &constants); // c == 1 state[0] } const _CONSTANTS_MATRIX:[[&str;3];3] = [ [ "1727009077431585087915540656539954534780777332184...
Rust
0
except openai.error.InvalidRequestError: logging.warning("OpenAI API Invalid Request: Prompt was filtered") return { "choices": [ { "message": { "content...
Python
1
let term1 = mul(&sum(&dz, 3), &sub(&(0.0 as PrimitiveType), &div(&self.gamma, &c2, true), true), true); let term2 = mul(&dmb_variance, &mean(&mul(&(-2.0 as PrimitiveType), &c1, true), 3), true); let dmb_mean = add(&term1, &term2, true); // Compute the derivative of the loss wrt the normalized i...
Rust
0
s(database); Ok(()) } fn change_directory(identifier: String, database: std::collections::HashMap<String, String>) -> Result<(), std::io::Error> { let favorite_path = match database.get(&identifier) { Some(path) => path, None => panic!("could not find favorite with given name.") }; prin...
Rust
0
fn convert(&self, _: &mut EvalContext) -> Result<Json> { let d = self.maximize_fsp(); Ok(Json::String(d.to_string())) } } impl crate::codec::data_type::AsMySQLBool for Json { #[inline] fn as_mysql_bool(&self, _context: &mut crate::expr::EvalContext) -> crate::Result<bool> { // T...
Rust
0
nd((file_path, mtime)) # Sort by modification time (most recent first) recent_files.sort(key=lambda x: x[1], reverse=True) if recent_files: canvas.info("\nRecently modified files:") for file_path, _ in recent_files[:5]: # Sho...
Python
1
okenizer.from_pretrained("bert-base-uncased", model_max_length=512) traces = [trace.tolist() for trace in pytorch_dataset.traces] # Extract traces times = [time.tolist() for time in pytorch_dataset.times] # Extract times # Create MAM dataset with temporal features mam_dataset = Masked...
Python
1
import os import re import jieba __init_seg = False def __init(): user_dict_path = os.path.join(root_filepath, "f_seg/user_dict.txt") jieba.load_userdict(user_dict_path) jieba.add_word("快递", 10000) jieba.suggest_freq(("面", "太厚")) jieba.suggest_freq(("价格", "便宜")) jieba.suggest_freq(("服务", "周到"...
Python
1
'\u{aa7c}', '\u{aa7c}', GC_Extend), ('\u{aab0}', '\u{aab0}', GC_Extend), ('\u{aab2}', '\u{aab4}', GC_Extend), ('\u{aab7}', '\u{aab8}', GC_Extend), ('\u{aabe}', '\u{aabf}', GC_Extend), ('\u{aac1}', '\u{aac1}', GC_Extend), ('\u{aaeb}', '\u{aaeb}', GC_SpacingMark), ('\u{aaec}', '\u{aaed}', GC_Exten...
Rust
0
A::TCC4_MC_0), 43 => Val(TRIGSRC_A::TCC4_MC_1), 44 => Val(TRIGSRC_A::TC0_OVF), 45 => Val(TRIGSRC_A::TC0_MC_0), 46 => Val(TRIGSRC_A::TC0_MC_1), 47 => Val(TRIGSRC_A::TC1_OVF), 48 => Val(TRIGSRC_A::TC1_MC_0), 49 => Val(TRIGSRC_A::TC1_MC_1)...
Rust
0
def sum_of_numbers_in_range(start, end): n = end - start + 1 return n * (start + end) // 2 start = int(input("Enter the start of the range: ")) end = int(input("Enter the end of the range: ")) result = sum_of_numbers_in_range(start, end) print(f"The sum of numbers in the range [{start}, {end}] is: {result}")
Python
1
) except Exception as e: await message.answer( f"❌ Ошибка при сохранении расхода: {str(e)}", reply_markup=back_to_menu_keyboard() ) finally: db.close() await state.clear() @router.callback_query(F.data == "expense_history") async def show_e...
Python
1
import argparse import asyncio import gc import os.path import socket as stdsock PRINT = 0 async def echo_client_streams(reader, writer): sock = writer.get_extra_info('socket') try: sock.setsockopt( stdsock.IPPROTO_TCP, stdsock.TCP_NODELAY, 1) except (OSError, NameError): pas...
Python
1
self.vao.bind(); unsafe { self.gl.Enable(gl::CULL_FACE); self.gl.Disable(gl::DEPTH_TEST); self.gl.Enable(gl::BLEND); self.gl.BlendFunc(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA); self.gl .DrawArrays(gl::LINES, 0, self.vertices.len() as gl:...
Rust
0
lude { pub use self::v1::*; /// version one of the `prelude` module. pub mod v1 { pub use types::Result; pub use hash::keccak256::{Hash,hash,hash_many}; pub use ecc::{Signature,Address,Public,Private,keygen,recover,ecrecover}; } } use pantheon::Color; use pantheon::Vec3; use s...
Rust
0
ge(len(row_instances)) ) ): return None info = {} pretrain_instance = { "rows": [ { 'tokens': row_instance['tokens'], 'token_ids': self.tokenizer.convert_tokens_to_ids(row_instance['tokens']), ...
Python
1
# -*- coding: utf-8 -*- import pygcb def CreateDBObject(): dbObj=pygcb.tcAcousticModel() dbObj.databaseClass='A Generic Diesel' dbObj.xSpeed_kts=[0.000000,5.300000,13.300000,21.000000] dbObj.ySL_dB=[98.000000,104.800003,116.800003,127.099998] dbObj.speedMinNL_kts=6.100000 dbObj.NL_min=48.599998 ...
Python
1
x4, isizex4, usizex4, msizex4 ); impl_from_cast_mask!( m64x4[test_v256]: i8x4, u8x4, m8x4, i16x4, u16x4, m16x4, i32x4, u32x4, f32x4, m32x4, i64x4, u64x4, f64x4, i128x4, u128x4, m128x4, isizex4, usizex4, msizex4 ); impl_from_cast!( i128x2[test_v256]: i8x2, u8x2, m8x2, i16x2, u16x2, m16x2, i32x2, u32x2, f32x...
Rust
0
" ┌" + "─"*len(values) + "┐\n" + chart return chart def XYview(cursor: tuple, points: list, leath: int, wight: int): text = "┌" + "──"*wight + "┐\n" for y in range(leath): text += "│" for x in range(wight): if cursor == (x, y): text += "O " elif c...
Python
1
import os import numpy as np import h5py from chunkflow.synapses import Synapses from chunkflow.chunk import Chunk file_path = '/mnt/ceph/users/neuro/wasp_em/jwu/sample1/72_tbar/02_tbar_points' def execute(synapses: Synapses, seg: Chunk): tbars = synapses.tbars if len(tbars) == 0: print('tbars with ...
Python
1
Returns: UI要素情報 """ if ui_element is None: return {} info = { "type": ui_element.__class__.__name__, "object_id": "unknown", "object_ids": [], "position": {}, "size": {}, "visible": ...
Python
1
import serial def parse_response(response): if len(response) == 0: return None # Header = response[0] # if Header != 0xCF: # return None # DLen = response[10] # ID = response[11:DLen+11] ID = response[0:11] return ID.hex() def read_rfid(): ser = serial.Serial(port='COM10'...
Python
1
input_size.height), Image.ANTIALIAS) image = np.asarray(the_image, dtype=np.float32)[np.newaxis, np.newaxis, ...] image /= 255 input_batch = Batch(data=[mx.nd.array(image)], label=[mx.nd.array(label)]) model.forward(input_batch, is_train=False) if args.plot...
Python
1
# -*- coding: utf-8 -*- # Author: Ryan Feng <odayfans at gmail dot com> # License: GPL3 # Version: 0.2 # Changelog # 0.2: # * Fewer error messages import gntp.notifier as notifier import weechat import time # Logging def log(msg): weechat.prnt("",msg) # Register plugin weechat.register("gntpnotify", ...
Python
1
ref(vm)), Value::Nil => "nil".to_string(), Value::Undefined => "#<Undefined>".to_string(), //panic!("Tried to get type for undefined!"), Value::Lambda(_) => "#<Lambda>".to_string(), Value::Closure(_) => "#<Lambda>".to_string(), Value::Continuation(_) => "#<Continuation>".to_strin...
Rust
0
feedback_type": "thumbs", # "optional_text_label": "欢迎反馈您打分的理由", # } # TODO: 这里的内容有点奇怪,从后端导入Settings.model_settings.LLM_MODEL_CONFIG,然后又从前端传到后端。需要优化 # 传入后端的内容 llm_model_config = Settings.model_settings.LLM_MODEL_CONFIG chat_model_config = {key: {} for key in llm_model_config.keys()} fo...
Python
1
ange as needed # Parse the data lines into a list of dictionaries vlan_data = [] for line in data_lines: values = line.strip().split() vlan_data.append(dict(zip(keys, values))) vlan_data = convert_cli_data(vlan_data) i...
Python
1
match id { "monospace" => { #[cfg(target_os = "linux")] { let native_monospace_font = linux_get_native_font(LinuxNativeFontType::Monospace); FontPropertyBuilder::new().family(&native_monospace_font) } #[cfg(not(target_os = "linux"))] { ...
Rust
0
b": "͙", "doubleringbelowcmb": "͚", "zigzagabovecmb": "͛", "doublebelowbrevecmb": "͜", "doublebrevecmb": "͝", "macrondoublecmb": "͞", "macrondoublebelowcmb": "͟", "tildedoublecmb": "͠", "inverteddoublebrevecmb": "͡", "arrowrightdoublebelowcmb": "͢"...
Python
1
> { match self { PrecomputationsForPolynomial::Borrowed(b) => { b }, PrecomputationsForPolynomial::Owned(o) => { &o } PrecomputationsForPolynomial::None => { unreachable!("precomputations must have been m...
Rust
0
rning("Please provide both a URL and a filename.") st.divider() # --- Options --- st.subheader("⚙️ Spraying Options") with st.expander("🛠️ Advanced Settings", expanded=False): enable_field_override = st.checkbox( "Override form field names (username/password)", key="sp...
Python
1
"kaldi_score", lambda meters: meters["kaldi_score_sum"].sum / meters["nsentences"].sum, ) I_r1 = sum( [log.get("I_r1", -1) for log in logging_outputs] ) I_r5 = sum( [log.get("I_r5", -1) for log in...
Python
1
rted BadInstruction, /// `StackUnderflow` when there is not enough stack elements to execute instruction StackUnderflow, /// When execution would exceed defined Stack Limit OutOfStack, /// When builtin contract failed on input data BuiltIn, /// Returned on evm internal error. Should never be ignored during deve...
Rust
0
ensities, classififcations and colors // let position_parser = get_attribute_parser(POSITION_3D.name(), source_layout, &target_layout); // let intensity_parser = get_attribute_parser(INTENSITY.name(), source_layout, &target_layout); // let classification_parser = get_attribute_parser(CLASSIFICAT...
Rust
0
c = Fift.exec(program.strip()) return c[0] @classmethod def tvm(cls, exec_config): cls._init() c = json.dumps(exec_config).encode("utf-8") out = cls._global_instance._tvm_exec(len(c), c) obj = json.loads(out.decode("utf-8"), strict=False) return obj @clas...
Python
1
n=eval(input("请输入数字:")) a=1 for i in range(1,n+1): a*=i print(a)
Python
1
ddr); current_task .mm .write_object(set_action_ref, &original_action) .expect("failed to set action"); assert_eq!( sys_rt_sigaction( &current_task, UncheckedSignal::from(SIGINT), set_action_ref, ...
Rust
0
r::NegInt((*var_1126).into()), ); } #[allow(unused_mut)] let mut scope_1127 = writer.prefix("RekeyFuzzPercentage"); if let Some(var_1128) = &input.rekey_fuzz_percentage { scope_1127.number( #[allow(clippy::useless_conversion)] smithy_types::Number::NegInt((*var_11...
Rust
0
import numpy as np from pylab import * with open('run.in', 'r') as file: for line in file: line = line.strip() if 'compute_hac' in line: one_lines = int(line.split()[2])/10 def set_tick_params(): tick_params(axis='x', which='both', direction='in', top=True, bottom=True) tick_pa...
Python
1
, force_b_rm_size: None, force_b_imm_size: None }); alias!(m: Caseless("CMOVE") => Caseless("CMOVZ")); alias!(m: Caseless("CMOVNE") => Caseless("CMOVNZ")); alias!(m: Caseless("CMOVPE") => Caseless("CMOVP")); alias!(m: Caseless("CMOVPO") => Caseless("CMOVNP")); alias!(m: Caseless...
Rust
0
:new(api_key); let year = env::args().nth(1).expect("year"); let country = env::args().nth(2).expect("country"); match client.search_holidays(&year, &country) { Err(e) => eprintln!("{:?}", e), Ok(holidays) =>{ match holidays { None => println!("No holidays!"), ...
Rust
0
::Final), "fn" => Token::Keyword(Keyword::Fn), "for" => Token::Keyword(Keyword::For), "if" => Token::Keyword(Keyword::If), "impl" => Token::Keyword(Keyword::Impl), "in" => Token::Keyword(Keyword::In), "let" => Token::Keyword(Keyword::Let), "loop" => Token::Keyword...
Rust
0
imaryCausets_buffer_ptr.as_ref() }; &vec_buf[offset_begin..offset_lightlike] } fn cmp_sort_key(&self, other: &Self) -> Result<Ordering> { // Only debug assert because this function is called pretty frequently. debug_assert_eq!(self.get_order_is_desc(), other.get_order_is_desc()); ...
Rust
0
is_query = if is_query == 1 { true } else {false}; //let node_graph = Graph {adj_list: vec![Vec::new(),subgraph_num_vertices]}; plan.nodes.push(Rc::new(PlanNode{ edge_start_idx, num_edges, subgraph_num_vertices, is_query, idx})); } let mut line = String::new(); reader.read_line(&mut line)....
Rust
0
params.fund_pubkey, &funding_script_pubkey, fund_output_value, &(z.0).1 ) .is_ok())); accept_cets_sigs.nth(0).unwrap().1 }; let oracle_sig = secp.schnorrsig_sign_with_nonce(&msgs[0], &oracle_kp, &oracle_k_value); assert!(dlc::...
Rust
0
OOF.Graphics_1.Layer.Select widget_10 = findWidget('OOF2 Graphics 1:Pane0:LayerScroll:LayerList') widget_10.event(event(gtk.gdk.BUTTON_PRESS,x= 1.8700000000000e+02,y= 7.6000000000000e+01,button=3,state=0,window=widget_10.window)) checkpoint toplevel widget mapped PopUp-Layer findWidget('PopUp-Layer').deactivate() findM...
Python
1