text
string
label_name
string
labels
int64
).await?; // // test(); // // println!("{:?}", warpd); // let command = Command::Version; // let config = Config::mainnet(); // // let addr = SocketAddr::from(([192, 168, 1, 2], 8333)); // let addr = SocketAddr::from(([192, 168, 1, 8], 8333)); // let mut raspi = Peer::at_address(1, addr, &...
Rust
0
ution + BatchNorm + ReLU x = self.conv1(x) x = self.bn1(x) x = F.relu(x) # Residual layers x = self.layer1(x) x = self.layer2(x) x = self.layer3(x) # Global Average Pooling x = self.avgpool(x) x = torch.flatten(x, 1) # Flatten to (batch_...
Python
1
).collect::<Vec<_>>(); let state = sections[0] == "on"; let ranges = sections[1].split(',').collect::<Vec<_>>(); let x_range = ranges[0].split('=').collect::<Vec<_>>()[1].split("..").collect::<Vec<_>>(); let x_min = x_range[0].parse::<i64>().unwrap(); let x_max = x_range[1].pa...
Rust
0
tests { use crate::port::*; #[test] fn test_setter_and_getter() { let mut port = Port::new(); assert_eq!(port.get_output(), 0); port.set_output(1); assert_eq!(port.get_output(), 1); assert_eq!(port.get_input(), 0); port.set_input(1); assert_eq!(por...
Rust
0
, CrossBalanceInsufficient = -4050, IsolatedBalanceInsufficient = -4051, NoNeedToChangeAutoAddMargin = -4052, AutoAddCrossedMarginReject = -4053, AddIsolatedMarginNoPositionReject = -4054, AmountMustBePositive = -4055, InvalidApiKeyType = -4056, InvalidRsaPublicKey = -4057, MaxPriceT...
Rust
0
].astype(int).to_numpy() self.n_clusters = len(np.unique(y_pred)) elif init=="mclust": sc.pp.neighbors(adata, n_neighbors) # sc.tl.umap(adata) y_pred = mclust_R(adata, num_cluster, pca_num) # y_pred=adata.obs['mclust'].astype(int).to_numpy() el...
Python
1
# coding=utf-8 # Copyright 2025 The Google Research 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 applicab...
Python
1
examples StringBuffer buf1 = new StringBuffer().append("系统消息: ").append(message).append(" 已发送"); StringBuffer buf2 = new StringBuffer().append(status).append("状态更新"); // Multi-line string concatenation examples String multiLine1 = "处理开始: " + processId...
Python
1
<i32>().unwrap(); let xx = x.parse::<i32>().unwrap(); if yy > dimensions.0 { dimensions.0 = yy; } if xx > dimensions.1 { dimensions.1 = xx; } ins.push((yy, xx)); } } Input { ins, folds, dimensions, } } fn ex1(input: &Input) { let mut field = v...
Rust
0
# 通过环境变量传递(作用于全局,优先级最低) import os from util.PWManager import PWManager import qianfan from Crypto.Cipher import AES crypto_manager = PWManager('../../resource/pw.txt') # 从文件中解密并读取字典 pw_dict = crypto_manager.decrypt_file_to_dict('../../resource/qianfan_key_id_data') #通过环境变量初始化认证信息 # 方式一:【推荐】使用安全认证AK/SK鉴权 # 替换下列示例中参数...
Python
1
SameFileOverflow(Box<[u8]>, PageNum), } impl KeyForStorage { fn as_ref(&self) -> &[u8] { match *self { KeyForStorage::Boxed(ref b) => b, KeyForStorage::SameFileOverflow(ref b, _) => b, } } } pub enum ValueForStorage { UnknownLen(Box<Read>), Read(Box<Read>, u6...
Rust
0
ing_repeated: Vec<Cow<'a, str>>, pub bytes_repeated: Vec<Cow<'a, [u8]>>, pub test_enum_repeated: Vec<TestEnum>, pub test_message_repeated: Vec<TestMessage>, } impl<'a> MessageRead<'a> for TestTypes<'a> { fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self> { let mut msg = Self::...
Rust
0
tions.append(Action("move", [room.name, rooms[0].name])) # pick up balls in first room tied to grippers for gripper in grippers: for ball in typed[ReducedNode.BALLS]: if goal.has_edge(ball, gripper): actions.append( Action("pick", ...
Python
1
await?; debug!("{:?}", res); let res: HttpResponse = res.json().await?; debug!("{:?}", res); Ok(res.get(false, "messageId")?) } } #[derive(Deserialize, Serialize, Debug, Clone)] pub struct HttpAuthBody { #[serde(rename = "productKey")] pub product_key: String, #[serde(re...
Rust
0
# Two Pointer Algorithm is an effective technique which is used for searching pairs in a sorted array. # This technique can be used to solve a number of problems, however the following code demonstrates how to use it to solve the following question: # Question: You are given an array consisting of n integers a1, a2, ...
Python
1
self._proc_out(p), " "))) return p.stdout class REPLDriver(CLIDriver): # pylint: disable=abstract-method REPL_ARGS: Tuple[str, ...] = () def __init__(self, args=(), fpath="-", binpath=None): super().__init__(args, fpath, binpath) self.repl = None self.instance_args: Tuple[str...
Python
1
#-*- coding:utf-8 _*- """ @version: @author: CharlesXu @license: Q_S_Y_Q @file: Create_features_B.py @time: 2018/1/24 14:38 @desc: 构建高敏感度的特征 """ import pandas as pd import numpy as np import csv import re import os import jieba import codecs import pickle from numpy import log from sklearn.preprocessing import Min...
Python
1
// c 作为 poll_next() 的返回值,(n, (a, b)) 作为 state Some((c, (n, (b, c)))) } }) } <reponame>Lichthagel/trakt-rust<filename>src/models/movie.rs<gh_stars>1-10 //! All models related to [movies] //! //! [movies]: https://trakt.docs.apiary.io/#reference/movies use crate::{ extended_info::{WithFull,...
Rust
0
list; use crate::Store; use crate::Metadata; use crate::store::bloom_filter; use std::io::Write; use std::fs::OpenOptions; use std::path::Path; pub fn run(store: &mut Store) -> Result<(), Box<dyn Error>> { let store_path = format!("./ndb/{}", store.name); for level in 1..=4 { let mut level_lists...
Rust
0
l0_results = self._retrieve_related_l0_memories(input_tags) current_recall_count += len(l0_results) if current_recall_count < recall_threshold: l1_results = self._retrieve_related_l1_memories(input_tags) current_recall_count += len(l1_results) if current_recall_co...
Python
1
3 = 51, Tim8Ch4 = 52, Tim8Up = 53, Tim8Trig = 54, Tim8Com = 55, Tim2Ch1 = 56, Tim2Ch2 = 57, Tim2Ch3 = 58, Tim2Ch4 = 59, Tim2Up = 60, Tim3Ch1 = 61, Tim3Ch2 = 62, Tim3Ch3 = 63, Tim3Ch4 = 64, Tim3Up = 65, Tim3Trig = 66, Tim4Ch1 = 67, Tim4Ch2 = 68, Tim...
Rust
0
DArray[np.object_]c Csn|j\}}}tj|dd}d}|j|dd}t|D]\}} || } t| } |s0t| | jd}| ||<q|S)NOrFrrT)rr.rr enumerater=r6r3) rMr2rrryr initializedrrwgroupr<r4r4r5r%is ...
Python
1
d if supplied methods.push(method); } // Handshake Lifecycle if stream.config.skip_auth == false { let methods = stream.send_version_and_methods(methods).await?; stream.which_method_accepted(methods).await?; } else { debug!("skipping auth"...
Rust
0
assert_eq!(semaphore.available_permits(), 0); /// /// let permit_3 = semaphore.try_acquire(); /// assert_eq!(permit_3.err(), Some(TryAcquireError::NoPermits)); /// # } /// ``` /// /// [`TryAcquireError::Closed`]: crate::sync::TryAcquireError::Closed /// [`TryAcquireError::NoPermits`]: cr...
Rust
0
string selection directly to standard output without JSON double-quotes") .conflicts_with("check") .long("raw-output") .short('r') ) .arg( Arg::new("stream") .help("Reads a stream of JSON data line by line") .co...
Rust
0
from functools import partial import mmcv import numpy as np import torch from six.moves import map, zip def tensor2imgs(tensor, mean=(0, 0, 0), std=(1, 1, 1), to_rgb=True): num_imgs = tensor.size(0) mean = np.array(mean, dtype=np.float32) std = np.array(std, dtype=np.float32) imgs = [] for img_i...
Python
1
# (7-1)*2 + 4 = 16 # (32 - 4 + 2*1)/2 + 1 = 16 model += [ nn.Conv2d(256, 512, 4, stride=2, padding=1), nn.InstanceNorm2d(512), nn.LeakyReLU(0.2, inplace=True) ] # (4-1)*1 + 4 = 7 # (16 - 4 + 2*1)/1 + 1 = 15 model += [ nn.Conv2d(512, ...
Python
1
back, on_ended=on_audio_ended, ) if not webrtc_worker and sdp_offer: LOGGER.debug( "No worker exists though the offer SDP is set. " 'Create a new worker (key="%s").', key, ) webrtc_worker = WebRtcWorker( mode=mode, ...
Python
1
import random import sys # Step 1 : Starting information print("------------------------------------") print("Welcome to Rock, Paper, Scissors Game!") print("------------------------------------") moves = {"Rock": "🪨", "Paper": "📃", "Scissors": "✂️"} valid_moves = list(moves.keys()) user_point = 0 computer_point = ...
Python
1
); keys.insert(InputMode::Pane, key_action_unbind); let from_yaml = KeybindsFromYaml { keybinds: keys, unbind: Unbind::Keys(vec![Key::Alt(CharOrArrow::Char('n'))]), }; let keybinds_from_yaml = Keybinds::get_default_keybinds_with_config(Some(from_yaml)); let result_normal_n = keybin...
Rust
0
# Copyright The OpenTelemetry 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 in ...
Python
1
e_id']]['human_judgement'].append( {'image_id': d['image_id'], 'image_path': d['image_filepath'], 'caption': d['caption'], 'rating': d['expert1']}) all_index[d['image_id']]['human_judgement'].append( {'image_id': d['image_id'], 'image_p...
Python
1
} else { deepness = width_excursion * world.zoom_factor; world.up_left = Point { x: world.up_left.x - width_excursion * world.zoom_factor, y: world.up_left.y + height_excursion * world.zoom_factor, }; ...
Rust
0
# coding:utf8 ''' Bluetooth/Pyjnius example ========================= This was used to send some bytes to an arduino via bluetooth. The app must have BLUETOOTH and BLUETOOTH_ADMIN permissions (well, i didn't tested without BLUETOOTH_ADMIN, maybe it works.) Connect your device to your phone, via the bluetooth menu. Afte...
Python
1
template_tree.write(output_path, encoding='utf-8', xml_declaration=True) print(f"已将设计师SVG转换为标准格式: {output_path}") # 输出转换信息 print("\n===== 转换信息 =====") if 'fill' in gradients: print("填充渐变:") for color, offset in gradients['fill']['colors']: ...
Python
1
conn.query(&stmt, &[]).await { Ok(query_result) => query_result, Err(e) => { let response = Response::builder() .status(400) .body(Body::from( serde_json::to_string( &ApiResUserCreateOtp { ...
Rust
0
the local Holochain zome, or a separate DNA-local zome. * * @package Holo-REA */ use paste::paste; use hdk_records::{ RecordAPIResult, records::{ create_record, delete_record, read_record_entry, read_record_entry_by_header, }, }; use hdk_semantic_indexes_client_lib::*; us...
Rust
0
from odoo import api, fields, models, _ from odoo.exceptions import UserError class Bill(models.Model): _name = "pos.bill" _order = "value" _description = "Coins/Bills" name = fields.Char("Name") value = fields.Float("Coin/Bill Value", required=True, digits=(16, 4)) pos_config_ids = fields.Ma...
Python
1
equipment.equipped = true; log.add( format!("Equipped {} on {}.", self.name, equipment.slot), colors::LIGHT_GREEN, ); } } else { log.add( format!("Can't equip {:?} because it's not an...
Rust
0
import re from typing import Any, Coroutine import commands as commands import message_queue as message_queue def disable_monitor( message_match: re.Match[Any], context: dict[str, Any] ) -> Coroutine[Any, Any, Any]: """Disable a monitor""" return commands.disable_monitor(message_match.group(1)) def ena...
Python
1
= 0x480, CMSG_GAMEOBJ_REPORT_USE = 0x481, SMSG_HIGHEST_THREAT_UPDATE = 0x482, SMSG_THREAT_UPDATE = 0x483, SMSG_THREAT_REMOVE = 0x484, SMSG_THREAT_CLEAR = 0x4...
Rust
0
Logger.print_error(f"Error during OctoEverywhere for Klipper update:\n{e}") def remove_extension(self, **kwargs) -> None: Logger.print_status("Removing OctoEverywhere for Klipper ...") mr_instances: List[Moonraker] = get_instances(Moonraker) ob_instances: List[Octoeverywhere] = get_instanc...
Python
1
946": "Kefka's Tower: Poltergeist", "947": "Kefka's Tower: Gold Dragon", "948": "Kefka's Tower: Skull Dragon", "949": "Banon's House: Banon A", "950": "Kohlingen: Old Man (Unequip)", "952": "Kefka's Tower: Doom Save Point", ...
Rust
0
from baml_client import b def main(): html = "https://www.databricks.com/dataaisummit/agenda" response = b.ExtractEvents(html) print(response) if __name__ == "__main__": main()
Python
1
from dataclasses import dataclass, field from typing import List, Dict, Any @dataclass class PromptRule: id: int = None name: str = "" description: str = "" positive_tags: str = "" negative_tags: str = "" system_prompt: str = "" created_at: str = "" updated_at: str = ""
Python
1
x2703, TEXTURE_MAG_FILTER = 0x2800, TEXTURE_MIN_FILTER = 0x2801, TEXTURE_WRAP_S = 0x2802, TEXTURE_WRAP_T = 0x2803, CLAMP = 0x2900, REPEAT = 0x2901, POLYGON_OFFSET_UNITS = 0x2A00, POLYGON_OFFSET_POINT = 0x2A01, POLYGON_OFFSET_LINE = 0x2A02, R3_G3_B2 = 0x2A10, V2F = 0x2A20...
Rust
0
Dispatch, StoreModel}; // use yew_router::prelude::*; use crate::components::header::Header; use chrono::prelude::*; use std::rc::Rc; #[derive(Properties, Clone, PartialEq)] pub struct DayProps { pub date: Option<DateTime<Local>>, } pub struct DayFC {} pub type Day = FunctionComponent<DayProps>; impl FunctionProvi...
Rust
0
se serde::{Deserialize, Serialize}; use serde_closure::*; use std::{ error, fmt::{self, Debug, Display}, io::Cursor, marker::PhantomData, ops::FnMut }; use amadeus_core::{ file::{Directory, File, Page, Partition, PathBuf}, into_par_stream::IntoDistributedStream, par_stream::DistributedStream, util::{DistParStr...
Rust
0
_prefix: &str, ident_location: &str) -> String { format!( "meta prefix '{}' not found at '{}'", meta_prefix, ident_location ) } <filename>roles/datastore/files/syslog-interceptor/src/syslog_app/sender.rs use anyhow::Result; use crate::app_config::SyslogConfig; use tokio::net::UdpSocket; pub st...
Rust
0
e; in that case, it is silently ignored. """ def cb(): random_seed = 0 seeded = False for i in range(device_count()): default_generator = torch.cuda.default_generators[i] if not seeded: default_generator.seed() random_seed = de...
Python
1
LAY_ADC_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for DELAY_ADC_R { type Target = crate::FieldReader<u8, u8>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `Delay_ADC` writer - "] pub struct DELAY_ADC_W<'a> { w: &'a mut W, } impl<'a> DEL...
Rust
0
, Ipv6Addr}; assert!( multiaddr_to_socketaddr(&"/ip4/127.0.0.1/udp/1234".parse::<Multiaddr>().unwrap()) .is_err() ); assert_eq!( multiaddr_to_socketaddr( &"/ip4/127.0.0.1/udp/12345/quic" .parse::<Multiaddr>() ...
Rust
0
ttps_proxy", "https://www.example.com") user_config_file_object = user_config_file.UserConfigFileObject() redacted_config = user_config_file_object.redact_config_data( cfg.user_config ) # Assert that proxy configurations are redacted assert getattr(redacted_config, ...
Python
1
from typing import List # leetCode: 128. Longest Consecutive Sequence # https://leetcode.com/problems/longest-consecutive-sequence/ class Solution: def longestConsecutive(self, nums: List[int]) -> int: numSet = set(nums) # Convert the list to a set for O(1) lookups longest = 0 # Store the longest seque...
Python
1
BO::LessThanEqual => { apply_int_op_and_return_bool!(lhs, <=, op, rhs); }, BO::GreaterThanEqual => { apply_int_op_and_return_bool!(lhs, >=, op, rhs); }, BO::ShiftLeft => { apply_int_op_and_return_self!(lhs, <<, op, rhs); }, BO::ShiftRight => { apply_int_op_and_return_sel...
Rust
0
#t $rt $r|jwxYw)Nzcontent-lengthr) send_request getresponsestatusrparse_responser/ Exceptionr getheaderryrreasonr getheaders)r#rrrr http_connresps r rzTransport.single_requests ...
Python
1
name, **kwargs): index = self.getPageIndex(name) if index > -1: page = self.GetPage(index) if hasattr(page, 'canClose'): if page.canClose(): self.callplugin('close_page', page, name) if hasattr(page, 'OnClose'): ...
Python
1
dijkstra: &mut Dijkstra, graph: &PreparationGraph, source: NodeId, target: NodeId, ) { assert_eq!(dijkstra.calc_path(&graph, source, target), None); assert_eq!(dijkstra.calc_weight(&graph, source, target), None); } fn assert_path( dijkstra: &mut Dijkstra, ...
Rust
0
Rod => state.fishing_rod_slot = i, AncientSkyBook => state.sky_book_slot = i, Empty => {} }; }); state } struct InventoryState { pub double_clawshots_slot: usize, pub dominion_rod_slot: usize, pub ball_chain_slot: usize, pub spinner_slot: usize, ...
Rust
0
CODE = 80i32; #[doc = "*Required features: `\"Win32_Networking_Ldap\"`*"] pub const LDAP_SERVER_DOWN: LDAP_RETCODE = 81i32; #[doc = "*Required features: `\"Win32_Networking_Ldap\"`*"] pub const LDAP_LOCAL_ERROR: LDAP_RETCODE = 82i32; #[doc = "*Required features: `\"Win32_Networking_Ldap\"`*"] pub const LDAP_ENCODING_ER...
Rust
0
import torch import torch.nn as nn import numpy as np # feature1 = np.array([[[0, 1], [1, -1]], [[-1, 0], [0, 2]]]) # feature2 = np.array([[[1, 0], [3, 1]], [[0, 1], [4, -1]]]) """ Examples:: >>> input = torch.randn(20, 6, 10, 10) >>> # Separate 6 channels into 3 groups >>> m = nn.GroupNor...
Python
1
+ Send + Sync; /// /// You can run a query with defined variables by calling `txn.query_with_vars(q, vars)`. /// /// # Arguments /// /// * `query`: GraphQL+- query /// * `vars`: map of variables /// /// # Errors /// /// If transaction is not initialized properly, return `Em...
Rust
0
#!/usr/bin/env python3 import subprocess import requests repo = "juliamertz/rose-pine-build" response = requests.get("https://api.github.com/repos/{}/releases/latest".format(repo)) latest_tag = response.json().get("tag_name") # Map nix system strings to cargo targets systems = { "x86_64-linux": "x86_64-unknown-l...
Python
1
butions of many other people. \ See [the contributor page](https://github.com/Akuli/porcupine/graphs/contributors) for details. Porcupine is developed in [this GitHub repo](https://github.com/Akuli/porcupine). Porcupine is available under the MIT license. It means that you can do \ pretty much anything you want with ...
Python
1
name: *mut PyObject, co: *mut PyObject, pathname: *mut PyObject, cpathname: *mut PyObject, ) -> *mut PyObject; #[cfg_attr(PyPy, link_name = "PyPyImport_GetModuleDict")] pub fn PyImport_GetModuleDict() -> *mut PyObject; // skipped Python 3.7 / ex-non-limited PyImport_GetMo...
Rust
0
// safe(b_high is not too small) let (neg_a2_h, neg_a2_l) = safetwoproduct(b_high.clone() / S::radix(), -d_high.clone()); // safe(-a_high/2 ~ neg_a2_h) ((a_high / S::radix() + n...
Rust
0
if make_reim_plot: fields = [ ("gamer", "Real"), ("gamer", "Real_gradient_magnitude"), ("gamer", "Imag_gradient_magnitude"), ] else: ...
Python
1
show_options(solver, name, disp=False)) text = "".join(text) else: method = method.lower() methods = dict(doc_routines[solver]) if method not in methods: raise ValueError("Unknown method %r" % (method,)) name = methods[method] ...
Python
1
alue. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix in-order arguments and keyword arguments. The available fields are: sum :param args: complete set of field values, in .msg order :param kwds: use keyword arguments corresponding to...
Python
1
import os import pyblish.api import pyblish.api class CollectAudio(pyblish.api.InstancePlugin): """ Collect relative path for audio file to instance. Harmony api `getSoundtrackAll` returns useless path to temp folder, for render on farm we look into 'audio' folder and select first file. ...
Python
1
RGB(RGBSubmodel), YUV(YUVSubmodel), CMYK, HSV, LAB, XYZ, } impl ColorModel { /// Returns the number of colour model components. /// /// The actual image may have more components e.g. alpha component. pub fn get_default_components(self) -> usize { match self { C...
Rust
0
ing,)`, which is just /// no fun. pub trait Filter: FilterBase { /// Composes a new `Filter` that requires both this and the other to filter a request. /// /// Additionally, this will join together the extracted values of both /// filters, so that `map` and `and_then` receive them as separate arguments....
Rust
0
''' URL := https://leetcode.com/problems/longest-consecutive-sequence/description/ 128. Longest Consecutive Sequence Category : Sets, Maps?, Linear Scan, Iteration, Math, Counting Complexity : Let N := number of elements Time := O(N) Space := O(N) ( E ) O( 1 ) ( I ) Correct but ran into a TLE Correct but seems like...
Python
1
child_bounds, light_id, location, intensity ); }, Octree::Leaf { cdf, values } => { cdf.add( light_id, intensity ); values.push( ( light_id, location, intensity ) ); if values.len( ) > MAX_PHOTONS_IN_CELL { let mut children = Vec::with_capacity( 8 ); for _i in 0....
Rust
0
You can get the `access_token` at /// <https://rollbar.com/{your_organization}/{your_app}/settings/access_tokens>. pub fn new<T: Into<String>>(access_token: T, environment: T) -> Client { let https = HttpsConnector::new(4).expect("TLS initialization failed"); let client = hyper::Client::builder...
Rust
0
rain_nodes] = True cdata.test_mask = test_mask cdata.train_mask = train_mask cdata.val_mask = val_mask task_data[cname] = {'train': self.TaskDataset(cdata, 'train'), 'val': self.TaskDataset(cdata, 'val'), 'test':self.TaskDataset(cdata, 'test')} ...
Python
1
A> for u8 { #[inline(always)] fn from(variant: PAD15FNCSEL_A) -> Self { variant as _ } } #[doc = "Reader of field `PAD15FNCSEL`"] pub type PAD15FNCSEL_R = crate::R<u8, PAD15FNCSEL_A>; impl PAD15FNCSEL_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -...
Rust
0
.log_histogram(key + '_w', param.weight.data, step) if hasattr(param.weight, 'grad') and param.weight.grad is not None: self.log_histogram(key + '_w_g', param.weight.grad.data, step) if hasattr(param, 'bias'): self.log_histogram(key + '_b', param.bias.data, step) if h...
Python
1
trs) _plot_syn(axis, t, _get_synthetics(greens, mt), attrs) _annotate(axis, attrs) axis.set_xlabel('Time (s)') axis.set_xlim(-window_length/2., +window_length/2.) axis.get_yaxis().set_ticks([]) print('') print('Panel 0') print('')...
Python
1
} else { let mut hash = Vec::with_capacity(self.base58check_prefix().len() + data.len()); if matches!(self, Self::Signature) && data == [0; Self::Ed25519Signature.size()] { hash.extend(Self::Ed25519Signature.base58check_prefix()); } else { hash...
Rust
0
ion node_keys = graph_renderer.node_renderer.data_source.data['index'] if set(node_keys) != set(layout_function.keys()): warn("Node keys in 'layout_function' don't match node keys in the graph. " "These nodes may not be displayed correctly.") graph_...
Python
1
p2p::{ identity::{ed25519, Keypair}, PeerId, }; use locutus_node::*; use locutus_runtime::prelude::{WrappedContract, WrappedState}; use tokio::sync::mpsc::{channel, Receiver, Sender}; const ENCODED_GW_KEY: &[u8] = include_bytes!("gw_key"); async fn start_gateway( key: Keypair, port: u16, location:...
Rust
0
1, y_edge1, c='r', linewidth=1, alpha=0.7) intersection_x1 = find_intersection_x(x_edge1, y_edge1) for x in intersection_x1: ax.axvline(x=x, c='r', linewidth=1, linestyle='dashed', alpha=0.7, ymax=0.295/0.8 / ax.get_ylim()[1]) # Plot for the third dataset ax.scatter(x_edge3, y_edge3, marker='^', c='k', s=15, alpha...
Python
1
from .chart_generators import BarChartGenerator, PieChartGenerator, LineChartGenerator import os import traceback from .config import CHARTS_DIR from urllib.parse import parse_qs def generate_chartjs( data: dict, chart_types: list = None, title: str = "Data Visualization", request_params: dict = None, ...
Python
1
return b_origin elif judgment == "Unclear": return "Unclear" elif judgment == "Error": return "Error" else: return "Invalid" # === 统计各类结果 === outcomes = [judge_winner(item) for item in data] counter = Counter(outcomes) total = sum(counter....
Python
1
from ..utils.display import Displayable, default_renderer_base, json_renderer_base from ..utils.display import RendererRegistry, HTMLRenderer __all__ = ( "Displayable", "default_renderer_base", "json_renderer_base", "RendererRegistry", "HTMLRenderer", )
Python
1
from datetime import datetime from arknights_mower.utils.email import Email from arknights_mower.utils.log import get_log_by_time, logger def submit_issue( description: str, issue_type: str = "Bug", start_time: str = None, end_time: str = None, ): """ 上报用户未解决的问题给开发组,可附带日志 """ try: ...
Python
1
`StreamEndpoint` is /// modified. /// Passing in a value of `None` removes the callback. fn set_endpoint_update_callback( &mut self, callback: Option<avdtp::StreamEndpointUpdateCallback>, ) { self.endpoint.set_update_callback(callback) } } impl Clone for Stream { fn clon...
Rust
0
_state_message] destination_cumulio = DestinationCumulio() result = list(destination_cumulio.write(config, configured_catalog, input_messages)) assert result == [airbyte_state_message] assert cumulio_writer.mock_calls == [ call(config, configured_catalog, logger), ...
Python
1
Eq, Eq)] // Table 51 pub enum Operator { // Table 57 GraphicsPush, GraphicsPop, TransformationMatrix, LineWidth, LineCap, LineJoin, MiterLimit, DashPattern, Intent, Flatness, DictName, // Table 59 Subpath, Line, BezierCurve1, BezierCurve2, BezierC...
Rust
0
_counts > (window_size * threshold_ratio) return should_reduce def dlr_loss(self, x, y): pass # 不再使用DLR损失 def attack_single_run(self, x_in, text_features): x = x_in.clone() if len(x_in.shape) == 4 else x_in.clone().unsqueeze(0) # 初始化参数 steps_2, steps_...
Python
1
fx_log_info!("can't push packet: {:?}", e); } if !player.playing() { player.play().unwrap_or_else(|e| fx_log_info!("Problem playing: {:}", e)); } inspect.accumulated_bytes += pkt.len() as u64; }, player_event ...
Rust
0
{ match ptr_size { 4 => match pe::ImportLookupTableEntry32::from_io(&mut rva) { Ok(ilt) if ilt.is_eot() => break, Ok(ilt) => { if let Some(ord) = i...
Rust
0
OpCode::Input => { let input = input.read()?; let input = input.trim().parse::<i64>()?; let store_idx = usize::try_from(mem_state[idx + 1])?; mem_state[store_idx] = input; idx += 2; } OpCode::Output(param_mode_0)...
Rust
0
table", "testme1.table", ), ]; for &(url, table_name) in examples { assert_eq!( PostgresLocator::from_str(url).unwrap().table_name, table_name.parse::<PgName>().unwrap(), ); } } impl Locator for PostgresLocator { fn as_any(&self) -> &dyn Any {...
Rust
0
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import sympy as sp # Given tan(x) tan_x = 5/12 # Calculate sec(x) sec_x = np.sqrt(1 + tan_x**2) # Visualization x = np.linspace(0, 2*np.pi, 100) y = np.linspace(0, 2*np.pi, 100) X, Y = np.meshgrid(x, y) Z = np.sin(X) * np.cos(...
Python
1
= seq_model.cur_surface ifc = seq_model.ifcs[idx] if tla == "DIF": for q in qlist: if "DOE" == q[0]: ifc.phase_element = doe.DiffractiveElement() elif tla == "HOR": if hasattr(ifc, 'phase_element'): ifc.phase_element.order = dlist[0] elif tla == ...
Python
1
from __future__ import annotations import rio # <component> class Testimonial(rio.Component): """ Displays 100% legitimate testimonials from real, most definitely not made-up people. """ # The quote somebody has definitely said about this company. quote: str # Who said the quote, probab...
Python
1
from easydict import EasyDict qbert_dqfd_config = dict( exp_name='qbert_dqfd_seed0', env=dict( collector_env_num=8, evaluator_env_num=8, n_evaluator_episode=8, stop_value=30000, env_id='Qbert-v4', #'ALE/Qbert-v5' is available. But special setting is needed after ...
Python
1
send_log_event: emit_to_front( EmitType.LOG_REPORT, msg={ "exec_id": executor.exec_id, "exec_position": executor.exec_position.name, "log_path": log_file, ...
Python
1