text string | label_name string | labels int64 |
|---|---|---|
: veth1
ipv4:
addresses:
- address: "192.0.2.1"
prefix_len: 24
ipv6:
addresses:
- address: "2001:db8:a::9"
prefix_len: 64"#;
const EMPTY_IP_CONF: &str = r#"---
ifaces:
- name: veth1
ipv4:
addresses: []
ipv6:
addresses: []"#;
const EXPECTED_... | Rust | 0 |
_on(async { node1_network.peer_set().await })?;
assert_eq!(peers.len(), 0);
let mut node_config2 = NodeConfig::random_for_test();
node_config2.network.seeds = vec![node_config1.network.self_address()].into();
let node_config2 = Arc::new(node_config2);
let node2 = test_helper::run_node_by_config(nod... | Rust | 0 |
print("Adjusted for start date:", current.strftime("%Y-%m-%d (%A)"))
print("\nGenerating dates:")
while current <= end_date:
# Set the time for this date
target_date = current.replace(hour=hour, minute=minute)
if start_date <= target_date <= end_date:
... | Python | 1 |
# -*- coding: utf-8 -*-
{
'name': 'SaaS Portal - templates',
'version': '17.0.1.0.1',
'author': 'Ivan Yelizariev, Nicolas JEUDY',
'license': 'LGPL-3',
'category': 'SaaS',
"support": "apps@it-projects.info",
'website': 'https://it-projects.info',
'depends': ['saas_portal'],
'data': [
... | Python | 1 |
LeftCurly,
#[token("}")]
RightCurly,
#[token(";")]
Semicolon,
#[token(".")]
Dot,
#[token(",")]
Comma,
// Operators
#[token("+")]
Plus,
#[token("-")]
Minus,
#[token("*")]
Star,
#[token("/")]
FwdSlash,
#[token("=")]
Equal,
#[token("... | Rust | 0 |
import warnings
warnings.filterwarnings('ignore')
import argparse, yaml, copy
from ultralytics.models.yolo.detect.compress import DetectionCompressor, DetectionFinetune
def compress(param_dict):
with open(param_dict['sl_hyp'], errors='ignore') as f:
sl_hyp = yaml.safe_load(f)
param_dict.update(sl_hyp)
... | Python | 1 |
afe { sys::cv_VideoCapture_getExceptionMode(self.as_raw_mut_VideoCapture()) }.into_result()
}
}
/// Class for video capturing from video files, image sequences or cameras.
///
/// The class provides C++ API for capturing video from cameras or for reading video files and image sequences.
///
/// Here is how the cl... | Rust | 0 |
from datetime import datetime
from XPdf import XPdf
import re
def count_revenue(line, date, my_pdf, line_elements):
current_year = datetime.now().year
current_year = current_year % 100
line_revenue = line_elements[-2]
my_pdf.total_revenue += float(line_revenue)
if (int(date[6:8]) == current_year):
my_pdf.revenu... | Python | 1 |
me_map: Dict[str, str]) -> None:
"""同步模型路由配置中的配置名称"""
if not rename_map:
return
router_config_file = DATA_DIR / 'model_router_config.json'
if not router_config_file.exists():
return
try:
with open(router_config_file, 'r', encoding='utf-8') as f:
config = json.lo... | Python | 1 |
harField', [], {'max_length': '100'})
},
'logged_out_homepage.spotlightedthread': {
'Meta': {'object_name': 'SpotlightedThread'},
'comment': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'spotlighted_threads'", 'to': "orm['canvas.Comment']"}),
'... | Python | 1 |
one().into_iter().collect();
Box::new(vec.shrink().map(|vec| vec.into_iter().collect()))
}
}
impl<T, C> Arbitrary for Set<T, C>
where
T: Arbitrary,
C: 'static + Clone + Compare<T> + Default + Send,
{
fn arbitrary<G: Gen>(gen: &mut G) -> Self {
Vec::<T>::arbitrary(gen).into_iter().collec... | Rust | 0 |
amma)
lr_scheduler = torch.optim.lr_scheduler.MultiStepLR(optimizer, milestones=args.lr_steps, gamma=args.lr_gamma)
# 如果传入resume参数,即上次训练的权重地址,则接着上次的参数训练
if args.resume:
# If map_location is missing, torch.load will first load the module to CPU
# and then copy each parameter to where it was ... | Python | 1 |
} else {
return;
}
}
if cursor == 0 {
break;
} else {
cursor -= 1;
}
}
}
#[cfg(test)]
mod tests {
#[test]
fn given_empty_when_encoding_then_remains_unchanged() {
let mut sut = given("");
when_encoding... | Rust | 0 |
params.collection_name]
# Reset without deleting the Search Index
collection.delete_many({})
# Insert documents in MongoDB Atlas with their embeddings
docsearch = MongoDBAtlasVectorSearch.from_documents(
docs, embeddings, collection=co... | Python | 1 |
2, 2, op_mul_assign, op_mul);
vec_op_scal_assign_test!(Vec3, 3, op_mul_assign, op_mul);
vec_op_scal_assign_test!(Vec4, 4, op_mul_assign, op_mul);
}
#[test]
fn scal_div_assign() {
vec_op_scal_assign_test!(Vec2, 2, op_div_assign, op_div);
vec_op_scal_assign_test!(Vec3, 3, op_div_assign, op_div);
vec_... | Rust | 0 |
k.contiguous(),
v.contiguous(),
o.view(-1, layer.tp_q_head_num, layer.v_head_dim),
forward_batch.token_to_kv_pool.get_key_buffer(layer.layer_id),
forward_batch.token_to_kv_pool.get_value_buffer(layer.layer_id),
forward_batch.req_to_token_pool.req_to_t... | Python | 1 |
"""Tests for trend forecasters."""
| Python | 1 |
49, 1202.0),
City::new(6435, "Malawi", "Chipoka", -13.9833333, 34.5166664, 472.0),
City::new(6436, "Malawi", "Phalombe", -15.8000000, 35.6500015, 757.0),
City::new(6437, "Malawi", "Chiradzulu", -15.7000000, 35.1833344, 1208.0),
City::new(6438, "Malawi", "Machinga", -14.9666667, 35.5166664, 676.0),
City::new(6439, ... | Rust | 0 |
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
let steam_location = hklm.open_subkey("SOFTWARE\\Valve\\Steam")
.or(hklm.open_subkey("SOFTWARE\\Wow6432Node\\Valve\\Steam"))
.and_then(|key| key.get_value("InstallPath"))
.unwrap_or_... | Rust | 0 |
MCU SEMAPHORE 30"]
pub mod smph30;
#[doc = "MCU SEMAPHORE 31\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://d... | Rust | 0 |
import os
import torch
import RRDBNet_arch as arch
pretrained_net = torch.load('./models/RRDB_ESRGAN_x4.pth')
save_path = './models/RRDB_ESRGAN_x4.pth'
crt_model = arch.RRDBNet(3, 3, 64, 23, gc=32)
crt_net = crt_model.state_dict()
load_net_clean = {}
for k, v in pretrained_net.items():
if k.startswith('module.'... | Python | 1 |
} else {
None
}
}),
);
mapping.extend(new_mapping.drain(..));
}
let mut registers = [0, 0, 0, 0];
for mut placeholder in instructions {
placeholder.0 = mapping[&placeholder.0];
let instruction: Instruction = place... | Rust | 0 |
et('queue_durable')
if q_durable is None:
q_durable = options.get('durable')
q_auto_delete = options.get('queue_auto_delete')
if q_auto_delete is None:
q_auto_delete = options.get('auto_delete')
e_arguments = options.get('exchange_arguments')
q_arguments... | Python | 1 |
selection::{Selection, SelectionType};
use alacritty_terminal::sync::FairMutex;
use alacritty_terminal::term::cell::Cell;
use alacritty_terminal::term::{ClipboardType, SizeInfo, Term, TermMode};
#[cfg(not(windows))]
use alacritty_terminal::tty;
use crate::cli::Options;
use crate::clipboard::Clipboard;
use crate::confi... | Rust | 0 |
t=example_weights) #
print(f"presheaf on alpha") #
M0, v_data, e_data = build_coboundary_0_matrix(simplex_tree, presheaf) #
M1, _, t_data = build_coboundary_1_matrix(simplex_tree, presheaf) #
dim_H0, dim_H1 = compute_cohomology_dims(M0, M1) #
print(f"dim H0(K, G) = {dim_H0 / presh... | Python | 1 |
/// `cacert.pem` file.
/// 4. If none of the conditions above are met, then a `cacert.pem` will be written in an SSL cache
/// directory (by default `/hab/cache/ssl` for a root user and `$HOME/.hab/cache/ssl` for a
/// non-root user) and this will be used. The contents of this file will be inlined in this
///... | Rust | 0 |
: libsm64_sys::SM64_TEXTURE_HEIGHT,
}
}
/// Create a new instancec of Mario that spawns at the point indicated by x/y/z, he must be placed above a surface or an error will be returned
pub fn create_mario<'ctx>(&'ctx self, x: i16, y: i16, z: i16) -> Result<Mario<'ctx>, Error> {
let mario_id ... | Rust | 0 |
loaded")
return self._config.models.default
def get_full_config(self) -> GraphConfig:
"""
Get the complete graph configuration.
Returns:
Complete GraphConfig object
"""
if not self._config:
raise RuntimeError("Configuration not loaded")
... | Python | 1 |
.0 }
).unwrap();
pd.mount_data.mount.as_mut().unwrap().stop_motion(mount::Axis::Secondary).unwrap();
pd.mount_data.guiding_timer.stop();
pd.mount_data.guide_slewing = false;
pd.mount_data.guiding_pos = None;
}
pub fn guiding_step(program_data_rc: &Rc<RefCell<ProgramData>>) {
/// Max acceptable ... | Rust | 0 |
&record
);
e
},
)?;
processor.geometry_end()?;
}
processor.feature_end(feature_idx as u64)?;
}
processor.dataset_end()?;
Ok(())
}
impl From<csv::Error> for GeozeroError {
fn from(error: csv::E... | Rust | 0 |
ag:bool = false;
let mut debug_string:String = "".to_string();
if code_dihed.contains_key(&ccode){
for vv in code_dihed.get(&ccode).unwrap().iter(){
zvec.push((false,vv));
}
hitflag = true;
... | Rust | 0 |
from ..char_classes import (
ALPHA,
ALPHA_LOWER,
ALPHA_UPPER,
CONCAT_QUOTES,
HYPHENS,
LIST_CURRENCY,
LIST_ELLIPSES,
LIST_ICONS,
LIST_PUNCT,
LIST_QUOTES,
)
_prefixes = (
[
"†",
"⸏",
"〈",
]
+ LIST_PUNCT
+ LIST_ELLIPSES
+ LIST_QUOTES
... | Python | 1 |
self.name.startswith("BATTLE_FRONTIER_BATTLE_PYRAMID_")
or self.name.startswith("BATTLE_FRONTIER_BATTLE_ARENA_")
or self.name.startswith("BATTLE_FRONTIER_BATTLE_FACTORY_")
or self.name.startswith("BATTLE_FRONTIER_BATTLE_PIKE_")
or self.name.startswith("ROUTE110_SEASIDE_C... | Python | 1 |
ation="Addingham Churchyard"
Iptc4xmpExt:City="Addingham"
Iptc4xmpExt:ProvinceState="North Yorkshire" TODO: UK province validator?
Iptc4xmpExt:CountryName="United Kingdom of Great Britain and Northern Ireland (the)" DONE ISO 3166 parser
Iptc4xmpExt:CountryCode="GBR" DONE: ISO 3166 parser
I... | Rust | 0 |
d in provider archive"))),
}
}
pub(crate) fn extract_claims(par: &ProviderArchive) -> Result<Claims, Error> {
match par.claims() {
Some(c) => {
let metadata = c.metadata.unwrap_or_default();
Ok(crate::Claims {
issuer: c.issuer,
public_key: c.subje... | Rust | 0 |
/master/COPYRIGHT. No part of file-descriptors, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2018-2019 The developers of file-descriptors. See the COPYRIGHT file in the top-level directory of this distribution and ... | Rust | 0 |
import six
import jax.numpy as jnp
import equinox as eqx
from jax import vjp
from typing import Callable
def quadratic_cost(t, x, dx, vdfdx_fun, args, context):
dx = dx.reshape(-1)
return 0.5 * jnp.mean(dx**2)
def jacobian_frobenius_regularization_fn(t, x, dx, vdfdx_fun, args, context):
_e = args["_e"]
... | Python | 1 |
et => "INET",
PgType::BoolArray => "BOOL[]",
PgType::ByteaArray => "BYTEA[]",
PgType::CharArray => "\"CHAR\"[]",
PgType::NameArray => "NAME[]",
PgType::Int2Array => "INT2[]",
PgType::Int4Array => "INT4[]",
PgType::TextArray => "TEXT[]",... | Rust | 0 |
s_replace_steps["default_"],
i)
for key, item in cross_replace_steps.items():
if key != "default_":
inds = [get_word_inds(prompts[i], key, tokenizer) for i in range(1, len(prompts))]
for i, ind in enumerate(inds):
i... | Python | 1 |
or>
where
H: FnOnce(R::Request<'a>, R::Response<'a>) -> Result<Completion, E> + 'static,
E: HandlerError,
{
let middleware2 = self.middleware2.clone();
self.middleware1.handle(req, resp, move |req, resp| {
middleware2.handle(req, resp, handler)
})
}
}
pu... | Rust | 0 |
# -*- coding: UTF-8 -*-
# motorControl.py python2.7
# @author: zdl
# func: 电机差速PID控制
import PID as PID
import AICarRun as Run
import math
import numpy as np
Width = 640
# 电机差速PID控制
def motor_control(point_x, point_y,mid_PWM):
global time_list
global error_list
global angle
if point_x > 0 and poin... | Python | 1 |
idData, e))
})?;
let mut aux = vec![0; l_aux];
reader.read_exact(&mut aux)?;
Ok(aux)
}
fn read_reference_sequences<R>(reader: &mut R, depth: i32) -> io::Result<Vec<ReferenceSequence>>
where
R: Read,
{
let n_ref = reader.read_i32::<LittleEndian>().and_then(|n| {
usize::try_from(n).map_... | Rust | 0 |
ord: &str,
remoteip: Option<&str>,
) -> Result<(), PamError>
{
// If we haven't started the background task yet, do it now.
// That also initializes req_chan.
let inner = &self.inner;
inner.once.call_once(|| {
// These should not ever panic on unwrap().
... | Rust | 0 |
.Figure()
fig_mfi.add_trace(go.Scatter(x=df.index, y=df["MFI"], mode="lines", name="MFI"))
fig_mfi.update_layout(
title="Interactive Chart for Money Flow Index (MFI)",
xaxis=dict(title="Date"),
yaxis=dict(title="MFI"),
legend=dict(x=0, y=1),
shapes=[
dict(
... | Python | 1 |
1\xf5\x9e\xbd\x10s\x89\xae\
\x1a\x06\x00\xe2\xa0\xd6\xd0L\xecV\xf0\x0b\x04\x01B\xd3\
\xaa\x90\xd6\x1e\x01\xf4\xd6o\xea\xb2$nnn\x185\
j\x14V\xacX\x81\x91#G\x22((\xe8?\xbb\x8c\
\xc6\x1a\x94+W\x0e=z\xf4\xc0\xe0\xc1\x83aoo\
\x8f\xd8\xd8X\x8b\x09\x11%\xdeM\xc7\x925\x17Q\xda\
\xc7\x09u\xaa\xab,AM\xa4y\xa8?\xe2o=\xc6\
\xf9\xc... | Python | 1 |
# This file is not meant for public use and will be removed in SciPy v2.0.0.
# Use the `scipy.datasets` namespace for importing the dataset functions
# included below.
from scipy._lib.deprecation import _sub_module_deprecation
__all__ = [ # noqa: F822
'central_diff_weights', 'derivative', 'ascent', 'face',
'... | Python | 1 |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import os
from os.path import splitext, basename
import sys
import json
from tqdm.contrib.concurrent import process_map
from data.pdb_utils import AgAbComplex
from utils.relax import openmm_relax
from evaluation.affinity import rosetta_affinity
from configs import CACHE_DIR
fr... | Python | 1 |
ags {
view: 0,
help: false,
version: false,
credits: false,
token: "".to_string(),
};
let mut watching_token: bool = false;
for arg in args {
if watching_token {
flags.token = arg.clone();
} else {
match arg.to_lowercase().as_... | Rust | 0 |
rate::_core::ops::Try::from_ok($ok_value.into())
}
})}
/// Sugar for an expression block catching early-returns.
///
/// To be used when the return type is a [`Result`],
/// to enable writing "try-catch"-like blocks within a function's body.
///
#[doc = "# Example"]
#[cfg_attr(feature = "nightly",
doc = "```r... | Rust | 0 |
len: 1 + length_len
})
}
fn parse_access_field(data: &[u8], _ctx: &mut AmlExecutionContext) -> Result<AmlParseTypeGeneric<AccessField>, AmlError> {
if data.len() < 3 {
return Err(AmlError::AmlParseError("AccessField - data truncated"))
}
parser_opcode!(data, 0x01, 0x03);
let flag... | Rust | 0 |
"""
Conductance drift model as described in:
I. Boybat et al., "Impact of conductance drift on multi-PCM synaptic architectures", 2018 Non-Volatile Memory Technology Symposium (NVMTS), 2018.
"""
import numpy as np
import torch
def model_conductance_drift(layer, x, initial_time=1e-12, drift_coefficient=0.1):
"""
... | Python | 1 |
device: VkDevice,
image: VkImage,
memory: VkDeviceMemory,
memoryOffset: VkDeviceSize,
) -> VkResult,
>;
pub type PFN_vkGetBufferMemoryRequirements = ::std::option::Option<
unsafe extern "C" fn(
device: VkDevice,
buffer: VkBuffer,
pMemoryRequirements: *mut VkMemor... | Rust | 0 |
List{xs: Vec<ValRefWithSource>},
Object{props: HashMap<String,ValRefWithSource>},
BuiltInFunc{f: fn(Vec<ValRefWithSource>) -> Result<ValRefWithSource, String>},
Func{args: Vec<Expr>, stmts: Block, closure: ScopeStack},
}
#[derive(Clone,Debug)]
pub struct ScopeStack(Vec<Arc<Mutex<Scope>>>);
pub type ... | Rust | 0 |
veDocument is None
def Activated(self):
# preferences
#p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/EM")
#self.Width = p.GetFloat("Width",200)
# get the selected object(s)
selection = FreeCADGui.Selection.getSelectionEx()
nodes = []
# if selec... | Python | 1 |
f.write(health_check_script)
# Upload and setup health check
health_script_path = f"{self.deploy_config.deploy_path}/health_check.sh"
if not self.upload_file(temp_health_script, health_script_path):
return False
self.execute_command(f"chmod +x {he... | Python | 1 |
import genRSAKeyPair
import viewRSAKeyPair
import genSingularSignature
import bulkGenSignatures
import sys
# SEE README.MD - Off-Chain Scripts
def main():
flags = sys.argv
if len(sys.argv) > 1:
if "--viewKeyPair" in flags and "--genKeyPair" in flags:
raise Exception("Cannot both view then ... | Python | 1 |
songdata[5],
songdata[6],
songdata[7],
songdata[8],
songdata[9],
songdata[10],
],
folder=songdata[4],
)
elif ga... | Python | 1 |
# Operaciones con cadenas de caracteres
str1 = "Hola"
str2 = "Mundo"
print(str1[0]) # Acceso a caracteres específicos: H
print(str1[1:3]) # Subcadenas: Hola -> ol (slicing)
print(len(str1)) # Longitud: 4
print(str1 +', ' + str2) # Concatenación: Hola, Mundo
print(str1 * 3) # Repetición: HolaHolaHola
for i in str1: # Re... | Python | 1 |
logs=[error_msg]
)
# 如果stdout_content已经是字典类型,检查是否包含正确的数据
if isinstance(stdout_content, dict):
if 'dataset' in stdout_content:
logger.info(f"容器直接返回了dataset数据"... | Python | 1 |
_log(&self, level: tracing::Level) {
match self {
Ok(_) => (),
Err(e) => e.ref_log(level),
}
}
fn log(self, level: tracing::Level) -> Self
where
Self: Sized,
{
match self {
ok @ Ok(_) => ok,
Err(e) => Err(e.log(level)),
... | Rust | 0 |
=>8, red),
consecutive_ranks!(7-8 clubs) => consecutive_ranks_result!(7=>8, clubs),
consecutive_ranks!(7-8 diamonds) => consecutive_ranks_result!(7=>8, diamonds),
consecutive_ranks!(7-8 hearts) => consecutive_ranks_result!(7=>8, hearts),
consecutive_ranks!(7-8 spades) => consecutive_... | Rust | 0 |
import tkinter as tk
class ChessBoard:
def __init__(self, master):
self.master = master
self.board = []
for i in range(8):
row = []
for j in range(8):
button = tk.Button(master, width=10, height=5)
button.grid(row=i, column=j)
... | Python | 1 |
_lanes(x: [u32x4_sse2<YesS3, YesS4, NI>; 4]) -> Self {
Self::new(unsafe {
[
_mm256_setr_m128i(x[0].x, x[1].x),
_mm256_setr_m128i(x[2].x, x[3].x),
]
})
}
}
impl<NI> Vec4<u32x4_sse2<YesS3, YesS4, NI>> for u32x4... | Rust | 0 |
")
// .long("year")
// .help("specifies year relative date")
// .takes_value(false));
}#[cfg(test)]
pub mod test_data {
pub const SSH_URL_ARRAY: &'static [&'static str] = &[
"ssh://host.xz/path/to/repo.git/",
"ssh://host.xz/path/to/repo.git",
... | Rust | 0 |
''' Fossil-aware skinning tools.
'''
from pymel.core import listConnections
import pdil
def getSkinClusters(cards):
''' Returns a list of skinClusters used by the given cards.
'''
skinClusters = set()
for card in cards:
for j in card.joints:
if not j.isHelper:
if ... | Python | 1 |
#!/usr/bin/env python3
# -*- coding=utf-8 -*-
import difflib
def html_diff_snippet(txt1, txt2, context=5):
# 将行结束符统一为 \n
txt1_normalized = txt1.replace('\r\n', '\n').replace('\r', '\n')
txt2_normalized = txt2.replace('\r\n', '\n').replace('\r', '\n')
txt1_list = txt1_normalized.split('\n')
txt2_... | Python | 1 |
identity file and password. Default: `None`
pub tls_data: Option<((String, PathBuf), String)>,
/// Whether to generate a one-off certificate. Default: false
pub generate_tls: bool,
/// Data for per-path authentication, in the form `username[:password]`, or `None` to explicitly disable
pub path_auth... | Rust | 0 |
32wl5x_cm0p")]
const INTERRUPT: pac::Interrupt = pac::Interrupt::$c1interrupt;
#[inline]
fn set_port(syscfg: &mut pac::SYSCFG) {
syscfg.[<exticr $exticr>].modify(|_, w| w.[<exti $n>]().[<p $port:lower $n>]());
}
... | Rust | 0 |
s not None
def test_jumpstart_hub_gated_estimator_with_eula(setup, add_model_references):
model_id, model_version = "meta-textgeneration-llama-2-7b", "*"
estimator = JumpStartEstimator(
model_id=model_id,
hub_name=os.environ[ENV_VAR_JUMPSTART_SDK_TEST_HUB_NAME],
tags=[{"Key": JUMPSTA... | Python | 1 |
if value == 0:
return None
if isinstance(value, cls):
return value
# multiple python interface types for the same COM interface.
# Do we need more checks here?
if cls._iid_ == getattr(value, "_iid_", None):
return value
# Accept an COMOb... | Python | 1 |
meta_list = normalize_metadata(meta, sources_count=len(sources))
for source, metadata in zip(sources, meta_list):
if isinstance(source, str):
source = Path(source)
try:
bytestream = get_bytestream_from_source(source)
except Exception as e:
... | Python | 1 |
import pygame
def main():
pygame.init()
# load and set the logo
logo = pygame.image.load("logo32x32.jpg")
pygame.display.set_icon(logo)
pygame.display.set_caption("minimal program")
# create a surface on screen that has the size of 240 x 180
modes = pygame.display.list_modes(0, pygame.FU... | Python | 1 |
:?$param_tp)?),*>)? {
$($( $param : PhantomData<$param> ),*)?
}
/// # Safety
/// The usage of [`mem::transmute`] is safe here as we transmute ZST types.
#[allow(unsafe_code)]
impl$(<$($param $(:?$param_tp)?),*>)?
$name $(<$($param),*>)? {
/// Cons... | Rust | 0 |
"""add is_visible to model and dataset
Revision ID: 3c495c9f691e
Revises: 32b2a244fd5d
Create Date: 2022-04-29 13:29:24.271877
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "3c495c9f691e"
down_revision = "32b2a244fd5d"
branch_labels = None
depends_on = None
... | Python | 1 |
am: intercept bias factor, the term c in X'w + c
:param: weights feature vector, the term w in X'w + c
:param: xMean Point around which the data X is centered.
:param: xVariance Variance of the given data
:param: nPoints Number of points to be generated
:param: seed ... | Python | 1 |
type SystemData = (
WriteStorage<'s, Sun>,
Read<'s, Time>,
);
fn run(&mut self, (mut sun, time): Self::SystemData) {
let mut new_health = 500;
for s in (&mut sun).join() {
// by chance sun can start feeling hot or cold -> from 500
if s.he... | Rust | 0 |
ts(text_embedding_path):
# get text clip embeddings
get_clip_text_embeddings(gt_dir, test_uid_path, caption_path)
with open(text_embedding_path,"rb") as f:
text_features = pkl.load(f)
image_embedding_path = os.path.join(pred_dir,f"image_embeddings_{model_name}.npy")... | Python | 1 |
from models.cliente import Cliente
\
class PessoaFisica(Cliente):
def __init__(self, cpf, nome, data_nasc, endereco):
super().__init__(endereco)
self.cpf = cpf
self.nome = nome
self.data_nasc = data_nasc | Python | 1 |
{
controller::locate_id(version.to_owned(), id.to_owned()).await?
};
return match page::shortify(location.clone()).await? {
Some(r) if vn == "head" => Ok(r),
_ => page::render(location).await,
};
}
<gh_stars>1-10
pub trait TypeSystem<Term, Type> {
type Context;
type Output... | Rust | 0 |
, 1, 1],[0, 1, 0],[1, 1, 0],
[1, 1, 1],[0, 1, 1],[0, 1, 0],[1, 1, 0],
[0, 0, 0],[1, 0, 0],[1, 0, 1],[1, 1, 0],
[1, 1, 1],[1, 0, 0],[1, 0, 1],[1, 1, 0],
[0, 0, 0],[0, 1, 1],[1, 0, 1],[1, 1, 0],
[1, 1, 1],[0, 1, 1],[1, 0, 1],[1, 1, 0]];
/// Noise function that outputs 2/3-dimensional Super Simpl... | Rust | 0 |
# SuperRes1(): Super Resolution
# SuperRes2(): Super Resolution with nnedi3 upsampling
# SuperRes(): Super Resolution with NLMeans filtering and user-defined resampling
"""Example of using nnedi3() as a main upsampling filter:
import nnedi3_resample as nnrs
from functools import partial
input = ...
target_width = ..... | Python | 1 |
_to_spend: f32 = financial_picture.disposable_income +
financial_picture.current_savings + 1.0;
let max_spend = entertainment_to_spend - 1;
let mut gumball_machines_to_buy: i32 = financial_picture.disposable_income/price_of_gumball_machine +
... | Rust | 0 |
mem::swap;
use std::sync::Arc;
use vulkano::buffer::cpu_access::CpuAccessibleBuffer;
use vulkano::buffer::BufferAccess;
use vulkano::buffer::BufferUsage;
use vulkano::command_buffer::AutoCommandBufferBuilder;
use vulkano::descriptor::descriptor::DescriptorDesc;
use vulkano::descriptor::descriptor_set::DescriptorWrite;
... | Rust | 0 |
5948, 0xe063d049],
[0xfffffffd, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xefffffff],
],
[
[0xcaf4e99c, 0x494eac75, 0x3237de43, 0x695ba4d4, 0x68339d6f, 0xbca064f3, 0x4910c02a, 0xaefca662],
[0xfffffffb, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xeffffff... | Rust | 0 |
rn "C" {
#[doc = " Retrieve the contextual information of an Ethernet device."]
#[doc = ""]
#[doc = " As part of this function, a number of of fields in dev_info will be"]
#[doc = " initialized as follows:"]
#[doc = ""]
#[doc = " rx_desc_lim = lim"]
#[doc = " tx_desc_lim = lim"]
#[doc = ... | Rust | 0 |
from fobi.base import form_element_plugin_widget_registry
from fobi.contrib.plugins.form_elements.fields.date.widgets import (
BaseDatePluginWidget,
)
from fobi.contrib.themes.bootstrap3 import UID
__title__ = (
"fobi.contrib.themes.bootstrap3.widgets.form_elements."
"date_bootstrap3_widget.fobi_form_eleme... | Python | 1 |
,sorted_columns]
df_SBSvsFamily.to_csv(f"outputs/df_stats_{prob}/df_SBSvsTF_DBD_Family_{prob}.csv")
# Filtering rows
rows_to_drop = df_SBSvsFamily.apply(lambda row: all([cell[0] == 0 and cell[1] == 0 for cell in row]), axis=1)
df_SBSvsFamily = df_SBSvsFamily[~rows_to_drop].drop(index="Unknown")
# Fi... | Python | 1 |
use yew::prelude::{html, Component, ComponentLink, Html, Properties, ShouldRender};
pub struct [name]
{
props: Props,
}
#[derive(Properties, Debug, Clone)]
pub struct Props
{
#[prop_or_default]
pub class: Option<&'static str>,
#[prop_or_default]
pub size: Option<i64>,
#[prop_or_default]
p... | Rust | 0 |
rror> {
// Common
let pc_gens = PedersenGens::default();
let bp_gens = BulletproofGens::new(128, 1);
// For the example, we also commit to the points although it is not necessary
let (proof, commitments) = point_doubling_proof(&pc_gens, &bp_gens, p1, p2)?;
point_doubling_verify(&pc_gens, &bp_g... | Rust | 0 |
ger.info('Initing weights ...')
init_weight(self.decode_head, nn.init.kaiming_normal_,
self.norm_layer, cfg.bn_eps, cfg.bn_momentum,
mode='fan_in', nonlinearity='relu')
if self.aux_head:
init_weight(self.aux_head, nn.init.kaiming_normal_,
self.... | Python | 1 |
b: Uint8, a: Uint8) -> Uint32;
}
extern "C" {
/// \brief Get the RGB components from a pixel of the specified format.
///
/// \sa SDL_GetRGBA
pub fn SDL_GetRGB(pixel: Uint32, format: *const SDL_PixelFormat,
r: *mut Uint8, g: *mut Uint8, b: *mut Uint8);
}
extern "C" {... | Rust | 0 |
::input::keyboard::KeyCode;
use ggez::{
conf::WindowSetup,
event::{self, EventHandler, KeyMods},
};
use ggez::{Context, ContextBuilder, GameResult};
/// Define the maximum FPS for the game
const DESIRED_FPS: u32 = 60;
mod assets;
mod function;
mod game;
mod game_over;
mod main_menu;
/// The game's main struct... | Rust | 0 |
import time
import re
import pandas as pd
import time
from nltk.tokenize import sent_tokenize
import jieba
# Count_Words idea is to approximate the number of tokens in the sentence. We are assuming 1 word ~ 1.2 Tokens
def count_words(input_string,language):
if language=='en':
words = input_string.split(... | Python | 1 |
_REQUIRED_LEN: &str = "38";
pub const PAYLOAD_TOO_LARGE: &[u8] = b"Blob too large";
pub const PAYLOAD_TOO_LARGE_LEN: &str = "14";
pub const INCOMPLETE: &[u8] = b"Incomplete blob";
pub const INCOMPLETE_LEN: &str = "15";
pub const UNEXPECTED_BODY: &[u8] = b"Unexpected request bo... | Rust | 0 |
),
);
instr(Instruct::ContFlow(InstructControlFlow::SSwitch {
cases,
targets,
}))
}
pub fn newobjr<'a>() -> InstrSeq<'a> {
instr(Instruct::New(InstructNew::NewObjR))
}
pub fn newobjd<'a>(id: ClassId<'a>) -> InstrSeq<'a> {
instr(Instruct::... | Rust | 0 |
##q8
a= int(input ("enter first number:"))
b= int(input ("enter second number:"))
temp=a
a=b
b=temp
print("a=",a,'b=',b)
| Python | 1 |
) {
let y: u64 = two_power(i) + j * two_power(i + 1) - 1;
let zmax: u64 = two_power(i) + 1;
for z in 1u64..zmax {
if y + z < k {
let res_op: Array<SecretModp, 2> = op(
output.get_unchecked(y).clone(),
... | Rust | 0 |
------------------5 Минуты Волшебные Случайные words---------------------------------[/yellow]')
t_end = time.time() + 60 * 5
t = time.localtime()
current_time = time.strftime("%H:%M:%S", t)
while time.time() < t_end:
finish= 0
count += 1
... | Python | 1 |
self.view.increment_zoom(y);
}
fn on_mouse_move(&mut self, x: f32, y: f32) {
match self.last_drag_point {
Some((prev_x, prev_y)) => {
const SCALE_FACTOR: f32 = 0.015;
let dx = (x - prev_x) * SCALE_FACTOR;
let dy = (y - prev_y) * SCALE_FACTOR;... | Rust | 0 |
DEM_INF_NOT_FOUND
/// The modem (`%1`) was not found in MODEM.INF.
pub const CTX_INVALID_MODEMNAME : NtStatus = NtStatus::from_constant(0xC00A0009); // STATUS_CTX_INVALID_MODEMNAME
/// The modem did not accept the command sent to it.
/// Verify the configured modem name matches the attached modem.
pub const CTX_RESPO... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.