text
string
label_name
string
labels
int64
> { /// A variable-length integer representing the time delta in microseconds /// between when this ACK was sent and when the largest acknowledged /// packet, as indicated in the Largest Acknowledged field, was /// received by this peer pub ack_delay: VarInt, /// Contains additional ranges of p...
Rust
0
ookFirst { async fn on_new_target(&self, target: &Arc<Target>, tc: &GuardedTargetCollection) { // This will crash if the target isn't already inserted. let t = Arc::clone(&tc.lock().await.get(target.nodename.clone().into()).await.unwrap()); assert_eq!(t.nodename, "nothin"); ...
Rust
0
sage_flags; pub mod info_destination; pub mod info_reply; pub mod info_reply_submessage_flags; pub mod info_source; pub mod info_timestamp; pub mod info_timestamp_submessage_flags; pub mod message; pub mod message_decoder; pub mod message_encoder; pub mod nack_frag; pub mod pad; pub mod protocol_id; pub mod protocol_ve...
Rust
0
#typ_generics #where_clause { fn decode(__d777: &mut minicbor::Decoder<'bytes>) -> core::result::Result<#name #typ_generics, minicbor::decode::Error> { #check match __d777.u32()? { #(#rows)* n => Err(minicbor::decode::Error::UnknownVar...
Rust
0
約為最近到期的合約 參數: symbol_base: 基本商品代碼,例如 "MXF" 返回: 包含近月到期月份的完整商品代碼,符合富邦API格式 """ today = date.today() current_year = today.year current_month = today.month # 計算當月第三個週三的日期 first_day = date(current_year, cur...
Python
1
response from Twitch for auth. Reason: \"{}\"", why) }), Ok(response) => match from_str::<Value>(&response) { Err(why) => Err( ExitMsg{ code: ExitCode::CannotParseResponse, msg: format!("Cannot parse response from Twitch for auth. Reason: \"{}\"", why) }), Ok(mut parse) => match from_value::<S...
Rust
0
[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] pub const CLUSAPI_VERSION_RS3: u32 = 2560u32; #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] pub const CLUSAPI_VERSION_SERVER2008: u32 = 1536u32; #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] pub const CLUSAPI_VERSIO...
Rust
0
from app.community.plugins.coin_technical_analyzer.tools import TOOLS from app.core.plugins import BasePlugin from app.core.plugins.registry import ensure_plugin_registry from app.core.plugins.tools import BaseTool plugin_registry = ensure_plugin_registry() @plugin_registry.register(name="coin-technical-analyzer") cl...
Python
1
# 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 class DeleteUserMailboxRequest(BaseRequest): def __init__(self) -> None: super().__init__...
Python
1
delete handler' def _openxr_window(window_name = None): if window_name is None: window_name = 'Preview window Composited' # For Sony SR 16" display handles = _find_window_handles_by_title(window_name) if len(handles) == 1: from Qt.QtGui import QWindow w = QWindow.fromWinId(handles[...
Python
1
g).unwrap(); // println!("test_attributes:{}:{:?}", arg, attr); assert_eq!(attr.ip, ip.to_s()); assert_eq!(attr.prefix, ip.prefix.num); } } #[test] pub fn test_octets() { let ip = IPAddress::parse("10.1.2.3/8").unwrap(); assert_eq!(ip.parts(), [10,...
Rust
0
the best finalized chain from permanent storage, //! in the old format //! * Target New State Service //! * writes best finalized chain blocks to permanent storage, //! in the new format //! * only performs essential contextual verification of blocks, //! to make sure that block data hasn't been ...
Rust
0
valid option name"); let value = CString::new(value.to_string()).expect("invalid option value"); let ret = unsafe { ffw_demuxer_set_initial_option(self.ptr, name.as_ptr() as _, value.as_ptr() as _) }; if ret < 0 { panic!("unable to allocate an option"); ...
Rust
0
anAddr("me".to_string()); let to_address = HumanAddr("you".to_string()); let amount = coins(1015, "earth"); let bank = BankMsg::Send { from_address, to_address, amount, }; let msg: CosmosMsg = bank.clone().into(); match msg { ...
Rust
0
Quickcheck needs pass by value #[allow(clippy::needless_pass_by_value)] #[cfg(test)] mod tests { use super::*; use itertools::repeat_n; use quickcheck_macros::quickcheck; use zkp_macros_decl::field_element; #[test] fn test_literal() { const SMALL: FieldElement = field_element!("0F"); ...
Rust
0
elif 'play music' in query: music_file = 'C:\\Users\\shiva\\Downloads\\music.mp3' # Replace with the path to your music file speak("Playing music now...") play_music(music_file) while pygame.mixer.music.get_busy(): continue speak("Music ha...
Python
1
import pulp def conjunto_independiente_maximo(grafo): problema = pulp.LpProblem("Conjunto_Independiente_Maximo", pulp.LpMaximize) vertices = grafo.obtener_vertices() x = pulp.LpVariable.dicts("x", vertices, 0, 1, pulp.LpBinary) problema += pulp.lpSum(x[v] for v in vertices), "Maximizar cantidad de vé...
Python
1
# from django.shortcuts import render # from library.services import book_service # def book_list(request): # books = book_service.get_all_books() # return render(request, 'library/book_list.html', {'books': books}) # def book_history(request, book_id): # book = book_service.get_book_by_id(book_id) # ...
Python
1
rn uv.clip(min=-1000, max=2000) def bfs(tree, start_node): order, predecessors = sp.csgraph.breadth_first_order(tree, start_node, directed=False) ranks = np.arange(len(order)) ranks[order] = ranks.copy() return ranks, predecessors def compute_min_spanning_tree(pws): sparse_graph = sp.dok_array(p...
Python
1
= buf[src_off + x * 4 + 1]; data[dst_off + x * 4 + 2] = buf[src_off + x * 4 + 0]; data[dst_off + x * 4 + 3] = buf[src_off + x * 4 + 3]; } } ImageFormat::RgbaSeparate => { fn pr...
Rust
0
find_words_tests { use super::*; #[test] fn find_words_test_one() { // arrange let test = vec![ String::from("Hello"), String::from("Alaska"), String::from("Dad"), String::from("Peace"), ]; // act let result = find_wor...
Rust
0
_bit(u: u64, i: usize) -> usize { ((u >> i) & 1) as usize } //#[inline] fn to_index(u: U64x4, i: usize) -> usize { get_bit(u.value[0], i) + (get_bit(u.value[0], 32 + i) << 1) + (get_bit(u.value[1], i) << 2) + (get_bit(u.value[1], 32 + i) << 3) + (get_bit(u.value[2], i) << 4) ...
Rust
0
_all_duplicated_items_bug() { let seed = [ 26, 84, 47, 127, 109, 136, 2, 23, 141, 90, 81, 183, 80, 116, 43, 39, 26, 84, 47, 127, 109, 136, 2, 23, 141, 90, 81, 183, 80, 116, 43, 39, ]; let mut rng = rand::rngs::SmallRng::from_seed(seed); test_range_query_all_by_rng(&mut rng); } #[test]...
Rust
0
ou expect this food item to contain?" Q3 = "Q3: In what setting would you expect this food to be served? Please check all that apply" Q4 = "Q4: How much would you expect to pay for one serving of this food item?" Q5 = "Q5: What movie do you think of when thinking of this food item?" Q6 = "Q6: What drink...
Python
1
dyn Error>> { let mut env = TestEnvironment::new(); env.expect_everyone_agrees_on_game_state(0)?; // P1 connects env.create_and_connect_player()?; // P2 connects let player2_id = env.create_and_connect_player()?; // P3 connects env.create_and_connect_player()?; // P2 disconnects let game = env.e...
Rust
0
installed", "--toolchain", name]) .log_output(false) .process_lines(&mut |line, _| { if line.starts_with("error: toolchain ") && line.ends_with(" is not installed") { not_installed = true; } }) .run_capture() ...
Rust
0
RST_CRC_RST_A> for u32 { #[inline(always)] fn from(variant: CRC_RST_CRC_RST_A) -> Self { variant as _ } } #[doc = "Reader of field `CRC_RST_CRC_RST`"] pub type CRC_RST_CRC_RST_R = crate::R<u32, CRC_RST_CRC_RST_A>; impl CRC_RST_CRC_RST_R { #[doc = r"Get enumerated values variant"] #[inline(al...
Rust
0
d736e2bcaa2a/src/cargo/ops/cargo_doc.rs // and is licensed under the terms of that repo #[cfg(not(any(target_os = "windows", target_os = "macos")))] fn open_project(path: &Path) -> Result<(), Error> { use std::env; let mut methods = Vec::new(); // trying $BROWSER if let Ok(name) = env::var("BROWSER") { ...
Rust
0
Ok(send); } fn anchor_increase_allowance_msg(asset_whitelist: &Arc<AssetWhitelist>, wallet_acc_address: &str, coin_amount: Decimal) -> anyhow::Result<Message> { let contract_addr_anc = tokens(asset_whitelist, "Anchor", "ANC").ok_or(anyhow!("no contract_addr_anc"))?; let contract_addr_lp_1 = custom(asset_white...
Rust
0
s = exprs .iter() .flat_map(|e| try_build_expression_using_other(e, other, other_prov, input_mapper)) .collect_vec(); if new_exprs.len() == exprs.len() { Some(MirScalarExpr::CallVariadic { func: func.clone(), ...
Rust
0
to Spark context: {MODEL_PATH}") else: if not SparkConfig.TRAIN_MODEL: print(f"FATAL ERROR: LightGBM model not found at {MODEL_PATH} and TRAIN_MODEL is False.", file=sys.stderr) spark_session.stop() sys.exit(1) else...
Python
1
ActiveSchedule, ActiveState}, }; pub fn ui_system<I: VisualizationState<S> + Clone + 'static, S: State>( egui_context: ResMut<EguiContext>, mut sim_data: ResMut<SimulationDescriptor>, active_schedule_wrapper: ResMut<ActiveSchedule>, active_state_wrapper: ResMut<ActiveState<S>>, on_init: Res<I>, ...
Rust
0
!(1, current_rules["abc2"].len()); drop(breaker_map); drop(breaker_rules); drop(current_rules); let success = load_rules_of_resource(&"abc1".into(), vec![Arc::clone(&r0), Arc::clone(&r1)]); assert!(!success.unwrap()); assert_eq!(2, BREAKER_MAP.read().unwrap(...
Rust
0
from vpython import * 场景 = canvas(title='电子排布与结合能计算', width=1000, height=700, background=color.white) 原子核 = sphere(pos=vector(0,0,0), radius=1, color=color.yellow) 轨道列表 = [] 电子列表 = [] 结合能标签列表 = [] 当前半径 = 2 for i in range(6): 轨道 = ring(pos=vector(0,0,0), axis=vector(0,0,1), radius=当前半径, thickness=0.1, opacity=0.2)...
Python
1
-8.89064, -30.01809, 60.62329, 49.66749, -258.98418] ) robot.MoveL(Pose([250, 300, 278.023897, 180, 0, -150]), [-37.52588, -6.32628, -34.59693, 53.52525, 49.24426, -251.44677] ) robot.MoveL(Pose([250, 250, 191.421356, 180, 0, -150]), [-39.75778, -1.04537, -40.37883, 52.09118, 54.15317, -246.94403] ) robot....
Python
1
\x15\xcb\x00@jo\x13S\x00\x90\xdb\ \x00\xf0\xb9\x14\x04h\x94B\x08\x8b\x81\x7f'\x1e\xd3\x9c\ \xdb\xce\xc45\x1f\x92\x01\x80\xd4\xc6&\x01\xcf.\xd8\x90\ y\xee|\xe3\x99\x0c\xec\x9fF\x7f$\x03\x00\xa9MM\ \xc3#{\xdb\xd1\x1e\xde\x03e\x00 \xb5\xb7-\xc9{\ \xe4,8\xff\x9fK\xa9u\x00\x10\x17\x03z\x0f\x94\x01\ \x80\xd4\xe6r\x0f\xd3;\xf...
Python
1
93fa823865842c4a2a4d82d987cdb435a51e68faaca74ea7169783010565e090625cc8bfe0ec03053485debb4c8de8f1ab52ed51f136f802cd7503cadadb5c36391ef51c05f01939", (64, 13, [0x1187baa5fbd9f754, 0x5c3778d1dca3ea0e], [0x7c0f7c92bc81eba7, 0x1421c5dcbd492cf4]), "<KEY>" ), ( // Len = 1856 "eefdbfc7a6e3ea3651f9fab80c879518de4f018b4...
Rust
0
[doc = "Bit 8 - 8:8\\] Internal. Only to be used through TI provided API."] #[inline] pub fn wu_signal(&mut self) -> _WU_SIGNALW { _WU_SIGNALW { w: self } } #[doc = "Bits 0:7 - 7:0\\] Internal. Only to be used through TI provided API."] #[inline] pub fn ev_signals(&mut self) -> _EV_SIGNA...
Rust
0
# external_module.py import streamlit as st import streamlit.components.v1 as components def render_external_module(url: str, title: str, note: str = "", height: int = 740): st.markdown(f"## {title}") if note: st.caption(note) fallback = st.toggle( "Buka fullscreen di halaman ini (fallback...
Python
1
from bs4 import BeautifulSoup, Comment def clean_html(html): soup = BeautifulSoup(html) unused_tags = ["script", "style", "svg", "image", "iframe", "code", "noscript"] for tag_name in unused_tags: for tag in soup.find_all(tag_name): tag.decompose() comments = soup.find_all(string=...
Python
1
,2,-1,-4]) ); println!( "Solution::three_sum(vec![0,2,2,3,0,1,2,3,-1,-4,2]) = {:?}", Solution::three_sum(vec![0,2,2,3,0,1,2,3,-1,-4,2]) ); println!( "Solution::three_sum(vec![0,0,0]) = {:?}", Solution::three_sum(vec![0,0,0]) ); println!( "Solution::three_s...
Rust
0
tion: Mat4) { for vertex_id in self.vertex_iter() { let p = self.vertex_position(vertex_id); let p_new = (transformation * p.extend(1.0)).truncate(); self.move_vertex_to(vertex_id, p_new); } } } <reponame>khvzak/hyper-sync use unicase::Ascii; header! { /// `A...
Rust
0
OptBlockId(if bool::read(buffer, version)? { Some(VarInt::read(buffer, version)?.0) } else { None }), 14 => MetaEntry::Nbt(Nbt::read(buffer, version)?.0), x => bail!("invalid entity metadata entry ID {}", x), }) } impl Writeable for EntityMetadata { fn wr...
Rust
0
oussu/ncollide //! //! Shape composed from the union of primitives. //! use crate::bounding_volume::{BoundingVolume, AABB}; use crate::math::{Isometry, Point}; use crate::partitioning::{BVHImpl, BVT}; use crate::query::{Contact, ContactKinematic, ContactPrediction, ContactPreprocessor}; use crate::shape::{CompositeSha...
Rust
0
pub use Shader_Builder = self::Release_Shader; #[macro_escape] mod check; #[macro_escape] #[path = "../../shared/log/macros.rs"] mod macros; pub trait Shaderable { fn bind(&mut self); fn get_uniform_location(&self, uniform: &str) -> i32; fn update_uniform_i32(&self, location: i32, i: i32); fn update_uniform...
Rust
0
eContext::new_with_state( Arc::new(create_route_with_activities( &fleet, vehicle, groups .into_iter() .map(|group| create_activity_with_job_at_location(create_test_single(g...
Rust
0
recognition processes processes = [] for _ in range(mp.cpu_count()): # One process per CPU core p = mp.Process(target=recognize_faces_worker, args=(frame_queue, processed_frame_queue, embeddings, app, stop_event), daemon=True) processes.append(p) p.start() # Start display thread ...
Python
1
: &mut W) -> Result<(), std::io::Error> where W: std::io::Write, { match self { IpAddr::V4(addr) => addr.to_ipv6_mapped().serialize(target), IpAddr::V6(addr) => addr.serialize(target), } } } impl Serializable for &std::net::SocketAddr { fn serialize<W>(&s...
Rust
0
import subprocess from YutaRobot import LOGGER, dispatcher from YutaRobot.modules.helper_funcs.chat_status import dev_plus from telegram import ParseMode, Update from telegram.ext import CallbackContext, CommandHandler @dev_plus def shell(update: Update, context: CallbackContext): message = update.effective_mess...
Python
1
import functools from flask import jsonify import logging import traceback logger = logging.getLogger(__name__) def handle_errors(f): @functools.wraps(f) def wrapped(*args, **kwargs): try: return f(*args, **kwargs) except Exception as e: logger.error(f"Error in {f.__nam...
Python
1
ic_const!(div_i64_const, "/", i64, "I64", "40i64", "2i64", 20); arithmetic_const!(mod_i64_const, "%", i64, "I64", "30i64", "7i64", 2); arithmetic_const!(add_f64_const, "+", f64, "F64", "0.5", "0.5", 1.0); arithmetic_const!(sub_f64_const, "-", f64, "F64", "0.5", "0.5", 0.0); arithmetic_const!(mul_f64_const, "*", f64, "...
Rust
0
# Copyright 2024 EPAM Systems # # 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 w...
Python
1
import functools import numpy as np from mltk.core.model import ( MltkModel, TrainMixin, ImageDatasetMixin, EvaluateAutoEncoderMixin ) from mltk.core.keras import ImageDataGenerator from mltk.models.shared import FullyConnectedAutoEncoder # Instantiate the MltkModel object with the following 'mixins'...
Python
1
vec!["foo", "bar"]; let seq = v.to_py_object(py).into_object().cast_into::<PySequence>(py).unwrap(); assert!(seq.list(py).is_ok()); } #[test] fn test_strings_coerce_to_lists() { let gil = Python::acquire_gil(); let py = gil.python(); let v = "foo"; let seq =...
Rust
0
entities = [] matches = entity_pattern.findall(response) for match in matches: # Remove or standardize spaces around slashes and hyphens normalized_match = re.sub(r"\s*([/-])\s*", r" \1 ", match) # Normalize to lowercase and strip whitespace entities...
Python
1
import sys from gi.repository import Gtk, Gdk, WebKit class WebKitWindow(Gtk.Window): scrolls = None webView = None def __init__(self, url, transparent=False): Gtk.Window.__init__(self, Gtk.WindowType.TOPLEVEL, title='') self.scrolls = Gtk.ScrolledWindow() self.webView = WebKit.WebView() self.set_positi...
Python
1
Dir): self._OutputDir = OutputDir @property def TaskNotifyConfig(self): r"""任务的事件通知配置,不填代表不获取事件通知。 :rtype: :class:`tencentcloud.mps.v20190612.models.TaskNotifyConfig` """ return self._TaskNotifyConfig @TaskNotifyConfig.setter def TaskNotifyConfig(self, TaskNotif...
Python
1
render_with_camera(&mut camera) { } } <filename>basics/static-files/src/main.rs use actix_files::Files; use actix_web::{middleware::Logger, App, HttpServer}; #[actix_web::main] async fn main() -> std::io::Result<()> { env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); log::info!(...
Rust
0
Deserialize, Clone, Debug, PartialEq, JsonSchema)] #[serde(rename_all = "snake_case")] pub struct SellNft { pub list_price: Coin, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] #[serde(rename_all = "snake_case")] pub enum QueryMsg { GetCount {}, GetFee {}, /// With Enumerable...
Rust
0
64 x 64 # WCT feature, transmatrix = matrix(all_time_feature_points, cF, sF) feature_d, transmatrix_d = matrix(all_time_feature_points, cF_d, sF) feature_s, transmatrix_s = matrix(all_time_feature_points, cF_s, sF) # 将风格迁移后的特征解码回原始rgb空间 transfer = dec(feature) # 1 x 3...
Python
1
], "Ern" => &[ "Earnest" ], "Fall" => &[ "Eliphalet" ], "Fan" => &[ "Estefania" ], "Fann" => &[ "Frances" ], "Ferb" => &[ "Pharaba" ], "Finn" => &[ "Phineas" ], "Floss" => &[ "Florence" ], "Gats" => &[ "Augustus" ], "Gatsb" => &[ "Augustus" ], "Gatt" => &[ "Gertrude" ], "Gen...
Rust
0
def introTutorial(V, arr): # Write your code here return arr.index(V) if __name__ == '__main__': V = int(input().strip()) arr = list(map(int, input().rstrip().split())) result = introTutorial(V, arr) print(result)
Python
1
let val = unsafe { self.get_unchecked(i, j).abs() }; if val > the_max { the_max = val; the_ij = (i, j); } } } the_ij } } impl<N, R: Dim, C: Dim, S: Storage<N, R, C>> Matrix<N, R, C, S> where ...
Rust
0
"{}\n\ Hit moles: {}", time_text, self.n_hit_moles ); let drawable_text = graphics::Text::new((text, self.font, 24.0)); graphics::draw( ctx, &drawable_text, DrawParam::new() .dest(Point2::new(4.0, 4.0)) ...
Rust
0
[subscribe_suspend](subscribe_suspend) module"] pub type SUBSCRIBE_SUSPEND = crate::Reg<u32, _SUBSCRIBE_SUSPEND>; #[allow(missing_docs)] #[doc(hidden)] pub struct _SUBSCRIBE_SUSPEND; #[doc = "`read()` method returns [subscribe_suspend::R](subscribe_suspend::R) reader structure"] impl crate::Readable for SUBSCRIBE_SUSP...
Rust
0
Vec<&'a str> { contents .lines() .filter(|line| line.contains(query)) .collect() } pub fn search_case_insensitive<'a>(query: &str, contents: &'a str) -> Vec<&'a str> { let query = &query.to_ascii_lowercase(); contents .lines() .filter(|line| line.to_ascii_lowercase(...
Rust
0
# -*- coding: utf-8 -*- # <(6O9)> import os from gtts import gTTS import threading from pydub import AudioSegment # Cần cài đặt: pip install pydub import time import math # LƯU Ý: pydub yêu cầu ffmpeg để xử lý file MP3. # Bạn cần tải và cài đặt ffmpeg, sau đó thêm nó vào PATH của hệ thống. # Hướng dẫn có thể tìm th...
Python
1
84392b061085349d73 203a4a13e96f5432ec0fd4a1ee65accd d5e3904df54c1da510b0ff20dcc0c77f cb2c0e0eb605cb0504db87632cf3d8b4 dae6e705769d1de354270123cb11450e fc60ac47683d7b8d0f811365565fd98c 4c8eb936bcab8d069fc33bd801b03ade a2e1fbc5aa463d08ca19896d2bf59a07 1b851e6c239052172f296bfb5e724047 90a2181014f3b94a4e97d1...
Rust
0
/// A logging level for the compiler. #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd)] #[repr(u64)] pub enum WeldLogLevel { Off = 0, Error, Warn, Info, Debug, Trace, } impl fmt::Display for WeldLogLevel { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}...
Rust
0
Vec<Token> = lexer.collect(); let mut iter = lexer.cycle(); iter.peek(); assert_eq!(iter.nth(Token::Zero), Some(&Token::Zero)); let mut iter = lexer.cycle(); iter.next(); assert_eq!(iter.peek(), None); assert_eq!(iter.nth(Token::Zero), None); } */ ...
Rust
0
tx_bear_cuirass.dds", 0x5051_470B, 0x86CE_4703), (r"icons\a\tx_bear_shield.dds", 0x5051_470B, 0xA9A2_40E5), (r"icons\a\tx_bear2_helmet.dds", 0x5051_470B, 0xCDD8_4DED), (r"icons\a\tx_bear2_boot.dds", 0x5051_476E, 0x1D79_7BCD), (r"icons\a\tx_bear_boot.dds", 0x5051_476E, 0xAEBC_C2CF), (r"icons\m\t...
Rust
0
→ ⊥", true), ("¬¬(((A → B) → A) → A)", true), ("(A ∨ (A → ⊥)) → ((A → ⊥) → ⊥) → A", true), ("(A ∨ ¬A) → ¬¬A → A", true), ("(A ∧ B) ∨ C → (A ∨ C) ∧ (B ∨ C)", true), ("(A ∨ C) ∧ (B ∨ C) → (A ∧ B) ∨ C", true), ]; #[test] fn test_provability() { for &(prop_str, provable_expect) in PROPS { ...
Rust
0
tocheckenc); debug!("with sign {:?}", sign); debug!("with key {:?}", self.get_pkey().0); let mut digest = Hasher::new(Self::HASH_SIGN); digest.write_all(tocheckenc).is_ok() // TODO proper errror?? && self.get_pkey().1.verify_with_hash(&digest.finish()[..], sign, Self::HASH_SIGN) } fn ossl_key_c...
Rust
0
JdYALbfs0cHffT-tE-gYB_k4N0idGOQ' genai.configure(api_key=api_key2) generation_config_analyzer = { "temperature": 1, "top_p": 0.95, "top_k": 64, "max_output_tokens": 8192, "response_mime_type": "text/plain", } model_analyzer = genai.GenerativeModel( model_name="gemini-1.5-pro", generation_c...
Python
1
#!/usr/bin/env python3 """ diskover community edition (ce) https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com Copyright 2017-2024 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ All othe...
Python
1
Returns: r, s as primary and dual residuals. """ elements = self._state.x0 - self._state.z - self._state.y primal_residual: float = cast(float, np.linalg.norm(elements)) if iteration > 0: elements_dual = self._state.z - self._state.z_saved[iteration - 1] ...
Python
1
import cv2 import dlib import numpy as np # Load face detector from dlib detector = dlib.get_frontal_face_detector() # Load the pre-trained face landmark predictor predictor_path = "shape_predictor_68_face_landmarks.dat" # Download from http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 predictor = dlib...
Python
1
oes not yet support"): cudf.date_range(start=s, end=e, freq=freqstr_unsupported) # We also check that these values are unsupported when using lowercase # characters. We exclude the value 3MS (every 3 month starts) because 3ms # is a valid frequency for every 3 milliseconds. if freqstr_unsupport...
Python
1
than [AStar], /// because of the extra functionality. /// 3. Access shortest path using `get_***` methods: /// [get_direction_at_point](#func-get_direction_at_point), /// [get_cost_at_point](#func-get_cost_at_point), ... /// /// # Notes /// - The [add_square_grid](#func-add_square_grid) and /// [add_hexagonal_grid](#f...
Rust
0
try: print(x) except NameError: print("variable x is not defined") except: print(" something went wrong")
Python
1
for n in 0..N_PRODUCERS { tokio::spawn(do_producer(tx.clone(), n)); } drop(tx); let mut results = HashSet::new(); while let Some(val) = { println!("receiving..."); rx.recv().await } { println!("received {}!", val); results.insert(val); } let resu...
Rust
0
* inv_det; self.matrix[3] = self.matrix[0] * inv_det; self.matrix[4] = (self.matrix[2] * self.matrix[5] - self.matrix[3] * self.matrix[4]) * inv_det; self.matrix[5] = (self.matrix[1] * self.matrix[4] - self.matrix[0] * self.matrix[5]) * inv_det; self } pub fn is_identity(&self) ...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2019 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
proportion { return None; } Some(bounds) } <filename>memflow-ffi/src/mem/phys_mem.rs use memflow::mem::phys_mem::*; use memflow::types::PhysicalAddress; use crate::util::*; use std::slice::{from_raw_parts, from_raw_parts_mut}; use log::trace; pub type CloneablePhysicalMemoryObj = &'static mut dyn C...
Rust
0
w=b''): raise pnn6ee88hy7 from r4p9xzkrk0x import t1ysvyttlzd xsxb2umvx3b = f7hrwel8fih '# strain_batteries_message -> battery_recipient_pole' None '# strain_batteries_message -> battery_recipient_pole' pass '# strain_batteries_message -> battery_recipient_pole' nonlocal g2zgbiq8xue ...
Python
1
b_config is not None: dynamic_config["jupyterhub"] = jupyterhub_config async with self.mutex: self.dynamic_config = traefik_utils.deep_merge( self.dynamic_config, dynamic_config ) self._persist_dynamic_config() async def _delete_dynamic_config...
Python
1
eap) } } impl FromAscObj<AscString> for String { fn from_asc_obj<H: AscHeap>(asc_string: AscString, _: &H) -> Self { let mut string = String::from_utf16(&asc_string.content).expect("asc string was not UTF-16"); // Strip null characters since they are not accepted by Postgres. ...
Rust
0
PRange::new(index.idx, pr.end)) } } /// Examine the elements `range` in order from higher towards lower /// While the closure returns `true`, continue scan and include the scanned /// element in the range. #[inline] pub fn scan_pointer_range_rev<'b, F, P>(&'b self, range: PRange<'id, T,...
Rust
0
') szcam.Add(label, (1, 0), (1, 1), wx.ALIGN_CENTER_VERTICAL) szcam.Add(self.sensitivity, (1, 1), (1, 1), wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT) label = wx.StaticText(self, -1, 'counts/e') szcam.Add(label, (1, 2), (1, 1), wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT) ...
Python
1
# -*- coding: utf-8 -*- from __future__ import print_function import sys sys.path.append(r"../..") from lxml import etree from PyQt5.QtWidgets import QPlainTextEdit from pymdwizard.gui import Descriptor def test_descriptor_from_xml(qtbot): widget = Descriptor.Descriptor() qtbot.addWidget(widget) tes...
Python
1
ehicle_Gunner_Kill_Share_Mosquito_HIVE_XP_Target = 1066, Vehicle_Gunner_Kill_Share_Prowler_HIVE_XP_Target = 1067, Vehicle_Gunner_Kill_Share_Reaver_HIVE_XP_Target = 1068, Vehicle_Gunner_Kill_Share_Scythe_HIVE_XP_Target = 1069, Vehicle_Gunner_Kill_Share_Sunderer_HIVE_XP_Target = 1070, Vehicle_Gunner_K...
Rust
0
env.lock().unwrap().remove(k); } Ok(()) } pub fn temp_dir() -> PathBuf { panic!("no filesystem in SGX") } pub fn home_dir() -> Option<PathBuf> { None } pub fn exit(code: i32) -> ! { super::abi::exit_with_code(code as _) } pub fn getpid() -> u32 { panic!("no pids in SGX") } <reponame>Ma...
Rust
0
fi::g_mime_autocrypt_header_get_type(), } } impl AutocryptHeader { #[doc(alias = "g_mime_autocrypt_header_new")] pub fn new() -> AutocryptHeader { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::g_mime_autocrypt_header_new()) } } #[doc(alias = "g_mime_autocrypt_head...
Rust
0
$( $member_name: $crate::fidl_new_empty!($member_ty), )* } } fn decode(&mut self, decoder: &mut $crate::encoding::Decoder) -> $crate::Result<()> { decoder.recurse(|decoder| { let mut...
Rust
0
uaternion(e2g_r).rotation_matrix velocity_global = np.array([*velocity_global[:2], 0.0]) velocity_lidar = velocity_global @ np.linalg.inv(e2g_r_mat).T @ np.linalg.inv( l2e_r_mat).T velocity_lidar = velocity_lidar[:2] dataset['infos'][id]['velo'] = veloci...
Python
1
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional from typing_extensions import Literal from ..._models import BaseModel from .response_input_message_content_list import ResponseInputMessageContentList __all__ = ["ResponseInputMessageItem"] class Resp...
Python
1
import gradio as gr from langchain_community.chat_message_histories import ChatMessageHistory from langchain_core.runnables.history import RunnableWithMessageHistory from langchain_ollama import ChatOllama from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder from langchain_openai import ChatOpenAI...
Python
1
n no stream is captured on Python <3.7 # (we always capture stdin, so this is already False by default on <3.7) kwargs["close_fds"] = False else: # Create a new session. # This makes it easier to interrupt the kernel, # because we want to interrupt the whole process group. ...
Python
1
const NONE = bgfx_sys::BGFX_RESOLVE_NONE as _; /// Auto-generate mip maps on resolve. const AUTO_GEN_MIPS = bgfx_sys::BGFX_RESOLVE_AUTO_GEN_MIPS as _; } } bitflags! { pub struct PciIdFlags : u16 { /// Autoselect adapter. const NONE = bgfx_sys::BGFX_PCI_ID_NONE as _; ...
Rust
0
string with highest score /// calculated as weighted sum of letter frequencies of english alphabet. /// Letters [a-z] and space [' '] are included in the calculated frequency score. /// TODO this is not a utility; move this to the challenge (3, 4) specific code instead pub fn single_char_xor(ss: &[&str]) -> Option<(u8...
Rust
0