text string | label_name string | labels int64 |
|---|---|---|
b])
@staticmethod
def _euclidean_distance(a: np.ndarray, b: np.ndarray) -> np.floating:
"""Compute the Euclidean distance between two vectors.
Args:
a (np.ndarray): The first vector.
b (np.ndarray): The second vector.
Returns:
np.floating: The Eucli... | Python | 1 |
(CREA, FLAG) => FieldType::CreatureFlags,
(NPC_, FLAG) => FieldType::NpcFlags,
(_, FLAG) => FieldType::I32,
(_, FLTV) => FieldType::F32,
(GLOB, FNAM) => FieldType::String(None),
(PCDT, FNAM) => FieldType::U8ListZip,
(_, FNAM) => FieldT... | Rust | 0 |
$globals) = ignore_depth;
// if every_vbox<>null then begin_token_list(every_vbox,every_vbox_text);
if every_vbox!($globals) != null {
begin_token_list($globals, every_vbox!($globals), every_vbox_text);
}
// end
}
// else begin space_factor:=1000;
else {
... | Rust | 0 |
_Internal = *mut FT_Slot_InternalRec_;
pub type FT_SubGlyph = *mut FT_SubGlyphRec_;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct TT_Header_ {
pub Table_Version: FT_Fixed,
pub Font_Revision: FT_Fixed,
pub CheckSum_Adjust: FT_Long,
pub Magic_Number: FT_Long,
pub Flags: FT_UShort,
pub Units_Per_EM:... | Rust | 0 |
f.write(u'abcde')
s = f.getvalue()
self.assertEqual(s, 'abcde')
self.assertEqual(type(s), str)
f = self.MODULE.StringIO(u'abcde')
s = f.getvalue()
self.assertEqual(s, 'abcde')
self.assertEqual(type(s), str)
# This cStringIO/StringIO difference seems CPyt... | Python | 1 |
# Tuple demonstrations
a = ()
print(a, type(a))
b = (12, 45, 52, 74, 61, 11, 13, 'abcd')
print(b[1], b[-1])
# This is an integer, not a tuple
c = (45)
print(c, type(c))
# Just arithmetic operation
d = (45 + 6) * 2
print(d, type(d))
# Single element tuple
e = (57,)
print(e, type(e))
# Tuple without parentheses
f = ... | Python | 1 |
>,
F::Response: Send + 'static,
F::Future: Send + 'static,
S: Service<T> + Clone + Unpin + Send + 'static,
S::Error: Into<Error>,
S::Response: Send + 'static,
S::Future: Send + 'static,
{
type Response = AcceptHttp<F::Response, S::Response>;
type Error = Error;
type Future =
... | Rust | 0 |
sleep(1)
max_count -= 1
else:
#send_slack_message("ํ์๊ฐ์
ํ์
์์")
self.driver.implicitly_wait(5)
sleep(1)
print("ํ์๊ฐ์
ํ์
์กฐํ ์คํจ")
#self.fail()
except Exception as e:
... | Python | 1 |
ec::new(), None), &complex_img())
);
}
#[test]
fn test_fg_and_bg_2_fgs() {
assert_eq!(
(vec![BLUE, Rgb::BLACK], Rgb::WHITE),
fg_and_bg(&ac(2, Vec::new(), None), &complex_img())
);
}
#[test]
fn test_fg_and_bg_excess_fgs() {
assert_eq!(
... | Rust | 0 |
600;
}}
.footer {{
text-align: center;
margin-top: 60px;
padding: 32px;
background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
border-radius: 16px;
border: 1px solid #334155;
... | Python | 1 |
HOT
* Contact: <EMAIL>
* Generated by: https://openapi-generator.tech
*/
/// TimeTrackingProvider : Details about the time tracking provider.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct TimeTrackingProvider {
/// The key for the time tracking provider. For example, *JIRA*.
#[serde... | Rust | 0 |
gument is absent')
self.test_address(3, self.nodes[3].getrawchangeaddress(), multisig=False, typ='bech32')
self.log.info('test invalid address type arguments')
assert_raises_rpc_error(-5, "Unknown address type ''", self.nodes[3].addmultisigaddress, 2, [compressed_1, compressed_2], None, '')
... | Python | 1 |
les>,
) {
if game_screen.current_screen == CURRENT_SCREEN && !screen.loaded {
info!("Loading screen");
let font: Handle<Font> = asset_handles.get_font_main_handle(&asset_server);
commands
.spawn(NodeBundle {
style: Style {
margin: Rect::all(V... | Rust | 0 |
from collections import deque
def bfs(jugs, buckets):
# Initialize the queue and the parent list
queue = deque([([0]*len(buckets), None)])
parent = {tuple([0]*len(buckets)): None}
while queue:
# Dequeue a state
state, prev_action = queue.popleft()
# If this state is the final... | Python | 1 |
# Model constants
DEEPLAB = 'deeplab'
DEEPLAB_50 = 'deeplab_50'
DEEPLAB_34 = 'deeplab_34'
DEEPLAB_18 = 'deeplab_18'
DEEPLAB_MOBILENET = 'deeplab_mn'
DEEPLAB_MOBILENET_DILATION = 'deeplab_mnd'
UNET = 'unet'
UNET_PAPER = 'unet_paper'
UNET_PYTORCH = 'unet_torch'
PSPNET = 'pspnet'
# Dataset constants
DOCUNET = 'docunet'
D... | Python | 1 |
ntinue providing input frames until encode driver returns"]
#[doc = " ::NV_ENC_SUCCESS. After receiving ::NV_ENC_SUCCESS status the client can call"]
#[doc = " ::NvEncLockBitstream() API on the output buffers in the same order in which"]
#[doc = " it has called ::NvEncEncodePicture()."]
NV_ENC_ERR_NEED_... | Rust | 0 |
def evalexpn(exp):
s=[]
i=0
while i<len(exp):
if exp[i].isdigit():
n=int(exp[i])
i=i+1
while i<len(exp) and exp[i].isdigit():
n=n*10+int(exp[i])
i=i+1
s.append(n)
elif exp[i] =="+":
s.append("+")
... | Python | 1 |
x, x) for x in value], mutable_local=MutableLocal()
)
elif isinstance(value, (tuple, list)):
cls = BaseListVariable.cls_for(type(value))
return cls([self(tx, x) for x in value], mutable_local=MutableLocal())
elif isinstance(value, types.MethodWrapperType):
... | Python | 1 |
ernel_sizes=(3, 3),
dropout=0,
residual=False,
norm_cfg=None)
model2 = TCN(
in_channels=34,
stem_channels=4,
num_blocks=1,
kernel_sizes=(3, 3),
dropout=0,
residual=False,
norm_cfg=None,
... | Python | 1 |
"""This script is to generate training list files for Deep3DFaceRecon_pytorch
"""
import os
# save path to training data
def write_list(lms_list, imgs_list, msks_list, mode='train',save_folder='datalist', save_name=''):
save_path = os.path.join(save_folder, mode)
if not os.path.isdir(save_path):
os.ma... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Tomoki Hayashi
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Filter samples by focus rates."""
import argparse
import logging
import os
import kaldiio
def main():
"""Run filtering by focus rate."""
parser = argparse.ArgumentP... | Python | 1 |
# Copyright (c) 2025 Intel Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writ... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python | 1 |
nt: WRNEN_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "TWRN_INT and RWRN_INT bits are zero, independent of the values in the error counters."]
#[inline(always)]
pub fn wrnen_0(self) -> &'a mut W {
self.variant(WRNEN_A::WRNEN_0)
}
#[doc = "TWRN_INT... | Rust | 0 |
(most), or s (size); default is "most"
#[structopt(
long,
value_name = "LEVEL",
parse(try_from_str = parse_opt_level),
verbatim_doc_comment,
)]
opt_level: Option<wasmtime::OptLevel>,
/// Set a Cranelift setting to a given value.
/// Use `wasmtime settings` to list Cr... | Rust | 0 |
-8 -*-
use std::env;
fn double_arg(mut argv: env::Args) -> Result<i32, String> {
match argv.nth(1) {
None => Err("ๆฐๅญใ๏ผใคๆๅฎใใฆใใ ใใใ".to_owned()),
Some(arg1) => {
match arg1.parse::<i32>() {
Ok(n) => Ok(2 * n),
Err(err) => Err(err.to_string()),
}... | Rust | 0 |
# -*- coding: utf-8 -*-
#
# co_co_function_unique.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 2 of the L... | Python | 1 |
e item to remove.
default: The default value to return if the key does not exist.
Returns:
The value associated with the key, or the default value.
Raises:
KeyError: If the key does not exist and no default value is provided.
"""
value = self.target.... | Python | 1 |
push_back(element);
out
}
pub fn pop(&mut self) -> Option<T> {
self.data.pop_front()
}
pub fn size(&self) -> usize {
self.size
}
pub fn is_empty(&self) -> bool {
self.len() == 0
}
pub fn len(&self) -> usize {
self.data.len()
}
pub fn c... | Rust | 0 |
type Checker = glib::value::GenericValueTypeChecker<Self>;
unsafe fn from_value(value: &'a glib::Value) -> Self {
skip_assert_initialized!();
from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0))
}
}
impl ToValue for WebRTCICEConnectionState {
fn to_value(&self) -> glib::V... | Rust | 0 |
F3A, 0x9F3C, 0x9F3D, 0x9F3F, 0x9F41, 0x9F43, 0x9F44, 0x9F45, 0x9F46, 0x9F47, 0x9F53, 0x9F55,
0x9F56, 0x9F57, 0x9F58, 0x9F5A, 0x9F5D, 0x9F5E, 0x9F68, 0x9F69, 0x9F6D, 0x9F6E, 0x9F6F, 0x9F70,
0x9F71, 0x9F73, 0x9F75, 0x9F7A, 0x9F7D, 0x9F8F, 0x9F90, 0x9F91, 0x9F92, 0x9F94, 0x9F96, 0x9F97,
0x9F9E, 0x9FA1, 0x9FA2,... | Rust | 0 |
ex]
)
post = remove_leading_index_zero(
self.post_cells[conn_type][post_index]
)
if is_body_wall_muscle(post):
continue # post is a BWM so ignore
num = self.conn_nums[co... | Python | 1 |
', 11), # Ice pad 2
('MISC', 12), # M1 PADS
('MISC', 14), # CARLOS 2
('MISC', 16), # Soft touch
('PPGVOCAL', 30), # *Planets
('MISC', 17), # Cirrus
('MISC', 18), # ENTRIX
('Guit_Clav4', 27), # Mal Poly
('MISC', 20), # Textures 6
('MISC', 10), # Etherial5a
('MISC', 15), # Airy
... | Python | 1 |
)> + Send>,
}
impl<D, S: NetworkSpecialization<Block>> Peer<D, S> {
/// Returns true if we're major syncing.
pub fn is_major_syncing(&self) -> bool {
self.network.service().is_major_syncing()
}
/// Returns the number of peers we're connected to.
pub fn num_peers(&self) -> usize {
self.network.num_connected_p... | Rust | 0 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
} g | j _ x t d | D] } t j j } | } | d 7} t j | | | ! \ } | } | | 7} t
r | | | !j d | _ n | | | !| _ | } | } | d 7} t
j | | | ! \ | _ | _ | j j j | qr W| } | d 7} t j | | | ! \ | j _ | } | d 7} t j | | | ! \ } d ... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import numpy as np
import networkx as nx
from matplotlib import pyplot as plt
#Initial Dictionary
Dict = {0: {'Neighbors': [1,3,5,7], 'Infection Status': 1},
1: {'Neighbors': [0,4,6,7], 'Infection Status': 0},
2: {'Neighbo... | Python | 1 |
# Copyright 2024 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | Python | 1 |
});
NEW_BUTTONS[position.1 as usize][position.0 as usize].unwrap()
})
.collect()
}
fn main() {
let input = fs::read_to_string("input.txt").expect("Error reading input.txt");
println!("What is the bathroom code? {}", get_code(&input),);
println!(
"โฆwhat is the correc... | Rust | 0 |
image individually
segm_results = []
mask_scores = []
for i in range(num_imgs):
if det_bboxes[i].shape[0] == 0:
segm_results.append(
[[] for _ in range(self.mask_head.num_classes)])
mask_scores.append(
... | Python | 1 |
h shape [N]
"""
assert len(x.size()) == 3
assert len(y.size()) == 3
assert x.size(0) == y.size(0)
assert x.size(-1) == y.size(-1)
# shape [N, m, n]
dist_mat = batch_euclidean_dist(x, y)
dist_mat = (torch.exp(dist_mat) - 1.) / (torch.exp(dist_mat) + 1.)
# shape [N]
dist = shortest_dist(dist_mat.perm... | Python | 1 |
#!/usr/bin/env python
# *****************************************************************************
# Copyright (c) 2019 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompa... | Python | 1 |
"""
ะกะตัะฒะธั ะดะปั ัะฟัะฐะฒะปะตะฝะธั QR ะพัะตัะตะดัะผะธ
"""
import secrets
import qrcode
import io
import base64
from datetime import datetime, timedelta, date
from typing import Optional, Dict, Any, List, Tuple
from sqlalchemy.orm import Session
from sqlalchemy import and_, or_, func
from app.models.online_queue import (
DailyQue... | Python | 1 |
{ std::slice::from_raw_parts_mut(pixels as *mut u8, length as usize) };
handler(slice, &bitmap_info);
unsafe {
if super::bitmap::AndroidBitmap_unlockPixels(native_interface as _, bitmap)
!= super::bitmap::ANDROID_BITMAP_RESULT_SUCCESS
{
debug!("Unlock Bitmap Failed");
... | Rust | 0 |
= get_llm_model(model_name)
response_text = model.invoke(prompt)
# Extract sources
sources = [doc.metadata.get("source", "Unknown") for doc, _score in results]
return response_text, sources
# Streamlit App modifications
st.title("Advanced RAG-Based Financial Report QA")
st.write("Leverage advance... | Python | 1 |
local! {
static BUFFER: RefCell<Vec<u8>> = RefCell::new(Vec::with_capacity(64 << 10));
}
pub fn get_vertex_id_by_primary_keys<'a, T: Deref<Target=Vec<u8>>>(label_id: LabelId, pks: impl Iterator<Item=T>) -> VertexId{
BUFFER.with(|bytes| {
let mut bytes = bytes.borrow_mut();
bytes.clear();
... | Rust | 0 |
big_df["ไบคๆๆฅๆ"], errors="coerce").dt.date
big_df["ๅผ็ไปท"] = pd.to_numeric(big_df["ๅผ็ไปท"], errors="coerce")
big_df["ๆ้ซไปท"] = pd.to_numeric(big_df["ๆ้ซไปท"], errors="coerce")
big_df["ๆไฝไปท"] = pd.to_numeric(big_df["ๆไฝไปท"], errors="coerce")
big_df["ๆไบคๅไปท"] = pd.to_numeric(big_df["ๆไบคๅไปท"], errors="coerce")
big_df["ๆถ... | Python | 1 |
# !/usr/bin/env python3
# Copyright (c) 2021 Institute for Quantum Computing, Baidu Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | Python | 1 |
from datetime import datetime, timedelta
from bot.schemas import RequestSchema, AggregatedPaymentsSchema, DatasetSchema
def make_pipline(request: RequestSchema) -> list[dict]:
groups = {
"hour": {'$hour': '$dt'},
"day": {'$dayOfMonth': '$dt'},
"month": {'$month': '$dt'},
}
group =... | Python | 1 |
impl ::core::clone::Clone for HTAPICALL__ {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[doc = "*Required features: 'Win32_Devices_Tapi'*"]
pub struct HTAPILINE__ {
pub unused: i32,
}
impl ::core::marker::Copy for HTAPILINE__ {}
impl ::core::clone::Clone for HTAPILINE__ {
fn clone(&self) -> ... | Rust | 0 |
# Arbitrary Value Imputation
arbitrary_value = -999 # Define the arbitrary value
df_arbitrary = df.fillna(arbitrary_value)
print("\nArbitrary Value Imputation:")
print(df_arbitrary)
| Python | 1 |
coding::RLE],
);
check_encoding_write_support::<Int96Type>(
WriterVersion::PARQUET_2_0,
false,
&[Int96::from(vec![1, 2, 3])],
None,
&[Encoding::PLAIN, Encoding::RLE],
);
}
#[test]
fn test_column_writer_default_encoding_supp... | Rust | 0 |
print("All formatted!")
| Python | 1 |
import xxhash
from unidecode import unidecode
def create_hash(*args: str, decode=False, limit=10) -> str:
"""
This function creates a case-insensitive, non-alphanumeric chars ignoring hash from the given arguments.
Example use case:
- Creating computable IDs for duplicate artists. eg. Juice WRLD ... | Python | 1 |
#
# Copyright 2018-2023 Elyra Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python | 1 |
fn delete(backend: sq_engine::Backend) -> impl Filter<Extract = impl Reply, Error = warp::Rejection> + Clone {
warp::path!("api" / String / String / "job" / String)
.and(warp::delete())
.and(with_backend(backend))
.and_then(do_delete_job)
}
/// GET /api/:namespace/:queue/peek
pub fn peek(ba... | Rust | 0 |
"""Add US Only verification for mail-in artists
Revision ID: 0a3de3158ae9
Revises: fc49b3e7cc91
Create Date: 2019-07-17 03:06:25.474811
"""
# revision identifiers, used by Alembic.
revision = '0a3de3158ae9'
down_revision = 'fc49b3e7cc91'
branch_labels = None
depends_on = None
from alembic import op
import sqlalche... | Python | 1 |
ref()) };
Some(match system as _ {
ffi::ZIP_ET_SYS => System::Sys(code),
ffi::ZIP_ET_ZLIB => System::Zlib(code),
_ => System::Unknown(code),
})
}
}
}
pub fn zip(&self) -> Option<Zip> {
let cod... | Rust | 0 |
deserializing message payload: {:?}", e);
""
}
};
info!("key: '{:?}', payload: '{}', topic: {}, partition: {}, offset: {}, timestamp: {:?}",
m.key(), payload, m.topic(), m.partition(), m.offset(), m.timestamp());
... | Rust | 0 |
}
}
named!(parse_stream_start<()>, do_parse!(
eat_pdf_ws >>
tag!(b"stream") >>
alt!(tag!(b"\n") | tag!(b"\r\n")) >>
()
));
/// Matches either a dictionary or a stream
///
/// It's efficient to detect a dictionary, then use it for a stream if it is a stream, or just
/// return a dictionary if not. We h... | Rust | 0 |
class Solution:
def removeInterval(self, intervals: List[List[int]], toBeRemoved: List[int]) -> List[List[int]]:
ans = []
for a, b in intervals:
if a >= toBeRemoved[1] or b <= toBeRemoved[0]:
ans.append([a, b])
else: # a < toBeRemoved[1] and b > toBeRemoved[0]
if a < toBeRemoved[... | Python | 1 |
n
})
response.content_type = 'application/json';
return response
def error_response(error, status_code=400):
response = flask.make_response(flask.json.dumps({'error': error}), status_code)
response.content_type = 'application/json';
return response;
def sanitize_ns(ns):
if not ns.tempos:... | Python | 1 |
ixing matrix
1 1 2.78399839e-01 # O_{11}
1 2 9.60465267e-01 # O_{12}
2 1 9.60465267e-01 # O_{21}
2 2 -2.78399839e-01 # O_{22}
";
let slha = Slha::parse(input).unwrap();
println!("{:?}", slha);
let alpha: BlockSingle<f64> = slha.get_block("alpha").unwrap().unwra... | Rust | 0 |
new() -> MainLoop{
unsafe{
MainLoop{ gst_loop: g_main_loop_new(mem::transmute(ptr::null::<c_void>()), 0), running: false }
}
}
pub fn spawn(&mut self){
if !self.running {
self.running = true;
let gst_loop: usize = unsafe{ mem::transmute(self.gst_loop) };
thread::spawn( move|| {
unsafe{
g_... | Rust | 0 |
ring>,
app: App<'static, 'static>,
}
impl DirsCommand {
pub fn new(args: Vec<String>) -> DirsCommand {
DirsCommand {
args,
app: App::new("dirs")
.about("Display directory stack.")
.setting(AppSettings::NoBinaryName)
.setting(AppSet... | Rust | 0 |
rev | Python | 1 |
s)]
const A_I8_T
: [u32; (i8::MAX as i8 + 1u8) as usize]
//~^ ERROR mismatched types
//~| expected `i8`, found `u8`
//~| ERROR cannot add `u8` to `i8`
= [0; (i8::MAX as usize) + 1];
const A_CHAR_USIZE
: [u32; 5u8 as char as usize]
= [0; 5];
const A_BAD_CHAR_USIZE
: [u32; 5i8 as char... | Rust | 0 |
import pygame
from sys import exit
pygame.init()
screen = pygame.display.set_mode((1600, 900))
pygame.display.set_caption('Planes!')
clock = pygame.time.Clock()
screen_color = pygame.Surface((1600, 900))
screen_color.fill('lightblue')
# functions:
def createGameGrid(rows, cols, cellsize, pos):
"""Creates a game... | Python | 1 |
000;
pub const PSH_NOMARGIN: DWORD = 0x10000000;
FN!{stdcall PFNPROPSHEETCALLBACK(
HWND,
UINT,
LPARAM,
) -> c_int}
STRUCT!{struct PROPSHEETHEADERA_V2 {
dwSize: DWORD,
dwFlags: DWORD,
hwndParent: HWND,
hInstance: HINSTANCE,
hIcon: HICON,
pszCaption: LPCSTR,
nPages: UINT,
pStar... | Rust | 0 |
"""
Projection Examples
name: projection.py
by: Gumyr
date: January 4th 2023
desc: Projection examples.
license:
Copyright 2023 Gumyr
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 Lice... | Python | 1 |
inal[int] = constants.InvoiceLimit.MIN_PAYLOAD_LENGTH
""":const:`telegram.constants.InvoiceLimit.MIN_PAYLOAD_LENGTH`
.. versionadded:: 20.0
"""
MAX_PAYLOAD_LENGTH: Final[int] = constants.InvoiceLimit.MAX_PAYLOAD_LENGTH
""":const:`telegram.constants.InvoiceLimit.MAX_PAYLOAD_LENGTH`
.. versionad... | Python | 1 |
n inside_rect(point: Point, x: i32, y: i32, w: i32, h: i32) -> bool {
x <= point.x && y <= point.y && point.x < x + w && point.y < y + h
}
fn print_centered_line(platform: &Platform, x: i32, y: i32, w: i32, h: i32, text: &str) {
let x_ = {
let rect_middle = x + (w / 2);
std::cmp::max(rect_midd... | Rust | 0 |
]+b[0]*a[1];
res[2]=b[2]*a[0]+b[0]*a[2];
res[3]=b[3]*a[0]+b[2]*a[1]-b[1]*a[2]+b[0]*a[3];
res
}
}
// Vee
// The regressive product. (JOIN)
impl BitAnd for QUAT {
type Output = QUAT;
fn bitand(self: QUAT, b: QUAT) -> QUAT {
let mut res = QUAT::zero();
let a = self;
res[3]... | Rust | 0 |
# -*- coding: UTF-8 -*-
# vim: set expandtab sw=4 ts=4 sts=4:
#
# phpMyAdmin web site
#
# Copyright (C) 2008 - 2016 Michal Cihar <michal@cihar.com>
#
# 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 Foundati... | Python | 1 |
import pygame
from nrconstants import *
# Function to convert Scratch coordinates (center is 0,0) to Pygame coordinates (top-left is 0,0)
def scratch_to_pygame_coordinates(x, y):
scaled_x = x * SCALE_FACTOR
scaled_y = y * SCALE_FACTOR
pygame_x = scaled_x + (NATIVE_WIDTH // 2)
pygame_y = (NATIVE_HEIGHT ... | Python | 1 |
, Tile, TileMap};
pub use self::vec2::Vec2;
pub use self::prop::{Prop};
pub use self::entity::{Entity, Id, Event};
pub use self::matter::{Matter};
<gh_stars>0
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::Rect;
use crate::Vec2;
use glib::translate::*;
impl Rect {
#[doc... | Rust | 0 |
from snr.constants.models import DATADECIDE_FINAL_FIVE_CKPTS, MODEL_LIST_DATADECIDE_FINAL, MODEL_LIST_EXTERNAL
from snr.scripts.oe_eval_tasks import CUSTOM_LOSS, LLM_COMPRESSION, PALOMA
def get_resource_util(model, task_list):
batch_size = None
gpu_memory_utilization = 0.7
if model in [m['model'] for m i... | Python | 1 |
##..#.#########",
"####################",
"#.####....###.#.#.##",
"##.#################",
"#####.##.###..####..",
"..######..##.#######",
"####.##.####...##..#",
".#####..#.######.###",
"##...#.##########...",
"#... | Rust | 0 |
fVR", Error::Overflow);
decode_block_neg!(b"zzzzzzzzzzz", Error::Overflow);
// Invalid symbolsb"
decode_block_neg!(b"01111111111", Error::InvalidSymbol);
decode_block_neg!(b"11111111110", Error::InvalidSymbol);
decode_block_neg!(b"11111011111", Error::InvalidSymbol);
deco... | Rust | 0 |
# Copyright 2023-present, Argilla, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | Python | 1 |
rce: *mut GSource, can_recurse: gboolean);
}
extern "C" {
pub fn g_source_get_can_recurse(source: *mut GSource) -> gboolean;
}
extern "C" {
pub fn g_source_get_id(source: *mut GSource) -> guint;
}
extern "C" {
pub fn g_source_get_context(source: *mut GSource) -> *mut GMainContext;
}
extern "C" {
pub fn ... | Rust | 0 |
ltBitEndianMod__MainObj__Subnest {
fn new<S: KaitaiStream>(stream: &mut S,
_parent: &Option<Box<KaitaiStruct>>,
_root: &Option<Box<KaitaiStruct>>)
-> Result<Self>
where Self: Sized {
let mut s: Self = Default::defaul... | Rust | 0 |
requested_at=requested_at,
received_at=int(time.time() * 1000),
req_payload={
"model": model.name,
"messages": messages,
"metadata": {
"project": "summarize",
"step"... | Python | 1 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | Python | 1 |
LOAT16_CONVERSIONS__',
'--expt-relaxed-constexpr',
'--expt-extended-lambda'] + generator_flag}))
ext_modules.append(
CUDAExtension(name='unicore_fused_layernorm_backward_gamma_beta',
sources=['csrc/... | Python | 1 |
i, lbl])
def _init_td_list_store(self):
store = self.dungeon_tileset_store
for i, dt in enumerate(self._dungeon_tilesets):
store.append(
[
str(i),
dt.ground_level,
dt.dungeon_id,
self._labels... | Python | 1 |
util::ArrayList>>) {
// unsafe {
// let env = __jni_bindgen::Env::from_ptr(self.0.env);
// let (class, field) = env.require_class_field("org/xmlpull/v1/XmlPullParserFactory\0", "parserClasses\0", "Ljava/util/ArrayList;\0");
// env.set_object_field(class, field... | Rust | 0 |
'~')
}
/// Checks if the value is an ASCII whitespace character:
/// U+0020 SPACE, U+0009 HORIZONTAL TAB, U+000A LINE FEED,
/// U+000C FORM FEED, or U+000D CARRIAGE RETURN.
///
/// Rust uses the WhatWG Infra Standard's [definition of ASCII
/// whitespace][infra-aw]. There are several other ... | Rust | 0 |
#if iat == 0 and isp==0:
#plt.plot(w,Sfreal[iat,iorb,isp,:].real,'-',w,Sfreal[iat,iorb,isp,:].imag,'--')
#plt.legend(['Orb1 - Re Sf','Orb1 - Im Sf','Orb2 - Re Sf','Orb2 - Im Sf','Orb3 - Re Sf','Orb3 - Im Sf',\
#'Orb4 - Re Sf','Orb4 - Im Sf','Orb5 - Re Sf','Orb5 - Im Sf'])
#plt.show()
# ... | Python | 1 |
hod, CompressedTensorsLinearMethod)
assert isinstance(qkv_proj.scheme, CompressedTensorsWNA16)
assert qkv_proj.scheme.strategy == strategy
assert qkv_proj.scheme.group_size == (-1 if group is None else group)
assert qkv_proj.weight_packed.dtype is torch.int32
assert qkv_proj.we... | Python | 1 |
};
/// assert!(Monomial::<i32>::zero().is_zero());
/// ```
fn zero() -> Self {
Monomial::new(N::zero(), 0)
}
/// Sets self to zero.
///
/// # Example
///
/// ```
/// use rustnomial::{SizedPolynomial, Monomial};
/// let mut non_zero = Monomial::new(1, 1);
/// asse... | Rust | 0 |
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import os
from setuptools import find_packages, setup
def get_version():
init_py_path = os.path.join(
os.path.abspath(os.path.dirname(__file__)), "pytorchvideo", "__init__.py"
)
init_py = open(init_py_p... | Python | 1 |
91_R {
WRT_PROT_SEC_91_R::new(((self.bits >> 27) & 0x01) != 0)
}
#[doc = "Bit 26 - WRT_PROT_SEC_90"]
#[inline(always)]
pub fn wrt_prot_sec_90(&self) -> WRT_PROT_SEC_90_R {
WRT_PROT_SEC_90_R::new(((self.bits >> 26) & 0x01) != 0)
}
#[doc = "Bit 25 - WRT_PROT_SEC_89"]
#[inline(a... | Rust | 0 |
whatwg!(var=KOI8_U, mod=koi8_u, name="koi8-u")
singlebyte_whatwg!(var=MACINTOSH, mod=macintosh, name="macintosh")
singlebyte_whatwg!(var=WINDOWS_874, mod=windows_874, name="windows-874")
singlebyte_whatwg!(var=WINDOWS_1250, mod=windows_1250, name="windows-1250")
singlebyte_whatwg!(var=WINDOWS_1251, mod=windows_1251, na... | Rust | 0 |
from dataclasses import dataclass, field
from typing import List
from eth_utils import to_int
from indexer.domain import Domain
@dataclass
class Trace(Domain):
trace_id: str
from_address: str
to_address: str
value: int
input: str
output: str
trace_type: str
call_type: str
gas: in... | Python | 1 |
indices.push(i*4 + 1);
cur += glyph.advance_px;
i += 1;
}
gx::BufferTarget::Array.bind_buffer(self.vbo.gl_id());
gx::BufferTarget::Array.set_buffer_subdata::<TextVertex>(&vertices, 0);
gx::BufferTarget::Array.unbind_buffer();
gx::BufferTarget::Elem... | Rust | 0 |
:
///
/// <br> areaType - Area type as string
/// <br> areaName - Area name as string
/// <br> areaCode - Area Code as string
/// <br> date - Date as string [YYYY-MM-DD]
pub enum Filters {
areaType,
areaName,
areaCode,
date,
}
impl Filters {
/// Exports all valid filter fields to a Vec of strings
... | Rust | 0 |
kernels was executing on the GPU.
pub gpu: u32,
/// Percent of time over the past sample period during which global (device)
/// memory was being read or written to.
pub memory: u32,
}
impl From<nvmlUtilization_t> for Utilization {
fn from(struct_: nvmlUtilization_t) -> Self {
Self {
... | 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 |
ec::new();
for c in containers {
states.push(c.State());
}
println!("{:#?}", states);
} else {
println!("unknown format {}", self.format);
}
return Ok(());
}
}
use core::convert::TryFrom;
#[derive(Copy,Clone,Debug,Eq,PartialE... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.