text string | label_name string | labels int64 |
|---|---|---|
const DEFAULT_PREHASH_MINIMAL_CACHE_SIZE: &str = "0";
const DEFAULT_VIDEO_REMOVE_AUTO_OUTDATED_CACHE: bool = false;
const DEFAULT_IMAGE_REMOVE_AUTO_OUTDATED_CACHE: bool = true;
const DEFAULT_DUPLICATE_REMOVE_AUTO_OUTDATED_CACHE: bool = true;
const DEFAULT_DUPLICATE_CASE_SENSITIVE_NAME_CHECKING: bool = false;
const DE... | Rust | 0 |
f.backtester)
elif self.mode == 'pick_time':
toolbox.register('map', self.picktime_backtester)
self.toolbox = toolbox
def picktime_backtester(self, evaluate, inds):
print('开始择时回测')
df, names = self._calc_df(inds)
results = []
# 向量化回测
# 计算每日收益
... | Python | 1 |
from torch import nn
from nfv.flows import Greenberg, Greenshield, Trapezoidal, Triangular, TriangularSkewed, Underwood
from nfv.models import CNNStencilModel
model_list = {
"greenshield": {
"supervised": CNNStencilModel(act=nn.ELU, clip=Greenshield().qmax), # q1lcz88q
"unsupervised": CNNStencilM... | Python | 1 |
let height = buf.read_u32::<BigEndian>()?;
//! BitmapExtents { width, height }
//! };
//! let data = {
//! (0..extents.width * extents.height)
//! .map(|_| Pixel::read(buf))
//! .collect::<Result<_, _>>()?
//! };
//! Ok... | Rust | 0 |
);
right.append(head_second);
}
(left, right)
}
// Generic multipoint crossover. This version skips indices that will not be effected,
// making it somewhat more complex then necessary.
pub fn cross_at_points<T>(pair: &mut [Ind<T>], bits_per_sym: usize, cross_points: &[usize])
where T: ... | Rust | 0 |
payment stream's reset dates.
#[serde(flatten)]
pub payment_stream_reset_date_business_center_grp: Option<super::payment_stream_reset_date_business_center_grp::PaymentStreamResetDateBusinessCenterGrp>,
/// Conditionally required when PaymentStreamResetFrequencyUnit(40765) is specified.
#[serde(skip_serializing_if ... | Rust | 0 |
, x));
assert_eq!(4, offset_of!(ReprC, y));
assert_eq!(8, offset_of!(ReprC, z));
}
#[cfg(not(miri))]
#[test]
fn compile_errors_are_good() {
let t = trybuild::TestCases::new();
t.compile_fail("shouldfail/*.rs");
}
}
use std::io;
use std::net::{IpAddr, SocketAddr}... | Rust | 0 |
EncodingTag::U32 => 0b_0000_0010_u8,
EncodingTag::U64 => 0b_0000_0011_u8,
EncodingTag::I8 => 0b_0000_1000_u8,
EncodingTag::I16 => 0b_0000_1001_u8,
EncodingTag::I32 => 0b_0000_1010_u8,
EncodingTag::I64 => 0b_0000_1011_u8,
En... | Rust | 0 |
PERF_ATTR_SIZE_VER0: u32 = 64;
pub const PERF_ATTR_SIZE_VER1: u32 = 72;
pub const PERF_ATTR_SIZE_VER2: u32 = 80;
pub const PERF_ATTR_SIZE_VER3: u32 = 96;
pub const PERF_ATTR_SIZE_VER4: u32 = 104;
pub const PERF_ATTR_SIZE_VER5: u32 = 112;
pub const PERF_RECORD_MISC_CPUMODE_MASK: u32 = 7;
pub const PERF_RECORD_MISC_CPUMO... | Rust | 0 |
# encoding: utf-8
import torch
from torch import nn
from .batch_norm import get_norm
class Non_local(nn.Module):
def __init__(self, in_channels, bn_norm, reduc_ratio=2):
super(Non_local, self).__init__()
self.in_channels = in_channels
self.inter_channels = reduc_ratio // reduc_ratio
... | Python | 1 |
ials_count' in d:
o.materials_count = d['materials_count']
if 'production_order_no' in d:
o.production_order_no = d['production_order_no']
if 'receiver_name' in d:
o.receiver_name = d['receiver_name']
if 'receiver_phone' in d:
o.receiver_phone = d[... | Python | 1 |
reeProcessorError> {
if meta.next_slots.is_empty() {
// Reached the end of this fork. Record the final entry height and last entry.hash
let bfi = BankForksInfo {
bank_slot: bank.slot(),
};
fork_info.push((bank.clone(), bfi));
return Ok(());
}
// This is ... | Rust | 0 |
"""Wrapper around Embedchain Retriever."""
from __future__ import annotations
from typing import Any, Iterable, List, Optional
from langchain_core.callbacks import CallbackManagerForRetrieverRun
from langchain_core.documents import Document
from langchain_core.retrievers import BaseRetriever
class EmbedchainRetrie... | Python | 1 |
if statement (ending the block)
const END_BLOCK_CHANCE: usize = 4;
// Chance of ending the program generation, finishing all unfinished blocks
// unconditionally.
// This is effectively what limits the size of the program (and the
// `MAX_INPUT_SIZE_BITS`)
const DONE_CHANCE: usize = 128;
... | Rust | 0 |
# backend/routes/sandboxes.py
import os
import json
from flask import Blueprint, jsonify, request, abort
from utils.db import Session, get_session, User
from fastapi import APIRouter, Request, Depends, HTTPException
from typing import Annotated
SessionDep = Annotated[Session, Depends(get_session)]
router = APIRouter(... | Python | 1 |
WITH_3DES_EDE_CBC_SHA: SSLCipherSuite = 0x0013;
pub const SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA: SSLCipherSuite = 0x0014;
pub const SSL_DHE_RSA_WITH_DES_CBC_SHA: SSLCipherSuite = 0x0015;
pub const SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA: SSLCipherSuite = 0x0016;
pub const SSL_DH_anon_EXPORT_WITH_RC4_40_MD5: SSLCipherSuite = ... | Rust | 0 |
def bullet_collision(self):
if self.bullet_sprites:
for bullet in self.bullet_sprites:
collision_sprites = pygame.sprite.spritecollide(bullet, self.enemy_sprites, False, pygame.sprite.collide_mask)
if collision_sprites:
self.impact_sound.play()
... | Python | 1 |
lambda x: (12.92 * x) if (x <= 0.0031308) else ((1.0 + 0.055) * pow(x, (1.0 / 2.4)) - 0.055),
[r, g, b]
)
# Bring all negative components to zero
r, g, b = map(lambda x: max(0, x), [r, g, b])
# If one component is greater than 1, weight components by that value.
... | Python | 1 |
import os
import pygame
from gtts import gTTS
pygame.init()
pygame.mixer.init()
def speak_text(text):
"""
Turn a given text into speech and play the sound that is created.
The speech will be moved into a temporary mp3 file that will be deleted after the speech is done.
Args:
text (str): Text... | Python | 1 |
await session.execute(text(create_table_sql))
await session.commit()
self.logger.info("✅ 角色详细信息表创建成功")
except Exception as e:
self.logger.error(f"❌ 创建角色详细信息表失败: {e}")
raise
async def create_role(self, role_de... | Python | 1 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import logging
from torch.nn.init import xavier_normal_
class MLPModel(nn.Module):
"""基于MLP的预测模型"""
def __init__(self, config, feature_info):
"""
初始化MLP模型
Args:
config: 模型配置
... | Python | 1 |
# Copyright (c) 2019, Adobe Inc. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike
# 4.0 International Public License. To view a copy of this license, visit
# https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode.
"""
自定义pytorch函数,实现一维、二维、三维张量的DWT和IDWT... | Python | 1 |
import copy
import os, sys
import math
import numpy as np
import cv2
sys.path.append("OpenSeeFace/")
from tracker import Tracker, get_model_base_path
features = ["eye_l", "eye_r", "eyebrow_steepness_l", "eyebrow_updown_l", "eyebrow_quirk_l", "eyebrow_steepness_r", "eyebrow_updown_r", "eyebrow_quirk_r", "mouth_corner_u... | Python | 1 |
from .ReadHelper import read_int_8, read_int_16le
def find_extends(stitches):
min_x = float("inf")
min_y = float("inf")
max_x = -float("inf")
max_y = -float("inf")
for stitch in stitches:
if stitch[0] > max_x:
max_x = stitch[0]
if stitch[0] < min_x:
min_x =... | Python | 1 |
model: The origin model.
"""
self._origin_model = model
@property
def q_model(self):
"""Return the quantized model.
Returns:
model: The quantized model.
"""
return self._q_model
@q_model.setter
def q_model(self, model):
""... | Python | 1 |
иетнамски', 'ml': 'വിയറ്റ്നാമീസ്', 'mn': 'вьетнам', 'mr': 'व्हिएतनामी', 'ms': 'Vietnam', 'mt': 'Vjetnamiż', 'mua': 'Vietnamiya', 'my': 'ဗီယက်နမ်', 'mzn': 'ویتنامی', 'naq': 'Vietnamǁî gowab', 'nb': 'vietnamesisk', 'nd': 'isi-Vietnamese', 'ne': 'भियतनामी', 'nl': 'Vietnamees', 'nmg': 'Kiɛl viɛtnam', 'nn': 'vietnamesisk', ... | Python | 1 |
# Copyright 2015 Open Source Robotics Foundation, Inc.
#
# 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... | Python | 1 |
nosecond",
InputError::InvalidLeapSecond => "invalid leap second",
InputError::InvalidFormat => "invalid format",
}
}
}
/// Possible errors when formatting a `Datetime`.
pub enum FmtError {
UnexpectedEndOfString,
InvalidFormatter(char),
}
impl fmt::Debug for FmtError {
... | Rust | 0 |
10;
str.push_str(&ctrl_digit.to_string());
str
}
<filename>crates/ra_hir/src/docs.rs<gh_stars>1-10
use ra_syntax::ast;
use crate::HirDatabase;
/// Holds documentation
#[derive(Debug, Clone)]
pub struct Documentation(String);
impl Documentation {
pub fn new(s: &str) -> Self {
Self(s.into())
}... | Rust | 0 |
from ..utils import BaseTestClass
import pytest
class TestClass(BaseTestClass):
def test_init(self, univariate_cont_dist):
assert isinstance(univariate_cont_dist().stabilization, str)
assert univariate_cont_dist().stabilization is not None
with pytest.raises(ValueError, match="Invalid stab... | Python | 1 |
# Copyright 2022 The JAX Authors.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | Python | 1 |
_from_hex_all_bytes() {
for i in 0..256 {
let ii: &[u8] = &[i as u8];
assert_eq!(format!("{:02x}", i).from_hex::<Vec<_>>().unwrap(),
ii);
assert_eq!(format!("{:02X}", i).from_hex::<Vec<_>>().unwrap(),
ii);
}
}
}
<filen... | Rust | 0 |
// Map the input to the selected benchmark.
let extrinsic = $crate::sp_std::str::from_utf8(extrinsic)
.map_err(|_| "`extrinsic` is not a valid utf8 string!")?;
let selected_benchmark = match extrinsic {
$( stringify!($name) => SelectedBenchmark::$name, )*
_ => return Err("Could not find extr... | Rust | 0 |
u8),
}
impl Opcode {
pub fn new(instruction: u16) -> Result<Self, String> {
match instruction & 0xF000 {
0x0000 => {
if instruction == 0x00A0 {
Ok(Opcode::BRK)
} else if instruction == 0x00E0 {
Ok(Opcode::CLS)
... | Rust | 0 |
a,b=input("enter a number").split(",")
x,y=int(a),int(b)
print("addition is :",x+y,"subtraction is :",x-y,"multiplication:",x*y)
print(f"numbers is({x}),and({y})") | Python | 1 |
m_eps=1e-5,
use_cache=True,
bos_token_id=0,
eos_token_id=2,
tie_word_embeddings=False,
**kwargs
):
super().__init__(bos_token_id=bos_token_id, eos_token_id=eos_token_id, **kwargs)
self.vocab_size = vocab_size
self.max_position_embeddings = max_position... | Python | 1 |
import pytest
from swarms.utils import extract_code_from_markdown
@pytest.fixture
def markdown_content_with_code():
return """
# This is a markdown document
Some intro text here.
Some additional text.
"""
@pytest.fixture
def markdown_content_without_code():
return """
# This is a markdown ... | Python | 1 |
#[allow(dead_code)]
pub(crate) fn cornell_box() -> HittableList {
let mut world = HittableList { objects: vec![] };
let red = YzRect {
mp: Arc::new(Lambertian::new(Vec3::new(0.65, 0.05, 0.05))),
y0: 0.0,
y1: 555.0,
z0: 0.0,
z1: 555.0,
k: 0.0,
};
world.ad... | Rust | 0 |
# Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | Python | 1 |
#!/usr/bin/python
import aud, math, time
def parseNotes(notes, bpm, basefreq, rate = 44100,
notechars = "XXXCXDXEFXGXAXHcXdXefXgXaXhp"):
pos = 0
fadelength = 60/bpm/10
halfchars = "#b"
durationchars = "2345678"
position = 0
sequence = aud.Sequence()
while pos < len(notes):
char = notes[pos]
... | Python | 1 |
field.clone(), new_null_array(field.data_type(), length)))
.collect();
let null_buffer = MutableBuffer::new_null(length);
Arc::new(StructArray::from((fields, null_buffer.into())))
}
DataType::Map(field, _keys_sorted) => {
new_null_list_array::<i32>(da... | Rust | 0 |
# Copyright 2024-2025 DavoCoder
#
# 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 to in writin... | Python | 1 |
has to be
// done here so that the stack frame can keep it all live
// long enough.
let job_b = StackJob::new(oper_b, SpinLatch::new());
let job_b_ref = job_b.as_job_ref();
worker_thread.push(job_b_ref);
// Execute task a; hopefully b gets stolen in the meantime.
... | Rust | 0 |
'mean_scores': mean_scores, 'loss_total': loss_total, 'policy_entropy': policy_entropy, 'policy_approxkl': policy_approxkl, 'policy_clipfrac': policy_clipfrac, 'iter_all_reward': iter_all_reward,
'iter_mean_scores': iter_mean_scores, 'iter_loss_total': iter_loss_total, 'iter_polic... | Python | 1 |
.store(current, Ordering::Relaxed);
current
} else {
LAST_TIME.load(Ordering::Relaxed)
}
}
// cov: end-ignore-line
#[cfg(test)]
fn get_current_time_millis() -> u64 {
let current = LAST_TIME.load(Ordering::Relaxed);
// move by 10 seconds in tests on each call
LAST_TIME.store(current ... | Rust | 0 |
#read--modify--write-api).\n\nFor information about avaliable fields see [comp_param_4](comp_param_4) module"]
pub type COMP_PARAM_4 = crate::Reg<u32, _COMP_PARAM_4>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _COMP_PARAM_4;
#[doc = "`read()` method returns [comp_param_4::R](comp_param_4::R) reader structure"]
im... | Rust | 0 |
", "freq": "single", "short_name": "SDT"},
{"name": "NotionalAmount", "type": "float", "freq": "multiple or single", "short_name": "NA"},
]
def _testing_formatted_string(trade_description: str, run_count: int) -> plt.Figure:
# Text for the fields
fields_text = fields_to_text(FIELDS)
# Create Llm obje... | Python | 1 |
_ymm_ymmm256
0x2000_02B7, 0x3B00_0001,// VEX_Vfmaddss_xmm_xmm_xmmm32_xmm
0x2000_02B7, 0x3B00_0001,// VEX_Vfmaddss_xmm_xmm_xmm_xmmm32
0x2000_02B7, 0x3B00_0001,// VEX_Vfmaddsd_xmm_xmm_xmmm64_xmm
0x2000_02B7, 0x3B00_0001,// VEX_Vfmaddsd_xmm_xmm_xmm_xmmm64
0x2000_02B7, 0x3B00_0001,// VEX_Vfmsubps_xmm_xmm_xmmm128_xmm
... | Rust | 0 |
arena.borrow()))
* fpow(BASE, size);
for child in id.children(&store.dst_arena.borrow()) {
size -= HashType::from(child.size(&store.dst_arena.borrow())) * 2;
debug_assert!(child.get_hash(&store.dst_arena.borrow()).is_some());
... | Rust | 0 |
try:
response = await self.handler(scope)
finally:
signals.template_rendered.disconnect(dispatch_uid=signal_uid)
got_request_exception.disconnect(dispatch_uid=exception_uid)
# Check for signaled exceptions.
self.check_exception(response)
# Save the cl... | Python | 1 |
23cdb21feeab0149,
0x14de113e7ea810d9,
0x52600cd958dac7e7,
0xc83392c14667e488,
0x9f808444bc1717fc,
0x56facb4bcf7c788f,
0x8bcad53245fc3ca0,
0xdef661e83f27d81c,
0x37d4ebcac9ad87e5,
0x6fe8b24f5cdb9324,
0x... | Rust | 0 |
return newString.join(reverseSplitString)
def makeAddStructHandleBody(self, arg, array_len_arg, recursivePointerAccess='', recursionDepth=1):
body = []
members = self.feature_struct_members.get(arg.base_type)
if not members:
return body
for member in members:
... | Python | 1 |
#!usr/bin/env python
# -*- coding: utf-8 -*-
"""
Time:17/1/1
---------------------------
Question:
---------------------------
"""
from keras import Sequential
from keras.layers import LSTM, Dense
from Air_Pollution_Forcast_Beijing.model.data_tranform import scaler, test_x, train_X, test_X, train_y, test_y
import matp... | Python | 1 |
# Copyright 2009-2017 Ram Rachum.
# This program is distributed under the MIT license.
from python_toolbox import nifty_collections
from python_toolbox.cute_iter_tools import double_filter
def test_double_filter():
(first_iterable, second_iterable) = \
double_filter(lambda value: value ... | Python | 1 |
_probe_jlink.interface);
if config_probe_jlink.interface == "JTAG" {
jlink.arg("-JTAGConf").arg("-1,-1");
}
}
fn gdb_server_args(gdb_server: &mut Command, config_probe_jlink: &config::ProbeJlink) {
gdb_server.arg("-LocalHostOnly").arg("1");
gdb_server.arg("-Silent").arg("1");
gdb_server.arg... | Rust | 0 |
);
let _ = lang_request(
"https://valid.localhost:7443/localized.html",
StatusCode::OK,
"text/html",
Some("en-US,en;q=0.5"),
None,
);
let _ = request(
"https://valid.localhost:7443/css/style.css",
Stat... | Rust | 0 |
_name1, $fmt_str1, $prefix1)),+);
}
}
macro_rules! nat_eq_basic {
($type0: ty) => {
impl PartialEq<$type0> for Nat {
fn eq(&self, other: &$type0) -> bool {
if self.is_nan() {false}
else {
let x = Nat::from(*other);
self... | Rust | 0 |
_dir, "wallet2", &client2, arg_vec.clone())?;
// already exists
assert!(execute_command(&app, test_dir, "wallet2", &client2, arg_vec).is_err());
let arg_vec = vec!["mimble-wallet", "-p", "password", "account", "-c", "account_2"];
execute_command(&app, test_dir, "wallet2", &client2, arg_vec)?;
// let's see those ... | Rust | 0 |
z_coords)
#--
# 建立網格
mesh = pg.Mesh(2)
# 使用計算出的節點座標創建網格
mesh.createGrid(NumPy_FullMesh_x_coords, NumPy_FullMesh_z_coords)
# 展示
pg.show(mesh, markers=True, showMesh=True, label="Mesh01")
plt.savefig('Mesh01.png')
#--
# 預設使用 mesh.createGrid 就會填入預設的邊界的Marker。
# BERT在逆推時會自行處理邊界,... | Python | 1 |
import bpy
import os
from bpy.props import PointerProperty, StringProperty, CollectionProperty, BoolProperty
from . import (_properties_, _functions_)
class JK_MMT_Addon_Prefs(bpy.types.AddonPreferences):
bl_idname = "MrMannequinsTools"
resources: StringProperty(name="Resources", description="Where the templa... | Python | 1 |
Procstate::UNUSED => "unused",
Procstate::SLEEPING => "sleep ",
Procstate::RUNNABLE => "runble",
Procstate::RUNNING => "run ",
Procstate::ZOMBIE => "zombie",
}
}
}
impl ProcData {
const fn new() -> Self {
Self {
kstack: 0,
... | Rust | 0 |
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "marimo",
# ]
# ///
import marimo
__generated_with = "0.15.5"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
return (mo,)
@app.cell(hide_code=True)
def _(mo):
mo.md(
"""
# Custom chatbot
... | Python | 1 |
sf5 = +nan
sf6 = -nan
"#;
let node: NodeRef = parse_node!(input);
assert_eq!(std::f64::INFINITY, node.get_key("sf1").as_float_ext());
assert_eq!(std::f64::INFINITY, node.get_key("sf2").as_float_ext());
assert_eq!(std::f64::NEG_INFINITY, node.get_key("sf3").as_float_ext());
ass... | Rust | 0 |
lable!".to_string()));
}*/
let mut rdx = self.rdx.borrow_mut();
*rdx += 1;
let inner = self.inner.borrow();
Ok((*inner)[*rdx - 1])
}
fn read_i16(&self) -> Result<i16, OOBSError> {
self.read_u16().map(|x| unsafe { transmute::<u16, i16>(x) })
}
fn read_u16... | Rust | 0 |
atrix<N, R2, C2, SB>>
for &'a Matrix<N, R1, C1, SA>
where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
SA: Storage<N, R1, C1>,
SB: Storage<N, R2, C2>,
DefaultAllocator: Allocator<N, R1, C2>,
ShapeConstraint: AreMultipliable<R1, C1, R2, C2>,
{
type Output = MatrixMN<N, R1, C2>;
#[inli... | Rust | 0 |
.style("left", "0")
.style("width", "100%")
.style("pointer-events", "none")
}
fn element_below_container() -> RawHtmlEl {
run_once!(|| {
global_styles().style_group(StyleGroup::new(".below > *").style("pointer-events", "auto"));
});
RawHtmlEl::new("div")
.class("below")
... | Rust | 0 |
#!/usr/bin/env python2
from sys import argv, exit
import os
import struct
PVR_TEX_TOOL_CLI = 'PVRTexToolCLI.exe'
def main():
if len(argv) != 3:
print('Usage: convert.py input-dir output-dir')
return -1
try:
os.mkdir(argv[2])
except OSError as e:
pass
for file in os.listdir(argv[1]):
os.s... | Python | 1 |
from typing import List
from datetime import datetime
from collections import deque
# Track execution time of the function
def timeit(func):
def wrapper(*args, **kwargs):
start = datetime.now()
value = func(*args, **kwargs)
end = datetime.now()
print(f"Time: {end-start}")
re... | Python | 1 |
match self.format {
PixelFormat::Rgba8 => Some(Rgba8::align(&self.buf)),
PixelFormat::Bgra8 => None,
}
}
}
#[derive(Debug, PartialEq, Eq)]
pub enum I2pError {
Unknown,
TcpConnectionError,
TcpStreamError,
NotSupported,
InvalidValue,
RouterError,
Par... | Rust | 0 |
able => STABLE.to_owned(),
UpdateChannel::Beta => BETA.to_owned(),
}
}
}
<filename>src/csv/csv_data.rs
use csv::{Position, Reader, StringRecord, Trim};
use log::debug;
use std::error::Error;
use std::fmt::{Display, Formatter};
use std::fs::File;
use std::io::{Read, Seek};
#[derive(PartialEq, De... | Rust | 0 |
, activation='relu'))
model.add(Dense(1024, kernel_initializer='normal', activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(1024, kernel_initializer='normal', activation='relu'))
model.add(Dense(1024, kernel_initializer='normal', activation='relu'))
model.add(Dropout(0.5))
model.add(Den... | Python | 1 |
;
assert_eq!(
parse_reference("task/c@1hours").unwrap().offset,
Some(Duration::hours(1))
);
assert_eq!(
parse_reference("task/c@1 hour").unwrap().offset,
Some(Duration::hours(1))
);
assert_eq!(
parse_reference("task/c@1 ... | Rust | 0 |
let mut csp: CStringPool = Default::default();
unsafe {
VM::start_logging_trace();
info!("Starting micro VM...");
let mvm = mu_fastimpl_new();
let ctx = ((*mvm).new_context)(mvm);
let b = ((*ctx).new_ir_builder)(ctx);
let id_i32 = ((*b).gen_sym)(b, csp.get("... | Rust | 0 |
from trl.commands.cli_utils import init_zero_verbose
init_zero_verbose()
trl_examples_dir = os.path.dirname(__file__)
command = f"python {trl_examples_dir}/scripts/chat.py {' '.join(sys.argv[2:])}"
try:
subprocess.run(
command.split(),
text=True,
... | Python | 1 |
try:
import mpmath as mp
except ImportError:
pass
try:
from sympy.abc import x
except ImportError:
pass
def lagrange_inversion(a):
"""Given a series
f(x) = a[1]*x + a[2]*x**2 + ... + a[n-1]*x**(n - 1),
use the Lagrange inversion formula to compute a series
g(x) = b[1]*x + b[2]*x**2... | Python | 1 |
use crate::error::MyError;
use crate::geometry::traits::rectangable::*;
use roxmltree::{self, Document};
use std::error::Error;
use std::fmt::{self, Display, Formatter};
use std::fs::{self, File};
use std::io::{self, Read};
use std::path::{Path, PathBuf};
use dxf::entities::Entity as DxfEntity;
use dxf::{Drawing, DxfR... | Rust | 0 |
Kontrola impulsywności**: Musi nauczyć się nie reagować na każdy
sygnał z rynku i nie inwestować pod wpływem emocji, które mogą
zmieniać się w zależności od zewnętrznych bodźców.
#### 6. **Droga ewolucji -- jak degen staje się inwestorem:**
Hype Degen może stać się bardziej dojrzałym inwestorem, zmieniając swoje
pode... | Python | 1 |
ED'}
# 删除阻尼追踪约束
class Remove_Damping_Tracking(bpy.types.Operator):
'''Remove_Damping_Tracking'''
bl_idname = "mmr.remove_damping_tracking"
bl_label = "Remove Damping Tracking"
bl_options = {'REGISTER', 'UNDO'} # 启用撤销功能
# 验证物体是不是骨骼
@classmethod
def poll(cls, context):
obj = context... | Python | 1 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | Python | 1 |
from pathlib import Path
import sys
sys.path.append(str(Path(__file__).resolve().parents[1]))
import os, argparse, itertools
import pandas as pd
import matplotlib.pyplot as plt
def main(lp_list, lc_list):
os.makedirs("summary", exist_ok=True)
rows=[]
for lp in lp_list:
for lc in lc_list:
... | Python | 1 |
tional_cost"
}
],
'enable_debug_repost_item_valuation':[
{
"doctype": "Custom Field",
"dt": "Repost Item Valuation",
"fieldname": "custom_items_to_be_repost",
"fieldtype": "Code",
"insert_after": "affected_transactions",
"depends_on": "eval:frappe.session.user == 'Administrator' || frappe.user.h... | Python | 1 |
let mut stream_entry = DirEntry::new("foo", ObjType::Stream, 0);
stream_entry.start_sector = 0;
stream_entry.stream_len = root_entry.stream_len;
let entries = vec![root_entry, stream_entry];
let directory = Directory::new(allocator, entries, 1).unwrap();
MiniAllocator::new(di... | Rust | 0 |
[0, 1000]
up_ft_index: which upsampling block of the U-Net to extract feature, you can choose [0, 1, 2, 3]
ensemble_size: the number of repeated images used in the batch to extract features
Return:
unet_ft: a torch tensor in the shape of [1, c, h, w]
'''
img_t... | Python | 1 |
Font = include_bdf!("examples/10x20.bdf");
fn main() -> Result<(), std::convert::Infallible> {
let mut display = SimulatorDisplay::<Rgb888>::new(Size::new(400, 150));
let style_small = BdfTextStyle::new(&FONT_6X10, Rgb888::RED);
let style_large = BdfTextStyle::new(&FONT_10X20, Rgb888::GREEN);
Text::n... | Rust | 0 |
ue_label, orig_label, temp_label, is_success, variable_names, None, None, None, None, suc_pre_code
if len(variable_names) == 0:
print("no identifier")
# 没有提取到identifier,直接退出
is_success = -3
return code, prog_length, adv_code, true_label, orig_label, t... | Python | 1 |
nt_thread instead",
)]
#[doc(hidden)]
pub mod current_thread;
#[deprecated(since = "0.1.8", note = "use tokio-threadpool crate instead")]
#[doc(hidden)]
/// Re-exports of [`tokio-threadpool`], deprecated in favor of the crate.
///
/// [`tokio-threadpool`]: https://docs.rs/tokio-threadpool/0.1
pub mod thread_pool {
... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 9 10:54:42 2024
@author: vakilifard
"""
import numpy as np
from numpy import linalg as LA
import gstools as gs
from scipy.interpolate import griddata
class Guassian_Random_filed_generator:
"""
# Set up random field parameters
seed = gs... | Python | 1 |
)
# === check for invalid oracle id
assert_raises_rpc_error(
-20,
"oracle <{}> not found".format(invalid_oracle_id),
self.nodes[1].getoracledata,
invalid_oracle_id,
)
assert_raises_rpc_error(
-32600,
"oracle <{}> ... | Python | 1 |
sage"),
};
assert_eq!(target, U256::from_dec_str(
"771946525395830978497002573683960742805751636319313395421818009383503547160"
).unwrap());
});
}
}
}
pub use neon_sys::Neon_Class_GetClassMap as get_class_map;
pub use neon_sys::Neon_Class_SetClassMap as set_class_map;
pub use neon_sys::Neon_Cla... | Rust | 0 |
#!/usr/bin/env python3
"""
Einfacher Test für Reset-Attribute Vereinfachung
Prüft, dass period und reset_signal aus den Templates entfernt wurden.
"""
import re
def test_reset_attributes_simplification():
"""Teste, dass period und reset_signal aus den Templates entfernt wurden."""
print("=== Test: Reset-Attri... | Python | 1 |
, i64>() -> (T, U)
[212; 235) 'G::<u3...i64>()': (u32, i64)
[245; 246) 'd': (u32, i64)
[259; 273) 'G::make::<i64>': fn make<G<u32>, u32, i64>() -> (T, U)
[259; 275) 'G::mak...i64>()': (u32, i64)
[285; 286) 'e': (u32, i64)
[301; 308) 'G::make': fn make<G<u32>, u32, i64>() -> (T, U)
[301; 310)... | Rust | 0 |
);
}
#[test]
#[should_panic]
fn test_n_max_less_than_2(){
let mut rbfs: RadialBasisFunctions = Default::default();
rbfs.construct(1, 0, 3.0);
}
}
#[doc = "Register `lo_cal_ctrl_hw1` reader"]
pub struct R(crate::R<LO_CAL_CTRL_HW1_SPEC>);
impl core::ops::Deref for R {
type Targe... | Rust | 0 |
model_path = os.path.join(models_dir, filename)
history_path = model_path.replace('.keras', '_history.pkl')
# Save model
print(f"Saving model to: {model_path}")
model.save(model_path, save_format='keras')
print(f"Model s... | Python | 1 |
# Generated by Django 5.2.2 on 2025-06-19 18:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("cards", "0010_alter_setprinting_initial_release_date"),
]
operations = [
migrations.AddField(
model_name="rarity",
n... | Python | 1 |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Purpose
Demonstrate create, list, and delete buckets in Amazon S3.
This example is part of the AWS Cloud9 User Guide topic at
https://docs.aws.amazon.com/cloud9/latest/user-guide/sample-python.html
"""
# ... | Python | 1 |
# # method 1 --->
# l = [1, 2, 0, -1, -1, 4, 2, 3, 0, -3]
# s = set()
# for i in range(0, len(l)):
# for j in range(i + 1, len(l)):
# for k in range(j + 1, len(l)):
# if l[i] + l[j] + l[k] == 0:
# temp = [l[i], l[j], l[k]]
# temp.sort()
# s.add(tup... | Python | 1 |
let t = time[i];
if bi.is_member(t, closed_window) {
group.push(i as u32);
} else if bi.is_future(t) {
break;
}
i += 1
}
if !group.is_empty() {
if include_boundaries {
lower_bound.push(bi.... | Rust | 0 |
#!/usr/bin/env python2
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of OpenCPI <http://www.opencpi.org>
#
# OpenCPI is free software: you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Publi... | Python | 1 |
7 = uy * uz * oc - ux * s;
let m8 = c + uzz * oc;
Self::new(m0, m1, m2, m3, m4, m5, m6, m7, m8)
}
}
/******************************************************************************
* Matrix4
*
* i j -------------------------------------------->
* | [m0 = c0_x | m4 = c1_x | m8 = c2_x | m12= c3_x... | Rust | 0 |
拼接过程
self._write_debug_log(f"🔍 chapters_dir: {repr(chapters_dir)} (类型: {type(chapters_dir).__name__})")
self._write_debug_log(f"🔍 准备调用os.path.join({repr(chapters_dir)}, {repr(chapter_filename)})")
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.