text string | label_name string | labels int64 |
|---|---|---|
name = tmp[0] + "__" + nnunet + "__" + tmp[1] + "__" + tmp[2] + "__" + tmp[3].split(".")[0]
global_dice_json = join(base_dir, nnunet, tmp[1], tmp[0], tmp[2] + "__" + tmp[3].split(".")[0], "fold_0", "validation_tiledTrue_doMirror_True", "global_dice.json")
ass... | Python | 1 |
volname, fs, opts) in volumes.iter()
{
let vh = match ::kernel::metadevs::storage::VolumeHandle::open_named(volname)
{
Ok(vh) => vh,
Err(e) => {
panic!("Unable to open {}: {}", volname, e);
},
};
match ::kernel::vfs::mo... | Rust | 0 |
mut scope_568 = writer.prefix("PrivateIpAddress");
if let Some(var_569) = &input.private_ip_address {
scope_568.string(var_569);
}
#[allow(unused_mut)]
let mut scope_570 = writer.prefix("SubnetId");
if let Some(var_571) = &input.subnet_id {
scope_570.string(var_571);
}
#[all... | Rust | 0 |
nt::{BigInt, BigUint, Sign};
use num_traits::One;
use proc_macro::TokenStream;
use std::str::FromStr;
use syn::{Expr, Item, ItemFn, Lit};
mod unroll;
fn parse_string(input: TokenStream) -> Option<String> {
let input: Expr = syn::parse(input).unwrap();
let input = if let Expr::Group(syn::ExprGroup { expr, .. }... | Rust | 0 |
al[:, :, -1].unsqueeze(-1).expand(-1, -1,
num_keep_attn_map)) + 0 # (B, rN, rN) without gradient 0/1 mask
patch_attn_static= patch_attn[:, agent_N+map_N: , agent_N+map_N:]
patch_attn_prune_static = batc... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2020 Michael J. Hayford
"""Various generators and utilities for producing 2d distributions
.. Created on Tue Mar 24 21:14:31 2020
.. codeauthor: Michael J. Hayford
"""
import math
import numpy as np
def grid_ray_generator(grid_rng):
"""Generator func... | Python | 1 |
Num::Int(i) => Ok(Val::Int(i)),
Num::Flo(f) => Ok(Val::Flo(f)),
}
}
#[doc(hidden)]
#[inline]
fn into_slot(self) -> GResult<Slot> {
match self {
Num::Int(i) => Ok(Slot::Int(i)),
Num::Flo(f) => Ok(Slot::Flo(f)),
}
}
}
impl<T: IntoVa... | Rust | 0 |
yLoc::Arg(i));
if let Some(&(_old_ty, new_ty)) = ty_replace_map.get(&k) {
expect!([e.kind] ExprKind::Call(_, ref mut args) => {
if let Some(ty) = cx.opt_node_type(args[i].id) {
if ty_compare.eq_tys(ty, new_ty) {
... | Rust | 0 |
'a, T>),
}
impl<'a, T> Iterator for Iter<'a, T> {
type Item = &'a T;
fn next(&mut self) -> Option<Self::Item> {
match self {
Self::None => None,
Self::One(it) => it.next(),
Self::Many(it) => it.next(),
}
}
}
pub enum IntoIter<T> {
None,
One(iter... | Rust | 0 |
StdResult, Storage, Uint128,
};
use primitive_types::U256;
use secret_toolkit::snip20;
use secret_toolkit::storage::{TypedStore, TypedStoreMut};
pub fn init<S: Storage, A: Api, Q: Querier>(
deps: &mut Extern<S, A, Q>,
env: Env,
msg: ProfitDistributorBInitMsg,
) -> StdResult<InitResponse> {
let mut con... | Rust | 0 |
#!/usr/bin/python
import sys
file1 = sys.argv[1]
file2 = sys.argv[2]
with open(file1, 'r') as f1, open(file2, 'r') as f2:
for line1, line2 in zip(f1, f2):
spline1 = line1.split('\t')
spline2 = line2.split('\t')
if spline1[-1] != spline2[-1]:
# split the lines on tab, print the... | Python | 1 |
b balance_delta: Decimal,
pub available_delta: Decimal,
pub currency: Currency,
pub description: String,
}
/// Contains a list of transactions.
#[derive(Debug, Deserialize)]
pub struct ListTransactionsResponse {
pub id: String,
pub transactions: Vec<Transaction>,
}
/// Contains a list of pending transactions.
#[... | Rust | 0 |
#
# Gavin McKenzie
# 4/16/24
# Boss Subclass
import random
from time import sleep
import Creature
class Boss(Creature.Creature):
def __init__(self, name, atk, deff, hp, status='', love=''):
super().__init__(self, name, atk, deff, hp, status)
self.love = love
def stats(self):
print(f"T... | Python | 1 |
me() != "TestShaderPropertiesNodeOSL" and \
node.GetName() != "TestShaderPropertiesNodeARGS" :
# We will parse color4 in MaterialX and UsdShade. Not currently
# supported in OSL. rman Args also do not support / require color4 type.
property = nodeInputs["inputColor4"]
assert prop... | Python | 1 |
pub struct AccessContext {
pub base: BaseContext,
pub access_token: models::AccessToken,
expires_at: chrono::DateTime<chrono::Utc>,
}
impl AccessContext {
const TIME_EXPIRATION_TOLERANCE: i64 = 60;
pub fn new(base: BaseContext, access_token: models::AccessToken) -> AccessContext {
let expi... | Rust | 0 |
# -*- coding: UTF-8 -*-
'''
Authorized by vlon Jang
Created on May 28, 2016
Email:zhangzhiwei@ict.ac.cn
From Institute of Computing Technology
All Rights Reserved.
'''
import pandas as pd
import numpy as np
import pymysql
import matplotlib
matplo... | Python | 1 |
mg_np[[2, 1, 0], :, :] #RGB to BGR -> in numpy, if using OpenCV, else not needed. Only if image has colors.
# TODO: Check: could denormalize in the begining in tensor form instead
if denormalize:
img_np = np_denorm(img_np) # denormalize if needed
if change_range:
img_np = np.clip(
... | Python | 1 |
= RTree::bulk_load(vec![
/// [0.0, 0.0],
/// [0.0, 1.0],
/// ]);
///
/// let nearest_neighbors = tree.nearest_neighbor_iter(&[0.5, 0.0]).collect::<Vec<_>>();
/// assert_eq!(nearest_neighbors, vec![&[0.0, 0.0], &[0.0, 1.0]]);
/// ```
pub fn nearest_neighbor_iter(
&self,
... | Rust | 0 |
String::new(py, "hello").into());
// This does a round-trip.
assert_tokens(
&pyobj,
&[Token::Bytes(&[
128, 4, 149, 9, 0, 0, 0, 0, 0, 0, 0, 140, 5, 104, 101, 108, 108, 111, 148, 46,
])],
);
}
/// Re-use Python's value semantics in Rust code.
impl PartialEq for TdPyAny {
... | Rust | 0 |
import sys
import os
import pytest
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from fastapi.testclient import TestClient
from main import app
# Create a test client instance to simulate HTTP requests
client = TestClient(app)
# Test 1: Chat endpoint returns a valid response
def t... | Python | 1 |
]
pub struct _ID;
#[doc = "`read()` method returns [id::R](id::R) reader structure"]
impl crate::Readable for ID {}
#[doc = "Flash Module Identification Register"]
pub mod id;
#[doc = "Flash Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--w... | Rust | 0 |
l fails
class MyWordControl(activex.Control, WordModule.Word): ...
style = win32con.WS_CHILD | win32con.WS_VISIBLE | win32con.WS_OVERLAPPEDWINDOW
self._obj_.CreateWindow(None, title, style, rect, parent)
rect = self.GetClientRect()
rect = (0, 0, rect[2] - rect[0], rect[3] - rec... | Python | 1 |
# ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributio... | Python | 1 |
"""Here you can found Bot class and Database worker class"""
import vk_api
import datetime
import time
import requests
import logging
import pyowm
import random
import json
import re
import threading
import wikipediaapi as wiki
import config
from pyowm.utils.config import get_default_config
from collections import dequ... | Python | 1 |
y"
ASSISTANT_INFO = f"{ASSISTANT}/info"
def get_api_info() -> Dict[str, Any]:
"""获取API信息"""
return {
"service": AppConstants.APP_NAME,
"version": AppConstants.APP_VERSION,
"status": "running",
"description": AppConstants.APP_DESCRIPTION,
"endpoints": {
"... | Python | 1 |
0,
xor_thing: time.as_secs(),
}
}
/// Round function in cipher for room id.
fn round(nr: u64, round: u64) -> u64 {
(((nr ^ (65521 + round * 3)).wrapping_add(11)) << 1) & BITMASK
}
/// Transform counter to room id using Feistel cipher.
fn crypt(&self, nr: u64) -> u6... | Rust | 0 |
import datetime
import jwt
import pytest
from pcapi import settings
from pcapi.core.users import utils as user_utils
from pcapi.core.users.utils import ALGORITHM_HS_256
from pcapi.core.users.utils import ALGORITHM_RS_256
from pcapi.core.users.utils import decode_jwt_token_rs256
from pcapi.core.users.utils import enco... | Python | 1 |
c_long, getenv, getgrnam as libc_getgrnam, getpwnam as libc_getpwnam, putenv, setenv,
sysconf, unsetenv,
};
use std::ffi::CStr;
use std::mem;
use std::os::raw::c_char;
use super::utils::{allocate_on_stack, copy_cstr_into_wasm, copy_terminated_array_of_cstrs};
use crate::webassembly::Instance;
// #[no_mangle]
///... | Rust | 0 |
iteUrl')
sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
sThumb = oInputParameterHandler.getValue('sThumb')
oRequestHandler = cRequestHandler(sUrl)
sHtmlContent = oRequestHandler.request()
sPattern = 'class="fa fa-play-circle-o"><\/i>([^<]+)<\/div>|href="([^"]+)" title="([^"]+)" targe... | Python | 1 |
"""This script automates the copying of the default keymap into your own keymap.
"""
import shutil
from milc import cli
from milc.questions import question
from qmk.path import is_keyboard, keymaps, keymap
from qmk.git import git_get_username
from qmk.decorators import automagic_keyboard, automagic_keymap
from qmk.ke... | Python | 1 |
95\x13\x89\xa2i)Z\x0b\x88z#\
\x1b\xd0\x9au\x1b\x94K6\xc2\x0e\x8b\xe8\x9b\x04HX\
}\xe6K_]u;\xaf#\xc2G\xedQ\xf7\xb1\x88\
F\x95\x82\x0d\x17/\x00\xbc\x82\xba\xd9I'&\x09\x85\
\x9f6\xb6\x8fK\x91\xbew\x87#v\x06\x91\x84\x7f?\
`\x8f\xcam?p\xc6\x0e\xe7\xd3v\xabU\xf2-\x1e\
\xac\xdc\xb3\xf6\x0b\xd7\xed\x11\x8e\x1f$\x9d5T\x9f4\
\x8... | Python | 1 |
"""
Hello animation example
================================================================================
Sketch to move elements on the screen.
* Author(s): Juan Sulca
Implementation Notes
--------------------
**Software and Dependencies:**
* Adafruit CircuitPython firmware for the supported boards:
https://... | Python | 1 |
from openai import OpenAI
from rich import print
from sparrow import MeasureTime, yaml_load # pip install sparrow-python
config = yaml_load("config.yaml", rel_path=True)
print(f"{config=}")
client = OpenAI(
api_key=config['api_key'],
base_url=config['api_base'],
)
stream = True
n = 1
# debug = True
debug =... | Python | 1 |
"]
#[doc = " - ::ZE_RESULT_ERROR_UNINITIALIZED"]
#[doc = " - ::ZE_RESULT_ERROR_DEVICE_LOST"]
#[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE"]
#[doc = " + `nullptr == hContext`"]
#[doc = " - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER"]
#[doc = " + `nullptr == desc`"... | Rust | 0 |
fn value(&self) -> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<SMM2CourseArea_LiquidMode> {
match value {
0 => ::std::option::Option::Some(SMM2CourseArea_LiquidMode::FIXED),
1 => ::std::option::Option::Some(SMM2CourseArea_LiquidMode::ONE_WAY),... | Rust | 0 |
from dataclasses import dataclass
from src.data_types.instrument.sensor_type import SensorType
@dataclass
class SensorMetadata:
"""
Metadata for SensorData
"""
sensor_type: SensorType
sampling_rate: float
unit: str
| Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOfflineProviderCollaborateTaskAcceptModel(object):
def __init__(self):
self._biz_time = None
self._out_biz_no = None
self._task_no = None
@property
def biz_... | Python | 1 |
max, pclk_max) = match pwr.vos {
VoltageScale::Scale0 => (480_000_000, 240_000_000, 120_000_000),
VoltageScale::Scale1 => (400_000_000, 200_000_000, 100_000_000),
VoltageScale::Scale2 => (300_000_000, 150_000_000, 75_000_000),
_ => (200_000_000, 100_000_000, 50_000_000),
... | Rust | 0 |
// You should have received a copy of the MIT License
// along with this software.
// If not, see <https://opensource.org/licenses/MIT>.
use gtk::prelude::*;
use std::ops::RangeInclusive;
use std::rc::Rc;
use std::str::FromStr;
use bitcoin::secp256k1;
use bitcoin::util::bip32::{
self, ChildNumber, DerivationPath,... | Rust | 0 |
# cook your dish here
s=input()
if s[0]==s[2] and s[1]=='w':
print("Cute")
else:
print("No")
| Python | 1 |
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script.
"""Public API for tf._api.v2.__internal__.distribute.multi_process_runner namespace
"""
import sys as _sys
from tensorflow.python.distribute.multi_process_runner import NotInitializedEr... | Python | 1 |
# -*- coding: utf-8 -*-
"""
医疗智能体ART强化学习训练系统 / Medical AI Agent ART Reinforcement Learning Training System
流程图 / Flowchart:
```mermaid
graph TB
A[开始 Start] --> B[加载配置文件 Load Config]
B --> C[检查HF数据集 Check HF Dataset]
C --> D{数据集存在? Dataset Exists?}
D -->|是 Yes| E[下载HF数据集 Download HF Dataset]
D -->|否... | Python | 1 |
w: self }
}
#[doc = "Bits 4:7 - Write 1 to instantly clear internal SM state which may be otherwise difficult to access and will affect future execution. Specifically, the following are cleared: input and output shift counters; the contents of the input shift register; the delay counter; the waiting-on-IRQ sta... | Rust | 0 |
import os
from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.files import *
from conan.tools.layout import basic_layout
required_conan_version = ">=2.1"
class TaoCPPSequencesonan(ConanFile):
name = "taocpp-sequences"
license = "MIT"
homepage = "https://github.com... | Python | 1 |
dule.block_reward(100000) - emission.block_reward(100000) < schedule.block_reward(100000) / 1000);
assert!(schedule.block_reward(200000) - emission.block_reward(200000) < schedule.block_reward(200000) / 1000);
assert!(emission.block_reward(700000) - schedule.block_reward(700000) < schedule.block_reward(... | Rust | 0 |
ub index: u32,
}
impl MsgSend for SetAnchorIndex {
type RetType = WinResult<()>;
fn convert_ret(&self, v: isize) -> Self::RetType {
match v as i32 {
LB_ERR => Err(co::ERROR::BAD_ARGUMENTS),
_ => Ok(()),
}
}
fn as_generic_wm(&self) -> WndMsg {
WndMsg {
msg_id: co::LB::SETANCHORINDEX.... | Rust | 0 |
;
pub const LOCK_ID_CHAIN_ID: u64 = 1_001;
pub const LOCK_ID_BUTTON: u64 = 1_007;
pub fn utxo_recover(config_path: &Path, height: u64) {
let storage_config = StorageConfig::new(config_path.to_str().unwrap());
let db = DB::new(&storage_config.db_path, &storage_config);
let controller_config = ControllerConf... | Rust | 0 |
off::new(Duration::from_millis(500)))
.with_min_connectivity(1.0)
.with_shutdown_signal(shutdown_signal)
.build()?;
add_all_peers(&comms.peer_manager(), &comms.node_identity(), seed_peers).await?;
// Create outbound channel
let (outbound_tx, outbound_rx) = mpsc::channel(10);
l... | Rust | 0 |
_certificate).unwrap()
}
pub fn to_hex_string(bytes: Vec<u8>) -> String {
let strs: Vec<String> = bytes.iter()
.map(|b| format!("{:02x}", b))
.collect();
strs.join("")
}
/*
* Consensus related sanity checks to be done here
* If all checks pass but WC < CC, forced sleep is
* induced to sync up the ... | Rust | 0 |
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from typing import Any, Dict, List, Optional, TypedDict
import frappe
from frappe import _
from frappe.query_builder.functions import Sum
class StockBalanceFilter(TypedDict):
company: Optional[str... | Python | 1 |
nfigError> {
if self.target != other.target || self.field != other.field {
return Err(BasiliqStoreConfigError::TargetConfigChange);
}
self.enabled = other.enabled;
Ok(())
}
}
#![feature(test)]
extern crate test;
use test::Bencher;
use std::collections;
use hashbrown;
u... | Rust | 0 |
# Copyright (c) 2021-2025, InterDigital Communications, Inc
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the disclaimer
# below) provided that the following conditions are met:
# * Redistributions of source cod... | Python | 1 |
MEDIUM_GRAY: Color = Color {
r: 0.533,
g: 0.533,
b: 0.533,
a: 1.0,
};
pub const GROOVES: Color = Color::hex_const("#252A2B");
pub const GROOVES_DARK: Color = Color::hex_const("#0D0D0D");
<reponame>sthagen/rusterlium-rustler
use rustler::{Error, NifResult};
mod atoms {
rustler::atoms! {
err... | Rust | 0 |
if is_train:
pl_module.train()
def check_frequency(self, check_idx):
return check_idx % self.batch_freq == 0
def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch_idx, dataloader_idx):
if not self.disabled:
self.log_img(pl_module, batch, ba... | Python | 1 |
= f"{Llama3_8B['model_type']}_{Llama3_8B['hidden_size']}_{Llama3_8B['num_attention_heads']}_{Llama3_8B['num_hidden_layers']}.onnx"
config = transformers.PretrainedConfig(**Llama3_8B)
m = transformers.LlamaForCausalLM(config)
ids = torch.zeros((1, 512), dtype=torch.long)
torch.onnx.export(m, ids, tmpfile... | Python | 1 |
# Python OAuth example
import evernote.edam.userstore.constants as UserStoreConstants
import evernote.edam.type.ttypes as Types
from evernote.api.client import EvernoteClient
##
# Helper function to turn query string parameters into a
# Python dictionary
##
def parse_query_string(authorize_url):
uargs = authoriz... | Python | 1 |
s.y,pos.z])
leaf_points.append(np_pos)
leaf_points=np.array(leaf_points)
n_clusters =5
# Step 1: Apply K-means clustering directly to the original 3D data
kmeans_3d = KMeans(n_clusters=n_clusters)
labels_3d = kmeans_3d.fit_predict(leaf_points)
pca_after_clustering = PCA(n_components=... | Python | 1 |
!(
unsafe { &(*(0 as *const drm_control)).func as *const _ as usize },
0usize,
concat!(
"Alignment of field: ",
stringify!(drm_control),
"::",
stringify!(func)
)
);
assert_eq!(
unsafe { &(*(0 as *const drm_control)).irq as *... | Rust | 0 |
r.set_X(0x01);
b.memory[0x80] = 0xB4;
b.memory[0x81] = 0x11;
b.memory[0x12] = 0xFF;
run(&mut r ,&mut b, &mut false);
assert_eq!(r.get_Y(), 0xFF)
}
#[test]
fn test_run_sta_zpg_x(){
let mut b = MockBus::new();
let mut r = Register::new();
r.set_PC(0x80);
r.set_A(0xFF);
r.se... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Accounting - MRP',
'version': '1.0',
'category': 'Manufacturing/Manufacturing',
'summary': 'Analytic accounting in Manufacturing',
'description': """
Analytic Accounting in MRP
============... | Python | 1 |
fft_scalar_prime_0251(b: &mut Bencher) { bench_raders_scalar(b, 251); }
#[bench] fn raders_fft_scalar_prime_0257(b: &mut Bencher) { bench_raders_scalar(b, 257); }
#[bench] fn raders_fft_scalar_prime_1009(b: &mut Bencher) { bench_raders_scalar(b, 1009); }
#[bench] fn raders_fft_scalar_prime_2017(b: &mut Bencher) { be... | Rust | 0 |
import requests
import socket
class Recon:
def __init__(self):
pass
def subdomain_enumeration(self, domain):
print(f"[+] Enumerating subdomains for {domain}")
subdomains = ["www", "mail", "ftp", "dev", "api"]
found_subdomains = []
for sub in subdomains:
subd... | Python | 1 |
# Copyright (C) 2024 Mitsubishi Electric Research Laboratories (MERL)
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import os
import shlex
import sys
from pathlib import Path
class c:
green = "\033[92m"
red = "\033[91m"
purple = "\033[95m"
cyan = "\033[96m"
end = "\033[0m"
def run(cmd, failure... | Python | 1 |
System_SystemInformation'*"]
pub const NTDDI_WIN10_CO: u32 = 167772171u32;
#[doc = "*Required features: 'Win32_System_SystemInformation'*"]
pub const NTDDI_WIN10_FE: u32 = 167772170u32;
#[doc = "*Required features: 'Win32_System_SystemInformation'*"]
pub const NTDDI_WIN10_MN: u32 = 167772169u32;
#[doc = "*Required feat... | Rust | 0 |
# Copyright (c) 2025, Kalutu and contributors
# For license information, please see license.txt
# import frappe
from frappe.utils.nestedset import NestedSet
class Warehouse(NestedSet):
pass
| Python | 1 |
).test_counters.get("ndp::rx_neighbor_advertisement"),
1,
"local received advertisement"
);
// at the end of the exchange, both sides should have each other on
// their ndp tables:
assert_eq!(
EthernetNdpDevice::get_ndp_state::<_>(net.context("local")... | Rust | 0 |
time_unit,
self._last_optime,
tag))
else:
log.info('%s - sync to %s - %d %s delay - %s' % (self.from_to,
... | Python | 1 |
O2)",
"GM1a+2OAc(34:1;O2)",
"GM3(36:1;O2)",
"GD3(36:1;O2)",
"GT1b(36:1;O2)",
"GQ1c(36:1;O2)",
"GP1(36:1;O2)",
"GD1+dHex(36:1;O2)",
"GD1+HexNAc(36:1;O2)",
],
"RT": [
9.572,
9.823,
... | Python | 1 |
def main():
time= input("What time is it? ")
t = convert(time)
X(t)
def X(t):
if 7.0 <= t <= 8.0:
print("breakfast time")
elif 12.0 <= t <= 13.0 :
print("lunch time")
elif 18.0 <= t <= 19.0:
print("dinner time")
else:
print()
def convert(time1=0.0):
ho... | Python | 1 |
w_size = (1,) * start.dim() + (steps,)
out_size = start.size() + (steps,)
start_w = torch.linspace(1, 0, steps=steps).to(start)
start_w = start_w.view(w_size).expand(out_size)
end_w = torch.linspace(0, 1, steps=steps).to(start)
end_w = end_w.view(w_size).expand(out_size)
start = start.con... | Python | 1 |
# to install pandas library go to cmd prompt and type:
# cd %USERPROFILE%\AppData\Local\Programs\Python\Python38-32\Scripts\
# pip install pandas
import pandas as pd
# load data from csv files
df_patients = pd.read_csv (r'patients.csv', sep = ",", decimal=".")
df_visits = pd.read_csv (r'visits.csv', sep = ",", decimal... | Python | 1 |
Option<AddrMut<libc::msqid_ds>>,
}
}
typed_syscall! {
pub struct Fcntl {
/// The file descriptor to perform the operation on.
fd: i32,
cmd: {
fn get(&self) -> FcntlCmd {
FcntlCmd::from_raw(self.raw.arg1 as libc::c_int, self.raw.arg2)
}
... | Rust | 0 |
from django.db import models
from django.contrib.auth.models import User
from .business import Business
class BusinessMember(models.Model):
business_id = models.ForeignKey(Business, on_delete=models.CASCADE, related_name='members')
name = models.CharField(max_length=100)
phone = models.CharField(max_length... | Python | 1 |
#Conditionals Challenge 18: Voter Registration App
print("Welcome to the Voter Registration App")
#Get user input
name = input("\nPlease enter your name: ").title().strip()
age = int(input("Please enter your age: "))
#Define our list of political parties
parties = ["Republican", "Democratic", "Independent", "Libert... | Python | 1 |
is used.
data_retention_time: Specifies the retention period for the table in days so that Time Travel actions (SELECT, CLONE, UNDROP) can be performed
on historical data in the table.
max_data_extension_time: Specifies the maximum number of days for which Snowflake can extend the data reten... | Python | 1 |
assert_eq!(col, OptColorWhen::Auto);
}
#[test]
fn test_from_str_invalid() {
let _col: OptColorWhen = match FromStr::from_str("other") {
Ok(_c) => _c,
Err(e) => {
assert_eq!(e.to_string(), "can not parse \'other\'");
return;
}
... | Rust | 0 |
# coding: utf-8
"""
Rapidata.Dataset
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E50... | Python | 1 |
from .base import Dependency, ReleaseDownload, MesonBuilder
from kiwixbuild.utils import Remotefile
class MicroHttpd(Dependency):
name = "libmicrohttpd"
class Source(ReleaseDownload):
src_archive = Remotefile(
"libmicrohttpd-0.9.76.tar.gz",
"f0b1547b5a42a6c0f724e8e1c1cb5ce9c4... | Python | 1 |
ished");
});
Scheduler::spawn(move || {
println!("REMOTE -> LOCAL started");
let mut buf = [0u8; 1024];
loop {
match (&*cloned_remote).read(&mut buf) {
Ok(0) => {
... | Rust | 0 |
afEntry::from(buf_reader.by_ref());
leaf.push(leaf_entry);
}
Dir2BlockDisk { hdr, leaf, tail }
}
pub fn get_data_end(&self, offset: u64, directory_block_size: u32) -> u64 {
offset + (directory_block_size as u64)
- (mem::size_of::<Dir2BlockTail>() as u64)
... | Rust | 0 |
import sys
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ._label import Label
from ._legendgrouptitle import Legendgrouptitle
from ._line import Line
from . import label
from . import legendgrouptitle
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__,... | Python | 1 |
from lin import db
from lin.core import lin_config
from lin.exception import NotFound
from lin.interface import InfoCrud as Base
from sqlalchemy import Column, String, Integer, Text, text
class Poem(Base):
__tablename__ = 'lin_poem'
id = Column(Integer, primary_key=True, autoincrement=True)
title = Column... | Python | 1 |
import argparse
import json
import os
import sys
from pathlib import Path
import streamlit.web.cli as stcli
from clear_eval.analysis_runner import run_clear_eval_analysis, run_clear_eval_generation, run_clear_eval_aggregation
from clear_eval.args import parse_args
def main():
overrides = parse_args()
run_clea... | Python | 1 |
it__(self, split='test', root="/home/yuyuan/work_space/fs_lost_and_found/", transform=None):
assert os.path.exists(root), "lost&found valid not exists"
"""Load all filenames."""
self.transform = transform
self.root = root
self.split = split # ['test', 'train']
self.image... | Python | 1 |
> _TRIMOFFSETNW {
_TRIMOFFSETNW { w: self }
}
#[doc = "Bit 29 - TSTREF"]
#[inline]
pub fn tstref(&mut self) -> _TSTREFW {
_TSTREFW { w: self }
}
#[doc = "Bit 31 - OPAMP 3 lock"]
#[inline]
pub fn lock(&mut self) -> _LOCKW {
_LOCKW { w: self }
}
}
// Copyright 2... | Rust | 0 |
import cloudinary
import cloudinary.uploader
import os as os
from dotenv import load_dotenv
from functions.pathConfig import get_default
load_dotenv()
default_path = get_default()
cloudinary.config (
cloud_name = os.getenv('CLOUDINARY_NAME'),
api_key = os.getenv('CLOUDINARY_KEY'),
api_secret = os.ge... | Python | 1 |
<LittleEndian>(v), |buffer| Ok(LittleEndian::read_i32(
buffer
)));
def_fixed_len!(u64, 8, |b, v| b.write_u64::<LittleEndian>(v), |buffer| Ok(LittleEndian::read_u64(
buffer
)));
def_fixed_len!(i64, 8, |b, v| b.write_i64::<LittleEndian>(v), |buffer| Ok(LittleEndian::read_i64(
buffer
)));
def_fixed_len!(boo... | Rust | 0 |
import unittest
from src.metrics.partial_match_eval.utils import get_item_index_in_list
class TestUtils(unittest.TestCase):
def test_get_item_index_in_list_only_strings(self):
index = get_item_index_in_list(["a", "b", "c", "d"], "c")
self.assertEqual(index, 2)
def test_get_item_index_in_lis... | Python | 1 |
pe(torch.long)).cuda()
i_idx = torch.unique(torch.Tensor(idx[1]).type(torch.long)).cuda()
user_view_1, item_view_1 = self.model(perturbed=True)
user_view_2, item_view_2 = self.model(perturbed=True)
user_cl_loss = InfoNCE(user_view_1[u_idx], user_view_2[u_idx], 0.2)
item_cl_loss =... | Python | 1 |
cfg: config::Config,
sex: String,
letter: String,
previous_letter: String,
) -> Vec<String> {
let mut names = match &*sex {
"male" => cfg.male_names,
"female" => cfg.female_names,
_ => append(cfg.male_names, cfg.female_names),
};
if !letter.is_empty() {
names = fi... | Rust | 0 |
Some(account1.address.clone()),
executor_context,
);
let params = r#"{"value":"abc"}"#.as_bytes();
let result = vm_execute(&context, Mode::Init, "init", params, 0).unwrap();
assert_eq!(result, r#"null"#.to_string());
let params = r#""#.as_bytes();
let result = vm_execute(&context, Mode::Call, "get_value",... | Rust | 0 |
_type: parts[2].to_string(),
mount_options: parts[3].split(",").map(|s| s.to_string()).collect(),
fsmgr_flags: parts[4].split(",").map(|s| s.to_string()).collect(),
};
Ok(entry)
}
fn get_struct(vector: Vec<Self>) -> FstabType {
FstabType::AndroidV2(vector)
}
... | Rust | 0 |
, 1)).T, np.kron(np.eye(L), Q) @ np.tile(y_term, (L, 1))) + np.dot(np.tile(u_term, (L, 1)).T, np.kron(np.eye(L), R) @ np.tile(u_term, (L, 1)))
sol_store[:, j] = sol
alpha_ol[:, j] = sol[:N-L+1]
u_ol[:, j] = sol[N-L+1:N-L+1+m*L]
y_ol[:, j] = sol[N-L+1+m*L:N-L+1+(m+p)*L]
if robust:... | Python | 1 |
US" => {
*res += &build_property(&p.name, &p.params, &p.value);
}
"UID" => {
if let Some(value) = &p.value {
let mut hasher =
hmac::Hmac::<sha2::Sha256>::new_from_slice(cfg.seed.as_bytes())
... | Rust | 0 |
import pytest
from fastapi.testclient import TestClient
from model.user import User
from main import app
client = TestClient(app)
@pytest.fixture
def sample() -> User:
return User(name="elsa", hash="123")
def test_create(sample):
resp = client.post("/user", json=sample.dict())
assert resp.status_code == ... | Python | 1 |
_KR": "잘못된 파일",
"hi_IN": "अमान्य फाइल",
"bn_BD": "অবৈধ ফাইল",
"it_IT": "File non valido",
"fr_FR": "Fichier invalide",
"de_DE": "Ungültige Datei",
"pt_PT": "Arquivo inválido",
"ar_SA": "ملف غير صالح",
"vi_VN": "Tệp không hợp lệ",
"fa_IR": "فایل نامعتبر",
"id_ID": "File tidak vali... | Python | 1 |
extern "C" fn(*mut CMuCtx) -> *mut CMuIRBuilder,
pub make_boot_image: extern "C" fn(
*mut CMuCtx,
*mut CMuID,
CMuArraySize,
CMuFuncRefValue,
CMuStackRefValue,
CMuRefValue,
*mut CMuIRefValue,
*mut CMuCString,
CMuArraySize,
*mut CMuIRefV... | Rust | 0 |
ve(0) {
register.register
} else {
unreachable!()
};
let source_register = match self.operands.first() {
Some(Token::Register(register)) => register.register,
Some(_) => unreachable!(),
None => destination_register,
};
... | Rust | 0 |
result_dir)
model = build_net(args.model_name)
if torch.cuda.is_available():
model.cuda()
_enhance(model, args)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
# Directories
parser.add_argument('--model_name', default='MIMO-UNet', choices=['MIMO-UNet', 'MIMO-UNetPlus']... | Python | 1 |
, 119, 245, 45, 56, 209, 152, 139, 120, 205, 54,
];
// initiator.chaining_hash = HASH(initiator.chaining_key || IDENTIFIER)
static INITIAL_CHAIN_HASH: [u8; KEY_LEN] = [
34, 17, 179, 97, 8, 26, 197, 102, 105, 18, 67, 219, 69, 138, 213, 50, 45, 156, 108, 102, 34,
147, 232, 183, 14, 225, 156, 101, 186, 7, 158, 24... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.