text
string
label_name
string
labels
int64
# Distributed under the MIT License. # See LICENSE.txt for details. import numpy as np def dg_package_data( u, flux_u, normal_covector, mesh_velocity, normal_dot_mesh_velocity ): result = u if normal_covector[0] > 0.0 else -u return ( u, np.asarray(np.einsum("i,i", normal_covector, flux_u...
Python
1
break; } } if skip { continue } if pack(img.get_pixel(x, y)) == 0xBCBCBC { let mut tube = ParsedTube::new(tubes.len(), x - 11, y - 3, 134, 479); pop_colors(&mut tube, &img); ...
Rust
0
"""Functions for downloading demo data.""" import os from pathlib import Path import gdown TARGET_DIR = "clarity_data/demo" PACKAGE_NAME = "data.tgz" def get_demo_data(metadata_url: str, target_dir: str) -> None: """Download demo data. Args: metadata_url (str): URL to download data from (should be...
Python
1
dir") .join("input/2021"); let mut data = Data::default(); data.load(&base_dir, String::from(DAY) + "_test.txt"); let mut state = State { regs: [8, 0, 0, 0] }; for op in &data.input[0] { state.process(op); } assert_eq!(state.regs, [1, 0, 0, 0]); ...
Rust
0
yaml_path = "./StreamingAvatarSDK.yaml" sdk_path = "./sdk" StreamingAvatarApi_remote_path = "https://api.github.com/repos/HeyGen-Official/StreamingAvatarSDK/contents/apis/StreamingAvatarApi.ts" StreamingAvatarApi_local_path = "./sdk/apis/StreamingAvatarApi.ts" runtime_remote_path = "https://api.github.com/repos/HeyGen-...
Python
1
BOOL, ScissorEnable: BOOL, MultisampleEnable: BOOL, AntialiasedLineEnable: BOOL, }} RIDL!{#[uuid(0x9bb4ab81, 0xab1a, 0x4d8f, 0xb5, 0x06, 0xfc, 0x04, 0x20, 0x0b, 0x6e, 0xe7)] interface ID3D11RasterizerState(ID3D11RasterizerStateVtbl): ID3D11DeviceChild(ID3D11DeviceChildVtbl) { fn GetDesc( pD...
Rust
0
from tkinter import * from tkinter import messagebox from model.celular import Celular from services.controladorTienda import ControladorTienda from services.Observable import Observable class FormularioCelular: def __init__(self, root, servicio): self.servicio = servicio self.nueva_ventana = Tople...
Python
1
from http.server import ThreadingHTTPServer, BaseHTTPRequestHandler from threading import Thread from queue import Queue addr = "127.0.0.1" port = 8037 viewQueue = Queue() class CADViewerHandler(BaseHTTPRequestHandler): def do_POST(self): len = int(self.headers["Content-Length"]) print("Content-...
Python
1
serialize() headers = request.headers body = self.call("ModifyAddressTemplateAttribute", params, headers=headers) response = json.loads(body) model = models.ModifyAddressTemplateAttributeResponse() model._deserialize(response["Response"]) return mo...
Python
1
_cgal() print_stats_3d(a1, q1, "cgal", t1, nv, nc) elif args.method == "sm": a1, q1, t1, nv, nc = run_SeismicMesh() print_stats_3d(a1, q1, "SeismicMesh", t1, nv, nc) elif args.method == "gmsh": a1, q1, t1, nv, nc = run_gmsh() print_stats_3d(a1, q1, "gmsh", t1, nv, nc) ...
Python
1
{ name, ptype } => { if ptype { return new_lib_project(&name); } return new_bin_project(&name); } PygoCommand::Init { name, ptype } => { if ptype { return init_lib_project(&name); } return init_bin_p...
Rust
0
::ZERO)); assert!(i8080.cpu.condition_flags.contains(ConditionFlags::SIGN)); // Intel 8080 Assembly Language Programming, p. 28. i8080.cpu.a = 0x00; i8080.cpu.condition_flags.insert(ConditionFlags::CARRY); i8080.cpu.execute_instruction([0xDE, 0x01, 0], &mut i8080.memory); // SBI 1 assert_eq!(i8...
Rust
0
rec_regspill32.opcodes(&MOV_STORE)); e.enc_r32_r64_rex_only(spill, rec_spillSib32.opcodes(&MOV_STORE)); e.enc_r32_r64_rex_only(regspill, rec_regspill32.opcodes(&MOV_STORE)); // Use a 32-bit write for spilling `b1`, `i8` and `i16` to avoid // constraining the permitted registers. // See MIN_SPILL_S...
Rust
0
Window, pub subtype: c_int, pub provider: RRProvider, pub property: Atom, pub timestamp: Time, pub state: c_int, } #[derive(Debug, Clone, Copy, PartialEq)] #[repr(C)] pub struct XRRResourceChangeNotifyEvent { pub type_: c_int, pub serial: c_ulong, pub send_event: Bool, pub display:...
Rust
0
""" DataTables sqlite tests. """ from lute.db import db from lute.utils.formutils import language_choices, valid_current_language_id from lute.models.repositories import UserSettingRepository # pylint: disable=unused-argument def test_language_choices(app_context, spanish, english): "Gets all languages." ch...
Python
1
haracter::{Character, CharacterTransaction, Cursor}; use crate::linking::BlockProvider; use crate::math::GridPoint; use crate::space::{SetCubeError, SpaceTransaction}; use crate::transactions::{ PreconditionFailed, Transaction, TransactionConflict, UniverseTransaction, }; use crate::universe::{RefError, URef}; use ...
Rust
0
)| v.iter().map(move |&j| (i, j))) .collect::<HashSet<_>>(); accum::for_each(&path, |&u, &v| assert!(edges.contains(&(u, v)))); } } fn brute_tree_diameter(g: &[Vec<usize>]) -> ([usize; 2], u32) { let n = g.len(); let mut dist = vec![vec![std::u32::MAX; n]; n]...
Rust
0
from hashlib import sha256 from .signature import Signature from .math import Math from .utils.integer import RandomInteger from .utils.binary import numberFromByteString from .utils.compatibility import * class Ecdsa: @classmethod def sign(cls, message, privateKey, hashfunc=sha256): byteMessage = ha...
Python
1
break x = torch.tensor(batched_graphs['x'], dtype=torch.float).to(device) edge_index = torch.tensor(batched_graphs['edge_index'], dtype=torch.long).to(device) batch_idx = torch.tensor(batched_graphs['batch'], dtype=torch.long).to(device) data...
Python
1
zoom_factor, "pan_x": self.pan_x, "pan_y": self.pan_y, "has_image": self.original_image is not None, "scroll_sensitivity": self.scroll_sensitivity, "smooth_scroll_enabled": self.smooth_scroll_enabled } def set_scroll_sensitivity(self, sensitivity:...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 自动评分系统 支持选择题、简答题和编程题的自动评分 """ import json import os import re import subprocess import tempfile from typing import Any, Dict, List, Tuple import requests class ScoringSystem: """评分系统""" def __init__(self): # 从数据库获取AI API配置 self.api_key = No...
Python
1
WN_NODE_STOP: u32 = 1u32; #[repr(C)] #[doc = "*Required features: `\"Win32_Networking_Clustering\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] pub struct RESUTIL_FILETIME_DATA { pub Default: super::super::Foundation::FILETIME, pub Minimum: super::super::Foundation::FILETIME, pub Maximum...
Rust
0
{search}' 🔎</i></b>") search = search.lower() find = search.split(" ") search = "" removes = ["in","upload", "series", "full", "horror", "thriller", "mystery", "print", "file"] for x in find: if x in removes: continue ...
Python
1
*", (45, 0): "'", (46, 0): "+", (30, 64): "~", (36, 64): "`", (20, 64): "\\", (26, 64): "|", (8, 64): "€", (47, 64): "÷", (48, 64): "×", (9, 64): "(", (10, 64): ")", (14, 64): "ł", (15, 64): "Ł", (52, 64): "ß", (49, 64): "¤", (100, 0): "<", (100, 2): "...
Python
1
#!/usr/bin/env python # Copyright NumFOCUS # # 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.txt # # Unless required by applicable law or...
Python
1
# Copyright The Lightning AI team. # # 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 agreed to in wri...
Python
1
<(u64, u64)> { use RawCommand::*; match self { Pread { buffer, .. } => Some(buffer.aio_addr_and_len()), Pwrite { buffer, .. } => Some(buffer.aio_addr_and_len()), Fdsync => None, Fsync => None, } } pub(crate) fn flags(&self) -> Option<u32>...
Rust
0
]; const OCC_POSITIONS:[(usize,usize); 4] = [ (1,4),(4,0),(0,4),(5,7) ]; const MOVES:[Move; 4] = [ Move::Put(MochigomaKind::Hisha,KomaDstPutPosition(9-(8-1),(8-0)+1)), Move::Put(MochigomaKind::Hisha,KomaDstPutPosition(9-(8-7),(8-0)+1)), Move::Put(MochigomaKind::Hisha,KomaDstPutPosition(9-(8-0),...
Rust
0
ey symbol let anno_key_symbol = usize::parse_key(&data)?; let result = ( item_id, self.anno_key_symbols .get_value(anno_key_symbol) .unwrap_or_default(), anno_val, ); Ok(result) } fn get_by_anno_qname_range<'a>...
Rust
0
target = user_fp / "presets.json" log.info(f" <c>{preset_fp}</c> -> <c>{target}</c>") preset_fp.rename(target) shutil.rmtree(ob11_user_fp) log.success(f"<y>{event.get_user_id()}</y> 的用户数据迁移完成") def _session_id(event: Event, session: EventSession, target: MsgTarget) -> str: ...
Python
1
from __future__ import annotations from typing import TYPE_CHECKING, Any from fastapi import HTTPException from heliclockter import datetime_utc from pydantic import BaseModel from bracket.models.db.account import UserAccountType from bracket.models.db.club import ClubCreateBody from bracket.models.db.ranking import...
Python
1
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models from odoo.tools.translate import _ from datetime import timedelta class HrEmployee(models.Model): _inherit = "hr.employee" newly_hired_employee = fields.Boolean('Newly hired employee', compute='_c...
Python
1
)); } fn steps(cups: VecDeque<u8>, num: usize) -> String { // play game let mut cups = cups; for _ in 0..num { step(&mut cups); } // find cup #1 and drop it while *cups.front().unwrap() != 1 { let front = cups.pop_front().unwrap(); cups.push_back(front); } cups....
Rust
0
d # ============================================================================= if seq < m: seq = m # ============================================================================= ################################################################## # Main Script Starting Below #########################################...
Python
1
files: raise ValueError(f"❌ 标签 '{material_tag}' 中没有找到视频文件") # 选择指定索引的视频文件 if video_index >= len(video_files): video_index = 0 # 如果索引超出范围,使用第一个 selected_video = video_files[video_index] print(f"🎬 选择视频文件: {selected_video}") # 使用选择的视频文件进行处理 return trans_dgh_img_insert(data, sel...
Python
1
n Marino', 'Santu Marine', 'San Mairíne', 'সান মারিনো', '聖馬利諾', 'سان مارینو', 'San Marinas', 'Sên -Marëen', 'Ǹfúfúb Maríno', 'San Marín', 'サンマリノ', 'San Maríno', 'Sanimarino', 'Saint -Marin', 'Sā Malino', 'Samaríino', 'ແຊນ ມາຣິໂນ', 'سان\u200cمارینو', 'सैन मेरीनो', 'سن مارینو', 'Sántu Marinɛ', 'i -San Marino', 'Samali...
Python
1
"}, ) assert_matches_type(Optional[Clip], clip, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.stream.clip.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353",...
Python
1
rt_var(var_hir_id), _ => span_bug!(expr.span, "res `{:?}` not yet implemented", res), } } fn convert_var(&mut self, var_hir_id: hir::HirId) -> ExprKind<'tcx> { // We want upvars here not captures. // Captures will be handled in MIR. let is_upvar = self ....
Rust
0
rt MPV let mut command = Command::new(&config.mpv_command.command); let mut mpv_ipc_flag = OsString::new(); mpv_ipc_flag.push("--input-ipc-server="); mpv_ipc_flag.push(&config.ipc_socket.0); debug!("{}", mpv_ipc_flag.clone().into_string().unwrap()); command .args(&config.mpv_command.f...
Rust
0
complains that the crate using pyo3 does not contains a `#[link(...)]` // attribute with pythonXY. if env::var("CARGO_CFG_TARGET_FAMILY")? == "windows" { println!("cargo:rustc-link-lib=pythonXY:python3"); } Ok(()) } fn main() -> Result<()> { // If PYO3_NO_PYTHON is set with abi3, we can b...
Rust
0
i + 2; } i += 6; } num } pj_euler::run!("Largest prime factor", largest_prime_factor(600851475143)); pj_euler::test!( {largest_prime_factor_of_13195, largest_prime_factor(13195), 29}, {largest_prime_factor_of_333, largest_prime_factor(333), 37}, {largest_prime_factor_of_331, lar...
Rust
0
token, ) context = browser.new_context(storage_state=storage_state) page = context.new_page() if settings.DEBUG_PLAYWRIGHT: DebugPlaywright.debug(page) # FIXME: Use of Timeout correct? timeout = ...
Python
1
ount(to)), value: eth_value, gas_price, gas: U256::from(MAX_GAS_LIMIT), data, } } pub fn parse_private_key(path: &str) -> Result<ethereum_types::H256> { let content = std::fs::read_to_string(path)?; let private_key_string = content .split_whitespace() .next()...
Rust
0
a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 14)) | (((value as u32) & 0x03) << 14); self.w } } #[doc = "Reader of field `SENSITIVE_DMA_APBPERI_UCHI0_PMS_CONSTRAIN_SRAM_WORLD_1_PM...
Rust
0
# Copyright (C) 2022-2025 Intel Corporation # LIMITED EDGE SOFTWARE DISTRIBUTION LICENSE from datetime import datetime, timedelta, timezone from uuid import uuid4 import pytest from rest.schema.balance import BalanceResponse from rest.schema.credit_accounts import CreditAccount @pytest.fixture def account_id(): ...
Python
1
_cli(line, "./filename") self.assertRaises(StopIteration, next, checkres) def test_check_datetime_alias(self): lines = ["import datetime as date", "import datetime", "import datetime as dto", "from datetime import datetime as dtime"] for l...
Python
1
wsp100m_36_37'].attrs = {'units': 'ms-1', 'name': 'Wind speed at 100m interpolated from level 36 and 37 from COSMO-REA6'} ds['total_radiation'].attrs = {'units': 'Wm-2', 'name': 'total short-wave surface radiation from COSMO-REA6'} ds['wsp'].attrs = {'...
Python
1
#!/usr/bin/python3 import unittest import sys sys.path.append('../util') from iwd import IWD from hostapd import HostapdCLI from config import ctx class Test(unittest.TestCase): def push_button_success(self, wd, client=False): self.hostapd.wps_push_button() devices = wd.list_devices(1) ...
Python
1
str2="Con la patente di categoria A si possono condurre anche i tricicli di potenza superiore a 15 kW, qualunque sia l'età del conducente" str1="Con lo potente ol cotegono A sl possono conourre onche l tnclcl ol potenzo supenore ol5 KW,quolunque sloleto oel conoucente" def remove_single_quotes(input_string): ...
Python
1
"nhomBT": teacher_info_match.group(6).strip(), "giangVienBT": teacher_info_match.group(7).strip(), "sisoLT": teacher_info_match.group(8).strip(), "classInfo": [], } time_and_location_match = time_and_location_pattern.findall(line) if ...
Python
1
1028 - Channel Enable Set Register"] pub dma_enaset: DMA_ENASET, #[doc = "0x102c - Channel Enable Clear Register"] pub dma_enaclr: DMA_ENACLR, #[doc = "0x1030 - Channel Primary-Alternate Set Register"] pub dma_altset: DMA_ALTSET, #[doc = "0x1034 - Channel Primary-Alternate Clear Register"] p...
Rust
0
Evaluates to true/false based on if the expression is not truthy. Not { /// Approximate absolute position in the parsed expression. offset: usize, /// node to negate node: Box<Ast>, }, /// Evaluates LHS, and pushes each value through RHS. Projection { /// Approxi...
Rust
0
{ "annotator_kind": eval_row.get("annotator_kind", "unknown"), "result": { "label": eval_row.get("label"), "score": eval_row.get("score", 0.0), }, "metadata": ...
Python
1
def load_text_file(filepath): with open(filepath, "r", encoding="utf-8") as f: return f.read()
Python
1
# cleanup.py - Game Cleanup System für SusWords import json import os import time from datetime import datetime, timedelta def get_file_last_modified(filepath): """Gibt das letzte Änderungsdatum einer Datei zurück""" try: return os.path.getmtime(filepath) except: return 0 def is_game_aban...
Python
1
; pub const ORB_KEY_P: u8 = 0x19; pub const ORB_KEY_Q: u8 = 0x10; pub const ORB_KEY_R: u8 = 0x13; pub const ORB_KEY_S: u8 = 0x1F; pub const ORB_KEY_T: u8 = 0x14; pub const ORB_KEY_U: u8 = 0x16; pub const ORB_KEY_V: u8 = 0x2F; pub const ORB_KEY_W: u8 = 0x11; pub const ORB_KEY_X: u8 = 0x2D; pub const ORB_KEY_Y: u8 = 0x15...
Rust
0
astructure"), ("tester", "mobile development"), ("designer", "user experience") ] for role, domain in test_cases: name = domain_strategy.generate_name(role, domain) print(f"{role} + {domain} = {name}") print("\n=== Real Naming Strategy ===") real_strategy = Real...
Python
1
_history[best_epoch], train_top5_history[best_epoch], val_top1_history[best_epoch], val_top5_history[best_epoch], train_loss_history[best_epoch], val_loss_history[best_epoch])) return self.best_model, best_epoch, train_top1_history, val_top1_history, train_top5_history, val_top5_history...
Python
1
idates.shape[1] - input_ids.shape[1], depth) def test_device_consistency(self): """Test handling of inputs on different devices""" input_ids = torch.tensor([[1, 2, 3]]).to(torch_device) self.generator.input_ids = input_ids candidates, _ = self.generator.get_candidates(input_ids) ...
Python
1
import os from os import path def walk_up(bottom): """ mimic os.walk, but walk 'up' instead of down the directory tree """ bottom = path.realpath(bottom) # get files in current dir try: names = os.listdir(bottom) except Exception as e: print(e) return dirs...
Python
1
from matplotlib import animation from matplotlib import pyplot as plt circle = plt.Circle((0,0), 0.05) def update_radius(i, circle): circle.radius = i * 0.5 return circle fig = plt.gcf() ax = plt.axes(xlim=(-10,10), ylim=(-10,10)) ax.set_aspect('equal') ax.add_patch(circle) ani = animation.FuncAnimation(fi...
Python
1
import os.path import matplotlib.pyplot as plt from Utils.GroupClassification import groupLabeling import numpy as np from Utils.Conf import DOUBLE_SUMMARY_FEATURES_PATH, DOUBLE_SUMMARY_FILE_PATH, features_explanation from Double.GlobalFeaturesReader import GlobalDoubleFeaturesReader import pandas as pd import pymc a...
Python
1
ax=ax, orientation="vertical", format="%+2.0f dB", cax=cax, ) librosa.display.specshow( spectrogram_db, sr=sample_rate, hop_length=num_samples_between_frames, x_axis="time", y_axis="mel"...
Python
1
_minor(dev: u64) -> u64 { unsafe { libc::minor(dev as libc::dev_t) as u64 } } } } // Aligns with most filesystem sparse boundaries. const SPARSE_COPY_BUF_SZ: usize = 4096; // Copy data from a reader into a file while using seek on runs of zeros // to encourage the OS to create a sparse file. ...
Rust
0
l.bg_radius > 0: content_bg_color = 1 else: content_bg_color = torch.rand_like(content_images[..., :3]) if C == 4: gt_rgb = content_images[..., :3] * content_images[..., 3:] + content_bg_color * (1 - content_images[..., 3:]) else: gt_rgb = content...
Python
1
max - send an open self.reply_tx .send(AsyncSinkReply::CB(cf_data.clone(), CbAction::Restore)) .await?; } Ok(()) } } /// ensures that we subtract 1 from the counter once this drops pub(crate) struct CounterGuard(usize, ConcurrencyCap, ContraflowData); i...
Rust
0
TREE_HASH_HEADER).unwrap(), "3d417484359fc9f5a3bafd576dc47b8b2de2bf2d4fdac5aa2aff768f2210d386" ); } } <reponame>spotlease/stripe-rust use reqwest::Method; use crate::models::{Charge, ChargeCreateParams, ChargeUpdateParams, ChargeListParams}; use crate::request::{Request, SimpleRequest}; use re...
Rust
0
from numpy.testing import IS_WASM, IS_EDITABLE import pytest if IS_WASM: pytest.skip( "WASM/Pyodide does not use or support Fortran", allow_module_level=True ) if IS_EDITABLE: pytest.skip( "Editable install doesn't support tests with a compile step", allow_module_level=Tru...
Python
1
1]: x = block(x, hw_shape) x = layer[2](x) x = nlc_to_nchw(x, hw_shape) if i in self.out_indices: outs.append(x) return outs @BACKBONES.register_module() class PyramidVisionTransformerV2(PyramidVisionTransformer): """Implementation of `P...
Python
1
, random_seed: Option<[u32; 4]> ) { let clients_to_run = clients.len(); static WRITERS_READY: AtomicUsize = ATOMIC_USIZE_INIT; static READERS_READY: AtomicUsize = ATOMIC_USIZE_INIT; let start = Instant::now(); let joins: Vec<_> = clients.drain(..).enumerate().map(|(client_num, handle)| { ...
Rust
0
ults.fetch_all() # Convert the results into Volts I1, Q1 = u.demod2volts(I1, readout_len), u.demod2volts(Q1, readout_len) I2, Q2 = u.demod2volts(I2, readout_len), u.demod2volts(Q2, readout_len) # Progress bar progress_counter(n, n_avg, start_time=results.start_time) # Plo...
Python
1
{ let mut runtime = Builder::new() .name_prefix("main-") .build() .map_err(|e| format!("{:?}", e))?; // Log configuration info!(log, "Listening on {:?}", &config.net_conf.listen_addresses; "data_dir" => &config.data_dir.to_str(), "port" => &config.net_conf.liste...
Rust
0
should_hflip = torch.rand(self.grid_h, self.grid_w) < 0.5 else: should_hflip = torch.zeros(self.grid_h, self.grid_w, dtype=torch.bool) for i in range(len(datapoint.frames)): datapoint = random_mosaic_frame( datapoint, i, grid_h=sel...
Python
1
sponse from nuget.org2."); let registrations_base_url = index .resources .into_iter() .find(|res| res.r#type == "RegistrationsBaseUrl") .expect("Unable to find nuget.org query endpoint.") .url; let package_info = client .get(format!( "{}runtime.{}.mic...
Rust
0
self.encoding_thread = EncodingThread( ordered_input, output_file, self.encoding_options, use_frame_based_trim=True, # 프레임 기반 트림 사용 debug_mode=get_debug_mode(), # 디버그 모드 전달 global_trim_start=global_trim_start, # 전역 트림 시작 값 global_tr...
Python
1
format follows hh:mm", "inbound_departure_time (time)": "departure time of the flight coming back from the trip, the format follows hh:mm", "price (float)": "the total cost of the flight tickets", "airlines (str)": "the company that provides air tr...
Python
1
uts, losses) self.val() self.step += 1 def process_batch(self, inputs): """Pass a minibatch through the network and generate images and losses """ for key, ipt in inputs.items(): inputs[key] = ipt.to(self.device) # inputs.len() = 33 ...
Python
1
def assign(gen: TautomerGenerator) -> TautomerGenerator: pass objectID = property(getObjectID) clearCoordinates2D = property(coordinates2DCleared, clearCoordinates2D) clearCoordinates3D = property(coordinates3DCleared, clearCoordinates3D) callbackFunction = property(getCallbackFunction, setCallbackF...
Python
1
(|_| rng.gen_range(0..self.nsamples())) .collect::<Vec<_>>(); let records = self.records().select(Axis(0), &indices); let targets = T::new_targets(self.as_multi_targets().select(Axis(0), &indices)); DatasetBase::new(records, targets) }) } /// Apply ...
Rust
0
from discord.ext import commands class Chat(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_message(self, message): cnf = self.bot.global_settings_dict['textCommands'] if message.author.id in [self.bot.user.id, 1209017744696279041...
Python
1
rquivo Compactado: 0 bytes") compressed_label.pack(side="left", padx=5) text_area_frame = ttk.LabelFrame(root, text="Conteúdo do Arquivo") text_area_frame.pack(fill="both", expand=True, padx=10, pady=10) text_area = tk.Text(text_area_frame, wrap=tk.WORD, font=("Consolas", 12)) text_area.pack(side="left", fill="both",...
Python
1
*/ RENDER_MODE_FIT = 2, /** **DEPRECATED** 3: This mode is deprecated. */ RENDER_MODE_ADAPTIVE = 3, /** 4: The fill mode. In this mode, the SDK stretches or zooms the video to fill the display window. */ RENDER_MODE_FILL = 4, } /** Video mirror modes. */ #[derive(FromPrimitive)] pub e...
Rust
0
ype /// conversion for fixed-point depth buffers are performed in the same /// fashion as for `glClearDepth`. /// /// ## Errors /// * `GL_INVALID_ENUM` is generated if `buffer` is not `GL_COLOR` or /// `GL_DEPTH`. pub unsafe fn ClearBufferfv(&self, buffer: Buffer, drawbuffer: GLint, value: *const GL...
Rust
0
import glob import os from cli.src.helpers.build_io import get_build_path from cli.src.helpers.data_loader import (SCHEMA_DIR, load_all_schema_objs, load_all_schema_objs_from_directory, load_json_obj, load_schema_obj, ...
Python
1
let mut cfs_opts = Vec::with_capacity(cfs.len()); for cf in cfs { cfs_opts.push(CFOptions::new(*cf, ColumnFamilyOptions::new())); } new_engine_opt(path, db_opts, cfs_opts) } fn check_and_open( path: &str, mut db_opt: DBOptions, cfs_opts: Vec<CFOptions>, ) -> Result<DB, String> { ...
Rust
0
ing, scope_name): ''' :param inputs: [minibatch_size, 7, 7, 256] :param is_training: :param scope_name: :return: ''' with tf.variable_scope('build_fc_layers'): # fc1 = slim.conv2d(inputs=inputs, # num_outputs=1024, # kernel_size=...
Python
1
digest::{Input, VariableOutput}, VarBlake2b, }; use datasize::DataSize; use failure::Fail; use serde::{Deserialize, Serialize}; use crate::{ bytesrepr::{Error, FromBytes, ToBytes, U8_SERIALIZED_LENGTH}, CLType, CLTyped, PublicKey, BLAKE2B_DIGEST_LENGTH, }; const FORMATTED_STRING_PREFIX: &str = "accou...
Rust
0
for _ in range(int(input())): matrix=[] n=int(input()) for _ in range(2): matrix.append(input()) cnt=0 for i in range(1,n-1): if matrix[0][i]==matrix[0][i+1]==matrix[0][i-1]==matrix[1][i]=="." and matrix[1][i-1]==matrix[1][i+1]=="x": cnt+=1 if matrix[1][i]==matr...
Python
1
cam_moved = true; } _ => {} } match context.window.get_key(Key::Right) { Action::Press | Action::Repeat => { cam_yaw -= cam_yaw_speed * (elapsed_seconds as GLfloat); cam_moved = true; } _ => {} } ...
Rust
0
import importlib import logging logger = logging.getLogger(__name__) def module_and_name_str_2_module_and_name_tuple(module_and_name_str: str) -> tuple[str, str]: """ Extracz the module name and class or function name of a fully qualified name Args: fully qualified name: module name dot class of ...
Python
1
# DIVISION 114 # LEONARDO MIRABELLI # La división de higiene está trabajando en un control de stock para productos sanitarios. # Debemos realizar la carga de 5 (cinco) productos de prevención de contagio, de cada una debe obtener los siguientes datos: # 1. El tipo (validar "barbijo", "jabón" o "alcohol") # 2. El pr...
Python
1
; <reponame>PatrickStephansen/reactive-synth-bitcrusher<gh_stars>0 // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global // allocator. #[cfg(feature = "wee_alloc")] #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; fn clamp(min_value: f32, max_value: f32, value: f32...
Rust
0
import pyglet import random # Create a window window = pyglet.window.Window(width=800, height=200, caption='Linear Search Visualization') batch = pyglet.graphics.Batch() # Generate a list with random numbers ensuring 42 is included numbers = random.sample(range(1, 80), 20) + [26] random.shuffle(numbers) # Variables ...
Python
1
]); } } } else if let SnailfishElem::Pair(snailfish) = self { return snailfish.try_explode_recur(depth); } (false, [0, 0]) } fn try_split(&mut self) -> bool { match self { SnailfishElem::Regular(num) => { if *nu...
Rust
0
or aa in theta_tmp] logger.info('Average test time per mini-batch = {}'.format( np.mean(gen_run_time))) ### Create networkx graphs from returned information if self.config.dataset.has_sub_nodes: graphs_gen = [get_graph_subnodes(A_pred[ii], node_embed_pred[ii], subnode_pred[ii]) for ii in...
Python
1
name, (module_name, lexer.name, tuple(lexer.aliases), tuple(lexer.filenames), tuple(lexer.mimetypes)))) # sort them to make the diff...
Python
1
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x40, 0x40, 0x...
Rust
0
CP_SecurityInformation), } #[derive(Debug, AperCodec)] #[asn(type = "SEQUENCE", extensible = false)] pub struct RANCPRelocationIndicationProtocolIEs_Entry { #[asn(key_field = true)] pub id: ProtocolIE_ID, pub criticality: Criticality, pub value: RANCPRelocationIndicationProtocolIEs_EntryValue, } #[der...
Rust
0
ne = random.choice(lines) tokens = line.split() external_ip = tokens[4] logger.info(f'Selected random legacy node - {external_ip}') return f'http://{external_ip}:3030' def main(): start_time = datetime.now() parser = argparse.ArgumentParser( description='Run a prober for split archiv...
Python
1
able': True, 'density': 'comfortable'}}]}, {'component': 'VCol', 'props': {'cols': 12, 'md': 2}, 'content': [{'component': 'VTextField', 'props': {'model': 'q_sport', 'label': '外部端口', 'density': 'comfortable'}}]}, {'component': 'VCol', 'props': {'c...
Python
1