text string | label_name string | labels int64 |
|---|---|---|
import contextlib
from typing import Any
from django.db import models # type: ignore[import-untyped]
from litestar.config.app import AppConfig
from litestar.plugins.base import SerializationPlugin, InitPlugin
from litestar.typing import FieldDefinition
from litestar_django.dto import DjangoModelDTO
class DjangoMod... | Python | 1 |
use sp_runtime::traits::AtLeast32Bit;
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T, I = ()>(_);
#[pallet::config]
/// The module configuration trait.
pub trait Config<I: 'static = ()>: frame_system::Config {
/// The overarching event type.
type Event: From<Event<... | Rust | 0 |
# Now append the system to the set of systems with this chemical formula.
for k, k_is_atom_based in is_atom_var.items():
db_arr = database[k]
store_arr = db_arr[i, :mol_n_atom] if k_is_atom_based else db_arr[i]
mol[k].append(store_arr)
# pos... | Python | 1 |
subnormal
FpCategory::Normal => {
let (mut sig, mut exp) = value.to_integer_exp().unwrap(); // deconstruct value in significant and exponent - unwrap safe because value is normal
let is_negative = match sig.cmp0() { // convert sig to positive and store the sign bit
... | Rust | 0 |
/// Returns the process corresponding to the given pid or `None` if no such process exists.
///
/// ```no_run
/// use sysinfo::{ProcessExt, System, SystemExt};
///
/// let s = System::new_all();
/// if let Some(process) = s.process(1337) {
/// println!("{}", process.name());
/// ... | Rust | 0 |
rive(Copy, Clone, Debug)]
pub struct PairPos2<'a>(pub(super) Subtable<'a>);
impl<'a> PairPos2<'a> {
/// Returns the value formats for the first and second glyph.
pub fn value_formats(&self) -> [ValueFormat; 2] {
let (data, base) = self.0.data_and_offset();
[
ValueFormat(data.read_u1... | Rust | 0 |
re::Result<Gist> {
let contents_1 = r#"{"description":"test description 1","language":"rust","tags":["tag1","tag2"],"code":"code\nthe\nfirst\n"}"#;
let contents_2 =
r#"{"description":"test description 2","language":"python","code":"code\nthe\nsecond\n"}"#;
let contents_3 =
r#"{"description":... | Rust | 0 |
, _: f64, _: f64) { unimplemented!() }
fn resize(&mut self, _: Dimensions) -> Result<(), String> { unimplemented!() }
}
#[cfg(test)]
mod tests {
use super::*;
use super::super::{Circle, Rect};
/// Verify the `get_shape_htmls` function returns a list of svg strings for each shape in the group.
#[t... | Rust | 0 |
def update_mapping_from_spec(device_fn_dict: Dict[str, Callable], attribute_name: str):
try:
# Try to import the function directly
spec_fn = getattr(device_spec_module, attribute_name)
device_fn_dict[torch_device] = spec_fn
except AttributeEr... | Python | 1 |
return {}
@pg.production('field_stmt : ID EQ value EOL')
@log_call
def field(p):
return p[0].getstr(), p[2]
@pg.production('value : INTEGER')
@log_call
def value(p):
return int(p[0].getstr())
@pg.production('value : NUMBER')
@log_call
def value(p):
return float(p[0].getstr())
@pg.production('valu... | Python | 1 |
from optuna._imports import _INTEGRATION_IMPORT_ERROR_TEMPLATE
try:
from optuna_integration.tensorboard import TensorBoardCallback
except ModuleNotFoundError:
raise ModuleNotFoundError(_INTEGRATION_IMPORT_ERROR_TEMPLATE.format("tensorboard"))
__all__ = ["TensorBoardCallback"]
| Python | 1 |
ng Ping..</i>'
PING_VALUE = '<b>Pong</b>\n<code>{value} ms..</code>'
# ---------------------
# async def onDownloadStart(self): --> tasks_listener.py
LINKS_START = """<b><i>Task Started</i></b>
┠ <b>Mode:</b> {Mode}
┖ <b>By:</b> {Tag}\n\n"""
LINKS_SOURCE = """➲ <b>Source:</b>
┖ <b>Added On:</b> {On... | Python | 1 |
def install_mim_dependencies():
mim_dep = ['mmpretrain[mim]>=1.0.0rc8', 'mmyolo[mim]==0.6.0']
print('Checking zoo dependencies, please wait...')
import mim
mim.install(mim_dep)
print('Check over')
| Python | 1 |
}
#[doc = "Bit 7 - Selects the interrupt mode for each pin interrupt. Bit n configures the pin interrupt selected in PINTSELn. 0 = Edge sensitive 1 = Level sensitive"]
#[inline]
pub fn pmode7(&mut self) -> _PMODE7W {
_PMODE7W { w: self }
}
}
<filename>src/spawn.rs
use futures::future::poll_... | Rust | 0 |
t_sink();
//!
//! // Setup the subscribers
//! let fmt_subscriber = FmtSubscriber::builder().finish();
//! let metric_subscriber = MetricsSubscriber::new(fmt_subscriber, sink);
//!
//! tracing::subscriber::with_default(metric_subscriber, || {
//! info!({ do_something_counter = 1 }, "Do some logging");
//! })
//! ``... | Rust | 0 |
, injections)
index_DTD: Optional[int] = indexOfDTD(soup)
# Insert information comment:
if option(A.list_injected):
namesOfInjectedScripts = [ i.userscript.name + ("" if i.userscript.version is None else " " + T.stringifyVersion(i.userscript.version)) ... | Python | 1 |
RR_RESP_1
}
}
#[doc = "Write proxy for field `SEC_ERR_RESP`"]
pub struct SEC_ERR_RESP_W<'a> {
w: &'a mut W,
}
impl<'a> SEC_ERR_RESP_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: SEC_ERR_RESP_A) -> &'a mut W {
{
self.bit(variant.... | Rust | 0 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Python | 1 |
#Eg 1
# global_var=20 #global variable
#
# def func():
# local_var=10 #local variable
# print(local_var)
# print(global_var)
#
# func()
# # print(local_var) #invalid because local_var is local variable of func()
# print(global_var) #valid because global_var is global variable
#Eg 2
# xy=100
# ... | Python | 1 |
g/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_c... | Rust | 0 |
(&self, address: u16) -> u8 {
let address = address as usize;
match address {
BOOT_ROM_BEGIN...BOOT_ROM_END => {
if let Some(boot_rom) = self.boot_rom {
boot_rom[address]
} else {
self.rom_bank_0[address]
... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .card import Card
class UpdateCardRequestBody(object):
_types = {
"card": Card,
"uuid": str,
"sequence": int,
}
def __init... | Python | 1 |
# Generated by Django 5.1.2 on 2025-02-27 10:49
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('hra_timesheets', '0007_timesheet_timesheet_detail'),
]
operations = [
migrations.DeleteModel(
name='TimeSheetDetails',
),
]
| Python | 1 |
ario.starting_context.tool_augmentation_list = [
ScenarioCategories.ARG_TYPE_SCRAMBLED
]
scenario.categories.append(ScenarioCategories.ARG_TYPE_SCRAMBLED)
scenarios[f"{name}_3_distraction_tools_arg_type_scrambled"] = scenario
# Scramble arg description
scenario = cop... | Python | 1 |
es }
const ENTITY_1_ID: EntityId<CustomRules> = EntityId::Object(OBJECT_1_ID);
// Create a battle with one object.
let mut server = util::server(CustomRules::new());
util::object(&mut server, OBJECT_1_ID, ());
// Fire an alter statistics event.
assert_eq!(
AlterStatistics::trigger(&mut s... | Rust | 0 |
image_data: 预处理后的图像数据
Returns:
分析结果字典
"""
# 准备医学描述模板
medical_descriptions = [
"正常胸部CT图像,无明显异常。",
"肺部有磨玻璃样阴影,考虑肺炎可能。",
"肺部有结节影,需要进一步评估。",
"肺部有实质性浸润影,考虑感染或肿瘤。",
"胸腔积液,肺实质无明显异常。",
"肺气肿表现,肺部透明... | Python | 1 |
dead_code)]
#![allow(nonstandard_style)]
#![allow(unused_imports)]
#![allow(unused_variables)]
use antlr_rust::atn::ATN;
use antlr_rust::atn_deserializer::ATNDeserializer;
use antlr_rust::char_stream::CharStream;
use antlr_rust::dfa::DFA;
use antlr_rust::error_listener::ErrorListener;
use antlr_rust::int_stream::IntStr... | Rust | 0 |
{ParentNode, RTreeNode};
use crate::object::RTreeObject;
use crate::params::RTreeParams;
use crate::{Envelope, RTree};
/// Iterator returned by `RTree::drain_*` methods.
///
/// Draining iterator that removes elements of the tree selected by a
/// [`SelectionFunction`]. Returned by
/// [`RTree::drain_with_selection_fu... | Rust | 0 |
# 查找匹配的表格元数据
for table in tables:
if table.get("html") and table_html in table.get("html"):
# 创建元数据注释
metadata = {
"type": "table",
"page": tabl... | Python | 1 |
tner.write(
{"delay_calendar_type": "natural", "factory_calendar_id": False}
)
reference_3 = "2097-01-25 12:00:00" # friday
result = self.company_partner.supplier_plan_days(reference_3, 3).date()
monday = fields.Date.to_date("2097-01-28")
self.assertEqual(result, mon... | Python | 1 |
p numControlQubits is outside [1, \\p qureg.numQubitsRepresented])"]
#[doc = " - if any qubit index (\\p targetQubit or one in \\p controlQubits) is outside [0, \\p qureg.numQubitsRepresented])"]
#[doc = " - if any qubit in \\p controlQubits is repeated"]
#[doc = " - if \\p controlQubits contains \\p target... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
The pytest for 'test_simulate.py' can be run in the termonal using:
1) cd <path of the Python Vehicle Simulator installation>
2) pytest -k simulate -v
"""
import matplotlib.pyplot as plt
from python_vehicle_simulator.lib import *
import python_vehicle_simulator.vehi... | Python | 1 |
# --------------------------------------------------
# File Name : 2567_3_Q4_A2.py
# Problem : Computer Price
# Author : Worralop Srichainont
# Date : 2025-08-01
# --------------------------------------------------
# Constants for computer components amount and types
COMPONENT_AMOUNT = 5
COMPONENT_TYPES = ["... | Python | 1 |
ers[b][0]:batch_answers[b][1]]) + '<br/>'
out_str += str(pred[b]) + str(tokenise(batch_contexts[b],asbytes=False)[pred[b][0]:pred[b][1]]) + '<br/>'
out_str += batch_ans_text[b] + '<br/>'
out_str += pred_str[b] + '<br/>'
out_... | Python | 1 |
col1, col2, col3 = st.columns([1, 2, 1])
with col2:
submit_btn = st.button("✨ Get Answer", use_container_width=True)
if submit_btn and query:
with st.spinner("🤔 Thinking..."):
response = ask_llm(query)
st.markdown('<div class="response-container">', uns... | Python | 1 |
from torch import nn
from .base import Module
from .crf import CRF
from .emb import WordShapeEmbedding
from .cnn import CNNEncoder
class NERHead(Module):
def __init__(self, emb_dim, tags_num):
super(NERHead, self).__init__()
self.emb_dim = emb_dim
self.tags_num = tags_num
self.p... | Python | 1 |
coded Document Acquisition.
Panda {
x: u32,
y: u32,
},
SuperCircle {
x: u32,
y: u32,
},
Unknown,
}
impl From<[u8; 10]> for Halftoning {
#[inline]
fn from(a: [u8; 10]) -> Self {
use BmpError::*;
match u16_le(&a[0..2]) {
0 => Halftoning::NoHalftoning,
1 => Halftoning::E... | Rust | 0 |
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... | Python | 1 |
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
import re
import shutil
try:
with open("README.md", "r", encoding="utf-8") as rh:
readme_contents = rh.read()
GITHUB_URL = "https://github.com/friendliai/friendli-python-internal.git"
GITHUB_URL = (
GITHUB_... | Python | 1 |
import json
import uuid
import pytest
from util.security.aes import AESCipher
from util.security.secret import convert_secret_key
@pytest.mark.parametrize(
"config_secret_key, expected_secret_key",
[
pytest.param("somesecretkey", b"somesecretkeysomesecretkeysomese", id="Some string"),
pytest... | Python | 1 |
from uuid import uuid4
import platform
import pyperclip
class clipboard:
def __init__(self):
self.device_id: str = str(platform.system()) + "-" + str(uuid4())
self.clipboard_content: str = pyperclip.paste()
self.clipboard_content_history: list[str] = []
self.max_history_size = 50
... | Python | 1 |
CEXR_InputFile,
err_out: *mut *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn CEXR_InputFile_from_stream(
stream: *mut CEXR_IStream,
threads: ::std::os::raw::c_int,
out: *mut *mut CEXR_InputFile,
err_out: *mut *const ::std::os::raw::c_cha... | Rust | 0 |
_member_mut().tag() {
if tag.as_str() == mytag {
return Some(child.as_mut());
}
}
}
}
if let Some(c) = child.is_container_mut() {
c.find_control_mut(arg)
... | Rust | 0 |
)]
pub fn with_buffer(
factory: &'a Factory,
format: ImageFormat,
width_pixels: i32,
height_pixels: i32,
stride_bytes: i32,
buffer: *mut u8,
buffer_size: usize,
buffer_release_cb: Option<MemoryDestroyCallback>,
buffer_release_cb_context: *mut (... | Rust | 0 |
population[:parents.shape[0], :] = parents
population[parents.shape[0]:, :] = offspring
return population, best_fitness
# Tạo phòng trống
room = np.zeros((20, 40))
# Chạy thuật toán di truyền
population, best_fitness = genetic_algorithm(room)
# Vẽ đồ thị độ thích nghi qua các thế hệ
plt.plot(best_fitnes... | Python | 1 |
Sqrid);
// Parser
pub mod parser {
use crate::Energy;
use crate::Grid;
use crate::Qa;
use anyhow::anyhow;
use anyhow::Result;
use nom::{character, combinator, multi::*, IResult};
use std::io::BufRead;
pub fn energy(input: &str) -> IResult<&str, Energy> {
let (input, energy) = ... | Rust | 0 |
al(text).unwrap();
assert_eq!(parse_output, Val::Decimal(-12345.6789));
assert!(remainder.is_empty());
}
#[test]
fn decimal__too_many_dots__accepted_with_remainder() {
let text = "-12345.6789.098098";
let (remainder, parse_output) = decimal(text).... | Rust | 0 |
err(|| ErrorKind::IO)?;
self.connections.insert(
id,
Tracker {
url: req.url.clone(),
last_updated: Instant::now(),
torrent: req.id,
state: TrackerState::new(sock, http_req, port),
redirect: false,
... | Rust | 0 |
}
#[doc = "Bit 4 - GPIO_4 interrupt enable for FFE0"]
#[inline(always)]
pub fn gpio_4_intr_en_ffe0(&mut self) -> GPIO_4_INTR_EN_FFE0_W {
GPIO_4_INTR_EN_FFE0_W { w: self }
}
#[doc = "Bit 5 - GPIO_5 interrupt enable for FFE0"]
#[inline(always)]
pub fn gpio_5_intr_en_ffe0(&mut self... | Rust | 0 |
>) {
EXECUTOR.wake_task(arc_self);
}
}
impl Debug for Task {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Task").field("tid", &self.tid).finish()
}
}
pub struct TaskBuilder {
future: Option<BoxFuture<'static, ()>>,
priority: SchedPriority,
budget: ... | Rust | 0 |
2 2 2 0 )
"A7" Shape ( 0 0 2 2 2 3 ) |
"D,#Fm"
"D" Shape ( _ 0 0 2 3 2 )
"#Fm" Shape ( 2 4 4 2 2 2 ) |
"Em,A"
"Em" Shape ( 0 2 2 0 0 0 )
"A" Shape ( 0 0 2 2 2 0 ) |
"D,Dmaj7,D7"
... | Rust | 0 |
# some OO setup tasks
LDAP_backend.register(LDAP_backend_Apple)
LDAP_backend.register(LDAP_backend_Windows2008R2)
LDAP_backend.register(LDAP_backend_OpenLDAP)
LDAP_backend.register(LDAP_backend_OpenLDAP_PDC)
# instantiating the user session object
l_user_session = User_session("margaret.thatch... | Python | 1 |
)
.with_stderr(format!("\
[COMPILING] foo v0.0.1 ({url})
[RUNNING] `rustc src{sep}lib.rs --crate-name foo --crate-type lib -g \
-C debug-assertions=off \
--out-dir {dir}{sep}target{sep}debug \
--emit=dep-info,link \
-L dependency={dir}{sep}target{sep}debug \
-L de... | Rust | 0 |
];
let mut chip8 = create_and_load(&program).unwrap();
let how_many_ones = chip8.gfx.iter().filter(|b| **b == 1).count();
assert_eq!(how_many_ones, 0);
assert_eq!(chip8.v[0xF], 0);
// set i to the first sprite in the font set (the number 0)
chip8.i = 0;
chip8.... | Rust | 0 |
plits):
diffj = diff[(j * diff.shape[0] // splits):((j+ 1) * diff.shape[0] //splits)]
kl1.append(np.exp(diffj.mean()))
print("category: %s scores_mean = %.2f, scores_std = %.2f" % (classes[i], np.mean(kl1),np.std(kl1)))
scores.append(np.exp(kl))
print("scores_mean = %.2f, sco... | Python | 1 |
:return: None
:raise AccountNotExistsError when account is not exists.
:raise AmountIllegalError when amount less 0.
"""
if self.is_account(name):
if amount < 0:
raise AmountIllegalError(amount)
else:
balance_old = self.__ge... | Python | 1 |
ev::Key::KEY_F20),
("f21", evdev::Key::KEY_F21),
("f22", evdev::Key::KEY_F22),
("f23", evdev::Key::KEY_F23),
("f24", evdev::Key::KEY_F24),
]);
let mod_to_mod_enum: HashMap<&str, Modifier> = HashMap::from([
("ctrl", Modifier::Control),
("control", Modifier::Contro... | Rust | 0 |
quetReader for amadeus_core::file::Reader<P>
// where
// P: Page,
// {
// fn len(&self) -> u64 {
// self.len()
// }
// }
#[derive(Serialize, Deserialize)]
pub struct ParquetDirectory<D> {
directory: D,
}
impl<D> ParquetDirectory<D> {
pub fn new(directory: D) -> Self {
Self { directory }
}
}
... | Rust | 0 |
# Generated on 2024-12-19 15:34
from django.conf import settings
from django.db.models import Prefetch
from more_itertools import chunked
from kobo.apps.organizations.models import Organization
from kpi.models.asset import Asset
def run():
"""
Transfers all assets owned by members to their respective organiz... | Python | 1 |
st() == [''] * (N_EVENTS * 2)
assert reader.tensors['file_name'].to_list() == [tmpinfo["event_filename"]] * (N_EVENTS * 2)
check_others(reader)
def test_log_dir(prepare, testdir):
tmpinfo = get_tmpdir_info(testdir.tmpdir)
# Test pivot
reader = SummaryReader(tmpinfo["log_dir"], pivot=True, extra_col... | Python | 1 |
# Copyright (c) OpenMMLab. All rights reserved.
from .collect_env import collect_env
from .misc import switch_to_deploy
from .setup_env import register_all_modules
__all__ = ['register_all_modules', 'collect_env', 'switch_to_deploy']
| Python | 1 |
into(),
..Server::new(ContentFactory(say_hello))
}.run();
//Check if the server started successfully
match server_result {
Ok(_server) => {},
Err(e) => error!("could not start server: {}", e.description())
}
}
fn read_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
... | Rust | 0 |
from captcha.image import ImageCaptcha
import numpy as np
from PIL import Image
import random
import cv2
import os
# 验证码中的字符
number = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
# alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
# ... | Python | 1 |
ction<Bytes> {
Connection::new(self.incoming.next().await.unwrap().await.unwrap())
}
}
pub fn build_certs() -> (CertificateChain, Certificate, PrivateKey) {
let cert = rcgen::generate_simple_self_signed(vec!["localhost".into()]).unwrap();
let key = PrivateKey::from_der(&cert.serialize_private_key_d... | Rust | 0 |
WindowPos3i(GLint, GLint, GLint))
failing!(fn WindowPos3iv(*GLint))
failing!(fn WindowPos3s(GLshort, GLshort, GLshort))
failing!(fn WindowPos3sv(*GLshort))
}
/// Load each OpenGL symbol using a custom load function. This allows for the
/// use of functions like `glfwGetProcAddress` or `SDL_GL_GetProcAddres... | Rust | 0 |
from unitxt.blocks import AddID, Copy, Set
from unitxt.catalog import add_to_catalog
from unitxt.metrics import MetricPipeline, Squad
from unitxt.test_utils.metrics import test_metric
metric = MetricPipeline(
main_score="f1",
preprocess_steps=[
AddID(),
Set(
{
"predi... | Python | 1 |
.trim()
.lines()
.map(|line| {
let caps = RE.captures(line).expect("invalid entry format");
PasswordWithPolicy {
min: caps[1].parse().expect("min value is not a number"),
max: caps[2].parse().expect("max value is not a n... | Rust | 0 |
ss GeotagHelper}
impl RtActivatable<IGeotagHelperStatics> for GeotagHelper {}
impl GeotagHelper {
#[cfg(feature="windows-devices")] #[inline] pub fn get_geotag_async(file: &super::IStorageFile) -> Result<ComPtr<foundation::IAsyncOperation<super::super::devices::geolocation::Geopoint>>> {
<Self as RtActivata... | Rust | 0 |
@pytest.mark.parametrize("ranges", ([(0, 1), (-5, None)], [(5, None)]))
def test_range_to_header(ranges):
header = ds.Range("byes", ranges).to_header()
r = http.parse_range_header(header)
assert r.ranges == ranges | Python | 1 |
import distutils.command.bdist_rpm as orig
class bdist_rpm(orig.bdist_rpm):
"""
Override the default bdist_rpm behavior to do the following:
1. Run egg_info to ensure the name and version are properly calculated.
2. Always run 'install' using --single-version-externally-managed to
disable eggs... | Python | 1 |
/// Label for handling input duration and press states.
TickSystem,
}use ethers::types::Address;
use worker::Response;
use worker::*;
mod utils;
use auth::{AuthRequest, Authorization};
use std::str::FromStr;
mod auth;
fn log_request(req: &Request) {
console_log!(
"{} - [{}], located at: {:?}, within: {... | Rust | 0 |
l_out = j
hcl_test_labels.append(label_out)
hcl_test_digits = np.array(hcl_test_digits).astype("int64")
hcl_test_labels = np.array(hcl_test_labels)
return hcl_train_digits, hcl_train_labels, hcl_test_digits, hcl_test_labels
# -----------------------------------------------------------------------... | Python | 1 |
Indicates whether there is an error in this SQL statement.
:param is_error_finding_present: The is_error_finding_present of this SqlTuningAdvisorTaskFindingSummary.
:type: bool
"""
self._is_error_finding_present = is_error_finding_present
@property
def is_timeout_finding_... | Python | 1 |
class Grid:
def __init__(self, width, height):
"""Initialisiere ein Raster mit den angegebenen Dimensionen."""
self.width = width
self.height = height
self.grid = [[0 for _ in range(width)] for _ in range(height)]
def is_space_free(self, x, y, room_width, room_height):
"... | Python | 1 |
from setuptools import setup
package_name = 'my_robot'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/' + package_name, ['package.xml']),
],
install_requires=['setuptools'],
zip_safe=True,
maintainer='Votre Nom',
maintainer_email='v... | Python | 1 |
SYNC_FLAGS_MASK
}
pub const D3D10_SB_OPCODE_EXTENDED_MASK: DWORD = 0x80000000;
pub const D3D10_SB_OPCODE_EXTENDED_SHIFT: DWORD = 31;
#[inline]
pub fn DECODE_IS_D3D10_SB_OPCODE_EXTENDED(OpcodeToken0: DWORD) -> DWORD {
(OpcodeToken0 & D3D10_SB_OPCODE_EXTENDED_MASK) >> D3D10_SB_OPCODE_EXTENDED_SHIFT
}
#[inline]
pub fn... | Rust | 0 |
e_kind;
pub mod pipeline_profile;
pub mod processing_block;
pub mod processing_block_kind;
pub mod processing_block_list;
pub mod sensor;
pub mod sensor_kind;
pub mod sensor_list;
pub mod stream_profile;
pub mod stream_profile_kind;
pub mod stream_profile_list;
/// The mod collects common used traits from this crate.
... | Rust | 0 |
= "std"),
feature(process_exitcode_placeholder),
feature(termination_trait_lib)
)]
#![cfg_attr(
all(nightly, feature = "nightly"),
feature(try_trait_v2),
feature(never_type),
feature(exhaustive_patterns)
)]
#![cfg_attr(any(docsrs, nightly), feature(doc_cfg))]
#![no_std]
#[cfg(doc)]
extern crate std;
#[cf... | Rust | 0 |
from asyncpg import Connection
from asyncpg.exceptions import UniqueViolationError
from core.errors import (
UniqueError,
)
from core.counter import Counter
from domain.store.interfaces import IStoreRepository
from domain.store.entities import Store
class StorePgRepository(IStoreRepository):
class Constrain... | Python | 1 |
> Result<String, Error> {
let (_, value) = os_release_data("NAME")?;
let value: Vec<&str> = value.split(' ').collect();
Ok(value[0].into())
}
<gh_stars>10-100
//! PWM abstractions
use crate::gpio::{gpiob, gpioc, gpiof, AlternateFunction, PushPull, AF7};
/// a timer
pub struct Timer<T> {
timer: T,
}
/... | Rust | 0 |
txt = data.get("stdout", None) or ""
data["stdout_lines"] = txt.splitlines()
if "stderr" in data and "stderr_lines" not in data:
# if the value is 'False', a default won't catch it.
txt = data.get("stderr", None) or ""
data["stderr_lines"] = txt.splitlines(... | Python | 1 |
serializes to and deserializes from a
/// BSON datetime rather than an RFC 3339 formatted string. Additionally, in non-BSON formats, it
/// will serialize to and deserialize from that format's equivalent of the
/// [extended JSON representation](https://docs.mongodb.com/manual/reference/mongodb-extended-json/) of a da... | Rust | 0 |
ters) * 2
# Auth-required endpoints are high value
if endpoint.auth_required:
score += 5
# Sensitive path patterns
sensitive_keywords = ['admin', 'user', 'auth', 'login', 'upload', 'file', 'payment']
path_lower = endpo... | Python | 1 |
)
L = sinput.size(2) * sinput.size(3) * sinput.size(4)
instances=sinput.view(sinput.size(0),L,sinput.size(1))
if encoder_hidden_state is not None:
encoder_hidden_state=encoder_hidden_state.permute(1,0,2)
transformer_output = self.transformer_encoder(instances.permute(1,0,2)... | Python | 1 |
"=" | ">" }
response = { "response" ~ "{" ~ optional_extension ~ command_name ~ ":" ~ arguments ~ "}" }
optional_extension = { "+"? }
arguments = { parenthesized_argument_lists | argument_list }
parenthesized_argument_lists = { ("(" ~ argument_list ~ ")")+ }
argument_list = { (argument ~ ",")* ~ argument? }
argumen... | Rust | 0 |
.org_arg()
.subcommand(App::new("list")
.about("List all repos for an organization"))
}
pub fn execute<'a>(matches: &ArgMatches<'a>, config: &Config) -> Result<()> {
let api = Api::new(config);
let org = config.get_org(matches)?;
let repos = api.list_organization_repos(&org)?;... | Rust | 0 |
as_ref().expect("No Elementbuffer for Mesh")
}
pub fn texture(&self) -> &Texture {
self.texture.as_ref().expect("No Texture for Mesh")
}
pub fn shader(&self) -> &Shader {
self.shader.as_ref().expect("No Shader for Mesh")
}
}
pub struct RenderTexture {
pub frame_buffer: FrameBu... | Rust | 0 |
LINK_REPLAY_ERROR_COUNT_L1: u32 = 47;
pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L2: u32 = 48;
pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L3: u32 = 49;
pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L4: u32 = 50;
pub const NVML_FI_DEV_NVLINK_REPLAY_ERROR_COUNT_L5: u32 = 51;
pub const NVML... | Rust | 0 |
:PipelineData, nu_protocol::ShellError> {
let records = if call.named.is_empty() {
let all_options = vec!["modifiers", "keycodes", "edits", "modes", "events"];
all_options
.iter()
.flat_map(|argument| get_records(argument, &call.head))
.col... | Rust | 0 |
from typing import List, Optional, Union
import numpy as np
import torch
from diffusers.schedulers.scheduling_flow_match_euler_discrete import FlowMatchEulerDiscreteScheduler
class FlowMatchEulerDiscreteInversionScheduler(FlowMatchEulerDiscreteScheduler):
def set_timesteps(
self,
num_inference_st... | Python | 1 |
is_zero(&self) -> bool
where
T: Zero + PartialEq,
{
let zero = T::zero();
self.top == zero && self.right == zero && self.bottom == zero && self.left == zero
}
/// Constructor setting the same value to all sides, taking a scalar value directly.
pub fn new_all_same(all: T) ->... | Rust | 0 |
user_id: String,
count: usize,
with_tweet_quote_count: bool,
include_promoted_content: bool,
with_super_follows_user_fields: bool,
with_user_results: bool,
with_birdwatch_pivots: bool,
with_reactions_metadata: bool,
with_reactions_perspective: bool,
with_super_follows_tweet_field... | Rust | 0 |
def test_clip_sample_range(self):
for clip_sample_range in [1, 5, 10, 20]:
self.check_over_configs(clip_sample_range=clip_sample_range)
| Python | 1 |
ng)) // FIXME: This type can be incorrect as well
.build();
pop_var_parser.check_supported(&expr).unwrap();
let src_schema = [FieldTypeTp::LongLong.into()];
let mut schema = vec![];
let mut exp = vec![];
let mut ctx = EvalContext::default();
pop_var_parser
... | Rust | 0 |
ound_poseidon() {
rational_post_test_compound::<PoseidonHasher>();
}
fn rational_post_test_compound<H: Hasher>() {
let rng = &mut XorShiftRng::from_seed(crate::TEST_SEED);
let leaves = 32;
let sector_size = (leaves * NODE_SIZE) as u64;
let challenges_count = 2;
... | Rust | 0 |
self.checksum)
.map_err(|err| Error::NonUtf8(self.checksum.to_vec(), err))?;
u8::from_str_radix(string, 16).map_err(|err| Error::NonNumber(string.to_owned(), err))
}
/// Return the actual checksum, derived from the data.
///
/// ```rust
/// # use gdb_protocol::packet::{Kind, Unc... | Rust | 0 |
model's input and output word embeddings should be tied.
rope_theta (`float`, *optional*, defaults to 10000.0):
The base period of the RoPE embeddings.
sliding_window (`int`, *optional*, defaults to 4096):
Sliding window attention window size. If not specified, will default to `... | Python | 1 |
# Copyright (c) 2023, NVIDIA CORPORATION. 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 |
into(),
TsParamPropParam::Assign(node) => (*node).into(),
}
}
}
impl<'a> From<TsParamPropParam<'a>> for Node<'a> {
fn from(node: TsParamPropParam<'a>) -> Node<'a> {
match node {
TsParamPropParam::Ident(node) => node.into(),
TsParamPropParam::Assign(node) => node.into(),
}
}
}
fn ge... | Rust | 0 |
read--modify--write-api).\n\nFor information about avaliable fields see [mtmovf0](mtmovf0) module"]
pub type MTMOVF0 = crate::Reg<u32, _MTMOVF0>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _MTMOVF0;
#[doc = "`read()` method returns [mtmovf0::R](mtmovf0::R) reader structure"]
impl crate::Readable for MTMOVF0 {}
#[... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.