text string | label_name string | labels int64 |
|---|---|---|
import os
import jinja2
import ujson
import uvicorn
from geoip2 import database
from starlette.applications import Starlette
from starlette.middleware.cors import CORSMiddleware
from starlette.staticfiles import StaticFiles
from starlette.responses import HTMLResponse, UJSONResponse
from middleware import WWWRedirect... | Python | 1 |
2 = i.clone();
comp.with_on_click(move |display_id, value, idx| {
f.invoke(
&mut i2.lock(),
vec![display_id.0.into(), value.into(), idx.into()],
)
.map(|_| {})
});
}
Ok(comp)
}
pub f... | Rust | 0 |
import json
import torch
from llama import ModelArgs, Tokenizer, Transformer
def Llama7B_adapter(args, **kwargs):
llama_model_path = args.llama_model_path
model_name = "7B"
checkpoint = torch.load(llama_model_path + "/consolidated.00.pth", map_location="cpu")
print(llama_model_path + "/consolidate... | Python | 1 |
out=0.0)
cfg.update(**kwargs)
# init model
with torch.device('meta'):
model = WanVAE_(**cfg)
from mmgp import offload
# load checkpoint
logging.info(f'loading {pretrained_path}')
# model.load_state_dict(
# torch.load(pretrained_path, map_location=device), assign=True)
o... | Python | 1 |
from manim import *
class TextFuncExample(Scene):
def construct(self):
grp = VGroup(
# Text to color
Text("Hello", t2c={"[1:-1]": BLUE}),
Text("World", t2c={"rl": RED}),
# Text to font
Text("Manim", t2f={"an": "Open Sans"}),
Text("Man... | Python | 1 |
send(self) -> Result<bool> {
let form = serde_json::to_value(&self)?;
self.bot
.get::<bool>("answerShippingQuery", Some(&form))
.await
}
}
use std::collections::HashSet;
fn count_consistent_strings(allowed: String, words: Vec<String>) -> i32 {
let s: HashSet<char> = all... | Rust | 0 |
from unittest import main
from tests import *
if __name__ == '__main__':
main()
| Python | 1 |
crate::{BusinessCentralServices, UrlKeyValue};
use serde_json::Value;
pub async fn get_generic(
client: BusinessCentralServices,
path: &str,
resource_values: Vec<UrlKeyValue>,
) -> Result<Value, reqwest::Error> {
let response = client
.make_odata_request(
reqwest::Method::GET,
... | Rust | 0 |
if cur_frame:
origin_frame = cur_frame.origin_index
seg_preview = None
if cur_frame:
seg_preview = cur_frame.preview_data
... | Python | 1 |
er) = hmac_stream::<hmac::Poly1305>(pk, TEST_MAX_THREADS);
timer = Instant::now();
for chunk in stream_block.chunks(TEST_CHUNK_LEN) {
hwriter.write_all(&chunk).expect("write error");
}
drop(hwriter);
while let Ok(buf) = hreader.squeeze(TEST_CHUNK_LEN) {
... | Rust | 0 |
ck files starting with next_day*
yaml_paths = sorted(
glob.glob(os.path.join(args.dir, "next_day*.yml"))
+ glob.glob(os.path.join(args.dir, "next_day*.yaml"))
)
print(yaml_paths)
print(1)
if not yaml_paths:
print(f"No YAML files starting with 'next_day' found in {args.dir}", ... | Python | 1 |
ve 2x actual performance thresholds"""
print("Applying realistic 2x performance thresholds...")
print("This will set very aggressive limits based on actual measured performance.")
adjuster = RealisticThresholdAdjuster()
results = adjuster.adjust_all_thresholds()
total = sum(results.values())
p... | Python | 1 |
import numpy as np
from gym import spaces
from stable_baselines3.common.preprocessing import is_image_space
from stable_baselines3.common.vec_env.base_vec_env import VecEnv, VecEnvStepReturn, VecEnvWrapper
class VecTransposeImage(VecEnvWrapper):
"""
Re-order channels, from HxWxC to CxHxW.
It is required ... | Python | 1 |
5825bfabc37432958b063360d3ad6461c9c4735ae7f8edd46592a5e0f01452b2e4b5010000000170636c69656e745f646174615f6a736f6e58997b2274797065223a2022776562617574686e2e676574222c20226368616c6c656e6765223a2022476d6c6a4c584a6c6358566c63335174595856306143316b5a57786c5a32463061573975495f415149773979624b754a36593634394e6f6b715335575f6f37... | Rust | 0 |
.takes_value(false)
)
.arg(Arg::new("tsm_socket")
.long("tsm-socket")
.about("TSM Socket to connect")
.env("TME_TSM_SOCKET")
.default_value("/var/run/tableau/tab-controller-login-8850")
... | Rust | 0 |
p_recording(self):
"""Stop recording and queue the FINAL collected audio segment (Phase 3)"""
if not self.is_collecting:
logger.warning("stop_recording called but not collecting.")
return
logger.info("AudioManager: Stopping recording. Processing final segment... | Python | 1 |
# Copyright 2023 Spotify AB
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | Python | 1 |
/// together with the next jump index.
fn first_after(&self, start: u64) -> (u64, usize) {
let mut a = start - (start % (self.modulus as u64)) + (self.first as u64);
for index in 0..self.jl.len() {
if a >= start {
return (a, index);
}
a += self... | Rust | 0 |
"""
Author: bugface https://github.com/bugface
The script is based on Google's SentencePiece to train a vocab from local corpous
see more details at https://github.com/google/sentencepiece
note: training with a large corpus may take TB-level of RAM; sentencepiece can limit input number of sentences, we did not use
i... | Python | 1 |
.unwrap()
.as_f64()
.unwrap(),
7.0
);
()
}
}
}
<filename>GameBarrels/src/menu/plugin.rs
use bevy::prelude::*;
use crate::global_state::entities::MenuEntitiesController;
use crate::windows::status::WindowSta... | Rust | 0 |
Maps almost directly to the SBML transition output tag.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SbmlTransitionOutput {
pub id: Option<String>, // Note that a missing ID is not entirely according to spec, but they do appear in models people use.
pub qual_species: String,
pub transition_effect: Opti... | Rust | 0 |
0x6e00,
// Self::UnspecifiedCheckingError => 0x6f00,
// Self::Success => 0x9000,
// Self::MoreAvailable(x) => u16::from_be_bytes([0x61, x]),
// }
// }
//}
//impl Into<[u8; 2]> for StatusWord {
// #[inline]
// fn into(self) -> [u8; 2] {
// let sw: u16 = self.into... | Rust | 0 |
"""
Copyright (C) ARM Ltd. 2016. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to... | Python | 1 |
_planets = all_planets.difference([planet])
if pvp is None:
rv_model = self.rv_model(pv, rv_time + self._tref, [planet], add_sv=False, add_slope=False)
rv_others = self.rv_model(pv, planets=other_planets, add_sv=False, add_slope=False)
rv_model_limits = None
else:
... | Python | 1 |
arket.ensure(market)
perp_index: int = perp_market.group.slot_by_perp_market_address(
market.address
).index
return StubOracle(perp_market, perp_index, perp_market.group.cache)
return None
def all_available_symbols(self, context: Context) -> typing.Seque... | Python | 1 |
"""
Example AgentOS app with a custom FastAPI app with basic routes.
You can also run this using the FastAPI cli (pip install fastapi["standard"]):
```
fastapi run custom_fastapi_app.py
```
"""
from agno.agent import Agent
from agno.db.postgres import PostgresDb
from agno.models.anthropic import Claude
from agno.os i... | Python | 1 |
"""
pretty prints the MPD
usage:
python print.py path-mpd/
"""
import sys
import json
import time
import os
def process_playlists(path):
filenames = os.listdir(path)
for filename in sorted(filenames):
if filename.startswith("mpd.slice.") and filename.endswith(".json"):
ful... | Python | 1 |
Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
... | Rust | 0 |
from caffe2.python import core
import caffe2.python.hypothesis_test_util as hu
import caffe2.python.serialized_test.serialized_test_util as serial
from hypothesis import given, settings
import hypothesis.strategies as st
import numpy as np
class TestBatchMomentsOp(serial.SerializedTestCase):
def batch_moments... | Python | 1 |
_base_ = './mask_rcnn_r50_caffe_fpn_mstrain-poly_1x_coco.py'
# learning policy
lr_config = dict(step=[28, 34])
runner = dict(type='EpochBasedRunner', max_epochs=36)
| Python | 1 |
48x2048",
"(Extrapolation) 4096x1024",
"(Extrapolation) 1024x4096",
]
resolution = gr.Dropdown(value=res_choices[0], choices=res_choices, label="Resolution")
with gr.Row():
num_sampling_steps = gr... | Python | 1 |
.compile_protos(&["src/abi.proto"], &["src"])?;
Ok(())
}
<reponame>matthewljsmith/tracing-layer-slack
use crate::{ChannelReceiver, ChannelSender};
use crate::message::SlackPayload;
use tokio::task::JoinHandle;
/// Provides a background worker task that sends the messages generated by the
/// layer.
pub(cra... | Rust | 0 |
None => set_debug_level("Error").expect(
"Error setting debug level"
)
}
// Get Session
let session: Option<EvtHandle> = match get_session_from_matches(
&options
).expect("Error getting session from options") {
Some(s) => Some(s.0),
None => None
}... | Rust | 0 |
.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='djangoUserExtension.UserExtension')),
('task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.Task', verbose_name='Task')),
],
options={
'verbose_name': 'Work',
'v... | Python | 1 |
alueError(f"Expected data with shape (regions, time, subjects); got {data.shape}")
R, T, S = data.shape
sus = np.zeros(S, dtype=float)
densities = [None] * S if return_densities else None
# tqdm over subjects
for subj in tqdm(range(S), desc="Susceptibility: subjects", ncols=80):
# data[:, ... | Python | 1 |
_: List![A, B, C] = list![a, b, c];
}
{
let tail: List![A, B, C] = list![A(3), B("string".into()), C(true)];
let _: PrependList![D, E; List![A, B, C]] = prepend_list![D([1, 2]), E::E1; tail];
}
{
let tail: List![A, B, C] = list![A(3), B("string".int... | Rust | 0 |
onst lv_style_t;
}
extern "C" {
#[doc = " Get whether recoloring is enabled"]
#[doc = " @param mbox pointer to a message box object"]
#[doc = " @return whether recoloring is enabled"]
pub fn lv_mbox_get_recolor(mbox: *const lv_obj_t) -> bool;
}
extern "C" {
#[doc = " Get message box button matrix"]
... | Rust | 0 |
# Problem: F - Non-academic Problem - https://codeforces.com/gym/618729/problem/F
import sys
input = sys.stdin.readline
def solve():
t = int(input())
for _ in range(t):
n, m = map(int, input().split())
graph = [[] for _ in range(n + 1)]
for _ in range(m):
u, v = map(int, in... | Python | 1 |
td")]
#[ext]
pub impl<T: Seek> T
where Self: Sealed<T>
{
fn stream_position(&mut self) -> std::io::Result<u64> {
self.seek(SeekFrom::Current(0))
}
}
#[ext]
pub impl<T> [T]
where Self: Sealed<[T]>
{
fn fill_with<F>(&mut self, mut f: F)
where F: FnMut() -> T {
for el in self {
... | Rust | 0 |
Some(var_1217) = &input.version {
object.key("Version").string(var_1217);
}
if let Some(var_1218) = &input.binary_media_types {
let mut array_1219 = object.key("BinaryMediaTypes").start_array();
for item_1220 in var_1218 {
{
array_1219.value().string(item_122... | Rust | 0 |
afe { mem::transmute_copy(&output) }
}
#[inline(always)]
pub fn try_zip<L, R, T, F, E, const N: usize>(
lhs: [L; N],
rhs: [R; N],
mut fun: F,
) -> Result<[T; N], E>
where
F: FnMut(L, R) -> Result<T, E>,
{
// SAFETY: transmute_copy to [ManuallyDrop<L>; N]" and forget lhs
let mut lhs_items: [Manu... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
简化的DeepSeek作业批改运行脚本
"""
from config import MODEL_CONFIGS, DEFAULT_MODEL, HOMEWORK_DIR, OUTPUT_FILE, REQUEST_DELAY
from deepseek_grader import MultiModelGrader
import logging
# 设置日志格式
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s... | Python | 1 |
extern crate slog_term;
use rsm::primitives::event::*;
use rsm::raft::protocol::Payload;
use slog::{Drain, Level, LevelFilter, Logger};
use slog_term::{FullFormat, PlainSyncDecorator};
use slog_async::Async;
use std::collections::HashMap;
use std::io::stderr;
use std::env;
use std::path::Path;
use std::sync::Arc;
#[... | Rust | 0 |
installed packages")
installed_pkgs = dpkg_parser.get_installed_pkgs_from_dpkg_list(self.logger)
return installed_pkgs
except Exception as ex:
raise PkgCountError(ex)
def _get_ua_status_file_path(self):
ua_status_file_path = const.UA_STATUS_FILE
if self.i... | Python | 1 |
k_norm = id_log_likelihoods - np.log(np.sum(np.exp(log_likelihoods)))
logsumexp_value = np.log(np.sum(np.exp(log_lik_norm)))
else:
raise ValueError
log_likelihood_per_semantic_id.append(logsumexp_value)
return log_likelihood_per_semantic_id
def predictive_entropy(log_probs... | Python | 1 |
e<'future, breadx::Result>
where
'a: 'future,
'b: 'future;
}
impl<Dpy> GlScreen<Dpy> {
#[inline]
pub fn screen_index(&self) -> usize {
self.screen
}
#[inline]
pub(crate) fn from_indirect(
screen: usize,
fbconfigs: Arc<[GlConfig]>,
visuals: Arc<[G... | Rust | 0 |
split_dir = os.path.join(args.output_dir, args.split)
if not os.path.exists(split_dir):
os.makedirs(split_dir)
else:
split_dir = os.path.join(args.output_dir, args.split)
# Tokenize the whole dataset at once.
tokenize_fn = tokenize_function(tokenizer)
dataset_tokenized = ... | Python | 1 |
tToLog(logger, "runPreprocessor")
self._insar.procDoc.addAllFromCatalog(catalog)
def check_overlap(ldr_m, img_m, ldr_s, img_s):
from isceobj.Constants import SPEED_OF_LIGHT
rangeSamplingRateReference, widthReference, nearRangeReference = read_param_for_checking_overlap(ldr_m, img_m)
rangeSamplingRat... | Python | 1 |
'b, #);
foo_50903!('a, #);
foo_50903!(#);
//}}}
//{{{ issue 51477 ==============================================================
macro_rules! foo_51477 {
($lifetime:lifetime) => {
"last token is lifetime"
};
($other:tt) => {
"last token is other"
};
($first:tt $($rest:tt)*) => {
... | Rust | 0 |
t42;
mod t43;
mod t44;
mod t45;
mod t46;
mod t47;
mod t48;
mod t49;
mod t50;
mod t51;
mod t52;
mod t53;
mod t54;
mod t55;
mod t56;
mod t57;
<gh_stars>0
mod maps;
pub mod shaders;
mod shapes;
mod text;
use bevy_app::{App, CoreStage, Plugin};
use bevy_ecs::prelude::*;
use bevy_math::*;
use miniquad::*;
use crate::inpu... | Rust | 0 |
-> Option<E::Item> {
// while (self.offset == 0 && self.idx == 0) || self.get_raw_entry().is_deactivated() {
// // println!("\nentry {:?}", self);
// let exists = self.prev_entry();
// if !exists { return None; }
// // println!("-> prev {:?} inside {:#?}", self, ... | Rust | 0 |
class Node:
def __init__(self, value):
self.value = value
self.next = None
class Stack:
def __init__(self):
self.top = None
def push(self, value):
newNode = Node(value)
temp = self.top
self.top = newNode
self.top.next = temp
def pop(... | Python | 1 |
{
Host::X86_64AppleDarwin => "x86_64-apple-darwin",
Host::X86_64UnknownLinuxGnu => "x86_64-unknown-linux-gnu",
Host::X86_64PcWindowsMsvc => "x86_64-pc-windows-msvc",
Host::Other => unimplemented!()
}
}
}
impl<'a> From<&'a str> for Host {
fn from(s: &str)... | Rust | 0 |
"icon": "material/lightbulb",
"name": "Switch to light mode",
},
},
],
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will ove... | Python | 1 |
ed \")\".\
\n ,\
\n3 | @include incorrectly-terminated($a,$b,;\
\n | ^\
\n \'\
\n input.scss 3:41 root stylesheet",
);
}
use std::collections::HashMap;
use super::layer::{
AddLayer, AddLayerCollection, CollectionItem, L... | Rust | 0 |
r.0 / dxm.0) - sqr(r.1 / dxm.1) - sqr(r.2 / dxm.2);
exponent.exp() * (2.0 * f64::consts::PI * frequency_in_x_direction * r.0).sin()
}
fn sqr<T: Copy + Mul<T>>(value: T) -> T::Output {
value * value
}
fn exchange_hfields(field: &mut Field, grid: Dimensions) {
for z in 0..grid.2 {
for y in 0..grid.1... | Rust | 0 |
let errmsg = format!("msgid {} doesn't exist", msgid);
let msg = session.pop_server_message(msgid).expect(errmsg.as_str());
let response = AuthResponse::from(msg).unwrap();
match response.error_code() {
AuthError::Nil => {
let f = self.send_get_keyfile(sessi... | Rust | 0 |
use internal::styles;
use internal::word_boundaries;
use internal::index_set;
use internal::selection;
use internal::movement;
use internal::syntax;
use internal::layers;
#[cfg(target_os = "fuchsia")]
use internal::fuchsia;
use tabs::Documents;
use rpc::Request;
#[cfg(target_os = "fuchsia")]
use apps_ledger_services... | Rust | 0 |
import torch
import torch.nn.functional as F
import numpy as np
def softmax(x):
z = x - max(x)
numerator = np.exp(z)
denominator = np.sum(numerator)
softmax = numerator/denominator
return softmax
@torch.no_grad()
def get_logprobs_causal(model, processor, prompt, device):
torch.manual_seed(42... | Python | 1 |
success=False,
code=500,
message=get_message(MessageKeys.INTERNAL_ERROR),
data=None
)
@router.put("/{conversation_id}", response_model=ApiResponse[ConversationResponse])
async def update_conversation(
conversation_id: str,
conversation_update: ConversationUpdate,
... | Python | 1 |
let mut request = String::new();
println!("NODE1: SENDING DATE REQUEST {}", "DATE");
match socket.write_all("DATE".as_bytes()) {
Ok(_) => {
match socket.read_to_string(&mut request) {
Ok(_) => { println!("NODE1: RECEIVED DATE {}", request); },
Err(err) ... | Rust | 0 |
_base_ = [
'../_base_/models/changer_s50.py',
'../common/standard_256x256_200k_cau.py']
crop_size = (256, 256)
model = dict(
backbone=dict(
interaction_cfg=(
None,
dict(type='SpatialExchange', p=1/2),
dict(type='ChannelExchange', p=1/2),
dict(type='C... | Python | 1 |
coded).map(TextureImage::Rgba)
}
image::ColorType::RGB(_) => {
image::ImageBuffer::from_raw(ctx.w, ctx.h, decoded).map(TextureImage::Rgb)
}
image::ColorType::Gray(_) => {
let raw = image::ImageBuffer::<image::Luma<u8>, _>::from_raw(ct... | Rust | 0 |
ix) in sample_names.iter().zip(index_vec) {
index_hash_sets
.entry(sample_name.clone())
.or_insert(HashSet::new())
.insert(ix.clone());
}
for (sample_name, ix2) in sample_names.iter().zip(index2_vec) {
index2_hash_sets
.entry(sample_name.clone())... | Rust | 0 |
text: CallbackContext):
"""Show appeal statistics (admin only)"""
try:
if update.effective_user.id != ADMIN_ID:
update.message.reply_text("❌ Access denied.")
return
conn = get_db_connection()
if not conn:
update.message.reply_text("❌ Datab... | Python | 1 |
if addr & 0b0000_0001_0000_0000 == 1 {
// (XXXXBBBB - X = Don't cares, B = bank select bits)
self.rom_bank = (value & 0x0f) as usize;
}
}
// 4 bit 区域
0xa000..=0xa1ff => self.write_via_ram_bank(addr, value & 0b1111),
... | Rust | 0 |
;
pub const WEBKIT_WEBSITE_DATA_OFFLINE_APPLICATION_CACHE: WebKitWebsiteDataTypes = WebKitWebsiteDataTypes::OFFLINE_APPLICATION_CACHE;
pub const WEBKIT_WEBSITE_DATA_SESSION_STORAGE: WebKitWebsiteDataTypes = WebKitWebsiteDataTypes::SESSION_STORAGE;
pub const WEBKIT_WEBSITE_DATA_LOCAL_STORAGE: WebKitWebsiteDataTypes = We... | Rust | 0 |
#!/usr/bin/env python3
from dev_aberto.dev_aberto import hello
import gettext
gettext.bindtextdomain('cli', 'locale')
gettext.textdomain('cli')
_ = gettext.gettext
if __name__ == '__main__':
date, name = hello()
print(_('Último commit feito em:'), date, _(' por'), name)
| Python | 1 |
vchan_sys::libvchan_read(self.inner, buffer.as_mut_ptr() as _, buffer.len()) };
if res == -1 {
Err(Error::last_os_error())
} else {
assert!(res >= 0, "read negative number of bytes?");
Ok(res as _)
}
}
}
impl Drop for Vchan {
fn drop(&mut self) {
... | Rust | 0 |
asset directory in a `build.rs` file.
///
/// Bundling assets and setting an asset path using
/// [`vial::asset_dir!()`](macro.asset_dir.html) are mutually
/// exclusive - you can't do both, as enabling bundling will set the
/// asset path for you. Therefor if you are making the transition from
/// using-assets-but-not... | Rust | 0 |
32, 'word_id'] == 'kénnen':
return insert_row(subdf, 232, 'beispielsweise')
else:
return subdf
except:
import pdb;
pdb.set_trace()
def merge_rows(df, index0, index1):
df.loc[index0] = [df.loc[index0, "Unnamed: 0"],
np.nansum([df.loc[index0,... | Python | 1 |
CLAVE, b"MRENCLAVE2", &sealed_b);
}
#[test]
#[should_panic]
fn test_incorrect_ciphertext_a() {
let sealed_b = seal(Keypolicy::MRENCLAVE, b"MRENCLAVE", b"Mr. Enclave");
unseal(Keypolicy::MRENCLAVE, b"MRENCLAVE", &sealed_b[..2]);
}
#[test]
#[should_panic]
fn test_incorrec... | Rust | 0 |
0b0000_0000_0000_00), ProcessId(0b0100_0000_0000_00), 2),
(ProcessId(0b1000_0000_0000_00), ProcessId(0b0000_0000_0000_00), 2),
(ProcessId(0b0000_0000_0000_00), ProcessId(0b1000_0000_0000_00), 2),
];
for (pid1, pid2, expected) in tests.iter().copied() {
let got = diff... | Rust | 0 |
from __future__ import absolute_import
import time
def retry(name, target, retry={}, **kwargs):
'''
Wraps an existing salt state into a retriable form.
name
A user-defined name.
target
Name of the salt state to invoke.
retry
This allows you to provide `attempts` and `in... | Python | 1 |
iter(|| v._is_shattered(&[1, 4]));
}
#[bench]
fn _is_shattered_3_20(b: &mut Bencher) {
let v = VcDim::with_random_polygon(20, MODE);
b.iter(|| v._is_shattered(&[1, 4, 7]));
}
#[bench]
fn _is_shattered_3_40(b: &mut Bencher) {
let v = VcDim::with_random_polygon(40, MODE);
... | Rust | 0 |
ut_transaction::tx_group::TxGroup;
use algonaut_transaction::{account::Account, ConfigureAsset, Pay, SignedTransaction, TxnBuilder};
use dotenv::dotenv;
use std::convert::TryInto;
use std::env;
use std::error::Error;
use tokio::test;
#[test]
async fn test_transaction() -> Result<(), Box<dyn Error>> {
// load varia... | Rust | 0 |
dling on chrX.
parser.add_argument("--gender", dest="gender", choices=["male", "female", "auto", "none"], default="auto",
help="Specify sex. This determines how haploid calls on chrX get treated: for male samples,"
" all non-ref calls (in the truthset only when r... | Python | 1 |
import usuarios
import menuUsuario
import tester
from colorama import Fore
class MenuAdministrador:
def verUsuarios():
# tester.limpiarPantalla()
print(f'{Fore.CYAN}USUARIOS{Fore.RESET}')
usuarioLista = MenuAdministrador.verUsuarios()
for i, usuario in enumerate(usuarioLista, star... | Python | 1 |
# def calculate_total(n, coordinates):
# d = {}
# for x, y in coordinates:
# if x not in d:
# d[x] = []
# d[x].append(y)
# res = 0
# for i in d:
# d[i].sort(reverse=True)
# res += sum(d[i][:i])
# return res
# t = int(input())
# for _ in range(t):
# n ... | Python | 1 |
er_col = 5
for user in users:
sheet.cell(row=day_row, column=user_col, value=user_assignments[user].get(day, 0))
sheet.cell(row=day_row, column=user_col + 1, value=user_replies[user].get(day, 0))
user_col += 2
day_row += 1
return workbook
class ExportTicketsTa... | Python | 1 |
or {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
TokenSendError::Channel(ref e) => write!(f, "Channel error: {}", e),
TokenSendError::Pipe(ref e) => write!(f, "IO error: {}", e),
}
}
}
const STDIN_ERROR_MSG: &'static str = "Failed to get FD of st... | Rust | 0 |
qual(height_florestad, floresta_chain["height"])
self.assertEqual(height_florestad, utreexod_chain["blocks"])
self.log("=== Check that florestad has the same blockcount as bitcoind...")
bitcoind_chain = self.bitcoind.rpc.get_blockchain_info()
height_bitcoind = self.bitcoind.rpc.get_bloc... | Python | 1 |
ptorSetWrite<'a>],
/// Writes to the descriptor set.
pub copies: &'a [DescriptorSetCopy<'a>],
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct DescriptorSetWrite<'a> {
/// Binding index.
pub binding: u32,
/// First element index.
/// Must be zero for non-array bindings.
pub... | Rust | 0 |
and parameters are used.",
);
#[cfg(feature = "synthesis")]
let command = add_subcommand_combinations!(command, command_name, true; poly_fit_interpolator, derive, synthesize, write);
#[cfg(not(feature = "synthesis"))]
let command = add_subcommand_combinations!(command, command_name, true; poly... | Rust | 0 |
x98V\xf5\xc5\xe7\xc7t\xd4\xed=\xab8\
[\xbcl\xe2(\xe7\xd9\xbf\xfe\xf5\xafN\xa8\x98<i\
\xba\x94\x93S\xd2PW\xef\x07\x90\x0d \x0b\x80=v\
\x0d2\xf8\xdfW{\xed\xda%{\x1f\xf4\xee\xa1\x15\xb4\
\xe5\xf0\xac\xdb\x08\x82 \x88\xd40{oi\xd7E\x00\
\xa5\xb6\xde\xf6\xef6\xd4\xd7OG\xf2{\x09H|_\
\xb1\xe5\xf0\xceG\x0c/x\xbf/\xef\xf7\xefO\x... | Python | 1 |
# usinf walrus operator
# the walrus operator (:=), introduced in python 3.8, allows you to assign values to variables as part of an expression.
if(n := len([1,2,3,4])) > 3:
print(f"List is too long ({n} elements, expected < 3)")
# Output => List is too long (4 elements, expected < 3
# In this example, n is ass... | Python | 1 |
a: *const GLvoid,
flags: GLbitfield,
) {
#[cfg(feature = "debug")] { _gl_print_debug("glBufferStorage"); }
#[cfg(feature = "error")] { _gl_check_for_last_error(self); }
if self.glBufferStorage == ptr::null_mut() {
_gl_impl_panic("glBufferStorage"... | Rust | 0 |
spawn(async move {
let listener = Webserver::new(port);
listener
.listen(ctx.clone(), config_lock.clone(), guild_id.clone())
.await;
});
} else {
let death_keywords = config_lock.read().aw... | Rust | 0 |
s(map: &mut BTreeMap<String, SecurityScheme>) {
update_security_definitions::<Self>(map);
}
}
impl<T> OperationModifier for Option<T>
where
T: OperationModifier,
{
fn update_parameter(op: &mut DefaultOperationRaw) {
T::update_parameter(op);
}
fn update_response(op: &mut DefaultOper... | Rust | 0 |
#
# Python WAMP client: callee that handles RPC from echo_caller.py
#
# Install dependencies:
# make
#
# Run this client:
# ./pyenv/bin/python echo_callee.py
#
import asyncio
from autobahn.asyncio.wamp import ApplicationSession
from autobahn.asyncio.component import Component, run
class Backend(ApplicationSess... | Python | 1 |
from input DHT primitives
pub fn construct_response<'a>(
address: &AgreementAddress, e: &Entry, (
commitments,
economic_events,
): (
Option<Cow<'a, Vec<CommitmentAddress>>>,
Option<Cow<'a, Vec<EventAddress>>>,
),
) -> ResponseData {
ResponseData {
agreement: Resp... | Rust | 0 |
pub const ONE_CONTAINER_TARGET: i32;
pub const MULTI_CONTAINER_TARGET: i32 = ONE_CONTAINER_TARGET * CONTAINERS + KUBERNETES + BACKGROUND;
macro_rules! set_last_activity {
($last:expr) => {{
unsafe {
LAST_ACTIVITY = $last;
}
}};
}
macro_rules! update_mem {
() => {{
let mut total_ram = TOTAL_RAM;
let... | Rust | 0 |
let local_impls = self.impl_data
.values()
// Only keep local impls (i.e. impls in the current crate)
.filter(|impl_datum| impl_datum.binders.value.impl_type == ImplType::Local);
for impl_datum in local_impls {
if !solver.orphan_check(impl_datum) {
... | Rust | 0 |
une", "vos", "votre", "vous", "c", "d", "j", "l", "à", "m", "n", "s", "t",
"y", "été", "étée", "étées", "étés", "étant", "suis", "es", "est", "sommes", "êtes", "sont",
"serai", "seras", "sera", "serons", "serez", "seront", "serais", "serait", "serions", "seriez",
"seraient", "étais", "était", "étions", "éti... | Rust | 0 |
i);
}
n = ((0) as i32);
i = ((0) as i32);
while (i < num_ranges) {
n += (((*ranges.offset((i) as isize)).num_chars) as i32);
c_runtime::preInc(&mut i);
}
rects = ((c_runtime::malloc(std::mem::size_of::<stbrp_rect>() as u64 * ((n) as u64)))
as *mut stbrp_rect);
if rect... | Rust | 0 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe import scrub
from frappe.model.utils.rename_field import rename_field
def execute():
for doctype in ("Salary Component", "Salary Detail"):
if frappe.db.has_colu... | Python | 1 |
s
if subjectID is not None:
fname_sup = f"view_sup_{subjectID}{ext}"
fname_inf = f"view_inf_{subjectID}{ext}"
fname_left = f"view_left_{subjectID}{ext}"
fname_right = f"view_right_{subjectID}{ext}"
fname_ant = f"view_ant_{subjectID}{ext}"
f... | Python | 1 |
k2.borrow().using_encoded(Self::Hasher2::hash);
let mut final_key = Vec::with_capacity(
module_prefix_hashed.len()
+ storage_prefix_hashed.len()
+ key1_hashed.as_ref().len()
+ key2_hashed.as_ref().len()
);
final_key.extend_from_slice(&module_prefix_hashed[..]);
final_key.extend_from_slice(&stor... | Rust | 0 |
def require(*types):
'''
Return a decorator function that requires specified types.
types -- tuple each element of which is a type or class or a tuple of
several types or classes.
Example to require a string then a numeric argument
@require(str, (int, long, float))
will do the tric... | Python | 1 |
).unwrap();
o
}
pub fn batch_additions(&self, additions: &[Element]) -> Element {
Element(
additions
.iter()
.map(|v| {
let mut vv = v.0;
vv.add_assign(&self.0);
vv
})
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.