text string | label_name string | labels int64 |
|---|---|---|
# Copyright (c) 2022, NVIDIA CORPORATION. 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 required by appli... | Python | 1 |
println!("x: {}, y: {}", f1.x(), f1.y());
println!("max_x: {}", f1.max_x(&f2));
let str1 = String::from("abcd");
let result;
{
let str2 = "xyz";
result = long_str(str1.as_str(), str2);
}
println!("longer string: {}", result);
let str1 = String::from("abcd");
let st... | Rust | 0 |
i64>,
) -> Result<(), InsertionError> {
let root_node = conn.get_tree()?;
let (output_node, workspace_id) = find_workspaces_output(&root_node, insertion_marker.pivot())
.ok_or_else(|| InsertionError::NoPivotWorkspace(insertion_marker.pivot().to_owned()))?;
let first_moved_workspace = match insertio... | Rust | 0 |
f = f + 1
if f == len(p):
return apology("error: invalid position", 400)
c = db.execute("SELECT DISTINCT name FROM characters WHERE position = ?", position[i])
f = 0
for l in range(len(c)):
if character[i] != c[l]['name']:
... | Python | 1 |
ed packets.
sleep(Duration::from_millis(10)).await;
}
// Now wait for another small period of time to make sure we've processed the messages.
// After that, trigger shutdown so our source closes and allows us to deterministically read
// everything that was in up without hav... | Rust | 0 |
lse,
imsize: int = 224,
cache_dir: Optional[str] = None,
image_mean = None,
image_std = None,
):
if pretrained=='bioclip':
model = load_openai_model(model_name, device=device, jit=jit, cache_dir=cache_dir)
###########PUT YOUR OWN PATH IN HERE #############
# R... | Python | 1 |
from hera.workflows import Container, Step, Steps, Workflow
from hera.workflows.models import Arguments, Mutex, Parameter, Synchronization
with Workflow(
api_version="argoproj.io/v1alpha1",
kind="Workflow",
generate_name="synchronization-db-tmpl-level-mutex-",
entrypoint="synchronization-db-tmpl-level-... | Python | 1 |
argument_len,
nested_name: nested_name.to_owned(),
nested,
}))
}
}
impl AggregateFunction for AggregateIfCombinator {
fn name(&self) -> &str {
&self.name
}
fn return_type(&self) -> Result<DataType> {
self.nested.return_type()
}
fn nulla... | Rust | 0 |
= width;
let height_in: i32 = height;
let mut out_out: *mut bindings::VipsImage = null_mut();
let extend_in: i32 = embed_options.extend as i32;
let extend_in_name = utils::new_c_string("extend")?;
let background_wrapper = utils::VipsArrayDoubleWrapper::from(&embed_options.back... | Rust | 0 |
"
],
"waf": [
"get_change_token",
"list_activated_rules_in_rule_group",
"list_byte_match_sets",
"list_geo_match_sets",
"list_ip_sets",
"list_logging_configurations",
"list_rate_based_rules",
"list_regex_match_sets",
"list_regex_pattern_sets... | Python | 1 |
as usize];
j += 1
}
k += x;
if k > EQTB_SIZE as i32 {
break;
}
}
if hash_high > 0 {
fmt_in
.undump(&mut EQTB[EQTB_SIZE as usize + 1..EQTB_SIZE as usize + 1 + hash_high as usize]);
}
fmt_in.undump_one(&mut x);
if x < HASH_... | Rust | 0 |
_base_ = [
'../_base_/models/pointpillars_hv_fpn_range100_lyft.py',
'../_base_/datasets/lyft-3d-range100.py',
'../_base_/schedules/schedule-2x.py',
'../_base_/default_runtime.py',
]
# model settings
model = dict(
type='MVXFasterRCNN',
pts_backbone=dict(
_delete_=True,
type='NoSte... | Python | 1 |
h,
window_height: event.window_height,
framebuffer_width: event.framebuffer_width,
framebuffer_height: event.framebuffer_height,
}
}
}
#[repr(C)]
#[derive(Debug)]
pub struct SAppDesc {
init_cb: *const c_void,
frame_cb: ... | Rust | 0 |
());
let object_id = "s3-object";
repo.create_object(object_id, DigestAlgorithm::Sha256, "content", 0)
.unwrap();
create_dirs(&temp, "a/b/c");
create_dirs(&temp, "a/d/e");
create_dirs(&temp, "a/f");
create_file(&temp, "a/file1.tx... | Rust | 0 |
file}")
return export_file
def main():
"""Main interface"""
ops = RealOps()
print("=== REALOPS - Trading/OSINT Operations ===")
print("1. Show real contacts")
print("2. Show DM summary")
print("3. Quick recon")
print("4. Export real data")
print("5. Exit")
while T... | Python | 1 |
.interpolate(xs)
for i, (x, y) in enumerate(zip(xs, ys)):
pitch_pos = int(x) + offset
if i == 0:
points.append(
Point(
x=pitch_pos + self.first_bar_length,
y=-100,
... | Python | 1 |
#!/usr/bin/env python3
"""
Verify Brain-Native Integration
"""
import os
import sys
print("🧠 BRAIN-NATIVE INTEGRATION VERIFICATION")
print("=" * 50)
# Add paths
current_dir = os.path.dirname(os.path.abspath(__file__))
src_dir = os.path.join(current_dir, "..")
sys.path.append(src_dir)
try:
print("📦 Testing bra... | Python | 1 |
ering has already
been done and else False. In this interface it is always False
since filtering is not available
"""
frame = GsUsbFrame()
# Do not set timeout as None or zero here to avoid blocking
timeout_ms = round(timeout * 1000) if timeout else 1
... | Python | 1 |
masks, _, _ = predictor.predict(
point_coords=None,
point_labels=None,
box=input_box[None, :],
multimask_output=False,
)
masks = masks.astype(np.float32)
mask_img = display_instance_with_masks(instance_img_rgb,
masks, prompt_fin... | Python | 1 |
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Move {
Unbounded(isize, isize),
CursorX(isize),
CursorY(isize),
ViewX(isize),
ViewY(isize),
}
impl Move {
/// reflects the x direction in case right-to-left mode
/// is enabled, since we do not actually want to mirror
/// the x ... | Rust | 0 |
rface_lines = [
interface_line(event_idl_file) for event_idl_file in event_idl_files
]
interface_lines.sort()
for relative_dir, name, attributes in interface_lines:
lines.extend([
' {',
' name: "%s",' % name,
' interfaceHeaderDir: "%s",' % relative_... | Python | 1 |
tory.id}")
# Lenovo specific stuff
if plugin_object.rf.vendor == "Lenovo":
redfish_chassi_url = grab(manager_response, "Links/ManagerForChassis/0/@odata.id", separator="/")
chassi_response = None
if redfish_chassi_url is not None:
chassi_response = plugin_object.rf.get(redf... | Python | 1 |
sult.append((w_key, space.wrap(str_val)))
else:
self.result.append((w_key, space.wrap(num_value)))
@jit.unroll_safe # assuming that the format string isn't too crazy
def interpret(self):
results = []
pos = 0
while pos < len(self.fmt):
char = self.fmt[pos... | Python | 1 |
import os
import cv2
import numpy as np
from ultralytics import YOLO
from deep_sort_realtime.deepsort_tracker import DeepSort
# Paths setup
script_dir = os.path.dirname(os.path.abspath(__file__))
video_path = os.path.join(script_dir, 'data', 'SampleVideo1.mp4')
print("Using absolute path:", video_path)
# Open video
c... | Python | 1 |
from turtle import *
import turtle
turtle.color("DarkOliveGreen4")
speed(0)
for x in range(36):
for x in range(5):
forward(100)
right(144)
right(10)
turtle.done() | Python | 1 |
layers: 5,
num_neighbors: 20,
max_search: 50,
show_progress: false,
};
let mut builder = HnswBuilder::<[T], T>::with_owned_elements(config, elements);
builder.build_index();
let index = builder.get_index();
verify_search(&index, 0.95, 40);
}
fn verify_search<E: At<Output =... | Rust | 0 |
import pytest
from mitmproxy.contentviews import Metadata
from mitmproxy.contentviews._view_javascript import beautify
from mitmproxy.contentviews._view_javascript import javascript
def test_view_javascript():
assert javascript.prettify(b"[1, 2, 3]", Metadata())
assert javascript.prettify(b"[1, 2, 3", Metada... | Python | 1 |
"""
Migration: Add Relay Messages History
Description: Создание таблицы relay_messages для хранения истории отправленных сообщений в анонимных чатах
Version: 009
Created: 2025-02-15T00:00:00
"""
version = "009"
name = "add_relay_messages_history"
description = "Создание таблицы relay_messages для хранения истории отпр... | Python | 1 |
t_caller(&mut self) {
match self {
&mut QueryTerm::Clause(_, _, _, ref mut use_default_cp) => *use_default_cp = true,
_ => {}
}
}
pub(crate) fn arity(&self) -> usize {
match self {
&QueryTerm::Clause(_, _, ref subterms, ..) => subterms.len(),
... | Rust | 0 |
import torch.nn as nn
from transformers import BertModel
import torch
import torch.nn.functional as F
import numpy as np
import math
import torch.utils.model_zoo as model_zoo
from resnet_models import *
class Mynet(nn.Module):
def __init__(self,config):
super(Mynet, self).__init__()
self.config=c... | Python | 1 |
).unwrap();
assert!(<&str>::from_robj(&na_string).is_err());
assert_eq!(<Option<&str>>::from_robj(&na_string), Ok(None));
assert_eq!(<Option<&str>>::from_robj(&Robj::from("1")), Ok(Some("1")));
assert!(<Option<&str>>::from_robj(&Robj::from(["1", "2"])).is_err());
let na_string =... | Rust | 0 |
o: &mut T, cluster: u32) -> Result<FatValue, bool> {
let block = (cluster + (cluster / 2)) / self.block_size;
let offset = (cluster + (cluster / 2)) % self.block_size;
if block >= self.block_count {
return Err(false);
}
let mut buf = [0u8; 2];
io.read(self.f... | Rust | 0 |
`true` if `a` and `b` are coprime.
///
/// This is a helper function that calls `gcd(a, b)` and checks
/// if the result is `1`.
///
/// # Examples
///
/// ```
/// use reikna::factor::coprime;
/// assert_eq!(coprime(8, 4), false);
/// assert_eq!(coprime(9, 8), true);
/// ```
pub fn coprime(a: u64, b: u64) -> bool {
... | Rust | 0 |
DOMAIN,
context={"source": config_entries.SOURCE_ZEROCONF},
data=zeroconf.ZeroconfServiceInfo(
ip_address=ip_address("fd00::b27c:63bb:cc85:4ea0"),
ip_addresses=[ip_address("fd00::b27c:63bb:cc85:4ea0")],
hostname="mock_hostname",
port=None,
typ... | Python | 1 |
ofile)
def get_username(profile: Optional[Any]) -> Optional[str]:
"""Get the username from the profile."""
return login_manager.get_username(profile)
def get_login_message() -> str:
"""Get the login message to display to users."""
return login_manager.get_login_message()
def validate_login_for_operat... | Python | 1 |
e.test("localhost", &id, None).unwrap(), true);
}
#[test]
fn test_pubkey_wrong_host() {
let id = PublicKey::from(vec![
0x00, 0x00, 0x00, 0x07, 0x73, 0x73, 0x68, 0x2d, 0x72, 0x73, 0x61, 0x00, 0x00, 0x00,
0x00,
]);
let line = KnownHostsLine("localhost ssh-rsa A... | Rust | 0 |
eset(message, escapes)
return message
def _escape_code_map(self, item: str) -> EscapeCodes:
"""
Build a map of keys to escape codes for use in message formatting.
If _blank_escape_codes() returns True, all values will be an empty string.
"""
codes = {**escape_codes.... | Python | 1 |
};
FrameMisR { bits }
}
}
extern crate cryptopals;
extern crate deflate;
use cryptopals::block_ciphers::AESBlockMode;
use deflate::deflate_bytes;
const PADDING: &[u8] = b"!\"#$%&'()*,-./:;<>?@[\\]^_`{|}~";
const CHARSET: &[u8] = b"+/0987654321ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
const SE... | Rust | 0 |
,
BuildReactor = 3683,
EffectSpray = 3684,
EffectRepair = 3685,
EffectMassRecall = 3686,
EffectBlink = 3687,
BehaviorHoldFireOn = 3688,
BehaviorHoldFireOff = 3689,
RallyWorkers = 3690,
BuildCreepTumor = 3691,
ResearchProtossAirArmor = 3692,
ResearchProtossAirWeapons = 3693,
ResearchProtossGroundArmor = 3694... | Rust | 0 |
write_wrap_seq_iter(&mut out, b"AAAATTTTGGG".chunks(size), 3).unwrap();
assert_eq!(&out, b"AAA\nATT\nTTG\nGG\n");
let mut out = vec![];
write_wrap_seq_iter(&mut out, b"AAAATTTTGGG".chunks(size), 4).unwrap();
assert_eq!(&out, b"AAAA\nTTTT\nGGG\n");
}
}
bitflags! {
#[derive(Defaul... | Rust | 0 |
pub seed: u64,
}
impl SharedState {
pub fn get_active_seat(&self) -> Seat {
self.seats
.get(self.turn)
.expect("Game turn number invalid")
.clone()
}
}
///////////////////////////////////////////////////////////////////////////////
// ... | Rust | 0 |
id::Uuid as UuidVal;
use snafu::{ensure, OptionExt};
use crate::common::Cardinality;
use crate::descriptors::{self, Descriptor, TypePos};
use crate::errors::{self, CodecError, DecodeError, EncodeError};
use crate::value::Value;
use crate::model;
use crate::serialization::decode::{RawCodec, DecodeTupleLike, DecodeArray... | Rust | 0 |
`](Self::setup_cqsize) has been called.
pub fn build(&self, entries: u32) -> io::Result<IoUring> {
let ring = IoUring::with_params(entries, self.params)?;
if self.dontfork {
ring.memory.sq_mmap.dontfork()?;
ring.memory.sqe_mmap.dontfork()?;
if let Some(cq_mmap) =... | Rust | 0 |
import pytest
from read_workouts import build_workout_program, Workout
@pytest.fixture()
def workout_program():
print("setup")
workout_program = build_workout_program()
yield workout_program
print("teardown")
def assert_workouts_eq(got, want):
assert got.day == want.day, "got " + str(got.day) + " ... | Python | 1 |
'''
RegularEx
'''
# s='hello'
# for aeiouAEIOU in s[0]:
# print(s)
# s='Bannana'
# for aeiouAEIOU in s[1]:
# if True:
# print('start with vowel')
# else:
# print('Not start with vowel')
# import re
# s='Hello'
# print(re.findall('.',s))
# import re
# s='Hello every one guys ...... | Python | 1 |
"Press Y to confirm deletion, any other key cancels: ",
Color::Cyan,
);
stdoutlock.flush().unwrap();
let gc = getch::Getch::new();
let do_delete = match gc.getch() {
Ok(key) => key == b'Y' || key == b'y',
Err(_) => false,
};
// println!();
do_delete
}
fn ... | Rust | 0 |
import multiprocessing
import serial
ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=1, dsrdtr=True, rtscts=True)
ser.reset_input_buffer()
manager = multiprocessing.Manager()
sensor_one = manager.Value("i", -1.0)
sensor_two = manager.Value("i", -1.0)
sensor_three = manager.Value("i", -1.0)
sensor_x = manager.Va... | Python | 1 |
...)
) -> Dict:
"""
GET endpoint for analysing a Japanese sentence without a focus word.
Args:
sentence (str): Sentence to breakdown
Returns:
dict: Dictionary containing fields 'sentence' and 'explanation'
Raises:
HTTPException: Status code 500 if breakdown fails.
"""
tr... | Python | 1 |
}),
Opcode(5) => Ok(Request::ShowWindowMenu {
seat: from_object_payload!(WlSeat, con.clone(), m.args[0]),
serial: from_payload!(UInt, m.args[1]),
x: from_payload!(Int, m.args[2]),
y: from_payload!(Int, m.args[3]),
}),... | Rust | 0 |
e::core::code::UnOptCode;
pub(crate) const COMMANDS: &'static [char] = &['형', '항', '핫', '흣', '흡', '흑'];
const HEARTS: &'static [char] = &[
'♥', '❤', '💕', '💖', '💗', '💘', '💙', '💚', '💛', '💜', '💝', '♡',
];
/// Check if the character is hangul
///
/// # Example
///
/// ```
/// use hyeong::core::parse;
///
///... | Rust | 0 |
import tkinter as tk
from tkinter import ttk
def celsius_to_fahrenheit(celsius):
return (celsius * 9/5) + 32
def fahrenheit_to_celsius(fahrenheit):
return (fahrenheit - 32) * 5/9
def celsius_to_kelvin(celsius):
return celsius + 273.15
def kelvin_to_celsius(kelvin):
return kelvin - 273.15
def fahren... | Python | 1 |
Entry { pat: 1, table: &COMMAND_TABLE2, flip_x: true },
UnitTableEntry { pat: 2, table: &COMMAND_TABLE1, flip_x: false },
UnitTableEntry { pat: 2, table: &COMMAND_TABLE1, flip_x: true },
],
[
UnitTableEntry { pat: 0, table: &COMMAND_TABLE3, flip_x: true },
UnitTableEntry { pat: 3... | Rust | 0 |
equent calls to this function will return NULL. The task pointer must not be NULL. The
/// caller must free the returned string.
#[no_mangle]
pub unsafe extern "C" fn tc_task_error(task: *mut TCTask) -> TCString {
// SAFETY:
// - task is not null (promised by caller)
// - task outlives 'a (promised by c... | Rust | 0 |
path())
.rewards_history(params.rewards_history());
let builder = match (leadership_mode, from_genesis) {
(LeadershipMode::Passive, _) => builder.genesis_block_hash(params.genesis_block_hash()),
(LeadershipMode::Leader, FromGenesis::File) => builder
.genesis_block_path(params.ge... | Rust | 0 |
) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `HPM_CAL_ARRAY_SIZE`"]
pub enum HPM_CAL_ARRAY_SIZEW {
#[doc = "128"]
_0,
#[doc = "256"]
_1,
}
impl HPM_CAL_ARRAY_SIZEW {
#[allow(missing_docs)]
#[doc(hi... | Rust | 0 |
import tkinter as tk
from tkinter import messagebox
def start(x, y, mines, times_of_can_back):
setting_window.destroy() # 關閉開始視窗
from .Minesweeper import Minesweeper
Minesweeper(x, y, mines, times_of_can_back)
def custom():
def check_parameters(x, y, mines, times_of_can_back):
x, y, mines = ... | Python | 1 |
:
tools_usage[tool] = tools_usage.get(tool, 0) + 1
# Get recent episodes (last 5)
recent_episodes = sorted(
self.episodes.values(),
key=lambda x: x.timestamp,
reverse=True
)[:5]
recent_episode_info = [
{
... | Python | 1 |
}
impl<'a, T> std::ops::Deref for CutexGuard<'a, T> {
type Target = T;
fn deref(&self) -> &T {
unsafe { &*self.cutex.value.get() }
}
}
impl<'a, T> std::ops::DerefMut for CutexGuard<'a, T> {
fn deref_mut(&mut self) -> &mut T {
unsafe { &mut *self.cutex.value.get() }
}
}
#[cfg(test)... | Rust | 0 |
);
println!("{:?}", vector_explicit);
// vector: initialize with values of 1, 2, and 3 inferred using macro
let vector_inferred = vec![1, 2, 3];
println!("{:?}", vector_inferred);
// vector: updating
let mut vector_updated = vec![1, 2, 3];
vector_updated.push(4);
vector_updated.push(... | Rust | 0 |
e vek::vec::Vec3;
use starstruck::StarstruckBuilder;
// THIS IS OUR STATE WHERE WE STORE ALL OUR DATA
struct State {
camera: DebugCamera,
triangle_pipeline: Pipeline<Vertex3D>,
triangle_bundle: Bundle<u16, Vertex3D>,
}
impl State {
pub fn new(setup: Arc<SetupContext>) -> impl Future<Item = Self, Error... | Rust | 0 |
(ctx.registers.st6, 0)
ctx.setConcreteRegisterValue(ctx.registers.st7, 0)
self.assertEqual(ctx.getConcreteRegisterValue(ctx.registers.st0), 0)
self.assertEqual(ctx.getConcreteRegisterValue(ctx.registers.st1), 0)
self.assertEqual(ctx.getConcreteRegisterValue(ctx.registers.st2), 0)
... | Python | 1 |
6, L7, L8, L9, L10, L11, L12, L13)
{
type Output = (
L0,
L1,
L2,
L3,
L4,
L5,
L6,
L7,
L8,
L9,
L10,
L11,
L12,
L13,
Type,
);
}
impl<L0, L1, L2, L3, L4, L5, L6, L7, L8, L9, L10, L11, L12, L13, L1... | Rust | 0 |
# Generated by Django 5.1.2 on 2024-11-13 17:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mi_app', '0028_bannerhome'),
]
operations = [
migrations.CreateModel(
name='About',
fields=[
('id', ... | Python | 1 |
,
Colorimetry::Bt601 as usize,
)
}
pub fn nv12_bt709_bgra_lrgb(
width: u32,
height: u32,
last_src_plane: u32,
src_strides: &[usize],
src_buffers: &[&[u8]],
_last_dst_plane: u32,
dst_strides: &[usize],
dst_buffers: &mut [&mut [u8]],
) -> bool {
nv12_bgra_lrgb(
wid... | Rust | 0 |
_top_layer, "top layer")
def test_top_layer_unmet_requisite_top_cross_improper(self):
self.raise_unmet_requisite_stage_test("frrffffffublrrrrrrulbbbbbbbuflllllllrubuuuuufddddddddd", solver._top_layer, "top layer")
def test_top_layer_change_nothing_solved(self):
self.change_nothing_test("fffffff... | Python | 1 |
hannel_controls_axes.add_collection(self._rb_histogram_channels._buttons)
def _get_display_info(self, bayer_image, camera_settings) -> str:
"""Get channel statistics for display."""
r_mean, g_mean, b_mean = get_channel_means(bayer_image, camera_settings)
return f'R: μ={r_mean:.3f} | G: μ={g_mean:.3f} |... | Python | 1 |
VolumeRef::ConfigMap(cm) => cm.mount(path).await,
VolumeRef::Secret(sec) => sec.mount(path).await,
VolumeRef::PersistentVolumeClaim(pv) => pv.mount(path).await,
VolumeRef::HostPath(host) => host.mount().await,
}
}
/// A convenience wrapper that calls the correct u... | Rust | 0 |
ngles))
return angles, mode_note
# =================================================
def process_folder_all_angles(folder_path):
_set_console_utf8()
# 规范化路径为 str
folder_path = os.path.normpath(os.fsdecode(os.fsencode(folder_path)))
# 生成角度列表
angles, mode_note = _build_angle_list()
print_... | Python | 1 |
ss="header">
<h1>🎯 Enhanced Interview System</h1>
<p>AI-powered interviews with integrated knowledge base</p>
</div>
<!-- Interview Setup -->
<div class="section">
<h3>🚀 Interview Setup</h3>
<input type="text" id="candidateName" placehol... | Python | 1 |
from transformers import BertTokenizer, BertForSequenceClassification
import torch
def load_dataset(file_path, label):
sequences = []
labels = []
with open(file_path, 'r') as f:
for line in f:
if not line.startswith('@'):
sequence = line.strip()
kmeriz... | Python | 1 |
_automl_passes_allow_long_running_models(
AutoMLTestEnv,
algo,
unique,
allow_long_running_models,
caplog,
):
X = pd.DataFrame([i for i in range(unique)] * 10)
y = pd.Series([i for i in range(unique)] * 10)
automl = AutoMLSearch(
X_train=X,
y_train=y,
problem_type=... | Python | 1 |
_eq!(value_to_face_offset(5.0, &axis, 14.0), 14.0);
assert_eq!(value_to_face_offset(0.0, &axis, 14.0), 4.0);
assert_eq!(value_to_face_offset(-4.0, &axis, 14.0), -4.0);
assert_eq!(value_to_face_offset(7.0, &axis, 14.0), 18.0);
}
}
<gh_stars>1-10
#![cfg_attr(not(feature = "std"), no_std)]
use... | Rust | 0 |
transform: Transform {
translation: grid::world_to_iso(pos.0),
scale: Vec3::new(WORLD_DRAW_SCALE, WORLD_DRAW_SCALE, 0.0),
..Default::default()
},
texture: match *flag {
world::Flag::COLONY_C => t... | Rust | 0 |
from abc import ABC
from typing import Callable
from typing import ClassVar
from typing import Optional
from evidently.pydantic_utils import register_type_alias
from evidently.ui.service.base import BlobStorage
from evidently.ui.service.base import DataStorage
from evidently.ui.service.base import ProjectMetadataStora... | Python | 1 |
ze() >= X.Size()).
a.RecoverFEMSolution(X, b, x)
if (cdofs > max_dofs):
print("Reached the maximum number of dofs. Stop.")
break
# 18. Call the refiner to modify the mesh. The refiner calls the error
# estimator to obtain element errors, then it selects elements to be
# refin... | Python | 1 |
ing record to the Firestore 'bookkeeping' collection
:param username: The username of this record
:param record_type: 'expense' or 'income'
:param category: The category of the record
:param name: The name/description of the record
:param amount: The amount (number)
:param timestamp: The timesta... | Python | 1 |
self.STRING_REGEX_SINGLE = "'[^'\r\n]*'"
# a literal '
# anything which isn't ' or a newline 0 or more times
# a literal '
self.STRING_REGEX_DOUBLE = re.compile('"[^"\r\n]*"')
# a literal ",
# anything which isn't " or a newline 0 or more times
# a literal "
self.NUMBER_REGEX = re.compile(
\b # begin wit... | Python | 1 |
,
n => ActivitySubtype::UnknownValue(n as u64),
}
} else {
panic!("can't convert ActivitySubtype to {:?}", field);
}
}
}
<reponame>DCIanus/proc_macro_helper<gh_stars>0
use syn::{Lit as Literal, Meta, NestedMeta};
#[derive(Debug, Default, Eq, PartialEq, Clone)]
... | Rust | 0 |
rse_args()
if args.generate:
keywords = generate_keyword_list()
with open('keywords.txt', 'w') as f:
for keyword in keywords:
f.write(f"{keyword}\n")
print(f"Список запрещенных слов успешно сгенерирован и сохранен в 'keywords.txt'.")
else:
with op... | Python | 1 |
string()
})
}
<reponame>jayjamesjay/prime-number
//! Module for working with iterators
use std::vec;
pub trait Stringify {
fn stringify(self, separator: &str, line_len: usize) -> String;
}
impl<T: ToString> Stringify for vec::IntoIter<T> {
///Consumes iterator over `Vec`. Generates simply formated `Strin... | Rust | 0 |
labels: self
.labels
.iter()
.map(|(&k, v)| (k.to_string(), v.to_string()))
.collect(),
value: self.value,
timestamp: self.timestamp_ms,
}
}
}
impl Metric {
fn append_sample_entry(&mut self, s: SampleEntry) {
... | Rust | 0 |
)
ax.set_title("Complex Vector Field")
ax.grid(True, alpha=0.3)
plt.close(fig)
def test_error_handling_integration(self):
"""Test error handling in integration scenarios."""
# Create simple field
x = np.linspace(0, 1, 5)
y = np.linspace(0, 1, 4)
u = ... | Python | 1 |
odds_table = [
{
"name": "Cherry",
"odds": 128, # 0-127 7-bits
"payout": 3,
},
{
"name": "Bar",
"odds": 70, # 128-191 7-bits
"payout": 5,
},
{
"name": "DoubleBar",
"odds": 26, # 192-217 5-bits
"payout": 10,
},
{
... | Python | 1 |
NAME> <<EMAIL>>")
.about("Reads advent calendar programs")
.arg(
Arg::new("INPUT")
.about("Sets the input file to use")
.required(true)
.index(1),
)
.get_matches();
let txt_location: &str = matches.value_of("INPUT").unwrap(... | Rust | 0 |
y::F1,
winit::keyboard::Key::F2 => KbKey::F2,
winit::keyboard::Key::F3 => KbKey::F3,
winit::keyboard::Key::F4 => KbKey::F4,
winit::keyboard::Key::F5 => KbKey::F5,
winit::keyboard::Key::F6 => KbKey::F6,
winit::keyboard::Key::F7 => KbKey::F7,
winit::keyboard::Key::F... | Rust | 0 |
from fastapi.encoders import jsonable_encoder
from sqlalchemy.dialects.mysql import insert
from sqlalchemy.orm import Session
from app import models, schemas
from .base import CRUDBase
class CRUDTag(
CRUDBase[
models.Tag,
schemas.TagResponse,
schemas.TagCreate,
schemas.TagUpdate,... | Python | 1 |
#!/usr/bin/env python3
"""
Tests code paths with invalid policy.
"""
from common import LOCALHOST, RootCert, STATUS_PORT, SocketPair, TcpServer, \
TlsClient, print_ok, run_ghostunnel, terminate
from tempfile import mkstemp, mkdtemp
import time
import signal
import shutil
import ssl
import socket
import os
if __... | Python | 1 |
(_)) => false,
(_, _) => false,
}
}
}
impl std::hash::Hash for Value {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
match self {
Value::Unsigned(x) => x.hash(state),
Value::Negative(x) => x.hash(state),
Value::ByteString(x) => x.hash(state),
Value::Utf8String(x) => x.hash(state),
Value... | Rust | 0 |
,loss_cls_value, loss_box_value, lr.eval())
print 'speed: {:.3f}s / iter'.format(timer.average_time)
if (iter+1) % cfg.TRAIN.SNAPSHOT_ITERS == 0:
last_snapshot_iter = iter
self.snapshot(sess, iter)
if last_snapshot_iter != iter:
self.snap... | Python | 1 |
ks_and_plls(
external_xtal_freq_hz,
pac.XOSC,
pac.CLOCKS,
pac.PLL_SYS,
pac.PLL_USB,
&mut pac.RESETS,
&mut watchdog,
)
.ok()
.unwrap();
let pins = rp_pico::Pins::new(
pac.IO_BANK0,
pac.PADS_BANK0,
sio.gpio_bank0,
&mu... | Rust | 0 |
me_train,rnn_index_train,config.n_time_interval,step, batch_size=batch_size)
lambda1 = model.train_batch(batch_x,batch_x_indict, batch_y,batch_time_interval_index,batch_rnn_index)
#train_writer.add_summary(summary, step)
train_loss.append(model.get_error(batch_x,batch_x_indict, batch_y,batch_time_interval_i... | Python | 1 |
"""Tests for the A2A module."""
| Python | 1 |
ompetitor stores
size_max=6 # Adjust the size of the markers
).update_traces(
marker=dict(size=10, opacity=0.8),
hovertemplate="<b>%{hovertext}</b><br>" +
"Address: %{customdata[0]}<br>" +
"ZIP: %{customdata[1]}<br>",
customdata=gdf_compet... | Python | 1 |
# Copyright 2016 Quantopian, Inc.
#
# 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 required by applicable law or agreed to in writ... | Python | 1 |
velopment")
.expect("config not found")
.validate()
.expect("invalid config"));
}
#[test]
fn staging_loads_builtins() {
dbg!(get_builtin("staging"));
}
#[test]
fn staging_validates() {
dbg!(get_builtin("staging")
.expect("config n... | Rust | 0 |
r, columns={'view_coupon_id_hash': 'coupon_id_hash'}, inplace=True)
# subset users that were seeing in training
df_vva = df_visits_valid[df_visits_valid.user_id_hash.isin(train_users)]
df_pva = df_purchases_valid[df_purchases_valid.user_id_hash.isin(train_users)]
id_cols = ['user_id_hash', 'coupon_id_hash']
df_intera... | Python | 1 |
emory(
pbBuffer: WICInProcPointer,
cbBufferSize: DWORD,
) -> HRESULT,
fn InitializeFromIStreamRegion(
pIStream: *const IStream,
ulOffset: ULARGE_INTEGER,
ulMaxSize: ULARGE_INTEGER,
) -> HRESULT,
});
RIDL!(#[uuid(0xdc2bb46d, 0x3f07, 0x481e, 0x86, 0x25, 0x22, 0x0c, 0x4a... | Rust | 0 |
> for Sequential {
fn from(seq: SequentialIfElse) -> Self {
Sequential::If(seq)
}
}
impl From<ParallelProcess> for Parallel {
fn from(process: ParallelProcess) -> Self {
Parallel::Process(process)
}
}
impl From<Parallel> for Stmt {
fn from(parallel: Parallel) -> Self {
Stmt... | Rust | 0 |
"""
OPDS Authentication 1.0 Serializer.
https://drafts.opds.io/schema/authentication.schema.json
"""
from rest_framework.fields import CharField
from rest_framework.serializers import IntegerField, Serializer
class OPDSAuth1LinksSerializer(Serializer):
"""OPDS Authentication Links."""
rel = CharField(read_... | Python | 1 |
* ( 0 as * const TPM20_TestParms_Out ) ) . responseCode as
* const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( TPM20_TestParms_Out ) ,
"::" , stringify ! ( responseCode ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const TPM2... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.