text
string
label_name
string
labels
int64
[`Grammar`] with a [`Node`] returns a reference to a /// [`NodeData`]. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Node(usize); /// A token, denoted with single quotes, like `'+'` or `'struct'`. /// /// Indexing into a [`Grammar`] with a [`Token`] returns a reference to a /// [`Toke...
Rust
0
expected); } } //! An implementation of a `ByteBuf` based on virtual memory. //! //! This implementation uses `mmap` on POSIX systems (and should use `VirtualAlloc` on windows). //! There are possibilities to improve the performance for the reallocating case by reserving //! memory up to maximum. This might be a p...
Rust
0
the crate's //! public modules. //! //! # Examples //! //! Basic usage: //! //! ```no_run //! extern crate etcd; //! //! use std::default::Default; //! //! use etcd::Client; //! //! fn main() { //! // Creates a client that will make API calls to http://127.0.0.1:2379. //! let client = Client::default(); //! //!...
Rust
0
n[R"XX5 [RS U5 [ (a[#U5R%5 gg!,(df  N=f![&a [RS U5 gf=f) N checkpointsTexist_ok.py&Writing che...
Python
1
.random.shuffle(unique_hash_grd) max_len = min(grounding_len, len(unique_hash_grd)) indices = np.random.permutation(max_len) selected_unique_hash_grd = unique_hash_grd[indices] selected_mask = np.in1d(hash_grd, selected_...
Python
1
n2: &Vector<T> = &x[n - 2]; let t_n2: &T = &t[n - 2]; return x_n + &((prob.func(t_n, x_n) * T::from_f64(23.0 / 12.0) + prob.func(t_n1, x_n1) * T::from_f64(-16.0 / 12.0) + prob.func(t_n2, x_n2) * T::from_f64(5.0 / 12.0)) * h); ...
Rust
0
impl<'b> Proposals<'b> { pub const PROPOSAL_BASE58_LEN: usize = 52; #[inline(never)] pub fn from_bytes(input: &'b [u8]) -> IResult<&[u8], Self, ParserError> { let (rem, (source, period, proposals)) = do_parse! {input, source: public_key_hash >> period: be_i32 >> ...
Rust
0
(), ScalarFuncSig::ConcatWs => concat_ws_fn_meta(), ScalarFuncSig::Ascii => ascii_fn_meta(), ScalarFuncSig::Reverse => reverse_fn_meta(), ScalarFuncSig::ReverseBinary => reverse_binary_fn_meta(), ScalarFuncSig::HexIntArg => hex_int_arg_fn_meta(), ScalarFuncSig::HexStrArg ...
Rust
0
AST> }, Le { left: Box<AST>, right: Box<AST> }, Ge { left: Box<AST>, right: Box<AST> }, Leq { left: Box<AST>, right: Box<AST> }, Geq { left: Box<AST>, right: Box<AST> }, Is { left: Box<AST>, righ...
Rust
0
from env.custom_hopper import * from stable_baselines3 import SAC from stable_baselines3.common.env_util import make_vec_env from stable_baselines3.common.vec_env import DummyVecEnv, VecMonitor from stable_baselines3.common.evaluation import evaluate_policy def save_rewards(filename, algo_name, rewards): with...
Python
1
erialize<'de> for Roster<'lf> where 'de: 'lf, { fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: serde::Deserializer<'de>, { #[derive(Deserialize)] #[serde(bound(deserialize = "'de: 'lf"))] struct Root<'lf> { league: Standard<'lf>, ...
Rust
0
# /usr/bin/env python # -*- coding: utf-8 -*- ''' @File : output.py @Time : 2020/12/27 05:55:34 @Author: Morker @Blog : https://96.mk/ @Email : i@96.mk If you don't go through the cold, you can't get the fragrant plum blossom. ''' import os import csv import time import json import base64 import xlsxwrit...
Python
1
tps://repository.edu/article.pdf" } ] } mock_get.return_value = mock_response result = unpaywall_meta("10.1234/test") # Should prefer repository URL assert result["oa_url"] == "https://repository.edu/article.pdf" @patch('research_system.tools.doi_fallback.unpaywall_me...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import math import tempfile import zipfile from odoo import _, api, models from odoo.tools.float_utils import float_round class L10n_DeEcSalesReportHandler(models.AbstractModel): _name = 'l10n_de.ec.sales.report.ha...
Python
1
# coding: utf-8 """ API Alegra Proveedor Electrónico Colombia No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class ma...
Python
1
"""Array Equilibrium Index Send Feedback Find and return the equilibrium index of an array. Equilibrium index of an array is an index i such that the sum of elements at indices less than i is equal to the sum of elements at indices greater than i. Element at index i is not included in either part. If more than one equi...
Python
1
import pytz from odoo import fields, models class SaleOrder(models.Model): _inherit = "sale.order" def _create_account_invoices(self, invoice_vals_list, final): """ EXTENDS 'sale' Necessary because if someone creates an invoice after 9 pm Argentina time, if the invoice is created aut...
Python
1
from .Ball2Envmap import Ball2Envmap from .Exposure2HDR import Exposure2HDR from .SaveHDR import SaveHDR from .ExposureBracket import ExposureBracket from .PadBlackBorder import PadBlackBorder from .ChromeballMask import ChromeballMask from .PercentileToPixelValueTonemap import PercentileToPixelValueTonemap # A dicti...
Python
1
The window icon. * /// * /// The default is `None`. * pub window_icon: Option<Icon>, */ } impl Default for WindowAttributes { #[inline] fn default() -> WindowAttributes { WindowAttributes { inner_size: None, min_inner_size: None, max_inner_size: None, ...
Rust
0
00 + 256 * 3 + 5; let window_height = 40 + 240 * 3 + 5; let mut window: PistonWindow = WindowSettings::new("xXx NESemu xXx", [window_width, window_height]) .exit_on_esc(true).graphics_api(OpenGL::V3_2).build().unwrap(); let mut event_settings = EventSettings::new(); event_settings.max_fps = 60; ...
Rust
0
'ac'] If *k* is not given, every set partition is generated. >>> iterable = 'abc' >>> for part in set_partitions(iterable): ... print([''.join(p) for p in part]) ['abc'] ['a', 'bc'] ['ab', 'c'] ['b', 'ac'] ['a', 'b', 'c'] Nr@6Can't partition in a negative or zero number of groupsc3<>#...
Python
1
# # Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual # property and proprietary rights in and to this material, related # documentation and any modifications thereto. Any use, reproduction, # disclosure or distribution ...
Python
1
, 160, 0x00FFFFFF, 0x00, 'C_VIS228._CH') OP_C5(0x01, -50, -80, 50, 80, -50, -10, 512, 512, 0, 0, 100, 160, 0x00FFFFFF, 0x00, 'C_VIS228._CH') OP_C5(0x02, -50, -80, 50, 80, -50, -10, 512, 512, 0, 0, 100, 160, 0x00FFFFFF, 0x00, 'C_VIS228._CH') OP_C5(0x03, -50, -80, 50, 80, -50, -10, 512, 512, 0, 0, 100, 160, 0...
Python
1
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # This is a BETA new format config file, and the usage may change recently. from mmengine.optim.optimizer.optimizer_wrapp...
Python
1
} #[derive(Clone, Copy, Debug)] #[must_use = "strategies do nothing unless used"] struct LengthStrat(Kind); struct LengthValueTree(Kind, <i64::Any as Strategy>::Tree); impl ValueTree for LengthValueTree { type Value = Length; fn current(&self) -> Self::Value { let...
Rust
0
lock.position.y as usize + y >= self.placed_blocks.len() || self.block.position.x as usize + x >= self.placed_blocks[0].len() || self.block.position.x + (x as f32) <= 0.0 || self.placed_blocks[y + self.block.position.y as usize][x + self.block.position.x as us...
Rust
0
IFFEN_1 } } #[doc = "Multi Vref Implemented\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum MVI_A { #[doc = "0: Single voltage reference high (VREFH) input supported."] MVI_0 = 0, #[doc = "1: Multiple voltage reference high (VREFH) inputs supported."] MVI_1 = 1, } impl From<...
Rust
0
) .unwrap() ); } #[test] fn test_string_utf16_bom_le() { const SOMEIP_TYPE: SomeIpType = SomeIpType::String(SomeIpString { max_size: 6, min_size: 0, length_field_size: Some(LengthFieldSize::OneByte), }); struct Options; impl SomeIpOptions for Options { con...
Rust
0
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.construct import init from .cost_center_version import CostCenterVersion class CreateCostCenterVersionResponseBody(object): _types = { "version": CostCenterVersion, } ...
Python
1
xc9\xc9I\x0c\xc3\xc8z\x9e\x97\xf1}\xbf\xb6E\ \x8f\xb6#\xe8E\x80\xa9\xd6\xea\xdd\x16\x01\x14\x02)%\ v;\x01\x9a\xce\x1fI\xd2\xf1\xdb\x88\xef~\xe7\x0d\xbe\ \xf4\xf8\xefoy\xc1c\x95\x04~\xaa\xbe\xe1\xc07\xe2\ \xe3\x9f\xfe\x09\xa4\xd1;\x06\xb1\x1c4(\x07\x0dF\xda\ \xb4A+\xe2H!\x81\x18\xad5\x96eq\xcb-\xb7\ `Y\x16$\xdb\xd9\xbc1...
Python
1
+ 1, train_loss, checkpoint_dir) print(f"💾 Saved checkpoint: {checkpoint_path}") # Track best model if train_loss < best_loss: best_loss = train_loss best_path = os.path.join(checkpoint_dir, "best_model.pt") torch.save(mo...
Python
1
2_simd!(bitor_i64, BitOr::bitor, BitOr::bitor, i64, VI64_WIDTH, set1_epi64); gen_quickcheck_2_simd!(bitxor_i64, BitXor::bitxor, BitXor::bitxor, i64, VI64_WIDTH, set1_epi64); // Equality/ordering/min/max gen_quickcheck_2_simd!(cmpeq_f32, (|a, b| f32::from_bits(if a == b { !0u32 } else { 0u32 })), S::cmpeq_...
Rust
0
import os from flask import Blueprint, request, url_for, redirect, render_template, jsonify, flash from app.models.job import Job from extensions import db from config import Config from utils.file_utils import move_file_with_lock from email_util import send_email approval_bp = Blueprint('approval', __name__) @approv...
Python
1
# ************************************************************************** # * # * Authors: J.M. De la Rosa Trevin (delarosatrevin@scilifelab.se) [1] # * # * [1] SciLifeLab, Stockholm University # * # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General ...
Python
1
name: [u8; DIR_SIZ], } impl DirEnt { pub(crate) fn empty() -> DirEnt { DirEnt { inum: 0, name: [0; DIR_SIZ], } } fn set_name(&mut self, new_name: *const u8) { let new_len = util::strnlen(new_name, DIR_SIZ); if new_len > DIR_SIZ { panic...
Rust
0
for subscriber in subscribers.iter_mut() { if let Some(sub) = subscriber { if let Err(_) = sub.send(msg.clone()).await { *subscriber = None } } } } } <gh_stars>1-10 //! This module defines the document tree of an OpenBook proje...
Rust
0
from isaacgymenvs.pbt.launcher.run_description import ParamGrid, RunDescription, Experiment from isaacgymenvs.pbt.experiments.allegro_kuka_pbt_base import kuka_base_cli from isaacgymenvs.pbt.experiments.run_utils import version env = 'allegro_kuka_two_arms_reorientation' _pbt_num_policies = 8 _name = f'{env}_{versio...
Python
1
foreRollover => "before-rollover", HookType::AfterRollover => "after-rollover", } .to_string() } } const ALL_HOOK_TYPES: &[HookType] = &[ HookType::BeforeEdit, HookType::AfterEdit, HookType::BeforeRollover, HookType::AfterRollover, ]; const HOOK_TEMPLATE: &'static str =...
Rust
0
vel::reply::Attr>::new(self.unique, Err(err)); let _ = self.sender.write_vectored(&reply.to_io_slices()); } } /// /// XTimes Reply /// #[cfg(target_os = "macos")] #[derive(Debug)] pub struct ReplyXTimes { unique: u64, sender: Box<dyn ReplySender>, } #[cfg(target_os = "macos")] impl Reply for Reply...
Rust
0
#!/usr/bin/env python3 """ Setup script for Gemini AI integration """ import os import sys def setup_gemini_api(): print("🤖 Gemini AI Setup") print("=" * 50) print() print("To use Gemini AI with your voice assistant, you need an API key.") print() print("Steps to get your Gemini API key:") ...
Python
1
from Conta import Conta from Despesa import Despesa from Receita import Receita from Utils import receberValor, receberDescricao, receberDespesaEDescricao, receberCategoria, comparar_despesa class AppFinanceiro: def adicionarConta(self, conta): saldo = receberValor('o saldo') #função presente em Utils ...
Python
1
k in 0..a.n { sum += a[[i, k]] * b[[k, j]]; } mat[[i, j]] = sum; } } mat }); overload!((a: ?Matrix) * (b: ?Vector) -> Vector { if a.n != b.n { panic!("Can not multiply {}x{} to {}", a.m, a.n, b.n); } let mut vec = Vector::new(a.n); for i i...
Rust
0
assert!(slice.is_none()); } #[test] fn test_get_mut_slice() { let mut src = ParallelVec::new(); src.extend(vec![(1, 2), (3, 4), (5, 6), (7, 8)]); let slice = src.get_mut(1..3); assert!(slice.is_some()); let mut slice = slice.unwrap(); assert_eq!(slic...
Rust
0
TRUE, TRUNCATE, UESCAPE, UNION, UNIQUE, UNKNOWN, UNNEST, UPDATE, UPPER, USER, USING, VALUE, VALUES, VALUE_OF, VAR_POP, VAR_SAMP, VARBINARY, VARCHAR, VARYING, VERS...
Rust
0
from mv3d.baselines.fastmvsnet.lightningmodel import FastMVSNetPLModel from mv3d.eval.main import main import torch def process_scene(batch, scene, dset, net): with torch.no_grad(): out, _ = net(batch, (0.125, 0.25, 0.5), (1.0, 0.75, 0.15), 0.5, 0.05, 96, move_to_cpu=True) depth_preds = out['flow...
Python
1
, T> Handle<'a, T> { /// Creates a new handle. /// /// `inner` must contain a `StaticInner<T>` or a `DynamicInner<T>`. fn new(inner: CacheEntryInner<'a>) -> Self where T: 'static, { let inner = loop { if let Some(inner) = inner.0.downcast_ref::<StaticInner<T>>() { ...
Rust
0
bled, skipping event polling") return logger.info("Starting Keycloak event polling") poller = KeycloakEventPoller() try: while True: # Poll for events events = poller.poll_events() # Process events if events: logger.info(f"Fo...
Python
1
m"); config::init(); assert_eq!( env::var("DEFAULT_CONCAT_ENV"), Ok("string/custom".to_string()) ); } } mod test_case_18 { itconfig::config! { DATABASE_URL < ( "postgres://", PG_USERNAME, ":", PG_PASSWORD, ...
Rust
0
+ '.jpg') gt = Image.open(img_path) w, h = gt.size[0], gt.size[1] # gt = np.array(gt, dtype=np.int32) # shape = [h, w], 0-20 is classes, 255 is ingore boundary pred = [] pred.append(np.zeros((num_classes+1, h, w), np.float32)) pred.append(np.zeros((num_classes+1, h, w)...
Python
1
bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _EMAC_DMAOPMODE_FEFW<'a> { w: &'a mut W, } impl<'a> _EMAC_DMAOPMODE_FEFW<'a> { #[doc = r"Sets the field bit"...
Rust
0
from termcolor import colored def printBanner(): print (r''' ('-. .-') _ ('-. .-. .-') _ .-') _ ('-. _ .-') _( OO) ( OO) ) ( OO ) / ( OO ) )( OO) ) _( OO)( \( -O ) ,--. ,--.(,------./ '._ ,-.-') ,--. ,--. ,-...
Python
1
level_info.accept(&mut visitor, level_info_version)?; } } VisitDirection::In => { let num_level_infos: usize = number_of_level_infos .try_into() .context("the serialized NumberOfLevelInfos field was negative")?; ...
Rust
0
"""Debug vertical positioning issues""" import json # Read current data with open('test_shape_location.json', 'r') as f: json_data = json.load(f) json_coords = json_data['shapes']['shape_218']['fields'] img_dims = json_data['shapes']['shape_218']['image_dimensions'] print("VERTICAL POSITIONING DEBUG") print("="...
Python
1
one for APPLY_SNAPSHOT_VHDSET_PARAMETERS_0 { fn clone(&self) -> Self { *self } } #[repr(C)] #[doc = "*Required features: `\"Win32_Storage_Vhd\"`*"] pub struct APPLY_SNAPSHOT_VHDSET_PARAMETERS_0_0 { pub SnapshotId: ::windows_sys::core::GUID, pub LeafSnapshotId: ::windows_sys::core::GUID, } impl :...
Rust
0
mut Vec<u8>) { self.payload.encode(bytes); } fn read(typ: ExtensionType, r: &mut Reader) -> Option<UnknownExtension> { let payload = try_ret!(Payload::read(r)); Some(UnknownExtension { typ: typ, payload: payload, }) } } declare_u8_vec!(ECPointFormatL...
Rust
0
location = forms.CharField( max_length=200, widget=forms.TextInput(attrs={"class": "form-control", "placeholder": "Local do Evento"}), label="Local", ) # Campo para a descrição do evento description = forms.CharField( widget=forms.Textarea(attrs={"class": "form-control", "pla...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 2019/1/5 20:23 # @Author : Miyouzi # @File : Config.py # @Software: PyCharm import os, json, re, sys, requests, time, random, codecs, chardet import sqlite3 import socket from urllib.parse import quote from urllib.parse import urlencode # 你猜猜看我是 .exe 或是 ...
Python
1
bool { path1_count7(f) == 38 } /// Path Semantical Logic: Returns `true` if proposition is correct, `false` otherwise. /// /// For more information, see the section "Path Semantical Logic" at the top level documentation. pub fn path1_prove8<F: FnMut((u64, u64, u64, u64), (u64, u64, u64, u64)) -> u64>(f: &mut F) ->...
Rust
0
let mut tier2_trigger: bool = false; let mut tier3_trigger: bool = false; let tier1_config = ReadonlyPrefixedStorage::new(LUCKY_NUMBER_CONFIG_TIER_1, &deps.storage); let min_entries_tier1: i16 = load(&tier1_config, b"min_entries")?; let tier1_rounds = ReadonlyPrefixedStorage::multilevel(&[ROUNDS_S...
Rust
0
lse: prompts_cabinet.add_base_assembly_prompts(self) tkh = self.get_prompt("Toe Kick Height").get_var('tkh') tk_setback = self.get_prompt("Toe Kick Setback").get_var('tk_setback') self.design_carcass = assemblies_cabinet.add_design_carcass(self,self.exposed_interior) ...
Python
1
""" 时间周期计算测试 验证基于cron表达式和执行时间的周期计算准确性 """ import pytest from datetime import datetime import sys import os # 添加项目根路径到Python路径 project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, project_root) from app.utils.time_context import TimeContextManager class TestTimePeriodCalcula...
Python
1
f.write_str(s) } fn p_if(&mut self, cond: bool, s: &str) -> fmt::Result { if cond { self.f.write_str(s)?; } Ok(()) } fn p_delim(&mut self, first: &mut bool, s: &str) -> fmt::Result { self.p_if(!std::mem::take(first), s) } fn write_fmt(&mut self, f: fmt...
Rust
0
x2 = self.frb_2(x2) # (8, 208, 28, 28) x2_up = F.pixel_shuffle(x2, 2) # (8, 32, 56, 56) x2_f = self.fem_2(torch.cat((x2, x3_f_a_en1, x4_f_a_en2 ), 1)) # (8, 128, 28, 28) ...
Python
1
in svocabs: return [svocabs[c], 0, 0] i = ord(c) if not is_korean(i): return [-1, -1, -1] elif is_jaum(i): return [i - jaum_begin, 0, 0] elif is_moum(i): return [0, i - moum_begin + jongsung_hot_begin, 0] i -= kor_begin cho = i // chosung_base jung = ( i ...
Python
1
import json from .oauth import OAuth2Test class CognitoAuth2Test(OAuth2Test): backend_path = "social_core.backends.cognito.CognitoOAuth2" pool_domain = "https://social_core.auth.eu-west-1.amazoncognito.com" expected_username = "cognito.account.ABCDE1234" access_token_body = json.dumps({"access_token"...
Python
1
rd.as_str())?)?; tag_value.set_named_property("weight", ctx.env.create_double(t.weight)?)?; js_tags.set_element(index as _, tag_value)?; } Ok(js_tags) } #[js_function] fn insert_word(ctx: CallContext) -> Result<JsUndefined> { ctx.env.get_undefined() } #[js_function(1)] fn load_tfidf_dict(ctx: CallConte...
Rust
0
KEN_1_ID, 100, TOKEN_2_ID, 1000), Error::<Test>::WrongInitialization ); }); } #[test] fn init_should_fail_4() { new_test_ext().execute_with(|| { init_tokens(1000); approve(ALICE, POOL); assert_noop!( Dex::init(Origin::signed(ALICE), POOL, 3, 100 * MIL, 4, 1000 * MIL), pallet_erc1155::Error::<Test>::...
Rust
0
import pandas as pd file_path = r"C:\Users\mkd\Desktop\Programming\Projects\Resolving Discrepancies\Interest Rates Map (K-Drive).xlsm" df_ms = pd.read_excel(file_path, sheet_name='MS', header=2) # Update with correct sheet name df_pm = pd.read_excel(file_path, sheet_name='PM', header=2) # Update with correct sheet na...
Python
1
__import__('_distutils_hack').do_override()
Python
1
} #[doc(hidden)] #[derive(Debug, Clone)] pub struct SubClosure<F, G>(F, G); impl<F, G> Fun for SubClosure<F, G> where F: Fun, G: Fun<T = F::T>, F::T: Clone, F::V: Sub<G::V>, { type T = F::T; type V = <F::V as Sub<G::V>>::Output; fn eval(&self, t: F::T) -> Self::V { self.0.eval(t.c...
Rust
0
import torch from .GaussJacobiQuadRule_V3 import GaussLobattoJacobiWeights # os.chdir(sys.path[0]) class Quad_Integral2d: def init(self, Q, device='cpu'): self.Q = Q a, b = 0, 0 [X, W] = GaussLobattoJacobiWeights(Q, a, b) X, Wx = torch.tensor(X,dtype=torch.float32), torch.tens...
Python
1
cfg(feature = "postgres")] mod postgres; pub use in_memory::ProInMemoryContext; #[cfg(feature = "postgres")] pub use postgres::PostgresContext; use crate::contexts::{Context, Db}; use crate::pro::users::{UserDb, UserSession}; use async_trait::async_trait; use tokio::sync::{RwLockReadGuard, RwLockWriteGuard}; /// A ...
Rust
0
ross all expert outputs # # (across the batch and sequence dimensions) # feature_variance = squared_diff.mean( # dim=[1, 2] # ) # Shape: [num_experts, hidden_size] # # Higher variance means the expert is more "specialized" or "unique" # # We want to reward this uniq...
Python
1
#!/usr/bin/env python3 """ Git Extract Changelog Entries This script iterates through Git commits and extracts a changelog line for all merged pull request in the given range to stdout Usage: python script.py --start_commit <start_commit> \ [--end_commit <end_commit>] [--repo_path /path/to/your/repo] Depend...
Python
1
name) reason = reason if reason else "Not specified." if failed: status = f"Gagal membatalkan fban di {len(failed)}/{total} federasi.\n" for i in failed: status += "• " + i + "\n" else: status = f"Berhasil Un-fbanned Pengguna ini di {total} federasi." reason = reas...
Python
1
from enum import IntEnum class GroupBy(IntEnum): """ Enum used to select what way the triggers should be grouped when using the function 'copy_trigger_tree_per_player'. Each mode has it's own explanation explained in the corresponding docstring. """ NONE = -1 """ Don't group triggers. Add ...
Python
1
/> </diagonal> </border> <border diagonalUp="1" diagonalDown="1"> <left/> <right/> <top/> <bottom/> <diagonal style="thin"> ...
Python
1
# To get an insight into naive recursive way to solve the Knapsack problem """ A shopkeeper has bags of wheat that each have different weights and different profits. eg. no_of_items 4 profit 5 4 8 6 weight 1 2 4 5 max_weight 5 Constraints: max_weight > 0 profit[i] >= 0 weight[i] >= 0 Calculate the maximum profit that...
Python
1
, IndependentJoint, RandomVariable}; use rand::prelude::*; use rand_distr::Beta as RandBeta; use std::{ops::BitAnd, ops::Mul}; /// Beta distribution #[derive(Clone, Debug)] pub struct Beta; #[derive(thiserror::Error, Debug)] pub enum BetaError { #[error("'α' must be positive")] AlphaMustBePositive, #[erro...
Rust
0
} #[test] fn test_from_str() { assert_eq!("CAPILLARY".parse(), Ok(Platform::Capillary)); assert_eq!("DNBSEQ".parse(), Ok(Platform::DnbSeq)); assert_eq!("LS454".parse(), Ok(Platform::Ls454)); assert_eq!("ILLUMINA".parse(), Ok(Platform::Illumina)); assert_eq!("SOLID".par...
Rust
0
import torch from typing import Optional from localizers.config import PostLocalizerConfig, LocalizerConfig from localizers.base import PostLocalizer, Localizer from localizers.two_view import TwoViewPostLocalizer def create_localizer( conf: LocalizerConfig, device: Optional[torch.device] = None ) -> Localizer: ...
Python
1
# Copyright 2017-2023 Posit Software, PBC # # 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 ...
Python
1
{ (self.inner.width, self.inner.height) } pub fn set_data(&self, data: &[u8]) { self.set_region(0, 0, self.inner.width, self.inner.height, data); } pub fn set_region(&self, x: i32, y: i32, width: i32, height: i32, data: &[u8]) { unsafe { assert_eq!(width as usize *...
Rust
0
Err); } Ok(MsgHeaderWrapper::Known(MsgHeader { magic: m, msg_type, msg_len, })) } None => { // Unknown msg type, but we still want to limit how big the msg is. let max_len = default_max_msg_size() * 4; if msg_len > max_len { error!( "Too large read (unknown msg t...
Rust
0
#Here in order to notify the users we will use the observer design pattern #this follower is the observer that will receive the updates class Follower: def __init__(self,name): self.name=name def receive_update(self,user_name,update): print(f"{self.name} received updates from {user_name}:{u...
Python
1
features: `\"Win32_System_Diagnostics_Debug\"`*"] pub const DEBUG_CSS_ALL: u32 = 4294967295u32; #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"] pub const DEBUG_CSS_COLLAPSE_CHILDREN: u32 = 64u32; #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"] pub const DEBUG_CSS_LOADS: u32 = ...
Rust
0
.unwrap() } } impl MorphySerde for Shaped { fn encode<W: fmt::Write>(&self, f: &mut W) -> fmt::Result { use self::ShapeKind::*; write!( f, "s:{},", match self.kind { Latin => "l", Number { is_float } => { i...
Rust
0
trivial castable to a `*mut T::VTable`. In other words, /// `ptr` should also be equal to `*mut *mut T::VTable` /// /// `ptr` must live for at least as long as the `InterfacePtr` /// /// # Panics /// /// Panics if `ptr` is null pub unsafe fn new(ptr: *mut c_void) -> InterfacePtr<T> { ...
Rust
0
# %% """Chance-Constrained Test Case.""" from pathlib import Path import pandas as pd import pomato from scipy.stats import norm import plotly.graph_objects as go from plotly.offline import plot import plotly.io as pio pio.renderers.default = "browser" # %% wdir = Path("./examples") # Change to local copy of examples ...
Python
1
SeaLevelTool = 7, EditReplaceTool = 8, RegionFillTool = 9, RegionPasteTool = 10, Other = 11, } #[derive(Debug, Copy, Clone, EnumConvert)] pub enum TextTruncate { None = 0, AtEnd = 1, } #[derive(Debug, Copy, Clone, EnumConvert)] pub enum TextureMode { Stretch = 0, Wrap = 1, Static =...
Rust
0
); self.mir_intrinsic_to_ast(ctx, NumericIntrinsic::Ctpop, z, kind) }, } } } use crate::Book; use serde::{Deserialize, Serialize}; pub type Chapter = u16; pub type Verse = u16; #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, Serialize, Deserialize)] /// A possibly-incomplete ...
Rust
0
""" 定义了船体的绘制类 """ from typing import Union, Literal import numpy as np # from main_logger import Log import OpenGL.GL as gl from main_logger import Log from pyqtOpenGL import Matrix4x4, GLGraphicsItem, GLMeshItem, Quaternion from pyqtOpenGL.items.MeshData import SymetryCylinderMesh, EditItemMaterial # 从正下方开始,逆时针排列(向z...
Python
1
is possible println!("Pointer is now: {:p}", addr); println!("Dereferencing addr will now segfault: {}", *addr); } } }); } use juniper::GraphQLEnum; use serde::{Deserialize, Serialize}; pub mod environments; pub mod features; #[derive(Debug, PartialEq, Serializ...
Rust
0
from dataclasses import dataclass from resources.devices.Router import Router from resources.user.User import User from resources.login_and_dataloading.operating_on_project_files import (get_aes_cipher, get_device, get_list_of_devices_in_json_from)...
Python
1
emporary directory, and changes into it. On exit returns to original directory and removes temporary dir. Parameters ---------- files : sequence of filenames Files to be copied across to temporary directory. capture_files : sequence of filenames Files to be copied back from tempora...
Python
1
// Step 2: Reverse the weakly increasing part self[i..].reverse(); // Step 3: Find the rightmost element equal to or bigger than the pivot (i-1) let mut j = self.len() - 1; while j >= i && self[j-1] < self[i-1] { j -= 1; } // Step 4: Swap that element wit...
Rust
0
(GROUP4_A::_0001) } #[doc = "FB_BE_15_8"] #[inline(always)] pub fn _0010(self) -> &'a mut W { self.variant(GROUP4_A::_0010) } #[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 & !(0x0f ...
Rust
0
83E9E94F9EA79BD640DC962533B0680793A38D53 run_rfc6979_test!(Sha256, sample, public, private, k vec![0x89,0x26,0xA2,0x7C,0x40,0x48,0x42,0x16, 0xF0,0x52,0xF4,0x42,0x7C,0xFD,0x56,0x47, 0x33,0x8B,0x7B,0x39,0x39,0xBC,0x65,0x73, 0xAF,0x43,0x33,0x56,0...
Rust
0
autoDelete=new_auto_delete, deviceName=disk.deviceName, instance=ref.Name(), project=ref.project, zone=ref.zone))) if set_auto_delete_requests: self.PromptIfDisksWithoutAutoDeleteWillBeDeleted(disks_to_warn_for) errors ...
Python
1
mId, pub tydef: Option<(ThmId, mm0::TydefId)>, } #[derive(Debug)] pub struct ConstDef { pub name: String, pub ty: OwnedType, pub mm0: (mm0::TermId, mm0::ThmId), } #[derive(Debug)] pub struct ThmDef { pub arena: TermStore, pub tyvars: Box<[TyVarId]>, pub hyps: Box<[TermId]>, pub concl: TermId, pub mm...
Rust
0