text string | label_name string | labels int64 |
|---|---|---|
def set_transformer_params(self, mix_ratio: float=0.5, condition_types:
Tuple=('text', 'image')):
for name, module in self.image_unet.named_modules():
if isinstance(module, DualTransformer2DModel):
module.mix_ratio = mix_ratio
for i, type in enumerate(condition_types):
... | Python | 1 |
d(0),
}
}
pub fn listener(&self) -> OffsetChangeListener {
self.event.change_listner()
}
/// update health check
// TODO: Determine if we can follow the clippy suggestion w/o negatively affecting functionality
#[allow(clippy::branches_sharing_cod... | Rust | 0 |
e_status);
if let Some(charge_tracker_clock) = charge_tracker_clock {
entity_builder = entity_builder.with(charge_tracker_clock);
}
if let Some(charge_limit) = charge_limit {
entity_builder = entity_builder.with... | Rust | 0 |
(
&self,
master_id: DeviceId,
attribute_id: AttributeId,
value: &AttributeValue,
) -> Result<(), Box<dyn Error>>;
}
pub struct AprontestController {
runner: Box<
dyn for<'a> Fn(
&'a [&str],
)
-> Pin<Box<dyn Future<Output = Resu... | Rust | 0 |
now();
let mut timeout = LOOPER_SAVE_TIMEOUT;
for (id, c) in channels {
session.loopers.push(
c.recv_timeout(timeout)
.map_err(|_| SaveLoadError::LooperSaveError(id))??,
);
timeout = timeout
.checked_sub(start.elaps... | Rust | 0 |
let serial = Serial(&**r.USART1);
let byte = serial.read().unwrap();
serial.write(byte).unwrap();
}
fn toggle(_t: &mut Threshold, r: SYS_TICK::Resources) {
**r.ON = !**r.ON;
if **r.ON {
PC13.on();
} else {
PC13.off();
}
}
// 1580000
pub fn part1() {
let mut pos = 0;
le... | Rust | 0 |
import math
from typing import List
from PIL import Image
import cv2
import numpy as np
import torch
from utils import ptp_utils
from utils.ptp_utils import MControl
# def show_cross_attention(prompt: str,
# attention_store: AttentionStore,
# tokenizer,
# ... | Python | 1 |
*const GLvoid
} else {
indices.as_ptr() as *const GLvoid
};
ffi::glDrawElements(mode, count, type_, ptr)
}
}
pub fn enable(feature: GLenum) {
unsafe { ffi::glEnable(feature) }
}
pub fn enable_vertex_attrib_array(index: GLuint) {
unsafe { ffi::glEnableVertexAttribArray(... | Rust | 0 |
x8e\x9ft8c\
\x11\x0as1\x94\xa8I\xe62\x05\x8b\x0af\x02v0\
\x05\x9d2)%\xfcD\xc5\xb38\xc2\x94\x0a\xfe\xb3\xdf\
]\xb1t\x86\xbf\xf0\x13\x97\x13\x0baF,\xaa\xb8^\
Z\xbd%\x8c\xd9\x12r\x01i\x90P\xf3\xef\xfc\xfe9\
\xff\xbb\x9f\x5c\x83\x08{M\xc1d\xbd\xb5Z\xa7t\xc6\
\x22\x86\xa3\xd1 \x92T\xedj\xd5\xbchp\xd4W\xbe\
b\x84\x98\xb5\xd9... | Python | 1 |
import os
import sys
workspace = os.path.abspath(os.path.join(__file__, "..", ".."))
sys.path.append(workspace)
from src import landscape
from src import benchmark
f = benchmark.Sphere()
landscape.draw_3d(f, *f.bound(), 0.1, f"{f.name()}.pdf")
| Python | 1 |
(3, 1, 2)
plt.plot(episodes, self.episode_wins, label='Wins', color='green')
plt.title('Wins vs Episode')
plt.xlabel('Episode')
plt.ylabel('Wins')
plt.grid()
# Plot the moves over episodes
plt.subplot(3, 1, 3)
plt.plot(episodes, self.episode_moves, label='... | Python | 1 |
e/line_w_long.png').convert_alpha()
# 半透明
note_w_trans = pygame.image.load('music_score/note_w_trans.png').convert_alpha()
sharp_w_trans = pygame.image.load('music_score/sharp_w_trans.png').convert_alpha()
flat_w_trans = pygame.image.load('music_score/flat_w_trans.png').convert_alpha()
double_sharp_w_trans = pygame.im... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, api
from odoo.addons.sale_timesheet.models.account import TIMESHEET_INVOICE_TYPES
class TimesheetsAnalysisReport(models.Model):
_inherit = "timesheets.analysis.report"
order_i... | Python | 1 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from cryptography.hazmat.primitives._serialization import (
BestAvailableEncryption,
Encoding,
KeySerializationEncryption,
... | Python | 1 |
elements as usize {
return Err(LiquidError::EmptyBuffer);
}
unsafe {
$release(self.inner, n as c_uint);
Ok(())
}
}
/// write a single sample into the buffer
pub fn push(&mut se... | Rust | 0 |
from tkinter import *
import time
import random as r
from pygame import mixer
mixer.init()
mixer.music.load("Media\\kb.mp3")
root = Tk()
root.geometry("580x490+200+200")
root.overrideredirect(True)
from PIL import Image
fnm="Media\\tenor.gif"
imageObject = Image.open(fnm)
frameCnt = imageObject.n_frames
frames ... | Python | 1 |
shape of [N].
thresh (float): Overlap threshold of NMS.
pre_max_size (int, optional): Max size of boxes before NMS.
Defaults to None.
post_max_size (int, optional): Max size of boxes after NMS.
Defaults to None.
Returns:
Tensor: Indexes after NMS.
"""
... | Python | 1 |
", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_32")))]
use crate::Ternary;
use glib::object::Cast;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::boxed::Box ... | Rust | 0 |
;
brute_knn.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap());
let brute_knn: Vec<usize> = brute_knn.iter().map(|(_d, pi)| *pi).collect();
// Children KNN
let children = match &node.children() {
Some((si, ca)) => {
let mut c: Vec<NodeAddress> = ca.iter().cloned(... | Rust | 0 |
pe {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"DriveStartStopType::{}",
match *self {
DriveStartStopType::Unknown => "Unknown",
DriveStartStopType::Shutdown => "Shutdown",
DriveStartStopType::Network... | Rust | 0 |
match_count = 0
zero_logs_count = 0
non_zero_logs_count = 0
non_zero_counts = [] # 新增列表存储非零日志数量
for index, row in df_input_timestamp.iterrows():
try:
print(">>>>>>>>>>>>>>>>>>>")
print(f"index: {index}")
result = load_filtered_log(df_input_timestamp, ind... | Python | 1 |
position.y, win.bottom(), win.top());
}
fn apply_force(&mut self, force: Vector2) {
// We could add mass here if we want A = F / M
self.acceleration += force;
}
// Here is where the brain processes everything
fn steer(&mut self, targets: &Vec<Vector2>, desired: &Vector2) {
... | Rust | 0 |
l_data
def crawl_all_industries(self):
"""爬取所有新兴行业的数据"""
logger.info("开始爬取所有新兴行业数据...")
all_industry_data = []
for industry in self.emerging_industries:
try:
industry_data = self.process_industry_data(industry)
all_in... | Python | 1 |
ptManager::restore_local_irq(irq);
Err(())
}
}
pub fn try_lock_weak(&self) -> Result<IrqSaveSpinLockFlagHolder, ()> {
let irq = InterruptManager::save_and_disable_local_irq();
if self
.flag
.compare_exchange_weak(false, true, Ordering::Acquire, Orderi... | Rust | 0 |
(&F64(a, _), &Mat4(ref b)) => {
let a = a as f32;
Mat4(Box::new([
[a - b[0][0], a - b[0][1], a - b[0][2], a - b[0][3]],
[a - b[1][0], a - b[1][1], a - b[1][2], a - b[1][3]],
[a - b[2][0], a - b[2][1], a - b[2][2], a - b[2][3]],
... | Rust | 0 |
results = json.load(open(os.path.join(args.initial_searched_results_dir, f'{data_source}_output_sequences.json')))
# add a row to each data item that represents a unique id
def make_map_fn(split):
def process_fn(example, idx):
if "yes" in example['golden_an... | Python | 1 |
;
if let Err(e) = client.login("cp_api", "<PASSWORD>") {
eprintln!("error: {}", e);
eprintln!("description: {}", e.description());
eprintln!("cause: {}", e.cause().unwrap());
}
}
#[test]
fn io_error() {
let mut client = Client::new("172.25.199.80", 443);
client.certificate("cer... | Rust | 0 |
#!/usr/bin/env python3
import os
import pygit2
import dmm
from mapmerge import merge_map
def main(repo):
if repo.index.conflicts:
print("You need to resolve merge conflicts first.")
return 1
try:
repo.lookup_reference('MERGE_HEAD')
print("Not running mapmerge for merge commit."... | Python | 1 |
from . import *
def plot_needle_result(config_dict):
try:
out = load_logs(get_log_filepath(
config_dict['task'], TTYPE_HSICTRAIN, config_dict['data_code']))['batch_log_list']
if config_dict['plot_task'] == 1:
if config_dict.get('filepath'):
config_dict['exp... | Python | 1 |
):
extra = {}
LATEX = '<img src="http://chart.apis.google.com/chart?cht=tx&chl=%s" align="center"/>'
extra['latex'] = lambda code: LATEX % code.replace('"','\"')
extra['verbatim'] = lambda code: cgi.escape(code)
extra['code'] = lambda code: CODE(code,language=None).xml()
... | Python | 1 |
t Monitor {
pub x: i32,
pub y: i32,
pub width: u32,
pub height: u32,
}
unsafe extern "system" fn monitor_enum_proc(
_: HMONITOR,
_: HDC,
rect: LPRECT,
monitors: LPARAM,
) -> BOOL {
let monitors = &mut *(monitors as *mut Vec<Monitor>);
let rect = *rect;
monit... | Rust | 0 |
import numpy as np
import gymnasium as gym
from neural_network import NeuralNetwork, sigmoid
from hyperparameters import Hyperparameters
from es import train
RANDOM_SEED = 0
np.random.seed(RANDOM_SEED)
env_name = 'CartPole-v1'
IL = 4 #input layer nodes
HL = 50 #hidden layer nodes
OL = 2 #output layer nodes
neural_ne... | Python | 1 |
bar_policy(gtk::PolicyType::Automatic)
.vscrollbar_policy(gtk::PolicyType::Automatic)
.shadow_type(gtk::ShadowType::EtchedIn)
.window_placement(gtk::CornerType::TopLeft)
.expand(true)
.build();
dlg.content_area()
.pack_start(&scrolled_window, true, true, 0);
let ... | Rust | 0 |
user_prompt_template_content = """
Now, let's get started with the following input.\n
INPUT: {input}
"""
persona = domain.Assistant(
key="test-persona",
scoped_id="global_test-persona",
name="Test Persona",
type=domain.AssistantType.SIMPLE_CHAT,
syste... | Python | 1 |
!(copy)
)
);
}
extern "C" {
#[doc = " @brief Open file and initialize a given @a f structure."]
#[doc = ""]
#[doc = " <strong>File open options:</strong>"]
#[doc = " @code {.c}"]
#[doc = " opts = {"]
#[doc = " .path = \"file path\", //File path. This options value is requied.... | Rust | 0 |
version() {
let pact_json = r#"{
"metadata" : {
"pact-specification": {
"version": "1.0.0"
}
}
}"#;
let pact = Pact::from_json(&s!(""), &serde_json::from_str(pact_json).unwrap());
expect!(pact.specification_version).to(be_equal_to(PactSpecification... | Rust | 0 |
test=\"a\">
</div>
";
parse(source).unwrap();
}
// #[test]
// fn can_parse_various_nodes() {
// let cases = [
// // text blocks
// "text",
// // comments
// "ab <!--cd-->",
// // slots
// "{ok}",
// // elements
// "<div></div>",
// "<div a ... | Rust | 0 |
#✅ 6. Nested Conditions (if inside if)
#🔹 Example:
age = 17
is_student = True
if age > 18:
if is_student:
print("Adult student")
if age < 18:
print("You are Not Adult student")
else:
print("Adult non-student")
#🤔 Questions:
#Q: When should I nest if?
#A: When one condition de... | Python | 1 |
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Auto-batch utils
"""
from copy import deepcopy
import numpy as np
import torch
from utils.general import LOGGER, colorstr, emojis
from utils.torch_utils import profile
def check_train_batch_size(model, imgsz=640, amp=True):
# Check YOLOv5 training batch size
... | Python | 1 |
spamming back and forth, so instead of
// printf use WriteConsoleOutput which updates the contents of the buffer,
// but doesn't move the cursor position.
COORD buf_size = { csbi.dwSize.X, 1 };
COORD zero_zero = { 0, 0 };
SMALL_RECT target = {
csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y,... | Rust | 0 |
ate_cond_lock();
}
drop { rustrt::rust_destroy_cond_lock(self.lock); }
}
enum condition {
condition_(rust_cond_lock)
}
class unlock {
let lock: rust_cond_lock;
new(lock: rust_cond_lock) { self.lock = lock; }
drop { rustrt::rust_unlock_cond_lock(self.lock); }
}
impl methods for lock_and_signal... | Rust | 0 |
subparser.add_parser(
"predict", help="Predict results from fine tuned model."
)
add_predict_args(parser_predict)
parser_fp = subparser.add_parser(
"fingerprint", help="Get the fingerprints of SMILES."
)
add_fingerprint_args(parser_fp)
parser_pretrain = subparser.add_parser(
... | Python | 1 |
from typing import Any, Callable, Dict, Tuple, Type
# overload support only works with this combination of System imports!
import System
from System import Boolean, Int32, Object, Single
CLR_TYPES: Dict[str, Tuple[Type, Type]] = {
"System.String": (System.String, str),
"Single": (Single, float),
"Boolean"... | Python | 1 |
EXPECTED_TOKEN: &str = "magic token value";
const EXPECTED_ERROR_MESSAGE: &str = "error message";
fn test_server() -> (tokio::task::JoinHandle<()>, std::net::SocketAddr) {
fn token_check(params: HashMap<String, String>) -> impl warp::Reply {
match params.get... | Rust | 0 |
.map_err(|e| format!("Failed to parse proposed transaction ttl: {}", e))?;
}
Ok(())
}
*/
}
fn default_torii_url() -> String {
DEFAULT_TORII_URL.to_string()
}
fn default_torii_connect_url() -> String {
DEFAULT_TORII_CONNECT_URL.to_string()
}
fn default_transaction_time_to_live_ms() ->... | Rust | 0 |
'''num = int(input('enter your number: '))
temp = num
factorial = 1
for i in range(num):
second_nmbr = temp - 1
factorial *=temp
temp = second_nmbr
if num<0:
print('factorial not possible, enter a positive number: ')
else:
print('factorial of', num, 'is', factorial)
'''
def factorial(num):
if n... | Python | 1 |
ue
/// onto the stack, and returns its name. `funcindex` points to the closure in
/// the stack. (Upvalues have no particular order, as they are active through
/// the whole function. So they are numbered in arbitrary order.)
///
/// Returns `None` (and pushes nothing) when the index is greater than the
/// number of u... | Rust | 0 |
in files:
fpath = os.path.join(root, name)
enqueue(fpath)
# Let debouncer feed queue and drain
time.sleep((DEBOUNCE_MS/1000) + 0.5)
q.join()
log.info("[STARTUP] Initial crawl complete.")
def main():
# Start threads
threading.Thread(target=debouncer, daemon=True).... | Python | 1 |
rom_context(context_dir=cwd, image_name=image_name)
def _build_image_from_context(context_dir: str, image_name: str):
import docker
client = docker.from_env()
# In Docker < 19, `docker build` doesn't support the `--platform` option
is_platform_supported = int(client.version()["Version"].split(".")[0]... | Python | 1 |
TEXT = {'agree': 'そうですね。私も賛同します。それがいいと思います。',
'busy': 'すみませんが、今週後半か来週にしていただけませんか?',
'upsell': 'これを毎月の寄付にすることを検討いただけませんか?'}
import sys
import pyperclip
if len(sys.argv) < 2:
print('使い方: python mclip.py [キーフレーズ名]')
print('キーフレーズに対応するテキストをクリップボードにコピーします。')
sys.exit()
keyphrase = sys.argv[1... | Python | 1 |
, $fn_addr:expr, $cc:expr, fn($($p_name:ident: $p_type:ty),*)$( -> $ret:ty)?, $my_fn:expr ) => {
{
unsafe extern $cc fn func($($p_name: $p_type),*)$( -> $ret)* {
let raw_fn: unsafe extern $cc fn($($p_name: $p_type),*)$( -> $ret)* =
std::mem::transmute(addr($fn_add... | Rust | 0 |
assert_eq!(lines.next().unwrap(), "P3");
assert_eq!(lines.next().unwrap(), "5 3");
assert_eq!(lines.next().unwrap(), "255");
}
#[test]
fn test_ppm_pixel_data() {
let mut c = Canvas::new(5, 3);
c.write_pixel(0, 0, color!(1.5, 0, 0));
c.write_pixel(2, 1, color!(0,... | Rust | 0 |
let val = RuyiNetworkSettingNameValue::read_from_in_protocol(i_prot)?;
f_4 = Some(val);
},
5 => {
let val = RuyiNetworkSettingNameValue::read_from_in_protocol(i_prot)?;
f_5 = Some(val);
},
6 => {
let val = RuyiNetworkSettingNameValue::re... | Rust | 0 |
ontNeed = linux_raw_sys::general::MADV_DONTNEED,
/// `MADV_FREE`
LinuxFree = linux_raw_sys::v5_4::general::MADV_FREE,
/// `MADV_REMOVE`
LinuxRemove = linux_raw_sys::general::MADV_REMOVE,
/// `MADV_DONTFORK`
LinuxDontFork = linux_raw_sys::general::MADV_DONTFORK,
/// `MADV_DOFORK`
LinuxDo... | Rust | 0 |
?;
}
}
/*
if let Some(x) = &self.link_path {
let link_path = Config::global().data_dir.join(x);
trace!("Updating link {:?}", &link_path);
match (link_path.is_symlink(), link_path.exists()) {
... | Rust | 0 |
# Common framework for syncdb actions
import copy
from django.core import management
from django.conf import settings
# Make sure the template loader cache is fixed _now_ (#448)
import django.template.loaders.app_directories
from south.hacks import hacks
from south.management.commands.syncdb import Command as Sync... | Python | 1 |
labels/layer for CDS
// let activations: usize = layers.iter().map(|e| *e).sum();
// let modulus_bits = <F as PrimeField>::size_in_bits();
// let elems_per_label = (128.0 / (modulus_bits - 1) as f64).ceil() as usize;
//
// let out_mac_keys = vec![F::zero(); layers.len()];
// let out_mac_shares = vec![F:... | Rust | 0 |
1_addcarryx_u32(&mut x682, &mut x683, x681, x631, x665);
let mut x684: u32 = 0;
let mut x685: fiat_secp256k1_u1 = 0;
fiat_secp256k1_addcarryx_u32(&mut x684, &mut x685, x683, x633, x667);
let mut x686: u32 = 0;
let mut x687: fiat_secp256k1_u1 = 0;
fiat_secp256k1_addcarryx_u32(&mut x686, &mut x687, x685, x635... | Rust | 0 |
[idx];
let mut count = 0;
for bot in bots.iter() {
if bot.c.distance(&strongest_bot.c) <= strongest_bot.radius {
count += 1;
}
}
println!("part1: {}", count);
}
/// the hardest part in AoC2018, z3 is used to solve it.
///
/// Z3 is an SMT ("Satisfiability modulo theories") s... | Rust | 0 |
write!(
f,
"{}",
match self {
BenchmarkOp::Set => "key_set",
BenchmarkOp::Get => "key_get",
BenchmarkOp::GetCached => "key_get(cached)",
}
)
}
}
#[allow(clippy::cast_precision_loss)]
#[allow(clippy::cas... | Rust | 0 |
l`](core::task::Poll).
///
/// Polling the returned future delegates to the wrapped function.
///
/// # Examples
///
/// ```
/// # futures::executor::block_on(async {
/// use futures_async_combinators::future::poll_fn;
/// use core::task::{Poll, Context};
///
/// fn read_line(_cx: &mut Context<'_>) -> Poll<String> {
//... | Rust | 0 |
)
self.deactivate = async_to_raw_response_wrapper(
certificates.deactivate,
)
self.get = async_to_raw_response_wrapper(
certificates.get,
)
class CertificatesResourceWithStreamingResponse:
def __init__(self, certificates: CertificatesResource) -> None:
... | Python | 1 |
t graphql_api = async_graphql_warp::graphql(schema)
.and_then(
|(schema, request): (
Schema<Query, Mutation, EmptySubscription>,
async_graphql::Request,
)| async move {
Ok::<_, Infallible>(GraphQLResponse::from(schema.execute(request).await... | Rust | 0 |
88() {
run_test(&Instruction { mnemonic: Mnemonic::CMP, operand1: Some(Indirect(RCX, Some(OperandSize::Dword), None)), operand2: Some(Literal8(97)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[131, 57, 97], OperandSize::Qword)
}
f... | Rust | 0 |
import doctest
from insights.parsers import gnocchi
from insights.parsers.gnocchi import GnocchiConf, GnocchiMetricdLog
from insights.tests import context_wrap
from datetime import datetime
GNOCCHI_CONF = """
[DEFAULT]
log_dir = /var/log/gnocchi
[api]
auth_mode = keystone
max_limit = 1000
[archive_policy]
[indexer]
u... | Python | 1 |
b in enumerate(q_bits):
q_bits[i] = None if b == '?' else int(b, 2)
# p and q are prime, odd.
p_bits[0] = 1
q_bits[0] = 1
d_bits = d.to_bits_le()
for i, b in enumerate(d_bits):
d_bits[i] = None if b == '?' else int(b, 2)
# Because e is small, k can be found by brute force.
... | Python | 1 |
from malaya.supervised.huggingface import load
from malaya.torch_model.huggingface import Reranker
available_huggingface = {
'mesolitica/reranker-malaysian-mistral-64M-32k': {
'Size (MB)': 95.7,
'Suggested length': 32768,
},
'mesolitica/reranker-malaysian-mistral-191M-32k': {
'Size ... | Python | 1 |
)
.unwrap();
let test_client = RemoteSignerHttpConsumer::from_components(url, reqwest_client);
let test_input = get_input_data_block(0xc137);
let signature = do_sign_request(&test_client, test_input);
signature.map_err(|e| format!("{:?}", e))
};... | Rust | 0 |
content = self
.input
.split(|b| *b == b'\n')
.nth((line - 1) as usize)
.expect("line");
let content = String::from_utf8_lossy(content);
writeln!(f, "TOML parse error at line {}, column {}", line, column)?;
// |
for _ in 0..=offset {
... | Rust | 0 |
in_channels=self.hidden_size,
out_channels=self.hidden_size,
kernel_size=downsample,
stride=downsample,
padding=0,
bias=True
),
nn.SiLU())
class SpatialConv(STCConnector):
def __init__(self, config... | Python | 1 |
xpit(x)
#
# Expected values were computed with mpmath:
#
# import mpmath
#
# mpmath.mp.dps = 100
#
# def mp_log_expit(x):
# return -mpmath.log1p(mpmath.exp(-x))
#
# expected = [float(mp_log_expit(t)) for t in x]
... | Python | 1 |
# Script based on https://www.blog.pythonlibrary.org/2018/10/16/testing-jupyter-notebooks/
import pytest
import drjit as dr
import mitsuba as mi
import glob
import re
import os
from os.path import join, realpath, dirname, basename, splitext, exists
has_no_cuda = not dr.has_backend(dr.JitBackend.CUDA)
def variant_no... | Python | 1 |
mut self, pos: usize, effect: E) {
let mut after = self.effects.split_off(pos);
after.push_front(RackEffect::new(effect));
self.effects.append(&mut after);
}
/// Removes the effect at the given position.
pub fn remove_effect(&mut self, pos: usize) {
let mut after = self.effe... | Rust | 0 |
.map_err(|_| Error(ErrorOrigin::Read, ErrorKind::Unknown))
})
}
}
extern "C" fn write(&self, data: VecOps<ROData>) -> i32 {
int_res_wrap! {
memdata_map(data, |data| {
self.get()
.write_raw_iter(data)
... | Rust | 0 |
tem;
pub use super::ishellitemarray::IShellItemArray;
pub use super::itaskbarlist::ITaskbarList;
pub use super::itaskbarlist2::ITaskbarList2;
pub use super::itaskbarlist3::ITaskbarList3;
pub use super::itaskbarlist4::ITaskbarList4;
}
pub mod traits {
pub use super::ifiledialog::ShellIFileDialog;
pub u... | Rust | 0 |
s, key=lambda x: (-x.size, x.path.as_posix()))[: cfg.topn_sizes]
topn_payload = [
{"path": str(fi.path.relative_to(cfg.root)), "size": fi.size} for fi in topn
]
# Stale docs(.md)
stale_cut = dt.datetime.now() - dt.timedelta(days=cfg.stale_days)
stale_docs: List[Dict[str, str]] = []
if "... | Python | 1 |
"""Tests for pandas/dask conversion adapters."""
| Python | 1 |
lr_finder.results
# Plot with
fig = lr_finder.plot(suggest=True)
fig.show()
# Pick point based on plot, or get suggestion
new_lr = lr_finder.suggestion()
os.makedirs("./hpo/", exist_ok=True)
fig.savefig(
f"./hpo/lr_r... | Python | 1 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2015 DevIntelle Consulting Service Pvt.Ltd (<http://www.devintellecs.com>).
#
# For Module Support : devintelle@gmail.com or Skype : devintelle
#
... | Python | 1 |
116,121,46,67,114,121,112,116,111,103,114,97,112,104,121,46,67,111,114,101,46,72,97,115,104,65,108,103,111,114,105,116,104,109,80,114,111,118,105,100,101,114,0]) [CLSID_HashAlgorithmProvider]);
DEFINE_IID!(IID_IHashAlgorithmProviderStatics, 2678888257, 23748, 17206, 174, 56, 98, 18, 183, 90, 145, 90);
RT_INTERFACE!{sta... | Rust | 0 |
from setuptools import find_packages, setup
from setuptools.command.develop import develop
from setuptools.command.install import install
class PostDevelopCommand(develop):
def run(self):
develop.run(self)
class PostInstallCommand(install):
def run(self):
install.run(self)
setup(
name=... | Python | 1 |
u32,
pub reference_ticks: u32,
}
#[repr(C)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct zx_clock_transformation_t {
pub reference_offset: i64,
pub synthetic_offset: i64,
pub rate: zx_clock_rate_t,
}
#[repr(C)]
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct zx_clock_details_v1_t {
pub opti... | Rust | 0 |
is numerical difference without for loop.
for i in range(time_size):
query_step = query[:, i * causal_chunk_length:(i + 1) *
causal_chunk_length, :]
query_step_shape = tf.shape(query_step)
query_step_1d = tf.reshape(query_step,
(query_step... | Python | 1 |
(Clone,Copy)] pub struct T { pub lnT: Value, pub T: Value, pub T2: Value, pub T3: Value, pub T4: Value, pub rcpT: Value, pub rcpT2: Value}
fn molar_heat_capacity_at_constant_pressure_R(a: &[f64; 7], T{T,T2,T3,T4,..}: T) -> Expression { (*a.prefix()).dot([Expr::from(1.),T.into(),T2.into(),T3.into(),T4.into()]) }
fn ent... | Rust | 0 |
= get_hex_address_two();
/// 0x5: hardcoded object ID for the singleton sui system state object.
pub const SUI_SYSTEM_STATE_OBJECT_ID: ObjectID = ObjectID::from_single_byte(5);
const fn get_hex_address_two() -> AccountAddress {
let mut addr = [0u8; AccountAddress::LENGTH];
addr[AccountAddress::LENGTH - 1] = ... | Rust | 0 |
doc(hidden)]
pub fn foo() {}
use colored::*;
use std::process;
#[macro_export]
macro_rules! info {
($($arg:tt)*) => {
println!("├ {:7} — {}", "Info".green(), format_args!($($arg)*));
};
}
#[macro_export]
macro_rules! warning {
($($arg:tt)*) => {
println!("├ {:7} — {}", "Warning".yellow()... | Rust | 0 |
s();
let collision_angle =
if collision_angle < 0.0 {
360.0 + collision_angle
} else {
collision_angle % 360.0
};
// The angle determines the quadrant in which the ball is, related to the
// bloc... | Rust | 0 |
def update_all():
update_lec_from_excel("V", 0)
for i in range(1, 50):
print("Actualizando lección ", i)
print("Vocabulario")
update_lec_from_excel("V", i)
print("Kanji")
update_lec_from_excel("K", i)
def write_sql_to_excel(df, sheet):
file = "/VocLecciones.xlsx"
... | Python | 1 |
/// assert_eq!(engine.eval_with_scope::<i64>(&mut scope, "x += 2; x")?, 44);
///
/// // The variable in the scope is modified
/// assert_eq!(scope.get_value::<i64>("x").expect("variable x should exist"), 44);
/// # Ok(())
/// # }
/// ```
#[inline(always)]
pub fn eval_with_scope<T: Va... | Rust | 0 |
whether the window has a frame."""
# window = self.app.get_window_by_id(self.window_id)
# return window.frame if window else False
# @Bridge(result=str)
# def getTitle(self):
# """Returns the title of the window."""
# window = self.app.get_window_by_id(self.window_id)
# ... | Python | 1 |
_1.rs<gh_stars>0
#[doc = "Reader of register SENSITIVE_DMA_APBPERI_PMS_MONITOR_1"]
pub type R = crate::R<u32, super::SENSITIVE_DMA_APBPERI_PMS_MONITOR_1>;
#[doc = "Writer for register SENSITIVE_DMA_APBPERI_PMS_MONITOR_1"]
pub type W = crate::W<u32, super::SENSITIVE_DMA_APBPERI_PMS_MONITOR_1>;
#[doc = "Register SENSITIV... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from gekko import GEKKO
# Import or generate data
filename = 'tclab_dyn_data2.csv'
try:
data = pd.read_csv(filename)
except:
url = 'https://apmonitor.com/do/uploads/Main/tclab_dyn_data2.txt'
data = pd.read_csv(url)
# Create GEKKO Model... | Python | 1 |
Primitive states string list returned from Robot::getPrimitiveStates().
parse_target : str
Name of the primitive state to parse for.
Returns
----------
str
Value of the specified primitive state in string format. Empty string is
returned if pars... | Python | 1 |
{
std::env::set_var("RUST_LOG", "info,seabird::server=trace");
}
// Now that everything is set up, load up the logger and configure it to
// include timestamps.
pretty_env_logger::init_timed();
match env_res {
Ok(path) => info!("Loaded env from {:?}", path),
// If the .en... | 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 |
# Programmer: limodou
# E-mail: limodou@gmail.com
#
# Copyleft 2006 limodou
#
# Distributed under the terms of the GPL (GNU Public License)
#
# UliPad 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 Foun... | Python | 1 |
await: allow_await.into(),
allow_return: allow_return.into(),
}
}
}
impl<R> TokenParser<R> for LabelledStatement
where
R: Read,
{
type Output = Node;
fn parse(
self,
cursor: &mut Cursor<R>,
interner: &mut Interner,
) -> Result<Self::Output, ParseError> {... | Rust | 0 |
Color) -> Self {
match x {
Color::Reset => tui::style::Color::Reset,
Color::Black => tui::style::Color::Black,
Color::Red => tui::style::Color::Red,
Color::Green => tui::style::Color::Green,
Color::Yellow => tui::style::Color::Yellow,
Color::Blue => tui::styl... | Rust | 0 |
"""
符号缓存相关数据模型
"""
from dataclasses import dataclass, field
from typing import Dict, List, Optional, Any
from datetime import datetime
@dataclass
class SymbolCacheData:
"""符号缓存数据结构"""
exchange_symbols: Dict[str, List[str]] # 各交易所支持的符号
overlap_symbols: List[str] # 重叠的符号列表
... | Python | 1 |
/swagger-api/swagger-codegen.git
*/
#[allow(unused_imports)]
use serde_json::Value;
#[derive(Debug, Serialize, Deserialize)]
pub struct ScannerresultContractsContract {
#[serde(rename = "contractID")]
contract_id: Option<i32>,
#[serde(rename = "distance")]
distance: Option<i32>,
#[serde(rename = "inScanTi... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.