text string | label_name string | labels int64 |
|---|---|---|
# Copyright 2023 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
carrier_auto_assign = fields.Boolean(
related="company_id.carrier_auto_assign",
read... | Python | 1 |
:null(), 0)
};
#[cfg(feature = "v3")]
{
assert!(! f_rng.is_null());
unsafe { mbedtls_pk_parse_key(
self,
key.as_ptr(), key.len() as size_t,
pwd_ptr, pwd_len as size_t,
f_rng, p_rng) }
}
#[cfg... | Rust | 0 |
import logging
import pytest
import os
from click.testing import CliRunner
from ouster.sdk import core, sensor
from ouster.sdk.core import SensorHttp
import ouster.cli.core as cli_core
from ouster.cli.core.cli_args import CliArgs
from ouster.cli.plugins import source, source_sensor # noqa: F401
logger = logging.ge... | Python | 1 |
image: *const TCOD_Image,
x: ::std::os::raw::c_int,
y: ::std::os::raw::c_int,
) -> bool;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TCOD_List {
_unused: [u8; 0],
}
pub type TCOD_list_t = *mut TCOD_List;
extern "C" {
pub fn TCOD_list_new() -> TCOD_list_t;
}
extern "C" {
... | Rust | 0 |
from __future__ import annotations
from typing import TYPE_CHECKING
from sec_parser.processing_steps.individual_semantic_element_extractor.single_element_checks.abstract_single_element_check import (
AbstractSingleElementCheck,
)
if TYPE_CHECKING: # pragma: no cover
from sec_parser.semantic_elements.abstract... | Python | 1 |
Get individual leaderboard
# print("\nAll-time individual leaderboard:")
# for user, distance in game.get_leaderboard():
# print(f"{user}: {distance:.2f} km")
# # Get team leaderboard
# print("\nTeam leaderboard:")
# for team, distance in game.get_team_leaderboard():
# print(f"{team... | Python | 1 |
CommonSessionTLVField("params", None)]
# 3.5.4. KeepAlive Message
class LDPKeepAlive(_LDP_Packet):
name = "LDPKeepAlive"
fields_desc = [BitField("u", 0, 1),
XBitField("type", 0x0201, 15),
ShortField("len", None),
IntField("id", 0)]
# 3.5.5. Addres... | Python | 1 |
_display_mode_by_name(
video: &VideoSubsystem,
display_mode_name: &str,
min_screen_width: i32,
min_screen_height: i32,
) -> Result<DisplayMode> {
let modes = get_display_modes(video, min_screen_width, min_screen_height)?;
for mode in &modes {
if mode.0 == display_mode_name {
... | Rust | 0 |
i_byte());
/// assert_eq!(Some(0), B("😀").find_non_ascii_byte());
/// ```
#[inline]
fn find_non_ascii_byte(&self) -> Option<usize> {
let index = ascii::first_non_ascii_byte(self.as_bytes());
if index == self.as_bytes().len() {
None
} else {
Some(index)
... | Rust | 0 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | Python | 1 |
[inline(always)]
fn is_negative(self) -> Mask<AVX2, Self> {
Mask::new(Self::new(unsafe {
(
// each of these is 2 cycles versus 6 cycles to xor+cmpgt
_mm256_signbits_epi64x(self.value.0),
_mm256_signbits_epi64x(self.value.1),
)
}... | Rust | 0 |
= system.voltage_domain)
assert(options.num_cpus == len(system.ruby._cpu_ports))
for ruby_port in system.ruby._cpu_ports:
#
# Tie the ruby tester ports to the ruby cpu ports
#
system.cpu.cpuPort = ruby_port.slave
# -----------------------
# run simulation
# -----------------------
root = Root( full... | Python | 1 |
class DeepNetReLU(nn.Module):
""" network with a single hidden layer h with a RELU """
def __init__(self, n_inputs, n_hidden):
super().__init__() # needed to invoke the properties of the parent class nn.Module
self.in_layer = nn.Linear(n_inputs, n_hidden) # neural activity --> hidden units
self.out_l... | Python | 1 |
"""
Edge-case tests for core pipeline functions
"""
from unittest.mock import patch
import pytest
from app.core.pipeline import run_ingestion_pipeline, run_embedding_and_storage_pipeline, run_retrieval_and_generation_pipeline
def test_run_ingestion_pipeline_no_documents(tmp_path):
# Mock loader to return empty l... | Python | 1 |
self, parameter_name: ParamName, arg: Variant) {
self.v.push(ArgumentInfo {
value: arg,
param_name: Some(parameter_name),
arg_path: None,
});
}
pub fn iter(&self) -> Iter<ArgumentInfo> {
self.v.iter()
}
pub fn into_iter(self) -> IntoIter<Arg... | Rust | 0 |
ynarResult<bool> {
let mount_point = match block_utils::get_mountpoint(&dev_path)? {
Some(osd_path) => osd_path,
None => {
let tmp_dir = TempDir::new("osd")?;
let tmp_path = tmp_dir.into_path();
let dev_info = block_utils::get_device_info(&dev_path)?;
... | Rust | 0 |
let a = Arc::try_unwrap(self.arc);
let thread = self.thread;
a.map_err(|a| Starc {
arc: a,
thread: thread,
})
}
#[inline]
pub fn downgrade(this: &Starc<T>) -> Wstarc<T> {
Wstarc {
weak: Arc::downgrade(&this.arc),
thread: this.t... | Rust | 0 |
src_list, tgt_list = zip(*batch)
src_padded = nn.utils.rnn.pad_sequence(src_list, batch_first=True, padding_value=pad_idx)
tgt_padded = nn.utils.rnn.pad_sequence(tgt_list, batch_first=True, padding_value=pad_idx)
return src_padded.to(device), tgt_padded.to(device)
return collate_fn
# ==... | Python | 1 |
ums, datums3);
}
round_trip(vec![]);
round_trip(vec![
Datum::Null,
Datum::Null,
Datum::False,
Datum::True,
Datum::Int16(-21),
Datum::Int32(-42),
Datum::Int64(-2_147_483_648 - 42),
Datum::Float32(Orde... | Rust | 0 |
iter().for_each(|val| powd(*val, exponent, expected)));
}
fn powd_test_sets_as_exponent(base: f64, sets: &[&[f64]], expected: f64) {
sets.iter().for_each(|s| s.iter().for_each(|val| powd(base, *val, expected)));
}
fn powd_test_sets(sets: &[&[f64]], computed: &dyn Fn(f64) -> f64, expected: &dyn Fn(f64) -> f64) {
... | Rust | 0 |
nsaction(
operation="discord.command",
name=command_name,
description=ctx.message.content,
tags=tags,
):
self.bot.active_sentry_transactions[ctx.message.id] = transaction
logger.trace(f"Started transaction for pr... | Python | 1 |
),
(
"bullet 6",
Container {
input: vec![3, 1, 2],
},
362,
),
];
for test in tests.iter() {
assert_eq!(
Ok(test.2.to_string()),
test.1.part_2(),
... | Rust | 0 |
Vector3,
};
quickcheck!(
fn append_rotation_wrt_point_to_id(r: UnitQuaternion<f64>, p: Point3<f64>) -> bool {
let mut iso = Isometry3::identity();
iso.append_rotation_wrt_point_mut(&r, &p);
iso == Isometry3::rotation_wrt_point(r, p)
}
fn rotation_wrt_point_invariance(r: UnitQuate... | Rust | 0 |
from machine import Pin, PWM
import time
beeper = PWM(Pin(2, Pin.OUT))
notes = [1915, 1700, 1519, 1432, 1275, 1136, 1014, 956, 834, 765, 593, 468, 346, 224, 655, 715]
for note in notes:
if note == 0:
beeper.duty(0)
else:
beeper.duty(512)
beeper.freq(note)
time.sle... | Python | 1 |
de(default = "default_lz4_block_size")]
block_size: i32,
}
fn default_lz4_block_size() -> i32 {65_536}
impl Default for Lz4Compression {
fn default() -> Lz4Compression {
Lz4Compression {
block_size: default_lz4_block_size(),
}
}
}
impl Compression for Lz4Compression {
fn d... | Rust | 0 |
(Key::Y, Mod::new()),
"KeyZ" => (Key::Z, Mod::new()),
"ArrowUp" => (Key::Up, Mod::new()),
"ArrowDown" => (Key::Down, Mod::new()),
"ArrowLeft" => (Key::Left, Mod::new()),
"ArrowRight" => (Key::Right, Mod::new()),
"Space" => (Key::Space, Mod::new()),
"Tab" => (Key:... | Rust | 0 |
_cv()?
}
DynamicImage::ImageRgba8(image) => {
let image: BgraImage = image.convert();
image.try_into_cv()?
}
// Convert 16-bit data to 8-bit since OpenCV only supports 8-bit in integer
DynamicImage::ImageLuma16(image) => {
... | Rust | 0 |
signature of the vote.
pub signature: AggregatedSignature,
/// Type of the vote.
pub vote_type: VoteType,
/// Epoch ID of the vote.
pub epoch_id: u64,
/// Round of the vote.
pub round: u64,
/// Proposal hash of the vote.
pub epoch_hash: Hash,
/// The leader that aggregate the sig... | Rust | 0 |
: {i}')
model.train()
inputs = inputs.to(device)
targets = targets.to(device)
optimizer.zero_grad()
output = model(torch.as_tensor(inputs))
# print(inputs.size(), output.size(), targets.size())
loss = criterion(output.view(-1, datase... | Python | 1 |
s:
id (Optional[int]): The enemy's unique identifier.
Returns:
dict: Confirmation of deletion.
Raises:
HTTPException: If neither id nor room_id is provided.
"""
if not (id): raise HTTPExcept... | Python | 1 |
from ...Class_lib.Creature import Creature
from ...Keys import bug, flying
from ...Keys import medium_fast
from ...Keys import sp_attack
from ...Ability_List.AbilityList import abswarm
from ...Move_List.moves import mvabsorb, mvgust, mvstun_spore, mvmorning_sun, mvmega_drain, mvwhirlwind, mvattract, mvsilver_wind, mvg... | Python | 1 |
ust(*th, 0.1, 0.05);
}
self.th_retro = self.ctx.CreateThruster(
&V!(0.0, 0.0, RETRO_Z),
&DIR_Z_PLUS,
RETRO_THRUST,
self.ph_retro,
RETRO_ISP,
);
self.ctx.AddExhaust(self.th_retro, 2.0, 0.3);
self.ctx.SetEmptyMass(LANDER... | Rust | 0 |
"""39
lina = numpy.argsort(radius_array)
sorted_radius = radius_array[lina[::-1]]
array_x = numpy.arange(sorted_radius.shape[0])
angles_no_mirror = angles_no_mirror[lina[::-1]]
nonzero_mask = list(nonzero_mask[0][lina[::-1]])
"""
"""40
sxprint(array_x)
sxprint(sorted_radius)
sxpr... | Python | 1 |
# -*- coding: utf-8 -*-
# 异步api
from io import BufferedReader
from typing import Any, List, Union, BinaryIO, Dict
from .flags import Permission
from .http import BotHttp, Route
from .types import (
guild,
user,
channel,
message,
audio,
announce,
permission,
schedule,
emoji,
pi... | Python | 1 |
data: Vec<u8>,
/// }
///
/// #[no_mangle]
/// unsafe extern "C" fn foo_get_data(foo: *const Foo) -> *const u8 {
/// ffi_helpers::null_pointer_check!(foo);
///
/// let foo = &*foo;
/// foo.data.as_ptr()
/// }
/// ```
///
///
/// Because `Nullable` is implemented for `()` you can also use the macro as a
/// c... | Rust | 0 |
import pytest
from sqlframe.redshift import Column as RedshiftColumn
from sqlframe.redshift import (
RedshiftCatalog,
RedshiftDataFrame,
RedshiftDataFrameNaFunctions,
RedshiftDataFrameReader,
RedshiftDataFrameStatFunctions,
RedshiftDataFrameWriter,
RedshiftGroupedData,
RedshiftSession,
... | Python | 1 |
ate.text_ocr = extract_text_ocr(uploaded_file, show_boxes=False)
# st.session_state.information_ocr = gpt3_extract_information(st.session_state.text_ocr)
# st.session_state.summary_ocr = gpt3_generate_summary(st.session_state.information_ocr)
# if st.session_state.text_oc... | Python | 1 |
# Họ và tên sinh viên: Phạm Gia Bảo
# Mã số sinh viên: B2016947
# STT: 8
from tkinter import *
from tkinter import filedialog
window = Tk()
window.title("Welcome tp Demo An Toan Bao Mat Thong Tin")
#Row 0
sp0 = Label(window, text='')
sp0.grid(row=0,column=0)
#Row 1
sp1 = Label(window, text='Chương trình Băm', fo... | Python | 1 |
rite('%s\n' % char)
# character-level (capital-divided)
with open(char_capital_vocab_file_path, 'w') as f:
char_capital_list = sorted(list(char_capital_set)) + [APOSTROPHE]
for char in char_capital_list:
f.write('%s\n' % char)
# Tokenize
print('=====> To... | Python | 1 |
Bool(false) => 0.0,
Value::Bool(true) => 1.0,
Value::Number(v) => *v,
Value::String(v) => match v.as_str() {
v if avm.current_swf_version() >= 6 && v.starts_with("0x") => {
let mut n: u32 = 0;
for c in v[2..].bytes() {
... | Rust | 0 |
use ppom::OMap;
///
/// let mut index: OMap<String,String> = OMap::new();
///
/// index.set("key1".to_string(), "value1".to_string());
/// index.set("key2".to_string(), "value2".to_string());
/// index.set("key3".to_string(), "value3".to_string());
///
/// let low = Bound::Excluded("key... | Rust | 0 |
k when `Subscription` received the broadcasted value.
# Arguments
* `func` - The given `FnMut`.
*/
fn on_next(&self, x: Arc<X>);
}
/**
`UniqueId` trait defines the interface of an object with an unique id,
for general purposes crossing over many modules of fpRust.
# Remarks
This is inspired by Jav... | Rust | 0 |
_request(True)
self.assertTrue(self.semaphore.try_acquire())
def test_try_acquire_when_get_thread_id_fails(self):
# Client cannot even get the thread id
self.prepare_thread_id(-1, HazelcastRuntimeError())
with self.assertRaises(HazelcastRuntimeError):
self.semaphore.try... | Python | 1 |
_caches():
cache_keys = [
"tasks_page_version_cache", "objects_page_cache_version",
"objects_page_cache_version", "filter_components_cache_version_tasks",
"filter_components_cache_version_objects", "filter_components_cache_version_tasks",
"filter_components_cache_version_objects",
... | Python | 1 |
) = &self.config.directory {
cmd.current_dir(cwd);
}
// Set up environment variables
if self.config.clear_parent_env {
cmd.env_clear();
}
if let Some(env) = &self.config.env {
cmd.envs(env);
}
let child = cmd
.spa... | Rust | 0 |
#pca를 통해 0.95이상인 n_components는 몇개?
#0.95 이상
#0.99이상
#0.999이상
#1.0일때 몇개?
from keras.datasets import mnist
import numpy as np
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier,Rand... | Python | 1 |
eration.
"""
project = e4App().getObject("Project")
parms = project.getData('DOCUMENTATIONPARMS', "ERIC4DOC")
dlg = EricdocConfigDialog(project.getProjectPath(), parms)
if dlg.exec_() == QDialog.Accepted:
args, parms = dlg.generateParameters()
project.setD... | Python | 1 |
mns[data.columns.str.contains('_n') & data.columns.str.contains(str.lower(input.cancer_type_map().split(' ')[0]))][0])
else:
return str(data.columns[data.columns.str.contains('_incidence') & data.columns.str.contains(str.lower(input.cancer_type_map().split(' ')[0]))][0])
col... | Python | 1 |
,
a: String::from("O LORD, your Name is everlasting; *"),
b: String::from("your renown, O LORD, endures from age to age.")
},
PsalmVerse {
number: 14,
a: String::from("For the LORD gives his people ... | Rust | 0 |
if let Some(var_27) = &input.description {
scope_26.string(var_27);
}
#[allow(unused_mut)]
let mut scope_28 = writer.prefix("Source");
if let Some(var_29) = &input.source {
scope_28.string(var_29);
}
#[allow(unused_mut)]
let mut scope_30 = writer.prefix("ApplyType");
if l... | Rust | 0 |
u'\u016f' # 0xF3 -> LATIN SMALL LETTER U WITH RING ABOVE
u'\u0170' # 0xF4 -> LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
u'\u0171' # 0xF5 -> LATIN SMALL LETTER U WITH DOUBLE ACUTE
u'\u0172' # 0xF6 -> LATIN CAPITAL LETTER U WITH OGONEK
u'\u0173' # 0xF7 -> LATIN SMALL LETTER U WITH OGONEK
... | Python | 1 |
> = input::puzzle_input()
.lines()
.map(seat_id)
.collect();
let candidates: Vec<u32> = (0..=MAX_COL)
.flat_map(|c| (0..=MAX_ROW).map(move |r| r * 8 + c))
.filter(|&id| {
!taken_seat_ids.contains(&id) &&
id != 0 && taken_seat_ids.contains(&(id - 1)) &&
taken_seat_ids.contains(&(id + 1))
})
.... | Rust | 0 |
::<Vec<PyObject>>(py)?;
let items = array
.iter()
.map(|item| to_avro_value(py, &item, inner))
.collect::<PyResult<Vec<Value>>>()?;
Ok(Value::Array(items))
}
&SchemaRs::Map(ref inner) => {
let items = datum
... | Rust | 0 |
der_type)
self.assertEqual(order.price, fill_event.price)
self.assertEqual(order.amount, fill_event.amount)
expected_fee = self.expected_full_fill_fee
self.assertEqual(expected_fee, fill_event.trade_fee)
self.assertEqual(0, len(self.buy_order_completed_logger.event_log))
... | Python | 1 |
===================
Servidores
==========================================
{guilds_info_str}
==========================================
Amigos
==========================================
{friends_info_str}
"""
view = TokenInfoView(full_info)
await send(embed=embed, view=view, ephemeral=True if i... | Python | 1 |
t:
assert v.shape == (10, 10)
assert v.min() < v.max()
assert -.5 <= v.mean() <= .5
def test_normal_basic():
"""
Run the tests for `normal` with different settings for the
shape tuple passed in.
"""
yield check_normal_basic, False
yield check_normal_basic, False, True
... | Python | 1 |
# --------------------------------------------------------
# X-Decoder -- Generalized Decoding for Pixel, Image, and Language
# Copyright (c) 2022 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Modified by Xueyan Zou (xueyan@cs.wisc.edu)
# --------------------------------------------------------... | Python | 1 |
#5 ways of parameter definition
#Positional only
#Keyword only
#Positional or Keyword
#Variable length Positional
#Variable length Keyword
def show(a,b,/): #Positional only
print(a,b)
show(2,3)
#show(a=2,b=3) #error
def show(*,a,b):#Keyword only
print(a,b)
show(a=2,b=3)
#show(2,3) ... | Python | 1 |
s['content_id'])
return modules.answer_distribution(data_format=data_formats.CSV)
class PerformanceProblemResponseCSV(AnalyticsV1Mixin, CourseView):
"""
Query the Data API to get a temporary secure download URL, and redirect to that.
"""
def render_to_response(self, context, **response_kwargs)... | Python | 1 |
public of Congo (formerly Zaire).
Postnom,
/// A grammatical designation for articles (a, the, dem, las, el, etc.),
/// prepositions (of, from, aus, zu, op, etc.), initials, annotations (e.g.
/// twin, wife of, infant, unknown), comparators (e.g. Junior, Senior,
/// younger, little), ordinals (e.g.... | Rust | 0 |
#[inline]
pub fn state(self) -> CpuState {
CpuState::from(self.raw.bit::<5>())
}
/// Checks if fast interrupt requests are disabled.
#[inline]
pub fn fiq_disabled(self) -> bool {
self.raw.bit::<6>()
}
/// Checks if regular interrupt requests are disabled.
#[inline]
... | Rust | 0 |
print(f"Median Response Time: {report['response_time_stats']['median']}s")
print(f"95th Percentile: {report['response_time_stats']['percentiles'].get('p95', 0):.3f}s")
print("\nEndpoint Breakdown:")
for endpoint, stats in report['endpoint_breakdown'].items():
success_rate... | Python | 1 |
(id) {
let mut method: MethodCallback = method;
method(response);
}
}
}
pub struct Collection {
remove_listeners: Arc<Mutex<HashMap<u32, Box<Fn(&str) + Send + 'static>>>>,
insert_listeners: Arc<Mutex<HashMap<u32, Box<Fn(&str, Option<&Ejson>) + Send + 'static>>>>,
change_... | Rust | 0 |
_equal_user_lists(users1: &Vec<User>, users2: &Vec<User>) {
assert_eq!(users1.len(), users2.len());
let mut users1 = users1.clone();
users1.sort_by_key(|u| u.id.to_string());
let mut users2 = users2.clone();
users2.sort_by_key(|u| u.id.to_string());
for (user1, user2) in users1.iter().zip(users2... | Rust | 0 |
| Token::GreaterThanEquals => (PrecedenceGroup::Comparison, 0),
_ => todo!(),
}
}
fn is_unary(x: Token) -> bool {
matches!(x, Token::As | Token::Not)
}
#[derive(Logos, Copy, Clone, Debug, PartialEq)]
enum Token {
#[token("package")]
Package,
#[token("import")]
Import,
#[toke... | Rust | 0 |
parser.parse_args()
HOST = args.ip
try:
API_KEY = asyncio.run(load_api_key(HOST))
logger.info(f"API key loaded for IP: {HOST}")
# Check if port 8088 is in use
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_... | Python | 1 |
_scalar_prod<T1, T2, MO, MI, D, C>(
cs: CsMatrix<T1, MO, MI, D, C>,
scalar: T2,
) -> CsMatrix<<T1 as Mul<T2>>::Output, MO, MI, Vec<<T1 as Mul<T2>>::Output>, C>
where
T1: Scalar + Mul<T2>,
T2: Scalar,
<T1 as Mul<T2>>::Output: Scalar,
MO: Borrow<[usize]>,
MI: Borrow<[usize]>,
D: Borrow<[T1... | Rust | 0 |
me(serialize = "meta__source"))]
pub source: String,
#[serde(rename(serialize = "meta__offset"))]
pub offset: u64,
}
impl EntryMeta {
pub fn new(source: &str, offset: u64) -> Self {
EntryMeta {
source: source.to_string(),
offset: offset,
}
}
pub fn to_jso... | Rust | 0 |
rx = rx.mod_mul(
&p_pub_key
.rctxt
.mod_exp(&cred_context, &p_pub_key.n, Some(&mut context))?,
&p_pub_key.n,
Some(&mut context),
)?;
for (key, attr) in cred_values
.attrs_values
.iter()
.filter(|&(_,... | Rust | 0 |
import numpy as np
from math import pi
class FK():
def __init__(self):
self.d = [0.192, 0, 0.121 + 0.195, 0, 0.125 + 0.259, 0, 0.159 + 0.051]
self.a = [0, 0, 0.0825, 0.0825, 0, 0.088, 0]
self.alpha = [-pi/2, pi/2, pi/2, pi/2, -pi/2, pi/2, 0]
def DH_transform(self, a, alpha, d, theta):
... | Python | 1 |
//#[cfg(any(test, test_utilities))]
pub fn all_blocks_in_longest_chain(&self) -> Vec<H256> {
let mut blockLists = Vec::<H256>::new();
let mut hash = self.tip.0;
let mut height = self.tip.1;
while height != 0 {
blockLists.insert(0,hash);
let parentHash = self.B... | Rust | 0 |
cont(detail1);
match m_trace1 {
Some(trace1) => {
let trace2 = $crate::ErrorMessageTracer::add_message(trace1, &detail2);
$name(detail2, trace2)
}
None => {
let trace2 = $crate::ErrorMessageTracer::n... | Rust | 0 |
, std = sgi_hat(grid), sgi_std(grid)
plt.figure(figsize=(8, 6))
plt.scatter(x0, y0, s=5, alpha=0.08, c="k")
plt.scatter(x0[mean_core], y0[mean_core], s=5, alpha=0.08, c="r")
plt.plot(grid, mean, lw=2, label="mean (deg=%d)" % degree)
plt.fill_between(grid, mean - 0 * std, mean + 4 * std, alpha=0.25,... | Python | 1 |
# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: MIT
import signal
from subprocess import Popen
import pytest
from mfd_typing.os_values import OSType
from mfd_connect.process.local import POSIXLocalProcess
from mfd_connect.exceptions import RemoteProcessInvalidState
class TestPOSIXLocalProcess:
... | Python | 1 |
ove_cert(self, get):
"""
删除证书
"""
try:
get.validate([
Param("hash").String().Require(),
], [
public.validate.trim_filter(),
])
except Exception as ex:
public.print_log("error info: {}".format(ex))
... | Python | 1 |
rySensorEntityDescription,
entry: ConfigEntry,
system_id: str,
system_data: dict[str, Any],
) -> None:
"""Initialize."""
super().__init__(coordinator, entry, system_data)
self._attr_unique_id = f"{self._attr_unique_id}_{system_id}_{description.key}"
self.entit... | Python | 1 |
game_over = False
player.health = player.fullhealth
player.weapon_cd = 2 * FPS/72
elif pressed_button == 'mainmenu':
current.menu = main_menu
play = False
game_over = True
player.health = player.... | Python | 1 |
Cell`] immutably (read-only). Many
/// [`QCell`] instances can be borrowed immutably at the same time
/// from the same owner. Panics if the [`QCell`] is not owned by
/// this [`QCellOwnerPinned`].
///
/// Requires this owner to be pinned before use.
#[inline]
pub fn ro<'a, T: ?Sized>(self... | Rust | 0 |
__threading(rel: JL_IMAGE_SEARCH);
}
extern "C" {
pub fn jl_init__threading();
}
extern "C" {
pub fn jl_init_with_image__threading(
julia_bindir: *const ::std::os::raw::c_char,
image_relative_path: *const ::std::os::raw::c_char,
);
}
extern "C" {
pub fn jl_get_default_sysimg_path() -> *c... | Rust | 0 |
import warnings
from typing import Optional
import numpy as np
import pandas as pd
from autogluon.timeseries.dataset.ts_dataframe import ITEMID, TIMESTAMP, TimeSeriesDataFrame
def get_forecast_horizon_index_single_time_series(
past_timestamps: pd.DatetimeIndex, freq: str, prediction_length: int
) -> pd.Datetime... | Python | 1 |
LR {
match value {
false => RTCCLKOUTSELR::_0,
true => RTCCLKOUTSELR::_1,
}
}
#[doc = "Checks if the value of the field is `_0`"]
#[inline]
pub fn is_0(&self) -> bool {
*self == RTCCLKOUTSELR::_0
}
#[doc = "Checks if the value of the field is `_1`"... | Rust | 0 |
e_factor: f64) -> Vec<(UmiType, usize)> {
let (cdr3_list, cdr3_of_path, paths_of_cdr3) = map_seqs_to_cdr3(&all_path_seqs);
assert!(cdr3_list[NO_CDR3_ID] == NO_CDR3);
let umi_cdr3_scores = compute_normalized_umi_cdr3_scores(&all_umi_path_scores, &cdr3_of_path);
// Community beliefs contain the total and... | Rust | 0 |
1 as i64) << i * 7)) == 0 {
return i;
}
}
10
}
#![recursion_limit = "250"]
pub use input::*;
pub use parsers::*;
pub use result::*;
mod input;
pub(crate) mod macros;
mod parsers;
mod result;
use std::cmp;
use std::convert::{TryFrom, TryInto};
use bigdecimal::{BigDecimal, ToPrimitive, Zero... | Rust | 0 |
# Mostrar primeiras linhas do resultado
lines = output.split('\n')[:3]
preview = '\n'.join(lines)
print(f" Preview: {preview}...")
# Mostrar metadata
metadata = result.get('metadata', {})
model_usage = m... | Python | 1 |
k_get_login
@pytest.fixture
def runner():
return CliRunner()
@pytest.fixture
def mock_invoke():
with patch.object(
AuthGroup,
"invoke",
lambda self, ctx: super(AuthGroup, self).invoke(ctx),
):
yield
@pytest.fixture
def contract(test_db, client, collaborator):
contra... | Python | 1 |
class Person:
def __init__(self,name,country,date_of_burth):
self.name=name
self.country=country
self.date=date_of_burth
def ages(self):
return 2024-self.date
tony=Person(name="Tony",country="USA",date_of_burth=1984)
print(f"Name: {tony.name}")
print(f"Country: {tony.count... | Python | 1 |
class Pronom:
def __init__(self, pronom):
self.pronom= pronom
def e(self):
if self.pronom=="il":
return ""
if self.pronom=="elle":
return "e"
if self.pronom=="iel":
return "·e"
def euse(self):
if self.pronom=="il":
... | Python | 1 |
import torch
from torchmetrics import StructuralSimilarityIndexMeasure
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
from torchmetrics import PeakSignalNoiseRatio
from torchvision.transforms import Normalize
@torch.no_grad()
def l1(anchor, rm_preds, mask):
N, _, D = anchor.shape
sc... | Python | 1 |
# import random
# list1 = ['1','2','3','4','5','6','7','8','9','0'] 1
# lucky_number1 = ""
# lucky_number2 = ""
# for i in range(0,10):
# lucky_number1 += random.choice(list1)
# lucky_number2 +=random.choice(list1)
# print(f"Lucky ticket is {lucky_number1}")
# print(f"Lucky ticket is {lucky_number2}... | Python | 1 |
"product_id": review.product_id,
"rating": review.rating,
"comment": review.comment,
},
]
)
)
await session.commit()
await update_rating(session, review.product_id)
return {"st... | Python | 1 |
0x1B67)),
Expr.Ez,
Expr.Return,
),
'loc_36B',
)
PlaySE(43, 0x00, 0x64)
OP_70(0x0000, 60)
Sleep(500)
If(
(
(Expr.Eval, "AddItem(ItemTable['兔跃靴'], 1)"),
Expr.Return,
),
'loc_302',
)
FadeOut(300, 0, 100)
... | Python | 1 |
n=input ()
m=int(input ())
for I in range (m):
print ('Hipp hipp hurra, '+n+'!') | Python | 1 |
>,
pub a_author: Option<String>,
pub a_email: Option<String>,
pub a_stylesheet: Option<String>,
/// Handlebars template context
pub sidebar_items: Vec<SidebarItem>,
}
impl<'a> HbsInput<'a> {
/// WARN: be sure to set `sidebar_items` later
pub fn new(html: &'a str, meta: &AdocMetadata, base_u... | Rust | 0 |
from langchain_cohere import CohereEmbeddings
from langchain_chroma import Chroma
from sqlalchemy import create_engine
import pandas as pd
from app.core.config import settings
engine = create_engine(settings.MYSQL_URL)
df = pd.read_sql("""
SELECT p.marca, p.nombre, p.precio_regular, p.precio_promo, c.nombre as cat... | Python | 1 |
(LabelORM.id.in_(label_ids_to_delete)).delete(synchronize_session=False)
self.session.commit()
def _get_or_create(self, session, model, **kwargs):
instance = session.query(model).filter_by(**kwargs).first()
if instance:
return instance
else:
instance = model... | Python | 1 |
.bot$")
async def bot(robot):
if not robot.text[0].isalpha() and robot.text[0] not in ("/", "#", "@", "!"):
await robot.edit(
"` \n ╲╲╭━━━━╮ \n╭╮┃▆┈┈▆┃╭╮ \n┃╰┫▽▽▽┣╯┃ \n╰━┫△△△┣━╯`"
"`\n╲╲┃┈┈┈┈┃ \n╲╲┃┈┏┓┈┃ `"
)
@register(outgoing=True, pattern="^.hey$")
async def hey(heyo)... | Python | 1 |
wrap_err(),
PhragmenError::CompactStakeOverflow,
);
}
#[test]
fn target_count_overflow_is_detected() {
let voter_index = |a: &AccountId| -> Option<u32> { Some(*a as u32) };
let target_index = |a: &AccountId| -> Option<u8> { Some(*a as u8) };
let assignments = vec![
Assignment {
who: 1 as AccountI... | Rust | 0 |
(False)
self.view.horizontalHeader().setHighlightSections(False)
self.view.horizontalHeader().setStretchLastSection(True)
self.view.horizontalHeader().setResizeMode(LogModel.LEVEL, QHeaderView.ResizeToContents)
self.view.horizontalHeader().setResizeMode(LogModel.MESSAGE, QHeaderView.Stre... | Python | 1 |
1, f"Point average does not match original sunsky emitter {err = }"
@pytest.mark.slow
@pytest.mark.parametrize("turb", [2.2, 4.8, 6.0])
@pytest.mark.parametrize("start_day", [2, 15, 22])
def test03_sky_sampling(variants_vec_backends_once, turb, start_day):
from .test_sunsky import CroppedSphericalDomain
... | Python | 1 |
= data['Weight']
# absolutes = data['Weighted Score']
#
# # Create the pie chart with percentage and absolute values
# wedges, texts, autotexts = plt.pie(percentages, labels=[indicator_names[i] for i in data['Indicator']],
# autopct='%1.1f%%', startangle=140, textprop... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.