text
string
label_name
string
labels
int64
import tkinter as tk from tkinter import filedialog from PIL import Image, ImageTk import shutil # Function to open an image using file dialog def open_image(): file_path = filedialog.askopenfilename() if file_path: image = Image.open(file_path) photo = ImageTk.PhotoImage(image) label....
Python
1
emantics op_waiting_for_response = op def on_twin_response(op, error): logger.debug( "{}({}): Got response for PatchTwinReportedPropertiesOperation operation".format( self.name, op.name ) ) ...
Python
1
chart, start_point, end_point, component_colors[j], -1) # Optionally draw value if val >= 0.001: cv2.putText(chart, f"{val:.3f}", (x_local+4, y+bar_height-8), cv2.FONT_HERSHEY_SIMPLEX, 0.4, tria_white, 1, cv2.LINE_AA) x_loca...
Python
1
; ldp x6, x7, [sp], #0x10 ; ldp x4, x5, [sp], #0x10 ; ldp x2, x3, [sp], #0x10 ; b >done ; self_addr: ; .qword self as *mut _ as *mut c_void as i64 ; populate_lists: ; .qword CmpLogRuntime::pop...
Rust
0
prior'] ds_all_CO[f'Prior_{Prior}'].attrs = { 'units': 'gC m-2 day-1', 'description': f'Perturbed prior fire CO flux estimated by {Prior}' } ds_all_CO[f'Posterior_exp{str(nn).zfill(2)}'] = ds['CO_post'] ds_all_CO[f'P...
Python
1
query.into_iter().map(Into::into).collect(), l_query: l_query.into_iter().map(Into::into).collect(), }) }#![doc = include_str!("../../doc/slice/ops.md")] use core::ops::{ BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Index, IndexMut, Not, Range, RangeFrom, RangeFull, RangeInc...
Rust
0
.map_or(f64::NAN, f64::sqrt) .into()) } /// Get the tangent of a number. /// /// More information: /// - [ECMAScript reference][spec] /// - [MDN documentation][mdn] /// /// [spec]: https://tc39.es/ecma262/#sec-math.tan /// [mdn]: https://developer.mozilla....
Rust
0
values for a member. pub value: u128, /// Set of all the guild IDs for a member. pub store: UnorderedSet<GuildId>, } #[cfg(feature = "u8i8_variants")] pub const U8_VARIANTS: &[&str] = &[ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", ...
Rust
0
.record # ensure that the dtype remains a record even when assigned data.dtype = dt assert data.dtype.type == np.record @pytest.mark.parametrize('nfields', [0, 1, 2]) def test_nested_fields_are_records(self, nfields): """ Test that nested structured types are treated as records...
Python
1
y /// is enabled through the custom flags. Bridge, /// PCI device. /// /// These objects have neither CPU sets nor node sets. /// They are not added to the topology unless I/O discovery /// is enabled through the custom flags. PCIDevice, /// Operating system device. /// /// T...
Rust
0
quare(); let bb = a[1].square(); let tmp = a[0].sub(a[1]); let tmp = tmp.square(); let c0 = bb.double(); let c0 = c0.add(aa); let c1 = bb.add(c0); let c1 = c1.sub(tmp); [c0, c1] } #[inline(always)] pub(crate) fn mul_fp2<E: FieldElement + From<BaseElement>>(a: &[E], b: &[E]) -> [E; 2...
Rust
0
arguments: int -- 权重 """ return common_place_judge_by_SceneTag(character_id, "Pizzeria") @add_premise(constant_promise.Premise.NOT_IN_PIZZERIA) def handle_not_in_pizzeria(character_id: int) -> int: """ 校验角色是否不在快捷连锁披萨店中 Keyword arguments: character_id -- 角色id Return arguments: int -...
Python
1
# Copyright (c) Megvii Inc. All rights reserved. import torch import torch.nn.parallel import torch.utils.data import torch.utils.data.distributed from bevdepth.exps.base_cli import run_cli from bevdepth.exps.nuscenes.base_exp import \ BEVDepthLightningModel as BaseBEVDepthLightningModel from bevdepth.models.fusio...
Python
1
from fastapi import FastAPI, Query import requests app = FastAPI() @app.get('/api/hello') def hello_world(): ''' endpoint que exibe uma mensagem incrivel do mundo da programação ''' return {'Hello': 'World'} @app.get('/api/restaurantes/') def get_restaurantes(restaurante: str = Query(None)): ...
Python
1
fn create(_: Self::Properties, _: ComponentLink<Self>) -> Self { VerifyRequest { } } fn update(&mut self, msg: Self::Message) -> ShouldRender { match msg { Msg::Ignore => { false } } } /* fn change(&mut self, _props: S...
Rust
0
ollout: ray.remote(ActorRolloutRefWorker), Role.Critic: ray.remote(CriticWorker), } global_pool_id = 'global_pool' resource_pool_spec = { global_pool_id: [config.trainer.n_gpus_per_node] * config.trainer.nnodes, } mapping = { Role.ActorRollout: global_pool_id, Role.C...
Python
1
{"code": "RTS", "market": "100"}, "巴基斯坦卡拉奇": {"code": "KSE100", "market": "100"}, "越南胡志明": {"code": "VNINDEX", "market": "100"}, "红筹指数": {"code": "HSCCI", "market": "124"}, "印尼雅加达综合": {"code": "JKSE", "market": "100"}, "希腊雅典ASE": {"code": "ASE", "market": "100"}, "墨西哥BOLSA": {"code": "MXX", "mar...
Python
1
ze(); // calculate array length let length: usize = end.offset_from(start.offset(header_size)) / mem::ptr_width_usize(); unsafe { *start.to_mut_ptr::<usize>() = vtable as usize; *start.add_ptr(1).to_mut_ptr::<usize>() = next.to_usize(); *start.add_ptr(2).to_...
Rust
0
numbytes: if numbytes < read_chunk_size: read_chunk_size = numbytes self.logger.debug("Reading %d bytes from address 0x%06X", read_chunk_size, offset) if use_word_access: data += self.avr.read_data_words(offset, read_chunk_size>> 1) else: ...
Python
1
"""Tests for AccountEmailClaim model.""" from funnel import models from .db_test import TestDatabaseFixture class TestUserEmailClaim(TestDatabaseFixture): def test_useremailclaim(self) -> None: crusoe = self.fixtures.crusoe new_email = 'crusoe@batdogs.ca' result = models.AccountEmailClai...
Python
1
t) self.main_widget = QWidget() self.main_widget.setStyleSheet(""" background-color: #F5F6FA; border-radius: 15px; """) #self.main_widget.setGraphicsEffect(shadow_effect) # 应用阴影 # 添加自定义标题栏 self.title_bar = CustomTitleBar(s...
Python
1
import heapq # Define the initial state of the stacks initial_state = [[], [], ['Yellow', 'Yellow', 'Green', 'Black', 'Red'], ['Black', 'Green', 'Black', 'Blue', 'Yellow'], ['Green', 'Blue', 'Yellow', 'Red', 'Blue'], [], [], ['Black', 'Red', 'Green', 'Red', 'Blue']] # Define the cost of moving one block to the top o...
Python
1
0.3.0", "description": "A FLAC decoding library", "reference": "https://ossindex.sonatype.org/component/pkg:cargo/claxon@0.3.0", "vulnerabilities": [ { "title": "CWE-200: Information Exposure", "desc...
Rust
0
SeqNum #[serde(skip_serializing_if = "Option::is_none")] #[serde(deserialize_with = "fix_common::workarounds::from_opt_str")]// https://github.com/serde-rs/serde/issues/1183 #[serde(default)] #[serde(rename = "1399")] pub appl_new_seq_num: Option<usize>, /// RefApplLastSeqNum #[serde(skip_serializing_if = "Optio...
Rust
0
rgs[0].strip() args.pop(0) if len(args) > 0 and "Records produced" in args[-1]: records_produced = int(re.search("Records produced: (\\d+)", args[-1]).group(1)) execution_time = float(re.search("Execution time: (\\d+.\\d+) ms", args[-1]).group(1)) ...
Python
1
from pathlib import Path from torch.multiprocessing import Process from ilock import ILock from llama_index.readers.docling import DoclingReader import torch def worker(file_path: str, sharedmem): """Worker process for loading documents using docling""" try: reader = DoclingReader() documents =...
Python
1
key.startswith("conditional_detr") and not key.startswith("class_labels_classifier") and not key.startswith("bbox_predictor") ): val = state_dict.pop(key) state_dict["conditional_detr.model" + key[4:]] = val elif "class_labels_cl...
Python
1
e"] else selected_model["display_name"] if st.button(f"Deploy {display_name}", key=model): if selected_model and endpoint_name: if not re.match(r'^[A-Za-z0-9_]+$', endpoint_name): st.error("Endpoint name can only contain letters, numbers, and under...
Python
1
&mut self.specialized { UnitSpecialized::Target => trace!("Reached target {}", self.conf.name()), UnitSpecialized::Socket(sock) => { sock.open_all() .map_err(|e| format!("Error opening socket {}: {}", self.conf.name(), e))?; } UnitSpeci...
Rust
0
x = x[:,-1:] a = a[:,-1:] ts = ts[:,-1:] pred_video, pred_audio = model(x, a, ts, mouse, btn, has_controls=cond_mask, kv_cache=cache_cond) x = x - pred_video*dt[step_idx] a = a - pred_audio*dt[step_idx] ...
Python
1
a json #[openapi] #[post("/login", format = "json", data = "<data>")] async fn login(conn : Db, data : Json<Login>) -> Result<Status, Status> { let result = conn.run(move |c| auth::login(c, data.email.clone(), data.password.clone())).await; match result{ Ok(_) => return Ok(Status::Ok), Err...
Rust
0
u8; 32], decoder: &mut Decoder) -> Option<Field> { if bytes[0] == 0x0D { return None } let mut field_name = String::with_capacity(11); // print!("Total bytes readed is {:?}", bytes); let (reason, readed, _) = decoder.decode_to_string(&bytes[0..12], &mut field_name, true); if readed ...
Rust
0
/// Converts slice to a generic array reference with inferred length; /// /// Length of the slice must be equal to the length of the array. #[inline] pub fn from_slice(slice: &[T]) -> &GenericArray<T, N> { slice.into() } /// Converts mutable slice to a mutable generic array refere...
Rust
0
data.create_simple_posting(entry, account, amount, currency) if self.config.get("show_unconfigured", False): for section in template_missing: print(section) if template_missing[section]: print(" " + "\n ".join(i for i in templ...
Python
1
example_error"] = f"Failed to create example: {str(e)}" else: result["error"] = f"Failed to create agent config directory structure at {config_path}" return result except Exception as e: logger.error("Agent config directory setup error: %s", e) return { ...
Python
1
in the `unic-langid` crate. In this case, the `key!` macro would be useful for generating a `Key` instance from a literal string. For example, ```toml [dependencies.json-gettext] version = "*" features = ["language_region_pair", "rocket"] ``` ```rust,ignore #[macro_use] extern crate rocket; #[macro_use] extern cr...
Rust
0
e": "经济型"}, {"address": "北京西城区西绦胡同15号", "facilities": "酒店提供的设施:公共区域和部分房间提供wifi;宽带上网;吹风机;24小时热水;中式餐厅;无烟房;商务中心;早餐服务;接待外宾;洗衣服务;行李寄存;叫醒服务", "hotel_id": 648, "name": "汉庭酒店(北京鼓楼店)", "phone": "010-64000123", "price": 403, "rating": 4.3, "subway": "鼓楼大街地铁站A1口", "type": "经济型"}], {"str": "找到了汉庭酒店(北京鼓楼店)、汉庭酒店(北京北苑店)、汉庭酒店(北...
Python
1
RefRef( _instance: *mut alt_CGlobalSyncedMetaDataChangeEvent, _p0: *mut alt_CGlobalSyncedMetaDataChangeEvent, ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct alt_CVehicleDestroyEvent { pub vtable: *mut ::std::os::raw::c_void, pub type_: alt_CEvent_Type, pub cancelled: bool, ...
Rust
0
"Can't serialize loca directly".to_string(), )) } } #[cfg(test)] mod tests { use crate::loca; use otspec::ReaderContext; #[test] fn loca_de_16bit() { let binary_loca = vec![0x00, 0x00, 0x01, 0x30, 0x01, 0x30, 0x01, 0x4c]; let mut reader = ReaderContext::new(binary_lo...
Rust
0
team_to_division = { # American League East "Baltimore Orioles": "AL East", "Boston Red Sox": "AL East", "New York Yankees": "AL East", "Tampa Bay Rays": "AL East", "Toronto Blue Jays": "AL East", # American League Central "Chicago White Sox": "AL Central", "Cleveland Indians": "AL ...
Python
1
from prowler.lib.check.models import Check, Check_Report_AWS from prowler.providers.aws.services.cloudtrail.cloudtrail_client import ( cloudtrail_client, ) class cloudtrail_log_file_validation_enabled(Check): def execute(self): findings = [] if cloudtrail_client.trails is not None: ...
Python
1
self } } #[doc = "Bit 16"] #[inline] pub fn soc_gtimer_en(&mut self) -> _SOC_GTIMER_ENW { _SOC_GTIMER_ENW { w: self } } #[doc = "Bit 14"] #[inline] pub fn soc_gdma1_en(&mut self) -> _SOC_GDMA1_ENW { _SOC_GDMA1_ENW { w: self } } #[doc = "Bit 13"] #[inline] ...
Rust
0
Result<Self::INPUT> { let mut res = String::new(); file.read_to_string(&mut res)?; Ok(res.lines().map(String::from).collect()) } fn part1(input: &Self::INPUT) -> Result<String> { let mut heading = (1isize, 0isize); let mut pos = (0isize, 0isi...
Rust
0
t[1]) return elif t[1] == 'tanh': if len(t[3]) == 1: t[0]=math.tanh(float(t[3][0])) else: print('%s() function need one arguments' % t[1]) return elif t[1] == 'asin': if len(t[3]) == 1: t[0]=math.asin(float(t[3][0])) else: ...
Python
1
.unwrap()).collect() } pub fn first_positions(tour_nodes: &[usize]) -> Vec<usize> { let size = tour_nodes.len(); let mut tour = tour_nodes.to_vec(); tour.reverse(); last_positions(&tour).iter().map(|&i| size - i - 1).collect() } <gh_stars>1-10 pub mod get_eval; pub mod operations; pub mod shell_operati...
Rust
0
conjunto_a = {1, 2, 3} conjunto_b = {4, 1, 2, 5, 6, 3} resultado = conjunto_a.issuperset(conjunto_b) # False print(resultado) resultado = conjunto_b.issuperset(conjunto_a) # True print(resultado)
Python
1
torch.arange(N_gt, device=device) # [N_gt] .expand(B, N_gt) # [B, N_gt] [~targets["mask"]] # [B*N_gt] ) # fmt: on # input query features for the decoder cdn_query_feat: QueryFeatures = { "feat": cdn_cls, "bbox": cdn_bbox, ...
Python
1
`\"Win32_Media_Multimedia\"`*"] pub const NS_E_WMPCORE_UNAVAILABLE: ::windows_sys::core::HRESULT = -1072885632i32; #[doc = "*Required features: `\"Win32_Media_Multimedia\"`*"] pub const NS_E_WMPCORE_UNRECOGNIZED_MEDIA_URL: ::windows_sys::core::HRESULT = -1072885623i32; #[doc = "*Required features: `\"Win32_Media_Multim...
Rust
0
/// (currently) affect parsing. pub fn string_to_pat(source_str: String) -> P<ast::Pat> { let ps = ParseSess::new(FilePathMapping::empty()); with_error_checking_parse(source_str, &ps, |p| { p.parse_pat() }) } /// Convert a vector of strings to a vector of Ident's pub fn strs_to_idents(ids: Vec<&st...
Rust
0
::de::Deserialize for UpdatePayload { fn deserialize<'a>(raw: &mut RawCbor<'a>) -> cbor_event::Result<Self> { raw.tuple(2, "UpdatePayload")?; Ok(Self { proposal: raw.deserialize()?, votes: raw.deserialize()? }) } } #[derive(Debug, Clone)] pub struct UpdateProposa...
Rust
0
i1, i2, n1 = find_closest_points(vc0, xyz, 1.5*probe_radius + rmax) dxyz = xyz[n1] - vc0[i1] adist = sqrt((dxyz*dxyz).sum(axis=1)) - radii[n1] ikeep = i1[adist < 1.5*probe_radius] kvi = [vtilist[i][0] for i in ikeep] kti = [vtilist[i][1] for i in ikeep] from numpy import concatenate keep...
Python
1
=> {}, ebpf::LD_ABS_H => {}, ebpf::LD_ABS_W => {}, ebpf::LD_ABS_DW => {}, ebpf::LD_IND_B => {}, ebpf::LD_IND_H => {}, ebpf::LD_IND_W => {}, ebpf::LD_IND_DW => {}, ebpf::LD_DW_IMM => { store =...
Rust
0
import tkinter as tk from tkinter import messagebox # Backend logic accounts = [ {"holder": "Goutam Kushwah", "account": 2111975, "password": 110903, "amount": 2000000}, {"holder": "Diksha Kushwah", "account": 2111976, "password": 220902, "amount": 1500000}, {"holder": "Devang Kushwah", "account": 2111977...
Python
1
Random { pub fn range(mut seed: u32, min: u32, max: u32) -> u32 { for x in [3, 5, 7, 9, 11, 13, 15, 17, 19].iter() { seed ^= seed + 1 << x; seed ^= seed / (21 + min) >> x; seed ^= seed / (23 + max) << x; } (see...
Rust
0
et_mark_of(self, mark, self.glen(pointy)); } } /// Length of the object (in words if `self.pointy()`, in bytes otherwise). pub fn len(&self) -> usize { self.header.obj_len() } fn glen(&self, pointy: bool) -> GSize { let len = self.len(); GSize::from(if pointy { len } else { len * Granu...
Rust
0
-slice {name}', fontsize=22, fontweight='bold') ax.set_xlabel('X', fontsize=20) ax.set_ylabel('Y', fontsize=20) # Draw boundary lines ax.axhline(y=add_pts//2, color='white', linewidth=2, linestyle='-') ax.axhline(y=length_signal + add_pts//2, color='white', linewidth=2, linestyle='-') ax.axvline...
Python
1
ed_source)) .unwrap() }; unsafe { *include_source = *blob.inner.as_mut_ptr(); (*me).blobs.push(blob); (*me).pinned.push(Rc::clone(&pinned_source)); } 0 } else { -2147024894i32 // ERR...
Rust
0
Raw for Reading { fn raw_to_reading(bytes: [u8; 4]) -> Reading { let [rh_h, rh_l, temp_h_signed, temp_l] = bytes; let rh = ((rh_h as u16) << 8 | (rh_l as u16)) as f32 / 10.0; let temp = { let (signed, magnitude) = convert_signed(temp_h_signed); ...
Rust
0
assert domains["has_more"] is True assert len(domains["data"]) == 2 assert domains["data"][0]["id"] == "domain-1" assert domains["data"][1]["id"] == "domain-2" def test_domains_list_with_before_param(self) -> None: self.set_mock_json( { "object":...
Python
1
num_params = 0 for param in net.parameters(): num_params += param.numel() if verbose: print(net) print('[Network %s] Total number of parameters : %.3f M' % (name, num_params / 1e6)) print('----------------------...
Python
1
ulse_density, 1 / 2))) / 2) mean_pd = math.pow(3 / pulse_density, 1 / 2) # mean_pd = math.pow(5 / pulse_density, 1 / 2) in_args.input['cell_size'] = round(0.05 * round(mean_pd / 0.05), 2) in_args.input['pulse_density'] = pulse_density else: ...
Python
1
from PyObjCTools.TestSupport import TestCase, min_os_level import Quartz class TestIKDeviceBrowserView(TestCase): @min_os_level("10.6") def testConstants10_6(self): self.assertEqual(Quartz.IKDeviceBrowserViewDisplayModeTable, 0) self.assertEqual(Quartz.IKDeviceBrowserViewDisplayModeOutline, 1)...
Python
1
import pygame import UnityFrame.UnityFrameBase as ufb import UnityFrame.Components.Components as cp import Entity pygame.init() pygame.display.set_caption("Hollow Knight") gameObjectManager=ufb.GameObjectManager() # 注册游戏物体管理器 # 创建背景 background = ufb.GameObject("Background", True) # 将背景对象放在渲染序列的最前面,确保它在所有对象之下 gameObj...
Python
1
nglish') ctdm = cvector.fit_transform(dfdata.stemsentence) # This is the vocabulary #print(cvector.vocabulary_) # These are the features - check them out. Try changing to bi-gram by changing the ngram_range parameter print(cvector.get_feature_names()) #print(ctdm.toarray()) # This is the term document matrix dfbow =...
Python
1
word file (Base64 encoded)")] password_file: Option<String>, #[structopt(short, long, help = "Use JWT token")] token: Option<String>, #[structopt(short = "k", long, help = "Use JWT token file")] token_file: Option<String>, #[structopt(short = "l", help = "Log into file")] log_file: Option...
Rust
0
y() return rgb[0, 0], rgb[0, 1], rgb[0, 2], rho[0] from utils import config_parser def load_model(): #config_path = 'configs/lego.txt' #ckpt_path = 'logs/blender_paper_lego/150000.tar' parser = config_parser() args = parser.parse_args() if args.ft_path is not None and args.ft_path!='None': ...
Python
1
#!/usr/bin/env python import vtkmodules.vtkCommonCore from vtkmodules.vtkCommonCore import vtkFloatArray from vtkmodules.vtkCommonDataModel import vtkDataSetAttributes dsa = vtkDataSetAttributes() for array in "Bit Char Double Float Int Long Short UnsignedChar UnsignedInt UnsignedLong UnsignedShort".split(): var =...
Python
1
Result<Self::Output, E> where F: FnMut(A) -> Result<B, E>, { self.into_iter().map(|(k, v)| Ok((k, f(v)?))).collect() } } impl<A, B, V> FuncMap<A, B, TypeParam<0>> for btree_map::IntoIter<A, V> where B: Ord, { type Output = btree_map::Into...
Rust
0
because of incompatibility with #[wasm_bindgen] internals. // The last resort is to convert manually to `JsValue` and then to `js_sys::Promise` wasm_bindgen_futures::future_to_promise(async move { self.0 .get_link_details(link.as_inner()) .await ...
Rust
0
one, PartialEq, Debug)] pub enum Index { Input(usize), Aux(usize), } /// This represents a linear combination of some variables, with coefficients /// in the scalar field of a pairing-friendly elliptic curve group. #[derive(Clone)] pub struct LinearCombination<E: ScalarEngine>(pub Vec<(Coefficient, E::Fr)>); ...
Rust
0
_chars(&normalize_case(&app_name))) .ok(); } _ => (), } } _ => (), } result } <reponame>andrisak/wascc-host<gh_stars>0 // A default implementation of the "wascc:extras" provider that is always included // with the host runti...
Rust
0
import numpy as np import pandas as pd import tensorflow as tf from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.metrics import accuracy_score, classification_report import joblib # Load and preprocess the dataset data_train = pd.read_csv(r'ExoPlanetTrai...
Python
1
msub213ps_zmm_k1z_zmm_zmmm512b32_er MemorySize::Broadcast128_Float64,// EVEX_Vfnmsub213pd_xmm_k1z_xmm_xmmm128b64 MemorySize::Broadcast256_Float64,// EVEX_Vfnmsub213pd_ymm_k1z_ymm_ymmm256b64 MemorySize::Broadcast512_Float64,// EVEX_Vfnmsub213pd_zmm_k1z_zmm_zmmm512b64_er MemorySize::Unknown,// VEX_Vfnmsub213ss_xmm_xm...
Rust
0
// this app is communicating via IPC with a higher priority app. !(chip.has_pending_interrupts() || DynamicDeferredCall::global_instance_calls_pending().unwrap_or(false) || self .kernel .get_process_iter() .position(|proc| proc.ready()) ...
Rust
0
t_os = "windows")] fn setup(out_path: &PathBuf, root_dir: &PathBuf) { let bin_dir = out_path.as_path().join("bin"); let lib_dir = out_path.as_path().join("lib"); let ffmpeg_bundle = root_dir .join("external") .join("ffmpeg") .join("ffmpeg-4.2.2-win64.zip"); if !is_target_state(&...
Rust
0
(feature = "sdl"))] fn sdl_kbd_joypad() -> Option<Box<JoypadImpl>> { None } <reponame>sjeohp/jni-bindgen // WARNING: This file was autogenerated by jni-bindgen. Any changes to this file may be lost!!! #[cfg(any(feature = "all", feature = "android-provider-ContactsContract_Groups"))] __jni_bindgen! { /// pub...
Rust
0
0), vect!(1, 1, 1))); let hb4 = BoundingBox::AabbF(AabbF::new(vect!(0, 0, 0), vect!(1, 1, 1))); assert!(hb1.get().is_none()); assert!(hb2.get().is_none()); assert_eq!(hb3.min(), vect!(0, 0, 0)); assert_eq!(hb3.max(), vect!(1, 1, 1)); assert_eq!(hb4.min(), vect!(0, 0, 0)...
Rust
0
effects::{DeleteLibraData, Effect, StopContainer}; use crate::experiments::{Context, ExperimentParam}; use crate::instance::Instance; use crate::tx_emitter::{EmitJobRequest, EmitThreadParams}; use crate::{effects::Action, experiments::Experiment}; use async_trait::async_trait; use slog_scope::info; use std::time::Insta...
Rust
0
et = self.build_humanart_dataset(data_mode="bottomup", test_mode=True) self.assertEqual(len(dataset), 3) self.check_data_info_keys(dataset[0], data_mode="bottomup") def test_exceptions_and_warnings(self): with self.assertRaisesRegex(ValueError, "got invalid data_mode"): _ = sel...
Python
1
cairo::LineCap::Butt, LineCap::Round => cairo::LineCap::Round, LineCap::Square => cairo::LineCap::Square, } } fn convert_line_join(line_join: LineJoin) -> cairo::LineJoin { match line_join { LineJoin::Miter => cairo::LineJoin::Miter, LineJoin::Round => cairo::LineJoin::Round, ...
Rust
0
token for user={user_id}") raise InvalidUserData("Неверный или просроченный токен") user.set_password(new_password) user.save() logger.info(f"Password reset successfully for user={user_id}") return user except (binascii.Error, ValueError): ...
Python
1
/// Returns a pointer to the freshly loaded or already loaded entry of the value. /// /// # Panics /// /// - If the lazy chunk is in an invalid state that forbids interaction. /// - If the lazy chunk is not in a state that allows lazy loading. fn lazily_load_mut<Q>(&mut self, index: &Q) -> &...
Rust
0
::ProtobufTypeMessage<super::kvrpcpb::Context>>( "context", |m: &Request| { &m.context }, |m: &mut Request| { &mut m.context }, )); fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::Pr...
Rust
0
nded result to {file_path}") def url_to_b64(image_url: str) -> str: # Download the image from URL response = requests.get(image_url) response.raise_for_status() # Raise an exception for bad status codes # Open image using PIL img = Image.open(BytesIO(response.content)) # Convert to ...
Python
1
= solver.add_clause_reuse(cur); cur.clear(); } else { // push literal into clause let lit = solver.get_lit(lit); //println!("add-lit {:?}", lit); solver.cur_clause.push(lit); } r } /// Add assumption into the solver #[ocaml::func] pub fn ml_batsat_assume(mut solver:...
Rust
0
m_sint(ty, ifinal); let negres = pos.ins().fadd(fhalf, fhalf); // Recycle the original instruction as a jump. pos.func.dfg.replace(inst).jump(done, &[negres]); // Finally insert a label for the completion. pos.next_inst(); pos.insert_block(done); cfg.recompute_block(pos.func, old_block); ...
Rust
0
(mut self, dse: DriveStrength) -> Self { self.value = (self.value & !DRIVE_STRENGTH_MASK) | (dse as u32); self.mask |= DRIVE_STRENGTH_MASK; self } /// Set the slew rate pub const fn set_slew_rate(mut self, sre: SlewRate) -> Self { self.value = (self.value & !SLEW_RATE_MASK) ...
Rust
0
Y == LYC) iten_lyc: bool, /// Interrupt during prelude (mode == 2) iten_prelude: bool, /// Interrupt during vblank (mode == 1). This is not the same as /// `it_vblank` above: it_vblank fires with a higher priority and /// is not shared with other interrupt sources like this one. iten_vblank:...
Rust
0
_reward_scores2 ) pickscore_win_prob1, pickscore_win_prob2 = calculate_win_probability( pickscore_scores1, pickscore_scores2 ) # Print results print(f"Comparing {folder_path1} and {folder_path2}:") print( f"AES win probability: Folder 1 = {aes_win_prob1}, Folder 2 = {aes_win_pro...
Python
1
(test_loaders)==0: print("no validation during training") else: print("validation start") for split, loader in test_loaders: if epoch_idx<=epoch_stage1-1: results=process2(split, loader, False,criterion1) ...
Python
1
b' => new_pos.1 += 1, _ => break, } } } //! This test checks that piped input is handled correctly. use std::io::Write; use std::process::{Command, Stdio}; #[test] fn piped_password() { // Run an example that reads a password and prints it let mut out = Command::new("cargo") .a...
Rust
0
fn parsing() { assert_eq!("FloorF32".parse(), Ok(LibCall::FloorF32)); } } <reponame>stevebob/orbital-decay<filename>game/src/world/realtime_periodic/data.rs use crate::{ world::{ realtime_periodic::{ animation::FRAME_DURATION, core::{RealtimePeriodicState, TimeConsumin...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of the `pypath` python module # # Copyright 2014-2023 # EMBL, EMBL-EBI, Uniklinik RWTH Aachen, Heidelberg University # # Authors: see the file `README.rst` # Contact: Dénes Türei (turei.denes@gmail.com) # # Distributed under the GPLv3 License. #...
Python
1
service(web::resource("/value") .route(web::get().to(get_field_values)) .route(web::get().to(new_field_value)) ); } pub async fn get_all(db: Data<Db>) -> impl Responder { match Field::get_all(&db.pool).await { Ok(fields) => respond::ok(fields), Err(e) => respond::er...
Rust
0
import torch import torch.nn as nn import torch.nn.functional as F class MobileNet(nn.Module): def __init__(self): super(MobileNet, self).__init__() def conv_bn(inp, oup, stride): return nn.Sequential( nn.Conv2d(inp, oup, 3, stride, 1, bias=False), nn.Ba...
Python
1
".format(i), cluster="staging", job="textfile_exporter", region="SA", device='Device {} (main) "quoted"'.format(i % 2), regex="^device{}(.+)bar\\$".format(i), address="10.0.0.1{}".format(i), ...
Python
1
pair::initmp(); for (aggregate_signature, aggregate_public_key, message) in signature_sets { // Verify subgroup of each aggregate_signature if !subgroup_check_g2(&aggregate_signature.point) { return false; } // TODO: Consider increasing rand sec...
Rust
0
UIConstants.WHITE, UIConstants.FONT_THICKNESS, ) # Instructions line 2 instructions2 = "Use Left/Right arrows to move cursor" (iw2, ih2), _ = cv2.getTextSize( instructions2, cv2.FONT_HERSHEY_SIMPLEX, UIConstants.FONT_SCALE_SMALL, ...
Python
1
#[test] fn test_day_22_part_1() { let input = r#"on x=-8..38,y=-15..37,z=-49..5 on x=-35..13,y=-26..26,z=-47..-2 on x=-44..9,y=-47..7,z=-18..35 on x=-24..20,y=-46..8,z=-10..38 on x=-32..21,y=-27..18,z=-43..6 on x=-36..18,y=-7..44,z=1..45 on x=-48..2,y=-38..16,z=-45..6 on x=-47..-3,y=-8..42,z=-4..49 on x=-26...
Rust
0
, &[new_key(&self.connection_factory.namespace)]) .await?; let id = ids.remove(0); let project = domain::Project::new(id, domain::ProjectName::try_new(project_name)?); Ok(project) } } fn new_key(namespace: impl Into<String>) -> Key { Key::new(KIND).namespace(namespace) }...
Rust
0