text
string
label_name
string
labels
int64
# Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': "Rental/Planning Bridge", 'summary': """This module Integrate Planning with Rental""", 'category': 'Sales/Sales', 'depends': ['sale_planning', 'sale_renting'], 'auto_install': True, 'data': [ 'views/plan...
Python
1
xpressions like `DATE_TRUNC('year', x) >= CAST('2021-01-01' AS DATE)`""" comparison = expression.__class__ if isinstance(expression, DATETRUNCS): this = expression.this trunc_type = extract_type(this) date = extract_date(this) #### Start of PyDough Change #### # If date ...
Python
1
array = [7,5,9,0,3,1,6,2,4,8] n = len(array) # def simple_quick_sort(arr): # if len(arr) <= 1: # return arr # pivot = arr[0] # tail = arr[1:] # left_side = [x for x in tail if x <= pivot] # right_side = [x for x in tail if x > pivot] # return simple_quick_sort(left_side) ...
Python
1
type=['txt', 'md', 'py', 'js', 'html', 'css', 'json']) agent_name = st.selectbox("Associated Agent (optional):", ["None"] + ["requirements_analyst", "architecture_designer", "code_generator", ...
Python
1
: _bindgen_ty_7 = _bindgen_ty_7::SDLK_MAIL; pub const SDLK_CALCULATOR: _bindgen_ty_7 = _bindgen_ty_7::SDLK_CALCULATOR; pub const SDLK_COMPUTER: _bindgen_ty_7 = _bindgen_ty_7::SDLK_COMPUTER; pub const SDLK_AC_SEARCH: _bindgen_ty_7 = _bindgen_ty_7::SDLK_AC_SEARCH; pub const SDLK_AC_HOME: _bindgen_ty_7 = _bindgen_ty_7::SD...
Rust
0
write_u64(buf: &mut [u8], value: u64) -> Result<usize, Error> { let mut w = Writer::new(buf); w.write_var_u64(value)?; Ok(w.pos()) } let mut buf = [0xffu8; 8]; // 0-7 bits assert_eq!(write_u64(&mut buf, 0b000000).unwrap(), 1); ...
Rust
0
# Copyright (C) 2017-2025 Pier Carlo Chiodi # # 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 later version. # # This program is distri...
Python
1
from Py4GWCoreLib import Botting, get_texture_for_model, ModelID #QUEST TO INCREASE SPAWNS https://wiki.guildwars.com/wiki/Lady_Mukei_Musagi BOT_NAME = "Gold_Crimson_Skull_farm" MODEL_ID_TO_FARM = ModelID.Gold_Crimson_Skull_Coin OUTPOST_TO_TRAVEL = 213 #zen daijun COORD_TO_EXIT_MAP = (19453, 14369) #zen daijun exit to...
Python
1
#!/usr/bin/env python3 # (c) https://t.me/TelethonChat/37677 and SpEcHiDe # # Licensed under the Raphielscape Public License, Version 1.d (the "License"); # you may not use this file except in compliance with the License. # from telethon.sessions import StringSession from telethon.sync import TelegramClient print( ...
Python
1
from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING if TYPE_CHECKING: from .conftest import MakeActorFunction, RunActorFunction async def test_actor_scrapy_title_spider( make_actor: MakeActorFunction, run_actor: RunActorFunction, ) -> None: base_path = Path('...
Python
1
ex::Regex; #[test] fn test_next_match() { let mut pager = Pager::new().unwrap(); let mut s_mark = 0; // A sample index for mocking actual search index matches pager.search_idx = vec![2, 10, 15, 17, 50]; for i in &pager.search_idx.clone() { next_match(&mut pag...
Rust
0
match *self { ExtensionValue::Atom(ref p) => p.valid_extension(), ExtensionValue::Composite(ref e) => e.valid_extension(), ExtensionValue::Extensions(_) => true } } } trait InternalToJson { fn _to_json(&self) -> Json; } impl InternalToJson for Element { fn _to_json(&self) -> Json { self.value.to_json...
Rust
0
math.vec4(0, 0, 0, 1), cov_scale=ti.math.vec3(1, 2, 3), translation=ti.math.vec3(0, 1, 1)) t = ti.math.mat4([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) p = ti.math.mat3([[2, 0, 0], [0, 2, 0], [0, 0, 1]]) uv, translation_camera = a[None].project_to_camera_position(t, p) d_u...
Python
1
import re import subprocess cellNumberRe = re.compile(r"^Cell\s+(?P<cellnumber>.+)\s+-\s+Address:\s(?P<mac>.+)$") regexps = [ re.compile(r"^ESSID:\"(?P<essid>.*)\"$"), re.compile(r"^Protocol:(?P<protocol>.+)$"), re.compile(r"^Mode:(?P<mode>.+)$"), re.compile(r"^Frequency:(?P<frequency>[\d.]+) (?P<frequ...
Python
1
def test_NewBobScheduler(): from speechbrain.nnet.schedulers import NewBobScheduler scheduler = NewBobScheduler(initial_value=0.8) prev_lr, next_lr = scheduler(1.0) assert prev_lr == 0.8 assert next_lr == 0.8 prev_lr, next_lr = scheduler(1.1) assert next_lr == 0.4 prev_lr, next_lr =...
Python
1
use std::mem::MaybeUninit; use std::net::SocketAddr; use std::ops::{Deref, DerefMut}; use std::time::Duration; /// Macro to implement `fmt::Debug` for a type, printing the constant names /// rather than a number. /// /// Note this is used in the `sys` module and thus must be defined before /// defining the modules. ma...
Rust
0
be, 0xef, 0xa0, 0xa1, 0xa5, 0x33, 0x9c, 0xc3, 0x95, 0xaa, 0x9f, ]; let mut rng = FuzzRng::new(&buf[..]); let mut dest = Vec::with_capacity(buf.len()); for chunk in buf.chunks(11) { dest.resize(chunk.len(), 0); rng.fill_bytes(&mut dest); assert_eq!(ch...
Rust
0
from_framework_not_found( moniker: &PartialAbsoluteMoniker, capability_id: impl Into<String>, ) -> Self { Self::CapabilityFromFrameworkNotFound { moniker: moniker.clone(), capability_id: capability_id.into(), } } pub fn capability_from_capability_not_...
Rust
0
from setuptools import setup, find_packages setup( name='hand_sign_detection', version='0.0.0', author='rohit', author_email='chakrabortyrohit181@gmail.com', packages=find_packages(), install_requires=[], )
Python
1
.expect("error reading MLME ScanEnd"); assert_eq!( scan_end, fidl_mlme::ScanEnd { txn_id: 1337, code: fidl_mlme::ScanResultCode::Success } ); } #[test] fn test_start_passive_scan_fails() { let exec = fasync::TestExecutor::new().expect("failed to create an ex...
Rust
0
def pattern_in(text, pattern): patterns = pattern.split(".") texts = text.split(".") for i in range(len(texts)): for j in range(len(patterns)): if patterns[j] == "*": continue elif "[" in patterns[j] and "]" in patterns[j]: tmp_pattern = patter...
Python
1
) def try_remove_legacy_submodule(): """Try remove annotators/hand_refiner_portable submodule dir.""" submodule = repo_root / "annotator" / "hand_refiner_portable" if os.path.exists(submodule): try: shutil.rmtree(submodule) except Exception as e: print(e) ...
Python
1
display("attempt to decode a non-data line into a side-channel band") } } } } /// A utility return type to support incremental parsing of packet lines. #[derive(Debug, Clone)] pub enum Stream<'a> { /// Indicate a single packet line was parsed completely Complete { ...
Rust
0
ility levels print("🔍 Testing compatibility levels...") # Get current compatibility level compat_level_response = requests.get(f"{dev_url}/config/{test_subject}-value", timeout=5) if compat_level_response.status_code == 200: level_data = compat_level_response.json() ...
Python
1
{ let pixels = [ Pixel(Point::new(0, 0), BinaryColor::On), Pixel(Point::new(1, 0), BinaryColor::Off), Pixel(Point::new(2, 0), BinaryColor::On), Pixel(Point::new(2, 1), BinaryColor::Off), ]; let mut display = MockDisplay::new(); pixels.ite...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 🔥 OpenTunnel Vmess Hunter - Hardcore Free Internet Script ⚡ Auto fetch subscription, decode vmess, generate QR, ready for Clash/Meta/V2rayNG 💀 Created by Dream Team - June 2025 """ import requests import base64 import json import qrcode import re import time import ...
Python
1
e!(f, "({} or {})", a, b), Expr::StartsWith(ref a, ref b) => write!(f, "({} ^= {})", a, b), Expr::EndsWith(ref a, ref b) => write!(f, "({} $= {})", a, b), Expr::Contains(ref a, ref b) => write!(f, "({} *= {})", a, b), Expr::Eq(ref a, ref b) => write!(f, "({} == {})", a, b...
Rust
0
me}/*/hls/*", f"arn:aws:s3:::{organization.bucket_name}/live/*", f"arn:aws:s3:::{organization.bucket_name}/*/thumbs/*", f"arn:aws:s3:::{organization.bucket_name}/*/audio/*", ], "Condition": {"StringEquals": {"AWS:SourceArn": f"{...
Python
1
]: https://docs.rs/semver/latest/semver/struct.VersionReq.html#method.parse #[cfg(feature = "rust")] #[proc_macro] pub fn rust_version(input: proc_macro::TokenStream) -> proc_macro::TokenStream { perform_check(input, rust::rust_version) } #[allow(dead_code)] fn perform_check<F, T>(input: proc_macro::TokenStream, f...
Rust
0
ERCACHESESSION_STOREVALUE_CACHEFULL, ShaderCacheSessionFindValueNotFound = D3D12_MESSAGE_ID_D3D12_MESSAGE_ID_SHADERCACHESESSION_FINDVALUE_NOTFOUND, ShaderCacheSessionCorrupt = D3D12_MESSAGE_ID_D3D12_MESSAGE_ID_SHADERCACHESESSION_CORRUPT, ShaderCacheSessionDisabled = D3D12_MESSAGE_ID_...
Rust
0
num = 1 #while num > 0: while num < 11: print(num) num+=1 # if num == 5: # break if num == 9: print("we're almost done")
Python
1
all_instance_list.append(instance) continue if split_video(input_file=video_path, start_time=start_time, end_time=end_time, output_file=save_path): instance = {} instance['label'] = clip['phase_label'] instance['label_description'] = label_desc...
Python
1
'name': '新兴区', 'level': 3, 'pinyin': None, 'prefix': None, 'weight': 0, 'is_hot': 0, }, { 'id': 1099, 'pid': 117, 'name': '茄子河区', 'level': 3, 'pinyin': None, 'p...
Python
1
AttributeArgs = parse_macro_input!(attr); let api_definition = match ParsedApiDefinition::parse(item_trait.clone(), &attrs) { Ok(parsed) => parsed, Err(e) => return e.write_errors().into(), }; let tokens = quote! { #item_trait #api_definition }; tokens.into() } use...
Rust
0
= list(di) di[1] += cos(phipos)*xdiff - sin(phipos)*ydiff di[2] += sin(phipos)*xdiff + cos(phipos)*ydiff newBox.d[i] = tuple(di) centerx += cos(phipos)*xdiff - sin(phipos)*ydiff centery += sin(phipos)*xdiff + cos(phipos)*ydiff ...
Python
1
mpl<'a> StateSummary<'a> { pub fn into_owned(self) -> Vec<u8> { self.0.into_owned() } } impl<'a> From<Vec<u8>> for StateSummary<'a> { fn from(state: Vec<u8>) -> Self { StateSummary(Cow::from(state)) } } impl<'a> From<&'a [u8]> for StateSummary<'a> { fn from(state: &'a [u8]) -> Self...
Rust
0
which must be cheaper than doing the equivalent /// operation with mismatches and gaps pub fn new(mismatch_cost: u8, gap_cost: u8, start_gap_cost: u8, transpose_cost: Option<u8>) -> Self { assert!(mismatch_cost > 0); assert!(gap_cost > 0); if let Some(cost) = transpose_cost { ...
Rust
0
} map.popover.hide(); } fn add_bookmark(app: &app::Handle, title: &str, uri: &str, tags: &[String]) { use gtk::prelude::*; let bookmarks = app.bookmarks(); let map = app.stored(); let map = map.bookmarks(); let id = bookmarks.add_bookmark(title, uri, tags); let title_escaped = text:...
Rust
0
import nextcord from nextcord import Interaction from nextcord.ext import commands import os from placeholders.apikeys import * intents = nextcord.Intents.default() intents.members = True client = commands.Bot(command_prefix= '!', intents=intents) @client.event async def on_ready(): print("Bot ready!") initial_e...
Python
1
intId> { self.pipes.get_mut(&eid).map_or(None, |pipe| { pipe.recv(ctx); Some(eid) }) } pub fn close_all(&mut self, ctx: &mut dyn Context) { for (_, pipe) in self.pipes.drain() { pipe.close(ctx); } } }use std::process::Command; use std::p...
Rust
0
nfig}, // Request, // }; // use tonic::codegen::futures_core::Stream; // use std::env; // async fn download() -> Result<(), Box<dyn std::error::Error>> { // let target = "https://github.com/twbs/bootstrap/archive/v4.0.0.zip"; // let response = reqwest::get(target).await?; // let path = Path::new("./...
Rust
0
64 = writer.prefix("RoleARN"); if let Some(var_65) = &input.role_arn { scope_64.string(var_65); } #[allow(unused_mut)] let mut scope_66 = writer.prefix("RollbackConfiguration"); if let Some(var_67) = &input.rollback_configuration { crate::query_ser::serialize_structure_crate_model_ro...
Rust
0
d + Sync + 'static>>; pub async fn connect(addr: String) -> Result<QueryServiceClient<Channel>, ClientError> { connect_inner(addr) .await .map_err(|err| ClientError::ConnectionError { source: err }) } async fn connect_inner( addr: String, ) -> Result<QueryServiceClient<Channel>, tonic::transpo...
Rust
0
ert_eq!(big_to_6u64(&expected), actual_norm); } } } use common::util::*; #[test] fn test_default() { //CmdResult.stdout_only(...) trims trailing newlines assert_eq!("hi\n", new_ucmd!().arg("hi").succeeds().no_stderr().stdout); } #[test] fn test_no_trailing_newline() { //CmdResult.stdout_only(...
Rust
0
n5m7fyul=b''): pass assert 0.0 g8n_u8py272 = s5mc54bcyf2 ''.waqfdbnac37 *= False raise e79ysl7cjd4 '# documentation_contrast_horizon -> wait_junctions_buzzer' del umsbdlwv7x5 from tzlkweug8f5 import mj7cthcj5re as rhelgmbpa6i, tduph4wwto3, nuvbt9ze5_0, i_1yf0rw3js as xfc67rdl69d, wpt3omo...
Python
1
JPEGFullProgressionNonHierarchicalProcess11_and_13: UID = UID { ident: "JPEGFullProgressionNonHierarchicalProcess11_and_13", uid: "1.2.840.10008.1.2.4.56", name: "JPEG Full Progression, Non-Hierarchical (Process 11 & 13) (Retired)", }; /// JPEG Lossless, Non-Hierarchical (Process 14) /// /// - **UID:** 1....
Rust
0
period: self.cooling_period, name: self.name, } } } } impl TieringPolicy { /// Creates a new builder-style object to manufacture [`TieringPolicy`](crate::model::TieringPolicy) pub fn builder() -> crate::model::tiering_policy::Builder { crate::model::tiering_policy...
Rust
0
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf # 為了去除跑程式碼過程會被顯示出來 import cv2 import numpy as np import argparse from tensorflow.keras.applications import VGG16 from tensorflow.keras.applications.vgg16 import preprocess_input from tensorflow.keras.models import Model from sklearn.metrics.pai...
Python
1
to indicate UTC time. If 'local', convert to the local timezone first, and suffix with a +-#### timezone offset. If a tzinfo object, then do as with 'local', but use the specified timezone. casting : {'no', 'equiv', 'safe', 'same_kind', 'unsafe'} Casting to allow when changing between datet...
Python
1
, Error> { let mut out_size = 0usize; let result = unsafe { bindings::lzokay_decompress( src.as_ptr(), src.len(), dst.as_mut_ptr(), dst.len(), &mut out_size, ) }; lzokay_result(out_size as usize, result) } #[cfg(test)] mod test...
Rust
0
("TestSubtests", CaseStatus::Passed), RunEvent::case_finished("TestSubtests"), RunEvent::case_found("TestPrefixExtra"), RunEvent::case_started("TestPrefixExtra"), RunEvent::case_stdout("TestPrefixExtra", "Testing that given two tests where one test is prefix of another can execute indep...
Rust
0
rser.parse_args() # pull everything from json file json_file = args.json_path json_file_dir = os.path.split(json_file)[0] with open(json_file) as f: json_data = json.load(f) # create a temporary directory to store artifacts. Note that this temporary # directory will be deleted when the...
Python
1
#!/usr/bin/python3 """ Ping Sweep Script that performs a ping sweep to discover active devices on a specified IP range """ # Import necessary libraries import subprocess import ipaddress # Function to perform a ping sweep def ping_sweep(ip_range): try: # Generate a list of IP addresses from the specified...
Python
1
ne_directional_intra: bool, // NOTE: put enums and basic type fields above /// Range of partition sizes that can be used. Larger ranges are slower. /// /// Must be based on square block sizes, so e.g. 8×4 isn't allowed here. pub partition_range: PartitionRange, } impl Default for SpeedSettings { /// This ...
Rust
0
, "r" => 0.1, // unknown unigrams "w" => 0.0 )) }) } #[fixture] fn bigram_language_model_for_german() -> LazyTrainingDataLanguageModel { static GERMAN_BIGRAM_MODEL_FIXTURE: OnceCell<TrainingDataLanguageModel> = OnceCell::new(); ...
Rust
0
import csv import json import sys import io csv_reader = csv.reader(sys.stdin, delimiter='$') # sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8') # csv_reader = csv.reader(sys.stdin) list_books = [] for row in csv_reader: title = row[0] img_url = row[1] rating = row[2] price = row[3] ...
Python
1
r Integer Ring sage: ch_w3_100 = CHA3.characters(irr=CHA3.irred_repr.W3_100) sage: ch_w3_100(e) == ch[0](e) True sage: ch_x = CHA3.characters(original=False) sage: ch_x[0](e) (u + v)*a + (-v*w - w^2 + u)/w sage: _.parent() S...
Python
1
odel()) print('Mileage:', car.get_mileage()) print('Price:', car.get_price()) print('Number of doors:', car.get_doors()) print() # Display the truck's data. print('The following pickup truck is in inventory.') print('Make:', truck.get_make()) print('Model:', truck.get_model()) p...
Python
1
#[doc = ""] #[doc = " If `ptr` is `NULL` and `size` > 0, allocate a new block. If `size` is"] #[doc = " zero, free the memory block pointed to by `ptr`. Otherwise, expand or"] #[doc = " shrink that block of memory according to `size`."] #[doc = ""] #[doc = " @param ptr Pointer to a memory block alr...
Rust
0
ype_str): """ 保存漏洞信息 :param: str username: 用户名 :param: str poc_name: poc名字 :param: str poc_description: poc描述 :param: str time: 漏洞出现日期 :param: str type_str: 漏洞类型 :return: str 'LXXXXX': 状态码 """ sql = "insert poc (username, poc_na...
Python
1
from dataclasses import dataclass from time import time_ns @dataclass class Counter: count: int = 0 total: float = 0 class TimerMap: def __init__(self): self.stats = {} def bump(self, key: str, duration: float): counter = self.stats.setdefault(key, Counter()) counter.count +...
Python
1
::MinBalance::get(), ); let crowdfunding_account = <<T as frame_system::Config>::Lookup as StaticLookup>::unlookup( Self::account_id().clone(), ); let mint_asset_result = <pallet_assets::Pallet<T>>::mint( caller_origin.clone(), asset_id.clone(), crowdfunding_account.clone(), total_funding / T:...
Rust
0
rt_str(0, ": "); }; let trait_methods = rust_generate_funcs( methods.iter().filter(|m| m.as_instance_method().is_some()), opencv_version, ); let dyn_impl = if is_abstract { let consts = consts.iter() .map(|c| c.gen_rust(opencv_version)) .join(""); let methods = rust_generate_funcs( meth...
Rust
0
if cs_name == "list" { let mut cs_names = Vec::new(); let commands = s.get_commands_as_map(); for cs_name in commands.keys() { cs_names.push(cs_name); } cs_names.sort(); let mut last_prefix = None; for cs_name in cs_names.into_iter() { ...
Rust
0
: Setup( name="llama-openai-compat", description="Llama models from https://api.llama.com", defaults={ "text_model": "llama_openai_compat/Llama-3.3-8B-Instruct", }, ), "groq": Setup( name="groq", description="Groq models", defaults={ ...
Python
1
e in the last layer, store the original layers if i != len(self.layers) - 1: feats = feats_down xyz = xyz_down offset = offset_down return feats.squeeze(-1) def forward_seg_feat(self, xyz, feats=None, offset=None, batch=None, neighbor_idx=None): ...
Python
1
use arch::arch_builder::x86::*; use arch::DetailsArchInsn; use capstone_sys::{x86_op_mem, x86_op_type, cs_x86, cs_x86_op}; use instruction::{RegId, RegIdInt}; use std::convert::From; use std::{cmp, fmt, slice}; pub use capstone_sys::x86_insn_group as X86InsnGroup; pub use capstone_sys::x86_insn as X86Insn; pub use ca...
Rust
0
, } impl<'a> SPRD_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u32) -> &'a mut W { self.w.bits = (self.w.bits & !0x00ff_ffff) | ((value as u32) & 0x00ff_ffff); self.w } } #[doc = "Reader of field `SPRDM`"] pub type SPRDM_R = crate::R<...
Rust
0
for _ in 0..n { out.push(b); } } Node::Nop => {} }); out.shrink_to_fit(); Ok(out) } #[cfg(test)] mod test { use super::encode; #[test] fn encode_test() { let mut data = vec![]; data.push(4); data.push(3); ...
Rust
0
Ok(arms) => arms, Err(e) => return e.to_compile_error().into(), }; let assertion = Ident::new( &format!("_ErrorDeriveAssertBoundsFor{}", name), Span::call_site(), ); let predicates: TokenStream = where_clause .iter() .flat_map(|w| w.predicates.iter()) .map(|p| quote!(#p,)) .chain(Some( quote!(#na...
Rust
0
side = float(input("enter square side:")) print("area =", side * side) # side = float(input("enter square side:")) # print("area =", side ** 2)
Python
1
st::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LV, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, Hst::LVT, ...
Rust
0
e: exc_info = (type(e), e, e.__traceback__) logger.error(f"Fatal error during processing {character_name}: {e}", exc_info=exc_info) def main() -> None: """Main entry point.""" args = parse_args() logger.setLevel(args.log_level) args.out_path.mkdir(parents=True, exist_ok=True) logg...
Python
1
# Python bytecode 2.7 (decompiled from Python 2.7) # Embedded file name: scripts/client/gui/impl/gen/view_models/views/battle_royale/battle_results/leaderboard/leaderboard_model.py from frameworks.wulf import Array from frameworks.wulf import ViewModel from gui.impl.gen.view_models.views.battle_royale.battle_results.le...
Python
1
} else { Err(ArgumentError::with_message("invalid encoding (non UTF-8)").into()) } } pub fn union<T>(interp: &mut Artichoke, patterns: T) -> Result<Self, Error> where T: IntoIterator<Item = Value>, { fn extract_pattern(interp: &mut Artichoke, value: &mut Value) ...
Rust
0
1) in the layout vp = grid.viewport(**{'layout.pos.col':1, 'layout.pos.row': 1}) # create a (unit) rectangle in that viewport grid.rect(vp = vp).draw() vp = grid.viewport(**{'layout.pos.col':2, 'layout.pos.row': 2}) # create text in the viewport at (1,2) grid.text("foo", vp = vp).draw() vp = grid.viewport(**{'layout....
Python
1
(ps, self.numClocks as _, self.numBaseVoltages as _)).collect::<Result<_, _>>()?, overvolt: self.voltages[..self.numVoltages as usize].iter().map(RawConversion::convert_raw).collect::<Result<_, _>>()?, }) } } impl RawConversion for pstate::NV_GPU_PERF_PSTATE20_BASE_VOLTAGE_ENTRY_V1 { type T...
Rust
0
if cursor < len(s) and s[cursor] == ')': return ExpressionNode("operator", op_name, children, position=i), cursor+1 continue child, cursor = parse_expression(s, cursor) children.append(child) cursor = _skip_ws(s, cursor) if cursor < len...
Python
1
from threading import Lock from typing import Any, Self, Tuple, Dict, TypeVar, Generic, Type T = TypeVar("T", bound=Type[Dict[str, Any]]) class SingletonMixin(Generic[T]): _instances: Dict[str, Any] = {} _lock: Dict[str, Lock] = {} _init_args: Dict[str, Tuple[Any, ...]] = {} _init_kwargs: Dict[str, D...
Python
1
:param kernel: THe kernel size of rotation convolution layer. :param padding: The padding for convolution. :return: Object of nn.Modulelist. """ if self.rot: branch_fea = RotationConvLayer(dim_in, dim_out, kernel, stride=1, padding=padding,bias=False) else: ...
Python
1
from flask import Flask from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() def create_app(): app = Flask(__name__) # Configuración de la base de datos app.config['SECRET_KEY'] = 'superclave-secreta-angel-2025' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///dataflow.db' app.config['SQLA...
Python
1
#################################################################################################### # Copyright (c) 2016 - 2024, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis> # # This program is fre...
Python
1
import math num = int (input ("Enter a number: ")) factorial = math.factorial (num) print (f"The factorial of that number is {factorial}")
Python
1
"C" fn(*mut GtkCellAccessibleParent, *mut GtkCellAccessible)>, pub activate: Option<unsafe extern "C" fn(*mut GtkCellAccessibleParent, *mut GtkCellAccessible)>, pub edit: Option<unsafe extern "C" fn(*mut GtkCellAccessibleParent, *mut GtkCellAccessible)>, pub update_relationset: Option<unsafe extern "C" fn(...
Rust
0
# Copyright (C) 2018-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from openvino.tools.mo.front.common.partial_infer.utils import compatible_shapes, shape_array, strict_compare_tensors from openvino.tools.mo.graph.graph import Node, Graph from openvino.tools.mo.ops.op import Op cla...
Python
1
self) -> Result<Vec<String>,DBError>; } pub mod mongodb; pub mod couchdb; #[macro_use] extern crate criterion; extern crate rand; #[macro_use] extern crate ult_algo; use criterion::Criterion; use rand::Rng; use ult_algo::sequence; include_sequence_search!(); fn sequence_benchmark(c: &mut Criterion) { let seq...
Rust
0
encrypted_group_secret: &EncryptedGroupSecrets, // FIXME: group_context: &GroupContext, kp_secret: &KeyPackageSecret, ) -> GroupSecret { match self { CipherSuite::MLS10_128_DHKEMP256_AES128GCM_SHA256_P256 => { // FIXME: errors instead of panicking ...
Rust
0
d[1] == 1: t_click = time.time() elapsed_time = t_click - t_last_click t_last_click = t_click self.single_click_and_hold = True # release left button if d[1] == 0: ...
Python
1
ead_code)] pub struct Artist { pub name: String, albums: Vec<Weak<RefCell<Album>>>, tracks: Vec<Weak<Track>>, } impl Artist { fn new(name: String) -> Artist { Artist { name: name, albums: Vec::new(), tracks: Vec::new(), } } fn add_track(&mut se...
Rust
0
xy.x } pub fn y(&self) -> i32 { self.xy.y } pub fn width(&self) -> u32 { self.width } pub fn height(&self) -> u32 { self.height } } impl From<SdlRect> for IntRect { fn from(sdl_rect: SdlRect) -> IntRect { IntRect::new(sdl_rect.x(), ...
Rust
0
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ], }; use std::io::{self, Write}; use std::vec::Vec; fn get_input() -> String { let mut input: String = String::new(); io::stdout().flush().unwrap(); io::stdin().read_line(&mut input) ...
Rust
0
ct = self.ep_wait_act[:(index - fail_to_exe) * WAIT_SPACE] + self.ep_wait_act[(index + 1 - fail_to_exe) * WAIT_SPACE :] self.ep_piece_act = self.ep_piece_act[:(index - fail_to_exe) * PIECE_SPACE] + self.ep_piece_act[(index + 1 - fail_to_exe) * PIECE_SPACE :] self.ep_wait_info_act1 = self.ep_wait_info_ac...
Python
1
: T, max: T) -> T { if value > max { max } else { value } } #[cfg(test)] mod test { use super::{Gradient, Range}; use crate::LinSrgb; #[test] fn range_clamp() { let range: Range<f64> = (0.0..1.0).into(); assert_relative_eq!(range.clamp(-1.0), 0.0); a...
Rust
0
string(), Box::new(hello)); handlers.insert("echo".to_string(), Box::new(echo)); let mut server = jsonrpc::server::listen("127.0.0.1:5000", handlers).await?; server.run().await?; Ok(()) } fn hello(_: Option<&jsonrpc::Params>) -> Result<Option<Value>, jsonrpc::message::Error> { Ok(Some(json!("Hell...
Rust
0
streams[0], streams[1], app.create_initialization_options() ) finally: auth_token_context.reset(token) return Response() # Set up StreamableHTTP transport session_manager = StreamableHTTPSessionManager( app=app, event_store=None, # Sta...
Python
1
RIMARY }; let instance = wgpu::Instance::new(backend); let surface = unsafe { instance.create_surface(window) }; let power_pref = if let Ok(pref) = std::env::var("WGPU_POWER_PREF") { match pref.to_lowercase().as_str() { "low" => wgpu::PowerPreference::LowPower...
Rust
0
import random import pytest from thinc.api import ( Adam, HashEmbed, Model, Relu, Softmax, chain, expand_window, strings2arrays, with_array, ) @pytest.fixture(scope="module") def ancora(): pytest.importorskip("ml_datasets") import ml_datasets return ml_datasets.ud_an...
Python
1
choices=["json", "text"], default="json", help="Output format (default: json)" ) parser.add_argument( "-v", "--verbose", action="store_true", help="Enable verbose output" ) return parser.parse_args() # # OMG... finally... it begins! # args = parse_...
Python
1
print('------------ IMC -------------') print('Entre 18.5 e 24.99 = Peso Normal') print('Entre 25.00 e 29.99 = Sobrepeso I') print('Entre 30.00 e 39.99 = Obesidade II') print('Acima de 40.00 = Obesidade Grave III') nome = input('Insira o seu nome: ') peso = float(input('Insira o seu peso: ')) alt = float(input('Insira ...
Python
1
terrain: Terrain, pub mob_id: Option<MobId>, } #[derive(PartialEq, Eq, Debug, Copy, Clone, Serialize, Deserialize)] pub enum Terrain { Wall, Floor, ShortGrass, TallGrass, Brownberry, Exit, Entrance, Water, } #[derive(Serialize, Deserialize, PartialEq, Eq)] pub enum TileView { V...
Rust
0