text string | label_name string | labels int64 |
|---|---|---|
es en posiciones
if posicion_anterior == 0:
nueva_posicion = random.randint(5, 20)
else:
# Simular mejoras o cambios realistas
cambio = random.choice([-2, -1, 0, 0, 1, 2, 3]) # Más probabilidad de mejora
nue... | Python | 1 |
_prob);
(merged_log_prob, e_hist)
}
pub(crate) fn merged_and_aligned<'a, Hist: 'a, I>(
hists: I,
merge_points: Vec<usize>,
alignment: Vec<usize>,
log_prob: Vec<Vec<f64>>,
e_hist: Hist
) -> GluedResult<Hist>
where Hist: HistogramCombine + Histogram,
I: Iterator<Item = &'a Hist>
{
// Not... | Rust | 0 |
_ok!(vote(Origin::signed(5), vec![5], 50));
assert_eq!(Elections::candidates(), vec![(5, 3)]);
// a runtime upgrade changes the bond.
CANDIDACY_BOND.with(|v| *v.borrow_mut() = 4);
assert_ok!(submit_candidacy(Origin::signed(4)));
assert_ok!(vote(Origin::signed(4), vec![4], 40));
assert_eq!(Elections:... | Rust | 0 |
fn page_flip(&self, framebuffer: framebuffer::Handle) -> Result<(), EitherError<E1, E2>> {
match self {
FallbackSurface::Preference(dev) => {
RawSurface::page_flip(dev, framebuffer).map_err(EitherError::Either)
}
FallbackSurface::Fallback(dev) => {
... | Rust | 0 |
_subnets_subnet_pool(
&self,
subnets_subnet_pool: crate::models::SubnetsSubnetPool,
subnets_subnet_pool_id: &str,
groupnet: &str,
subnet: &str,
force: bool,
) -> Box<dyn Future<Item = (), Error = Error>>;
}
impl<C: hyper::client::connect::Connect + 'static> NetworkGr... | Rust | 0 |
ocon.tdi_pio0_11.modify(|_, w| w.mode().bits(0x2));
}
},
Timer::Timer1 => match mr {
MatchReg::Reg0 => {
iocon.tdo_pio0_13.modify(|_, w| w.func().bits(0x3));
iocon.tdo_pio0_13.modify(|_, w| w.mode().bits(0x2));
}
MatchReg::R... | Rust | 0 |
"\nYou need a valid certificate to access this page.\n",
);
}
Status::Input(message) => {
dialog::input(&gui, absolute_url, &message);
}
... | Rust | 0 |
t n controls the corresponding BPWM channel n.\nNote: If IMMLDENn is Enabled, WINLDENn and CTRLDn will be invalid.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum IMMLDEN5_A {
#[doc = "0: PERIOD will load to PBUF at the end point of each period. CMPDAT will load to CMPBUF at the end point o... | Rust | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-10 17:17
from __future__ import unicode_literals
from django.db import migrations
# Move project.title into project.root_task.title_override before
# dropping the project.title column if project.title != project.root_task.module.title.
def forwards_func(... | Python | 1 |
r_rx(&self, n: u64) {
self.rx.fetch_add(n as _, Ordering::AcqRel);
}
}
<reponame>Oswfrans/Geoffrey
extern crate gotham;
#[macro_use]
extern crate gotham_derive;
extern crate hyper;
extern crate mime;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate uuid;
ex... | Rust | 0 |
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Value of the field"]
pub struct PWM_2_FLTSTAT1_DCMP1R {
bits: bool,
}
impl ... | Rust | 0 |
ation,
name=name,
planperiod_end=planperiod_end,
planperiod_end_schedule_is_start=planperiod_end_schedule_is_start,
planperiod_start=planperiod_start,
planperiod_start_schedule_is_start=planperiod_start_schedule_is_start,
remark=remark,
... | Python | 1 |
32;
#[doc = "*Required features: `\"Win32_NetworkManagement_WindowsFilteringPlatform\"`*"]
pub const FWP_MATCH_FLAGS_ANY_SET: FWP_MATCH_TYPE = 7i32;
#[doc = "*Required features: `\"Win32_NetworkManagement_WindowsFilteringPlatform\"`*"]
pub const FWP_MATCH_FLAGS_NONE_SET: FWP_MATCH_TYPE = 8i32;
#[doc = "*Required featur... | Rust | 0 |
#!/usr/bin/env python
"""
Example DaVinci Resolve script:
Display project information: timeline, clips within timelines and media pool structure.
"""
from python_get_resolve import GetResolve
def DisplayTimelineTrack( timeline, trackType, displayShift ):
trackCount = timeline.GetTrackCount(trackType)
for index in ... | Python | 1 |
# SPDX-License-Identifier: Apache-2.0.
# Copyright (c) 2024 - 2025 Waldiez and contributors.
"""Build the `waldiez_jupyter` python package."""
import os
import shutil
import subprocess # nosemgrep # nosec
import sys
from pathlib import Path
ROOT_DIR = Path(__file__).parent.parent
def install_dependencies() -> Non... | Python | 1 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 25 11:06:04 2024
@author: n.patsalidis
"""
import numpy as np
from matplotlib import pyplot as plt
import sys
sys.path.append('../main_scripts')
import FF_Develop as ff
from time import perf_counter
L = 10
dx =0.001
if False:
params = np.array([ L,0,1,3,-5,20,-20,-15,... | Python | 1 |
o",
field_choice='{"1":"同意", "2":"不同意"}', workflow=leave_wf)
# 建立初始和结束状态
s1 = State.objects.create(name="开始", order_id=1, state_type=1, is_hidden=True, participant_type='none',
workflow=leave_wf)
s2 = State.objects.create... | Python | 1 |
pub fn apply(&self, conn: &TcpStream) {
if let Some(v) = self.keepalive {
let keepalive_duration = Duration::from_secs(v.keepalive_secs);
let keepalive_interval = Duration::from_secs(v.keepalive_interval);
if let Err(e) = try_set_tcp_keepalive(conn, keepalive_duration, ke... | Rust | 0 |
,
unit: fetch_value::<i32>(&document, InputId::CarSpaceFeeUnit)?.try_into()?,
},
key_change_fee: RentItem {
value: fetch_value::<i32>(&document, InputId::KeyChangeFee)?,
unit: fetch_value::<i32>(&document, InputId::KeyChangeFeeUnit)?.try_into()?,
... | Rust | 0 |
取RSA公钥
fn load_pk_u8s(pk: &[u8]) -> Results<Rsa<Public>> {
match Rsa::public_key_from_pem(pk) {
Ok(key) => Ok(key),
Err(_) => match Rsa::public_key_from_pem_pkcs1(pk) {
Ok(key) => Ok(key),
Err(_) => match Rsa::public_key_from_der(pk) {
Ok(key) => Ok(key),
... | Rust | 0 |
originale
serialized_data = original_instance.serialize()
# Creazione di una nuova istanza della stessa classe
new_instance = StingerForMixBusPlayer(
r"C:\pythonCode\openPyVisionBook\openPyVisionCOMM\mainDir\imgs\testSequence", 1, QSize(1920, 1080))
# D... | Python | 1 |
s.serialize_field(".tag", "path")?;
s.serialize_field("path", x)?;
s.end()
}
CreateSharedLinkError::Other => Err(::serde::ser::Error::custom("cannot serialize 'Other' variant"))
}
}
}
impl ::std::error::Error for CreateSharedLinkError ... | Rust | 0 |
:
logger.warning("未找到rec_paper内的read_syllable节点")
logger.info(f"XML解析完成,总分: {result.overall_score}")
except ET.ParseError as e:
logger.error(f"XML解析失败: {e}")
raise
except Exception as e:
logger.error(f"结果解析过程中发生错误: {e}")
raise... | Python | 1 |
<()> {
let manifest = lal::Manifest::read(&component_dir)?;
lal::status(&component_dir, &manifest, true, true, true)
}
<filename>src/piecewisecubiccurve.rs
use num_traits::one;
use superslice::Ext; // for slice::upper_bound_by()
use crate::utilities::gauss_legendre13;
use crate::{fail, Error, Scalar, Vector};
... | Rust | 0 |
Ok(())
}
}
fn try_import<P: AsRef<Path>>(&mut self, path: P) -> Result<bool, ParseError> {
if path.as_ref().exists() {
self.parse_unit_from_file(path)?;
Ok(true)
}
else {
Ok(false)
}
}
}
#[derive(Debug, Error)]
#[err... | Rust | 0 |
default_app_config = 'server.contrib.redirects.apps.RedirectsConfig'
| Python | 1 |
return [pixel_poly, pixel_center_pos]
@staticmethod
def make_pixel_polygon(edges):
"""
:param edges: List of dictionaries (edges) with the parameters defining the edges of the pixel
:paramtype edges: list, dict
"""
poly = []
for k in ran... | Python | 1 |
coop",
Provider::SirBz => "sirbz.com",
Provider::Rlu => "rlu.ru",
Provider::TinyUrl => "tinyurl.com",
Provider::TinyPh => "tiny.ph",
Provider::TnyIm => "tny.im",
Provider::UrlShortenerIo => "url-shortener.io",
Provider::VGd => "v.gd",
... | Rust | 0 |
me);
let ids = enc.row_ids_filter(&"north", &cmp::Operator::GT, RowIDs::Vector(vec![]));
assert_eq!(
ids,
RowIDs::Vector(vec![9, 10, 11, 14, 15, 16, 17, 18]),
"{}",
name
);
let ids = enc.row_ids_filter(&"north", &cmp::Operator::GTE, RowID... | Rust | 0 |
&& (*nam1 == VAR_NONE || count_uses(body, *nam1) == 1)
&& is_linear(body);
return expr_linear && body_linear;
}
Term::Lam { name, body } => {
let body_linear
= (*name == VAR_NONE || count_uses(body, *name) == 1)
&& is_linear(body);
return body_linear;
}
Term... | Rust | 0 |
/ Exponent under/overflow.
succeeds(pc(1, 1, i32::MAX), pc(1, 1, 0), pc(PD_SCALE as i64, 2 * PD_SCALE, i32::MAX + PD_EXPO));
fails(pc(1, 1, i32::MAX), pc(1, 1, -1));
succeeds(pc(1, 1, i32::MIN - PD_EXPO), pc(1, 1, 0), pc(PD_SCALE as i64, 2 * PD_SCALE, i32::MIN));
succeeds(pc(1, 1, i32::MIN), pc(1, 1, P... | Rust | 0 |
dex>,
matched_rule_id: i32,
}
#[cfg(test)]
mod tests {
use std::fs::File;
use std::io::Read;
use std::path::PathBuf;
use crate::grammar::Grammar;
fn read_code(lang_test_dir: &PathBuf) -> String {
let mut file = File::open(lang_test_dir).unwrap();
let mut code = String::new();
... | Rust | 0 |
captures| {
captures
.iter()
.skip(1) // We are only interested in the capture groups, so we skip the first submatch, since that contains the entire match.
.filter_map(|maybe_submatch| {
maybe_submatc... | Rust | 0 |
e(usize, u8) -> Instruction
{
let k = (opcode & 0x00FF) as u8;
let vr = ((opcode & 0xF00) >> 8) as usize;
Ok(f(vr, k))
}
fn vr_vy_op<F>(opcode: u16, f: F) -> Result<Instruction, String>
where F: FnOnce(usize, usize) -> Instruction
{
let vy = ((opcode & 0x00F0) >> 4) as usize;
let vr = ((opcode ... | Rust | 0 |
from django.db.models import QuerySet
class RoadmapQuerySet(QuerySet):
def all(self):
return super().all().order_by("-updated_at", "-created_at", "total_votes")
class WebsiteEmailQuerySet(QuerySet):
pass
| Python | 1 |
g*qlLeOY + (theta_bar/lambda_qbar)*ky; %Equation 63
# ceOY = alpha-iy-by*(1-betaparam*(1+lambda_abar))/g; %See equation 64
# chOY = 1-ceOY-iy; %See equation 65
# lhOle = qlLhOY/qlLeOY; %See equation 67
# le = lbar/(1.0+lhOle);
# lh = lbar-le;
# psi_bar = ((1-alpha)*g*(1-gamma_h/r)*(1/chOY))/(n*(g-gamma_h)... | Rust | 0 |
Outcome: TryFrom<T::Error, Error = Error>,
{
type Request = Transfer;
type Response = Outcome;
type Error = Error;
type Future = ResourceServiceFut<S, T>;
#[inline]
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
self.service.poll_ready(cx).map_err(Err... | Rust | 0 |
ntinue`, found `Break({:?})`", b),
}
}
}
/// A future that outputs a `ControlFlow`.
pub trait ControlFlowFuture:
CompletionFuture<
Output = ControlFlow<<Self as ControlFlowFuture>::Break, <Self as ControlFlowFuture>::Continue>,
>
{
type Continue;
type Break;
}
impl<C, B, F> ControlFlowFutur... | Rust | 0 |
from typing import Tuple, Union
import torch.nn.functional as F
import torch.nn as nn
import torch
class Kernel(nn.Module):
"""
Channel-wise 3x3 convolution followed by 1x1 pointwise convolution.
Allows inspecting intermediate 3x3 output or final 1x1 output.
Args:
kernel: Tensor of shape [C,1,3... | Python | 1 |
.wait();
if result.exit_code != 0 {
panic!(
"Shotover exited with {} but expected 0 exit code (Success).\nstdout: {}\nstderr: {}",
result.exit_code, result.stdout, result.stderr
);
}
}
}
pub struct WaitOutput {
pub stdout: String,
pub... | Rust | 0 |
* (counts[UNDER] + 1.5 * counts[SPLIT]).powf(0.9),
counts,
)
}
fn plane_cost(input: &[Face], split: Plane, space: &WingMesh) -> f32 {
plane_cost_c(input, split, space).0
}
pub fn compile(faces: Vec<Face>, space: WingMesh) -> Box<BspNode> {
compile_lt(faces, space, LeafType::NotLeaf)
}
fn min_fac... | Rust | 0 |
from django.urls import path
from .views import HomePageView, CreatePostView
urlpatterns = [
path("", HomePageView.as_view(), name="home"),
path("post/", CreatePostView.as_view(), name="add_post")
] | Python | 1 |
lf {
W(writer)
}
}
#[doc = "Field `SLC1_TXLINK_ADDR` reader - "]
pub struct SLC1_TXLINK_ADDR_R(crate::FieldReader<u32, u32>);
impl SLC1_TXLINK_ADDR_R {
#[inline(always)]
pub(crate) fn new(bits: u32) -> Self {
SLC1_TXLINK_ADDR_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for... | Rust | 0 |
num: int = int(input("\nEnter a number: "))
count: int = 1
multiplo: int = 0
while count < 50:
if count % num == 0:
multiplo += 1
print(count)
if multiplo == 5:
break
count += 1
lista = 'Jose'
print(lista[::-1])
| Python | 1 |
prelude::*;
use legion::*;
pub struct Camera {
player_pos: Point,
viewport: Rect,
}
impl Camera {
pub fn new(ecs: &World) -> Self {
let player_pos = <(&Player, &Position)>::query()
.iter(ecs)
.map(|(_, pos)| pos.pt)
.nth(0)
.unwrap();
let vi... | Rust | 0 |
from cadquery import Shape
from pydantic_core import core_schema
from io import BytesIO
# Shape schema
shape_schema = core_schema.typed_dict_schema(
{
"brep": core_schema.typed_dict_field(core_schema.str_schema()),
"label": core_schema.typed_dict_field(core_schema.str_schema(), required=False),
... | Python | 1 |
nombre = "Jose Vicente" # cadena
edad = 47 # entero
altura = 1.78 # decimal
guapo = True # booleana
| Python | 1 |
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, avg, count
spark = SparkSession.builder.appName("MovieDataAnalysis").getOrCreate()
df = spark.read.csv("netflix_titles.csv", header=True, inferSchema=True)
df.show(5)
df_clean = df.dropna()
df_clean.show()
df_clean.printSchema()
#Пробую фи... | Python | 1 |
d9\x9f\xb3\xe9$\xf0\x0a\x0e\xa3\
\xa0\xdf\xcdg\x88w^{\x9c\xf7\x99X\xdb\xcc{\x9f\
f\x7fH\x94\xf9>Q\xda\xbbbo\x92\xc4\xd7\x89\xda\
\xbcD\xd4r1Q\xe4SbO\x8c\xb0\x07+\xa8\x1e\
\xaeS\x7f<l\xc5\xf0\x8b%\x0d\x0b\xd7o\x0d\x8e\x1d\
;\xdfY_'\xcf\xc2L\xd9\x1a\xa9:9\xf0\x95\xf6\
L_\x03[\xf0\xbf`\xef\xb5:\xaf\xdaz?\x19\xd3\
\x85J}W\... | Python | 1 |
# *********************************************************************
# FUNCTION TO CONVERT LAND-SEA MASK TO A SPARSE ARRAY
#
# Copyright (c) 2014-2019: HILARY R. MARTENS, LUIS RIVERA, MARK SIMONS
#
# This file is part of LoadDef.
#
# LoadDef is free software: you can redistribute it and/or modify
# i... | Python | 1 |
import funciones
def main():
lista_reales = [1/4, 0.4, 23, 3.4, 1, 56, -34, 0.34/8.9]
funciones.promedio_array(lista_reales)
if (__name__ == "__main__"):
main() | Python | 1 |
import codecs
import encodings.aliases
import re
import babel.core
def patch_codecs():
# ---------------------------------------------------------
# some charset are known by Python under a different name
# ---------------------------------------------------------
encodings.aliases.aliases['874'] = ... | Python | 1 |
Send,
{
fn borrow(&self) -> &[T] {
&self.components
}
}
impl<T, const N: usize> BorrowMut<[T]> for Vector<T, N>
where
T: Num + Copy + Sync + Send,
{
fn borrow_mut(&mut self) -> &mut [T] {
&mut self.components
}
}
// ================================
//
// Deref / DerefMut trait impl... | Rust | 0 |
, np.mean(train_losses).item(), valid_loss, valid_f1, patience_counter))
debug('=' * 100)
train_losses = []
if patience_counter == max_patience:
break
# 当用户按下Ctrl + C(即键盘中断)时,会触发KeyboardInterrupt异常。相当于可以人为结束训练,后面的代码仍会执行。
#也可以直接按终止一次,不要按2次,按2次后面... | Python | 1 |
> false,
}
}
}
//! Resources (enums, structs) for processing the _Geolocation API_ response
//! from the Google Maps Platform. Look in here for more information about the
//! data returned from Google's server and how to parse it with your program.
mod error_object;
mod error;
use crate::{
geolocation... | Rust | 0 |
owned(),
})?;
fixed.next += fixed.step;
}
}
}
// Run variable rate systems.
cx.clock = clock;
for system in self.var_systems.iter_mut() {
let cx = cx.reborrow();
system.run(cx).wrap_err_with(||... | Rust | 0 |
self.num_classes = num_classes
if if_SN:
self.conv1 = SpectralNorm(nn.Conv2d(1, model_dim, 5, stride=2, padding=2))
self.conv2 = SpectralNorm(nn.Conv2d(model_dim, model_dim * 2, 5, stride=2, padding=2))
self.conv3 = SpectralNorm(nn.Conv2d(model_dim * 2, model_dim * ... | Python | 1 |
# Don't Remove Credit @VJ_Botz
# Subscribe YouTube Channel For Amazing Bot @Tech_VJ
# Ask Doubt on telegram @KingVJ01
from pyrogram import Client, filters
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
import requests
import os
API = "https://apis.xditya.me/lyrics?song="
@Client.on_messa... | Python | 1 |
# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
overall_metrics = "overall_metrics"
precision = "precision"
recall = "recall"
f1 = "f1"
retriever_metrics = "retriever_metrics"
context_recall = "context_recall"
context_precision = "context_precision"
context_relevancy = "context_relevancy"... | Python | 1 |
let maybe_res = client.send(req).await;
if let Ok(res) = maybe_res {
let mut res = res;
let ret = res.body_string().await.unwrap();
Ok(ret)
} else {
Err("fail to get problem".to_string())
}
}
pub fn submit_problem(id: usize, pose: &Pose) -> Result<String, String> {
t... | Rust | 0 |
except Exception as e:
raise IOError(f"Error loading pitch file {pitch_path}: {str(e)}")
# Process the sample using parent class method
waveform, pitch, periodicity = self.process_sample(
waveform, pitch, periodicity, sr
)
if self.use_c... | Python | 1 |
leaves = vec![1, 2];
let tree = Tree::<DummyHash>::new(&leaves);
assert_eq!(vec![1, 1, 2], tree.nodes());
}
#[test]
fn build_five() {
let leaves = vec![2, 3, 5, 7, 11];
let tree = Tree::<DummyHash>::new(&leaves);
assert_eq!(vec![4, -2, 2, 4, 2, 3, 5, 7, 11], tree.no... | Rust | 0 |
Origin::ensure_origin(origin)?;
ensure!(Self::assets(asset_id).is_some(), Error::<T>::AssetNotFound);
let b_symbol = Self::to_bounded_name(symbol)?;
let metadata = AssetMetadata::<BoundedVec<u8, T::StringLimit>> {
symbol: b_symbol.clone(),
decimals,
};
AssetMetadataMap::<T>::insert(asset_id, ... | Rust | 0 |
c0n\x96\xd5\xe2~\xc9\
\x191u\x9a\xe3\xbc\xdb\xf0\xd0>9\x9aH7,\xd6\
++\xb7_\xcc\x9a\x08+0\xd5}\x87QN\xc9\x88\
,\xa8\xac&-i\xaa\xd8\xbdY1mk\x8c\x1d\xef\
i\xfe3\xe5q\x8a9\xe7\x08\xad xA\xb5B\xcf\
c\xf6\x11\xb8.\xebVO\x88\x5c\x09\x1a\x83t0J\
D\xb4V.\x8b\x98\xa1\xc4\x1a\x8b\xe8N\x9f.\xbb\x1c\
\x17X\xdbzn\x1e\x14\xb5\xc1\xd0... | Python | 1 |
tkeyslot.rs
#[doc = "Reader of register SELECTKEYSLOT"]
pub type R = crate::R<u32, super::SELECTKEYSLOT>;
#[doc = "Writer for register SELECTKEYSLOT"]
pub type W = crate::W<u32, super::SELECTKEYSLOT>;
#[doc = "Register SELECTKEYSLOT `reset()`'s with value 0"]
impl crate::ResetValue for super::SELECTKEYSLOT {
type T... | Rust | 0 |
//
/// Matrices expose a set of convenience methods for pre- and post-transformations.
/// A pre-transformation corresponds to adding an operation that is applied before
/// the rest of the transformation, while a post-transformation adds an operation
/// that is appled after.
pub struct TypedMatrix... | Rust | 0 |
# ------------------------------------------------------------------------
# Copyright (c) 2017-present, SeetaTech. All Rights Reserved.
#
# Licensed under the BSD 2-Clause License,
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org... | Python | 1 |
// while_loop,
// ret
// ];
// let ast = ExprWrapper::default(Expr::FnDecl("dec_until".into(), Vec::new(), Some("u8".into()), body));
// let mut llvm_generator = LLVMGenerator::new();
// llvm_generator.add_module(ast, false, false);
// llvm_generator.initialize(true);
// let a... | Rust | 0 |
om variables.
Parameters
----------
grasp_rv : :obj:`ParallelJawGraspPoseGaussianRV`
random variable for gripper pose
obj_rv : :obj:`GraspableObjectPoseGaussianRV`
random variable for object pose
params_rv : :obj:`ParamsGaussianRV`
ran... | Python | 1 |
import sys
from PyQt5.uic import loadUi
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QDialog, QApplication, QWidget
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import QTimer
from PyQt5.QtWidgets import QStackedWidget
from PyQt5.QtWidgets import (
QApplication,
QWidget,
QMainWindow,
QPus... | Python | 1 |
Features, TokenBuilder};
lazy_static! {
pub static ref TEST_SENTENCES: Vec<Sentence> = {
let mut sentences = Vec::new();
let mut s1 = Sentence::new();
s1.push(
TokenBuilder::new("Die")
.lemma("die")
.cpos("ART")
.pos("ART")
... | Rust | 0 |
0..iterations {
add_padding(&mut image, 2, '-');
let mut new_image = image.clone();
for i in 1..image.len() -1 {
for j in 1..image[0].len() - 1 {
new_image[i][j] = enhance(&image, i, j, algorithm, it);
}
}
image = new_image;
... | Rust | 0 |
config(&self) -> QueryResult<bool> {
self.surface_type()
.map(|flags| flags.contains(SurfaceType::WINDOW))
}
pub fn opengl_config(&self) -> QueryResult<bool> {
self.client_api()
.map(|flags| flags.contains(ConfigClientAPI::OPENGL))
}
pub fn opengl_es_1_config(&s... | Rust | 0 |
) -> Result<Self, error::KeyRejected> {
let key_pair =
ec::suite_b::key_pair_from_bytes(alg.curve, private_key, public_key, cpu::features())?;
Ok(Self::new(alg, key_pair))
}
fn new(alg: &'static Algorithm, key_pair: ec::KeyPair) -> Self {
let (seed, public_key) = key_pair.sp... | Rust | 0 |
// hits[rng.gen_range(0, max_val as usize)] += 1;
// }
// hits
// }
// pub(crate) fn bench_vec_group_by_flex(num_entries: u32, max_val: u32) -> Vec<u32> {
// let mut hits: Vec<u32> = vec![];
// let mut rng = rand::thread_rng();
// ... | Rust | 0 |
# Ultralytics YOLO 🚀, AGPL-3.0 license
from .predict import SegmentationPredictor, predict
from .train import SegmentationTrainer, train
from .val import SegmentationValidator, val
__all__ = 'SegmentationPredictor', 'predict', 'SegmentationTrainer', 'train', 'SegmentationValidator', 'val'
| Python | 1 |
#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug, Default)]
pub struct NextPositionIdxResponse {
pub next_position_idx: Uint128,
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct MigrateMsg {
pub collateral_oracle: String,
pub staking: String,
pub... | Rust | 0 |
#[doc = " Disable the receipt of all multicast frames by an Ethernet device."]
#[doc = ""]
#[doc = " @param port_id"]
#[doc = " The port identifier of the Ethernet device."]
pub fn rte_eth_allmulticast_disable(port_id: u8);
}
extern "C" {
#[doc = " Return the value of allmulticast mode for an ... | Rust | 0 |
if remove {
self.0.voice_state_guilds.remove(&guild_id);
}
}
let (_, state) = self.0.voice_states.remove(&(guild_id, user_id))?;
if let Some(channel_id) = state.channel_id {
let remove = self
.0... | Rust | 0 |
) -> Self::Range;
}
impl Index for () {
type Range = std::ops::RangeFull;
fn total_size(&self) -> usize {
1
}
fn transpose(&self, _x: usize) -> Self {}
fn slice(&self, _sub: Self) -> Self::Range {
..
}
}
impl Index for usize {
type Range = std::ops::Range<usize>;
fn t... | Rust | 0 |
# © 2020 Solvos Consultoría Informática (<http://www.solvos.es>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Maintenance Timesheets",
"summary": "Adds timesheets to maintenance requests",
"author": "Odoo Community Association (OCA), Solvos",
"license": "AGPL-3",
"vers... | Python | 1 |
child::section[position()=2]", "selects the second section of the fifth chapter of the doc document element", None),
("child::para[attribute::type='warning']", "selects all para children of the context node that have a type attribute with value warning", None),
("child::para[attribute::type='war... | Rust | 0 |
from typing import List, Set
from keycloak_scanner.logging.vuln_flag import VulnFlag
from keycloak_scanner.scan_base.scanner import Scanner
from keycloak_scanner.scan_base.types import Realm
from keycloak_scanner.scan_base.wrap import WrapperTypes
URL_PATTERN = '{}/auth/realms/{}'
class RealmScanner(Scanner[Realm])... | Python | 1 |
#!/usr/bin/env python3
import rclpy
from geometry_msgs.msg import PoseWithCovarianceStamped
from rclpy.node import Node
from robot_localization.srv import SetPose
from std_srvs.srv import Empty
class ResetLocalizationService(Node):
def __init__(self):
super().__init__("reset_localization_service")
... | Python | 1 |
##################################################################
# Kernels
def linear_kernel(X, Y):
"""
Compute the linear kernel between X and Y.
Parameters
----------
X: array of shape (n_samples_1, n_features)
Y: array of shape (n_samples_2, n_features)
Returns
-------
Gram ... | Python | 1 |
# Last updated: 10/7/2025, 10:27:17 AM
class TaskManager:
def __init__(self, tasks: List[List[int]]):
self.heap = []
self.taskPriority = {}
self.taskOwner = {}
for t in tasks:
self.add(t[0], t[1], t[2])
def add(self, userId: int, taskId: int, priority: int... | Python | 1 |
UsageFlagBits.html>"]
pub struct CommandBufferUsageFlags(pub(crate) Flags);
vk_bitflags_wrapped!(CommandBufferUsageFlags, Flags);
impl CommandBufferUsageFlags {
pub const ONE_TIME_SUBMIT: Self = Self(0b1);
pub const RENDER_PASS_CONTINUE: Self = Self(0b10);
#[doc = "Command buffer may be submitted/executed m... | Rust | 0 |
his point
arg2_so += 6
# if-else might be unnecessary as title shouldn't have any splitting applied to it
if not in_title:
text, length, a_i, b_i = extract_relevant_sentence(text, arg1_so, arg2_so)
formatted_data.append({"text": text, "metadata": ... | Python | 1 |
deviation = x - self.x_0;
self.gamma / (PI * (self.gamma * self.gamma + deviation * deviation))
}
}
impl distribution::Distribution for Cauchy {
type Value = f64;
#[inline]
fn distribution(&self, x: f64) -> f64 {
use std::f64::consts::FRAC_1_PI;
FRAC_1_PI * ((x - self.x_0) / s... | Rust | 0 |
Ok(())
}
pub fn op_code(&self) -> u8 {
match *self {
Live(_) => 1,
Load(_, _) => 2,
Store(_, _) => 3,
Addition(_, _, _) => 4,
Substraction(_, _, _) => 5,
And(_, _, _) => 6,
Or(_, _, _) => 7,
Xor(_, _, _) =>... | Rust | 0 |
kockata na podlogata,
# togaj taj klik ode u buffer
# tuka se apply-nuva taj buffer
if self.direction[0] == ActorMoves.INPLACE and self.x_buffer:
self.direction[0] = self.x_buffer
self.update_velocity((self.x_buffer.value, 0))
self.line_index += self.x_buffer.... | Python | 1 |
case_sensitive: bool,
}
impl Config {
pub fn from_args(args: env::Args) -> Result<Config, &'static str> {
// first argument is the program name. let's skip it.
let mut args = args.skip(1);
let query = args.next().ok_or("Didn't provide a query string")?;
let file_name = args.next().... | Rust | 0 |
ization": rlTimeSynchronization,
"rlDnsCl": rlDnsCl,
"rlCDB": rlCDB,
"rldot1x": rldot1x,
"rlFile": rlFile,
"rlAAAEap": rlAAAEap,
"rlSNMP": rlSNMP,
"rlSsl": rlSsl,
"rlMacBasePrio": rlMacBasePrio,
"rlWlanAccessPoint": rlWlanAccessPoint,
"rlLocalization... | Python | 1 |
enumerate(prompt_segs)
]
seg_embs = [self.model.llama_model.model.embed_tokens(seg_t) for seg_t in seg_tokens]
mixed_embs = [emb for pair in zip(seg_embs[:-1], img_list) for emb in pair] + [seg_embs[-1]]
mixed_embs = torch.cat(mixed_embs, dim=1)
return mixed_embs
if __name__ ==... | Python | 1 |
ate_source", message = "source is not correct"))]
source: u8,
#[validate(custom(
function = "validate_journey_destiny",
message = "journey_destiny is not correct"
))]
journey_destiny: String,
}
fn validate_source(source: u8) -> Result<(), ValidationError> {
if to_source_name(source... | Rust | 0 |
"""Deep learning based regressors."""
__all__ = [
"CNNRegressor",
"CNTCRegressor",
"FCNRegressor",
"InceptionTimeRegressor",
"LSTMFCNRegressor",
"MACNNRegressor",
"MCDCNNRegressor",
"MLPRegressor",
"ResNetRegressor",
"SimpleRNNRegressor",
"TapNetRegressor",
]
from sktime.re... | Python | 1 |
import argparse
import pandas as pd
# Initialize the argparse object that we will modify
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input", help='A list of the VERSE output filenames provided by snakemake', dest="input", required=True, nargs='+')
parser.add_argument("-o", "--output", help='The ou... | Python | 1 |
_params(level, window_bits, strategy);
let invalid_level = (mem_level < 1) || (mem_level > 9);
if (method != MZ_DEFLATED) || invalid_level || invalid_window_bits(window_bits) {
return Err(MZError::Param);
}
stream_oxide.adler = MZ_ADLER32_INIT;
stream_oxide.total_in = 0;
stream_oxide.... | Rust | 0 |
################################################################################
#
# Copyright (c) 2021-2025 Hybird
#
# 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, incl... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.