text
string
label_name
string
labels
int64
api) => { unsigned_message_api.to_owned() } MessageTxAPI::SignedMessageAPI(signed_message_api) => { signed_message_api.message.to_owned() } } } } /// Structure containing an `UnsignedMessage` or a `SignedMessage` from forest_address #[deri...
Rust
0
usize = 10; pub const NEDGE: usize = 6; pub const NFACE: usize = 4; pub const EDGE_NNODE: usize = 3; pub const FACE_NNODE: usize = 6; pub const FACE_NEDGE: usize = 3; #[rustfmt::skip] pub const EDGE_NODE_IDS: [[usize; Tet10::EDGE_NNODE]; Tet10::NEDGE] = [ [0, 1, 4], [1, 2, ...
Rust
0
import pygame import os # Initialize the pygame mixer pygame.mixer.init() # Function to load and play music def play_music(song): if os.path.exists(song): # Check if the song exists pygame.mixer.music.load(song) pygame.mixer.music.play() print(f"Playing: {song}") else: print("...
Python
1
her fields will be adopted from the first data dict. """ def __init__(self, transforms, scatter_key, collate_keys): super().__init__() self.transforms = Compose([TRANSFORMS.build(t) for t in transforms]) self.scatter_key = scatter_key self.collate_keys = set(collate...
Python
1
// Consider a fragmented record: // first(R1), middle(R1), last(R1), first(R2) // If initial_offset points to a record after first(R1) but before first(R2) // incomplete fragment errors are not actual errors, and must be suppressed // until a new first or full record is encou...
Rust
0
from functions.calc_funcs.hard_map import hard_map def test_hard_map_stand(): # Player total, Dealer total assert hard_map(17,1) == "S" assert hard_map(18,1) == "S" assert hard_map(20,2) == "S" assert hard_map(14,2) == "S" assert hard_map(14,3) == "S" assert hard_map(17,3) == "S" assert...
Python
1
# -*- 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
ax[1].set_title("NCCF peaks") ax[1].imshow(nccf_peaks[0].t(), extent=(0, n_frames, 0, nccf_bins), **imshow_kwargs) plt.pause(0.1) # this creates variable length windows on batched sequences # -> pad # Concatenate all voiced frames (omit unvoiced) peaks_concat = [] for b in loc[0].unique(): ...
Python
1
pwv.append(frs+'00') pwv.append(frs+'19971997') pwv.append(frs+'1221') pwv.append(nmf) else: if len(frs)<3: pwv.append(nmf) else: pwv.append(frs+frs) ...
Python
1
me probabilities for each row alpha = 1 self.pi = (X+alpha).astype(np.float) / (X+alpha).sum(axis=1)[:,None] self.multinomials = [] for pi_n in self.pi: self.multinomials.append(Multinomial(weights=pi_n, K=self.K)) def add_data(self,data): raise NotImplementedEr...
Python
1
Try` } } #[stream(item = i32)] async fn async_stream_fn() { for _i in 1..2 { async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try` } } async fn async_fn_and_for_await() { #[for_await] for _i in stream(2) { async {}.await?; //~ ERRO...
Rust
0
> { process_win += 1; } } // assert_eq!(c.get(&1).unwrap().read(), 1); sleep(Duration::from_millis(1200)); assert!(c.get(&1).is_none()); } eprintln!("process: {} cleanup: {}", process_win, clean_win); } } cfg_async...
Rust
0
return squared_maha if __name__ == '__main__': kf = KalmanFilter() mean, covariance = kf.initiate(torch.tensor([10, 15, 0.5, 10])) mean, covariance = kf.predict(mean, covariance) mean, covariance = kf.update(mean, covariance, torch.tensor([12, 20, 0.6, 11])) mean_2, covariance_2 = kf.in...
Python
1
# rc.py - functions for handling Slovak birth numbers # coding: utf-8 # # Copyright (C) 2012, 2013 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of...
Python
1
els::NodeScoreMeta>>, } impl AllocationMetric { pub fn new() -> AllocationMetric { AllocationMetric { nodes_evaluated: None, nodes_filtered: None, nodes_available: None, class_filtered: None, constraint_filtered: None, nodes_exhausted:...
Rust
0
'context': { 'search_default_group_type': True, 'search_default_year': True, 'search_default_validated': True, } } @api.model def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True): i...
Python
1
infos.len() as _, infos.as_ptr(), indirect_device_addresses.as_ptr(), indirect_strides.as_ptr(), max_primitive_counts.as_ptr(), ); } /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkBuildAccelerationStructuresKHR.h...
Rust
0
# Copyright 2014 NEC Corporation. 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 required ...
Python
1
let result = xmlSchemaValidateFile(schema_valid_ctxt, c_path.as_ptr(), 0); xmlSchemaFreeValidCtxt(schema_valid_ctxt); if result == 0 { Ok(()) } else { Err(RunnerError::ValidatingXmlFailed(result)) } } } <filename>src/methods/get_chat_administrators.rs // WARNING: THIS CODE IS AUTOGENE...
Rust
0
def updateNoteFields(self, note): # TODO ensure note is logically correct self.AnkiBridge.updateNoteFields(note) def getConfig(self): return aqt.mw.addonManager.getConfig(__name__) def writeConfig(self, config): aqt.mw.addonManager.writeConfig(__name__, config) ...
Python
1
import os shape_predictor_path = os.path.join('D:/S6 Project', 'shape_predictor_68_face_landmarks.dat') output_file_path = r'driver_data.csv' EYE_DROWSINESS_THRESHOLD = 0.20 EYE_DROWSINESS_INTERVAL = 1.7 MOUTH_DROWSINESS_THRESHOLD = 0.37 MOUTH_DROWSINESS_INTERVAL = 1.0 DISTRACTION_INTERVAL = 2.5 NORMAL_INTERVAL = 1.0...
Python
1
screenshot(arg: &str) { let bitmap = autopilot::bitmap::capture_screen().unwrap(); let path = Path::new(file!()) .parent() .unwrap() .parent() .unwrap() .join(&arg); bitmap.image.save(&path).unwrap(); } // fn op_screenshot( // _state: &mut OpState, // arg: S...
Rust
0
vec![powers[&curr_t].clone()]; let mut ts = vec![]; let final_t = calculate_final_t(iterations, delta); let mut round_index = 0; while curr_t != final_t { assert_eq!(curr_t & 1, 0); let half_t = curr_t >> 1; ts.push(half_t); assert!(round_index < 63); let denom...
Rust
0
self.vis_button.setEnabled(True) self.vis_window = None def handle_model_change(self, selected_model): """处理模型选择变化事件(新增方法)""" if selected_model == "其他模型": self.custom_model_input.setVisible(True) self.modelname = self.custom_model_input.text() or "deepseek-...
Python
1
dex""" rstrip_list = [x for x in string.splitlines() if not len(x.strip()) == 0] end_points = (len(x.rstrip()) for x in rstrip_list) max_point = max(end_points) new_rstrip_list = ((x + ' ' * max_point)[:max_point] for x in rstrip_list) return '\n'.join(new_rstrip_list) def _strip(string: str) -> s...
Python
1
r["status"] = "success" # If MAIL FROM attrs said Success earlier, MX already marked verified return { "status": overall, "dnsRecords": dns_records if overall != "success" else [], } def delete_identity(self, identity: str): """ Delete an ident...
Python
1
if labels is not None: labels = labels.to(logits.device) if self.config.problem_type is None: if self.num_labels == 1: self.config.problem_type = "regression" elif self.num_labels > 1 and (labels.dtype == torch.long or labels.dtype == torch....
Python
1
xtern RPC_IF_HANDLE __MIDL_itf_wbemtran_0000_0000_v0_0_s_ifspec; ENUM!{enum WBEM_LOGIN_TYPE { WBEM_FLAG_INPROC_LOGIN = 0, WBEM_FLAG_LOCAL_LOGIN = 1, WBEM_FLAG_REMOTE_LOGIN = 2, WBEM_AUTHENTICATION_METHOD_MASK = 0xf, WBEM_FLAG_USE_MULTIPLE_CHALLENGES = 0x10, }} pub type WBEM_128BITS = *mut BYTE; // E...
Rust
0
_to(&mut stdout()).ok(); if newline { println!(""); } println!("at {:?} wait for {:?} ", scope.now(), scope.now() + Duration::new(10, 0)); Intent::of(Http::Sleep(s)).sleep() .deadline(scope.now() ...
Rust
0
self) { debug!("D2H Reader finish"); if self.finished { return; } self.writer_inbox .send(AsyncMessage::StreamOutputDone { output_id: self.writer_output_id, }) .await .unwrap(); } fn finish(&mut self) {...
Rust
0
_z, regular_lower_edges_z], is_periodic, shape: In3D::new(size_x, size_y, size_z), lower_bounds: Vec3::new(lower_bound_x, lower_bound_y, lower_bound_z), upper_bounds: Vec3::new(upper_bound_x, upper_bound_y, upper_bound_z), extents: Vec3::new(extent_x, extent_y...
Rust
0
g = dataset_obj[0] num_classes = dataset_obj[1] orbit_partition_sizes = dataset_obj[2] return graphs_ptg, num_classes, orbit_partition_sizes def try_downgrading(data_folder, id_type, induced, directed_orbits, k, k_min): ''' Extracts the substructures of size up to the `k`, if a collection of ...
Python
1
&mut stamp as (*mut TaiA) as (*const TaiA), ); if r == -1i32 { current_block = 5; break; } if r == 1i32 { current_block = 4; break; } } (if current_block == 4 { 0i32 } else { ...
Rust
0
Ok(()) } } #[derive(Default)] pub struct Never {} impl Interrupt for Never { fn should_interrupt(&self) -> bool { false } } <gh_stars>100-1000 use crate::consts::BLAKE2S_IV; use digest::generic_array::typenum::{U32, U64}; blake2_impl!( VarBlake2s, Blake2s, u32, u32x4, U32, ...
Rust
0
for PublicationWithRelations { fn create_route() -> AppRoute { AppRoute::Admin(AdminRoute::NewPublication) } } pub mod create_publication_mutation; pub mod delete_publication_mutation; pub mod publication_query; pub mod publication_types_query; pub mod publications_query; use crate::ops::cnn::conv::Ker...
Rust
0
rame.tobytes("raw", rawmode), timestamp, frame.size[0], frame.size[1], rawmode, lossless, quality, method, ) # Update timestamp and frame index ...
Python
1
next_bytes: 0, cycles: opcode_name(val).1, } } } fn opcode_name(val: u8) -> (String, u8) { let s = match val { 0x00 | 0x08 | 0x10 | 0x18 | 0x20 | 0x28 | 0x30 | 0x38 | 0xCB | 0xD9 | 0xDD | 0xED | 0xFD => ("NOP", 4), 0x01 | 0x11 | 0x21 | 0x31 => ("LXI", 10), 0x...
Rust
0
#!/usr/bin/env python3 """ 测试数据生成器 为开发和测试环境生成模拟的股价数据 """ import pandas as pd import numpy as np import yfinance as yf from datetime import datetime, timedelta from typing import Dict, List, Optional import json import os class TestDataGenerator: """测试数据生成器""" def __init__(self, cache_dir: str = "test_dat...
Python
1
eprintln!("Lex error: {}", lex_err); self.token_buf.clear(); continue; } BufferState::EndOfInput => { eprintln!("Exit"); self.token_buf.clear(); return Result::EndOfInput; ...
Rust
0
r_case_globals)] pub const CONSTANT_ALPHA: types::GLenum = 0x8003; #[allow(dead_code, non_upper_case_globals)] pub const CONSTANT_ATTENUATION: types::GLenum = 0x1207; #[allow(dead_code, non_upper_case_globals)] pub const CONSTANT_COLOR: types::GLenum = 0x8001; #[allow(dead_code, non_upper_case_globals)] pub const CONTE...
Rust
0
enant_id="tenant_id", language="en") @pytest.mark.asyncio async def test_generate_title_failure(conversation_mocks): mock_auth_header = "Bearer test-token" request_obj = MagicMock() request_obj.conversation_id = 1 request_obj.history = [] http_request = MagicMock() conversation_mocks['get_use...
Python
1
################################################################################ # # Copyright 2023 ByteDance Ltd. and/or its affiliates. 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 t...
Python
1
ck_user", {}) or {} raw_id = lock_user.get("id", 0000) try: user_id = int(float(raw_id)) if isinstance(raw_id, str) else int(raw_id) except (ValueError, TypeError): user_id = 0000 if self._event.get("name") == "LOCK_INDOOR_BUTTON_UNLOCK": at...
Python
1
atus = process::Command::new("crossbar") .arg("init") .arg("--appdir") .arg(&crossbar_dir) .stdout(Stdio::null()) .status() .await .expect("could not run `crossbar init`"); if !status.success() { panic!("`crossbar init` exited with status code {}", st...
Rust
0
np.ndarray, pd.DataFrame]) -> Union[np.ndarray, pd.DataFrame]: """Apply all transforms in sequence.""" result = data for transform in self.transforms: result = transform.transform(result) return result def fit_transform(self, data: Union[np.ndarray, pd.DataFrame]) ->...
Python
1
afe impl<'a, T: 'a + Element> Element for &'a T { dispatch_ele!{self, *self} } /// RefCell - Interior mutability impl<T: Element> Element for ::std::cell::RefCell<T> { dispatch_ele!{self, self.borrow()} } /// Unit type is a valid element. Just does nothing. impl Element for () { fn focus_change(&self, _have: bool) {...
Rust
0
// 0 1 2 3 let split_by_dash: Vec<&str> = raw_value.split('-').collect(); match split_by_dash.len() { 0..=2 => return Err(VersionParseError::from(raw_value)), 3 => (split_by_dash[1], ""), 4 => (split_by_dash[1]...
Rust
0
4 = P_3 + P_1, where P_3 = P_1 + P_2. // Under the above presumptions on P_1 and P_2 can be enforced by just 5 // constraints // 1. (x2 - x1) * lambda_1 = y2 - y1; // 2. lambda_1^2 = x1 + x2 + x3; // 3. (x1 - x3) * (lambda1 + lambda_2) = 2·y1 // 4. la...
Rust
0
iteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 30/08/2018 Last Modified: 30/08/2018 License: MIT */ use super::Point2D; use std::f64; #[derive(Clone, Copy, Debug)] pub struct BoundingBox { pub min_x: f64, pub min_y: f64, pub max_x: f64, pub max_y: f64, } impl Eq for BoundingBox ...
Rust
0
SULT, fn CreateRasterizerState( pRasterizerDesc: *const D3D11_RASTERIZER_DESC, ppRasterizerState: *mut *mut ID3D11RasterizerState, ) -> HRESULT, fn CreateSamplerState( pSamplerDesc: *const D3D11_SAMPLER_DESC, ppSamplerState: *mut *mut ID3D11SamplerState, ) -> HRESULT, ...
Rust
0
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed ...
Python
1
n_matrix = translation_back @ R @ translation_to_origin return rotation_matrix # def RotateAngle2Matrix(center, axis, theta): # # 将axis向量标准化 # axis = np.asarray(axis) # axis = axis / np.sqrt(np.dot(axis, axis)) # # # 使用罗德里格斯公式计算旋转矩阵 # a = np.cos(theta / 2.0) # b, c,...
Python
1
""" Setup script for Interactive Log Analyzer """ from setuptools import setup, find_packages with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() with open("requirements.txt", "r", encoding="utf-8") as fh: requirements = [line.strip() for line in fh if line.strip() and not line....
Python
1
, Formula): s += expr.symbol s += ": " stack.append((0, expr.get_expr())) elif isinstance(expr, Contract): if seen == 0: s += f"{expr.symbol}: (" stack.append((seen + 1, expr)) stack.append((0, expr.get_assumption())...
Python
1
ra_headers(expected_lineage_header_info) if is_in_notebook or is_in_job: mock_http.assert_any_call( host_creds=mock.ANY, endpoint=mock.ANY, method=mock.ANY, json=mock.ANY, extra_headers=extra_headers, ) def...
Python
1
################희소배열 활용** import sys input = sys.stdin.readline sys.setrecursionlimit(10**5) LOG = 17 #2**17 = 131072 def tree(node,p,depth): dep[node] = depth for i,j in graph[node]: if i!=p: parent[i][0][0] = node parent[i][0][1] = j tree(i,node,depth+1) N = int(in...
Python
1
must list both spellings. 'sa': ['अस्', 'as', 'भू', 'bhū', 'इ', 'i', 'कृ', 'kṛ', 'शक्', 'śak'], 'hi': ['है', 'था', 'रह', 'कर', 'जा', 'सक', 'पा', 'चाहिए', 'हो', 'पड़', 'लग', 'चुक', 'ले', 'दे', 'डाल', 'बैठ', 'उठ', 'रख', 'आ'], 'ur': ['ہے', 'تھا', 'رہ', 'کر', 'جا', 'سک', 'پا', 'چاہیئ...
Python
1
# Copyright 2017 The TensorFlow Authors. 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 required by applica...
Python
1
class QLearner(MDPValueIteration): def __init__(self, grid_world: GridWorldBase, gamma: float = 0.99): """Constructs an MDP from a GridWorldBase object. States should be numbered from left-to-right and from top-to-bottom. Args: grid_world: GridWorld specification. gamma: Discount factor. ...
Python
1
) ax[0, n].plot( t_array, target[n, v, :], linestyle="dashed", label="target var " + str(v), color=colors[v], ) # ax[0, n].legend(loc="upper right") ax[0, n].set_title(f"Activity and target, node ...
Python
1
ot as usize)?, 1 => window.right_click(packet.slot as usize)?, _ => bail!("unrecgonized click"), }, 1 => window.shift_click(packet.slot as usize)?, 5 => match packet.button { 0 => window.begin_left_mouse_paint(), 4 => window.begin_right_mouse_paint...
Rust
0
te an interrupt based on COMPR1. value."] EN, } impl TMRB6IE1R { #[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { ...
Rust
0
p by pressing CTRL+C, which will raise a KeyboardInterrupt. """ # XXX Should there be a way to pass additional event handles which # can terminate this function? # XXX XXX XXX # # It may be that I misunderstood the CoWaitForMultipleHandles # function. Is a message loop required in a ST...
Python
1
nxit::{verify_signed_batch, Identity, Signable, Signed, VerifiedRef}; /// /// // define example struct /// struct TestData<'a>(&'a str); /// /// // make the struct signable /// impl<'a> Signable for TestData<'a> { /// type SignableData = &'a str; /// type Error = std::io::Error; // never used /// fn signabl...
Rust
0
+ str(node_idx), etab, layout, ) ) return outs is_tf_keras = _check_model_is_tf_keras() if not is_tf_keras: # Importing from Keras try: import keras except ImportError: ...
Python
1
; out vec2 v_tex_coords; void main() { gl_Position = vec4(position, 1.0); v_tex_coords = texture; } "; /// Default post fragment shader pub const FRAG: &str = " #version 330 #define M_PI 3.1415926535897932384626433832795 uniform vec...
Rust
0
1", "62", "63", "64", "65", "66", "67", "68", "69", "6A", "6B", "6C", "6D", "6E", "6F", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7A", "7B", "7C", "7D", "7E", "7F", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8A", "8B", "8C", "8D", "8E", "8F", "90", "91", "92", "93", ...
Rust
0
); let body = response.text().await.unwrap(); assert_eq!(body, $expected); }; } /// Performs a GET on a server running on localhost on port /// `port` and checks the body matches the `expected` text. #[macro_export] macro_rules! check_get_text { ($port:expr, $path:expr, $expected:expr) => { ...
Rust
0
e of \{'..." with pytest.raises(ValueError, match=message): res.plot(plot_type='llama') except (ModuleNotFoundError, ImportError): # Avoid trying to call MPL with numpy 2.0-dev, because that fails # too often due to ABI mismatches and is hard to avoid. This te...
Python
1
FLAGS.question_len, FLAGS.vocab_file, FLAGS.do_lower_case, FLAGS.global_token_types, FLAGS.spm_model_path, FLAGS.tokenizer_type, split == "train", FLAGS.predict_la_when_no_sa, FLAGS.include_unknown_rate, FLAGS.include_unknown_rate_for_unanswerab...
Python
1
{data['nextPageToken']}") return {"result": "\n".join(results)} async def send_live_chat_message(live_chat_id: str, message_text: str) -> Dict[str, Any]: """Send a message to a YouTube livestream chat. This function posts a message to a live chat by its ID. The sender must be authorized via ...
Python
1
models.json' 中未找到。请求将不带特定模型ID发送。") if not target_model_id: logger.warning(f"模型 '{model_name}' 在 'models.json' 中未找到对应的ID。请求将不带特定模型ID发送。") # 4. 构建消息模板 message_templates = [] for msg in processed_messages: message_templates.append({ "role": msg["role"], "content": ...
Python
1
, tm_mon: 7, tm_year: 116, tm_wday: 0, tm_yday: 233, tm_isdst: 0, tm_utcoff: 0, tm_nsec: 0 }; let state = BucketState::try_new(format!("{{\"content\":5,\"lastDrip\":{}}}", now.to_timespec().sec * 1000).as_bytes(), &now).unwrap(); now.tm_sec += 2; let bucket = Bucket::new("bucket".to_owned(), 100...
Rust
0
ed = svm.SVC() for MultiClassClassifier in [OneVsRestClassifier, OneVsOneClassifier]: ovr_false = MultiClassClassifier(clf_notprecomputed) assert not ovr_false._pairwise ovr_true = MultiClassClassifier(clf_precomputed) assert ovr_true._pairwise @pytest.mark.parametrize( "Mult...
Python
1
"mel": mel, # [T, 80] "f0": f0, } np.save(out_name, out_dict) except Exception as e: print(e) def extract_mel_f0_from_video_name(mp4_name, wav_name=None, out_name=None): if mp4_name.endswith(".mp4"): wav_name = split_wav(mp4_name, wav_name) if out_n...
Python
1
for k, v in aggregated_stats.items(): logger.info(f"Average episode {k}: {v:.4f}") step_id = checkpoint_index if "extra_state" in ckpt_dict and "step" in ckpt_dict["extra_state"]: step_id = ckpt_dict["extra_state"]["step"] writer.add_scalars( "eval_...
Python
1
19"); } #[test] fn powers_17() { test_eval("(2/3)^(4/5)", "approx. 0.7229811807"); } #[test] fn powers_18() { test_eval( "5.2*10^15*300^(3/2)", "approx. 27019992598076723515.9873962402", ); } #[test] fn pi_to_the_power_of_ten() { test_eval("pi^10", "approx. 93648.047476083"); } #[tes...
Rust
0
HashConsed(self.0) } } type HM<T> where T: Eq + Hash = HashMap<UnsafeRef<T>, UnsafeRef<T>>; struct HashConserBox<T> where T: Eq + Hash { map: HM<T>, refs: usize, } /// Hash-conser, i.e. hash-consed value factory and cache. pub struct HashConser<T> where T: Eq + Hash { ptr: *mut HashConserBo...
Rust
0
AuthnContext> <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password</saml:AuthnContextClassRef> </saml:AuthnContext> </saml:AuthnStatement> <saml:AttributeStatement> <saml:Attribute Name="uid" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"> <saml:AttributeVal...
Rust
0
encrypted_key.decrypt(password)?; // let xsk_child = xsk.derive_child(index)?; // Ok(xsk_child) // } } #[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)] pub struct KeyCiphertext { pub ciphertext: SerdeBytes, pub mac: SerdeBytes, pub salt: SerdeBytes, pub iv: SerdeBytes...
Rust
0
el: Element { id, el_type: ElementType::Vertex, }, label: VertexLabel::Document, }, uri: Url::parse(uri).expect("passed uri was not valid"), language_id: String::from(language_id), } } } ...
Rust
0
ment """ return f""" Determine appropriate intervention for negative feedback: {negative_feedback} Customer value: {customer_value} Issue severity: {issue_severity} Context: {context} Suggest specific actions to address concerns and recover the relationship. """ @mcp.prompt("/feedback-classification") def fe...
Python
1
= (pd.to_datetime(df_rws_all["timestamp"]) - datetime.datetime(2024, 3, 19, 0, 31, 35)) / np.timedelta64(1, 'm') df_rws_all["error_rate"] = df_rws_all["total_errors"] / ((18000 + (df_rws_all["step"] * 2000)) / df_rws_all["average_iops"])...
Python
1
C_FOREACH: xsltStyleType = 16; pub const xsltStyleType_XSLT_FUNC_DOCUMENT: xsltStyleType = 17; pub const xsltStyleType_XSLT_FUNC_WITHPARAM: xsltStyleType = 18; pub const xsltStyleType_XSLT_FUNC_PARAM: xsltStyleType = 19; pub const xsltStyleType_XSLT_FUNC_VARIABLE: xsltStyleType = 20; pub const xsltStyleType_XSLT_FUNC_W...
Rust
0
+ "." + str(x) + "." + y + "=" + self.__encode_string(values[x][y]) + "\n" ) ...
Python
1
ve(Debug, Clone, PartialEq, Eq, Hash)] pub enum WhereClause { /// The given trait needs to be implemented for its type parameters. Implemented(TraitRef), /// An associated type bindings like in `Iterator<Item = T>`. AliasEq(AliasEq), } pub type QuantifiedWhereClause = Binders<WhereClause>; #[derive(De...
Rust
0
let (here, there) = S::new(); let respfut = match http { true => { let mut temp = Request::builder().method(method).uri(uri); for elt in header { temp = temp.header(elt.0, elt.1); } let req = temp.body(Body::from(body))?; le...
Rust
0
); assert_eq!(a, "simple string"); let (i, a) = parse_quoted_string(r#""with; semicolons.""#).unwrap(); assert_eq!(i, ""); assert_eq!(a, "with; semicolons."); let (i, a) = parse_quoted_string(r#""with escaped\; semicolons.""#).unwrap(); assert_eq!(i, ""); assert...
Rust
0
} /// <p>The <code>RuleId</code> of the <a>RateBasedRule</a> that you want to get. /// <code>RuleId</code> is returned by <a>CreateRateBasedRule</a> and by <a>ListRateBasedRules</a>.</p> pub fn rule_id(mut self, inp: impl Into<std::string::String>) -> Self { self.inner = self.inner.r...
Rust
0
get_command() .args(&["--bearer=SomeToken", &server.base_url()]) .assert(); server.assert_hits(1); } #[test] fn digest_auth() { let server = server::http(|req| async move { if req.headers().get("Authorization").is_none() { hyper::Response::builder() .status(4...
Rust
0
102, 15, 43, 190, 146, 164, 9, 82], OperandSize::Dword) } #[test] fn movntpd_2() { run_test(&Instruction { mnemonic: Mnemonic::MOVNTPD, operand1: Some(IndirectScaledIndexedDisplaced(RCX, RDX, Eight, 585280777, Some(OperandSize::Xmmword), None)), operand2: Some(Direct(XMM5)), operand3: None, operand4: None, lock: f...
Rust
0
import spikeinterface_gui as sigui from spikeinterface_gui.tests.testingtools import clean_all, make_analyzer_folder, make_curation_dict from spikeinterface_gui.controller import Controller from spikeinterface_gui.myqt import mkQApp from spikeinterface_gui.viewlist import possible_class_views from spikeinterface_gui.b...
Python
1
(dropout_layer.get_shape())同上 with tf.name_scope('movie_fc'): # 首先将movie的id和genres分别连入一个小型神经网络 movie_id_fc_layer = tf.layers.dense(movie_id_embed_layer, embed_dim, name='movie_id_fc_layer', activation=tf.nn.relu) movie_categories_fc_layer = tf.layers.dense(movie_categories_embed_layer, embed_dim, name='mov...
Python
1
# -*- coding:utf-8 -*- from flask_babel import lazy_gettext as _l from api.lib.resp_format import CommonErrFormat class ErrFormat(CommonErrFormat): login_succeed = _l("login successful") # 登录成功 ldap_connection_failed = _l("Failed to connect to LDAP service") # 连接LDAP服务失败 invalid_password = _l("Passwor...
Python
1
'tcx u8); macro_rules! gen { ($(($name:ident, $tcx:lifetime, [$k:ty], [$r:ty]))*) => { pub struct Providers { $(pub $name: for<$tcx> fn(TyCtxt<$tcx>, $k) -> $r,)* } } } // @has 'foo/struct.Providers.html' // @has - '//*[@class="docblock item-decl"]//code' "pub a: for<'tcx> fn(_: Ty...
Rust
0
1K => 12, TMRA1CLKR::LFRC => 13, TMRA1CLKR::RTC_100HZ => 14, TMRA1CLKR::HCLK_DIV4 => 15, TMRA1CLKR::XT_DIV4 => 16, TMRA1CLKR::XT_DIV8 => 17, TMRA1CLKR::XT_DIV32 => 18, TMRA1CLKR::CTMRB1 => 20, TMRA1CLKR::CTMRA0 => 21, ...
Rust
0
_lambda_with_an_argument_correctly() { let mut interpreter = Interpreter::new(); let plus = interpreter.intern_symbol_value("+"); let one = Value::Integer(1); let arg1 = interpreter.intern_symbol_value("%1"); let nil = interpreter.intern_nil_symbol_value(); let cdr = in...
Rust
0
jectName("dateTimeEdit") self.btnCalculate = QtWidgets.QPushButton(self.centralwidget) self.btnCalculate.setGeometry(QtCore.QRect(20, 170, 111, 51)) self.btnCalculate.setObjectName("btnCalculate") self.widget = QtWidgets.QWidget(self.centralwidget) self.widget.setGeometry(QtCore....
Python
1
} #[cfg(test)] mod tests { use lychee_lib::{CacheStatus, InputSource, ResponseBody, Uri}; use super::*; #[test] fn test_skip_cached_responses_in_progress_output() { let mut buf = Vec::new(); let response = Response( InputSource::Stdin, ResponseBody { ...
Rust
0
import sys, os import time import argparse import serial client = None READING_SEEING = 'A' READING_RAW = 'B' parser = argparse.ArgumentParser(description='Use Airylab Solar Scintillation Monitor to start/stop Planetary Imager recording based on seeing') parser.add_argument('serial_port', help='Serial port to use for...
Python
1