text string | label_name string | labels int64 |
|---|---|---|
BAUDRATER::BAUD38400 => 10309632,
BAUDRATER::BAUD56000 => 15007744,
BAUDRATER::BAUD57600 => 15462400,
BAUDRATER::BAUD76800 => 20615168,
BAUDRATER::BAUD115200 => 30924800,
BAUDRATER::BAUD230400 => 61845504,
BAUDRATER::BAUD250000 => 67108... | Rust | 0 |
################################################################################
# AccelerateCFD_CE
# Copyright 2018-2019 Illinois Rocstar LLC
#
# This utility helps to visualize the cumulative energy content in POD modes.
# This utility is also provided under General Public License Version 3.
#
######################... | Python | 1 |
of the line with our indices, then
// we need to see if we've reached the success state during the last
// iteration through our states...
nfa.remove_branches(check_states).iter().any(|&i| { *(nfa.state_at(i)) == State::Success } )
}
/// A string is a Regular Expression if it can validate other strings
//... | Rust | 0 |
let value = entry.value() as u64;
let country = entry.country_code;
let name = entry.username;
let entry = RankingEntry {
value: UserValue::Amount(value),
name,
country,
};
(i, entry)
})
.co... | Rust | 0 |
# Copyright (c) 2021 PaddlePaddle 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 appli... | Python | 1 |
COLUMNS_INDEX = {0: 0,
1: 0,
2: 2,
3: 2,
4: 4,
5: 5,
6: 6,
7: 7,
8: 8,
9: 8}
# space used in LayoutBoxes
SPACE = 10
# Fl... | Python | 1 |
more than two segments")]
TooManySegments,
#[error("package path has fewer than two segments")]
TooFewSegments,
#[error("invalid package name")]
PackageName(#[source] PackagePathSegmentError),
#[error("invalid package variant")]
PackageVariant(#[source] PackagePathSegmentError),
}
<repon... | Rust | 0 |
, "zihuabu" => 190, 167, 139;
"黄封", "huangfeng" => 202, 178, 114;
"养生主", "yangshengzhu" => 180, 155, 127;
"沙饧", "shaxing" => 191, 166, 112;
"黄螺", "huangluo" => 180, 163, 121;
"蒸栗", "zhengli" => 165, 138, 95;
"巨吕", "julv" => ... | Rust | 0 |
excessive_precision)]
use crate::Float;
use color::color_data::{LAMBDA_END, LAMBDA_START};
use serde::{Deserialize, Serialize};
use utility::floats::FloatExt;
///! In optics, the **refractive index** of a material is a dimensionless number that describes
///! how fast light travels through the material.
///!
///! Thi... | Rust | 0 |
# coding: utf-8
"""
KlimAPI - Calculation & Compensation API
This API offers you the possibility to calculate and offset emissions, create checkout links, get statistics and much more.
API Version: v2
Contact: tech@klimapi.com
Do not edit the class manually.
""" # noqa: E501
import unittest
... | Python | 1 |
import mido
import os
def midi_note_to_name(midi_note):
notes = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']
octave = (midi_note // 12) - 1
note = notes[midi_note % 12]
return f"{note}{octave}"
def midi_to_text(midi_file_path):
midi = mido.MidiFile(midi_file_path)
# E... | Python | 1 |
stringify!(rte_pci_device_list),
"::",
stringify!(tqh_last)
)
);
}
#[doc = " List of PCI drivers"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct rte_pci_driver_list {
pub tqh_first: *mut rte_pci_driver,
pub tqh_last: *mut *mut rte_pci_driver,
}
#[test]
fn b... | Rust | 0 |
_type, side_turn,
side_invert, fill_color, stroke_color, background_color);
side_turn += 1;
draw_patch(&mut target_image, block_pos, block_pos_2, side_type, side_turn,
side_invert, fill_color, stroke_color, background_color);
side_turn += 1;
draw_patch(&mut target_image, 2, block_pos, side_type, sid... | Rust | 0 |
from random import randint
print("Welcome to the Higher-Lower Game!")
rnum = randint(0, 100)
noguesses = 0
while True:
while True:
guess = input("Guess the number: ")
if guess.isdigit():
# Check if the input string consists of digits only
integer_number = int(guess)
... | Python | 1 |
fn(
this: &mut T,
threadId: ThreadID,
cchName: ULONG,
name: *const WCHAR,
) -> HRESULT,
pub GarbageCollectionStarted: unsafe extern "system" fn(
this: &mut T,
cGenerations: int,
generationCollected: *const BOOL,
reason: COR_PRF_GC_REASON,
) -> ... | Rust | 0 |
from flask import Blueprint, g, jsonify, make_response
from httpx import delete
from werkzeug.exceptions import Unauthorized
from app.web.hooks import (
login_required,
handle_file_upload,
load_model,
)
from app.web.db.models import Pdf
from app.web.tasks.embeddings import process_document
from app.web impo... | Python | 1 |
oc['documentElement']['scrollTop'];
}
""")
def getChildIndex(parent, child):
JS("""
var count = 0, current = @{{parent}}['firstChild'];
while (current) {
if (! current['isSameNode']) {
if (current == @{{child}}) {
return count;
}
}
else if (current['isSameNode'](@{{child}})) {
... | Python | 1 |
re(true, Ordering::Relaxed);
join_handle.join().unwrap();
return;
}
}
}
/// Reads all input from user and sends valid directions to server
pub fn handle_input(
stream: Arc<Mutex<Option<TcpStream>>>,
mut input: AsyncReader,
exit: Arc<AtomicBool>,
altscreen_guard: Alte... | Rust | 0 |
_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets PSR to value 0"]
impl crate::Resettable for PSR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
fn f() {
asdf();
// ^^^^ERR(<1.16.0) unresolved name `asdf`
// ^^^^ERR(<1.16.0) unresolved name
// ^^^^ERR(>=1.16.0) not ... | Rust | 0 |
FULL) => Err(nb::Error::WouldBlock),
Val(sr::FLVL_A::QUARTER4) => Err(nb::Error::WouldBlock),
_ => {
unsafe {
audio_ch.dr.write(|w| w.bits(left_word).bits(right_word));
}
Ok(())
}
}
}
// Pin definitions
macro_rules! pins {
($($SAIX:ty:... | Rust | 0 |
tity'] += symbol_summary['filled_quantity']
summary['pending_quantity'] += symbol_summary['pending_quantity']
return summary
class PositionManager:
"""头寸管理器
管理交易账户的所有头寸
"""
def __init__(self,
config: Optional[Dict[str, Any]] = None,
log_le... | Python | 1 |
Some(self.transform_subrange_with_state(children.to_vec(), &mut state));
}
result.unwrap()
}
_ => vec!(node),
}
}
Loop(..) => unreachable!(),
Block(..) => unreachable!(),
}
}).collect();
nodes
}
}
impl optimizer:... | Rust | 0 |
# Update
card.title = "New White Card Title"
card.save()
# Delete
card.delete()
assert not self.WhiteCard.objects.all().exists()
class ProjectContactModelTests(TestCase):
"""Collection of tests for :model:`rolodex.ProjectContact`."""
@classmethod
def setUpT... | Python | 1 |
0.00159 * rank_int**2 - 0.0380 * rank_int + 0.37
) * PlayingCard.width
with PolarLocations(
radius=center_radius,
count=rank_int,
start_angle=90 if rank_int > 1 else 0,
):
PlayingCard... | Python | 1 |
mes))]
fn egcd(a: i32, b: i32) -> (i32, i32, i32) {
if a == 0 {
return (b, 0, 1);
}
let (g, y, x) = egcd(b % a, a);
(g, x - (b / a) * y, y)
}
#[test]
fn test() {
let l = [(2, 3), (3, 5), (2, 7)];
assert_eq!(chinese_remainder(&l), Some(23));
let l = [(10, 11), (4, 22), (9, 19)];
... | Rust | 0 |
infos, min_size=32)]
# obtain_annotations
for data_info in data_infos:
ann_ids = self.coco.getAnnIds(imgIds=data_info['id'])
ann_info = self.coco.loadAnns(ann_ids)
data_info.update({'ann_info': ann_info})
if self.debug:
data_infos = data_infos[:32... | Python | 1 |
if expectation is None:
self.assertRaises(AttributeError,
strftime(dt, format))
else:
self.assertEqual(strftime(dt, format),
expectation)
return unittest.TestLoader().loadTestsFromTestCase(Te... | Python | 1 |
%Y%m%d_%H%M%S")
filename = f"jobpulse_test_report_{timestamp}.txt"
report = self.generate_report()
try:
with open(filename, 'w', encoding='utf-8') as f:
f.write(report)
self.log(f"📄 Test report saved to: {filename}", "IN... | Python | 1 |
CRED, super::ucred);
#[cfg(any(target_os = "macos",
target_os = "ios"))]
sockopt_impl!(Both, TcpKeepAlive, libc::IPPROTO_TCP, libc::TCP_KEEPALIVE, u32);
#[cfg(any(target_os = "freebsd",
target_os = "dragonfly",
target_os = "linux",
target_os = "android",
target_os = "na... | Rust | 0 |
shell=True,
)
fi, fo, fe = p.stdin, p.stdout, p.stderr
while 1:
txt = g.toUnicode(fo.read())
f.write(txt)
if txt == '':
break
while 1:
txt = g.toUnic... | Python | 1 |
ern, flags):
"""
mock file.search
"""
if len(pattern.split()) == 1:
return False
else: # charmap was supplied
return True
ret = {"stdout": "saltines", "stderr": "biscuits", "retcode": 0, "pid": 1337}
with patch... | Python | 1 |
# least_confident
val_scores = np.array([0.5, 0.3])
scores = uncertainty_scores(self.probas, method="least_confident")
np.testing.assert_allclose(val_scores, scores)
# entropy
val_scores = np.array([1.029653014, 0.8018185525])
scores = uncertainty_scores(self.probas, met... | Python | 1 |
tLeaf("x_1"))
def check_candidate(self, candidate):
if not equal_bnot_mop(candidate["x_1"].mop, candidate["bnot_x_1"].mop):
return False
return True
class Mul_FactorRule_1(PatternMatchingRule):
PATTERN = AstNode(m_add,
AstConstant("2", 2),
... | Python | 1 |
1_neg_lo, op1_neg_hi, dest.clone()));
}
ScoreOpKind::MulAssign => {
cmds.extend(mul_64_bit(op0_lo, op0_hi, op1_lo, op1_hi, dest.clone()));
}
_ => todo!("{:?}", kind),
}
cmds
} else {
let dest =
ScoreHolder::from_loc... | Rust | 0 |
<IC::HelpSNARK as SNARK<HelpField>>::prove(&default_pk, default_circ, &mut default_rng)
.unwrap();
let crh_pp_gadget = <IC::CRHGadget as VariableLengthCRHGadget<
IC::CRH,
MainField,
>>::ParametersVar::new_constant(
ark_relations::ns!(cs, "alloc_crh_f... | Rust | 0 |
LiquidityETH");
let token = erc20_address;
let amount_token_desired: U256 = 50000_000000000000000000u128.into();
let amount_token_min: U256 = 49000_000000000000000000u128.into();
let amount_eth_min: U256 = 10000_000000000000000000u128.into();
let to = sender;
let deadline: U256 = (time_now() + 1... | Rust | 0 |
from typing import List
class Solution:
def mergeArrays(self, nums1: List[List[int]], nums2: List[List[int]]) -> List[List[int]]:
ans = {}
for idx, num in nums1:
ans[idx] = ans.get(idx, 0) + num
for idx, num in nums2:
ans[idx] = ans.get(idx, 0) + num
retur... | Python | 1 |
cation_transaction():
self.db.delete(notification)
return True
# 执行事务
self.execute_in_transaction(delete_notification_transaction)
logger.info(f"成功删除通知,ID: {notification_id}")
# 清除缓存
self.delete_cache(f... | Python | 1 |
# Problem link - https://leetcode.com/problems/critical-connections-in-a-network/description/
# Solution - https://www.youtube.com/watch?v=qrAub5z8FeA&list=PLgUwDviBIf0oE3gA41TKO2H5bHpPd7fzn&index=55
class Solution:
_timer = 1
@staticmethod
def _find_bridges(graph, node, parent, visited, in_time, min_tim... | Python | 1 |
ation(*config_and_inputs)
# special case for DeiTForImageClassificationWithTeacher model
def _prepare_for_class(self, inputs_dict, model_class, return_labels=False):
inputs_dict = super()._prepare_for_class(inputs_dict, model_class, return_labels=return_labels)
if return_labels:
if... | Python | 1 |
径
save_dir = 'F:/软件工程/AI技术赛道(更新)/processed_data'
dataset_path = os.path.join(save_dir, 'processed_data.pt')
# 检查是否已存在保存的数据
if os.path.exists(dataset_path):
# 如果数据存在,加载已处理的数据
dataset = torch.load(dataset_path)
all_data = dataset['data']
all_angles = dataset['angles']
class_labels = dataset['class_la... | Python | 1 |
# with open('test.txt', 'a+', encoding='utf-8') as file:
# file.write('\nGomanova\nElina\n21.04.2010')
# with open('test.txt', 'r', encoding='utf-8'):
with open('test.txt', 'w+', encoding='utf-8') as file:
file.write('\nGomanova\nElina\n21.04.2010')
with open('test.txt', 'r', encoding='utf-8') as file:
... | Python | 1 |
[allow(clippy::cast_ref_to_mut)]
let stream = unsafe { &mut *(&this.stream as *const TcpStream as *mut TcpStream) };
this.write_fut
.arm_future(AsyncWriteRent::write(stream, raw_buf));
}
let (ret, _) = match this.write_fut.poll(cx) {
std::task::Poll::... | Rust | 0 |
1, 1)]
)
yield Case(
Annotated[datetime, at.Timezone(timezone.utc)],
[datetime(2000, 1, 1, tzinfo=timezone.utc)],
[datetime(2000, 1, 1), datetime(2000, 1, 1, tzinfo=timezone(timedelta(hours=6)))],
)
yield Case(
Annotated[datetime, at.Timezone('Europe/London')],
[... | Python | 1 |
KeyVersion][google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersion].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCryptoKeyVersionRequest {
/// Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get.
#[prost(str... | Rust | 0 |
{
const $c: Encoding<'static> = $e;
}
unsafe impl<T: RefEncode + ?Sized> $x for NonNull<$t> {
const $c: Encoding<'static> = $e;
}
unsafe impl<'a, $t: RefEncode + ?Sized> $x for Option<&'a $t> {
const $c: Encoding<'static> = $e;
}
un... | Rust | 0 |
// (it's been only added to the write batch).
// But this can be fixed upon reloading the db / restarting the worker
self.last_blocks.remove(shard);
}
}
#[cfg(test)]
mod test {
use super::*;
use itp_types::ShardIdentifier;
use its_primitives::{
traits::{Block as BlockT, SignBlock, SignedBlock as SignedBlo... | Rust | 0 |
);
/// This simply test that the lazy static lock is being updated correctly after calling the function setup_withdrawal.
/// We call the function with the 'Withdraw' struct and check if the information is being updated correctly. This is necessary
/// that the correct information about the withdrawal is b... | Rust | 0 |
import sys
import prolog
import pipe
import getopt
format = pipe
token_index = 2
pos_index = 4
def Iter(node, btags, etags):
assert node
span = node.end_index-node.start_index+1
btags[node.start_index] = max(btags[node.start_index], span)
etags[node.end_index] = max(etags[node.end_index], span)
if node... | Python | 1 |
|| {
for &i in vals.iter() {
h.set(i, i);
}
});
}
}#![allow(non_snake_case)]
#![allow(unused_imports)]
use crate::avro::{FromAvro, ToAvro};
use std::collections::HashMap;
use std::io::{Read, Write};
use libflate::deflate::{Decoder, Encoder};
use nom::{
bytes::s... | Rust | 0 |
)
.deallocate(ptr, old_size, align)
}
}
/// Attempt to resize an existing block of memory, preserving as much data
/// as possible. For now, we always just allocate new memory, copy data,
/// and deallocate the old memory.
#[no_mangle]
pub extern "C" fn __rust_reallocate(
ptr: *mut c_void,
old_size: usi... | Rust | 0 |
le.TimeEnergy.append(workflow.schedule.T_total)
workflow.schedule.TimeEnergy.append(workflow.schedule.E_total)
def calculateComputingCost(self, f, T_e_i): # m为卸载的服务器索引, T_e_i为在该服务器上的计算时间
unit_cost = np.exp(-epsilon_1) * (np.exp(f) - 1) * epsilon_2
return unit_cost * T_e_i
def get_RT_... | Python | 1 |
following format:
///
/// 1 1 1 1 1 1
/// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
/// +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/// | |
/// / QNAME / ZNAME /
/// /... | Rust | 0 |
components = np.array(components, dtype = 'object')
end = timer()
times[1] = times[1] + end - start
print(" computation of the SPG...")
start = timer()
graph_sp = compute_sp_graph(xyz, args.d_se_max, in_component, components, labels, n_labels)
... | Python | 1 |
/// let index = Route::new(Method::Get, "/foo/bar?a=1", handler);
/// assert_eq!(index.uri.path(), "/foo/bar");
/// let index = index.map_base(|base| format!("{}{}", "/boo", base)).unwrap();
/// assert_eq!(index.uri.path(), "/boo/foo/bar");
/// ```
#[inline(always)]
pub fn path(&self) -> &st... | Rust | 0 |
stLen', c_uint), # < \~chinese 输出数据大小 \~english Output data size
('nDstBufferSize', c_uint), # < \~chinese 提供的输出缓冲区大小 \~english Provided outbut buffer size
('nRes', c_uint * 4), # < \~chinese 保留字节 \~english Reserved bytes
]
MV_... | Python | 1 |
::clone(&cv),
Arc::clone(&alt_mu),
Arc::clone(&alt_cv),
tx.clone(),
));
}
for _ in 0..OBSERVERS {
ex.spawn_ok(observe_either(
Arc::clone(&mu),
Arc::clone(&cv),
Arc::clone(&alt_mu),
... | Rust | 0 |
import os
import sys
import shutil
import subprocess
import common
SRC_PATH = f"{common.BASE_PATH}/services/ecowatch.service"
SRC_damy_PATH = f"{common.BASE_PATH}/services/ecowatch_damy.service"
DEST_PATH = f"/usr/lib/systemd/system/ecowatch.service"
DEST_damy_PATH = f"/usr/lib/systemd/system/ecowatch_damy.service"
... | Python | 1 |
nst SYS_BUTTON_LID_OPEN: u32 = 65536u32;
#[doc = "*Required features: `\"Win32_System_Power\"`*"]
pub const SYS_BUTTON_LID_STATE_MASK: u32 = 196608u32;
#[doc = "*Required features: `\"Win32_System_Power\"`*"]
pub const SYS_BUTTON_POWER: u32 = 1u32;
#[doc = "*Required features: `\"Win32_System_Power\"`*"]
pub const SYS_... | Rust | 0 |
ensions
None,
))
}
/// Configure initial storage state for FRAME modules.
fn testnet_genesis(
wasm_binary: &[u8],
initial_authorities: Vec<(AccountId, AuraId, GrandpaId)>,
root_key: AccountId,
foundation_account: AccountId,
sales_account: AccountId,
endowed_accounts: Vec<AccountId>,
_enable_println: bool,
b... | Rust | 0 |
SonnyRistrettoPoint,
p3: SonnyRistrettoPoint,
) -> Result<(), R1CSError> {
// Common
let pc_gens = PedersenGens::default();
let bp_gens = BulletproofGens::new(128, 1);
// For the example, we also commit to the points although it is not necessary
let (proof, commitments) = point_addition_proof(... | Rust | 0 |
import logging
from datetime import datetime
from typing import Any, Dict
from .utils import get_currency_rates, get_greeting, get_stock_prices, load_user_settings, process_transactions_data
def main_page(date_time_str: str) -> Dict[str, Any]:
"""
Основная функция для страницы "Главная".
"""
try:
... | Python | 1 |
table_name)
///
/// ```rust
/// # use async_sqlx_session::SqliteSessionStore;
/// # use async_session::Result;
/// # fn main() -> Result { async_std::task::block_on(async {
/// let store = SqliteSessionStore::new("sqlite:%3Amemory:").await?;
/// store.migrate().await;
/// # Ok(()) }) }
... | Rust | 0 |
)
def plot_metrics(self, output_dir='/tmp'):
'''
Plot metrics collected during training.
args:
output_dir: (optional) folder path for saving results.
'''
import matplotlib.pyplot as plt
import json
import os
if not os.path.exists(output_... | Python | 1 |
x, ev.position.y),
}));
}
for ev in events.mouse_button.iter() {
let button = conversions::mouse_button(ev.button);
event_queue.push(IcedEvent::Mouse(match ev.state {
bevy::input::ElementState::Pressed => iced_native::mouse::Event::ButtonPressed(button),
bevy::in... | Rust | 0 |
from pyrogram.errors import InviteHashExpired, UsernameInvalid, UsernameNotOccupied
from pyrogram.types import Chat
from functions.base_function import Base
from functions.utils import Field, Types
class Function(Base):
"""Leave selected groups"""
__id__ = 'leave_groups'
__function_name__ = 'Leave group... | Python | 1 |
from __future__ import annotations
# Imports Begin
from src.main.org.apache.commons.graph.export.AbstractExporter import *
from src.main.org.apache.commons.graph.Mapper import *
from src.main.org.apache.commons.graph.Graph import *
from src.main.org.apache.commons.graph.DirectedGraph import *
import typing
from typing... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Created on 2025/10/4 22:52
@author: Aidan
@project: GoalBet
@filename: routers_bounties
@description:
- Python
"""
from datetime import timezone, datetime
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from api.app.api.routers_auth import get_cu... | Python | 1 |
# Generated by Django 5.1.9 on 2025-05-10 06:18
import common.json
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sync', '0032_metadata_transfer'),
]
operations = [
migrations.AlterField(
model_name='mediaserver',
... | Python | 1 |
array() {
let p = qp(typ, "[u8; 42]");
assert_extent!(p, (0, 8))
}
#[test]
fn type_array_allows_expressions() {
let p = qp(typ, "[u8; 1 + 1]");
assert_extent!(p, (0, 11))
}
#[test]
fn type_fn() {
let p = qp(typ, "fn(u8) -> u8");
assert_extent!(p,... | Rust | 0 |
vent::Swipe(event) => event.as_raw_event(),
GestureEvent::Pinch(event) => event.as_raw_event(),
#[cfg(feature = "libinput_1_19")]
GestureEvent::Hold(event) => event.as_raw_event(),
}
}
}
impl FromRaw<ffi::libinput_event_gesture> for GestureEvent {
unsafe fn try_from_... | Rust | 0 |
_id, handler)) = commands.current_handler() {
if id != handler_id {
warn!(
"response id #{} doesn't match handler id #{}",
id, handler_id
);
commands.error_response(id, -1);
re... | Rust | 0 |
object: *const sfCircleShape,
states: *const sfRenderStates,
);
}
extern "C" {
pub fn sfRenderWindow_drawConvexShape(
renderWindow: *mut sfRenderWindow,
object: *const sfConvexShape,
states: *const sfRenderStates,
);
}
extern "C" {
pub fn sfRenderWindow_drawRectangleSh... | Rust | 0 |
/// ```text
/// [{decl_item}+ "begin"] {stmt} ["end" [ident] ";"]
/// ```
pub fn parse_generate_body<P: Parser, T>(
p: &mut P,
label: Option<Spanned<Name>>,
term: T,
) -> ReportedResult<ast::GenBody>
where
T: Predicate<P>,
{
let mut span = p.peek(0).span;
// Parse the optional de... | Rust | 0 |
U8(u8),
U16(u16),
U32(u32),
U64(u64),
USize(usize),
I8(i8),
I16(i16),
I32(i32),
I64(i64),
ISize(isize),
F32(f32),
F64(f64),
}
#[derive(Debug, Clone, PartialEq)]
pub enum Term {
Name(Cow<'static, str>),
Panic(Cow<'static, str>),
Constant(Constant),
If(Box<T... | Rust | 0 |
)) * 0.25f32;
}
}
}
}
print!("P3\n{} {}\n{}\n", w, h, 255);
let mut why = 0;
for el in c {
why += 1;
print!("{} {} {} ", to_int(el.x), to_int(el.y), to_int(el.z));
}
println!("{} {}", w * h, why);
}//! Spherical-polar dimensions.
/// Spheri... | Rust | 0 |
:NDFET),
"PDFET" => Ok(VoltageBiasedDeviceType::PDFET),
_ => Err(()),
}
}
}
<gh_stars>1-10
//! See [`PublicKey`].
use arrayvec::ArrayVec;
use serde::{Deserialize, Serialize};
use serde_big_array::BigArray;
use crate::{Config, Group};
/// Public key, used to verify the server by th... | Rust | 0 |
ificateTemplates.Create(
messages.PrivatecaProjectsLocationsCertificateTemplatesCreateRequest(
parent=cert_template_ref.Parent().RelativeName(),
certificateTemplateId=cert_template_ref.Name(),
certificateTemplate=new_cert_template,
requestId=request_utils.Generate... | Python | 1 |
::StaticVec::drain_iter) method on [`StaticVec`](crate::StaticVec),
/// as while the [`drain`](crate::StaticVec::drain) method does have a similar purpose, it works by
/// immediately returning a new [`StaticVec`](crate::StaticVec) as opposed to an iterator.
pub struct StaticVecDrain<'a, T: 'a, const N: usize> {
pub(... | Rust | 0 |
slate-700",
stroke_slate_800: "stroke-slate-800",
stroke_slate_900: "stroke-slate-900",
stroke_stone_100: "stroke-stone-100",
stroke_stone_200: "stroke-stone-200",
stroke_stone_300: "stroke-stone-300",
stroke_stone_400: "stroke-stone-400",
stroke_stone_50: "stroke-stone-50",
stroke_stone... | Rust | 0 |
import string
class TOMLChar(str):
def __init__(self, c):
super().__init__()
if len(self) > 1:
raise ValueError("A TOML character must be of length 1")
BARE = string.ascii_letters + string.digits + "-_"
KV = "= \t"
NUMBER = string.digits + "+-_.e"
SPACES = " \t"
N... | Python | 1 |
rs[idx_last_layer+1:]
last_layer = self.layers[idx_last_layer]
self._send_messages_through_layers(forward_layers, last_layer)
# Backward
backward_layers = reversed(self.layers[idx_last_layer:])
self._send_messages_through_layers(backward_layers)
def _send... | Python | 1 |
t_output_device()`
pub fn with_device(self, device: rodio::Device) -> Self {
AmbisonicBuilder {
device: Some(device),
..self
}
}
/// Set sample rate fo the ambisonic mix
pub fn with_sample_rate(self, sample_rate: u32) -> Self {
AmbisonicBuilder {
... | Rust | 0 |
SETS_DIR" in os.environ
else Path.home() / ".neuralk" / "datasets"
)
base_dir.mkdir(parents=True, exist_ok=True)
return base_dir
def load_json(path: Path):
"""
Load a JSON file if it exists, otherwise return None.
Parameters:
- path: Path to the JSON file
Returns:
- The l... | Python | 1 |
'"+path+"' DELIMITER '"+sep+"' CSV "+header+" NULL '';"
def __add_b_tree__(name:str, columns:str,index_name="index")->str:
return "CREATE INDEX "+index_name+"_"+name+" ON "+name+" ("+columns+");"
def __execute_query_strata__(name:str,operator:str,num:int,range_sql:str):
return "select "+operator+"(agg_count) ... | Python | 1 |
# Crie uma frase qualquer e diga se ela é um palíndromo,
# desconsiderando os espaços e acentos (Mas você vai digitar com espaços)
# Palíndromo é aquela frase que você pode ler de trás pra frente e de frente pra trás,
# que vai dar na mesma.
# ex:
# APOS A SOPA
# A SACADA DA CASA
# A TORRE DA DERROTA
# O LOBO AMA O BOL... | Python | 1 |
let s = s.to_string();
if s.len() % 2 == 1 {
return Err(anyhow::anyhow!("Hex is invalid!"));
}
let mut bytes = vec![];
for i in 0..(s.len() / 2) {
let res = u8::from_str_radix(&s[2 * i..2 * i + 2], 16)?;
bytes.push(res);
}
Ok(Proof... | Rust | 0 |
import logging
from injector import inject, singleton
from llama_index.core.storage.docstore import BaseDocumentStore, SimpleDocumentStore
from llama_index.core.storage.index_store import SimpleIndexStore
from llama_index.core.storage.index_store.types import BaseIndexStore
from private_gpt.paths import local_data_pa... | Python | 1 |
import os.path
from ..base_test_case import BaseTestCase
from ..test_utils import get_modules_and_packages
from pyt.core.project_handler import get_directory_modules
class NestedTest(BaseTestCase):
def test_nested_user_defined_function_calls(self):
path = os.path.normpath('examples/nested_functions_cod... | Python | 1 |
_frames_in_flight(frames)
.build(&mut factory, &mut families, &scene)
.unwrap();
let icosphere = genmesh::generators::IcoSphere::subdivide(4);
let indices: Vec<_> = genmesh::Vertices::vertices(icosphere.indexed_polygon_iter())
.map(|i| i as u32)
.collect();
let vertices: Vec... | Rust | 0 |
this = self.clone();
let lossf = lossf.clone();
let sender = sender.clone();
busy_threads += 1;
let mut samples = Vec::with_capacity(chunk_width);
samples.push(s);
let mut count = 1;
if count < chunk_width {
while let Some(s) = it.next() {
samples.push(s);
... | Rust | 0 |
import numpy as np
import csv
import joblib
AUDIO_FILENAME = "/test/S01_U04.CH4.wav"
FRAME_HOP_SECONDS = 0.01
FEATURES_FILE = "test_features.npy"
MODEL_PATH = "least_squares_model.pkl"
SCALER_PATH = "scaler.pkl"
OUTPUT_CSV = "segments_output_least_squares.csv"
def load_data(features_path, scaler_path):
X = np.lo... | Python | 1 |
(test)]
async fn launch_and_run_test_with_custom_args() {
let test_url =
"fuchsia-pkg://fuchsia.com/gtest-runner-example-tests#meta/test_with_custom_args.cm";
let events = run_test(
test_url,
TestRunOptions {
disabled_tests: DisabledTestHandling::Exclude,
paralle... | Rust | 0 |
tance, if a [`TimeoutGuard`] cannot restore the original timeout
/// in its Drop implementation, rather than panicking (which would almost
/// certainly cause the program to abort rather than unwind the stack) it
/// can poison the port.
poison: Option<io::Error>,
/// The builder used to concatenate... | Rust | 0 |
Hours(ChargeMetric),
Days(ChargeMetric),
Weeks(ChargeMetric),
Bytes(ChargeMetric),
KiloBytes(ChargeMetric),
MegaBytes(ChargeMetric),
GigaBytes(ChargeMetric),
TeraBytes(ChargeMetric),
PetaBytes(ChargeMetric),
}
impl ChargeUnits {
pub fn scale(&self) -> Decimal {
match se... | Rust | 0 |
onsider each of the retained combinations.
smiles_to_consider = set([])
for atom_config_options in all_atom_config_options:
# Make a copy of the original RDKit molecule.
a_rd_mol = copy.copy(mol.rdkit_mol)
# a_rd_mol = Chem.MolFromSmiles(mol.smiles())
for bond_idx, direc in zip(... | Python | 1 |
with open("text.txt", "r") as dosya:
dosya.seek(6)
print(dosya.read())
dosya.seek(0)
str = dosya.read(5) # 5 karakter oku
print(str)
| Python | 1 |
/// in the meantime.
#[cfg(any(feature = "v1_24", feature = "dox"))]
pub fn get_permissions_state(&self) -> Ternary {
unsafe {
from_glib(nm_sys::nm_client_get_permissions_state(
self.to_glib_none().0,
))
}
}
/// Gets the `ActiveConnection` corres... | Rust | 0 |
String,
addr: *mut u8,
len: usize,
num_rx_queues: u16,
num_tx_queues: u16,
rx_queues: Vec<IxgbeRxQueue>,
tx_queues: Vec<IxgbeTxQueue>,
}
struct IxgbeRxQueue {
descriptors: *mut ixgbe_adv_rx_desc,
num_descriptors: usize,
bufs_in_use: Vec<*mut packet::Packet>,
rx_index: usize,
}
... | Rust | 0 |
;
}
if number % 5 == 0 {
raindrops.push_str("Plang");
}
if number % 7 == 0 {
raindrops.push_str("Plong");
}
if raindrops.len() == 0 {
return number.to_string();
}
raindrops
}#![allow(clippy::type_complexity, clippy::too_many_arguments)]
pub mod ecs;
pub mod se... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.