text string | label_name string | labels int64 |
|---|---|---|
r())
### TRAINING-TESTING SPLIT
(tr_data,te_data, tr_time,te_time, tr_label,te_label,
tr_mask1,te_mask1, tr_mask2,te_mask2) = train_test_split(data, time, label, mask1, mask2, test_size=0.20, random_state=seed)
(tr_data,va_data, tr_time,va_time, tr_label,va_label,
tr_mask1,va_mask1, tr... | Python | 1 |
[test]
pub fn test_to_str() {
let mut times: Vec<TimeObject> = Vec::new();
let mut t1: TimeObject = TimeObject::new();
t1.set_time(TimeState::IN,
Local.ymd(2020, 12, 8).and_hms(6, 13, 25),
Local.ymd(2020, 12, 8).and_hms(6, 13, 25));
let mut t2: TimeObject ... | Rust | 0 |
,如:MessageDigest::sha256()
pub fn sign_intermediate_by_csr(
csr: CSR,
x509: X509,
bits: i32,
msb_ca: MsbOptionCA,
odd: bool,
sk: PKey<Private>,
version: i32,
not_before_day: u32,
not_after_day: u32,
san: Option<SAN>,
message_dig... | Rust | 0 |
#!/usr/bin/env python
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController, OVSSwitch
from mininet.node import CPULimitedHost, Host, Node
from mininet.node import OVSKernelSwitch, UserSwitch
from mininet.node import IVSSwitch
from mininet.cli import CLI
from mininet.log ... | Python | 1 |
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
# Create your models here.
class Task(models.Model):
PRIORITY_CHOICES=[
('low', 'Low'),
('medium', 'Medium'),
('high', 'High'),
]
STATUS_CHOICES =[
('pending', 'Pe... | Python | 1 |
, self.physical.width));
}
_ => {}
}
self
}
pub fn id(&self) -> u32 {
self.gid
}
}
// #![deny(warnings)]
use log::info;
use sauron::jss::jss;
use sauron::{html::attributes::style, prelude::*};
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Seria... | Rust | 0 |
"""set up
Revision ID: d360583c3601
Revises:
Create Date: 2024-02-26 19:20:47.801420
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd360583c3601'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated b... | Python | 1 |
import os
import scipy.misc
import numpy as np
from model import LAYOUTGAN
from utils import pp, show_all_variables
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_integer("epoch", 50, "Epoch to train [25]")
flags.DEFINE_integer("batch_size", 64, "The size of batch images [64]")
flags.DEFINE_string("dataset"... | Python | 1 |
/div[1]/div[1]/div/span[1]/div[1]/div[4]/div/div/span/div/div/div[3]
# /html/body/div[1]/div[1]/div[1]/div[1]/div/span[1]/div[1]/div[3]/div/div/span/div/div/div[3]
# /html/body/div[1]/div[1]/div[1]/div[1]/div/span[1]/div[1]/div[2]/div/div/span/div/div/div[3]
# /html/body/div[1]/div[1]/div[1]/div[1]/div/span... | Python | 1 |
if True:
import sys
sys.path.append('../..')
import dash
import json
from dash import html
import feffery_antd_charts as fact
from dash.dependencies import Input, Output
app = dash.Dash(__name__)
mock_data = {
'name': 'root',
'children': [
{
'name': '分类 1',
... | Python | 1 |
,
}?;
let mods = capture
.name("mods")
.and_then(|v| Mods::from_str(v.as_str()).pls_ok())
.unwrap_or(Mods::NOMOD);
let info = match mode.unwrap_or(beatmap.mode).to_oppai_mode() {
Some(mode) => cache
.... | Rust | 0 |
](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtoggle](index.html) module"]
pub struct DTOGGLE_SPEC;
impl crate::RegisterSpec for DTOGGLE_SPEC {
type Ux = u32;
}
#[doc = "`read()` m... | Rust | 0 |
=True),
sa.Column("user_settings_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["query_id"],
["athena_queries.id"],
),
sa.ForeignKeyConstraint(
["user_id"],
["users.id"],
),
sa.ForeignKeyConstraint(
... | Python | 1 |
#!/usr/bin/python3
"""This module creates the Song class"""
import models
from models.base_model import BaseModel, Base
from sqlalchemy import Column, String, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy import *
metadata = Base.metadata
song_word = Table('song_word', metadata,
... | Python | 1 |
number: 1,
name: "John",
};
let rs1 = Record {
id: 100,
data: s1,
};
}
table! {
url (id) {
id -> Integer,
code -> Varchar,
#[sql_name="url"]
myurl -> Varchar,
create_time -> Datetime,
count -> Integer,
}
}
<filename>examples/de... | Rust | 0 |
* pow(2.0f64, (Rb - (*l_step_size).expn) as libc::c_double))
as OPJ_FLOAT32;
/* Mb value of Equation E-2 in "E.1 Inverse quantization
* procedure" of the standard */
(*l_band).numbps =
(*l_step_size).expn + (*l_tccp).numgbits as OPJ_INT32 - 1 as libc::c_i... | Rust | 0 |
from util import loader
import os
THIS_DIR = os.path.dirname(__file__)
# get file contents as string
def read_file(filename):
with open(THIS_DIR+'/'+filename) as file:
return file.read()
def load_metamodels(state, scd_mmm):
mm_cs = read_file('models/mm_design.od')
mm_rt_cs = mm_cs + re... | Python | 1 |
import pytest
from app.main import db, save_to_db, TopWord
# Recall function being tested...
# def save_to_db(url: str, top_word: Tuple[str, int]) -> None:
# record = TopWord()
# record.url = url
# record.word = top_word[0]
# record.num_occurrences = top_word[1]
# db.session.add(record)
# db.... | Python | 1 |
_world_rotation: Vector2::new(0.0, 0.0),
reverse,
bloom_intensity: render_extra_config.bloom_intensity,
}));
}
}
}
}
// Returns bullet direction.
pub fn bullet_hit(&self, bullet_id: BulletId, player_stat... | Rust | 0 |
import os
import csv
import re
import spotipy
from spotipy.oauth2 import SpotifyOAuth
from dotenv import load_dotenv
import openpyxl
import colorama
from colorama import Fore, Style, init
init(autoreset=True)
C_LOGO = Fore.CYAN+Style.BRIGHT
C_HEADER = Fore.YELLOW+Style.BRIGHT
C_MENU_HEADER = Fore.MAGENTA
C_OPTION = F... | Python | 1 |
num_stateless_operands: i32,
num_state_variables: i32,
num_stateful_alus: i32,
hole_config_file: String) -> String {
let hole_vars = extract_hole_cfgs (hole_config_file... | Rust | 0 |
, "{}", name)
} else {
write!(f, "Unknown(0x{:04x})", self.0)
}
}
}
#[macro_use]
extern crate num_derive;
extern crate num_traits;
use num_traits::FromPrimitive;
use libc::*;
use ebur128_sys::*;
#[derive(Copy, Clone)]
pub enum Mode {
M = mode_EBUR128_MODE_M as... | Rust | 0 |
main() {
//! let mut rng = Isaac64Rng::seed_from_u64(42);
//! let dist = Normal::new(2.0, 3.0).unwrap();
//! let mut hist = StreamingHistogram::new(32);
//!
//! let maxn = 10000;
//! let vals: Vec<f64> = (0..maxn).map(|_| dist.sample(&mut rng)).collect();
//!
//! for v in vals.iter() {
//! ... | Rust | 0 |
0, 0.0],
];
const POSITIONS_YNEG: QuadPositions = [
[0.0, 0.0, 0.0],
[1.0, 0.0, 0.0],
[0.0, 0.0, 1.0],
[1.0, 0.0, 1.0],
];
const POSITIONS_YPOS: QuadPositions = [
[0.0, 1.0, 1.0],
[1.0, 1.0, 1.0],
[0.0, 1... | Rust | 0 |
import random
print("This is a digital dice stimulator")
x = "y"
while x == "y":
number = random.randint(1,6)
if number == 1:
print("===========")
print("| |")
print("| O |")
print("| |")
print("===========")
elif number == 2:
print("=... | Python | 1 |
r_p: u32,
full_round_keys: Vec<<KEY>>,
partial_round_keys: Vec<<KEY>>,
mds_matrix: Vec<bn256::Fr>,
security_level: u32,
}
impl Bn256PoseidonParams {
pub fn new<H: GroupHasher>() -> Self {
let t = 6u32;
let r_f = 8u32;
let r_p = 57u32;
let security_level = 126u32;... | Rust | 0 |
robot_configuration_module: &RobotConfigurationModule, robot_fk_module: &RobotFKModule, robot_bounds_module: &RobotBoundsModule, num_threads: Option<usize>) -> Result<Self, String> {
let mut _num_threads = num_cpus::get();
if num_threads.is_some() { _num_threads = num_threads.unwrap(); }
if _num... | Rust | 0 |
rror::invalid_content("world with data centre in parens", Some(&parts_str)))?;
World::from_str(world_str)
.map_err(|_| Error::invalid_content("valid world", Some(&world_str)))
}
fn parse_active_members(html: ElementRef) -> Result<u8> {
plain_parse(html, &*ITEM_ACTIVE_MEMBERS)
.and_then(|x| x.parse().map_er... | Rust | 0 |
#!/usr/bin/env python
""" Test suite for gsmmodem.util """
from __future__ import print_function
import sys, time, unittest, logging, re
from datetime import timedelta
from . import compat # For Python 2.6 compatibility
from gsmmodem.util import allLinesMatchingPattern, lineMatching, lineStartingWith, lineMatching... | Python | 1 |
.await
.unwrap();
let pkg_url = format!("fuchsia-pkg://test/{}", pkg.name());
let path_to_override = format!("/blobs/{}", pkg.meta_far_merkle_root());
let repo = Arc::new(
RepositoryBuilder::from_template_dir(EMPTY_REPO_PATH)
.add_package(&pkg)
.build()
... | Rust | 0 |
collect::<HashMap<
Var,
bool,
fxhash::FxBuildHasher,
>>();
let mut inner_bound_vars = inner_applier.vars();
let mut unbound_vars = Vec::new();
for i in (0..inner_bound_vars.len()).rev() {
let var = inner_bound_vars[i];
if let So... | Rust | 0 |
import uuid
from datetime import timedelta
from django.db import models
from django.contrib.auth.models import User
from django.core.validators import FileExtensionValidator
from django.urls import reverse
from apps.services.utils import unique_slugify
from django.utils import timezone
from django.core.cache import cac... | Python | 1 |
[PROJECT_ID]`, under which
/// the occurrences are to be created.
#[prost(string, tag = "1")]
pub parent: std::string::String,
/// The occurrences to create. Max allowed length is 1000.
#[prost(message, repeated, tag = "2")]
pub occurrences: ::std::vec::Vec<Occurrence>,
}
/// Response for creati... | Rust | 0 |
e, del_rf_et, tank_top_parms):
storage = torch.zeros_like(tank_storage)
storage[:, :, 1:] = tank_storage[:, :, 1:]
# the primary soil moisture storage
Xp = tank_top_parms[:, :, 6:7]
# the maximum capacity of primary soil moisture storage
Cp = tank_top_parms[:, :, 7:8]
... | Python | 1 |
# Created by MechAviv
# Kinesis Introduction
# Map ID :: 331002000
# School for the Gifted :: First Floor Corridor
KINESIS = 1531000
YOUNG = 1531046
sm.setSpeakerID(YOUNG)
sm.flipSpeaker()
sm.removeEscapeButton()
sm.sendNext("Hey there, #b#h0##k! Did you see this picture in the paper? My dumb friend is convinced it'... | Python | 1 |
s 读线圈
:param port: 通讯端口,0-控制器 RS485 端口,1-末端接口板 RS485 接口,3-控制器 ModbusTCP 设备
:param address: 线圈起始地址
:param num:要读的线圈的数量,该指令最多一次性支持读 8 个线圈数据,即返回的数据不会一个字节
:param device:外设设备地址
:return:返回离散量
"""
self.pDll.Get_Read_Coils.argtypes = (
ctypes.c_int, ctypes.c_... | Python | 1 |
import os
import supervisely as sly
import re
import tqdm
import traceback
from rich.console import Console
import os
def download_directory_run(
team_id: int,
remote_dir: str,
local_dir: str,
filter: str = None,
ignore_if_not_exists: bool = False,
) -> bool:
console = Console()
api = s... | Python | 1 |
from @startup_notification_id."""
if "_TIME" in startup_notification_id:
_ign, bstime = startup_notification_id.split("_TIME", 1)
with contextlib.suppress(ValueError):
return abs(int(bstime))
return 0
@contextlib.contextmanager
def using_startup_notify_id(notify_id: str) -> ty.Any... | Python | 1 |
import struct, objc
from Foundation import NSBundle
from Cocoa import NSAppleEventDescriptor
def OSType(s):
# Convert 4 character code into 4 byte integer
return struct.unpack('>I', s)[0]
# Create an opaque pointer type to mask the raw AEDesc pointers we'll throw around
AEDescRef = objc.createOpaquePointerTyp... | Python | 1 |
sp.io.mmwrite(f"{args.output}/{t}.x.mtx", vbd.x)
sp.io.mmwrite(f"{args.output}/{t}.v.mtx", vbd.v)
# Rotate Dirichlet vertices
xrotl = rotate(mesh.X, t * dt * np.pi / 2)
xrotr = rotate(mesh.X, -t * dt * np.pi / 2)
x = vbd.x
no2 = int(... | Python | 1 |
u8 {
b'A'...b'Z' => true,
_ => false
};
let c_u8 = (c as u8) | ((is_ascii_uppercase as u8) << 5);
c_u8 as char
}
/// Check if a character is ascii.
/// Taken from the Rust v1.23.0 code.
fn is_ascii(c: char) -> bool {
(c as u32) <= 0x7F
}
/// Checks if both prefixes match, regardless o... | Rust | 0 |
"EM_TI_C5500" => Ok(142), /* Texas Instruments TMS320C55x DSP */
"EM_TI_ARP32" => Ok(143), /* Texas Instruments App. Specific RISC */
"EM_TI_PRU" => Ok(144), /* Texas Instruments Prog. Realtime Unit */
/* reserved 145-159 */
"EM_MMDSP_PLUS" => Ok(160), /* STMic... | Rust | 0 |
'static mut M4 {
unsafe { CLIP_MATRIX.get_or_insert_with(|| M4::identity()) }
}
fn calc_clip_matrix(wd: u32, ht: u32) -> M4 {
let display_ratio = wd as f32 / ht as f32;
let grid_ratio = GRID_WIDTH as f32 / GRID_HEIGHT as f32;
if display_ratio > grid_ratio {
let ratio = display_ratio / grid_rat... | Rust | 0 |
变量离开作用域时将会 drop 回收,除非这些数据的所有权移动到另一个变量上(return 到调用函数)
// 假如希望在调用函数时保留参数的所有权,需要将传入的值作为结果返回
/* fn main() {
// 不希望堆数据 drop,可以返回传入参数
let s1 = String::from("hello");
let (s1, len) = calculate_length(s1); // 这里须同时返回 s2 以保留所有权
println!("The length of '{}' is {}.", s1, len);
}
fn calculate_length(s: String) ... | Rust | 0 |
from typing import List, Dict
from app.init.postgres import get_db_pool
from app.init.model import GPT
import logging
logger = logging.getLogger(__name__)
async def vector_search(query: str, limit: int = 5) -> List[Dict]:
"""Search documents by vector similarity"""
try:
client = GPT()
embeddi... | Python | 1 |
class Solution(object):
def smallerNumbersThanCurrent(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
count = 0
a = []
for i in nums:
for j in nums:
if j < i:
count +=1
a.append(count)
... | Python | 1 |
#!/usr/bin/env python
import os
import csv
import math
import tf
import rospy
import sys
from geometry_msgs.msg import Quaternion, PoseStamped
from styx_msgs.msg import Lane, Waypoint
from nav_msgs.msg import Path
CSV_HEADER = ['x', 'y', 'yaw']
MAX_DECEL = 1.0
class WaypointLoader(object):
def __init__(self... | Python | 1 |
LeafContent::ObjectEnd => {
out.push(LineFragment::new("}", false, StyleType::Highlightable));
if self.comma {
out.push(LineFragment::new_unstyled(",", false));
}
}
};
LineFragments::new(out)
}
}
fn is_unicod... | Rust | 0 |
rade_apply_params'] = self.trade_apply_params
return params
@staticmethod
def from_alipay_dict(d):
if not d:
return None
o = AlipayCommerceAirCallcenterTradeApplyModel()
if 'amount_detail' in d:
o.amount_detail = d['amount_detail']
if 'channel' in... | Python | 1 |
THREE_OF_HEARTS: &[u8] = include_bytes!("../../assets/card_faces/3_of_hearts.svg");
static THREE_OF_SPADES: &[u8] = include_bytes!("../../assets/card_faces/3_of_spades.svg");
static FOUR_OF_CLUBS: &[u8] = include_bytes!("../../assets/card_faces/4_of_clubs.svg");
static FOUR_OF_DIAMONDS: &[u8] = include_bytes!("../../... | Rust | 0 |
[x16]",
));
insns.push((
Inst::Store8 {
rd: xreg(1),
mem: MemArg::Unscaled(xreg(2), SImm9::zero()),
srcloc: None,
},
"41000038",
"sturb w1, [x2]",
));
insns.push((
Inst::Store8 {
rd: xreg(1),
mem: MemAr... | Rust | 0 |
"""
Introdução ao for / in - estrutura de repetição para coisas finitas
"""
# senha_salva = '123456'
# senha_digitada = ''
# repeticoes = 0
# while senha_salva != senha_digitada:
# senha_digitada = input(f'Sua senha ({repeticoes}x)')
# repeticoes += 1
# print('Laço pode ser infinito')
texto = 'macaco'
nov... | Python | 1 |
[inline]
fn div(self, rhs: Self) -> Self::Output {
self * rhs.invert()
}
}
#[cfg(test)]
mod tests_fract16 {
use assert_approx_eq::assert_approx_eq;
use crate::{Fract, Fract16};
#[test]
fn should_create() {
let expected: Fract16 = Fract16 {
numerator: 8,
... | Rust | 0 |
# invalid stuff should be ignored
hover = "rouge"
todo = ""
"##;
let th = Theme {
done: Color::Rgb(252, 8, 244),
active: Color::LightYellow,
..Theme::default()
};
assert_eq!(th, theme_from_config(partial_config));
}
#[test... | Rust | 0 |
-primitives, if you assign another variable to a piece of data,
the first variable will no longer hold that value.
You'll need to use a reference (&) to point to the resource.
*/
// vector - non-primitive
let vec1 = vec![1, 2, 3];
let vec2 = &vec1;
println!("Values {:?}", (&vec1, v... | Rust | 0 |
import time
from prawcore import ResponseException
from redditrepostsleuth.core.config import Config
from redditrepostsleuth.core.db.db_utils import get_db_engine
from redditrepostsleuth.core.db.uow.unitofworkmanager import UnitOfWorkManager
from redditrepostsleuth.core.logging import log
from redditrepostsleuth.core... | Python | 1 |
DEVICE = DEVICE)
Trainresults['epoch'] = clock.epoch
with open(train_res_path, 'a') as f:
json.dump(Trainresults, f)
torch.cuda.empty_cache()
#val_epoch = next(ds_val.epoch_generator())
Valresults = adversarial_val(net, ds_val, criterion, PgdA... | Python | 1 |
from passlib.context import CryptContext
pw_context = CryptContext(schemes=['bcrypt'], deprecated='auto')
def hash_pw(plain_pw) -> str:
return pw_context.hash(plain_pw)
def verify_pw(plain_pw, hashed_pw) -> bool:
return pw_context.verify(plain_pw, hashed_pw)
| Python | 1 |
pu::fp_from_execstate;
use crate::execstate::ExecState;
use crate::gc::Address;
use crate::os;
use crate::threads::{DoraThread, ThreadState, THREAD};
use crate::vm::{get_vm, VM};
pub struct PollingPage {
addr: Address,
}
impl PollingPage {
pub fn new() -> PollingPage {
PollingPage {
addr: ... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
事件处理模块
包含所有处理来自播放器或amll WebSocket消息的函数。
"""
import logging
from typing import Dict, Any
import aiohttp
from websockets.client import WebSocketClientProtocol
from websockets.exceptions import ConnectionClosed
from ws_protocol import to_body, MessageType, ENUM_TO_CAMEL, parse_body
from play... | Python | 1 |
state.tui.select(Some(0));
}
}
ScrollDirection::Bottom => {
if self.state.show_options {
self.options.state.select(Some(
self.options
.items
.len()
.checked_sub(1)
.unwrap_or_default(),
));
show_options = true;
} else if Tab::Help == self.t... | Rust | 0 |
[i][j] = grid[i][j];
} else {
let mut min_n = std::i32::MAX;
for k in 0..n {
if k == j {
continue;
}
min_n = min(min_n, dp[i + 1][k]);
}
... | Rust | 0 |
: Phase, adr: HandPiece, position: &Position, move_list: &mut Vec<Move>) {
if let Some(pc_ex) = position.last_hand(adr) {
// 打つぜ☆(^~^)
let drop = &mut |to| {
if let None = position.piece_at_board(to) {
// 駒が無いところに打つ
use crate::take1... | Rust | 0 |
);
controller.update(&gamepad).unwrap();
};
match update {
ClientUpdate::ButtonADown => update_button(XButtons::A, true),
ClientUpdate::ButtonAUp =>... | Rust | 0 |
| !field.is_null()), "{}field_back() : field.is_null()", MODULE_PATH);
bindings::field_back(return_mut_ptr!(field))
}
/// # Safety
///
/// <https://invisible-island.net/ncurses/man/form_field_buffer.3x.html>
pub unsafe fn field_buffer(field: FIELD, buf: i32) -> Option<Vec<i8>> {
assert!(!field.is_null(), "{}f... | Rust | 0 |
/ it is highly unlikely that you work with any possible version of your dependency,
/// and wildcard dependencies would cause unnecessary breakage in the ecosystem.
///
/// ### Example
/// ```toml
/// [dependencies]
/// regex = "*"
/// ```
#[clippy::version = "1.32.0"]
pub WILDCARD_D... | Rust | 0 |
;
entity.borrow_mut().set_x(x, 0.);
}
ObstructionSide::Top => {
let y = rect.bottom();
entity.borrow_mut().set_y(y, 0.);
}
ObstructionSide::Bottom => {
let height = entity.borrow().size.height as f64;
... | Rust | 0 |
# coding:utf-8
import sys
from PySide6.QtCore import Qt
from PySide6.QtGui import QColor
from PySide6.QtWidgets import QApplication, QWidget, QSlider
from qfluentwidgets import HollowHandleStyle, Slider, setTheme, Theme
class Demo1(QWidget):
def __init__(self):
super().__init__()
self.resize(300... | Python | 1 |
pAttachment {
pub href: String,
}
#[derive(Serialize, Deserialize, Clone, Default, PartialEq, Debug)]
#[serde(rename_all = "camelCase")]
pub struct WpTerm {
pub taxonomy: String,
pub embeddable: bool,
pub href: String,
}
#[derive(Serialize, Deserialize, Clone, Default, PartialEq, Debug)]
... | Rust | 0 |
from iniconfig import IniConfig
def read_url():
ini = IniConfig(r'./pytest.ini')
if 'base_url' in ini:
return dict(ini['base_url'].items())
return {}
| Python | 1 |
let v2 = v0
.mul(cs.ns(|| "v0 * v1"), &v1)?
.mul_by_constant(cs.ns(|| "D * v0 * v1"), &d)?;
// Compute x3 = (v0 + v1) / (1 + v2)
let x3 = F::alloc(&mut cs.ns(|| "x3"), || {
let t0 = v0.get_value().get()? + &v1.get_value().get()?;
... | Rust | 0 |
from .. import Provider as DateTimeProvider
class Provider(DateTimeProvider):
# Source: http://www.localeplanet.com/icu/ta-IN/index.html
DAY_NAMES = {
"0": "திங்கள்",
"1": "செவ்வாய்",
"2": "புதன்",
"3": "வியாழன்",
"4": "வெள்ளி",
"5": "சனி",
"6": "ஞாயிறு"... | Python | 1 |
u8)]
pub enum PRSSTARTMODE_A {
#[doc = "0: PRS cannot start the LETIMER"]
NONE = 0,
#[doc = "1: Rising edge of selected PRS input can start the LETIMER"]
RISING = 1,
#[doc = "2: Falling edge of selected PRS input can start the LETIMER"]
FALLING = 2,
#[doc = "3: Both the rising or falling edg... | Rust | 0 |
import glob
import os
class FileManager:
@staticmethod
def get_file_list(from_path: str) -> dict:
# Build file list
file_list = {} # Dictionary: file and base_data_folder (data participant ID)
# Add files to list
files = glob.glob(from_path + "/**/*.*", recursive=True) # Fi... | Python | 1 |
from unittest import TestCase
import numpy as np
from pygem import CustomDeformation
class TestCustomDeformation(TestCase):
def get_cube_mesh_points(self):
# Points that define a cube
nx, ny, nz = (20, 20, 20)
mesh = np.zeros((nx * ny * nz, 3))
xv = np.linspace(0, 1, nx)
y... | Python | 1 |
# -*- coding: utf-8 -*-
# Copyright (C) 2024 BIRU
#
# This file is part of Tenzu.
#
# Tenzu is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or (at your option) any later... | Python | 1 |
# Copyright 2014-2016 Nathan West
#
# This file is part of autocommand.
#
# autocommand 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 Foundation, either version 3 of the License, or
# (at your option) any later v... | Python | 1 |
void, (*table).xMin as i32, 2i32) as isize);
p = p.offset(put_big_endian(p as *mut libc::c_void, (*table).yMin as i32, 2i32) as isize);
p = p.offset(put_big_endian(p as *mut libc::c_void, (*table).xMax as i32, 2i32) as isize);
p = p.offset(put_big_endian(p as *mut libc::c_void, (*table).yMax as i32, 2i32) a... | Rust | 0 |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// ▽ラ,▽キ,▽ゾ,▽イ,▽ネ,▽ウ,▽シ,▽ヒ,▽パキ,▽パゾ,▽パネ,▽パウ,▽パシ,▽パピ,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
// 空マス,
0,
];
}
/**... | Rust | 0 |
# AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Pagination(Component):
"""A Pagination component.
Material UI Pagination component
Keyword arguments:
- id (string; required):
Component ID.
- count (number; required):
Number of pages.
... | Python | 1 |
"""
日志模块 - 统一日志管理
"""
import logging
import sys
from datetime import datetime
from logging.handlers import RotatingFileHandler
from pathlib import Path
class Logger:
"""日志管理器"""
_loggers = {}
@staticmethod
def setup(log_dir: str = "logs", level: int = logging.DEBUG):
"""
配置日志系统
... | Python | 1 |
# Copyright (c) 2012, Google, Inc.
# All rights reserved.
#
# 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, modify... | Python | 1 |
(epoch + 1, self.monitor, self.best,
current, filepath))
self.best = current
if self.save_weights_only:
self.model.save_weights(filepath, overwrite=True)
else:
... | Python | 1 |
# Python bytecode 2.7 (decompiled from Python 2.7)
# Embedded file name: scripts/common/dossiers2/custom/cache.py
import nations
from items import vehicles
from collector_vehicle import CollectorVehicleConsts
def getCache():
global _g_cache
return _g_cache
def buildCache():
vehiclesByLevel = {}
vehic... | Python | 1 |
ok());
let mut ciphertext = [0u8; MSG_LEN];
ciphertext.copy_from_slice(&message);
assert!(receiver.receive(None, ad, &mut mac, Some(nonce)).is_ok());
let mut round_trip = [0u8; MSG_LEN];
round_trip.copy_from_slice(&ciphertext);
assert_eq!(round_trip, pre);
}
#[t... | Rust | 0 |
# Copyright 2022 The BladeDISC Authors. 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 applicable law or ... | Python | 1 |
put_u32_le(size_of_val(&n));
fn try_put_i32(n: i32) => put_i32(size_of_val(&n));
fn try_put_i32_le(n: i32) => put_i32_le(size_of_val(&n));
fn try_put_u64(n: u64) => put_u64(size_of_val(&n));
fn try_put_u64_le(n: u64) => put_u64_le(size_of_val(&n));
fn try_put_i64(n: i64) => put_i6... | Rust | 0 |
from cache import *
#from debugtools import *
#from .debugtools import level
import os
import os.path
import imp
__all__ = ['DEFAULTPREF', 'USERPREF']
# Default preference values
DEFAULTPREF = {}
# authentication key in the network
DEFAULTPREF['authkey'] = 'playdohauthkey'
# default port
DEFAULTPREF['port'] = 2718
... | Python | 1 |
# -*- coding: utf-8 -*-
# Copyright 2025 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 or... | Python | 1 |
see [uartpcellid1](uartpcellid1) module"]
pub type UARTPCELLID1 = crate::Reg<u32, _UARTPCELLID1>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _UARTPCELLID1;
#[doc = "`read()` method returns [uartpcellid1::R](uartpcellid1::R) reader structure"]
impl crate::Readable for UARTPCELLID1 {}
#[doc = "UARTPCellID1 Registe... | Rust | 0 |
import torch
import comfy.model_management
import numbers
RMSNorm = None
try:
rms_norm_torch = torch.nn.functional.rms_norm
RMSNorm = torch.nn.RMSNorm
except:
rms_norm_torch = None
def rms_norm(x, weight=None, eps=1e-6):
if rms_norm_torch is not None and not (torch.jit.is_tracing() or torch.jit.is_s... | Python | 1 |
from collections import deque
from typing import List
from unittest import TestCase, main
class Solution:
def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool:
return self.solve_topological_sort(numCourses, prerequisites)
"""
Runtime: 1 ms (Beats 100.00%)
Time Complexi... | Python | 1 |
0.655167,
0.36179554,
-0.09111279,
-0.5440211,
])
);
}
#[test]
fn trilinear_resize_shrink() {
let n = 3.;
let mut xn = Array::linspace(-n, n, 5);
// Unsure if we'll inculde this in the library or not..
l... | Rust | 0 |
_mh_streetlight_01.nif", 0x0E19_5154, 0x4CC4_FDF3),
(r"meshes\c\c_m_shirt_common2_ua.nif", 0x0F18_060B, 0xC610_4AE0),
(r"meshes\c\c_m_shirt_common1_ua.nif", 0x0F18_060B, 0xC610_4AE6),
(r"meshes\c\c_m_shirt_common2_w.nif", 0x0F18_060B, 0xD5EA_0DE4),
(r"meshes\c\c_m_shirt_common2_f.nif", 0x0F18_060B, ... | Rust | 0 |
Ok(response)
}
}
async fn connection_handler(socket: &mut TcpStream) -> anyhow::Result<()> {
let mut socket = BufReader::new(socket);
socket.write_all(AGENT.as_bytes()).await?;
let mut buf = Vec::with_capacity(1_024);
let mut state = SessionState::Initial;
loop {
buf.clear();
... | Rust | 0 |
node_id: splitter_id,
port_index: PortIndex::new(0),
},
Socket {
node_id: encoder_id,
port_index: PortIndex::new(0),
},
);
flow.connect(
Socket {
node_id: splitter_id,
port_index: PortIndex::new(1),
},
... | Rust | 0 |
a as a 4-byte IEEE Floating point number"
),
128 => String::from(
"Error Packet: indicates error was encountered when executing command"
),
_ => String::from("Response type is unknown")
}
}
<filename>arch/arm32/src/kernel/cpu.rs
use crate::arm32_printk;
use cpu::CpuInfo;
... | Rust | 0 |
s.adapter_path):
print(f"❌ 适配器路径不存在: {args.adapter_path}")
sys.exit(1)
# 检查适配器信息
print("\n" + "="*50)
base_model_from_config = check_adapter_info(args.adapter_path)
if base_model_from_config and base_model_from_con... | Python | 1 |
mut memory = init_memory();
// setup cache of loops.
let mut loop_map = LoopMap::new(code);
// initialize pc and pointer.
let mut pc: usize = 0;
let mut mem: usize = 0;
// main loop.
while pc < code_len {
let inst = code[pc];
match inst {
0x2b => {
... | Rust | 0 |
0\x01(\tR\x13signedInstallScr\
ipt2\x92\x08\n\x0eContentBuilder\x12\x98\x01\n\x0eInitDepotBuild\x12'.CC\
ontentBuilder_InitDepotBuild_Request\x1a(.CContentBuilder_InitDepotBuild\
_Response\"3\x82\xb5\x18/Get\x20inital\x20parameters\x20to\x20start\x20b\
uilding\x20a\x20depot\x12\x9e\x01\n\x10StartDepotUp... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.