text string | label_name string | labels int64 |
|---|---|---|
import logging
import socket
import httpx
import requests
from validr import T
from rssant_api.models import STORY_SERVICE, Feed
from rssant_api.models.worker_task import (
WorkerTask,
WorkerTaskExpired,
WorkerTaskPriority,
)
from rssant_common.service_client import SERVICE_CLIENT
from rssant_feedlib.full... | Python | 1 |
[allow(clippy::type_complexity)]
type SystemData = (
Entities<'s>,
ReadExpect<'s, PhysicsWorld<N>>,
WriteStorage<'s, Transform>,
ReadStorage<'s, PhysicsHandle<PhysicsRigidBodyTag>>,
ReadStorage<'s, Parent>,
);
fn run(
&mut self,
(entities, physics_wor... | Rust | 0 |
ER: slog_atomic::AtomicSwitchCtrl<(), io::Error> =
slog_atomic::AtomicSwitch::new(
slog::Discard.map_err(|_| io::Error::new(io::ErrorKind::Other, "should not happen"))
)
.ctrl();
}
/// Create an application logger (to be used by our binary crates).
pub fn create_app_logger<T: slog::... | Rust | 0 |
,
pub front_page_id: Option<Uuid>,
pub opens_at: Option<DateTime<Utc>>,
pub copied_from: Option<Uuid>,
}
impl Chapter {
pub fn from_database_chapter(
chapter: &DatabaseChapter,
file_store: &dyn FileStore,
app_conf: &ApplicationConfiguration,
) -> Self {
let chapter_i... | Rust | 0 |
# -*- coding: utf-8 -*-
''' Check get_horizontal_soil_reaction_diagram function.'''
from __future__ import print_function
__author__= "Luis C. Pérez Tato (LCPT)"
__copyright__= "Copyright 2024, LCPT"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@gmail.com"
import math
import xc
from geotechnics impor... | Python | 1 |
() {
if let Err(err) = go_shred() {
eprintln!("{}", err);
exit(1);
}
}
impl ShredArguments {
fn convert(self) -> ShredResult<ShredConfig<PathBuf>> {
let verbosity = match (self.debug, self.quiet) {
(true, true) => return Err("cannot use quiet mode and debug mode together... | Rust | 0 |
from tracker.firmware import Patch, PatchLoc
from tracker.memory import Polyp
import struct
from time import sleep
SYMBOLS = {
"set_pad":0x0002B99C+1,
"pads_struct": 0x20005D48}
DST_ADDR = 0x70100000
stub_set_pad = """
push {r4-r5,lr}
mov r4, r0
ldr r0, =pads_struct
ldr r1, [r4,#8]
ldr r2, ... | Python | 1 |
# Copyright 2019 The TensorFlow 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 applica... | Python | 1 |
d = self.opt.lr / self.opt.niter_decay
lr = self.old_lr - lrd
for param_group in self.optimizer_D.param_groups:
param_group['lr'] = lr
for param_group in self.optimizer_G.param_groups:
param_group['lr'] = lr
if self.opt.verbose:
print('update l... | Python | 1 |
import logging
import pandas as pd
from langchain_core.documents import Document
from langchain_graphrag.query.local_search.context_selectors.relationships import (
RelationshipsSelectionResult,
)
from langchain_graphrag.types.tokens import TokenCounter
_LOGGER = logging.getLogger(__name__)
class Relationships... | Python | 1 |
import os
os.system('cls')
# declaracoes
x = 10
y = 5
j = 'mary'
print('-' * 90)
print('VERDADEIRO OU FALSO')
print('=' * 90)
# (and) Verdadeiro
print('E (and) Verdadeiro.')
if (x > 5 and y != j):
print('Verdadeiro: Bloco executado.')
else: print('Falso: bloco executado.')
print('.' * 90)
# E (and) falso / ... | Python | 1 |
"""Constants for 1-Wire component."""
from __future__ import annotations
from homeassistant.const import Platform
DEFAULT_HOST = "localhost"
DEFAULT_PORT = 4304
DOMAIN = "onewire"
DEVICE_KEYS_0_3 = range(4)
DEVICE_KEYS_0_7 = range(8)
DEVICE_KEYS_A_B = ("A", "B")
DEVICE_SUPPORT = {
"05": (),
"10": (),
"... | Python | 1 |
*;
#[test]
fn initial_pool_amount() {
let trade_fee_numerator = 0;
let trade_fee_denominator = 1;
let owner_trade_fee_numerator = 0;
let owner_trade_fee_denominator = 1;
let owner_withdraw_fee_numerator = 0;
let owner_withdraw_fee_denominator = 1;
let cal... | Rust | 0 |
(
&mut self,
_origin_: vector,
_euler_angles_: vector,
idx: ::std::os::raw::c_int,
) {
coordinate_system_update1(self, _origin_, _euler_angles_, idx)
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct conic {
pub ref_frame: coordinate_system,
pub origin: vect... | Rust | 0 |
::from(other);
self.0 = tmp.reduce();
}
}
impl MulAssign<Fr> for Fr {
fn mul_assign(&mut self, other: Fr) {
let tmp = self.0 * Scalar::from(other);
self.0 = tmp.reduce();
}
}
impl From<Hash> for Fr {
fn from(h: Hash) -> Fr {
Fr::from(Scalar::from_bytes_mod_order(h.bits(... | Rust | 0 |
0x0d, 0x38, 0x34, 0x1b, 0xab, 0x33, 0xff, 0xb0,
0xbb, 0x48, 0x0c, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e,
0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77,
0x0a, 0xa6, 0x20, 0x68, 0xfe, 0x7f, 0xc1, 0xad,
];
const MIN_KEY_LEN: usize = 1; // In bytes
const MAX_KEY_LEN: usize = 128; // In bytes
#[inline]
fn key_ex... | Rust | 0 |
};
pub use page_table::{ENTRY_COUNT, PageTable, PageTableEntry};
use crate::ia_32e::PhysAddr;
use lazy_static::lazy_static;
use alloc::vec::Vec;
// use crate::mutex::Mutex;
///! 提供了内存分页功能
mod page;
mod page_table;
mod page_ops;
pub mod frame;
pub mod allocator;
pub mod mapper;
pub mod result;
pub mod frame_allocator;
... | Rust | 0 |
nd.index - 1) % 5) == 0;
if is_this_node {
debug_assert!(self.nodes[nd.index as usize].is_leaf());
continue;
}
let node = &self.nodes[nd.index as usize];
if node.is_leaf() {
visit(NodeInfo::from(nd, node.element_count));
... | Rust | 0 |
me>xiongjiwei/tikv<gh_stars>1000+
// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
use engine_rocks::raw::CompactOptions;
use engine_rocks::util::get_cf_handle;
use engine_traits::util::append_expire_ts;
use engine_traits::{MiscExt, Peekable, SyncMutable, CF_DEFAULT};
use tikv::config::DbConfig;
use ... | Rust | 0 |
# Project 1 - Snake, Water and Gun Game
# We all have played snake, water and gun game in our childhood. If you haven't, google the rules of this game and write a python program that are capable of playing this game with the user.
'''
1 for snake
-1 for water
0 for gun
'''
import random
computer = random.choice([1,... | Python | 1 |
isibleTo(view)
assert view.dims.last_used == i
else:
# sliders should not be visible for the following dims and the
# last_used should fallback to the first available dim with a
# visible slider (dim 0)
assert not widg.isVisibleTo(view)
ass... | Python | 1 |
# 总结搜索结果提示词
summarize_webpage_prompt = """
You are tasked with summarizing the raw content of a webpage retrieved from a web search. Your goal is to create a summary that preserves the most important information from the original web page. This summary will be used by a downstream research agent, so it's crucial to mai... | Python | 1 |
"""alter_column
Revision ID: 87b26d4e3fd4
Revises: fd28d3489400
Create Date: 2024-03-21 12:42:13.089333
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '87b26d4e3fd4'
down_revision = 'fd28d3489400'
branch_labels = None
depends_on = None
def upgrade():
op.... | Python | 1 |
# MIT License
#
# Copyright The SCons Foundation
#
# 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, including
# without limitation the rights to use, copy, modify, merge, ... | Python | 1 |
= (acc_os_star * (self.known_num_class) + acc_unknown) / (self.known_num_class+1)
acc_hos = (2 * acc_os_star * acc_unknown) / (acc_os_star + acc_unknown)
self.G.train()
self.C.train()
self.E.train()
if epoch%self.args.update_term==0:
entropy_list = all_ent_t.data.nu... | Python | 1 |
b = id(456);
if let Ok(y) = id::<Result<bool, ()>>(Ok(true)) {
zzz(); // #break
let c = id(789);
if let (z, 42) = id((10, 42)) {
zzz(); // #break
}
}
}
}
#[inline(never)]
fn id<T>(value: T) -> T { value }
fn zzz() { }
<gh_stars>0
... | Rust | 0 |
],
},
},
contracts: Default::default(),
balances: btreemap! {
0.into() => (0x00..=0xff)
.map(|address| (Address::from_low_u64_be(address), 1u64.as_u256()))
.chain(vec!... | Rust | 0 |
omData<E>);
impl<'de: 'a, 'a, E> Deserializer<'de> for MissingFieldDeserializer<'a, E>
where
E: Error,
{
type Error = E;
fn deserialize_any<V>(self, _: V) -> Result<V::Value, Self::Error>
where
V: Visitor<'de>,
{
Err(Error::custom(format_args!("Missing field: {}", self.0)))
}
... | Rust | 0 |
unwrap(), "---\n{}\n");
}
/// Check that minimal install config file serializes to minimal arg list
#[test]
fn serialize_empty_install_config_file() {
let config: InstallConfig = serde_yaml::from_str("dest-device: foo").unwrap();
assert_eq!(config.to_args().unwrap(), vec!["foo"]);
}... | Rust | 0 |
"7a6a846eb4eb1448826d1a221ecf492e3e9222248cd051437d9e9077c6ce286e")),
// AccountId::from(hex_literal::hex!("f0bf5adfee4cd54b35ed483ab27578ee57657aa8ab2714eefb687985939b091c")),
// AccountId::from(hex_literal::hex!("127ad4fa172054535def282e1b6ded508a03d94583368f41bd806e39c49f6a40")),
// AccountId::from(hex_lite... | Rust | 0 |
import os
import json
import firebase_admin
from firebase_admin import credentials, firestore
from dotenv import load_dotenv
# Carga las variables de entorno desde .env
load_dotenv()
# Lee la variable de entorno que contiene el JSON como string
firebase_creds = {
"type": os.getenv("type"),
"project_id": os.ge... | Python | 1 |
),
local_public_key,
);
let ping = Ping::new(PingConfig::new().with_keep_alive(false));
let kad_config = KademliaConfig {
peer_id: cfg.local_peer_id,
keypair: cfg.key_pair,
kad_config: cfg.kademlia_config,
};
// TODO: this is hazy... | Rust | 0 |
text) == 0 {
show_error( "wglMakeCurrent() failed.\0".as_ptr() as *const i8);
return ( 0 as HWND, h_dc ) ;
}
gl::init();
gl::wglSwapIntervalEXT(1);
( h_wnd, h_dc )
}
}
// Create message handling function with which to link to hook window to Windows messaging ... | Rust | 0 |
ef can_use_emoji(self, emoji):
if emoji.is_unicode_emoji():
return True
role_ids = emoji.role_ids
if (role_ids is not None):
return False
guild = self.guild
if guild is None:
return False
default_role = guild.... | Python | 1 |
e_range_str.endswith("]")):
error_lines.append(f"行 {i+1}: 页码范围格式错误,应为 [开始页码,结束页码]")
continue
# Remove brackets and split by comma
page_nums = page_range_str[1:-1].split(",")
if len(page_nums) != 2:
... | Python | 1 |
from .base_page import BasePage
from .locators import LoginPageLocators
class LoginPage(BasePage):
def should_be_login_page(self):
self.should_be_login_url()
self.should_be_login_form()
self.should_be_register_form()
def should_be_login_url(self):
assert self.is_element_present... | Python | 1 |
= ser.astype(object).where(cond, other)
tm.assert_series_equal(res, expected)
# ----------------------------------------------------------------------------
# Printing
def test_repr_small():
arr = PeriodArray._from_sequence(["2000", "2001"], dtype="period[D]")
result = str(arr)
expected = (
... | Python | 1 |
fo_command(
matches: &ArgMatches<'_>,
wallet_manager: &mut Option<Arc<RemoteWalletManager>>,
) -> Result<CliCommandInfo, CliError> {
let address = pubkey_of_signer(matches, "address", wallet_manager)
.unwrap()
.unwrap();
Ok(CliCommandInfo {
command: CliCommand::GetTokenMultisigA... | Rust | 0 |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import Usuario
class UsuarioAdmin(UserAdmin):
"""
Configuração de exibição e gerenciamento do modelo Usuario no Django Admin.
Atributos:
model (Model): Define o modelo associado a este admin.
li... | Python | 1 |
fn model_path(iter: &mut str::Split<char>) -> PathBuf {
let owner = iter.next().wasi_expect("expected owner");
let model = iter.next().wasi_expect("expected model");
let version = iter.next().wasi_expect("expected version");
let mut path = PathBuf::new();
path.push(owner);
path.push("models");
path.push(model);... | Rust | 0 |
requirements", "Present properly", "Clean afterwards"],
"allows_creativity": True
}
],
DailyTaskType.INTIMATE_SERVICE: [
{
"title": "Evening Attendance",
"description": "Provide attentive evening service",
"duration... | Python | 1 |
import os
import string
all_drives = ['%s:' % drives
for drives in string.ascii_uppercase
if os.path.exists('%s:' % drives)]
C_drive = all_drives.index('C:')
# function to print Drive name before the listing process
def drive_letter(num):
name = all_drives
printer = open("store.t... | Python | 1 |
import torch
from torch import nn
from spikingjelly.activation_based import surrogate, neuron
tau = 2.0 # beta = 1 - 1/tau
backend = "torch"
detach_reset = True
class RepeatEncoder(nn.Module):
def __init__(self, output_size: int):
super().__init__()
self.out_size = output_size
self.lif ... | Python | 1 |
let res_one = map_one
.iter()
.fold(0, |sum, x| sum + x.iter().filter(|p| **p > 1).count());
let lines_two = include_str!("input.txt")
.lines()
.map(|line| {
line.split(" -> ")
.map(|point| {
point
.split('... | Rust | 0 |
Err(e) => {
log::error!("Failed to serialize error response: {}", e);
return Message::Close(None);
}
};
Message::Text(json)
}
rpc::Response::Binary { kind, bytes } => {
let mut bin = vec![kind as u8];
... | Rust | 0 |
(d: Decimal) -> u8 {
(d.0 / 100000) as u8
}
}
impl From<Decimal> for u16 {
#[inline]
fn from(d: Decimal) -> u16 {
(d.0 / 100000) as u16
}
}
impl From<Decimal> for u32 {
#[inline]
fn from(d: Decimal) -> u32 {
(d.0 / 100000) as u32
}
}
impl From<Decimal> for u64 {
... | Rust | 0 |
from typing import List, Optional, Type, cast
from pepperbot.adapters.keaimao.api import KeaimaoAPI, KeaimaoGroupAPI, KeaimaoGroupBot
from pepperbot.adapters.onebot.api import (
OnebotV11API,
OnebotV11GroupAPI,
OnebotV11GroupBot,
)
from pepperbot.adapters.telegram.api import TelegramAPI, TelegramGroupAPI
f... | Python | 1 |
layer1 = diagram.category.Layer(left1, box1,
middle @ box0.dom @ right0)
elif off1 >= off0 + len(box0.cod): # box0 left of box1
middle = left1[len(left0 @ box0.cod):]
layer0 = diagram.category.Layer(left0, box0,
midd... | Python | 1 |
, c2);
fn test_shallow_copy<
't,
T: 't
+ Copy
+ std::fmt::Debug
+ PartialEq
+ ArgumentReflection
+ ReturnTypeReflection
+ Marshal<'t>,
>(
s1: &mut StructRef<'t>,
s2: &StructRef<'t>,
data: &TestData<T... | Rust | 0 |
}
pub fn set(&mut self, ar: Vec<T>) {
self.free(); //释放之前的内存
//Vec::into_raw_parts 这个方法不是稳定方法,所以参考它手动实现
let mut t = ManuallyDrop::new(ar);
self.len = t.len() as CU64;
self.ptr = t.as_mut_ptr();
self.cap = t.capacity() as CU64;
}
pub fn get_mut(&mut self)... | Rust | 0 |
.0
///
/// Reference: SCPI 1999.0: 21.8 - :ERRor Subsystem
#[repr(i16)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum StandardErrorCode {
// Reference: SCPI 1999.0: 21.8.9 - Command Error
CommandError = -100,
InvalidCharacter = -101,
SyntaxError = -102,
InvalidSeparator = -103,
DataTypeE... | Rust | 0 |
not in all_metrics["R_precision"]:
all_metrics["R_precision"][key] = [item]
else:
all_metrics["R_precision"][key] += [item]
for key, item in fid_score_dict.items():
if key not in all_metrics["FID"]:
all_metrics["FI... | Python | 1 |
0.539760 0.831396 11.00000 0.37995
N031 3 0.817715 0.476480 0.534524 11.00000 0.20138
C111 1 0.826041 0.475196 0.486356 11.00000 0.21657
C112 1 0.814548 0.514222 0.462493 11.00000 0.21379
O031 4 0.786121 0.528903 0.469882 11.00000 0.22405
C113 1 0.809644 0.437852 0.463950 ... | Python | 1 |
"""Extend dismissed enrichments with SUPPRESSED status
Revision ID: 876a424d8f06
Revises: 8176d7153747
Create Date: 2025-02-18 18:09:40.656808
"""
from alembic import op
from sqlalchemy import and_, null
from sqlalchemy.orm.attributes import flag_modified
from sqlmodel import Session
from keep.api.core.db_utils imp... | Python | 1 |
i1)
);
let actual = Sync3Timestamp {
timestamp: 88888888,
}
.to_raw();
let expected = RawBgbCommand {
b1: 106,
b2: 0,
b3: 0,
b4: 0,
i1: 88888888,
};
assert_eq!(
(actual.b1, actual... | Rust | 0 |
io: bool
}
impl Propiedad {
pub fn new() -> Propiedad {
Propiedad {
valor: "".to_string(),
vacio: true
}
}
}
#[derive(Debug)]
pub struct EntradaFormulario {
pub id: String,
pub etiqueta_web: String,
pub etiqueta_pdf: Propiedad,
pub valor: String,
pub obligatorio: b... | Rust | 0 |
from aiogram import types
from aiogram.types import Message
from aiogram.fsm.context import FSMContext
import requests
url = "https://open-ai21.p.rapidapi.com/conversationllama"
async def chatgpt_javob(message: Message, state: FSMContext):
question = message.text
await state.update_data(question=question)
... | Python | 1 |
ONE_EVENT_BUSY: WIFI_SCAN_DONE_EVENT_TYPE = 1;
pub type WIFI_SCAN_DONE_EVENT_TYPE = ::cty::c_uint;
#[repr(C)]
#[derive(Default, Copy, Clone)]
pub struct wifi_conf {
pub country_code: [::cty::c_char; 3usize],
pub channel_nums: ::cty::c_int,
}
pub type wifi_conf_t = wifi_conf;
#[safe_wrap(_)] extern "C" {
pub... | Rust | 0 |
from argparse import ArgumentParser as ПарсерАргументов
аргпарсер = ПарсерАргументов(
description="birp - большой русский питон. Позволяет писать программы на русском языке, как настоящий патриот!!!!",
prog="birp[.reverse]"
)
аргпарсер.add_argument(
"-ф", "--файлы", "-f", "--files", nargs="+", help="Списо... | Python | 1 |
ment, ERROR_MISSING_SEGMENT))
};
Ok(Self {
main_header,
segments,
chunk_map,
position: 0,
encryption_key: None,
encryption_algorithm: EncryptionAlgorithm::AES256GCMSIV, //is set to an encryption algorithm: this value will never be used without the self.encryption_key value.
})
}
/// returns a... | Rust | 0 |
ga)
@dp.callback_query_handler(text="ortga17")
async def show_back_to_products_from_iwatch(call: CallbackQuery): # Funksiya nomi o'zgartirildi
await call.message.delete()
await call.message.answer_photo(
caption="<b>Apple products</b>",
photo="https://overclockers.ru/st/legacy/blog/390340/1988... | Python | 1 |
) = (0x02, "64-bit objects");
pub const ELFDATANONE: (u8, &str) = (0x00, "Invalid data encoding");
pub const ELFDATA2LSB: (u8, &str) = (0x01, "little endian");
pub const ELFDATA2MSB: (u8, &str) = (0x02, "big endian");
pub const ELFOSABI_NONE: (u8, &str) = (0x00, "No extensions or unspecified");
pub const ELFOSABI_HPU... | Rust | 0 |
# this script should be executed from its parent folder e.g. python ./test.py
import cv2
from keras.models import load_model
import numpy as np
from statistics import mode
from utils import preprocess_input
from utils import get_labels
import sys
# parameters
image_path = './images/test_image.jpg'
detection_model_pa... | Python | 1 |
dules_5_modules_final_layer_norm_parameters_bias_:
name = "L_self_modules_model_modules_decoder_modules_layers_modules_5_modules_final_layer_norm_parameters_bias_"
shape = [1024]
dtype = "torch.float32"
device = "cpu"
mean = 0.004
std = 0.098
data = None
class Program_weight_tensor_meta_L_... | Python | 1 |
stop) {
return false;
}
let z_diff = if left_z > right_z {
left_z - right_z
} else {
right_z - left_z
};
if z_diff > 1 {
return false;
}
let y_diff = if left_y > right_y {
left_y - right_y
} else {
right_y - left_y
};
if y_diff > ... | Rust | 0 |
np.array(["b"] * 4 + ["a"] * 16 + ["c"] * 20, dtype=object),
["c", "b", "a"],
[20, 4, 16],
),
(
np.array([np.nan] * 4 + ["a"] * 16 + ["c"] * 20, dtype=object),
["c", np.nan, "a"],
[20, 4, 16],
),
(
np.ar... | Python | 1 |
ading("#1", text = "原文件名")
_file.heading("#2", text = "更改后文件名")
_file.pack(side = LEFT)
_fileScorllY.pack(side = RIGHT, fill = Y)
_fileScorllX.pack(side = BOTTOM, fill = X)
_fileFrameS.pack(side = BOTTOM)
_file.bind("<Delete>", lambda event : functions.removeSelect(_file))
# 文件按钮 Button
_removeFileButton = Button(_fil... | Python | 1 |
from Cyclonus.Manifolds.LieGroups.SO3Matrix import SO3Matrix
import numpy as np
import pytest
@pytest.fixture
def setup_tests_fixture():
setup_values = {
"unit vector x": np.array([1., 0., 0.]),
"unit vector y": np.array([0., 1., 0.]),
"unit vector z": np.array([0., 0., 1.])
}
... | Python | 1 |
s(f):
os.remove(f)
def null_html():
null_files = ['/www/server/nginx/html/index.html','/www/server/apache/htdocs/index.html','/www/server/panel/data/404.html']
null_new_body='''<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</cente... | Python | 1 |
except Exception:
log.warning("当前无在线协议端, 已停止推送")
return
group_list = await _bot.get_group_list()
gl = [f"{i['group_id']}" for i in group_list]
if str(m.group_id) not in gl:
await sub.del_sub(m.tid, m.group_id)
log.warning(f"群 {m.group_id} ... | Python | 1 |
_node)?)),
"em" => Ok(RPrBase::EmphasisMark(xml_node.get_val_attribute()?.parse()?)),
"lang" => Ok(RPrBase::Language(Language::from_xml_element(xml_node))),
"eastAsianLayout" => Ok(RPrBase::EastAsianLayout(EastAsianLayout::from_xml_element(xml_node)?)),
"specVanish" => Ok... | Rust | 0 |
Arg::from_usage("-a, --alignment=<FILE> 'Input SAM/BAM file'").display_order(1))
.arg(Arg::from_usage("-g, --gtf=<FILE> 'Input GTF/GFF file'").required_unless("index").display_order(1))
.arg(Arg::from_usage("-i, --index=<DIR> 'Index directory containing parsed GTF files'").required_unless("gtf").display... | Rust | 0 |
d):
n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels
m.weight.data.normal_(0, math.sqrt(2. / n))
elif isinstance(m, nn.BatchNorm2d):
m.weight.data.fill_(1)
m.bias.data.zero_()
if self.use_sample_w:
self.samp_w_pred.... | Python | 1 |
ield `MEMSTAT`"]
pub type MEMSTAT_R = crate::R<u8, MEMSTAT_A>;
impl MEMSTAT_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, MEMSTAT_A> {
use crate::Variant::*;
match self.bits {
0 => Val(MEMSTAT_A::OFF),
3 =>... | Rust | 0 |
ool3d(*args, **kwargs)
raise ValueError(f"unsupported dimensions: {dims}")
class HybridConditioner(nn.Module):
def __init__(self, c_concat_config, c_crossattn_config):
super().__init__()
self.concat_conditioner = instantiate_from_config(c_concat_config)
self.crossattn_conditioner = in... | Python | 1 |
coefficient,
}
}
pub fn estimate(&self, sz: usize) -> Result<Fee, CoinError> {
let msz = Milli::integral(sz as u64);
let fee = self.constant + self.coefficient * msz;
let coin = Coin::new(fee.to_integral())?;
Ok(Fee(coin))
}
}
/// Calculation of fees fo... | Rust | 0 |
# Create a test CSV file (test_videos.csv)
import pandas as pd
test_data = {
'Title': ['TOP 10 AMAZING TRICKS!', 'How to become popular on TikTok', 'MY DAY VLOG'],
'Published At': ['2024-01-15', '2024-01-16', '2024-01-17'],
'Keyword': ['tips', 'tutorial', 'vlog']
}
df = pd.DataFrame(test_data)
df.to_csv('... | Python | 1 |
"""
This script makes a dataset of two million approximately whitened patches,
extracted at random uniformly from a downsampled version of the STL-10
unlabeled and train dataset.
It assumes that you have already run make_downsampled_stl10.py, which
downsamples the STL-10 images to 1/3 of their original resolution.
Th... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale_loyalty.tests.common import TestSaleCouponCommon
from odoo.tests.common import tagged
@tagged('-at_install', 'post_install')
class TestBuyGiftCard(TestSaleCouponCommon):
def test_buying_gift_c... | Python | 1 |
AsRef<str>>(value: A) -> Self {
match value.as_ref() {
"complete" => Self::Complete,
"incomplete" => Self::Incomplete,
"incomplete_first_party_only" => Self::IncompleteFirstPartyOnly,
"incomplete_third_party_only" => Self::IncompleteThirdPartyOnly,
"u... | Rust | 0 |
&text=Na%20zdravje&op=translate) [Alla salute!](https://dictionary.cambridge.org/dictionary/italian-english/alla-salute) [Prost!](https://dictionary.cambridge.org/dictionary/german-english/prost) [Nazdravlje!](https://matadornetwork.com/nights/how-to-say-cheers-in-50-languages/) 🍻
//!
// endregion: auto_md_to_doc_comm... | Rust | 0 |
osition(
hClientHandle: HANDLE,
pInterfaceGuid: *const GUID,
strProfileName: LPCWSTR,
dwPosition: DWORD,
pReserved: PVOID,
) -> DWORD;
pub fn WlanSetProfileCustomUserData(
hClientHandle: HANDLE,
pInterfaceGuid: *const GUID,
strProfileName: LPCWSTR,... | Rust | 0 |
-> String {
format!("level: {} difficulty: {}", self.level, self.difficulty)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_action() {
// arrange
const EXPECTED_ACTION: (i32, i32) = (1, 10);
let enemy = Computer::new(1, 10);
// act
let resu... | Rust | 0 |
paint.set_stroke_width(1.0);
//
// Draw the circle that the user can manipulate
//
canvas.draw_circle(skia_safe::Point::new(200.0, 200.0), 100.0, &paint);
//
// Draw FPS text
//
let mut text_paint =
skia_safe::Paint::new(skia_safe::Colo... | Rust | 0 |
import rdkit.Chem as Chem
from rdkit.Chem import Descriptors
import numpy as np
from build_encoding import decode
import rdkit.Chem.Crippen as Crippen
import rdkit.Chem.rdMolDescriptors as MolDescriptors
from rdkit.Chem import Descriptors
# Cache evaluated molecules (rewards are only calculated once)
evaluated_mols... | Python | 1 |
ated[:limit]
except Exception as e:
logger.error(f"❌ Failed to find related content: {e}")
return []
def get_enhanced_engine():
"""Factory function to create enhanced semantic engine"""
return EnhancedSemanticEngine()
# Memory usage monitoring
def get_memory_usage(... | Python | 1 |
Color_Delete(p: *mut B2ParticleColor);
fn b2ParticleColor_Set(p: *mut B2ParticleColor, r: UInt8, g: UInt8, b: UInt8, a: UInt8);
fn b2ParticleColor_IsZero(p: *mut B2ParticleColor) -> bool;
}
/// Small color object for each particle
#[allow(raw_pointer_derive)]
#[derive(Clone)]
pub struct ParticleColor... | Rust | 0 |
use std::iter;
use rand::{Rng, thread_rng};
use rand::distributions::Alphanumeric;
lazy_static! {
static ref path_digi_suffix: Regex = Regex::new(r"_\((\d+)\)$").unwrap(); // to match a directory name: this_is_a_directory_(123)
}
#[derive(Debug)]
enum WrappedTypes {
Zip, Xz, Tar, Gzip, Bzip, Rar, Base64
}
f... | Rust | 0 |
r = r.read().decode()
assert expected_error == r
def test_invalid_name_update_notification_instance(self, foglamp_url):
conn = http.client.HTTPConnection(foglamp_url)
changed_data = {"description": "changed_desc"}
conn.request("PUT", '/foglamp/notification/{}'.format('nonExistent'... | Python | 1 |
access_mask(dacl_ptr as *mut _, &mut group_trustee) }?;
let world_access_mask = unsafe { get_acl_access_mask(dacl_ptr as *mut _, &mut world_trustee) }?;
let has_bit = |field: u32, bit: u32| field & bit != 0;
let permissions = Permissions {
user_read: has_bit(owner_access_mask, winnt::FILE_GENERIC... | Rust | 0 |
ommu.
dev.allocate_address(resources)
.context("failed to allocate resources early for virtio pci dev")?;
let dev = Box::new(dev);
devices.push((dev, iommu_dev.jail));
}
}
for params in &cfg.stub_pci_devices {
// Stub devices don't need jailin... | Rust | 0 |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
RMDL: Random Multimodel Deep Learning for Classification
* Copyright (C) 2018 Kamran Kowsari <kk7nc@virginia.edu>
* Last Update: Oct 26, 2018
* This file is part of RMDL project, University of Virginia.
* Free to use, change, share and distribute source cod... | Python | 1 |
gi587k9jtj0 as zauea0ed4b7, uxa9d0bsurs
@{b'', u641a0d5x8z, 0.0, a10erog2_cw, False, i0vxoxx0vsw, ld992irvic_, '', 0, cqubhrssw6l}
def fdyr0p8ew5b():
nonlocal i8js3iqdxw3
assert 0j
yctirl2s6t5 = pxq5vi9jm8i
0 .uxxsfhjr_8b <<= yb5bihaun6h
'# hatchet_canister_header -> machines_battleships_unions'
... | Python | 1 |
rPods)4.3 out of 5 stars 2,562#5Redmi A4 5G (Sparkle Purple, 4GB RAM, 128GB Storage) | Global Debut SD 4s Gen 2 | Segment Largest 6.88in 120Hz | 50MP Dual Camera | 18W Fast Charging4.0 out of 5 stars 581#6boAt Bassheads 100 in Ear Wired Earphones with Mic(Black)4.1 out of 5 stars 412,589Next page
# Bestsellers i... | Python | 1 |
# ------------------------------------------------------------------------------
# Copyright (c) 2010-2013, EVEthing team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of... | Python | 1 |
chCommand} <b>[link]: Mirror YT video</b>
/{BotCommands.TarWatchCommand} <b>[link]: Mirror YT video & upload as .tar</b>
/{BotCommands.CloneCommand} <b>[link]: Mirror drive folder</b>
/{BotCommands.CancelMirror} <b>: Reply to dwnld cmd</b>
/{BotCommands.CancelAllCommand} <b>: Reply to dwnld cmd</b>
/{BotCommands.Status... | Python | 1 |
filename>combustion/cli/src/error.rs
use combustion::project::{ProjectError};
pub struct CliError {
pub message: String
}
impl From<ProjectError> for CliError {
fn from(error: ProjectError) -> Self {
let message = match error {
ProjectError::InvalidTarget { message } => message,
... | Rust | 0 |
)
)
};
if let Some(e) = produce_variant() {
return Some(e);
}
}
};
}
Fields::Unit => {
return quote! {
if let Some(captures) = matcher.c... | Rust | 0 |
will call the underlying RPC
on the server.
"""
# Generate a "stub function" on-the-fly which will actually make
# the request.
# gRPC handles serialization and deserialization, so we just need
# to pass in the functions for each.
if "get_file" not in sel... | Python | 1 |
usize) -> d16 {
d16 {
value: u16::from_le_bytes([cartridge[address], cartridge[address + 1]]),
}
}
}
impl fmt::Display for d16 {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{0:04X}", self.value)
}
}
#[allow(non_camel_case_types)]
#[d... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.