text
string
label_name
string
labels
int64
les_directory(settings::SETTINGS.collectors.tg.files_directory.clone()) .log_verbosity_level(settings::SETTINGS.collectors.tg.log_verbosity_level) .max_download_queue_size(settings::SETTINGS.collectors.tg.max_download_queue_size) .encryption_key(settings::SETTINGS.collectors.tg.encryption_key.cl...
Rust
0
let mut handler = MockHandlerHolder::new(); handler.memory[0x0000] = opcode; let mut cpu = Cpu::new(Box::new(handler)); reset_all_registers(&mut cpu); cpu.set_A_reg(a); cpu.set_B_reg(b); cpu.next_instruction(); assert_eq!(cpu.get_H_flag(), expected); assert_eq!(cpu.get_A_reg(),...
Rust
0
lue(&tag)); } let temp = std::env::temp_dir(); nu_dict.insert_value("temp-dir", UntaggedValue::path(temp).into_value(&tag)); let config = nu_data::config::default_path()?; nu_dict.insert_value("config-path", UntaggedValue::path(config).into_value(&tag)); let keybinding_path = crate::keybindin...
Rust
0
ackhide__ = True cls.raise_if( val=not val, resource_name=resource_name, field_value=field_value, field_name=field_name, msg=msg, ) class ValidationException(MDRApiBaseException): """ An exception raised when a submitted form or docu...
Python
1
Determines how bars at the same location coordinate are displayed on the graph. With "group", the bars are plotted next to one another centered around the shared location. With "overlay", the bars are plotted over one anoth...
Python
1
{ continue; } else { word_counter.increment(word); } } } word_counter.display(); } use std::io; use std::sync::Arc; use async_trait::async_trait; use crate::proxy::InboundHandler; use crate::proxy::{InboundTransport, TcpInboundHandler}; pub st...
Rust
0
nal[RequestOptions] Request-specific configuration. Returns ------- Tool Successful Response Examples -------- from letta_client import Letta client = Letta( token="YOUR_TOKEN", ) class InventoryItem(BaseMode...
Python
1
w(Arc::new(|| { $body; })); $b.iter(|| { $body; }); drop(t); }; ($b:ident, $pre:expr, $body:expr) => { reset(); $pre; let t = LThreads::new(Arc::new(|| { $body; })); $b.iter(|| { $body; }); drop(t); }; } ...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- from pwnpwnpwn import * from pwn import * #host = "10.211.55.28" #port = 8888 host = "chat.pwn.seccon.jp" port = 26895 r = remote(host,port) def signup(name): r.recvuntil("menu >") r.sendline("1") r.recvuntil("name >") r.sendline(name) def signin(name)...
Python
1
from unittest import TestCase import responses from requests import Session from ...controllers import SpansController from ...models import Project, ProjectTypes from ...utils.response import DoccanoAPIError from .mock_api_responses import bad from .mock_api_responses import spans as mocks class SpansControllerTes...
Python
1
(f, 50, 1000).await; run_test_async(f, 100, 1000).await; } #[tokio::test] async fn encoding_storage_new_without_not_default_incarnation_find_without_incarnation() { let db = kv::new_mem_database().unwrap(); let tx = db.begin_mutable().await.unwrap(); let tx = &tx; l...
Rust
0
can_author_with: Default::default(), } } /// Calls in transactions. #[derive(Clone, PartialEq, Eq, Encode, Decode)] #[cfg_attr(feature = "std", derive(Debug))] pub struct Transfer { pub from: AccountId, pub to: AccountId, pub amount: u64, pub nonce: u64, } impl Transfer { /// Convert into a signed extrinsic. ...
Rust
0
ag="2")] pub message: ::prost::alloc::string::String, } #[derive(::serde::Serialize, ::serde::Deserialize)] #[serde(rename_all = "camelCase")] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InsertOneResult { #[prost(string, tag="1")] #[serde(skip_serializing_if = "String::is_empty")] pub id: :...
Rust
0
from tests.pipeline.utils import assert_load_info def intro_snippet() -> None: # @@@DLT_SNIPPET_START api import dlt from dlt.sources.helpers import requests # Create a dlt pipeline that will load # chess player data to the DuckDB destination pipeline = dlt.pipeline( pipeline_name="ch...
Python
1
# -*- coding: utf-8 -*- from odoo.exceptions import UserError from odoo import models, api, _, fields class ProductAttrValueInstance(models.Model): _name = 'product.attr.value.instance.exp' _description = 'Product Attribute Value Export' woo_instance_id = fields.Many2one('woo.instance') def product...
Python
1
/// Leone #[serde(rename = "694")] N694, /// Leu #[serde(rename = "642")] N642, /// Lev #[serde(rename = "100")] N100, /// Liberian Dollar #[serde(rename = "430")] N430, /// <NAME> #[serde(rename = "434")] N434, /// Lilangeni #[serde(rename = "748")] N748, /// Lithuanian Litas #[serde(rename = "440...
Rust
0
mistake_count >= 1: status += '│ ' if mistake_count >= max_mistake_count: status += '╱ ╲ ' elif mistake_count >= 1: status += ' ' * len('╱ ╲ ') if mistake_count >= max_mistake_count: status += 'You have made too many incorrect guesses' ...
Python
1
from odoo import fields, models, api from odoo.exceptions import ValidationError class AccountPayment(models.Model): _inherit = 'account.payment' l10n_ar_partner_vat = fields.Char(related='partner_id.l10n_ar_vat', string='CUIT del destinatario')
Python
1
eck_var: self.update_generate_option( name, var ), ) def update_generate_option(self, name, var): self.config["generate"][name] = var.get() def save_changes(self): with open("config.json", "w") as f: json.dump(self.config, f, indent=4...
Python
1
from examples.benchmarks import solveSudoku import time import copy # sudoku def py_solve_sudoku(board): empty = find_empty(board) if not empty: return True row, col = empty for i in range(1, 10): if valid(board, i, (row, col)): board[row][col] = i if py_solve_s...
Python
1
s > RESCHEDULE_TOKENS or ( not shortlived and cumulative_time > RESCHEDULE_SECONDS ) ) ): print("******** pov producer getting a sibling") launched_sub_worker = True ...
Python
1
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
1
""" ********************************************************************* You should write a function that will receive a positive integer and return: "Fizz" if the number is divisible by 3 (3, 6, 9 ...) otherwise convert the given number to a string (2 -> "2"). *********************************************************...
Python
1
# ean.py - functions for handling EANs # # Copyright (C) 2011-2017 Arthur de Jong # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option...
Python
1
, 'š': 's', 'Ţ': 'T', 'ţ': 't', 'Ť': 'T', 'ť': 't', 'Ŧ': 'T', 'ŧ': 't', 'Ũ': 'U', 'ũ': 'u', 'Ū': 'U', 'ū': 'u', 'Ŭ': 'U', 'ŭ': 'u', 'Ů': 'U', 'ů': 'u', 'Ű': 'U', 'ű': 'u', 'Ŵ': 'W', 'ŵ': 'w', 'Ŷ': 'Y', 'ŷ': 'y', 'Ÿ': 'Y', 'Ź': '...
Python
1
let src = [h0, h1, h2, h3]; let dst = merkle_compress_all_leaves(&src, 2); assert_eq!(dst, h6); } #[test] fn test_merkle_gen_auth_0() { let h0 = hash::tests::HASH_ELEMENT; let h1 = hash::hash_n_to_n_ret(&h0); let h2 = hash::hash_n_to_n_ret(&h1); let h3...
Rust
0
x = torch.cat([corr, feats], dim=-1) if self.update_edge: h, edge_attr = layer(x, edge_index, edge_attr, batch) # [N,hidden_dim] else: h = layer(x, edge_index, edge_attr, batch) # [N,hidden_dim] corr, feats = h[:, 0:3], h[:, 3:] ...
Python
1
for r in &mut result[..] { *r = 0; } // XXX: Questionable as far as constant-timedness is concerned. // TODO: Improve this. input.read_all(error::Unspecified, |input| { for i in 0..num_encoded_limbs { let mut limb: Limb = 0; for _ in 0..bytes_in_current_limb { ...
Rust
0
from django.core.management import BaseCommand, call_command from django.utils import timezone from config.utils.sms import BaseSMS from employee.models import Employee class Command(BaseCommand): def handle(self, *args, **options): employees = Employee.objects.filter(active=True, ...
Python
1
` < 2^`n`. /// /// This proof uses a [`merlin`] transcript to generate a challenge /// scalar for use as a non-interactive proof protocol. /// /// This function returns the bit commitment, `B`, its assosciated /// [`BitProof`], and the challenge scalar `x`. /// /// ``` /// # use rand...
Rust
0
} } fn test_set_style(){ for i in tbl::TextStyle::iterator(){ tbl::set_colour(tbl::UC::Std, tbl::XG::FG); tbl::set_style(*i); println!("haha yes"); } } fn test_set_colours(){ for fg in tbl::UC::iterator(){ for bg in tbl::UC::iterator(){ tbl::set_colours(*fg,...
Rust
0
).to(cls_preds.device) xs = xs.view(batch, -1, 1) + batch_reg[:, :, 0:1] ys = ys.view(batch, -1, 1) + batch_reg[:, :, 1:2] xs = xs * self.out_size_factor * self.voxel_size[0] + self.cav_lidar_range[0] ## 基于feature_map 的size求解真实的坐标 ys = ys * self.out_size_factor * self.voxel_size[1] +...
Python
1
# -*- coding: utf-8 -*- import pygcb def CreateDBObject(): dbObj=pygcb.tcWeaponDamage() dbObj.databaseClass='BlastFragAir130kg' dbObj.maxRange_m=4073.230225 dbObj.probDetonate=0.850000 dbObj.blastCharge_kg=23.393738 dbObj.fragCharge_kg=59.804176 dbObj.radCharge_kg=2.339374 dbObj.fragMeta...
Python
1
message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module iisutf-8N( R#R$RR%RRRRRR&R'(R RR,R(R)RR*((s/home/dmerej/src/master/tools/qitoolcha...
Python
1
3 => { if data >= pins.len() { ReturnCode::EINVAL /* impossible pin */ } else { let pin_state = pins[data].read(); ReturnCode::SuccessWithValue { value: pin_state as usize } } } ...
Rust
0
// ===== impl Handle ===== impl<F, N> Handle<F, N> where F: Filter<N> + 'static, { pub fn reload(&self, new_filter: impl Into<F>) -> Result<(), Error> { self.modify(|filter| { *filter = new_filter.into(); }) } /// Invokes a closure with a mutable reference to the current fi...
Rust
0
# -*- coding: utf-8 -*- # If your documentation needs a minimal Sphinx version, state it here. needs_sphinx = "1.5" # Add any Sphinx extension module names here, as strings. # They can be extensions coming with Sphinx (named 'sphinx.ext.*') # or your custom ones. extensions = () # Add any paths that contain template...
Python
1
with open(r'txt\26_8279.txt') as file: t, N, M = map(int, file.readline().split()) data = [list(map(int, i.split())) for i in file] clients = [i for i in data if i[2] <= M] clients = sorted(clients, key=lambda x: (-x[0], x[1], -x[2]), reverse=True) print(clients) buy_items = [] for i in clients: summ = su...
Python
1
etail] = cap_details_scores[detail] / cap_details_counts[detail] * 100 eval_logger.info(f"Score for {detail}: {cap_details_scores[detail]:.2f}") return overall_score def doc_to_text(doc, lmms_eval_specific_kwargs=None): if lmms_eval_specific_kwargs is None: return doc["question"] question...
Python
1
as f64 / 1000.0); ren.filled_circle((p.rx * width as f64) as i16, (p.ry * height as f64) as i16, (p.radius * width as f64) as i16, *color).unwrap(); ren.aa_circle((p.rx * width as f64) as i16, ...
Rust
0
RST_20H, ADD_SP_r8(r8), JP_pHL, LD_pa16_A(a16), XOR_d8(d8), RST_28H, LDH_A_pa8(a8), POP_AF, LD_A_pC, DI, PUSH_AF, OR_d8(d8), RST_30H, LD_HL_SPp_r8(r8), LD_SP_HL, LD_A_pa16(a16), EI, CP_d8(d8), RST_38H, } #[allow(non_camel_case_types)] #[derive(Cl...
Rust
0
5C\x5D\x5E\x5F\ \x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\ \x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x...
Rust
0
if not cpu: generator = DataParallelWithCallback(generator) kp_detector = DataParallelWithCallback(kp_detector) generator.eval() kp_detector.eval() return generator, kp_detector def make_animation(self, source_image, driving_video, generator, kp_detector, ...
Python
1
pub fn ChildWindowFromPointEx( hwnd: HWND, pt: POINT, flags: UINT, ) -> HWND; } pub const CTLCOLOR_MSGBOX: c_int = 0; pub const CTLCOLOR_EDIT: c_int = 1; pub const CTLCOLOR_LISTBOX: c_int = 2; pub const CTLCOLOR_BTN: c_int = 3; pub const CTLCOLOR_DLG: c_int = 4; pub const CTLCOLOR_SCROL...
Rust
0
@Error.setter def Error(self, Error): self._Error = Error def _deserialize(self, params): self._TaskID = params.get("TaskID") self._MiniAppID = params.get("MiniAppID") self._MiniAppName = params.get("MiniAppName") self._MiniAppVersion = params.get("MiniAppVersion") ...
Python
1
(messages.keys(), reverse=True)] sorted_messages.insert(0, f"【汇总】\n" f"总上传:{StringUtils.str_filesize(incUploads)}\n" f"总下载:{StringUtils.str_filesize(incDownloads)}\n" f"—————————...
Python
1
detection"), ) .with_system( level_of_detail_system .system() .label("level_of_detail") .after("chunk_generator"), ) .with_system( ...
Rust
0
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. """The debug module contains utilities and functions for better debugging Gunicorn.""" import sys import linecache import re import inspect __all__ = ['spew', 'unspew'] _token_spliter = re....
Python
1
print(f"Episode {episode_id} processed successfully!") except Exception as e: print(f"Failed to process episode {episode_id}: {e}") print(f"All episodes for task {task_name} processed successfully!") if __name__ == "__main__": parser = argparse.ArgumentParser(description="Genera...
Python
1
import os from detectron2.config import CfgNode as CN def add_boundaryformer_config(cfg): """ Add config for BoundaryFormer. """ # We retry random cropping until no single category in semantic segmentation GT occupies more # than `SINGLE_CATEGORY_MAX_AREA` part of the crop. cfg.INPUT.CROP....
Python
1
_type!("uint16z", Uint16z, u16, read_u16, 0x0000); base_type!("uint32z", Uint32z, u32, read_u32, 0x00000000); base_type!("sint64", Sint64, i64, read_i64, 0x7FFFFFFFFFFFFFFF); // 2's complement format base_type!("uint64", Uint64, u64, read_u64, 0xFFFFFFFFFFFFFFFF); base_type!("uint64z", Uint64z, u64, read_u64, 0x000000...
Rust
0
handle, &sheet, (num_generated / num_per_row * size * 2) as u32, (num_generated / num_per_row * size * 2) as u32) .is_err() { println!("Failed composing image data"); } } } // Copyright © 2015, <NAME> // Licensed under t...
Rust
0
ize_rpc_sync_info() { let sync_state = r#"{ "currentBlock": "0x42", "highestBlock": "0x9001", "knownStates": "0x1337", "pulledStates": "0x13", "startingBlock": "0x0" }"#; let value: SyncState = serde_json::from_str(sync_state).unwrap(); ...
Rust
0
Url>().unwrap(); let keypair = keypair::read_keypair_file("tests/fixtures/solana_test.json")?; request_airdrop(base_url.clone(), &keypair).await?; let result = create_sol_transaction(base_url, &keypair, 42).await?; println!("{}", result); Ok(()) } #[tokio::test] asy...
Rust
0
import FWCore.ParameterSet.Config as cms from RecoBTag.SecondaryVertex.vertexTrackSelection_cff import * from RecoBTag.SecondaryVertex.vertexReco_cff import * from RecoBTag.SecondaryVertex.vertexCuts_cff import * from RecoBTag.SecondaryVertex.vertexSelection_cff import * secondaryVertexTagInfos = cms.EDProducer("Seco...
Python
1
{ Idp2pDigest::Sha256 { digest: Code::Sha2_256.digest(content).digest().to_vec(), } } pub fn from(code: u64, digest: &[u8]) -> Result<Self> { match code { SHA256_CODE => Ok(Idp2pDigest::Sha256 { digest: digest.to_vec(), }), ...
Rust
0
, D::Error> where D: Deserializer<'de>, { deserializer.deserialize_seq(MatchPathVisitor) } } #[cfg(test)] mod test { use super::*; #[test] pub fn test_status_code_schema() { serde_json::to_string_pretty(&schemars::schema_for!(MatchingPath)).unwrap(); } #[test] ...
Rust
0
.contains(ThermalPowerFeaturesEax::TURBO_BOOST) ); assert!(tpfeatures.eax.contains(ThermalPowerFeaturesEax::ARAT)); assert!(tpfeatures.eax.contains(ThermalPowerFeaturesEax::PLN)); assert!(tpfeatures.eax.contains(ThermalPowerFeaturesEax::ECMD)); assert!(tpfeatures.eax.contains(ThermalPowerFeaturesEax...
Rust
0
import os from trainer import Trainer, TrainerArgs from TTS.utils.audio import AudioProcessor from TTS.vocoder.configs import UnivnetConfig from TTS.vocoder.datasets.preprocess import load_wav_data from TTS.vocoder.models.gan import GAN output_path = os.path.dirname(os.path.abspath(__file__)) config = UnivnetConfig(...
Python
1
adjustments emotion_adjustments = { "inspired": {"detection_threshold": 0.7, "enhancement_level": 0.8}, "confident": {"detection_threshold": 0.8, "enhancement_level": 0.9}, "curious": {"detection_threshold": 0.6, "enhancement_level": 0.6}, "excited": {"detection_...
Python
1
return ret; } } } for _ in 0..65_536 { let range = ranges[rnd.gen_range(0..ranges.len())].clone(); if let Some(ch) = ::core::char::from_u32( rnd.gen_range(*range.start() as u32..*range.end() as u32 + 1), ) { return (*range.start() as u32, c...
Rust
0
[512, 512, 5, 3, True, 1, 4], [512, 512, 5, 5, True, 1, 4, mhsa(8, 64, 64, 12)], [512, 512, 5, 0, True, 1, 4, mhsa(8, 64, 64, 12)], [512, 512, 5, 0, True, 1, 4, mhsa(8, 64, 64, 12)], [512, 512, 5, 0, True, 1, 4, mhsa(8, 64, 64, 12)], [512, 512, 5, 0, True, 1, ...
Python
1
elf) -> RXDATA_R { RXDATA_R::new((self.bits & 0x00ff_ffff) as u32) } } <reponame>cecelo01/ServiceLocatorPatternDI-LocalizadorDeServico service.locator.pattern.ServicoEmail <gh_stars>0 mod local_disk_data_store; pub mod world_data_store; use crate::config::Config; use legion::World; use winit::event::Window...
Rust
0
while True: try: odd_sum = 0 cycle = 0 user_input = str(abs(int(input('Введите число с нечётными цифрами, а я посчитаю их сумму первых трёх: ')))) while True: for n in user_input: if int(n) % 2 == 1: while cycle < 3: ...
Python
1
from db import pinecone, supabase from util.openai import text_embedding from typing import Union import json def query_pinecone_document(text: str, top_k: int): try: text_vector = text_embedding(text) index = pinecone.Index("assembly-comp") query_res = index.query( vector=text...
Python
1
bad, in which case something like [`Walkdir`](https://crates.io/crates/walkdir) might make more sense. ## Installation Add `dowser` to your `dependencies` in `Cargo.toml`, like: ```ignore [dependencies] dowser = "0.3.*" ``` ## Features | Feature | Description | | ------- | ----------- | | `regexp` | Enable th...
Rust
0
tionResult = [] for key in keyList: print(key, points[key]) detectionResult.append(DetectionResult(self.name, points[key])) if (len(detectionResult)): print("Detected something", detectionResult[0].midpoint) if self.callback and (detectionResult[...
Python
1
import random import json from datetime import datetime, timezone import time from kafka import KafkaProducer rate_per_second = 5 # Check if broker is available def is_broker_available(): global producer try: return True except Exception as e: print(f"Broker not available: {e}") re...
Python
1
atures = [ feat_level[img_idx].unsqueeze(0) for feat_level in self._features["high_res_feats"] ] low_res_masks, iou_predictions, _, _ = self.model.sam_mask_decoder( image_embeddings=self._features["image_embed"][img_idx].unsqueeze(0), image_pe=self.model.s...
Python
1
# Generated by Django 4.2.9 on 2025-06-22 10:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user_account', '0006_otpcode_created_alter_passwordresettoken_created'), ] operations = [ migrations.AlterField( model_name='pas...
Python
1
tuning_params = Arc::new(tuning); let mut config = ConductorConfig::default(); config.network = Some(network); let mut conductor = SweetConductor::from_config(config).await; conductor.update_dev_settings(DevSettingsDelta { publish: Some(false), ..Default::default() }); let (dna...
Rust
0
en(re.findall(pattern, array_str)) array_str = array_str.replace('010', '000').replace('0110', '0000') tmax_encode = np.frombuffer(array_str.encode('utf-8'), dtype=np.uint8) - ord('0') # tmax_sequence = tmax_sequence * tmax_encode frequency = count_tmax duration = np.sum(tmax_en...
Python
1
xfa\x9c\xcbO\xfcO\xdau\xbc\x91y\xf3\ 5\xb6=\xef9\x9eL\xee\xc1?\xc2b\xec\xf9tf\ \x06v\x1a\x0d\xf8\x16`\x00W\x8e\x0b\x1d\xd3\x84\xe5]\ \x00\x00\x00\x00IEND\xaeB`\x82\ \x00\x00\x18\x12\ \x89\ PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ \x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ \x00\x00\x06mzTXtRaw pr...
Python
1
import random dice_art = { 1: ("┌───────────┐", "│ │", "│ ● │", "│ │", "└───────────┘"), 2: ("┌───────────┐", "│ ● │", "│ │", "│ ● │", "└───────────┘"), 3: ("┌───────────┐", "│ ...
Python
1
&mut SysBus, region_base: u64, region_size: u64, ) -> Result<Arc<Mutex<Self>>> { self.fwcfg.common_realize()?; self.set_sys_resource(sysbus, region_base, region_size) .chain_err(|| "Failed to allocate system resource for FwCfg.")?; let dev = Arc::new(Mutex::new(...
Rust
0
_k_np, savepath, gt_k_np=None): plt.clf() if gt_k_np is None: ax = plt.subplot(111) im = ax.imshow(out_k_np, vmin=out_k_np.min(), vmax=out_k_np.max()) plt.colorbar(im, ax=ax) else: ax = plt.subplot(121) im = ax.imshow(gt_k_np, vmin=gt_k_np.min(), vmax=gt_k_np.max()) ...
Python
1
value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x07 << 13)) | (((value as u32) & 0x07) << 13); self.w } } #[doc = "Reader of field `S0CONF`"] pub type S0CONF_R = crate::R<u8, u8>; #[doc = "Write proxy for field `S0CONF`"] pub struct S0CONF_W<'a> { w: &'a mut W, } impl<'a> S0CONF_W<'a>...
Rust
0
> return Err(err), } } } Ok(()) } #[derive(Debug, PartialEq, Eq)] enum OrderState { PartialFilled, SellCKBCompleted, BuyCKBCompleted, } fn validate_order_cells(index: usize) -> Result<(), Error> { let input = Cell::load(index, Source::Input)?; let output = Cell::load(i...
Rust
0
import subprocess import os from typing import Optional from pathlib import Path def ldconfig_find(name: str) -> Optional[Path]: try: output = subprocess.check_output([ '/sbin/ldconfig', '-p' ], env={**os.environ, 'LANG': 'C', 'LC_ALL': 'C'}) output = output.decode('utf-8') ...
Python
1
match bytes.len() { 1 => bytes[0] as u64, 2 => unsafe {u16::from_le_bytes(*(bytes as *const _ as *const [u8; 2])) as u64 }, 3 => u32::from_le_bytes([bytes[0], bytes[1], bytes[2], 0]) as u64, 4 => unsafe {u32::from_le_bytes(*(bytes as *const _ as *const [u8; 4])) as u64 } ...
Rust
0
if not obj.resource.project: return None return { "slug": obj.resource.project.slug, "name": obj.resource.project.name, } class NestedEntitySerializer(EntitySerializer): translations = serializers.SerializerMethodField() class Meta(EntitySerializer.Me...
Python
1
re assumed to be zero, and the filter is padded with zeros so that its shape is a: multiple of the upsampling factor. Args: hidden_states (`torch.Tensor`): Input tensor of the shape `[N, C, H, W]` or `[N, H, W, C]`. kernel (`torch.Tensor`, *optional*): FIR filter of the ...
Python
1
import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib.pyplot import Figure, Axes from scipy.optimize import curve_fit from AeroViz.plot.utils import * __all__ = ['koschmieder'] @set_figure(figsize=(2.4, 3)) def koschmieder(df: pd.DataFrame, vis: str, ...
Python
1
et rcubes_ibuffer = glium::IndexBuffer::new( &display, glium::index::PrimitiveType::TrianglesList, &rcubes_ilist, ) .unwrap(); let vertex_shader_src = fs::read_to_string("resources/shaders/vert-shader.glsl") .expect("\n### No se encontro el archivo vertex shader. \n"); le...
Rust
0
mbeddings() assert isinstance(x, tf.keras.layers.Layer) name = model.get_bias() assert name is None else: x = model.get_output_embeddings() assert x is None name = model.get_bias() assert name is ...
Python
1
rStatus, /// Trade in a Clearing Hold #[serde(rename = "J")] TradeInAClearingHold, /// Trade has been released to Clearing #[serde(rename = "K")] TradeHasBeenReleasedToClearing, /// Triggered or Activated by System #[serde(rename = "L")] TriggeredOrActivatedBySystem, } impl Default for ExecType { fn default(...
Rust
0
nds = "\r\n* " + item['config']['keyword'] else: commands += "\r\n" + "* " + item['config']['keyword'] # Grabs explanatory text and subtext. People don't seem to use these in any particular way in that one would be more descriptive than the other # So, I'm not sure how to deal with problem to pres...
Python
1
deque2.push_back((dist.clone(), pos2, 0)); let search = |vec: &Vec<Vec<T>>, deque: &mut VecDeque<(Vec<Vec<T>>, (usize, usize), usize)>, pos: (usize, usize), step: usize| { for next in direct(pos) { ...
Rust
0
ecs::{Component, NullStorage}; #[derive(Default)] pub struct AI; impl Component for AI { type Storage = NullStorage<Self>; } <filename>src/cfr.rs use crate::game_node::*; use bincode::serialize; use rayon::prelude::*; use std::collections::HashMap; use std::fs::File; use std::io::Write; use std::sync::Mutex; /// ...
Rust
0
str_to_lines( "\ ####### #E.G#.# #.#G..# #G.#.G# #G..#.# #...E.# #######" )) .play_until_no_enemies_remain() ); } #[test] fn combat_example_5() { assert_eq!( 28_944, Grid::from(&read_str_to_lines( "\ ####### #.E...
Rust
0
QRT_2 + Self::ONE); let mut s = notbig.blend(Self::FRAC_PI_4, Self::FRAC_PI_2); s = notsmal & s; let mut a = notbig & t; a = notsmal.blend(a - Self::ONE, a); let mut b = notbig & Self::ONE; b = notsmal.blend(b + t, b); let z = a / b; let zz = z * z; // Taylor expansion let mu...
Rust
0
1_feature = [Dropout(i) for i in feature] #print(f'[mutli]: {mutli}') if mutli== True: if emb==True: #print('**********************') aux_seg1 = self.aux_decoder1(aux1_feature) feature_end = self.embed_head(aux_seg1[self.contrast_embed_index+...
Python
1
from sklearn.ensemble import RandomForestRegressor from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error import sqlite3 import pandas as pd import os import numpy as np import matplotlib.pyplot as plt filename = os.path.dirname(__file__) + "/" + 'cleaned_movie_earnings_yea...
Python
1
classes, scores, boxes], axis=-1) boxes_final.append(bboxes) bbox_num[i] = bboxes.shape[0] bbox_pred = paddle.concat(boxes_final) return bbox_pred, bbox_num def nms(dets, thresh): """Apply classic DPM-style greedy NMS.""" if dets.shape[0] == 0: return dets[[],...
Python
1
import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_time_range class TestUnconfigureTimeRange(unittest.TestCase): @classmethod def setUpClass(self): testbed = f""" devices: Startrek-SVL: connect...
Python
1
rotpos pattern"); let rev_pat = regex::Regex::new(r"^reverse positions ([0-9]+) through ([0-9]+)$") .expect("could not compile rev pattern"); let mov_pat = regex::Regex::new(r"^move position ([0-9]+) to position ([0-9]+)$") .expect("could not compile mov pattern"); // Set u...
Rust
0
name: String, physical_address: u32, virtual_address: u32, raw_data_size: u32, raw_data_offset: u32, relocations_offset: u32, line_numbers_offset: u32, relocation_count: u16, line_number_count: u16, characteristics: u32, } type PeImageSectionHeaders = Vec<PeImageSectionHeader>; #...
Rust
0
########################################################################## # # Copyright (c) 2008, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
Python
1
= FunctionBuilderContext::new(); /// # let mut func = Function::with_name_signature(ExternalName::user(0, 0), sig); /// # let mut builder = FunctionBuilder::new(&mut func, &mut fn_builder_ctx); /// # /// # let entry = builder.create_ebb(); /// # builder.switch_to_block(entry); /// # /// let block0 = builder.create_ebb...
Rust
0
interrupt. assert_eq!(queue.trigger_interrupt(&mem, &interrupt), true); // driver handle all the interrupts and update avail.used_event to u16::MAX driver_handled = device_generate; let _ = mem.write_obj_at_addr(Le16::from(driver_handled.0), used_event_address); // At this mome...
Rust
0