text string | label_name string | labels int64 |
|---|---|---|
(1)) & \
(dframe["smooth support"] * (1 + 0.5 / 100) > dframe["close"])
condition_2_sell = dframe["SMA fast"] < dframe["SMA slow"]
condition_3_sell = dframe["Bearish Engulfing"] == -1
# condition_1_buy & condition_1_sell &
buy_condition = condition_1_bu... | Python | 1 |
elf = Expr::Sexp(
Op::Bind,
Box::new(Expr::Atom(Prim::Name(String::from("__shouldReport")))),
Box::new(Expr::Atom(Prim::Bool(true))),
)
}
Expr::None => {}
Expr::Atom(_) => {}
Expr::Sexp(_, ref mut... | Rust | 0 |
more than one scope.
/// If `None` is specified, then all scopes will be removed and no default scope will be used either.
/// In that case, you have to specify your API-key using the `key` parameter (see the `param()`
/// function for details).
///
/// Usually there is more than one suitable scope... | Rust | 0 |
request_cors_if_not_same_origin(&image, url);
image.set_src(url);
let handler = web::add_event_listener_with_bool(&image, "load", callback, true);
*callback_ref.borrow_mut() = Some(handler);
}
#[cfg(not(target_arch = "wasm32"))]
fn reload(&self) {}
}
// === Utils ===
/// ... | Rust | 0 |
xtend_from_slice(&eval_proof.poe_proof_vec[..]);
let proof = NiEvalProof {
y_l_vec,
y_r_vec,
c_l_vec,
c_r_vec,
poe_proof_vec,
f_const: eval_proof.f_const.clone(),
d,
b,
};
return proof;
}
}
impl... | Rust | 0 |
import tkinter as tk
import random
import os
all_images = os.listdir('images')
# 编写代码, 在游戏开始的时候, 随机展示一张图片
cur_pic =
def clear():
input_word.delete(0, 'end')
# 定义一个主窗口
win = tk.Tk()
# 窗口宽高为500
win.geometry('500x500')
# 窗口的标题
win.title('成语猜猜猜')
# 显示成语图片
img = tk.PhotoImage(file='images/' + cur_pic)
img_label ... | Python | 1 |
clone()
} else {
format!("{:?}", r).to_string()
}
};
let show_regs = |r_vec: &[Reg]| {
let mut s = "".to_string();
for r in r_vec {
s = s + &show_reg(*r) + &" ".to_string();
}
s
};
fo... | Rust | 0 |
_name: *const c_char) -> c_int;
pub fn libvlc_vlm_seek_media(
p_instance: *mut libvlc_instance_t, psz_name: *const c_char, f_percentage: c_float) -> c_int;
pub fn libvlc_vlm_show_media(
p_instance: *mut libvlc_instance_t, psz_name: *const c_char) -> *const c_char;
pub fn libvlc_vlm_get_media... | Rust | 0 |
'孔': 'zv',
'巡': 'zv',
'延': 'zv',
'趾': 'zv',
'跄': 'zv',
'跪': 'zv',
'踵': 'zv',
'躐': 'zv',
'迮': 'zv',
'遏': 'zv',
'邋': 'zv',
'孜': 'zw',
'跷': 'zw',
'踢': 'zw',
'蹾': 'zw',
'迈': 'zw',
'迕': 'zw',
'这': 'zw',
'违': 'zw',
'逛': 'zw',
'逞': 'zw',
'逡... | Python | 1 |
n: &semver::Version,
yanked: bool) -> CargoResult<()> {
let repo = app.git_repo.lock().unwrap();
let repo = &*repo;
let repo_path = repo.path().dir_path();
let dst = index_file(&repo_path, krate);
commit_and_push(repo, || {
let prev = try!(File::open(&dst).read_to_string());
... | Rust | 0 |
nal_day = Some(
try_consume_exact_digits(s, 3, padding)
.and_then(NonZeroU16::new)
.ok_or(error::Parse::InvalidDayOfYear)?,
);
Ok(())
}
/// Month of the year, zero-padded (`01`-`12`)
pub(crate) fn fmt_m(f: &mut Formatter<'_>, date: Date, padding: Padding) -> fmt::Result {
p... | Rust | 0 |
tType = X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE,
X509UnsupportedConstraintSyntax = X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX,
X509UnsupportedNameSyntax = X509_V_ERR_UNSUPPORTED_NAME_SYNTAX,
X509CrlPathValidationError= X509_V_ERR_CRL_PATH_VALIDATION_ERROR,
X509ApplicationVerification = X509_V_ERR_APPLICATI... | Rust | 0 |
import numpy as np
class platform:
def calculate_platform_offset(previous_x:int, previous_y:int):
offset_x = random_number = np.random.randint(-100, 100)
offset_y = random_number = np.random.randint(40, 151)
print(f'Offset x: {offset_x}, Offset y: {offset_y}')
new_x = previous_x ... | Python | 1 |
unsafe { TODO: call ffi::gtk_font_chooser_set_filter_func() }
//}
fn set_font(&self, fontname: &str) {
unsafe {
ffi::gtk_font_chooser_set_font(self.to_glib_none().0, fontname.to_glib_none().0);
}
}
fn set_font_desc(&self, font_desc: &pango::FontDescription) {
unsafe... | Rust | 0 |
services: Services::new(),
}
}
/// Adds a system to the [`Application`]
pub fn add_system(&mut self, system: System) {
self.scheduler.add(system);
}
/// Adds a service to the [`Application`]
pub fn add_service<T: IntoService>(&mut self, service: T) {
self.serv... | Rust | 0 |
from build123d import *
pip_count = 6
lego_unit_size = 8
pip_height = 1.8
pip_diameter = 4.8
block_length = lego_unit_size * pip_count
block_width = 16
base_height = 9.6
block_height = base_height + pip_height
support_outer_diameter = 6.5
support_inner_diameter = 4.8
ridge_width = 0.6
ridge_depth = 0.3
wall_thickness... | Python | 1 |
fer
//! to the files in the dev directory for sample implementations.
//!
//! Creating a bdev for any supported device type is now as simple as:
//! ```ignore
//! let uri = "aio:///tmp/disk1.img?blk_size=512";
//! bdev::Uri::parse(&uri)?.create().await?;
//! ```
use std::{collections::HashMap, convert::TryFrom... | Rust | 0 |
ount_id.clone(),
in_token_remaining: to_yocto("2.5").into(),
in_token_paid_unclaimed: to_yocto("2.5").into(),
in_token_paid: to_yocto("2.5").into(),
total_shares: to_yocto("5").into(),
start_time: sale.start_time.clone(),
duration: sale.duration.cl... | Rust | 0 |
et result = get_scalar(
instruction_words,
vec![("x9", const_(0xeed85f2300, 64))],
memory,
"x15",
);
assert_eq!(result.value_u64().unwrap(), 0xffffdead);
}
#[test]
fn ldrsb_wn_xn() {
let mut memory = Memory::new(Endian::Big);
memory
.store(0xeed85f2300, const_(0x... | Rust | 0 |
# config.py
from __future__ import annotations
import os
from pathlib import Path
from typing import Optional, Dict
from dotenv import load_dotenv
def _load_env(dotenv_path: Optional[str] = None) -> None:
"""
Load .env. If no path is provided, search upwards from CWD for a '.env' file.
"""
if dotenv... | Python | 1 |
ata| {
if data.undo_valid {
env.set(druid::theme::BUTTON_DARK, env.get(druid::theme::BUTTON_DARK));
env.set(druid::theme::BUTTON_LIGHT, env.get(druid::theme::BUTTON_LIGHT));
env.set(druid::theme::BORDER_LIGHT, env.get(druid::theme::BORDER_LIGHT));
... | Rust | 0 |
_positions)
# 4. Calculate the actual correction as a product of the effective charges, exponential decay term, and phase factor
# the phase factor is based on the distance of the G-vector and atomic positions
phase = np.exp(1j * np.einsum('ia,nma->inm', g_positions, distances_bohr))
''... | Python | 1 |
0: Self, currency_id_1: Self) -> Option<Self> {
match (currency_id_0, currency_id_1) {
(CurrencyId::Token(token_symbol_0), CurrencyId::Token(token_symbol_1)) => {
Some(CurrencyId::DEXShare(token_symbol_0, token_symbol_1))
}
_ => None,
}
}
}
/// Note the pre-deployed ERC20 contracts depend on `Currenc... | Rust | 0 |
import os
API_KEY = os.getenv('9a19db152424baf1aa1e20de497d038a0997ba45')
VALID_STOCKS = ['AAPL', 'GOOGL', 'MSFT', 'AMZN', 'TSLA', 'NFLX', 'FB', 'NVDA', 'AMD', 'SPY', 'ABCL', 'ACET']
MARKOV_MATRIX = {
'UP': {'UP': 0.6, 'DOWN': 0.3, 'STABLE': 0.1},
'DOWN': {'UP': 0.2, 'DOWN': 0.5, 'STABLE': 0.3},
'STABLE':... | Python | 1 |
ss('HammerOn')[0]
hammer_n0 = hammer_on.getSpannedElements()[0]
hammer_n1 = hammer_on.getSpannedElements()[1]
self.assertEqual(hammer_n0.getSpannerSites()[0], hammer_on)
self.assertEqual(hammer_n1.getSpannerSites()[0], hammer_on)
pull_off = s.flatten().getElementsByClass('PullOf... | Python | 1 |
# to make multiple sub-images for training and test by cropping the whole images
# coded by syshin (180428)
import numpy as np
import os
import skimage.io
IMG_SIZE = [2336,3504]
SUB_IMG_SIZE = 768
if __name__ == '__main__':
save_root_path = '../HRF/all_768'
if not os.path.isdir(save_root_path):
... | Python | 1 |
ns for addressing limitations in underperforming task categories
- Discuss implications for general vs. specialized cognitive architectures
ANALYSIS STANDARDS:
- Support ALL claims with specific evidence from benchmark results
- Be honest about failures and unexpected outcomes across different cognitive domains
- Focu... | Python | 1 |
import subprocess
import elftools
import elftools.elf
from elftools.elf.elffile import ELFFile
from emulator import *
from unirop import *
def load_gadgets(path, arch):
gadgets = subprocess.check_output("ROPgadget --binary %s | grep -e \"0x[[:xdigit:]]* :\"" % path, shell=True)
gadget_addrs = [int(gadget.split... | Python | 1 |
import subprocess
# Replace with your video path
video_path = "video.mp4"
# Replace with your Youtube stream key (get from Youtube Studio)
youtube_stream_key = "ptv1-prvf-rwe4-0wx9-99pm"
def start_stream():
"""Starts live stream using ffmpeg."""
command = [
"ffmpeg",
"-re", # Loop playback
"-i... | Python | 1 |
pq.upsert(s, 0.0);
p.dist_to[s] = 0.0;
while let Some((v, _)) = pq.pop() {
for edge in g.adj(v) {
relax(p, edge, &mut pq);
}
}
}
fn relax<E>(p: &mut WeightedPath<E>, e: E, pq: &mut IndexMinPQ<f64>)
where
E: Directed + NonNegative,
{
let v = e.from();
let w = e.to();
if p.dist_to[v] + e.weight() < p.dist_... | Rust | 0 |
` and `TransactionPool` we require this
// extension to be a `Weak` reference.
// That's also the reason why it's being registered lazily instead of
// during initialization.
transaction_pool: RwLock<Option<Weak<dyn sp_transaction_pool::OffchainSubmitTransaction<Block>>>>,
extensions_factory: RwLock<Box<dyn Extens... | Rust | 0 |