text
string
label_name
string
labels
int64
CTXT: RequestContext<Name = CStr>, { let res_type = res.result_type(); if matches!(res_type, ResultType::Error | ResultType::Exception) { assert_eq!(res.exn_is_declared(), res_type == ResultType::Error); rctxt.set_user_exception_header(res.exn_name(), &res.exn_value())?; } ctx_sta...
Rust
0
From<&'a str> for Value { fn from(v: &'a str) -> Self { Value { value: ValueType::Atom(Primitive::from(v)), id: None, extension: Vec::new() } } } impl From<Vec<Element>> for Value { fn from(v: Vec<Element>) -> Self { Value { value: ValueType::Elt(v), id: None, extension: Vec::new() } } }...
Rust
0
from linebot import LineBotApi from linebot.models import * import os from apps.common.common import * from apps.common.dateConverter import * line_bot_api = LineBotApi(os.getenv("LINE_CHANNEL_ACCESS_TOKEN")) # 日曆 def calendarMain(event, date_obj): # 計算相差天數 diff_day = calculateDays(date_obj) # 西元 y...
Python
1
.and_then(|paths| { env::split_paths(&paths) .filter_map(|dir| { let full_path = dir.join(&name); if full_path.is_file() { Some(full_path) } else { None } }) .next() })...
Rust
0
TypeHeapDump: WER_DUMP_TYPE = 3i32; #[doc = "*Required features: 'Win32_System_ErrorReporting'*"] pub const WerDumpTypeTriageDump: WER_DUMP_TYPE = 4i32; #[doc = "*Required features: 'Win32_System_ErrorReporting'*"] pub const WerDumpTypeMax: WER_DUMP_TYPE = 5i32; #[repr(C)] #[doc = "*Required features: 'Win32_System_Err...
Rust
0
._scm.batched_call(flatten_u, t, w_t, w_e) # Batched evidence (always cpu for dataloading) batched_evidence = self._batched_evidence_type( scm=self._scm, e_batched=e.detach().to('cpu'), t_batched=t.detach().to('cpu'), w_e_batched=w_e.detach().to('cpu'), ...
Python
1
ready unlocked"); return Ok(()); } return Err(format!("Unknown state: {:?}", state)); } check_args!(args, 1); let pass = &args[1].as_ref(); if wallet.db.unlock(pass) { wallet.prompt = "unlocked>> ".to_owned(); } else { println!("Failed to unlock wallet......
Rust
0
against # the column vector [c0, c1, ..., c5] of polynomial coeffs def matrix_row(term): x, order, _value = term coeffs = np.polyder([1]*6, order).tolist() + [0] * order powers = np.arange(6).tolist()[:6-order][::-1] + [0] * order return np.array(x) ** powers * coeffs def solve_spline(terms): matr...
Rust
0
msg = ( "In a future version of pandas all arguments of Index.set_names " "except for the argument 'names' will be keyword-only" ) with tm.assert_produces_warning(FutureWarning, match=msg): result = idx.set_names("quarter", None) expected = Index([1, 2, 3, 4], name="quarter") ...
Python
1
) as usize][(y) as usize]; } // Enter your code here. fn count_routes(mut x: i32, mut y: i32) -> i32 { if x == 0 || y == 0 { return 1; } let xn = x.abs() as u64; let yn = y.abs() as u64; let facboi = notnice(xn, yn); return (facboi % 1000) as i32; } fn main() { let mut in...
Rust
0
tion."] #[repr(C)] #[derive(Copy, Clone)] pub struct rte_eth_global_cfg { #[doc = "< Global config type."] pub cfg_type: rte_eth_global_cfg_type, pub cfg: rte_eth_global_cfg__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union rte_eth_global_cfg__bindgen_ty_1 { #[doc = "< Valid GRE key length in...
Rust
0
for line in crate::input!(8).lines() { let digits = line.split_at(61).1.split_whitespace(); for digit in digits { unique_digits += match digit.len() { 2 | 3 | 4 | 7 => 1, _ => 0, } } } println!("{unique_digits}") } fn to_bit...
Rust
0
mut GtkStockItem, n_items: c_uint); pub fn gtk_stock_add_static(items: *mut GtkStockItem, n_items: c_uint); pub fn gtk_stock_list_ids() -> *mut glib::GSList; pub fn gtk_stock_lookup(stock_id: *const c_char, item: *mut GtkStockItem) -> gboolean; pub fn gtk_stock_set_translate_func(domain: *const c_char, ...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 7 12:34:08 2021 @author: mcerdeiro """ # tabla_informe.py import csv #%% def leer_camion(nombre_archivo): '''Computa el precio total del camion (cajones * precio) de un archivo''' camion = [] with open(nombre_archivo, 'rt') as f: ...
Python
1
pub fn is_h_counter(&self) -> bool { *self == SETCLR9R::H_COUNTER } } #[doc = "Possible values of the field `SETCLR10`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SETCLR10R { #[doc = "Independent. Set and clear do not depend on any counter."] INDEPENDENT, #[doc = "L counter. Set and...
Rust
0
: account.vesting_amount, vested_amount, vesting_schedule: account.vesting_schedule, claimable_amount: vested_amount.checked_sub(account.claimed_amount)?, }) } Ok(VestingAccountResponse { address, vestings }) } #![allow(clippy::manual_assert)] use efg::efg; macro_r...
Rust
0
"mov rsp, $1;", "mov rbp, $2;", "mov r12, $3;", "mov r13, $4;", "mov r14, $5;", "mov r15, $6;", "jmp $7" ) :: "*m"(rbx), "*m"(rsp), "*m"(rbp), "*m"(r12), "*m"(r13), "*m"(r14), "*m"(r15), "*m"(rip) :: "intel", "volatile"...
Rust
0
t_at(output_len); let mut naive_output = vec![0f32; output_len]; let mut fast_output = vec![0f32; output_len]; let naive_mdct = MdctNaive::new(output_len, current_window_fn); let inner_dct4 = Arc::new(Type4Naive::new(output_len)); let fa...
Rust
0
ucky_number(13)); assert!(is_lucky_number(17)); assert!(is_lucky_number(41)); } #[test] fn is_triangular_number_test() { assert!(is_triangular_number(3)); assert!(is_triangular_number(7)); assert!(is_triangular_number(13)); assert!(is_triangular_number(31)); } //#[bench] //fn bench_is_prime(b:...
Rust
0
#Exercises: Day 9 #Exercises: Level 1 #while True: # user_input=int(input("Enter your age: ")) # if user_input >= 18: # print("You are old enough to drive.") # elif user_input<18: # print(f"You need {18-user_input} more years to learn to drive.") # break #my_age = int(input("Enter my age: ")) #your_age = int(...
Python
1
# # Copyright 2016 Google Inc. # # 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 applicable law or agreed to in writing...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.construct import init from .app_table_view_property_filter_info import AppTableViewPropertyFilterInfo from .app_table_view_property_hierarchy_config import AppTableViewPropertyHierarchyCon...
Python
1
_eq!(value, i.to_string()); count += 1; } assert_eq!(count, 5); { let position_entry = scratchpad.get_entry::<_, IteratorPosition<u32>>("map"); assert_eq!(position_entry.get(), Some(IteratorPosition::Ended)); } // The iterator is ended now. ...
Rust
0
Normal(0, 1).log_prob(x_prior) * padding_mask.unsqueeze(-1)) ll_q = ll_gmm + ll_prior + torch.sum(logdet) loss = (ll_p - ll_q) / x_noised.numel() # backward pass and optimizer step loss.backward() opt.step() opt.zero_grad() sch...
Python
1
} } #[doc = "Checks if the value of the field is `HFXT2_ON_0`"] #[inline(always)] pub fn is_hfxt2_on_0(&self) -> bool { *self == HFXT2_ON_A::HFXT2_ON_0 } #[doc = "Checks if the value of the field is `HFXT2_ON_1`"] #[inline(always)] pub fn is_hfxt2_on_1(&self) -> bool { *s...
Rust
0
ing -------------- class Dictionary(object): def __init__(self): self.word2idx = {} self.idx2word = {} self.idx = 0 def add_word(self, word): if not word in self.word2idx: self.word2idx[word] = self.idx self.idx2word[self.idx] = word self....
Python
1
import random import numpy as np import skimage.color as sc import torch def get_patch(*args, patch_size=96, scale=2, multi=False, input_large=False): try: ih, iw = args[0].shape[:2] except: ih, iw = args[0][0]['image'].shape[:2] if not input_large: p = scale if multi else 1 ...
Python
1
# /////////////////////////////////////////////////////////////// # # BY: WANDERSON M.PIMENTA # PROJECT MADE WITH: Qt Designer and PySide6 # V: 1.0.0 # # This project can be used freely for all uses, as long as they maintain the # respective credits only in the Python scripts, any information in the visual # interface ...
Python
1
Args: region (str): Region to screen limit (int): Maximum number of results Returns: pandas.DataFrame: DataFrame with high dividend stocks """ criteria = self.default_criteria.copy() criteria['min_dividend_yield'] = 5.0 # Higher dividen...
Python
1
modulation: entry.parse_column(&AR_CM_DOC30_IF_UP_CHANNEL_EXTENDED_MODULATION)?, }) } } const DOCS_IF3_CM_STATUS_US_TABLE: OID = OID::new("1.3.6.1.4.1.4491.2.1.20.1.2"); // docsIf3CmStatusUsTable const DOCS_IF3_CM_STATUS_US_TX_POWER: OID = OID::new("1.3.6.1.4.1.4491.2.1.20.1.2.1.1"); // docsIf...
Rust
0
/// /// This interface should be used by plugins that wish to register themselves as the engine's /// event provider. Anything that implements this should correctly handle creating and /// destroying whatever is needed to access the system's event queue, and should be able to give out /// an `AnyArc<IEvents>` to allow ...
Rust
0
"""modulo que gera dados de exemplo para testes.""" import random import pandas as pd from faker import Faker def generate_absenteeism_data(): """ Generate absenteeism data for testing. type: df: pd.DataFrame """ faker = Faker("pt_BR") departments = [ "Recursos Humanos", "...
Python
1
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from SoccerNet.Evaluation.ActionSpotting import evaluate if __name__ == '__main__': # Load the arguments parser = ArgumentParser(description='Evaluation for Action Spotting', formatter_class=ArgumentDefaultsHelpFormatter) parser...
Python
1
{ adc.rb.cr2.modify(|_, w| w.adc_cfg().bit($bank_b)); adc.rb.$smprx.modify(|r, w| unsafe { const OFFSET: u8 = 3 * $chan % 10; let mut bits = r.smp().bits() as u32; bits &= !(0xfff << OFFSET); ...
Rust
0
import pickle from pathlib import Path from Logging.Logger import Logger from Models.Player import Player from Repositories.PlayerRepository.AbstractPlayerRepository import AbstractPlayerRepository # TODO check folder if not created Unit Test class PicklePlayerRepository(AbstractPlayerRepository): def __init__(se...
Python
1
</th> <th>60%ile (ms)</th> <th>70%ile (ms)</th> <th>80%ile (ms)</th> <th>90%ile (ms)</th> <th>95%ile (ms)</th> <th>99%ile (ms)</th> <th>100%ile (ms)</th...
Rust
0
n = int(input()) ugly = [0] * n # 1차원 DP 테이블 ugly[0] = 1 # 2배, 3배, 5배를 위한 인덱스 i2 = i3 = i5 = 0 # 처음에 곱셈값을 초기화 next2, next3, next5 = 2, 3, 5 # 1부터 n까지의 못생긴 수를 찾기 for l in range(1, n): # 가능한 곱셈 결과 중에서 가장 작은 수를 선택 ugly[l] = min(next2, next3, next5) # 인덱스에 따라 곱샘 결과를 증가 if ugly[l] == next2: i2 += ...
Python
1
budget_estimated_change_weekly_interactions: ::core::option::Option<i64>, /// Output only. The estimated change in weekly views if the recommended budget is applied. /// /// This field is read-only. #[prost(int64, optional, tag = "30")] pub recommended_budget_estimated_change_weekly_views: ::core::o...
Rust
0
HANDLE; fn RtlCheckForOrphanedCriticalSections( ThreadHandle: HANDLE, ); }} STRUCT!{struct RTL_RESOURCE { CriticalSection: RTL_CRITICAL_SECTION, SharedSemaphore: HANDLE, NumberOfWaitingShared: ULONG, ExclusiveSemaphore: HANDLE, NumberOfWaitingExclusive: ULONG, NumberOfActive: LO...
Rust
0
y) } } impl Sub<Point> for Point { type Output = Point; fn sub(self, other: Point) -> Point { Point { x: self.x - other.x, y: self.y - other.y } } } impl Add<Point> for Point { type Output = Point; fn add(self, other: Point) -> Point{ Point { x: self.x + other.x, ...
Rust
0
{ assert_eq!(s, format!("{}", suite)); assert_eq!(Ok(suite), s.parse()); } check_pair("S".to_string(), Spade); check_pair("H".to_string(), Heart); check_pair("D".to_string(), Dia); check_pair("C".to_string(), Club); } #[test] fn show_card() { ...
Rust
0
ssion Link(Submission), /// TODO Message(Message), /// About Subreddit Subreddit(AboutSubreddit), /// TODO Award, } use super::{client::Clerk, server::ShardKvServer}; use crate::shard_ctrler::{client::Clerk as CtrlerClerk, server::ShardCtrler, N_SHARDS}; use ::rand::distributions::Alphanumer...
Rust
0
return ({}, RiskLevel.MODERATE) def main(): # Example usage system = GlobalHealthWarningSystem(OPENAI_API_KEY) # Sample health data data = { "health_metrics": { "case_numbers": "increasing", "severity_levels": "moderate", "spread_rate": "accelerating"...
Python
1
" \\rst"] #[doc = " .. versionadded:: 1.12"] #[doc = " \\endrst"] pub fn TCOD_get_error() -> *const ::std::os::raw::c_char; } extern "C" { #[doc = " Set an error message and return TCOD_E_ERROR."] #[doc = " \\rst"] #[doc = " .. versionadded:: 1.12"] #[doc = " \\endrst"] pub fn TC...
Rust
0
a b a + b c + d break; continue pass; continue break
Python
1
/// ``` pub fn successor(&self, key: &K) -> Option<(&K, &V)> { self.root.as_ref().and_then(|node| node.successor(key)) } ///返回第一个小于key的键值对 /// # Example /// ``` /// use an_ok_avl_tree::AVLTree; /// let mut tree = AVLTree::new(); /// tree.insert(3, 'c'); /// tree.insert(...
Rust
0
import asyncio import logging import os from google.adk.agents import Agent from google.adk.models.lite_llm import LiteLlm from google.adk.runners import Runner from google.genai import types from config import get_settings from tools.weather import get_weather logging.basicConfig(level=logging.INFO) settings = get...
Python
1
#!/usr/bin/env python3 from base64 import b64decode from hashlib import sha256 import requests REPO = "certifi/python-certifi" def fetch_certdata(): r = requests.get("https://api.github.com/repos/%s/git/refs/heads/master" % REPO) assert r.status_code == 200 commithash = r.json()["object"]["sha"] r...
Python
1
the terminating double quote. // Finally, process the parameter value. // Check that we have not seen the name parameter already. if !part.name.is_empty() { self.multipart.flags.set(Flags::CD_PARAM_REPEATED); ...
Rust
0
openbsd", target_os = "redox", )))] pub use imp::termios::types::CR3; #[cfg(not(any( target_os = "dragonfly", target_os = "freebsd", target_os = "illumos", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd", target_os = "redox", )))] pub use imp::term...
Rust
0
, render_asset::RenderAssets, render_component::{ComponentUniforms, DynamicUniformIndex, UniformComponentPlugin}, render_phase::{ AddRenderCommand, DrawFunctions, EntityRenderCommand, RenderCommandResult, RenderPhase, SetItemPipeline, TrackedRenderPass, }, ...
Rust
0
context) else: weights = self.weights # Calculate total weighted delta total_delta = ( weights.performance * perf_delta + weights.efficiency * eff_delta + weights.stability * stab_delta + weights.capability * cap_delta ...
Python
1
0x01], "cvttss2si eax, dword [ecx]"); test_display(&[0xf3, 0x0f, 0x2d, 0xc1], "cvtss2si eax, xmm1"); test_display(&[0xf3, 0x0f, 0x2d, 0x01], "cvtss2si eax, dword [ecx]"); test_display(&[0x0f, 0x2e, 0x00], "ucomiss xmm0, dword [eax]"); test_display(&[0x0f, 0x2f, 0x00], "comiss xmm0, dword [eax]"); te...
Rust
0
import json text_file = "youtube.txt" def list_all_videos(videos): print("\n") print("*" * 80) for index, video in enumerate(videos, start=1): print(f"{index}. {video['name']}, Duration:{video['time']} ") print("\n") print("*" * 80) print("here are all the videos") de...
Python
1
frame: Option<(f64, Color)>, color: Color ) { let draw_state = graphics::default_draw_state(); let transform = graphics::abs_transform(win_w, win_h); if let Some((_, f_color)) = maybe_frame { draw_frame(draw_state, transform, graphics, pos, dim, f_color) } let f_width = if let Some((f_wi...
Rust
0
ht[2]]) move_dir = move_dir / np.linalg.norm(move_dir) self.velocity += move_dir * current_speed velocity_length = np.linalg.norm(self.velocity) if velocity_length > self.max_velocity: self.velocity = (self.velocity / velocity_length) * self.max_velocity def che...
Python
1
= "\n".join(assistant_thoughts_plan) elif isinstance(assistant_thoughts_plan, dict): assistant_thoughts_plan = str(assistant_thoughts_plan) # Split the input_string using the newline character and dashes lines = assistant_thoughts_plan.split("\n") for lin...
Python
1
pub fn new() -> Result<Arc<dyn ProducesTickets>, Error> { Ok(Arc::new(TicketSwitcher::new(6 * 60 * 60, generate_inner)?)) } } #[test] fn basic_pairwise_test() { let t = Ticketer::new().unwrap(); assert!(t.enabled()); let cipher = t.encrypt(b"hello world").unwrap(); let plain = t.decrypt...
Rust
0
} impl<'a, S: ReadonlyStorage> ReadonlyBalances<'a, S> { pub fn from_storage(storage: &'a S) -> Self { Self { storage: ReadonlyPrefixedStorage::new(PREFIX_BALANCES, storage), } } fn as_readonly(&self) -> ReadonlyBalancesImpl<ReadonlyPrefixedStorage<S>> { ReadonlyBalanc...
Rust
0
nel, Receiver, Sender}; use filedescriptor::{FileDescriptor, Pipe}; use portable_pty::*; use std::cell::RefCell; use std::cell::RefMut; use std::io::BufWriter; use std::io::Write; use std::rc::Rc; use std::sync::Arc; use std::time::Duration; use termwiz::caps::{Capabilities, ColorLevel, ProbeHints}; use termwiz::input:...
Rust
0
tm_errno: u32, pub rtm_fmask: u32, pub rtm_inits: u64, _rt_metrics: [u64; 14usize], } use std::future::Future; use crate::internal::{ base::{ unsafe_create_session, unsafe_run_session, Context, ContextLens, Empty, EmptyContext, PartialSession, Protocol, Session, }, ...
Rust
0
--modify--write-api).\n\nFor information about available fields see [usbhs_hstpipicr_blk_mode](usbhs_hstpipicr_blk_mode) module"] pub type USBHS_HSTPIPICR_BLK_MODE = crate::Reg<u32, _USBHS_HSTPIPICR_BLK_MODE>; #[allow(missing_docs)] #[doc(hidden)] pub struct _USBHS_HSTPIPICR_BLK_MODE; #[doc = "`write(|w| ..)` method ta...
Rust
0
s://github.com/getzola/zola/issues/816 #[test] fn leaves_custom_url_scheme_untouched() { let content = r#"[<EMAIL>](xmpp:<EMAIL>) [(123) 456-7890](tel:+11234567890) [blank page](about:blank) "#; let tera_ctx = Tera::default(); let config = Config::default(); let permalinks_ctx = HashMap::new(); ...
Rust
0
""" Classifies: CHEBI:48927 N-acyl-L-alpha-amino acid """ """ Classifies: CHEBI:59949 N-acyl-L-alpha-amino acid """ from rdkit import Chem def is_N_acyl_L_alpha_amino_acid(smiles: str): """ Determines if a molecule is an N-acyl-L-alpha-amino acid based on its SMILES string. An N-acyl-L-alpha-amino acid is ...
Python
1
""" Created on Thu Aug 31 10:33:00 2023 create dfs0 files Input files = water level dfs0 files @author: Michael Getachew Tadesse """ import numpy as np import pandas as pd import mikeio import os dir_obs = 'C:\\Users\\mtadesse\\OneDrive - Hazen and Sawyer\\Section216\\Postprocessing\\M11_scenarios_3_5' # dir_...
Python
1
# Function: Relu and normalization. Start and done signals included # Latency: 1cc # Comments: offset defined during design phase (not runtime) import pyrtl # relu and normalization def relu_nrml(din, offset): assert len(din) == 32 assert offset <= 24 dout = pyrtl.WireVector(32) dout_reg = pyrtl.Register(8) wi...
Python
1
# profile statistics # import commonly used packages import numpy as np import pandas as pd import matplotlib.pyplot as plt import xarray as xr xrod=xr.open_dataset def stats(data,mid,bottom_depth): nlines=len(data.copy()) data=data.dropna(subset=['steric']) nlines_valid=len(data) mdt=np.mean(da...
Python
1
/ // .\#########\\/.,#############/ pub mod blocks; pub use blocks::{ parse_sentence, Mem, keyword, split, regi, value_parse, first_phrase, first_clause, tree }; pub use super::runner::filesys::CURRENT_FILE as CURRENT_FILE; pub fn transpile(tree :&Mem, pivot :usize)->String { ...
Rust
0
tion('?') self.arguments = parse_qs_bytes(self.query, keep_blank_values=True) def supports_http_1_1(self): """Returns True if this request supports HTTP/1.1 semantics""" return self.version == "HTTP/1.1" @property def cookies(self): """A dictionary of Cookie.Morsel objects....
Python
1
""" In this example we train a semantic search model to search through Wikipedia articles about programming articles & technologies. We use the text paragraphs from the following Wikipedia articles: Assembly language, C , C Sharp , C++, Go , Java , JavaScript, Keras, Laravel, MATLAB, Matplotlib, MongoDB, MySQL, Natura...
Python
1
(&message); TestResult::from_bool(result.is_none()) } use crate::ffi::OsString; use crate::sys::windows::args::*; fn chk(string: &str, parts: &[&str]) { let mut wide: Vec<u16> = OsString::from(string).encode_wide().collect(); wide.push(0); let parsed = unsafe { parse_lp_cmd_line(wide.as_ptr() a...
Rust
0
html_content += f"<h3>{suite['name']}(平均提升: {suite['avg_speedup']:.2f}%)</h3>" html_content += """ <table> <tr> <th>测试用例</th> <th>RV 时间 (s)</th> <th>RVV 时间 (s)</th> <th>RV 标准差</th> <th>RVV 标准差</th> ...
Python
1
tool(**kwargs: Any) -> Any: return await self.session.call_tool(tool.name, arguments=kwargs) async def prepare_tool(ctx: RunContext, tool_def: ToolDefinition) -> ToolDefinition | None: tool_def.parameters_json_schema = tool.inputSchema return tool_def return...
Python
1
''' A 학급에 총 10명의 학생이 있다. 이 학생들의 중간고사 점수는 다음과 같다. [70, 60, 55, 75, 95, 90, 80, 80, 85, 100] for문을 이용하여 A 학급의 평균 점수를 구해 보자. ''' A = [70, 60, 55, 75, 95, 90, 80, 80, 85, 100] total = 0 for score in A : total += score average = total / len(A) print(average)
Python
1
DataLines: i32 = -201136; pub const DAQmxErrorOnlyUseRefTrigSrcPrptyWithDevDataLines: i32 = -201135; pub const DAQmxErrorPauseTrigDigPatternSizeDoesNotMatchSrcSize: i32 = -201134; pub const DAQmxErrorLineConflictCDAQ: i32 = -201133; pub const DAQmxErrorCannotWriteBeyondFinalFiniteSample: i32 = -201132; pub const DAQmxE...
Rust
0
#!/usr/bin/env python3 from utils.all import * def emu(flow, x, m, a, s): cur = 'in' while cur != 'A' and cur != 'R': insns, last = flow[cur] for exp, nxt in insns: if eval(exp): cur = nxt break else: cur = last if cur == 'A': return x + m + a + s return 0 # @log_calls_recursive() def em...
Python
1
mensaje = 'Hola Mundo' # Declaración de variables # Concatenación de caracteres mensaje1 = 'Hola' + ' ' + 'Mundo' print(mensaje1) # Multiplicación de caracteres mensaje2A = 'Hola ' * 3 mensaje2B = 'Mundo' print(mensaje2A + mensaje2B) # Añadir caracteres (desde aquí 'String Methods') mensaje3 = 'Hola' mensaje3 += ' '...
Python
1
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from copy import copy from ultralytics.models import yolo from ultralytics.nn.tasks import PoseModel from ultralytics.utils import DEFAULT_CFG, LOGGER from ultralytics.utils.plotting import plot_images, plot_results class PoseTrainer(yolo.detect.De...
Python
1
rain_eps is not None and self.num_val_eps is None: val = max(1, self.num_train_eps // 9) train = self.num_train_eps elif self.num_train_eps is None and self.num_val_eps is not None: train = 9 * self.num_val_eps val = self.num_val_eps else: trai...
Python
1
None; } /* wrong alignment */ if off + 6 > hop_by_hop_header.len() { return None; } /* truncated */ if hop_by_hop_header[off+1] != 4 { return None; } /* always 4 bytes content */ let payload_length = BigEndian::read_u32(&hop_by_hop_header[off+2..off+6]) as usize; if payload_length <= 65535 { return Non...
Rust
0
tle_tips: Vec<String>, game_over_title: String, game_over_score: String, game_over_tips: Vec<String>, } impl Source { fn new(assets: &Assets) -> Result<Self> { // ggez用にいじってるPathBufを正常な&strにする: 7れんさ let text_tmp_path = assets .show_map() .get("game_text.toml") ...
Rust
0
.0, 1.0, 1.0, 0.0, r, 0.0, 1.0, 0.0, 1.0, 1.0 ]; // vertex buffer for static geometry let geometry_vertex_buffer = Buffer::immutable(ctx, BufferType::VertexBuffer, &vertices); #[rustfmt::skip] let indices: &[u16] = &[ 0, 1, 2, 0, 2, 3, 0, 3...
Rust
0
u8 > 0); // Only run if the CPU is not built in NES mode // TODO: Make sure cpu is removed as dead code in nes builds if cfg!(feature = "binary_coded_decimal") && cpu.get_flag(StatusFlag::Decimal) { let value = value as i16; let mut sum = (cpu.accumulator & 0xf) as i16...
Rust
0
# 1. Crear la función vistos_por_ciudad, que recibe como parámetro el nombre del archivo # con las observaciones de aves. # 2. Leer el archivo con las observaciones. # 3. Agrupar las observaciones por ciudad. # 4. Ordenar las observaciones de cada ciudad por fecha (de la más antigua a la más nueva). # 5. Crear un arch...
Python
1
from django.apps import AppConfig class TodoConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'apps.todo'
Python
1
Simplex4d { Simplex4d::random(rng) } } /// Uniformly maps i32s to vectors from the origin towards the midpoint of an edge of a hypercube struct Gradient4d<const LANES: usize> where LaneCount<LANES>: SupportedLaneCount, { // Masks guiding dimension selection l24: Mask<i32, LANES>, l16: Mask...
Rust
0
("sign"); signed_witnesses.push( witness .clone() .as_builder() .lock(Some(Bytes::from(sig.serialize())).pack()) .build() .as_bytes() .pack(), ); for i in 1..witnesses_len { si...
Rust
0
.SetMuteRequest.MuteValueValuesEnum.MUTE_UNSPECIFIED ), "muted": messages.SetMuteRequest.MuteValueValuesEnum.MUTED, "unmuted": messages.SetMuteRequest.MuteValueValuesEnum.UNMUTED, "undefined": messages.SetMuteRequest.MuteValueValuesEnum.UNDEFINED, } # The muted option has to be ...
Python
1
.0, 1.0), Coord2(10.0, 10.0)); let clipped = line_clip_to_bounds(&line, &bounds); assert!(clipped.is_none()); } #[test] fn line_out_of_bounds_crossing() { let line = (Coord2(9.0, 0.0), Coord2(20.0, 9.0)); let bounds = (Coord2(1.0, 1.0), Coord2(10.0, 10.0)); let clipped = line_clip_to_bounds(&line,...
Rust
0
name co_argcountco_posonlyargcountco_kwonlyargcount co_nlocals co_stacksizer[co_flags co_consts enumerateco_names co_varnames co_freevars co_cellvarsrV)colinesZi_cZi_nrrr r^s<     r^cCstt||dd...
Python
1
ert unit_split.alternate_symbol == "LVROW" assert unit_split.alternate_cusip == "ALTCUSIP1" assert unit_split.alternate_rate == 0.3333 assert unit_split.effective_date == date(2023, 3, 1) assert unit_split.process_date == date(2023, 3, 1) stock_dividend: StockDividend = res["stock_dividends"][0] ...
Python
1
|state| state.run(), // The input here is the entire list of signed transactions, so it's pretty large. BatchSize::LargeInput, ) } } impl<K, V> BencherState<K, V> where K: Hash + Clone + Debug + Eq + Send + Sync + PartialOrd + Ord + 'static, V: Clone + Eq + Send + Sync ...
Rust
0
import matplotlib.pyplot as plt import numpy as np from joblib import Parallel, delayed import acoustotreams k0s = 2 * np.pi * np.linspace(1000, 45000, 1000) / 343 material_slab = acoustotreams.AcousticMaterial(698, 950) thickness = 0.0025 period = 0.025 lattice = acoustotreams.Lattice.square(period) materials = [ac...
Python
1
LSCH2_INT_ENA`"] pub struct OVF_CNT_LSCH2_INT_ENA_W<'a> { w: &'a mut W, } impl<'a> OVF_CNT_LSCH2_INT_ENA_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_b...
Rust
0
q!( "ssh://user@ent@127.0.0.1:2112/ent/org/proj".to_string(), conf.delivery_git_ssh_url().unwrap() ); } #[test] fn test_git_url_without_server() { let conf = Config::default(); assert!(conf.server.is_none()); assert!(conf.delivery_git_ssh_url().is_err...
Rust
0
as a bytestring, without a `0x04`-byte tag. /// /// This will be twice the modulus size, or 1-byte smaller than the /// `Elliptic-Curve-Point-to-Octet-String` encoding i.e /// with the leading `0x04` byte in that encoding removed. pub fn from_untagged_point(bytes: &GenericArray<u8, UntaggedPointSize...
Rust
0
#The Hacker Within: Python Boot Camp 2010 - Session 07 - Using SciPy. #Presented by Anthony Scopatz. # #SciPy constants, Crawl before you walk! #A plethora of important fundamental constants can be found in import scipy.constants #NOTE: this module is not automatically included when you "import scipy" #Some very basi...
Python
1
).expect("Failed to load font from memory"); // Loading a font from a file is that simple nwg::Font::add_font("./test_rc/IndieFlower-Regular.ttf"); let _app = CustomFontApp::build_ui(Default::default()).expect("Failed to build UI"); nwg::dispatch_thread_events(); nwg::Font::remove_memory_font(mem...
Rust
0
from __future__ import print_function import numpy as np import pandas as pd from scipy import misc import os, sys import itertools from bokeh.objects import ( GMapPlot, DataRange1d, Range1d, LinearAxis, Grid, ColumnDataSource, Glyph, ObjectArrayDataSource, PanTool, WheelZoomTool, ResizeTool, BoxSelectTool...
Python
1
, Arg3) }); /// Argument matcher /// /// Basically it is predicate telling whether argument /// value satisfies to some criteria. However, in case /// of mismatch it explains what and why doesn't match. pub trait MatchArg<T> { fn matches(&self, arg: &T) -> Result<(), String>; fn describe(&self) -> String; } #...
Rust
0