text
string
label_name
string
labels
int64
_ref() .ok_or_else(|| from_display("Not a gatekeeper"))?; let pubkey: WorkerPublicKey = request .public_key .as_slice() .try_into() .map_err(|_| from_display("Bad public key"))?; let state = gk .worker_state(&pubkey) .ok...
Rust
0
#Instructions '''You are going to write a virtual coin toss program. It will randomly tell the user "Heads" or "Tails". Important, the first letter should be capitalised and spelt exactly like in the example e.g. "Heads", not "heads". There are many ways of doing this. But to practice what we learnt in the last less...
Python
1
test!(b"\x1B[6n" => CSI::DeviceStatusReport(CSI::Report::CursorPosition)); } #[test] fn dta() { test!(b"\x1B[ T" => CSI::DimensionTextArea(0, 0)); test!(b"\x1B[1 T" => CSI::DimensionTextArea(1, 0)); test!(b"\x1B[;1 T" => CSI::DimensionTextArea(0, 1)); test!(b"\x1B[1;1 T" => C...
Rust
0
from PIL import Image import numpy as np import torch from .view_base import BaseView class SkewView(BaseView): def __init__(self, skew_factor=1.5): self.skew_factor = skew_factor def skew_image(self, im, skew_factor): ''' Roll each column of the image by increasing displacements. ...
Python
1
rlAltDel => vmm.send_ctrl_alt_del().map(|_| api_server::VmmData::Empty), SetVmConfiguration(machine_config_body) => vmm .set_vm_configuration(machine_config_body) .map(|_| api_server::VmmData::Empty), UpdateBlockDevicePath(drive_id, path_on_host) =...
Rust
0
tText(q.right_answer) # - отображение формы вопроса show_question() def check_answer(): if answers[0].isChecked(): ''' если выбран переключатель answers[0], то вызывать функцию show_correct с аргументом «Правильно» ''' window.score += 1 print('Статистика\...
Python
1
DataType::INT64 => 2, DataType::FLOAT => 3, DataType::DOUBLE => 4, DataType::TEXT => 5, } } } /// IotDB encoding enum #[derive(Copy, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] pub enum Encoding { PLAIN, PlainDictionary, RLE, DIFF, Ts2diff, ...
Rust
0
_instanced( &mut self, mesh: &'b Mesh, instances: Range<u32>, uniforms: &'b wgpu::BindGroup, light: &'b wgpu::BindGroup, ) { self.set_vertex_buffer(0, mesh.vertex_buffer.slice(..)); self.set_index_buffer(mesh.index_buffer.slice(..), wgpu::IndexFormat::Uint32);...
Rust
0
r14(&mut self) -> DIR14_W { DIR14_W { w: self } } #[doc = "Bit 15 - Port Data Direction 15"] #[inline(always)] pub fn dir15(&mut self) -> DIR15_W { DIR15_W { w: self } } #[doc = "Bit 16 - Port Data Direction 16"] #[inline(always)] pub fn dir16(&mut self) -> DIR16_W { ...
Rust
0
from pathlib import Path import pytest from formula1_race_analysis import build_q1_report from formula1_race_analysis.display import SortStrategy, display_race_report, filter_report, sort_report class TestDisplayRaceReport: def test_display_race_report_in_ascending_order( self, prepare_correct_d...
Python
1
::default() .set_rest_api_endpoint(mockito::server_url()) .set_recv_window(1234); let account: Account = Binance::new_with_config(None, None, &config); let _ = env_logger::try_init(); account.test_market_sell_using_quote_quantity("BNBBTC", 0.002).unwrap(); ...
Rust
0
ort") +takes_value default_value("9000") "Port of directory service") (@arg runs: -r --runs +takes_value default_value("3") "How many epochs to run") (@arg certPath: -c --("directory-certificate") +takes_value "Path to directory server certificate (only necessary if trust is not anchored in system") ...
Rust
0
def feed_forward_chunk_query(self, attention_output): intermediate_output = self.intermediate_query(attention_output) layer_output = self.output_query(intermediate_output, attention_output) return layer_output
Python
1
fn write(&mut self, buf: &[u8]) -> io::Result<usize> { self.write_all(buf)?; Ok(buf.len()) } fn write_all(&mut self, buf: &[u8]) -> io::Result<()> { self.pos += buf.len() as u64; self.w.write_all(buf) } fn flush(&mut self) -> io::Result<()> { self.w.flush() } } /// Encode the command `cmd` (...
Rust
0
Some(index) } pub fn remove(&mut self, key: usize) { for (index, key_) in self.keys.iter().enumerate() { if *key_ == key { self.keys.remove(index); break; } } let value = self.tx_map.remove(&key); if value.is_some() { ...
Rust
0
BillingInfo { pub client_id: i32, pub phone_number: Option<String>, pub card_info: Option<i32> } #[derive(Queryable, Serialize)] pub struct BillingInfo { pub client_id: i32, pub phone_number: Option<String>, pub card_info: Option<i32>, } #[derive(Insertable, Deserialize)] #[table_name = "card_...
Rust
0
ngify!(pcap_samp), "::", stringify!(value) ) ); } extern "C" { pub fn pcap_setsampling(p: *mut pcap_t) -> *mut pcap_samp; } extern "C" { pub fn pcap_remoteact_accept( address: *const libc::c_char, port: *const libc::c_char, hostlist: *const libc::c_cha...
Rust
0
")] pub port: String, #[serde(default = "default_pool_size")] pub pool_size: u32, } impl Database { pub fn startup_parameters(&self) -> BTreeMap<String, String> { let mut params = BTreeMap::new(); params.insert("database".into(), self.dbname.clone()); params.insert("user".into(...
Rust
0
xbc\x17D\ \xb7Q\x0a\x00i\xc6\xb7(\x00H\xc4\xa1\xff:\x99\xa0\ \xe3\x1cIgP\x11\x94\x8a9\xf2b\xfe+z\xef\xa8\ 7\xe7\x7fg\x02\x11\x82\x90\xc2\x9b\x1b\x5c\xcc\x1e\x1f\x91\ tl\xf7E\x83\x9f\xe3\xbaU\x94\xda\x93\x92n\x94\x09\ 6\xee\xa7\x1c\x00@\xc0\x01\x00\xc7\x89C\xff\x0c\x99[\ W\xce\x91\xf4\x1bT\x04\xe5l\xf68\x8c\xa4\xe4(\x8c...
Python
1
from talon import Context, Module, actions mod = Module() apps = mod.apps apps.discord = "app.bundle: com.hnc.Discord" apps.discord = "app.name: Discord" apps.discord = "app.name: Discord.exe" apps.discord = """ tag: browser browser.host: discord.com """ mod.list("discord_destination", desc="discord destination") ct...
Python
1
wtlp33qfs0 as ddeadbjnbhl '# kites_gallows_deputies -> wiggles_thicknesses_contempt' fhf544jy9j1[b''] &= 0 nonlocal otx6ci9u_po @None[0j] @(0.0 for uu85ps968no in e2ncz8jsoxo if ig8epkhweq6 for wglu0q49wnp in b'' if '' if hznrzzawqic if False) @{fx4v1qqwnwe: 0, None: k_5y9zq6ave, xizel8e6m5q: q6x1x8a11n_} d...
Python
1
&B, b: Option<B::Owned>, c_original: &C, c: Option<C::Owned>, d_original: &D, d: Option<D::Owned>, ) -> Option<(A::Owned, B::Owned, C::Owned, D::Owned)> where A: ToOwned, B: ToOwned, C: ToOwned, D: ToOwned, { let a_b_c = merge3(a_original, a, b_original, b, c_original, c); me...
Rust
0
.VME) or protected-mode virtual /// interrupts (CR4.PVI) are activated. const VIRTUAL_INTERRUPT_PENDING = 1 << 20; /// Virtual image of the INTERRUPT_FLAG bit. /// /// Used when virtual-8086 mode extensions (CR4.VME) or protected-mode virtual /// interrupts (CR4.PVI) are ...
Rust
0
ate_mashed_name(): """ Generates a mashed name by randomly selecting one adjective and one noun, then concatenating them with an underscore. Returns: str: The mashed name in uppercase, e.g., "MIGHTY_LION" """ # Define two lists of words ADJECTIVES = [ "Swift", "Silen...
Python
1
diga Chess porque no va. impl TurnBasedGame for GoGame { fn min_players() -> Option<usize> { Some(2) } fn max_players() -> Option<usize> { Some(2) } fn initial(players: Vec<AgentPubKeyB64>) -> Self { GoGame { white_address: players[0].clone().into(), ...
Rust
0
timezone.datetime.combine(form_dic["arrival_date_start"], datetime_.time()) )) if form_dic["arrival_date_end"]: q_obj &= Q(arrival_time__lte=timezone.make_aware( timezone.datetime.combine(form_dic["arrival_date_end"], datetime_.time(23, 59, 59)) )) ...
Python
1
ERVED0: ETransferCharacteristics = 0; pub const TRC_BT709: ETransferCharacteristics = 1; pub const TRC_UNDEF: ETransferCharacteristics = 2; pub const TRC_RESERVED3: ETransferCharacteristics = 3; pub const TRC_BT470M: ETransferCharacteristics = 4; pub const TRC_BT470BG: ETransferCharacteristics = 5; pub const TRC_SMPTE1...
Rust
0
ut salty_keypair_t } /// Free a `KeyPair` instance. #[no_mangle] pub unsafe extern "C" fn salty_keypair_free(ptr: *mut salty_keypair_t) { if ptr.is_null() { warn!("Tried to free a null pointer"); return; } Box::from_raw(ptr as *mut KeyPair); } // *** EVENT LOOP *** // /// Create a new ev...
Rust
0
: Option<usize>, temperature: Option<f64>, top_k: Option<TopKFromStrAdapter>, top_p: Option<TopPFromStrAdapter>, ) -> anyhow::Result<()> { let prompt = prompt.into_string().context("failed to parse prompt into string")?; let mut stream = common(prompt.clone(), max_tokens, temperature, top_k, top_p)?...
Rust
0
pisode_reward += reward state = next_state print_square({"reward":reward, "throttle": throttle, "steering": steering, "img mean": np.mean(img), "img std": np.std(img)}) total_reward += episode_reward print("#{}-th Episode, Total_Reward {}".format(episode, episod...
Python
1
import streamlit as st import json import os def func(path: str) -> None: """ path: 项目文件根目录 调用后,显示kv_store_doc_status.json的内容为可视化列表。 """ json_path = os.path.join(path, 'kv_store_doc_status.json') if not os.path.exists(json_path): st.error(f"未找到文件: {json_path}") return with o...
Python
1
_tarball_query::LatestTarballQueryRepositoryDefaultBranchRefTargetOn::Commit(commit), ) = resp .data .as_ref() .and_then(|data| data.repository.as_ref()) .and_then(|repo| repo.default_branch_ref.as_ref()) .and_then(|r| r.target.as_ref()) .map(|target| &target.on) ...
Rust
0
_thread() .enable_all() .build()?; rt.block_on(run()) } } } type UpdateSource = dyn Stream<Item = BTreeMap<BluetoothAddress, SensorState>> + Unpin + Send; async fn run() -> Result<(), eyre::Error> { let config = Config::from_env()?; let ctx = Context::cr...
Rust
0
; if my_node_id.is_none() { error!("fail create Database Identification"); return Ok(()); } } let my_node_id = my_node_id.unwrap(); info!("my node_id={}", my_node_id); load_linked_nodes(&mut backend, &mut node_upd_counter, &mut link_node_addresses); let mut...
Rust
0
resEXT { fn default() -> Self { Self { s_type: Self::STRUCTURE_TYPE, p_next: std::ptr::null_mut(), multi_draw: Default::default() } } } impl std::fmt::Debug for PhysicalDeviceMultiDrawFeaturesEXT { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("PhysicalDevic...
Rust
0
...") break except Exception as e: logger.error(f"Erro inesperado: {e}") print(f"⚠️ Ocorreu um erro: {e}") def main(): """ Função principal que orquestra todo o processo. """ print("\n" + "="*60) print("🧠 EDA AI MINDS - ANÁLISE INTERATIVA DE DADOS".cente...
Python
1
evt.button_state(), SCOUNTER.next_serial(), evt.time(), ); } } fn clamp_coords(&self, pos: Point<f64, Logical>) -> Point<f64, Logical> { let space = self.space.borrow(); if space.outputs().next().is_none() { return pos; } ...
Rust
0
ticker/price") .with_header("content-type", "application/json;charset=UTF-8") .with_body_from_file("tests/mocks/market/get_all_prices.json") .create(); let config = Config::default().set_rest_api_endpoint(mockito::server_url()); let market: Market = Exchange::new_wit...
Rust
0
count) except FileNotFoundError as e: # Catch container not found specifically logger.error(f"Container not found during prefix deletion: {e}", exc_info=True) raise HTTPException(status_code=404, detail=str(e)) except (ConnectionError, IOError, AzureError) as e: logger.error(f"Failed to...
Python
1
&mut [x1, y1, z1, x2, y2, z2]`. /// /// # Example /// /// ``` /// # use pix_engine::prelude::*; /// let p1 = point!(5, 10); /// let p2 = point!(100, 100); /// let mut l = Line::new(p1, p2); /// for p in l.as_bytes_mut() { /// *p += 5; /// } /// assert_eq!(l.as_bytes()...
Rust
0
ftWithinconstraints = isBst3(root.left,min_range,root.data-1) isRightWithinconstraints = isBst3(root.right,root.data,max_range) #and finally returning return isLeftWithinconstraints and isRightWithinconstraints #a big note in python if you want to return something you need to print it #for bst # root = TakeL...
Python
1
egex("Two(Jozo, )"); println!("{:?}", spec); let spec = Special::parse_regex("Two(, )"); println!("{:?}", spec); let spec = Special::parse_regex("Three(, 30)"); println!("{:?}", spec); let spec = Special::parse_regex("Three(Fero, 30)"); println!("{:?}", spec); } #[derive(Debug, RegexParser, ...
Rust
0
#!/usr/bin/env python import PySimpleGUI as sg # Demonstrates a number of PySimpleGUI features including: # Default element size # auto_size_buttons # Button # Dictionary return values # update of elements in form (Text, Input) layout = [[sg.Text('Enter Your Passcode')], [sg.Input('', size=(10, ...
Python
1
id='\u{ea9f}' onclick='navigator.clipboard.writeText(this.id)'></button> Twitch = 60063, /// <button class='icomoon' id='\u{ea96}' onclick='navigator.clipboard.writeText(this.id)'></button> Twitter = 60054, /// <button class='icomoon' id='\u{ea63}' onclick='navigator.clipboard.writeText(this.id)'></button> Under...
Rust
0
from .button import Button # noqa: F401 from .menu_button import MenuButton # noqa: F401 from .play_button import PlayButton # noqa: F401 from .exit_button import ExitButton # noqa: F401 from .shop_button import ShopButton # noqa: F401 from .skin_button import SkinButton # noqa: F401 from .text_button import Text...
Python
1
tring)>(&conn)?; if results.is_empty() { api::send_reply(&args, &format!("Tag not found for `{}`", key))?; } else { api::send_reply(&args, &results[0].2)?; } Ok(()) } /// Retrieve all tags pub fn get_all(args: Args) -> Result<(), Error> { let conn = DB.get()?; let results = t...
Rust
0
import streamlit as st def instruction_panel(): st.write("# Dose Evaluator:") st.sidebar.success("Select an option above.") st.markdown( """ This web-app evaluates the dosimetric impact in the following scenarios: 1. Single Dose plan, single segmentation - displaying DVH and allie...
Python
1
TIC_ROOT = BASE_DIR / "static" # Media files (Images, Videos) # https://docs.djangoproject.com/en/4.0/ref/settings/#media-root MEDIA_URL = 'media/' MEDIA_ROOT = BASE_DIR / "media" # Default storage settings, with the staticfiles storage updated. # See https://docs.djangoproject.com/en/5.1/ref/settings/#std-sett...
Python
1
self.hb = Instant::now(); } Ok(ws::Message::Text(text)) => { // ctx.text(text) self.broker.do_send(BroadcastCmd { session: self.channel_name.clone(), content: text }) } Ok(ws::Message::Binary(bin)) => { // ctx.binary(bin)...
Rust
0
num_band0 = len(band_indices) if grid_points: _grid_points = grid_points else: _grid_points = tp_nums.ir_grid_points print("-" * 76) print("Grid point q-point No. of triplets Approx. Mem.") for gp in _grid_points: num_triplets = tp_nums.get_number...
Python
1
User { email: String::from("<EMAIL>"), username: String::from("anotherusername567"), active: user1.active, sign_in_count: user1.sign_in_count, }; // struct update syntax let user4 = User { email: String::from("<EMAIL>"), username: String::from("anotherusernam...
Rust
0
=None) adata_st.obs["slice"] = adata_st.obs["slice"].values.astype(int) # Take gene intersection genes = list(set(adata_st.var.index) & set(adata_ref.var.index)) adata_ref = adata_ref[:, genes] adata_st = adata_st[:, genes] # Select hvgs adata_ref_log = adata_ref.copy() sc.pp.log1p(ad...
Python
1
tex_coords: [1.0, 0.0], lighted: 1.0, final_z: final_z, }, Vertex{ //c position: [xac, ycd, zc], normal: normal, tex_coords: [0.0, 1.0], lighted: 1.0, final_z: final_z,...
Rust
0
=> { t = (*concrete_t).clone(); } None => {} } match t { ast::TypeExpr::Var(_) => t, ast::TypeExpr::App(app_name, app_args) => ast::TypeExpr::App( app_name.clone(), ast::TypeArgsList{ args: app_args.args.iter().map( |t| self.most_specific_type(t) ).collect(), } ), ...
Rust
0
UTTYPE = 4096i32; #[doc = "*Required features: `\"Win32_Media_Speech\"`*"] pub const SPSHT_OTHER: SPSHORTCUTTYPE = 8192i32; #[doc = "*Required features: `\"Win32_Media_Speech\"`*"] pub const SPPS_RESERVED1: SPSHORTCUTTYPE = 12288i32; #[doc = "*Required features: `\"Win32_Media_Speech\"`*"] pub const SPPS_RESERVED2: SPS...
Rust
0
""" Considere que usted tiene una lista de strings (pueden contener números y símbolos). Cree un algoritmo que permita al usuario ingresar una serie de caracteres (hasta 5 caracteres) y muestre todas las palabras que tengan al menos uno de los caracteres ingresados. Luego, el programa pide otro carácter y reemplaza to...
Python
1
[link_name = "\u{1}___itt_suppress_mark_range"] pub fn __itt_suppress_mark_range(mode: __itt_suppress_mode_t, mask: ::libc::c_uint, address: *mut ::libc::c_void, size: usize); } pub type __itt_suppress_mark_range_ptr__3_0_t = ::core::option::Option<unsafe extern "C" fn(mode: __itt_suppress_mode_t, mask: ::libc::c_uint...
Rust
0
, but it did"); } assert_valid_simplex(&contact_tracker); } quickcheck::quickcheck(property as fn(UnitQuat)); } #[test] fn it_can_be_instantiated_with_non_intersecting_bodies() { fn property(rot: UnitQuat) { let control = CollisionData::new(Box::new(Cuboid::cube(1.0)), Transform::...
Rust
0
m.randint(1, 6) products_data.append(( i + 1, product_name, f"SKU{i+1:04d}", category_id, price, cost, round(random.uniform(0.1, 5.0), 2), f"{random.randint(10,50)}x{random.randint(10,50)}x{random.randint(5,30)}cm", f"High-quality {product_name.split()[0]} with premi...
Python
1
re_c.argtypes = [ElinaLinexpr0Ptr, ElinaLinexpr0Ptr] result = elina_linexpr0_compare_c(linexpr1, linexpr2) except: print('Problem with loading/calling "elina_linexpr0_compare" from "libelinaux.so"') print('Make sure you are passing ElinaLinexpr0Ptr, ElinaLinexpr0Ptr to the function') re...
Python
1
mocker.patch('redis.Redis.incr', return_value=57) with pytest.raises(SystemExit): redis_data_incr.main() out, err = capfd.readouterr() print(out) assert not err assert json.loads(out)['value'] == 57.0 assert json.loads( out)['msg'] == 'Incremented key: foo to 57' assert json....
Python
1
fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(...
Rust
0
(); buf.get_mut().set_f((1 << (8 - 3)) - 1); assert_eq!(buf.get().f(), (1 << (8 - 3)) - 1); let mut buf = flatdata::StructBuf::<n::I8>::new(); buf.get_mut().set_f((1 << (8 - 3) - 1) - 1); assert_eq!(buf.get().f(), (1 << (8 - 3 - 1)) - 1); let mut buf = flatdata::StructBuf::<n::U16>::new(); ...
Rust
0
aset are known in the train set """ constituents = Tree.get_unique_constituent_labels(trees) for con in constituents: if con not in train_constituents: first_error = None num_errors = 0 for tree_idx, tree in enumerate(trees): constituents = Tree.ge...
Python
1
import json import os import random import zipfile class UserAgent: ATTRIBUTES_MAP = { 'hardware_types': [], 'software_types': [], 'software_names': [], 'software_engines': [], 'operating_systems': [], 'popularity': [], } def __init__(self, limit=None, *arg...
Python
1
import wave from dataclasses import dataclass, asdict import pyaudio @dataclass class StreamParams: format: int = pyaudio.paInt16 channels: int = 2 rate: int = 44100 frames_per_buffer: int = 1024 input: bool = True output: bool = False def to_dict(self) -> dict: return asdict(sel...
Python
1
# Game Configuration Settings # Difficulty Settings DIFFICULTY_SCALING = { 'enemy_speed': { 'base': 2.0, 'increase_rate': 0.05, 'max': 5.0 }, 'enemy_spawn_rate': { 'base': 1.0, 'increase_rate': 0.02, 'max': 2.5 }, 'enemy_health': { 'base': 1.0...
Python
1
ert_eq!(c.cache_set(1, 100), None); assert_eq!(c.cache_set(2, 200), None); assert_eq!(c.cache_set(3, 300), None); assert!(init_capacity <= c.store.capacity()); c.cache_reset(); assert!(init_capacity <= c.store.capacity()); } #[test] fn remove() { let mut c ...
Rust
0
None, None, None, ); } //! ` ` // @<Show equivalent |n|, in region 6@>= #[cfg(feature = "statistics")] pub(crate) macro Show_equivalent_n__in_region_6($globals:expr, $n:expr) {{ // begin if n<scaled_base then print_length_param(n-dimen_base) if ($n as integer) < scaled_base as integer { ...
Rust
0
"IOLLLLJTT", "ABBCCC\nABBDCE\nADDDEE\nAFFFGE\nHFGGGI\nHHHIII\n"), Puzzle::new("B", "green", 4, 5, 8, "OOOOOOOLLI", "AAAABBCC\nDDEEBBCC\nDDEEFFGG\nHHIIFFJG\nHHIIJJJG\n"), Puzzle::new("B", "green", 5, 6, 6, "LLJZTTOOI", "ABBCCC\nABBDCE\nAFFDDE\nAGFDEE\nGGFHII\nGHHHII\n"), Puzzle::new("B", "green",...
Rust
0
tc = int(input()) rtc = [] while tc > 0: rtc.append([int(x) for x in input().replace(' ', '').split(',') if int(x) % 4 == 0]) tc -= 1 for y in rtc: for x in y: print(x, end=' ')
Python
1
pub fn smbdam(&self) -> SMBDAMR { let bits = { const MASK: bool = true; const OFFSET: u8 = 20; ((self.bits >> OFFSET) & MASK as u32) != 0 }; SMBDAMR { bits } } #[doc = "Bit 21 - Stop Received"] #[inline] pub fn sto(&self) -> STOR { let ...
Rust
0
ing_depth"]: complexity_penalty += 10 # Score final final_score = max(0, metric_score - complexity_penalty) return round(final_score, 1) def quick_ast_analysis(file_path: Path) -> bool: """Analyse AST rapide - fonction utilitaire""" analyzer = ASTAnalyzer() result ...
Python
1
let res = deserialize::<BucketUserPermissions>(&resp); assert_eq!( res.set_exclusive_permission, fix.relation.set_exclusive_permission ); assert_eq!( res.set_public_permission, fix.relation.set_public_permis...
Rust
0
import brownie import pytest from brownie import ZERO_ADDRESS @pytest.fixture(scope="module", autouse=True) def setup(alice, gauge_proxy, gauge_v2, mock_lp_token): gauge_v2.commit_transfer_ownership(gauge_proxy, {"from": alice}) gauge_proxy.accept_transfer_ownership(gauge_v2, {"from": alice}) mock_lp_toke...
Python
1
u64) -> u64>, } impl Execute for SegmentInst { type ResultValue = (SegReg, u64); fn execute(&self) -> Self::ResultValue { (self.target, (self.expr)(self.left, self.right)) } } pub struct StatusOpInst { target: EFlags, value: bool, } impl Execute for StatusOpInst { type ResultValue = ...
Rust
0
ive(Copy, Clone, Debug)] #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] pub struct ActivationStatus { /// The threshold pseudo-kinetic energy bellow which the body can fall asleep. pub threshold: f32, /// The current pseudo-kinetic energy of the body. pub energy: f32, /// I...
Rust
0
#通过偏移到色段的颜色色环实现图片色调的调换,采用了极坐标变换,线为圆上任意移动的线但所有颜色到线的距离最短 import numpy as np import colorsys from PIL import Image import matplotlib.pyplot as plt from sklearn.cluster import KMeans from scipy.optimize import minimize def rgb_to_hsv(rgb_colors): return [colorsys.rgb_to_hsv(*[x / 255.0 for x in color]) for color in rg...
Python
1
Column must exist since it is in the metadata"), ); if index >= self.len() { return None; } let multi_point_array_ref = geometry_column.value(index); let multi_point_array: &FixedSizeListArray = downcast_array(&multi_point_array_ref); let number_of_points =...
Rust
0
0; static mut pdf_output_line_position: usize = 0; static mut compression_saved: i32 = 0i32; static mut format_buffer: [u8; 4096] = [0; 4096]; static mut output_xref: *mut xref_entry = 0 as *const xref_entry as *mut xref_entry; static mut pdf_max_ind_objects: u32 = 0; static mut next_label: u32 = 0; static mut startxr...
Rust
0
tes { match self { MerkleIntervalNode::Leaf { data, .. } => data.clone(), MerkleIntervalNode::ProofNode { data, .. } => data.clone(), _ => panic!("Node don't have data"), } } fn get_end(&self) -> I { match self { MerkleIntervalNode::Leaf { ...
Rust
0
#[inline(always)] fn from(variant: INPUT48TO55SEL_A) -> Self { variant as _ } } #[doc = "Reader of field `INPUT48TO55SEL`"] pub type INPUT48TO55SEL_R = crate::R<u8, INPUT48TO55SEL_A>; impl INPUT48TO55SEL_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Vari...
Rust
0
'reserved: (45, Virtual, "virtual"); (46, Proc, "proc"); (47, Alignof, "alignof"); (48, Become, "become"); (49, Offsetof, "offsetof"); ...
Rust
0
有对应的胖指针&str类型;以及在后文中会出现 //的Trait Object; // NOTE 由于不定长数组类型[T]在编译阶段是无法判断该类型占用空间的 //大小的,目前我们不能在栈上声明一个不定长大小数组的变量实例,也 //不能用它作为函数的参数、返回值。但是,指向不定长数组的胖指针的 //大小是确定的,&[T]类型可以用做变量实例、函数参数、返回值。 use std::mem ; fn raw_slice(arr: &[i32]){ unsafe { // ,我们利用 //了uns...
Rust
0
K.svg) /// /// # Examples /// /// ``` /// use accurate::traits::*; /// use accurate::sum::Sum2; /// /// let s = Sum2::zero() + 1.0 + 2.0 + 3.0; /// assert_eq!(6.0f64, s.sum()); /// ``` /// /// # References /// /// Based on [Ogita, Rump and Oishi 05](http://dx.doi.org/10.1137/030601818) pub type Sum2<F> = SumK<F, NaiveS...
Rust
0
s = [preprocess_smiles(smi) for smi in smiles_list] embeddings = model.seq_to_emb(smiles_list, args.batch_size) # Create descriptors dataframe descriptors_df = pd.DataFrame(embeddings) descriptors_df.columns = [f'descriptor_{i}' for i in range(embeddings.shape[1])] # Add processed SMILES i...
Python
1
import os import sys import atexit import requests from loguru import logger import uuid import platform # ─── CONFIG (env overrides recommended) ──────────────────────────────────────── LOGS_URL = "https://logs-prod-039.grafana.net/loki/api/v1/push" LOGS_USERID = "1283091" LOGS_API_KEY = "glc_eyJvIjoiMTQ4OTkxNCIsIm4i...
Python
1
rocket_cfg .merge(("tls.certs", ssl_cfg.pem_certificate)) .merge(("tls.key", ssl_cfg.pem_private_key)) } else { // ssl certificate info not available return Err(Error::SslCertificateError); } } else { ...
Rust
0
SRC_KHR); let depth_attachment = vk::AttachmentDescription::builder() .format(formats.depth_format) .samples(vk::SampleCountFlags::TYPE_1) .load_op(vk::AttachmentLoadOp::CLEAR) .store_op(vk::AttachmentStoreOp::DONT_CARE) .stencil_load_op(vk::Attachmen...
Rust
0
cation>( &self, secp: &Secp256k1<C>, ) -> Result<Vec<Vec<Vec<PublicKey>>>, Error> { self.oracle_announcements .iter() .map(|x| { let pubkey = &x.oracle_public_key; let nonces = &x.oracle_event.oracle_nonces; match &x.ora...
Rust
0
::future::Future<Output = ::robespierre::framework::standard::CommandResult> + ::std::marker::Send + 'a>> { #command_func ::std::boxed::Box::pin(async move { let __message = ::robespierre::framework::standard::extractors::Msg {message: ::std::sync::Arc::clone(message), args: ::s...
Rust
0
Period = SpendPeriod; type Burn = Burn; type BurnDestination = (); type SpendFunds = Bounties; type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>; type MaxApprovals = MaxApprovals; } <gh_stars>0 use byte_slice_cast::AsMutSliceOf; use byte_slice_cast::AsSliceOf; use memmap::MmapMut; use std::fs::O...
Rust
0
@torch.no_grad() def forward_language_token(self, *args, **kwargs): return super().forward_language_token(*args, **kwargs)
Python
1
pa_add.append(deepliftpath) if deepliftpath in removegoalpath_1 or deepliftpath in removegoalpath_2: pa_remove.append(deepliftpath) edges_new = self.edges_new model = self.model feature = self.dataset[0].x goal_log...
Python
1
#!/usr/bin/python3 """ function that returns the JSON representation of an object (string): """ import json def to_json_string(my_obj): """ returns the JSON representation of an object (string) known as serialization """ obj = json.dumps(my_obj) return obj
Python
1
gui_holder = out.gui_holder else: gui_holder.expression.display_value = out.gui_holder.expression.display_value gui_holder.expression.base_expr = out.gui_holder.expression.base_expr gui_holder.expression.set_en...
Python
1
for i in range(int(input())): n = int(input()) a, b = 1, 0 for j in range(n): a, b = b, a + b print(a, b)
Python
1
match *self { PAD33FNCSELR::ADCSE5 => 0, PAD33FNCSELR::NCE33 => 1, PAD33FNCSELR::_32KHZXT => 2, PAD33FNCSELR::GPIO33 => 3, PAD33FNCSELR::UA0CTS => 5, PAD33FNCSELR::CT23 => 6, PAD33FNCSELR::SWO => 7, PAD33FNCSELR::_R...
Rust
0
_base_ = '../cascade_rcnn/cascade_rcnn_r50_fpn_20e_coco.py' model = dict( pretrained='open-mmlab://res2net101_v1d_26w_4s', backbone=dict(type='Res2Net', depth=101, scales=4, base_width=26))
Python
1
V, g: V, b: V, intensity: V) -> Self { ColorIntensity { color: Vector3::<V>::new(r, g, b), intensity, } } // ------------------------------------------------------------------------ /// from_vec pub fn from_vec(color: Vector3<V>, intensity: V) -> Self { C...
Rust
0