text string | label_name string | labels int64 |
|---|---|---|
lConv
}
fmm::types::CallingConvention::Tail => llvm_sys::LLVMCallConv::LLVMFastCallConv,
}) as u32
}
<reponame>jfortin42/Wolf3D_rs<gh_stars>0
use super::*;
use parser::material::PortalSymbolSet;
pub use parser::material::PhysicsProperties;
#[derive(Debug)]
pub enum Shading {
Texture(String), ... | Rust | 0 |
from django.test import TestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from django.contrib.auth import get_user_model
from rest_framework.test import APIRequestFactory
from .models import CustomUser
from core.authentication import CustomJWTAuthentication
import os
# Custom user test case
cla... | Python | 1 |
(return_tx, rx_yield) = oneshot::channel();
let command = SwarmCommand::UnbanPeer { peer, return_tx };
self.send_command(command).await;
rx_yield.await.unwrap()
}
/// Check whether the Network has an established connection to a peer.
pub async fn is_connected(&mut self, peer: PeerI... | Rust | 0 |
Weekday::Saturday => "Sat",
Weekday::Sunday => "Sun",
}
}
#[cfg(feature = "formatting")]
fn full_weekday(weekday: Weekday) -> &'static str {
match weekday {
Weekday::Monday => "Monday",
Weekday::Tuesday => "Tuesday",
Weekday::Wednesday => "Wednesday",
Weekday::Thursda... | Rust | 0 |
['\u{002B}']),
(0x1d43a, &['\u{0047}']),
(0xfd23, &['\u{0636}', '\u{0649}']),
(0x2f49, &['\u{6708}']),
(0xfe5f, &['\u{0023}']),
(0xfb5f, &['\u{067A}']),
(0x33aa, &['\u{006B}', '\u{0050}', '\u{0061}']),
(0x1d6f0, &['\u{039F}']),
(0x316d, &['\u{11D9}']),
(0x1d424, &['\u{006B}']),
(... | Rust | 0 |
emy(distance: location::Distance) -> &'static Self {
weighted_choice(distance)
}
}
pub const COMMON: &[Class] = &[RAT, WOLF, SNAKE, SLIME, SPIDER];
pub const RARE: &[Class] = &[ZOMBIE, ORC, SKELETON, DEMON, VAMPIRE, DRAGON, GOLEM];
pub const LEGENDARY: &[Class] = &[CHIMERA, BASILISK, MINOTAUR, BALROG, PHOE... | Rust | 0 |
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrofork.
#
# Pyrofork is free software: you can redistribute it and/or modify
# it under ... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "ipetrash"
from dataclasses import dataclass
from urllib.parse import urljoin
import requests
from bs4 import BeautifulSoup
session = requests.session()
session.headers[
"User-Agent"
] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/2010... | Python | 1 |
# -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals
from snapshottest import Snapshot
snapshots = Snapshot()
snapshots['TestTopkTokens.test_matches_snapshot 1'] = '''<div id="circuits-vis-mock" style="margin: 15px 0;"/>
<script crossorigin type="module">
... | Python | 1 |
D BE UNCOMPRESSED SIZE, CAN BE PROBABLY GOT FROM THE FILE MANIFEST
for window in self.chunk_filesize_list.values() {
chunks.append(
u32::try_from(*window)
.unwrap_or_default()
.to_le_bytes()
.to_vec()
.bo... | Rust | 0 |
1.creat_point(p2);
println!("p3.x = {}, p3.y = {}", p3.x, p3.y);
}
}
//! Contains types for storing sorted or unsorted collections of data.
pub mod bit_mask;
pub mod rc;
pub mod stack;
use super::{Error, Highlight, HighlightConfiguration, HighlightEvent, Highlighter, HtmlRenderer};
use regex::Regex;
use std... | Rust | 0 |
rain_filter(|subscriber| {
subscriber.next(value);
subscriber.is_closed()
});
}
}
impl<Err, T> ObserverError<Err> for Vec<T>
where
Err: Copy,
T: ObserverError<Err> + SubscriptionLike,
{
fn error(&mut self, err: Err) {
self.iter_mut().for_each(|subscriber| {
subscriber.error(err);
... | Rust | 0 |
import torch
from byol_pytorch import BYOL
from model import CovidNet
n_classes = 14
model = CovidNet('small', n_classes=n_classes).cuda()
# model = CovidNet('large', n_classes=n_classes)
#
# model = CNN(n_classes, 'mobilenet_v2')
#
# model = ViT(
# image_size=224,
# patch_size=32,
# num_classes=3,
# ... | Python | 1 |
from ast import literal_eval
from itertools import chain
# Пример преобразованного массива JackBack
JackBack = "[32, 50, 112, 51, 77, 114, 105, 98, 111, 110, 116, 48, 115, 46, 107, 41, 101, 10, 109, 52, 97, 34, 121, 61, 102, 40, 103, 44, 75, 58, 100, 49, 66, 164, 6, 15, 17, 40, 42, 45, 49, 50, 51, 52, 70, 72, 75, 79, ... | Python | 1 |
np.float)
elif type == 'TranslateY':
theta = np.array([[1, 0, 0], [0, 1, v]]).astype(np.float)
H = tensor.shape[2]
W = tensor.shape[3]
theta[0,1] = theta[0,1]*H/W
theta[1,0] = theta[1,0]*W/H
if type != 'Rotate':
theta[0,2] = theta[0,2]*2/H + theta[0,0] + theta[0,1] - 1
t... | Python | 1 |
delay.delay_ms(500_u16);
watchdog.feed();
delay.delay_ms(500_u16);
tx.write_str("This will get printed \r\n").ok();
watchdog.feed();
// Now a reset happens while delaying
delay.delay_ms(1500_u16);
tx.write_str("This won't\r\n").ok();
}
loop {
... | Rust | 0 |
it Cells JSON",
os.getcwd(), # starting directory
"JSON Files (*.json);;All Files (*)",
)
if file_path:
try:
with open(file_path, "r", encoding="utf-8") as f:
json_string = f.read()
unit_cells = deserialize_unit_ce... | Python | 1 |
nsorrt_available():
print(f"[E] Unsupported hardware: {f} cannot be loaded")
filepath = os.path.join(root, f)
device = 'cuda' if ext in trt_extensions else 'cpu'
print(lightgreen(f"{f}"))
try:
start_time= time.time()
model... | Python | 1 |
from Maix import freq
cpu_freq, kpu_freq = freq.get()
print(cpu_freq, kpu_freq)
freq.set(cpu = 400, pll1=400, kpu_div = 1)
| Python | 1 |
ME_STATE,
pub szVolumeFriendlyName: [u16; 260],
pub RedirectedIOReason: u64,
pub VolumeRedirectedIOReason: u64,
}
impl ::core::marker::Copy for CLUSTER_SHARED_VOLUME_STATE_INFO_EX {}
impl ::core::clone::Clone for CLUSTER_SHARED_VOLUME_STATE_INFO_EX {
fn clone(&self) -> Self {
*self
}
}
#[doc... | Rust | 0 |
import time
from pyfirmata import Arduino
import customtkinter as ctk
# Setup appearance
ctk.set_appearance_mode("dark")
ctk.set_default_color_theme("dark-blue")
# Create window
root = ctk.CTk()
root.geometry("500x400")
root.title("Live Servo Control")
# Connect to Arduino
board = Arduino('COM8')
horizontal = board.... | Python | 1 |
_1.shape, policy_2.actions(observations).shape)
@pytest.mark.skip("Latent smoothing is temporarily disabled.")
def test_latent_smoothing(self):
observation_np = self.env.reset()
smoothed_policy = FeedforwardGaussianPolicy(
input_shapes=self.env.observation_shape,
output_... | Python | 1 |
#!/usr/bin/env python3
"""
Database Migration Script
=========================
Add new columns to strategies table for extended configuration fields.
"""
import sqlite3
import logging
# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def migrate_database():
"""Migr... | Python | 1 |
",
0x1999: "市民15",
0x199A: "市民16",
0x199B: "市民17",
0x199C: "市民18",
0x199D: "市民19",
0x199E: "市民20",
0x199F: "市民21",
0x19A0: "市民22",
0x19A1: "市民23",
0x19A2: "管家格利伏斯",
0x19A3: "金恩",
0x19A4: "亞博斯事務次長",
0x19A5: "可麗茲社長",
0x19A6: "拉旺館長",
0x19A9: "馬5",
0x19C8: "巴克利",
0x19C9: "胡蜂女王",
0x19CA: ... | Python | 1 |
file_name="generated_app.py",
mime="text/plain",
)
def render_footer():
"""Render the app footer with improved styling"""
st.markdown(
"""
<div class="footer-container">
<h3>Powered By</h3>
<div>
<span class="model-badge">Gemini 1.5 Flash</span>
... | Python | 1 |
#!/usr/bin/env python3
from utils.all import *
# fin = advent.get_input()
# eprint(*fin, sep='')
timer_start()
##################################################
moons = [
[-7, 17, -11],
[9, 12, 5],
[-9, 0, -4],
[4, 6, 0]
]
vels = [
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0]
]
for _ in range(1000):
accels = [
... | Python | 1 |
#!/usr/bin/python
# Copyright (C) 2012-2016 Reece H. Dunn
#
# This file is part of ucd-tools.
#
# ucd-tools 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 optio... | Python | 1 |
//! hope the **Stakker** runtime also does.
//!
//! [`ActorOwn`]: struct.ActorOwn.html
//! [`Actor`]: struct.Actor.html
//! [`Core`]: struct.Core.html
//! [`Cx`]: struct.Cx.html
//! [`Deferrer`]: struct.Deferrer.html
//! [`Fwd`]: struct.Fwd.html
//! [`PipedThread`]: struct.PipedThread.html
//! [`Ret`]: struct.Ret.html... | Rust | 0 |
Result<Self, SynthesisError> {
let mut result = self.clone();
result.double_in_place(cs)?;
Ok(result)
}
#[inline]
fn double_in_place<CS: ConstraintSystem<ConstraintF>>(
&mut self,
mut cs: CS,
) -> Result<&mut Self, SynthesisError> {
self.c0.double_in_pla... | Rust | 0 |
anton= 21
beth= 6+anton
chen=20+beth
drew=chen+anton
Ethen=chen
print("Anton is " + str(anton))
print("Beth is " + str(beth))
print("Chen is " + str(chen))
print("Drew is " + str(drew))
print("Ethan is " + str(Ethen))
| Python | 1 |
from collections.abc import Iterable
from amaranth import *
from typing import Any, Generic, Optional, Protocol, TypeVar
from amaranth.hdl import ValueCastable
from amaranth_types.types import HasElaborate, ShapeLike, ValueLike
__all__ = ["AbstractMemory", "AbstractReadPort", "AbstractWritePort", "AbstractMemoryCon... | Python | 1 |
data and splitting it into chunks.
Args:
file_path (str): The path to the file.
chunk_size (int): Optional. The size of each chunk.
overlap_ratio (float): Optional. The overlap ratio between consecutive chunks.
Returns:
List[Document]: A list of Document... | Python | 1 |
from articles import views
from config import settings
from django.conf.urls.static import static
from django.urls import include, path
from rest_framework.routers import DefaultRouter
router = DefaultRouter(trailing_slash=False)
router.register("articles", views.ArticleViewSet)
router.register("tags", views.TagView)
... | Python | 1 |
ordSet, new_flashes: &mut CoordSet) {
azip!((index (i, j), e in &mut arr) {
*e += 1;
if *e > 9 {
to_test.insert((i, j));
}
});
while !to_test.is_empty() {
small_step(arr.view_mut(), flashed, to_test, new_flashes);
}
}
fn new_coord_set() -> CoordSet {
Co... | Rust | 0 |
lt.xlabel('Context Length', fontsize=22) # X-axis label with larger font
plt.ylabel('Answer Depth (%)', fontsize=22) # Y-axis label with larger font
plt.yticks(rotation=0, fontsize=16) # Enlarge y-axis labels
cbar = ax.collections[0].colorbar
cbar.ax.tick_params(labelsize=16)
cbar.set_label('Score', fontsize=22... | Python | 1 |
) / len(d3s))
print('mean jaccard distance @ 5 NOT projected', sum(d3s_5) / len(d3s_5))
print('mean jaccard distance @ 10 NOT projected', sum(d3s_10) / len(d3s_10))
print('knn classification accuracy NOT projected', accuracy)
writer.close()
def get_k():
"""Returns the number of referen... | Python | 1 |
'\u{aa36}', Cham), ('\u{aa40}', '\u{aa4d}', Cham), ('\u{aa50}',
'\u{aa59}', Cham), ('\u{aa5c}', '\u{aa5f}', Cham), ('\u{aa60}', '\u{aa7f}', Myanmar),
('\u{aa80}', '\u{aac2}', Tai_Viet), ('\u{aadb}', '\u{aadf}', Tai_Viet), ('\u{aae0}',
'\u{aaf6}', Meetei_Mayek), ('\u{ab01}', '\u{ab06}', Ethiopic... | Rust | 0 |
import sys
import argparse
import logging
from crytic_compile import cryticparser
from slither import Slither
from slither.utils.command_line import read_config_file
from slither.tools.slither_format.slither_format import slither_format
logging.basicConfig()
logging.getLogger("Slither").setLevel(logging.INFO)
# Slit... | Python | 1 |
= 10,
V4L2_BUF_TYPE_PRIVATE = 0x80,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct v4l2_rect {
left: i32,
top: i32,
width: i32,
height: i32,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct v4l2_fract {
pub numerator: u32,
pub denominator: u32,
}
#[repr(C)]
pub struct v4l2_capability {
... | Rust | 0 |
Gladis::from_builder(builder)
}
}
// Re-export #[derive(Gladis)].
#[cfg(feature = "derive")]
#[doc(hidden)]
pub use gladis_proc_macro::Gladis;
#[cfg(test)]
mod tests {
use crate::{GladisError, NotFoundError};
#[test]
fn fmt_not_found_error() {
let err = NotFoundError {
id... | Rust | 0 |
await CartItemRepository.remove_from_cart(cart_item.id, session)
sold_items.append(cart_item)
msg += MessageService.create_message_with_bought_items(purchased_items)
user.consume_records = user.consume_records + cart_total
await UserRepository.update(user, sessi... | Python | 1 |
= "Possible values of the field `CFG17`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CFG17R {
#[doc = "Output is A7OUT2. value."]
A7OUT2,
#[doc = "Output is A6OUT2. value."]
A6OUT2,
#[doc = "Output is A1OUT2. value."]
A1OUT2,
#[doc = "Output is A4OUT. value."]
A4OUT,
#[doc = ... | Rust | 0 |
###Script to be loaded inside the Raspberry Pi or controller which controls the feed machine
import socket
from gpiozero import LED
# Define the server address and port
server_address = ('192.168.0.4', 65432) # Replace <raspberry-pi-ip> with the actual IP address of your Raspberry Pi
led_pin = 13
# Create an LED obj... | Python | 1 |
>();
if enum_values.len() == 2 {
if let Ok(enum_index) = enum_values[0].parse::<i32>() {
let enum_name = enum_values[1];
field_enum_values.insert(enum_index, enum_name.to_owned());
}
... | Rust | 0 |
(f)(SOURCE)
def test_export_pb(enabled=False):
# TF suffers from install conflicts on Windows and macOS
if enabled and LINUX:
model = YOLO(MODEL)
f = model.export(format='pb')
YOLO(f)(SOURCE)
def test_export_paddle(enabled=False):
# Paddle protobuf requirements conflicting with o... | Python | 1 |