text string | label_name string | labels int64 |
|---|---|---|
rvals.append((beta_scan[i], beta_scan[i + 1]))
def refine_root(
f: Callable[[float], float | None], b_left: float, b_right: float
) -> float:
for _ in range(50):
b_mid = 0.5 * (b_left + b_right)
val_mid = f(b_mid)
if val_mid is None:
b_right =... | Python | 1 |
let content = vec![
("index.html", "This file is just here to cause the"),
("intro.html", "Here's some interesting text"),
("second.html", "Second Chapter"),
("first/nested.html", "testable code"),
("first/index.html", "more text"),
("conclusion.html", "Conclusion"),
... | Rust | 0 |
# Copyright 2024 Husarion sp. z o.o.
#
# 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 w... | Python | 1 |
0 - f1) < 1
if F[i+1] + F_DIFF[i+1] * rng.gen() < pdf(x) {
return x;
}
}
}
/// A wrapper around an `f64` to generate N(0, 1) random numbers (a.k.a. a
/// standard normal, or Gaussian). Multiplying the generated values by the
/// desired standard deviation `sigma` then adding the desire... | Rust | 0 |
horas_de_sono = [7, 5, 8, 6, 7.5, 8, 7]
horas_semana = 0
diass = 0
diasn = 0
meta = 7
for horas in horas_de_sono:
horas_semana += horas
if horas >= meta:
diass += 1
else:
diasn += 1
print(f"Quantidade de dias que alcançaram a meta {diass} dias\nQuantidade de dias que não alcançaram a meta: {... | Python | 1 |
extern "C" {
#[doc = " XXH128_cmp():"]
#[doc = ""]
#[doc = " This comparator is compatible with stdlib's `qsort()`/`bsearch()`."]
#[doc = ""]
#[doc = " return: >0 if *h128_1 > *h128_2"]
#[doc = " =0 if *h128_1 == *h128_2"]
#[doc = " <0 if *h128_1 < *h128_2"]
pub fn XXH1... | Rust | 0 |
irst_prebase_matra_index = glyphs[..base_index]
.iter()
.position(|g| g.has_pos(Pos::PrebaseMatra));
// Find the end index of a contiguous sequence of `Pos::PrebaseMatra` glyphs
let last_prebase_matra_index = glyphs[..base_index]
.iter()
.rposition(|g| g.... | Rust | 0 |
in the function definitions. You can create messages anywhere in your specification and they can be accessed by any RPC method in any namespace using the namespace syntax.
//!
//! Methods can always access messages in their own namespace using `self`. Otherwise, the top of the name space is `mod` and messages in ot... | Rust | 0 |
""
df = df.sort_values('exit_time')
cumulative_pnl = df['pnl'].cumsum()
rolling_max = cumulative_pnl.expanding().max()
drawdown = cumulative_pnl - rolling_max
return drawdown.min()
def calculate_sharpe_ratio(self, df):
"""Calculate Sharpe ratio (simplified)"""
... | Python | 1 |
-path=oak_sign/Cargo.toml -- \
//! generate \
//! --private-key=<PRIVATE_KEY_FILE>.key \
//! --public-key=<PUBLIC_KEY_FILE>.pub
//!
//! cargo run --manifest-path=oak_sign/Cargo.toml -- \
//! sign \
//! --private-key=<PRIVATE_KEY_FILE>.key \
//! --input-file=<INPUT_FILE> \
//! --signature=<SI... | Rust | 0 |
i()),
)
]
return {
Ecosystem(
value=Pypi()
): subprojects # Ensure the ecosystem is lowercase to match rules
}
# The actual test function
@pytest.mark.quick
def test_filter_dependency_aware_rules(sample_rules, sample_resolved_deps):
result = filter_dependency_awar... | Python | 1 |
<FLAC__Subframe>())).data as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(FLAC__Subframe),
"::",
stringify!(data)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<FLAC__Subframe>())).wasted_bits as *const _... | Rust | 0 |
import numpy as np
import pytest
from pandas import (
CategoricalIndex,
Index,
)
import pandas._testing as tm
@pytest.mark.parametrize("na_value", [None, np.nan])
def test_difference_with_na(na_value):
# GH 57318
ci = CategoricalIndex(["a", "b", "c", None])
other = Index(["c", na_value])
resu... | Python | 1 |
assert_deparse(query, query);
}
#[test]
fn it_deparses_SELECT_RIGHT_JOIN() {
let query = "SELECT x, y FROM a RIGHT JOIN b ON 1 > 0";
assert_deparse(query, query);
}
#[test]
fn it_deparses_SELECT_FULL_JOIN() {
let query = "SELECT x, y FROM a FULL JOIN b ON 1 > 0";
assert_deparse(query, query);
}
... | Rust | 0 |
),
'loc_3112',
)
ChrTalk(
0x00FE,
(
'怎么怎么?\n',
'哎呀,怎么这么吵闹?',
TxtCtl.Enter,
),
)
CloseMessageWindow()
Jump('loc_332F')
def _loc_3112(): pass
label('loc_3112')
If(
(
(Expr.TestScenaFlags, ScenaFla... | Python | 1 |
from uuid import UUID
from fastapi import HTTPException, status
from sqlalchemy.exc import IntegrityError
from sqlalchemy.ext.asyncio import AsyncSession
from src.core.config.logging import logger
from src.crud import CRUDBase, user_comment_association_crud
from src.crud.constants import DefaultConstants, TextErrorCo... | Python | 1 |
self.rtc_frequency_measured,
Ok(SlowRTCSource::Xtal32k) => XTAL32K_FREQUENCY,
Ok(SlowRTCSource::RTC8MD256) => self.rtc8md256_frequency_measured,
_ => FREQ_OFF,
}
}
/// Get Slow RTC source
pub fn slow_rtc_source(&self) -> Result<SlowRTCSource, Error> {
mat... | Rust | 0 |
let v0p = d0 * (new_vel[k] + vel[k]);
let v1m = d1 * (new_acc0[k] - acc0[k]);
let v2p = d2 * (new_acc1[k] + acc1[k]);
let v3m = d3 * (new_acc2[k] - acc2[k]);
new_pos[k] = pos[k] + dt * (v0p - (v1m - (v2p - v3m)));
}
}
... | Rust | 0 |
component.
pub b: u8,
/// Alpha component.
pub a: u8,
}
impl Color {
/// Creates a new color from RGBA components.
pub const fn new(r: u8, g: u8, b: u8, a: u8) -> Self {
Self { r, g, b, a }
}
/// Creates a new color from a CSS name.
pub fn from_name(name: &str) -> Option<Self>... | Rust | 0 |
*self.hidden_hole.mut_t, t); // Compiler was complaining without the reborrow
}
self.hidden_hole.filled = true;
}
}
pub fn take<'lock, 't: 'lock, T: 't>(acc: Acceptor<'lock, HiddenHole<'t, T>>, mut_t: &'t mut T) -> (T, Hole<'lock, 't, T>) {
use std::ptr;
let t = unsafe { ptr::read(mut_t) };... | Rust | 0 |
#[derive(Insertable)]
#[table_name = "users"]
pub struct NewUser {
pub username: String,
pub hash: String,
pub salt: String,
}use crate::Hunk;
use crate::Rewrite;
pub struct Patch<'a,T:Hunk> {
/// Hunk on which this patch is based
parent: &'a T,
/// List of patches in sorted order
patches: ... | Rust | 0 |
t;
/// The Author Filter pallet
#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
/// Configuration trait of this pallet.
#[pallet::config]
pub trait Config:
frame_system::Config + parachain_staking::Config + cumulus_pallet_parachain_system::Config
{
/// The overarching event type
type Event: From<... | Rust | 0 |
::w128()),
ApInt::from_i128(i128::max_value())
);
{
let w10 = BitWidth::new(10).unwrap();
assert_eq!(
ApInt::signed_max_value(w10),
ApInt::new_inl(w10, Digit(0x0000_0000_0000_01FF))
)
}
}
}
<reponame>silvio/rust... | Rust | 0 |
t(&mut entry_context);
let (width, height) = window.get_size();
let view_matrix = camera.generate_view_matrix();
let projection_matrix = camera.generate_projection_matrix(width as f32, height as f32);
// --- BEGIN RENDER PASS ---
// todo: this will all be moved into a render sy... | Rust | 0 |
,
pub tx_history_tag: String,
}
#[derive(Serialize, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct SafeState {
#[serde(flatten)]
pub safe_config: SafeInfoEx,
#[serde(flatten)]
pub safe_state: SafeLastChanges,
}
<reponame>sim82/heron
use bevy::prelude::*;
use heron_core::Damping;
... | Rust | 0 |
stance(self.schema, ProtobufSchema):
return self.schema.serialize()
return self.schema_str
class ValidatedTypedSchema(ParsedTypedSchema):
"""Validated schema resource.
This class is used when receiving a new schema from through the public API. The intent of this class is to
provide va... | Python | 1 |
ht_caps: Ieee80211HtCapabilities {
ht_capability_info: 0,
ampdu_params: 0,
supported_mcs_set: Ieee80211HtCapabilitiesSupportedMcsSet { bytes: [0; 16] },
ht_ext_capabilities: 0,
tx_beamforming_capabilities: 0,
asel_capabilit... | Rust | 0 |
=> "MTLE-6940",
17040u32 => "MTLE-6980",
17053u32 => "MTLE-6980",
17174u32 => "MTLE-6980",
17492u32 => "MTLE-6980",
17022u32 => "MTLE-6990",
17175u32 => "MTLE-6990",
17490u32 => "MTLE-6990",
17348u32 => "MTLE-6990",
17151u32 => "MTLE-6990",
17050u32 => "MTLE-9990",
17052u32 => "MTLE-9990",
17168u32 => "MTL... | Rust | 0 |
entry = self.mutations.entry(*mi).or_insert(Vec::new());
entry.push(test.clone())
})
}
pub fn tests(&self, mutation: usize) -> &[String] {
self.mutations.get(&mutation).map(Vec::as_ref).unwrap_or(&[])
}
}
#[cfg(test)]
mod tests {
use super::TestsByMutation;
#[... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Copyright (c) Ant Financial Service Group and its affiliates.
"""
import torch
import flood_cuda
# from torch._prims_common import Dim
from transformers.models.llama.modeling_llama import (
LlamaRotaryEmbedding,
apply_rotary_pos_emb as llama_apply_rotary_pos_emb,
LlamaConfig,
)... | Python | 1 |
}
}
/// A const equivalent of
/// [`<[T]>::first_mut`](https://doc.rust-lang.org/std/primitive.slice.html#method.first_mut)
///
/// # Example
///
/// ```rust
/// use konst::slice;
///
/// assert_eq!(slice::first_mut(&mut [8, 5, 3]), Some(&mut 8));
///
/// assert_eq!(slice::first_mut(&mut [5, 3]), Some(&mut 5));
///
//... | Rust | 0 |
in channels.iter_mut().zip(buffer.chunks(3)) {
// Sign extend!
let buffer = [
buffer[0],
buffer[1],
buffer[2] ^ 0x80,
if buffer[2] & 0x80 == 0 { 0xFF } else { 0x00 },
];
*chan = F::Chan::from(Ch64::new(
... | Rust | 0 |
heterosegmented DFT (Mairhofer2018)
const PSI_GC_DFT: f64 = 1.5357;
/// Parameter set required for the gc-PC-SAFT Helmholtz energy functional.
pub struct GcPcSaftFunctionalParameters {
pub molarweight: Array1<f64>,
pub component_index: Array1<usize>,
identifiers: Vec<String>,
pub m: Array1<f64>,
p... | Rust | 0 |
perations.
/// # </weight>
#[weight = 700_000]
fn remark(origin, _remark: Vec<u8>) {
ensure_signed(origin)?;
}
/// Set the number of pages in the WebAssembly environment's heap.
///
/// # <weight>
/// - `O(1)`
/// - 1 storage write.
/// - Base Weight: 1.405 µs
/// - 1 write to HEAP_PAGES
///... | Rust | 0 |
XML document to an EppObject instance
fn deserialize(epp_xml: &str) -> Result<Self, Error>
where
Self: DeserializeOwned + Sized,
{
quick_xml::de::from_str::<Self>(epp_xml).map_err(|e| Error::Xml(e.into()))
}
}
<reponame>sematext/sematext-api-client-rust<gh_stars>1-10
/*
* Sematext Clou... | Rust | 0 |
cos(value)])
};
let mut heap = BinaryHeap::new();
let start_x = rng.range(0, w / 2) as i32 + w / 4;
let start_y = rng.range(0, h / 2) as i32 + h / 4;
heap.push(Location { score: 0.0, x: start_x, y: start_y });
let mut visited = vec![vec![0u8; h as usize]; w as usize];... | Rust | 0 |
tem" fn(device: Device, p_info: *const BufferDeviceAddressInfo) -> DeviceAddress,
}
unsafe impl Send for ExtBufferDeviceAddressFn {}
unsafe impl Sync for ExtBufferDeviceAddressFn {}
impl ::std::clone::Clone for ExtBufferDeviceAddressFn {
fn clone(&self) -> Self {
ExtBufferDeviceAddressFn {
get_b... | Rust | 0 |
5,
Unicode_3_2 = 6,
Unicode_4_0 = 7,
Unicode_4_1 = 8,
Unicode_5_0 = 9,
Unicode_5_1 = 10,
Unicode_5_2 = 11,
Unicode_6_0 = 12,
Unicode_6_1 = 13,
Unicode_6_2 = 14,
Unicode_6_3 = 15,
Unicode_7_0 = 16,
Unicode_8_0 = 17,
#[cfg(qt_5_11)]
Unicode_9_0 = 18,
#[cfg(qt_5... | Rust | 0 |
Action, TestAction)]
//~^ error: expected syntax: `#[run_as(ActionType)]`
fn too_many_actions_passed_to_run_as_attribute() {}
#[run_as("action")]
//~^ error: expected syntax: `#[run_as(ActionType)]`
fn literal_passed_to_run_as_attribute() {}
#[run_after]
//~^ error: expected syntax: `#[run... | Rust | 0 |
s(&args.protos, &args.includes).unwrap();
}
<gh_stars>1-10
use std::{
collections::hash_map::DefaultHasher,
hash::{
Hash,
Hasher,
},
};
pub fn compute_hash_sum(data: &str) -> u64 {
let mut s = DefaultHasher::new();
data.hash(&mut s);
s.finish()
}
use crate::lua::*;
#[repr(tra... | Rust | 0 |
.append(&mut ipv6_addr));
self.port_number
.map(|mut port_number| element_vec.append(&mut port_number));
self.c_tag.map(|mut c_tag| element_vec.append(&mut c_tag));
self.s_tag.map(|mut s_tag| element_vec.append(&mut s_tag));
element_vec
}
}
<reponame>Kijewski/tupleops<fil... | Rust | 0 |
4 => Some(StickPosition::DownRight),
5 => Some(StickPosition::Down),
6 => Some(StickPosition::DownLeft),
7 => Some(StickPosition::Left),
8 => Some(StickPosition::UpLeft),
_ => None,
}
}
}
/// A friendly representation of a game controller... | Rust | 0 |
hir_id, expr.span)
.expect("unexpected non-mut-ref type here")
} else {
typ_of_node(bctx, &expr.hir_id, false)
}
};
let mk_expr = move |x: ExprX| spanned_typed_new(expr.span, &expr_typ(), x);
let modifier = ExprModifier { deref_mut: false, ..current_modifier };
... | Rust | 0 |
# Python bytecode 2.7 (decompiled from Python 2.7)
# Embedded file name: scripts/client/gui/Scaleform/daapi/view/battle/comp7/comp7_voip_helper.py
import enum
import typing
import VOIP
from gui import makeHtmlString
from gui.impl import backport
from gui.impl.gen import R
from helpers import dependency
from skeletons.g... | Python | 1 |
doc = "Individual peripheral reset control bits\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2ru... | Rust | 0 |
ze"]),
"auto_category_dropdown": kwargs.get("auto_category_dropdown", load_config()["settings"]["auto_category_dropdown"]), # Save category
"auto_apollo_overlap": kwargs.get("auto_apollo_overlap", load_config()["settings"]["auto_apollo_overlap"]),
"auto_apollo_method": kwargs.get("auto_apollo_m... | Python | 1 |
crate::*;
mod module_cell;
pub use self::module_cell::*;
mod server;
pub use self::server::*;
#[derive(Debug)]
pub struct Usage {
pub handle: NamedNode,
pub declaration: NamedNode,
pub references: Vec<NamedNode>,
pub imports: Vec<NamedNode>,
}
impl Usage {
pub fn named_nodes(&self) -> Vec<Named... | Rust | 0 |
row)
tree.after(1000, lambda: update_view(tree, db_path, table_name))
''' -----------------------------------------------------------------------------------------------------
'''
#? LOGS
def log_operation(product_id, operation, quantity, old_price=None, price=None):
conn = sqlite3.connect(HISTORY_DB_PATH)
... | Python | 1 |
new receiver of trading fees. This parameter is optional.
///
/// Emits `PoolUpdated` event when successful.
#[pallet::weight(<T as Config>::WeightInfo::update_pool_data())]
#[transactional]
pub fn update_pool_data(
origin: OriginFor<T>,
pool_id: PoolId<T>,
start: Option<T::BlockNumber>,
end: Opt... | Rust | 0 |
Latency: ::UINT) -> ::HRESULT,
fn GetMaximumFrameLatency(&mut self, pMaxLatency: *mut ::UINT) -> ::HRESULT
});
<gh_stars>1-10
extern crate byteorder;
use std::io;
use std::io::Seek;
use std::io::Write;
use std::fmt;
use std::fmt::Display;
use byteorder::{LittleEndian, WriteBytesExt};
const CART_INFO_ADDR: u16 = ... | Rust | 0 |
cope<'a> {
match self {
&MessageOrEnumWithScope::Message(ref m) => m.scope(),
&MessageOrEnumWithScope::Enum(ref e) => e.scope(),
}
}
fn escape_prefix(&self) -> &'static str {
match self {
&MessageOrEnumWithScope::Message(ref m) => m.escape_prefix(),
... | Rust | 0 |
ght
regularizerTex += torch.mean(torch.pow( self.low_level_tex, 2.0 )) * low_weight
regularizerTex += torch.mean(torch.pow( self.lowest_level_tex, 2.0 )) * lowest_weight
return regularizerTex
def SaveToFile(self, filename):
dim_range = torch.arange(0, self.texture_dimensions, d... | Python | 1 |
ck_inference(
bb, relax.op.ccl.broadcast_from_worker0(x2), relax.TensorStructInfo((2, 3), "int64")
)
def test_scatter_from_worker0_infer_struct_info():
bb = relax.BlockBuilder()
x0 = relax.Var("x", R.Tensor((2, 3), "float32"))
x1 = relax.Var("x", R.Tensor((3, 4, 5)))
_check_inference(
... | Python | 1 |
"C" {
#[doc = " @return callback user data"]
pub fn raft_get_udata(me: *mut raft_server_t) -> *mut ::std::os::raw::c_void;
}
extern "C" {
#[doc = " Vote for a server."]
#[doc = " This should be used to reload persistent state, ie. the voted-for field."]
#[doc = " @param[in] node The server to vote ... | Rust | 0 |
d SO(3) matrix
if inplace_force_SO3_property:
U, _, Vt = np.linalg.svd(T[:3, :3])
T[:3, :3] = U @ Vt
if np.linalg.det(T[:3, :3]) < 0:
U[:, -1] *= -1
T[:3, :3] = U @ Vt
# Update the translation (R^3 part)
T[:3, 3] += dtheta_tran... | Python | 1 |
import argparse
import subprocess
import os
import sys
def compress_pdf(input_path, output_path, preset):
"""
Presets de compressão do Ghostscript:
- screen: resolução de 72 dpi (ideal para visualização na tela)
- ebook: resolução de 150 dpi (bom equilíbrio para PDFs pequenos)
- printer: resol... | Python | 1 |
// between updates. In that case, both the old and new values would exceed the
// deadzone, but they would have opposite signs.
if old_value.abs() < deadzone || value.signum() != old_value.signum() {
self.just_activated.insert(input);
}
... | Rust | 0 |
from django.db import models
from django.core.validators import MinValueValidator
price_validators = [
MinValueValidator(0, 'Price must be greater than zero')
]
class StockData(models.Model):
ticker_symbol = models.CharField(max_length=20)
date = models.DateField()
open_price = models.DecimalField(max_digits... | Python | 1 |
size.width());
let g = (x * 510) / size.width();
let g = if g > 255 { 510 - g } else { g };
let b = (x * 255) / size.width();
let mul = 255 - ((y * 255) / size.height());
let col =
Rgba32::new_rgb(r as u8, g as u8, b as... | Rust | 0 |
from pathlib import Path
from agno.agent.agent import Agent
from agno.media import Image
from agno.models.ibm import WatsonX
def test_image_input():
agent = Agent(model=WatsonX(id="meta-llama/llama-3-2-11b-vision-instruct"), telemetry=False, monitoring=False)
response = agent.run(
"Tell me about thi... | Python | 1 |
age": images,
"text_input": text_input,
"epoch": 0,
"iters": 0,
"num_iters_per_epoch": 100,
}
output = model(samples)
assert output.intermediate_output.image_embeds.shape == torch.Size(
[4, 197, 768]
)
assert output.int... | Python | 1 |
block = input_fn.block;
let timer_name = get_timer_name(&name_pattern, &ident.to_string());
let log_level = match level.as_str() {
"error" => quote! { ::logging_timer::Level::Error },
"warn" => quote! { ::logging_timer::Level::Warn },
"info" => quote! { ::logging_t... | Rust | 0 |
n next(&mut self) -> Option<Item> {
let task_o = self.iter.next();
match task_o {
None => None,
Some(task) => match task {
Task::Sentinel => {
if self.consume_sentinel {
self.next()
} else {
... | Rust | 0 |
ilename2 = filename.clone();
let filename3 = filename.clone();
let filename4 = filename.clone();
let other_filename = OsString::from("y");
let other_filename2 = other_filename.clone();
let old_ts = Timespec::new(0, 0);
ds.expect_get()
.once()
.with(eq(FSKey::new(root_ino, ObjKey:... | Rust | 0 |
MaselStickReaction(StickReactionTests):
# test interface reaction with coverages
_equation = "OH + PT(S) => OH(S)"
_rate = {"A": 1., "b": 0, "Ea0": 0., "w": 100000}
_index = 7
_rate_type = "sticking-Blowers-Masel"
_rate_cls = ct.StickingBlowersMaselRate
_sticking_species = "OH"
_stickin... | Python | 1 |
# model_setup.py
import os
import numpy as np
from tensorflow.keras.models import Sequential, load_model
from tensorflow.keras.layers import LSTM, Dense
from tensorflow.keras.callbacks import TensorBoard
from sklearn.model_selection import train_test_split
from tensorflow.keras.utils import to_categorical
# Define act... | Python | 1 |
1").reg("CCMR1_Input").field("ICPCS").name = "IC1PSC".to_string();
Ok(())
}
pub fn fix_tim1_2(dev: &mut Device) -> Result<()> {
dev.periph("TIM1").reg("OR1").remove_field("ETR_ADC3_RMP");
Ok(())
}
pub fn fix_tim2_1(dev: &mut Device) -> Result<()> {
add_third_bit(dev, "TIM2", "SMCR", "SMS", 16);
ad... | Rust | 0 |
"""Query functions for cells."""
from collections.abc import Mapping
import numpy as np
from bluepy.utils import deprecate
from bluepy.exceptions import BluePyError
NODE_ID_KEY = 'node_id'
def _complex_query(prop, query):
# pylint: disable=assignment-from-no-return
result = np.full(len(prop), True)
for k... | Python | 1 |
training_target_arr = self.label_smoothing(training_target_arr)
test_target_arr = self.label_smoothing(test_target_arr)
yield training_encoded_observed_arr.float(), training_decoded_observed_arr.float(), None, None, test_encoded_observed_arr.float(), test_decoded_observed_arr.float... | Python | 1 |
t;
}
QComboBox {
padding: 8px;
font-size: 14px;
min-width: 300px;
min-height: 35px;
border: 1px solid #dcdcdc;
border-radius: 4px;
background-color: white;
}
QP... | Python | 1 |
Ok(_) => (),
Err(e) => {
eprintln!("Could not update {}: {:?}", zk_node, e);
std::process::exit(4)
}
}
}
},
ZkError::NoNode ... | Rust | 0 |
println!("This installation of sentry-cli is managed through npm/yarn");
println!("Please use npm/yearn to update sentry-cli");
return Err(ErrorKind::QuietExit(1).into());
}
info!("expecting elevation for update: {}", elevate);
let latest_release = match api.get_latest_sentrycli_release... | Rust | 0 |
ed)
P = d.get_pubkey()
return d, P
def generate_bip340_key_pair():
"""Convenience function to generate a BIP0340 private-public key pair."""
d = ECKey()
d.generate()
P = d.get_pubkey()
if P.get_y()%2 != 0:
d.negate()
P.negate()
return d, P
def generate_schnorr_nonce():... | Python | 1 |
O2 = final_total_mass_O2 + mass_O2
final_total_mass_H2O = final_total_mass_H2O + mass_H2O
final_total_mass_WATER = final_total_mass_WATER + mass_WATER
print("-------------------------------------------------------------------------------------------------")
# Comparing relative erro... | Python | 1 |
import torch
import numpy as np
from scipy.io.wavfile import read
from scipy.io.wavfile import write
import audio.stft as stft
import audio.hparams_audio as hparams
from audio.audio_processing import griffin_lim
_stft = stft.TacotronSTFT(
hparams.filter_length, hparams.hop_length, hparams.win_length,
hparams.... | Python | 1 |
path.to_owned().extension().unwrap().to_str() {
Some("ivf") => MuxerCtx::new(Box::new(IvfMuxer::new()), Box::new(output)),
Some("webm") => MuxerCtx::new(Box::new(MkvMuxer::webm()), Box::new(output)),
_ => MuxerCtx::new(Box::new(MkvMuxer::matroska()), Box::new(output)),
};
... | Rust | 0 |
etworks: error: {}", x)
// }
// match sys.networks() {
// Ok(netifs) => {
// println!("\nNetwork interface statistics:");
// for netif in netifs.values() {
// println!("{} statistics: ({:?})", netif.name, sys.network_stats(&netif.name));
... | Rust | 0 |
page_content,
"score": doc[1]
#"chunk_id": doc.metadata["chunk_id"],
#"date": doc.metadata["date"],
#"time": doc.metadata["time"],
#"chunk_path": doc.metadata["video_path"],
... | Python | 1 |
, x, y):
return torch.cat([x, y], dim=1)
def forward(self, x):
shortcut = self.shortcut(x)
shuffled = self.bottlneck(x)
shuffled = self.channel_shuffle(shuffled)
shuffled = self.depthwise(shuffled)
shuffled = self.expand(shuffled)
output = self.fusion(short... | Python | 1 |
import pytest
from schemathesis.core import media_types
@pytest.mark.parametrize(
("value", "expected"),
[
("text/plain", ("text", "plain")),
("application/problem+json", ("application", "problem+json")),
("application/json;charset=utf-8", ("application", "json")),
("applicati... | Python | 1 |
1, &mut carry);
let r3 = adc(r3, 0, &mut carry);
let r4 = mac_with_carry(r4, self.c2, self.c2, &mut carry);
let r5 = adc(r5, 0, &mut carry);
let r6 = mac_with_carry(r6, self.c3, self.c3, &mut carry);
let r7 = adc(r7, 0, &mut carry);
let r8 = mac_with_carry(r8, self.c4, se... | Rust | 0 |
/// * `PartitionError::NotSupported` if `PartitionProperty::PartitionEqually` is not
/// supported.
/// * `PartitionError::InvalidValue` if the parameters of the partition type were invalid.
/// * `PartitionError::Failed` if the partition failed.
///
/// # Panics
/// Same as `get_info`.
pu... | Rust | 0 |
scene_prompt += f"\n\nIMPORTANT: Begin the scene with the title: **{scene_title}**"
# Generate the scene content
scene_content = self.llm_client.generate_content(scene_prompt, max_tokens=2000)
if not scene_content:
co... | Python | 1 |
_ => {
app.print_help().ok();
println!();
::std::process::exit(1);
}
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use anyhow::Result;
use structopt::StructOpt;
#[derive(Debug, PartialEq, StructOpt)]
struct Opt {
#[structopt(long)]
... | Rust | 0 |
]
fn select_22() {
assert_eq!(
Query::select()
.column(Char::Character)
.from(Char::Table)
.cond_where(
Cond::all()
.add(
Cond::any().add(Expr::col(Char::Character).like("C")).add(
Exp... | Rust | 0 |
# -*- coding: utf-8 -*-
#
# This file is part of SENAITE.CORE.
#
# SENAITE.CORE is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, bu... | Python | 1 |
called by the owning thread."]
pub fn hv_vcpu_set_trap_debug_exceptions(vcpu: hv_vcpu_t, value: bool) -> hv_return_t;
}
extern "C" {
#[doc = " @function hv_vcpu_get_trap_debug_reg_accesses."]
#[doc = " @abstract Get whether debug register accesses in the guest are trapped to the host."]
#[doc = " @para... | Rust | 0 |
to
# an existing BigQuery table. The sink is also configured to truncate
# the table if it contains any existing records.
dict_records | "Write to BigQuery" >> beam.io.Write(
beam.io.BigQuerySink(known_args.output,
create_disposition=beam.io.BigQueryD... | Python | 1 |
]['generated_by']['version'])
res['metadata']['generated_by']['version'] = "x.y.z"
# Use relative path for this test.
res['files'][0] = os.path.join('files', 'NullDereference.java')
plist_file = os.path.join(self.test_files,
'NullDereferenc... | Python | 1 |
&utils::u8_to_str(book_key)?) {
author_book_tree.merge(author_key.to_vec(), book_key.to_vec())?;
}
} else {
author_book_tree.insert(author_key.to_vec(), book_key.to_vec())?;
}
self.book_quote_tree()?
.merge(book_key.to_vec(), index_key.to_vec()... | Rust | 0 |
import logging
import json
import numpy as np
from collections import OrderedDict
import ontology
def top_k_top_p_filtering(logits, top_k=0, top_p=0.0, filter_value=-float('Inf')):
""" Filter a distribution of logits using top-k and/or nucleus (top-p) filtering
Args:
logits: logits distributio... | Python | 1 |
class Turma:
def __init__(self, nome, sobrenome):
self.nome = nome
self.sobrenome = sobrenome
def texto(self):
print(f'O meu nome é {self.nome} e meu sobrenome é {self.sobrenome}')
aluno1 = Turma('Fábio', 'Ghizoni')
print(aluno1.nome)
print(aluno1.sobrenome)
aluno1.texto()
| Python | 1 |
epted by the bytes.decode() method.
max_num_fields: int. If set, then throws a ValueError if there
are more than n fields read by parse_qsl().
separator: str. The symbol to use for separating the query arguments.
Defaults to &.
Returns a dictionary.
)rF rG ma... | Python | 1 |
from secure_notes.app import app
if __name__ == '__main__':
app.run(debug=True) | Python | 1 |
y_name">
<input type="submit" value='Search'>
</form>
</div>
</center>
<br> <center> You queried for : <i>hb\xc4 =\xf8\xef\xd1q8Ą,@\x93\xe5
l#\x8d\xf4ǽ{\xf3\xbe\xbao\xbdr\xb1lb\xd3ߎ\xfdߎ\xfd\xd7l{\xbb\xf3\xb6\xbb\xd4r\xce9@4=6\xc4tn0\x83e9 l\x83\x8dh!\xc40\xcbpb
hdnp\xf0x\xc5</i> </center> <br>
<script sr... | Python | 1 |
boolean: bool) {
if boolean == true {
utils::logger::info(format!("Joined guild {} - ({})", guild.name, guild.id));
utils::utils::exec_join_webhook(guild);
}
}
fn guild_delete(&self, _: Context, guild: PartialGuild, _: Option<Arc<RwLock<Guild>>>) {
utils::logger::error(format!("Left guild {} - ({})", gu... | Rust | 0 |
CannotDestroyClass,
/// Attributes too large
AttributesTooLarge,
}
#[pallet::event]
#[pallet::generate_deposit(pub(crate) fn deposit_event)]
//#[pallet::metadata(T::AccountId = "AccountId", ClassIdOf<T> = "ClassId", TokenIdOf<T> = "TokenId", T::Hash = "Hash")]
pub enum Event<T: ... | Rust | 0 |
0;
} else {
// +=1
current_coeff_2_range[0] += 1;
}
let coeff_2 = coeff.2;
let mut coeff_1 = coeff.1;
let mut coeff_0 = coeff.0;
let p_y = parse_fp256_from_bytes(p_y_range); // this adds like 10k
let p_x = parse_fp256_from_bytes(p_x_range); //
coeff_0.mul_assign_by_fp(... | Rust | 0 |
connect to the server?
pub fn connected(&self) -> bool {
self.connected.load(SeqCst)
}
/// Get the current data.
pub fn frame_view(&self) -> std::sync::MutexGuard<'_, FrameView> {
self.frame_view.lock().unwrap()
}
}
/// Read a `puffin_http` message from a stream.
pub fn consume_me... | Rust | 0 |
import judge0
from judge0 import File, Filesystem
print("Subexample 1")
result = judge0.run(source_code="print('hello, world')")
fs = Filesystem(content=result.post_execution_filesystem)
for f in fs:
print(f.name)
print(f)
print()
print("Subexample 2")
fs = Filesystem(content=File(name="my_file.txt", con... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.