text
string
label_name
string
labels
int64
02000000)); let cpu = ARM7::default(); println!("{}", cpu); } <reponame>ryoon/rustc-1.19.0 //! Generic data structure deserialization framework. //! //! The two most important traits in this module are `Deserialize` and //! `Deserializer`. //! //! - **A type that implements `Deserialize` is a data structure**...
Rust
0
from concurrent.futures import ThreadPoolExecutor class Scheduler: def __init__(self, method, params, n_futures=2, n_workers=2): self.n_workers = n_workers self.n_futures = n_futures self.method = method self.params = params self._init_threads() self._updat...
Python
1
#!/usr/bin/env python3 """ 计算两个SNP位点ref base ratio的皮尔森相关系数 包含置换检验验证统计显著性 """ import numpy as np from scipy.stats import pearsonr import random import matplotlib.pyplot as plt import seaborn as sns def permutation_test(x, y, n_permutations=10000, random_seed=42): """ 执行置换检验 参数: x, y: 两组数据 n_pe...
Python
1
ME payload for the POST data """ boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254' sep_boundary = b'\n--' + boundary.encode('ascii') end_boundary = sep_boundary + b'--' end_items = end_boundary, b"\n", builder = functools.partial( cls._build_par...
Python
1
from rest_framework import serializers from .models import Referral class ReferralSerializer(serializers.ModelSerializer): referrer = serializers.StringRelatedField(read_only=True) referred = serializers.StringRelatedField(read_only=True) class Meta: model = Referral fields = '__all__'...
Python
1
bev = (255 * bev).astype(np.uint8) bev = self.to_tensor(bev) result = { 'bev': bev, 'view': torch.tensor(sample.view), } if 'visibility' in sample: visibility = Image.open(scene_dir / sample.visibility) result['visibility'] = np....
Python
1
::<()>::deserialize(&mut VVDeserializer::new(b"@{[0x53, 0x6f, 0x6d, 0x65]}")).unwrap(); assert_eq!(v, Some(())); } #[derive(PartialEq, Eq, Serialize, Deserialize, Debug)] struct NilStruct { x: (), } #[test] fn structs() { let v = NilStruct::deserialize(&mut VVDeserializ...
Rust
0
hash_query { let mut query_param = "".to_string(); query_param.push_str(&utf8_percent_encode(key, QUERY_ENCODE_SET).to_string()); if !value.is_empty() { query_param.push('='); query_param.push_str(&utf8_percent_encode(value, QUERY...
Rust
0
serde::Serialize, serde::Deserialize, )] #[strum(serialize_all = "kebab-case")] pub enum PromptNumericKind { Blink, Beep, Vibrate, InNumeric, Push, Twist, } crate::impl_tryfrom_zvariant!(PromptNumericKind); #[derive( Debug, Clone, Copy, strum::Display, strum::EnumS...
Rust
0
ype::Pointer(base)) } _ => Err(ERROR_INVALID_OPERAND), }, NodeKind::Mul(lhs, rhs) | NodeKind::Div(lhs, rhs) => match (&lhs.ctype, &rhs.ctype) { (Self::Integer(_), Self::Integer(_)) => Ok(Self::Integer(Integer::Int)), _ => Err(ERROR_...
Rust
0
::marker::PhantomData; use std::iter::FromIterator; #[derive(Debug, PartialEq, Serialize, Deserialize, Clone, Default)] pub struct Code<FlatTyp:TFlatTyp, FlatLiteral:TFlatLiteral<FlatTyp>>(pub BTreeMap<String, Expr<FlatTyp, FlatLiteral>>); pub type DPCode = Code<types::FlatTyp, literals::FlatLiteral>; pub type CPCode ...
Rust
0
ate{1}{G} & \qw \\ \lstick{\ket{0}} & \ghost{G} & \qw \\ \lstick{\ket{0}} & \qw & \qw \\ \lstick{\ket{0}} & \gate{G} \qwx[-2] & \qw \\ } "#); } #[test] fn test_conjugate() { let gate = Composite::from_string("G", "CX 0 1; X 0").unwrap(); let mut ops = [PauliOp::X, PauliOp::Y...
Rust
0
opassign_tag, pub Assignable, pub Op, pub Box<Expression>, ); def_tag!(next_tag, "next"); #[derive(Deserialize, Debug, Clone)] pub struct Next(pub next_tag, pub ArgsAddBlockOrExpressionList); impl Next { pub fn into_call_chain(self) -> Vec<CallChainElement> { vec![ ident_as_cc("ne...
Rust
0
f.write_fmt(format_args!( "Could not find indexes folder. Tried {}", ps.trim_end_matches(", ") )) } Error::InvalidIndexFile(p) => { f.write_fmt(format_args!("Invalid index file {}", p.display())) } } ...
Rust
0
acc, acc_cls, iu, mean_iu, fwavacc=iou.evaluate() precisons = np.array(precisons).mean() recalls = np.array(recalls).mean() precisons = np.array(precisons).mean() recalls = np.array(recalls).mean() print('[val] iou:{} pre:{} rec:{} f1:{}'.format(iu, p...
Python
1
import torch import torch.nn as nn class NormLayer(nn.Module): def __init__(self, hidden_dim, norm_type): super().__init__() if norm_type == "batchnorm": self.norm = nn.BatchNorm1d(hidden_dim) elif norm_type == "layernorm": self.norm = nn.LayerNorm(hidden_dim) ...
Python
1
postgres-persistent")] mod persistent; #[cfg(feature = "postgres-persistent")] pub use persistent::Store as PersistentStore; use crate::{identity_provider, service_provider}; /// Filter to inject the `PgPool` into the request handler. pub fn with_store<S: Store + Send + Sync + Clone>( store: S, ) -> impl Filter<...
Rust
0
# Copyright 2020 Ram Rachum and collaborators. # This program is distributed under the MIT license. from __future__ import annotations import pathlib import os import threading import filelock class InternalFileLock(filelock.FileLock): pass class CachedFileLockType(type): def __new__(mcls, *args, **kwargs...
Python
1
xd8\xd3\xca\x91!\x9dN\xba\xb5\xa0\xa4Js\ \xbb\xb5Nu!\xca\xea\xe4\xe7n\x8f\xbd\x8ec\xd9\x80\ \xc5,\x97\xfe\xd7gff\xd8\xb2e\x0b\xbb\x1e\xdc\xcb\ ;\xaf~\x0f_\xfe\xea\xb5\x84\x81\xa6\x5c+\xe3:E\ \x82$\xa1T*aL\xcax\x14\x8bEbk\x09\x82\ \x80\xa1\xa1!\x12\x1b?\xe4~\xc9k\x15\xacO,\xdb\ r\xfc\x00\xf0\xde\xf5x\x1d\xeb\xd2 8\xf4\x...
Python
1
import streamlit as st from streamlit_labelstudio import st_labelstudio st.set_page_config(layout='wide') config = """ <View> <View style="padding: 25px; box-shadow: 2px 2px 8px #AAA;"> <Image name="img" value="$image" width="100%" maxWidth="100%" brightnessControl="true" contrastControl="true...
Python
1
#!/usr/bin/env python3 # Author: Pwnsard # Challenge: Bounty Machine # CTF: 404CTF 2025 from pwn import * exe = ELF(b'data/chall') libc = ELF(b'data/libc.so.6') ld = ELF(b'data/ld-2.32.so') context.binary = exe def conn(): if args.LOCAL: r = process([exe.path]) # gdb.attach(r) return r ...
Python
1
); return Err(InstructionError::MissingRequiredSignature); } // If Config account is already initialized, update signatures must match Config data if !current_data.keys.is_empty() && !current_signer_keys.iter().any(|pubkey| pubkey == sign...
Rust
0
import pygame import sys Inicjalizacja Pygame pygame.init() screen = pygame.display.set_mode((1280, 720)) pygame.display.set_caption("FIROS: System Craftingu") font = pygame.font.SysFont("timesnewroman", 24) clock = pygame.time.Clock() WHITE = (255, 255, 255) BLACK = (0, 0, 0) GRAY = (50, 50, 50) GOLD = (212, 175, 5...
Python
1
gger.info("📋 종목별 수집 현황:") for _, row in summary.iterrows(): self.logger.info(f" • {row['corp_name']}({row['stock_code']}): {row['count']}건") return True else: self.logger.error("❌ 모든 종목 수집 실패") re...
Python
1
# Generated by Django 1.11.23 on 2019-08-19 01:00 from django.conf import settings from django.db import migrations def set_site_domain_based_on_setting(apps, schema_editor): Site = apps.get_model('sites', 'Site') # The site domain is used to build URLs in some places, such as in password # reset emails,...
Python
1
from prowler.lib.check.models import Check, Check_Report_GCP from prowler.providers.gcp.services.cloudresourcemanager.cloudresourcemanager_client import ( cloudresourcemanager_client, ) class iam_role_kms_enforce_separation_of_duties(Check): def execute(self) -> Check_Report_GCP: findings = [] ...
Python
1
# Script writes site and link meta data into the Arango graphDB # requires https://pypi.org/project/python-arango/ # python3 add_meta_data.py import json from arango import ArangoClient user = "root" pw = "jalapeno" dbname = "jalapeno" client = ArangoClient(hosts='http://198.18.133.104:30852') db = client.db(dbname,...
Python
1
"process.disk.total_read_bytes", disk.total_read_bytes as f64, ); metric.gauge("process.disk.read_bytes", disk.read_bytes as f64); } // Network sys.refresh_networks(); for (name, nt) in sys.networks() { ...
Rust
0
from .vlm_module import VLMBaseModule from .qwen_module import Qwen2VLModule from .internvl_module import InvernVLModule __all__ = ["VLMBaseModule", "Qwen2VLModule", "InvernVLModule"]
Python
1
g\EXL_RF_AOD.m', # r'J:\AODinversion\2024大论文\ML\stacking\EXL_ET_AOD.m', # r'J:\AODinversion\2024大论文\ML\stacking\EXL_Light_AOD.m', # r'J:\AODinversion\2024大论文\ML\stacking\EXL_线性_AOD.m', # r'J:\AODinversion\2024大论文\ML\stacking\EXL_ridge_AOD.m' ...
Python
1
right: &'static str, midright: &'static str, botright: &'static str, } fn list_cows() -> Vec<String> { PROJECT_DIR .files() .iter() .map(|file| file.path.replace(".cow", "")) .collect::<Vec<String>>() } fn format_animal(s: String, thoughts: &str, eyes: &str, tongue: &str) -...
Rust
0
ts[punto].co = LISTA_POINTC[punto] print LISTA_POINTC[punto] # SETEO ENDPOINT bpy.data.objects['Cable'].data.splines[0].use_endpoint_u= True # SELECCIONO LA CURVA bpy.ops.object.select_all(action='DESELECT') bpy.data.objects['Cable'].select=1 ...
Python
1
), expected_outcome ) } #[test] fn test_returns_files_without_class_strings_as_is() { let file_contents = r#" This is to a represent any other normal file. "#; let expected_outcome = r#" This is to a represent any other normal file. "...
Rust
0
f the returned size, IRI resolution (and merge) would /// succeed without OOM error. The resolution may succeed with smaller /// buffer than this function estimates, but it is not guaranteed. /// /// Note that this is `O(N)` operation (where N is input length). #[must_use] fn estimate_max_buf_si...
Rust
0
ethod.ok_or("Undefined method")?; let path = req.path.unwrap_or("/"); let version = req.version.unwrap_or(0); writer.write_all(format!("{} {} HTTP/1.{}\r\n", method, path, version).as_bytes())?; } } for hdr in http.headers() { // strip content length and tran...
Rust
0
_inheriting & wasi_unstable::RIGHT_PATH_FILESTAT_GET, 0, "the scratch directory should have RIGHT_PATH_FILESTAT_GET as base right", ); // Create a file in the scratch directory. let mut file_fd = wasi_unstable::Fd::max_value() - 1; let filename = "file"; let status = wasi_path_open(...
Rust
0
!( err_message.to_string(), r#"Module not found "http://localhost/other.ts"."# ); } #[tokio::test] async fn transform_remote_file_error() { let err_message = TestBuilder::new() .with_loader(|loader| { loader.add_remote_file_with_error( "http://localhost/mod.ts", "Some error loadin...
Rust
0
rcesFixture(exp_clients, **exp_parameters) as vr_fixture: # Assert vr have been provisioned mock_vr.assert_called_once_with(exp_clients, **exp_parameters) # Assert vr have been setup in the fixture self.assertEqual(exp_vr, vr_fix...
Python
1
.globals.target_path): update_status('Processing to video succeed!') else: update_status('Processing to video failed!') def destroy(to_quit=True) -> None: if modules.globals.target_path: clean_temp(modules.globals.target_path) if to_quit: quit() def run() -> None: parse_args(...
Python
1
""" Author: Chuanyu (skewcy@gmail.com) _constants.py (c) 2023 Desc: description Created: 2023-10-21T02:24:36.212Z """ ## Model / algorithm assumptions T_SLOT = 100 ## Use 120 * 60 ns to apply on TTTech TSN board T_PROC = 2000 T_M = int(1e16) E_SYNC = 0 MAX_NUM_QUEUE = 8 NUM_PORT = 4 ## Control parameters SEED = 10...
Python
1
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in complia...
Python
1
None: coords1 = coords1 + flow_init flow_predictions = [] # 12次循环 for itr in range(iters): # 梯度分离(在执行与训练无关的操作时) coords1 = coords1.detach() corr = corr_fn(coords1) # index correlation volume flow = coords1 - coords0 with a...
Python
1
import json def seed_doc_to_visual(doc): return [doc["image"].convert("RGB")] def parse_choice_img(choice: str, img_token: str): if "jpg" in choice or "png" in choice: return img_token return choice def seed_doc_to_text(doc, model_specific_kwargs=None): question = doc["question"] quest...
Python
1
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from collections import OrderedDict from torch import nn from maskrcnn_benchmark.modeling import registry from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform from . import fpn as fpn_module from . import resnet @registr...
Python
1
_id: 6, key: vec![1, 2, 3, 4, 5, 6, 7], rsc: 8, }][..], ) .expect("expected InfraBss::handle_mlme_setkeys_req OK"); assert_eq!(fake_device.keys.len(), 1); assert_eq!( fake_device.keys[0], KeyConfig { bssi...
Rust
0
<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TRACEPORTSPEED_A) -> &'a mut W { { self.bits(variant.into()) } } #[doc = "Trace Port clock is: 64MHz"] #[inline(always)] pub fn _64mhz(self) -> &'a mut W { sel...
Rust
0
policy")?; iam_client .attach_role_policy() .role_name(IAM_INSTANCE_PROFILE_NAME) .policy_arn("arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role") .send() .await .context( Resources::Remaining, ...
Rust
0
>取消</a> </form> </body> </html> ''' return render_template_string(template) # 3. 编辑任务 @app.route('/edit/<int:task_id>', methods=['GET', 'POST']) def edit_task(task_id): """编辑任务""" # 查找任务 task = next((t for t in tasks if t['id'] == task_id), None) if not task: ...
Python
1
:new(signer); let robot_account = AccountId::from_ss58check(robot.as_str()).map_err(|_| Error::Ss58CodecError)?; let client = substrate_subxt::ClientBuilder::<Robonomics>::new() .set_url(remote.as_str()) .build() .await?; let xt_hash = client.launch(&subxt_signer, robot_accou...
Rust
0
import sys import cv2 from PIL import Image from ayat.find_ayat_v2 import find_ayat, draw from lines.lines import find_lines def verify_lines(image_dir, filename): image = Image.open(image_dir + filename).convert('RGBA') lines = find_lines(image, 110, 35, 0) if len(lines) != 15: print('failure: f...
Python
1
![].into_iter()), Err(SmlError::TLInvalidLen)), l => assert_eq!(parse_tl(0x50 | l, &mut vec![].into_iter()), Err(SmlError::TLInvalidPrimLen(l as usize))) } } } #[test] fn t_tl_u8() { assert_eq!(pa...
Rust
0
department[ 0:9] + ";" + department process_list.append(department) for asd in process_list: partment += str(asd) + ';' department = partment.rstrip(';') ...
Python
1
import torch import argparse # 用于处理LoRA(Low-Rank Adaptation)模型 from peft import PeftModel from peft import LoraConfig, TaskType, get_peft_model # 功能:从自定义模块中导入 load_model 函数 # from evaluate import load_model:从名为 evaluate 的模块中导入 load_model 函数,用于加载和初始化模型 from evaluate import load_model # 功能:全局变量的初始化 # 初始化一个 ArgumentPa...
Python
1
_FAN_NORMAL: nvmlFanState_enum = 0; pub const nvmlFanState_enum_NVML_FAN_FAILED: nvmlFanState_enum = 1; pub type nvmlFanState_enum = i32; pub use self::nvmlFanState_enum as nvmlFanState_t; pub const nvmlLedColor_enum_NVML_LED_COLOR_GREEN: nvmlLedColor_enum = 0; pub const nvmlLedColor_enum_NVML_LED_COLOR_AMBER: nvmlLedC...
Rust
0
].reorder(cc_out, ch, kh, kw, cw, cc_in) sch[CachedY].vectorize(cc_in) sch[CachedY].unroll(cw) # Schedule the padding by adding thread-level parallelism if PaddedX != X: sch[PaddedX].parallel(PaddedX.op.axis[0]) # Optimize the packing of X and K sch[PackedX].parallel(sch[PackedX].fuse(*...
Python
1
} fn members_paths(&self, globs: &[String]) -> CargoResult<Vec<PathBuf>> { let mut expanded_list = Vec::new(); for glob in globs { let pathbuf = self.root_dir.join(glob); let expanded_paths = Self::expand_member_path(&pathbuf)?; // If glob does not find any...
Rust
0
from django_filters import rest_framework as filters from django.contrib.gis.db.models.functions import Distance from django.contrib.gis.geos import Point from django_filters.rest_framework import NumberFilter, CharFilter from .models import CulturalProperty class CulturalPropertyFilter(filters.FilterSet): name =...
Python
1
pot = pot - wager #print(len(deck)) #print(pot) i +=1 pC = 0 pS = 0 dC = 0 dS = 0 games_played +=1 #Game Over wr = games_won/games_played*100 #print("GAME OVER ") ...
Python
1
corner_indicies!(CUBE2_CORNER_INDICIES, Cube2x2x2Faces, 2); cube_corner_indicies!(CUBE3_CORNER_INDICIES, Cube3x3x3Faces, 3); cube_corner_indicies!(CUBE4_CORNER_INDICIES, Cube4x4x4Faces, 4); pub(crate) const CUBE_CORNER_COLORS: [[Color; 3]; 8] = [ // URF [Color::White, Color::Red, Color::Green], // UFL ...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class BarcodeRule(models.Model): _inherit = 'barcode.rule' type = fields.Selection(selection_add=[ ('weight', 'Weighted Product'), ('location', 'Location'), ...
Python
1
des the debug output for a BoardPosition. #[quickcheck] fn board_position_string_roundtrip(index: u8) -> TestResult { if index >= 8 * 8 { TestResult::discard() } else { let pos = BoardPosition(index); let pos2 = BoardPosition::try_from(&*format!("{:?}", pos))....
Rust
0
ketNoticeParticipantnoticetrk1> = mms_file.get_table()?; mmsdm_core::sql_server::batched_insert( client, file_key, mms_file.header(), &d, "exec mmsdm_proc.InsertMarketNoticeParticipantnoticetrk1 @P1, @P2", chunk_...
Rust
0
# steering_vector.py import numpy as np def compute_steering_vector(x_pos, y_pos, z_pos, freq, c, scan_x, scan_y, scan_z): """ 计算阵列的导向矢量 参数: x_pos: ndarray - 麦克风x坐标 [1×P] y_pos: ndarray - 麦克风y坐标 [1×P] z_pos: ndarray - 麦克风z坐标 [1×P] freq: float - 波频率 [Hz] c: float - 声速 [m/s] sca...
Python
1
"""Module for search utilities.""" import itertools import typing as ty import regex as re from ..customtypes import SearchResult from ..exceptions import RegexParseError from ..registry import get_re_pattern from ..registry import get_re_weights def filter_overlapping_matches( matches: ty.Iterable[SearchResult...
Python
1
$NetBSD$ Remove workarounds that are not needed any longer with gperf 3.2. https://bugs.gentoo.org/953436 https://bugs.gentoo.org/attachment.cgi?id=924201&action=diff --- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py.orig 2025-03-18 19:28:59.000000000 +0000 +++ src/3rdparty/chromium/third_pa...
Python
1
# Copyright 2022-2025, Julian Heinzel and the freecad-jewelry contributors # SPDX-License-Identifier: AGPL-3.0-or-later import FreeCAD as App import FreeCADGui as Gui import Part class AddRing: def Activated(self): doc = App.activeDocument() import RingGeneric obj = doc.addObject("Part::FeaturePython",...
Python
1
# pylint: disable=W0611 ''' Input management ================ Our input system is wide and simple at the same time. We are currently able to natively support : * Windows multitouch events (pencil and finger) * OS X touchpads * Linux multitouch events (kernel and mtdev) * Linux wacom drivers (pencil and finger) * TUIO...
Python
1
from typing import cast import pytest from unittest.mock import Mock from django.contrib.gis.geoip2 import GeoIP2, GeoIP2Exception from django.test import TestCase from posthog.geoip import geoip, get_geoip_properties australia_ip = "13.106.122.3" uk_ip = "31.28.64.3" us_ip_v6 = "2600:6c52:7a00:11c:1b6:b7b0:ea19:63...
Python
1
"v1_30", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_30")))] impl fmt::Display for KeyfileHandlerType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "KeyfileHandlerType::{}", match *self { Self::Warn => "Warn"...
Rust
0
marker_msg.pose.orientation.y = 0.0 marker_msg.pose.orientation.z = 0.0 marker_msg.pose.orientation.w = 1.0 if joint_id in [11, 12, 13, 14, 15, 16, 17]: marker_msg.scale.x = 0.024 marker_msg.scale.y = 0.024 ...
Python
1
F: FnOnce(E) -> U; } impl<T, E> Poll_v1_51<T, E> for Poll<Result<T, E>> { fn map_ok<U, F>(self, f: F) -> Poll<Result<U, E>> where F: FnOnce(T) -> U, { match self { Poll::Ready(Ok(t)) => Poll::Ready(Ok(f(t))), Poll::Ready(Err(e)) => Poll::Ready(Err(e)), Po...
Rust
0
t): disable_existing_loggers() launch(rank=rank, world_size=world_size, host="localhost", port=port, backend="nccl") physical_mesh_id = torch.arange(0, 4) assert rank == dist.get_rank() mesh_shape = (2, 2) # [[0, 1, # [2, 3]] device_mesh = DeviceMesh(physical_mesh_id, mesh_shape, init...
Python
1
' || chr == '5' || chr == '6' || chr == '7' || chr == '8' || chr == '9' } fn is_not_space(chr: char) -> bool { chr != ' ' && chr != '\r' && chr != '\n' } fn is_not_tick(chr: char) -> bool { chr != '\'' } pub fn split_header_and_payload(source: &str) -> Option<(String, ...
Rust
0
up overlapping; in this case, the dots //! merge together and become a single dot. //! //! The second fold instruction is fold along x=5, which indicates this line: //! //! ```text //! #.##.|#..#. //! #...#|..... //! .....|#...# //! #...#|..... //! .#.#.|#.### //! .....|..... //! .....|..... //! ``` //! //! Because thi...
Rust
0
s("##-")); } <gh_stars>0 fn main() { encode(&mut EncoderImpl); } pub trait Encoder { type W; fn writer(&self) -> Self::W; } fn encode<E: Encoder>(mut encoder: E) { encoder.writer(); encode(&mut encoder); } struct EncoderImpl; impl Encoder for EncoderImpl { type W = (); fn writer(&self)...
Rust
0
a.character_info.main_character_id = self.settings['config']['character'] data.character_info.ClearField('character_sort') data.character_info.character_sort.extend( self.settings['config']['star_chars']) data.character_...
Python
1
_all_file(filename: &str) -> std::io::Result<Vec<u8>> { let mut data = Vec::new(); std::fs::File::open(filename).and_then(|mut file| file.read_to_end(&mut data))?; Ok(data) } fn round_trip(x: &[u8]) { let mut compressed: Vec<u8> = Vec::new(); lzma_rs::lzma2_compress(&mut std::io::BufReader::new(x),...
Rust
0
new(3)).unwrap(); assert_eq!(entry.value().len(), 1); } assert_eq!( cache.member(Id::new(2), Id::new(3)).unwrap().user_id, Id::new(3), ); Ok(()) } /// Assert that the a cached variant of the voice state is correctly /// inserted. #[te...
Rust
0
class TaskFamily: @staticmethod def get_tasks() -> dict[str, dict]: return { "1": {"puzzle": "You have a 3-gallon jug and a 5-gallon jug. You need to measure exactly 4 gallons of water. Describe the steps to do this."}, "2": {"puzzle": "You are in a room with three light switches...
Python
1
d ) for instance in queryset_iterator(instances): # delete submission instance.delete() # pylint: disable=invalid-name @app.task(base=AutoRetryTask) def send_project_invitation_email_async(invitation_id: str, url: str): """Sends project invitation email asynchronously""" ...
Python
1
##################################### CLASS ############################################# ################################## NET_SNIFFER ########################################## # CURRENT # # This class contains two method: the first runs tshark to capture packets on the network # the second stops the capture. The c...
Python
1
}", "\u{a739}", "\u{a73b}", "\u{a73d}", "\u{a73f}", "\u{a741}", "\u{a743}", "\u{a745}", "\u{a747}", "\u{a749}", "\u{a74b}", "\u{a74d}", "\u{a74f}", "\u{a751}", "\u{a753}", "\u{a755}", "\u{a757...
Rust
0
object of type [`Cw20ReceiveMsg`] which is a hook message to be executed. pub fn receive_cw20( deps: DepsMut, info: MessageInfo, cw20_msg: Cw20ReceiveMsg, ) -> Result<Response, ContractError> { let msg = cw20_msg.msg; let config: Config = read_config(deps.storage)?; match from_binary(&msg)? { ...
Rust
0
// .join("\n") // ); // panic!("asdf"); // patterns // .into_iter() // .unique_by(|p| p.ast.clone()) // .collect_vec() pattern_map .into_iter() .sorted_by_key(|(_pat, count)| *count) .filter_map(|(pat, count)| { if count >= count_...
Rust
0
OfStack: *mut StackType_t, pxCode: TaskFunction_t, pvParameters: *mut crate::esp_idf::std::os::raw::c_void) -> *mut StackType_t; } extern "C" { pub fn xPortStartScheduler() -> BaseType_t; } extern "C" { pub fn vPortEndScheduler(); } extern "C" { ...
Rust
0
let json = r#"{}"#; let deserialization_err = deserialize(json.to_string()).unwrap_err(); assert_eq!(deserialization_err, Error::EmptyInputError); } #[test] fn multiple_roots_json() { let json = r#" { "cool": { "beans": { ...
Rust
0
a model of the // camera into world space (transformation and rotation) // This is an orientation matrix that is transposed. Transpose effectively performs // inversion. This achieves the effect that the world rotates around the camera let rotation = Matrix4::from_rows(&[ RowVector4::new(x.x, ...
Rust
0
# this is the standard pipeline currently used by default pipes = ( ('read', 'Read'), ('histogram', 'Histogram'), ('format', 'Format'), )
Python
1
doc = "5: Channel 5 is selected as the fixed reference input for the fixed mux port."] _101 = 5, #[doc = "6: Channel 6 is selected as the fixed reference input for the fixed mux port."] _110 = 6, #[doc = "7: Channel 7 is selected as the fixed reference input for the fixed mux port."] _111 = 7, } imp...
Rust
0
0x33, 0x3a, 0x32, 0x32, 0x20, 0x47, 0x4d, 0x54, 0xc0, 0x5a, 0x04, 0x67, 0x7a, 0x69, 0x70, 0x77, 0x38, 0x66, 0x6f, 0x6f, 0x3d, 0x41, 0x53, 0x44, 0x4a, 0x4b, 0x48, 0x51, 0x4b, 0x42, 0x5a, 0x58, 0x4f, 0x51, 0x57, 0x45, 0x4f, 0x50, 0x49, 0x55,...
Rust
0
in {0} ⚠️**\n\n", lang)); } ret.push_str(&format!("```{}\n", lang)); if let (before, Some(after)) = try_split(after, "```") { ret.push_str(before); ret.push_str("```"); after } else { ...
Rust
0
nable to do the diffie Hellman"))] DiffieHellmanFail, #[snafu(display("Unable to compress the data: {}", source))] CompressionError { source: compressor::CompressorError }, #[snafu(display("Unable to uncompress the data: {}", source))] UncompressionError { source: compressor::CompressorError }, #[snafu(d...
Rust
0
OR: No Search Results!" else: print "PASSED: {0} Search Results".format(len(search)) options = ImageOptions() options.image_type = ImageType.CLIPART options.larger_than = LargerThan.MP_4 options.color = "green" images = Google.search_images("banana", options) if images is None ...
Python
1
pub fn HAL_Pwm_Init_8195a(pPwmAdapt: *mut HAL_PWM_ADAPTER) -> HAL_Status; pub fn HAL_Pwm_Enable_8195a(pPwmAdapt: *mut HAL_PWM_ADAPTER); pub fn HAL_Pwm_Disable_8195a(pPwmAdapt: *mut HAL_PWM_ADAPTER); pub fn HalI2SWrite32(I2SIdx: uint8_t, I2SReg: uint8_t, I2SVal: uint32_t); pub fn HalI2SRead32(I2SIdx: uin...
Rust
0
import contextlib import logging from pystiche import optim __all__ = [ "assert_modules_identical", "assert_named_modules_identical", "assert_logs", "assert_property_in_repr", ] def assert_modules_identical(actual, desired, equality_sufficient=False): actual = tuple(actual) desired = tuple(d...
Python
1
s_lowercase(c: char) -> bool { match c { 'a' .. 'z' => true, c if c > '\x7f' => derived_property::Lowercase(c), _ => false } } /// /// Indicates whether a `char` is in upper case /// /// This is defined according to the terms of the Unicode Derived Core Property 'Uppercase'. /// #[inlin...
Rust
0
ne()), cmd_start: systemd_start(service_name.clone()), cmd_stop: systemd_stop(service_name), logger, } } } impl Supervisor for CommandSupervisor { fn pid(&self) -> Result<Option<String>> { (self.cmd_pid)(&self.logger) } fn start(&self) -> Result<()> ...
Rust
0
(), errors::ValidateError> { let blocks = &self.basic_blocks; for bb in blocks { let mut found_error: bool = false; let (fst, snd) = bb.branch_targets(); if let Some(fst) = fst { if fst >= blocks.len() { found_error = true; ...
Rust
0
import os import faiss import json import numpy as np from sentence_transformers import SentenceTransformer # Paths INDEX_PATH = "law_index_faiss/faiss_index.bin" META_PATH = "law_index_faiss/metadata.json" # Load embedding model print("[INFO] Loading embedding model (all-MiniLM-L6-v2)...") model = SentenceTransforme...
Python
1
KHDCdpKpQf81FTNyQg2Vgz7Pu1ZHZw6zNy"}, "signature": "Qk67ePVhxdjHivAf8H4Loy1hN5zfb1dq79VSJKYx485EAXmj44PASpp8gj2faysdN8CNzSoUVvXgd3U4P2CA7VkwD7FHKUuviAFJfRQ68FnpUS8hVuqn6PAuv9RGUobohcJnKJ8CVKxr5i3Zn2JNXbk7AqeYRZQ2egq8fdoP3woPW7" }), }]; let json_str = string_from_char_ptr(new_str_ptr).unwrap...
Rust
0