text
string
label_name
string
labels
int64
let bytecode_compressed = if emit_bc_compressed { Some(outputs.temp_path(OutputType::Bitcode, Some(&self.name)) .with_extension(RLIB_BYTECODE_EXTENSION)) } else { None }; CompiledModule { llmod_id: self.llmod_id, name: self.n...
Rust
0
'static str> { // return any postgresql.conf settings that are required for your tests vec![] } } use std::time::Duration; use crate::core::element::Record; use crate::core::watermark::{Watermark, WatermarkGenerator}; use crate::utils::date_time::current_timestamp_millis; /// Determine whether to ...
Rust
0
_assert_query(updated, {"y": ["c"]}) def test_scopes_to_string(): cases = [ ("", ()), ("", []), ("", ("",)), ("", [""]), ("a", ("a",)), ("b", ["b"]), ("a b", ["a", "b"]), ("a b", ("a", "b")), ("a b", (s for s in ["a", "b"])), ] for e...
Python
1
debugList.push(Cmd::Allocate(self.cur_allocator_index, width as i32 , height as i32)); let allocation= atlas_allocator.allocate(guillotiere::Size::new(width as i32, height as i32)).unwrap(); let list = &mut self.all_allocator[target_type.0]; let index = list.list.insert(SingleAllocator { allocator:atlas_al...
Rust
0
''' 1 7 8 1 2 1 3 2 4 2 5 4 6 5 6 6 7 3 7 ''' def DFS(s, V): # s시작정점, V 정점개수(1번부터인 정점의 마지막 정점) visited = [0]*(V+1) # 빙문한 정점을 표시 stack = [] # 스택생성 print(s) visited[s] = 1 # 시작정점 방문표시 v = s while True: for w in adjL[v]: # v에 인접하고, 방문 안 한 w가 있으면 ...
Python
1
from tkinter import * import random attempts = 10 answer = random.randint(1, 99) def check_answer(): global attempts try: attempts -= 1 guess = int(entry_window.get()) if answer == guess: text.set("Congratulations! YOU WON!") btn_check.pack...
Python
1
Schema>, agent_pool: AgentPool, msg_pool: MessagePool, } struct RunnerImpl<'m> { embedded: Embedded<'m>, this: mv8::Value<'m>, sims_state: HashMap<SimulationShortId, SimState>, } // we pass in _mv8 for the return values lifetime fn sim_id_to_js(_mv8: &MiniV8, sim_run_id: SimulationShortId) -> mv8:...
Rust
0
lCheck: typing.Optional[str] = None, style: typing.Optional[typing.Any] = None, tabIndex: typing.Optional[typing.Union[str, NumberType]] = None, title: typing.Optional[str] = None, **kwargs ): self._prop_names = [ "children", "id", "accessK...
Python
1
launch the child and return the PID, rather than waiting for it to perform all the necessary /// modifications and call `execve()`. /// /// If `envp` is NULL, the environment of the parent process is left unchanged. /// /// # Safety /// /// 1. `argv` (and `envp`, if it is not NULL) must be a valid pointer to a NULL-ter...
Rust
0
import requests key = '70b36ebfd410582cc400eeeb0f832218' params = { 'access_key': key } api_result = requests.get('https://api.aviationstack.com/v1/flights', params) api_response = api_result.json() #print(api_response) for flight in api_response['data']: #if (flight['live'].keys() #if (flight['live']['is...
Python
1
ermissions.manage_guild: return True if vc.dj_role: if vc.dj_role in ctx.author.roles: return True raise commands.CheckFailure( f"You need to have {vc.dj_role.mention} role or have `Manage Server` permissions to do this." ) ...
Python
1
Dialect::Build } else { Dialect::Bzl }; for i in matches.free.into_iter() { eval_file(&i, dialect, &mut global.child(&i)); } if opt_repl { println!("Welcome to St...
Rust
0
est_database) cursor = connection.cursor() try: orders = cursor.execute('SELECT `bike_id`, `status`, `name`, `surname`, `phone_number` FROM shop_order').fetchall() return orders except sqlite3.DatabaseError as err: return CheckResult.wrong(str(err)) def c...
Python
1
name: Pat::Ident(BindingIdent::from(assign.key.clone())), init: if let Some(init) = self.replace(&assign.key.sym, false) { Some(Box::new(init)) } else { assign.value.clone().fold_with(self) }, definite: false...
Rust
0
from __future__ import annotations from collections.abc import Iterable, Iterator from functools import lru_cache from typing import TYPE_CHECKING, Callable, TypeVar, Union, overload import jaraco.text as text from packaging.requirements import Requirement if TYPE_CHECKING: from typing_extensions import TypeAlia...
Python
1
import random import string pass_len = 12 charValues = string.ascii_letters + string.digits + string.punctuation print(random.choice(charValues)) password = "" for i in range(pass_len): password += random.choice(charValues) print("your random password is : ", password)
Python
1
] impl<T: Config> ValidateUnsigned for Pallet<T> { type Call = Call<T>; fn validate_unsigned(_source: TransactionSource, call: &Self::Call) -> TransactionValidity { match call { Call::liquidate(currency_id, who) => { let account = T::Lookup::lookup(who.clone())?; let Position { collateral, debit ...
Rust
0
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( arr , n ) : found = True for i in range ( 0 , n - 2 ) : for j in range ( i + 1 , n - 1 ) : ...
Python
1
assert_eq!( read_array(&cbor_bool!(true)), Err(CTAP2_ERR_CBOR_UNEXPECTED_TYPE) ); assert_eq!( read_array(&cbor_text!("foo")), Err(CTAP2_ERR_CBOR_UNEXPECTED_TYPE) ); assert_eq!( read_array(&cbor_bytes_lit!(b"bar")), ...
Rust
0
tress_level'), 'dominant_emotion': context.get('dominant_emotion') } except Exception as e: print(f"[EMOTION] Error getting emotion snapshot: {e}") return None def _has_emotion_state_changed(self): """Check if emotional state has significantly...
Python
1
RAL", "O3", "Opl1", "Opl2", "ORDINAL", "Osg1", "Osg2", "PE4", "PERSONAL", "PL1", "PL2", "PL3", "Ppe4", "Ppl1", "Ppl2", "Ppl3", "PREPOSITION", "PRONOUN", "PROPER", "Psg1", "Psg2", "Psg3", "PUNCTUATION", "Qhan", "Qkaan", "...
Python
1
import pandas as pd import numpy as np input_csv_filename = r"Project Files/Web_Scraped_Data/" + "jobbank_2023-11-22.csv" df = pd.read_csv(input_csv_filename) # 1. Clean "Job Title" column df["Job Title"] = df["Job Title"].str.replace("developer, software", "software developer") df["Job Title"] = df["Job Title"].str....
Python
1
!("Error {}, unable to parse acls {}", e, String::from_utf8_lossy(&acls)); return Err(ForkliftError::FSError(err)); } }; match acl_list { SmbcXAttrValue::AclAll(s_acls) => Ok(s_acls), _ => Ok(vec![]), } } /// change the destination linux stat mode to that of the source f...
Rust
0
""" Example sentences to test spaCy and its language models. >>> from spacy.lang.hu.examples import sentences >>> docs = nlp.pipe(sentences) """ sentences = [ "Az Apple egy brit startup vásárlását tervezi 1 milliárd dollár értékben.", "San Francisco vezetése mérlegeli a járdát használó szállító robotok betil...
Python
1
text' in survey: # Typical error text; pass it along raise exceptions.ParseError(detail=survey['text']) else: # Something odd; hopefully it can be coerced into a string raise exceptions.ParseError(detail=survey) # Le...
Python
1
return core_object.get_object_name() return '' def dumps(self) -> bytes: """バイトデータにシリアライズ モデルのデータをシリアライズして保存するためのバイト配列を生成 Returns: data (bytes): Serialize data """ core_model = self.get_core() if core_model is not None: ...
Python
1
ze) else: img_normal = img face_img = face_detector.face_detect(img_normal) if face_img is None: print("if face_img is None:") continue # 获取存储路径 frame_dir_split = frame_dir.split(...
Python
1
rost(message, optional, tag = "10")] pub next_execute_time: ::core::option::Option<::prost_types::Timestamp>, /// Configurations for this recurring schedule. /// Configurations must match frequency. #[prost(oneof = "recurring_schedule::ScheduleConfig", tags = "6, 7")] pub schedule_config: ::core::op...
Rust
0
U pub ciphertext: Vec<u8>, // V #[serde(with = "ark_serde")] pub auth_tag: G2<P>, // W } #[derive(Serialize, Deserialize, Clone, Debug)] pub struct DecryptionShare<P: ThresholdEncryptionParameters> { pub decryptor_index: usize, // i #[serde(with = "ark_serde")] pub decryption_share: G1<P>, // U...
Rust
0
entials::default() .token_info(token_info) .build(); Spotify::default() .client_credentials_manager(client_credential) .build() } fn auth_manager(cookies: Cookies) -> SpotifyOAuth { // Please notice that protocol of redirect_uri, make sure it's http(or https). It will fail if yo...
Rust
0
'M', 0, 0] /// | +- 1 → [b'M', 0, 1] /// | +- ... /// | +- <msg_count> → [b'M', 0, <msg_count>] /// +- 1 /// | +- header → [b'H', 1] /// | +- messages /// | +- 0 → [b'M', 1, 0] /// | +- ... /// +- ... /// | /// `- <stream_count> /// +- header → [b'H', <stream...
Rust
0
iness day as /// defined by F if it does not already satisfy it. Then advances by the /// given number of business days which may be negative. pub fn add_business_days_rounding_backward<F>(self, days: i64, is_business_day: F) -> Self where F: Fn(Self) -> bool, { self.round_backward_...
Rust
0
ast_selected, closest_dists) # (P - i) # The aim is to pick the point that has the largest # nearest neighbour distance to any of the already selected points selected_idx = torch.argmax(closest_dists) sample_idx_batch[i] = selected_idx # Add the list of points ...
Python
1
import json import pytest from pysondb.db import PysonDB TEST_DATA = { 'version': 2, 'keys': [ 'age', 'name', 'place' ], 'data': { '219520953066905460': { 'name': 'ad0', 'age': 0, 'place': 'US' }, '110180374400879352...
Python
1
bs58::decode(encoded_str).into_vec()? } Self::Json => { return Err(LandslideError::Encoding(anyhow!( "JSON decoding is not yet supported (neither in upstream Avalanche)" ))) } }; log::trace!("Decoded...
Rust
0
raise except (EOFError, BrokenPipeError) as e: raise ConnectionError(str(e)) from e except (OSError) as e: if "Bad file descriptor" in str(e): raise ConnectionError(str(e)) from e raise def get_allocator(self, channel=0): retu...
Python
1
fn alloc_value(self, heap: &'v Heap) -> Value<'v> { heap.alloc_mutable(List { content: self.into_map(|x| x.alloc_value(heap)), }) } } impl<'v, T: AllocFrozenValue<'v>> AllocFrozenValue<'v> for Vec<T> { fn alloc_frozen_value(self, heap: &'v FrozenHeap) -> FrozenValue { he...
Rust
0
] elif self.mode == "save": cmdline += [ "--getsavefilename", (self.path if self.path else os.path.expanduser("~")), " ".join(filt) ] else: cmdline += [ "--getopenfilename", (s...
Python
1
import numpy as np arr1 = np.arange(1, 17).reshape(4, 4) arr2 = np.arange(17, 33).reshape((4, 4)) print(arr1) print(arr2) # ------------------------------- Concatenate ----------------------- # Concat two 2d matrix # list1 = [2,4,6,8] # list2 = [10,12,14,16] # This method is not work in concatenation, if I write a...
Python
1
, ratio, ppl in sorted_sensitive_list[mid:]: layers_min_ratio[layername] = min(layers_min_ratio[layername], ratio) for layername, ratio in tqdm(layers_min_ratio.items()): # set ratio raw_linear = module_dict[layername] info = linear_info[raw_linear] svd_linear = GradSVDLinear...
Python
1
pv_eva = 0.0 for t in range(N): roic_t = max(0.02, roic_path[t]) eva_t = (roic_t - WACC) * IC_prev pv_eva += eva_t / ((1.0 + WACC) ** (t + 1)) # grow invested capital g_it = g_cap[t] IC_prev = IC_prev * (1.0 + g_it) if IC_...
Python
1
}, } } } #[derive(Debug, FromForm)] struct Crc64Options { polynomial: Crc64Polynomial, } #[post("/crc64?<options..>", data = "<payload>")] fn crc64(payload: Vec<u8>, options: Option<Form<Crc64Options>>) -> String { let checksum = if let Some(choice) = options { let polynomial = match c...
Rust
0
) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); self.w } } #[doc = "Reader of field `AXI_ERROR_ID`"] pub type AXI_ERROR_ID_R = crate::R<u8, u8>; #[doc = "Reader of field `LUT_DMA_LOAD_DONE_IRQ`"] pub type LUT_DMA_LOAD_DONE_IRQ_R = crate::R<bool, bool>; #...
Rust
0
', b'i', b'j', b'k', b'l', b'm', b'n', b'o', b'p', b'q', b'r', b's', b't', b'u', b'v', b'w', b'x', b'y', b'z', ]; pub const ASCII_LETTERS_STR: [&str; 52] = [ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", ...
Rust
0
from setuptools import setup, find_packages try: __version__ = open("EMpy/version.py").read().split('"')[1] except ImportError: __version__ = "" __author__ = "Lorenzo Bolla" with open("README.rst", "r") as readme: long_description = readme.read() setup( name="ElectroMagneticPython", version=__ve...
Python
1
bytes: Bytes = "-strin".into(); decode_and_verify_some(&bytes, &expected); decode_and_verify_padded_some(&bytes, &expected); } #[test] fn should_decode_boolean_true() { let expected = ( Some(Frame::Boolean { data: true, attributes: None, }), 4, ); let bytes...
Rust
0
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models from odoo.osv import expression class ProductReplenishMixin(models.AbstractModel): _inherit = 'stock.replenish.mixin' def _get_allowed_route_domain(self): domains = super()._get_allowed_route_domain() ...
Python
1
let (device, queue) = adapter .request_device( &wgpu::DeviceDescriptor { label: None, features: wgpu::Features::empty(), limits: wgpu::Limits::default(), }, None, // Trace path ) ...
Rust
0
st] fn simple_bool() { for o in vec![AND, OR, XOR] { let t = term![o.clone(); term![o.clone(); bool(true), bool(false)], bool(true)]; let tt = term![o.clone(); bool(true), bool(false), bool(true)]; assert_eq!(flatten_nary_ops(t), tt); } } #[test] fn s...
Rust
0
Unpacked {x: 432, y: 321, z: 210, w: 109}, d: -98} // gdb-command:print sizeof(packed) // gdb-check:$5 = 14 // gdb-command:print sizeof(packedInPacked) // gdb-check:$6 = 40 // === LLDB TESTS ================================================================================== // lldb-command:run // lldb-command:prin...
Rust
0
.allocate_memory(&index_allocate_info, None) .unwrap(); let index_ptr = base .device .map_memory( index_buffer_memory, 0, index_buffer_memory_req.size, vk::MemoryMapFlags::empty(), ).unwr...
Rust
0
StagMinus = zStagMinus, StagPlus = zStagPlus, dMinus = dzMinus, dPlus = dzPlus) elif config["Grid"]["GridInput"]["type"] == "FromFile": assert config["Grid"]["GridInput"]["gridDir"], "gridDir has to be spec...
Python
1
pos2(left, from_content(state.offset.y)), pos2(right, from_content(state.offset.y + inner_rect.height())), ); let min_handle_height = (2.0 * corner_radius).max(8.0); if handle_rect.size().y < min_handle_height { handle_rect = Rect::from_c...
Rust
0
# -*- coding: utf-8 -*- # """*********************************************************************************************""" # FileName [ upstream/vggish/hubconf.py ] # Synopsis [ the VGGish torch hubconf ] # Author [ S3PRL ] # Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ] """************...
Python
1
235, 51, 165, 255, 186, 134, 6, 104, 146, 67, 255, 34, 1, 238, 58, 246, 188, 132, 224, 0, 106, 173, 64, 1, 245, 102, 74, 76, ], ]); let chk_files = files.with_checksums(&crc); let mut crc_naive = CRC::<u128>::with_options(); crc_naive.width(128...
Rust
0
else { if i == ')' { -1 } else { 0 } }; squote = if i == '\'' { !squote } else { squote }; dquote = if i == '\'' { !dquote } else { dquote }; tokens[-1] += i; } if (squote || dquote) { return Err("unmatched quotations") } if (parens) { return Err("...
Rust
0
#!/usr/bin/evn python #-*-:coding:utf-8 -*- #Author:wonderkun #Name:1039 家校通 /admin/Product/ProductList.aspx post SQL注入 #Refer:http://www.wooyun.org/bugs/wooyun-2010-0125318 #Data:2016/2/20 import time import re ''' /admin/Product/ProductList.aspx post SQL注入 soso 参数 ''' def assign(service,arg): if service=="1...
Python
1
::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [ssifssin_ssi1](ssifssin_ssi1) module"] pub type ...
Rust
0
variable /// message size. For the VhostUserConfig, a maximum size of 4K is enough because the user /// configuration space for virtio devices is (4K - 0x100) bytes at most. For the VhostUserMemory, /// 4K should be enough too because it can support 255 memory regions at most. pub const MAX_MSG_SIZE: usize = 0x1000; ...
Rust
0
Index); let source = config.release_source(); info!( source = Into::<&'static str>::into(source), "fetching index" ); let index = match config.release_source() { ReleaseSource::RustChangelog => { RustChangelog::fetch_channel(Channel::Stable)?.build_index()? ...
Rust
0
`/v4/spreadsheets/{spreadsheetId}` endpoint. * * Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. By default, data within grids will not be returned. You can include grid data one of two ways: * Specify a field mask listing your desired fields using the `fields` URL parame...
Rust
0
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------- from olive.common.utils import StrEnumBase class ExecutionProvider(Str...
Python
1
import numpy as np from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score, classification_report from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn.ensemble import RandomForestClassifier from imblearn.over_sampling import SMOTE fr...
Python
1
from rdkit import Chem from rdkit.Chem import Draw import pandas as pd import os def draw_molecule(smiles, filename): mol = Chem.MolFromSmiles(smiles) if mol is not None: img = Draw.MolToImage(mol, size=(300, 300)) img.save(filename) else: print("Invalid SMILES string:", smiles) ...
Python
1
queue.pop_n(params.number_of_entries_to_consume); let mut event_queue_data: &mut [u8] = &mut accounts.event_queue.data.borrow_mut(); event_queue.header.serialize(&mut event_queue_data).unwrap(); msg!( "Number of events consumed: {:?}", capped_number_of_entries_consumed ); Ok(()) } ...
Rust
0
Key}; pub fn build_tezos_base58_private_key(sk: &str) -> Result<String> { //tezos private key prefix let edsk_prefix: [u8; 4] = [43, 246, 78, 7]; //prefix + public key + public key let mut prefixed_sec_key_vec = vec![]; prefixed_sec_key_vec.extend(&edsk_prefix); let ed25519_private_key = ...
Rust
0
off_t, pub st_blksize: blksize_t, pub st_blocks: blkcnt_t, pub st_atim: timespec, pub st_mtim: timespec, pub st_ctim: timespec, pub __rd_unused: [syscall_slong_t; 3], } #[repr(C)] #[derive(Copy, Clone, Default)] pub struct user_regs_struct { pub ...
Rust
0
# nzrmohammad/vpanel-manager/VPanel-Manager-d7e402c07646dd8f8f10f027f7b8a5c1c0a6f8fb/webapp/user_service.py from markupsafe import escape from datetime import datetime, timedelta import pytz from bot.database import db from bot.combined_handler import get_combined_user_info from bot.utils import to_shamsi, days_until_...
Python
1
import json import pytest from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import rsa from cryptography import x509 from swarmauri_certs_self_signed import SelfSignedCertificate from swarmauri_core.crypto.types import ExportPolicy, KeyRef, KeyType, KeyUse @pyte...
Python
1
ate::msg::HandleMsg; use crate::state::{Balances}; pub fn handle<S: Storage, A: Api, Q: Querier>( deps: &mut Extern<S, A, Q>, env: Env, msg: HandleMsg, ) -> StdResult<HandleResponse> { match msg { HandleMsg::Deposit {amount} => try_deposit(deps, env, amount), _ => panic!("not supported ...
Rust
0
Script, ToCKBCellData}; use crate::toCKB_typescript::utils::{ config::*, types::{Error, ToCKBStatus}, }; use crate::*; use ckb_testtool::{builtin::ALWAYS_SUCCESS, context::Context}; use ckb_tool::ckb_types::{ bytes::Bytes, core::{TransactionBuilder, TransactionView}, packed::*, prelude::*, }; u...
Rust
0
import binascii from cryptography.hazmat.backends.openssl.backend import backend from cryptography.hazmat.primitives.ciphers import algorithms, base, modes def encrypt(mode, key, iv, plaintext): cipher = base.Cipher( algorithms.IDEA(binascii.unhexlify(key)), mode(binascii.unhexlify(iv)), ...
Python
1
0_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36", "Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; MAARJS; rv:11.0) like Gecko", "Mozilla/5.0 (Linux; Android 5.0; SAMSUNG SM-N900T Build/LRX21V) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.1 Chrome/34.0.1847.76 Mob...
Python
1
self, ctx: commands.Context, *, device_name: Optional[str] = None, ): raise NotImplementedError() @abstractmethod async def spotify_device_default( self, ctx: commands.Context, *, device_name: Optional[str] = None, ): raise NotI...
Python
1
false } RccError::Parse(s) => { if let RccError::Parse(o) = other { return s == o; } false } RccError::ParseInt(p) => { if let RccError::ParseInt(o) = other { ...
Rust
0
"ko-kr" => Ok(Cultures::KoKr), "lv-lv" => Ok(Cultures::LvLv), "lt-lt" => Ok(Cultures::LtLt), "nb-no" => Ok(Cultures::NbNo), "pl-pl" => Ok(Cultures::PlPl), "pt-br" => Ok(Cultures::PtBr), "pt-pt" => Ok(Cultures::PtPt), "ro-ro"...
Rust
0
t_size) } /// Sends a `QueryBestSize` request (unchecked). /// /// This request generates a reply. You must either discard it with /// [`discard_reply`] or retrieve it with [`xcb_query_best_size_reply`]. /// /// [`discard_reply`]: crate::Xcb::xcb_discard_reply /// [`xcb_query_best_size_...
Rust
0
).unsqueeze(-1) output = torch.zeros_like(x[:, :, 0]) output.scatter_(-1, idx, 1) x[:, :, 0] = output i_, j_ = x.shape[:2] for i in range(i_): for j in range(j_): if x[i][j][0][0] == 1: x[i][j][1] = torch.zeros_like(x[i][j][1]) ...
Python
1
àn"), ('𥤷', "yín"), ('𥤸', "wán"), ('𥤹', "yào,yǎo"), ('𥤺', "wā"), ('𥤻', "pí"), ('𥤼', "suì"), ('𥥅', "kǒng"), ('𥥈', "hóng,wòng"), ('𥥊', "mǐng"), ('𥥋', "líng"), ('𥥌', "yì,dié"), ('𥥍', "shēn,shèn"), ('𥥏', "zuò"), ('𥥛', "tū,bá"), ('𥥝', "yòng"), ('...
Rust
0
rrange(grid, 'n b c h w -> (n b) c h w') grid = make_grid(grid, nrow=n_rows) # to image grid = 255. * rearrange(grid, 'c h w -> h w c').cpu().numpy() img = Image.fromarray(grid.astype(np.uint8)) samp...
Python
1
"""Represents a feature discovery disclosure message.""" from typing import Mapping, Sequence from marshmallow import EXCLUDE, Schema, fields from .....messaging.agent_message import AgentMessage, AgentMessageSchema from ..message_types import DISCLOSE, PROTOCOL_PACKAGE HANDLER_CLASS = f"{PROTOCOL_PACKAGE}.handlers...
Python
1
print("Завдання 1. Введіть два інтових і два флоат числа:") a = int(input()) b = int(input()) c = float(input()) d = float(input()) print("\nЗавдання 2.") results = [a + b, a - b, a * b] if b != 0: results.append(a / b) else: results.append("Ділення на нуль!") # піднесення до степеня results.append(a ** b) ...
Python
1
// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_a"]' 'pub fn foo_a(&self)' // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_b"]' 'pub fn foo_b(&self)' // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_c"]' 'pub fn foo_c(&self)' // @has '-' '//*[@class="impl-items"]//*[@id="method.foo_j"]' 'pub ...
Rust
0
hould represent a safe batch size /// optimized for performance. /// `BatchHasher` users are responsible for not attempting to hash batches larger than the advised maximum. fn max_batch_size(&self) -> usize { 700000 } } pub fn round_numbers(arity: usize) -> (usize, usize) { let width = arit...
Rust
0
ee (tree level, counting from root=0). pub const C: usize = 7; type SecKey = [u8; N]; type PubKey = [u8; (1 << S) * N + N]; /// SD-MSS-WOTS Keypair // TODO save some space here #[derive(Debug, Clone, PartialEq, PartialOrd, Hash, Default)] pub struct Keypair { sk_seed: SecKey, pub shallow: UpdatableMerkleKeypa...
Rust
0
)</div>' html_output += f'<div style="font-size: 0.9em; margin-top: 5px;">Penalty applied: {penalty*100:.1f}%</div>' else: html_output += f'<div class="check-success">✓ Answer length is good ({len(answer_text)} characters)</div>...
Python
1
import os import time from .base import EmbedModelProvider,ChatModelProvider from latentscope.util import get_key # TODO verify these tokenizers somehow # derived from: # https://docs.mistral.ai/platform/endpoints/ # https://huggingface.co/docs/transformers/main/en/model_doc/mixtral encoders = { "mistral-tiny...
Python
1
from rplidar import RPLidar from timeit import default_timer as timer import gpiozero import sys # import controller import time lidar = RPLidar('/dev/ttyUSB0', timeout=3) lidar.stop() lidar.stop_motor() info = lidar.get_info() print(info) health = lidar.get_health() print(health) def detect(angle:float, distan...
Python
1
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Copyright © 2019 hzshang <hzshang15@gmail.com> from pwn import * from pwnlib.util.iters import bruteforce import hashlib def hash(x): return hashlib.sha256(x).hexdigest() #libc=ELF("./libc.so.6") elf = ELF("./xx_warm_up") libc = ELF("./bc.so.6") #heap_add=0 #sta...
Python
1
from Script.UI.Moudle import draw from Script.Core import ( cache_control, game_path_config, game_type, constant, ) from Script.Config import game_config, normal_config from Script.Design import handle_premise game_path = game_path_config.game_path cache: game_type.Cache = cache_control.cache """ 游戏缓存数...
Python
1
metrics[k] res_single[k] = metric(preds=preds_single, target=labels.int()) res_dict = {"num_teacher": 1, "res_avg": res_single} results.append(res_dict) print("computed single teacher", flush=True) #For each teacher-combination compute performances teacher_to_test = [2,4,8,16] for i in ...
Python
1
def first_fit(blocks, processes): allocation = [-1] * len(processes) # To store block assigned to each process for i in range(len(processes)): for j in range(len(blocks)): if blocks[j] >= processes[i]: # Block can accommodate process allocation[i] = j # Allocate block j t...
Python
1
d-Entity-Recognition (NER) tasks. """, CAMEMBERT_START_DOCSTRING, ) class TFCamembertForTokenClassification(TFRobertaForTokenClassification): """ This class overrides :class:`~transformers.TFRobertaForTokenClassification`. Please check the superclass for the appropriate documentation alongside usage exa...
Python
1
channel_packages::package_id.eq(any(package_ids))), ) .execute(conn) } } #[derive(DbEnum, Debug, Clone, Serialize, Deserialize)] pub enum PackageChannelTrigger { Unknown, BuilderUi, HabClient, } impl From<JobGroupTrigger> for PackageChannelTrigger { fn from(value: JobGroupTrigger) ...
Rust
0
Spectrogram sample_rate = 1 / spectrogram.window_step # determine the start and end times of each clip to analyze clip_df = generate_clip_times_df( full_duration=spectrogram.duration, clip_duration=clip_duration, clip_overlap=clip_overlap, clip_overlap_fraction=clip_overlap_...
Python
1
} // Fix incomplete Eq trait for RGN_CHN_ATTR_S. #[cfg(feature = "mpi-region")] impl std::cmp::Eq for RGN_CHN_ATTR_S {} #[cfg(feature = "mpi-sys")] impl_as_bundle_many!( // GPS_INFO_S, // MPP_BIND_DEST_S, MPP_CHN_S, // MPP_SYS_CONFIG_S, MPP_VERSION_S, // SCALE_COEFF_LEVEL_S, // SYS_VIRMEM...
Rust
0
agement}; mod runtime_pm; pub use scsi_host::ScsiHost; mod scsi_host; <gh_stars>0 // Copyright (c) 2018 Intel Corporation. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. extern crate libzfs_sys as sys; use std::ptr; use nvpair; use zfs::Zf...
Rust
0
leaving the network. mdns.release() .expect("Fail to release ourselves from the network."); } fn main() { discover_neighbourhood(); } //! Rotates & Shifts use jeebie::core::cpu::CPU; use jeebie::core::registers::Register8::*; use jeebie::core::registers::Register16::*; // 'RLCA' 07 4 pub fn RLCA(cpu:...
Rust
0
() { let route = Route::from("/context/function/input/1"); assert!(route .sub_route_of(&Route::from("/context/function")) .is_some()) } #[test] fn extend_empty_route() { let mut route = Route::default(); route.extend(&Route::from("sub")); ass...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2023 Google LLC. 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 requir...
Python
1