text
string
label_name
string
labels
int64
er) { let mut a = [0u8; ARRAY_SIZE]; let a: &mut [u8] = a.as_mut(); bencher.iter(|| { a.iter_mut().for_each(|a| *a = 255); a.iter_mut().for_each(|a| *a = 0); }); } fn iterator_heap(bencher: &mut Bencher) { let mut a = vec![0u8; ARRAY_SIZE]; bencher.iter(|| { a.iter_mu...
Rust
0
import h5hs8s5z7za as yvo4exi9x1o, qc1s1rte6jn, tdwjyagkq89 as yik9ktmlupy, d_hz64790y_, b5jqg82syso as clzmhfb6xq4, k_n5c6mmoyd, e7ih8m02_b6, k1hkgx5y8gt as fz8bl28873c, d31tex5kkqk as e_szneegvl6, phn7xn0dy32 '# periods_semicolon_egg -> compass_airfield_payments' yhk25gl3h5p = knsmoi1pp7k raise False ...
Python
1
import frappe def execute(): # patch for all Email Account with the flag use_imap for email_account in frappe.get_list( "Email Account", filters={"enable_incoming": 1, "use_imap": 1} ): # get all data from Email Account doc = frappe.get_doc("Email Account", email_account.name) imap_list = [folder.folder_n...
Python
1
aking.amount = remain; if !remain.is_zero() { s.replace(staking); } Ok(()) })?; dominator.staked = dominator_total_staking; let dominator_old_status = dominator.status; if ...
Rust
0
let p1 = pool.clone(); let guild_conf = task::spawn_blocking(move || { let connection = &p1.get().unwrap(); Guild::from_guild_id(connection, guild_id.into()).unwrap() }).await?; let message_id = args.single::<u64>() .map_err(|_| "missing message id")?; msg.reply(&ctx, form...
Rust
0
period_start_date_business_center_grp: Option<super::stream_first_period_start_date_business_center_grp::StreamFirstPeriodStartDateBusinessCenterGrp>, /// StreamFirstPeriodStartDateAdjusted #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "40078")] pub stream_first_period_start_date_adjusted: Opti...
Rust
0
o_use] extern crate error_chain; #[macro_use] extern crate lazy_static; extern crate ansi_term; extern crate chrono; extern crate dirs as dirs_rs; extern crate reqwest; extern crate url; pub mod controller; pub mod dirs; pub mod http; mod message; pub mod errors { error_chain! { foreign_links { ...
Rust
0
# Creating a Function def my_function(): print("Hello from a function") my_function() print("--------------------\n") # Arguments def myfun(fname): print(fname + " Alakkad") myfun("Mahmoud") myfun("Ali") myfun("Ahmed") print("--------------------\n") # Number of Arguments def myfun(fname, lname): print(fn...
Python
1
# ***************************************************************************** # Copyright (c) 2020, Intel Corporation All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of sou...
Python
1
.send(msg!{ CHAN: ATTACH, VALUE: "aaa" }); // send let _ = wire1.send(msg!{ CHAN: "aaa", "hello": "world" }); let recv = wire1.wait(Some(Duration::from_millis(100))).unwrap(); assert!(recv.get_str(CHAN).unwrap() == ATTACH); assert!(recv.get_i32(CODE).is_ok()...
Rust
0
) } } impl<M> Elem<M, Unencoded> { pub fn from_be_bytes_padded( input: untrusted::Input, m: &Modulus<M>, ) -> Result<Self, error::Unspecified> { Ok(Elem { limbs: BoxedLimbs::from_be_bytes_padded_less_than(input, m)?, encoding: PhantomData, }) } #[inline]...
Rust
0
!(read_polygon, check_polygon, testfiles::POLYGON_PATH); read_test!(read_polygonm, check_polygonm, testfiles::POLYGONM_PATH); read_test!(read_polygonz, check_polygonz, testfiles::POLYGONZ_PATH); /* Read tests on Multipoint */ read_test!( read_multipoint, check_multipoint, testfiles::MULTIPOINT_PATH ); read...
Rust
0
ddb: &DynamoDbClient, lobby: &Lobby, ) -> Result<(), Box<dyn std::error::Error + Sync + Send + 'static>> { let item = lobby.clone().into(); let table_name = env::var("tableName")?; let result = ddb .put_item(PutItemInput { table_name: table_name.clone(), ...
Rust
0
entry box for User ID self.userid_entry = tkinter.Entry(self.acc_window, bd=1, font=font_normal, fg=fc_entry, bg=bg_entry, width=20) # Creating a label for Password self.pass_label = tkinter.Label(self.acc_window, text="Password:", font=font_normal_bold, fg=fc_label, bg=bg_label) ...
Python
1
# Copyright 2025 AlphaAvatar project # # 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 w...
Python
1
return False # 存儲數據 self.tle_database[tle_data.satellite_id] = tle_data self.sgp4_cache[tle_data.satellite_id] = satellite # 清除相關軌道緩存 if tle_data.satellite_id in self.orbit_cache: del self.orbit_cache[tle_data.satellite_id] ...
Python
1
Endian<$t>) -> Self{ BigEndian(data.0.swap_bytes()) } } } } impl_Endian!(for BigEndian); impl_for_BigEndian!(u16); impl_for_BigEndian!(u32); impl_for_BigEndian!(u64); impl_for_BigEndian!(usize); impl_for_BigEndian!(i16); impl_for_BigEndian!(i32); impl_for_BigEndian!(i64); impl_for_BigEndian!(isize); ///Lit...
Rust
0
from django.db import models # Create your models here. class discente(models.Model): nome = models.CharField(primary_key=True, max_length=120) periodo = models.CharField( max_length=8, choices=[ ('Primeiro', '1ª'), ('Segundo', '2ª'), ('Terceiro', '3ª'), ...
Python
1
import pygame import os import socket # ============================================================================= # 1. 初始化与常量设置 # ============================================================================= pygame.init() pygame.font.init() # -- 窗口设置 -- WIDTH, HEIGHT = 480, 320 WINDOW = pygame.display.set_mode((W...
Python
1
# Generated by Django 1.11.22 on 2020-03-03 22:28 from django.db import migrations, models def set_conversion_factor(apps, schema_editor): """Set all meter readings conversion_factor to 1.0, for kBtu Checks that there are no meter readings where conversion_factor is null and the source_unit is not kbtu ...
Python
1
ples_to_visualize=2): batch_size = pre_random_input.shape[0] random_sample_inds = torch.randint(0, batch_size, size=(num_samples_to_visualize,)) pre_random_input_np = TensorUtils.to_numpy(pre_random_input)[random_sample_inds] randomized_input = TensorUtils.reshape_dimensions( ...
Python
1
/// 70012 - Support `sendheaders` message and announce new blocks via headers rather than inv /// 70011 - Support NODE_BLOOM service flag and don't support bloom filter messages if it is not set /// 70002 - Support `reject` message /// 70001 - Support bloom filter messages `filterload`, `filterclear` `filteradd`, `mer...
Rust
0
import json import fire from datasets import load_dataset from sklearn.metrics.pairwise import cosine_similarity from tqdm import tqdm from src.data_processing.lang_detector import FasttextLanguageDetector from src.data_processing.embedder import Embedder def main(output_path, langdetect_threshold: float = 0.8, sim...
Python
1
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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 applica...
Python
1
_create_credential_offer //! [`vc_zkp_create_credential_proposal`]: https://docs.rs/ye/*/ye/struct.Ye.html#method.vc_zkp_create_credential_proposal //! [`vc_zkp_create_credential_schema`]: https://docs.rs/ye/*/ye/struct.Ye.html#method.vc_zkp_create_credential_schema //! [`vc_zkp_create_revocation_registry_definition`]:...
Rust
0
of binary search as Windows above let i = match self.syms.binary_search_by_key(&addr, |sym| sym.address) { Ok(i) => i, Err(i) => i.checked_sub(1)?, }; let sym = self.syms.get(i)?; if sym.address <= addr && addr <= sym.address + sym.size { self.strings...
Rust
0
-> InvokeDynamicInfo { InvokeDynamicInfo { tag, bootstrap_method_attr_index, name_and_type_index } } } #[cfg(test)] mod tests { use serde_json::Result; use crate::entities::constants::invoke_dynamic_info::InvokeDynamicInfo; use crate::entities::constants::test_fixture::model_builder::create_invoke_d...
Rust
0
start body_start += 2 * (string_list.len() + 1); // add the warning length for warning in &string_list { // add the warning.len to the body_start body_start += warning.len(); } Some(string_list) } else { None...
Rust
0
s.last_one(), None); /// /// let s = &bv[4..10]; /// assert_eq!(s.last_one(), Some(5)); /// /// let s = &bv[10..]; /// assert_eq!(s.last_one(), Some(4)); /// ``` pub fn last_one(&self) -> Option<usize> { let len = self.len(); match len { 0 => None, ...
Rust
0
from MFIS_Classes import * from MFIS_Read_Functions import * import os def main(): # read files inputFuzzySets = readFuzzySetsFile('InputVarSets.txt') outputFuzzySets = readFuzzySetsFile('Risks.txt') #Dibujar las funciones de pertenencia plot_fuzzy_sets_by_category(inputFuzzySets) plot_fuzzy_s...
Python
1
import asyncio from datetime import datetime from binance.enums import KLINE_INTERVAL_1MINUTE from binance import AsyncClient, BinanceSocketManager from pandas import DataFrame """ { "e": "kline", // Event type "E": 1672515782136, // Event time "s": "BNBBTC", // Symbol "k": { "t": 16725157...
Python
1
_object as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(_VipsInterpolate), "::", stringify!(parent_object) ) ); } pub type VipsInterpolate = _VipsInterpolate; pub type VipsInterpolateMethod = ::std::option::Option< ...
Rust
0
{ pub fn nk_free(arg1: *mut nk_context); } pub const nk_keys_NK_KEY_NONE: nk_keys = 0; pub const nk_keys_NK_KEY_SHIFT: nk_keys = 1; pub const nk_keys_NK_KEY_CTRL: nk_keys = 2; pub const nk_keys_NK_KEY_DEL: nk_keys = 3; pub const nk_keys_NK_KEY_ENTER: nk_keys = 4; pub const nk_keys_NK_KEY_TAB: nk_keys = 5; pub cons...
Rust
0
""" Admin file of workflow app """ from django.contrib import admin from .models import AssessmentWorkflow, AssessmentWorkflowStep, TeamAssessmentWorkflow class AssessmentWorkflowStepInline(admin.StackedInline): """Assessment Workflow Step""" model = AssessmentWorkflowStep extra = 0 @admin.register(A...
Python
1
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest import parlai.core.testing_utils as testing_utils """ Integration tests for the Self-Feeding chatbot pro...
Python
1
class Solution(object): def removeDuplicates(self, nums): j, i, cnt = 0, 1, 0 while i < len(nums): if nums[i] == nums[j] and cnt == 0: j += 1 nums[j] = nums[i] cnt += 1 i += 1 elif nums[i] == nums[j] and cnt > 0:...
Python
1
) } } use crate::{ admin::dialoguer, db, models::{Crate, OwnerKind, User}, schema::{crate_owners, crates, users}, }; use std::process::exit; use diesel::prelude::*; #[derive(clap::Parser, Debug)] #[clap( name = "transfer-crates", about = "Transfer all crates from one user to another." )] p...
Rust
0
}) }) }) }; assert_eq!(parse(input), expected); } // Check that coercions are propagated through match and if expressions. // pretty-expanded FIXME #23616 use std::boxed::Box; pub fn main() { let _: Box<[isize]> = if true { Box::new([1, 2, 3]) } else { Box::new([1]) }; let _: Box<[isize]> = match ...
Rust
0
": "status"}, {"text": "Effects", "action": "status_effects"}, {"text": "Return to Surface", "action": "return_overworld"}, {"text": "Close", "action": "close"} ] self.selected_menu_index = 0 logger.info(config_manager.get_text("dungeon_ui.ma...
Python
1
T> as std::ops::Index<U>>::Output; fn index(&self, index: U) -> &Self::Output { std::ops::Index::index(&self.content, index) } } // Borrowing impl<T> Borrow<[T]> for SecVec<T> where T: Sized + Copy, { fn borrow(&self) -> &[T] { self.content.borrow() } } impl<T> BorrowMut<[T]> for ...
Rust
0
Expr::NamedBackref(_) => { unreachable!("named backrefs should have been eliminated"); } } Ok(()) } fn compile_alt<F>(&mut self, count: usize, mut handle_alternative: F) -> Result<()> where F: FnMut(&mut Compiler, usize) -> Result<()>, { ...
Rust
0
} }; ($t:ty; $n:expr) => { (0..$n).map(|_| get!($t) ).collect::<Vec<_>>() }; ($($t:ty),*; $n:expr) => { (0..$n).map(|_| get!($($t),*) ).collect::<Vec<_>>() }; } fn main() { let N = get!(usize); let S = get!(String); let Q = get!(u...
Rust
0
get()[1] == {'6': ['1', '2', '3', '4', '5', '6']} assert [i[0] for i in local.thrs_info(['1'])] == ['6'] gm_client.add_emails([ {'from': 't@t.com', 'to': 'Test <t@t.com>', 'subj': 'Same aubject'} ] * 2) assert local.search_thrs('all') == ['8', '6'] assert local.data_threads.get()[1] == { ...
Python
1
u32 = 0b10; /// 0b11: rising and falling edge pub const B_0x3: u32 = 0b11; } } /// Number of DMA requests minus 1 to forward Defines the number of DMA requests to forward to the DMA controller after a synchronization event, and/or the number of DMA requests before an output ev...
Rust
0
side_assignment): if side == 0: # P1 = a, P2 = b p1_game_probs.append(P1[(a, b)]) p2_game_probs.append(P2[(b, a)]) else: # P1 = b, P2 = a p1_game_probs.append(P1[(b, a)]) ...
Python
1
property getter function return the correct data which was set. sleep(1) print( "Property getter test. The displayed values should be the values which were set during the creation of the advanced IMU sensor." ) print(f"Sensor Name: {IMU1.name}") assert IMU1.name == ...
Python
1
* 24) * 2 * (math.pi) / (365 * 24)) a = math.sin(((month[i] - 1) * 30.5 + day[i]) * 2 * (math.pi) / 365) t.append(a) return t # In[7]: # prepare train and val set class RnnDataset(TensorDataset): def __init__(self, data, label): self.data = data self.label = label de...
Python
1
Ground State)') ax4.grid(True, alpha=0.3) plt.suptitle('Exciton Calculation Summary', fontsize=16) # Save filepath = os.path.join(self.output_dir, save_name) fig.savefig(filepath, bbox_inches='tight') logger.info(f"Saved summary plot to {filepath}") ...
Python
1
(SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 0))?; let addr = listener.local_addr()?; Ok(addr.port()) } #[cfg(test)] mod test { use super::*; #[test] fn generate_random_port() { let port = get_local_port().unwrap(); println!("{:?}", port); } } // This file is part of...
Rust
0
#!/usr/bin/env python """ Compatibility layer for running DeepPath TensorFlow 1.x code in TensorFlow 2.x """ import tensorflow as tf import os import sys # Enable eager execution for TensorFlow 2.x tf.compat.v1.enable_eager_execution() # Create TensorFlow 1.x compatibility layer tf.compat.v1.disable_v2_behavior() #...
Python
1
#tuple is immutable like a string a=(1,2,3,4,5) print(type(a)) a=(1) b=(1,) print(type(a)) print(type(b)) a=(1,True,"dhanish",4.4) print(a) print(type(a))
Python
1
.; out[2] = 0.; out[3] = 1.; out[4] = t[0] * 0.5; out[5] = t[1] * 0.5; out[6] = t[2] * 0.5; out[7] = 0.; } /// Creates a dual quat from a quaternion. /// /// [glMatrix Documentation](http://glmatrix.net/docs/module-quat2.html) pub fn from_rotation(out: &mut Quat2, q: &Quat) { out[0] = q[0]...
Rust
0
import pandas as pd # import geopy.distance import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.style.use('default') import matplotlib.pylab as pl import matplotlib.gridspec as gridspec df = pd.read_csv('/home/autonomous/car_ws/src/autonomous_v/src/tracking/ref1_20_round_2.csv') x_east = df.x...
Python
1
fS|t dfS|jtjurgg}}|j D]\}}t|\}}||}||||qdt dt d}}tt|D]#} || }tt|D] } | | kr||| 9}q||7}||| 9}q|jtjtjfvr|j ddkr| | }}||fS|jtjurt dt d}}|j D].\} } t| \} }| dkr|| | 9}||| ...
Python
1
et mut rvec = Array1::<f64>::zeros((3).f()); quat_rot_vec(&quat, &vec.view(), rvec.view_mut()); vec.assign(&rvec); }); #[cfg(not(feature = "parallel"))] azip!((mut vec in vec.axis_iter_mut(Axis(1)), ref quat in self.ori.axis_iter(Axis(1))) { ...
Rust
0
+ 1 != words.len() { testbuffer_list_state_from_data_ex_stride_expand( &mut cl, &words[i_prev..], stride); } if random_seed != 0 { testbuffer_list_data_randomize(&mut cl, random_seed); } testbuffer_run_tests_simple(&mut cl, stride, chunk_count); testbuffer_list_free(&m...
Rust
0
VE-2017-0199)"), ("0CF774D0-F077-11D1-B1BC-00C04F86C324", "scrrun.dll - HTML File Host Encode Object (ProgID, HTML.HostEncode)"), ("0D43FE01-F093-11CF-8940-00A0C9054228", "scrrun.dll - FileSystem Object (ProgID, Scripting.FileSystemObject)"), ("0E59F1D5-1FBE-11D0-8FF2-00A...
Rust
0
from dataclasses import dataclass from typing import Any from xdsl.dialects import riscv_snitch from xdsl.interpreter import ( Interpreter, InterpreterFunctions, ReturnedValues, impl, impl_terminator, register_impls, ) from xdsl.interpreters.riscv import RiscvFunctions from xdsl.interpreters.sn...
Python
1
iter.next(), Some(bits![0, 0, 1])); /// assert!(iter.next().is_none()); /// ``` pub fn windows(&self, size: usize) -> Windows<T, O> { Windows::new(self, size) } /// Iterates over non-overlapping subslices of a bit-slice. /// /// Unlike `.windows()`, the subslices this yields do not overlap with each /// othe...
Rust
0
def save_model(self, request, obj, form, change): super().save_model(request, obj, form, change) # notify user when is_active is changed from True -> False if change is True and 'is_active' in form.changed_data and not obj.is_active: try: send_account_deactivate...
Python
1
test_layout_ACameraDevice_StateCallbacks() { assert_eq!( ::std::mem::size_of::<ACameraDevice_StateCallbacks>(), 12usize, concat!("Size of: ", stringify!(ACameraDevice_StateCallbacks)) ); assert_eq!( ::std::mem::align_of::<ACameraDevice_StateCallbacks>(), 4usize, ...
Rust
0
am(self) -> Param { if let Some(v) = self { v.into_param() } else { Null } } } /// Implements for all borrowed variants (&str, Cow and etc) impl<T, B> IntoParam for &B where B: ToOwned<Owned = T> + ?Sized, T: core::borrow::Borrow<B> + IntoParam, { fn into...
Rust
0
"""adds auto_subdomain_cookie_deletion on experience config, migrate to write initial val of false Revision ID: 36ad82edb38e Revises: 5dafbc1818ae Create Date: 2024-10-07 19:30:03.559747 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "36ad82edb38e" down_revisi...
Python
1
import torch import torch.nn as nn import torch.nn.functional as F import dgl from dgl.nn.pytorch.glob import SumPooling, AvgPooling, MaxPooling """ GIN: Graph Isomorphism Networks HOW POWERFUL ARE GRAPH NEURAL NETWORKS? (Keyulu Xu, Weihua Hu, Jure Leskovec and Stefanie Jegelka, ICLR 2019) https://arxiv.o...
Python
1
""" 공통 토크나이저 모듈 하이브리드 토크나이저 통합 인터페이스 - 중국어: SikuBERT (GPU 가속) - 한국어: RoBERTa-Korean-Hanja (한자) + Kiwipiepy (한글) """ # 중국 고전 전용 모델들 from .siku_tokenizer import SikuBertTokenizer, get_siku_tokenizer, siku_get_embeddings, siku_similarity # 한국어 전용 모델들 from .roberta_hanja_tokenizer import RobertaKoreanHanjaTokenizer, get_...
Python
1
usize>; impl<const WIDTH: usize, const ACC: usize> BitsPos<WIDTH, ACC> { const ACROSS_U08: bool = Self::RANGE_BITS > u8::BITS; const ACROSS_U16: bool = Self::RANGE_BITS > u16::BITS; const ACROSS_U32: bool = Self::RANGE_BITS > u32::BITS; const ACROSS_U64: bool = Self::RANGE_BITS > u64::BITS; const E...
Rust
0
from .otBase import BaseTTXConverter class table__f_e_a_t(BaseTTXConverter): """Feature name table The feature name table is an AAT (Apple Advanced Typography) table for storing font features, settings, and their human-readable names. It should not be confused with the ``Feat`` table or the OpenType ...
Python
1
Parse. let qi = qi.trim(); let mut parts = qi.rsplitn(2, ';').map(|p| p.trim()); let last_part = parts .next() .expect("rsplitn should return at least one part"); let coding; let quality; match parts.next() { None => { ...
Rust
0
import logging from .common.conversions import str_to_coords import numpy as np class CoordsSequenceSimilarity: """ Measure the similarity between two list of coordinates, used for keypoint estimation tasks """ @staticmethod def compute_score(pred_keypoints, gt_keypoints, k=10): """ ...
Python
1
""" evaluation.py Replicated in the NSML leaderboard dataset, KoreanFood. """ import argparse import torch def compute_iou(box_a, box_b): # make [x1,y1,x2,y2] from [x,y,w,h] box_a[:, 2:] += box_a[:, :2] box_b[:, 2:] += box_b[:, :2] max_xy = torch.min(box_a[:, 2:], box_b[:, 2:]) min_xy = torch.max...
Python
1
.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 1)) | (((...
Rust
0
ass="btn btn-warning" onclick="reloadBridgeConfig()">Reload Bridge Config</button> <button class="btn btn-danger" onclick="restartBridge()">Restart Bridge</button> </div> </div> </div> <script> let currentConfig = {}; let currentLanguage = 'ko'; ...
Python
1
epo", repo) .const_label("runner", runner), ) .unwrap() } <reponame>sm1215/rust /// The possible nucleotides in DNA and RNA #[derive(Debug, Eq, PartialEq, Clone, Copy)] pub enum Nucleotide { Adenine, Cytosine, Guanine, Thymine, Uracil, } impl Nucleotide { /// Parses a nucleo...
Rust
0
Result<Bits, Exception> { let mut fp_state = FPState::default(); fp_state.rounding_mode = if let Some(rm) = Self::rm_from_bits(f.csrs.frm().get()) { rm } else { if self.rm(ir) == 7 { return Err(Exception::IllegalInsn(*ir)); } else { ...
Rust
0
import logging from swiftclient.service import SwiftService, SwiftError from sys import argv logging.basicConfig(level=logging.ERROR) logging.getLogger("requests").setLevel(logging.CRITICAL) logging.getLogger("swiftclient").setLevel(logging.CRITICAL) logger = logging.getLogger(__name__) def is_png(obj): return (...
Python
1
Alignment of ", stringify!(ImPlotRange)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<ImPlotRange>())).Min as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(ImPlotRange), "::", stringify!(Min) ) ); a...
Rust
0
apped_column") return "\n".join(lines) return content def process_file(path: Path) -> tuple[str, str]: original = path.read_text(encoding="utf-8") lines = original.splitlines(keepends=True) i = 0 out: list[str] = [] changed = 0 while i < len(lines): line = lines...
Python
1
plt.figure(figsize=(10, 8)) plt.imshow(plv_matrix, cmap='hot', aspect='equal') plt.colorbar(label='PLV') if channel_names: plt.xticks(range(len(channel_names)), channel_names, rotation=45) plt.yticks(range(len(channel_names)), channel_names) plt.title(tit...
Python
1
er.gen_crop_cameras( [view.camera for view in input_frame.views], image_pose_stream._hand_pose_labels.camera_angles, gt_hand_model, gt_tracking, min_num_crops=1, ) res = tracker.track_frame(input_frame, calibrated_hand_model, crop_cameras) ...
Python
1
l[round_key]}] | Algorithm: [{methodcrypt}]") else: lprint("⛔") notsucessed+=[{"Filename":path.basename( Filename),"error" : "Invalid passphrase!"}] cleanscreen() lprint("\n║DECRYPTION PROCESS╠"+"═"*60+"╣[CTRL+C] C...
Python
1
formLayout(numberOfDivisions=100) column = cmds.columnLayout(adjustableColumn=True) cmds.text(label='Tweener was not downloadeded automatically.', align='left') cmds.text(label=' ') cmds.text(label='Please download the latest release from:', align='left') cmds.text( label='<a style="col...
Python
1
''' Example 1: Input: haystack = "sadbutsad", needle = "sad" Output: 0 Explanation: "sad" occurs at index 0 and 6. The first occurrence is at index 0, so we return 0. Example 2: Input: haystack = "leetcode", needle = "leeto" Output: -1 Explanation: "leeto" did not occur in "leetcode", so we return -1. ''' haystack =...
Python
1
from importlib import import_module from typing import TYPE_CHECKING, Dict, Protocol, Union, cast if TYPE_CHECKING: from ..markdown import Markdown _plugins = { "speedup": "mistune.plugins.speedup.speedup", "strikethrough": "mistune.plugins.formatting.strikethrough", "mark": "mistune.plugins.formattin...
Python
1
# Copyright (c) 2021-2023, NVIDIA CORPORATION. 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 required by ...
Python
1
ts_config['decision_ranking_agent']['goal'] indexed = "\n".join([f"[{i+1}]\n{c}" for i, c in enumerate(candidates)]) prompt = ( f"Evaluate the following candidate answers for the question and return ONLY a comma-separated list of indices from best to worst (e.g., 2,1,3).\n" f"Que...
Python
1
# Toggle case a string txt=input("Enter a string:") result = "" for ch in txt: if ch.islower(): result += ch.upper() elif ch.isupper(): result += ch.lower() else: result += ch print("Original string:",txt) print("Resultant string:",result)
Python
1
), None => SExpr::List(vec![SExpr::UnarySigilApp( ':', Box::new(SExpr::Ident(ident!("some"))), )]), } } } impl<T: FromSExpr> FromSExpr for Option<T> { fn from_sexpr(expr: SExpr) -> Result<Option<T>, InterpreterError> { let result: Result<O...
Rust
0
import difflib # Dataset QA simples dataset = [ {"pergunta": "Quem descobriu o rádio?", "resposta_certa": "Marie Curie"}, {"pergunta": "Capital do Brasil?", "resposta_certa": "Brasília"}, {"pergunta": "Quem escreveu Dom Quixote?", "resposta_certa": "Miguel de Cervantes"}, ] # Documentos simulados docs = [...
Python
1
"""Reproduce an Timer state.""" from __future__ import annotations import asyncio from collections.abc import Iterable import logging from typing import Any from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import Context, HomeAssistant, State from . import ( ATTR_DURATION, DOMAIN, S...
Python
1
LED = 8, } impl ::protobuf::ProtobufEnum for HdfsFileStatusProto_Flags { fn value(&self) -> i32 { *self as i32 } fn from_i32(value: i32) -> ::std::option::Option<HdfsFileStatusProto_Flags> { match value { 1 => ::std::option::Option::Some(HdfsFileStatusProto_Flags::HAS_ACL), ...
Rust
0
from datetime import datetime from groundlight import ExperimentalApi def test_notes(gl_experimental: ExperimentalApi): name = f"Test {datetime.utcnow()}" det = gl_experimental.create_detector(name, "test_query") gl_experimental.create_note(det, "test_note") # test runner could be either a customer o...
Python
1
_err() { println!("No previous history."); } loop { let val = input::read(&mut rl); match val { Ok(input) => { eval::eval(parser::parse(input)); }, Err(1) => { break }, Err(_) => () } } rl.save_history(histo...
Rust
0
luence Labs Limited * * 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 writing, s...
Rust
0
assert ndx.group_name_list == [ "Protein", "1ZIN", "1ZIN", "hbonds_Protein-1ZIN", "test", ] assert ndx.group_index_list[0] == [i for i in range(1, 1126)] assert ndx.group_index_list[1] == [i for i in range(1126, 1157)] assert ndx.group_index_list[2] == [i for i i...
Python
1
from precise.skaters.managers.schurmanagerfactory import schur_diag_diag_buf_emp_manager_factory # Note: Could also consider more based on schur_vol_vol_ewa_manager_factory # Stands for Lopez de Prado # Some Hierarchical Risk-Parity managers very loosely based on some literature # (Note that seriation may be differ...
Python
1
node.borrow().expr.clone(); if e.is_some() { let expr = e.unwrap(); let expr_ty = expr.borrow().ty.clone(); if expr_ty.borrow().ty != CType::PTR { bad_node!(node, format!("operand must be a pointer: {:?}", expr)); } ...
Rust
0
, 'static') # Absolute filesystem path to the directory that will hold user-uploaded files. MEDIA_ROOT = os.path.join(BASE_DIR, 'media') # Path used for database translations files LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale'), ) ORCHESTRA_SITE_NAME = '{{ project_name }}' MIDDLEWARE_CLASSES = ( 'djang...
Python
1
from django.urls import path from .views import BookListView urlpatterns = [ path('', BookListView.as_view(), name='home'), ]
Python
1
# Copyright 2023, 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 agreed to in writing...
Python
1
import textwrap def pretty_print_error(error_message): try: # Convert escape sequences (like \n and \t) to their actual characters. unescaped_message = error_message.encode('utf-8').decode('unicode_escape') except Exception: unescaped_message = error_message # Wrap each line to 100...
Python
1