text string | label_name string | labels int64 |
|---|---|---|
errno, Errno};
use libc;
use sgx_types::*;
use utils::cstr_len;
use ENCLAVE;
extern "C" {
fn sgx_wasm(
eid: sgx_enclave_id_t,
retval: *mut sgx_status_t,
wasmt_ptr: *const u8,
wasmt_len: usize,
arguments_ptr: *const u8,
arguments_len: usize,
result_ptr: *mut ... | Rust | 0 |
(10)
if loczb:
x=loczb[0]+10
y=loczb[1]+10
# 移动鼠标到元素的中心位置
pyautogui.moveTo(x, y, duration=0.1)
# 鼠标按下
pyautogui.mouseDown()
pyauto... | Python | 1 |
]:
image = utils.common_upscale(image.to(device), noise.shape[-1], noise.shape[-2], "bilinear", "center")
noise_level = torch.tensor([noise_level], device=device)
if noise_augment > 0:
image, noise_level = self.noise_augmentor(image.to(device), noise_level=noise_level, seed=seed... | Python | 1 |
#[doc = "Output toggle"]
#[inline(always)]
pub fn toggle(self) -> &'a mut W {
self.variant(OUTTGL0_AW::TOGGLE)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
... | Rust | 0 |
from django.urls import path, include
from . import views
from JobOffers.views import JobOfferGP, JobOfferGPD, apply, deleteApplicationByCandidateIdAndJobOfferId, deleteApplicationById, get_unread_notifications, getApplicationByCandidateIdAndJobOfferId, getApplicationCandidates, getApplications, getJobOffersByRecruiter... | Python | 1 |
from django.urls import path
from . import views
urlpatterns = [
path('stores/<int:id>/', views.StoreDetialView.as_view()),
path('staff/<int:store_id>/', views.StoreDetialView.as_view()),
path('store/staff/<int:store_id>/', views.StoreStaffList.as_view()),
path('stores/', views.StoresList.as_view()),
]... | Python | 1 |
entBegin(0x00)
FadeOut(0, 0, -1)
ChrSetPos(0x012A, -25710, -500, 6350, 158)
ChrSetPos(0x0129, -26570, -500, 5830, 143)
ChrSetPos(0x0146, -26910, -500, 4600, 90)
ChrSetPos(0x0102, -25290, -500, 3650, 0)
CameraMove(-25995, -500, 5000, 0)
OP_67(0, 6000, -10000, 0)
CameraSetDistance(3000, 0)... | Python | 1 |
12);
// gdb-command: s
// gdb-check:[...]match (a, b) {
// gdb-command: s
// gdb-check:[...](_, _) => 5
// gdb-command: s
// gdb-check:[...]}
// gdb-command: s
// gdb-check:[...]match_tuple(42, 12);
// gdb-command: s
// gdb-check:[...]match (a, b) {
// gdb-command: s
// gdb-check:[...](42, 12) => 1,
// gdb-comma... | Rust | 0 |
table = Table("foo", "bar", "baz")
table.add_row("1", "2", "3")
progress_renderables = [
"Text may be printed while the progress bars are rendering.",
Panel("In fact, [i]any[/i] renderable will work"),
"Such as [magenta]tables[/]...",
table,
"Pretty printed structure... | Python | 1 |
legend':list(errors.keys())}
self.plot_data['X'].append(epoch + counter_ratio)
self.plot_data['Y'].append([errors[k] for k in self.plot_data['legend']])
self.vis.line(
X=np.stack([np.array(self.plot_data['X'])]*len(self.plot_data['legend']),1),
Y=np.array(self.plot_data['... | Python | 1 |
current_month_date, -1)
issue = make_issue(current_month_date, "__Test Customer", 2, "High", "Bug")
add_assignment({"assign_to": ["test@example.com"], "doctype": "Issue", "name": issue.name})
issue = make_issue(last_month_date, "__Test Customer", 2, "Low", "Bug")
add_assignment({"assign_to": ["test1@example.com"]... | Python | 1 |
&factors);
should_be_all_bytes_from_256_to_511_but_as_polys
.iter()
.map(|p| {
usize::from_be_bytes(
p.to_bytes(std::mem::size_of::<usize>() as i64)
.as_ref()
.unwrap()
.as_slice(... | Rust | 0 |
attribute::<Vector3<f64>>(&POSITION_3D) {
if !is_finite(&point) {
continue;
}
// only compute the covariance matrix for finite points
let mut diff_mean = Vector3::<f64>::zeros();
// calculate difference from the centroid for each point
... | Rust | 0 |
estns testns {protected}
{pkgname} 1.0.1 replicationcontroller kube-ui testns {deleted}
{pkgname} 1.0.1 service kube-ui testns {deleted}\n""".format(pkgname=pkgname,
protected=color... | Python | 1 |
", target_os = "freebsd"))]
IFF_STATICARP;
/// Address from stateless addrconf.
#[cfg(any(target_os = "illumos", target_os = "solaris"))]
IFF_ADDRCONF;
/// Interface is in polling mode.
#[cfg(any(target_os = "dragonfly"))]
IFF_NPOLLING;
/// Router on inter... | Rust | 0 |
# -*- coding: utf-8 -*-
# Taken from https://stackoverflow.com/a/31505798
import re
def split(text):
caps = "([A-Z])"
prefixes = "(Mr|St|Mrs|Ms|Dr)[.]"
suffixes = "(Inc|Ltd|Jr|Sr|Co)"
starters = "(Mr|Mrs|Ms|Dr|He\s|She\s|It\s|They\s|Their\s|Our\s|We\s|But\s|However\s|That\s|This\s|Wherever)"
acrony... | Python | 1 |
import pytest
from repositories.task_repository import TaskRepository
from db.models.task import Task
@pytest.fixture
def repo():
class TestTaskRepository(TaskRepository):
def __init__(self):
super().__init__()
self.model = Task
return TestTaskRepository()
def test_get_by_pr... | Python | 1 |
64> + ToFloat<f64> + Clone,
I: Sub<Output = I> + Add<Output = I> + PartialOrd + FromFloat<f64> + ToFloat<f64> + Clone,
SE: Scale<E>,
SI: Scale<I>,
{
fn external_max(&self) -> E {
self.0.max()
}
fn external_min(&self) -> E {
self.0.min()
}
fn internal_max(&self) -> I {
... | Rust | 0 |
poisson_flux=False)
print(img.added_flux)
np.testing.assert_allclose(img.added_flux, flux, rtol=2.e-3)
img = obj.drawImage(bandpass, nx=25, ny=25, scale=0.2, method='phot', rng=rng)
print(img.added_flux)
assert abs(img.added_flux - flux) > 0.1
# Flux_scale
psf = galsim.ChromaticObject... | Python | 1 |
") {
Some(profile) => profile.to_owned(),
None => profile
}
},
None => "unconfined".to_owned()
}
}
};
//println!("apparmor_profile: {}", apparmor_profile);
let attr_current_fd = if apparmor_profile == "unconfined" {
None
} else {
Some(open_for... | Rust | 0 |
ply_buffer).unwrap();
let mut plain_buffer = [0u8; 256];
let reply_plain = client_reply_handler
.decrypt_reply(reply, &mut plain_buffer)
.unwrap();
assert_eq!(reply_plain, b"foobar");
}
use mitrid_core::io::Client as ClientBase;
use crypto::Digest;
use io::Address;
use io::ClientTransport;... | Rust | 0 |
quad),
};
}
if discriminant < T::zero() {
return NoIntersect;
}
let (sol1, sol2) = quadratic_solutions(a_quad, b_quad, c_quad, discriminant);
let (t0, t1) = min_max(sol1, sol2);
TwoIntersects { t0, t1 }
}
<reponame>SomewhatML/match-compile
use super::*;
use std::cell::Cell;
t... | Rust | 0 |
implements DOMEventTarget;
match fn {
type_ => || ffi::webkit_dom_entity_reference_get_type(),
}
}
impl DOMEntityReference {}
pub const NONE_DOM_ENTITY_REFERENCE: Option<&DOMEntityReference> = None;
impl fmt::Display for DOMEntityReference {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {... | Rust | 0 |
ble() * 10 + 0.1)
assert approx_equal(min(
abs(angle_delta_deg(angle_1=a.angle_model, angle_2= angle_model)),
abs(angle_delta_deg(angle_1=a.angle_model, angle_2=-angle_model))), 0)
check_derivs(out=out, a=a)
#
for site2 in [(0,2.3,0), (0,0,2.5)]:
perm = flex.size_t([0,1,2])
while True:
... | Python | 1 |
pub fn PerfStartProvider(providerguid: *const ::windows_sys::core::GUID, controlcallback: PERFLIBREQUEST, phprovider: *mut PerfProviderHandle) -> u32;
#[doc = "*Required features: 'Win32_System_Performance'*"]
pub fn PerfStartProviderEx(providerguid: *const ::windows_sys::core::GUID, providercontext: *const PER... | Rust | 0 |
qrt{2/3}~U_L`
The current limits should be the peak-to-peak value of the phase current (:math:`\hat{i}_S`).
Typically the RMS value for the phase current (:math:`I_S`) is given as
:math:`\hat{i}_S = \sqrt{2}~I_S`
If not specified, nominal values are equal to their corresponding limit values.
Furth... | Python | 1 |
(), None, None, None, [%write_1])
# CHECK-NEXT: %write
# CHECK-SAME: (%read_1, %c, 4, None, (), None, None, None)
# CHECK: -----
@tkw.wave_trace_only()
def gemm(
a: tkl.Memory[M, K, ADDRESS_SPACE, tkl.f16],
b: tkl.Memory[N, K, ADDRESS_SPACE, tkl.f16],
c: tkl.Memory[M, N, ADDRESS_SPACE, tkl.f3... | Python | 1 |
in ncFile.groups:
print('Timestamp %s already added' % maskGroupName)
continue
else:
maskGroup = ncFile.createGroup(maskGroupName)
interpolationHierarchy[maskGroupName] = {}
for a in fullHierarchy[thisStamp]:
... | Python | 1 |
f let Err(why) = client.start().await {
println!("Client error: {:?}", why);
}
}
use CliResult;
use config::{Config, Delimiter};
use select::SelectColumns;
use util;
static USAGE: &'static str = "
Select columns from CSV data efficiently.
This command lets you manipulate the columns in CSV data. You can r... | Rust | 0 |
let order2 = Order::new(Side::Ask, dec!(2.0), dec!(10.0), time::Instant::now());
side.append(order);
side.append(order2);
side.remove(order2);
assert_eq!(side.depth, 1);
assert_eq!(side.volume, order.quantity);
assert_eq!(side.num_orders, 1);
}
#[test]... | Rust | 0 |
(sr) => {
if !sr.success {
invoke_scheduling |= self.rollback_steal(sr);
}
}
ToSchedulerMessage::NewTask(ti) => {
self.graph.add_task(ti);
invoke_scheduling = true;
}
... | Rust | 0 |
ties2KHR = crate::vk1_1::PFN_vkGetPhysicalDeviceQueueFamilyProperties2;
#[doc = "[Vulkan Manual Page](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceMemoryProperties2KHR.html) · Alias"]
#[allow(non_camel_case_types)]
pub type PFN_vkGetPhysicalDeviceMemoryProperties2KHR = crate:... | Rust | 0 |
nt._user_defined_nullable is NULL_UNSPECIFIED:
parent.nullable = False
parent.server_default = self
def _as_for_update(self, for_update: bool) -> FetchedValue:
return self
@util.deprecated(
"1.4",
"The :meth:`_schema.Identity.copy` method is deprecated "
"a... | Python | 1 |
_size = get_size(path).expect("failed to get size of db dir folders");
let file_name = path.file_name().expect("failed to get file name");
let file_name = file_name.to_str().unwrap().to_string();
let splitted_name = file_name.rsplitn(2, '-').collect::<Vec<&str>>();
let fu... | Rust | 0 |
# Scene Text Recognition Model Hub
# Copyright 2022 Darwin Bautista
#
# 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 ... | Python | 1 |
"Bit 6 - The masked interrupt status bit for I2S_RX_HUNG_INT interrupt."]
#[inline(always)]
pub fn rx_hung_int_st(&self) -> RX_HUNG_INT_ST_R {
RX_HUNG_INT_ST_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 7 - The masked interrupt status bit for I2S_TX_HUNG_INT interrupt."]
#[inline(a... | Rust | 0 |
# ============================================
# 2_arraySorting
# ============================================
# Instruction:
# Write a program that sorts an array (list) of numbers in ascending order.
# You may also try descending order or implement a manual sorting algorithm.
#
# Key Concepts:
# - Array manipulation
... | Python | 1 |
lone().complete_column_families(cfs_3, false);
assert!(res_2_0.is_err(), "no column family was expected");
assert!(res_2_1.is_err(), "1 column family was expected but has 2");
assert!(res_2_2.is_ok(), "error: {}", res_2_2.unwrap_err());
assert!(res_2_3.is_err(), "should not has \"col_fam... | Rust | 0 |
assert_eq!(entries[0].len, 297742332);
assert_eq!(entries[0].modified, 1578770227005);
assert_eq!(entries[1].path.to_string_lossy(), "test/with spaces .txt");
assert_eq!(entries[1].hash, "048287162a3a9e8976f0aec50af82965c7c622d479bcf15f4db2d67358bd0544");
assert_eq!(entries[1].len, 467... | Rust | 0 |
#!/usr/bin/env python3
"""
통합 모델 훈련 시스템
다양한 알고리즘의 훈련을 통합 관리
"""
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader, TensorDataset
import xgboost as xgb
from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier
from sklearn.lin... | Python | 1 |
# -----------------------------------------------------------------------------
# Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
import numpy as np
from glumpy import app, gl, glo... | Python | 1 |
help="skip email downloading step"
)
# fmt: on
args = parser.parse_args()
# sanity check
first, last, force_update, skip_email = (
args.first,
args.last,
args.force_update,
args.skip_email,
)
load_email = not skip_email
if first is not None:
... | Python | 1 |
raise TypeError("Wrapper class must inherit from BaseModelWrapper")
cls._WRAPPER_MAPPING[model_type] = wrapper_class
# Convenience functions
def create_model(model_type: str, **kwargs) -> BaseModelWrapper:
"""Convenience function to create model"""
return ModelWrapperFactory.create_wrapper(mo... | Python | 1 |
r "*".
pub name: Text,
}
#[ast_node]
#[derive(Is)]
pub enum SubclassSelector {
#[tag("IdSelector")]
Id(IdSelector),
#[tag("ClassSelector")]
Class(ClassSelector),
#[tag("AttributeSelector")]
Attr(AttrSelector),
#[tag("PseudoClassSelector")]
Pseudo(PseudoSelector),
#[tag("AtSe... | Rust | 0 |
1", "Item22", "Item23", "Item24",
],
selected: None,
events: vec![
("Event1", "INFO"),
("Event2", "INFO"),
("Event3", "CRITICAL"),
("Event4", "ERROR"),
("Event5", "INFO"),
("Event6", "INFO... | Rust | 0 |
-----------------------------------
let result = version(request);
// ---------------------------------------
// THEN
// (Some(StateValue::Session), None) is returned
// ---------------------------------------
let value = m... | Rust | 0 |
l ---------------------------------|
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
// inline value -----| nhandles | flags ---|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, //
],
)
.await
.expect_err("client call unexpectedly succeeded");
assert_mat... | Rust | 0 |
from .info import Info
__red_end_user_data_statement__ = "No user data is stored by this cog."
async def setup(bot):
await bot.add_cog(Info(bot))
| Python | 1 |
# Check whether the artifact can be removed with PARRM
import os
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal
from pyparrm import get_example_data_paths, PARRM
from pyparrm._utils._power import compute_psd
from scipy.stats import pearsonr, spearmanr
import matplotlib
matplotlib.use('Qt5Agg')
... | Python | 1 |
info_getter.h", &header_path))
.raw_line(ALLOW_UNCONVENTIONALS)
.clang_arg("-std=c++11")
.clang_arg("-x")
.clang_arg("c++")
.generate()
.expect("Unable to generate bindings");
let binding_target_path = PathBuf::new()
.join("src")
.join("ffi")
... | Rust | 0 |
01.dds", 0x3900_114A, 0x319F_8866),
(r"textures\tx_creature_lamecor_00.dds", 0x3900_114A, 0x319F_8876),
(r"textures\tx_creature_lamecor_09.dds", 0x3900_114A, 0x319F_88E6),
(r"textures\tx_creature_lamecor_08.dds", 0x3900_114A, 0x319F_88F6),
(r"textures\tx_creature_ashvampire.dds", 0x3900_114A, 0x31CB... | Rust | 0 |
pub fn prefix_end(color_id: &ColorIdentifier) -> Bytes {
bincode::serialize(&(b'C', &serialize_color_id(color_id), std::u32::MAX)).unwrap()
}
pub fn get_txid(&self) -> Txid {
self.key.txinfo.get_txid()
}
fn into_row(self) -> DBRow {
DBRow {
key: bincode::serialize(&... | Rust | 0 |
developers of rdma-core. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/rdma-core/master/COPYRIGHT.
pub const MXM_LOG_CATEGORY_ASYNC: _bindgen_ty_1 = _bindgen_ty_1::MXM_LOG_CATEGORY_ASYNC;
pub const MXM_LOG_CATEGORY_CONN: _bindgen_ty_1 = _bin... | Rust | 0 |
I], V1").unwrap(), OpCode::LDS(0x1));
assert_eq!(words_to_opcode("LD V1, [I]").unwrap(), OpCode::LDR(0x1));
assert_eq!(words_to_opcode("SCRD 56").unwrap(), OpCode::SCRD(0x56));
assert_eq!(words_to_opcode("SCRR").unwrap(), OpCode::SCRR);
assert_eq!(words_to_opcode("SCRL").unwrap(), OpCod... | Rust | 0 |
d,
{
PerBand { base: self }
}
}
impl<V, T> VoicePresenceDetector<T> for V
where
V: VoiceActivityDetector<T>,
T: Float,
{
fn detect<D>(&self, spectrum: &ArrayBase<D, Ix1>) -> T
where
D: Data<Elem = Complex<T>>,
{
if VoiceActivityDetector::detect(self, spectrum) {
... | Rust | 0 |
llm_tool_call[param_name]), str(expected_param_value)):
match, message = self.match_parameter_values(
api_call, llm_tool_call, param_name, expected_param_value
)
if not match:
model_answer.score_raw_data[self.type] = message
... | Python | 1 |
from server_commands.argument_helpers import TunableInstanceParam
from sims.household_enums import HouseholdChangeOrigin
from sims.sim_info_types import Age, Gender
from sims.sim_spawner import SimSpawner, SimCreator
import services
import sims4.commands
@sims4.commands.Command('pets.toggle_selectable_pets', command_ty... | Python | 1 |
,
Self::Simulcast => "simulcast",
Self::Svc => "svc",
Self::Sctp => "sctp",
Self::Message => "message",
}
}
}
/// DTLS certificate and private key.
#[derive(Debug, Clone)]
pub struct WorkerDtlsFiles {
/// Path to the DTLS public certificate file in PEM fo... | Rust | 0 |
##########################################################################
#
# Copyright (c) 2017, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... | Python | 1 |
al_iid.into();
config.github_app_private_key = $val_pk.into();
assert!(matches!(validate_api_credentials(&config), $($res)+));
}};
}
test!("", 0_u64, 0_u64, "", Err(ApiConfigError::MissingToken));
test!(
"",
0_u64,
... | Rust | 0 |
sec += (-offset) as u64;
}
if sec >= MAX_SECONDS {
return None;
}
Some(Time {
sec: sec,
nano: nano,
})
}
/// Convert the time to SystemTime, returns None if the time is before unix epoch
pub fn to_system_time(&self) -> Optio... | Rust | 0 |
(self, color: u8, is_sprite: bool) -> (u8, u8, u8, bool) {
match color {
0 if is_sprite => (0, 0, 0, false),
0 => DEFAULT_COLORS[self.get_color_0() as usize],
1 => DEFAULT_COLORS[self.get_color_1() as usize],
2 => DEFAULT_COLORS[self.get_color_2() as usize],
... | Rust | 0 |
rformance:
print(f"📊 Model performance: Perplexity={performance['perplexity']:.4f}, Accuracy={performance['accuracy']:.4f}")
print()
# Predefined questions
demo_questions = [
"What is machine learning?",
"How does deep learning work?",
"What is the difference between AI... | Python | 1 |
ror> {
// Note that the function `G` cannot be `FnOnce` because every observer
// receives a copy of it. Alternatively, `map_error` could be
// implemented with a subject to only call the mapping function once,
// but that would prevent stream fusion and require memory and a virtual
... | Rust | 0 |
#ARDUINO
'''
n=list(map(int,input().split()))
a=str(n)
c=0
for i in a:
print(i)
x=int(i)
c+=x
print(c)
'''
a=list(map(int,input().split()))
mx=-1
s=0
for i in a:
s=s+i
if s>mx:
mx=s
print(mx)
1 -2 3 4
6
| Python | 1 |
path_node.expand_dir(
&TreeIndex::from(vec![0, 0]),
PathNode::compare_dirs_top_simple,
);
path_node.expand_dir(
&TreeIndex::from(vec![1]),
PathNode::compare_dirs_top_simple,
);
path_node.expand_dir(
&TreeIndex::from(vec![1,... | Rust | 0 |
_base_ = '../cascade_rcnn/cascade-mask-rcnn_x101-32x4d_fpn_1x_coco.py'
model = dict(
backbone=dict(
norm_cfg=dict(type='SyncBN', requires_grad=True),
norm_eval=False,
plugins=[
dict(
cfg=dict(type='ContextBlock', ratio=1. / 16),
stages=(False, True... | Python | 1 |
"""
Write a function to find the maximum difference between the number of 0s and number of 1s in any sub-string of the given binary string.
assert find_length("11000010001") == 6
"""
def find_length(s):
max_diff = 0
for i in range(len(s)):
count_zero = 0
count_one = 0
for j in range(i, ... | Python | 1 |
om(tensor: &Tensor) -> Self {
TensorIndexer::IndexSelect(tensor.shallow_clone())
}
}
macro_rules! impl_from_range {
($range_type:ty) => {
impl From<$range_type> for TensorIndexer {
fn from(range: $range_type) -> Self {
use std::ops::Bound::*;
let sta... | Rust | 0 |
() <= 0 {
remove_price_level = true;
}
}
if remove_price_level {
self.prices.remove(&order.price);
self.price_tree.remove(&order.price);
self.depth -= 1;
}
return result;
}
pub fn min_price_level(&self) -> Option<... | Rust | 0 |
fs::create_dir_all(&path)?;
Ok(path)
}<reponame>tum-taskforce/onion
use crate::{Peer, PeerProvider, Result};
use anyhow::anyhow;
use bytes::Bytes;
use circuit::CircuitHandler;
use crypto::RsaPrivateKey;
use log::{debug, info, warn};
use socket::OnionSocket;
use std::collections::{hash_map, HashMap};
use std::n... | Rust | 0 |
) -> LispResult {
if args.len() != 2 {
return Err(Error::InvalidArity("reset!", "2"));
}
if let Type::Atom(ref v) = **args[0] {
*v.borrow_mut() = args[1].clone();
Ok(v.borrow().clone())
} else {
Err(Error::InvalidArg("reset!", "atom and any other value"))
}
}
fn swap... | Rust | 0 |
::ModSymbol>>,
) -> fmt::Result {
write!(out, ".. cpp:member:: ")?;
gen_type(&field.1, in_path, None, env, out)?;
writeln!(out, " {}", field.0)?;
if !field.2.is_empty() {
let mut field_indented = indented(out).with_str(" ");
markdown_to_rst(&mut field_indented, &field.2, &|shortcut_p... | Rust | 0 |
import sys
import pygame
import zengl
import zengl_extras
zengl_extras.init()
pygame.init()
pygame.display.set_mode((1280, 720), flags=pygame.OPENGL | pygame.DOUBLEBUF | pygame.RESIZABLE, vsync=True)
ctx = zengl.context()
render_size = (800, 600)
image = ctx.image(render_size, 'rgba8unorm', texture=False)
pipeline... | Python | 1 |
import sys
import boto3
import argparse
def create_presigned_url(bucket_name, object_key, expiration=3600):
"""Generate a presigned URL for an S3 object."""
s3_client = boto3.client('s3')
try:
response = s3_client.generate_presigned_url('get_object',
... | Python | 1 |
)
status = IntField(default=0, choices=[0, 1]) # not delete / delete
reply = ListField(ReferenceField('PostThread', db_field='postThread'),
dafault=list)
class Post(Document):
post_name = StringField(default='', required=True, max_length=64)
thread = ReferenceField('PostThread',... | Python | 1 |
in days]))
for day in tqdm(days, desc="Extracting input data"):
extract_prithvi_wxc_input_data(
np.datetime64(day.strftime("%Y-%m-%d")),
download_dir,
input_data_dir,
)
finally:
if tmpdir is not None:
tmpdir.cleanup... | Python | 1 |
= 3;
pub const GRANITE_WIDGETS_STORAGE_BAR_ITEM_DESCRIPTION_APP: GraniteWidgetsStorageBarItemDescription = 4;
pub const GRANITE_WIDGETS_STORAGE_BAR_ITEM_DESCRIPTION_FILES: GraniteWidgetsStorageBarItemDescription = 0;
// Callbacks
pub type GraniteWidgetsDroppedDelegate = Option<unsafe extern "C" fn()>;
pub type Granit... | Rust | 0 |
<Expr> },
// match
// match all
}
<reponame>imxrt-rs/imxrt-rt-gen<gh_stars>0
pub(crate) mod link;
pub(crate) mod reset;
//!
//! Group Anagrams
//!
//! https://leetcode.com/problems/group-anagrams/
//!
//! Given an array of strings, group anagrams together.
//!
//! **Example:**
//! ```text
//! Input: ["eat", "... | Rust | 0 |
eQuery, self).__init__()
self.feature_ids = feature_ids
self.feature_states = feature_states
self.scope_values = scope_values
class ContributedFeatureValueRule(ContributedFeatureHandlerSettings):
"""ContributedFeatureValueRule.
:param name: Name of the handler to run
:type name: s... | Python | 1 |
}_{k+1}"]
for (i, j) in edge_list for k in range(self.n_commodities)
)
objective_expr += quicksum(
adj_mat[i, j][1] * y_vars[f"y_{i+1}_{j+1}"]
for (i, j) in edge_list
)
objective_expr += quicksum(
coverage_costs[i] * z_vars[f"z_{i+1}_{j+1}"... | Python | 1 |
# Personal Library Manager :
# import streamlit as st
library = [
{"title": "Islam Aur Jiddat Pasandi", "author": "Mufti Taqi Usmani"},
{"title": "Usul al-Ifta wa Adabuhu", "author": "Mufti Taqi Usmani"},
{"title": "Takmilah Fath al-Mulhim bi-Sharh Sahih al-Imam Muslim", "author": "Mufti Taqi Usmani"},
... | Python | 1 |
import streamlit as st
import pandas as pd
import plotly.graph_objects as go
def display_backtest_results(results):
if results is None:
st.error("没有回测结果可供显示")
return
col1, col2, col3 = st.columns(3)
col1.metric("总收益率", f"{results['total_return']:.2f}%")
col1.metric("总盈亏金额", f"${results... | Python | 1 |
matcher::GumTreeConfig::new());
let dummy_src: ast::Arena<String, ast::SrcNodeId> = ast::Arena::new();
let zs: Box<MatchTrees<u16>> =
Box::new(zs_matcher::ZhangShashaConfig::new(&dummy_src, &ast::Arena::new()));
descriptions.push(format!("{}\n-----{}\n", "Myers:", myers.describe()));
description... | Rust | 0 |
audiobooks.
"""
)
with gr.Row():
with gr.Column(scale=3):
ebook_file = gr.File(label="eBook File")
target_voice_file = gr.File(label="Target Voice File (Optional)", visible=False)
voice_selector = gr.Dropdown(label="Select Voice", choices=voice_keys) # Define voic... | Python | 1 |
Rate(44_100), 10, input);
///
/// // first chunk contains 10 samples
/// let next = resampler.next().unwrap().unwrap();
/// assert_eq!(next.sample_len(), 10);
/// assert_eq!(next.channel_data(0), &ChannelData::from(vec![
/// 1., 2., 3., 4., 5.,
/// 1., 2., 3., 4., 5.,
/// ]));
///
/// // second chunk contains 5... | Rust | 0 |
e_def_pc * \
# torch.tensor([1, -1, 1]).cuda() # for shapenet shapes
# sym_loss = chamfer_distance(sample_def_pc, sample_def_pc_sym) #### sym_loss for the deformed shape
sym_loss = collision_loss
cd_loss = sum(cd_... | Python | 1 |
ount: 11,
emission_initial: 18_462_816_327 * uT,
emission_decay: &DIBBLER_DECAY_PARAMS,
emission_tail: 800 * T,
max_randomx_seed_height: u64::MAX,
proof_of_work: algos,
faucet_value: (10 * 4000) * T,
transaction_weight: TransactionWeigh... | Rust | 0 |
1BC37B730FFC1786, 0x5D20C81D345FE4B9, 0x1D14A5663D369A93,
0x5EBD4BD39B2217D0, 0x56833BE1CDDBA6BC, 0xB288169B4E3BB726, 0xC2ED28FBFC395D1F,
0x035B30C68F9A6B6F, 0x539836A6E56A7B16, 0xCEB1525C6ADB65A5, 0x5F71754AA458B11A,
0x0DB9D180B21C0B13, 0x417D86C59DF33E49, 0x183A8F6C44DAFA24, 0x4E224C180C1F0B45,
0xC93C... | Rust | 0 |
-> AIR)
for atomicity in vec![InvAtomicity::Atomic, InvAtomicity::NonAtomic] {
state.reached_functions.insert(fn_inv_name(atomicity));
state.reached_functions.insert(fn_namespace_name(atomicity));
state.reached_datatypes.insert(datatype_invariant_path(atomicity));
}
let kratex = Kr... | Rust | 0 |
#!/usr/bin/python3
# from picoctf platform
import glob, imp, argparse, time
from os.path import splitext, basename
import config
def load_modules(directory):
files = glob.glob("{}/*.py".format(directory))
return [imp.load_source(splitext(basename(module))[0], module) for module in files]
def run_modules(modu... | Python | 1 |
l>) {
self.iter()
.for_each(|line_string| line_string.rasterize(rasterizer));
}
}
impl<Label> Rasterize<Label> for Polygon<f64>
where
Label: Copy + Add<Output = Label>,
{
fn rasterize(&self, rasterizer: &mut Rasterizer<Label>) {
rasterize_polygon(self.exterior(), self.interiors(... | Rust | 0 |
}
}
rfcs
}
<gh_stars>1-10
use contract::contract_api::runtime;
use types::U512;
use logic::VestingTrait;
use crate::utils;
type Amount = U512;
type Time = U512;
pub struct VestingContract;
impl VestingTrait<Amount, Time> for VestingContract {
fn set_amount(&mut self, name: &str, value: Amount) ... | Rust | 0 |
face_create(ft_face: FT_Face, destroy: hb_destroy_func_t) -> *mut hb_face_t;
}
extern "C" {
pub fn hb_ft_face_create_cached(ft_face: FT_Face) -> *mut hb_face_t;
}
extern "C" {
pub fn hb_ft_face_create_referenced(ft_face: FT_Face) -> *mut hb_face_t;
}
extern "C" {
pub fn hb_ft_font_create(ft_face: FT_Face, d... | Rust | 0 |
!(f16::INFINITY, inf);
assert_eq!(f16::NEG_INFINITY, neg_inf);
assert!(nan.is_nan());
assert!(f16::NAN.is_nan());
let e = f16::from_f32(core::f32::consts::E);
let pi = f16::from_f32(core::f32::consts::PI);
let frac_1_pi = f16::from_f32(core::f32::consts::FRAC_1_PI);
... | Rust | 0 |
"required_1.service".into(),
},
"extra_2".to_string() => ExtraDependency {
source: "source_2.service".into(),
requires: "required_2.service".into(),
},
},
MountUnit {
unit_section: UnitSection... | Rust | 0 |
fn test_load_rom() {
let mut emu = CHIP8::new();
// Test the number of bytes written.
let bytes_written = emu.load_rom(Some(Box::new([1; 8])));
assert_eq!(bytes_written, 8);
// Test that the rom was written in the right place.
let start = 0x200;
for idx in 0.... | Rust | 0 |
initial=True,
affect_children=False
)
rig_hrc.set_local_transform(
self.rig_key,
unreal.Transform(),
initial=True,
affect_children=False)
def set_parent(self,
parent_name=None,
... | Python | 1 |
from kartothek.core.dataset import DatasetMetadata
from kartothek.utils.ktk_adapters import get_dataset_columns
def test_fail_skv_missing(cli):
result = cli("--store=cubes", "my_cube", "index")
assert result.exit_code == 2
assert "Error: Could not open load store YAML:" in result.output
def test_fail_wr... | Python | 1 |
r_says_nope() {
setup(&|config| {
let out = run_input(config, &["rustup-init"], "n\n\n");
assert!(out.ok);
assert!(!config.cargodir.join("bin").exists());
});
}
#[test]
fn with_no_modify_path() {
setup(&|config| {
let out = run_input(config, &["rustup-init", "--no-modify-pat... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.