text string | label_name string | labels int64 |
|---|---|---|
type Left = (A, B, C, D);
type Right = (E, F, G, H, I);
fn split(self) -> (Self::Left, Self::Right) {
match self {
(a, b, c, d, e, f, g, h, i) =>
((a, b, c, d),
(e, f, g, h, i))
}
}
}
impl<A, B, C, D, E, F, G, H, I, J> Split for (A, B, C, D, E,... | Rust | 0 |
0" greyed out
pub opacity: u32,
#[serde(rename = "blendMode", default)] // 0 / missing for groups - editor shows "Normal" greyed out
pub blend_mode: BlendMode,
pub color: Option<Color>,
pub data: Option<String>,
#[doc(hidden)] #[serde(skip)] pub _non_exhaustive: (), // more fields may be added
... | Rust | 0 |
# -*- coding: utf-8 -*-
from django.contrib.contenttypes.models import ContentType
from django_comments.models import Comment
from tcms.core.helpers.comments import add_comment
from tcms.tests import BasePlanCase
from tcms.tests.factories import UserFactory
class TestAddComments(BasePlanCase):
"""Test comments.... | Python | 1 |
ize=(50,50))
plt.bar(efa_df.columns, communalities, color='skyblue', alpha=0.8)
plt.xlabel('Variables')
plt.ylabel('Communalities (Common Variance)')
plt.title('Communalities of Variables in EFA')
plt.ylim(0, 1) # Communalities are proportions between 0 and 1
plt.grid(axis='y', linestyle='--', alpha=0.7)
plt.show()
p... | Python | 1 |
# Cancel all other tasks. We take care to not cancel the current
# task as well. If we do so, then since there is no `await` after
# here and CancelledError are usually thrown at one, we will
# encounter a curious corner case where the current task will end
# up as don... | Python | 1 |
t(&self, _: &Event<'_>) {}
fn enter(&self, _: &Id) {}
fn exit(&self, _: &Id) {}
fn current_span(&self) -> tracing_core::span::Current {
tracing_core::span::Current::unknown()
}
}
#[test]
fn reload_handle() {
static FILTER1_CALLS: AtomicUsize = AtomicUsize::new(0);
static FILTER2_CALLS: ... | Rust | 0 |
:-2]
header_flag = dest_shortname.upper().replace("/", "_").replace("-", "_") + "_H"
export_list = open(req_file).read().split("\n")
with open(dest, "w") as ostream:
W = lambda *x: print(*x, file=ostream)
W("#ifndef {}".format(header_flag))
W("#include <stddef.h>")
W("#inc... | Python | 1 |
),
self._check_http_code(
BASIC_AUTH_AND_OTHER_IP_FILTER_RESOURCE, 403, auth=auth
),
self._check_http_code(
BASIC_AUTH_OR_MY_IP_FILTER_RESOURCE, 200, auth=auth
),
self._check_http_code(BASIC_AUTH_OR_M... | Python | 1 |
ntry(id).or_insert_with(|| vec![]).push(value);
} else {
raise!("failed to read the {} column", name);
}
}
Ok(data)
}
#[cfg(test)]
mod tests {
use assert;
use sqlite::Connection;
#[test]
fn read_names() {
let backend = open();
let data = super::read_... | Rust | 0 |
t| object.into_outer()),
EcdsaMessageHash::EcdsaDealingSupport(_) => self
.dealing_support
.remove_object(&EcdsaDealingSupport::key_from_outer_hash(id))
.map(|object| object.into_outer()),
}
}
}
impl EcdsaPoolSection for EcdsaPoolSectionImpl {
... | Rust | 0 |
s as usize);
unsafe {
sys::eglGetConfigs(
display,
(&mut configs[..]).as_mut_ptr(),
num_configs,
&mut num_configs as *mut Int,
);
configs.set_len(num_configs as usize);
};
configs
}
pub fn get_config_attrib(display: Display, config: Co... | Rust | 0 |
from .base import *
try:
from .local import *
except ImportError:
pass
WAGTAIL_ENABLE_UPDATE_CHECK = False
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = env.str('SECRET_KEY')
# SECURITY WARNING: define the correct hosts in production!
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS... | Python | 1 |
a str;
#[generator]
fn generator(_input: &str) -> Out {
eprintln!("This day is not implemented in Rust due to requirement of -- essentially -- OCR");
eprintln!("See https://docs.google.com/spreadsheets/d/1whrmqDXiUvX2bXp4qoyZMX68JQ0IzY5JAa3yIuphpg8/edit");
std::process::exit(1);
}
#[solution(part1,
ex... | Rust | 0 |
f test_query_other_database_using_cursor(self):
query_results = self.run_setup("QueryOtherDatabaseCursorAppConfig")
self.assertSequenceEqual(query_results, [(42,)])
def test_query_many_default_database_using_cursor(self):
self.run_setup("QueryDefaultDatabaseCursorManyAppConfig")
def te... | Python | 1 |
&Self::Target {
unsafe { & *self.ptr }
}
}
impl<T> DerefMut for Pointer<T> {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *self.ptr }
}
}
use wasm_bindgen::prelude::*;
use crate::tetris_board::TetrisBoard;
use crate::utils;
extern crate web_sys;
// A macro to provide `pri... | Rust | 0 |
nwind, AssertUnwindSafe};
let u = unsafe { &mut *(usrdata as *mut UserCallbackData) };
let (cb_obj, model, nvars) = (&mut u.cb_obj, u.model, u.nvars);
let where_ = Where::new(CbCtx::new(cbdata, where_, model, nvars));
let callback_result = catch_unwind(AssertUnwindSafe(|| {
let w = match where_... | Rust | 0 |
case!(
cross_switch_write_invalidate,
|cx| cx.run::<redundant::LoadStore>("redundant-load-store"),
r#"
let foo = 1;
switch (bar) {
case 1:
foo += 1; // do not drop
case 2:
foo = 3;
}
"#,
@r###"
_ini = 1
foo <= _ini
_swi = <global bar>
_tst = 1
_tst$1 = 2... | Rust | 0 |
reply = "<xml><ToUserName><![CDATA[%s]]></ToUserName><FromUserName><![CDATA[%s]]></FromUserName><CreateTime>%s</CreateTime><MsgType><![CDATA[text]]></MsgType><Content><![CDATA[%s]]></Content><FuncFlag>0</FuncFlag></xml>"
response = make_response( reply % (fromUserName, toUserName, str(int(time.time())), res_msg ... | Python | 1 |
ge_paths
def append_to_train_set_file(train_set_file, augmented_image_paths):
with open(train_set_file, 'a') as file:
for path in augmented_image_paths:
file.write(path + '\n')
def main():
print(f"The current working directory is: {SCRIPT_DIR}")
# Full path to the file containing the... | Python | 1 |
x" % h
futures.append(tpool.submit(requests.post, post_url, json=body))
print("Posting %d docs to host %s" % (len(body["_aknn_docs"]), h))
for f, h in zip(as_completed(futures), es_hosts):
res = f.result()
if res.status_code != 200:
print("Error a... | Python | 1 |
.bitfield_enum("PanelType")
.generate_comments(true)
.layout_tests(false)
.parse_callbacks(Box::new(InkViewTypeChooser))
.prepend_enum_name(false)
.rustfmt_bindings(true)
.use_core()
// Finish the builder and generate the bindings.
.generate()
// Unwrap the Result and panic on failure.
.expect("U... | Rust | 0 |
down the writing instruction into multiple subtasks."
"Each subtask will guide the writing of one paragraph in the essay, and should include the main points and word count requirements for that paragraph."
"The writing instruction is as follows:"
"<instruction>"
"{instr... | Python | 1 |
e to True.
9. Freezes the circuit again to prevent further changes.
The methods generated by this function are:
- `generate_methods_d_hamiltonian_d`
- `generate_tphi_1_over_f_methods`
- `generate_t1_flux_bias_line_methods`
- `generate_t1_methods`
- `generate_ove... | Python | 1 |
e=_mock_response({'foo': 'bar'})) as mock_get:
loader.renew_token()
mock_get.assert_called_once_with(expected_url, headers=self.expected_header)
def test_renew_token_fail(self):
expected_url = '{}/v1/auth/token/renew-self'.format(self.url)
with mock.patch('requests.get', re... | Python | 1 |
('server_uri', sa.String(40)),
sa.Column('transport', sa.String(40)),
sa.Column('support_path', yesno_values),
)
op.create_index('ps_registrations_id', 'ps_registrations', ['id'])
########################## add columns ###########################
# new columns for endpoints
op.add_... | Python | 1 |
debug!(target: "aleph-justification", "Successfully finalized {:?}", number);
if let Some(metrics) = &self.metrics {
metrics.report_block(hash, Instant::now(), Checkpoint::Finalized);
}
}
Err(e) => {
error!(targe... | Rust | 0 |
let x10 = lerp(wx, w010, w110);
let x01 = lerp(wx, w001, w101);
let x11 = lerp(wx, w011, w111);
let y0 = lerp(wy, x00, x10);
let y1 = lerp(wy, x01, x11);
lerp(wz, y0, y1)
}
pub fn noisep(p: Point3f) -> Float {
noise(p.x, p.y, p.z)
}
fn grad(x: usize, y: usize, z: usize, dx: Float, dy: Fl... | Rust | 0 |
import django_filters
from .models import Company
class CompanyFilter(django_filters.FilterSet):
"""
Filter set for Company model with various filtering options
"""
name = django_filters.CharFilter(
lookup_expr="icontains", help_text="Filter by company name (case-insensitive)"
)
count... | Python | 1 |
t = ::std::os::raw::c_int;
pub type int_least8_t = __int_least8_t;
pub type int_least16_t = __int_least16_t;
pub type int_least32_t = __int_least32_t;
pub type int_least64_t = __int_least64_t;
pub type uint_least8_t = __uint_least8_t;
pub type uint_least16_t = __uint_least16_t;
pub type uint_least32_t = __uint_least32_... | Rust | 0 |
import json
import requests
BASE = "http://127.0.0.1:5000/"
print("get".center(60, "-"))
response = requests.get(BASE + "getproduct/coke")
res = response.json()
for k, info in res.items():
print(k)
print("-" * len(k))
for k, v in info.items():
print(k, "=>", v)
print("=" * 60)
print("put".cent... | Python | 1 |
return aspect_ratios[closest_ratio], float(closest_ratio)
def process_ratio(ori_h, ori_w):
ASPECT_RATIO_512 = {
"0.25": [256, 1024],
"0.26": [256, 992],
"0.27": [256, 960],
"0.28": [256, 928],
"0.32": [288, 896],
"0.33": [288, 864],
"0.35": [288, 832],
... | Python | 1 |
8(data) {
let _ = s.parse::<Topic>();
}
});
<gh_stars>0
/*
* Copyright (c) 2015 <NAME>
*
* 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 withou... | Rust | 0 |
oint(class_scope:tensorboard.RewriterConfig.CustomGraphOptimizer.ParameterMapEntry)
))
,
DESCRIPTOR = _REWRITERCONFIG_CUSTOMGRAPHOPTIMIZER,
__module__ = 'tensorboard.compat.proto.rewriter_config_pb2'
# @@protoc_insertion_point(class_scope:tensorboard.RewriterConfig.CustomGraphOptimizer)
))
,... | Python | 1 |
-> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<ObjType> {
match value {
0 => ::std::option::Option::Some(ObjType::BlockHeaders),
1 => ::std::option::Option::Some(ObjType::BlockBodies),
2 => ::std::option::Option::Some(ObjType::Block... | Rust | 0 |
verdict = "✅ ULTIMATE SUCCESS"
else:
print("🔧 Birth/death still needs work, but we've made progress:")
print(f" 📊 {total_adaptations} total adaptations attempted")
print(f" 💀 {total_deaths} deaths (need > 0)")
print(f" 🐣 {total_births} births (need > 0)")
... | Python | 1 |
us_ready: AtomicU32,
}
impl VirtualMachine {
/// Construct a new `VirtualMachine` using the given config
///
/// This creates the guest address space (allocating the needed memory),
/// and maps in the requested images.
pub fn new(
id: u32,
config: VirtualMachineConfig,
info... | Rust | 0 |
"""
Cut the pictures in the source folder into training set, validation set and test set,
and save the names of the pictures in the corresponding set to the file.
ratio: 6:2:2
"""
import os
import random
import shutil
import argparse
argparser = argparse.ArgumentParser()
argparser.add_argument("--zoom", type=str, he... | Python | 1 |
CRS_OFFSET.lock().unwrap();
while key != input::Scancode::None {
let mut last = (lines_mutex.last().unwrap()).clone();
if key == input::Scancode::BACKSPACE {
last.1.pop();
*(lines_mutex.last_mut().unwrap()) = (last.0, last.1);
*crs_offset -= 1;
} else if... | Rust | 0 |
));
assert_eq!(circuit_plus_op, circuit_overall);
assert_eq!(circuit_plus_circuit, circuit_overall);
assert_eq!(circuit_plus_ref_circuit, circuit_overall);
}
/// Test += function
#[test]
fn add_assign_op_circuit() {
let mut circuit_one = Circuit::new();
circuit_one.add_operation(RotateZ::new(0, Ca... | Rust | 0 |
ODO(doc): @quake
fn cell_provider(&self) -> CellProviderWrapper<Self> {
CellProviderWrapper(self)
}
/// Get block by block header hash
fn get_block(&'a self, h: &packed::Byte32) -> Option<BlockView> {
let header = self.get_block_header(h)?;
if let Some(freezer) = self.freezer() ... | Rust | 0 |
}
buf.resize(65535, 0_u8);
match socket.recv_from(buf.as_mut()) {
Ok((size, _remote)) => {
buf.truncate(size);
incoming_bytes.inc_by(size as f64);
let r = process_buffer_newlines(&mut b... | Rust | 0 |
let t0 = 1.0 / intp.nf / (intp.sa + 0.5 * Ldrn + i as f64 * (intp.sd + Ldrn));
let t1 = 1.0 / intp.nf / (intp.sb + 0.5 * Ldrn + i as f64 * (intp.sd + Ldrn));
Inv_sa += t0;
Inv_sb += t1;
}
Inv_ODeff = Inv_sa + Inv_sb;
rho = model.ku0 / size_params.ku0temp * ... | Rust | 0 |
type::ReactionType,
text_channel::TextChannel,
voice_channel::VoiceChannel,
webhook::Webhook,
webhook_type::WebhookType,
};
#[cfg_attr(
feature = "serde-support",
derive(serde::Deserialize, serde::Serialize),
serde(untagged)
)]
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub enum Channel {... | Rust | 0 |
super().__init__()
self._success_probability: float | None = None
self._num_steps: int | None = None
self._num_first_state_steps: int | None = None
self._theta_intervals: list[list[float]] | None = None
@property
def success_probability(self) -> float:
"""Return the s... | Python | 1 |
}
#[test]
fn gsub_chaining1_boundary_003() {
assert_eq!(
shape(
"tests/fonts/aots/gsub_chaining1_boundary_f3.otf",
"\u{0000}\u{0014}\u{0015}\u{0016}\u{0017}\u{0000}",
"--features=\"test\" --no-clusters --no-glyph-names --no-positions",
),
"0|\
20... | Rust | 0 |
list
NilR
}
use std::rc::Rc; // "Rc" not in the prelude, hence need to import it
enum ListRc{
ConsRc(i32, Rc<ListRc>),
NilRc
}
fn main() {
let a = List::Cons(5, Box::new(List::Cons(10, Box::new(List::Nil))));
let b = List::Cons(3, Box::new(a)); // "a" is moved here
/*
let c = List::Cons(4... | Rust | 0 |
import os
import cv2
import random
import numpy as np
import torch
import argparse
from shutil import copyfile
from src.config import Config
from src.bbx_reg import BoxReg
import torch.nn as nn
import torch.distributed as dist
import torch.multiprocessing as mp
def main(rank, world_size):
config = load_config(mod... | Python | 1 |
lude_duration=include_duration,
),
' ',
)
for root in self.roots
],
'</SpanTree>',
]
return '\n'.join(repr_parts)
def __str__(self):
return f'<SpanTree num_roots={len(self.roots)} total_spans={l... | Python | 1 |
#[inline(always)]
fn from(variant: PACKAGE_A) -> Self {
match variant {
PACKAGE_A::QF => 8192,
PACKAGE_A::CH => 8193,
PACKAGE_A::CI => 8194,
PACKAGE_A::CK => 8197,
PACKAGE_A::UNSPECIFIED => 4294967295,
}
}
}
#[doc = "Reader of field `PA... | Rust | 0 |
ts3D']
# keypoints3d are in world coordinate system
keypoints3d_world = kps3d_dict['keypoints3d'][...]
keypoints3d_world = keypoints3d_world[frame_list, ...]
keypoints3d_mask = kps3d_dict['keypoints3d_mask'][...]
# return keypoints3d in world coordinate system
if device... | Python | 1 |
if let Some(index) = index {
extensions.remove(index);
}
}
extensions.is_empty()
}
pub(crate) fn find_queue_families(&self, device: &PhysicalDevice) -> QueueFamilyIndices {
let mut indices = QueueFamilyIndices::default();
... | Rust | 0 |
from omegaconf import OmegaConf
from configs.common.data.bert_dataset import tokenization
from configs.common.models.bert import cfg as simcse_cfg
from configs.common.models.graph import graph
from configs.common.optim import optim
from configs.common.train import train
from libai.config import LazyCall
from libai.dat... | Python | 1 |
}
impl WindowWrapper {
pub fn new(window: Window, window_rect: Rect, is_trans: bool) -> Self {
let restore_size = window_rect.get_size();
Self {
window,
window_rect,
hidden: false,
is_trans,
restore_position: Position { x: 0, y: 0 },
... | Rust | 0 |
d(list, Ptr::to(ptr));
}
}
list
}
}
impl<'a, T> ToGlibContainerFromSlice<'a, *const glib_sys::GSList> for &'a T
where
T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>,
{
type Storage = (
Option<SList>,
Vec<Stash<'a, <T as GlibPtrDefault>::GlibTy... | Rust | 0 |
let input = $input;
let mut written = Vec::with_capacity(input.len());
let actual = {
let mut tree = MerkleTreeWriter::new(&mut written);
tree.write_all(input.as_slice()).unwrap();
tree.finish().root()
};
... | Rust | 0 |
= " \\brief Allows a user to set attribute of a node before Graph Validation."]
#[doc = " \\param [in] node The reference to the node to set."]
#[doc = " \\param [in] attribute Use <tt>\\ref vx_node_attribute_e</tt> value to set the desired attribute."]
#[doc = " \\param [in] ptr The pointer to the desired... | Rust | 0 |
;
for i_char in 0..string_a.len() {
if string_a[i_char] != string_b[i_char] {
num_different += 1;
}
if num_different > 1 {
return false;
}
}
if num_different == 1 {
return true;
}
}
if st... | Rust | 0 |
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf::descriptor::FileDescriptorProto,
};
fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto {
::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap()
}
pub fn file_descriptor_proto() -> &'static ::protobuf::descr... | Rust | 0 |
},
6 => { // jump if zero
if param(mem, pc, 1, &relative_base) == 0 {
pc = param(mem, pc, 2, &relative_base) as usize;
} else {
pc += 3;
}
},
7 => { // less than
let a = pa... | Rust | 0 |
, 1, 3]).unwrap();
let p2 = PermutationMatrix::<u32>::from_array(vec![0, 3, 2, 1]).unwrap();
let p1p2 = PermutationMatrix::from_array(vec![2, 3, 1, 0]).unwrap();
let p2p1 = PermutationMatrix::from_array(vec![2, 0, 3, 1]).unwrap();
{
// Consume p1, consume p2
ass... | Rust | 0 |
/// Returns the size of the child widget.
pub fn child_size(&self) -> Size {
self.clip.content_size()
}
/// Returns the current scroll offset.
pub fn offset(&self) -> Vec2 {
self.clip.viewport_origin().to_vec2()
}
/// Returns a [`Rect`] representing the currently visible ... | Rust | 0 |
vals.get(*oshape, *monn_2, *monn_1);
if ip != 0. as R || !sym || r == c {
m.push(r, c, ip);
}
}
// Iterate element pairs with our interior supported element vs side supported elements.
// The support sides are iterated in order of increasing non-boundary side num... | Rust | 0 |
#
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2025 Carsten Igel.
#
# This file is part of simplepycons
# (see https://github.com/carstencodes/simplepycons).
#
# This file is published using the MIT license.
# Refer to LICENSE for more information
#
""""""
# pylint: disable=C0302
# Justification: Code is generated
... | Python | 1 |
use std::ops::Rem;
use std::result::Result;
#[cfg(feature="external-hasher")]
use char_seq;
use crate::error::ErrorKind;
pub type Map = BTreeMap<BigUint, Vec<String>>;
/// This is a sequence of mathematical prime numbers, whereby each
/// letter of a given alphabet within a script such as Latin or
/// Cyrillic gets... | Rust | 0 |
import re
import subprocess
from typing import Mapping, Set, Union
from retrying import retry
from helm.common.optional_dependencies import handle_module_not_found_error
try:
from simple_slurm import Slurm
except ModuleNotFoundError as e:
handle_module_not_found_error(e, ["slurm"])
class SlurmJobState:
... | Python | 1 |
"""Formula 6.15 from EN 1993-1-1:2005: Chapter 6 - Ultimate Limit State."""
from blueprints.codes.eurocode.en_1993_1_1_2005 import EN_1993_1_1_2005
from blueprints.codes.formula import Formula
from blueprints.codes.latex_formula import LatexFormula, latex_replace_symbols
from blueprints.type_alias import DIMENSIONLESS... | Python | 1 |
eCombatText(CreateCombatText), // 81
LoadNetModule(LoadNetModule), // 82
SetNpcKillCount(SetNpcKillCount), // 83
SetPlayerStealth(SetPlayerStealth), // 84
QuickStash(QuickStash), // 85
UpdateTileEntit... | Rust | 0 |
self._block_room(room_id)
channel = self.make_request(
"GET",
self.url % room_id,
access_token=self.admin_user_tok,
)
self.assertEqual(200, channel.code, msg=channel.json_body)
self.assertTrue(channel.json_body[... | Python | 1 |
io_postgres::row::Row) -> Self {
Self {
#(#fields),*
}
}
}
};
syn::parse_quote!(#tokens)
}
fn impl_tokio_postgres_mapper(
s: &DataStruct,
name: &Ident,
impl_generics: &ImplGenerics,
ty_generics: &TypeGenerics,
where_cl... | Rust | 0 |
import torch
import matplotlib.pyplot as plt
from sklearn.metrics import (
confusion_matrix,
classification_report,
accuracy_score,
precision_score,
recall_score,
f1_score,
roc_auc_score,
roc_curve
)
def compute_accuracy(model, dataloader, device):
model.eval()
correct = 0
t... | Python | 1 |
n with maximum range limit and ECHO pin error checking.
# Returns the range of the closest target in cm. The 'max' parameter limits
# the search range to objects no farther than 'max' cm. The function returns
# -1 if a previous ranging operation is still in progress, 0 if no target is
# found within the specified max r... | Python | 1 |
"List/reverse" => Some(ListReverse),
"Optional/fold" => Some(OptionalFold),
"Optional/build" => Some(OptionalBuild),
"Text/show" => Some(TextShow),
_ => None,
}
}
}
// Trim the shared indent off of a vec of lines, as defined by the Dhall semantics of multilin... | Rust | 0 |
#!/usr/bin/env python
"""A command signer using a private key from a file."""
import cryptography.exceptions as crypto_exceptions
from cryptography.hazmat.primitives.asymmetric import ed25519
from grr_response_core import config
from grr_response_server import command_signer
from grr_response_proto.rrg.action import ... | Python | 1 |
eq_len, -1)
if self.use_pos_emb:
target_emb = torch.cat([target_emb, self.pos_emb.expand(target_emb.size(0), -1, -1)], dim=-1)
target_emb = self.W_proj(target_emb)
din_concat = torch.cat([target_emb, sequence_emb, target_emb - sequence_emb,
target... | Python | 1 |
= true
srcblend = D3D11_BLEND_SRC_ALPHA
destblend = D3D11_BLEND_INV_SRC_ALPHA
srcblendalpha = D3D11_BLEND_ONE
destblendalpha = D3D11_BLEND_ONE
blendop = D3D11_BLEND_OP_ADD
blendopalpha = D3D11_BLEND_OP_ADD
rendertargetwritemask = 15 // D3D11_COLOR_WRITE_ENABLE_ALL
[BlendStateDX11]
alphatocoverageenable = false
indepe... | Rust | 0 |
::{Parent, Position, TextBlock, TuiChannel, TuiEvent};
use crate::specs_ext::SpecsExt;
use amethyst::ecs::{prelude::*, SystemData as _};
use hibitset::BitSetLike;
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct Centered {
pub horizontal: bool,
pub vertical: bool,
}
impl Centered {
pub fn new(horizonta... | Rust | 0 |
# Flip Five
# https://open.kattis.com/problems/flipfive
# TAGS: BFS, bitmask, nice
# CP4: 8.2b, State-Space, BFS, E
# NOTES:
"""
Nice little practice with bitmask and encoding states.
Left comments, but basically:
- the moves can be encoded as binary numbers representing the mask on the board
- you XOR each mask with ... | Python | 1 |
et[1]);
println!("xspeed = {:?} {:?} time = {} {}", vx0, vx1, t0, t1);
let yv0 = get_yspeed(target[2], t0);
let yv1 = get_yspeed(target[2], t1);
println!("yspeed = {:?} {:?}", yv0, yv1);
let yv0 = get_yspeed(target[3], t0);
let yv1 = get_yspeed(target[3], t1);
pri... | Rust | 0 |
# sectors/views.py
import os
import csv
from collections import defaultdict
from rest_framework.response import Response
from rest_framework.views import APIView
from .serializers import CourseSerializer
class SectorCoursesView(APIView):
def get(self, request, sector_name=None):
data_folder = os.path.join(... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from vtkmodules.vtkCommonCore import (
vtkFloatArray,
vtkLookupTable,
)
from vtkmodules.vtkCommonDataModel import vtkTable
from vtkmodules.vtkChartsCore import (
vtkChart,
vtkChartXY,
vtkPlotPoints,
)
from vtkmodules.vtkRenderingContext2D impo... | Python | 1 |
5]);
println!("|---|---|---|");
println!("| {} | {} | {} |", board[6], board[7], board[8]);
println!("\\-----------/");
}
fn get_player_input(state: &[CellState; 9]) -> usize {
print!("Enter the # for your choice (X): ");
let guess = lib::stdin().read_line();
let guess = guess.as_bytes()[0];
... | Rust | 0 |
esult.output)
# Assert
mock_detect_relevant_tests.assert_called_once_with(
"helloworld",
"/coverage_dir",
True,
["special_file_1", "special_file_2"],
["special_ext_1", "special_ext_2"],
"my_out_file",
"my_custom_branch",
True,
)
@pytest.mark... | Python | 1 |
=> {
impl BitRange<$bitrange_ty> for $t {
#[inline]
fn get(&self) -> $bitrange_ty {
*self as $bitrange_ty
}
#[inline]
fn bit_range(&self, msb: usize, lsb: usize) -> $bitrange_ty {
let bit_len = size_of::<$t>()*8;
... | Rust | 0 |
from ast import *
from interp_Larray import InterpLarray
from utils import *
class Function:
__match_args__ = ("name", "params", "body", "env")
def __init__(self, name, params, body, env):
self.name = name
self.params = params
self.body = body
self.env = env
def __repr__(sel... | Python | 1 |
from typing import Any, Dict, Optional
from contextlib import contextmanager
from contextvars import ContextVar
from pydantic import BaseModel
class TracingContext(BaseModel):
traceparent: Optional[Dict[str, Any]] = None
baggage: Optional[Dict[str, Any]] = None
credentials: Optional[str] = None
para... | Python | 1 |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_restful import Api
db = SQLAlchemy()
migrate = Migrate()
def create_app():
app = Flask(__name__)
# Load configuration
from .config import Config
app.config.from_object(Config)
# Initi... | Python | 1 |
pub_key: *const BufferWithSize,
tx_hash: *const BufferWithSize,
out_idx: u32,
withdrawal_epoch_length: u32,
mc_btr_request_data_length: u8,
custom_field_elements_config: *const BufferWithSize,
custom_bv_elements_config: *const BitVectorElementsConfig,
custom_bv_elements_config_len: usize... | Rust | 0 |
LEN, Some(UNINTERESTED_MESSAGE_ID)) => value!(
Ok(PeerWireProtocolMessage::UnInterested)
) |
(HAVE_MESSAGE_LEN, Some(HAVE_MESSAGE_ID)) => map!(
call!(HaveMessage::parse_bytes, bytes.split_off(HEADER_LEN)),
|res_have| res_have.ma... | Rust | 0 |
the PINTSEL6 register as the source to bit slice 4."]
INPUT6,
#[doc = "Input 7. Selects the pin selected in the PINTSEL7 register as the source to bit slice 4."]
INPUT7,
}
impl From<SRC4_A> for u8 {
#[inline(always)]
fn from(variant: SRC4_A) -> Self {
match variant {
SRC4_A::INP... | Rust | 0 |
from fastapi import HTTPException, status
from sqlalchemy.ext.asyncio import AsyncSession
from app.crud.charity_project import charity_project_crud
from app.models import CharityProject
DUPLICATE_NAME = 'Проект с таким именем уже существует!'
NOT_EXIST = 'Проект не найден!'
NOT_ENOUGH = ('Размер необходимых инвестици... | Python | 1 |
"""Constants for the zwave_mqtt integration."""
DOMAIN = "zwave_mqtt"
DATA_UNSUBSCRIBE = "unsubscribe"
PLATFORMS = ["binary_sensor", "cover", "climate", "fan", "sensor", "switch", "light"]
# MQTT Topics
TOPIC_OPENZWAVE = "OpenZWave"
# Common Attributes
ATTR_INSTANCE_ID = "instance_id"
ATTR_SECURE = "secure"
ATTR_CON... | Python | 1 |
saldo = 1000
def depositar(cantidad): # Operación de deposito con .5% de IVA
global saldo
monto_real = cantidad - (cantidad * 0.005)
saldo += monto_real
print(f"Ha depositado ${monto_real}. Su saldo ahora es ${saldo}.")
def retirar(cantidad): # Operación de retiro con .7% de IVA
global saldo
... | Python | 1 |
dd level on the fly.
line_start = line_end = 0
highest_level = 0
lowest_odd_level = EXPLICIT_LEVEL_LIMIT
for idx in range(max_len):
_ch = chars[idx]
# calc the levels
char_level = _ch['level']
if char_level > highest_level:
highest_level = char_level
... | Python | 1 |
logger, Level::Debug, "Dead beef {}", 4);
assert_eq!(logs.entries().len(), 2);
assert_eq!(logs.entries()[0], (Level::Warn, "Dead beef 3".to_owned()));
assert_eq!(logs.entries()[1], (Level::Debug, "Dead beef 4".to_owned()));
}
#[test]
fn test_log_wrappers() {
let (logger, lo... | Rust | 0 |
fp in all_firewall_policy:
result.extend(
firewalls_utils.ConvertFirewallPolicyRulesToEffectiveFwRules(
client, fp
)
)
result.extend(
firewalls_utils.ConvertNetworkFirewallRulesToEffectiveFwRules(
network_firewall
)
)
return result
... | Python | 1 |
_broker.get_broker().join("kairon_events", fail_fast=True)
worker.join()
assert len(mongo_broker.get_broker().queues['kairon_events'].queue) == 0
worker.stop()
@patch('kairon.shared.events.broker.mongo.Database', autospec=True)
@patch('kairon.shared.events.broker... | Python | 1 |
=> Result::Err(format!("Path Resolution Error: {}", err))
}
}
pub fn handle_load_context(path : String, glob_state : &mut GlobalState) {
let maybe_path_contents = read_from_path(&path);
match (maybe_path_contents) {
Result::Err(err) => {
println!("Load Context: IO Error: {}", err);
... | Rust | 0 |
# %%
from AIDL import *
def car_model(
car_length: float = 200.0,
car_height: float = 75.0,
wheel_diameter: float = 30.0,
window_margin_top: float = 10.0,
window_margin_side: float = 5.0
):
# Create a root structure for the car
car = Solid()
# Create substructures
car.body = Solid... | Python | 1 |
{
set_logger();
let servers: Vec<_> = matches
.values_of("SERVERS")
.unwrap()
.map(|addr| create_client(addr))
.collect();
let client_id = rand::random();
let mut client = Clerk::new(&servers, client_id);
if matches.is_present("BULK") {
let file = matches... | Rust | 0 |
pass
else:
pass
else:
break
else:
break
except:
return
@app.on_callback_query(filters.regex("GetTimer") & ~BANNED_USERS)
async def quite_timer(client,... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.