text
string
label_name
string
labels
int64
set_attributes( // self.to_glib_none().0, // attributes.to_glib_none().0, // n_attributes, // ); // } // } pub fn set_first_vertex(&self, first_vertex: i32) { unsafe { ffi::cogl_primitive_set_first_vertex(self.to_glib_none(...
Rust
0
_idx]:idxs_it[i][end_idx - 1] + 1] = \ timeseries[i][idxs_it[i][start_idx] - 1] else: # linear interpolation idxs_interp = np.array([idxs_it[i][start_idx] - 1, idxs_it[i][end_idx - 1] + 1]) idxs_to_interp = np.arange(idxs_it[i][start_idx], idxs_it[i][end...
Python
1
{ /// Handles the submitted [`Command`] using the [`Aggregate::handle`] method /// and updates the Aggregate [`State`]. /// /// Returns a `&mut self` reference to allow for _method chaining_. /// /// [`State`]: trait.Aggregate.html#associatedtype.State /// [`Command`]: trait.Aggregate.html#...
Rust
0
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.models import ValidationError from odoo.tests import TransactionCase, tagged @tagged('-at_install', 'post_install') class TestWebsiteRedirect(TransactionCase): def test_01_website_redirect_validation(self): with self.ass...
Python
1
reward_model_names = df.apply(lambda x: _prettify_model_name(x), axis=1).to_list() df.insert(0, "Reward Model", reward_model_names) df = df.drop(columns=["model", "model_type"]).rename(columns={"average": "Score"}) if "Pref Sets" in name: df = df.drop(columns=["...
Python
1
#[test] fn test_new_rtcp_mux_policy() { let tests = vec![ ("Unspecified", RTCPMuxPolicy::Unspecified), ("negotiate", RTCPMuxPolicy::Negotiate), ("require", RTCPMuxPolicy::Require), ]; for (policy_string, expected_policy) in tests { assert_eq!...
Rust
0
#!/usr/bin/python3 -i # # Copyright (c) 2022-2023 LunarG, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, m...
Python
1
d P_ik. # First, let's just obtain the centers. c = np.zeros((4, 3)) for i in range(4): face = [ f for f in range(4) if f != i ] # TODO: Is there a better way to exclude indices? c[i] = sum(v[face]) / 3 # Now let o be the tetartoid center. o = shift # Conside...
Python
1
kRenderPassMultiviewCreateInfoKHX`](https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkRenderPassMultiviewCreateInfoKHX) #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct VkRenderPassMultiviewCreateInfoKHX { pub sType: vk::VkStructureType, pub pNext: *const c_void, pub subpass...
Rust
0
| |-- 1_2_1 // | |-- 1_2_2 // | `-- 1_2_3 // `-- 1_3 assert_eq!( n1.traverse(&arena).collect::<Vec<_>>(), &[ Start(n1), Start(n1_1), End(n1_1), Start(n1_2), Start(n1_2_1), End(n1_2_1), S...
Rust
0
== cycle { continue; } while item == arr[pos] { pos += 1; } (arr[pos], item) = (item, arr[pos]); while pos != cycle { pos = cycle; for i in arr.iter().take(arr_len).skip(cycle + 1) { if *i < item { ...
Rust
0
ers = self.resource.raccess\ .get_users_with_explicit_access(PrivilegeCodes.CHANGE, include_user_granted_access=True, include_group_granted_access=True) self.assertEqual(len(users), 1) self.assertIn(self....
Python
1
use tonic::transport::Server; #[derive(Debug, Deserialize)] pub struct Settings { repository_kind: RepositoryKind, input_port: u16, druid: Option<DruidSettings>, victoria_metrics: Option<VictoriaMetricsSettings>, monitoring: MonitoringSettings, #[serde(default)] log: LogSettings, } #[de...
Rust
0
ct = sentence_bleu(reference_code, code.split()) # use code to run test cases time_limit = problem_info[name]['time_limit'] question_quality_result = '0' test_case_solved = ['',''] if code == '': # this is deprecated now ('') i...
Python
1
seen_tiles: # tile_h, tile_w = ctx.projection_obj.tile_shape # tile_m, tile_n = idx2xy(int(ctx.tile), (ctx.projection_obj.tiling_h, ctx.projection_obj.tiling_w)) # tile_x, tile_y = tile_m * tile_w, tile_n * tile_h # # tile_frame = next(tiles_reader[ctx.til...
Python
1
is_nan()); /// /// let y = [0.0, f64::NAN, 3.0, -2.0]; /// assert!(y.std_dev().is_nan()); /// /// let z = [0.0, 3.0, -2.0]; /// assert_eq!(z.std_dev(), (19f64 / 3.0).sqrt()); /// ``` fn std_dev(&self) -> f64 { Statistics::std_dev(self) } } impl Median<f64> for [f64] { //...
Rust
0
) } } fn lookup_child_inner(&self, key_fragment: u8) -> Option<OpaqueNodePtr<V>> { let child_index = self.lookup_child_index(key_fragment)?; // SAFETY: The value at `child_index` is guaranteed to be initialized because // the `lookup_child_index` function will only ...
Rust
0
f32) -> RayHitInfo; } extern "C" { pub fn InitAudioDevice(); } extern "C" { pub fn CloseAudioDevice(); } extern "C" { pub fn IsAudioDeviceReady() -> bool; } extern "C" { pub fn SetMasterVolume(volume: f32); } extern "C" { pub fn LoadWave(fileName: *const ::std::os::raw::c_char) -> Wave; } extern "C...
Rust
0
import warnings warnings.warn( "scipy.misc.doccer is deprecated and will be removed in 2.0.0", DeprecationWarning, stacklevel=2 )
Python
1
rm_parameters_bias_" shape = [768] dtype = "torch.float32" device = "cuda:0" mean = 0.000 std = 0.000 data = None class Program_weight_tensor_meta_L_self_modules_pooler_modules_dense_parameters_weight_: name = "L_self_modules_pooler_modules_dense_parameters_weight_" shape = [768, 768] ...
Python
1
ight=600) centrale = tk.Frame(master=self, width=400, height=600, background="#ffffff") # Inserisci l'immagine di sfondo nel laterale sinistro label_sx = tk.Label(laterale_sx, image=self.img_sx, background="#e6f7ff") label_sx.place(relwidth=1, relheight=1) # Inserisci l'immagin...
Python
1
try!(write!(f, "[0x{:08x}", self.0)); try!(write!(f, "]")); Ok(()) } } #[doc="Frames Transmitted OK Statistic Register"] #[derive(Default, Clone, Copy, PartialEq, Eq)] pub struct IeeeTFrameOk(pub u32); impl IeeeTFrameOk { #[doc="Frame count"] #[inline] pub fn count(&self) -> ::bobbi...
Rust
0
crypto_size: cipher .as_ref() .map(|c| c.key_settings.key_size.as_usize()) .unwrap_or(0) as u8, ext_hs: Some(SrtControlPacket::HandshakeResponse(SrtHandshake { version: SrtVersion::CURRENT, flags: SrtShakeFlags::SUPPORTED, ...
Rust
0
from polars.io.parquet.functions import read_parquet, read_parquet_schema, scan_parquet __all__ = [ "read_parquet", "read_parquet_schema", "scan_parquet", ]
Python
1
new(); let strategy = data_for_multiproof(self.key_bytes(), self.index_sizes()); let absent_keys_strategy = absent_keys(self.key_bytes()); proptest!( self.config(), |((mut keys, data) in strategy, absent_keys in absent_keys_strategy)| { write_data(&db, dat...
Rust
0
16 = 4821; pub const SURFBOARD: u16 = 4822; pub const SURFBOARD_SEED: u16 = 4823; pub const SURFBOARD___FLAME: u16 = 4824; pub const SURFBOARD___FLAME_SEED: u16 = 4825; pub const SURFBOARD___WAVE: u16 = 4826; pub const SURFBOARD___WAVE_SEED: u16 = 4827; pub const SURFBOARD___ELECTRIC_GREEN: u16 = 4828; pub const SURFBO...
Rust
0
unwrap()).join(plugin_name) } else { Path::new(&out_dir).join(plugin_name) }; rename(from, &to)?; if config.code_signing.sign { sign_code_command(&to, &config)?; } Ok(()) } #[cfg(target_os = "macos")] fn bundle_plugin_command(config: &Config) -> Result<(), Box<dyn Error>> { ...
Rust
0
w(missing_docs)] #[doc(hidden)] pub struct _RTC_I2C_SCL_HIGH; #[doc = "`read()` method returns [rtc_i2c_scl_high::R](rtc_i2c_scl_high::R) reader structure"] impl crate::Readable for RTC_I2C_SCL_HIGH {} #[doc = "`write(|w| ..)` method takes [rtc_i2c_scl_high::W](rtc_i2c_scl_high::W) writer structure"] impl crate::Writab...
Rust
0
import streamlit as st def copy_to_clipboard_button(text, key): """Adds a copy button to each response or prompt""" copy_script = f""" <script> function copyToClipboard(text) {{ navigator.clipboard.writeText(text).then(function() {{ console.log('Copied to clipboard:', text); ...
Python
1
let _ = self.sb.next(); } Some((range, usage)) } // only right stream (None, Some(&&(ref rb, vb))) => { let range = self.base.max(rb.start)..rb.end; self.base = rb.end; let _ = self.sb.next(); ...
Rust
0
def maxSumIS(arr, n): max = 0 msis = [0 for x in range(n)] for i in range(n): msis[i] = arr[i] for i in range(1, n): for j in range(i): if (arr[i] > arr[j] and msis[i] < msis[j] + arr[i]): msis[i] = msis[j] + arr[i] for i in range(n): ...
Python
1
('/')[0].split('?')[0] #ไธ่ƒฝ่งฃ็ ่ฏดๆ˜Ž'/'ไธๆ˜ฏbase64ๅ†…ๅฎน if param.find('@') > -1: matcher = re.match(r'(.*?)@(.*):(.*)', param) if matcher: param = matcher.group(1) node['server'] = matcher.group(2) node['server_port'] = matcher.group(3).split('&')[0] else: ...
Python
1
, Scalar}; use num_traits::Zero; use std::{borrow::Borrow, ops::Add}; impl<'a, T, R, C, S> From<&'a Matrix<T, R, C, S>> for CooMatrix<T> where T: Scalar + Zero, R: Dim, C: Dim, S: RawStorage<T, R, C>, { fn from(matrix: &'a Matrix<T, R, C, S>) -> Self { convert_dense_coo(matrix) } } imp...
Rust
0
๏ฟฝๆœŸๅ›› 08ๆ—ถ41ๅˆ†52็ง’ ***********************************************************************/ use std::thread; use std::time::Duration; use std::sync::mpsc; fn main() { // spawnๅ’Œjoin็š„ๅŸบๆœฌ็”จๆณ• let handle = thread::spawn(|| { for i in 0..5 { println!("spawned thread print {}", i); thread::sleep(Duration::from_millis(1)...
Rust
0
email setup to notify event by email.") return k = event["Key"] n = LmConf.MacAddrTable.get(k, lx("### UNKNOWN ###")) ts = event["Timestamp"] t = event["Type"] type = lx(LmNotif.HUMAN_TYPE[t]) subject = n + " - " + type m = lx("Date:") + " " + ts.st...
Python
1
} fn main() { let price1 = calculateprice(55); let price2 = calculateprice(40); // Don't modify this! if price1 == 55 && price2 == 80 { println!("Good job!"); } else { panic!("Uh oh! Wrong price!"); } } //! # Purpose //! //! This crate is for producing Rust closures that can c...
Rust
0
mod virtio; pub mod virtqueue; pub type HypervisorError = kvm_ioctls::Error; pub type DebugExitInfo = kvm_bindings::kvm_debug_exit_arch; use std::{ hint, io, mem, net::{TcpListener, TcpStream}, os::unix::prelude::JoinHandleExt, sync::{Arc, Barrier}, thread, }; use core_affinity::CoreId; use gdbstub::stub::{Dis...
Rust
0
let channel_name = "https://t.me/nympunkbot".bright_cyan(); // the text should consists of two parts, telegram handle and wallet address - we can perform some very basic validation here already let split = text.split(' ').collect::<Vec<_>>(); if split.len() != 2 { let error_message = format!(r#...
Rust
0
\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ \x00\x000\x00\x00\x000\x08\x06\x00\x00\x00W\x02\xf9\x87\ \x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\ \x01\x00\x9a\x9c\x18\x00\x00\x03\xc4IDATh\x81\xed\ \x9a_\x88\x94U\x18\xc6\x7f3;\x1a\x0b\x19\x15f\x17\ \xca\x03IPM\x09J7Q^D)&f\x05[\ \xb9\xd2\x82\xb1P\x17\x91$t\x11\x08...
Python
1
() -> Self { PrepStepDecompressArgs { format: CompressionFormat::Gzip, sub_path: None, } } } pub struct PrepStepDecompressBuilder<'a: 'b, 'b> { fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>, } i...
Rust
0
options)) ); assert_eq!( unsafe { &(*(::core::ptr::null::<ncprogbar_options>())).ulchannel as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(ncprogbar_options), "::", stringify!(ulchannel) ) ); assert_...
Rust
0
# -*- encoding=utf8 -*- from poco.drivers.android.uiautomation import AndroidUiautomationPoco class PortfolioPage: poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False) # ็ป„ๅˆๅŸบ็ก€ไฟกๆฏ product_name = poco(text="ๅˆ›ๅปบ็ป„ๅˆ032็š„") unsubscribed_button = poco(text="ๅทฒ่ฎข้˜…") subscribed_b...
Python
1
candidates, # penalty_weights=penalty_weights, sample_greedy = sample_greedy, logits_processor = logits_processor ) outputs[outputs == 0] = 2 # convert output id 0 to 2 (eos_token_id) outputs[outputs == 1] = 2 # convert output id 1 to 2 (eos_t...
Python
1
).cloned(); match (xwalk.as_ref(), maybe_xdomain) { (LTermInner::<U, E>::Var(_, _), Some(xdomain)) => { // Stream of solutions where xwalk can equal any value of xdomain map_sum(solver, state, |d| { let dterm = LTerm::from(d); ...
Rust
0
} VMInst::PUSH_CONST => { let int32 = read_int32(code, i + 1); let value = const_table.get(int32 as usize).as_value(); // TODO: Implement 'format' for 'value' format!("PushConst {}", value) } VMInst::JMP_IF_F...
Rust
0
at index `11`. Same things as above apply pub secondary_color: Color, /// The amount of secret coins this [`SearchedUser`] has collected. /// /// ## GD Internals: /// This value is provided at index `13` pub secret_coins: u8, /// The type of icon being displayed /// /// ## GD Inter...
Rust
0
# coding=utf-8 import csv import json import sys converted = [] typemap = { "Aktion": "Action", "Geld": "Treasure", "Fluch": "Curse", "Punkte": "Victory", "Reaktion": "Reaction", "Angriff": "Attack", "Dauer": "Duration", "Plรผndern": "Looter", "Ritter": "Knight", "Ruine": "Ruin...
Python
1
from unittest import mock import pytest from great_expectations.data_context.store.data_context_store import DataContextStore from great_expectations.data_context.types.base import DataContextConfig @pytest.mark.unit def test_serialize(basic_data_context_config: DataContextConfig): store = DataContextStore(stor...
Python
1
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1 import typing, winrt import enum _ns_module = winrt._import_ns_module("Windows.Media.Effects") try: import winrt.windows.foundation except: pass try: import winrt.windows.foundation.collections except: pass try: ...
Python
1
"korean")] /// The Korean language. Korean, #[cfg(feature = "spanish")] /// The Spanish language. Spanish, } impl Language { /// Get words from the wordlist that start with the given prefix. pub fn words_by_prefix(self, prefix: &str) -> &[&'static str] { let first = match self.word_list().iter().position(|w|...
Rust
0
import asyncio import awaitwhat FUTURES = [] async def main(): t = asyncio.create_task(test()) await do_work() await t async def do_work(): futs = [frob_a_tree() for i in range(3)] await asyncio.gather(*futs) async def frob_a_tree(): await b_tree() async def b_tree(): f = asyncio.F...
Python
1
contents, you get youself a buffer editor via the //! `edit_vertex_buffer` method of Context that in turn allows you to call `data` or `sub_data` to //! set the contents. The `edit_vertex_buffer` takes `&mut self` as its first parameter, so there //! can exist only a single editor object at a time. //! //! The idea be...
Rust
0
arg, expect_output) in test_cases { let arg = arg.parse::<Decimal>().ok(); let expect_output = expect_output.parse::<Decimal>().ok(); let output = RpnFnScalarEvaluator::new() .push_param(arg.clone()) .evaluate(ScalarFuncSig::AbsDecimal) ...
Rust
0
import tensorflow as tf import math def rotate_to_normal(pose, normal, around): z_axis = normal y_axis = tf.linalg.cross(tf.constant( [1.0, 0.0, 0.0], dtype=tf.float32), z_axis) x_axis = tf.linalg.cross(z_axis, y_axis) axis = tf.stack([x_axis, y_axis, z_axis]) return tf.tensordot(pose - ar...
Python
1
alumnos = dict(Luis=9.9, Maria=6.3, Adolfo=3.8, Pedro=10) def sumar_punto(item: dict): if item[1] >= 9: nota = 10 else: nota = item[1] + 1 return item[0], nota nuevas_notas = map(sumar_punto, alumnos.items()) print(dict(nuevas_notas).keys()) ''' Crear la clase Persona con nombre, edad, y...
Python
1
manager::ShellManager; crate use crate::shell::value_shell::ValueShell; crate use crate::stream::{InputStream, OutputStream}; crate use crate::traits::{HasSpan, ToDebug}; crate use crate::Span; crate use crate::Text; crate use futures::stream::BoxStream; crate use futures::{FutureExt, Stream, StreamExt}; crate use futu...
Rust
0
# Time: O(n) # Space: O(1) class Solution(object): def findDuplicates(self, nums): """ :type nums: List[int] :rtype: List[int] """ result = [] for i in nums: if nums[abs(i)-1] < 0: result.append(abs(i)) else: n...
Python
1
Address Register"] pub dmac_fdesc_addr_reg5: crate::Reg<dmac_fdesc_addr_reg::DMAC_FDESC_ADDR_REG_SPEC>, #[doc = "0x270 - DMAC Package Number Register"] pub dmac_pkg_num_reg5: crate::Reg<dmac_pkg_num_reg::DMAC_PKG_NUM_REG_SPEC>, _reserved72: [u8; 0x0c], #[doc = "0x280 - DMAC Channel Enable Register"...
Rust
0
if receiver['started']: target_task = receiver['started'] target_task.add_args({'received': target_task.sizes}) target_task.end(target_task.end_time) receiver['started'] = None def finalize(self): for target, receiver in self.tcpip.iteritems(): s...
Python
1
alEq, Clone)] pub enum AttributeValue { /// A string attribute such as value="My text input contents" String(String), /// A boolean attribute disabled=true Bool(bool), } impl AttributeValue { /// If the attribute is a string, return it. Otherwise return None. pub fn as_string(&self) -> Option<&...
Rust
0
let scanners: &mut Vec<&Scanner> = &mut vec![ &DelimiterScanner, &AlphabetScanner, &ZeroScanner, &IntegerScanner, ]; lex_from_str("|: abc 123", "Pipe Otag<:> Chvc<abc> Nmbr<123>", scanners); } #[test] #[ignore] fn bind_piq() { lex_from_str_with_all_scanners("|# abc 123", "P...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ๅ…จ้ข await/sync ่ชฟ็”จๆชขๆŸฅ ๆชขๆŸฅๆ‰€ๆœ‰ๅฏ่ƒฝ็š„ await ไฝฟ็”จ้Œฏ่ชคๅ’Œๆ–นๆณ•่ชฟ็”จๅ•้กŒ """ import ast import re import sys from pathlib import Path def check_await_usage(): """ๆชขๆŸฅ await ไฝฟ็”จๆ˜ฏๅฆๆญฃ็ขบ""" print("๐Ÿ” ๅ…จ้ข await/sync ่ชฟ็”จๆชขๆŸฅ") print("=" * 60) file_path = Path("cogs/reservoir_commands...
Python
1
. @file attribute.rs @brief Markup attribute types */ //a Imports use super::{Name, NamespaceStack}; //a Attribute //tp Attribute /// An [Attribute] has a [Name] and a [String] value. /// /// They correspond to attributes in markup tags #[derive(Clone, Eq, PartialEq, Hash, Debug)] pub struct Attribute { //...
Rust
0
0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d, 0x3c, 0x16, 0xc1, 0x72, 0x51, 0xb2, 0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0, 0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a, ]); let bobpk = PublicKey::from([ 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3,...
Rust
0
o = Version::At(pkg.version.clone()); if changes.from != to { changes.to = to; } else { diff.remove(pkg.name.as_str()); } } else { insert_changes(&mut diff, Changes::from_new(pkg)) } } diff } fn insert_changes(dif...
Rust
0
from .chess_detection import detect_abnormal_moves, detect_cheating_pattern from .shooting_detection import detect_aimbot, detect_wallhack, detect_script from .game_integration import integrate_with_game
Python
1
""" runs model.pt and saves patient-level preds on external test set """ import hydra import wandb import torch from torch.utils.data import DataLoader import pandas as pd from utils.dataset import SinglePatientDataset from train import get_outputs from pathlib import Path import os device ='cuda' if torch.cuda.is_av...
Python
1
with open('txt/26_3586.txt') as file: n = int(file.readline()) trees = [list(map(int, i.split())) for i in file] trees = sorted(trees, key=lambda x: (-x[0], x[1])) rows = [] for tree1, tree2 in zip(trees, trees[1:]): if tree1[0] == tree2[0]: rows.append([tree2[1] - tree1[1] - 1, tree1[0]]) print(ma...
Python
1
fut.poll() { Ok(Async::NotReady) => Ok(Async::NotReady), Ok(Async::Ready(res)) => Ok(Async::Ready(res.into())), Err(e) => { let e: Error = e.into(); error!("Error in handler: {:?}", e); Ok(Async::Ready(())) } } }...
Rust
0
) .map_err(|err| Error::generic_execution_error_caused("", err))?; match proto_id { Some(proto_id) => Ok(Value::Object(proto_id)), None => Ok(interpreter.intern_nil_symbol_value()), } } #[cfg(test)] mod tests { use super::*; #[allow(unused_imports)] use nia_basic_assertion...
Rust
0
[config.best_model_eval_metric] old_eval_metric_value = best_state.best_eval_metric_value if eval_metric_is_better_op(current_eval_metric_value, old_eval_metric_value): logging.info("%s: %s %s %s, saving new best checkpoint.", config.best_model_...
Python
1
l IntoIterator<Item = T>, result: T, f: impl Fn(T) -> U, ) { assert!(lower_upper_minus_one.into_iter().all(|i| { if i < result { f(i) > f(i + T::one()) } else { f(i) <= f(i + T::one()) } })); } /////////////...
Rust
0
_header(&mut file)?; let start_pos = file.stream_position()?; let index = LogFile::make_index(&mut file)?; Ok(LogFile { file, index, start_pos, }) } fn check_header(file: &mut BufReader<File>) -> anyhow::Result<()> { let mut header = [...
Rust
0
method("android/media/audiofx/Visualizer\0", "setDataCaptureListener\0", "(Landroid/media/audiofx/Visualizer$OnDataCaptureListener;IZZ)I\0"); __jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr()) } } /// public static final [ALREADY_EXISTS](https://de...
Rust
0
# Copyright (c) OpenMMLab. All rights reserved. import mmcv import torch from mmdet.models.dense_heads import YOLOFHead def test_yolof_head_loss(): """Tests yolof head loss when truth is empty and non-empty.""" s = 256 img_metas = [{ 'img_shape': (s, s, 3), 'scale_factor': 1, 'pad...
Python
1
ServiceRegistries").start_array(); for item_1710 in var_1708 { { let mut object_1711 = array_1709.value().start_object(); crate::json_ser::serialize_structure_crate_model_aws_ecs_service_service_registries_details(&mut object_1711, item_1710); object_1...
Rust
0
import requests from pyfiglet import Figlet def main(): figletfunc("CURRENCY CONVERTER") currin = input("ENTER INPUT CURRENCY CODE(INR/EUR/AUD): ") amt = int(input("ENTER AMOUNT: ")) val1 = convert_to_usd(currin.upper()) usdval = amt/val1 usdval = round(usdval, 2) currout = input("ENTER OU...
Python
1
parameters (use DamlVariant instead))") } }) .collect(); let type_arguments = extract_generic_type_arguments(generics); AttrEnum::new(name, all_constructors, type_arguments) } fn extract_generic_type_arguments(generics: &Generics) -> Vec<String> { generics .params ...
Rust
0
.scatter(subDf.bcodeCount, subDf.asmCount) plt.title("ASM variation by Bytecode") plt.xlabel("Bytecode Instruction Count") plt.ylabel("ASM Instruction Count") if plotFile is not None: plt.savefig(plotFile) return plt def predictionErrorPlot(df, plotFile=None, minPerc=None, maxPerc=None, ...
Python
1
'''OpenGL extension ARB.derivative_control This module customises the behaviour of the OpenGL.raw.GL.ARB.derivative_control to provide a more Python-friendly API Overview (from the spec) This extension provides control over the spacial granularity at which the underlying implementation computes derivatives. ...
Python
1
now: now, request_queue: request_queue } } pub fn poll(&self) { for (interval, plugins) in &self.intervals { let elapsed_secs = self.now.elapsed().as_secs(); if elapsed_secs > 0 && interval > &0 && elapsed_secs % interval == 0 { for plugin_name in plugins { self.reques...
Rust
0
ached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { if let Some(ref v) = self.task_id.as_ref() { os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; os.write_raw_varint32(v.get_cached_size())?; v.write_to_with_cached_...
Rust
0
ement. Warning is an extension of the Element class. """ return self._tree.warning def __len__(self) -> int: return len(self._tree) def __iter__(self): yield from self._tree def __getitem__(self, idx: int) -> Node: return self._tree[idx] def get(se...
Python
1
Future<'static, ExitStatus> = Box::pin(async { EXIT_SUCCESS }); Ok(ret) }), } } } <gh_stars>0 mod circle; mod cuboid; mod line1; mod line2; mod polygon; mod rect; mod triangle; pub use circle::Circle; pub use cuboid::Cuboid; pub use line1::Line1; pub use line2::Line2; pub use po...
Rust
0
mpliance 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, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express...
Rust
0
e": "<์ „์ž์ •๋ถ€ํ”„๋ ˆ์ž„์›Œํฌ ์Šคํƒ€์ผ์˜ VO ์ฝ”๋“œ>", "report": {{"๋ณ€๊ฒฝ ์‚ฌํ•ญ": "<๋ณ€๊ฒฝ ์‚ฌํ•ญ>", "์ถ”๊ฐ€ ์‚ฌํ•ญ": "<์ถ”๊ฐ€ ์‚ฌํ•ญ>", "์š”์•ฝ": "<๋ณ€ํ™˜ ๋ฐ ์ƒ์„ฑ ์š”์•ฝ>" }} }} }} - code์™€ report ์™ธ์—๋Š” ์•„๋ฌด๊ฒƒ๋„ ์ถœ๋ ฅํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. """ ) if __name__ == '__main__': from langchain_openai import ChatOpenAI llm = ChatOpenAI(model="gpt-4o-mini", api_ke...
Python
1
] * stride_kd v_ptrs = V_ptr + start * stride_vn + block_kv * stride_vn + pid_h * stride_vh +\ tl.arange(0, BLOCK_SIZE_N)[:,None] * stride_vn + \ tl.arange(0, D)[None, :] * stride_vd k = tl.load(k_ptrs,...
Python
1
{ #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::ln::msgs::UpdateFulfillHTLC> { if self.datalen == 0 { return Vec::new(); } let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into(); self.data = std::ptr::null_mut(); self.datalen = 0; re...
Rust
0
char, c_uint, c_ulong, c_void}; use std::cell::Cell; use std::collections::VecDeque; use std::ffi::{CStr, CString}; use std::mem; use std::ptr; use std::slice; use std::str; use std::sync::{Mutex, Once, ONCE_INIT}; use std::sync::atomic::{AtomicBool, Ordering}; use gl; use x11::key::{ElementState, ScanCode, VirtualKey...
Rust
0
println!("Digite um numero entre 1 e 100"); chute = myio::read_u8(); //Verificando se o chute eh invalido if chute <1 || chute >100 { //Imprimindo mensagem de erro eprintln!("O chute deve ser entre 1 e 100"); } else { //Saindo ...
Rust
0
lar1_min(c: &mut Criterion) { bench(c, &NG_MIN, "angular1_min", false); } fn jquery(c: &mut Criterion) { bench(c, &JQ, "jquery", false); } fn jquery_min(c: &mut Criterion) { bench(c, &JQ_MIN, "jquery_min", false); } fn react(c: &mut Criterion) { bench(c, &REACT, "react", false); } fn react_min(c: &m...
Rust
0
f def mask_entity_coordinates( df: DataFrame, ) -> DataFrame: """ Mask the target entity and other entities in the text. Args: df (DataFrame): The input DataFrame Returns: DataFrame: The masked DataFrame """ i = 1 entity_counter = {} df["masked_text"] = None df...
Python
1
from osgeo import gdal from skimage import io, morphology import numpy as np from data_crop.project_array import project_array_and_save def cutoff(extent_path, boundary_path, result_path, threshold: float = 0.5): """ extent_map & boundary_map: float (0-1) """ extent_ds...
Python
1
ng(), &agent_signer, 0, "get_agent".into(), "{\"account_id\": \"agent.root\"}".as_bytes().to_vec(), DEFAULT_GAS, CryptoHash::default(), )); let (_, res_outcome2) = res2.unwrap(); let new_agent_balance2 = match res_outcome2.status { ExecutionStatus::Suc...
Rust
0
import torch.nn.functional as F import torch import numpy as np # ## ๅฎšไน‰ๆŸๅคฑๅ‡ฝๆ•ฐ ''' # partly sccnLoss loss = torch.sum(torch.mul(diff, 1 - pux)) / N HingeLoss loss = torch.sum( torch.mul(diff, 1 - pux) + torch.mul( torch.where(diff < m,...
Python
1
me") @_builtins.property @pulumi.getter(name="primaryAccessKey") def primary_access_key(self) -> pulumi.Output[_builtins.str]: """ The Primary Shared Access Key associated with the EventGrid Topic. """ return pulumi.get(self, "primary_access_key") @_builtins.property ...
Python
1
target: vec2(cam_x, cam_y), zoom: vec2(2.0 / WIDTH, 2.0 / HEIGHT) * 16.0, ..Default::default() }; set_camera(&cam); system_draw_colored_boxes(&self.world, &self.physics); system_draw_projectiles(&self.world, &self.physics); system_draw_particl...
Rust
0
* 30) # for x in srch_res.groups(): # print(x) # from re import search as s # from re import findall as f # # name = 'KAreem Ashraf' # # my_re = r'[A-Z]+' # searches for a group of uppercase letters # # srch_rslt = s(my_re, name) # # # print(srch_rslt) # # # print(srch_rslt.group()) # # print(srch_rslt.spa...
Python
1
(0, cross_product(dir, v7)) EQUAL(0, cross_product(dir, v8)) EQUAL(0, cross_product(dir, v9)) // Check that the resulting vectors are orthogonal // to the difference between them and the original vector. EQUAL(0, (v2 - v1) * v2) EQUAL(0, (v3 - v1) * v3) EQUAL(0, (v4 - v1) * v4) EQUAL(0...
Rust
0
import os import uuid from typing import List, Dict, Any, TYPE_CHECKING from langchain_community.document_loaders import PyPDFLoader from langchain_text_splitters import RecursiveCharacterTextSplitter from langchain_nvidia_ai_endpoints import NVIDIAEmbeddings from django.conf import settings from .qdrant_client import...
Python
1