text
string
label_name
string
labels
int64
x, y = self.node_positions.get(node, (0, 0)) self.canvas.create_oval(x - 20, y - 20, x + 20, y + 20, fill="orange", outline="black") self.canvas.create_text(x, y, text=str(node.value), font=("Arial", 12, "bold")) self.window.update() time.sleep(0.5) ...
Python
1
t(input("Enter QA record ID to delete: ")) delete_qa_record(qa_id) elif choice == '4': manage_quality_issues() elif choice == '5': resolve_quality_issue() elif choice == '6': log_quality_checks() elif choice == '7': display_reco...
Python
1
_responder.join().expect("join"); t_window.join().expect("join"); Blocktree::destroy(&blocktree_path).expect("Expected successful database destruction"); let _ignored = remove_dir_all(&blocktree_path); } fn make_test_window( packet_receiver: Receiver<Packets>, exit: Arc<...
Rust
0
mut dyn (::std::any::Any) { self as &mut dyn (::std::any::Any) } fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { Self::descriptor_static() } fn new(...
Rust
0
tion::rotate(&mut matrix); assert_eq!(matrix, result); } #[test] fn test_0048_example_4() { let mut matrix = vec![vec![1, 2], vec![3, 4]]; let result = vec![vec![3, 1], vec![4, 2]]; Solution::rotate(&mut matrix); assert_eq!(matrix, result); } } <gh_stars>0 use...
Rust
0
lexivity && m_outer[outer_idx].different_to_all(m_inner) && m_inner[inner_idx].different_to_all(m_outer)) || (!global_reflexivity && m_outer[outer_idx].different_to(&m_inner[inner_...
Rust
0
qv(qv).unwrap() } pub fn d(&self) -> NullOr<&String>{ let qv = citem::get_immutable_str(self.ptr, "d").unwrap(); NullOr::from_qv(qv).unwrap() } pub fn run(&self) -> CListConst<RunCItem>{ CListConst::new(citem::get_cil(self.ptr, "run").unwrap(), self) } } #[derive(Debug, PartialEq, Clone, Copy)] pub struct ...
Rust
0
ffi::safe::lua_pushrclosure(state, userdata_destructor::<T>, 0)?; ffi::safe::lua_rawsetfield(state, -2, "__gc")?; ffi::lua_pushboolean(state, 0); ffi::safe::lua_rawsetfield(state, -2, "__metatable")?; if let Some(f) = customize_fn { f(state)?; } ffi::safe::lua_rawsetp(state, ffi::LU...
Rust
0
class Solution: def findCheapestPrice(self, n: int, flights: List[List[int]], src: int, dst: int, k: int) -> int: graph = [[] for _ in range(n)] minHeap = [(0, src, k + 1)] # (d, u, stops) dist = [[math.inf] * (k + 2) for _ in range(n)] for u, v, w in flights: graph[u].append((v, w)) whil...
Python
1
/// disabled interrupts for the concrete core is dropped. #[inline(always)] #[link_section = ".iram1.interrupt_csg_drop"] fn drop(&mut self) { #[cfg(any(esp32c3, esp32s2))] unsafe { vPortExitCritical() }; #[cfg(not(any(esp32c3, esp32s2)))] unsafe { ...
Rust
0
import rospy from std_msgs.msg import Float64MultiArray from sensor_msgs.msg import JointState import copy def main(): rospy.init_node('shadow_moveit_demo') joint_pub = rospy.Publisher('joint_states', JointState, queue_size=10) while not rospy.is_shutdown(): joints_msg = rospy.wait_for_message("/t...
Python
1
-literal.rs // compile-flags: -Z parse-only -Z continue-parse-after-error fn main() { 0b121; //~ ERROR invalid digit for a base 2 literal 0b10_10301; //~ ERROR invalid digit for a base 2 literal 0b30; //~ ERROR invalid digit for a base 2 literal 0b41; //~ ERROR invalid digit for a base 2 literal 0b...
Rust
0
]; // please note we force each `ptrace::write` to be exactly ptrace_poke (8 bytes a time) // instead of using `process_vm_writev`, because this function can be called in // PTRACE_EXEC_EVENT, the process seems not fully loaded by ld-linux.so // call process_vm_{readv, writev} would 100% fail. for ...
Rust
0
'], ['e', 'i', ' ', ' '], ['a', 'o', ' ', ' '], ['o', 'u', ' ', ' '], ['a', 'n', ' ', ' '], ['e', 'n', ' ', ' '], ['a', 'n', 'g', ' '], ['e', 'n', 'g', ' '], ['o', 'n', 'g', ' '], ]; // ["i", "ia", "ie", "iao", "iou", "ian", "in", "iang", "ing", "iong"] pub const RHYME_TABLE_COLUMN_I : [[char; 4]; 10] = [...
Rust
0
, 0, 0, 0), command_names::WATCH => (-2, fr | NOSCRIPT, 1, -1, 1), command_names::UNWATCH => (1, fr | NOSCRIPT, 0, 0, 0), command_names::CLUSTER => (-2, ADMIN | READONLY, 0, 0, 0), command_names::RESTORE => (-4, wm, 1, 1, 1), command_names::RESTORE_ASKING => (-4, wm | ASKING, 1, ...
Rust
0
# coding: utf-8 """ codebeamer swagger API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 3.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # no...
Python
1
Tag, Other, } #[derive(Copy, Clone, Debug, PartialEq, Eq)] enum Minor { This(u8), Next1([u8; 1]), Next2([u8; 2]), Next4([u8; 4]), Next8([u8; 8]), More, } impl AsRef<[u8]> for Minor { #[inline] fn as_ref(&self) -> &[u8] { match self { Self::More => &[], ...
Rust
0
hoices[0].delta.content} # 添加助手响应到历史 return Message( role="assistant", content={ "content":full_response, "reasoning":reasoning, "elapsed":reasoning_elapsed } ) if __name__ == "__main__": ...
Python
1
holder engagement") return summary def _define_engagement_next_steps(self, feedback_analysis: Dict[str, Any]) -> List[Dict[str, Any]]: """Define next steps for stakeholder engagement""" next_steps = [] # Address low engagement low_engagement_gr...
Python
1
let cipher = vec_u8_from_hex_string(&input[2]); let mut res: Vec<u8> = Vec::with_capacity(in1.len()); for (i, &c) in cipher.iter().enumerate() { res.push(c ^ in1[i] ^ in2[i]); } println!("{:?}\n{:?}\n{:?}\n{:?}", in1, in2, cipher, hex_string_from_vec(&res)); } use crate::bulma::ImageRati...
Rust
0
us: 0; position: relative; top: 3px; cursor: pointer; }} div[role=radiogroup] label p {{ font-weight: 500; }} div[role=radiogroup] label:nth-child({selected}) {{ border-bottom: 3px solid {cor}; }} div[role=radiog...
Python
1
from django.db import transaction from rest_framework.serializers import ValidationError from .db_service import get_my_reading_lists, delete_reading_list_book_instance, rotate_reading_list_order_by_deducting, \ does_book_belongs_to_reading_list, rotate_reading_list_order_by_adding from common.base_db_service impor...
Python
1
def expand_range(number_range_str: str) -> tuple[int, ...]: """Expand ranges like 2-5,8,22-45.""" numbers: list[int] = [] for number_range in number_range_str.split(","): start_stop = number_range.split("-") if len(start_stop) == 2: start = int(start_stop[0]) stop = i...
Python
1
] fn test_get_zone_offset() { // winter time in Warsaw, offset = +01:00 assert_eq!(Some(SECONDS_IN_HOUR), get_zone_offset("Europe/Warsaw", (2020, 10, 29), (9, 12, 3, 0))); // summer time in Warsaw, offset = +02:00 assert_eq!(Some(2 * SECONDS_IN_HOUR), get_zone_offset("Europe/Warsaw", (2020, 6, 21), (1...
Rust
0
ed features: `\"Win32_Networking_Clustering\"`*"] pub const CLUS_RESTYPE_NAME_DFS: &str = "Distributed File System"; #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] pub const CLUS_RESTYPE_NAME_DFSR: &str = "DFS Replicated Folder"; #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] pub c...
Rust
0
from ultralytics import YOLO if __name__ == '__main__': model = YOLO('yolov8.yaml') # build from YAML and transfer weights # Train the model results = model.train(data='coco.yaml', epochs=300, imgsz=640, batch=8,) # # Load a model # model = YOLO('F:/yolov8/ultralytics/runs/detect/train32/weight...
Python
1
#!/usr/bin/env python """ Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/) See the file 'LICENSE' for copying permission """ from lib.core.data import logger from plugins.generic.enumeration import Enumeration as GenericEnumeration class Enumeration(GenericEnumeration): def getBanner(self): ...
Python
1
gs.parameter_xml, "rb") bytes = f.read() desc['parameter_xml_size'] = len(bytes) desc['parameter_xml'] = base64.b64encode(zlib.compress(bytes,9)).decode('utf-8') desc['mav_autopilot'] = 12 # 12 = MAV_AUTOPILOT_PX4 if args.airframe_xml != None: f = open(args.airframe_xml, "rb") bytes = f.read() desc['airframe_xml...
Python
1
if let ChildNumber::Normal { index } = path[0] { path_found = Some(index) } } Some(path) if xpub.wildcard == Wildcard::None && path.is_empty() => { path_found = Some(0) ...
Rust
0
Some(ImefCallback::Drop) => { break; // this exits the loop and kills the thread } None => (), } } }<reponame>robert-chiniquy/rust-aws-iam use crate::model::{ConditionValue, QString}; use crate::offline::request::Environment; use crate::offline::EvaluationError...
Rust
0
from typing import Optional from pydantic import BaseModel, Field from sqlalchemy import Column, Integer, String, Boolean, DateTime, func from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class CompanyTable(Base): __tablename__ = "company" id = Column(Integer, primary_key=Tru...
Python
1
import datetime import math import multiprocessing def do_map(start=0, num=10): # print(f'start: {start}----- ---- num: {num}') postion = start random_number = 1000 * 1000 mean = 0 while postion < num: postion += 1 result = math.sqrt((postion - random_number) ** 2) mean ...
Python
1
by Syn. Verbatim(Literal), } } ast_struct! { /// A UTF-8 string literal: `"foo"`. pub struct LitStr { repr: Box<LitRepr>, } } ast_struct! { /// A byte string literal: `b"foo"`. pub struct LitByteStr { repr: Box<LitRepr>, } } ast_struct! { /// A byte literal: `...
Rust
0
import json import logging import boto3 from list_tasks import list_tasks from error_handler import error_handler # DynamoDBテーブルの初期化 dynamodb = boto3.resource('dynamodb') table = dynamodb.Table('TasksTable') # ロガーの設定 logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) def lambda_handler(event, contex...
Python
1
failed"); assert_eq!(SyncPayload::GetHeaders, msg.payload_type()); info!("Send malformed message to node0 twice"); net.send( NetworkProtocol::SYNC.into(), peer_id, vec![0, 0, 0, 0].into(), ); sleep(3); net.send( NetworkProt...
Rust
0
nt(tm[2] * 1000000000 % 1000000000), )) pyFmt += "%s" i += 2 continue elif c1 == "p": funcs.append(lambda cell, calType, tm: _( "AM" if tm[0] < 12 else "PM", )) pyFmt += "%s" i += 2 continue elif c1 == "P": funcs.append(lambda cell, calType, tm: _( "AM" if tm[0] <...
Python
1
any chosen size by using the split_window opcode. # Styles Sets the text style to: Roman (if 0), Reverse Video (if 1), Bold (if 2), Italic (4), Fixed Pitch (8). In some interpreters (though this is not required) a combination of styles is possible (such as reverse video and bold). In these, changing to Roman should t...
Rust
0
utc).isoformat(), "direction": "inbound", "channel_id": channel.id, "channel_name": channel.name, "author_id": message.author.id, "author_name": message.author.display_name, "src_lang": src, "to_lang": PREFER...
Python
1
with_types: bool, } /// Generates a label for a graphviz graph. #[derive(Debug)] enum DotLabel<'a> { /// Plain label SingleRow(&'a str), /// A single-column table that has a row for each string in the array. MultiRow(&'a [String]), } /// Generates a string that escapes characters that would problem...
Rust
0
_COMMAND, fullTest: TPMI_YES_NO, rspAuthsArray: *mut TSS2L_SYS_AUTH_RESPONSE, ) -> TSS2_RC; } extern "C" { pub fn Tss2_Sys_IncrementalSelfTest_Prepare( sysContext: *mut TSS2_SYS_CONTEXT, toTest: *const TPML_ALG, ) -> TSS2_RC; } extern "C" { pub fn Tss2_Sys_IncrementalSelf...
Rust
0
/// that resembles a linked list. /// /// To pack a tree, use the pack method. /// /// ![extend_unpacked illustration](https://ipfs.io/ipfs/QmaEDTjHSdCKyGQ3cFMCf73kE67NvffLA5agquLW5qSEVn/extend_unpacked.jpg) pub fn extend_unpacked<I, V>(&self, tree: &mut StreamBuilder<T, V>, from: I) -> Result<()...
Rust
0
Labels for supervised model" g = open(args.output_supervised,'w') for cnt, (x,y) in enumerate(zip(test_chunks,list_max)): print "Top "+args.num_sup_labels+" labels for topic "+str(cnt)+" are:" g.write( "Top "+args.num_sup_labels+" labels for topic "+str(cnt)+" are:" +"\n") for i2 in y: ...
Python
1
from scapy.all import rdpcap, IP, TCP, Raw, DNS, DNSQR PCAP_FILE = "sample-http-dns.pcap" packets = rdpcap(PCAP_FILE) dns_queries = [] http_requests = [] for pkt in packets: # DNS Query if pkt.haslayer(DNS) and pkt.haslayer(DNSQR): try: query = pkt[DNSQR].qname.decode() dns_qu...
Python
1
`], likely mutating its state. fn cycle(&mut self); } <filename>spectrum-audio/src/config.rs<gh_stars>1-10 use std::io::Read; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use serde_yaml; pub trait ValidatedConfig { fn validate(&self) -> Result<(), String>; } #[derive(Copy, Clone, Deb...
Rust
0
flags.push(flag); if flag & NEXT_FLAG == 0 { next_flag = false } k = i; } Ok((k, flags)) } fn parse_abstract_message<'a>(i: &'a [u8], amf3: &mut AMF3Decoder) -> AMFResult<'a, Vec<Element>> { let (i, flags) = parse_abstract_message_flags(i)?; let mut elements = Vec:...
Rust
0
ceived and our settings. Parity, /// Triggered when the received character didn't have a valid stop bit. Framing, } #[cfg(feature = "eh1_0_alpha")] impl eh1_0_alpha::serial::Error for ReadErrorType { fn kind(&self) -> eh1_0_alpha::serial::ErrorKind { match self { ReadErrorType::Ove...
Rust
0
Icon::CalendarEventFill => '\u{f1d5}', Icon::CalendarFill => '\u{f1d7}', Icon::CalendarMinus => '\u{f1d9}', Icon::CalendarMinusFill => '\u{f1d8}', Icon::CalendarMonth => '\u{f1db}', Icon::CalendarMonthFill => '\u{f1da}', Icon::CalendarPlus => '\u{f1dd}', ...
Rust
0
tcher::sources::{read_sources_file, Sources}; use std::{collections::HashMap, net::SocketAddr, path::Path}; use tracing_subscriber::prelude::*; use tracing_subscriber::{fmt, EnvFilter}; static SERVICE_NAME: &str = "kubewarden-policy-server"; lazy_static! { static ref VERSION_AND_BUILTINS: String = { let b...
Rust
0
''' Bài 1: Sử dụng cây nhị phân tìm kiếm để giải bài toán (thống kê) số lượng ký tự có trong văn bản (không dấu) 1. Xây dựng cây cho biết nỗi ký tự có trong văn bản xuất hiện mấy lần 2. Nhập vào 1 ký tự. Kiểm tra ký tự đó xuất hiện bao nhiêu lần trong văn bản ''' import os class Node: def __init__(self,key): ...
Python
1
import zipfile import shutil import os from modules.configs.MyConfig import config import subprocess from pathlib import Path import nicegui import time import pponnxcr import platform import requests import tarfile def package_download_adb(platformstr = None): target_adb_path = os.path.join(os.getcwd(), "too...
Python
1
from datasets import load_dataset from trl import GRPOTrainer, GRPOConfig from transformers import AutoModelForCausalLM, AutoTokenizer import os dataset = load_dataset("trl-lib/tldr", split="train") def reward_func(completions, **kwargs): # Dummy reward function that rewards completions with more unique letters. ...
Python
1
.fee_receiver = fee_receiver_keypair.pubkey(); assert_eq!( TestReserve::init( "sol".to_owned(), &mut banks_client, &lending_market, &all_null_oracles, RESERVE_AMOUNT, config, spl_token::native_mint::id(), sol_us...
Rust
0
R = (); }; } /// Internal macro. Do not use. #[macro_export] #[doc(hidden)] macro_rules! _implement_register_field { // Read without 'as' convert (@R, $register_bit_order:ty, $(#[$field_doc:meta])* $field_name:ident: $field_type:ty $(:$field_bit_order:ident)? = RO $field_bit_range:expr) => { $(#[$...
Rust
0
#!/data/venv/hdp-env/bin python # -*- coding: utf8 -*- ''' @Author: xiangfu shi @Contact: xfu_shi@163.com @Time: 2019/12/22 9:20 PM ''' import tensorflow as tf from model_brain import BaseModel class xDeepFM(BaseModel): ''' DeepFM model model feature 中 wide配置直接使用正常wide and deep 方式配置 deep配置只能配置embedd...
Python
1
ameters(self) -> List[Dict[str, Any]]: """PaddleOCRの調整可能パラメータ""" return [ { "name": "lang", "label": "認識言語", "type": "select", "default": "japan", "options": [ {"value": "japan", "label": "日本語...
Python
1
Borrowed(_)))); assert!(result .languages_c2s .iter() .all(|s| matches!(s, Cow::Borrowed(_)))); assert!(result .languages_s2c .iter() .all(|s| matches!(s, Cow::Borrowed(_)))); } #[test] fn example_channel_open_packet() { const SSH_MSG_CHANNEL_OPEN: u8 = 90; ...
Rust
0
-aware interventions: 4") print(f"\n{self.ui.colors['bold']}Key Insights:{self.ui.colors['reset']}") print(f" 🔍 Browser history reveals true pattern context") print(f" 📧 Gmail is the #1 time sink (21k visits!)") print(f" 💻 Heavy localhost usage confirms productive coding")...
Python
1
ict={H_out_true: y_train_data[j], L: in_L, is_train: True}) total_train_loss = total_train_loss + train_loss # print('this single train cost: {:.7f}'.format(train_loss)) print("train cost :" + str(i) + " " + str(j) + " finished.") for j in range(x_valid_data.shape[0]): ...
Python
1
# LICENSE HEADER MANAGED BY add-license-header # # Copyright 2024-2025 Syntropix # # 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 ...
Python
1
handle(&response_rx); unsafe { resh.add(); } loop { let id = sel.wait(); if id == reqh.id() { match reqh.recv() { Ok(Request::SendMessage(msg)) => match msg.as_str_vec().as_slice() { ["!d"] => return state.quit(false), ...
Rust
0
ALID_FAX_FILE: "Invalid fax file", ERROR_FAX_FILE_NOT_FOUND: "Fax file not found", ERROR_INTERNAL : 'Unknown internal error', } class Error(Exception): def __init__(self, opt=ERROR_INTERNAL): self.opt = opt self.msg = ERROR_STRINGS.get(opt, ERROR_STRI...
Python
1
AddList` together specify files that are to be packed into /// `PackedFile`. Each string in `AddList` is zero-delimited (ends in zero), and the `AddList` string ends with an extra zero /// byte, i.e. there are two zero bytes at the end of `AddList`. /// /// `Flags` can contain a combination of the following values refl...
Rust
0
ptr(), enc, C, LM, 1i32, max_decay, lfe, ) } if 0 == intra { let intra_buf: *mut c_uchar; let mut enc_intra_state: ec_enc; let tell_intra: opus_int32; let nstart_bytes: opus_uint32; let nintra_bytes: opus_uint32; let mut save_bytes: opus_uint32; let badness2: c_int; tell_intra = ec...
Rust
0
path, bg); let mut path = Path::new(); path.circle(x + (pos * w).floor(), cy, kr - 0.5); canvas.stroke_path(&mut path, Paint::color(Color::rgba(0, 0, 0, 92))); canvas.restore(); } fn draw_thumbnails<T: Renderer>(canvas: &mut Canvas<T>, x: f32, y: f32, w: f32, h: f32, images: &[ImageId], t: f32) { ...
Rust
0
j = int(input()) a = int(input()) jerseys = ['']*j for i in range(j): jeans = input() jerseys[i] += str(jeans) cnt = 0 for s in range(a): order = input().split() if order[0] == 'S' and jerseys[int(order[1]) - 1] != '*': cnt += 1 jerseys[int(order[1]) - 1] = '*' elif order[0] == 'M...
Python
1
R { type Target = crate::FieldReader<bool, LEDPOL_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `LEDPOL` writer - LED output pin polarity."] pub struct LEDPOL_W<'a> { w: &'a mut W, } impl<'a> LEDPOL_W<'a> { #[doc = r"Writes `variant` to the field"] ...
Rust
0
# This script takes csvs produced by parse_logs.py and combines them # into a single CSV file import ast import csv import sys from collections import defaultdict assert len(sys.argv) == 3 RESULTS = defaultdict(dict) for side, f in zip(["static", "dynamic"], sys.argv[1:]): with open(f) as f: reader = c...
Python
1
) -> Self { /// use ::ensogl_core::application::command::*; /// let source = FrpOutputsSource::new(network); /// let mut status_map: HashMap<String, frp::Sampler<bool>> = default(); /// let mut command_map: HashMap<String, Command> = default(); /// frp::extend...
Rust
0
16usize, concat!( "Offset of field: ", stringify!(__va_list_tag), "::", stringify!(reg_save_area) ) ); } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum GuiControlState { GUI_STATE_NORMAL = 0, GUI_STATE_FOCUSED = 1, ...
Rust
0
4, 3, 4, 0, 0, 0, 0, 9, 8, 5, 8, 11, 11, 11, 11, 5, 2, 5, 2, 1, 1, 1, 1, 0, 6, 5, 6, 10, 10, 10, 10, 5, 4, 3, 4, 0, 0, 0, 0, 9, 8, 5, 8, 11, 11, 11, 11, 5, 2, 5, 2, 1, 1, 1, 1, 5, 6, 5, 6, 10, 10, 10, 10, 5, 4, 3, 4, 0, 0, 0, 0, 9, 8, 5, 8, 11, 11, 11, 11, 5, 2, 5, 2, 1, 1, 1, 1, 5, 6, 5, 6, 10, 10, 10, 10, 5, 4,...
Rust
0
# Copyright 2016 Google Inc. 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 applicable law or ...
Python
1
proxy for field `UDE`"] pub struct UDE_W<'a> { w: &'a mut W, } impl<'a> UDE_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { ...
Rust
0
Some(protocol) = protocol { let protocol_value = match protocol { OptionValue::String(s) => { s.to_string() } _ => { // TODO: return error here "".to_string() } }; ...
Rust
0
), &mut internal_walls, rng, ); let mut grid = grid.clone(); for wall in internal_walls { wall.draw(&mut grid); } grid } <reponame>tomasvdw/bitcrust<gh_stars>10-100 //! Transaction parsing and verification //! //! use std::fmt; use std::time::{Instant,Duration}; use itertoo...
Rust
0
npUint8ImageData = self._percentileStretch(npImageData, dblPercentile) npUint8ImageData = np.stack((npUint8ImageData,) * 3, axis=-1) return ProcessedImageData(strImgName, npUint8ImageData, objImageData.tupleOriginalShape, "converted", objI...
Python
1
_bounds(); if let Some(p) = pb { if p.len() != 4 { error!("Expected four values for \"pixelbounds\" parameter. Got {}.", np); } else { let b = Bounds2i::from_points( &Point2i::new(p[0], p[2]), &Point2i::new(p[1], p[3])); pbounds = ...
Rust
0
dWorkflowOptionsBase.validateAndSanitizeOptions(self,options) if options.excludedRegions is not None : for excludeIndex in range(len(options.excludedRegions)) : options.excludedRegions[excludeIndex] = \ checkFixTabixIndexedFileOption(options.excludedRegions[exclu...
Python
1
2.9059, -3.9017]]], dtype=config.param_dtype, device=activation_device, ) elif case_key == "case3": logits_ref = torch.tensor( [[[-5.7833e+00, -4.1559e+00, -7.2531e-01, -1.2458e+00, 5.3105e+00, -1.1368e+00, 2.0874e+00, 3.9418e-01, -3.1351e+00, -1.59...
Python
1
5SP75nU$)Nr)r*rrr+c>[UTTTS9$)NrFrGr)bufrGrErFs rUr0Jregister_onednn_fusion_ops.<locals>.linear_unary.<locals>.epilogue_creator8w) rlTnoner.r/r0r)rr input_...
Python
1
# -*- coding: utf-8 -*- ''' FanFilm Add-on Copyright (C) 2015 lambda 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 3 of the License, or (at your option) any ...
Python
1
from bl3hotfixmod import Mod mod=Mod('god_bear.bl3hotfix', 'God Bear', 'SSpyR', [ 'Adjusts Auto Bear to feel more like Scorpio Turret, etc.', 'Also buffing general Iron Bear stuff.', 'God.' ], lic=Mod.CC_BY_SA_40, cats='cheat, joke' ) mod.comment('Increasing Iron Bear Damage') mod.table_hotfix(Mod.PATCH...
Python
1
""" Database models for the Tasks module. """ import enum from sqlalchemy import Boolean, Column, DateTime, String, CheckConstraint, UniqueConstraint from sqlalchemy import Enum as SAEnum from sqlalchemy.orm import relationship from app._infra.db_base import Base, CustomBaseTaskMixin from app.modules.tasks.constants ...
Python
1
9-1DD2-11B2-99A6-080020736631", OperatingSystem::Solaris), /// Solaris Alternate Sector (SOLARIS_ALT, "6A9283A5-1DD2-11B2-99A6-080020736631", OperatingSystem::Solaris), /// Solaris Reserved (SOLARIS_RESERVED1, "6A945A3B-1DD2-11B2-99A6-080020736631", OperatingSystem::Solaris), /// Solaris Reserved ...
Rust
0
, "bit_and", 42, 10), case(2, "add_from_sto", 5, 7), case(2, "add_from_mem", 5, 7) )] fn aug_assign(target: usize, op: &str, value: usize, expected: usize) { with_executor(&|mut executor| { let harness = deploy_contract(&mut executor, "aug_assign.fe", "Foo", &[]); harness.test_function( ...
Rust
0
g_schema = super().get_config_schema() config_schema["config"] = { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { cls.META_KEYS_STR: { "type": "array", "items": { ...
Python
1
.ok_or(io::ErrorKind::InvalidData)? .try_into() .unwrap(); let uncompressed_size = u32::from_le_bytes(*uncompressed_size_bytes) as usize; decompressed.reserve(uncompressed_size); unsafe { decompressed.set_len(uncompressed_size); } let bytes_written = decompress_into(&compress...
Rust
0
FILE.is_present() { read_config_from_file(proto::CONFIG_FILE.flag)? } else { proto::Config { log: Some(log::proto::Config::default()), pwgen: Some(pwgen::proto::Config::default()), ..Default::default() } }; if proto::DEBUG.is_present() && proto::D...
Rust
0
# chart = (left_chart | middle_chart | right_chart) if vii == 0 else chart & (left_chart | middle_chart | right_chart) charts.append(copy.deepcopy([left_chart, middle_chart])) charts = np.array(charts) for ii in range(2): for vii,chts in enumerate(charts): chartnow = chts[ii] if v...
Python
1
:List(list) } // Major type 5: a map of pairs of data items 0xa0..=0xbb => { let len = read_len(r, major - 0xa0)?; #[cfg(feature = "unleashed")] if len > 0 { let pos = r.seek(SeekFrom::Current(0))?; ...
Rust
0
ed", type=int, default=1, help="Whether to distribution shifts towards more skewed. 1 = yes, 0 = no (default: 1)", ) args = parser.parse_args() for k, v in args.__dict__.items(): if isinstance(v, str) and ("{dbname}" in v or "{table}" in v): args.__dict__[k] = v...
Python
1
ders_need runtime: %s seconds/ecc" % np.around(((time.time() - start_soltime)/len(e2)),6)) #compare with the array method diff = np.zeros(len(e2), dtype=int) for ie2, e2c in enumerate(e2): diff[ie2] = N_orders_needed['joint'][0,ie2] - len(Newtonian_orders_needed(e2c, pmax, tols[0])) print('Difference in methods:', n...
Python
1
for logical names narrator_voice = TTSVoice(voice="narrator") assert narrator_voice.voice == "nova" # Maps to nova expert_voice = TTSVoice(voice="expert") assert expert_voice.voice == "echo" # Maps to echo # Test fallback behavior for unrecognized voices unrecognized...
Python
1
alleles[0][0] } else { break; }; let mut left_padded = true; for al in alleles.iter() { if al[0] != '<' as u8 && al[0] != '*' as u8 && (al.len() < 2 || al[0] != left_nuc) { left_padded = false; break; } ...
Rust
0
urn word id for each subword token (annotate by joiner).""" flags = [0] * len(subwords) for i, tok in enumerate(subwords): if tok.endswith(marker): flags[i] = 1 if tok.startswith(marker): assert i >= 1 and flags[i-1] != 1, \ "Sentence `{}` not correct!".fo...
Python
1
NetworkSpecifier$Builder", java.flags == PUBLIC, .name == "setPort", .descriptor == "(I)Landroid/net/wifi/aware/WifiAwareNetworkSpecifier$Builder;" unsafe { let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0)]; let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);...
Rust
0
maximin) { Ordering::Less => maximin, _ => minimax, }) } (Err(_), Ok(maximin)) => Ok(maximin), (Ok(minimax), Err(_)) => Ok(minimax), (Err(e), Err(f)) => Err(ElectionError::BothFailed(e, f)...
Rust
0
x<HashLevel<K, V, B>>>, *mut HashLevel<K, V, B>, )> { tmp_guard.protect(&self.0, atomic::Ordering::SeqCst); if is_entry(tmp_guard.raw() as *const u8) { None } else { let ptr = to_actual_ptr(tmp_guard.raw() as *const u8) as *const (); let ptr = ptr ...
Rust
0
file structure. Returns: True if key was deleted, False if no key existed """ deleted = False if self.config_file.exists(): try: with open(self.config_file) as f: config_data = json.load(f) # Remove only the ...
Python
1
se_tools::client_exists; use crate::rita_exit::database::database_tools::delete_client; use crate::rita_exit::database::database_tools::get_client; use crate::rita_exit::database::database_tools::get_next_client_ip; use crate::rita_exit::database::database_tools::set_client_timestamp; use crate::rita_exit::database::da...
Rust
0
1, -1), Size::new(4, 4)) ); } #[test] fn dimensions() { let image: Bmp<Rgb565> = Bmp::from_slice(include_bytes!("./chessboard-4px-color-16bit.bmp")).unwrap(); let image = Image::new(&image, Point::zero()).translate(Point::new(100, 200)); assert_eq!( image.bounding_box(), Rectan...
Rust
0