text string | label_name string | labels int64 |
|---|---|---|
mensions["k"], algorithm="brute"
).fit(local_dpt_X_train)
batch_model = NearestNeighbors_Batch(
n_neighbors=dimensions["k"], algorithm="brute"
).fit(X_train)
spmd_dists, spmd_indcs = spmd_model.kneighbors(local_dpt_X_train)
batch_dists, batch_indcs = batch_model.kneighbors(X_train)
tol ... | Python | 1 |
}
STROKE_COUNT => stroke_counts.push(text?.parse()?),
FREQ => freq = Some(text?.parse()?),
JLPT => old_jlpt = Some(text?.parse()?),
_ => {}
}
}
let stroke_count = stroke_counts
.first()
.ok_or(XmlError::MissingTag(STROKE_COUNT.to_owned... | Rust | 0 |
5: u32 = 261;
pub const ASVL_PAF_RGB16_R5G5B5: u32 = 262;
pub const ASVL_PAF_RGB16_R4G4B4: u32 = 263;
pub const ASVL_PAF_RGB24_B8G8R8: u32 = 513;
pub const ASVL_PAF_RGB24_B6G6R6: u32 = 514;
pub const ASVL_PAF_RGB24_B6G6R6T: u32 = 515;
pub const ASVL_PAF_RGB24_R8G8B8: u32 = 516;
pub const ASVL_PAF_RGB24_R6G6B6: u32 = 51... | Rust | 0 |
),
None => RuleResult::Failed,
}
}
}
impl ParseLiteral for str {
fn parse_string_literal(&self, pos: usize, literal: &str) -> RuleResult<()> {
let l = literal.len();
if self.len() >= pos + l && &self.as_bytes()[pos..pos + l] == literal.as_bytes() {
RuleResult::Ma... | Rust | 0 |
ld: float = 0.3):
"""
Initialize scene detector
Args:
threshold: Scene change threshold
"""
self.threshold = threshold
self.previous_frame = None
self.scene_history = deque(maxlen=100)
def detect_scene_change(self, frame: np.ndarray) ... | Python | 1 |
.time_to_expiration()
}
<reponame>der0pa/jekyll-now
fn main() {
println!("Hello, world!");
another_function(5, 6);
let z = plus_one(41);
println!("The value of z is: {}", z);
let a = [10,20,30,40,50];
let mut index = 0;
while index < 5 {
println!("a[index] is {}", a[index]);
... | Rust | 0 |
st_add_script, cfg => CONFIG_1,
| cfg: ChildPath, mut cmd: Command | {
cmd.args(&["add", r#"echo test_3"#, "-a", "test_cmd_3", "-d", "Test Description."]);
cmd.assert().success();
cfg.assert(contains(trim!(r#"
[scripts.test_cmd_3]
alias = 'test_cmd_3'
command = 'echo test_3'
... | Rust | 0 |
Adjuster {
_inner: *mut Fl_Adjuster,
}
/// Creates an adjuster widget
#[derive(WidgetExt, ValuatorExt, Debug)]
pub struct ValueInput {
_inner: *mut Fl_Value_Input,
}
<reponame>t0037799/AgileInfer
use crate::{
c_api::TVMTensor,
model::{Op, OpArg},
pod_de::{self, PodType},
};
use libloading::Library;... | Rust | 0 |
1)
err = sbc_compare_pcm(subband_frame_count, actual_frame, expected_frame)
if err < 0:
print("Frame %d: PCMs differ %f \n%s\n%s" % (subband_frame_count, max_error, actual_frame.pcm, expected_frame.pcm))
sys.exit(1)
... | Python | 1 |
}
}
/// Token supported in zkSync protocol
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
pub struct Token {
/// id used for tx signature and serialization
pub id: TokenId,
/// Contract address of ERC20 token or Address::zero() for "ETH"
pub address: Address,
/// Token symbol (e.g. ... | Rust | 0 |
rd_buffer[9],
rd_buffer[10],
]),
humidity: f32::from_be_bytes([
rd_buffer[12],
rd_buffer[13],
rd_buffer[15],
rd_buffer[16],
]),
};
Ok(sensor_data)
}
pub fn activate_auto_sel... | Rust | 0 |
TL3_CTM_HALWAYS,
#[doc = "Hysteresis Once"]
ADC_DCCTL3_CTM_HONCE,
}
impl ADC_DCCTL3_CTMW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> u8 {
match *self {
ADC_DCCTL3_CTMW::ADC_DCCTL3_CTM_ALWAYS => 0,
ADC_DCCTL3_CTMW::ADC_DCCTL3_CT... | Rust | 0 |
RTIES_IFACE)
state = props.Get(network.NM_ACTIVE_CONN_IFACE, 'State')
if state == network.NM_ACTIVE_CONNECTION_STATE_ACTIVATED:
access_point_o = props.Get(network.NM_ACTIVE_CONN_IFACE,
'SpecificObject')
if access_point_o ... | Python | 1 |
o(f"✅ Revenue projections created")
logger.info(f"💰 Current ARR: ${revenue_projections['current_metrics']['annual_run_rate']:,}")
logger.info(f"🎯 Year 1 Target ARR: ${revenue_projections['growth_projections']['year_1_target']['target_arr']:,}")
logger.info(f"🚀 Year 2 Target ARR: ${revenue_pro... | Python | 1 |
(self.pc_range[5] - self.pc_range[2]) + self.pc_range[2])
# record the query features for the next frame
# pick the results from the last decoder
last_query_feats = outs_dec[-1]
outs = {
'all_cls_scores': all_cls_scores,
'all_bbox_preds': all_bbox_preds,
... | Python | 1 |
aterial", base::node::MAIN_PASS)
.unwrap();
commands.spawn_bundle(PerspectiveCameraBundle {
transform: Transform::from_xyz(0.0, 0.0, -8.0).looking_at(Vec3::ZERO, Vec3::Y),
..Default::default()
});
}
fn draw_fire(
mut commands: Commands,
fire_pipeline: Res<FirePipeline>,
mut... | Rust | 0 |
rge_factor_file() -> Result<()> {
let cli = cli!("config")?;
let mut proto = mock!(file "factor = 'B'" => "config");
assert_eq!(proto.factor(&cli.subcommand_matches("config").unwrap()), 1);
Ok(())
}
}
#[doc = "Register `INTERP0_CTRL_LANE1` reader"]
pub struct R(crate::R<INTERP0_CTRL... | Rust | 0 |
))
}
}
fn ty_check_literal(ty_ctx: TyCtx, l: &mut Lit) -> (TyCtx, Ty) {
let scalar_data = match l {
Lit::Unit => ScalarTy::Unit,
Lit::Bool(_) => ScalarTy::Bool,
Lit::I32(_) => ScalarTy::I32,
Lit::U32(_) => ScalarTy::U32,
Lit::F32(... | Rust | 0 |
translations": [
"doctor",
"court academician (in feudal China)",
"Ph.D."
]
},
{
"id": 626,
"hanzi": "不但",
"pinyin": "bù dàn",
"translations": [
"not only (... but also...)"
]
},
{
"id": 627,
"hanzi": "不过",
"pinyin": "bù guò",
"translations": [
... | Python | 1 |
fn set_metadata<P: AsRef<Path>>(&self, path: P, metadata: Self::Metadata) -> Result<()>;
}
pub trait UnixFileSystem {
/// Returns the current mode bits of `path`.
///
/// # Errors
///
/// * `path` does not exist.
/// * Current user has insufficient permissions.
fn mode<P: AsRef<Path>>(&... | Rust | 0 |
Ok(())
})?;
let rhs = self.parse_expr(&span, rhs)?;
let lhs = self.push_tuple_pattern(&span, false, lhs)?;
macro_rules! get_intrinsic {($f:ident) => {
if intrinsic {
if let Some((_, name, _)) = lhs.k.as_single_name() {
Some(get_intrinsic(&lhs.span, name, $f::from_sy... | Rust | 0 |
env;
// Rust 1.16.0
pub mod error;
// Rust 1.16.0
pub mod ffi;
// Rust 1.16.0 (no tests)
pub mod fs;
// Rust 1.16.0 (no tests, mostly, not the submodules `lazy`, `stdio`)
pub mod io;
// Rust 1.16.0 (no tests, missing `lookup_host` and friends)
pub mod net;
// Rust 1.16.0
pub mod num;
// Rust 1.16.0 (no tests)
pub mod ... | Rust | 0 |
# Copyright (C) 2018-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.mo.front.common.replacement import FrontReplacementOp
from openvino.tools.mo.graph.graph import Node, Graph, rename_nodes
from openvino.tools.mo.ops.broadcast import Broadcast
from openvino.tools.m... | Python | 1 |
"size": "small"
},
"text": "mdi-information"
},
{
"compon... | Python | 1 |
# routes/intents.py
"""
意图管理相关路由
处理用户意图的创建、读取、更新、删除等操作
"""
from fastapi import APIRouter, HTTPException, Depends, status
from pydantic import BaseModel
from typing import Optional
import logging
import json
import sqlite3
from .auth import verify_user_token, get_query_user_id
logger = logging.getLogger(__name__)
rou... | Python | 1 |
reset_time = time.time() + 60 # Default value
try:
if e.body and "error" in e.body: # type: ignore[operator]
headers = e.body["error"].get("metadata", {}).get("headers", {}) # type: ignore[index]
reset_header = headers.get("X-RateLimit-Reset")
... | Python | 1 |
::Sha512;
use protobuf;
use protobuf::Message;
use dgc_contract_sdk::protocol::payload::{Action, SmartPayload};
use dgc_contract_sdk::protocol::ADMINISTRATORS_SETTING_ADDRESS;
use dgc_contract_sdk::protos::IntoBytes;
use sawtooth_sdk::messages::batch::Batch;
use sawtooth_sdk::messages::batch::BatchHeader;
use sawtooth_... | Rust | 0 |
import logging
from aiogram import Bot
from utils.db.alchemy import get_admins
from data.config import ADMIN
async def on_startup_notify(bot: Bot):
admins_list = get_admins()
admins_list.append(ADMIN)
print(admins_list)
for admin in admins_list:
try:
bot_properties = await bot.me... | Python | 1 |
request = request.header(reqwest::header::USER_AGENT, "Discordeno Issue Creation Bot");
request = request.header(
reqwest::header::AUTHORIZATION,
format!("token {}", env::var("GITHUB_ACCESS_TOKEN").unwrap()),
);
request
}
if let Ok(client) = reqwest::Cli... | Rust | 0 |
pe.INTEGER),
(ov.Type.u1, Dtype.INTEGER),
(ov.Type.u4, Dtype.INTEGER),
(ov.Type.u8, Dtype.INTEGER),
(ov.Type.u16, Dtype.INTEGER),
(ov.Type.u32, Dtype.INTEGER),
(ov.Type.u64, Dtype.INTEGER),
(ov.Type.boolean, Dtype.INTEGER),
(ov.Type.string, Dtype.INTEGER),... | Python | 1 |
from fastapi import APIRouter, HTTPException, HTTPException
from pydantic import BaseModel
from core import organization
router = APIRouter(prefix="/org")
class OrgCreateRequest(BaseModel):
org_name: str
creator_email: str
@router.post("", response_model=int)
def create_org(request: OrgCreateRequest):
... | Python | 1 |
viceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
pub struct CM_NOTIFY_FILTER_0_0 {
pub hTarget: super::super::Foundation::HANDLE,
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::marker::Copy for CM_NOTIFY_FILTER_0_0 {}
#[cfg(feature = "Win32_Foundation")]
impl ::core:... | Rust | 0 |
ty::Foreign(defid) => self.codegen_foreign(ty, *defid),
ty::Array(et, len) => {
let array_name = format!(
"[{}; {}]",
self.ty_mangled_name(*et),
len.try_eval_usize(self.tcx, self.param_env()).unwrap()
);
... | Rust | 0 |
), Position::new(75.0, 40.0));
context.close_path();
context.set_fill_style(EnvironmentColor::Accent);
context.fill();
context
}
<gh_stars>0
use std::fmt::{Display, Formatter};
use std::mem::discriminant;
use enum_iterator::IntoEnumIterator;
use crate::parsing::NonterminalSymbol;
use crate::lua::synt... | Rust | 0 |
nt changes are made.
// https://substrate.dev/docs/en/knowledgebase/runtime/events
decl_event!(
pub enum Event<T>
where
AccountId = <T as frame_system::Trait>::AccountId,
{
/// A data string was set. \[who\]
DataStringSet(AccountId),
/// A data string was changed. \[who\]
DataStringChanged(AccountId),
}... | Rust | 0 |
Self::new()
}
}
#[cfg(test)]
mod tests {
use super::*;
use dns_parser::Class;
use std::net::Ipv4Addr;
#[test]
fn add_should_shorten_the_name() {
let mut attrs = DeviceAttributes::default();
attrs.add(&mk_txt_record(
"eWeLink_ababababab._ewelink._tcp.local",
... | Rust | 0 |
_while` will consume that first item for which the
//! predicate returns `false`, and it will be lost.
//!
//! ```
//! extern crate peeking_take_while;
//!
//! // Bring the `peeking_take_while` method for peekable iterators into
//! // scope.
//! use peeking_take_while::PeekableExt;
//!
//! # fn main() {
//! // Let's s... | Rust | 0 |
Command::new(which("cross").unwrap_or(cargo))
};
if let Some(hash) = get_git_hash() {
command.env("GIT_HASH", hash);
}
if let Ok(rustflags) = var("RUSTFLAGS") {
if !rustflags.contains("-Ctarget-feature") && !rustflags.contains("-C target-feature") {
command.env(
... | Rust | 0 |
rocessed string).
Args:
bytes_list (List[int]): 输入的字节列表 (Input byte list).
Returns:
str: 处理后的字符串 (Processed string).
"""
# 将字节列表转换为字符字符串
bytes_str = StringProcessor.to_char_str(bytes_list)
result_str = []
index_b = self.big_array[1]
... | Python | 1 |
#Imports
import pygame, sys, random
#A comment right here
def ball_animation():
global ball_speed_x, ball_speed_y
ball.x += ball_speed_x
ball.y += ball_speed_y
if ball.top <= 0 or ball.bottom >= screen_height:
ball_speed_y *= -1
if ball.left <= 0 or ball.right >= screen_width:
b... | Python | 1 |
lback::{EitherError, FallbackSurface};
#[cfg(any(feature = "backend_drm_atomic", feature = "backend_drm_legacy"))]
use crate::backend::drm::common::Error as DrmError;
#[cfg(feature = "backend_drm_legacy")]
use crate::backend::drm::legacy::LegacyDrmSurface;
use crate::backend::drm::{Device, RawDevice, RawSurface, Surfac... | Rust | 0 |
, 0f64, 1f64],
],
Self::IsotropicScale { factor } => [
[*factor, 0f64, 0f64],
[0f64, *factor, 0f64],
[0f64, 0f64, 1f64],
],
Self::ReflectionX => [[-1f64, 0f64, 0f64], [0f64, 1f64, 0f64], [0f64, 0f64, 1f64]],
Self... | Rust | 0 |
# Copyright 2024-2025 ModelCloud.ai
# Copyright 2024-2025 qubitium@modelcloud.ai
# Contact: qubitium@modelcloud.ai, x.com/qubitium
#
# 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... | Python | 1 |
6, 14),
// Rows 13 and 14.
(7, 1),
(7, 2),
(7, 3),
(7, 4),
(7, 5),
(7, 6),
(7, 7),
(7, 8),
(7, 12),
// Rows 15 and 16.
(8, 0),
(8, 1),
(8, 2),
(8, 3),
(8, 4),
(8, 5),
// Rows 1... | Rust | 0 |
;
use crate::semantic::element::r#type::function::stdlib::convert_from_bits_field::Function as ConvertFromBitsFieldFunction;
use crate::semantic::element::r#type::function::stdlib::convert_from_bits_signed::Function as ConvertFromBitsSignedFunction;
use crate::semantic::element::r#type::function::stdlib::convert_from_b... | Rust | 0 |
LL_KNOWN_SID_TYPE = 78i32;
#[doc = "*Required features: `\"Win32_Security\"`*"]
pub const WinMediumPlusLabelSid: WELL_KNOWN_SID_TYPE = 79i32;
#[doc = "*Required features: `\"Win32_Security\"`*"]
pub const WinLocalLogonSid: WELL_KNOWN_SID_TYPE = 80i32;
#[doc = "*Required features: `\"Win32_Security\"`*"]
pub const WinCo... | Rust | 0 |
def get_cost(stack, target):
return abs(stack - target)
def find_cheapest_move(stacks, costs):
min_cost = float('inf')
move = None
for i in range(len(stacks)):
for j in range(len(stacks)):
if i != j and (not stacks[i] or stacks[i][-1] == stacks[j][-1]):
cost = get_c... | Python | 1 |
import sys
import time
import pygame
from database.queries import update_battle_stats
from game_logic.generate_maze import grid_cells, Wall
from game_logic.bot_tank import build_graph, BotTank
from launcher import switch_screen
from screens.menu import Button, menu
from game_logic.tank import Tank, are_positions_collid... | Python | 1 |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
import os
picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
sys.path.append(libdir)
import logging
from ... | Python | 1 |
lang = config.default_language.clone();
library.insert_page(page3);
let mut page4 = Page::default();
let mut taxo_page4 = HashMap::new();
taxo_page4.insert("test-taxonomy".to_string(), vec!["école".to_string()]);
page4.meta.taxonomies = taxo_page4;
page4.lang = config.de... | Rust | 0 |
_curve: true },
],
],
components: vec![],
instructions: vec![],
overlap: false // There is, though.
});
/*
<TTGlyph name="Aacute" xMin="5" yMin="0" xMax="751" yMax="915">
<component glyphName="A" x="0" y="0" flags="0x4"/>... | Rust | 0 |
rom_file(file: File, flock_op: libc::c_int) -> IoResult<Self> {
loop {
let rc = unsafe { libc::flock(file.as_raw_fd(), flock_op) };
if rc == 0 {
break;
}
let err = IoError::last_os_error();
// If our wait was interrupted, try to acquir... | Rust | 0 |
(()BCCPQ**+>??EF @# #5>r: thresholdc : U R U R - U: $ )Nr r )r5 r s r6 r Measurement.meets_confidence xx$++% 11r: c . U R R $ ... | Python | 1 |
;
Ok(ApiResult::success(()))
}
/// Mendapatkan data akun.
#[api_endpoint(path = "/user/info", accessor = "admin", auth = "required")]
pub fn user_info(query: IdQuery) -> ApiResult<db::User> {
let conn = state.db();
let dao = UserDao::new(&conn);
dao.get_by_id(query.id)
... | Rust | 0 |
(5) {
return Err(Error::Message("invalid length for CharacterVariable"));
}
d.u8()?;
let curendurance = d.i8()?;
let flags = Flags(d.u32()?);
let cequipment = d.decode()?;
let cprevequipment = d.decode()?;
Ok(CharacterVariable {
curendurance,
flags,
cequipment,
... | Rust | 0 |
import heapq
from collections import defaultdict
class Solution:
def mostBooked(self, n: int, meetings: List[List[int]]) -> int:
meetings.sort() # Sort meetings by start time
available = list(range(n)) # All rooms initially available
heapq.heapify(available)
busy = [] # (end_ti... | Python | 1 |
is_playable=True,
)]
if channel_data and channel_data.get('epg'):
listing.append(
kodiutils.TitleItem(
title=kodiutils.localize(30053, channel=title), # TV Guide for {channel}
path=kodiutils.url_for('show_tvguide_channel', ch... | Python | 1 |
::min_value() {
panic!("attempt to {} with underflow", stringify!($method));
}
res
}
}
};
}
forward_op! { impl Add for Int256 { fn add } }
forward_checked_op! { impl CheckedAdd for Int256 { fn checked_add } }
forward_assign_op! { impl AddAssi... | Rust | 0 |
85',
'\u2985'), ('\u2987', '\u2987'), ('\u2989', '\u2989'), ('\u298b', '\u298b'), ('\u298d',
'\u298d'), ('\u298f', '\u298f'), ('\u2991', '\u2991'), ('\u2993', '\u2993'), ('\u2995',
'\u2995'), ('\u2997', '\u2997'), ('\u29d8', '\u29d8'), ('\u29da', '\u29da'), ('\u29fc',
'\u29fc'), ('\u2e22... | Rust | 0 |
import json
import os
import platform
from pathlib import Path
from jinja2 import Template
_HERE = Path(__file__).parent
config_template = _HERE / "claude_desktop_config.json"
def generate_claude_config():
# Get current working directory
pwd = Path.cwd().resolve().as_posix()
# Read the template config
... | Python | 1 |
("error listing: {}", e)),
);
match r_sessions.wait().unwrap() {
Ok(sessions) => {
let body = serde_json::to_string(&sessions).unwrap();
(state, hyper::Response::new(hyper::Body::from(body)))
}
Err(e) => {
log::warn!("error retrieving sessions: {}", e... | Rust | 0 |
rror) => return Err(Error::Ping),
};
match self.socket.readln() {
Ok(data) => Ok(data),
Err(_error) => Err(Error::Ping),
}
}
#[cfg(test)]
pub fn exit(&mut self) -> Result<(), Error> {
match self.socket.write("EXIT\r\n") {
Ok(_size) => Ok((... | Rust | 0 |
`bio pkg build` run, but from
/// the `VERSION` file in a plain `cargo build` run.
fn version() -> String { env::var("PLAN_VERSION").unwrap_or_else(|_| read_common_version()) }
/// Reads the contents of the `VERSION` file at the repository root.
fn read_common_version() -> String {
let version_... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. 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 requir... | Python | 1 |
mb_blob_to_collation_body -- --ignored -> mb_blob_to_collation_body.log
let blob = Blob::new(vec![1; DATA_BYTES_PER_COLLATION]);
// let mut blob_as_chunks = blob.to_chunks();
let sample_body = blob.blob_to_collation_body();
/* let sample_chunk = Chunk::new(0, [0; 31]);
let samp... | Rust | 0 |
from backend.data.models import AllCoins
from backend.utils.scrappers import BaseScrapper, scrap_website_soup
import logging
logger = logging.getLogger(__name__)
class Coinranking(BaseScrapper):
def run(self):
scrap_config = self.config.scrappers[self.name]
if not scrap_config["enabled"]:
... | Python | 1 |
DerefMut;
static GPIO: Mutex<RefCell<Option<GPIOTE>>> = Mutex::new(RefCell::new(None));
static TX: Mutex<RefCell<Option<serial::Tx<UART0>>>> = Mutex::new(RefCell::new(None));
static MAG3110: Mutex<RefCell<Option<Mag3110<I2c<TWI1>>>>> = Mutex::new(RefCell::new(None));
#[entry]
fn main() -> ! {
if let Some(p) = mic... | Rust | 0 |
onitor = Mock()
app.current_monitor.x = 0
app.current_monitor.y = 0
app.window_width = 1920
app.window_height = 1080
test_coords = [(50, 75), (500, 300), (1000, 800)]
for x, y in test_coords:
adjusted = app.adjust_mouse_coordinates(x, y)
assert a... | Python | 1 |
edDump(ip,domain,username,password,passwordHash)
for x in results:
x=x.strip()
if len(x)>0:
tmpResultList.append([ip,x])
if len(tmpResultList)>0:
print (setColor("\nSearch Drives for PAN Numbers", bold, color="green"))
print tabulate(tmpResultList,tablefmt="simple")
'''
for x... | Python | 1 |
000000 {
// Ensure that r * (a + b + c) = r*a + r*b + r*c
let r = Fr::random(&mut rng);
let mut a = Fr::random(&mut rng);
let mut b = Fr::random(&mut rng);
let mut c = Fr::random(&mut rng);
let mut tmp1 = a;
tmp1.add_assign(&b);
... | Rust | 0 |
tr), &parsed_data, type_, key) {
Ok(state_proof) => {
trace!("TransactionHandler::_parse_reply_for_sp: proof: {:?}", state_proof);
state_proofs.push(state_proof)
}
Err(err) => {
trace!("TransactionHandler::_parse_reply_for_sp: <<< {:?}", err);
ret... | Rust | 0 |
quest RPC.
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Response {
pub request: Request,
pub receiver: NodeData,
pub payload: ResponsePayload,
}
/// An enum representing the payload to a response RPC.
///
/// As stated in the Kademlia paper, a response to a request could be a list of nodes, a... | Rust | 0 |
IOINI (CONFIG0 \\[10\\]).If CIOINI is set to 0, the default value is 0xFFFF_FFFF and all pins will be quasi-bidirectional mode after chip powered on.If CIOINI is set to 1, the default value is 0x0000_0000 and all pins will be input mode after chip powered on.\nNote 2: \nThe PC.15/PF.12~13/PG.0~1,5~8/PH.0~3,12~15 pin is... | Rust | 0 |
#! /usr/bin/env python3
import actionlib
import actionlib.msg
from rosplan_dispatch_msgs.srv import DispatchService, DispatchServiceRequest, DispatchServiceResponse
from std_srvs.srv import Empty # Add this import
import rospy
from tf import transformations
from rosplan_dispatch_msgs.srv import DispatchServiceRequest
... | Python | 1 |
essage {
DiscoverService(Result<raw::ble_gattc_service_t, DiscoverError>),
DiscoverCharacteristics(Result<Vec<raw::ble_gattc_char_t, DiscCharsMax>, DiscoverError>),
DiscoverDescriptors(Result<Vec<raw::ble_gattc_desc_t, DiscDescsMax>, DiscoverError>),
Disconnected,
}
pub(crate) async fn discover_service... | Rust | 0 |
#!/usr/bin/env python
from scipy import *
def Create_kpath(KPoints,nk_band):
def dist(a,b): return sqrt(sum((array(a)-array(b))**2))
# returns the distance of given a and b points
#print KKPoints
path_len=[]
for i in range(len(KPoints)-1):
path_len.append(dist(KPoints[i+1],KPoints[i]))
#path_le... | Python | 1 |
so the CAN FD CAN Bit Timing Register (CAN_FDCBT).
// // Initialize the Message Buffers
// // Initialize the Rx Individual Mask Registers (CAN_RXIMRn)
// // Set required interrupt mask bits in the CAN_IMASK Registers (for all MB interrupts) and in CAN_CTRL1 / CAN_CTRL2 Registers (for Bus Off and Error inter... | Rust | 0 |
, "grandfather", "Goedele"))
# ===== Reason why =====
print("\nReason why")
print("----------")
print("1) Fixed projection in children(): we now return the OBJECT (child) of parent facts.")
print("2) Sibling rule remains permissive (x may equal y), but 'uncle-blood' and 'aunt-blood'")
print(" ... | Python | 1 |
assert_almost_equal(np.abs(Xt_pca), np.abs(Xt_ipca), decimal=prec)
Xinv_ipca = ipca.inverse_transform(Xt_ipca)
Xinv_pca = pca.inverse_transform(Xt_pca)
assert_almost_equal(X, Xinv_ipca, decimal=prec)
assert_almost_equal(X, Xinv_pca, decimal=prec)
assert_almost_equal(Xinv_pca, Xi... | Python | 1 |
if file >= File::NUM_FILES {
return Err(FenError::TooManySquares(Rank::from_idx(rank)));
}
match c {
b'1'..=b'8' => {
file += (c - b'0') as usize;
}
_ => {
... | Rust | 0 |
"""
Gregory Way 2017
PanCancer Classifier
scripts/copy_burden_merge.py
Merge per sample classifier scores with segment based scores
Usage: Run in command line with required command argument:
python scripts/copy_burden_merge.py --classifier_folder
classifier_folder is a string pointing to the location of the... | Python | 1 |
{
is_utf8("LC_ALL")
.or_else(|| is_utf8("LC_CTYPE"))
.or_else(|| is_utf8("LANG"))
.unwrap_or(false)
}
}
use std::io::BufRead;
use chrono::{DateTime, Utc};
use mime::Mime;
use crate::model::{Category, Content, Entry, Feed, FeedType, Generator, Image, Link, MediaContent, MediaObject, Person, T... | Rust | 0 |
def jimin(far):
print((far-32)*(5/9))
f = int(input())
jimin(f)
| Python | 1 |
isize)).ele1).clone() };
let val = unsafe { ((*result.data.offset(x as isize)).ele2).clone() };
let vec: Vec<i32> = (0..val.len)
.into_iter()
.map(|y| unsafe { *val.data.offset(y as isize) })
.collect();
((key.ele1, key.ele2), vec)
... | Rust | 0 |
ocal position = {
x = x,
y = alt,
z = y,
}
local wind = Weather.getGroundWindAtPoint({
position = position
})
local temp, pressure = Weather.getTemperatureAndPressureAtPoint({
position = position
})
return {
... | Rust | 0 |
#!/usr/bin/env python
import rospy
import sys
from sensor_msgs.msg import LaserScan
import math
def callback(msg):
front = msg.ranges[0]
angle = math.atan (0.5/front)
min_angle = (msg.angle_min)
ang_not_used = abs(round((min_angle -(-angle) )/ msg.angle_increment))
ang_used = a... | Python | 1 |
}
_ => self.docs.alloc(doc),
})
}
fn alloc_column_fn(
&'a self,
f: impl Fn(usize) -> Self::Doc + 'a,
) -> <Self::Doc as DocPtr<'a, A>>::ColumnFn {
self.alloc_any(f)
}
fn alloc_width_fn(
&'a self,
f: impl Fn(isize) -> Self::Doc + 'a,
)... | Rust | 0 |
class Solution:
def deleteDuplicates(self, head: ListNode) -> ListNode:
curr = head
while curr:
while curr.next and curr.val == curr.next.val:
curr.next = curr.next.next
curr = curr.next
return head
| Python | 1 |
//! between two elements of the same set.
//!
//! This can be used to represent graphs (an edge between point A and B).
//! It can also be used to represent associations (group A should have physical collisions enabled
//! with group A and group B).
//!
//! ## Internal Representation
//! ```ignore
//! ABCD
//! A-
//... | Rust | 0 |
"""
python3 -m sglang.launch_server --model-path meta-llama/Llama-2-7b-chat-hf --port 30000
"""
import json
import unittest
from sglang.test.test_programs import (
test_decode_int,
test_decode_json_regex,
test_expert_answer,
test_few_shot_qa,
test_mt_bench,
test_parallel_decoding,
test_par... | Python | 1 |
import RPi.GPIO as GPIO
import logging
from application_layer.alarm_pi.alarm_config import AlarmConfig
class Alarm:
"""
@brief A class to control an alarm system using a relay.
"""
def __init__(self):
"""
@brief Initializes the Alarm class.
@param relay_pin The GPIO pin connec... | Python | 1 |
GS_INPUT_REGISTER_COMPONENT_BIT_COUNT: u32 = 32u32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
pub const D3D10_GS_INPUT_REGISTER_COUNT: u32 = 16u32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D10\"`*"]
pub const D3D10_GS_INPUT_REGISTER_READS_PER_INST: u32 = 2u32;
#[doc = "*Required featu... | Rust | 0 |
nd val options
opt = TrainOptions().parse()
val_opt = get_val_opt()
# load data
print('load data...')
train_loader = get_loader(opt)
total_step = len(train_loader)
val_loader = get_val_loader(val_opt)
# cuda config
# set the device for training
if opt.gpu_id == '0':
os.... | Python | 1 |
//! The trait is automatically implemented for any type that implements `Iterator`.
//!
//! # Examples
//!
//! ```
//! use collect_slice::CollectSlice;
//!
//! let mut orig = [0; 8];
//! (0..8).map(|i| i * 2).collect_slice_checked(&mut orig[..]);
//! assert_eq!(orig, [0, 2, 4, 6, 8, 10, 12, 14]);
//!
//! let mut buf =... | Rust | 0 |
094d'), # ? -> घ्
('\xb3', '\u0919'), # ³ -> ङ
('pkS', '\u091a\u0948'), # pkS -> चै
('p', '\u091a'), # p -> च
('Pk', '\u091a'), # Pk -> च
('P', '\u091a\u094d'), # P -> च्
('N', '\u091b'), # N -> छ
('t', '\u091c'), # t -> ज
('Tk', '\u091c'), # Tk -> ज
('T', ... | Python | 1 |
= if let Some(num) = parts.get(1) {
num.parse()
.expect(&format!("Unable to parse compression level in {}", num))
} else {
6
};
match str {
&"gzip" => Ok(Compression::GZip(level)),
&"zlib" => Ok(Compression::ZLib(level)),
... | Rust | 0 |
import socket
import network
import machine
import uos
import ujson
SSID = "A"
WIFI_PWD = "manimani"
# compoenets
MICROPHONE_PIN = machine.Pin(32, machine.Pin.IN)
MICROPHONE_PIN = machine.Pin(32, machine.Pin.IN)
SD_CS_PIN = machine.Pin(5, machine.Pin.OUT)
SD_MOSI_PIN = machine.Pin(23, machine.Pin.OUT)
SD_MISO_PIN = ... | Python | 1 |
from queue import PriorityQueue
# Define the city map
city_map = [
['x', 14, 15, 10, 'x', 14, 'x', 'x', 18, 6, 'x', 'x', 4],
[6, 'x', 'x', 'x', 1, 'x', 15, 'x', 'x', 2, 'x', 17, 'x'],
['x', 4, 'x', 17, 3, 14, 4, 2, 'x', 3, 'x', 11, 'x'],
[6, 6, 'x', 19, 'x', 13, 'x', 11, 13, 6, 3, 'x', 'x'],
[3, 1... | Python | 1 |
t duration representing a nanosecond.
pub const NANOSECOND: Duration = Duration::from_nanos(1);
/// Converts a duration into a number of days, rounding down.
#[inline]
pub fn as_days(duration: &Duration) -> u64 {
let secs = duration.as_secs();
secs / SECS_PER_DAY
}
/// Converts a duration into a number of hou... | Rust | 0 |
e_not_found_error.clone();
vm.new_exception(exc_type, format!("No such file or directory: {}", &fname))
}
ErrorKind::PermissionDenied => {
let exc_type = vm.ctx.exceptions.permission_error.clone();
vm.new_exception(exc_type, format!("Permission denied: {}", &fname))
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.