text string | label_name string | labels int64 |
|---|---|---|
#===============================================================================
# This is to create a single sphere in Blender
#
# You can run it interactivelly with:
# > blender --background --python ./sphere.py
#
# or:
# > blender -b -P ./sphere.py
#---------------------------------------------------------... | Python | 1 |
container=False)
with gr.Column(scale=0.15, min_width=0):
clear = gr.Button("Clear")
with gr.Column(scale=0.15, min_width=0):
btn = gr.UploadButton("Upload", file_types=["image"])
txt.submit(bot.run_text, [txt, state], [chatbot, state])
... | Python | 1 |
-----------------------
# Decorators for public use
# Decorators to skip certain tests on specific platforms.
skip_win32 = skipif(sys.platform == 'win32',
"This test does not run under Windows")
skip_linux = skipif(sys.platform.startswith('linux'),
"This test does not run under ... | Python | 1 |
her.aabb
}
}
impl Eq for RandomBVHCandidate {}
impl PartialOrd for RandomBVHCandidate {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
FloatOrd(self.dist_to_root_center)
.partial_cmp(&FloatOrd(other.dist_to_root_center))
.map(Ordering::reverse)
}
}
impl Ord for R... | Rust | 0 |
of 100 would result in a line width of 3 in the backing texture of the font.
///
/// The font will allow you to choose a fill_color and a stroke_color when drawing text. The lines surrounding the characters of
/// the text will get the stroke_color.
///
/// Setting this value to 0 will prevent th... | Rust | 0 |
import urllib.request
from selenium import webdriver
from PIL import Image
import time
from grab import grabDouBanCommentData
url = 'http://accounts.douban.com/login'
email = input('E-mail:')
password = input('Password:')
browser = webdriver.PhantomJS(executable_path=r'D:\codetools\phantomjs-2.1.1-windows\bin\phantom... | Python | 1 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Samples a large number of images from a pre-trained DiT model using DDP.
Subsequently saves a .npz file that can be us... | Python | 1 |
# Base class for all trading strategies in Kriging-Bot
from abc import ABC, abstractmethod
class BaseStrategy(ABC):
"""
Abstract base class for all trading strategies.
Provides interface for initialization, signal generation, and execution.
"""
def __init__(self, name: str, config: dict = None):
... | Python | 1 |
print("FAIL: number of reply does not match")
errs += 1
break
rep = json_loads(rep)
json_res.append(rep)
# self.assertEqual(rep, r, f"reply does not match for {requestFile!s}")
if rep != r:
print(self.__c... | Python | 1 |
2 - Contagem Regressiva com Verificação:
Faça um programa que use um laço while para fazer uma
contagem regressiva de um número inserido pelo usuário até 0.
Durante a contagem, exiba "Número par" para os números
pares. | Python | 1 |
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
"r",
"s",
"t",
"u",
"v",
"w",
"x",
"y",
"z",
"braceleft",
"bar",
"braceright",
"asciitilde",
".notdef",
"Adieresis",
"Aring",
"Ccedilla",
"Eacute",
"Ntilde",
"... | Rust | 0 |
# Copyright (c) 2024, Shanghai Iluvatar CoreX Semiconductor Co., Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/license... | Python | 1 |
râmetros: {clean_params} - Accuracy: {acc}")
test_results.append({
"Modelo": idx + 1,
"ExtractModel": model_type,
"Pooling": POOLING,
"Parâmetros": clean_params,
"Acurácia": acc,
"Precisão": precision,
... | Python | 1 |
"""
Create the distribution of the maximum of distributions
=======================================================
"""
# %%
# Context
# -------
#
# In this example, we define how to build a distribution defined as the maximum of some other ones.
#
# We detail some interesting cases:
#
# - Case 1: The maximum of corre... | Python | 1 |
ends.entry(interval_end).or_default().push(interval_index);
}
} else {
line_elms[0].trim().split(';').for_each(|elm| {
for interval_start in read_interval_elm(elm, symbols) {
starts.entry(interval_start).or_default().push(interval_index);
... | Rust | 0 |
= "allow_unknown_fields"), serde(deny_unknown_fields))]
#[non_exhaustive]
pub struct Tiers {
/// Indicates whether or not emote information is accessible to users.
pub can_cheer: bool,
/// Hex code for the color associated with the bits of that tier. Grey, Purple, Teal, Blue, or Red col... | Rust | 0 |
R {
HOST_SLC0_TOHOST_BIT3_INT_ENA1_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 4"]
#[inline(always)]
pub fn host_slc0_tohost_bit4_int_ena1(&self) -> HOST_SLC0_TOHOST_BIT4_INT_ENA1_R {
HOST_SLC0_TOHOST_BIT4_INT_ENA1_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 5... | Rust | 0 |
('pressed', colors['success']),
('disabled', colors['disabled'])])
# 警告按鈕樣式
style.configure('Warning.TButton',
font=fonts['button'],
foreground=colors['text'],
background=colors['warning... | Python | 1 |
# =============================================================================
# Copyright (C) 2019 Ryan Holmes
#
# This file is part of pyfa.
#
# pyfa 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, either v... | Python | 1 |
#!/usr/bin/env python3
from __future__ import print_function
import roslib
#roslib.load_manifest('my_package')
import sys
import rospy
import cv2
import numpy as np
from std_msgs.msg import String
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
class video_show:
def __init__(self)... | Python | 1 |
#!/usr/bin/env python
from pwn import *
with context.quiet:
p = process('qemu-arm -L ./ ./program', shell=True)
p.recvuntil('Welcome to bi0s CTF!\n')
bss = 0x21034
# replace the return address (pc) with address of the read snippet, so we can execute the read again
# we also set the "saved fp" i... | Python | 1 |
'''
Universidad Escuela Colombiana de Ingeniería
Algoritmos y Programación (AYPR)
Profesora: Ingeniera Patricia Salazar Perdomo
Estudiante: Lancheros José, Valero Daniel
Lenguaje: Python
Referencia: Tarea No. 15
11. Obtener la suma de los números que hay por debajo de la diagonal secundaria de una matriz cuadrada.
... | Python | 1 |
= 0.01);
assert_relative_eq!(Rgb::new(0.0, 0.0, 1.0), image.get(1, 0), epsilon = 0.01);
assert_relative_eq!(Rgb::new(1.0, 0.0, 1.0), image.get(1, 1), epsilon = 0.01);
}
}
}
mod tga {
use picto::{self, color::*};
#[test]
fn read_as_is() {
let image = picto::read::from_path::<Rgb, u8, _>("tests/rainbow.t... | Rust | 0 |
out_header_eq(mut result: Module, expected: &str) {
use rspirv::binary::Disassemble;
//use rspirv::binary::Assemble;
// validate(&result.assemble());
result.header = None;
let result = result.disassemble();
let expected = expected
.split('\n')
.map(|l| l.trim())
.colle... | Rust | 0 |
g, CryptoError> {
let mut iv = [0_u8; 12];
let mut mac = [0_u8; 16];
let mut cipher = vec![0_u8; p_data.len()];
unsafe {
handle_sgx!(sgx_read_rand(iv.as_mut_ptr(), iv.len()))?;
}
if let Err(s) =
rsgx_rijndael128GCM_encrypt(&p_key.key, p_data, &iv, &[], &mut cipher[..], &mut mac)... | Rust | 0 |
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup()
d['packages'] = ['assignment2_exprob']
d['package_dir'] = {'': 'scripts'}
setup(**d) | Python | 1 |
ending {} eth frames w/ {}-byte payload (total msg size: {} bytes) (single-threaded)",
config.num_frames_to_send,
config.payload_size,
eth_frame.len()
);
dev2_to_dev1_single_thread(config, dev1, dev2);
}
}
fn parse_arg<T>(matches: &clap::ArgMatches, name: &str, e... | Rust | 0 |
files
if not force_remove or failure:
msg = f"Folder {dir_path} is already used, please remove it and rerun the program"
print(msg)
raise Exception(msg)
def create_or_reset_dir(
dir_path: str, ignore_files: Iterable[str] = tuple(), force_reset: bool = False
) -> None:
... | Python | 1 |
r(
self.to_glib_none().0,
idx,
))
}
}
///
/// Feature: `v1_16`
///
/// ## `public_key`
/// the public key for looking up the
/// peer.
/// ## `out_idx`
/// optional output argument
/// for the index of the found peer. If no i... | Rust | 0 |
1
)]
filter_quote: Vec<InvertibleGlob>,
/// Filter which system includes are inlined.
///
/// This option works just like --filter, except it only applies to system includes.
#[clap(
long,
value_name = "glob",
multiple_occurrences = true,
number_of_values = 1
... | Rust | 0 |
import bs4
from bs4 import BeautifulSoup
import requests
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import selenium
# doc = requests.get('https://ncert.nic.in/textb... | Python | 1 |
#==========================================================================
#
# Copyright NumFOCUS
#
# 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/... | Python | 1 |
import layoutparser as lp
import cv2
from PIL import Image
import numpy as np
def preprocess(im):
gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
gray = cv2.resize(gray, (0, 0), fx=2, fy=2)
# if gray.mean() > 127:
# thr = cv2.adaptiveThreshold(
# gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2... | Python | 1 |
32 = 40003;
const MSGID_REPAIR: u32 = 40004;
const MSGID_VERSION: u32 = 40005;
const MSGID_RESTART: u32 = 40009;
const MSGID_EXIT: u32 = 40010;
static mut P_NID: *mut NOTIFYICONDATAW = ptr::null_mut();
static mut P_NID_NORMAL: *mut NOTIFYICONDATAW = ptr::null_mut();
static mut P_NID_LOAD: *mut NOTIFYICONDATAW = ptr::n... | Rust | 0 |
from string import Template
_IMG2IMG_COMFYUI_PROMPT = """{
"6": {
"inputs": {
"text": "$text",
"clip": [
"11",
0
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"8": {
"inputs": {
"samples": [
... | Python | 1 |
// class.path == "java/security/AlgorithmParameters", java.flags == PUBLIC | STATIC, .name == "getInstance", .descriptor == "(Ljava/lang/String;Ljava/lang/String;)Ljava/security/AlgorithmParameters;"
unsafe {
let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindge... | Rust | 0 |
th: init_settings.epoch_stability_depth,
initial_utxos: init_settings.initial_utxos,
bft_leaders: init_settings.bft_leaders,
allow_account_creation: init_settings.allow_account_creation,
linear_fees: init_settings.linear_fee,
});
s... | Rust | 0 |
& 0xFFFF00FF) | (($mid as u32) << 8)
};
}
// Get the highest byte of a 24-bit value (or, the second highest byte of a 32-bit value).
macro_rules! hi24 {
($val:expr) => {
($val >> 16) as u8
};
}
// Set the high byte of a 24-bit value.
macro_rules! set_hi24 {
($val:expr, $hi:expr) => {
... | Rust | 0 |
tegory, projects[project_id]["categories"][category]
)
else:
# create stats dict for category
projects[project_id]["categories"][category] = get_category_stats(
reason, totals, outcome, category
)
projects = dict(sorted(projects.items()))
... | Python | 1 |
w: QgsDateTimeEdit = self.mTable.cellWidget(row, 5)
if w.isNull():
endTimes.append('')
else:
endTimes.append(w.dateTime().toString('yyyy-MM-ddTHH:mm:ss'))
w: QgsFilterLineEdit() = self.mTable.cellWidget(row, 6)
offsets.append(tofloat(w.tex... | Python | 1 |
parsing. Zero-length matches will be added between
/// a mismatch and a subsequent mismatch, deletion, or
/// end-of-string. This ensures that the resulting MD field string
/// matches the regexp
///
/// `[0-9]+(([A-Z]|\^[A-Z]+)[0-9]+)*`
///
/// # Arguments
///
/// * `mds` are a vec... | Rust | 0 |
import math
import torch
import torch.nn as nn
class PositionEmbedding(nn.Module):
def __init__(self,d_model=64,dropout_rate=0.1,max_len=5000):
super(PositionEmbedding,self).__init__()
self.dropout = nn.Dropout(p=dropout_rate)
# 0矩阵:[max_len,d_model]
pe = torch.zeros(max_len, d_mod... | Python | 1 |
ord")
print("4. Delete word")
print("5. Show all words")
print("6. Show statistics")
print("7. Exit")
choice = input("Your choice: ").strip()
if choice == "1":
search_word(dictionary)
elif choice == "2":
add_word(dictionary)
elif c... | Python | 1 |
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0x07) | ((value as u32) & 0x07);
self.w
}
}
impl R {
#[doc = "Bits 3:5 - 5:3\\]
Receive interrupt FIFO level select: This field sets the trigge... | Rust | 0 |
y unlock the
// mutex and wake up a waiter, if any. Otherwise we decrement our
// recursive counter and let some one else take care of the zero.
match *self.recursions.get() {
0 => {
self.owner.swap(0, SeqCst);
wasm32::atomic_notify(self.ptr() as *mut ... | Rust | 0 |
");
/// ```
pub fn new(file_name: &str) -> PPMDecoder {
let file = File::open(file_name).unwrap();
PPMDecoder{f : file}
}
/// Loads a ppm file.
///
/// Will load a ppm file that's in either ASCII or binary format. The file extension does not
/// matter.
///
/// # Exa... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python | 1 |
le(Tag(0x0028, 0x1051)), alias: "WindowWidth", vr: DS },
E { tag: Single(Tag(0x0028, 0x1052)), alias: "RescaleIntercept", vr: DS },
E { tag: Single(Tag(0x0028, 0x1053)), alias: "RescaleSlope", vr: DS },
E { tag: Single(Tag(0x0028, 0x1054)), alias: "RescaleType", vr: LO },
E { tag: Single(Tag(0x0028, 0x1... | Rust | 0 |
(&(R::from(err))) {
Ok(b) => resp_stub()
.with_status(StatusCode::BadRequest)
.with_header(ContentType::json())
.with_header(ContentLength(b.len() as u64))
.with_body(b),
Err(e) => {
// Should rarely or never happen
... | Rust | 0 |
self.max_align = align;
}
let thin = ThinArch {
data: bytes,
cpu_type,
cpu_subtype,
align,
};
self.arches.push(t... | Rust | 0 |
ize,
has_other_words: bool,
) -> SudachiResult<Vec<Node>>;
/// Fills range field of generated nodes and returns.
fn get_oov(
&self,
input_text: &Utf8InputText,
offset: usize,
has_other_words: bool,
) -> SudachiResult<Vec<Node>> {
let mut nodes = self.prov... | Rust | 0 |
_string<P: AsRef<str>>(value: P) -> Result<Self, FbxError> {
match value.as_ref() {
"ByPolygon" => Ok(FbxMapping::ByPolygon),
"ByPolygonVertex" => Ok(FbxMapping::ByPolygonVertex),
"ByVertex" | "ByVertice" => Ok(FbxMapping::ByVertex),
"ByEdge" => Ok(FbxMapping::ByE... | Rust | 0 |
# This file is part of the faebryk project
# SPDX-License-Identifier: MIT
import faebryk.library._F as F
from faebryk.core.module import Module
from faebryk.libs.library import L
from faebryk.libs.units import P
class SPIFlash(Module):
power: F.ElectricPower
qspi = L.f_field(F.MultiSPI)(4)
memory_size =... | Python | 1 |
// Tab Settings
pub tab_size: u16,
}
impl Default for ViewConfig {
fn default() -> ViewConfig {
ViewConfig {
display_gutter: true,
gutter_size: 0,
tab_size: 4,
}
}
}
<gh_stars>0
/*
* Copyright 2015 <NAME>
*
* Licensed under the Apache License, Version ... | Rust | 0 |
xmin = cms.double(-10.0),
xmax = cms.double(10.0),
Nbiny = cms.int32(20),
ymin = cms.double(-0.1),
ymax = cms.double(1.2)
),
Trending ... | Python | 1 |
er, TyExt, TyKind};
pub fn missing_unsafe(db: &dyn HirDatabase, def: DefWithBodyId) -> Vec<ExprId> {
let infer = db.infer(def);
let is_unsafe = match def {
DefWithBodyId::FunctionId(it) => db.function_data(it).is_unsafe(),
DefWithBodyId::StaticId(_) | DefWithBodyId::ConstId(_) => false,
};... | Rust | 0 |
"""a JupyterLite addon for customizing favicons
TODO:
- this should do some best-effort image conversions.
- may also impact `serviceworker.py`
"""
import pprint
from typing import TYPE_CHECKING
from ..optional import has_optional_dependency
from .base import BaseAddon
if TYPE_CHECKING: # pragma: no cover
... | Python | 1 |
t的queue数量
:type CurrentQueues: int
:param _CurrentExchanges: 当前vhost的exchange数量
:type CurrentExchanges: int
:param _CurrentConnections: 当前vhost的连接数量
:type CurrentConnections: int
:param _CurrentChannels: 当前vhost的channel数量
:type CurrentChannels: int
:param ... | Python | 1 |
t uses information from the first text to fill the placeholders.
## Rules
- A placeholder is a string like "[[placeholder]]". E.g. "[[company]]", "[[job_title]]", "[[years_of_experience]]"...
- The task is to remove the placeholders from the text.
- If there is no information to... | Python | 1 |
) -> Displacement {
Displacement {
base_displacement: disp,
outer_displacement: 0,
indexer: Indexer::NoIndexer,
indirection: MemoryIndirection::NoIndirection,
}
}
/// Convenience function (for tests and decoding cases) to generate a displacement with a data
/// register and scal... | Rust | 0 |
;
}
std::cmp::min(base_bytes_max, cur_level_size)
};
self.level_multiplier = max_bytes_for_level_multiplier;
if l0_size > base_level_size
&& (l0_size > max_bytes_for_level_base
|| self.level0.tables.len() / 2 > level... | Rust | 0 |
+ "n" + str(
num_keys) + ".tsv"
np.savetxt(
file_name,
table,
fmt="%g",
header="depth,CountSketchMedian,CountSketchSigns,BCountSketchMedian,BCountSketchSigns"
)
print("To plot the results run: python3 plot.py", file_name, num_trials)
def sweep_width_trial(sketch_class, seed, num_su... | Python | 1 |
mi = v.z;
}
if v.z > ma {
ma = v.z;
}
}
// let z_sect = (ma + mi) / 2.0;
// let depth: i32 = (10.0 * (10.0 / (1.0f64 + n_sections as f64)).log10()).floor() as i32;
// let mut results: Vec<Vec<String>> = Vec::with_capacity(depth.pow(n_sections as u32) as u... | Rust | 0 |
_options(self, option_order)
finally:
sys.stdout.reconfigure(encoding=encoding)
def run_command(self, command):
self.set_defaults()
# Postpone defaults until all explicit configuration is considered
# (setup() args, config files, command line and plugins)
super(... | Python | 1 |
serde_json::to_string(self).unwrap())
}
}
impl GetGameHighScoreInline {
pub fn new<I>(inline_message_id: I, user_id: i32) -> Self
where
I: Into<String>,
{
let inline_message_id = inline_message_id.into();
Self {
inline_message_id,
user_id,
}
}... | Rust | 0 |
from rest_framework import generics
from apps.api.product.v1.serializers import ProductSerializer
from apps.common.models import Products, Tech1, Type
from django_filters.rest_framework import DjangoFilterBackend
import django_filters
class ProductFilter(django_filters.FilterSet):
class Meta:
model = Prod... | Python | 1 |
gs)
def _runtime_environment(self, *new_paths):
'''
Returns a new environment dictionary for this intepreter, with only the supplied paths
(and the required maya paths). Dictionary is independent of machine level settings;
non maya/python related values are preserved.
''... | Python | 1 |
array))(input)
}
use crate::field::SizedPrimeField;
use crate::fp::Fp;
use crate::representation::ElementRepr;
use crate::traits::{FieldElement, MsbBitIterator, ZeroAndOne};
use crate::weierstrass::Group;
use crate::weierstrass::{CurveParameters};
use crate::weierstrass::curve::{WeierstrassCurve, CurvePoint};
use crat... | Rust | 0 |
olume to aspirate from the elution
buffer source and dispense to each well containing
beads.
"""
# resuspend beads in elution
if magdeck.status == 'enagaged':
magdeck.disengage()
_pick_up(m300)
m300.mix(5, 100, ... | Python | 1 |
from ..base_agent import BaseAgent
class OpenAIRealtime(BaseAgent):
#Not implemented yet
pass
| Python | 1 |
'type': type,
}
checkskipjob = ses.post(skipjob,params=PARAMS).json()
if checkskipjob['status'] == 200:
message = checkskipjob['message']
... | Python | 1 |
"""
Time zone information
"""
tz_str = """-1200 Y
-1100 X NUT SST
-1000 W CKT HAST HST TAHT TKT
-0900 V AKST GAMT GIT HADT HNY
-0800 U AKDT CIST HAY HNP PST PT
-0700 T HAP HNR MST PDT
-0600 S CST EAST GALT HAR HNC MDT
-0500 R CDT COT EASST ECT EST ET HAC HNE PET
-0400 Q AST BOT CLT COST EDT FKT GYT HAE HNA PYT
-0300 P... | Python | 1 |
[admin_external:endpoint2]
handlertype = python
python.version = python3
handlerfile = file2.py
handleractions = list, create, remove, edit
handlerpersistentmode = true
"""
).lstrip()
restmap_conf = RestMapConf(
global_config_logging_with_user_defined... | Python | 1 |
entered_value == hex_val
# Notify Test
hex_val = self.gen_hex_pairs()
server.get_characteristic(char_uuid).value = self.hex_to_byte(hex_val)
print("A new value will be notified on the phone")
await aioconsole.ainput("Press enter to receive the new value...")
server.up... | Python | 1 |
from lib.booking import Booking
import datetime
class BookingRepository:
def __init__(self, connection):
self._connection = connection
def create(self, booking):
self._connection.execute('INSERT INTO bookings (start_date, end_date, user_id, space_id) VALUES (%s, %s, %s, %s)', [booking.star... | Python | 1 |
ences = np.array(phase_differences)
abs_phase_differences = np.abs(phase_differences)
sin_phase_differences = np.sin(abs_phase_differences %np.pi)
# Plot the histogram of the absolute phase differences
fig_hist, (ax_hist1, ax_hist2) = plt.subplots(1, 2, figsize=(12, 5))
ax_hist1.hist(abs_phase_dif... | Python | 1 |
mpl Plugin for DebugPlugin {
fn build(&self, app: &mut App) {
app.add_system(debug_panel);
}
}
fn debug_panel(
mut egui: ResMut<EguiContext>,
windows: Res<Windows>,
q_camera: Query<(&Camera, &GlobalTransform, &OrthographicProjection)>,
) {
let mut ctx = egui.ctx_mut();
let window =... | Rust | 0 |
rint(rng, self.foe_change_proc)
if rng > self.foe_change_proc:
return
for stat in self.foe_change_stats:
self.modify_ability(target_stats, self.foe_change_value, stat)
def modify_ability(self, target:Stats, modifier, stat):
target.ability.check_attack_type_stat_modif... | Python | 1 |
h(pe)
plt.text(4.2,-408,'Sound with Noise',fontsize=15,color='w')
plt.ylim(-410,65)
plt.tick_params(labelsize=10)
t=np.linspace(0-0.503,7-0.503,arraylength)
plt.plot(t,conv_avg,linewidth=2,color=color[g])
plt.fill_between(t,conv_avg-conv_sterr,conv_avg+conv_sterr,linewidth=0,alpha=0.3,facecolor=co... | Python | 1 |
l, |val| val != 0);
unbox_simple!(uint32 => char, |val| char::try_from(val)?);
unbox_simple!(int8 => i8);
unbox_simple!(int16 => i16);
unbox_simple!(int32 => i32);
unbox_simple!(int64 => i64);
unbox_simple!(long => isize);
unbox_simple!(uint8 => u8);
unbox_simple!(uint16 => u16);
unbox_simple!(uint32 => u32);
unbox_si... | Rust | 0 |
cosmwasm_std::testing::mock_env;
use cosmwasm_std::{coin, coins, from_binary, CosmosMsg, Decimal, HumanAddr, StdError};
use terra_bindings::{
ExchangeRateResponse as TerraExchangeRateResponse, ExchangeRatesResponse, OracleQuery,
RewardsWeightResponse, SeigniorageProceedsResponse, TaxCapRespons... | Rust | 0 |
inds.is_open(ctx);
egui::Window::new(GENERAL_KEYBINDS_TITLE)
.open(&mut open)
.show(ctx, |ui| {
let r = ui.add(KeybindsTable::new(app, keybinds_table::GeneralKeybinds));
app.prefs.needs_save |= r.changed();
});
Window::GeneralKeybinds.set_open(ctx, open);
let... | Rust | 0 |
))
# Try to switch to an invalid thread ID
conn.expect('Hgfe', '')
# Ensure still on thread 8
conn.expect('qC', 'QC08')
@test_harness.test(['emulator'])
def gdb_thread_info(*unused):
# Run with one core, four threads
hexfile = test_harness.build_program(['count.S'], image_typ... | Python | 1 |
use std::fs;
use std::path::{Path, PathBuf};
use diesel::{
r2d2::{ConnectionManager, Pool},
sqlite::SqliteConnection,
};
use splinter::migrations::run_sqlite_migrations;
use crate::error::CliError;
const SPLINTER_HOME_ENV: &str = "SPLINTER_HOME";
const SPLINTER_STATE_DIR_ENV: &str = "SPLINTER_STATE_DIR";
co... | Rust | 0 |
[plugin_init]
pub fn on_load() {
console::register_notifier("rust_demolish", Box::new(move |_: Vec<String>| {
match game::get_local_car() {
Some(car) => car.demolish(),
None => log_console!("Car is NULL")
};
}));
console::register_notifier("rust_notifier", Box::new(n... | Rust | 0 |
,
pcs_token_deltas: store::Deltas,
total_deltas: store::Deltas,
volumes_deltas: store::Deltas,
reserves_delta: store::Deltas,
events: Events,
) -> Vec<Item> {
struct SortableItem {
ordinal: u64,
item: Item,
}
let mut items: Vec<SortableItem> = Vec::new();
for delta ... | Rust | 0 |
def test_stable_diffusion_adapter_pipeline_with_sequential_cpu_offloading(self
):
torch.cuda.empty_cache()
torch.cuda.reset_max_memory_allocated()
torch.cuda.reset_peak_memory_stats()
adapter = T2IAdapter.from_pretrained('TencentARC/t2iadapter_seg_sd14v1')
pipe = StableDiffusionAdapterPipeline.f... | Python | 1 |
okupTableScalarRangeOn()
Mapper10.SetScalarVisibility(1)
Mapper10.SetScalarModeToUsePointFieldData()
Mapper10.SelectColorArray("Density")
Mapper10.SetLookupTable(LookupTable1)
Actor10 = vtkActor()
Actor10.SetMapper(Mapper10)
Actor10.GetProperty().SetRepresentationToSurface()
Actor10.GetProperty().SetInterpolationToGou... | Python | 1 |
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from .models import CustomUser
class CustomUserCreationForm(UserCreationForm):
class Meta:
model = CustomUser
fields = ('username','email','age',)
class CustomUserChangeForm(UserChangeForm):
c... | Python | 1 |
p();
// second needs trim to remove dot
let second = self.person_id(words.last().unwrap().trim_matches('.'));
if gainlose == "lose" {
amount *= -1;
}
self.happiness.insert((first, second), amount);
}
fn max(&self) -> i32 {
(0..self.people.len() as u16)... | Rust | 0 |
"""An external UID for a schedule."""
from jupiter.core.framework.errors import InputValidationError
from jupiter.core.framework.value import AtomicValue, value
from jupiter.core.use_cases.infra.realms import (
PrimitiveAtomicValueDatabaseDecoder,
PrimitiveAtomicValueDatabaseEncoder,
)
@value
class ScheduleE... | Python | 1 |
oncordium-euro2ccd-service<filename>src/helpers.rs
use concordium_rust_sdk::types::ExchangeRate;
use num_bigint::BigInt;
use num_integer::Integer;
use num_rational::BigRational;
use num_traits::{CheckedDiv, ToPrimitive, Zero};
use std::collections::VecDeque;
/**
* Compute the average of the rates stored in the given ... | Rust | 0 |
import numpy as np
from pyscf import gto, scf, mcscf
from dsrg.reference import SpinReference
from dsrg.driver_so import DSRG
VERBOSE = 0
RTOL = 1.0e-06
ATOL = 1.0e-06
def test_mrdsrg_ldsrg2_hf():
mol = gto.M(atom='''H 0 0 0; F 0 0 1.5''',
spin=0,
basis='6-31g',
... | Python | 1 |
import os
import json
import asyncio
import urllib.request
from open_taxonomy import TaxonomyNode, TaxonomyTree, is_node_relevant
taxonomy_url = "https://raw.githubusercontent.com/Intuitive-Systems/open-taxonomy/main/dist/taxonomy.json"
# Create an asynchronous function to load and test the taxonomy tree
async def l... | Python | 1 |
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
def plot_stress_levels_over_time(stress_data, time_period='daily'):
"""
Generates a line plot showing the user's stress levels ov... | Python | 1 |
lat += angle.cos()
* gamepad.value(Axis::LeftStickY) as f64
* (0.0000001 * altitude).min(0.01)
- angle.sin()
* gamepad.value(Axis::LeftStickX) as f64
* (0.0000001 * altitu... | Rust | 0 |
m.group(2))
if m.group(3):
offset = offset + 60 * int(m.group(3))
if m.group(1) == '-':
offset = -offset
return offset
def _str2time(day, mon, yr, hr, min, sec, tz):
yr = int(yr)
if yr > datetime.MAXYEAR:
return None
# translate month nam... | Python | 1 |
essful
error: Error message if operation failed
"""
dynamodb_logger = get_dynamodb_logger()
if success:
dynamodb_logger.info(
f"DynamoDB operation - Table: {table}, Operation: {operation}, "
f"Username: {username or 'N/A'}, Status: SUCCESS"
)
else:
... | Python | 1 |
{
#[inline]
pub fn add_task_id(&mut self, task_id: &TaskId) {
self.fbb_
.push_slot_always::<&TaskId>(CancelTask::VT_TASK_ID, task_id);
}
#[inline]
pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> CancelTaskBuilder<'a, 'b> {
let start = _fbb.start_table();... | Rust | 0 |
);
}
pub fn nullable_int_array_def_val(&self) -> NullOr<&Vec<i64>>{
let qv = root::get_int_array_def(self.ptr, "nullableIntArray").unwrap();
NullOr::from_qv(qv).unwrap()
}
pub fn nullable_int_array(&self) -> NullOr<&Vec<i64>>{
let qv = root::get_immutable_int_array(self.ptr, "nullableIntArray").unwrap();
Nu... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.