text string | label_name string | labels int64 |
|---|---|---|
tems.
///
/// The view port is concerned with the physical size of the device.
///
/// see [Gfx, windows, and resizing](https://falseidolfactory.com/2018/05/28/gfx-windows-and-resizing.html)
#[derive(Debug)]
pub struct ViewPort {
pub(crate) rect: gfx::Rect,
}
impl ViewPort {
/// Create a view port rectangle co... | Rust | 0 |
>,
chooser: Option<String>,
},
Command {
arguments: Vec<OsString>,
binary: OsString,
overrides: BTreeMap<String, String>,
},
Completions {
shell: String,
},
Dump,
Edit,
Evaluate {
overrides: BTreeMap<String, String>,
variable: Option<String>,
},
Format,
Init,
List,
... | Rust | 0 |
TxtpList)
if len(TxtpList) == 0:
print(f"{movie} has no txtp, copying original")
# Copy original
outfile = os.path.join(OutputDir, get_file_name(movie) + "_original.mp4")
shutil.copyfile(movie, outfile)
continue
# Convert to wavs
# pr... | Python | 1 |
v_depth, inv_depth_flipped, method='mean'):
"""
Post-process an inverse and flipped inverse depth map
Parameters
----------
inv_depth : torch.Tensor [B,1,H,W]
Inverse depth map
inv_depth_flipped : torch.Tensor [B,1,H,W]
Inverse depth map produced from a flipped image
method :... | Python | 1 |
e = self.view_spacing
num_frames = len(frames)
for i in range(num_frames - self.num_views * stride):
f_ids = []
for v in range(self.num_views):
f_ids.append(frames[i + v * stride])
# Hacky way of getti... | Python | 1 |
from ....structs import ProtocolEntity, ProtocolTreeNode
from .notification import NotificationProtocolEntity
class MexUpdateNotificationProtocolEntity(NotificationProtocolEntity):
'''
<notification from="s.whatsapp.net" type="mex" id="355574974" t="1729559459">
<update op_name="NotificationUserReachou... | Python | 1 |
_up_flag:
# extent, extent_crs_authid = warm_up(default_output_file_png)
# else:
# zoom = 14
# # Mostoles coords
# ul_coords = (40.3379,-3.8894)
# br_coords = (40.3055,-3.8351)
# # Additional initialization
# new_lat = ul_coords[0]
# new_lon = ul_coor... | Python | 1 |
# uncompyle6 version 2.11.5
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.18 (default, Apr 20 2020, 20:30:41)
# [GCC 9.3.0]
# Embedded file name: Exploits\Wp_cloudflare.py
import requests
from Exploits import printModule
from Exploits import CVE_2017_9841PHPUnit
r = '\x1b[31m'
g = '\x1b[32m'
y = '\x1b[33... | Python | 1 |
tConfig(NdiSetConfig),
}
#[derive(StructOpt, Debug, Clone)]
pub struct NdiSetConfig {
/// Whether NDI should be active.
#[structopt(long, takes_value = true)]
pub active: Option<bool>,
/// Whether NDI 5 should be used.
#[structopt(long)]
pub use_ndi5: Option<bool>,
/// Whether a custom reso... | Rust | 0 |
ml_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false,... | Python | 1 |
"""
Tool to download all local datasets and save them within the vega_datasets
source tree.
Usage:
$ python download_datasets.py
"""
import json
from os.path import abspath, join, dirname
import sys
from urllib.request import urlretrieve
import json
sys.path.insert(1, abspath(join(dirname(__file__), "..")))
from veg... | Python | 1 |
macro_rules! delegate_file_distribution_repository {
(impl $(<$($vars:ident $(: $c0:ident $(+ $cs:ident)* )? ),*>)? FileDistributionRepository for $ty:ty {
$sel:ident $target:block
}) => {
#[::async_trait::async_trait]
impl $(<$($vars$(: $c0 $(+ $cs)* )?,)*>)? $crate::context::FileDistr... | Rust | 0 |
elif is_emetrics is not None and is_emetrics(file_or_dir_name):
push_function_arg = push_emetrics_function
if push_function_arg is not None:
self.logger.info("Creating top-level log runner for %s", log_file_path)
... | Python | 1 |
rray, NewAead},
Aes256Gcm,
};
#[test]
fn test_encrypt_decrypt() {
let plaintext = b"The quick brown fox was annoying".to_vec();
let key = GenericArray::from_slice(b"an example very very secret key.");
let cipher = Aes256Gcm::new(key);
let cipher_text = encrypt_bytes... | Rust | 0 |
(r#"UPPER("Hello")"#, &[r#""Hello""#]);
test("SIN(3.14)", &["3.14"]);
test("COS(3.14)", &["3.14"]);
test("TAN(3.14)", &["3.14"]);
test("ASIN(3.14)", &["3.14"]);
test("ACOS(3.14)", &["3.14"]);
test("ATAN(3.14)", &["3.14"]);
test("RADIANS(180)", &["180"]);
t... | Rust | 0 |
s-serif;
height: 100%;
text-align: center;
width: 100%;
}
body {
display: table-cell;
vertical-align: middle;
margin: 2em auto;
}
h1 {
color: #555;
... | Rust | 0 |
ageDetial[poiPageDetial.index("百度坐标"):].strip("\r\n").strip("\"").strip(";").strip("&")
baiduGPS=baiduGPS[baiduGPS.index("</span>")+8:baiduGPS.index("</li>")].strip("\n").strip("\"").strip("&")
sqlValues="\'"+key+"\',\'"+... | Python | 1 |
}
X[0] ^= t;
// Undo excess work
Q = 2;
while Q != N {
P = Q - 1;
for i in (0..n).rev() {
if (X[i] & Q) != 0_u32 {
X[0] ^= P; // invert
}
else
{
t = (... | Rust | 0 |
"""Reward processors
Each method takes the metadata with the following keys:
- env_reward: MiniWoB official reward
- raw_reward: Raw task reward without time penalty
- done: Whether the task is done
Then it returns a reward (float).
"""
def get_original_reward(metadata):
return float(metadata["env_re... | Python | 1 |
)) => {
if val.is_nan() {
return Err({
rt.arg_err_index.set(Some(0));
"Expected number, found `NaN`".into()
})
} else {
let mut sec = (**sec).clone();
sec.reverse();
sec
... | Rust | 0 |
::ChalkIr)
};
(bound $b:expr) => {
chalk_ir::LifetimeData::BoundVar(chalk_ir::BoundVar::new(chalk_ir::DebruijnIndex::INNERMOST, $b))
.intern(&chalk_integration::interner::ChalkIr)
};
(placeholder $b:expr) => {
chalk_ir::LifetimeData::Placeholder(PlaceholderIndex { ui: Unive... | Rust | 0 |
xd2, 0x8a, 0xda, 0x32, 0x4, 0x93, 0xd2, 0xbf,
0xb4, 0xbb, 0xa, 0x9e, 0x8c, 0xe9, 0x8f, 0xe7, 0x8a, 0x95, 0xc8, 0x21, 0xfa, 0x12,
0x41, 0x2e, 0x69, 0x54, 0xf0, 0x7a, 0x9e, 0x20, 0x94, 0xa3, 0xaa, 0xc3, 0x50, 0x43,
0xc5, 0xe2, 0x32, 0x8b, 0x2e, 0x4f, 0xbb, 0xb4, 0xc0, 0x7f, 0x47, 0x35,... | Rust | 0 |
rames:
self.obs_stack.append(gray_obs)
self.obs_stack.append(gray_obs)
obs = np.stack(self.obs_stack)
return obs
else:
return self.shuffled_obs
def register_solution(self, solution):
self.solution = solution
def plot_white_patches... | Python | 1 |
"""
Mock classes for unit tests
:copyright: Copyright 2006-2024 by the PyNN team, see AUTHORS.
:license: CeCILL, see LICENSE for details.
"""
from pyNN import random
import numpy as np
class MockRNG(random.WrappedRNG):
rng = None
def __init__(self, start=0.0, delta=1, parallel_safe=True):
random.Wr... | Python | 1 |
# Generated by Django 4.0.7 on 2022-10-21 07:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("examples", "0006_alter_example_upload_name"),
]
operations = [
migrations.AddField(
model_name="example",
name="scor... | Python | 1 |
"""
toy utils.py
sqlite and enip use name (string) and pid (int) has key and the state stores
values as strings.
sqlite uses float keyword and cpppo use REAL keyword.
if ACTUATORX is 1 then is ON otherwise is OFF.
"""
from minicps.utils import build_debug_logger
toy_logger = build_debug_logger(
name=__name__,
... | Python | 1 |
merged_cg[parent_id].remove(existing_edge)
merged_cg[parent_id].append((child_id, merged_attrs))
edge_exists = True
break
if not edge_exists:
merged_cg[parent_id].append((chil... | Python | 1 |
from __future__ import annotations
import pytest
from distributed.shuffle._core import _mean_shard_size
def test_mean_shard_size():
assert _mean_shard_size([]) == 0
assert _mean_shard_size([b""]) == 0
assert _mean_shard_size([b"123", b"45678"]) == 4
# Don't fully iterate over large collections
a... | Python | 1 |
self.gfl_reg,
)
def forward_single(self, x, cls_convs, reg_convs, gfl_cls, gfl_reg):
cls_feat = x
reg_feat = x
for cls_conv in cls_convs:
cls_feat = cls_conv(cls_feat)
for reg_conv in reg_convs:
reg_feat = reg_... | Python | 1 |
crate::util::{Result, Reportable};
use crate::encoder::{Encoder};
use message_io::network::{NetworkController, Endpoint};
use resize::px::RGB;
use rgb::RGB8;
use v4l::prelude::*;
use v4l::FourCC;
use v4l::buffer::Type;
use v4l::io::traits::CaptureStream;
use v4l::video::traits::Capture;
use std::time::{Duration};
/... | Rust | 0 |
DOF velocities (with shape (N, num_dofs)),
body positions (with shape (N, num_bodies, 3)), body rotations (with shape (N, num_bodies, 4), as wxyz quaternion),
body linear velocities (with shape (N, num_bodies, 3)) and body angular velocities (with shape (N, num_bodies, 3)).
"""
t... | Python | 1 |
s = input().split()
height = [int(i) for i in s]
a = height[0]
height[0] = height[1]
height[1] = a
print(height) | Python | 1 |
_base_ = './solov2_r50_fpn_1x_coco.py'
# model settings
model = dict(
mask_head=dict(
stacked_convs=2,
feat_channels=256,
scale_ranges=((1, 56), (28, 112), (56, 224), (112, 448), (224, 896)),
mask_feature_head=dict(out_channels=128)))
# dataset settings
train_pipeline = [
dict(... | Python | 1 |
import socket
HOST = '0.0.0.0'
PORT = 4444
with socket.socket() as server:
server.bind((HOST, PORT))
server.listen(1)
print(f"[+] Listening on {PORT}...")
conn, addr = server.accept()
print(f"[+] Connection from {addr}")
with conn:
while True:
data = conn.recv(10240).deco... | Python | 1 |
0; num_draws];
let mut acov_s: Array1 = vec![0.0; num_chains];
for c in 0..num_chains {
acov_s[c] = chain_acov[c][1]
}
let mut rho_hat_even = 1.0;
rho_hat_s[0] = rho_hat_even;
let mut rho_hat_odd = 1.0 - (mean_var - mean(&acov_s)?) / var_plus;
rho_hat_s[1] = rho_hat_odd;
// Conv... | Rust | 0 |
#https://www.youtube.com/watch?v=qglQloYv82Q
def ubbiDubbiTranslate(word):
if not word.isalpha():
return word
newWord=""
for i in word:
if i.lower() in "aeiou":
newWord+="ab"+i
else:
newWord+=i
return newWord
def ubbiDubbiDeTranslate(word):
# try:... | Python | 1 |
import traceback
import mysql.connector
from app.adapters.db_factory import DBFactory
from app.models.member_demo import MemberDemo
from app.exceptions.database_exception import *
from typing import List, Optional
class DemoRepository:
def __init__(self):
self.mysql = DBFactory().get_mysql()
def crea... | Python | 1 |
True)
self.sync_all()
except JSONRPCException as e:
print("Unexpected exception caught during testing: " + str(e.error))
assert(False)
self.nodes[0].generate(1)
self.sync_all()
# restart (after fork, without -regtestprotectcoinbase)
stop_node... | Python | 1 |
lator {
use crate::procfs::cpu_probe::common_test_utils::create_stat;
use crate::procfs::cpu_probe::UsageCalculator;
use crate::procfs::parsers::process::PidStat;
fn create_initialized_calc(elapsed_ticks: u64) -> UsageCalculator {
let mut calc = UsageCalculator::default();
calc.compute... | Rust | 0 |
field `REFSEL`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REFSELR {
#[doc = "Use supply with a 1/8 prescaler as reference."]
SUPPLYONEEIGHTHPRESCALING,
#[doc = "Use supply with a 2/8 prescaler as reference."]
SUPPLYTWOEIGHTHSPRESCALING,
#[doc = "Use supply with a 3/8 prescaler as reference.... | Rust | 0 |
nop.i64x2 (I32)
// end of copy_nop.i32x4 (I32)
// end of copy_nop.i16x8 (I32)
// end of copy_nop.i8x16 (I32)
// end of copy_nop.b64x2 (I32)
// end of copy_nop.b32x4 (I32)
// end of copy_nop.b16x8 (I32)
// end of copy_nop.b8x16 (I32)
// end of copy_nop.i64 (I32)
// end of copy_nop.f32... | Rust | 0 |
tensor.col_mut(1)[2] += -pt.y * pt.z;
tensor.col_mut(1)[0] += -pt.x * pt.y;
tensor.col_mut(2)[0] += -pt.x * pt.z;
tensor.col_mut(2)[1] += -pt.y * pt.z;
sample_count += 1;
}
}
}
tensor * (sample_count as f32).r... | Rust | 0 |
mut g);
let plate = g.to_string();
(painted, plate)
}
fn main() {
let input = std::fs::read_to_string("input/11.txt").unwrap();
let now = std::time::Instant::now();
let s = solve(&input);
println!("Solution: {}\n{}", s.0, s.1);
println!("Time: {}ms", now.elapsed().as_millis());
}
#![allow(... | Rust | 0 |
let matches = App::new("Sweet Home 3D model builder")
.version(VERSION)
.author("<NAME> <<EMAIL>>")
.about("Generating data for building Sweet Home 3D rooms from the human readable description.")
.arg(
Arg::with_name("version-number")
.help(&format!("Prints ve... | Rust | 0 |
subsample_mode_in_name.as_ptr(),
subsample_mode_in,
strip_in_name.as_ptr(),
strip_in,
background_in_name.as_ptr(),
background_in,
page_height_in_name.as_ptr(),
page_height_in,
NULL,
);
utils::result(vi... | Rust | 0 |
t is not <code>$LATEST</code>.
/// Example: <code>function:my-function:prod</code> or <code>function:my-function:1</code>.</p>
/// </li>
/// <li>
/// <p>Amazon Keyspaces table - The resource type is <code>table</code> and the unique identifier is the table name.
/// Example: <code>keyspace/mykeyspac... | Rust | 0 |
reassembled packet. Once this utility
//! has received all the fragments for a combination of source address, destination
//! address and identification value, the implementer will need to allocate a
//! buffer of sufficient size to reassemble the final packet into and pass it to
//! this utility. This utility will th... | Rust | 0 |
ure("albums.json")
browse = await async_browse_media(hass, f"{URI_SCHEME}{DOMAIN}/ARTIST-UUID")
assert browse.domain == DOMAIN
assert browse.identifier == "ARTIST-UUID"
assert browse.title == "ARTIST"
assert vars(browse.children[0]) == snapshot
# Test browsing an album
mock_api.get_item.s... | Python | 1 |
function was referenced multiple times.
pub multiple: bool,
/// The start address of this function relative to the image base (load address).
pub address: u64,
/// The size of the code covered by this function's line records.
pub size: u64,
/// The size of the parameters on the runtime stack.
... | Rust | 0 |
print ('\t+ Label: %s, Conf: %.5f' % (classes[int(cls_pred)], cls_conf.item()))
# Rescale coordinates to original dimensions
box_h = int(((y2 - y1) / unpad_h) * (img.shape[0]))
box_w = int(((x2 - x1) / unpad_w) * (img.shape[1]) )
y1 = int(((y1 - pad_y // 2) / unp... | Python | 1 |
= [1, 2, 3, 4, 5, 6];
let d = Array::new(&d_input, d_dims);
af_print!("Create 2-by-3 matrix from host data", d);
//// // Sort A
//println!("Sort A and print sorted array and corresponding indices");
//let x = sort_index(&a, 0, true);
//print(&x.0);
//print(&x.1);
let u8_cnst = &constan... | Rust | 0 |
lang_mapping = {
"Chinese": "zh",
"Turkish": "tr",
"English": "en",
"German": "de"
} | Python | 1 |
import pytest
from pandas import DataFrame
import pandas._testing as tm
class TestSwaplevel:
def test_swaplevel(self, multiindex_dataframe_random_data):
frame = multiindex_dataframe_random_data
swapped = frame["A"].swaplevel()
swapped2 = frame["A"].swaplevel(0)
swapped3 = frame["... | Python | 1 |
word!(level);
syn::custom_keyword!(target);
syn::custom_keyword!(name);
syn::custom_keyword!(err);
}
enum AsyncTraitKind<'a> {
// old construction. Contains the function
Function(&'a ItemFn),
// new construction. Contains a reference to the async block
Async(&'a ExprAsync),
}
struct AsyncT... | Rust | 0 |
ntermediate_angle, speed)
time.sleep(abs(angle_diff + 180) / 360 * 2) # 估算时间
elif force_direction == 'ccw':
# 强制逆时针
if angle_diff > 0:
# 需要逆时针转动,但角度差为正,需要走长路径
intermediate_angle = target_angle - 180
... | Python | 1 |
mage using convolution
sobel_y = cv2.filter2D(gray, -1, Sobel_kernel_y)
cv2.imwrite(os.path.join(f"{self.output_dir}", 'sobel_y.jpg'), sobel_y)
self.show_results(os.path.join(f"{self.output_dir}", 'sobel_y.jpg'))
def apply_kMeans(self):
if self.input_image_path == '':
me... | Python | 1 |
if prev_taken is None:
prev_taken = i
elif prev_taken != i - 1:
# Need to flip the list, because the first and last points
# were taken and they are now in the wrong order
floor_adjacent_pts.reverse()
if len(f... | Python | 1 |
r is a broken symlink
# (see https://bitbucket.org/pitrou/pathlib/issue/12/)
return False
def expanduser(self):
""" Return a new path with expanded ~ and ~user constructs
(as returned by os.path.expanduser)
"""
if (not (self._drv or self._root)
... | Python | 1 |
2.0)),
n2i(f64::NEG_INFINITY, 1.0)
);
assert_eq2!(
n2i(1.0, f64::INFINITY).mul_add(n2i(-5.0, 3.0), n2i(f64::NEG_INFINITY, 2.0)),
I::ENTIRE
);
assert_eq2!(
n2i(1.0, f64::INFINITY).mul_add(n2i(1.0, 3.0), n2i(f64::NEG_INFINITY, 2.0)),
I::ENTIRE
);
assert_eq2!... | Rust | 0 |
;
// We support both USB 1.1 packets with a size of 64 bytes
// as well as USB 2.0 packets with a size of 512 bytes.
// It is hardware dependent, wether the larger size is actually supported.
#[allow(dead_code)]
#[cfg(not(feature = "large_pkgs"))]
const EP_PKG_SIZE: u16 = 64;
#[allow(dead_code)]
#[cfg(feature = "larg... | Rust | 0 |
#[doc = " @param[out] pDst points to the output vector"]
#[doc = " @param[in] blockSize number of samples in each vector"]
pub fn arm_add_q31(pSrcA: *const q31_t, pSrcB: *const q31_t, pDst: *mut q31_t, blockSize: u32);
}
extern "C" {
#[doc = " @brief Floating-point vector subtraction."]
#[do... | Rust | 0 |
# Copyright 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of con... | Python | 1 |
ini"), "w")
f.write("error_reporting = E_ALL & ~E_NOTICE\n")
f.close()
os.chdir(tmpdir)
try:
output = self.run('''<?
echo ini_get("error_reporting");
echo $a;
?>''', capfd)
assert output == str(E_ALL & ~E_NOTICE)
finally... | Python | 1 |
tasker.spawn(async { panic!("Things aren't going well") });
let tasker2 = tasker.clone();
tasker.stop();
// Assert that the join stream won't start yielding results
// until all tasker clones are done.
let mut join_stream = tasker.join_stream();
assert!(poll!(join_stream.next()).is_pending... | Rust | 0 |
d(obj[key],name+'['+str(key)+']')
#find(locals(),'locals')
print 'found instances: ',found
final_array = grad.get_value(borrow=True, return_internal_type = True)
print 'final cudandarray addr %x' % id(final_array)
#addr = final_array.gpudata
#print 'final storage address: %x' % addr
"""
print '------------'
for it... | Python | 1 |
{"cmap": None, "data_range": (0, 1)},
},
],
name="validation_step",
step=self.true_global_step,
)
def on_validation_epoch_end(self):
pass
def test_step(self, batch, batch_idx):
out = self(batch, decode=True)
self.save_image_gr... | Python | 1 |
'Å', '⽷', '│', 'ᙁ', '𛉜', '⮛',
'䷔', 'ꅴ', '🀗', '𑇫', '𐒏', '♞', '𖦙', '𓁅', '𑃣', 'ケ', 'ꄾ', '🤈',
'Ⲭ', '⌉', '🮹', '尢', '𑛈', 'ቅ', 'Ἣ', 'ㅈ', '𘨭', '𛊞', 'ⶰ', 'ﺵ',
'ᆿ', 'ⶱ', 'ᾔ', '⹕', 'ﰑ', '𝦟', '𝡴', 'ႚ', '𔑹', 'ᯡ', '⿈', '𒑆',
'ᚾ', '𝚖', '🮉', 'ꏨ', '𘱝', '𒇠', '𛅾', '౻', '🅕', 'ࡥ', '𓉏', 'ᦜ',
'ꌖ', '... | Rust | 0 |
mod ast;
pub mod parse;
#[cfg(feature = "eval")]
pub mod eval;
// internal helpers
pub(crate) mod util;
<filename>hooks_util/src/ordered_pair.rs
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Debug)]
pub struct OrderedPair<T>((T, T));
impl<T: Ord> OrderedPair<T> {
pub fn new(first: T, second: T) -> OrderedPair... | Rust | 0 |
if params["build_to"] is None or params["build_to"] > now:
params["build_to"] = now
if params["build_from"] is None:
params["build_from"] = lastweek
# Securing fields
params["fields"] = restrict_fields(params["fields"], ["signature", "dump"])
params["plugin_in"] = restrict_fields(params... | Python | 1 |
b const TM_RENDERER_COMPARE_OP_LESS_OR_EQUAL: ::std::os::raw::c_int = 3;
pub const TM_RENDERER_COMPARE_OP_GREATER: ::std::os::raw::c_int = 4;
pub const TM_RENDERER_COMPARE_OP_NOT_EQUAL: ::std::os::raw::c_int = 5;
pub const TM_RENDERER_COMPARE_OP_GREATER_OR_EQUAL: ::std::os::raw::c_int = 6;
pub const TM_RENDERER_COM... | Rust | 0 |
amove_order_system,
holdpos_order_system,
simple_destination_system,
ai_pathing_system,
movement_system,
toggle_game_speed_system,
toggle_game_mode_system,
win_condition_system,
//leader1_simple_movement_system, // TODO re-enable & rewrite like sim... | Rust | 0 |
64);
self.wcon(w, G::A_TITLE());
self.mvwprintw_center(w, 2, "* * * THE WIZARD'S CASTLE * * *\n\n");
self.wcoff(w, G::A_TITLE());
wattron(w, A_BOLD());
self.wprintw_center(w, "Many cycles ago, in the Kingdom of N'DIC, the gnomic\n");
self.wprintw_center(w, "<NAME> forg... | Rust | 0 |
t entry_path = path::PathBuf::from(entry.path());
let entry_path2 = entry_path.clone();
let abs_path = cur_dir.join(entry_path);
abs_path.canonicalize().ok().and_then(|used_path| {
match gitignore.is_excluded(used_path.as_path()) {
Err(err) => None... | Rust | 0 |
= HexTiles(np.random.randn(1000, 2)).opts(alpha='Count')
plot = bokeh_renderer.get_plot(hextiles)
glyph = plot.handles['glyph']
self.assertEqual(property_to_dict(glyph.fill_alpha), {'field': 'alpha'})
def test_hex_tile_scale_op(self):
hextiles = HexTiles(np.random.randn(1000, 2)).o... | Python | 1 |
from django import forms
from .models import Post
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ('title', 'title_tag', 'short_description', 'author', 'body')
widgets = {
'title': forms.TextInput(attrs={'class': 'form-control', 'placeholder': 'Enter title'})... | Python | 1 |
#!/usr/bin/env python3
"""
Kalshi EV Finder - Main Entry Point
Find positive expected value betting opportunities on NFL games
"""
from ev_calculator import find_ev_opportunities
from paper_tracker import create_paper_trades
import sys
def main():
"""Main application entry point"""
print("🎯 KALSHI EV FINDER... | Python | 1 |
= self.next.checked_add(self.increment).expect("Ran out of ids");
next
}
}
<filename>src/main.rs
//
// main.rs
// Copyright (C) 2019 g <<EMAIL>>
// Distributed under terms of the MIT license.
//
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate serde_json;
#[macro_use]
extern crate prettyt... | Rust | 0 |
{
Self {
boards: HashMap::new(),
turn_order: Vec::new(),
}
}
/// Tries to start the game. If all players are ready, returns a [`Game`] with the
/// current setup. If fewer than 2 players have been added, or any player has not
/// placed all of their ships, retur... | Rust | 0 |
fo(f'Number of examples without difference image data: {len(examples_not_found_df)}.')
if 'label' in examples_not_found_df:
logger.info(f'{examples_not_found_df["label"].value_counts()}')
logger.info('Finished adding difference image data to TFRecords.')
if __name__ == '__main__':
tf.config.set_... | Python | 1 |
"""
WebWeaver 提示词模板模块
包含各种智能体的提示词模板:
- planner_prompts: 规划者提示词
- writer_prompts: 写作者提示词
- evaluation_prompts: 评估提示词
"""
from .planner_prompts import PlannerPrompts
from .writer_prompts import WriterPrompts
from .evaluation_prompts import EvaluationPrompts
__all__ = [
"PlannerPrompts",
"WriterPrompts",
"... | Python | 1 |
to stdout: {}", e);
}
Ok(false)
}
}
pub fn get_exclude_patterns(file_pattern_options: &LoadOptions) -> Vec<WildMatch> {
let mut ep: Vec<WildMatch> = Vec::new();
for pattern in &file_pattern_options
.exclude_patterns
.clone()
.into_comparable()
{
ep.push(... | Rust | 0 |
location_coords = {
"1": (37.5665, 126.9780), # 서울특별시
"2": (37.4563, 126.7052), # 인천광역시
"3": (36.3504, 127.3845), # 대전광역시
"4": (35.8714, 128.6014), # 대구광역시
"5": (35.1595, 126.8526), # 광주광역시
"6": (35.1796, 129.0756), # 부산광역시
"7": (35.5384, 129.3114), # 울산광역시
"8": (36.4801, 1... | Python | 1 |
lcd.tick(memory.get_video_memory(), c, &mut app);
let stat = memory.get_io(io_regs::STAT);
let ly = memory.get_io(io_regs::LY);
assert_eq!(stat & 0b11, 0);
assert_eq!(ly as u64, line);
}
}
// Test line 144 timings
{
let line = 144;
let ... | Rust | 0 |
import speech_recognition as sr
import pyttsx3
def listen_command():
recognizer = sr.Recognizer()
with sr.Microphone() as source:
print("Dinliyorum...")
audio = recognizer.listen(source)
try:
command = recognizer.recognize_google(audio, language="tr-TR")
print(f"... | Python | 1 |
begin tail_append(new_math(math_surround,before));
//! cur_mlist:=p; cur_style:=text_style; mlist_penalties:=(mode>0); mlist_to_hlist;
//! link(tail):=link(temp_head);
//! while link(tail)<>null do tail:=link(tail);
//! tail_append(new_math(math_surround,after));
//! space_factor:=1000; unsave;
//! end
//!
//! @ \TeX\ ... | Rust | 0 |
{
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, ENUPD4_A> {
use crate::Variant::*;
match self.bits {
0 => Val(ENUPD4_A::IMM),
2 => Val(ENUPD4_A::LSYNC),
3 => Val(ENUPD4_A::GSYNC),
i => ... | Rust | 0 |
nt> for ExtendedPoint`
/// using basepoint + basepoint versus the 2*basepoint constant.
#[test]
fn basepoint_plus_basepoint_vs_basepoint2() {
let bp = constants::ED25519_BASEPOINT;
let bp_added = &bp + &bp;
assert_eq!(bp_added.compress_edwards(), BASE2_CMPRSSD);
}
/// Test `... | Rust | 0 |
import astropy.units as u
import pytest
from pint.pintk.plk import PlkWidget
from tkinter import Frame
@pytest.fixture
def widget():
return Frame.__new__(PlkWidget)
@pytest.mark.parametrize(
"in_min,in_max,out_min,out_max",
[
(0 * u.us, 190 * u.us, 0 * u.us, 190 * u.us),
(0 * u.us, 201 *... | Python | 1 |
import io
import os
import socket
import struct
from time import sleep
from PIL import Image
from datetime import datetime
# Start a socket listening for connections on
# 0.0.0.0:8000 (0.0.0.0 means all interfaces)
server_socket = socket.socket()
server_socket.bind(('0.0.0.0', 8088))
server_socket.listen(0)
folder = ... | Python | 1 |
::{BufRead, Read},
path::PathBuf,
};
const TEST_PROFILES_PATH: &str = "../../../src/test/resources";
const NAMES_PATH: &str = "../wasm-ddsaveedit/names_cache.txt";
#[test]
fn test_loading() {
let mut profiles_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
profiles_dir.push(TEST_PROFILES_PATH);
let m... | Rust | 0 |
"abc");
// Remove . elements
assert_eq!(normalize!("abc/./def"), "abc/def");
assert_eq!(normalize!("/./abc/def"), "/abc/def");
assert_eq!(normalize!("abc/."), "abc");
// Remove .. elements
assert_eq!(normalize!("abc/def/ghi/../jkl"), "abc/def/jkl");
assert_eq!(... | Rust | 0 |
"""
Embeds x to (x, sin(2^k x), cos(2^k x), ...)
Different from the paper, "x" is also in the output
See https://github.com/bmild/nerf/issues/12
Inputs:
x: (B, self.in_channels)
Outputs:
out: (B, self.out_channels)
"""
out = [x]
... | Python | 1 |
let l_vec_len: u8 = CanonicalDeserialize::deserialize_uncompressed_unchecked(&mut reader)?;
let mut l_vec = Vec::with_capacity(l_vec_len as usize);
for _ in 0..(l_vec_len as usize) {
let c: G = CanonicalDeserialize::deserialize_uncompressed_unchecked(&mut reader)?;
l_vec.push(c);... | Rust | 0 |
'authorization': 'Bearer undefined',
'content-type': 'application/json',
'dnt': '1',
'origin': 'https://order.phuclong.com.vn',
'priority': 'u=1, i',
'referer': 'https://order.phuclong.com.vn/',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'se... | Python | 1 |
ke_while1_succeed() {
const INPUT: &str = "βèƒôřèÂßÇáƒƭèř";
const CONSUMED: &str = "βèƒôřèÂßÇ";
const LEFTOVER: &str = "áƒƭèř";
fn while1_s(c: char) -> bool {
c == 'β' || c == 'è' || c == 'ƒ' || c == 'ô' || c == 'ř' || c == 'è' || c == 'Â' || c == 'ß' || c == 'Ç'
}
fn test(input: &str) -> ... | Rust | 0 |
fn usage() -> TestResult {
let mut cmd = Command::cargo_bin(PROGRAM)?;
for flag in vec!["-h", "--help"] {
cmd.arg(flag)
.assert()
.stdout(predicate::str::contains("USAGE"));
}
Ok(())
}
// --------------------------------------------------
#[test]
fn bad_file() -> TestRe... | Rust | 0 |
um_tasks, dim_z=config.ae_dim_z,
enc_layers=ae_arch,
activation_fn=misc.str_to_act(config.ae_act),
use_bias=True).to(device)
init_params += list(rnet.parameters())
else:
rnet = None
### Initial... | Python | 1 |
"original_content": "zedrbzrb",
"post_id": 276670,
"topic_id": null,
"user_id": 24
}
]
}
"""
from flask import jsonify, request
from .sphinx_helper import api_url
from . import b... | Python | 1 |
///
/// The difference is computed as `final - initial`.
/// For [`DiscreteCoordinates`](crate::discrete::DiscreteCoordinate), this should be 0 for all values across the range.
#[must_use]
fn round_trip_coordinate_error(self) -> Self {
let float: f32 = self.into();
let round_trip_co... | Rust | 0 |
#!/usr/bin/env python3
"""Scans emails for unsubscribe links and opens them in a browser."""
import webbrowser
import imaplib
import bs4
import imapclient
import pyzmail
def unsub_scan(user_name, user_pass):
"""Returns a list of the unsubscribe links in a Gmail inbox."""
unsub_links = []
imaplib._MAXLIN... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.