text string | label_name string | labels int64 |
|---|---|---|
let byte: i8 = jvm.to_rust(byte).expect("byte to Rust");
res.push(byte as u8);
}
res
}
struct JavaIterator<'a> {
jvm: &'a Jvm,
it: Instance,
}
impl<'a> JavaIterator<'a> {
fn new(jvm: &'a Jvm, it: Instance) -> Self {
Self { jvm, it }
}
}
impl<'a> Iterator for JavaItera... | Rust | 0 |
]
fn hash_path_anchor_entry_def() {
assert_eq!(PathEntry::entry_def_id(), Anchor::entry_def_id(),);
assert_eq!(PathEntry::crdt_type(), Anchor::crdt_type(),);
assert_eq!(
PathEntry::required_validations(),
Anchor::required_validations(),
);
assert_eq!(PathEntry::entry_visibility(),... | Rust | 0 |
/// This is an optimized layout of `(char, u8)` values. Unicode codepoints need only 21 bits while
/// char type can has 32 bits available. This means we can technically use the high octet for the
/// value of canonical combining class of a codepoint. However, the compiler does not know that we
/// do not need the hig... | Rust | 0 |
no polyline found
return None
def dxf_merge(files, colors = range(0, 256), nolayer = False):
'merge DXF file and convert continuous line to polyline.'
# DXF file
dwg = ezdxf.new('AC1015')
msp = dwg.modelspace()
# layer vars
layer_num = 1
layer_name = 'layer0'
layer_names = []
... | Python | 1 |
(&self) -> CIType {
if let Some(c) = self.std_env.get("GITLAB_CI") {
if c == "true" {
return CIType::Gitlab;
}
}
if let Some(c) = self.std_env.get("GITHUB_ACTIONS") {
if c == "true" {
return CIType::Github;
}
... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (C) <2018-2024> <Agence Data Services, DSI France Travail>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at ... | Python | 1 |
ie to Playwright format
cookie_dict = {
'name': cookie.name,
'value': cookie.value,
'domain': cookie.domain,
'path': cookie.path,
'secure': secure,
'httpOnly': bool(cookie.has_nonstandard_attr('HttpOnly')),
... | Python | 1 |
ng("port")
.value_name("PORT")
.help("Listening port")
.validator(is_num::<u16>)
.default_value("5353"),
)
.arg(
Arg::with_name("proxy")
.long("proxy")
.value_n... | Rust | 0 |
fst::MapBuilder");
let i1 = builder.insert("abcd")?;
fst_builder.insert("a", i1 as u64).expect("fst insert");
let i2 = builder.insert("efgh")?;
fst_builder.insert("b", i2 as u64).expect("fst insert");
builder.finish();
fst_builder.finish().expect("Unable to finish build of fst::MapBuilder");
let... | Rust | 0 |
dictor = GRNAEffectivenessPredictor()
# Test training
training_results = predictor.train_model()
assert 'accuracy' in training_results
assert 'feature_importance' in training_results
# Test prediction
result = predictor.predict_effectiveness(0.5, 1)
... | Python | 1 |
= args.path;
check_unstable(state, "Deno.dlopen");
let permissions = state.borrow_mut::<FP>();
permissions.check(Some(&PathBuf::from(&path)))?;
let lib = Library::open(&path).map_err(|e| {
dlopen::Error::OpeningLibraryError(std::io::Error::new(
std::io::ErrorKind::Other,
format_error(e, path)... | Rust | 0 |
will not work correctly."
);
0
},
}
}
}
<reponame>matyama/rust-examples<filename>src/orphan.rs<gh_stars>0
//! This module demonstrates *Orphan rules* and *coherence* of Rust's trait system.
//!
//! # Coherence
//! *Coherence* can informally be understood as a property of trait implementations (typeclass... | Rust | 0 |
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 1 |
AppSettings::ArgRequiredElseHelp)
.setting(AppSettings::ColoredHelp)
.setting(AppSettings::ColorAlways)
.after_help("")
.arg(
Arg::with_name("help")
.short("h")
.long("help")
.help("Print this hel... | Rust | 0 |
Station latitude: 47.68
Station longitude: -117.63
Station elevation: 728.0
Showalter index: 21.63
Lifted index: 23.20
LIFT computed using virtual temperature: 23.21
... | Rust | 0 |
.signature);
let nonce = 9;
let mut packet = repair_response_packet_from_bytes(
shred.payload,
&SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080),
nonce,
)
.unwrap();
packet.meta.repair = true;
let leader_slots = [(slot, k... | Rust | 0 |
$(
$(#[$variant_meta])*
$value_name = $value_int
),+
}
impl $crate::RemoteEnum for $enum_name {
fn from_value(value: i64) -> Option<Self> {
match value {
$( $value_int => Some($enum_name::$value_nam... | Rust | 0 |
#!/usr/bin/env python3
import sys
import numpy as np
def LargestSquareOfOnes(mat):
mat = mat.copy()
bestval = -1
bestloc = None
for y in range(data.shape[0]-2,-1,-1):
for x in range(data.shape[1]-2,-1,-1):
if mat[y,x]>0:
mat[y,x] = min(mat[y+1,x],mat[y,x+1],mat[y+1,x+1])+1
if mat... | Python | 1 |
anager):
"""Plain API Token Manager
:param openapi_key: OpenAPI key
:type openapi_key: str
:param logger: Logger object
:type logger: logging.Logger
:keyword kwargs: Optional keyword arguments
:paramtype kwargs: Dict
"""
def __init__(self, openapi_key: str, logger: logging.Logger, ... | Python | 1 |
3f(s: f32, t: f32, r: f32);
#[doc = "*Required features: `\"Win32_Graphics_OpenGL\"`*"]
pub fn glTexCoord3fv(v: *const f32);
#[doc = "*Required features: `\"Win32_Graphics_OpenGL\"`*"]
pub fn glTexCoord3i(s: i32, t: i32, r: i32);
#[doc = "*Required features: `\"Win32_Graphics_OpenGL\"`*"]
pub fn... | Rust | 0 |
)),
Box_::into_raw(f),
)
}
}
fn connect_pad_removed<F: Fn(&Self, &Pad) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn pad_removed_trampoline<P, F: Fn(&P, &Pad) + Send + Sync + 'static>(
this: *mut gs... | Rust | 0 |
wc_ecma_ast::JSXAttr;
use swc_ecma_ast::JSXAttrOrSpread;
use swc_ecma_ast::JSXAttrValue;
use swc_ecma_ast::JSXEmptyExpr;
use swc_ecma_ast::JSXExpr;
use swc_ecma_ast::JSXExprContainer;
use swc_ecma_ast::JSXMemberExpr;
use swc_ecma_ast::JSXObject;
use swc_ecma_ast::KeyValueProp;
use swc_ecma_ast::Lit;
use swc_ecma_ast::M... | Rust | 0 |
{ elapsed_seconds: 0.0 });
//! // a system fn which loops through Position and Velocity components, and reads
//! // the Time shared resource.
//! #[system(for_each)]
//! fn update_positions(pos: &mut Position, vel: &Velocity, #[resource] time: &Time) {
//! pos.x += vel.dx * time.elapsed_seconds;
//! pos.y += ... | Rust | 0 |
Operand::GtEqual => write!(f, ">="),
Operand::And => write!(f, "and"),
Operand::Or => write!(f, "or"),
Operand::Not => write!(f, "not"),
}
}
}
impl fmt::Display for Operand {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.lua(f)
... | Rust | 0 |
r_n for _ in range(n)]
return roots, weights
def lagpoly(n, single=True):
result = [Polynomial([(0, 1)]), Polynomial([(0, 1), (1, -1)])]
for i in range(2, n + 1):
result.append((Polynomial([(0, 2 * i - 1), (1, -1)]) * result[-1] - Polynomial([(0, i - 1)]) * result[-2]) / i)
return result[n] if... | Python | 1 |
::new(-1.0, 1.0, 0.0),
a_color: Vector3::new(0.0, 1.0, 0.0),
},
FooAttr {
a_offset: Vector3::new(0.0, 0.0, 1.0),
a_color: Vector3::new(0.0, 0.0, 1.0),
},
],
BufferDataUsage::StaticDraw,
);
let indices = Indices:... | Rust | 0 |
Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r" Value of the field as raw bits"]
#[inline]
... | Rust | 0 |
, localhost will either resolve to a ipv4 or
// an ipv6 addr.
match c.http_bind_address {
SocketAddr::V4(so) => {
assert_eq!(so, SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 1234))
}
SocketAddr::V6(so) => assert_eq!(
so,
... | Rust | 0 |
# Copyright 2020 DeepMind Technologies Limited.
#
# 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 ag... | Python | 1 |
awListNil() -> *mut ImDrawList;
}
extern "C" {
pub fn igGetBackgroundDrawListViewportPtr(viewport: *mut ImGuiViewport) -> *mut ImDrawList;
}
extern "C" {
pub fn igGetForegroundDrawListViewportPtr(viewport: *mut ImGuiViewport) -> *mut ImDrawList;
}
extern "C" {
pub fn igGetDrawListSharedData() -> *mut ImDraw... | Rust | 0 |
import google.generativeai as genai
import PIL.Image
import requests, io, os
genai.configure(api_key=os.getenv("GEMAPI"))
model = genai.GenerativeModel("gemini-1.5-flash")
def getAlt(src):
try:
response = requests.get(src)
image = PIL.Image.open(io.BytesIO(response.content))
respo... | Python | 1 |
on
app[AppKeys.GH_CLIENT] = gh_aiohttp.GitHubAPI(client_session.client_session, 'ci', oauth_token=oauth_token)
app[AppKeys.BATCH_CLIENT] = await BatchClient.create('ci')
exit_stack.push_async_callback(app[AppKeys.BATCH_CLIENT].close)
app[AppKeys.DB] = Database()
await app[AppKeys.DB].async_init()
... | Python | 1 |
import random
print("Bonjour & bienvenue 👋\n")
user_name = input("Saisissez votre nom d'utilisateur : ")
user_rules = input("Souhaitez-vous voir les règles du jeu ? [Y/N] ").strip().lower()
if user_rules == "y":
print("Les règles sont simples :")
print("")
print("- Le but est de trouver le bon nombre, v... | Python | 1 |
review_cend = {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
}
},
"required": [
"status"
]
}
| Python | 1 |
,
}),
SET => Ok(Wql::UpdateSet {
name: entity.to_string(),
id,
content,
}),
_ => Err(WqlError::Plain(format!(
"Couldn't parse input `{}` as UPDA... | Rust | 0 |
ption:
reader.close()
break
if step % 1000 == 0:
print(f"{datetime.datetime.now()}: load "
f"{step * reader_batch_size} nodes.")
ids = torch.tensor([feat[0] for feat in feature_list], dtype=torch.long)
_, original_index = torch.sort(ids)
if isinsta... | Python | 1 |
0] as *mut CGDirectDisplayID,
&mut count,
);
if err != CGDisplayNoErr {
return Err("Error getting list of displays.");
}
// Get screenshot of requested display
let disp_id = disps[screen];
let cg_img = CGDisplayCrea... | Rust | 0 |
fn generate_jawiki_ut(article: &str, ids: &str, out: Arc<Mutex<Vec<String>>>, re_remove_chars: Regex, re_ref: Regex, re_chars: Regex) {
// タイトルから表記を作る
// タイトルを取得
let title = if let Some((title, _)) = article.split_once("</title>") {
if let Some((_, title)) = title.split_once("<title>") {
... | Rust | 0 |
# Copyright 2015 Ufora 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 i... | Python | 1 |
>0
use casbin::{CoreApi, DefaultModel, Enforcer, FileAdapter, RbacApi};
use std::io;
use std::sync::RwLock;
use ntex::web::{self, middleware, App, HttpRequest, HttpResponse};
/// simple handle
async fn success(
enforcer: web::types::Data<RwLock<Enforcer>>,
req: HttpRequest,
) -> HttpResponse {
let mut e =... | Rust | 0 |
import os
# timeout = 30
errorlog = '/var/log/gunicorn/error.log'
accesslog = '/var/log/gunicorn/access.log' | Python | 1 |
"""empty message
Revision ID: 4271993c2d0a
Revises: 0279bf0ce97f
Create Date: 2024-03-28 16:46:16.168879
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4271993c2d0a'
down_revision = '0279bf0ce97f'
branch_labels = None
depends_on = None
def upgrade():
# ... | Python | 1 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
5px;
}
QPushButton:hover {
background-color: #777777;
}
"""
MainWindow.setStyleSheet(dark_stylesheet)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle("Kelime Uygulaması")
def yenikelime(self):
row = self.gridLayout.rowCount()
... | Python | 1 |
library.
///
/// - `logfile` - The file that is used to output the log messages.
/// - `level` - Minimum level to output.
/// - `err` - Pointer to a list of errors. If any error occured, this list will be non-empty.
///
/// # Safety
///
/// This functions dereferences the `err` pointer and is therefore unsafe.
#[no_ma... | Rust | 0 |
.#
#.###.# D E C H #.#.#.#
#.#...# #...#.#
#.###.# #.###.#
#.#....OA WB..#.#..ZH
#.###.# #.#.#.#
CJ......# #.....#
####### ###... | Rust | 0 |
conditions() {
let threads = 8;
let players_per_thread = 100000;
let max_players = threads * players_per_thread / 2;
let count = PlayerCount::new(max_players);
let num_added = AtomicU32::new(0);
thread::scope(|s| {
for _ in 0..threads {
s.sp... | Rust | 0 |
html_file = f"{self.output_dir}/page_{url.replace('/', '_').replace(':', '')}.html"
with open(html_file, 'w', encoding='utf-8') as f:
f.write(html)
print(f" 📁 HTML saved: {html_file}")
except Exception as e:
... | Python | 1 |
ce");
}
}
}
}
//! Tests auto-converted from "sass-spec/spec/css/plain/hacks.hrx"
#[test]
#[ignore] // wrong result
fn test() {
assert_eq!(
crate::rsass(
"@import \"plain\";\
\n"
)
.unwrap(),
".hacks {\
\n *x: y;\
\n :... | Rust | 0 |
def explain_prediction(sample_input, env_pred_label, bact_pred_label):
reasons = []
if env_pred_label in ['Poor', 'Moderate']:
if sample_input['DissolvedOxygen (mg/L)'] < 5:
reasons.append("🔴 Dissolved oxygen is below optimal level (< 5 mg/L).")
if sample_input['pH'] < 6.5 or sampl... | Python | 1 |
!($Name;$T);
impl $Name {
env_funs!($env);
}
};
($(#[$outer:meta])* pub secs struct $Name:ident($T:ty, env=$env:expr);) => {
__new_type_base!($(#[$outer])*;$Name;$T);
__new_type_base_copy_ext!($Name;$T);
impl $Name {
env_funs!($env);
p... | Rust | 0 |
&mut I,
) -> (Implemented<'b, S>, ShutdownHandle)
where
T: Timestamp + Lattice,
I: ImplContext<T>,
S: Scope<Timestamp = T>,
{
let (relation, mut shutdown_handle) =
self.plan.implement(nested, local_arrangements, context);
let key_offsets: Vec<usize> = sel... | Rust | 0 |
have drawn {} letter{}, {} left'.format(len(lst), 's' if len(lst) > 1 else '', (7-len(lst))))
print('Current letters drawn: {}'.format(lst))
else:
print('You have drawn {} letters'.format(len(lst)))
return lst
def enter_word():
"""User inputs a word and this function will retu... | Python | 1 |
"""
WSGI config for django_structlog_demo_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the... | Python | 1 |
let mut series_ydata = vec![];
let mut series_names = vec![];
let mut rng = thread_rng();
let mut sample_num = 0usize;
let (mut x, mut y): (f64, f64);
while sample_num < num_samples {
let row = rng.gen_range(0, rows as isize);
... | Rust | 0 |
import os
from unittest.mock import patch
import requests_mock
from truss.base.truss_config import ExternalData
from truss.util.download import download_external_data
TEST_DOWNLOAD_URL = "http://example.com/some-download-url"
def test_download(tmp_path):
mocked_download_content = b"mocked content"
with pat... | Python | 1 |
([self.width, self.height], resample=2) # resize
img_numpy = np.array(img) # astype numpy
outputs.append(img_numpy)
outputs = np.asarray(outputs)
outputs = outputs.transpose([0, 3, 1, 2]) # [num, h, w, 3] --> [num, 3, h, w]
outputs = outputs / 255. # [0,... | Python | 1 |
///
/// * `height` - The height of the block to fetch
async fn get_block_header(&self, height: u32) -> Result<Option<Vec<u8>>, Error>;
/// Returns the (little endian) hash of a block
///
/// # Arguments
///
/// * `height` - The height of the block to fetch
async fn get_block_hash(&... | Rust | 0 |
D_W {
DATAVD_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Master Clock Configuration Register 1\n\nThis register you can [`read`](crate::generic::Reg:... | Rust | 0 |
#-----------------------------------------------------------------------------
# Copyright (c) 2008 by David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""
The netaddr.contrib n... | Python | 1 |
let logging_directory_file = format!("{}/error.log", get_logging_directory());
let path = std::path::Path::new(logging_directory_file.as_str());
let mut file = if path.exists() {
std::fs::OpenOptions::new()
.append(true)
.open(logging_directory_file)?
} else {
std::f... | Rust | 0 |
"""Ddoctest tests.
Ddoctest extends doctest by calling numpy.allclose so
numeric differences that fall under a specified tolerance
will pass.
To make existing script.py scripts work:
Add "from Dutils import Ddoctest" after "import doctest".
By default, Ddoctest passes the following parameters
to numpy.allclose:
rel... | Python | 1 |
relt_pose = aug_trans @ np.matmul(np.linalg.inv(tgt_pose), src_pose)
src_pts += (
np.random.rand(src_pts.shape[0], 3) - 0.5
) * self.config.train.augmentation_noise
tgt_pts += (
np.random.rand(tgt_pts.shape[0], 3) - 0.5
) * self.config.... | Python | 1 |
al Multiplexing Power Save
4 greenfield, // HT-Greenfield.
5 short_gi_20, // Short Guard Interval for 20 MHz
6 short_gi_40, // Short Guard Interval for 40 MHz
7 tx_stbc,
8..=9 rx_stbc, ... | Rust | 0 |
title: String,
author: Author,
thumbnail: String,
footer: Footer,
}
impl NoChokeEmbed {
pub async fn new<'i, S>(
user: &User,
scores_data: S,
unchoked_pp: f32,
rank: Option<usize>,
ctx: &Context,
pages: (usize, usize),
) -> Self
where
S: I... | Rust | 0 |
def test_callback_cfg(self):
sig = inspect.signature(self.pipeline_class.__call__)
has_callback_tensor_inputs = ('callback_on_step_end_tensor_inputs' in
sig.parameters)
has_callback_step_end = 'callback_on_step_end' in sig.parameters
if not (has_callback_tensor_inputs and has_callback_step_end):... | Python | 1 |
esult<LineSpan<'_>, Token<'_>> {
map(_string, Token::String)(input)
}
// `"` *take_until* `"`
fn _string(input: LineSpan<'_>) -> IResult<LineSpan<'_>, &str> {
let (span, (_, lit, _)) = tuple((tag("\""), take_until("\""), tag("\"")))(input)?;
Ok((span, &lit))
}
// *_signed_integer*
fn signed_integer(input:... | Rust | 0 |
alert argument")
.possible_values(&["title", "title-price", "json", "csv"])
.default_value("title-price")
.long_help("Shape of the alert argument. \
title: single line string with title only \
title-price: same as title but list of prices appended to ... | Rust | 0 |
miniseed-rs
extern crate git2;
use std::env;
use std::process::Command;
use git2::Repository;
fn main() {
let url = "https://gitlab.isti.com/TIM/libmseed";
match Repository::clone(url, "src/libmseed") {
Ok(_repo) => {},
Err(e) => {
match e.code() {
git2::ErrorCode... | Rust | 0 |
import torch
import numpy as np
def faceshifter_batch(source_emb: torch.tensor,
target: torch.tensor,
G: torch.nn.Module) -> np.ndarray:
"""
Apply faceshifter model for batch of target images
"""
bs = target.shape[0]
assert target.ndim == 4, "targe... | Python | 1 |
nsfer by issuing a START and arbitrating for the bus. - 0 - STOP is not issued after this byte, regardless of whether or not the Tx FIFO is empty. If the Tx FIFO is not empty, the master continues the current transfer by sending/receiving data bytes according to the value of the CMD bit. If the Tx FIFO is empty, the ma... | Rust | 0 |
# ===============================
# Program Pengelolaan Nilai Mahasiswa
# ===============================
# Dictionary untuk nyimpen data mahasiswa
# Format: {"nama": nilai}
data_mahasiswa = {}
def tambah_data():
nama = input("Masukkan nama mahasiswa: ").strip()
if not nama:
print("Nama tidak boleh ko... | Python | 1 |
ate_optimizer(model, config.optimizer.lr)
lr_scheduler = create_basic_lr_scheduler(
optimizer, config.training.warmup_steps, config.training.steps, config.optimizer.lr, config.optimizer.lr_end
)
lr_scheduler_config = ScheduleConfig(
config.optimizer.lr_schedule,
... | Python | 1 |
me_lbl.place(x=screenwidth/1.3125, y=screenheight/2.7)
monster_health_lbl = Label(root, text=f"{m_health}", font=('', 32, 'bold'), bg='#a2cad3')
monster_health_lbl.place(x=screenwidth/1.225, y=screenheight/2.2)
# Label where all actions are displayed
action_label = Label(root, text="A " + m_name + "... | Python | 1 |
'o', b'o', // SSID
1, 6, // supp_rates id and length
12, 24, 48, 54, 96, 108, // supp_rates
][..]);
#[rustfmt::skip]
assert_eq!(&m.fake_device.wlan_queue[1].0[..], &[
// Mgmt header:
0b0100_00_00, 0b00000000, // FC
0, 0, // Duration
... | Rust | 0 |
mon_data::CharacterCommonData;
use crate::character::character_sub_stat::CharacterSubStatFamily;
use crate::character::{CharacterConfig, CharacterName, CharacterStaticData};
use crate::character::skill_config::CharacterSkillConfig;
use crate::character::traits::{CharacterSkillMap, CharacterSkillMapItem, CharacterTrait}... | Rust | 0 |
# SNMP MIB module (T21-MIB) expressed in pysnmp data model.
#
# This Python module is designed to be imported and executed by the
# pysnmp library.
#
# See https://www.pysnmp.com/pysnmp for further information.
#
# Notes
# -----
# ASN.1 source file:///Users/rob/MIBs/t21_45297/T21-MIB.mib
# Produced by pysmi-1.6.1 at Sa... | Python | 1 |
from langchain_community.document_loaders.iugu import IuguLoader
__all__ = ["IuguLoader"]
| Python | 1 |
rigin::signed(ALICE),
BOB,
MockCurrencyId::BTC,
schedule,
));
assert_ok!(Vesting::claim_for(Origin::signed(ALICE), BOB, MockCurrencyId::BTC));
assert_eq!(
Tokens::locks(&BOB, MockCurrencyId::BTC).get(0),
Some(&BalanceLock { id: VESTING_LOCK_ID, amount: 20_u64 })
);
assert!(VestingSchedules::<... | Rust | 0 |
early = keras.callbacks.EarlyStopping(monitor='val_loss', min_delta=1e-4, patience=10, verbose=0, mode='auto')
redu = keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.1, patience=5, verbose=1, mode='auto')
model.fit(data[0], data[1],
validation_split=val_split,
... | Python | 1 |
context: &CompilationContext,
) -> Option<CompilationResult> {
Some(RefValidator::compile(reference, context))
}
// Copyright © 2019 <NAME>, <NAME>
// [This program is licensed under the "MIT License"]
// Please see the file LICENSE in the source
// distribution of this software for license terms.
//! This code t... | Rust | 0 |
"""
Binary logit model
==================
Example of a binary logit model.
Two alternatives: Train and Car.
:author: Michel Bierlaire, EPFL
:date: Wed Apr 12 17:58:18 2023
"""
import biogeme.biogeme as bio
from biogeme import models
from biogeme.expressions import Beta
# %%
# See the data processing script: :ref:... | Python | 1 |
import wx
import eos.db
import gui.mainFrame
from gui import globalEvents as GE
from gui.fitCommands.calc.module.changeCharges import CalcChangeModuleChargesCommand
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
class GuiChangeProjectedModuleChargesCommand(wx.Command):
de... | Python | 1 |
] // documentation missing in model
Russell,
#[allow(missing_docs)] // documentation missing in model
Salli,
#[allow(missing_docs)] // documentation missing in model
Seoyeon,
#[allow(missing_docs)] // documentation missing in model
Takumi,
#[allow(missing_docs)] // documentation missing ... | Rust | 0 |
: Key, V> IndexMut<&str> for NamedSlotMap<K, V> {
#[inline]
fn index_mut (&mut self, id: &str) -> &mut Self::Output {
self.get_mut(self.find_key(id).expect("Attempted NamedSlotMap[ID] access to invalid ID")).unwrap()
}
}
/// An iterator of (ID, Value) for a NamedSlotMap
pub struct IDIter<'a, K: Key... | Rust | 0 |
-> FLAC__StreamDecoderInitStatus;
}
extern "C" {
pub fn FLAC__stream_decoder_init_ogg_FILE(
decoder: *mut FLAC__StreamDecoder,
file: *mut FILE,
write_callback: FLAC__StreamDecoderWriteCallback,
metadata_callback: FLAC__StreamDecoderMetadataCallback,
error_callback: FLAC__Str... | Rust | 0 |
s(0x0013, 0x0080)
ChrSetFlags(0x0014, 0x0080)
ChrSetFlags(0x0015, 0x0080)
def _loc_41C(): pass
label('loc_41C')
If(
(
(Expr.TestScenaFlags, ScenaFlag(0x02C1, 3, 0x160B)),
Expr.Ez,
(Expr.PushValueByIndex, 0x4),
(Expr.PushLong, 0x8),
... | Python | 1 |
import time
class Stopwatch:
"""
A class representing a stopwatch for measuring elapsed time.
Attributes:
elapsed (float): The elapsed time in seconds.
is_running (bool): A flag indicating whether the stopwatch is running
"""
elapsed = 0
is_running = False
def __enter__(... | Python | 1 |
cil
type WeightInfo = weights::evm::WeightInfo<Runtime>;
#[cfg(feature = "with-ethereum-compatibility")]
fn config() -> &'static evm::Config {
&ISTANBUL_CONFIG
}
}
impl module_evm_bridge::Config for Runtime {
type EVM = Evm;
}
parameter_types! {
// note: if we add other native tokens (USDG) we have to set na... | Rust | 0 |
"""
Example sentences to test spaCy and its language models.
>>> from spacy.lang.te import Telugu
>>> nlp = Telugu()
>>> from spacy.lang.te.examples import sentences
>>> docs = nlp.pipe(sentences)
"""
sentences = [
"ఆపిల్ 1 బిలియన్ డాలర్స్ కి యూ.కె. స్టార్ట్అప్ ని కొనాలని అనుకుంటుంది.",
"ఆటోనోమోస్ కార్లు భీమ... | Python | 1 |
{ mem::transmute(value as u8) })
} else {
Err(IcedError::new("Invalid PrefixKind value"))
}
}
}
#[test]
#[rustfmt::skip]
fn test_prefixkind_try_from_usize() {
for value in PrefixKind::values() {
let converted = <PrefixKind as TryFrom<usize>>::try_from(value as usize).unwrap();
assert_eq!(converted, value)... | Rust | 0 |
#
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2025 Carsten Igel.
#
# This file is part of simplepycons
# (see https://github.com/carstencodes/simplepycons).
#
# This file is published using the MIT license.
# Refer to LICENSE for more information
#
""""""
# pylint: disable=C0302
# Justification: Code is generated
... | Python | 1 |
e stream.
r r N r# r' r) r* r% rO r0 compressrP )r rQ s rU r
_Stream.write e ==D yyq((3DHCF==E!!!!$AQrX c ` U =R U-
sl [ U R 5 U R ... | Python | 1 |
pub struct Environment {
pub response: Option<Response>,
_psql: Postgres,
_redis: Redis,
pub credentials_db_url: String,
pub tokens_db_url: String,
pub service_addr: String,
pub other_service: String,
pub login_token: String,
pub services: Vec<Child>,
}
#[async_trait(?Send)]
impl W... | Rust | 0 |
for key in key_value_dict.keys():
if key in default.keys():
default[key] = key_value_dict[key]
return default
def camel_case_to_snake_case_dict(dictionary):
di = {}
for key, value in dictionary.items():
camel_key = re.sub(r"(?<!^)(?=[A-Z])", "_", key).lower()
d... | Python | 1 |
on_method(¬ifications.source, settings)
.await?
.try_filter_map(|ev| async move { Ok(ev.payload) })
.and_then(|payload| async move {
serde_json::from_str(&payload).map_err(FieldError::from)
});
Ok(Box::pin(stream))
... | Rust | 0 |
capacity(), 16);
/// assert_eq!(vec2.capacity(), 16);
/// ```
pub type SliceVec<'a, T, I = usize> = Vec<T, SliceStorage<'a, T>, I>;
/// A vector using an arena-allocated slice for storage.
///
/// # Examples
/// ```
/// use coca::arena::Arena;
/// use coca::collections::ArenaVec;
/// use core::mem::MaybeUninit;
///
///... | Rust | 0 |
drive.
#[serde(rename = "driveId")]
pub drive_id: String,
}
impl std::fmt::Display for DrivesDeleteParams {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Ok(())
}
}
/// Parameters for the `drives.get` method.
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub ... | Rust | 0 |
"""
对SequenceToSequence模型进行基本的参数组合测试
"""
import sys
import random
import pickle
import numpy as np
import tensorflow as tf
sys.path.append('..')
def test(params):
"""测试不同参数在生成的假数据上的运行结果"""
from sequence_to_sequence import SequenceToSequence
from data_utils import batch_flow
from word_sequence impo... | Python | 1 |
; 32]).expect("32 bytes, within curve order");
let addr2 = get_address(&secp, &sk2).0;
tx.add_output(TxOut::new(addr2, Coin::new(99999649).unwrap()));
let witness: Vec<TxInWitness> = vec![get_tx_witness(secp, &tx.id(), &secret_key, &merkle_tree)];
let plain_txaux = PlainTxAux::new(tx.clone(), witness.c... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.