text
string
label_name
string
labels
int64
from freshen import * from nose.tools import * def flunker(): raise Exception("FAIL") @Given("^passing$") def passing(table): pass @Given("^failing$") def failing(string): flunker() @Given("^passing without a table$") def pass_without_table(): pass @Given("^failing without a table$") def fail_with...
Python
1
ger.warning("More than one harmful word/phrase found in prompt: %s", prompt) for word in self._blacklisted_words: if word in prompt: harmful_word = word break # If not blacklisted words found, try to find [masked words] if...
Python
1
# Copyright Materialize, Inc. and contributors. All rights reserved. # # Use of this software is governed by the Business Source License # included in the LICENSE file at the root of this repository. # # As of the Change Date specified in that file, in accordance with # the Business Source License, use of this software...
Python
1
/tools/mod.rs pub mod crop; pub mod ellipse; pub mod eyedropper; pub mod fill; pub mod freehand; pub mod line; pub mod navigate; pub mod path; pub mod pen; pub mod rectangle; pub mod select; pub mod shape; pub mod shared; pub mod spline; pub mod text; // A HTTP query server based on CCHs. #![feature(proc_macro_hygiene...
Rust
0
ount': t['amount'], 'type': t['type'], 'description': t['description'] } for t in analyzer.transactions]) df['date'] = pd.to_datetime(df['date'], errors='coerce') # Daily spending chart daily_spending = df[df['type'] == 'DEBIT'].groupby('date')['amount'].sum().reset_index() fig_dail...
Python
1
local_aggregation_type=self.model_cfg.LOCAL_AGGREGATION_TYPE, num_reduced_channels=self.model_cfg.get('NUM_REDUCED_CHANNELS', None), num_channels_of_local_aggregation=self.model_cfg.NUM_CHANNELS_OF_LOCAL_AGGREGATION, neighbor_distance_multiplier=2.0 ...
Python
1
<u32 as IntoDeserializer<Error>>::into_deserializer(index); let value = seed.deserialize(deserializer)?; Ok((value, self)) } } impl<'de, 'a> VariantAccess<'de> for &'a mut Deserializer<'de> { type Error = Error; #[inline] fn unit_variant(self) -> Result<()> { Ok(()) } ...
Rust
0
# Quando usado parenteses é uma tupla, serve para listas que não podem ser alteradas. time = ("Ronaldo", "Romario", "Neymar", "Pelé", "Ronaldinho") print (time) #time.append("Coutinho") # Adicionando itens a um set x = set() x.add(19) x.add(18) x.add(10) x.add(10) print(x) #Bolean | Os valores boleanos podem ser a...
Python
1
page: usize = 1; loop { let data = client.get(&next_url).send().await?.text().await?; let data: Value = serde_json::from_str(&data).unwrap(); let data = data.as_object().unwrap(); let packages = data.get("packages").unwrap().as_array().unwrap(); fo...
Rust
0
_base_ = ['co_dino_5scale_r50_8xb2_1x_coco.py'] pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_large_patch4_window12_384_22k.pth' # noqa # model settings model = dict( backbone=dict( _delete_=True, type='SwinTransformer', pretrain_img_size=384, ...
Python
1
# there are different escape sequence ,they are # \n = new line # \"" or \'' = to use double quote or single quote in a string # \\ = if you want to use back slash a= "hi dhanish is a good boy \n" \ " and he is a bad boy too" print(a) a= "hi dhanish is a good \"boy\" " print(a) a= "hi dhanish is a good 'boy'" prin...
Python
1
aging-induced error is uniform across temperature"] pub const rs2_dsm_correction_model_RS2_DSM_CORRECTION_AOT: rs2_dsm_correction_model = 1; #[doc = "< Thermal-over-aging; aging-induced error changes alongside temperature"] pub const rs2_dsm_correction_model_RS2_DSM_CORRECTION_TOA: rs2_dsm_correction_model = 2; pub con...
Rust
0
from .base import BaseAWQForCausalLM from transformers.models.opt.modeling_opt import OPTForCausalLM, OPTDecoderLayer class OptAWQForCausalLM(BaseAWQForCausalLM): layer_type = "OPTDecoderLayer" max_new_tokens_key = "max_position_embeddings" @staticmethod def get_model_layers(model: OPTForCausalLM): ...
Python
1
# Copyright 2025 SqueezeBits, Inc. # # 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 wri...
Python
1
0b0_0000), R1: CoreRegisterAddress(0b0_0001), R2: CoreRegisterAddress(0b0_0010), R3: CoreRegisterAddress(0b0_0011), R4: CoreRegisterAddress(0b0_0100), R5: CoreRegisterAddress(0b0_0101), R6: CoreRegisterAddress(0b0_0110), R7: CoreRegisterAddress(0b0_0111), R8: CoreRegisterAddress(0b0_1000...
Rust
0
#!/usr/bin/env python # -*- coding:utf-8 -*- """ @Description: 人脸识别存储 @Author: Kermit @Date: 2024-02-19 17:10:54 """ from typing import Callable import numpy as np from store.store import Store class FaceRecognitionStore: """人脸识别存储""" def __init__( self, store_creater: Callable[[bool, int]...
Python
1
lf._input.process_frame(EndFrame(), FrameDirection.DOWNSTREAM) if self._output: await self._output.process_frame(EndFrame(), FrameDirection.DOWNSTREAM) async def _on_audio_track_subscribed(self, participant_id: str): await self._call_event_handler("on_audio_track_subscribed", participan...
Python
1
Field::Name => { if name.is_some() { return Err(de::Error::duplicate_field("name")); } name = Some(map.next_value()?); } } } ...
Rust
0
Process().open_files()), "memory_info": psutil.Process().memory_info()._asdict() } return HealthCheckResult( status=status, message=message, details=details, timestamp=time.time(), check_duration_ms=...
Python
1
it group with reference counted context. | [`CBox<T>`](crate::boxed::CBox) | [`CArc<Ctx>`](crate::arc::CArc) | //! | `MyGroupBaseMut<T>` | Base by-mut-ref CGlue trait group. | `&mut T`. | [`NoContext`](crate::trait_group::NoContext) | //! | `MyGroupBaseCtxMut<T, Ctx>` | Base by-mut-ref CGlue trait group with a context....
Rust
0
.DEF_PERFORMANCE_HISTORY_ON_RESCHEDULE, help='default history(in sec) to be collected on a job ' 'reschedule'), cfg.IntOpt('performance_timestamp_overlap', default=constants.TelemetryCollection .DEF_PERFORMANCE_TIMESTAMP_OVERLAP, ...
Python
1
import pytest from ape.utils.misc import LOCAL_NETWORK_NAME from tests.conftest import geth_process_test @pytest.fixture def mock_geth_sepolia(ethereum, geth_provider, geth_contract): """ Temporarily tricks Ape into thinking the local network is Sepolia so we can test features that require a live net...
Python
1
utex(); // sync::test::philosopher_using_monitor(); // sync::mpsc::test::test_all(); } /// Global heap allocator /// /// Available after `memory::init()`. /// /// It should be defined in memory mod, but in Rust `global_allocator` must be in root mod. #[global_allocator] static HEAP_ALLOCATOR: LockedHeap = Locked...
Rust
0
mlist/jsons/undefiable_list_separated", true)?; // We call "adjust_versions" manually here. // "load_dochy_file"/"load_history_file" automatically adjusts versions, so calling this manually isn't necessary. let r = adjust_versions(new, old, true)?; let mut r = RootIntf::new(r); //"list" is undefin...
Rust
0
('\u{0261}') /* IPA's /g/ */ => if strict { panic!("'\u{0261}' looks like 'g', but it is not.") } else { low!(G) }, Some(a @ ('\u{0251}' /* IPA's /ɑ/ */ | 'α')) => if strict { panic!("'{}' looks like 'a', but it is not.", a) } else { low!(A) }, Some('ο') => if strict { panic!("'ο' looks like 'o', but it...
Rust
0
fonts }); } fn check_state( mut commands: Commands, mut state: ResMut<State<GameState>>, asset_server: Res<AssetServer>, loading_state: Res<LoadingState>, ) { if LoadState::Loaded != asset_server.get_group_load_state(loading_state.fonts.iter().map(|handle| handle.id)) { return;...
Rust
0
some() { let cmd = self.parse_pipe(); cmds.extend(quote!(.pipe(#cmd))); if !matches!(self.iter.peek(), Some(ParseArg::Pipe)) { self.iter.next(); break; } self.iter.next(); } cmds } fn parse_pipe(&mut sel...
Rust
0
B, N, C, H, W = images.shape elif len(images.shape) == 4 and mode =='multi_view': N, C, H, W = images.shape B = 1 images, cameras = images[None], cameras[None] elif len(images.shape) == 4 and mode =='single_view': B, C, H, W = images.shape ...
Python
1
es: `\"Win32_Media_Multimedia\"`*"] pub const MCI_DGV_SETVIDEO_SRC_PAL: i32 = 16387i32; #[doc = "*Required features: `\"Win32_Media_Multimedia\"`*"] pub const MCI_DGV_SETVIDEO_SRC_PAL_S: i32 = 32787i32; #[doc = "*Required features: `\"Win32_Media_Multimedia\"`*"] pub const MCI_DGV_SETVIDEO_SRC_RGB: i32 = 16385i32; #[do...
Rust
0
assert_eq!(leasingmanager.is_enabled(), false); leasingmanager.enable(); assert_eq!(leasingmanager.is_enabled(), true); } #[ink::test] fn disable_works() { let mut leasingmanager = LeasingManager::new(instantiate_erc20_contract(), true); ...
Rust
0
aracter, remove that character and return the resulting string. fn find_prototype_fabric_id(string1: &str, string2: &str) -> Option<String> { let mut index_of_diff = 0; let mut got_diff = false; let mut got_too_many_diffs = false; let zipped_iterator = string1.chars().zip(string2.chars()); for (i, ...
Rust
0
= ""] #[doc = " \\param xyz_image"] #[doc = " Handle to output xyz image."] #[doc = ""] #[doc = " \\remarks"] #[doc = " \\p depth_image must be of format ::K4A_IMAGE_FORMAT_DEPTH16."] #[doc = ""] #[doc = " \\remarks"] #[doc = " The \\p camera parameter tells the function what the perspe...
Rust
0
metryFilter() XZGeom.SetInputData(XZGrid) XZGeom.SetExtent(0,2,0,2,0,2) XZMapper = vtkPolyDataMapper() XZMapper.SetInputConnection(XZGeom.GetOutputPort()) XZActor = vtkActor() XZActor.SetMapper(XZMapper) XZActor.SetPosition(4,2,0) ren1.AddActor(XZActor) # 3D XYZPts = vtkPoints() XYZPts.SetNumberOfPoints(8) XYZPts.SetPo...
Python
1
essageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.Yes ) if reply == QtWidgets.QMessageBox.Yes: process = subprocess.Popen(args=[sys.executable, '-m', 'tools.config_editor'], close_fds=False, ...
Python
1
fn trans_exchange_free_ty<'a, 'tcx>(bcx: &Builder<'a, 'tcx>, ptr: LvalueRef<'tcx>) { let content_ty = ptr.ty.to_ty(bcx.tcx()); let def_id = langcall(bcx.tcx(), None, "", BoxFreeFnLangItem); let substs = bcx.tcx().mk_substs(iter::once(Kind::from(content_ty))); let callee = Callee::def(bcx.ccx, def_id, s...
Rust
0
= load_answersfile_data(dst) assert "computed" not in answers def test_conditional_computed_value(tmp_path_factory: pytest.TempPathFactory) -> None: src, dst = map(tmp_path_factory.mktemp, ("src", "dst")) build_file_tree( { src / "copier.yml": ( """\ f...
Python
1
} _ => {} } if app_control.should_terminate_process() { *control_flow = winit::event_loop::ControlFlow::Exit } }); } } <gh_stars>0 use std::fmt; // Import `fmt` // aruments are in the reverse() // returns are after the -> fn reverse(pair...
Rust
0
); //t0.norm();//24 t0.sub(&t2); t0.norm();//25 t0.mul(&z3);//26 y3.add(&t0); //y3.norm();//27 t0.copy(&self.y); t0.mul(&self.z);//28 t0.dbl(); t0.norm(); //29 z3.mul(&t0);//30 x3.sub(&z3); //x3.norm();//31 t0.dbl(); t0.norm();//32 t1.dbl(); t1.norm();//33 z3.copy(&t0); z3.mul(&...
Rust
0
32_Security_Authentication_Identity\"`*"] pub const NameCanonical: EXTENDED_NAME_FORMAT = 7i32; #[doc = "*Required features: `\"Win32_Security_Authentication_Identity\"`*"] pub const NameUserPrincipal: EXTENDED_NAME_FORMAT = 8i32; #[doc = "*Required features: `\"Win32_Security_Authentication_Identity\"`*"] pub const Na...
Rust
0
case)] pub fn IEEE_lt(input: [SecretI64; 2]) -> SecretI64 { let ans = unsafe { execute_garbled_circuit!(FP_LT(input) -> SecretI64) }; ans } #[inline(always)] #[allow(non_snake_case)] pub fn IEEE_floor(input: SecretI64) -> SecretI64 { let ans = unsafe { execute_garbled_circuit!(FP_FLOOR(input) -> SecretI64)...
Rust
0
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys f = open(sys.argv[2], 'w+') f.write(sys.argv[1]) f.close()
Python
1
None => {}, Some(node) => { add_entries_to_cheapest_to_target_node!(node, target, 0); }, } for hop in last_hops.iter() { if first_hops.is_none() || hop.src_node_id != network.our_node_id { // first_hop overrules last_hops if network.nodes.get(&hop.src_node_id).is_some() { if first_hops.is_som...
Rust
0
nt", "contact_email": "COF@communities.gov.uk", "instructions_json": { "en": "You must have received an invitation to apply. If we did not invite you, first <a href='https://www.gov.uk/guidance/community-ownership-fund-round-4-how-to-express-your-interest-in-applying'>express your interest i...
Python
1
uf); PluginWrapper::<P>::handle(plugin, |p| { P::MainThread::value_to_text(p.main_thread().as_ref(), param_id, value, &mut writer) .map_err(PluginWrapperError::with_severity(CLAP_LOG_ERROR as i32)) }) .is_some() && writer.finish() } unsafe extern "C" fn text_to_value<'a, P: Plug...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2015 Tecnativa - Jairo Llopis # Copyright 2016 Tecnativa - Vicent Cubells # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Require accepting legal terms to checkout", "summary": "Force the user to accept legal tems to buy in the web shop", "...
Python
1
x = cx.argument::<JsNumber>(0)?.value() as usize; { let this = cx.this(); let guard = cx.lock(); let ref_ = &(*this.borrow(&guard)).index; let mut send_index = ref_.lock().unwrap(); send_index.replace(index); } ...
Rust
0
import _plotly_utils.basevalidators class LineValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="line", parent_name="layout.newselection", **kwargs): super(LineValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
Python
1
#!/usr/bin/python """ (gdb) disassemble vulnerable Dump of assembler code for function vulnerable: 0x0000000010000794 <+0>: mflr r0 ... 0x00000000100007f4 <+96>: ld r0,16(r1) 0x00000000100007f8 <+100>: mtlr r0 0x00000000100007fc <+104>: ld r31,-8(r1) 0x0000000010000800 <+108>: blr 0x...
Python
1
# ***************************************************************************** # Copyright (c) 2019-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 o...
Python
1
return Response({"success": f"You have unfollowed {username}."}, status=status.HTTP_200_OK) except CustomUser.DoesNotExist: return Response({"error": "User not found."}, status=status.HTTP_404_NOT_FOUND) return Response({"error": "Username is required."}, status=status.HTTP_400_...
Python
1
with warnings.catch_warnings(): warnings.simplefilter("ignore") p1.train(str(record.seq[:20000])) # pickle/unpickle the TrainingInfo ti = pickle.loads(pickle.dumps(p1.training_info)) p2 = GeneFinder(meta=False, training_info=ti, min_gene=60) # make sure the same ...
Python
1
} }) .collect(); let checks: TokenStream2 = choices .iter() .zip(weights_opt.iter()) .enumerate() .filter(|(_, (_, weight))| weight.is_some()) .map(|(i, (choice, _))| { let body = body_fn(choice, i)?; Ok(quote! { if roll < ...
Rust
0
} } } impl StaticType for RelayType { fn static_type() -> Type { unsafe { from_glib(ffi::nice_relay_type_get_type()) } } } impl<'a> FromValueOptional<'a> for RelayType { unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> { Some(FromValue::from_value(value)) ...
Rust
0
0..KYBER_K { aes256ctr_squeezeblocks(&mut buf.coeffs, NOISE_NBLOCKS, &mut state); state.n = _mm_loadl_epi64([nonce, 0].as_ptr() as *const __m128i); nonce += 1; poly_cbd_eta1_90s(&mut sp.vec[i], &buf); } for i in 0..KYBER_K { aes256ctr_squeezeblocks(&mut buf.coeffs, C...
Rust
0
jump Instr("JUMP_FORWARD", label2), label, Instr("LOAD_CONST", 1), Instr("STORE_NAME", "x"), Instr("LOAD_NAME", "test"), Instr("POP_JUMP_IF_TRUE", label3), label2, Instr("JUMP_FORWARD", label...
Python
1
if itemType(item) in [1,2]: outputStack.push(float(item)) #if operator elif itemType(item) == 0: while operatorStack.__len__() > 0 and operatorStack.peek() != "(" and popFromOperatorStack(item,operatorStack.peek()): outputStack.push(operatorStack.pop()) ...
Python
1
h_stars>1-10 use crate::Garbler; /// Trait for values that can be garbled pub trait Garble: Sized { /// Output type after a garbling /// /// In most cases, this will be the same as the input type. type Output; /// Garble the data with the given garbler fn garble<G>(self, garbler: &mut G) -> Se...
Rust
0
Self(point.compress().to_bytes()) } } impl TryFrom<&PodRistrettoPoint> for RistrettoPoint { type Error = Curve25519Error; fn try_from(pod: &PodRistrettoPoint) -> Result<Self, Self::Error> { CompressedRistretto::from_slice(&pod.0) .decompress() ...
Rust
0
1829680439\"},\"messageId\":1638,\"publishDate\":\"2024-09-29T06:53:10Z\",\"message\":\"সিএসকে এমএস ধোনিকে ৪ কোটি টাকায় আনক্যাপড খেলোয়াড় হিসেবে ধরে রাখতে পারবে, কারণ আইপিএলের একটি পুনর্জীবিত নিয়ম ভারতীয় খেলোয়াড়দের, যারা পাঁচ বছর ধরে আন্তর্জাতিক ক্রিকেট থেকে অবসর নিয়েছে, আনক্যাপড হিসেবে শ্রেণীবদ্ধ করার অনুমতি দে...
Python
1
al(self, pos, max_pos), TerminalSymbol::Metasymbol(metasymbol) => match metasymbol { Metasymbol::Empty => self.to_epsilon_ast(pos), Metasymbol::Failure => self.to_failed_ast(pos), Metasymbol::Any(n) => self.to_any_ast(pos, max_pos, *n), Metasym...
Rust
0
ER_CORE_CONTROLLER_DOWNGRADE: u32 = 5000; /// Ticks per body part that invader cores of each level take to spawn defensive /// creeps. #[inline] pub fn invader_core_creep_spawn_time(core_level: u32) -> Option<u32> { match core_level { 1 => Some(0), 2 => Some(6), 3 => Some(3), 4 => S...
Rust
0
// * Is a memory leak possible in safe code? // * Yes: If the user uses something like `Box::leak()`, `ManuallyDrop`, or // `core::mem::forget`, the destructor will not be called even though the struct // is dropped. However, it is documented tha...
Rust
0
;color: #008B8B;">Sizler için Derlediklerimiz</h3>**', unsafe_allow_html=True) random_home = df[~df["price"].isna()].sample(5) for i, col in enumerate(columns): with col: col.markdown(f""" <div style="border: 1px solid #dee2e6; border-radius: 0.25rem; margin-bottom: 1rem; pa...
Python
1
SLUlg)N sslcontextr]rget_extra_infor)rcr3r"s r'_replace_transport'StreamReaderProtocol._replace_transport'zz#"11,?tKr+c~^^TR(aPSS0nTR(aTRUS...
Python
1
Gaussian kernel pub fn generate_gaussian_kernel(size: u32, sigma: f32) -> ImgProcResult<Vec<f32>> { error::check_odd(size, "size")?; let mut filter = vec![0.0; (size * size) as usize]; let k = ((size - 1) / 2) as i32; for i in 0..(size as i32) { for j in 0..(size as i32) { if i <=...
Rust
0
} extern "C" { #[doc = " This method gets an in-use address filter entry."] #[doc = ""] #[doc = " This function is available when OPENTHREAD_CONFIG_MAC_FILTER_ENABLE configuration is enabled."] #[doc = ""] #[doc = " @param[in] aInstance A pointer to an OpenThread instance."] #[doc = " @para...
Rust
0
#[inline(always)] pub fn _0(self) -> &'a mut W { self.variant(SSACKERR_A::_0) } #[doc = "Reset caused by peripheral failure to acknowledge attempt to enter stop mode"] #[inline(always)] pub fn _1(self) -> &'a mut W { self.variant(SSACKERR_A::_1) } #[doc = r"Sets the fiel...
Rust
0
_id0 int_seq1_expected += int_sequence_id1 string_seq0_expected += int(string_sequence_id0) print( "[" + str(i) + "] " + str(int_result0_list[i][0][0]) + " : " + str(int_result1_list[i][0][0]) + " : " ...
Python
1
from typing import List from langchain_core.output_parsers.transform import BaseTransformOutputParser class StrOutputParser(BaseTransformOutputParser[str]): """OutputParser that parses LLMResult into the top likely string.""" @classmethod def is_lc_serializable(cls) -> bool: """Return whether th...
Python
1
.min() .unwrap() } fn part2(data: &[isize]) -> usize { let (min, max) = data .iter() .minmax() .into_option() .unwrap(); (*min..=*max) .map(|n| data.iter().map(|d| -> usize {(1..=d.abs_diff(n)).sum()}).sum()) .min() .unwrap() } fn main() -> io::R...
Rust
0
import os # Модуль для работы с операционной системой, в частности, для получения переменных окружения import asyncio # Модуль для работы с асинхронными операциями import logging # Модуль для ведения логов (отслеживание и запись работы программы) from aiogram import Bot, Dispatcher # Импорт классов для создания бо...
Python
1
ParamFlags = 16; pub const G_PARAM_STATIC_NAME: GParamFlags = 32; pub const G_PARAM_PRIVATE: GParamFlags = 32; pub const G_PARAM_STATIC_NICK: GParamFlags = 64; pub const G_PARAM_STATIC_BLURB: GParamFlags = 128; pub const G_PARAM_EXPLICIT_NOTIFY: GParamFlags = 1073741824; pub const G_PARAM_DEPRECATED: GParamFlags = 2147...
Rust
0
ays > 1: if days > 6: date = now + datetime.timedelta( days=-days, hours=-hours, minutes=-minutes ) afk_since = date.strftime("%A, %Y %B %m, %H:%I") else: wday = now + datetime.timedel...
Python
1
, E>(output: &Path, version: (u8, u8), fallbacks: Fallbacks, extensions: E) -> io::Result<()> where E: AsRef<[&'a str]>, { let mut output = File::create(output)?; Registry::new(Api::Gles2, version, Profile::Core, fallbacks, extensions) .write_bindings(gl_generator::GlobalGenerator, &mut output) } <r...
Rust
0
''' iOS Gyroscope --------------------- ''' from plyer.facades import Gyroscope from pyobjus import autoclass from pyobjus.dylib_manager import load_framework load_framework('/System/Library/Frameworks/UIKit.framework') UIDevice = autoclass('UIDevice') device = UIDevice.currentDevice() class IosGyroscope(Gyroscop...
Python
1
u8 != 0); // The NOMCK bit of the SAI_xCR1 register is used to define whether the master clock is // generated or not. // Inversed polarity on non-H7 based on how we have `MasterClock` enabled. #[cfg(not(any(feature = "h7", feature = "l4", feature = "l5")))] ...
Rust
0
'795':'Turkmenistan',\ '796':'Turks and Caicos Islands',\ '798':'Tuvalu',\ '800':'Uganda',\ '804':'Ukraine',\ '784':'United Arab Emirates',\ '826':'United Kingdom',\ '840':'United States',\ '581':'United States Minor Outlying Islands',\ '858...
Python
1
from time import sleep, time from WS_UMB import WS_UMB def query_one_channel(umb, channel, receiver_id=1): '''query one channel''' value, status = umb.onlineDataQuery(channel, receiver_id=receiver_id) if status != 0: print(umb.checkStatus(status)) else: print(value) def query_multip...
Python
1
axpy_f16(self, x): self.inf_body += f"""\ saxpy_f16({x.m}, {x.n}, {x.A}, // {self.weights[x.A].shape} {x.x_in}, // {self.tmpinout[x.x_in].shape} {x.y}, // {self.weights[x.y].shape} {x.x_out} // {self.tmpinout[x.x_out].shape} ); """ def visit_softmax(self, x): ...
Python
1
self.model.eval() with torch.no_grad(): return self.test_iteration(data_loader, print_freq) def update_ema_predictions(self): """update every epoch""" self.ema_pslab = (self.ema_decay*self.ema_pslab) + (1.0-self.ema_decay)*self.epoch_pslab self.epoch_pslab = self....
Python
1
_length(&self) -> usize { self.0.serialized_length() } } impl FromBytes for EntryPoints { fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), bytesrepr::Error> { let (entry_points_map, rem) = EntryPointsMap::from_bytes(bytes)?; Ok((EntryPoints(entry_points_map), rem)) } } impl Ent...
Rust
0
.map(|inner| { let weak = load(inner.counter.lock.as_mut(), &inner.counter.weak); let strong = load(inner.counter.lock.as_mut(), &inner.counter.strong); if strong == 0 { 0 } else { // Since we observed that there was...
Rust
0
#!/usr/bin/env python3 # Copyright (c) 2024 Red Hat, Inc. # # 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...
Python
1
import numpy as np import cv2 import prespective as tm # Create a black image image = np.zeros((600, 600, 3), dtype=np.uint8) # Define the coordinates of the trapezoid's vertices # vertices = np.array([[100, 100], [300,70], [350, 300], [50, 400]], dtype=np.int32) vertices = np.array([[138 , 93], [522, 118], [542, 39...
Python
1
#imprimir os numeros oares e impares entre 100 e 125 numero_par = 102 numero_inpar = 101 print ("numero_par") while numero_par < 125: print (numero_par) numero_par += 2 print ("numero_inpar") while numero_inpar <125: print (numero_inpar) numero_inpar += 2
Python
1
import symforce.symbolic as sf def _rn_delta_factor(x, y, sqrt_info, epsilon: sf.Scalar) -> sf.Matrix: return sqrt_info * (y - x) def _lie_delta_factor(x, y, sqrt_info, epsilon: sf.Scalar) -> sf.Matrix: return sqrt_info * sf.Matrix(x.local_coordinates(y, epsilon)) def r1_delta_factor(x: sf.V1, y: sf.V1, s...
Python
1
def ending(ww): a = "" completion = client.chat.completions.create( model="gpt-4-turbo-2024-04-09", messages=[ {"role": "system", "content": f""" 对话记录、满意程度以及双方关系变化如下:{ww} 直到满意程度超过49,游戏通关,满意程度低于或等于0则谈话失败。 如果通关,根据上面的对话总结出谈话成功的经验,如果失败,根据上面的对话总结出谈话失败的教...
Python
1
16, 'o' as u16, 0]); /// ``` /// /// From iterator of references: /// #[cfg_attr(feature="std", doc=" ```")] #[cfg_attr(not(feature="std"), doc=" ```no_compile")] /// use encode_unicode::{IterExt, CharExt, Utf16Char}; /// /// // (💣 takes two units) /// let chars: Vec<Utf16Char> = "💣 bomb 💣".chars().map(|c| c.to_utf1...
Rust
0
("C7", 2093.00), ("CSHARP7_Db7", 2217.46), ("D7", 2349.32), ("DSHARP7_Eb7", 2489.02), ("E7", 2637.02), ("F7", 2793.83), ("FSHARP7_Gb7", 2959.96), ("G7", 3135.96), ("GSHARP7_Ab7", 3322.44), ("A7", 3520.00), ("ASHARP7_Bb7", 3729.31), ...
Rust
0
:time::Duration; use strace_parse::errors::*; use strace_parse::raw::Call; // % time seconds usecs/call calls errors syscall // ------ ----------- ----------- --------- --------- ---------------- // 0.00 0.000000 0 8 read // ... // 0.00 0.000000 0 1 ...
Rust
0
from easydict import EasyDict pendulum_pg_config = dict( exp_name='pendulum_pg_seed0', env=dict( collector_env_num=8, evaluator_env_num=5, act_scale=True, n_evaluator_episode=5, stop_value=-200, ), policy=dict( cuda=False, action_space='continuous...
Python
1
nfxk-zktwx-vetllbybxw-ktuubm-hixktmbhgl-501[bkltx] tinnm-qobrm-qcohwbu-zcuwghwqg-584[ejnps] rmn-qcapcr-kyelcrga-cee-bcqgel-730[cerag] apwmeclga-djmucp-ylyjwqgq-756[acgjl] pybgmyargtc-amlqskcp-epybc-zsllw-pcacgtgle-392[cglpa] jxdkbqfz-avb-tlohpelm-783[blade] npmhcargjc-bwc-pcqcypaf-808[phjds] rdchjbtg-vgpst-qphzti-itrwc...
Rust
0
Getters Tests for IOSDriver. Get operations: get_lldp_neighbors get_facts get_interfaces get_bgp_neighbors get_interfaces_counters """ @classmethod def setUpClass(cls): """Executed when the class is instantiated.""" cls.mock = True username = "vagrant" ...
Python
1
input_mask = 1 - s_sk input = t_f * input_mask input_mask = torch.cat((input_mask, input_mask, input_mask), 1) output = input_mask * input + (1 - input_mask) * torch.normal(float(torch.mean(input)),float(torch.std(input)),size=input.size()).cuda() o_b = output o...
Python
1
ansaction_broadcast_monitoring_timeout = Duration::from_secs( cfg.get_int(&key) .map_err(|e| ConfigurationError::new(&key, &e.to_string()))? as u64, ); let key = "wallet.transaction_chain_monitoring_timeout"; let transaction_chain_monitoring_timeout = Duration::from_secs( cfg.ge...
Rust
0
vDesc); } extern "C" { pub fn GEplayDisplayList(dd: pGEDevDesc); } extern "C" { pub fn GEcopyDisplayList(fromDevice: ::std::os::raw::c_int); } extern "C" { pub fn GEcreateSnapshot(dd: pGEDevDesc) -> SEXP; } extern "C" { pub fn GEplaySnapshot(snapshot: SEXP, dd: pGEDevDesc); } extern "C" { pub fn GEo...
Rust
0
output = output[int(iterations) - 1:-int(iterations)] if notch_filter: output = filter_signal(output, 0.05, sample_rate, filtertype='notch') return output def generate_ecg_templates(sample_rate, widths=[50, 60, 70, 80, 100], presets=[[0, 2, 2.5, 3, 3.5, 5], ...
Python
1
tlsTransport> { if !certificates.is_empty() { let now = SystemTime::now(); for cert in &certificates { if cert.expires().duration_since(now).is_err() { return Err(Error::ErrCertificateExpired.into()); } } } else { ...
Rust
0
fn cycle_duration(&self) -> usize { self.fly_duration + self.rest_duration } } #[cfg(test)] mod tests { use super::*; use line_reader::read_str_to_lines; const EXAMPLE: &str = "\ Comet can fly 14 km/s for 10 seconds, but then must rest for 127 seconds. Dancer can fly 16 km/s for 11 seconds, bu...
Rust
0
import torch import nestedtensor import utils import random # Performance tanks hard for lots of small Tensors as expected RAND_INTS = [random.randint(10, 30) for _ in range(2000)] def gen_nt_unbind(): nested_tensor = nestedtensor.nested_tensor( [torch.rand(i, 2560) for i in RAND_INTS]) def nt(): ...
Python
1