text string | label_name string | labels int64 |
|---|---|---|
eU64::failure();
}
return val;
}
/// <!-- description -->
/// @brief Writes to a CPU register in the VS given a bf_reg_t and the
/// value to write. Note that the bf_reg_t is architecture specific.
///
/// <!-- inputs/outputs -->
/// @param vsid The ID of the VS to ... | Rust | 0 |
fs::File;
use std::{io, ptr, result, slice};
use libc::c_void;
use log::warn;
use nix::sys::mman::{mmap, msync, munmap, MapFlags, MsFlags, ProtFlags};
use nix::sys::uio::{process_vm_readv, process_vm_writev, IoVec, RemoteIoVec};
use nix::unistd::Pid;
use std::os::unix::io::AsRawFd;
use virtio_blk::defs::{SECTOR_SHIFT,... | Rust | 0 |
import pytest
from wasabi.util import color, diff_strings, format_repr, locale_escape, wrap
def test_color():
assert color("test", fg="green") == "\x1b[38;5;2mtest\x1b[0m"
assert color("test", fg=4) == "\x1b[38;5;4mtest\x1b[0m"
assert color("test", bold=True) == "\x1b[1mtest\x1b[0m"
assert color("tes... | Python | 1 |
#!/usr/bin/env python3
"""
Debug Size Parsing Issue
Creator: Mahesh Vaikri
"""
import sys
import os
# Add the project root to Python path
parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parent_dir)
def test_size_parsing():
print("🔍 DEBUGGING SIZE PARSING")
print("=... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__license__= """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Golismero project site: https://github.com/golismero
Golismero project mail: contact@golismero-project.com
This program is free software; you can redistribute it and/or
modify it under the terms of ... | Python | 1 |
0.into(), 2.into()).unwrap(),
);
assert!(!result.is_empty());
}
/// Would cause panics in `Source` as the spans from the implicit prelude were used with the
/// `Source` from the normal expression
#[tokio::test]
async fn dont_use_the_implicit_prelude_span_in_the_top_expr() {
let _ = ::env_logger::try_init(... | Rust | 0 |
` - A random sample
/// * `indices`: The spectral indices
pub fn sample_packet(
&self,
point: Vec3,
sample: Vec2,
indices: &[usize; PACKET_SIZE],
) -> EmitterSample<[Float; PACKET_SIZE]> {
let surface_sample = self.geometry.sample_surface(point, sample);
let o... | Rust | 0 |
#!/usr/bin/env python3
import rospy
from sensor_msgs.msg import Image
class InferenceAbstractionNode:
def __init__(self):
rospy.init_node('inference_abstraction_node')
# Subscribers for camera images
self.top_camera_sub = rospy.Subscriber('/camera/top/dual/color/image_raw', Image,... | Python | 1 |
r"""
1. A' = \{a \in A : a < d_{test}\} \\
2. B' = \{b \in B : b < d_{test}\} \\
3. C = \{a \in A' : a \notin B'\} \\
4. \text{if } |C| < 10 \text{ then remove } \max(A') \text{ and repeat step 3} \\
5. A = A \cap C
"""
)
st.caption(
"""
In this notation:
- $A$ represents the "all_data" dataset.
- $B$ represent... | Python | 1 |
trainer.train(args.epochs, start_epoch=start_epoch)
except KeyboardInterrupt:
logger.info("Training interrupted by user (KeyboardInterrupt).")
save_final = True
except Exception as e:
logger.error(f"An unexpected error occurred during training: {e}", exc_info=True)
save_fina... | Python | 1 |
Mask: AccessFlags,
pub oldLayout: ImageLayout,
pub newLayout: ImageLayout,
pub srcQueueFamilyIndex: u32,
pub dstQueueFamilyIndex: u32,
pub image: Image,
pub subresourceRange: ImageSubresourceRange,
}
#[repr(C)]
pub struct RenderPassBeginInfo {
pub sType: StructureType,
pub pNext: *const ... | Rust | 0 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | Python | 1 |
}
}
});
});
let _ = sender.try_send(Box::new(move || {
for &i in &reacters {
let turf = unsafe { Value::turf_by_id_unchecked(i) };
if cfg!(target_os = "linux") {
turf.get(byond_string!("air"))?.call("vv_react", &[&turf])?;
} else {
turf.get(byond_string!("air"))?.call("react", &[&t... | Rust | 0 |
from flask import Blueprint, render_template, request, redirect, url_for, session
from services.course_service import CourseService
from services.teacher_service import TeacherService
course_bp = Blueprint('course_bp', __name__)
def check_adm_role():
"""
Verifica se o usuário atual é 'adm'.
Caso não seja,... | Python | 1 |
arch::asm;
use core::panic::PanicInfo;
#[cfg(not(feature = "no_panic"))]
#[panic_handler]
unsafe fn _panic(info: &PanicInfo) -> ! {
crate::early_printk!("\nKernel panicked\n");
let location = info.location().unwrap();
crate::early_printk!("Location: In {} at line {}\n", location.file(), location.line());... | Rust | 0 |
:spawn(move || {
let vals = vec![
String::from("hi"),
String::from("from"),
String::from("the"),
String::from("thread"),
];
for val in vals {
tx1.send(val).unwrap();
thread::sleep(Duration::from_secs(1));
}
});
... | Rust | 0 |
_PACKING_ROW_INTERLEAVED: GstVideoMultiviewFramePacking = 6;
pub const GST_VIDEO_MULTIVIEW_FRAME_PACKING_TOP_BOTTOM: GstVideoMultiviewFramePacking = 7;
pub const GST_VIDEO_MULTIVIEW_FRAME_PACKING_CHECKERBOARD: GstVideoMultiviewFramePacking = 8;
pub type GstVideoMultiviewMode = c_int;
pub const GST_VIDEO_MULTIVIEW_MODE... | Rust | 0 |
ized_data
color_strength = normalized_data
vmin = min(color_strength)
vmax = max(color_strength)
norm = mcolors.TwoSlopeNorm(vmin=vmin, vmax=vmax, vcenter=vcenter)
cmap = plt.cm.get_cmap('RdBu_r')
new_cmap = mpl.colors.LinearSegmentedColormap.from_list('truncated_cmap', cmap(np.linspace(... | Python | 1 |
import torch
# ---- Default model paths (you can override with CLI flags) ----
sovits_path = "" # trained SoVITS .pth; leave empty to pass -s
gpt_path = "" # trained GPT .ckpt; leave empty to pass -g
# Feature extractors (HF-style folders)
cnhubert_path = "GPT_SoVITS/pretrained_models/chinese-hubert... | Python | 1 |
H: Fn(UpdateWithCx<Message>, Cmd) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<(), HandlerE>> + Send + 'static,
Result<(), HandlerE>: OnError<HandlerE>,
HandlerE: Debug + Send,
N: Into<String> + Send + 'static,
{
let cloned_bot = bot.clone();
commands_repl_with_listener(
... | Rust | 0 |
if trades_has_header:
continue
exch_ts = int(row[timestamp_col])
local_ts = exch_ts + feed_latency
px = float(row[price_col])
qty = float(row[qty_col])
# Insert TRADE_EVENT
tmp[row_num] = [
TRADE_EVENT | (S... | Python | 1 |
ClientTrait>(
pool: web::Data<Pool>,
group_name: web::Path<String>,
scope_and_user: ScopeAndUser,
trust_change: web::Json<ChangeTrust>,
cis_client: web::Data<T>,
) -> Result<HttpResponse, ApiError> {
operations::groups::update_group_trust(
&pool,
&scope_and_user,
&group_n... | Rust | 0 |
deal by using the transfer made by Person2
assert_noop!(
Creditcoin::close_deal_order(
Origin::signed(test_info.borrower.account_id),
deal_order_id,
transfer_id,
),
crate::Error::<Test>::TransferDealOrderMismatch
);
});
}
#[test]
fn close_deal_order_should_error_when_transfer_block_is_greate... | Rust | 0 |
mut val_match = false;
if frame.id == id {
match &*frame.fields {
&[Field::TextEncoding(_), Field::String(ref f_key), Field::String(ref f_val)] => {
//TODO(sp3d): checking byte equality is wrong; encodings need to be considered
... | Rust | 0 |
a, b, weight.clone());
self.add_arc(b, a, weight.clone());
}
}
impl<V, W> Index<NodeId> for AdjacencyMap<V, W> {
type Output = AdjacencyMapNode<V, W>;
fn index(&self, index: NodeId) -> &AdjacencyMapNode<V, W> {
&self.nodes[self.map[&index]]
}
}
// Currently there is no easy way to ret... | Rust | 0 |
# Copyright (c) 2018 luozhouyang
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | Python | 1 |
from .fewshot_base_dataset import FewShotBaseDataset
from .fewshot_dataset import FewShotKeypointDataset
from .test_base_dataset import TestBaseDataset
from .test_dataset import TestPoseDataset
from .transformer_base_dataset import TransformerBaseDataset
from .transformer_dataset import TransformerPoseDataset
__all__ ... | Python | 1 |
dataset_type = 'GrassDataset'
data_root = 'data/grass'
crop_size = (256, 256)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type='RandomCrop', crop_size=crop_size),
dict(type='RandomFlip', prob=0.5),
dict(type='PhotoMetricDistortion'),
dict(type='PackSegI... | Python | 1 |
new_spline[:, 1] = new_spline[:, 1] + scene_width // 2
new_spline[:, 2] = -new_spline[:, 2] + scene_height // 2
# Fix framerate issue for eth scene
if scene == 'seq_eth':
new_spline[:, 0] = new_spline[:, 0] / 0.6
spline_list.append(new_spline... | Python | 1 |
mut data) = data {
let hex_mode = true;
// let hex_mode = self.config.hex_mode;
let data_len = if hex_mode { data.len() / 2 } else { data.len() };
if len > 0 && data_len != len {
defmt::error!(
... | Rust | 0 |
// TODO Hacks to override OSM data. There's no problem upstream, but we want to accomplish
// various things for A/B Street.
for id in [380902156, 380902155, 568612970] {
if let Some(way) = doc.ways.get_mut(&WayID(id)) {
// https://www.openstreetmap.org/way/380902156 and friends look like a ... | Rust | 0 |
FFERS_COUNT], // Transmit Start Address of Descriptor0 (TSAD0 .. TSAD3)
pub config1: Port<u8>, // Configuration Register 1 (CONFIG1)
pub rx_addr: Port<u32>, // Receive (Rx) Buffer Start Address (RBSTART)
pub capr: Port<u16>, // Current Ad... | Rust | 0 |
carGameSet(obj: usize);
fn ReplayDirector_TA_SetGameEvent(obj: usize, InGameEvent: usize);
fn ReplayDirector_TA_EventFocusCarChanged(obj: usize, NewFocusCar: usize);
fn ReplayDirector_TA_EventAutoSaveChanged(obj: usize, Director: usize);
fn ReplayDirector_TA_EventScoreDataChanged(obj: usize, Director: u... | Rust | 0 |
)
);
}
pub const SHUT_RD: ::std::os::raw::c_uint = 0;
pub const SHUT_WR: ::std::os::raw::c_uint = 1;
pub const SHUT_RDWR: ::std::os::raw::c_uint = 2;
pub type _bindgen_ty_5 = ::std::os::raw::c_uint;
extern "C" {
pub fn socket(
__domain: ::std::os::raw::c_int,
__type: ::std::os::raw::c_i... | Rust | 0 |
import os
import httpx
from openai import OpenAI
class SafePromptGenerator:
def __init__(self, key, substitution_pool_size):
"""
Initialize
"""
self.key = key
self.substitution_pool_size = substitution_pool_size
self.client = OpenAI(api_key=key)
current_dir ... | Python | 1 |
def _make_pretrained_vitb16_384(pretrained, use_readout='ignore', hooks=
None, enable_attention_hooks=False):
model = timm.create_model('vit_base_patch16_384', pretrained=pretrained)
hooks = [2, 5, 8, 11] if hooks == None else hooks
return _make_vit_b16_backbone(model, features=[96, 192, 384, 768],
... | Python | 1 |
pressure_turfs {
if found_turfs.contains(&initial_turf) {
continue;
}
if let Some(initial_mix_ref) = turf_gases().get(&initial_turf) {
let mut border_turfs: VecDeque<(TurfID, TurfMixture)> = VecDeque::with_capacity(40);
let mut turfs: Vec<TurfMixture> = Vec::with_capacity(200);
let mut min_pressure = ... | Rust | 0 |
import unittest
from app.services.gmail.api import GmailAPI
class TestGmailAPI(unittest.TestCase):
def setUp(self):
# Remplacer par un email de test ou mock
self.api = GmailAPI(account_email="test@example.com")
def test_list_messages(self):
result = self.api.list_messages()
s... | Python | 1 |
crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [srs](index.html) module"]
pub struct SRS_SPEC;
impl crate::RegisterSpec for SRS_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns ... | Rust | 0 |
e / test_031);
rdf_test!(rdfms_rdf_names_use / test_032);
rdf_test!(rdfms_rdf_names_use / test_033);
rdf_test!(rdfms_rdf_names_use / test_034);
rdf_test!(rdfms_rdf_names_use / test_035);
rdf_test!(rdfms_rdf_names_use / test_036);
rdf_test!(rdfms_rdf_names_use / test_037);... | Rust | 0 |
d::Await)),
}
}
}
impl parse::Peek for Await {
fn peek(peeker: &mut parse::Peeker<'_>) -> bool {
matches!(peeker.nth(0), ast::Kind::Await)
}
}
impl macros::ToTokens for Await {
fn to_tokens(&self, _: &mut macros::MacroContext<'_>, stream: &mut macros::TokenStream) {
stream.push... | Rust | 0 |
# https://leetcode.com/problems/find-eventual-safe-states/
class Solution:
def eventualSafeNodes(self, graph: List[List[int]]) -> List[int]:
safe = {}
def dfs(node):
if node in safe: # Cycle found or previously checked
return safe[node]
safe[node] = Fa... | Python | 1 |
_c) => write!(f, "sub {}, {}, {}", reg_a, reg_b, reg_c),
And(dir_ind_reg_a, dir_ind_reg_b, reg) => write!(f, "and {}, {}, {}", dir_ind_reg_a, dir_ind_reg_b, reg),
Or(dir_ind_reg_a, dir_ind_reg_b, reg) => write!(f, "or {}, {}, {}", dir_ind_reg_a, dir_ind_reg_b, reg),
Xor(dir_ind_reg_a... | Rust | 0 |
OtghsrstR { bits: self._otghsrst() }
}
fn _ethmacrst(&self) -> u8 {
const MASK: u8 = 1;
const OFFSET: u8 = 25;
((self.bits >> OFFSET) & MASK as u32) as u8
}
# [ doc = "Bit 25 - Ethernet MAC reset" ]
pub fn ethmacrst(&self) -> EthmacrstR {
... | Rust | 0 |
self.logs[f"read_camera_{name}_dt_s"] = self.cameras[name].logs["delta_timestamp_s"]
self.logs[f"async_read_camera_{name}_dt_s"] = time.perf_counter() - now
# Populate output dictionnaries and format to pytorch
obs_dict = {}
obs_dict["observation.state"] = state
... | Python | 1 |
rrent_time - session_start_time if can_write and current_filename else 0
print(f"{elapsed_seconds:.1f}s|0,0,0,0|0,0,0|0,0,0|0,0,0|0,0,0")
# Write zeros to CSV as well if filesystem is writable
if can_write and current_filename:
csv_line = f"{session_ti... | Python | 1 |
_workflow_task_scheduled_and_started();
t
}
/// 1: EVENT_TYPE_WORKFLOW_EXECUTION_STARTED
/// 2: EVENT_TYPE_WORKFLOW_TASK_SCHEDULED
/// 3: EVENT_TYPE_WORKFLOW_TASK_STARTED
/// 4: EVENT_TYPE_WORKFLOW_TASK_COMPLETED
/// 5: EVENT_TYPE_TIMER_STARTED
/// 6: EVENT_TYPE_TIMER_FIRED
/// 7: EVENT_TYPE_WORKFLOW_TASK_S... | Rust | 0 |
ontrollerDesc<U>;
}
impl<U> BoxController for PxBoxController<U> {}
pub trait BoxController: Class<physx_sys::PxBoxController> + Controller {
/// Get the half forward extent.
fn get_half_forward_extent(&self) -> f32 {
unsafe { PxBoxController_getHalfForwardExtent(self.as_ptr()) }
}
/// Get th... | Rust | 0 |
c = "Hello"
b = "world!"
x = lambda x , y : x + y
print(x(c, b))
| Python | 1 |
>
""", unsafe_allow_html=True)
# Result message
if predicted_class == 'no_tumor':
st.markdown(f"""
<div class="success-message">
✓ No tumor detected. The scan appears normal.
... | Python | 1 |
angles_vertical(contents: &str) -> std::io::Result<Vec<Triangle>> {
let mut vecs = Vec::new();
for line in contents.lines() {
let sides: Vec<u64> = line.split_whitespace()
.map(|side| {
side.parse()
.map_err(|_| invalid_data(&format!("Bad side: {}", side))... | Rust | 0 |
.
fn is_at_end(&self) -> bool {
self.current >= self.source.len()
}
/// Scan the tokens, basically match everything known and returns an error if we can't
fn scan_token(&mut self) -> Result<Token, String> {
return match self.advance() {
'[' => Ok(self.token(TokenType::LeftBr... | Rust | 0 |
ResourceError};
use super::{TextureError, VertexArray};
pub type TextRendererComp = crate::WrapperComponent<TextRenderer>;
pub const TEXT_RENDERER_FILES: [(&str, &[u8]); 4] = [
("core/shaders/text.vert", include_bytes!("sdf-text.vert")),
("core/shaders/text.frag", include_bytes!("sdf-text.frag")),
("core/fonts/ha... | Rust | 0 |
# Copyright (c) 2020 Institution of Parallel and Distributed System, Shanghai Jiao Tong University
# ServerlessBench is licensed under the Mulan PSL v1.
# You can use this software according to the terms and conditions of the Mulan PSL v1.
# You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/M... | Python | 1 |
10;
#[test]
fn load_gif_non_looping_frame_first() {
let load_path = setup_test_image(GIF_NO_LOOP);
let config = ImportConfig {
selected_frame: FrameIndex::First,
};
let image = load_image(&mut file_reader(load_path).unwrap(), &config).unwrap();
// color =... | Rust | 0 |
def list_animals():
animals = ['Cat', 'Dog', 'Elephant', 'Frog']
for animal in animals:
print(animal)
def list_birds():
birds = ['Sparrow', 'Eagle', 'Parrot', 'Penguin']
for bird in birds:
print(bird)
if __name__ == "__main__":
list_animals()
print("\nBirds:")
list_birds()
| Python | 1 |
from vtkmodules.vtkFiltersSources import vtkConeSource
from vtkmodules.vtkInteractionStyle import vtkInteractorStyleSwitch # noqa
from vtkmodules.vtkRenderingCore import (
vtkActor,
vtkPolyDataMapper,
vtkRenderer,
vtkRenderWindow,
vtkRenderWindowInteractor,
)
from trame.app import get_server
from ... | Python | 1 |
range.end_bound()).cloned();
IterSubset(Some(match (&range.start, &range.end) {
(Start(Unbounded), End(Unbounded)) => IterSubsetInner::Full(self.iter()),
(Start(Unbounded), bounded_end) => IterSubsetInner::Partial {
before: None,
iter: self.map.range(..bo... | Rust | 0 |
from bolna.models import *
from bolna.agent_manager import AssistantManager
class Assistant:
def __init__(self, name = "trial_agent"):
self.name = name
self.tasks = []
def add_task(self, task_type, llm_agent, input_queue = None, output_queue = None, transcriber = None, synthesizer = None, enab... | Python | 1 |
ANT_MASS_LUMINOSITY_EXP)
}
}
pub fn color(&self) -> Color {
match self.class() {
StarClass::O => Color::rgba_u8(155, 176, 255, 1),
StarClass::B => Color::rgba_u8(170, 191, 255, 40),
StarClass::A => Color::rgba_u8(202, 215, 255, 100),
StarClass::F ... | Rust | 0 |
).map(|_| {
let pvt_key = ed25519_dalek::SecretKey::generate(&mut rand::thread_rng());
ed25519_dalek::PublicKey::from(&pvt_key)
}).collect::<Vec<ed25519_dalek::PublicKey>>();
let mut bytes = [0u8; 8];
bytes.copy_from_slice(&vec[0].as_bytes()[0..8]);
let v1 = u64::... | Rust | 0 |
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct _opaque_pthread_once_t {
pub __sig: ::std::os::raw::c_long,
pub __opaque: [::std::os::raw::c_char; 8usize],
}
impl ::std::default::Default for _opaque_pthread_once_t {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Copy)]
pu... | Rust | 0 |
s::begin().enable_depth().finish(),
)
.unwrap()
};
let vertex_shader = context
.try_create_vertex_shader(include_str!("vertex.glsl"))
.unwrap();
let fragment_shader = context
.try_create_fragment_shader(include_str!("fragment.glsl"))
.unwrap();
let pipe... | Rust | 0 |
>,
{
let node = traverse_single_must(node, path)?;
let itxt = inner_text(node)?;
Ok(T::from_str_optional(itxt)?)
}
#[cfg(test)]
mod test {
use chrono::{Datelike, Timelike};
use xml::Element;
const XML: &'static str = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<EnumerationResults \
... | Rust | 0 |
se dataloader::{cached::Loader, BatchFn};
use schema::courses::{courses_client::CoursesClient, GetAnchorsByPageIDsRequest};
use tonic::transport::Channel;
use crate::{entities::Anchor, errors::GatewayError};
async fn get_anchors_by_page_id(
map: &mut HashMap<i32, Vec<Anchor>>,
ids: Vec<i32>,
mut client: C... | Rust | 0 |
class Wrappers:
V1 = ".captcha-disable-scroll"
V2 = ".captcha-verify-container"
class RotateV1:
INNER = "[data-testid=whirl-inner-img]"
OUTER = "[data-testid=whirl-outer-img]"
SLIDE_BAR = ".captcha_verify_slide--slidebar"
SLIDER_DRAG_BUTTON = ".secsdk-captcha-drag-icon"
UNIQUE_IDENTIFIER = ... | Python | 1 |
types::DirectoryChromeosdevicesIssueCommandRequest,
) -> Result<crate::types::DirectoryChromeosdevicesIssueCommandResponse> {
let url = format!(
"/admin/directory/v1/customer/{}/devices/chromeos/{}/issueCommand",
crate::progenitor_support::encode_path(&customer_id.to_string()),
... | Rust | 0 |
(|| spooky::hash128_with_seed(&DATA[..size], SEED as u128));
})
.with_function("t1ha2::hash128_atonce", move |b, &&size| {
b.iter(|| t1ha2::Hash128AtOnce::hash_with_seed(&DATA[..size], SEED));
})
.with_function("xxh3::hash128", move |b, &&size| {
b.iter(|| xxh3::hash128_with_seed(&DATA[.... | Rust | 0 |
mut lexer);
assert!(assign.is_ok(), "Assign parse failed: {:?}", assign);
let assign = assign.unwrap();
let ast = Assign::new(
Identifier::new(String::from("a")),
Expression::Real(Real::new(5.0))
);
assert_eq!(assign, ast);
let obj = as... | Rust | 0 |
ad_dir(dir_path)?;
for entry in dir.into_iter().filter(|f| f.is_ok()).map(|f| f.unwrap()) {
let p = entry.path();
if p.is_dir() {
print_formula(&p)?
} else if entry.file_name().to_str().unwrap() == "Cask.toml" {
let f = formula::new(&p, "")?;
println!("... | Rust | 0 |
ses_np, dtype=torch.float32)
torch_res = torch_auto_orient_and_center_poses(poses_torch, method=method, center_method=center)
np_res = np_auto_orient_and_center_poses(poses_np, method=method, center_method=center)
torch_transform = torch_res.transform.numpy(force=True)
torch_oriented = torch_res.orient... | Python | 1 |
<String>,
}
impl layeredconf::LayeredConfSolid for TestSubConfig {
type Layer = TestSubConfigLayer;
}
impl layeredconf::LayeredConfLayer for TestSubConfigLayer {
type Config = TestSubConfig;
fn load_configs(&self) -> Vec<std::path::PathBuf> {
let mut load_configs = vec![];
load_configs
}... | Rust | 0 |
# Load the storage incase it's hosted remote
self.storage.load()
query_vector = self.embedding_model.embed(obj=query)
db_query = VectorDBQuery(query_vector=query_vector, top_k=top_k)
query_results = self.storage.query(query=db_query)
# If no results found, raise an error
... | Python | 1 |
0, # replaces_id
icon, # app_icon
title, # summary
message, # body
[], # actions
{}, # hints
timeout ... | Python | 1 |
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 1 |
!("http://127.0.0.1:{}", server.port()))
.unwrap();
(browser, tab)
}
#[test]
fn simple() -> Result<()> {
logging::enable_logging();
let (server, browser, tab) = dumb_server(include_str!("simple.html"));
tab.wait_for_element("div#foobar")?;
Ok(())
}
// NOTE: we disable this test for Mac, be... | Rust | 0 |
50/install.sh#L216
let clt_git_filepath = Path::new("/Library/Developer/CommandLineTools/usr/bin/git");
if clt_git_filepath.exists() {
return Ok(XcodeInstruments::XcTrace);
}
} else {
let instruments_app_filepath = Path::new("/usr/bin/instruments")... | Rust | 0 |
import requests
from datetime import datetime
api_url = "https://www.fema.gov/api/open/v2/DisasterDeclarationsSummaries?$filter=state eq 'FL' and substringof('MILTON', declarationTitle)"
def get_fema_data():
response = requests.get(api_url)
if response.status_code == 200:
data = response.json()
... | Python | 1 |
load_data_gt('./data/gt_2d/pack-valid-%d-%d-5-1-5/' % (blocks_num, num_samples), blocks_num, num_samples)
blocks, _ = load_data_rand('../data/rand_2d/pack-valid-%d-%d-7-1-5/' % (blocks_num, num_samples), blocks_num, num_samples)
ratio, positions, box_size, valid_size, box_size, empty_size, stable_num, pac... | Python | 1 |
).unwrap();
let source = rodio::Decoder::new(BufReader::new(file)).unwrap();
// rodio::play_raw(&device, source.convert_samples());
sink.set_volume(*volume);
sink.append(source);
sink.play();
found_sink = true;
... | Rust | 0 |
;
<filename>src/game/frontends/sdl/input.rs
use sdl2::Sdl;
use sdl2::event::Event;
use sdl2::keyboard::{self, Keycode, Mod};
use game::*;
#[derive(Clone)]
pub struct SdlInputSource {
sdl: Sdl,
}
impl SdlInputSource {
pub fn new(sdl: Sdl) -> Self {
SdlInputSource {
sdl: sdl,
}
... | Rust | 0 |
s.ietf.org/html/rfc2324)]
(418, IM_A_TEAPOT);
/// 421 Misdirected Request
/// [RFC7540, Section 9.1.2](http://tools.ietf.org/html/rfc7540#section-9.1.2)
(421, MISDIRECTED_REQUEST);
/// 422 Unprocessable Entity
/// [[RFC4918](https://tools.ietf.org/html/rfc4918)]
... | Rust | 0 |
import json
import logging
import time
import requests
logger = logging.getLogger()
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.DEBUG)
RATE = 1
delay = 1/RATE
def generator(file_path):
logger.debug(f"Opening file {file_path}")
with open(file_path, 'r') as f:
requests_list =... | Python | 1 |
t::new();
assert_eq!(expected, actual);
}
#[test]
fn capture_other_side() {
let pieces: HashMap<Coord, Player> = [
(Coord::of(0, 0), Player::BLACK),
(Coord::of(1, 0), Player::BLACK),
(Coord::of(2, 0), Player::BLACK),
(Coord::of(0, 1), Player::... | Rust | 0 |
about an image in the state.
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)]
pub struct ImageMetadata {
/// The image id
pub id: String,
/// The image reference, such as `docker.io/amd64/ubuntu`
pub reference: String,
/// The image digest
pub digest: String,
/// The imag... | Rust | 0 |
it()
class Bypass_Attribute(_Bypass):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.node._value = [getattr(self.node, "value"), getattr(self.node, "attr")]
@recursion_protect
def by_getattr(self):
return self.P9H(
f"getattr({self.P9H(self.... | Python | 1 |
from PIL import Image
from sys import argv
width = 80
height = 25
dark = False
img = Image.open(argv[1]).convert("RGB")
palette = [
(0x00, 0x00, 0x00),
(0x00, 0x00, 0x80),
(0x00, 0x80, 0x00),
(0x00, 0x80, 0x80),
(0x80, 0x00, 0x00),
(0x80, 0x00, 0x80),
(0x80, 0x80, 0x00),
(0xC0, 0xC0, 0... | Python | 1 |
-----|
| field | string | {{ _("对象的字段") }} |
| operator | string | {{ _("操作符, $eq为相等,$neq为不等,$in为属于,$nin为不属于") }} |
| value | string | {{ _("字段对应的值") }} |
""" # noqa
sys_name = configs.SYSTEM_NAME
api_type = API_TYPE_Q
host = configs.host
class Form(BaseComponent... | Python | 1 |
enabled interrupts or events can wakeup the processor, disabled interrupts are excluded.
1 = Enabled events and all interrupts, including disabled interrupts, can wakeup the processor.
When an event or interrupt becomes pending, the event signal wakes up the processor from WFE. If the
processor is not waiting... | Rust | 0 |
ontrol_flow_util.ENABLE_CONTROL_FLOW_V2 = True
return_value = control_flow_ops.cond(x < 50, lambda: x + 1, lambda: x * x)
control_flow_util.ENABLE_CONTROL_FLOW_V2 = previous_control_flow_v2_value
return return_value
dataset = dataset_ops.Dataset.range(100).apply(
batching.map_and_batch(ma... | Python | 1 |
f"[bold cyan]Размер репозитория:[/bold cyan] {round(int(r_repo.get('size')) / 1024, 1)} MB.\n" + \
f"[bold cyan]Github-рейтинг:[/bold cyan] {r_repo.get('watchers')} звёзд.\n" + \
f"[bold cyan]Скрытые опции:[/bold cyan]\n'... | Python | 1 |
/// It can be cloned and moved around independently.
pub fn close_handle(&self) -> PeerCloseHandle<Body> {
PeerCloseHandle {
command_tx: self.command_tx.clone(),
}
}
}
impl<Body> Clone for PeerWriteHandle<Body> {
fn clone(&self) -> Self {
let command_tx = self.command_tx.clone();
let _: Result<_, _> = co... | Rust | 0 |
llect::<Vec<_>>();
Superclass::new(enum_fullname, tyargs)
}
}
/// Returns signature of `.new` and `#initialize` of an enum case
fn enum_case_new_sig(
ivar_list: &[SkIVar],
typarams: &[ty::TyParam],
fullname: &ClassFullname,
) -> (MethodSignature, MethodSignature) {
let params = ivar_list
... | Rust | 0 |
# request_disk will have to be adjusted when skimming large data sets.
# For now, it is a low value so that condor jobs will start queueing
# more quickly.
condorSubTemplate="""
Executable = {path}/workingArea/skim_{name}.tcsh
Universe = vanilla
Output = {path}/workingArea/skim_out_{name}.txt
Error = {path}/workingA... | Python | 1 |
compose_file = PROJECT_ROOT / "docker-compose.yml"
if compose_file.exists():
import shutil
shutil.copy2(compose_file, backup_dir / "docker-compose.yml.backup")
# 導出 Kubernetes 配置(如果使用)
k8s_dir = PROJECT_ROOT / "k8s"
if k8... | Python | 1 |
ii, ...], all_void_masks)
return j_metrics_res, f_metrics_res
def _evaluate_unsupervised(all_gt_masks, all_res_masks, all_void_masks, metrics, max_n_proposals=20):
if all_res_masks.shape[0] > max_n_proposals:
sys.stdout.write(
f"\nIn your PNG files there is an index higher than the maximum... | Python | 1 |
'water jug', 'water tower', 'whiskey jug', 'whistle', 'wig', 'window screen', 'window shade', 'Windsor tie', 'wine bottle', 'wing', 'wok', 'wooden spoon', 'wool', 'worm fence', 'wreck', 'yawl', 'yurt', 'web site', 'comic book', 'crossword puzzle', 'street sign', 'traffic light', 'book jacket', 'menu', 'plate', 'guacam... | Python | 1 |
=0.1, color=colors[icl]
)
axes[idp, ift].plot(lls.index, lls.median(axis=1), marker="o", label=run_id, color=colors[icl])
axes[idp, ift].plot(lls.index, lls.iloc[:, 0:max_files_deep], color="k", lw=0.3)
axes[idp, ift].set_title(f"{nn}, {feature}")
axes[idp, if... | Python | 1 |
// match app.sensor_count(&device) {
// Ok(count) => {
// let range: Vec<crate::i2c::Result<(f64, crate::config::value::Unit)>> = (0..count)
// .into_iter()
// .map(|index| app.read_sensor(device.clone(), index))
// .collect();
// Ok(w... | Rust | 0 |
ontext: ForwardContext = get_forward_context()
self = forward_context.no_compile_layers[layer_name]
assert self.quant_method is not None
return self.forward_impl(hidden_states, router_logits)
def moe_forward_fake(hidden_states: torch.Tensor, router_logits: torch.Tensor,
layer_name: s... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.