text
string
label_name
string
labels
int64
2048. pub fn tick(&mut self, channel_enable: &mut bool, channel_frequency: &mut u16) { self.sweep_timer = self.sweep_timer.saturating_sub(1); if self.sweep_timer == 0 { if self.sweep_enabled && self.sweep_period != 0 { let temp_freq = self.sweep_calculations(channel_enab...
Rust
0
ow(unused_braces)] pub(crate) mod output_area; // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global // allocator. #[cfg(feature = "wee_alloc")] #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; #[wasm_bindgen(start)] pub fn main() -> Result<(), JsValue> { pani...
Rust
0
import json from configparser import ConfigParser from operator import attrgetter from pathlib import Path from types import SimpleNamespace def _verify_lockfile(): """Assert that all the packages in Pipfile are in Pipfile.lock""" config = ConfigParser() config.read('Pipfile') pipfile_packages = set...
Python
1
ARGO_FEATURE_PI3").is_some() && target_arch == "aarch64" { let _ = fs::write( "./target/config.txt", r#"####################################################### # RPi3 configuration settings for baremetal bootloader ####################################################### # fix the core frequency dr...
Rust
0
rKzAddressHeader.addressesvs5 ?? "#$L$LLDOr#) r6rBrCrrrrr`rdrDrrKrrs@r!rrGs]I CC6" r#rceZdZdZy)UniqueAddressHeaderrP...
Python
1
import random from _context import simplemind as sm class InspirationPlugin(sm.BasePlugin): # Define inspirations as a class variable inspirations: list[str] = [ "The only limit to our realization of tomorrow is our doubts of today.", "Imagine beyond the edges of what you know.", "Wha...
Python
1
: f32, pub sub_pixel_interpolation_offset_bits: u32, pub max_framebuffer_width: u32, pub max_framebuffer_height: u32, pub max_framebuffer_layers: u32, pub framebuffer_color_sample_counts: SampleCountFlags, pub framebuffer_depth_sample_counts: SampleCountFlags, pub framebuffer_stencil_sample_...
Rust
0
t.write("\n") def create_mk(target, data, platform): mk_copyright(target) mk_help(target, platform) create_params(target, data) add_host_flags(target, data, platform) add_kernel_flags(target, data, platform) mk_build_all(target, data, platform) mk_run(target, data, platform) mk_clean(t...
Python
1
# Copyright (c) 2020 PaddlePaddle Authors. 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 appli...
Python
1
c] fn test_clamp_min_greater_than_max() { let _ = 1.0f64.clamp(3.0, 1.0); } #[test] #[should_panic] fn test_clamp_min_is_nan() { let _ = 1.0f64.clamp(f64::NAN, 1.0); } #[test] #[should_panic] fn test_clamp_max_is_nan() { let _ = 1.0f64.clamp(3.0, f64::NAN); } #[test] fn test_total_cmp() { use core::c...
Rust
0
the QR code. Modules are arranged in left-to-right, then /// top-to-bottom order. modules: Vec<Module>, } impl Canvas { /// Constructs a new canvas big enough for a QR code of the given version. pub fn new(version: Version, ec_level: EcLevel) -> Self { let width = version.width(); Self...
Rust
0
seconds".format(avg_detection_latency)) print("Average Tracking Latency per Frame: {:.4f} seconds".format(avg_tracking_latency)) print("Average Total Latency per Frame: {:.4f} seconds".format(avg_total_latency)) # Paths to your video folder video_folder = r"C:\Users\akhil\Akhil_work\deep_sort\__MACOSX\test\Mi...
Python
1
(..)` constructor, creating a new instance of `FontFace`."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FontFace/FontFace)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `FontFace`*"] pub fn new_with_array_buffer_...
Rust
0
B_BLE_GC2_R { pub(crate) fn new(bits: u8) -> Self { TX_DVGA_GAIN_QDB_BLE_GC2_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for TX_DVGA_GAIN_QDB_BLE_GC2_R { type Target = crate::FieldReader<u8, u8>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[do...
Rust
0
\\PY64_PROJECT\\CDLL_TEST\\h\\MBx_utility.h: 204 def MBxMasterErrorFullQ(pMBX): return (((((((pMBX.contents.Error).value).Head).value) + 1) % MBX_MASTER_ERROR_QUEUE_MAX) == ((((pMBX.contents.Error).value).Tail).value)) # E:\\PY64_PROJECT\\CDLL_TEST\\h\\MBx_utility.h: 210 def MBxMasterRequestEmptyQ(pMBX): retur...
Python
1
change this property. pub options: Option<::Value<::json::Value>>, /// Property [`Tags`](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewaymulticastdomain.html#cfn-ec2-transitgatewaymulticastdomain-tags). /// /// Update type: _Mutable_. /// AWS CloudFormat...
Rust
0
d_sql"] else "No SQL expected" ) # Display test checks st.markdown("**Test Checks**") checks_df = pd.DataFrame(test_data["results"]) checks_df = checks_df[["name", "passed", "notes"]] checks_df = checks_df.rename( columns={ ...
Python
1
.abs() < 0.001); } #[test] fn test_translation (){ let i1 = Mat4x4::ident(); let t1 = Mat4x4::translation(0.1, 0.2, 0.3); let r = i1 * t1; assert!((r.m[0] - 1.0).abs() < 0.001); assert!((r.m[1] - 0.0).abs() < 0.001); assert!((r.m[2] - 0.0).abs() < 0.001); assert!((r.m[3] - 0.1).abs() < 0.001); as...
Rust
0
0"; pub const k_pch_SteamVR_StartDashboardFromAppLaunch_Bool: &'static [u8; 28usize] = b"startDashboardFromAppLaunch\0"; pub const k_pch_SteamVR_StartOverlayAppsFromDashboard_Bool: &'static [u8; 30usize] = b"startOverlayAppsFromDashboard\0"; pub const k_pch_SteamVR_EnableHomeApp: &'static [u8; 14usize] = b"enab...
Rust
0
# pylint: disable=E0611 # Drakkar-Software OctoBot-Trading # Copyright (c) Drakkar-Software, All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version ...
Python
1
"uwp"))] pub fn link(original: &Path, link: &Path) -> io::Result<()> { let original = maybe_verbatim(original)?; let link = maybe_verbatim(link)?; cvt(unsafe { c::CreateHardLinkW(link.as_ptr(), original.as_ptr(), ptr::null_mut()) })?; Ok(()) } #[cfg(target_vendor = "uwp")] pub fn link(_original: &Path...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # (c) B.Kerler 2019-2023 under GPLv3 license # If you use my code, make sure you refer to my name # # !!!!! If you use this code in commercial products, your product is automatically # GPLv3 and has to be open sourced under GPLv3 as well. !!!!! # TXT to EDL Loader (c) B.Ke...
Python
1
nt.bold = True ppt_file_path = f"Miniproject/{topic}_presentation.pptx" prs.save(ppt_file_path) return ppt_file_path def get_ppt_download_link(ppt_file_path): with open(ppt_file_path, "rb") as file: ppt_contents = file.read() b64_ppt = base64.b64encode(ppt_contents).decode() file_name...
Python
1
.with(TextSystem, "text", &[]) .with(UseSystem, "use", &[]) .with_bundle(ArcBallControlBundle::<StringBindings>::new().with_sensitivity(0.1, 0.1))? .with_bundle(TransformBundle::new().with_dep(&["arc_ball_rotation"]))? .with_bundle( InputBundle::<StringBindings>::new(...
Rust
0
Foo<u8> { fn default() -> Self { Self { private: 0, public: 0, public_option: Some(Arc::new(0)), } } } pub fn main() { let mut foo = Foo::<u8>::default(); foo.set_private(&mut 1); (*foo.private_mut()) += 1; assert_eq!(*foo.private(), 2); ...
Rust
0
lay { meta_tx: transfer_msg.into(), signature: signature.into(), public_key: sender_pub_key.into(), }; let res = execute(deps.as_mut(), env.clone(), info, relay_msg).unwrap(); assert_eq!(0, res.messages.len()); // Check balance of sender (ACCOUNT_4) let query_msg = QueryMsg:...
Rust
0
"d": 0 }, "adProofsId": "86eaa41f328bee598e33e52c9e515952ad3b7874102f762847f17318a776a7ae", "transactionsId": "ac80245714f25aa2fafe5494ad02a26d46e7955b8f5709f3659f1b9440797b3e", "parentId": "6481752bace5fa5acba5d5ef7124d48826664742d46c974c98a2d60ace229a34" }"...
Rust
0
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云 - 监控平台 (BlueKing - Monitor) available. Copyright (C) 2017-2025 Tencent. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain ...
Python
1
) -> Self::Builder; } /// Builder for when a component has no properties pub struct EmptyBuilder; impl Properties for () { type Builder = EmptyBuilder; fn builder() -> Self::Builder { EmptyBuilder } } impl EmptyBuilder { /// Build empty properties pub fn build(self) {} } /// Link to com...
Rust
0
double; let mut avg: [c_double; 3] = [0.0; 3]; let loads: i32 = unsafe { getloadavg(avg.as_mut_ptr(), 3) }; if loads == -1 { println!(); } else { print!("load average: "); for n in 0..loads { print!( "{:.2}{}", avg[n as usize], ...
Rust
0
ount_sentences(text_content) # Comptage ponctuations punctuation_list = [ch for ch in text_content if ch in ',.!?;:'] stats['punctuation_counts'].update(punctuation_list) # --- 3) Analyser les fichiers audio (wav + mp3) --- # On ne traite que si "audio" est dans le ...
Python
1
t calls to get a better idea of the average and variance of the rate. subtract_latency: A value, in seconds, to subtract from the end-to-end duration in order to determine repetition rate. Useful if you would like to remove network latency or other round-trip...
Python
1
, src_aoi_org[1], src_aoi_org[0] + mapimg.tile_size[0], src_aoi_org[1] + mapimg.tile_size[1] ) character = mapimg.img.crop(src_aoi) lutimg.img.paste(character, lutimg.get_aoi_origin([u,v])) # overlay relevant pixels for x in range( 0 , lutimg.tile_size[0] ): pixel_col = (192) if (u & (1 << (lutimg...
Python
1
32, fds: /*Ignored*/Vec<PollFD>) -> (i32, i32) { // unsafe { TODO: call ffi:g_main_context_query() } //} #[doc(alias = "g_main_context_release")] pub fn release(&self) { unsafe { ffi::g_main_context_release(self.to_glib_none().0); } } //#[doc(alias = "g_main_cont...
Rust
0
rates = [ 'DB(CBN,DEM,10,MIDYLD)', 'DB(CBN,ITL,10,MIDYLD)', 'DB(CBN,USD,10,MIDYLD)' ] uncertainty = [ #'DB(QA,.VIX,PRICE,CLOSE)', 'DB(COV,VOLSWAPTION,EUR,05Y,06M,PAYER,PREM)', 'sum(DB(NEO-US, eur/vol/index/swaption/3mx2y/daily))' ] politics = [] govt_finances = [ 'DB(JPMAQS,ITL_GGNDGDPRA...
Python
1
import pytest from xdsl.builder import ImplicitBuilder from xdsl.dialects.builtin import i1 from xdsl.dialects.test import TestOp from xdsl.ir import Block, Region from xdsl.ir.region_utils import used_values_defined_above def test_used_values_defined_above(): r = Region(Block()) r0 = Region(Block()) r1 ...
Python
1
import math, urllib2, json, re def download(): graph = {} page = urllib2.urlopen("http://fx.priceonomics.com/v1/rates/?q=1") jsrates = json.loads(page.read()) pattern = re.compile("([A-Z]{3})_([A-Z]{3})") for key in jsrates: matches = pattern.match(key) conversion_rate = -math.log(float(jsrates[key])) fro...
Python
1
MA ("commat", "\u{0040}"), // COMMERCIAL AT ("comp", "\u{2201}"), // COMPLEMENT ("compfn", "\u{2218}"), // RING OPERATOR ("cong", "\u{2245}"), // APPROXIMATELY EQUAL TO ("congdot", "\u{2A6D}"), // CONGRUENT WITH DOT ABOVE ("conint", "\u{222E}"), // CONTOUR INTEGRAL ("copf", "\...
Rust
0
get_parse("TEST_GET_SOCKETADDRV4_UNDEFINED"); assert!(if let Err(EnvmntError {kind: ErrorKind::Missing(_)}) = output_socketaddrv4 {true} else {false}); let output_socketaddrv6: Result<SocketAddrV6, EnvmntError> = get_parse("TEST_GET_SOCKETADDRV6_UNDEFINED"); assert!(if let Err(EnvmntError {kind: ErrorKind...
Rust
0
st: Some(black_list), } } /// Create a new `PrivatEmailConfig` struct pub fn new<F, T, B>(from_email: F, to_email: T, black_list: B) -> Self where F: ToString, T: ToString, B: ToString, { let b_list_vec = black_list.to_string(); let b_list: Vec<String...
Rust
0
est_utils.GetTempDir()) self.assert_(p.exited) self.assertEquals(0, p.exit_code) output_file_name1 = test_name + ".xml" output_file1 = os.path.join(self.output_dir_, output_file_name1) output_file_name2 = 'lt-' + output_file_name1 output_file2 = os.path.join(self.output_dir_, output_file_name2)...
Python
1
import torch import argparse import json if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--model_dir", type=str, default="./OUTPUT_MODEL/G_latest.pth") parser.add_argument("--config_dir", type=str, default="./configs/modified_finetune_speaker.json") args = parser.pars...
Python
1
TuVwXyZ"); let nr = name2number_i64("gkgwByLwRXTLPP", &charset).unwrap(); assert_eq!(nr, ::std::i64::MIN); } } #[cfg(test)] mod type_u128 { use super::*; use crate::Charset; #[test] fn unsigned() { let charset = Charset::case_sensitive("aBcD"); let nr = name2number_...
Rust
0
osit_descriptor .derive(child_number.into(), &secp) .inner(), )?; desc_san_check( unvault_descriptor .derive(child_number.into(), &secp) .inner(), )?; desc_san_check(cpfp_descriptor.derive(child_number.into(), &secp).inner())?; // We reuse the...
Rust
0
) << 1), (((3 << 3) + 1) << 2) - 1, (((7 << 2) - 1) << 2), ((((3 << 2) + 1)) << 3) + 1, (7 << 4), (3 << 5) + (1 << 1), (7 << 4) - 1, (3 << 5) + 1, (7 << 4) + (1 << 1), (((3 << 3) + 1) << 2), (5 << 4) + (1 << 1), (((3 << 3) + 1) << 2) + 1, (3 << 5) + 1, (((3 << 3) + 1) << 2), (((1 << 4) + 1) << 1), (((3 << 3) - 1) << 2)...
Python
1
# 创建agnostic-mask图像 mask_image = Image.fromarray(mask * 255) mask_image = mask_image.convert("RGB") mask_image = pil2tensor(mask_image) temp = (torch.clamp(mask_image, 0, 1.0) * 255.0).round().to(torch.int) temp = torch.bitwise_left_shift(temp[:,:,...
Python
1
vHue<T>) { self.into_components() } } impl<Wp: WhitePoint, T: FloatComponent, H: Into<LuvHue<T>>, A: Component> From<(T, T, H, A)> for Alpha<Lchuv<Wp, T>, A> { fn from(components: (T, T, H, A)) -> Self { Self::from_components(components) } } impl<Wp: WhitePoint, T: FloatComponent, A: C...
Rust
0
(dest, idxn, src, degs): n = degs.numel() w = src.size(1) assert n == src.size(0) and w == dest.size(1) assert type(src)==type(dest) and isinstance(degs, torch.cuda.LongTensor) and isinstance(idxn, torch.cuda.LongTensor) function, stream = get_kernel_func('avgpool_bw_kernel', avgpool_bw_kern...
Python
1
pub inclusion: Option<HashSet<&'a str>>, /// Source files to be excluded, to exclude nothing, set it to empty pub exclusion: HashSet<&'a str>, } impl<'a> SourceFilter<'a> { fn should_include_file(&self, filename: &str) -> bool { !self.exclusion.contains(filename) && self ...
Rust
0
use_latest_restorable_time); } #[allow(unused_mut)] let mut scope_1991 = writer.prefix("DBInstanceClass"); if let Some(var_1992) = &input.db_instance_class { scope_1991.string(var_1992); } #[allow(unused_mut)] let mut scope_1993 = writer.prefix("Port"); if let Some(var_1994) = &i...
Rust
0
:new().unwrap(); let client = Arc::new(test_client::new()); let p = Author { client: client.clone(), pool: Arc::new(Pool::new(Default::default(), ChainApi::new(client))), subscriptions: Subscriptions::new(runtime.executor()), }; let xt = uxt(AccountKeyring::Alice, 1).encode(); let h: H256 = blake2_256(&xt).i...
Rust
0
img_id =file1[0].rsplit('.')[0] print(img_id) full_flow_1 = full_flow.detach().cpu().numpy() if save_npy: full_flow_1 = cv2.resize(full_flow_1, (1080, 1920)) np.save(osp.join(full_flow_dir, img_id + '.npy'), full_flow_1) depth = disps_est[-1][0, 0...
Python
1
let possible_rules = rules .iter() .filter(|(_, ranges)| ranges.iter().any(|range| range.contains(value))) .map(|(rule, _)| *rule) .collect::<HashSet<_>>(); i...
Rust
0
} else { bail!("ill-formed value, missing closing paren") } } else { bail!( "expected symbol in function to array conversion `{}`", input ) } } else { debug_a...
Rust
0
import requests import json def analyze_pdf(pdf_url, question): """Analyze a PDF with a specific question""" url = "https://api.perplexity.ai/chat/completions" headers = {"Authorization": "Bearer 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"} payload = { "messages": [{ ...
Python
1
import streamlit as st def show_data_study(): st.title("Data 학습") st.write("여기에 데이터 학습에 대한 내용을 추가합니다.") st.write("예를 들어, 데이터셋을 로드하고, 전처리 과정을 설명할 수 있습니다.") # 데이터셋 로드 예시 # data = pd.read_csv('path_to_your_data.csv') # st.write(data.head())
Python
1
assert_eq!(git_describe!("--always", "--dirty=-modified"), name); assert_eq!(git_version!(), name); } <reponame>Aswasa/owo-code //! No documentation right now because I cannot be bothered. I mean, *does* this //! really need any documentation, doesn't the README.md explain the 79 lines of //! code well enough, lol? Al...
Rust
0
#Academia media_peso = 0 media_altura = 0 soma_peso = 0 soma_altura = 0 qtdA = 0 qtdP = 0 #Maiores Características para salvar maior_altura = 0 menor_altura = 0 maior_peso = 0 menor_peso = 0 #Essa parte vai registrar o código do cliente com as maiores caracteristicas cod_maior_altura = "" cod_menor_altura = "" cod_ma...
Python
1
: Option<u32>, pub r#type: String, } #[derive(Debug, Deserialize)] pub struct Albums { pub data: Vec<Album>, } pub struct AlbumService { client: Client, } impl AlbumService { pub fn new(client: &Client) -> Self { Self { client: client.clone(), } } pub async fn get(&self, id: &str) -> Resul...
Rust
0
发送钉钉推送 if self.enable_dingtalk and self.dingtalk_webhook and self.dingtalk_secret: try: self.send_dingtalk_notification(tweet_data) except Exception as e: print(f"钉钉推送失败: {str(e)}") else: print(f"跳过重复推文: {tweet_id} -...
Python
1
import streamlit as st def display_contact_us(): """ Displays a contact form for users to reach out. """ st.header(":mailbox: Get In Touch With Me!") contact_form = """ <form action="https://formsubmit.co/ajblogsprogramming@gmail.com.com" method="POST"> <input type="hidden" name="_cap...
Python
1
een.blit(settings_text, settings_text.get_rect(center=settings_button.center)) pygame.draw.rect(screen, (100,100,100), quit_button) pygame.draw.rect(screen, (255,0,0), quit_button, 2) quit_text = font.render("QUIT", True, (255,255,255)) screen.blit(quit_text, quit_text.get_rect(center=qu...
Python
1
()).map(|(haystack, regex)| { if haystack.is_none() | regex.is_none() { // regex is expensive => short-circuit if null return Result::Ok(false); }; let haystack = haystack.unwrap(); let regex = regex.unwrap(); let regex = if let Some(regex) = map.get(rege...
Rust
0
_group_ext = response['app_group_ext'] if 'app_security_ext' in response: self.app_security_ext = response['app_security_ext'] if 'encrypt_config_ext' in response: self.encrypt_config_ext = response['encrypt_config_ext'] if 'exterface_ext' in response: self.ex...
Python
1
b'magic!', 2) == (None, 4) def test_embedded_fixedlist(): class Foo(PebblePacket): foo = Uint8() class ListOfFoo(PebblePacket): length = Uint8() foos = FixedList(Foo, length=length) class EmbeddedListOfFoo(PebblePacket): length = Uint8() list_of_foo = Embed(ListOf...
Python
1
ovsxbd))] pub unsafe fn _mm256_cvtepi8_epi32(a: i8x16) -> i32x8 { simd_cast::<::v64::i8x8, _>(simd_shuffle8(a, a, [0, 1, 2, 3, 4, 5, 6, 7])) } /// An i8x4 type is pretty useless, but we need it as an intermediate type in /// _mm256_cvtepi8_epi64. #[repr(simd)] #[allow(non_camel_case_types)] struct i8x4(i8, i8, i8,...
Rust
0
Syllable::Te => "b7", } .to_owned() } pub fn from_text(text: &str) -> Self { match text { //Natural "1" => Syllable::Do, "2" => Syllable::Re, "3" => Syllable::Mi, "4" => Syllable::Fa, "5" => Syllable::So...
Rust
0
_activation_mut()?; frame.set_local(index, value); Ok(()) } else { Err(Error::NoCallFrame) } } } impl std::fmt::Debug for Stack { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { writeln!(f, "┌-------------------------┐")?; ...
Rust
0
[inline] #[cfg_attr(test, assert_instr(v128.not))] pub fn v128_not(a: v128) -> v128 { unsafe { transmute(simd_xor(a.as_i64x2(), i64x2(!0, !0))) } } /// Performs a bitwise and of the two input 128-bit vectors, returning the /// resulting vector. #[inline] #[cfg_attr(test, assert_instr(v128.and))] pub fn v128_and(a:...
Rust
0
"*Required features: `\"Win32_Storage_OfflineFiles\"`*"] pub const OFFLINEFILES_SYNC_CONTROL_CR_KEEPREMOTE: u32 = 536870912u32; #[doc = "*Required features: `\"Win32_Storage_OfflineFiles\"`*"] pub const OFFLINEFILES_SYNC_CONTROL_CR_MASK: u32 = 4026531840u32; #[doc = "*Required features: `\"Win32_Storage_OfflineFiles\"`...
Rust
0
roc_macro_attribute] pub fn argio(attr: TokenStream, item: TokenStream) -> TokenStream { let attr = parse_macro_input!(attr as ArgioAttr); let item = parse_macro_input!(item as syn::ItemFn); let vis = item.vis; let name = &item.sig.ident; let ret_type = item.sig.output; let args = &item.sig.inp...
Rust
0
f: DynTraitBound<'borr>, InterfaceFor<T, I, TD_CanDowncast>: ImplType, { check_unerased!( self, self.sabi_check_same_destructor::<InterfaceFor<T, I, TD_CanDowncast>, T>() ); unsafe { let this = ManuallyDrop::new(self...
Rust
0
rams = setup::<Bls12_381, _, _, _>(circuit); let mut rng = thread_rng(); let g: EdwardsPoint<Bn12381Fr> = EdwardsPoint::<Bn12381Fr> { x: Num::<Bn12381Fr>::from_str("8076246640662884909881801758704306714034609987455869804520522091855516602923").unwrap(), y: Num::<Bn12381Fr>::from_str("1326237469...
Rust
0
temporal_hash.len()] .copy_from_slice(&flattened_temporal_hash); let ret = Self { hash: hash_arr, num_frames: spatial_hash.len() as u32, src_path: src_path.as_ref().to_owned(), duration: duration as u32, }; Ok(ret) } pub fn n...
Rust
0
let mut pattern: Matrix = ".#./..#/###".parse()?; for _ in 0..iterations { assert_eq!(pattern.height, pattern.width, "Must be square patterns"); let source_wh = pattern.width; let source_stride = if source_wh % 2 == 0 { 2 } else { 3 }; let steps = source_wh / source_stride; ...
Rust
0
rnix::SyntaxElement; use crate::{ dsl::{SpaceLoc, SpaceValue, SpacingRule}, engine::{BlockPosition, FmtModel, SpaceBlock}, tree_utils::has_newline, }; impl SpacingRule { pub(super) fn apply(&self, element: &SyntaxElement, model: &mut FmtModel) { if !self.pattern.matches(element) { ...
Rust
0
y; for i in 0..triangle_height as i32 { let second_half = i > (t1.y - t0.y) as i32 || (t1.y == t0.y); let segment_height = if second_half {t2.y - t1.y} else {t1.y - t0.y}; let alpha = i as f64 / triangle_height as f64; let beta = if second_half { (i as f64 - (t1.y - t0.y) as f64) /...
Rust
0
arner] # Get a trainer or evaluator. trainer_kwargs = { 'train_learner': train_learner, 'eval_learner': eval_learner, 'is_training': FLAGS.is_training, 'train_dataset_list': train_datasets, 'eval_dataset_list': eval_datasets, 'restrict_classes': restrict_classes,...
Python
1
lt(m,fmo,params,out,manager_class = None): m.process(make_restraints=True) grm = m.get_restraints_manager() manager = mmtbx.ions.identify.create_manager( pdb_hierarchy = m.get_hierarchy(), fmodel = fmo, geometry_restraints_manager = grm.geometry, wavelength = params.input.wavelength, params = ...
Python
1
from django.apps import AppConfig class DashboardConfig(AppConfig): name = 'dashboard'
Python
1
# Copyright (c) Mathias Kaerlev 2012. # This file is part of Anaconda. # Anaconda is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
Python
1
ffchain::timestamp().add(Duration::from_millis(2_000)); // Initiate an external HTTP GET request. // This is using high-level wrappers from `sp_runtime`, for the low-level calls that // you can find in `sp_io`. The API is trying to be similar to `reqwest`, but // since we are running in a custom WASM execut...
Rust
0
# coding: utf-8 """ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 from __future_...
Python
1
: &Fd, path: P, oflags: OFlags, mode: Mode, ) -> io::Result<fs::File> { let dirfd = dirfd.as_raw_fd(); let path = path.as_c_str()?; unsafe { _openat(dirfd, &path, oflags, mode) } } unsafe fn _openat(dirfd: RawFd, path: &CStr, oflags: OFlags, mode: Mode) -> io::Result<fs::File> { #[allow(cli...
Rust
0
#!/usr/bin/env python3 from typing import List class Solution: def longestCommonPrefix(self, arr1: List[int], arr2: List[int]) -> int: pass """ category: combinatorics subcategory: counting difficulty: medium image_path_e1: none image_path_e2: none image_path_e3: none title: Find the Length of the Longes...
Python
1
import re from translate import translate def test_translate_examples_in_readme(): # 1984年的四川省涪陵地区南川县 # 对应于2018年的重庆市南川区 assert translate("512323", 1984, 2018) == ["500119"] # 2000年的湖南省衡阳市城北区 # 对应于2018年的湖南省衡阳市石鼓区、蒸湘区 assert translate("430404", 2000, 2018) == ["430407", "430408"] # 2010年的...
Python
1
# SPDX-FileCopyrightText: 2020 Dan Halbert for Adafruit Industries # # SPDX-License-Identifier: MIT """ `adafruit_ble_adafruit.light_sensor_service` ================================================================================ BLE access to light sensor data. * Author(s): Dan Halbert """ __version__ = "1.2.3" __...
Python
1
d_date="2024-06-30", max_cloud_cover=30.0 ) results = searcher.search(params) assert len(results) == 1 assert results[0]['properties']['identifier'] == "S2A_MSIL1C_20240601" @patch('requests.Session.post') def test_search_by_geometry(self, mock_...
Python
1
import operator operator_dict = { "=": operator.eq, ">": operator.gt, "<": operator.lt, ">=": operator.ge, "<=": operator.le } def select_aux(db, operand1, operator, operand2): result = {} for col in db: result[col] = [] if operand2 in db: for i in range(len(db[operan...
Python
1
i$v=19$m=65536,t=3,p=1$cHBwcHBwcHBwcHBwcHBwcA$MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA"; let invalid0 = "$argon2i$v=019$m=65536,t=3,p=1$cHBwcHBwcHBwcHBwcHBwcA$MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA"; let invalid1 = "$argon2i$v=19$m=065536,t=3,p=1$cHBwcHBwcHBwcHBwcHBwcA$MDAwMDAwMDAwMDAwMD...
Rust
0
assert_eq!(&sg1, &sg2); } #[test] fn seating_grid_clone_and_ne() { let sg1 = SeatingGrid::from_str(&TEST_INPUT_0); let mut sg2 = sg1.clone(); sg2.seats[2][2] = Cell::Seat(SeatState::Occupied); assert_ne!(&sg1, &sg2); } #[test] fn occupied_visibility_0() { ...
Rust
0
from uuid import uuid4 from django.core.cache import cache from django.db import models from care.utils.registries.feature_flag import FlagName, FlagRegistry class BaseManager(models.Manager): def get_queryset(self): qs = super().get_queryset() return qs.filter(deleted=False) class BaseModel(m...
Python
1
import streamlit as st import pandas as pd import os st.set_page_config(page_title="PrivAIlegiance – Admin Logs", page_icon="🗂️") st.title("📊 PrivAIlegiance – Consent Log Viewer") # Check if logs.csv exists log_file = "logs.csv" if os.path.exists(log_file): df = pd.read_csv(log_file, names=["Timestamp", "Name ...
Python
1
_Popref_pop1 = 11, StackBehaviour_Popref_popi = 12, StackBehaviour_Popref_popi_popi = 13, StackBehaviour_Popref_popi_popi8 = 14, StackBehaviour_Popref_popi_popr4 = 15, StackBehaviour_Popref_popi_popr8 = 16, StackBehaviour_Popref_popi_popref = 17, StackBehaviour_Push0 = 18, StackBehaviour...
Rust
0
efractory = refractory[-1] else: max_refractory = None # Initialize GPU if use_gpu: set_gpu_device(0) simulator = Simulator(model, reset, threshold, inputs, input_var = input_var, dt = dt, ...
Python
1
import os import sys import json from word_tokens_tools import split_into_words, scan_next, split_into_sentences, save_text from openai import OpenAI API_KEY = os.getenv("OPENAI_API_KEY") # Get API key from environment variable if not API_KEY: raise ValueError("API_KEY is not set") client = OpenAI(api_key=API_KE...
Python
1
.5, 0.5); } } fn main() { let filename = "outputs/basic_sphere.png".to_string(); let nx: u64 = 400; let ny: u64 = 200; let ns: u64 = 200; let cam: Camera = Camera::new(Vec3::new(0.0, 1.0, 5.0), Vec3::new(0.0, 0.0, -1.0), Vec3::new(0.0, 1.0, 0.0), 50.0, (nx as f64)/(ny as f64)...
Rust
0
) return scipy.ndimage.affine_transform(image, m, o, shape) def findTranslation(image1, image2): pc = phaseCorrelate(image1, image2) return findPeak(pc) if __name__ == '__main__': from pyami import mrc import sys import time window = numextension.hanning(1024, 1024, a=0.54) highpass = numextension.highpass(...
Python
1
# RUN: %PYTHON %s | FileCheck %s from buddy_mlir.dialects import dap, func from buddy_mlir import ir from buddy_mlir.passmanager import PassManager def run(f): print("\nTEST:", f.__name__) f() return f def dapIir(dtype, context: ir.Context) -> ir.Module: with context, ir.Location.unknown(): ...
Python
1
dp", "passkey", "disabled"]), ipausersearchfields=dict(type='list', elements='str', aliases=['usersearchfields']), ipauserobjectclasses=dict(type='list', elements='str', aliases=['userobjectclasses']), ) module = AnsibleModule( ...
Python
1