text string | label_name string | labels int64 |
|---|---|---|
mut c_void
}
opencv_type_boxed! { Feature2D }
impl Drop for Feature2D {
fn drop(&mut self) {
extern "C" { fn cv_Feature2D_delete(instance: *mut c_void); }
unsafe { cv_Feature2D_delete(self.as_raw_mut_Feature2D()) };
}
}
impl Feature2D {
#[inline] pub fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw()... | Rust | 0 |
r) => r.write(output),
}
}
}
#[cfg(test)]
mod tests {
use quickcheck::{quickcheck, Arbitrary, Gen, TestResult};
use super::*;
static ANNOUNCE_REQUEST_PATH: &str = "/announce?info_hash=%04%0bkV%3f%5cr%14%a6%b7%98%adC%c3%c9.%40%24%00%b9&peer_id=-ABC940-5ert69muw5t8&port=12345&uploaded=0&downloa... | Rust | 0 |
"""Console script for {{cookiecutter.project_slug}}."""
{%- if cookiecutter.command_line_interface|lower == 'argparse' %}
import argparse
{%- endif %}
import sys
{%- if cookiecutter.command_line_interface|lower == 'click' %}
import click
{%- endif %}
{% if cookiecutter.command_line_interface|lower == 'click' %}
@clic... | Python | 1 |
from soda.contracts.data_contract_translator import DataContractTranslator
from soda.scan import Scan
import logging
import os
def run_dq_checks_for_transformation_stage():
# Correctly set the path to the project root directory
project_root_directory = os.path.dirname(os.path.dirname(os.path.dirname(os.path.ab... | Python | 1 |
count_stddev=0.0,
expected_num_records=2.0)
query = privacy_ledger.QueryWithLedger(
query, population_size, selection_probability)
# First sample.
tf.assign(population_size, 10)
tf.assign(selection_probability, 0.1)
_, global_state = test_utils.run_query(query, [record1, record2])
... | Python | 1 |
gm.leftSideBearing + gm.rightSideBearing)) as f32
* scaled_design_units_to_pixels;
let height = (gm.advanceHeight as i32 - (gm.topSideBearing + gm.bottomSideBearing)) as f32
* scaled_design_units_to_pixels;
let x = (-gm.leftSideBearing) as f32 * scaled_design_units_to_pixels;
let y = (gm.ver... | Rust | 0 |
from abc import ABC, abstractmethod
class IVectorStoreSaveLoad(ABC):
"""
Interface to abstract the ability to save and load the state of a vector store.
This includes saving/loading the vectorizer's model as well as the documents or vectors.
"""
@abstractmethod
def save_store(self, directory_... | Python | 1 |
hickness': 2.5,
'origin': [-100.0, -120.0, -80.0],
'orientation_matrix_3x3': np.eye(3).tolist()
}
viewer3d.update_volume(dummy_volume_data_zyx,
dummy_image_properties,
tumor_mask_full_zyx=dummy_tumor_mask_zyx,
... | Python | 1 |
on);
let contents: Vec<_> = db.iter(DEFAULT_COLUMN_NAME).collect();
assert_eq!(contents.len(), 2);
assert_eq!(&*contents[0].0, key1);
assert_eq!(&*contents[0].1, key1);
assert_eq!(&*contents[1].0, key2);
assert_eq!(&*contents[1].1, key2);
Ok(())
}
/// A test for `KeyValueDB::iter_from_pref... | Rust | 0 |
1u8;
let y = 2u32;
let z = 3f32;
// Unsuffixed literal, their types depend on how they are used
let i = 1;
let f = 1.0;
// `size_of_val` returns the size of a variable in bytes
println!("size of `x` in bytes: {}", std::mem::size_of_val(&x));
println!("size of `y` in bytes: {}", std::mem::size_of_val(... | Rust | 0 |
#!/usr/bin/env python
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import glob
import sys
linewidth = 2
fontsize = 17
marker ={ "CK" : "-"
, "IK" : "."
, "RK" : "-"
}
xlab = { "CK" : "Random Value ( Real / Imaginary ))"
, "IK" : "Random Value ( Integer )"
... | Python | 1 |
None,
multilayer_feature: bool = False,
layer: int = -1,
use_gpu: bool = True,
):
self.model = S3prlFrontend(
fs=fs,
frontend_conf=s3prl_conf,
download_dir=download_dir,
multilayer_feature=multilayer_feature,
layer=layer,
... | Python | 1 |
::Group::new(self.delimiter, self.stream.as_native());
g.set_span(self.span);
g
}
}
impl From<pm::Ident> for Ident {
fn from(p: pm::Ident) -> Self {
// XXXManishearth strip out and note down the r# of raw idents
let span = p.span();
let ident = p.to_string();
Sel... | Rust | 0 |
9652, 0)),
("SuchThat;", (8715, 0)),
("boxu", (0, 0)),
("middo", (0, 0)),
("vltr", (0, 0)),
("biguplus;", (10756, 0)),
("gtcir", (0, 0)),
("nGtv", (0, 0)),
("NotHump", (0, 0)),
("Hilber", (0, 0)),
("prsim;", (8830, 0)),
("colone;", ... | Rust | 0 |
res[2])? * self.witness(wires[3])?
+ q_c;
let output_var = self.create_variable(output_val)?;
let wires = [wires[0], wires[1], wires[2], wires[3], output_var];
self.insert_gate(
&wires,
Box::new(QuadPolyGate {
q_lc: *q_lc,
q_mu... | Rust | 0 |
angle.dtype)
mask_pi = torch.isclose(angle, torch.tensor(torch.pi), atol=1e-2).to(angle.dtype)
mask_else = (1 - mask_0) * (1 - mask_pi)
numerator = 0.5 * mask_0 + angle * mask_else
denominator = (
(1 - angle**2 / 6) * mask_0 + 2 * torch.sin(angle) * mask_else + mask_pi
)
rot_vec_not_pi... | Python | 1 |
let data_id = data_id_for_static(fx.tcx, fx.module, def_id, linkage);
let local_data_id = fx.module.declare_data_in_func(data_id, &mut fx.bcx.func);
#[cfg(debug_assertions)]
fx.add_comment(local_data_id, form... | Rust | 0 |
id=catalog_ids[parent_id]
))
for xv in cat.xvariables:
for p in xv.parents:
await xvar_parent_service.create(XVariableParent(
xvariable_id=xvar_ids[xv.xvid],
parent_xvariable_id=xvar_ids[p]
... | Python | 1 |
#!/usr/bin/env python3
"""Setup demo tenant and associate demo user."""
import asyncio
import asyncpg
import os
import uuid
from dotenv import load_dotenv
load_dotenv()
async def setup_demo_tenant():
"""Create demo tenant and associate demo user."""
db_url = os.getenv(
"DATABASE_URL", "postgresql://l... | Python | 1 |
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import sys
from airbyte_cdk.entrypoint import launch
from source_polygon_stock_api import SourcePolygonStockApi
def run():
source = SourcePolygonStockApi()
launch(source, sys.argv[1:])
| Python | 1 |
_2.json()
expected_error_1 = [
{
"type": "less_than_equal",
"loc": [
"query",
"month"
],
"msg": "Input should be less than or equal to 12",
"input": "13",
"ctx": {
"le": 12
... | Python | 1 |
[i].val <= auxiliary_array[j].val {
// When we select an element i on the left array,
// we know that elements selected previously from the right array jump from i's right to i's left.
// For each element i, records the number of elements jumping from i's right to i's left during the... | Rust | 0 |
nonce: &hex!("cc6966e9d81a298a561416d4"),
plaintext: &hex!("de68fb51731b45e7c2c5063923"),
aad: b"",
ciphertext: &hex!("f5be41f2c8c32e01098d433057"),
tag: &hex!("c82b1b012916ab6ed851d59829dad8ab"),
},
TestVector {
key: &hex!("<KEY>"),
nonce: &hex!("cfb2aec82cfa6c7d... | Rust | 0 |
from collections import defaultdict
def convert_adj_list(curr_word, word_list):
adj_list = defaultdict(set)
word_set = set(word_list) # Convert to set for O(1) lookups
def helper(parent_word, remaining_words):
if not remaining_words:
return
child_words = {word for word in re... | Python | 1 |
[rasn(tag(3))]
pub enc_part: EncryptedData,
}
#[derive(AsnType, Decode, Encode)]
#[rasn(tag(application, 3))]
pub struct EncTicketPart {
#[rasn(tag(0))]
pub flags: TicketFlags,
#[rasn(tag(1))]
pub key: EncryptionKey,
#[rasn(tag(2))]
pub crealm: Realm,
#[rasn(tag(3))]
pub cname: Prin... | Rust | 0 |
def maxSubArray(self, nums: List[int]) -> int:
# [-2,1,-3,4,-1,2,1,-5,4]
# 0 1 2 3 4 5 6 7 8
#
maxim = nums[0]
curr_max = 0
for i in range(len(nums)):
if curr_max < 0:
curr_max = 0
... | Python | 1 |
from django import template
#from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
import re
register = template.Library()
@register.filter
def highligt_yellow(text, value): #search, #autoscape= True
if text is not None:
text = str(text)
src_str = re.comp... | Python | 1 |
mps = temp_containers[0].find_all('span', class_='unit unit_temperature_c')
night_temps = temp_containers[1].find_all('span', class_='unit unit_temperature_c') if len(
temp_containers) > 1 else []
for i in range(min(7, len(dates))):
... | Python | 1 |
None => continue
};
if let Ok(file) = OpenOptions::new().read(true).open(path) {
info!("Found init file @ {:?}", path);
return Ok((path.clone(), file))
}
}
Err(io::Error::new(io::ErrorKind::NotFound, "No configuration file found"))
}
pub fn log_error(err: rlua::E... | Rust | 0 |
output: Output,
op: ir::ArithmeticOp,
left: Input,
right: Input,
},
Decider {
output: Output,
op: ir::DeciderOp,
left: Input,
right: Input,
mode: DeciderMode,
},
Lamp {
op: ir::DeciderOp,
left: Input,
right: Input,
... | Rust | 0 |
def special_factorial(n):
"""The Brazilian factorial is defined as:
brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!
where n > 0
For example:
>>> special_factorial(4)
288
The function will receive an integer as input and should return the special
factorial of this integer.
... | Python | 1 |
) {
let conversion_result: IonResult<Decimal> = value.try_into();
assert!(conversion_result.is_err());
}
#[test]
fn test_convert_to_big_decimal() {
let decimal = Decimal::new(-24601, -3);
let big_decimal: BigDecimal = decimal.try_into().unwrap();
let double = big_dec... | Rust | 0 |
import numpy as np
import numba as nb
from numpy.random import PCG64
from timeit import timeit
bit_gen = PCG64()
next_d = bit_gen.cffi.next_double
state_addr = bit_gen.cffi.state_address
def normals(n, state):
out = np.empty(n)
for i in range((n + 1) // 2):
x1 = 2.0 * next_d(state) - 1.0
x2 =... | Python | 1 |
eq!(solution(2), 5);
}
#[test]
fn test_day_3() {
assert_eq!(solution(3), 9);
}
}<reponame>dmrolfs/egress-proxy
pub mod proxy;
pub mod metrics;use crate::device::Device;
use ash::{version::DeviceV1_0, vk};
use std::sync::Arc;
pub struct RenderPass {
device: Arc<Device>,
pub vk: vk::Render... | Rust | 0 |
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u32) & 0x0f) << 12);
self.w
}
}
#[doc = "Reader of field `Delay4`"]
pub type DELAY4_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `Delay4`"]
pub struct DELAY4_W<'a> {
w: &'a mu... | Rust | 0 |
o
[a$ @ sT d Z ddlZddlZddlmZ ddlmZ ddlmZ dd Z G dd d eZ
dS )
zBdistutils.command.build
Implements the Distutils 'build' command. N)Command)DistutilsOptionError)get_platformc C s ddl m} | d S )Nr show_compile... | Python | 1 |
#!/usr/bin/env python3
"""
Debug XML extraction from PBO files
"""
import sys
import os
import tempfile
sys.path.append('src')
from parsers.pbo_parser import PBOParser
from parsers.xml_parser import XMLParser
def debug_xml_extraction():
"""Debug why XML files aren't being found in extracted PBO content."""
... | Python | 1 |
_height(40.),
)
.border(Color::rgb8(0xcc, 0xcc, 0xcc), 1.);
let gallery_list = GridView::new(image_gridview_builder)
.wrap()
.with_spacing(30.)
.padding(20.);
let layout = Flex::column()
.with_child(menu_btns)
.with_child(gallery_list)
.cross_axis_alignme... | Rust | 0 |
"""
Data models for the Open-Meteo Weather MCP Server.
This module contains all Pydantic models used for structured data representation
in the weather API responses.
"""
from typing import List
from pydantic import BaseModel
class CurrentWeather(BaseModel):
"""Current weather conditions"""
latitude: float
... | Python | 1 |
# The implementation is modified from ErenBalatkan/Bts-PyTorch
# made publicly available under the MIT license
# https://github.com/ErenBalatkan/Bts-PyTorch/blob/master/BTS.py
import torch.nn as nn
import torchvision.models as models
class Encoder(nn.Module):
def __init__(self, pretrained=False):
super(... | Python | 1 |
"""
Check out this website for the entire Unicode characters list:
http://unicode-table.com
"""
import config
# Python 2 and 3 compatibility: chr(n) in Python3, unichr(n).encode('utf-8') in Python2.
try:
# Note: exceptions raised by the lambda function are not caught by the next `except` clause,
# so we first... | Python | 1 |
# ------------------------------------------------------------------------
# PoET: Pose Estimation Transformer for Single-View, Multi-Object 6D Pose Estimation
# Copyright (c) 2022 Thomas Jantos (thomas.jantos@aau.at), University of Klagenfurt - Control of Networked Systems (CNS). All Rights Reserved.
# Licensed under ... | Python | 1 |
#!/usr/bin/python3
"""this module defines a Rectangle subclass Square"""
Rectangle = __import__('9-rectangle').Rectangle
class Square(Rectangle):
"""Represent a square"""
def __init__(self, size):
"""Initialize a new square
"""
self.integer_validator("size", size)
super().__in... | Python | 1 |
replace("[","").replace("]","").replace("\"", "");
return format!("?username={}&token={}", username, token);
}
pub static mut FULL_LIST: Option<crate::json::mod_list::FullList> = None;
pub fn get_all_mods() -> bool {
println!("Downloading mod list ...");
unsafe {
if FULL_LIST.is_none() {
... | Rust | 0 |
0xa2,0x36,0x29,0x59,0xa1,]
},
Aes128Test {
key: [0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,],
pt: [0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,0xfa,],
ct: [0xdb,0xb5,0x8b,0xad,0x9e,0x3c,0x29,0x66,0x9e,0x9e,0x14,0x65,0xa... | Rust | 0 |
_CONSTRAIN_WORLD_0_PWR_R::new(((self.bits >> 28) & 0x03) as u8)
}
#[doc = "Bits 26:27"]
#[inline(always)]
pub fn sensitive_core_0_pif_pms_constrain_world_0_wifimac(
&self,
) -> SENSITIVE_CORE_0_PIF_PMS_CONSTRAIN_WORLD_0_WIFIMAC_R {
SENSITIVE_CORE_0_PIF_PMS_CONSTRAIN_WORLD_0_WIFIMAC_R... | Rust | 0 |
d, id, t = int(line[0]), str(line[1]), line[2:]
feature = Feature([(int(t[i]), float(t[i + 1]))
for i in range(0, len(t) - 1, 2)])
self.theta.add(id, feature)
self.corpus.features['topics'] = self.theta
return self.theta
... | Python | 1 |
from ralph.access_cards.models import AccessCard, AccessZone
from ralph.accounts.api import RalphUserSimpleSerializer, RegionSerializer
from ralph.api import RalphAPISerializer, RalphAPIViewSet, router
class AccessZoneSimpleSerializer(RalphAPISerializer):
class Meta:
model = AccessZone
depth = 0
... | Python | 1 |
"""
:mod:`pytracelog` -- Пакет для логирования и трассировки
===================================
.. moduleauthor:: Aleksey Guzhin <a-guzhin@it-serv.ru>
"""
__appname__ = 'pytracelog'
__author__ = 'Iserv'
__contact__ = 'info@it-serv.ru'
| Python | 1 |
GDK_MODIFIER_RESERVED_14_MASK")]
const MODIFIER_RESERVED_14_MASK = ffi::GDK_MODIFIER_RESERVED_14_MASK as u32;
#[doc(alias = "GDK_MODIFIER_RESERVED_15_MASK")]
const MODIFIER_RESERVED_15_MASK = ffi::GDK_MODIFIER_RESERVED_15_MASK as u32;
#[doc(alias = "GDK_MODIFIER_RESERVED_16_MASK")]
... | Rust | 0 |
i_hex.clone();
let c_s_hex = gamma_hex.split_off(33);
let mut c_hex = c_s_hex.clone();
c_hex.split_off(16);
let expected_gamma = EcPoint::from_bytes(&ecdsa.group, &gamma_hex, &mut ecdsa.bn_ctx).unwrap();
let expected_c = BigNum::from_slice(c_hex.as_slice()).unwrap();
ass... | Rust | 0 |
Readable for PLL_VIDEO_TOG {}
#[doc = "`write(|w| ..)` method takes [pll_video_tog::W](pll_video_tog::W) writer structure"]
impl crate::Writable for PLL_VIDEO_TOG {}
#[doc = "Analog Video PLL control Register"]
pub mod pll_video_tog;
#[doc = "Numerator of Video PLL Fractional Loop Divider Register\n\nThis register you ... | Rust | 0 |
[u8; break]>::new(); //~ ERROR [E0268]
}
<reponame>extraymond/sdk
/*
* Ory APIs
*
* Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
*
* The version of the OpenAPI document: v0.0.1-alpha.... | Rust | 0 |
output: \"[\'\u{1}\u{2}\u{3}\u{4}\u{5}\u{6}\u{7}\u{8}\t\']\";\
\n}\
\n"
);
}
// From "sass-spec/spec/parser/interpolate/16_escapes_single_quoted_numbers/03_inline_double.hrx"
#[test]
fn t03_inline_double() {
assert_eq!(
rsass(
".result {\
\n output: #{#{\'\\1\\2... | Rust | 0 |
#[doc = "Port 1 Interrupt Edge Select"]
pub mod p1ies;
#[doc = "Port 1 Interrupt Enable\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::m... | Rust | 0 |
import unittest
from unittest import mock
from django.contrib.gis.gdal import Driver, GDALException
valid_drivers = (
# vector
"ESRI Shapefile",
"MapInfo File",
"TIGER",
"S57",
"DGN",
"Memory",
"CSV",
"GML",
"KML",
# raster
"GTiff",
"JPEG",
"MEM",
"PNG",
)
... | Python | 1 |
# Generated by Django 4.2 on 2025-09-05 07:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("telebot", "0009_alter_videogeneration_options_and_more"),
]
operations = [
migrations.AddField(
m... | Python | 1 |
) mstatus);
mstatus
}
}
pub fn get_mcause() -> usize {
let mcause: usize;
unsafe { asm!("csrr {}, mcause", out(reg) mcause) };
mcause
}
use actix::prelude::*;
// ---- Actor ----
pub struct CountActor(pub u32);
impl Actor for CountActor {
type Context = Context<Self>;
}
// ---- Messages ... | Rust | 0 |
6, 8);
cf1.insert(&13).unwrap();
assert!(cf1.query(&13));
let cf2 = cf1.clone();
cf1.insert(&42).unwrap();
assert!(cf2.query(&13));
assert!(!cf2.query(&42));
}
#[test]
fn with_properties_4() {
let cf = CuckooFilter::<u64, ChaChaRng>::with_properties_... | Rust | 0 |
from functools import partial
from pathlib import Path
import hydra
from hydra.utils import instantiate
from omegaconf import DictConfig
import torch
from agent import Agent
from envs import SingleProcessEnv, WorldModelEnv
from game import AgentEnv, EpisodeReplayEnv, Game
from models.actor_critic import ActorCritic
... | Python | 1 |
ew)
return render(
request,
"reviews/instance-form.html",
{
"form": form,
"instance": review,
"model_type": "Review",
"related_instance": book,
"related_model_type": "Book",
},
)
def book_media(request, pk):
book ... | Python | 1 |
ack()` operation is
/// *O*(log *n*) time, so this currently provides no performance
/// advantage over `pop_max()` and `pop_min()`.
///
/// This type is created with
/// [`MinMaxHeap::drain_desc`](struct.MinMaxHeap.html#method.drain_desc).
#[derive(Debug)]
pub struct DrainDesc<'a, T: 'a>(&'a mut MinMaxHeap<T>);
impl<... | Rust | 0 |
.map(|arg| arg == "evil" || arg == "for-filipe")
.unwrap_or(false);
Args { evil_mode }
};
}
use core::borrow::Borrow;
use core::cmp::{
Ord,
Ordering::{Equal, Greater},
};
use core::hash::{BuildHasher, Hash, Hasher};
use core::mem::ManuallyDrop;
use core::ops::Deref;
use cor... | Rust | 0 |
u(lens)
self.predictor.run()
preds = self.output_handle.copy_to_cpu()
if args.benchmark:
self.autolog.times.stamp()
preds = [pred[1:] for pred in preds]
all_preds.append(preds)
all_lens.append(lens)
start_idx += self.b... | Python | 1 |
>().unwrap();
instruction.reduce(-50..=50);
instruction
})
.into_iter()
.fold(HashSet::new(), |mut cubes, instruction| {
for x in instruction.x.clone() {
for y in instruction.y.clone() {
for z in instruction.z.clone() {
... | Rust | 0 |
ref name, .. } => name.clone(),
Monitor::Expression { ref name, .. } => name.clone(),
Monitor::AnomalyDetection { ref name, .. } => name.clone(),
}
}
}
/// Monitor types
#[derive(PartialEq, Copy, Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum Mon... | Rust | 0 |
(float): FPS of the output video.
fourcc (str): Fourcc of the output video, this should be compatible
with the output file type.
filename_tmpl (str): Filename template with the index as the variable.
start (int): Starting frame index.
end (int): Ending frame index.
sh... | Python | 1 |
_add(extra);
result.copy_from_slice(&res2.to_le_bytes());
}
32 => {
let l = conver_to_i512(E256::get(lhs));
let r = E512::from(rhs);
let extra = E512::get(result);
let (res, _) = l.overflowing_mul_s(r);
let (res2, _) = res.overflow... | Rust | 0 |
Field(
1,
title="Width Step Size",
description="The step size in pixels for adjusting frame width.",
examples=[1, 2, 10],
)
min_fps: float = Field(
...,
description="The minimal frame rate of the camera mode, measured in frames per second (fps).",
example... | Python | 1 |
write!(&mut file, ";\n\n").unwrap();
// By number.
let mut by_num = phf_codegen::Map::new();
json.by_num.iter().for_each(|(num, rust_code)| {
by_num.entry(*num, rust_code.as_str());
});
write!(&mut file, "/// Map errno number to information about errno code.\n").unwrap();
write!(
... | Rust | 0 |
r(){
nexx_.push(Point3D::new(atoms[*pp].get_x(),atoms[*pp].get_y(),atoms[*pp].get_z()));
}
let mut nexx:Vec<&mut dyn Vector3D> = vec![];
for nn in nexx_.iter_mut(){
nexx.push(nn);
... | Rust | 0 |
let speed = self.format_speed(speed);
if self.are_extra_messages_enabled() {
self.dispatch_top_message(&format!("Translation camera speed: {}", speed));
}
self.catch_error(dispatch_event_with(&self.event_bus, "back2front:change_movement_speed", &speed.into()));
}
fn d... | Rust | 0 |
_depth: 1.0,
};
let scissor = vk::Rect2D {
extent: dimension.clone(),
offset: vk::Offset2D { x: 0, y: 0 },
};
// Start the first sub pass specified in our default render pass setup by the base class.
// This will clear the col... | Rust | 0 |
"Other")]
// Generate a funciton on Pallet to deposit an event.
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
/// doc comment put in metadata
// `<T as frame_system::Config>::AccountId` is not defined in metadata list, the last
// Thus the metadata is `<T as frame_system... | Rust | 0 |
rt_eq!(
config.doc.to_string(),
r#"
# test configuration file
apply = ["PATH", "source"]
[templates]
prompt = { value = 'ln -sf "{{ file }}" "{{ data_dir }}/functions/prompt_{{ name }}_setup"', each = true }
# yes this is the pure plugin
[plugins.pure]
github = "sindresorhus/pure"
apply = ["pr... | Rust | 0 |
TRUSTED_PEERS_PATH.into(),
}
}
}
pub mod prelude {
//! Re-exports important traits and types. Meant to be glob imported when using `Iroha`.
#[doc(inline)]
pub use iroha_crypto::{Hash, KeyPair, PrivateKey, PublicKey, Signature};
#[doc(inline)]
pub use crate::{
block::{
... | Rust | 0 |
#####################################
# Author: Matteo Nerini #
# Email: m.nerini20@imperial.ac.uk #
# Date: June 2020 #
#####################################
# Import
from datetime import datetime
import subprocess
import csv
# Options
num_scenarios = 1 # how many scenarios a... | Python | 1 |
W) -> io::Result<()> {
self.pdf_sum.write_lhe(writer)?;
self.dip_map.write_lhe(writer)?;
self.jet_algo.write_lhe(writer)
}
}
#[cfg(test)]
impl Arbitrary for InitExtraRS {
fn arbitrary<G: Gen>(gen: &mut G) -> InitExtraRS {
InitExtraRS {
pdf_sum: Arbitrary::arbitrary(g... | Rust | 0 |
tch: &mut Vec<u8>,
max_gas: Uint256,
gas_price_bid: Uint256,
to_addr: Uint256,
value: Uint256,
calldata: Vec<u8>,
wallet: &Wallet,
) -> Vec<u8> {
let (msg, tx_id_bytes) = self.make_compressed_and_signed_l2_message(
gas_price_bid,
max_ga... | Rust | 0 |
})
}
}
#[allow(non_upper_case_globals)]
pub fn should_close(&self) -> bool {
let mut should_we = false;
unsafe {
let count = (self.xlib.XPending)(self.display);
for _ in 0..count {
let mut event: xlib::XEvent = mem::uninitialized();
... | Rust | 0 |
"""
19-mavzudagi darsada kerak bo'ladigan funksiyalar kodi
"""
def avto_royxat(modeli, rangi, kompanyasi, yurgani, yili, narxi = None ) :
royxat = {
'Modeli' : modeli,
'Rangi': rangi,
'Kompanyasi' : kompanyasi,
'Yurgan yo\'li' : yurgani ,
'Chiqarilgan' : yili,
'Nar... | Python | 1 |
story {
if h.released {
withdrawable_amount += v.stluna_amount * h.stluna_withdraw_rate
+ v.bluna_amount * h.bluna_withdraw_rate;
deprecated_batches.push(user_batch);
}
}
}
Ok((withdrawable_amount, deprecated_batches))
}
/// Re... | Rust | 0 |
import json
from .oauth import BaseAuthUrlTestMixin, OAuth2Test
class PinterestOAuth2Test(OAuth2Test, BaseAuthUrlTestMixin):
backend_path = "social_core.backends.pinterest.PinterestOAuth2"
user_data_url = "https://api.pinterest.com/v1/me/"
expected_username = "foobar"
access_token_body = json.dumps({... | Python | 1 |
rbidden:
self.logger.warning(f"无法在论坛 '{forum.name}' 中搜索归档帖子,权限不足。")
return None
# --- 核心每日任务逻辑 ---
async def daily_forum_management(self, guild_id: int):
"""每日任务的主体,由tasks.loop调用。"""
# 从 task 对象获取 guild_id
guild = self.bot.get_guild(guild_id)
if not guild:
... | Python | 1 |
stored
cpu.run_cycle(KEYS); // Run next instruction
assert_eq!(cpu.waiting_for_key, false);
assert_eq!(cpu.pc, 0xaaa);
}
#[test]
fn ram_write() {
let mut cpu = Processor::initialize();
for i in 0..16 {
cpu.v[i] = 7;
}
cpu.idxr = 0x300;
... | Rust | 0 |
path.startswith("/api/v1/iac/generate"):
project_name = request_data.get("project_name", "example")
requirements = request_data.get("requirements", "Not specified")
infrastructure_code = f"""# Generated Infrastructure Code
# Requirements: {requirements}
resource "proxmox_vm_qemu" "... | Python | 1 |
Error::<T>::ServiceDoesNotExist)
}
let mut service = service.unwrap();
if service.owner_id != owner_id.clone() {
return Err(Error::<T>::NotServiceOwner)
}
// Calculate total price
let mut service_info_mut = service_info.clone();
for (idx, price_by_currency) in service_info.prices_by_currency.iter().e... | Rust | 0 |
else:
foundMethods.append(m)
try:
self.assertListEq(foundMethods, actualMethods, ignore)
self.assertEqual(py_item.__module__, value.module)
self.assertEqualsOrIgnored(py_item.__name__, value.name,
... | Python | 1 |
env::remove_var(AWS_SESSION_TOKEN);
assert!(result.is_ok());
let creds = result.ok().unwrap();
assert_eq!(creds.aws_access_key_id(), "id");
assert_eq!(creds.aws_secret_access_key(), "secret");
assert_eq!(creds.token(), &Some("token".to_string()));
}
#[test]
fn get_no... | Rust | 0 |
window.set_focus();
}
}
}
}
_ => (),
}
});
}
// System tray isn't supported on other's platforms.
#[cfg(not(any(target_os = "windows", target_os = "linux", target_os = "macos")))]
fn main() {
println!("This platform doesn't support system_tray.");
}
// Tr... | Rust | 0 |
# ContentDB
# Copyright (C) 2018-21 rubenwardy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program... | Python | 1 |
from typing import Union
import redis
import os
import json # For potentially storing structured data
# Configuration (adjust host, port, db if needed)
REDIS_HOST = os.environ.get("REDIS_HOST", "localhost")
REDIS_PORT = int(os.environ.get("REDIS_PORT", 6379))
REDIS_DB = int(os.environ.get("REDIS_DB", 0))
# Create th... | Python | 1 |
NAME: u32 = 32u32;
#[doc = "*Required features: `\"Win32_Globalization\"`*"]
pub const MAX_MIMECP_NAME: u32 = 64u32;
#[doc = "*Required features: `\"Win32_Globalization\"`*"]
pub const MAX_MIMECSET_NAME: u32 = 50u32;
#[doc = "*Required features: `\"Win32_Globalization\"`*"]
pub const MAX_MIMEFACE_NAME: u32 = 32u32;
#[d... | Rust | 0 |
ft + w] = _get_pixels(
self.per_pixel, self.rand_color, (chan, h, w),
dtype=dtype)
break
return img
def __call__(self, x):
"""RandomErasing apply"""
if len(x.shape) == 3:
output = self._erase(x, *x.s... | Python | 1 |
import pandas as pd
import requests
from google.cloud import storage, bigquery
import os
from dotenv import load_dotenv
load_dotenv()
bucket = os.environ.get('BUCKET')
project = os.environ.get('PROJECT')
dataset = os.environ.get('DATASET')
table = os.environ.get('TABLE')
api_key = os.environ.get('API_KEY')
url = "ht... | Python | 1 |
Vec2b, core::CV_8U, 2);
data_type!(core::Vec3b, core::CV_8U, 3);
data_type!(core::Vec4b, core::CV_8U, 4);
data_type!(core::Vec2<i8>, core::CV_8S, 2);
data_type!(core::Vec3<i8>, core::CV_8S, 3);
data_type!(core::Vec4<i8>, core::CV_8S, 4);
data_type!(core::Vec2<u16>, core::CV_16U, 2);
data_type!(core::Vec3<u16>, core::CV... | Rust | 0 |
#!/usr/bin/env python3
"""
Test script for the improved Claude CLI direct prompting functionality.
This script tests the improved prompt_claude_directly function which now handles
the "(no content)" case by falling back to non-JSON mode.
"""
import sys
import os
import logging
import json
from pathlib import Path
# ... | Python | 1 |
#!/usr/bin/env python
import os, json, sys
from vtkmodules.vtkIOImage import vtkJSONImageWriter
from vtkmodules.vtkImagingCore import vtkRTAnalyticSource
args = sys.argv[1:]
temp_dir = args[args.index("-T") + 1]
# Always use / to prevent windows/python issue with backslash
tmp_file = temp_dir + '/wavelet_slice_3.json... | Python | 1 |
image size
# Dataloader
bs = 1 # batch_size
if webcam:
view_img = check_imshow(warn=True)
dataset = LoadStreams(source, img_size=imgsz, stride=stride, auto=pt, vid_stride=vid_stride)
bs = len(dataset)
elif screenshot:
dataset = LoadScreenshots(source, img_size=imgsz, s... | Python | 1 |
on_complete<PIN: Channel<ADC, ID = u8>>(_adc: &mut Adc, _pin: &mut PIN) {}
fn on_stop<PIN: Channel<ADC, ID = u8>>(adc: &mut Adc, pin: &mut PIN) {
adc.disable_interrupts(pin);
adc.disable_freerunning();
}
}
impl<C> InterruptAdc<C>
where
C: ConversionMode,
{
pub fn service_interrupt_rea... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.