text
string
label_name
string
labels
int64
d)'></button> SoundcloudR = 60100, /// <button class='icomoon' id='\u{e917}' onclick='navigator.clipboard.writeText(this.id)'></button> Spades = 59671, /// <button class='icomoon' id='\u{ea12}' onclick='navigator.clipboard.writeText(this.id)'></button> SpellCheck = 59922, /// <button class='icomoon' id='\u{e9c9}'...
Rust
0
tmp_dir = tempfile::Builder::new() .prefix(env!("CARGO_PKG_NAME")) .rand_bytes(5) .tempdir() .expect("not possible to create tempfile"); let db_path = tmp_dir.path().join("test.db"); // Connection manager let manager = r2d2::ConnectionManager::<...
Rust
0
rtdt|d }|dkr^t}q|dkrt j dt|tj |q|dkrt |}t j dt|t|t j||q|dkrtjdqn|r(t j||t jd t|ndS( Ns8The file %s exists. (i)gnore, (w)ipe, (b)ackup, (a)aborttitwtb...
Python
1
=> HyperMethod::PUT, } } } /// Field that either serializes to null or a value. /// /// This is particularly useful when combined with an `Option` by allowing three /// states via `Option<NullableField<T>>`: undefined, null, and T. /// /// When the request field is `None` a field can skip serialization, w...
Rust
0
# Copyright (c) Saga Inc. # Distributed under the terms of the GNU Affero General Public License v3.0 License. from mito_ai.utils.mito_server_utils import ProviderCompletionException import pytest class TestProviderCompletionException: """Test the ProviderCompletionException class.""" @pytest.mark.param...
Python
1
_name { "print_callback" => PRINT_CALLBACK, "lookup_callback" => LOOKUP_CALLBACK, _ => panic!("unexpected export {}", field_name), }; Ok(FuncInstance::alloc_host(signature.clone(), index)) } } // Minimal String wrapper to work with wasmi's MemoryInstance::set_val...
Rust
0
ot for axis in (ax[class_number // nrows, class_number % ncols], ax[nrows-1, ncols-1]): axis.scatter(class_clean_features[:, 0], class_clean_features[:, 1], marker=".", color=colors[class_number]) axis.scatter(class_noisy_features[:, 0], class_noisy_features[:, 1], marker="x"...
Python
1
et actually includes the one-time /// private key, and returns an error if only the alternative is supplied. /// /// The purpose of this is to avoid the need to refactor existing working /// software like SDKs that would not benefit from migrating to the /// LocalRingSigner, at least for now #[derive(Clone, Debug)] pub...
Rust
0
ble_unchecked`. pub fn size_prefixed_root_as_my_table_with_opts<'b, 'o>( opts: &'o flatbuffers::VerifierOptions, buf: &'b [u8], ) -> Result<MyTable<'b>, flatbuffers::InvalidFlatbuffer> { flatbuffers::size_prefixed_root_with_opts::<MyTable<'b>>(opts, buf) } #[inline] /// Assum...
Rust
0
is wrong" ); } else if count == 5 { assert_ne!(epoch, end, "Ending epoch of exclusive time series is wrong"); } #[cfg(feature = "std")] println!("{}", epoch); count += 1; } assert_eq!(count, 6, "Should have five items in this iterator"); cou...
Rust
0
RelayerRewards; type Balances = pallet_balances::Pallet<TestRuntime>; const RELAYER_1: TestAccountId = 1; const RELAYER_2: TestAccountId = 2; const RELAYER_3: TestAccountId = 3; const RELAYERS_FUND_ACCOUNT: TestAccountId = crate::mock::ENDOWED_ACCOUNT; fn relayers_rewards() -> RelayersRewards<TestAccountId, Te...
Rust
0
ath register representations. pub struct Scope { pub program_uid: u32, pub(crate) named: RegFile, pub(crate) num_control: u8, pub(crate) num_local: u8, pub(crate) num_perm: u8, tmp: Vec<Reg>, } macro_rules! add_reg { ($scope:ident, $name:expr, $rtyp:ident, $idx:expr, $typ:expr) => {{ ...
Rust
0
continue; }; batch.push( // Also show edited roads in this layer if map.get_edits().changed_roads.contains(&r.id) { Fill::ColoredTexture(color, Texture::CROSS_HATCH) } else { Fill::Color(color) ...
Rust
0
""" pygments.lexers.sophia ~~~~~~~~~~~~~~~~~~~~~~ Lexer for Sophia. Derived from pygments/lexers/reason.py. :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, default, words from pygme...
Python
1
o','r','l','d'].iter().map(|c| *c as u8).collect::<Vec<_>>(), b'o')); /// assert_eq!(-1,bytes::LastIndexByte("Hello, world", b'x')); /// ``` pub fn LastIndexByte(s: impl AsRef<[byte]>, c: byte) -> int { for (i, &v) in s.as_ref().iter().enumerate().rev() { if v == c { return int!(i); } ...
Rust
0
el="服装蒙版", elem_id="masked-img",show_share_button=False,width=300) with gr.Row(): btn_open_outputs = gr.Button("输出文件夹") btn_open_outputs.click(fn=open_folder) with gr.Column(): with gr.Row(): # image_out = gr.Image(label="Output", elem_id="outp...
Python
1
engine262"); bench_source(c, &file); } criterion_group!(benches, engine262); criterion_main!(benches); <filename>src/mpi.rs use num::bigint::BigUint; use num::integer::Integer; #[inline] pub fn pow_mod(val: &[u8], exp: &[u8], modulus: &[u8]) -> BigUint { let modulus = BigUint::from_bytes_be(modulus); let ...
Rust
0
lt: localhost:1350] "); fn load(Args { arg_file, flag_play, flag_target, flag_verbose, .. }: Args) -> Baps3Result<()> { let ap = try!(to_absolute_path_str(&*arg_file)); let log = |&:s:&str| verbose_logger(flag_verbose, s); let mut baps3 = try!(Baps3...
Rust
0
} } pub trait Parse { fn encode(&self) -> Vec<u8>; fn decode(data: &[u8]) -> Result<Counter, Box<dyn Error>>; } impl Parse for Counter { fn encode(&self) -> Vec<u8> { let string_list: Vec<String> = self .values .iter() .map(|(k, v)| format!("{}: {}", k, v)) ...
Rust
0
bool, ) -> (Vec<f32>, Vec<f32>) { assert!(layers > 0); if outside { xl = xl - (layers - 1) as f32 * x_spacing - x_spacing / 2.; xr = xr + (layers - 1) as f32 * x_spacing + x_spacing / 2.; yl = yl - (layers - 1) as f32 * y_spacing - y_spacing / 2.; yr = yr + (layers - 1) as f32 *...
Rust
0
import numpy as np import pytest import pandas as pd from pandas import ( MultiIndex, Series, ) import pandas._testing as tm @pytest.mark.parametrize("as_period", [True, False]) def test_mode_extension_dtype(as_period): # GH#41927 preserve dt64tz dtype ser = Series([pd.Timestamp(1979, 4, n) for n in ...
Python
1
3 (3.00%) high severe Benchmarking bench_fold1000_no_branch Benchmarking bench_fold1000_no_branch: Warming up for 3.0000 s Benchmarking bench_fold1000_no_branch: Collecting 100 samples in estimated 5.0012 s (19M iterations) Benchmarking bench_fold1000_no_branch: Analyzing bench_fold1000_no_branch ...
Rust
0
lue(json).unwrap() } fn to_init_pdu_event( id: &str, sender: UserId, ev_type: EventType, state_key: Option<&str>, content: JsonValue, ) -> StateEvent { let ts = unsafe { let ts = SERVER_TIMESTAMP; // increment the "origin_server_ts" value SERVER_TIMESTAMP += 1; t...
Rust
0
appropriate grants for the /// log-delivery group. </p> /// </li> /// <li> /// <p> /// <i>HTTP Status Code:</i> 400 Bad Request</p> /// </li> /// <li> /// <p> /// <i>SOAP Fault Code Prefix:</i> Client</p> /// </li> /// </ul> /// </li> /// <li> /// <ul> /// <l...
Rust
0
处理的数量""" if not processed_data: return 0 processed_inputs = {item['input'] for item in processed_data if item.get('input')} count = 0 for item in original_data: if item.get('text') and item['text'] in processed_inputs: count += 1 ...
Python
1
sponse at greens_func: greens function semianalytic_func: semianalytic function Returns ------- : Combined response """ response = np.zeros(inside.shape[:-1]) points = inside[..., 0] if np.any(~points): ...
Python
1
data = self.data.T[mask.T] return self._csc_container((data, indices, indptr), shape=self.shape, dtype=self.dtype) tocsc.__doc__ = spmatrix.tocsc.__doc__ def tocoo(self, copy=False): num_rows, num_cols = self.shape num_offsets, offset_len = self.dat...
Python
1
method_a(self.0.object, __jni_method, __jni_args.as_ptr()) } } /// [readImmediately](https://developer.android.com/reference/android/telecom/Connection.RttTextStream.html#readImmediately()) /// /// Required features: "java-lang-String" #[cfg(any(feature = "all", all(...
Rust
0
ld(ActionType::Deployment, Weight::new(123)) .expect_err("This operation should return error"); match err { Error::SetThresholdFailure(SetThresholdFailure::PermissionDeniedError) => {} ref e => panic!("Invalid error variant: {:?}", e), } ...
Rust
0
(data.keys())}') try: outputs = data[output_key] except KeyError as e: raise KeyError(f'output_key is "{output_key}", but data has keys: {sorted(data.keys())}') for i, o in zip(inputs, outputs): new_data.append(glm.TuningExample({"text_input": str(i), "output": str(o)})) return...
Python
1
# # Copyright (C) 2023, Inria # GRAPHDECO research group, https://team.inria.fr/graphdeco # All rights reserved. # # This software is free for non-commercial, research and evaluation use # under the terms of the LICENSE.md file. # # For inquiries contact george.drettakis@inria.fr # import os import torch from random...
Python
1
ill_done() temp_sensor = hass.states.get("sensor.b51782bc8_remote_temperature") assert temp_sensor.state == "1.0" primary_temp_sensor = hass.states.get("sensor.b51782bc8_primary_temperature") assert primary_temp_sensor.state == "1.0" # Fastforward time without BLE advertisements with patch_bl...
Python
1
assert!(test_bed.contains_key("ELEC_EXT_PWR_POTENTIAL_NORMAL")); assert!(test_bed.contains_key("ELEC_EXT_PWR_FREQUENCY")); assert!(test_bed.contains_key("ELEC_EXT_PWR_FREQUENCY_NORMAL")); } } <gh_stars>0 use core::ffi::c_void; use core::ptr::NonNull; /// Raw window handle for Windows. /// /// ## Co...
Rust
0
from sqlalchemy.orm import Session from model.models import Patient, Organization, ProviderNetwork, Coverage from datetime import datetime def get_patient(db: Session, patient_id: int): return db.query(Patient).filter(Patient.id == patient_id).first() def get_organization(db: Session, org_id: int): return db....
Python
1
#[doc = "Bits 16:23 - Remap vector for Alcatraz System address space"] #[inline(always)] pub fn az_sys_remap(&mut self) -> AZ_SYS_REMAP_W { AZ_SYS_REMAP_W { w: self } } } <gh_stars>10-100 //! Command `new` use crate::{ registry::{redep, Manifest, Registry}, result::Result, }; use etc::{Etc...
Rust
0
enerate_children(2):#max方一定是AI,所以生成AI走步的子节点 next_tuple = alpha_beta_search(child, depth - 1, alpha, beta, False) tuple = max(tuple, next_tuple,key=itemgetter(0)) alpha = max(alpha, tuple[0]) if alpha >= beta: break return tuple else: tu...
Python
1
self.array[..].iter().cloned() } pub fn squares_with_indices<'a>( &'a self, ) -> impl Iterator<Item = (SquareIndex, Option<Digit>)> + 'a { SquareIndex::all().map(move |i| (i, self.get(i))) } } impl std::fmt::Debug for Grid { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::...
Rust
0
ーユーザのリスト pub async fn get_friends_list(&self, token: &Token) -> Vec<TwitterUser> { let mut users: Vec<TwitterUser> = Vec::new(); let mut cursors = friends_of(self.account.id, &token).with_page_size(200); loop { let resp = cursors.call().await.unwrap(); users = [users,...
Rust
0
# Attendance.route.py from flask import Blueprint from Attendance.controller import create_attendance, get_all_attendances, get_attendance_by_user, update_attendance, delete_attendance attendance_bp = Blueprint('attendance', __name__) # Đăng ký các route cho API attendance_bp.route('/attendance', methods=['POST'])(cr...
Python
1
class Solution: def moveZeroes(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ non_zero_index = 0 for i in range(len(nums)): if nums[i] != 0: nums[non_zero_index] = nums[i] non_zero_in...
Python
1
<a class="link" href={format!("{}{}?searchMode=all", DICTIONARY_LINK_TEMPLATE, word)} target="_blank">{ "Sanakirja" } </a> {" | "} <a class="link" href={"javascript:void(0)"} onclick={share_link}> { if !props.is_link_co...
Rust
0
pub struct Builder { pub(crate) trust_policy: std::option::Option<std::string::String>, } impl Builder { /// <p>The proposed trust policy for the IAM role.</p> pub fn trust_policy(mut self, input: impl Into<std::string::String>) -> Self { self.trust_policy = Some(input.in...
Rust
0
# Copyright 2021 The HuggingFace Team. 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 applicabl...
Python
1
#runas solve(1, 1000) #pythran export solve(int, int) #FIXME unittest.skip conflicting name for end def solve(start, end): ''' How many letters would be needed to write all the numbers in words from 1 to 1000? ''' words = [ ( 1, 'one' , '' ), ( 2, 'two' , '' ), ...
Python
1
############################################################################## # Python From Scratch # Author: Nilo Ney Coutinho Menezes # Editora Novatec (c) 2010-2025 - LogiKraft 2025 # Site: https://pythonfromscratch.com # ISBN: 978-85-7522-949-1 (Paperback), 978-85-7522-950-7 (hardcover), 978-85-7522-951-4 (ebook) ...
Python
1
ike output ports for example. buffer_input_driver = get_drivers(input_net)[0] _, bid_outputs = get_io(buffer_input_driver) (bid_iterm, _) = bid_outputs[0] bid_iterm.connect(output_net) print( f" * Connected buffer output({output_net.getConstNa...
Python
1
.upsample(p0_Concat_C2f) # (_, 640, 28, 28) p1_Concat = self.Concat([p1, x2]) # (_, 800, 28, 28) p1_Concat_C2f = self.C2f_4(p1_Concat) # (_, 320, 28, 28) # head2 # 对yolo的拓展,额外部分 p_add = self.upsample(p1_Concat_C2f) # (_, 320, 56, 56) p_add_Concat = self.Concat([p_add, x1]) ...
Python
1
, 2 => EPI_HB8CFG_WRWSR::EPI_HB8CFG_WRWS_6, 3 => EPI_HB8CFG_WRWSR::EPI_HB8CFG_WRWS_8, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `EPI_HB8CFG_WRWS_2`"] #[inline(always)] pub fn is_epi_hb8cfg_wrws_2(&self) -> bool { *self == EP...
Rust
0
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : 0_hello_world.py @Time : 2021-01-06 @Author : EvilRecluse @Contact : https://github.com/RecluseXU @Desc : zipfile是python官方用于对zip压缩文件文件进行操作的库 ''' # here put the import lib import zipfile zip_f = zipfile.ZipFile( # zip文件路径, 也可以传入ByteIO...
Python
1
import os import datetime import tensorflow as tf from skipThoughtVec.model import Model def main(): model = Model() inputs, decode_pre, decode_post = model.build() saver = tf.train.Saver() sess = tf.Session() sess.run(tf.global_variables_initializer()) step = 0 new_state = sess.run(inputs...
Python
1
" @GNUTLS_CERT_INVALID: The certificate is not signed by one of the"] #[doc = " known authorities or the signature is invalid (deprecated by the flags"] #[doc = " %GNUTLS_CERT_SIGNATURE_FAILURE and %GNUTLS_CERT_SIGNER_NOT_FOUND)."] #[doc = " @GNUTLS_CERT_SIGNATURE_FAILURE: The signature verification failed."] #[do...
Rust
0
self { Number::Hundred => 100, Number::Thousand => 1_000, Number::TenThousand => 10_000, Number::HundredThousand => 100_000, Number::Million => 1_000_000, Number::TenMillion => 10_000_000, Number::Other(x) => x, } } pu...
Rust
0
#!/usr/bin/env python """ Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org/) See the file 'LICENSE' for copying permission """ import re from lib.core.enums import PRIORITY __priority__ = PRIORITY.LOWEST def dependencies(): pass def tamper(payload, **kwargs): """ Replaces AND and OR logic...
Python
1
# Copyright 2020 The JAX Authors. # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
Python
1
(1,1,1,1) impl ToString for Color { fn to_string(&self) -> String { format!("{},{},{},{}", self.r.to_string(), self.g.to_string(), self.b.to_string(), self.a.to_string()) } } impl Into<[f32; 4]> for Color { fn into(self) -> [f32; 4] { [self.r.into(), self.g.into(), self.b.into(), self.a.int...
Rust
0
class Solution: def numberOfPatterns(self, m, n): q, pattern = [[c] for c in range(1, 10)], 0 while q: new = [] for arr in q: if m <= len(arr) <= n: pattern += 1 if len(arr) < n: last = arr[-1] ...
Python
1
nt_(m.bn2.weight, 0) def _make_layer(self, block, planes, num_blocks, stride): strides = [stride] + [1] * (num_blocks - 1) layers = [] for i in range(num_blocks): stride = strides[i] layers.append(block(self.in_planes, planes, stride)) self.in_planes = pl...
Python
1
.clone() .into_iter() .find(|x| format!("{}", x).contains("generic_arg")) .unwrap(); let generic_bound = public_api .into_iter() .find(|x| format!("{}", x).contains("generic_bound")) .unwrap(); assert_eq!(generic_arg.max(generic_bound.clone()), generic_...
Rust
0
) .add_attribute("sender", info.sender)) } pub fn execute_token_withdraw( deps: DepsMut, env: Env, info: MessageInfo, token: String, recipient: String, ) -> Result<Response, ContractError> { // authorized owner let cfg = CONFIG.load(deps.storage)?; if info.sender != cfg.owner { ...
Rust
0
image async def create_variation( self, image: ImageType, model: str = None, response_format: str = None, connector: BaseConnector = None, proxy: str = None, **kwargs ): provider = self.get_provider(model, provider) result = None ...
Python
1
features: `\"Win32_Media_Audio_XAudio2\"`*"] pub const FXEQ_DEFAULT_BANDWIDTH: f32 = 1f32; #[doc = "*Required features: `\"Win32_Media_Audio_XAudio2\"`*"] pub const FXEQ_DEFAULT_FREQUENCY_CENTER_0: f32 = 100f32; #[doc = "*Required features: `\"Win32_Media_Audio_XAudio2\"`*"] pub const FXEQ_DEFAULT_FREQUENCY_CENTER_1: ...
Rust
0
ent variable."] #[doc = " @return 0 in case of no packet being received (non-blocking), 1 in case of success, -1 in case of error."] pub fn pfring_recv( ring: *mut pfring, buffer: *mut *mut c_uchar, buffer_len: c_uint, hdr: *mut pfring_pkthdr, wait_for_incoming_packet: ui...
Rust
0
xt(text.password) st3 = panel.StaticText(text.eventPrefix) eg.EqualizeWidths((st1, st2, st3)) box1 = panel.BoxedGroup(text.tcpBox, (st1, portCtrl)) box2 = panel.BoxedGroup(text.securityBox, (st2, passwordCtrl)) box3 = panel.BoxedGroup( text.eventGenerationBox, (st3, e...
Python
1
return api_response( result=RealVipUserConfig.model_json_schema(), command=command_name, failed=False, ) @csrf_exempt @login_required() @require_http_methods(["GET"]) def describe_seed_vip_config(request): command_name = "describe_seed_vip_config" return api_response( res...
Python
1
is_empty()); Ok(()) } #[test] fn delete_nonexistent() -> Result<(), Box<dyn std::error::Error>> { let bucket = crate::read_test_bucket_sync(); let nonexistent_object = "test-delete-nonexistent"; let delete_result = Object::delete_sync(&bucket.n...
Rust
0
ika-deepam/15457/list/popular-clips/t-3_2_1272', 'only_matching': True, }] def _real_extract(self, url): id_ = self._match_id(url) return self.playlist_result( self._playlist_entries('tray/find', id_, query={'tas': 10000, 'uqId': id_}), id_) class HotStarSeasonIE(HotStarBa...
Python
1
f ddlZddlZddlmZejdddgZGddej ZGd d eZy) N)_BaseTestCaseContext_LoggingWatcherrecordsoutputc"eZdZdZdZdZdZy)_CapturingHandlerzM A log...
Python
1
i, I, E>) -> Option<T>] { #[inline] fn choice(self, r: &mut Reader<'i, I, E>) -> Option<T> { for branch in self { if let Some(value) = (branch)(r) { return Some(value); } } None } } impl<'i, T, I, E, const N: usize> Choices<'i, T, I, E> fo...
Rust
0
t(sofl) delayfl=input(f'{Cyan}Nhập delay follow: {Red}') checklike=input(f'{Cyan}Có làm nhiệm vụ {Red}like{Cyan} không (on/off): {Red}') if(checklike=='on'): solike=input(f'{Cyan}Nhập số like/1 acc: {Red}') solike=int(solike) delaylike=input(f'{Cyan}Nhap delay like: {Red}') chuyenacc=input(f'{Cyan}Nhập ...
Python
1
"avro")] impl TryFrom<avro_rs::types::Value> for EndTime { type Error = ValidationError; fn try_from(value: avro_rs::types::Value) -> Result<Self, Self::Error> { match value { avro_rs::types::Value::String(s) => DateTime::parse_from_rfc3339(&s) .map(|dt| EndTime(DateTime::<...
Rust
0
::{AccountIdLookup, BlakeTwo256, Block as BlockT, NumberFor}; use sp_runtime::transaction_validity::{TransactionSource, TransactionValidity}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, FixedPointNumber, Perbill, Perquintill, }; use sp_std::prelude::*; #[cfg(feature = ...
Rust
0
#!/user/bin/env python # -*- coding: utf-8 -*- import argparse from AccelBrainBeat.brainbeat.binaural_beat import BinauralBeat def main(params): brain_beat = BinauralBeat() brain_beat.play_beat( frequencys=(params["left"], params["right"]), play_time=params["time"], volume=params["volu...
Python
1
} } } Ok((PyBPEDecoder {}, BPEDecoder::new(suffix).into())) } } #[derive(Clone)] pub(crate) struct CustomDecoder { inner: PyObject, } impl CustomDecoder { pub(crate) fn new(inner: PyObject) -> PyResult<Self> { Ok(CustomDecoder { inner }) } } impl Decoder for...
Rust
0
.w.bits &= !(1 << 18); self.w.bits |= ((value as u32) & 1) << 18; self.w } } impl R { #[doc = r"Value of the register as raw bits"] #[inline(always)] pub fn bits(&self) -> u32 { self.bits } #[doc = "Bit 0 - Timestamp Enable"] #[inline(always)] pub fn emac_timstctr...
Rust
0
// get ready to go through from the object start (not mem_start) to the end let base = obj_dump.addr; let end = obj_dump.addr + obj_dump.size; assert!(base.is_aligned_to(POINTER_SIZE)); // offset as cursor let mut offset = 0; while offset < ob...
Rust
0
""" Write a python function which takes a list and returns a list with the same elements, but the k'th element removed. assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1] """ def remove_kth_element(list,k): return list[:k-1]+list[k:] print(remove_kth_element([1,1,2,3,4,4,5,1],3)) /python/python...
Python
1
fn volatile_store<T>(dst: *mut T, val: T); } /// Coerce an immutable reference to be mutable. #[inline(always)] pub unsafe fn transmute_mut<'a,T>(ptr: &'a T) -> &'a mut T { transmute(ptr) } pub fn swap<T>(x: &mut T, y: &mut T) { unsafe { let mut tmp: T = uninit(); copy_nonoverlapping_memory(&mut...
Rust
0
// did:example:123/path?service=agent&relativeRef=/credentials#degree let mut end_pos: usize = query.len(); end_pos = end_pos.min(query.find('?').unwrap_or(end_pos)); end_pos = end_pos.min(query.find('/').unwrap_or(end_pos)); end_pos = end_pos.min(query.find('#').unwrap_or(end_pos)); query.get(0...
Rust
0
_t, mut bp: *mut OPJ_BYTE, mut len: OPJ_UINT32, mut extra_writable_bytes: OPJ_UINT32, ) { opj_mqc_init_dec_common(mqc, bp, len, extra_writable_bytes); mqc.c = 0; mqc.ct = 0; } #[no_mangle] pub fn opq_mqc_finish_dec(mut mqc: &mut opj_mqc_t) { /* Restore the bytes overwritten by opj_mqc_init_dec_common() *...
Rust
0
gl_call!(gl.enable(Gl::CULL_FACE)); gl_call!(gl.cull_face(Gl::FRONT)); } CullMode::Back => { gl_call!(gl.enable(Gl::CULL_FACE)); gl_call!(gl.cull_face(Gl::BACK)); } } if let Some(state) = &pipeline.depth_stencil...
Rust
0
ints = "Please provide a brief, concise answer without any additional information." messages = [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": f"{question}\n{constraints}"} ] try: response = requests.post(self.API_U...
Python
1
#! /usr/bin/python3 """ This script is particularly intended for those adding new devices to LAVA and developing new jinja templates to create the per-device configuration in the Device Dictionary database table. In a production system, the devices directory will be stored in /etc/lava-server/dispatcher-config/device...
Python
1
from threading import Lock from .task_executor import TaskExecutor from .server import Server from .k8s import K8s class MasterExecutor(TaskExecutor): def load(self): self.lock = Lock() self.k8s = K8s() # Initialize capacities self.current_capacity = {"request": 0, "browser": 0, "t...
Python
1
__all__ = ["PubUtilsTests"] import unittest from dbacademy.dbbuild.publish import pub_utils class PubUtilsTests(unittest.TestCase): def test_parse_links(self): links = pub_utils.parse_html_links(""" # MAGIC %md --i18n-TBD # MAGIC # Bla bla bla""".strip()) self.assertEqual...
Python
1
import random import hashlib def hash_val(*args): data = "".join(map(str, args)).encode() return int(hashlib.sha256(data).hexdigest(), 16) def yak_key_exchange(p, g): print("===== YAK Key Exchange Protocol =====") print(f"Public parameters:\n Prime (p): {p}\n Generator (g): {g}\n") # Private ke...
Python
1
error::ListTapesError>, >, > + Unpin { aws_smithy_async::future::fn_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { crate::lens::lens_structure_crate_output_list_tapes_output_tape_infos(page) .unwrap_or_default() .into_iter() }) } } /...
Rust
0
y assigned /// to Workers because the Qualifications might be needed for active HITs. /// If there are any pending requests for the Qualification type, Amazon /// Mechanical Turk rejects those requests. After you delete a /// Qualification type, you can no longer use it to create HITs or HIT /// types.</p> /// <note> /...
Rust
0
en pcap path {:?}", pcap_path)); let bytes = pcap_reader .bytes() .map(|b| b.unwrap()) .collect::<std::vec::Vec<u8>>(); let (_, f) = CaptureFile::parse(&bytes).expect("Failed to parse"); assert_eq!(f.global_header.endianness, Endianness::Little); as...
Rust
0
fn namespace_variable() { assert_eq!( runner().err("@forward \"other\" with (a.$b: c);\n"), "Error: expected \"$\".\ \n ,\ \n1 | @forward \"other\" with (a.$b: c);\ \n | ^\ \n \'\ \n input.scss 1:24 root stylesh...
Rust
0
def get_dummy_components(self): torch.manual_seed(0) transformer = Transformer2DModel(sample_size=8, num_layers=2, patch_size=2, attention_head_dim=8, num_attention_heads=3, caption_channels=32, in_channels=4, cross_attention_dim=24, out_channels=8, attention_bias=True, activation_fn= ...
Python
1
TASK_LOGON_TYPE, ) -> HRESULT, fn get_GroupId( pGroup: *mut BSTR, ) -> HRESULT, fn put_GroupId( pGroup: BSTR, ) -> HRESULT, fn get_RunLevel( pRunLevel: *mut TASK_RUNLEVEL, ) -> HRESULT, fn put_RunLevel( pRunLevel: TASK_RUNLEVEL, ) -> HRESULT, }} ENUM!{...
Rust
0
# UVa 11450 - Wedding Shopping - Bottom Up (faster than Top Down) def main(): TC = int(input()) for tc in range(TC): MAX_gm = 30 # 20 garments at most and 20 models per garment at most MAX_M = 210 # maximum budget i...
Python
1
_inner(self)->K{ match self { MapKey::Value(v)=>v, _=>unreachable!("This is a BUG!!!!!!!!!!!!!!!!!!!!") } } #[inline] pub fn as_ref(&self)->&K{ match self { MapKey::Value(v)=>v, _=>unreachable!("This is a BUG!!!!!!!!!!!!!!!!!!!!") ...
Rust
0
r is not used normally as a fast path in mogrify uses NULL, but it makes easier to adapt composite types. """ def __init__(self, obj): pass def getquoted(self, _null=b"NULL"): return _null def make_dsn(dsn=None, **kwargs): """Convert a set of keywords into a connection strings."""...
Python
1
def isSame(datas): # 判断数据集是否属于同一类型 st = set() for x in datas: st.add(x["type"]) return len(st) == 1 def maxType(datas): # 选择这一数据集里类型最多的那个类型 cnt = {} for x in datas: if x["type"] not in cnt: cnt[x["type"]] = 0 cnt[x["type"]] += 1 lis = list(cnt.items()) ...
Python
1
下载按钮 img_bytes = io.BytesIO() result['edited_image'].save(img_bytes, format='PNG') img_bytes = img_bytes.getvalue() st.download_button( ...
Python
1
import logging from core.schemas.v1 import CaptionResponse, ClassifyResponse, SimilarImagesResponse from fastapi import APIRouter, status logger = logging.getLogger(__name__) router = APIRouter(tags=["Image endpoints"]) @router.post( "/similar-images", response_model=SimilarImagesResponse, status_code=...
Python
1
rue, help='禁用机器学习检测') @click.option('--stdin', is_flag=True, help='从标准输入读取') @click.option('--seed', type=int, help='随机种子') @click.option('--config', default='config.yml', help='配置文件路径') def analyze(file, tenant, window, mode, no_ml, stdin, seed, config): """分析日志文件或标准输入中的威胁""" # 设置随机种子 if seed is not N...
Python
1
//let (pk, sk) = nh.cpa_pke_gen(); //NewHope(_ cpa_pke_gen(); println!("{}", _newhope1024.finite_field().element(299)); let q = 12289; let n = 512; let one = finite_field::FiniteFieldElement::new(q, 1); let result = new_hope::ntt(finite_field::FiniteFieldPolynomial::new(q, vec![one, one, f...
Rust
0
(mp: *mut rte_mempool, opaque_arg: *mut ::std::os::raw::c_void); } extern "C" { #[doc = " Create a mbuf pool."] #[doc = ""] #[doc = " This function creates and initializes a packet mbuf pool. It is"] #[doc = " a wrapper to rte_mempool functions."] #[doc = ""] #[doc = " @param name"] #[doc = ...
Rust
0