text string | label_name string | labels int64 |
|---|---|---|
();
vertices.sort_unstable_by_key(|w| w.index);
RawMesh {
vertices: vertices.into_iter().map(|w| w.vertex).collect(),
triangles: self
.indices
.chunks_exact(3)
.map(|i| TriangleDefinition([i[0], i[1], i[2]]))
.collec... | Rust | 0 |
default_value("1.1.1.1"),
)
.arg(Arg::with_name("domain-name").required(true))
.get_matches();
let domain_name_raw = app.value_of("domain-name").unwrap();
let dns_server_raw = app.value_of("dns-server").unwrap();
let mut request_as_bytes: Vec<u8> = Vec::with_capacity(512);
let m... | Rust | 0 |
import torch
from typing import List, Tuple, Dict, Optional
from enum import Enum
from collections import namedtuple
from .samd_config import SamdConfig
from .sam import DynSAM, StaticSAM
from profile_utils import profile_decorator
from transformers import LlamaConfig, LlamaForCausalLM
# from transformers import Llam... | Python | 1 |
if idx == 0: # 过期的棒棒糖
if 10.17 <= amount < 101.7: # 10.17-101.7, 积分清零
points = 0
bonus_report += '很不幸,你获得了【过期的棒棒糖】,本次获取的积分清零T_T'
elif amount >= 101.7: # 多于101.7,积分减半
points = int(points // 2)
bonus_report += '很不幸,你获得了【过期的棒棒糖】,本次获取的积分减半T_T'
elif idx... | Python | 1 |
(|f| &f.ident)
.flatten();
let a = fields.next();
let b = fields.next();
let c = fields.next();
let name = &input.ident;
TokenStream::from(quote! {
impl ops::Add<#name> for #name {
type Output = #name;
fn add(self, other: #name) -> #name {
#name... | Rust | 0 |
ize, Deserialize)]
pub struct NpcMoves {
pub npc_moves_remaining: usize,
pub ticks_till_next_npc_move: usize,
// Essentially, whether "response" systems should run
pub move_was_made: bool,
}
impl NpcMoves {
pub fn player_can_move(&self) -> bool {
self.npc_moves_remaining == 0 && self.ticks_... | Rust | 0 |
ependencies. The
# condition we impose is that there is a git submodule for every dependency in
# the workspace, but not necessarily conversely. E.g. Bloaty is a dependency
# not used by any of the targets built by Bazel.
if len(workspace_git_hashes - git_submodule_hashes) > 0:
print(
"Found discrepancies b... | Python | 1 |
let b = Matrix::randsn(m, nrhs);
let x = solve_driver(&a, &b).expect("solve failed unexpectedly");
assert_eq!(x.dims(), (n, nrhs));
println!("a*x\n{}\nb\n{}", &a * &x, &b);
assert_fpvec_eq!(&a * &x, &b);
}
#[test]
fn test_solve_approx_nrhs_narrow() {
let (m,... | Rust | 0 |
# λ Calculus 當中的所有資料結構都是用 closure 達成的
# 換言之,所有的資料結構都是函數閉包。
# Church Booleans : Logic
IF = λ c:λ x:λ y:c(x)(y) # if: λ c x y. c x y # if c then x else y.
TRUE = λ x:λ y:x # if true then x # 兩個參數執行第一個
FALSE = λ x:λ y:y # if false then y # 兩個參數執行第二個
AND = λ p:λ q:p(q)(p) # if p then q else p
OR = λ p:λ q:p(p)(q)... | Python | 1 |
_usage(&program, &opts);
process::exit(1);
}
};
// Default to "stream" if traffic type is not defined.
let traffic_type = matches.opt_str("t");
if let Some(t) = traffic_type {
match t.as_ref() {
"stream" => {}
"datagram" => {
warn!("da... | Rust | 0 |
lf) -> bool {
self.status() == ItemStatus::Init as u8
}
// reset只会把状态从shutdown变更为init
// 必须在shutdown之后调用
pub(crate) fn reset(&self) {
//self.status_cas(ItemStatus::Shutdown as u8, ItemStatus::Init as u8);
self.status.store(Init as u8, Ordering::Release);
self.try_wake();
... | Rust | 0 |
, 'shi': 'ⵜⴰⵟⴰⵍⵢⴰⵏⵜ', 'shi-Latn': 'Taṭalyant', 'shi-Tfng': 'ⵜⴰⵟⴰⵍⵢⴰⵏⵜ', 'si': 'ඉතාලි', 'sk': 'taliančina', 'sl': 'italijanščina', 'smn': 'italiakielâ', 'sn': 'chiTariana', 'so': 'Talyaani', 'sq': 'italisht', 'sr': 'италијански', 'sr-Cyrl': 'италијански', 'sr-Latn': 'italijanski', 'su': 'Italia', 'su-Latn': 'Italia', 's... | Python | 1 |
= df / d(\sigma_t-1(())
#### strategy 1 ####
# xyz_difference = self.get_finite_difference_of_density(fr + 1, nex_density_index.x, nex_density_index.y, nex_density_index.z)
# cur_def_grad = -1. * self.density_tot_frames.grad[fr, i, j, k] * xyz_difference... | Python | 1 |
}
<reponame>erikhyrkas/doglang
use crate::lex::group::Group;
#[derive(PartialEq, Eq, Debug)]
pub enum MatchRepeats {
Once,
ZeroOrMore,
OneOrMore,
ZeroOrOne,
}
pub fn min_matches(match_repeats: &MatchRepeats) -> i32 {
let result;
match match_repeats {
MatchRepeats::Once => { result = 1... | Rust | 0 |
_uchar_U(*(rs_allocation*)buf3692, *(uint32_t*)buf3693, *(uint32_t*)buf3694);
*(uchar*)buf3695 = rsGetElementAtYuv_uchar_V(*(rs_allocation*)buf3696, *(uint32_t*)buf3697, *(uint32_t*)buf3698);
*(uchar*)buf3699 = rsGetElementAtYuv_uchar_Y(*(rs_allocation*)buf3700, *(uint32_t*)buf3701, *(uint32_t*)buf3702);
*(... | Rust | 0 |
:
last_test = not last_test
char_lines = line_for_char[ch]
if len(char_lines) >= expect_size:
continue
elif length < 5 and char_lines and len(lines[char_lines[0]]) > 10:
continue
line_for_char[ch].append(k)
used_line... | Python | 1 |
n = int(input())
for i in range(n) :
n1,n2,n3 = map(float,input().split(" "))
media = (n1*2 + n2 *3 + n3*5)/10
print("%.1f"%media)
| Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Odoo 17 Accounting',
'version': '2.0.2',
'category': 'Accounting',
'summary': 'Accounting Reports, Asset Management and Budget, Recurring Payments, '
'Lock Dates, Fiscal Year, Accounting Dashboard, Fina... | Python | 1 |
# Import standard python modules
import logging
# Import python types
from typing import Optional, Dict
# Import device utilities
from device.utilities.logger import Logger
# Import i2c package elements
from device.utilities.communication.i2c.exceptions import MuxError
class MuxSimulator(object):
"""I2C mux si... | Python | 1 |
new();
sql.push_str("INSERT INTO art (id, title, votes) VALUES ");
for i in 0..bs {
if i != 0 {
sql.push_str(", ");
}
sql.push_str(&format!("({}, 'Article #{}', 0)", aid, aid));
aid +=... | Rust | 0 |
ocess;
fn load_patterns() -> Result<day21::PatternSet, failure::Error> {
let stdin = io::stdin();
let mut patterns = day21::PatternSet::new();
for line in stdin.lock().lines() {
patterns.insert(&line?)?;
}
Ok(patterns)
}
fn main() {
let patterns = match load_patterns() {
Ok(p) => p,
Err(e) => ... | Rust | 0 |
ART_UTX_END_INT_UMSK: i32 = -2;
pub const UART_URX_END_INT_POS: u32 = 1;
pub const UART_URX_END_INT_LEN: u32 = 1;
pub const UART_URX_END_INT_MSK: u32 = 2;
pub const UART_URX_END_INT_UMSK: i32 = -3;
pub const UART_UTX_FIFO_INT_POS: u32 = 2;
pub const UART_UTX_FIFO_INT_LEN: u32 = 1;
pub const ... | Rust | 0 |
e setup
fig = plt.figure(
figsize=(
width,
width / (len(labels) if fixed_height is None else fixed_height) + 0.1,
)
)
grid = AxesGrid(
fig, 111, nrows_ncols=(1, len(labels)), cbar_mode="edge", cbar_size="10%"
)
for ax in grid:
ax.axes.xaxis.set... | Python | 1 |
import time
import turtle
from ball import Ball
from brick_manager import BrickManager
from colors_fonts import BG_COLOR
from paddle import Paddle
from scoreboard import Scoreboard
screen = turtle.Screen()
screen.bgcolor(BG_COLOR)
screen.setup(width=1000, height=600)
screen.title("Breakout")
screen.tracer(0)
paddle ... | Python | 1 |
lob.glob(self.norm('aa*') + os.sep)
self.assertEqual(len(res), 2)
# either of these results is reasonable
self.assertIn(set(res), [
{self.norm('aaa'), self.norm('aab')},
{self.norm('aaa') + os.sep, self.norm('aab') + os.sep},
])
... | Python | 1 |
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QPushButton, QLabel
from PyQt6.QtGui import QFont
from PyQt6.QtCore import QProcess
import os
class RadiationMapTab(QWidget):
def __init__(self):
super().__init__()
self.init_ui()
def init_ui(self):
layout = QVBoxLayout()
label ... | Python | 1 |
f.ball.y = self.screen_height // 2
self.ball.vx = self.ball.speed * direction
self.ball.vy = self.ball.speed * random.choice([-1, 1]) * random.uniform(0.5, 1.0)
def draw_scores(self):
left_text = self.font.render(str(self.left_score), True, self.ball.color)
right_text = self.font.... | Python | 1 |
. S SK Jr S SKrS SKrS SKrS SKrS SKrS SKJr S SK J
r
S SK Jr S SK
JrJr S SKJr S SKJr S S KJrJr S S
KJr S SKJrJrJrJrJrJrJ r J!r!J"r" S SK#J$r$J%r% S S
K&J'r'J(r(J)r)J*r* \RV " SSSS9r, ... | Python | 1 |
v[0];
iv[..n - 1].clone_from_slice(&iv_copy[1..]);
iv[n - 1] = t;
}
}
self.iv = iv;
}
}
impl<C, P> IvState<C, P> for Cfb8<C, P>
where
C: BlockCipher + BlockEncrypt + NewBlockCipher,
P: Padding,
{
fn iv_state(&self) -> GenericArray<u8, Self::Iv... | Rust | 0 |
def availability(self, request, pk=None):
"""
Проверка доступности транспортного средства.
"""
vehicle = self.get_object()
start_time = request.query_params.get('start_time')
end_time = request.query_params.get('end_time')
if not start_time or not end_time:
... | Python | 1 |
"target/**",
# These are not vendored from the crate - we exclude them to avoid busting caches
# when we change how we generate BUILD files and such.
"BUILD.bazel",
"WORKSPACE.bazel",
"WORKSPACE",
]),
tags = [
"cargo-raze",
"manual",
],
version = ... | Rust | 0 |
.push(p.parse()?);
}
let mut items = Vec::new();
let mut item_attributes = p.parse()?;
let mut item_visibility = p.parse()?;
let mut path = p.parse::<Option<ast::Path>>()?;
while path.is_some() || ast::Item::peek_as_item(p.peeker(), path.as_ref()) {
let ite... | Rust | 0 |
o
[aA& |