text
string
label_name
string
labels
int64
_HS device IN endpoint transmit FIFO status register"] pub otg_hs_dtxfsts5: OTG_HS_DTXFSTS5, _reserved44: [u8; 4usize], #[doc = "0x1c0 - OTG device endpoint-6 control register"] pub otg_hs_diepctl6: OTG_HS_DIEPCTL6, _reserved45: [u8; 4usize], #[doc = "0x1c8 - OTG device endpoint-6 interrupt regi...
Rust
0
lock().unwrap().exec_records, "F", "E"); } fn assert_ordering<T: AsRef<str>>(records: &[T], first: &str, second: &str) { assert!(first != second); let first_idx = records.iter().position(|s| s.as_ref() == first); let second_idx = records.iter().position(|s| s.as_ref() == second); assert!(first_idx.unwr...
Rust
0
, Coin}; use chain_core::tx::data::address::ExtendedAddr; use chain_core::tx::data::attribute::TxAttributes; use chain_core::tx::data::output::TxOut; use chain_core::tx::data::Tx; use chain_core::tx::fee::FeeAlgorithm; use chain_core::tx::{TransactionId, TxAux}; use client_common::{ErrorKind, Result, SignedTransaction}...
Rust
0
} #[man(socketpair(2))] pub fn socketpair( domain: c::c_int, ty: c::c_int, protocol: c::c_int, ) -> Result<(OwnedFd, OwnedFd)> { let mut socks = [0, 0]; let res = unsafe { c::socketpair(domain, ty, protocol, &mut socks[0]) }; map_err!(res).map(|_| (OwnedFd::new(socks[0]), OwnedFd::new(socks[1]...
Rust
0
0.0, f64::cos(theta), 0.0, -f64::sin(theta)], [0.0, 0.0, 1.0, 0.0], [0.0, f64::sin(theta), 0.0, f64::cos(theta)], ] } fn rotmat_4d_zu(theta: f64) -> Mat4x4 { [ [1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, f64::cos(theta), -f64::sin(theta)], [0.0, 0.0, f...
Rust
0
2id; pub mod mock; use ra_syntax::{TextUnit, TextRange, SourceFile, TreePtr}; pub use crate::{ cancellation::{Canceled, Cancelable}, syntax_ptr::LocalSyntaxPtr, input::{ FilesDatabase, FileId, CrateId, SourceRoot, SourceRootId, CrateGraph, Dependency, FileTextQuery, FileSourceRootQuery, So...
Rust
0
u32::from_be_bytes(self.0[24..28].try_into().unwrap()) )); s.push_str(&format!( " green y: {}\n", u32::from_be_bytes(self.0[28..32].try_into().unwrap()) )); s.push_str(&format!( " blue x: {}\n", u32::from_be_bytes(self.0[32..36].tr...
Rust
0
} } => Ok(()) } test_verify_one_file! { #[test] test2 code! { enum E1 { N(), E(Box<E2>), } enum E2 { N(), E(Box<E1>), } } => Ok(()) } test_verify_one_file! { #[test] test3 code! { struct List<A> { a: ...
Rust
0
attr( all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows" )] mod cmd; fn main() { tauri::Builder::default() .on_page_load(|window, _payload| { window.listen("tauri://update-available".to_string(), move |msg| { println!("New version available: {:?}", msg); }...
Rust
0
import numpy as np # Creating an array array = np.array([1, 2, 3, 4, 5, 6]) # Boolean condition mask = array > 3 # Applying the mask filtered_array = array[mask] print("Original Array:", array) print("Mask:", mask) print("Filtered Array:", filtered_array)
Python
1
class AllOne: def __init__(self): self.myDict = {} def inc(self, key: str) -> None: if key in self.myDict: self.myDict[key] += 1 else: self.myDict[key] = 1 def dec(self, key: str) -> None: if key in self.myDict: if self.myDict[key] > 1: ...
Python
1
ers: List[str]) -> Dict[str, Any]: """ Add access points to an AP group. Args: venue_id: ID of the venue ap_group_id: ID of the AP group serial_numbers: List of AP serial numbers to add to the group Returns: Dict conta...
Python
1
team1_num = 5 team2_num = 6 score_1 = 40 score_2 = 42 team1_time = 1552.512 team2_time = 2153.31451 if score_1 > score_2 or score_1 == score_2 and team1_time > team2_time: result = 'Победа команды Мастера кода!' elif score_1 < score_2 or score_1 == score_2 and team1_time < team2_time: result = 'Победа команды ...
Python
1
::<i64>::from(typeid_array)) as std::sync::Arc<dyn arrow2::array::Array>, std::sync::Arc::new(arrow2::array::Utf8Array::<i64>::from(noticetype_array)) as std::sync::Arc<dyn arrow2::array::Array>, std::sync::Arc::new(arrow2::array::PrimitiveArray::f...
Rust
0
specified app type. Creates a /// `#[wasm_bindgen]` export with the name of the app type prefixed with `boot`. /// For example, `app_boot!(Example)` would export a JavaScript function named /// `bootExample`. #[macro_export] macro_rules! app_boot { ($app:ty) => { moxie_dom::__paste! { impl moxi...
Rust
0
=[[11, 12, 13], [21, 22, 23], [31, 32, 33]]) print("ss2 =\n" + str(ss2)) # The data of a StateSpace object is defined as read-only nx1 = ss1.nx A = ss1.A # ss1.nx = 3 # Raises an exceptions, since attribute is defined as read only print("\nCalculate eigen values and right eigen vectors:") ...
Python
1
ub fn and(&mut self, other: &Bitmap) { for i in 0..self.data.len() { self.data[i] &= other.data[i]; } } } /** * A 32x32 matrix that can be displayed on a LED matrix. */ #[derive(Clone, Copy, PartialEq)] pub struct Frame<const XSIZE: usize, const YSIZE: usize> { bitmap: [Bitmap; YS...
Rust
0
elf.inputs[index]["attention_mask"].squeeze() # might need to squeeze target_mask = self.targets[index]["attention_mask"].squeeze() # might need to squeeze return {"source_ids": source_ids, "source_mask": src_mask, "target_ids": target_ids, "target_mask": target_mask} def _b...
Python
1
import ast class GroupSimilarConstructsVisitor(ast.NodeVisitor): def visit_function_def(self, func_node, is_async): return self.generic_visit(func_node) def visit_FunctionDef(self, func_node): return self.visit_function_def(func_node, is_async=False) def visit_AsyncFunctionDef(self, func_...
Python
1
match (l, bg.len()) { (0,4) | (1,3) | (2,2) => {bg.pop(); (l, bg)}, _ => (l, bg), } }).collect(); let badges_filtered: HashMap<i16, Vec<api::PuzzleResult>> = badges_group_f .into_iter() .map(|(l,bg)| (l,bg .into_iter() .map(|b| api::Puz...
Rust
0
irs": self._scan_dirs, "min_size": self._min_size, "exclude_dirs": self._exclude_dirs, "exclude_extensions": self._exclude_extensions, "exclude_keywords": self._exclude_keywords, "hash_buffer_size": self._hash_buffer_size, "...
Python
1
from securityheaders.models import SecurityHeader from securityheaders.models.featurepolicy import FeaturePolicyDirective, FeaturePolicyKeyword from securityheaders.models.annotations import * import copy @requiredheader @description('It is a new header that allows a site to control which features and APIs can be used...
Python
1
r_style = 'success' progress.value = index label.value = "{name}: {index}".format( name=name, index=str(index or '?') ) def dbg(*args): if cfg['debug']: print(*args) cfg = { 'sys_seed':0, 'debug':True, 'scoring': None, 'scoring_higher_better': True, 'indent...
Python
1
SHIFT, __PAGE_OFFSET}; /// PAGE_SHIFT determines the page size pub const PAGE_SHIFT: i32 = 12; pub const PAGE_SIZE: usize = 1 << PAGE_SHIFT; pub const PAGE_MASK: usize = !(PAGE_SIZE - 1); pub const PMD_PAGE_SIZE: usize = 1 << PMD_SHIFT; pub const PMD_PAGE_MASK: usize = !(PMD_PAGE_SIZE - 1); pub const HPAGE_SHIFT: i3...
Rust
0
FramedStream) { if let Err(err) = Self::echo(&mut stream).await { error!("echo {}", err); } } } async fn make_xenovox<A: ToSocketAddrs>( addr: A, peer_store: SimplePeerStore, ) -> Result<(QuicHost, PublicKey), Error> { let (sk, pk) = random_keypair(); let mut sock_addr...
Rust
0
, w3); /// /// *state = [ae.0, bf.0, cg.0, dh.0, /// ae.1, bf.1, cg.1, dh.1]; /// } /// ``` /// /// instead of 4 rounds of: /// /// ```ignore /// fn round(state: &mut [u64; 8], w: &mut [u64], t: usize) { /// let [a, b, c, mut d, e, f, g, mut h]: [u64; 8] = *state; /// /// h += big_sigma1!(e) +...
Rust
0
rrsendfile^s4   zBaseEventLoop.sendfilecstddS)Nz!sendfile syscall is not supportedrR)rhrirNrOrPrrrrszBaseEventLoop._sendfile_nativec s||r|||r...
Python
1
psu-mb': 36, 'FPC-mb-ursa': 37, 'BT_ANT-mb': 38, 'BT_ANT-wlan': 39, 'WF_ANT-mb': 40, 'WF_ANT-wlan': 41, 'SPK-mb': 42, 'SPK-ursa': 43, 'HDMI-ursa-mb': 44, 'HDMI-mb-tcon': 45, 'HDMI-ursa-tcon': 46, 'IRKEY-mb': 47, ...
Python
1
inux. //! use myutil::{err::*, *}; use nix::{ mount::{self, MsFlags}, sys::wait, unistd, }; pub(in crate::linux) fn mount_make_rprivate() -> Result<()> { mountx( None, "/", None, pnk!(MsFlags::from_bits( MsFlags::MS_REC.bits() | MsFlags::MS_PRIVATE.bits() ...
Rust
0
mut potentials = Vec::with_capacity(self.potentials.len()); for v2 in 0..self.n_values_2() { for v1 in 0..self.n_values_1() { potentials.push(self.potential(v1, v2)); } } CategoricalEdge { dim_1: self.dim_2, dim_2: self.dim_1, ...
Rust
0
_from_url(url) if warc_record and cdxj_record: return warc_record, cdxj_record return None, None def iter_index(self) -> Generator[CdxjRecord, None, None]: """ Iterates over the index entries in all WACZ files, yielding `CdxjRecord` objects. Each yielded ...
Python
1
from app.core.env import env S3_ID: str = env.str("S3_ID") S3_KEY: str = env.str("S3_KEY") S3_ENDPOINT: str = env.str("S3_ENDPOINT") S3_BUCKET: str = env.str("S3_BUCKET") S3_URL = env.str("S3_URL", "http://146.0.75.247:2300/fastx")
Python
1
tq_ids = tq_ids.view(tq_ids.shape[0], -1).to(device) # [batch_size, seq_len] tq_mask = tq_mask.view(tq_ids.shape[0], -1).to(device) # [batch_size, seq_len] ti_mask = ti_mask.view(tq_ids.shape[0], -1).to(device) # [batch_size, seq_len] ti_ids = ti_ids.view(tq_ids.shape[0], -1).to(device) # [...
Python
1
/// use colorful::Color; /// /// fn main() { /// let a = "Hello world"; /// println!("{}", a.color(Color::Red)); /// println!("{}", a.blue()); /// let b = String::from("Hello world"); /// println!("{}", b.blue()); /// } /// ``` fn color<C: ColorInterface>(self...
Rust
0
SERV_FLAG: ::ULONG = 0x00000040; pub const DS_CLOSEST_FLAG: ::ULONG = 0x00000080; pub const DS_WRITABLE_FLAG: ::ULONG = 0x00000100; pub const DS_GOOD_TIMESERV_FLAG: ::ULONG = 0x00000200; pub const DS_NDNC_FLAG: ::ULONG = 0x00000400; pub const DS_SELECT_SECRET_DOMAIN_6_FLAG: ::ULONG = 0x00000800; pub const DS_FULL_SECRE...
Rust
0
} } /// Returns true if the new mode is revoking permissions as compared to the old mode as pertains /// directory read/execute permissions. This is useful when recursively modifying file permissions. /// /// ### Examples /// ``` /// use fungus::prelude::*; /// /// assert_eq!(sys::revoking_mode(0o0777, 0o0777), f...
Rust
0
.next(); while next.is_some() { let cause = next.unwrap(); let _ = writeln!(error_string, " caused by: {}", cause); next = causes.next(); } if let Some(backtrace) = err.backtrace() { let _ = writeln!(error_string, "backtrace: {}", backtrace); } error_string } fn ...
Rust
0
] fn test_ray_tracing() { let entry = gen_one_entry!(rgen, r#" #version 460 core #extension GL_EXT_ray_tracing: enable uniform accelerationStructureEXT acc; layout(location = 0) rayPayloadEXT vec4 payload; void main() { traceRayEXT(acc, gl_RayFlagsOpaqueEXT, 0x...
Rust
0
import logging import os import sys from contextlib import asynccontextmanager from typing import Final import uvicorn from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from surfkit.server.routes import task_router from .agent import Agent # Configure logging logger: Final = logging.getL...
Python
1
clone::Clone for addrinfoex3 { fn clone(&self) -> Self { *self } } #[repr(C)] #[doc = "*Required features: `\"Win32_Networking_WinSock\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] pub struct addrinfoex4 { pub ai_flags: i32, pub ai_family: i32, pub ai_socktype: i32, ...
Rust
0
from rest_framework.permissions import SAFE_METHODS, BasePermission class IsAdminOrIfReadOnly(BasePermission): def has_permission(self, request, view): return bool( ( request.method in SAFE_METHODS ) or (request.user and request.user.is_staff) )
Python
1
移が行われた回数 j_start = 1 if target_index <= boost_limit else 0 # jの開始値 min_tmp_cost = 10**9 best_tmp_palette = [] best_extract_well = -1 best_command = [] best_j = -1 best_diff = 0 best_discard_count = 0 best_well_index = -1 # すべてのウェルに対して for well_index in range(wells_num): ...
Python
1
c) -> Self { Self { pixels: &mut q.pixels, width: q.w, height: q.h, } } } /// Flood fill algorithm. See [wikipedia](https://en.wikipedia.org/wiki/Flood_fill) for more details. #[allow(clippy::too_many_arguments)] fn flood_fill_seed<F>( image: &mut ImageMut<'_...
Rust
0
# automatically generated by the FlatBuffers compiler, do not modify # namespace: tflite import flatbuffers from flatbuffers.compat import import_numpy np = import_numpy() class StablehloConcatenateOptions(object): __slots__ = ['_tab'] @classmethod def GetRootAs(cls, buf, offset=0): n = flatbuff...
Python
1
from __future__ import annotations import os import subprocess import sys import pytest def _module_is_loaded(module: str) -> bool: """This function checks if the specified module is loaded after calling `import pyvista` We use ``os.system`` because we need to test the import of pyvista outside of the ...
Python
1
els) """ p = patch_size h = x.shape[1] imgs = x.reshape(shape=(x.shape[0], 1, h * p)) return imgs def save_videos_grid(videos: torch.Tensor, path: str, rescale=False, n_rows=4, fps=8, resize=None): videos = rearrange(videos, "b c t h w -> t b c h w") outputs = [] for x in videos: ...
Python
1
vm.handle_store(MemoryOrder::Relaxed, &global_handle, &func_ret42_handle); } let my_main_handle = vm.handle_from_func(func_my_main_id); // make boot image vm.make_boot_image( vec![func_ret42_id, func_my_main_id], // whitelist Some(&my_main_handle), None, // primoridal f...
Rust
0
r" "#; let data: Data = toml::from_str(toml).unwrap(); assert_eq!(data.key, Topology::Leader); } #[test] fn topology_toml_serialize() { #[derive(Serialize)] struct Data { key: Topology, } let data = Data { key: Topology::L...
Rust
0
# (Parte 3) Threads - Executando processamentos em paralelo from time import sleep from threading import Lock, Thread class Ingressos: ''' Classe que vende ingressos ''' def __init__(self, estoque: int): ''' Inicializando... :param estoque: quantidade de ingressos em estoque ...
Python
1
import torch.nn as nn import torchvision.models as models import torch import numpy as np import torch.nn.functional as F from sklearn.neighbors import KDTree from scipy.spatial import cKDTree from torch.nn.functional import pairwise_distance from scipy.spatial import distance_matrix # import cupy as cp from scipy.spat...
Python
1
large.", 23 => "Host is unreachable.", 24 => "Identifier removed.", 25 => "Illegal byte sequence.", 26 => "Operation in progress.", 27 => "Interrupted function.", 28 => "Invalid argument.", 29 => "I/O error.", 30 => "Socket...
Rust
0
nd, SeekFrom}; #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] pub(crate) struct AbsSeekPos(pub u64); impl AbsSeekPos { /// Result: Ok( 0 ..= end ) or Error (kind() == InvalidInput) pub fn offset_bounded(&self, pos: SeekFrom, end: u64) -> io::Result<AbsSeekPos> { let cur = self.0; Ok(Se...
Rust
0
let (x0, x1) = match (0..nx).position(|xx| xx as f64 > xlook) { Some(idx) => (idx - 1, idx), None => (nx - 1, nx), }; let (y0, y1) = match (0..ny).position(|yy| yy as f64 > ylook) { Some(idx) => (idx - 1, idx), None => (ny - 1, ny), }; ...
Rust
0
#!/usr/bin/env python # Copyright 2015 Minhua Wu # Apache 2.0 # convert acronyms in swbd decode result # e.g. convert things like en_4156 B 414.26 0.65 u._c._l._a. to # en_4156 B 414.26 0.16 u # en_4156 B 414.42 0.16 c # en_4156 B 414.58 0.16 l # en_4156 B 414.74 0.17 a import argparse import re __author__ = 'Minhu...
Python
1
FLAGS.camera_id, FLAGS.keypoint_batch_size, FLAGS.save_res) else: # predict from image img_list = get_test_images(FLAGS.image_dir, FLAGS.image_file) topdown_unite_predict(detector, topdown_keypoint_detector, img_list, ...
Python
1
let ( $($ty,)* ) = self; ( $($ty.lend1(),)* ) } fn lend2(&'a self, ptr: &Self::Target1) -> Self::Target { let ( $($name,)* ) = ptr; let ( $($ty,)* ) = self; ( $($ty.lend2($name),)* ) } fn lend(&'a self) -> ...
Rust
0
nect_triples("huruf") connect_triples("paragraf") # Find entities that appear only as subjects in type declarations candidates_for_removal = set() non_removable_entities = set() a_label = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" for s, p, o in graph: if p == URIRef(a_label): candidates_for_remova...
Python
1
scaled_set"].apply(lambda x: "GPT2-oscar" in x) # oscar = evals[oscar_idx].groupby(["min_percentage", "num_models"])[ # "are"].mean().apply(lambda x: x).reset_index() # evals = evals[~oscar_idx] # oscar["scaled_set"] = "GPT2-oscar-all" # evals = pd.concat( # [evals, oscar, c4]) # plo...
Python
1
}, ); g.bench_function( concat!( "TinyVec<[", stringify!($type), "; ", stringify!($len), "]>::extend_from_slice" ), |b| { b.iter(|| { let data: &[$type] = black_box(&[0, 1, 2, 3, 4, 5, 6, 7]); let mut v: Tiny...
Rust
0
hot::Sender<()>>, third_wheel_killer: Option<oneshot::Sender<()>>, pub client: reqwest::Client, } pub async fn set_up_for_trivial_mitm_test() -> Harness { INIT.call_once(|| SimpleLogger::new().init().unwrap()); // set up certificates for third wheel and the test server let root_certificates = creat...
Rust
0
a = ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', 'Воскресенье'] c = int(input()) print('Ваши рабочие дни: ', a[:(7-c)])
Python
1
None: self.evaluation_cache[key] = value def _clear_eval_cache(self) -> None: self.evaluation_cache.clear() async def close(self): """ Close the configuration client and clean up resources. Stops polling tasks and clears caches. """ try: # C...
Python
1
from module_dotenv import user, password, host, port, db POSTGRES_URI = f'postgresql://{user}:{password}@{host}:{port}/{db}' SALT = 'my_sJHLHLHKL_)jzekehckiuper_s!alt_#4$4344'
Python
1
i << 12 } pub const I_INDENTCALLBACK: c_int = -1; pub type LV_ITEMA = LVITEMA; pub type LV_ITEMW = LVITEMW; pub const I_GROUPIDCALLBACK: c_int = -1; pub const I_GROUPIDNONE: c_int = -2; STRUCT!{struct LVITEMA { mask: UINT, iItem: c_int, iSubItem: c_int, state: UINT, stateMask: UINT, pszText:...
Rust
0
put((max_seq_len,1)) op_1 = predictive_model([Input_Layer,y_in]) final_norm_op = tf.keras.layers.Lambda(normalisation_layer)(op_1) testing_model = tf.keras.models.Model(inputs=[Input_Layer,y_in],outputs=final_norm_op) testing_model.compile(tf.keras.optimizers.Adam(lr=1e-4),loss='categorical_crossentropy',metrics=['ac...
Python
1
: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[242, 15, 92, 250], OperandSize::Dword) } fn subsd_2() { run_test(&Instruction { mnemonic: Mnemonic::SUBSD, operand1: Some(Direct(XMM2)), operand2: Some(IndirectScaledDisplaced(EDI, Eight, 203931...
Rust
0
= " @param[in] pSrcB points to the second input sequence."] #[doc = " @param[in] srcBLen length of the second input sequence."] #[doc = " @param[out] pDst points to the block of output data"] #[doc = " @param[in] firstIndex is the first output sample to start with."] #[doc = " @par...
Rust
0
dyn (::std::any::Any)> { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { Self::descriptor_static() } fn new() -> ListLogMetricsRequest { ListLogMetricsRequest::new() } fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescr...
Rust
0
from datetime import date from pathlib import Path import pytest from tests.utils import ( WarningConfig, assert_stelselgroep_output, assert_stelselgroep_specifiek_output, assert_stelselgroep_warnings, maak_specifieke_input_en_output_model_fixture, ) from woningwaardering.stelsels.onzelfstandige_w...
Python
1
import numpy as np import re # 定義聲母(initials)與韻母(finals) consonants = ['p', 'ph', 'm', 'b', 't', 'th', 'n', 'l', 'k', 'kh', 'ng', 'g', 'ts', 'tsh', 's', 'j', 'h'] vowels = sorted([ 'm', 'mh', 'ng', 'ngh', 'a', 'ah', 'ann', 'annh', 'am', 'ap', 'an', 'at', 'ang', 'ak', 'e', 'eh', 'enn', 'ennh', 'eng', '...
Python
1
def WebIDLTest(parser, harness): parser.parse(""" typedef long mylong; typedef long? mynullablelong; interface Foo { const mylong X = 5; const mynullablelong Y = 7; const mynullablelong Z = null; void foo(mylong arg); }; """) results = parser.finish()...
Python
1
ivec_pd_01.nif", 0x4F57_7322, 0xE3F9_3660), (r"meshes\x\ex_vivec_h_08.nif", 0x4F57_7322, 0xE7F3_AAA3), (r"meshes\x\ex_vivec_ps_01.nif", 0x4F57_7322, 0xE879_3660), (r"meshes\x\ex_vivec_pq_01.nif", 0x4F57_7322, 0xE979_3660), (r"meshes\x\ex_vivec_pq_03.nif", 0x4F57_7322, 0xE979_3661), (r"meshes\x\...
Rust
0
Into<String>")] IntoSerializable); check_serialization(S(IntoSerializable::A), expect![[r#""String A""#]]); check_serialization(S(IntoSerializable::B), expect![[r#""Some other value""#]]); check_serialization(S(IntoSerializable::C), expect![[r#""Looks like 123""#]]); } #[test] fn test_frominto_de() { ...
Rust
0
ncellable, progress_callback: PkProgressCallback, progress_user_data: gpointer, callback: gio::GAsyncReadyCallback, user_data: gpointer); #[cfg(any(feature = "v0_5_2", feature = "dox"))] pub fn pk_package_sack_merge_generic_finish(sack: *mut PkPackageSack, res: *mut gio::GAsyncResult, error: *mut *mut glib::GEr...
Rust
0
Value::Byte(lv_raw) => Ok((lv_raw <= rv.try_extract_into::<i8>()?).into()), Value::Short(lv_raw) => Ok((lv_raw <= rv.try_extract_into::<i16>()?).into()), Value::Int(lv_raw) => Ok((lv_raw <= rv.try_extract_into::<i32>()?).into()), Value::Long(lv_raw) => Ok((lv_raw <= rv.try_extract_into:...
Rust
0
offset to account for the BeginLoop/EndLoop instr let offset = inner_loop.len() + 1; instrs.push(Instr::BeginLoop(offset)); instrs.extend(inner_loop); instrs.push(Instr::EndLoop(offset)); } } } ...
Rust
0
unsafe { VertexDescriptor::from_ptr(msg_send![self.as_ptr(), retain]) } } } // Extra block stuff not supported by `block` const BLOCK_HAS_COPY_DISPOSE: i32 = 0x02000000; const BLOCK_HAS_SIGNATURE: i32 = 0x40000000; #[repr(C)] struct BlockBase<A, R> { isa: *const Class, ...
Rust
0
tabs share=0.8 { viewport name=Viewport pos="rocket.world_pos + (0.0,0.0,0.0,0.0, 5.0, 0.0, 1.0)" look_at="rocket.world_pos" hdr=#true } vsplit share=0.4 { graph "rocket.fin_control_trim" name="Trim Control" graph "rocket.fin_deflect" name="Fin Deflection" ...
Python
1
close() # Đóng kết nối print("Kết nối đã được đóng.") else: print("Kết nối đã bị đóng trước đó.") client_window.quit() # Đóng cửa sổ Tkinter sau khi ngắt kết nối client_window.destroy() client_window.protocol("WM_DELETE_WINDOW", closing_client_window) ...
Python
1
a[5] * 2, a[6] * 2, a[7] * 2, ]; [ m(a[0], a[0]), m(aa[0], a[1]), m(aa[0], a[2]) + m(a[1], a[1]), m(aa[0], a[3]) + m(aa[1], a[2]), m(aa[0], a[4]) + m(aa[1], a[3]) + m(a[2], a[2]), m(aa[0], a[5]) + m(aa[1], ...
Rust
0
ow::bail!("Invalid SenderId") } <gh_stars>0 use crate::{Error, mock::*}; use frame_support::{assert_ok, assert_noop}; use super::*; #[test] fn create_claim_works(){ new_test_ext().execute_with(||{ let claim = vec![1, 2]; assert_ok!(TemplateModule::create_claim(Origin::signed(1), claim.clone())); ...
Rust
0
) else: if pr: report.add(Record(INFORMATION, f"{addon_name} addon also exists in {branch} branch but " \ f"with update compatible version: {repo_addons_version}")) def _check_version_lower(report: Report, addon_details, branch, repo_addons_version, pr): """Che...
Python
1
if output_res.is_err() { return String::from(STANDARD_BOARD_ID); } // Try to parse the output as a valid UTF-8 string. let output = output_res.unwrap(); let str_res = String::from_utf8(output.stdout); if str_res.is_err() { return String::from(STANDARD_BOARD_ID); } // Parse...
Rust
0
ResponseOutput), Error> where KexAlgo: Kex, Cipher: AeadMut + NewAead + NoiseCipher + Sized, DigestType: BlockInput + Clone + Default + Digest + FixedOutput + Update + Reset; } impl ResponderTransitionMixin for Start { fn handle_request<Handshake, KexAlgo, Cipher, DigestType>( &...
Rust
0
ction.COPY_FROM, other=field.name ) # Save the changes proj.manual_entries.write() return new_entry def __get(self, project_key, mapping_id, proj: Project | None = None): if proj is None: proj = self.project_handler._get(project_key) if proj is None...
Python
1
ape (n_states, ) C[i] is a the minimum-consecutive-states constraint for state i. C[i] = 1 is equivalent to no constraint (default). constraint : optional, array of shape (n_samples, n_states) K[t, i] = 1 forbids state i at time t. K[t, i] = 2 forces state i at time t. Use K[...
Python
1
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
Error> { for test_token in TestToken::all_tokens() { if TokenLike::Id(test_token.id) == token { return Ok(Token::new( test_token.id, test_token.address, "", test_token.precision, Token...
Rust
0
= "../structs/extra_bytes.rs"] mod extra_bytes; use extra_bytes::ExtraBytes; pub struct ItemsDat { items_dat_hash: u32, items_dat: Vec<u8>, items_dat_file: Vec<u8> } #[allow(dead_code)] impl ItemsDat { pub fn new() -> ItemsDat { ItemsDat { items_dat_hash: 0, items_dat...
Rust
0
<T>, E> where F: Fn(String) -> Result<String, E>, { let mut result = self; result.entries = result .entries .into_iter() .map(|p| p.map_symbols(&f)) .collect::<Result<_, _>>()?; Ok(result) } } pub trait Context { fn get_wor...
Rust
0
# Problem 626: Exchange Seats # Difficulty: Medium # Table: Seat # +-------------+---------+ # | Column Name | Type | # +-------------+---------+ # | id | int | # | student | varchar | # +-------------+---------+ # id is the primary key (unique value) column for this table. # Each row of this tabl...
Python
1
getenv("ADAPTER_S3_PREFIX_PATH", "txgemma_lora_instr_v1") logger.info("Uploading LoRA adapter to s3://%s/%s …", ADAPTER_BUCKET, ADAPTER_PREFIX) uploaded = upload_directory( ADAPTER_DIR, bucket=ADAPTER_BUCKET, prefix=ADAPTER_PREF...
Python
1
fn get_test_value() -> Self { 0 } fn is_equal(&self, other: &Self) -> bool { self == other } } }; } convert_primitive!(u16, read_u16, write_u16); convert_primitive!([u8; 2]); convert_primitive!([u8; 3]); convert_primitive!([u8; 4]); c...
Rust
0
rmap(var, trueexit.target.inputargs[i]) for i, var in enumerate(falseexit.args): add_to_varmap(var, falseexit.target.inputargs[i]) current = targetblock if len(chain) > 1: break else: return False merge_chain(chain, checkvars[0], varmap, graph)...
Python
1
fReader, Write}; fn main() { let args = std::env::args().collect::<Vec<String>>(); let filename = args.get(1); let mut reader_lines = filename .map(|name| BufReader::new(std::fs::File::open(name).expect("invalid filename")).lines()); let mut vars: HashMap<String, Variable> = default_vars!(); ...
Rust
0
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { let width = 0; match self { AnyType::Null => write!(f, "null"), AnyType::UInt8(v) => write!(f, "{}", v), AnyType::UInt16(v) => write!(f, "{}", v), AnyType::UInt32(v) => write!(f, "{}", v), ...
Rust
0
4bee-b270-2d7435275f9c', 0) set_local_machine_dword_value(_pgina_reg_path, 'ced8d126-9121-4cd2-86de-3d84e4a2625e', 0) set_local_machine_dword_value(_pgina_reg_path, '534eaabf-ab1f-4b0e-9b28-dc77f3494a78', 0) def _configure_plugins_order(): set_local_machine_multi_str_value(_pgina_reg_path, 'IPluginAuthent...
Python
1
m(lr=self.lr, clipnorm=self.clipnorm), loss='mse') io_func = self.G.make_io_func(io_form='regression', cols=self.target_cols) callbacks = [keras_utils.LrReducer(patience=self.patience, reduce_rate=.1, ...
Python
1
import glob import json import numpy as np import cv2 base_path = "./data/different_types" # prediction_dir = "/home/hanxiao/Desktop/Research/proj-qqtt/proj-QQTT/exp_results/indomain_our/output_dynamic" # prediction_dir = "/home/hanxiao/Desktop/Research/proj-qqtt/proj-QQTT/exp_results/GNN_render/output_dynamic_gnn" pr...
Python
1
_DECL_AST: ::libc::c_uint = 5; pub const Z3_UNKNOWN_AST: ::libc::c_uint = 1000; pub type Z3_ast_kind = Enum_Unnamed10; pub type Enum_Unnamed11 = ::libc::c_uint; pub const Z3_OP_TRUE: ::libc::c_uint = 256; pub const Z3_OP_FALSE: ::libc::c_uint = 257; pub const Z3_OP_EQ: ::libc::c_uint = 258; pub const Z3_OP_DISTINCT: ::...
Rust
0