text
string
label_name
string
labels
int64
self.data.prev } fn data(&self) -> &ExprData { &self.data } } impl fmt::Display for Sequence { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Sequence({}, {}, {})", self.first, self.last, self.increment ) } }...
Rust
0
extra] padding_mask = padding_mask.view( padding_mask.size(0), features.size(1), -1 ) padding_mask = padding_mask.all(-1) return padding_mask def preprocess( self, source: torch.Tensor, fbank_mean: float = 15.41663, fbank_s...
Python
1
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above ...
Python
1
# we assume adding a new data in the batch with seqlen pad_size if pad_size > 0: if unpad_tokens.ndim == 1: unpad_tokens = F.pad(unpad_tokens, (0, pad_size)) elif unpad_tokens.ndim == 2: unpad_tokens = F.pad(unpad_tokens, (0, 0, 0, pad_size)) else: raise N...
Python
1
oth_FSs_do_not_refuse_clients(self): ''' Test that the command "ceph fs swap" command fails when "refuse_client_session" is not set for both the CephFSs. ''' self.run_ceph_cmd('fs', 'dump') self._bring_both_cephfss_down() sleep(2) msg = (f"CephFSs '{self.f...
Python
1
())] # Browser stats browsers = [click.user_agent for click in clicks if click.user_agent] browser_counts = Counter(browsers).most_common(5) browser_stats = [{"browser": k, "count": v} for k, v in browser_counts] return { "total_clicks": total_clicks...
Python
1
mma": 0.1, # 数据集加载器 "encoder_threads": 12, "graph_threads": 0, # 不为 0 的话,工作进程里就没有 cache 了 "threads": 4, }, { "name": "RX3D101", # 网络架构 "encoder_type": "RX3D101", "graph_type": "GraphKmTwoStreamNet", "encoder_enable_vf": True, "grap...
Python
1
_id) } pub(crate) fn result_tys(&self, st: &SynTree<'_>) -> Vec<ResultTy> { st.cast_children(self.syn_id) } pub(crate) fn instrs(&self, st: &SynTree<'_>) -> Vec<Instr> { st.cast_children(self.syn_id) } } impl ExportDecl { pub(crate) fn name(&self, st: &SynTree<'_>) -> Option<S...
Rust
0
er]: """获取可执行的占位符(已分析且SQL已验证)""" return db.query(TemplatePlaceholder).filter( and_( TemplatePlaceholder.template_id == template_id, TemplatePlaceholder.agent_analyzed == True, TemplatePlaceholder.sql_validated == True, TemplateP...
Python
1
{ let input = "\ Butterscotch: capacity -1, durability -2, flavor 6, texture 3, calories 8 Cinnamon: capacity 2, durability 3, flavor -2, texture -1, calories 3 "; assert_eq!(part1(&parse_input(input)), 62842880); } #[test] fn sample2() { let input = "\ Butterscotch: capacity -1, du...
Rust
0
Method": "selectList1", "fileName": f"매출현황 조회-{timestamp}", "onlyData": "false", "isExportData": "false", "exportData": "" } try: # POST 요청 response = ...
Python
1
import logging from typing import Optional from matchms.typing import SpectrumType logger = logging.getLogger("matchms") def require_retention_time( spectrum_in: SpectrumType, minimum_rt=None, maximum_rt=None, clone: Optional[bool] = True ) -> Optional[SpectrumType]: """ This function checks if the inpu...
Python
1
is_window_visible(window: HWND, orig: unsafe extern fn(HWND) -> u32) -> u32 { if is_forge_window(window) { 1 } else { orig(window) } } unsafe fn client_to_screen( window: HWND, point: *mut POINT, orig: unsafe extern fn(HWND, *mut POINT) -> u32, ) -> u32 { if is_forge_window...
Rust
0
r = C3::zero(); for _ in 0..samples_per_pixel { let u = (col as f64 + random::<f64>()) / (image_width - 1) as f64; let v = (row as f64 + random::<f64>()) / (image_height - 1) as f64; let ray = camera.ray(u, v); color += ray_color(&ray, &world, max_depth); ...
Rust
0
#!/usr/bin/env python ''' Gimp plugin "Heal transparency" Copyright 2010 lloyd konneker (bootch at nc.rr.com) Version: 1.0 lloyd konneker lkk 2010 Initial version in python. License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as p...
Python
1
{ new_test_ext().execute_with(|| { // The execution went through without error. assert_ok!(Assets::create(Origin::signed(ALICE))); // The nonce was increased. assert!(Assets::nonce() == 1); // The asset id is 0; let details = Assets::asset(0).unwrap(); // The sender is the owner of the asset....
Rust
0
ation_space(self, *args: Any, **kwargs: Any): return spaces.Box(low=0.0, high=1.0, shape=(1,), dtype=np.float) def get_observation( self, observations, *args: Any, episode, **kwargs: Any ): current_position = self._sim.get_agent_state().position.tolist() distance_to_target = se...
Python
1
R # Заменяем нулевые значения на минимальное значение float bers_plot = [max(ber, 1e-300) for ber in results["bers"]] axs[1, 1].plot(distances, bers_plot, label=label) axs[1, 1].set_title("Вероятность битовой ошибки (BER)") axs[1, 1].set_xlabel("Расстояние (м)") axs[1, 1].set_ylabel("BER") a...
Python
1
black_box(xyz); } } fn convert_checker_spd() { for (_, spd) in spd::BABELCOLOR.iter() { let xyz = spd.to_xyz(); black_box(xyz); } } fn convert_checker_spd_avx() { for (_, spd) in spd::BABELCOLOR.iter() { let xyz = spd::spd_to_xyz_avx(spd); black_box(xyz); } } fn cr...
Rust
0
english IBase interface IFT_IValue = 0 # < \~chinese IValue接口类型 \~english IValue interface MV_TRIGGER_MODE_OFF = 0 # < \~chinese 关闭 \~english Off MV_TRIGGER_MODE_ON = 1 # < \~chinese 打开 ...
Python
1
le all cells in this row for j in range(len(header)): cell = table[(i, j)] if model_type == 'API': # Light blue for API models cell.set_facecolor('#e6f2ff' if j > 0 else '#d4e6f1') ...
Python
1
::ffi::c_void pointer of the // process_memory::ProcessHandle to be passed through threads. // This is technically unsafe, but in practice it _shouldn't_ cause // issues as we're never changing anything about this pointer. unsafe impl Send for Dolphin {} impl Dolphin { // new hooks into the Dolphin process and int...
Rust
0
} } let ch = c as u8; let mut buffers = translated_byte_buffer(body[0], body[1] as *const u8 , body[2]); unsafe { buffers[0].as_mut_ptr().write_volatile(ch); } 1 } _=>panic!("Unsupported memory service id")...
Rust
0
let mut gates = vec![]; #[allow(clippy::explicit_counter_loop)] for row in 0..num_gates { let wires = Wire::new(row); gates.push(CircuitGate::create_generic_gadget( wires, GenericGateSpec::Const(1u32.into()), None, ));...
Rust
0
GdkContentFormats>, pub write_mime_type_async: Option< unsafe extern "C" fn( *mut GdkContentProvider, *const c_char, *mut gio::GOutputStream, c_int, *mut gio::GCancellable, gio::GAsyncReadyCallback, gpointer, ), ...
Rust
0
"), DuelErr::IllegalDraw => write!(f, "Cannot draw a duel match"), } } } pub struct Duel { matches: Vec<Match>, } impl Base<DuelErr> for Duel { fn get_matches(&self) -> &Vec<Match> { &self.matches } fn validate(&self, _: &Match, score: &Vec<Score>) -> Result<(), DuelErr...
Rust
0
// したがって、インデックスをそのまま使える。 // 結果的に、選択された本をすべてshelving_booksに追加することができる for (enum_index, selecting_index) in self .box_info_window .get_selecting_index() .iter() .enumerate() { // 許容限界に達したので、追加は中止する if remaining_capaci...
Rust
0
pop(); machine .stack .push((((popped as i32 - 3) + 65536) % 65536) as u16); machine.instruction_pointer = (machine.instruction_pointer as u32 + 1) as u16; }, bytes_per_arg: 0, clock_cycles: 1, }, Instruction { inst: "DEC4P", num_args: 0, op_code: 0x7f, run:...
Rust
0
:Instant; for lgl in (13..=29).step_by(2) { // commit to random poly of specified size let coeffs = random_coeffs(lgl); let enc = LigeroEncodingRho::<Ft255, TLo, THi>::new(coeffs.len()); let mut xxx = 0u8; let now = Instant::now(); for i in 0..N_ITERS { ...
Rust
0
# Generated by Django 4.1.5 on 2023-02-15 17:52 from django.db import migrations from django.core.exceptions import FieldError def forwards_migrate_napalm(apps, schema_editor): Platform = apps.get_model("dcim", "Platform") try: NapalmPlatformConfig = apps.get_model("netbox_napalm_plugin", "NapalmPlat...
Python
1
yTermModel | None = None if c_code is not None: if "ct_term_generic_repository" in find_term_by_uid.__module__: term = find_term_by_uid(c_code, at_specific_date=at_specific_date) else: term = find_term_by_uid(c_code) if term is not None: ...
Python
1
Id { term: 1, index: want }, to(), "snapshot").await?; { let logs = sto0.get_log_entries(..).await?; assert_eq!(1, logs.len(), "only one snapshot pointer log"); } let m = sto0.get_membership_config().await?; assert_eq!( MembershipConfig { ...
Rust
0
y.create( final_agent_card_to_use, consumers=None, interceptors=[opa_middleware], ) logger.info('A2AClient initialized.') message = Message( role=Role.user, parts=[ Part(root=TextPart(text='How much is 10 USD in...
Python
1
Title(BaseLayout): """a title attributes : * BaseLayout attributes A title must not contains a section nor a paragraph! """ class Span(BaseLayout): """a title attributes : * BaseLayout attributes A span should only contains Text and Link nodes (in-line elements) """ class ...
Python
1
ll want the socket to persist, and will free it * themselves when they are done. Protocols should only ever call sofree() * following setting this flag in pru_detach(), and never otherwise, as * sofree() bypasses socket reference counting. */ /* strong protocol reference */ /* * Socket state bits now stored in th...
Rust
0
import subprocess import sys import time from multiprocessing import Pool from pathlib import Path import pytest import requests def _query_server(prompt: str, max_tokens: int = 5) -> dict: response = requests.post("http://localhost:8000/generate", json={ ...
Python
1
!("Could not load encoding {:?}", e); () })?; let bytes_before = ByteGrid::load(Path::new(before_name), &encoding).map_err(|e| { eprintln!("Could not load map {}: {:?}", before_name, e); () })?; let bytes_after = ByteGrid::load(Path::new(after_name), &encoding).map_err(|e| { ...
Rust
0
# Generated by Django 4.1.1 on 2024-10-18 20:01 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('HomePage', '0001_initial'), ] operations = [ migrations.CreateModel( name='Tag', fields=[ ('id', mod...
Python
1
enreList = genreStore.get("genre", "").split(", ") for genre in genreList: if genre in result: result[genre] += 1 else: result[genre] = 1 if result[genre] > most_popular_genre_count: most_popular_gen...
Python
1
build_inputs_with_special_tokens` method if token_ids_1 is None: # [CLS] X [SEP] return (len(token_ids_0) + 2) * [0] # [CLS] A [SEP] [SEP] B [SEP] return [0] * (len(token_ids_0) + 1) + [1] * (len(token_ids_1) + 3) def is_ch_char(self, char): """ is_c...
Python
1
// for input in inputs { // starts.push(BlendInput { // weight: input.weight, // value: input.value.start, // }); // ends.push(BlendInput { // weight: input.weight, // value: input.value.end, // });...
Rust
0
} /// [glSamplerParameterfv](http://docs.gl/es3/glSamplerParameter)(sampler, pname, param) /// * `pname` group: SamplerParameterF /// * `param` len: COMPSIZE(pname) #[cfg_attr(feature = "inline", inline)] #[cfg_attr(feature = "inline_always", inline(always))] pub unsafe fn SamplerParameterf...
Rust
0
> EpsResult<()> { let epsbatconf = ffi::EpsBatteryConfig { batt_maxvoltage: config.batt_maxvoltage, batt_safevoltage: config.batt_safevoltage, batt_criticalvoltage: config.batt_criticalvoltage, batt_normalvoltage: config.batt_normalvoltage, reserved1: ...
Rust
0
check_optional` function needs to use pattern matching to //! determine whether the box has a value (i.e., it is [`Some(...)`][`Some`]) or //! not ([`None`]). //! //! ``` //! let optional = None; //! check_optional(optional); //! //! let optional = Some(Box::new(9000)); //! check_optional(optional); //! //! fn check_op...
Rust
0
cycles smpr1.set_smp16(0b0100); //Sample with 84 cycles smpr1.set_smp17(0b0100); }); adc.smpr2.update(|smpr2| { //Sample with 84 cycles smpr2.set_smp0(0b0100); //Sample with 84 cycles smpr2.set_smp1(0b0100); //Sample with 84 cycles smpr2.s...
Rust
0
import re def strip_answer(answer): answer = re.sub("The", "", answer) answer = re.sub("If", "", answer) answer = re.sub("[INST]", "", answer) answer = re.sub("[/INST]", "", answer) answer = re.sub("<Img>", "", answer) answer = re.sub("</Img>", "", answer) return answer def remove_specia...
Python
1
r_batch): """Convert camera coordinates to pixel coordinates.""" B, n, _ = cam_pts.shape pix = np.empty((B, n, 2), dtype=np.int64) for b in range(B): intr = intr_batch[b].astype(np.float32) fx, fy = intr[0, 0], intr[1, 1] cx, cy = intr[0, 2], intr[1, 2] for i in prange(n)...
Python
1
, delay) // return tuple (i2c, led, delay) } #[cfg(feature = "stm32l1xx")] // eg Discovery STM32L100 and Heltec lora_node STM32L151CCU6 use stm32l1xx_hal::{ delay::Delay, gpio::{gpiob::PB6, Output, PushPull}, i2c::{I2c, Pins}, prelude::*, rcc, // for ::Config but avoid name conflict with serial ...
Rust
0
ATH}:OneMaybe", c=None))), (["--from-file", f"{NON_ABSTRACT_PATH}"], non_abstract_dict), ( ["--from-py-fn", f"{INSTANCES_PYPATH}:default_two"], dict(_type_=f"{CLASSDEFS_PYPATH}:OneDefault", c=dict(_type_=f"{CLASSDEFS_PYPATH}:SubTwoConfig", two=1234)), ), ] @pytest.m...
Python
1
IES), 'namePrefix': None, }, 'apiUrl': 'http://api.example.com', 'applicationKey': 'masterKey-0', 'applicationKeyId': 'account-0', 'downloadUrl': 'http://download.example.com', 'isMasterKey': True, 's3endpoint': 'http://s3.api.example.com', } ...
Python
1
me(guild) => { conn.execute( "DELETE FROM guild_config \ WHERE discord_guild_id = ?1 AND key = ?2", (guild, key))?; } None => { conn.execute( "DELETE FROM global_config WHERE key = ?1", key)?; } } Ok(()) } #[inline...
Rust
0
{ return Err(ProofError::InvalidGeneratorsLength); } transcript.rangeproof_domain_sep(n as u64, 1u64); transcript.append_point(b"V", value_commitment); transcript.validate_and_append_point(b"A", &self.A)?; transcript.validate_and_append_point(b"S", &self.S)?; ...
Rust
0
my_list = input().split() new_list = [] n = "*" for i in range(len(my_list)): if len(my_list[i])>4: new_list.append(n*len(my_list[i])) else: new_list.append(my_list[i]) print(" ".join(new_list))
Python
1
rawdate = "-" match = re.search(r'(?is)\\date\s*(.*?)[\\|\*/]', cmt) if match: rawdate = match.group(1) rawdate = re.sub(r'(?ims)^\s*\*\s*$', '', rawdate) rawdate = re.sub(r'(?ims)^\s*\*\s*(\S+)', r'\1', rawdat...
Python
1
h[..., 2:4] # 2. transform all true outputs # y_true: (batch_size, grid, grid, anchors, (x1, y1, x2, y2, obj, cls)) true_box, true_obj, true_class_idx = tf.split( y_true, (4, 1, 1), axis=-1) true_xy = (true_box[..., 0:2] + true_box[..., 2:4]) / 2 true_wh = true_box[....
Python
1
""" Dumps things to tensorboard and console """ import os import logging import datetime from typing import Dict import numpy as np from PIL import Image from torch.utils.tensorboard import SummaryWriter from annotatepropwizard3d.cutie.utils.time_estimator import TimeEstimator def tensor_to_numpy(image): image_...
Python
1
.delay(5) .limit_for(LimitedFor::User) }) .await //help and groups .help(&MY_HELP) .group(&GENERAL_GROUP) .group(&TESTCOMMANDS_GROUP); let mut client = Client::builder(&token) .event_handler(Handler) .framework(framework) ...
Rust
0
te( "main", tenant_id=tenant_id, config_lines=["neon.lakebase_mode = true"] ) endpoint.respec(skip_pg_catalog_updates=False) endpoint.start() tenant_ps_id = env.get_tenant_pageserver( TenantShardId(tenant_id, shard_number=0, shard_count=1) ).id non_hosting_ps = ( env.pag...
Python
1
eturns ------- design_spaces : List[Schedule] The list of schedules generated by applying the schedule rule. """ raise NotImplementedError def clone(self) -> ScheduleRule: """Deep clone the schedule rule. Returns ------- cloned_rule : Sch...
Python
1
# -*- coding: utf-8 -*- # @Author : llc # @Time : 2023/2/16 9:46 openapi_html_string = """ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>APIdoc</title> <link rel="shortcut icon" href=" data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAkBJREF...
Python
1
payload > 10 { Ok(format!("Value is {}. Valid!", payload)) } else { Err("Value < 10. Invalid!".to_string()) } } #[export_name = "canister_update test_dapp_method"] fn test_dapp_method() { over(candid_one, test_dapp_method_) } fn test_dapp_method_(payload: i64) { println!("Executed with...
Rust
0
subdivide::subdivide_univariate; use fenris::quadrature::univariate::gauss; use fenris::quadrature::{subdivide::subdivide_triangle, total_order, Quadrature}; use itertools::izip; use matrixcompare::assert_scalar_eq; #[test] fn subdivided_gauss_rules_exactly_integrate_monomials() { // This test is almost exactly th...
Rust
0
:type LoadBalancerType: str :param _LoadBalancerName: 负载均衡器名称 :type LoadBalancerName: str :param _Domain: 负载均衡域名。规则:1-60个小写英文字母、数字、点号“.”或连接线“-”。内网类型的负载均衡不能配置该字段 :type Domain: str :param _LoadBalancerVips: 负载均衡获得的公网IP地址,支持多个 :type LoadBalancerVips: list of str :pa...
Python
1
rev_r_array] ratio_delta_data = [np.column_stack([qh_r_array, r]) for r in ratio_deltas] ratio_delta_plots = LineCollection(ratio_delta_data, array=prev_r_array, cmap='plasma') ratio_delta_lower_bounds_data = [np.column_stack([qh_r_array, r]) for r in ratio_delta_lower_bounds] ratio_delta_lower_bounds_p...
Python
1
from fastapi import FastAPI, Request, Form from fastapi.responses import HTMLResponse, RedirectResponse import uvicorn app = FastAPI() # 預設轉址位址(可依需求修改) redirect_url = "https://google.com" @app.get("/", response_class=HTMLResponse) async def index(request: Request): """ 首頁,顯示目前設定的轉址位址, 並提供連結到設定頁面與轉址測試頁面。 ...
Python
1
(), ActivateItem { used_by: player_entity, item: item_entity, }, )); } Point::zero() } use egg_mode::{KeyPair, Token, auth}; use crate::helpers::credentials_helper; use auth::access_token; // A smaller form of the Credentials struct ...
Rust
0
#!/usr/bin/env python # coding: utf-8 import cv2 import numpy as np import time from math import sqrt from matplotlib import pyplot as plt import os from PIL import Image import pyocr #組み込み方説明 # process関数以外は全てOCR処理の各ステップを定義した関数で、気にしなくていい # 一番下のprocess関数は、引数のimage_pathにカメラから取った画像のパスを入れる # vegetabel_databaseには野菜のデータベー...
Python
1
new(ErrorKind::Other, "Unable to find ceph version")); } }; let ceph_version = SemVer::parse(&v).map_err( |e| Error::new(ErrorKind::Other, e), )?; Ok(ceph_version) } fn config_set(p: &Path, section: &str, key: &str, value: &str) -> IOResult<()> { let mut conf = Ini::load_from_file(p...
Rust
0
# Copyright 2018 The TensorFlow Authors. 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 applica...
Python
1
a::{Isometry3, Vector3}; use ncollide3d::{ query::Ray, query::RayCast, shape::{Ball, Plane as CollidePlane}, }; use std::str::FromStr; use strum_macros::{Display, EnumIter, EnumString}; #[derive(Copy, Clone, Debug, PartialEq, Display, EnumIter, EnumString)] pub enum CollisionConstraint { XAxis, YAxi...
Rust
0
(); let font = Into::<FontDesc>::into("Arial").resize(50.0); root.fill(&White)?; let mut chart = ChartBuilder::on(&root) .caption("y=x^2", &font) .x_label_area_size(30) .y_label_area_size(30) .build_ranged(-1f32..1f32, -0.1f32..1f32); chart.configure_mesh().draw()?; ...
Rust
0
. /// /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_MM_TRANSPOSE4_PS) #[inline] #[allow(non_snake_case)] #[target_feature(enable = "sse")] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _MM_TRANSPOSE4_PS( row0: &mut __m128, row1: &mut __m128, row2: ...
Rust
0
video_overlay_video_renderer_new_with_sink( window_handle as *mut _, video_sink.as_ref().to_glib_none().0, ) as *mut _) } #[doc(alias = "gst_player_video_overlay_video_renderer_new_with_sink")] pub fn with_sink<P: IsA<gst::Element>>(video_sink: &P) -> PlayerVideoOverlayVideo...
Rust
0
import numpy as np def load_training_info_from_checkpoint(checkpoint, save_val_metrics): current_epoch = checkpoint['epoch'] + 1 best_epoch = checkpoint['best_epoch'] best_model_wts = checkpoint['best_model_state_dict'] best_epoch_val_metrics = checkpoint['best_epoch_val_metrics'] # ^ best val met...
Python
1
parse(())?, }) } } impl MySerialize for PrimaryKeysWithPrefix<'_> { fn serialize(&self, buf: &mut Vec<u8>) { self.data.serialize(buf); } } /// Info about primary key with a prefix (see [`PrimaryKeysWithPrefix`]). #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct PrimaryKeyWithPrefix ...
Rust
0
, 0.92), HSL::new(0.16666666666666666, 1.0, 0.5), HSL::new(0.16666666666666666, 1.0, 0.68), HSL::new(0.16666666666666666, 1.0, 0.76), HSL::new(0.16666666666666666, 1.0, 0.84), HSL::new(0.16666666666666666, 1.0, 0.92), HSL::new(0.0, 0.0, 1.0), HSL::new(0.0, 0.0, 0....
Rust
0
# Copyright 2024 The HuggingFace Inc. 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 appl...
Python
1
txn: &Transaction, now: Timestamp, author: &AgentPubKey, ) -> StateMutationResult<Vec<(ScheduledFn, Option<Schedule>)>> { let mut stmt = txn.prepare( " SELECT zome_name, scheduled_fn, maybe_schedule FROM ScheduledFunctions WHERE start <= :...
Rust
0
rallelNetwork`` when ``make_parallel`` is called. This might be useful in cases when the ``NaiveParallelNetwork`` has an advantange in terms of speed over ``ParallelNetwork``. You have to test to see which way is faster for your particular situation. ...
Python
1
() -> App<'static> { let app = App::new("termbin") .version(crate_version!()) .about("Create a termbin from the command line."); let clip = Arg::new("clip") .short('c') .long("clip") .about("Copy the url of the created termbin to the clipboard."); let remote = Arg::new("remote") .short('r') .long("re...
Rust
0
e(self): self.driver.find_element(By.XPATH, self.assetDelete).click() time.sleep(1) def verifyDeleted(self): try: self.driver.implicitly_wait(5) self.delToast = self.driver.find_element(By.XPATH, self.toastDeleted).text print(f"toast message: {self.delToa...
Python
1
#Import gmsh and load the mesh we generated import gmsh gmsh.initialize() gmsh.open("example2.msh") #Import opensees and the tools import opensees as ops import gmsh2opensees as g2o #We'll add 3-DOF nodes ops.model("basicBuilder","-ndm",3,"-ndf",3) #Add solid material model solidMaterialTag = 1 E = 200e9 nu = 0.3...
Python
1
waiting: [bool; 2], turn: usize, } pub struct DekkerLock { data: Arc<RefCell<DekkerData>>, } impl Clone for DekkerLock { fn clone(&self) -> Self { DekkerLock { data: self.data.clone(), } } } pub struct DekkerLockToken<'a> { l: &'a mut DekkerLock, id: usize, } impl...
Rust
0
import pytest import yup #================================================================================================== def test_read_within_subregion(): # Setup: Create a memory stream and wrap it in a SubregionStream source_data = b'This is a test stream' source_stream = yup.MemoryInputStream(sour...
Python
1
out.write( get_bed_line( cur_transcript_chrome, cur_transcript_id, cur_transcript_strand, cur_transcripts_blocks ) ) # Start new transcript. cur_transcript...
Python
1
import streamlit as st from pathlib import Path from pygments import highlight from pygments.lexers import LeanLexer from pygments.formatters import HtmlFormatter st.title("🔹 Proof Assistant Playground") st.write("Exploring basic Lean4 proofs interactively.") # Loading lean proofs lean_file = Path("lean_playground/L...
Python
1
''') s = converter.parse(empty_bars_with_repeats, format='romanText') br_iter = s[bar.Repeat] self.assertEqual(len(br_iter), 4) start_repeat1, end_repeat1, start_repeat2, end_repeat2 = br_iter _repeat_tester(start_repeat1, 'start', 0.0, 2) _repeat_tester(end_repeat1, 'en...
Python
1
ro.html#serdes-and-formatter-avro) /// - [Protobuf](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/serdes-protobuf.html#serdes-and-formatter-protobuf) /// - [JSON](https://docs.confluent.io/platform/current/schema-registry/serdes-develop/serdes-json.html#serdes-and-formatter-json) #[derive(De...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2015 Google Inc. 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 require...
Python
1
kernels::sort::{SortColumn, SortOptions}; use arrow::record_batch::RecordBatch; use serde::{Deserialize, Serialize}; mod approx_distinct; mod array_agg; mod average; #[macro_use] mod binary; mod case; mod cast; mod coercion; mod column; mod count; mod cume_dist; mod get_indexed_field; mod in_list; mod is_not_null; mod...
Rust
0
type(&self, icon_type: IconType) -> io::Result<Image> { let element = self.find_element(icon_type)?; if let Some(mask_type) = icon_type.mask_type() { let mask = self.find_element(mask_type)?; element.decode_image_with_ma...
Rust
0
t hi bits on count. _zeros = jnp.zeros_like(counts_lo) k1 = jnp.reshape(key_ref[0, 0], (1, 1)) k2 = jnp.reshape(key_ref[0, 1], (1, 1)) o1, o2, _, _ = philox_4x32(_zeros, counts_lo, _zeros, _zeros, k1, k2) if fuse_output: out_bits = o1 ^ o2 out_ref[...] = out_bits.reshape(out_ref.shape) ...
Python
1
bludgeon to prevent shadowing via both `shadow` directly, as well /// as overriding any of the functions within, as if all functions were declared /// as `nomask`. pub no_shadow: bool, /// Prevent the master object from being unloaded from memory, even if all clones /// have been removed from the ...
Rust
0
.set_assoc(&sub_beta.extract_from_mbe(&parts, f)); } res } Basic(n_s, _) | SameAs(n_s, _) | BoundButNotUsable(n_s) | Underspecified(n_s) | Protected(n_s) => f(parts.get_leaf_or_panic(&n_s)).clone(), } } }...
Rust
0
check_constraint( "geom_iff_address", "page_versions", "(geom IS NULL) = (address IS NULL)", ) # "references" is a postgres keyword so need to quote it op.execute('ALTER TABLE "references" DROP CONSTRAINT ck_references_host_request_id_xor_friend_reference') op.create_check_constr...
Python
1
fn test_overflow() { new_test_ext().execute_with(|| { crate::pallet::NextKittyId::<Test>::mutate(|x| *x = u32::MAX - 3); assert_ok!(KittiesModule::create_kitty(Origin::signed(100))); assert_ok!(KittiesModule::create_kitty(Origin::signed(100))); assert_ok!(KittiesModule::breed_kitty( ...
Rust
0
<Instructions> { input .lines() .map(Instruction::try_from) .collect::<Result<Vec<Instruction>, _>>() } fn apply_instructions(instructions: Instructions) -> (HashMap<String, i32>, i32) { let mut registers: HashMap<String, i32> = HashMap::new(); let mut highest_value = 0; for i ...
Rust
0
""" Write a python function which takes a list of integers and only returns the odd ones. assert Split([1,2,3,4,5,6]) == [1,3,5] """ def Split(lst): return [x for x in lst if x % 2 == 1]
Python
1
a)?.tags, &mut temp); return Some(true); } if manager.workspaces.len() == 1 { let last = manager .focused_tag_history .get(1) .map(std::string::ToString::to_string)?; let tag_index = manager.tags.iter().position(|x| x.id == last)? + 1; return ...
Rust
0
ENW { _ADC_SH_MODE_ENW { w: self } } #[doc = "Bit 27 - 27:27\\] Trim value for DDI_0_OSC:ATESTCTL.ATESTLF_RCOSCLF_IBIAS_TRIM."] #[inline] pub fn atestlf_rcosclf_ibias_trim(&mut self) -> _ATESTLF_RCOSCLF_IBIAS_TRIMW { _ATESTLF_RCOSCLF_IBIAS_TRIMW { w: self } } #[doc = "Bits 25:26 ...
Rust
0