text
string
label_name
string
labels
int64
enum ShapeCastCollisionType { /// The shapes were already penetrating each-other at the shapes `start_position` /// /// Collision normals and points cannot be accurately calculated AlreadyPenetrating, /// The cast shape collided with another along its path Collided(ShapeCastCollisionInfo), } /...
Rust
0
/// Whether to compile to bytecode (false) or to print out the IR (true). #[structopt(long)] pub print_ir: bool, /// If set, outputs a binary file representing the script bytes. #[structopt(short = "o")] pub binary_outfile: Option<String>, /// Silent mode. Don't output any warnings or erro...
Rust
0
from win32api import * from win32gui import * import win32con import time import random hwnd = GetDesktopWindow() hdc2 = GetWindowDC(hwnd) x = GetSystemMetrics(0) y = GetSystemMetrics(1) x2 = GetSystemMetrics(0) import math import time desktop = GetDesktopWindow() left, top, right,bottom = GetWindowRect(desktop) def ...
Python
1
if let Some(docker) = docker { let logs = docker.get_logs(&d.deployment_id, d.last_log_time).await; d.update_log_time(); if !logs.is_empty() { let publisher = node.broker.as_ref().unwrap().get_channel().await; ...
Rust
0
type = 1; #[doc = "!< Select shown atoms and terms."] pub const clingo_show_type_clingo_show_type_shown: clingo_show_type = 2; #[doc = "!< Select all atoms."] pub const clingo_show_type_clingo_show_type_atoms: clingo_show_type = 4; #[doc = "!< Select all terms."] pub const clingo_show_type_clingo_show_type_terms: cling...
Rust
0
Token_t, return_: *mut c_ulong) -> Exception; /// Return the text that this token represents. /// /// \note The returned pointer value is not valid after this TfToken /// object has been destroyed. pub fn pxrInternal_v0_20__pxrReserved____TfToken_GetText(this_: *const pxr_TfToken_t, return_: *mut *const c_char) -> Ex...
Rust
0
# Copyright 2018-2025 # Institute of Neuroscience and Medicine (INM-1), Forschungszentrum Jülich GmbH # 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/LICE...
Python
1
omplete"); } assert_eq!(*block_on(mu.lock()), 1); } #[test] fn cancel_after_notify_one() { async fn dec(mu: Arc<Mutex<usize>>, cv: Arc<Condvar>) { let mut count = mu.lock().await; while *count == 0 { count = cv.wait(count).await; ...
Rust
0
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import sys from airbyte_cdk.entrypoint import launch from source_square import SourceSquare def run(): source = SourceSquare() launch(source, sys.argv[1:])
Python
1
print(f"✅ Frame {frame_number} saved to {out_img_dir}") return outpath # === Main Processing === # Read simulation summary (e.g., N.Logical Processes) for colors. summary = read_sim_summary(summary_file) n_lp = summary.get("N.Logical Processes", 4) colors = generate_colors(n_lp) # Get list of simulation st...
Python
1
from django.shortcuts import render from rest_framework import viewsets from .models import * from .serializer import * from .permissions import IsAdminOrReadOnly # Create your views here. class RNViewset(viewsets.ModelViewSet): queryset = RegionNaturelle.objects.all() serializer_class = RegionNaturelleSeriali...
Python
1
outputs to evaluate against which labels with which metric function. Metric ops should support streaming, e.g., returning `update_op` and `value` tensors. For example, see the options defined in `../../../metrics/python/ops/metrics_ops.py`. name: Name of the evaluation if user need...
Python
1
from gpiozero import LED from time import sleep def setup(): PIN_MAPPING = { 'red': [2, 17, 0, 16], 'yellow': [3, 27, 5, 20], 'green': [4, 22, 6, 21] } global leds leds = {color: [LED(pin) for pin in pins] for color, pins in PIN_MAPPING.items()} for led in leds['red']: ...
Python
1
Unencoded { data: &'tl [u8] }, } #[allow(unused)] #[derive(Debug, Copy, Clone, TlRead)] #[tl(boxed)] pub enum Message<'tl> { #[tl(id = 0x0fac8416)] Answer { query_id: HashRef<'tl>, answer: &'tl [u8], }, #[tl(id = 0x60dd1d69, size_hint = 68)] ConfirmChannel { key: HashRe...
Rust
0
odal integration (Vision + LLM) 2. Real-time processing capability 3. Scalable data pipeline 4. Modular architecture 5. Production-ready design ## 🎯 Target Applications - Players: Real-time feedback - Coaches: Game analysis - Broadcasters: Automated insights - Analytics: Strategic patterns ## 🚀 Future Extensions 1....
Python
1
#!/usr/bin/env python # coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. 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/L...
Python
1
ummary(meeting_topic, len(meeting_history)) for char in backup_summary: yield char await asyncio.sleep(0.01) return # 处理流式响应 lo...
Python
1
except (IndexError, TypeError, KeyError) as detail: # if we are in fails, the ok, otherwise raise it if fails is not None: if isinstance(detail, fails): return raise if typs is None: typs = self._typs ...
Python
1
# -*- coding: utf-8 -*- # Created on 2018-08-15 # author: 欧度智能,https://www.odooai.cn # email: 300883@qq.com # resource of odooai # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # Odoo16在线用户手册(长期更新) # https://www.odooai.cn/documentation/16.0/zh_CN/index.html # Odoo16在线开发者手册(长期更新) # https://www.odooai....
Python
1
ath(DUMMY_SP, vec![Ident::from_str("Self"), common_marshall_name(original_fn)]); path.segments.last_mut().unwrap().parameters = Some(P(ast::PathParameters::AngleBracketed( ast::AngleBracketedParameterData { span: DUMMY_SP, lifetimes: V...
Rust
0
None => Ok(None), Some(MessageQueue::Amqp) => { let connection_string = self .amqp_connection_string .as_ref() .ok_or(MissingConfigError("AMQP connection string"))?; let consumer_tag = self ...
Rust
0
unwrap(); let payment_address = payments::create_payment_address(wallet_handle, PAYMENT_METHOD_NAME, EMPTY_OBJECT).unwrap(); assert!(payment_address.starts_with("pay:null:")); wallet::close_wallet(wallet_handle).unwrap(); test_utils::tear_down(); } } mo...
Rust
0
].refrence_point_y_internal = (pd + internal_y) as u32; } self.current_state = GpuState::HDraw; self.cycles_to_next_state = HDRAW_CYCLES; } else { for i in 0..2 { self.bg_a...
Rust
0
w_item_adgroup_creative_add_bind( self, creative_bind_list, adgroup_id ): """ 信息流新增并且绑定创意 文档地址:https://open-doc.dingtalk.com/docs/api.htm?apiId=43332 :param creative_bind_list: 新增绑定的创意,一次最多2个 :param adgroup_id: 单元id """ ret...
Python
1
WsReply<F> { ws: Ws2, on_upgrade: F, } impl<F, U> Reply for WsReply<F> where F: FnOnce(WebSocket) -> U + Send + 'static, U: Future<Item = (), Error = ()> + Send + 'static, { fn into_response(self) -> Response { let on_upgrade = self.on_upgrade; let config = self.ws.config; ...
Rust
0
_TILE_DEBUG: aom_dec_control_id = 276; #[doc = "Codec control function to enable the row based multi-threading of"] #[doc = " decoding, unsigned int parameter"] #[doc = ""] #[doc = " - 0 = disabled"] #[doc = " - 1 = enabled (default)"] pub const AV1D_SET_ROW_MT: aom_dec_control_id = 277; #[doc = "Codec control function...
Rust
0
ionRecordAccount>(program_id, delegation_record_info)?; msg!("YY"); if &scope_delegation_data.delegator_token_origin_record != token_origin_record_info.key { return Err(GovernanceError::InvalidTokenOwnerRecordAccountAddress.into()); } if &scope_delegation_data.delegatee_token_owner_record ...
Rust
0
| (x as f64, y.incidence_calculated * incidence_scale)) .collect::<Vec<_>>(); let ( cases_increase, deaths_increase, hospitalizations_increase, recoveries_increase, current_incidence, ) = data_points .last() .map(|d| { ( ...
Rust
0
"type": "string", "title": "Name"}, "age": IsDict( { "anyOf": [{"type": "integer"}, {"type": "null"}], "title": "Age", } ) ...
Python
1
""" Minimal working example to use an X-SLED model """ import torch from transformers import AutoTokenizer, AutoModel, AutoModelForSeq2SeqLM # noinspection PyUnresolvedReferences import sled # *** required so that SledModels will be registered for the AutoClasses *** if __name__ == '__main__': # Load the mode...
Python
1
(-1, 512 * 512) # pred_score_test = torch.squeeze(pred_score, dim=1) # ignored_map_test = torch.squeeze(ignored_map, dim=1) # classify_loss = F.cross_entropy((pred_score_test * (1 - ignored_map_test)).view(-1, 512 * 512), gt_score_test.long()) # classify_loss = FocalLoss(gt_score, pred_s...
Python
1
(KurinjiPlugin::default()) .add_startup_system(setup.system()) .add_system(action_system.system()) .run(); } fn setup(mut kurinji: ResMut<Kurinji>) { kurinji // PLAYER 1 .bind_gamepad_button_pressed_for_player( 0, GamepadButtonType::Select, ...
Rust
0
unwrap().copy() } pub fn assign_probability_of_cut(&self, di_vector: &mut DiVector, point: &[f32]) { di_vector.assign_as_probability_of_cut(self.current_box.as_ref().unwrap(), point) } pub fn assign_probability_of_cut_shadow_box(&self, di_vector: &mut DiVector, point: &[f32]) { assert!(s...
Rust
0
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from frappe.model.document import Document class QuotationLostReason(Document): # begin: auto-generated types # This code is auto-generated. Do not modify anything in this block. from t...
Python
1
R_W { w: self } } } // Copyright 2019 The Tari Project // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the // following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and t...
Rust
0
- `f64.convert_i64_u` fn interpret_instr( &self, outputs: &[Option<Value>], mut frame: ActivationFrame, ) -> Result<InterpretationFlow, InterpretationError> { let return_value = extract_single_output_or_skip!(outputs); let source = frame.read_register(self.src()); ...
Rust
0
/// Reflects the `reply_to_message_id` parameter. pub const fn in_reply_to(mut self, id: message::Id) -> Self { self.reply_to_message_id = Some(id); self } /// Configures whether this message should be sent even /// if the replied-to message is not found. /// Reflects the `allo...
Rust
0
height: 0, stride: 0, format: 0, flags: 0, } } } extern "C" { /** * Given a java bitmap object, fill out the {@link AndroidBitmapInfo} struct for it. * If the call fails, the info parameter will be ignored. */ #[allow(non_snake_case)] ...
Rust
0
ts of memory copying. //! //! # Known problems //! //! This renderer still suffers from small audible clicks in very fast moving sounds, clicks sounds more like //! "buzzing" - it is due the fact that hrtf is different from frame to frame which gives "bumps" in amplitude //! of signal because of phase shift each impuls...
Rust
0
metrics.log_scalar(k, v) return if not any('ntokens' in log for log in logging_outputs): warnings.warn('ntokens not found in Criterion logging outputs, cannot log wpb or wps') else: ntokens = sum(log.get('ntokens', 0) for log in logging_outputs) metrics...
Python
1
rules, 4, "ab"), vec![2]); assert_eq!(try_match(&rules, 5, "bab"), vec![3]); assert_eq!(try_match(&rules, 6, "aaab"), vec![4]); assert_eq!(try_match(&rules, 5, "babbbb"), vec![3]); assert_eq!(try_match(&rules, 5, "aabbbb"), vec![]); assert_eq!(try_match(&rules, 6, "aaa"), vec![]...
Rust
0
mode. The gray4 mode has black and white swapped (for now). fn invert_display(&mut self); } /// Display for a 200x200 panel pub struct Display1in54 { #[cfg(not(feature="alloc"))] buffer:([u8;(WIDTH*HEIGHT)/8],[u8;(WIDTH*HEIGHT)/8]), #[cfg(feature="alloc")] buffer:(Vec<u8>,Vec<u8>), rotation: D...
Rust
0
rn if self.mode=='w': fake_message_writer( self.messages, self.fd ) self.fd.close() self.closed = True def read_messages(self): for topic,value in self.messages: t = 0.0 yield (topic,value,t) class Bunch(object): pass def _get_sensor_msgs():...
Python
1
#!/usr/bin/python3 # Author: Farhana Alam from sys import stdin import re current_word = None word = None current_doc = None doc_count_dict = {} # dictionary to keep all document-count info #doclist = '' for line in stdin: #remove leading and trailing whitespace (including newlines) line = line.strip() #s...
Python
1
Self { variant as u8 != 0 } } #[doc = "Field `ERSAREQ` reader - Erase All Request"] pub struct ERSAREQ_R(crate::FieldReader<bool, ERSAREQ_A>); impl ERSAREQ_R { #[inline(always)] pub(crate) fn new(bits: bool) -> Self { ERSAREQ_R(crate::FieldReader::new(bits)) } #[doc = r"Get enumerat...
Rust
0
match DeviceT::new(name) { Err(e) => { return Err(e); } Ok(d) => Ok(Launchpad { device: d, }) } } } impl Lightable for Launchpad { fn clear(&mut self) -> Err { self.device.write(0xB0, 0, 0) } fn led_on(&mut self, x: u8, y: u8, v: u8) -> Err { if x > 7 { return Err("x too large fo...
Rust
0
ut = step.transform_table(data) all_expr.append(output) if check_backend(backend, all_expr): res["support"].append(step_dict["step_params"]) else: res["not_support"].append(step_dict["step_params"]) if not res["not_sup...
Python
1
R_vec.len() <= params.share_count); assert!( secret_shares_vec.len() > params.threshold && secret_shares_vec.len() <= params.share_count ); assert!( vss_scheme_vec.len() > params.threshold && vss_scheme_vec.len() <= params.share_count ); ...
Rust
0
Event::StandardControllerRelease(0, StandardControllerButton::DPadRight))}, Keycode::Equals | Keycode::KpPlus | Keycode::Plus => {application_events.push(events::Event::GameIncreaseScale);}, Keycode::KpMinus | Keycode::Minus => {application_events.push(events::Event::GameDec...
Rust
0
# Copyright 2023 ⓒ Kakao Brain Corp. # # 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
., "Arial", /// "Arial Narrow", "Arial Black"). Win32FamilyNames, /// Indicates the string containing a GDI-compatible subfamily name. Win32SubfamilyNames, /// [no description of this tag is provided] TypographicFamilyNames, /// [no description of this tag is provided] TypographicSubf...
Rust
0
import tkinter as tk from time import strftime def time(): string = strftime('%H:%M:%S %p') label.config(text=string) label.after(1000, time) root = tk.Tk() root.title("Digital Clock") label = tk.Label(root, font=("Arial", 50), background="black", foreground="cyan") label.pack(anchor='center') time() ro...
Python
1
@var array<int, string> */ protected $fillable = [ 'count', ]; /** * The attributes that should be cast. * * @var array<string, string> */ protected $casts = [ 'count' => 'integer', ]; /** * The table associated with the model. * * @var ...
Python
1
_void, } } pub fn as_str(&self) -> Result<&str, Utf8Error> { str::from_utf8(self.0.as_slice()) } } #[derive(Debug)] pub enum HTTPErrorCode { Undefined, StreamReset, ConnectionFailure, BufferLimitExceeded, RequestTimeout, } impl HTTPErrorCode { fn from_envoy_error_c...
Rust
0
3)? } else if how.bit(CMD) { ctx.engine.cmd.length() } else { 0 }; proc_slice(ctx, 0, 0, |slice, _| Ok(StackItem::Cell(slice.reference(n)?.clone()))) }) .err() } // (slice - cell) pub fn execute_pldref(engine: &mut Engine) -> Failure { pldref(engine, ...
Rust
0
, "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"]; #[rustfmt::skip] pub const BYTE_CATEGORY: &[ByteCategory; 256] = &[ ByteCategory::AsciiControl, ByteCategory::AsciiControl, ByteCategory::AsciiControl, ByteCategory::AsciiC...
Rust
0
one()), rounded: false, start: Time::get(ClockId::Monotonic), })) } /// Return the list of names of services this app wants to provide fn outgoing_services_names(&self) -> Vec<&'static str> { [EchoMarker::NAME].to_vec() } /// Handle a request to connect to a...
Rust
0
from datetime import datetime from sqlalchemy import Column, ForeignKey, Integer, Numeric from sqlalchemy.ext.associationproxy import association_proxy from sqlalchemy.orm import relationship from dispatch.database.core import Base from dispatch.incident_cost_type.models import IncidentCostTypeRead from dispatch.mode...
Python
1
Reversed blue color', 'blue', attrs=['reverse']) cprint('Concealed Magenta color', 'magenta', attrs=['concealed']) cprint('Bold underline reverse cyan color', 'cyan', attrs=['bold', 'underline', 'reverse']) cprint('Dark blink concealed white color', 'white', attrs=['dark', 'blink', '...
Python
1
test setup"); result.unwrap(); } async fn setup() -> Result<TestContext> { let client = cd::Client::new("http://localhost:36462", None) .await .context("Failed to create client")?; let projects = client .list_projects() .await .context("Failed to list projects")?; ...
Rust
0
#[serde(rename( serialize = "{http://xmlgw.companieshouse.gov.uk}PostTown", deserialize = "{http://www.govtalk.gov.uk/CM/envelope}PostTown" ))] pub post_town: String, #[serde(rename( serialize = "{http://xmlgw.companieshouse.gov.uk}County", deserialize = "{http://www.govtalk....
Rust
0
t(out_c.values())[0] == len(in_c.keys()) s = len(list(count.values())[0]) i = len(in_c.keys()) o = len(out_c.keys()) # assert i <= o, (i, o, s, irrep, self._input_size, self._output_size) # if i > o: # print("Warning: using delta orthogonal initializ...
Python
1
) -> Element { let document = window().unwrap_throw().document().unwrap_throw(); let tr = document.create_element("tr").unwrap_throw(); let td1 = td("col-md-1"); tr.append_child(&td1).unwrap_throw(); let td2 = td("col-md-4"); tr.append_child(&td2).unwrap_throw(); let a2 = document.create_el...
Rust
0
()); } } /// Geographical location of the end user or device. #[derive(Debug, Clone, Deserialize, PartialEq, ProcessAnnotatedValue, Serialize)] pub struct Geo { /// Two-letter country code (ISO 3166-1 alpha-2). #[serde(default, skip_serializing_if = "utils::is_none")] #[process_annotated_value(pii_kind...
Rust
0
let mut card = get_test_card(); card.call_num(14); card.call_num(10); card.call_num(2); card.call_num(22); card.call_num(18); card.call_num(18); card.call_num(9); assert!(card.is_winner()); assert_eq!(card.score(), 250); } } //! Assorted fun...
Rust
0
""" 格式:直接cid为自带的index位;aid放不下了,通过字典来查,反正就5w个 """ import os import logging logger = logging.getLogger(__name__) import faiss import numpy as np # ###########如果是原始特征要先写save inp_root = r"E:\codes\py39\dataset\mi\2-co256" npys = [] for name in sorted(list(os.listdir(inp_root))): phone = np.load("%s/%s" % (inp_root,...
Python
1
""" Analysis Orchestrator (S-Class): 디지털 시스템 지휘자 - [S-Class] 적응형 파이프라인 관리 (성능에 따른 동적 우선순위 조정) - [S-Class] 장애 허용 시스템 (Fault Tolerance) - 부분적 실패 시에도 지속 동작 - [S-Class] 실시간 성능 모니터링 및 자동 최적화 - [S-Class] 예측적 리소스 관리 (다음 프레임 처리 요구사항 예측) """ import asyncio import time from typing import Dict, Any, Optional, List, Tuple from da...
Python
1
fn as_u32_arrays(&self) -> (&[u8], &[[u32; 4]], &[u8]) { unsafe { self.align_to::<[u32; 4]>() } } fn as_u32s(&self) -> (&[u8], &[u32], &[u8]) { unsafe { self.align_to::<u32>() } } } // Copyright 2021 The Nakama Authors // // Licensed under the Apache License, Version 2.0 (the "License...
Rust
0
G-4') stop ('G-4', pause=True) play ('G-4') stop ('G-4', pause=True) play ('G-4') stop ('G-4', pause=True) play ('G-4') stop ('G-4', pause=True) play ('G-4') stop ('G-4', pause=True) play ('G-4') stop ('G-4', pause=True) play ('B-4') stop ('B-4', pause=True) play ('C#5') stop ('C#5', pause=True) play ('D-5') stop ('D-5...
Python
1
import pytest from summarization import summarize_text, create_gists # Mock the pipeline to return a summary without actually calling the model class MockSummarizer: def __call__(self, text, max_length=None, min_length=None, do_sample=None): # Mock behavior: return the first half of the input text as "summ...
Python
1
is a great language for building RAG systems. LangChain is a popular framework for RAG. Vector databases store document embeddings for similarity search. """ sample_path = rag.doc_folder / "sample_rag_info.txt" with open(sample_path, 'w') as f: f.write(sample_content) print(...
Python
1
ma //! | Whitespace //! | StringToken //! | RealDecimal //! | True //! | False //! | Null //! | Eof //! }; //! } //! //! grammar! { JsonToken; //! pub struct Kvp => { key: StringToken, Colon, value: Value }; //! pub struct List => { LBracket, vals: [(V...
Rust
0
TXN_IN_PROGRESS: HRESULT = 0x8032000E; pub const FWP_E_TXN_ABORTED: HRESULT = 0x8032000F; pub const FWP_E_SESSION_ABORTED: HRESULT = 0x80320010; pub const FWP_E_INCOMPATIBLE_TXN: HRESULT = 0x80320011; pub const FWP_E_TIMEOUT: HRESULT = 0x80320012; pub const FWP_E_NET_EVENTS_DISABLED: HRESULT = 0x80320013; pub const FWP...
Rust
0
[ "git", "filter-repo", "--commit-callback", filter_repo_commit_callback_script, "--force" # Use --force if the repo has already been filtered (e.g. by filter-branch) ] # Prepare environment for subprocess env = os.environ.copy() print(f"Running git filter-repo in {clone_dir} to adjust commit timestamps....
Python
1
et_avatars(users) for user in users: name = user['display_name'] avatar = user['avatar'] user_id = user['user_id'] team_name = user['metadata'].get('team_name') user_dict = {"name": name, "id": user_id, ...
Python
1
value.get().expect("Return Value for property `full-mode` getter") } } #[cfg(any(feature = "v0_1_8", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_8")))] #[doc(alias = "ice-tcp")] pub fn is_ice_tcp(&self) -> bool { unsafe { let mut value = g...
Rust
0
x = 1 if True: x = 2 else: pass print(x)
Python
1
c = &mut arr[bits_c.arr_pos()]; let num_c = u16::from_ne_bytes(c.try_into().unwrap()); // 11111111_11111111 // 1_11111111 // 1_11111111 assert_eq!((num_c & (u16::MAX >> (16 - 9) << 6)) >> 6, C); // println!("{:08b} {:08b} {:08b} {:08b}", // (u8::MAX >> (8 - 3) << 1), //...
Rust
0
from flask_sqlalchemy import SQLAlchemy from datetime import datetime from sqlalchemy import Enum import enum # Creates an instance to manipulate the database db = SQLAlchemy() # Creates an enumerated class for the three states class NoteState(enum.Enum): ACTIVE = 1 ARCHIVED = 2 BINNED = 3 # Creates an e...
Python
1
_ in 0..epoch/batch_size { let mut inputs = data_stream.next(); inputs.extend(parameters.iter().cloned()); let storage = subgraph.execute(inputs).expect("Could not execute validation"); let err_vec = storage.get(&prediction_loss.value_id()).unwrap(); err += err_vec.scalar_sum(); } println!("Validat...
Rust
0
h} not exist") return PDCErrorCode.CommandFail generate_checksum_args = [self._pdc_agent_bin, "-mode", "command", "-type", "checkSum", "-path", f"{path}"] error_code = PDCErrorCode.Success try: logger.info(f"begin to check_sum path: {path}") res, error_code = ...
Python
1
inline_mode::message_content::InputMessageContent, primitive::{Float, Integer}, reply_markup::InlineKeyboardMarkup, }; use serde::Serialize; /// Venue /// /// By default, the venue will be sent by the user /// Alternatively, you can use input_message_content /// to send a message with the specified content ins...
Rust
0
span.enter(); let tc = new_sled_test_context(); let db = &tc.db; let tree = SledTree::open(db, tc.tree_name, true)?; let k = 100; tree.txn(false, |txn_tree| { // sub tree key space let nodes_ks = txn_tree.key_space::<Nodes>(); let _got = nodes_ks.insert(&k, &Node { ...
Rust
0
Result<()> { let args = Parser::new(args).parse()?; if let Some(ref path) = args.log_file { logger::init(path)?; log::debug!("Logger initialized!"); } if args.help { print_and_flush(stdout, HELP)?; log::debug!("Show help and exit"); return Ok(()); } if arg...
Rust
0
write!(f, "perf_event_attr__bindgen_ty_1 {{ union }}") } } #[test] fn bindgen_test_layout_perf_event_attr() { assert_eq!( ::std::mem::size_of::<perf_event_attr>(), 12usize, concat!("Size of: ", stringify!(perf_event_attr)) ); assert_eq!( ::std::mem::align_of::<perf_event_...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """\ Anagrams christoph dürr - jill-jênn vie - 2013-2019 """ # snip{ # pylint: disable=anomalous-backslash-in-string def anagrams(S): # S is a set of strings """group a set of words into anagrams :param S: set of strings :returns: list of l...
Python
1
dpg.add_text('Output') super().__init__( node_id, _id, _staging_container_id, [self.in_attr], [self.out_attr]) self.dist.activate(self.in_attr) def change_dist(self): dpg.delete_item(self.dist.plot) t...
Python
1
stack_name = generated_name(); let input = ApplyStackInput::new(&stack_name, TemplateSource::inline(NON_EMPTY_TEMPLATE)) .set_parameters([Parameter { key: "CidrBlock".to_string(), value: "10.0.0.0/28".to_string(), }]); let stack = client.apply_stack(input).await?; l...
Rust
0
.platform == 'linux', reason="Can't test GUI on Linux") @pytest.mark.integration def test_on_show_axon_metrics_warns_user_slow_very_large_image(self,make_napari_viewer): try: # Create a large synthetic int image (e.g., 5001,5000) large_image = np.random.randint(0, 256, size=(5001...
Python
1
e_op() def concat(operand0: TensorType, operand1: TensorType, *, axis: int = 0) -> TensorType: """Concatenate ciphertext tensors along specified axis. Args: operand0: The first ciphertext operand to concatenate operand1: The second ciphertext operand to concatenate axis: Axis along whic...
Python
1
/// validate_threshold returns an error if the threshold is invalid /// (we require 0-1) pub fn validate_threshold(threshold: Decimal) -> StdResult<()> { if threshold > Decimal::one() { Err(StdError::generic_err("threshold must be 0 to 1")) } else { Ok(()) } }...
Rust
0
tors": { "--with-origin": None, "default": {"foo": {"bla": {"bar"}}}, "delete": None, }, } ) assert complete("", n) == {"aggregate", "ancestors"} # nested assert complete("anc", n) == {"ancestors"} assert complete("ancestors ", n) ...
Python
1
import time import random """ Nadeem Elsayed Game is called one row nim This program plays this game smartly Game Rules: there are around 21 sticks in a cup there are two players who take turns taking out one, two, or three sticks the last person to take a stick out loses """ #variable declarations nsticks = 21 playe...
Python
1
''' Created on ٢٩‏/٠٤‏/٢٠١٠ @Created by: Muhammad Altabba ''' from ..Lexicon.RootAndPatterns.Root import *; from ..Lexicon.RootAndPatterns.UnvoweledPattern import *; from ..Lexicon.RootAndPatterns.VoweledPattern import *; from ..Lexicon.RootAndPatterns.VoweledNominalPattern import *; from ..Lexicon.RootAndPatterns.V...
Python
1
import json import logging from .plugin_base import PostprocessContext logger = logging.getLogger(__name__) def gen_key_file_from_log(tlsmon_log): key_file_content = "" for line in tlsmon_log: try: entry = json.loads(line) client_random = entry["client_random"] ma...
Python
1
move |mut factors| { if factors.len() == 0 { // closureのmove, borrowingまったくわかってない... val.clone() } else { let mut res = val.clone(); factors.reverse(); while let Some(f) = factors.p...
Rust
0
.current_dir(dir) .output() .expect("call to test build failed"); if !call.status.success() { println!("Status code: {:?}", call.status); println!("STDOUT: {}", String::from_utf8_lossy(&call.stdout)); println!("STDERR: {}", String::from_utf8_lossy(&call.stderr)); ...
Rust
0
# # SPDX-FileCopyrightText: Copyright (c) 1993-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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...
Python
1
# Copyright 2025 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
meta_keys else frozenset( meta_key for meta_key in storage.keys() if isinstance(meta_key, _DictMetaKeyTrait) ) for meta_key in selected_meta_keys: cast_mapping = t.cast(t.Mapping[t.Optional[str], t.Optional[str]], mapping) storage[meta_key] = defaultdict( lis...
Python
1