text string | label_name string | labels int64 |
|---|---|---|
> Recoleta finalizada!
""")
# FASE 6: Corrigir cartas incompletas
if incomplete_cards:
logger.info(f"🔧 FASE 6: Corrigindo {len(incomplete_cards)} cartas incompletas...")
fixed = self._fix_incomplete_cards_in_db(incomplete_cards)
... | Python | 1 |
ewsConfig {
pub approvals: u32,
}
fn default_reviews_config() -> ReviewsConfig {
ReviewsConfig { approvals: 1 }
}
#[derive(Deserialize, Debug, Clone)]
pub struct RepoConfig {
pub repo: String,
pub reviews: Option<ReviewsConfig>,
#[serde(default)]
pub statuses: Vec<StatusConfig>,
}
#[derive(... | Rust | 0 |
lculate_level_up_dates(characters):
# # 創建一個佇列來存放每個角色的資訊
# queue = deque(characters)
# # 定義每天可獲得的碎片數量循環
# daily_fragments_cycle = deque([4, 3, 2])
# # 初始化字典來儲存每個角色升級日期
# level_up_dates = {char['name']: {} for char in characters}
# # 初始化當前日期
# current_date = 1
# wh... | Python | 1 |
# ckwg +29
# Copyright 2020 by Kitware, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... | Python | 1 |
use edgeql_parser::preparser;
use crate::options::Options;
use crate::options::Query;
use crate::outputs::tab_separated;
use crate::print::{self, PrintError};
use crate::repl::OutputFormat;
use crate::statement::{ReadStatement, EndOfFile};
pub async fn main(q: &Query, options: &Options)
-> Result<(), anyhow::Erro... | Rust | 0 |
import os
import configparser
from http.server import HTTPServer
from http.server import BaseHTTPRequestHandler
from urllib.parse import parse_qs, urlparse
import json
config_ini = configparser.ConfigParser()
config_ini.read(os.path.join(os.path.dirname(os.path.abspath(__file__)),"config.ini"), encoding='utf-8')
HOST ... | Python | 1 |
_position(PhysicalPosition {
x: measurements.shark_pos.0,
y: measurements.shark_pos.1,
});
let bound = measurements.area_min_pos.0 - measurements.shark_size.0;
if measurements.shark_pos.0 < ... | Rust | 0 |
error("url not found".to_string(), 404)
}
},
Err(err) => Response::error(err.to_string(), 500)
}
}<gh_stars>10-100
#[cfg(not(feature = "no_std"))]
use std::any::Any;
#[cfg(feature = "no_std")]
use core::any::Any;
#[cfg(not(feature = "no_std"))]
use std::rc::Rc;
#[cfg(feature = "no_... | Rust | 0 |
## Imports
import numpy as np
import pandas as pd
import datetime as dt
from re import match
from astropy import units as u
from astropy.coordinates import SkyCoord
## Read in data from txt file
data = open("horizons_results.txt", "r").readlines()
data = data[60:8845] #end = 8845
## Make dataframe
header_list = [
... | Python | 1 |
mut pages, column_metadata, field.data_type().clone())?;
let array = if array.len() > remaining_rows {
array.slice(0, remaining_rows)
} else {
array
};
columns.push(array.into());
let (b1, b2) = pag... | Rust | 0 |
window.blit(text, (10, 20))
text_lose = font2.render("Missed: " + str(lost), 1, (255, 255, 255))
window.blit(text_lose, (10, 50))
text_goal = font2.render("Goal: " + str(goal), 1, (255, 255, 255))
window.blit(text_goal, (10, 80))
ammo_text = font2.render(... | Python | 1 |
ty: self_ty,
},
shim,
}),
});
Ok(())
}
}
<gh_stars>0
// Test whether `zmq::poll()` works with `PollItem`s constructed from
// arbitrary FDs.
extern crate nix;
extern crate zmq;
use std::thread;
use std::os::unix::io::RawFd;
use self::nix:... | Rust | 0 |
import multiprocessing
import os
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
from tqdm import tqdm
def walk_wav_files(folder):
for root, dirs, files in os.walk(folder):
for file in files:
if file.endswith(".wav"):
yield os.path.join(ro... | Python | 1 |
ndard
VALUES (?, ?);
"#,
)?;
stmt.execute(values)?;
Ok(())
}
}
impl FromSql for Status {
#[inline]
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> {
value.as_str().and_then(|s| match Status::from_str(s) {
Ok(s) => Ok(s),
... | Rust | 0 |
ime.sleep(1)
browser_rt.implicitly_wait(30)
right = Right(url,rt_idx)
right.handle_page(browser_rt)
# time.sleep(2)
# if '441900' in hurl: ## 河源
# if rt_idx <= 220:#130
# rt_idx += len... | Python | 1 |
from typing import TYPE_CHECKING, Protocol
if TYPE_CHECKING:
from infrastructure.messaging.producer import RabbitProducer
from schemas import (
ActivateQrCodeResponseDTO,
AllActiveTicketsEventResponseDTO,
AllTicketsEventResponseDTO,
TicketCreateDTO,
TicketCreateResponseD... | Python | 1 |
HAZARD = 0x1,
}}
FLAGS!{ enum D3D12_TILE_RANGE_FLAGS {
D3D12_TILE_RANGE_FLAG_NONE = 0x0,
D3D12_TILE_RANGE_FLAG_NULL = 0x1,
D3D12_TILE_RANGE_FLAG_SKIP = 0x2,
D3D12_TILE_RANGE_FLAG_REUSE_SINGLE_TILE = 0x4,
}}
ENUM!{ enum D3D12_UAV_DIMENSION {
D3D12_UAV_DIMENSION_UNKNOWN = 0,
D3D12_UAV_DIMENSION_... | Rust | 0 |
import numpy as np
def calculate_ab(std1, std2, theta, lambda_):
"""
Calculate 'a' and 'b' coefficients for poincare mapping base detection algorithms.
Parameters
------
std1 (float): Standard deviation of the first component.
std2 (float): Standard deviation of the second component.
... | Python | 1 |
import jax.numpy as jnp
import numpy as np
from jax import jit
from jax.tree_util import tree_flatten, tree_unflatten
def state_store(num_nodes, init_state, numpy=True):
sample_state = init_state(1)
leaves, treedef = tree_flatten(sample_state)
del sample_state
shapes = [(-1,) + np.shape(l)[1:] for l i... | Python | 1 |
os::raw::c_char;
}
extern "C" {
pub fn hb_language_get_default() -> hb_language_t;
}
pub const HB_SCRIPT_COMMON: _bindgen_ty_3 = _bindgen_ty_3::HB_SCRIPT_COMMON;
pub const HB_SCRIPT_INHERITED: _bindgen_ty_3 =
_bindgen_ty_3::HB_SCRIPT_INHERITED;
pub const HB_SCRIPT_UNKNOWN: _bindgen_ty_3 = _bindgen_ty_3::HB_SCRI... | Rust | 0 |
_sprite(&self, x: u32, y: u32, spte: &Sprite) {
//Cambia las coordenadas de tamaño del juego a px
let x = x * self.scaled_width;
let y = y * self.scaled_height;
//Calcula el valor en pixeles de cada sprite
let width = self.scaled_width as f64 / 8.0;
let height = self.sca... | Rust | 0 |
prompt = U.make_embed(
title="__Remove Linked Role(s)__",
description=(
"Please select the role(s) you would like to remove from this "
"posting channel group."
)
)
view = FroggeSelectView(interaction.user, options, multi_select=Tru... | Python | 1 |
o_animate_owl(owl: &Owl, sprite: &mut SpriteDrawable, frame_count: u32) {
let pat = ((frame_count >> 5) & 1) as usize;
let pat = if owl.capturing_state != OwlCapturingState::None { 1 } else { pat };
let pat = if owl.life <= 1 { pat + 2 } else { pat };
sprite.sprite_name = OWL_SPRITE_NAMES[pat as usize];... | Rust | 0 |
BBBBBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DDDDDDDDDDDDDDDDDDDDDDDDDDD/DDDDDDDDD/DDDDDDDDDDDD+XtKG=
# END OF EXAMPLE KEY FILE
";
let expected = Record::SecureNote(SecureNote {
title: String::from("multiline secure note"),
text: S... | Rust | 0 |
if byte.is_ascii_graphic() {
format!(" {}", char::from(byte))
} else {
format!("{:02x}", byte)
}
}
fn digit_to_hex(digit: u8) -> char {
[
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f',
][digit as usize]
}
fn append_hex_byte(s: &mut Stri... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import wasserstein_distance
from scipy.spatial.distance import jensenshannon
np.random.seed(33)
reference_data = np.random.normal(loc=0, scale=1, size=100)
current_data = np.random.normal(loc=0, scale=1, size=100000)
w_distance = wasserstein_distan... | Python | 1 |
:new(fileout)))
.build(
Root::builder()
.appender("stdout")
.appender("fileout")
.build(log_level),
)
.unwrap_or_else(|err| {
error!("{}", err);
process::exit(1);
});
log4rs::init_config(log_config).... | Rust | 0 |
())
}
}
/////////////////////////////////////
#[cfg(test)]
impl std::str::FromStr for FormatStr {
type Err = ParseError;
fn from_str(input: &str) -> Result<FormatStr, ParseError> {
parse_format_str(input, StrRawness::dummy())
}
}
impl FormatStr {
pub fn parse(input: &str, rawness: StrRaw... | Rust | 0 |
> was here".to_vec()]);
},
)
.add_with_post_test(
2,
|| { /* do nothing within block */ },
|| {
let v = UpwardMessages::<Test>::get();
assert_eq!(v, vec![b"message 2".to_vec()]);
},
);
}
#[test]
fn send_upward_message_relay_bottleneck() {
BlockTests::new()
.with_relay_sproof_builder(|_,... | Rust | 0 |
self.logger.debug(msg, args, extra={"spider": spider})
elif self.logdupes:
msg = (
"Filtered duplicate request: %(request)s"
" - no more duplicates will be shown"
" (see DUPEFILTER_DEBUG to show all duplicates)"
)
self.logg... | Python | 1 |
"""
.. _ssao_example:
Surface Space Ambient Occlusion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demonstrate the usage of surface space ambient occlusion.
Surface space ambient occlusion (SSAO) can approximate shadows more
efficiently than ray-tracing and produce similar results. Use this when you wish
to plot the occlusion ef... | Python | 1 |
new(&path).exists();
println!(
"[Pre-flop only heads-up hold'em] (effective stack = {}bb)",
opts.stack
);
let (_, ev, exploitability) = if file_exists {
let mut infile = File::open(&path)?;
let mut buf = Vec::new();
infile.read_to_end(&mut buf)?;
deserialize... | Rust | 0 |
alculate median human performance for beats_human
median_human = human_scores.median()
if is_lower_better:
beats_human = agent_score < median_human
# For lower-is-better: percentile = % of humans with score >= agent_score
human_percentile = (human_scores >= agent_score).mean() * 100
... | Python | 1 |
in cwd (inside container)
candidate = Path(ligand_raw)
if not candidate.exists():
return jsonify({"success": False, "message": f"SDF file '{ligand_raw}' not found in working directory"}), 400
ligand_input = ligand_raw # pass as str path
... | Python | 1 |
PEG_AUDIO_EMPHASIS: u32 = CID_MPEG_BASE + 107;
pub const MPEG_AUDIO_EMPHASIS_NONE: u32 = 0;
pub const MPEG_AUDIO_EMPHASIS_50_DIV_15_uS: u32 = 1;
pub const MPEG_AUDIO_EMPHASIS_CCITT_J17: u32 = 2;
pub const CID_MPEG_AUDIO_CRC: u32 = CID_MPEG_BASE + 108;
pub const MPEG_AUDIO_CRC_NONE: u32 = 0;
pub ... | Rust | 0 |
import wavely as wv
import matplotlib.pyplot as plt
def plot(title, *paths):
fig, ax = plt.subplots(figsize=(12, 8))
colors = ['blue', 'red', 'green', 'orange', 'purple', 'brown', 'pink', 'gray']
for i, (label, path) in enumerate(paths):
color = colors[i % len(colors)]
ax.plot(path.x, path.y, color=colo... | Python | 1 |
"""Initial migration
Revision ID: 33e572a32548
Revises:
Create Date: 2024-06-07 03:09:15.264907
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '33e572a32548'
down_revision: Union[str, None] = None
branch_labels: Union[... | Python | 1 |
The action to check for.
/// ## `details`
/// Details about the action or [`None`].
/// ## `flags`
/// A set of [`CheckAuthorizationFlags`][crate::CheckAuthorizationFlags].
/// ## `cancellable`
/// A [`gio::Cancellable`][crate::gio::Cancellable] or [`None`].
///
/// # Returns
///
... | Rust | 0 |
{1}??0Metafile@Gdiplus@@QEAA@PEB_WPEAUHDC__@@W4EmfType@1@0@Z"]
pub fn Metafile_Metafile8(
this: *mut Metafile,
fileName: *const WCHAR,
referenceHdc: HDC,
type_: EmfType,
description: *const WCHAR,
);
}
extern "C" {
#[link_name = "\u{1}??0Metafile@Gdiplus@@QEAA@PEB_WPE... | Rust | 0 |
})))
})
)
})
}
fn render_result(state: Rc<State>, jig: &JigResponse) -> Dom {
let jig_ages = jig.jig_data.age_ranges.clone();
html!("home-search-result", {
.property("slot", "results")
.property("title", &jig.jig_data.display_name)
.property("playedCount", "???")... | Rust | 0 |
=> panic!("expected brackets"),
}
*slice = &slice[2..];
}
fn assert_foo(slice: &mut &[TokenTree]) {
match slice[0].kind {
TokenNode::Term(ref name) => assert_eq!(name.as_str(), "fn"),
_ => panic!("expected fn"),
}
match slice[1].kind {
TokenNode::Term(ref name) => assert_eq... | Rust | 0 |
fn stop_after_secs() -> Result<()> {
let _ = env_logger::try_init();
let mut file = NamedTempFile::new()?;
file.write_all(b"{}\n")?;
file.write_all(b"\"snot\"\n")?;
file.write_all(b"\"badger\"\n")?;
file.flush()?;
let path = file.into_temp_path();
let defn = literal!({
"codec": ... | Rust | 0 |
trait_ref.def_id.krate != ast::LOCAL_CRATE &&
!ty::has_attr(tcx, trait_ref.def_id, "fundamental")
{
debug!("trait_ref_is_knowable: trait is neither local nor fundamental");
return false;
}
// find out when some downstream (or cousin) crate could impl this
// trait-ref, presumin... | Rust | 0 |
lt_ty: KTy2) -> KTy2 {
KTy2::Fn {
param_tys: param_tys.into_iter().collect(),
result_ty: Box::new(result_ty),
}
}
pub(crate) fn is_unbound(&self, ty_env: &KTyEnv) -> bool {
ty2_map(self, ty_env, |ty| match ty {
KTy2::Unresolved { .. } => true,
... | Rust | 0 |
# ========= Copyright 2023-2024 @ CAMEL-AI.org. 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 requ... | Python | 1 |
present.
pub fn get<R>(&self) -> Res<'_, R>
where
R: 'static,
{
let ref_ = self
.0
.get(&TypeId::of::<R>())
.unwrap_or_else(|| panic!("Resource {} not present", type_name::<R>()))
.try_borrow()
.unwrap_or_else(|_err| panic!("Resour... | Rust | 0 |
stream_seq=1)
await audio_queue_put(audio_queue,rsp,trace_tree)
# 发送结束标记
await audio_queue_put(audio_queue,TTSRsp(stream_seq=-1),trace_tree)
elif route.kb_result.category_name == QuestionType.WEATHER.value:
question_rag = ""
try:
... | Python | 1 |
from sqlalchemy import Column, String, Float, DateTime, Text, Integer, ForeignKey, Boolean
from sqlalchemy.orm import relationship
from datetime import datetime
from app.db.base import Base
class Submission(Base):
__tablename__ = "submissions"
id = Column(String, primary_key=True, index=True)
user_id... | Python | 1 |
))?
}
};
Ok(balance.into())
}
// account_id, key, block_number
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(untagged)]
enum GetStorageAtParams {
Tip((AccountID, JsonH256)),
Number((AccountID, JsonH256, Option<GwUint64>)),
}
async fn get_storage_at(
Params(params): Params<GetStor... | Rust | 0 |
s) -> Result<BlockSize, ParseIntError> {
if matches.is_present(OPT_HUMAN_READABLE_BINARY) {
Ok(BlockSize::HumanReadableBinary)
} else if matches.is_present(OPT_HUMAN_READABLE_DECIMAL) {
Ok(BlockSize::HumanReadableDecimal)
} else if matches.is_present(OPT_BLOCKSIZE) {
let s = matches.... | Rust | 0 |
uttons,
bootrom: true,
}
}
pub fn step(&mut self) {
self.gpu.step();
self.spu.step();
self.dma_step();
self.timer.step();
}
pub fn dma_step(&mut self) {
let end = map::range_size(map::OAM);
if self.dma_idx >= end {
// No ... | Rust | 0 |
types::Record::new("Bar", Default::default(), SourceInformation::dummy()),
)],
vec![],
));
let type_id_calculator = TypeIdCalculator::new(reference_type_resolver.clone());
assert_eq!(
TypeCompiler::new(
referenc... | Rust | 0 |
XKeySym::XK_3270_EraseEOF => 0xfd06,
XKeySym::XK_3270_EraseInput => 0xfd07,
XKeySym::XK_3270_Reset => 0xfd08,
XKeySym::XK_3270_Quit => 0xfd09,
XKeySym::XK_3270_PA1 => 0xfd0a,
XKeySym::XK_3270_PA2 => 0xfd0b,
XK... | Rust | 0 |
}
}
// MIT/Apache2 License
#![no_std]
#![warn(clippy::pedantic)]
#![allow(clippy::cast_sign_loss)]
#![allow(clippy::redundant_pattern_matching)]
#![allow(clippy::cast_possible_wrap)]
#![forbid(unsafe_code)]
#[cfg(feature = "alloc")]
extern crate alloc;
pub mod array_deque;
#[cfg(feature = "alloc")]
pub mod tiny... | Rust | 0 |
from airflow import DAG
from operators.common_pipeline import CommonDag
def remove_district_code(x):
if isinstance(x, str) and "630" in x:
city = x[:3]
rest = x[11:]
return f"{city}{rest}"
else:
print("無須轉換:" + x)
return x
def D100101(**kwargs):
import pandas as p... | Python | 1 |
{
let content = format!("Twitch user `{name}` was not found");
return data.error(&ctx, content).await;
}
Err(why) => {
let _ = data.error(&ctx, TWITCH_API_ISSUE).await;
return Err(why.into());
}
};
let channel = data.channel_id().get();... | Rust | 0 |
import os
import sys
from setuptools import setup, Extension
# --- Get paths and environment variables (same as before) ---
script_dir = os.path.dirname(os.path.realpath(__file__))
llama_cpp_dir = os.path.join(script_dir, "vendor", "llama.cpp")
# --- CUDA Setup ---
cuda_path = os.environ.get('CUDA_PATH')
cuda_include... | Python | 1 |
import os
from setuptools import setup
from setuptools.command.test import test as TestCommand
from setuptools.command.sdist import sdist as SdistCommand
import sys
try:
from setuptools_rust import RustExtension
except ImportError:
import subprocess
errno = subprocess.call([sys.executable, "-m", "pip", "i... | Python | 1 |
stack: Vec<MatchState<'a, 'k, V>>,
}
impl<'a, 'k, V> Matches<'a, 'k, V> {
pub(crate) fn new(node: &'a Trie<V>, keyword: &'k str) -> Self {
Self { stack: vec![MatchState::new(true, node, node, keyword.chars())] }
}
}
impl<'a, 'k, V> Iterator for Matches<'a, 'k, V> {
type Item = (&'a Trie<V>, ... | Rust | 0 |
_of_url(database_url, "information_schema");
let conn = try!(MysqlConnection::establish(&mysql_url));
if try!(mysql_database_exists(&conn, &database)) {
println!("Dropping database: {}", database);
query_helper::drop_database(&database).if_exists().execute(&conn)?... | Rust | 0 |
));
s.push_str(&format!(
" blue: {}\n",
u16::from_be_bytes(self.0[12..14].try_into().unwrap())
));
}
}
s.push_str(&format!(
" crc: 0x{:08X}\n",
u32::from_be_bytes(self.0[8 + length..].try_... | Rust | 0 |
lf) -> bool {
**self == REG_GPIO_6_SMT_A::ENABLED
}
}
impl core::ops::Deref for REG_GPIO_6_SMT_R {
type Target = crate::FieldReader<bool, REG_GPIO_6_SMT_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `reg_gpio_6_smt` writer - Schmitt trigger enabl... | Rust | 0 |
c = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
... | Rust | 0 |
ontrolFlowMode::Break,
HirControlKind::Continue => ControlFlowMode::Continue,
}
}
}
impl Default for ControlFlowMode {
fn default() -> Self {
ControlFlowMode::Normal
}
}
<filename>engine/src/assets/terrain.rs<gh_stars>10-100
use {
super::{
append_key,
materia... | Rust | 0 |
Unknown(u16),
}
impl FromStr for DNSSECRecordType {
type Err = ProtoError;
fn from_str(str: &str) -> ProtoResult<Self> {
match str {
"DNSKEY" => Ok(DNSSECRecordType::DNSKEY),
"DS" => Ok(DNSSECRecordType::DS),
"KEY" => Ok(DNSSECRecordType::KEY),
"NSEC... | Rust | 0 |
number of tokens in fixed array")]
FixedArrayLengthsMismatch,
/// Tokenize::from_token token is tuple with wrong length.
#[error("expected a different number of tokens in tuple")]
TupleLengthMismatch,
}
/// Rust type and single token conversion.
pub trait Tokenize {
/// Convert self into token.
... | Rust | 0 |
conv_kernel,
self.conv_padding,
dilation_value=1,
),
SamePad(kernel_size=self.conv_kernel, causal=self.causal),
]
self.net = torch.nn.Sequential(
*emb_net,
torch.nn.Dropout(dropout),
*inner_net,
)
d... | Python | 1 |
Major version of the PTX Compiler APIs"]
#[doc = " \\param [out] minor Minor version of the PTX Compiler APIs"]
#[doc = " \\note The version of PTX Compiler APIs follows the CUDA Toolkit versioning."]
#[doc = " The PTX ISA version suppor... | Rust | 0 |
loaded', 'progress']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
# 写入表头
writer.writeheader()
# 写入peer数据
for peer_id, peer_info in peers.items():
... | Python | 1 |
import pygame
from function.btns.drawLines import drawLines
def drawFigures(screen,font,position,WHITE,BLACK,boardRows,squareSize,WidthBoard,HeightBoard,LineWidth):
screen.fill(BLACK)
drawLines(screen,boardRows,WHITE,squareSize,WidthBoard,HeightBoard,LineWidth)
for num, (x,y) in position.items... | Python | 1 |
sed)]
pub mod SFRS {
pub const INDF0: u16 = 0x00;
pub const FSR0: u16 = 0x01;
pub const PCL: u16 = 0x02;
pub const PCLATH: u16 = 0x03;
pub const ALUSTA: u16 = 0x04;
pub const T0STA: u16 = 0x05;
pub const CPUSTA: u16 = 0x06;
pub const INTSTA: u16 = 0x07;
pub const INDF1: u16 = 0x08;
... | Rust | 0 |
.oo0P~GPjo.
.o0o0000P'.?P `jo.'.
karanlıkta dört nala! __ .000000P.;' .dP.dPo) ,
. '0000oo.00d00b.P' X^V P<<
... | Python | 1 |
from enum import Enum
from typing import Dict, Literal
class StartCharTyping(Enum):
EMPTY = ""
BLOCK_BRACE = "["
PAREN = "("
DOT_BLOCK = "⡇"
StartCharName = Literal[
"empty",
"block_brace",
"paren",
"dot_block",
]
class StartChar:
names: Dict[StartCharName, str] = {
cha... | Python | 1 |
te1 = trackResult['CreatedAt']
thisDate2 = trackResult['UpdatedAt']
#Add the track to the file for testing
f.write(f"\n[{{'TrackID': {track_id}, 'Title': '{arr[0]}', 'Duration': {arr[3]}, 'AlbumID': None, 'ArtistID': {artistResult['ArtistID']}, 'CreatedAt': datetime.datetime({thisDat... | Python | 1 |
ession returned is
# newly created, the callback will be invoked but since there is no tag
# specified, no session state will be changed
print("(1) acquire session without tag")
with pool.acquire() as conn:
cursor = conn.cursor()
cursor.execute("select to_char(current_date) from dual")
(result,) = cursor.fe... | Python | 1 |
T = int(input())
cases = []
for _ in range(T):
k = int(input())
n = int(input())
cases.append([k,n])
## k층의 n호
## k층의 n호에는 k-1층의 1호부터 n호까지 사람수의 합만큼 사람들 데려와 살아야함
## 1층의 1호
dp = [[0] * 15 for _ in range(15)]
dp[0][1] = 1
dp[0][2] = 3
for i in range(3,15):
dp[0][i] = i + dp[0][i-1]
for k in range(1,15):
fo... | Python | 1 |
uma opçao: "))
for marca, modelos in tenis.items():
for modelo, detalhes in modelos.items():
data_lancamento = datetime.strptime(detalhes["data_lancamento"], "%d/%m/%Y")
if (datetime.now() - data_lancamento).days <= 30:
tenis_n... | Python | 1 |
pe=str(type(filename))))
# check extension is a laserscan
if not any(filename.endswith(ext) for ext in self.EXTENSIONS_LABEL):
raise RuntimeError("Filename extension is not valid label file.")
# if all goes well, open label
label = np.fromfile(filename, dtype=np.int32)
label = label.reshape(... | Python | 1 |
print(f"错误: 多次尝试后未能删除临时文件 '{filepath_to_delete}'。它可能被其他进程或 Pygame 锁定。")
except FileNotFoundError:
print(f"Debug: 临时文件 '{filepath_to_delete}' 已被删除或未找到。")
deleted_successfully = True
break
except Exception as e_os_rem:
... | Python | 1 |
ame>guillemcordoba/holochain<filename>crates/hdk/src/countersigning.rs
use crate::prelude::*;
/// Locks the local chain to commence a countersigning session.
/// The `PreflightRequestAcceptance` MUST be sent back to the session initiator
/// so that the corresponding entry can be built for everyone to sign.
/// This f... | Rust | 0 |
#[serde(skip_serializing_if = "Option::is_none")]
pub max_age: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub priority: Option<u16>,
#[serde(skip_serializing_if = "Option::is_none")]
pub multi_bool_opt: Option<u64>, // does not avaiable in sysfs yet
#[serde(skip_serializing_i... | Rust | 0 |
だ実装してないぜ☆(^~^)!",
))),
}
}
fn is_rank3(&self, destination: &FireAddress) -> bool {
match destination {
FireAddress::Board(dst_sq) => RANK7U8 == dst_sq.rank(),
_ => panic!(Log::print_fatal(&format!(
"(Err.905) まだ実装してないぜ☆(^~^)!",
))),... | Rust | 0 |
file_delimeters
new_file_encodings = self.file_encodings + other_code_chunk.file_encodings
new_file_decimals = self.file_decimals + other_code_chunk.file_decimals
new_file_skiprows = self.file_skiprows + other_code_chunk.file_skiprows
new_error_bad_lines = self.file_error_bad_lines + oth... | Python | 1 |
import requests, json
def get_stock_prices(api_key, symbol):
base_url = "https://www.alphavantage.co/query"
params = {
"function": "TIME_SERIES_DAILY",
"symbol": symbol,
"apikey": api_key
}
response = requests.get(base_url, params=params)
data = response.json()
... | Python | 1 |
ko = 0;
// TODO 隣接しているのが相手の石で、呼吸点が 1 なら、その連は取れる☆(^~^)
let opponent = get_opponent(pos.turn);
if pos.get_board().get_stone(top) == opponent {
println!("Do move: 上に相手の石。");
peel_off_by_piece_id(top, pos, record);
// コウ。
if 1 == record.get_current().agehama_addrs.len() {
... | Rust | 0 |
param: f64,
) -> msdfgen_Vector2;
}
extern "C" {
#[link_name = "\u{1}_ZNK7msdfgen13LinearSegment14signedDistanceENS_7Vector2ERd"]
pub fn msdfgen_LinearSegment_signedDistance(
this: *mut ::std::os::raw::c_void,
origin: msdfgen_Point2,
param: *mut f64,
) -> msdfgen_SignedDistan... | Rust | 0 |
rom_frame = self.key_frames.index(i - 1);
let from_frame = from_frame.as_ref();
let to_frame = self.key_frames.index(i);
let to_frame = to_frame.as_ref();
if seconds == to_frame.seconds() {
to_frame.apply(core, property_key, mix);
} else if from_frame.interpolation_t... | Rust | 0 |
from typing import List
from elements.identifier import Identifier
from elements.date import Date
from elements.dollars import Dollars
from utilities import split_segment, get_element
from elements.adjustment_reason_code import AdjustmentReasonCode
from elements.reference_qualifier import ReferenceQualifier
class Pro... | Python | 1 |
format!("{}", num_valid))
}
}
pub mod graph;
pub mod traversal;
<gh_stars>1000+
#![crate_name="macros"]
#[macro_export]
macro_rules! foo {
() => {};
}
#[macro_export]
macro_rules! bar {
() => {};
}
#[macro_export]
macro_rules! baz {
() => {};
}
#[macro_export]
macro_rules! quux {
() => {};
}
use c... | Rust | 0 |
unchecked_unwrap::UncheckedUnwrap;
use xjbutil::either::Either;
use crate::awa;
use crate::diag::diag_data;
use crate::diag::location::SourceRange;
use crate::parse::lexer::LexerMode;
use crate::parse::parser::TOP_LEVEL_FIRST;
use crate::syntax::ConcreteProgram;
use crate::syntax::attr::Attribute;
use crate::syntax::... | Rust | 0 |
();
append_static_binary_element(&elem, &mut bits, None).unwrap();
assert_eq!(bits.as_ref(), &[21 >> 4, 21 << 4]);
}
#[test]
fn simple_integer_little_endian_with_size() {
let expr = ast::Expr::Literal(Literal::Integer(SourceSpan::UNKNOWN, ast::NodeId(0), 21.into()));
let siz... | Rust | 0 |
-5 rad/sec
const ROOT32: f64 = 3.7393792e-7;
const ROOT52: f64 = 1.1428639e-7;
const ZNL: f64 = 1.5835218e-4;
const ZNS: f64 = 1.19459e-5;
// -------------------- deep space initialization ------------
irez = 0.0;
if (nm < 0.0052359877) && (nm > 0.0034906585) {
irez = 1.0;
}
... | Rust | 0 |
class Solution:
def numIslands(self, grid: List[List[str]]) -> int:
# this is kind of like a flood fill paint bucket type thing
rows, cols = len(grid), len(grid[0])
# linear search through the 2d array
# if encounter 1, increment solution counter
# then BFS to get every s... | Python | 1 |
ations in the sense word
#[derive(Clone, Debug)]
pub struct DecodeResult<F> {
output: Vec<F>,
error_positions: Vec<usize>,
}
impl<F> DecodeResult<F> {
/// Decoded original data
pub fn output(&self) -> &[F] {
&self.output
}
/// Error locations in the sense word
pub fn error_position... | Rust | 0 |
"""Regression tests for the graphpipeline."""
| Python | 1 |
}
}
more_chars_used += 1;
match u32::from_str_radix(&escape, 16) {
Ok(codepoint) => match char::from_u32(codepoint) {
Some(ch) => Ok((ch, more_chars_used)),
_ => Err(LexErrorKind::QuoteInvalidEscapedUnicodeCodepoint {
codepoint: escape,
index... | Rust | 0 |
.fire()
.err(),
None
);
assert_eq!(
server
.battle()
.entities()
.character(&ENTITY_1_ID)
.unwrap()
.statistics()
.count(),
2
);
// Regenerate should fail for non existing entities.
assert_... | Rust | 0 |
14, R15,
Imm(i64),
Op2(String, Box<Asm>, Box<Asm>),
Retq,
Cfg(String, Vec<Asm>),
}
impl fmt::Display for Asm {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
use Asm::*;
match self {
RAX => write!(f, "%rax"), RBX => write!(f, "%rbx"), RCX => write!(f, "%rcx... | Rust | 0 |
e_sigint),
signal::SaFlags::empty(),
signal::SigSet::empty(),
);
unsafe {
match signal::sigaction(signal::SIGINT, &sig_action) {
Ok(_) => (),
Err(e) => panic!("Unable to register SIGINT handler: {}", e),
}
}
let arg_options = parse_args();
le... | Rust | 0 |
InstanceKind::Module { module, args })
} else if p.peek2::<kw::component>() {
let component = p.parse()?;
let mut args = Vec::new();
while !p.is_empty() {
args.push(p.parens(|p| p.parse())?);
}
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.