text string | label_name string | labels int64 |
|---|---|---|
{
'name': 'Margins in Sales Orders',
'version': '1.0.0',
'category': 'Sales/Sales',
'description': """
This module adds the 'Margin' on sales order.
=============================================
This gives the profitability by calculating the difference between the Unit Price and Cost Price.
""",
... | Python | 1 |
"""
Revision ID: 0128_noti_to_sms_sender
Revises: 0127_remove_unique_constraint
Create Date: 2017-10-26 15:17:00.752706
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
revision = "0128_noti_to_sms_sender"
down_revision = "0127_remove_unique_constraint"
def upgrade():
... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
SBS系统日志工具模块
配置和管理SBS系统的日志记录
"""
import os
import logging
import sys
from pathlib import Path
from datetime import datetime
def setup_logging(config=None, level=logging.INFO, log_to_file=True):
"""
设置日志记录配置
参数:
config: 配置字典,包含日志配置
lev... | Python | 1 |
next_update_time (which is in the past, and
// likely to be "before" the last_update_check by the duration it takes to perform an
// update check)
let schedule =
UpdateCheckSchedule::builder().last_time(now - Duration::from_secs(1234)).build();
let server_dictate... | Rust | 0 |
s.as_str(),
)?;
match backend {
BackendFramework::ActixWeb => {
let name = resource.config.file_name.as_str();
let service_entry = &format!("services::{}::endpoints(web::scope(\"{}\"))", name, base_endpoint_path);
register_actix(name, service_entry)?;
},
... | Rust | 0 |
in self.notes:
note.metadata.remove_duplicate_values(k=k, meta_type=meta_type)
def order(
self,
k: Union[str, list[str], None] = None,
o_keys: Union[Order, None] = Order.ASC,
o_values: Union[Order, None] = Order.ASC,
meta_type: Union[MetadataType, None] = None,
... | Python | 1 |
iff no other metric is requested
total_consumption = ba.analyze_power(trace_path)
print("The average consumption is {} W".format(total_consumption))
else:
print('The metric ' + metric + ' is not yet implemented\n')
def generate_launch_description():
# Decl... | Python | 1 |
"""
1. 模块 -- 包含函数定义和可执行语句的文件
每次解释器会话中,模块仅导入一次,如果模块内容修改,需要重新导入模块
***** 导入模块时,以下划线开头的名称不会导入
2. 模块搜素路径
导入spam.py模块时,
搜索具有该模块名称的内置模块 -- sys.builtin_module_names中列出,没有时下一步
|
sys.path列表中搜索名为spam.py的文件
|
被执行文件所在目录
|
PYTHONPATH
|
site-pack... | Python | 1 |
pqItems = [
4000884, # Primrose Seed
# We dont remove Rice Cakes cause you use them to buy the Equip item
]
def endMoonBunny():
sm.warpInstanceOut(933000000)
if sm.getFieldID() == 933001000:
sm.setSpeakerID(parentID)
if field.getProperty("stage") == 2:
selection = sm.sendNext("Yum, yum! This is so tasty. Ple... | Python | 1 |
on": "bedrock-2023-05-31",
"max_tokens": 65536,
"messages": [{"role": "user", "content": prompt}],
"temperature": 0.1,
"top_p": 0.9,
}
response = self.bedrock_client.invoke_model(
modelId=model_id,
... | Python | 1 |
ont and terminal*. Among the longest Unicode codepoints is"]
#[doc = ""]
#[doc = " U+FDFD ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM ﷽"]
#[doc = ""]
#[doc = " wcwidth() rather optimistically claims this most exalted glyph to occupy"]
#[doc = " a single column. BiDi text is too complicated for me to even get into ... | Rust | 0 |
from celery import shared_task
from allianceauth.corputils.models import CorpStats
@shared_task
def update_corpstats(pk):
cs = CorpStats.objects.get(pk=pk)
cs.update()
@shared_task
def update_all_corpstats():
for cs in CorpStats.objects.all():
update_corpstats.delay(cs.pk)
| Python | 1 |
image = images.from_enum(
ImageEnum.EDITNODE, width=images.NODE_SIZE, scale=scale
)
return image
class NodeDraw:
def __init__(self) -> None:
self.custom: bool = False
self.image: PhotoImage | None = None
self.image_enum: ImageEnum | None = None
self.im... | Python | 1 |
import os
train_audio_dir = '/home/ssd2/kinect_sound/audio/train'
test_audio_dir = '/home/ssd2/kinect_sound/audio/test'
def get_file_list(read_path):
'''
获取文件夹下图片的地址
:param read_path:
:return:
'''
path = read_path
dirs = os.listdir(path)
floder_len = len(dirs)
file_name_list = []
... | Python | 1 |
import pytest
import requests
import json
BASE_URL = "http://localhost:8000"
class TestGLM45Compatibility:
"""Test suite for GLM-4.5 compatibility"""
def test_health_endpoint(self):
"""Test that health endpoint works"""
response = requests.get(f"{BASE_URL}/api/health")
assert respons... | Python | 1 |
',
existing_type=mysql.VARCHAR(length=100),
nullable=True)
batch_op.alter_column('user_id',
existing_type=mysql.INTEGER(),
nullable=True)
with op.batch_alter_table('friendship', schema=None) as batch_op:
batch_op.alter_column('user_id_2',
... | Python | 1 |
APTER_D3D9_KHR IDirect3DDevice9 * (if the cl_khr_dx9_media_sharing extension is supported).
// CL_CONTEXT_ADAPTER_D3D9EX_KHR IDirect3DDeviceEx* (if the cl_khr_dx9_media_sharing extension is supported).
// CL_CONTEXT_ADAPTER_DXVA_KHR IDXVAHD_Device * (if ... | Rust | 0 |
te": 0.0,
},
)
registry.register_model_config(
"levit_384",
LeViT,
config={
"embed_dim": [384, 512, 768],
"key_dim": 32,
"num_heads": [6, 9, 12],
"depths": [4, 4, 4],
"drop_path_rate": 0.1,
},
)
registry.register_weights(
"levit_128s_il-common",
{
... | Python | 1 |
v2.threshold(gray_frame,254,255, cv2.THRESH_BINARY)
#gray_frame = cv2.flip(gray_frame, 1)
# Detect blobs in the frame
keypoints = detector.detect(gray_frame)
points = cv2.KeyPoint_convert(keypoints)
# Check if a blob is present
if len(points) > 0:
point = points[0] # Take the first det... | Python | 1 |
] Error executing transaction: {str(e)}")
logger.error(f"[MANAGER] Error type: {type(e).__name__}")
import traceback
logger.error(f"[MANAGER] Traceback: {traceback.format_exc()}")
new_transaction.status = "FAILED"
... | Python | 1 |
_base_ = '../replknet-31B_32xb64_in1k.py'
model = dict(backbone=dict(small_kernel_merged=True))
| Python | 1 |
'𘯀', '🌿',
'⍉', 'ᛲ', 'ေ', '\u{11d42}', '𐛽', '%', '⋏', 'ꝟ', '°', '𘱘', '𒐍',
'Ꮶ', '𐬌', '𐓹', 'ㆷ', '𔔆', '𑜳', 'Ǎ', 'ꆅ', '𥄳', '𑆔', '⌊', '𐤦',
'\u{202f}', 'ɤ', '𑵰', 'థ', '🍇', '𝤔', 'ប', '┼', '𘠍', '𐎵', 'ᔈ',
'𛇈', '🕉', 'ര', 'ਓ', '\u{36f}', '\u{36d}', '\u{1dee}', '𒃾', '\u{1072}', '益',
'㊯', '\u{... | Rust | 0 |
NCTUATION), // PUNCTUATION SPACE
'\u{2009}' => Some(space::SPACE_EM_5), // THIN SPACE
'\u{200A}' => Some(space::SPACE_EM_16), // HAIR SPACE
'\u{202F}' => Some(space::SPACE_NARROW), // NARROW NO-BREAK SPACE
'\u{205F}' => Some(space::SPACE_4_EM_18)... | Rust | 0 |
: char = '\u{0989}';
pub(crate) const B_UU: char = '\u{098A}';
pub(crate) const B_RRI: char = '\u{098B}'; // BENGALI LETTER VOCALIC R
pub(crate) const B_VOCALIC_L: char = '\u{098C}';
pub(crate) const B_E: char = '\u{098F}';
pub(crate) const B_OI: char = '\u{0990}'; // BENGALI LETTER AI
pub(crate) const B_O: char = '\u{... | Rust | 0 |
from config import *
from Unet import UNet
import torch
from torch import nn
from difussion import *
import matplotlib.pyplot as plt
from dataset.dataset import tensor_to_pil
from lora import inject_lora, LoraLayer
def backward_senoise(model, batch_x_t, batch_class):
step = [batch_x_t,]
global alphas,alphas_c... | Python | 1 |
te block 4
consensus
.in_message_tx()
.unbounded_send(ConsensusInMessage::Generate)
.unwrap();
base::wait_block_execution(&chain, 4).await;
let tx1_receipt = chain.get_receipt(&tx1_hash).unwrap().unwrap();
let tx1_result = tx1_receipt.result.unwrap();
let tx1_result: Vec<u8> = Decode::decode(&mut &tx1_resul... | Rust | 0 |
, 0x05, 0xbb, 0x7f, 0x06, 0x5e, 0x25, 0x6f, 0xf4, 0x54, 0xf8, 0xa8, 0xdf, 0x6f, 0x2f, 0x9b, 0x8a, 0x8c, 0x95, 0x08, 0xca, 0xac, 0xfe, 0xe9, 0x52, 0x1c, 0xbe, 0x68, 0x9d, 0xd1, 0x12, 0x0f
],
external_ovk: [
0xdb, 0x97, 0x52, 0x0e, 0x2f, 0xe3, 0x68, 0xad, 0x50, 0x2d, 0x... | Rust | 0 |
6x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If n... | Python | 1 |
import numpy as np
class BagLearner:
def __init__(self, learner, kwargs, bags = 20, boost = False, verbose = False):
self.learner = learner
self.kwargs = kwargs
self.bags = bags
self.boost = boost
self.verbose = verbose
self.learners = []
for i in range(self... | Python | 1 |
S r SSKJr SSKrSSKrSSKrSSKJrJrJ r SSK
r
SSKr
SSKr
SSK
JrJrJr \ ( a SSKJr SSKrSSKJr SSKJr SS jr SS
jr " S S5 r " S
S5 rSS jr SS jrg)... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
internal_project_id = fields.Many2one(
related='company_id.internal_project_id', re... | Python | 1 |
X Residuals vs reduced local coordinates (Strip)
TProfileYResStripModules = dict(Nbinx = 34, xmin = -1.02, xmax = 1.02),
# X Residuals vs reduced local coordinates (Pixel)
TProfileXResPixelModules = dict(Nbinx = 17, xmin = -1.02, xmax = 1.02),
# X Residuals vs reduced local coordinates (Pixel)
TPr... | Python | 1 |
pers::TestApp;
#[actix_rt::test]
async fn top_returns_a_200_for_valid_form_data() {
// Arrange
let app = TestApp::spawn().await;
let body = "source=codeforces&query=EbTec&many=10";
// Act
let response = app.post_autocomplete(body.into()).await;
// Assert
assert_eq!(200, response.status().... | Rust | 0 |
from odoo import api, fields, models
class LLMPublisher(models.Model):
_name = "llm.publisher"
_description = "LLM Publisher"
_inherit = ["mail.thread"]
name = fields.Char(required=True, tracking=True)
logo = fields.Image(
max_width=1024, max_height=1024, verify_resolution=True, help="Pub... | Python | 1 |
0 => Ok(()),
1 => Err(PluginError::Unknown),
2 => Err(PluginError::OutOfMemory),
3 => Err(PluginError::NotImplemented),
4 => Err(PluginError::InvalidArguments),
5 => Err(PluginError::InvalidPassword),
_ => return None,
})
}... | Rust | 0 |
from Hyper import Configurator
import re
import httpx
import json
import os
import time
# 加载配置
Configurator.cm = Configurator.ConfigManager(Configurator.Config(file="config.json").load_from_file())
# 插件信息
TRIGGHT_KEYWORD = "Any"
class BilibiliDelayManager:
def __init__(self):
self.data_dir = "./data/bili... | Python | 1 |
e owner unique identifier."]
pub id: u64,
#[doc = "< The owner name."]
pub name: [::std::os::raw::c_char; 64usize],
}
#[test]
fn bindgen_test_layout_rte_eth_dev_owner() {
assert_eq!(
::std::mem::size_of::<rte_eth_dev_owner>(),
72usize,
concat!("Size of: ", stringify!(rte_eth_dev_... | Rust | 0 |
# Задание №3
# ✔ Напишите программу, которая получает целое число и возвращает
# его двоичное, восьмеричное строковое представление.
# ✔ Функции bin и oct используйте для проверки своего
# результата, а не для решения.
# Дополнительно:
# ✔ Попробуйте избежать дублирования кода
# в преобразованиях к разным системам счис... | Python | 1 |
[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Screen/onchange)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Screen`*"]
pub fn onchange(this: &Screen) -> Option<::js_sys::Function>;
# [wasm_bindgen (structural , method , setter , js_class... | Rust | 0 |
elmetIsSilver),
17 => Ok(PotentStrengthPotionActive),
_ => Err(Error::Message("invalid flag id")),
}
}
}
impl Encode for Flag {
fn encode<W: Write>(&self, e: &mut Encoder<W>) -> Result<(), encode::Error<W::Error>> {
e.array(1)?.u8(*self as u8)?;
Ok(())
}
}
pub fn max_hp(ccst: &CharacterC... | Rust | 0 |
{
if rows.len() > 0 {
warn!("[osu_submit_modular] Duplicate score detected: player {}({}), score_md5: {}, duplicate with: {:?}", player_name, player_id, s.md5, rows);
return failed;
}
}
Err(err) => {
error!(
"[osu_submi... | Rust | 0 |
(&class_type),
Action::Destroy => handle_destroying(&class_type),
}
}
use stm32f3_discovery::stm32f3xx_hal as hal;
use cortex_m::peripheral::DWT;
use hal::{rcc::Clocks, time::rate::Hertz};
/// A monotonic nondecreasing timer. This is a resurrection of MonoTimer from
/// the stm32f3xx-hal where it got remo... | Rust | 0 |
eposts_count"] > 0):
self.get_weibo_reposts(
weibo, repost_max_count, self.sqlite_insert_reposts
)
count += 1
# 为防止被ban抓取一定数量的转发后随机睡3到6秒
if count % 20:
sleep(random.randint(3, 6))
for weibo i... | Python | 1 |
# Copyright 2018-2020 Akretion France (https://akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class ResPartner(models.Model):
_inherit = "res.partner"
def _get_gravatar_image(self, email):
... | Python | 1 |
If we have a card, check for numeric tokens
if card:
numeric_token_count = getattr(card, "numeric_token_count", 0)
# Also check for numbers in the text if numeric_token_count not set
if numeric_token_count == 0:
text = getattr(card, "snipp... | Python | 1 |
= std::mem::transmute([
r, g, b, r, g, b, r, g, // QW1
b, r, g, b, r, g, b, r, // QW2
g, b, r, g, b, r, g, b, // QW3
]);
*ptr = d1;
*ptr.of... | Rust | 0 |
: u32 = 35379;
pub const GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT: u32 = 35380;
pub const GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH: u32 = 35381;
pub const GL_ACTIVE_UNIFORM_BLOCKS: u32 = 35382;
pub const GL_UNIFORM_TYPE: u32 = 35383;
pub const GL_UNIFORM_SIZE: u32 = 35384;
pub const GL_UNIFORM_NAME_LENGTH: u32 = 35385;
pub co... | Rust | 0 |
is one, discard it and return its result.
if let Some((index, result)) = item {
self.0.swap_remove(index);
result
} else {
Ok(Async::NotReady)
}
}
}
/// Returns `true` if a `poll` indicates that its future has finished.
fn is_ready_or_err<T, E>(poll: &P... | Rust | 0 |
model.features.transition2.conv]
else:
raise RuntimeError('Model not supported.')
# invert the data normalization before visualizing raw images
transforms = T.Compose([T.Normalize([0,0,0],[255/63.0,255/62.1,255/66.7]),
T.Normalize([-125.3/255,-123.0/... | Python | 1 |
.map(|(_index, (_, _, cost))| cost)
.sum::<f32>();
// bail, we got a worse plan!
if new_plan_cost >= existing_plan_cost && plan_is_valid(&game, &existing_plan) {
//println!("bailing longer plan! existing_plan_cost: {}, new_plan_cost: {}", existing_pl... | Rust | 0 |
e("item"));
for item_1258 in var_1257 {
#[allow(unused_mut)]
let mut entry_1260 = list_1259.entry();
crate::query_ser::serialize_structure_group_identifier(entry_1260, item_1258);
}
list_1259.finish();
}
#[allow(unused_mut)]
let mut scope_1261 = wr... | Rust | 0 |
return Ok(x),
Err(e) => {
log::warn!("Attempt failed: {:?}", e);
count -= 1;
if count == 0 {
log::warn!("Retry limit reached");
return Err(e);
} else {
log::warn!("Retrying... (remaini... | Rust | 0 |
put_ids[0][inputs.input_ids.shape[1] :], skip_special_tokens=True
)
with open(f"{self.save_dir}/llm_output_{self.episode_idx: 04d}.txt", 'w') as f:
f.write(self.llm_output)
self.last_output_ids = copy.deepcopy(output_ids[0])
self.past_key_values = copy.deepcopy(outputs.past_k... | Python | 1 |
import os
from google import genai
from google.genai import types
from src.core.llm_predictor.llm_predictor import LLMPredictor
from dotenv import load_dotenv, find_dotenv
from tenacity import retry, stop_after_attempt, wait_exponential, retry_if_exception_type
# Load environment variables
load_dotenv(find_dotenv()... | Python | 1 |
antomData<F>,
constraint_field: PhantomData<CF>,
polynomial_commitment: PhantomData<PC>,
pc_check: PhantomData<PCG>,
}
impl<
F: PrimeField,
CF: PrimeField,
PC: PolynomialCommitment<F, DensePolynomial<F>>,
PCG: PCCheckVar<F, DensePolynomial<F>, PC, CF>,
> AHPForR1CS<F, CF... | Rust | 0 |
import numpy as np
import cv2 as cv
src = cv.imread('/home/pi/mse112-ws-student/OpenCV_tutorials/Geometric_transformations/sfu.png')
# method output the dimension directly
height, width = src.shape[:2] # acquire the original dimension
# increase size by 50%, interpolation cubic spline
res1 = cv.resize(src, (int(1.... | Python | 1 |
fn terminator_effect(
&self,
trans: &mut impl GenKill<Self::Idx>,
_terminator: &mir::Terminator<'tcx>,
location: Location,
) {
drop_flag_effects_for_location(self.tcx, self.body, self.mdpe, location, |path, s| {
Self::update_bits(trans, path, s)
});
... | Rust | 0 |
/// @param viewport The buffer viewport structure that will be populated with
/// retrieved data.
pub fn gvr_buffer_viewport_list_get_item(
viewport_list: *const gvr_buffer_viewport_list,
index: usize,
viewport: *mut gvr_buffer_viewport,
);
}
extern "C" {
/// Update an element ... | Rust | 0 |
# ",/usr/bin/env python,
# ,
# Copyright 2018-present Facebook. All Rights Reserved.,
# ,
# This program file is free software; you can redistribute it and/or modify it,
# under the terms of the GNU General Public License as published by the,
# Free Software Foundation; version 2 of the License.,
# ,
# This program is ... | Python | 1 |
}
if focused.0 {
self.update_default_state(focused.1, "focus", widget);
}
let mut selected = (false, false);
if let Ok(sel) = widget.borrow_mut_property::<Selected>() {
selected = (true, sel.0);
}
if selected.0 {
self.update... | Rust | 0 |
whether this is the last fragment in a sequence of message fragments. Only required where message has been fragmented.
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "893")]
pub last_fragment: Option<LastFragment>,
/// Specifies the number of repeating symbols (instruments) specified
#[serde(f... | Rust | 0 |
t)) => {
if i == id {
Concrete(AbsType::Forall(i, t))
} else {
let tt = *t;
Concrete(AbsType::Forall(i, Box::new(tt.subst(id, to))))
}
}
// Trivial recursion
Concrete(AbsType:... | Rust | 0 |
E_D: u32 = 32;
const SCANCODE_F: u32 = 33;
const SCANCODE_Z: u32 = 44;
const SCANCODE_X: u32 = 45;
const SCANCODE_C: u32 = 46;
const SCANCODE_V: u32 = 47;
if let Some(keycode) = virtual_keycode {
let ctrl = self.modifiers_state.ctrl();
let shift =... | Rust | 0 |
ge the half life of the item, maintaining the same frecency
pub fn set_half_life(&mut self, half_life: f32) {
let old_frecency = self.get_frecency();
self.half_life = half_life;
self.set_frecency(old_frecency);
}
/// Calculate the frecency of the item
pub fn get_frecency(&self) ... | Rust | 0 |
#[no_mangle]
fn png_create_write_struct(user_png_ver: png_const_charp,
error_ptr: png_voidp, error_fn: png_error_ptr,
warn_fn: png_error_ptr) -> png_structp;
/* Allocate and initialize the info structure */
#[no_mangle]
fn png_create_info... | Rust | 0 |
DeadHorn,
Tube,
Brain,
Bubble,
Fire,
Horn,
}
impl CoralVariant {
pub fn as_string(self) -> &'static str {
match self {
CoralVariant::DeadTube => "dead_tube",
CoralVariant::DeadBrain => "dead_brain",
CoralVariant::DeadBubble => "dead_bubble",
... | Rust | 0 |
}
#[derive(Deserialize)]
struct TagListDe {
scope: TagScope,
tags: TagsDe,
}
impl From<TagListDe> for TagList {
fn from(tag_list_de: TagListDe) -> Self {
let mut tag_list = tag_list_de.tags.0;
tag_list.get_mut().unwrap().set_scope(tag_list_de.scope);
tag_list
}
}
impl<'de> De... | Rust | 0 |
end_after(deep_expr.unary_op().op.clone());
}
}
(flat_nodes, flat_ops)
}
#[cfg(feature = "partial")]
mod detail_diff {
use std::{cmp::Ordering, fmt::Debug};
use smallvec::SmallVec;
use crate::{
definitions::N_UNARYOPS_OF_DEEPEX_ON_STACK,
operators::UnaryOp,
... | Rust | 0 |
uch of this crate is _unstable_ and thus the API is likely to undergo
//! change. Implementors of traits should not rely on the interfaces to remain
//! the same.
// This provides "unused" building blocks to other crates
#![allow(dead_code)]
// our error-chain could potentially blow up otherwise
#![recursion_limit="1... | Rust | 0 |
ta: &InstanceInfo) -> anyhow::Result<()> {
use async_std::os::unix::net::UnixDatagram;
use async_std::task;
let systemd_socket = env::var_os("NOTIFY_SOCKET").unwrap();
let systemd = task::block_on(async {
let sock = UnixDatagram::unbound()
.context("cannot create systemd notify sock... | Rust | 0 |
setwd(normalizePath(dirname(R.utils::commandArgs(asValues=TRUE)$"f")))
source('../findNSourceUtils.R')
test.pub_636_column_references <- function(H2Oserver) {
prostatePath = system.file("extdata", "prostate.csv", package="h2o")
prostate.hex = h2o.importFile(H2Oserver, path = prostatePath, key = "prostate.hex")
prost... | Python | 1 |
ize,
concat!(
"Offset of field: ",
stringify!(nk_style_item),
"::",
stringify!(data)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nk_style_text {
pub color: nk_color,
pub padding: nk_vec2,
}
#[test]
fn bindgen_test_layout_nk_style... | Rust | 0 |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... | Python | 1 |
racy_score(y_true, y_pred)
assert balanced == pytest.approx(macro_recall)
adjusted = balanced_accuracy_score(y_true, y_pred, adjusted=True)
chance = balanced_accuracy_score(y_true, np.full_like(y_true, y_true[0]))
assert adjusted == (balanced - chance) / (1 - chance)
def test_multilabel_jaccard_simila... | Python | 1 |
import json
player = {
'players':[
{'id': 'P101', 'Name': 'Sachin Tendulkar', 'Matches': 585, 'runs': 28500, 'age': 38},
{'id': 'P102', 'Name': 'Sourav Ganguly', 'Matches': 430, 'runs': 19400, 'age': 36},
{'id': 'P103', 'Name': 'Rahul Dravid', 'Matches': 390, 'runs': 18500, 'age': 35},
... | Python | 1 |
f(self, t.as_slice::<$typ>()?, dst.as_slice_mut::<$typ_dst>()?)?;
return Ok(dst)
}
)*
)*
bail!("{} does not support {:?}", self.name(), t.datum_type());
}
$(
fn cos... | 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... | Python | 1 |
ut().enumerate() {
*octopus += 1;
if *octopus == 10 {
flashing_octopus_indices.push(index);
}
}
while !flashing_octopus_indices.is_empty() {
let mut new_flashing_octopus_indices: Vec<usize> = Vec::with_capacity(GRID_SIZE.pow(2));
... | Rust | 0 |
DefaultShaders = [
[
[
["INT","irradianceMap",0],
["INT","prefilterMap",1],
["INT","brdfLUT",2],
["INT","albedoMap",3],
["INT","normalMap",4],
["INT","metallicMap",5],
["INT","roughnessMap... | Python | 1 |
n function to preprocess SST-2 data.
Args:
data_dir (str): Path to SST-2 dataset directory.
output_dir (str): Path to save processed data.
Returns:
tuple: Processed data and vocabularies.
"""
if not os.path.exists(data_dir):
print(" Dataset directory not found. Downloa... | Python | 1 |
x>,
}
let mut state = Vec::<MergeGroup>::new();
// Create the initial state by giving each RangeFragIx its own Vec, and
// tagging it with its interface blocks.
for fix in all_frag_ixs_for_reg {
let mut live_in_blocks = Set::<BlockIx>::empty();
let mut s... | Rust | 0 |
import logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.DEBUG)
import requests
import settings
SEARCH_ENABLED = bool(settings.MEILI_URL)
def meili_api(method, route, json=None, params=None, parse_json=True):
try:
r = method(settings... | Python | 1 |
from django.db import models
class Service(models.Model):
name = models.CharField(max_length=200, null=True, blank=False)
image = models.ImageField(upload_to="services")
def __str__(self):
return self.name
class ServiceDetail(models.Model):
service = models.ForeignKey(Service, on_delete=mod... | Python | 1 |
proceso.
#[derive(Debug)]
pub enum ProcessState {
Running,
Sleeping,
Waiting,
Dead,
}
/// Proceso
/// Cada proceso posee los siguientes atributos:
/// * frame: representa el contexto del proceso, es decir, el estado de los
/// registros, stack pointer, mmu, etc.
/// * stack: una porción de memoria par... | Rust | 0 |
of this field. Ignores missing values in this
/// computation. If all values are missing, returns `0.0`.
fn stdevp(&self) -> f64 {
self.varp().sqrt()
}
}
impl<DI> Variance for DI
where
DI: DataIndex + SumSq + NaCount + Mean,
<DI as SumSq>::Output: AsPrimitive<f64>,
{
fn var(&self) -> f... | Rust | 0 |
"""Module defines type annotations for use with SQLAlchemy models."""
from datetime import datetime
from typing import Annotated
from sqlalchemy import text
from sqlalchemy.orm import mapped_column
INT_PK = Annotated[int, mapped_column(primary_key=True, nullable=False)]
CREATED_AT_DATETIME = Annotated[
datetime... | Python | 1 |
eeBee<'a, 'b: 'a, T: 'b> {
//~^ ERROR outlives requirements can be inferred
tee: &'a &'b T,
}
struct BeeOutlivesAyTeeAyBee<'a, 'b: 'a, T: 'a + 'b> {
//~^ ERROR outlives requirements can be inferred
tee: &'a &'b T,
}
struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b: 'a... | Rust | 0 |
#!/usr/bin/env python
# Copyright (c) Prophesee S.A.
#
# 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 applicable law or agreed t... | Python | 1 |
r::Builder::new(&mut buf);
ar.mode(tar::HeaderMode::Deterministic);
ar.follow_symlinks(false);
ar.append_dir_all(".", source_dir)?;
ar.finish()?;
}
let archive = std::fs::OpenOptions::new()
.write(true)
.create(true)
.tr... | Rust | 0 |
id::<RefNode>::new(match self {
$( Self::$nid(v) => v.as_ref() ),*
})
}
}
}
}
macro_rules! cst_macro_helper {
(token $id:ident) => {
SyntaxKind::Token(McTokenKind::$id)
};
(group $id:ident) => {
SyntaxKind::Group(McGroupType::$id)
... | Rust | 0 |
qual(
sol["Terminal voltage [V]"].data, sol2["Terminal voltage [V]"].data
)
for idx1, idx2 in [(1, 0), (2, 1), (4, 2)]:
np.testing.assert_array_equal(
sol.cycles[0].steps[idx1]["Terminal voltage [V]"].data,
sol2.cycles[0].steps[idx2]["Terminal volt... | Python | 1 |
nvironment_credential() {
let message = r#"{
"job_id": 123,
"parameters": [
{
"id":"key",
"type":"string",
"value": "unset_credential_key",
"store": "env"
}
]
}"#;
let result = Job::new(message);
assert!(result.is_ok());
let job = result.unwrap();
ass... | Rust | 0 |
pub type EFUSE_PGM_DATA1 = crate::Reg<u32, _EFUSE_PGM_DATA1>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _EFUSE_PGM_DATA1;
#[doc = "`read()` method returns [efuse_pgm_data1::R](efuse_pgm_data1::R) reader structure"]
impl crate::Readable for EFUSE_PGM_DATA1 {}
#[doc = "`write(|w| ..)` method takes [efuse_pgm_data... | Rust | 0 |
let info = &*iter.data;
if info.type_ == ffi::XCB_INPUT_DEVICE_TYPE_MASTER_POINTER as _ {
assert!(core.is_none());
core = Some((info.deviceid, info.attachment));
}
self.xinput.xcb_input_xi_device_info_next(&mut iter);
... | Rust | 0 |
(), err));
path
}
pub fn resolve_packages(&self) -> io::Result<BTreeMap<package::Name, Package>> {
Ok(cargo::Metadata::from_file_workspace(&self.path, self.root.workspace.clone()).packages.iter().map(|p| (p.package.name.clone(), p.clone())).collect())
}
}
impl Deref for ContainerToml {
... | Rust | 0 |
lement(&user_input) },
Ok(Command::StringLength) => { get_string_length(&user_input) },
Ok(Command::GCContent) => { gc_content(&user_input) },
Err(_) => { return abort("Invalid command!") }
};
match output {
Ok(text) => { println!("{}", text); },
... | Rust | 0 |
item in test_acc:
if item.step <= 25:
test_acc_epoch.append(item.step)
test_acc_value.append(item.value)
# add to list
all_train_loss_epoch.append(train_loss_epoch)
all_train_loss_value.append(train_loss_value)
all_train_acc_value.append(train... | Python | 1 |
"""
API 处理后返回的数据类型
"""
from collections import namedtuple
from lanzou.api.models import FolderList
File = namedtuple('File', ['name', 'id', 'time', 'size', 'type', 'downs', 'has_pwd', 'has_des'])
Folder = namedtuple('Folder', ['name', 'id', 'has_pwd', 'desc'])
FolderId = namedtuple('FolderId', ['name', 'id', 'desc',... | Python | 1 |
::ByPosition(Vec::new()),
},
)
.await?
.result
.res()?;
let config_info: init_info::ConfigInfo = serde_json::from_value(config_info)?;
let bitcoin_info: init_info::BitcoinInfo = serde_json::from_value(
config_info
.plugins
.into_iter()
.filter(... | Rust | 0 |
om<ProxyAuth> for RawControl {
fn from(pa: ProxyAuth) -> RawControl {
RawControl {
ctype: PROXY_AUTH_OID.to_owned(),
crit: true,
val: Some(pa.authzid.into_bytes()),
}
}
}
<reponame>calmofthestorm/orgize<filename>src/elements/fn_ref.rs
use std::borrow::Cow;
us... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.