text string | label_name string | labels int64 |
|---|---|---|
_y = self.classification_data_loader.test_Y
accs = []
aucs = []
for i,label in enumerate(LABELS_TO_PREDICT):
acc, auc, f1, precision, recall = gen_wrap.compute_all_classification_metrics(preds[:,i], true_y[:,i])
print label, 'Acc:', acc, 'AUC:', auc, 'F1:', f1, 'Precision... | Python | 1 |
.path(Some(default_executable().unwrap()))
.build()
.unwrap(),
)
.unwrap();
std::thread::sleep(std::time::Duration::from_millis(100));
chrome.debug_ws_url.clone()
});
handles.push(hand... | Rust | 0 |
#!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2019, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
"""
Description: Move Joint
"""
import os
import sys
import time
import math
sys.path.append(os.path.join(os.path.dirname(... | Python | 1 |
y = y - 1;
//calculate summed area, see https://en.wikipedia.org/wiki/Summed-area_table
let val_up_right = if zi_y > 0 { table[zi_x][zi_y - 1] } else { 0 };
let val_down_left = if zi_x > 0 { table[zi_x - 1][zi_y] } else { 0 };
let val_up_left = if zi_y >... | Rust | 0 |
anMech = ChannelMechanism("KConductance", dens)
cell.associateGroupWithChanMech("all", chanMech)
print "Channels present: "+str(cell.getChanMechsVsGroups())
############################################################################
'''
myPro... | Python | 1 |
uilds
.values()
.filter_map(|guild| guild.read().emojis.get(&EmojiId($id)).cloned())
.next(),
)+
}
}
};
}
trait EmojiCache {
fn manamoji(&self, s: &str) -> Option<Emoji>;
fn with_manamoji(&self, s: impl ToString... | Rust | 0 |
print(f"{Fore.RED}Error analyzing {symbol}: {str(e)}{Style.RESET_ALL}")
results.append({
'symbol': symbol,
'recommendation': 'ERROR',
'score': 0,
'reasons': [f'Analysis error: {str(e)}']
})
# Display results
if... | Python | 1 |
"""Coordinator for SleepIQ."""
import asyncio
from dataclasses import dataclass
from datetime import timedelta
import logging
from asyncsleepiq import AsyncSleepIQ
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
_LOGGER = logging.getLogger(__nam... | Python | 1 |
e_dict_lst:
try:
tensor = model_state_dict.pop(key)
except Exception:
print(f"Cannot find key {key} in rank {rank}.")
if isinstance(tensor, DTensor):
state_dict[key].append(tensor._local_tensor.bfloat16())
placements = ... | Python | 1 |
() -> Result<(), Box<dyn std::error::Error>> {
//! async fn handle(req: Request<Body>) -> Result<Response<Body>, Infallible> {
//! // Open the file.
//! let file = File::open("Cargo.toml").await.expect("file missing");
//! // Convert the file into a `Stream`.
//! let stream = ReaderStream::new(file);
//... | Rust | 0 |
}
#[pallet::event]
#[pallet::metadata(T::AccountId = "AccountId")]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
SlashFunds(
<T as frame_system::Config>::AccountId,
BalanceOf<T>,
<T as frame_system::Config>::BlockNumber,
),
RewardFunds(
<T as frame_system::C... | Rust | 0 |
_7560, 0x87F1_B960),
(r"meshes\a\a_steel_cuir_female.nif", 0x1615_1220, 0x5078_5DB6),
(r"meshes\b\b_n_darkelf_m_helsethhair.nif", 0x167D_7560, 0xFD9F_A1B3),
(r"meshes\l\light_torch_burnedout.nif", 0x1719_0E53, 0x3122_3EDF),
(r"meshes\m\misc_fabricant_elixir.nif", 0x1720_2455, 0xDDC2_A5C9),
(r"m... | Rust | 0 |
"""
Logging utilities for Hunyuan3D API server.
"""
import logging
import logging.handlers
import os
import sys
LOGDIR = '.'
handler = None
def build_logger(logger_name, logger_filename):
"""
Build and configure a logger with file and console handlers.
Args:
logger_name (str): Name of the l... | Python | 1 |
var
computation. Can be set to ``None`` for cumulative moving average
(i.e. simple average). Default: 0.1
affine: a boolean value that when set to ``True``, this module has
learnable affine parameters. Default: ``True``
track_running_stats: a boolean value that when s... | Python | 1 |
#!/usr/bin/env python
#
# 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 us... | Python | 1 |
let input_tensor = Tensor::new(&[1, PARAGRAPH_SIZE as u64])
.with_values(indexes_f32.as_slice())
.unwrap();
let mut output_step = SessionRunArgs::new();
let op_embed = TF_GRAPH
.operation_by_name_required("embedding_1_input")
.unwrap();
let op_softmax = TF_GRAPH
.operation_by_name_required... | Rust | 0 |
// println!("last_name:{:?}", last_name);
// println!("is_male:{:?}", is_male);
// 名字の各漢字の画数取得
let mut last_name_writing_count_vec = Vec::new();
for c in last_name.chars() {
match self.kanji_manager.get_writing_count_of_kanji(&c, is_new_count) {
Some(m... | Rust | 0 |
relude::*;
use cubic_spline::{Spline, SplineOpts};
use bresenham::Bresenham;
use rand::Rng;
//use rand::{Rng, SeedableRng, rngs::StdRng};
use std::cmp::min;
extern crate console_error_panic_hook;
use std::panic;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "we... | Rust | 0 |
Return a string representation of ``self``.
EXAMPLES::
sage: w = SymmetricFunctions(ZZ).witt()
sage: w.dual_basis().construction()
(SymmetricFunctionsFunctor[dual Witt], Integer Ring)
"""
if self._basis_name is None:
name = "dual " + self.... | Python | 1 |
x {
S(a, .., b, c) => {
assert_eq!(a, 1);
assert_eq!(b, 4);
assert_eq!(c, 5);
}
}
match x {
S(a, b, c, .., d) => {
assert_eq!(a, 1);
assert_eq!(b, 2);
assert_eq!(c, 3);
assert_eq!(d, 5);
}
}
... | Rust | 0 |
import cv2
import time
import numpy as np
from deploy import classify
from lib.CenterFace.centerface import CenterFace
def draw(bboxs, img=None, thresh=0.5, max_size=0):
img_cp = img.copy()
len_line = int(img_cp.shape[1] / 5)
pad_percent = int(img_cp.shape[1] / 2)
x = int(img_cp.shape[1] / 25)
y... | Python | 1 |
} else {
// No more clusters
(None, None)
}
}
}
/// Return the `Pool`'s name.
pub fn name(&self) -> &str {
&self.name
}
/// Open an existing `Pool` from its component devices.
///
/// Returns a new `Pool` object and a ... | Rust | 0 |
"""
Write a python function to check whether the given number can be represented as sum of non-zero powers of 2 or not.
assert is_Sum_Of_Powers_Of_Two(10) == True
"""
def is_Sum_Of_Powers_Of_Two(n):
if n == 0:
return False
while n % 2 == 0:
n = n // 2
for i in range(2, int(n ** 0.5) + 1):
... | Python | 1 |
: &mut Cx, mut env: Env, file: FileId, root: &Root) -> Env {
for &item in root.items.iter() {
get_item(&root.arenas, cx, &mut env, file, item);
}
env
}
use derive_getters::Getters;
use quick_xml::DeError;
use regex::Regex;
use serde::Deserialize;
use std::path::Path;
#[derive(Default, Deserialize, Debug, Par... | Rust | 0 |
schemaLocation")]
schema_location: String,
/// Data under the <cd> tag
#[serde(rename = "cd")]
pub host_list: Vec<HostCheckDataItem>,
}
/// Type that represents the <resData> tag for host check response
#[derive(Serialize, Deserialize, Debug)]
pub struct HostCheckResult {
/// Data under... | Rust | 0 |
d().unwrap();
match config.get(CONFIG_ENABLE_TEST_MODE) {
None => false,
Some(value) => if value == "true" { true } else { if value == "indy" { true } else {false }},
}
}
pub fn get_threadpool_size() -> usize {
let size = match get_config_value(CONFIG_THREADPOOL_SIZE) {
Ok(x) => x.... | Rust | 0 |
} else {
node.speed.x = 0.;
}
if is_key_pressed(KeyCode::Space) || is_key_pressed(KeyCode::Up) {
if on_ground {
node.speed.y = Self::JUMP_SPEED;
}
}
world.move_h(node.collider, node.speed.x * get_frame_time());
world.move_v(no... | Rust | 0 |
// 01111
(")", "012345678-abcdefghi"), // 10000 16
(")B", "012345678B-abcdefghi"), // 10001
(")(", "012345678-abcd"), // 10010
(")(B", "012345678-abcdB"), // 10011
(")+", "012345678+abcdefghi"), // 10100
(")+B", "012345678+B"), // 10101
... | Rust | 0 |
# sqlxport/core/storage.py
import boto3
import pandas as pd
import io
import os
import pyarrow.parquet as pq
import posixpath
def upload_dir_to_s3(
dir_path,
bucket_name,
key_prefix,
access_key,
secret_key,
endpoint_url="http://localhost:9000",
region_name="us-east-1"
):
import os
... | Python | 1 |
ilename
self.excel = excel
self.workbook = self.excel.Workbooks.Add()
self.worksheets = {}
def AddWorksheet(self, name):
worksheet = ExcelWorksheet(self.excel, self.workbook, name)
self.worksheets[name] = worksheet
return worksheet
def AddChart(self, name, afterSh... | Python | 1 |
bytes)
idx += 1
st.session_state["samples"] = {
"prompt": opts.prompt,
"img": img,
"seed": opts.seed,
"bytes": img_bytes,
}
opts.seed = None
else:
st.warning("Your generated image may... | Python | 1 |
const TARGET_ARCH: Arch = Arch::X86;
#[cfg(target_arch = "x86_64")]
/// `target_arch` when building this crate: `x86_64`
pub const TARGET_ARCH: Arch = Arch::X86_64;
#[cfg(not(any(
target_arch = "aarch64",
target_arch = "arm",
target_arch = "asmjs",
target_arch = "mips",
target_arch = "mips64",
... | Rust | 0 |
1.0 |
//! | 7 | n = 10 | - 0.5 | 1.0 |
//! | 8 | n = 20 | - 0.5 | 1.0 |
//!
//! Init to be taken is (-1, -1, ..., -1)
//!
//! ### Cases 9
//! Case 9 is found in \[1965\] p. 587 and adapted from a minimization of \[1964\]
//!
//! Dimension is 2
//!
//! ### Case... | Rust | 0 |
proper map type, must be MapType::PerfEventArray");
}
Ok(PerfMap {
map_fd,
_t: PhantomData,
})
}
/// Start polling the underlying eBPF map for events, waiting up to `time_ms` milliseconds
/// for an event. Returns the receiver side of an unbounded channel, wh... | Rust | 0 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import annotations
import abc
class KeyDerivationFunction(metaclass=abc.ABCMeta):
@abc.abstractmethod
def derive... | Python | 1 |
_DERIVE_CLONE_DEBUG, indent = level * INDENTION);
let _ = writeln!(out, "{:indent$}pub enum {} {}", "", id, "{", indent = level * INDENTION);
for case in switch_cases {
let _ = case.write(out, level + 1);
}
let _ = writeln!(out, "{:inde... | Rust | 0 |
import re
from typing import TYPE_CHECKING, Match, Optional
from ._base import BaseDirective, DirectiveParser
if TYPE_CHECKING:
from ..block_parser import BlockParser
from ..core import BlockState
from ..markdown import Markdown
__all__ = ["RSTDirective"]
_directive_re = re.compile(
r"\.\.( +)(?P<t... | Python | 1 |
usize> = (&tasks).into_iter().map(|t| t.line_num).collect();
let pruned_content = text_remove_lines_in_str(&content_getter.get_contents()?, line_nums)?;
content_setter.set_contents(pruned_content)?;
let msg = format!(
"Pruned {} task{}",
tasks.len(),
if tasks.len() > 1 { "s" } else... | Rust | 0 |
in research on [Path Semantics](https://github.com/advancedresearch/path_semantics)
//! - Brought to you by the [AdvancedResearch Community](https://advancedresearch.github.io/)
//! - [Join us on Discord!](https://discord.gg/JkrhJJRBR2)
//!
//! Abbreviations:
//!
//! - IPL: Intuitionistic/Constructive Propositional Lo... | Rust | 0 |
ln;
// This trait is needed to make the ProstGeneratedMessageStruct::decode method
// available.
use prost::Message;
thread_local! {
static STATE: RefCell<SnsRootCanister> = RefCell::new(Default::default());
}
fn main() {}
#[export_name = "canister_init"]
fn canister_init() {
dfn_core::printer::hook();
... | Rust | 0 |
._n == len(self)
class LazyMultiStepMemory(LazyMemory):
def __init__(self, capacity, state_shape, device, gamma=0.99,
multi_step=3):
super(LazyMultiStepMemory, self).__init__(
capacity, state_shape, device)
self.gamma = gamma
self.multi_step = int(multi_step)... | Python | 1 |
#!/bin/python3
def showInstructions():
# 印刷メインメニューとコマンド
print('''
RPGゲーム
========
コマンド:
行く [方向]
取得する [項目]
''')
def showStatus():
# 選手の現在のステータスを表示する
print('---------------------------')
print('あなたは' + currentRoom + 'にいる')
# 現在の インベントリー
print('インベントリー : ' + str(inventory))
# 項目があればそれを表示する
if '項目' ... | Python | 1 |
] * v2[2], v1[0] * v2[1] - v1[1] * v2[0]]
}
pub fn multiply_3d_matrices(m1: [[f32; 3]; 3], m2: [[f32; 3]; 3]) -> [[f32; 3]; 3]
{
let mut result = [[0.0f32;3];3];
for i in 0..3
{
for j in 0..3
{
for k in 0..3
{
result[i][j] += m1[i][k] * m2[k][j];
... | Rust | 0 |
pace=PendingDeposit::LEN + 8,
seeds = [volt_vault.key().as_ref(), authority_check.key().as_ref() ,b"pendingDeposit"],
bump,
payer = authority)]
pub pending_deposit_info: Box<Account<'info, PendingDeposit>>,
#[account(init_if_needed,
space=FriktionEpochInfo::LEN + 8,
seed... | Rust | 0 |
01 <-- peer index
//4c 39 56 0a <-- orig_ts
//00 25 <-- attr length (37)
//
//4: 40 01 [01] 00
//26: 50 02 [00 16] 02 05 00 00 a4 7d 00 00 a3 ed 00 00 a3 95 00 00 51 23 00 00 0d 1c
//7: 40 03 [04] 5b 67 18 02
//
//let buffer = hex::decode("0x00014c39560a0025400101005002001602050000a47d000... | Rust | 0 |
{f0a5}",
"hand-point-right"=>"\u{f0a4}",
"hand-point-up"=>"\u{f0a6}",
"hand-pointer"=>"\u{f25a}",
"hand-rock"=>"\u{f255}",
"hand-scissors"=>"\u{f257}",
"hand-spock"=>"\u{f259}",
"hands"=>"\u{f4c2}",
"hands-helping"=>"\u{f4c4}",
"handshake"=>"\u{f2b... | Rust | 0 |
# log the images as wandb Image
experiment.log(
{
f"Images/{experiment.name}": [
wandb.Image(x, caption=f"Pred:{pred}, Label:{y}")
for x, pred, y in zip(
val_imgs[: self.num_samples],
... | Python | 1 |
move |r: hyper::Request<hyper::Body>| {
handle_request(
r,
Arc::clone(&templates),
Arc::clone(&http_client),
Arc::clone(&logs),
... | Rust | 0 |
import os
os.system("cls||clear")
nomeProduto = input("Digite o nome do produto: ")
quantidadeAdquirida = int(input("Digite a quantidade adquirida: "))
precoUnitario = float(input("Digite o preço do produto: "))
total = quantidadeAdquirida * precoUnitario
if quantidadeAdquirida <= 5:
desconto = total * 0.02
el... | Python | 1 |
ut settings representation.
///
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Settings {
/// The linker library addresses.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub libraries: Option<HashMap<String, HashMap<String, String>>>,
/// The output s... | Rust | 0 |
it.
///
/// *Method: NcChannel.[set_r()][NcChannel#method.set_r]*
//
// Not in the C API.
#[inline]
pub fn channel_set_r(channel: &mut NcChannel, r: NcColor) -> NcChannel {
*channel = (r as NcChannel) << 16 | (*channel & 0xff00) | (*channel & 0xff);
*channel
}
/// Sets the green [NcColor] of an [NcChannel], a... | Rust | 0 |
d))) = pair(
take_year,
pair(
preceded(char('-'), take_month),
preceded(char('-'), take_day),
),
)(i)?;
Ok((i, (y, m, d)))
}
/// fragment
/// YEAR
/// : '000' [1-9]
/// | '00' [1-9] DEC_DIGIT
/// | '0' [1-9] D... | Rust | 0 |
// errors.
Err(_) => ffx_bail_with_code!(2, "Value not found"),
}
}
async fn exec_get<W: Write + Sync>(get_cmd: &GetCommand, writer: W) -> Result<()> {
let query = ConfigQuery::new(
get_cmd.name.as_ref().map(|s| s.as_str()),
None,
get_cmd.build_dir.as_ref().map(|s| s.as... | Rust | 0 |
from Py4GWCoreLib.enums import outpost_name_to_id, explorable_name_to_id
# 1) IDs
_1_basaltgrotto_to_jennurshordeoutpost_ids = {
"outpost_id": 398,
}
# 2) Outpost exit path
_1_basaltgrotto_to_jennurshordeoutpost_outpost_path = [
(55, 1622),
(196, 598),
(1038, 51),
(2037, -62),
(2909, -566),
... | Python | 1 |
er {} initial testcases", added, num),
phantom: PhantomData,
},
)?;
manager.process(self, executor, scheduler)?;
Ok(())
}
pub fn new(rand: R, corpus: C, feedbacks: FT, solutions: SC, objectives: OFT) -> Self {
Self {
rand,
exec... | Rust | 0 |
rns the value as a string.
Args:
**kwargs: Additional arguments to pass to the command.
Returns:
The KitOps CLI version as a string.
Raises:
subprocess.CalledProcessError: If the command returns a non-zero exit status.
The exception contains the return code and the standar... | Python | 1 |
# 弹出一个节点
node = self.nodes.popleft()
self.send_find_node((node.ip, node.port), node.nid)
time.sleep(SLEEP_TIME)
except IndexError:
# 一旦节点队列为空,则重新加入 DHT 网络
self.bootstrap()
def save_magnet(self, info_hash):
... | Python | 1 |
::Transaction(err) => {
return Err(DbErr::Exec(err.to_string()));
}
}
}
Ok(())
}
pub async fn find_all(offset: u64, limit: u64) -> Result<Vec<AppModel>, DbErr> {
AppEntity::find()
.offset(offset)
.limit(limit)
.all(master())
.await
}
// 查... | Rust | 0 |
r the next phase of the OLL solution.
pub new_state: Option<OLLAlgorithm>,
/// Time spent recognizing the state
pub recognition_time: u32,
/// Time spent executing the algorithm
pub execution_time: u32,
/// Move index of the start of the algorithm
pub start_move_index: usize,
/// Moves p... | Rust | 0 |
from flask import Blueprint, jsonify
bp = Blueprint('other', __name__)
@bp.get('/ping')
def ping_pong():
return jsonify(
dict(
error=False,
message="Pong",
result=True
)
) | Python | 1 |
, 345.0),
City::new(7202, "Nicaragua", "<NAME>", 13.6833333, -86.3166656, 742.0),
City::new(7203, "Nicaragua", "<NAME>", 13.5500000, -86.1666641, 866.0),
City::new(7204, "Nicaragua", "Palacaguina", 13.4500000, -86.4000015, 528.0),
City::new(7205, "Nicaragua", "<NAME>", 12.0666667, -84.5333328, 85.0),
City::new(720... | Rust | 0 |
// various values track through the iterations
let best_point = initial_simplex.corners
.iter()
.max_by_key(|c| OrderedFloat(c.value))
.expect("You need at least one dimension!")
... | Rust | 0 |
()
if last_update:
last_update = re.sub(
r'\b[Uu][Pp][Dd][Aa][Tt][Ee][Dd]\s*[:]\s*', '', last_update
)
views = manga.xpath(
".//span[contains(@class, 'item-time')][2]/text()"
).get()
if views:
... | Python | 1 |
) \\), which we identify with the Kummer
/// line of the Montgomery curve.
#[derive(Copy, Clone, Debug)]
pub(crate) struct ProjectivePoint {
pub U: FieldElement,
pub W: FieldElement,
}
impl Identity for ProjectivePoint {
fn identity() -> ProjectivePoint {
ProjectivePoint {
U: FieldEleme... | Rust | 0 |
input: &crate::output::ListMilestonesOutput,
) -> std::option::Option<&std::string::String> {
let input = match &input.next_token {
None => return None,
Some(t) => t,
};
Some(input)
}
pub(crate) fn reflens_structure_crate_output_list_notifications_output_next_token(
input: &crate::ou... | Rust | 0 |
new_model = a * A + b * B + c * C
```
としてマージされます。
## TIPS
- A, B, C が全て通常モデルで、通常モデルを作りたい場合は、`a + b + c = 1`となるようにするのがよいと思います。
- `a + b + c = 0` とすると(たとえば `A - B`)、話者性を持たないヌルモデルを作ることができ、「ヌルモデルとの和」で結果を使うことが出来ます(差分マージの材料などに)
- 他にも、`a = 0.5, b = c = 0`などでモデルAを謎に小さくしたり大きくしたり負にしたりできるので、実験に使ってください。
"""
add_null_md = """
「... | Python | 1 |
luck_type = [
{
"good-luck": 10,
"name": "大吉"
},
{
"good-luck": 9,
"name": "中吉"
},
{
"good-luck": 8,
"name": "小吉"
},
{
"good-luck": 7,
"name": "吉"
},
{
"good-luck": 6,
"name": "半吉"
},
{
"g... | 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 |
}
}
}
#[macro_export]
macro_rules! default_colors {
(blue) => { 0x0061afef };
(orange) => { 0x00d19a66 };
(purple) => { 0x00c678dd };
(green) => { 0x0098c379 };
(red) => { 0x00e06c75 };
(cyan) => { 0x0056b6c2 };
}
#[macro_export]
macro_rules! start_zone_profiling {
($name:liter... | Rust | 0 |
averaged results
averaged_results = runner.calculate_averaged_results(all_results)
# Print results table
runner.print_ablation_results_table(averaged_results)
# Generate summary
summary = runner.generate_ablation_summary(averaged_results)
logger.info(f"\\n{summary}")
return a... | Python | 1 |
strings = extensions!(
"EGL_KHR_config_attribs"
"EGL_KHR_lock_surface"
"EGL_KHR_image"
"EGL_KHR_vg_parent_image"
"EGL_KHR_gl_texture_2D_image"
"EGL_KHR_gl_texture_cubemap_image"
"EGL_KHR_gl_texture_3D_image"
"EGL_KHR_gl_renderbuffer_image"
"EGL_KHR... | Rust | 0 |
import rospy
from nortek_nucleus_dvl.msg import Altimeter
class SubscriberAltimeterPackets:
def __init__(self, callback_function, queue_size=10):
self.node_name = 'altimeter_packets_subscriber'
rospy.init_node(self.node_name, anonymous=True)
self.subscription = rospy.Subscriber(
... | Python | 1 |
s is not used if generate_graph was updated for Bernoulli
print(f"\nGenerating a graph with {NUM_NODES_TO_GENERATE} nodes...")
generated_sample_graph = generate_graph(
model=autoregressive_generator,
num_nodes_to_generate=NUM_NODES_TO_GENERATE,
device=DEVICE,
sampling_threshold=SAMPLING_THRESHOLD # Don... | Python | 1 |
idxw*self.stride:idxw*self.stride+self.kernel_size]
self.d_bias[idxc] += top_diff[idxn, idxc, idxh, idxw]
bottom_diff[idxn, :, idxh*self.stride:idxh*self.stride+self.kernel_size, \
idxw*self.stride:idxw*self.stride+self.kernel_si... | Python | 1 |
let substring = &hash_string[i..i + 2];
let z = (u8::from_str_radix(substring, 16)).unwrap();
// hprintln!("{:?}", z).unwrap();
hash[(i - (i / 2))] = z;
// hprintln!("i {:?}", &c[3..5]).unwrap()
}
// hprintln!("hash_bytes : {:?})", hash).unwrap();
return hash;
}
#[allow(dead... | Rust | 0 |
, happy_var_1, |at| box CFunctionDef(lift_attrs(happy_var_1), happy_var_2, vec![], happy_var_3, at))
}.map(HappyAbsSyn::NT10),
_ => panic!("irrefutable pattern")
}
}
fn happy_reduce_14(p: &mut Parser, i: isize) -> Res<Cont> {
happy_result_reduce(p, 3, 10, happy_reduction_14, i)
}
fn happy_red... | Rust | 0 |
print(f"Supervised model retrained with {len(features)} samples")
return True
except Exception as e:
print(f"Error retraining supervised model: {str(e)}")
return False
def run_model_update(self, hours_back=24):
"""Run complete model up... | Python | 1 |
nload_results(completed_job)
# Convenience functions for common patterns
def create_literary_analysis_batch(
texts: List[str],
processor: AnthropicBatchProcessor,
model: str = "claude-opus-4-1-20250805",
) -> AnthropicBatchJob:
"""Create a batch for literary text analysis.
Args:
texts: ... | Python | 1 |
import numpy as np
from sigmoid import sigmoid
from sigmoid import sigmoid_gradient
def nn_cost_function(X,Y,nn_paramters,input_layer,hidden_layer,out_layer,lmd=0):
# 取出theta1和theta2
theta1 = nn_paramters[:hidden_layer*(input_layer+1)].reshape(hidden_layer,input_layer+1)
theta2 = nn_paramters[hidden_layer*(input_l... | Python | 1 |
sageWindow()
def _loc_466A(): pass
label('loc_466A')
ChrTalk(
0x0101,
(
'#0010471150V#1015F根据以往的经验,\n',
'应该没错吧。',
TxtCtl.Enter,
),
)
CloseMessageWindow()
ChrTalk(
0x0103,
(
'#0030471151V#020F嗯~应该就是这样。',
... | Python | 1 |
# 통계 업데이트
conn.execute("ANALYZE")
# 인덱스 재구성
conn.execute("REINDEX")
# 공간 최적화
conn.execute("VACUUM")
logger.info("데이터베이스 최적화 완료")
def export_data(self, export_path: str):
"""데이터 내보내기"""
exp... | Python | 1 |
from typing import Any, Generic, Optional, cast
from core.models import Base
from sqlalchemy import ColumnExpressionArgument, select
from sqlalchemy.ext.asyncio import AsyncSession
from typing_extensions import TypeVar
from .abc import AbstractRepository
T = TypeVar("T", bound=Base)
class SQLAlchemyRepository(Gene... | Python | 1 |
let materials_guard = CurrentGuard::new(&mut materials);
let obj_sets_guard = CurrentGuard::new(&mut obj_sets);
let programs_guard = CurrentGuard::new(&mut programs);
let vertex_buffers_guard = CurrentGuard::new(&mut vertex_buffers);
let index_buffers_guard = CurrentGuard::new(&mut i... | Rust | 0 |
# Copyright 2023 Garena Online Private Limited.
#
# 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 agr... | Python | 1 |
import sys
import constants
def convert_table_to_triples(table_header, rows):
linearized_table = []
triples = set()
node_dict = dict()
for i, header in enumerate(table_header):
if header in node_dict:
header_idx = node_dict[header]
else:
header_idx = len(no... | Python | 1 |
: i32,
mdx: i32,
mdy: i32,
difficulty:u32,
player_field: [[Cell;10];10],
cpu_field : [[Cell;10];10],
player_cursor: Graphic<Texture<'r>>,
cpu_cursor : Graphic<Texture<'r>>,
player_ship_disp: ShipDisplay<'r>,
cpu_ship_disp: ShipDisplay<'r>,
status: Status,
placing_ship: PieceT... | Rust | 0 |
{
str_writer.as_mut().write_str("_").unwrap();
assert_eq!(str_writer.remaining_capacity(), i);
}
assert_eq!(str_writer.remaining_capacity(), 0);
assert_eq!(str_writer.as_str(), &underscored[..str_writer.capacity()]);
str_writer.truncate(5).unwrap();
assert_eq!(str_writer.remaining_... | Rust | 0 |
a3: ArgReg<A3>,
) -> RetReg<R0> {
rsix_reordered_syscall4(a1, a2, a0, a3, nr)
}
#[inline]
#[must_use]
pub(in crate::imp::linux_raw) unsafe fn syscall5(
nr: SyscallNumber,
a0: ArgReg<A0>,
a1: ArgReg<A1>,
a2: ArgReg<A2>,
a3: ArgReg<A3>,
... | Rust | 0 |
def test_create_habit_missing_fields_returns_422(client, user_token):
headers = {"Authorization": f"Bearer {user_token}"}
resp = client.post("/habits/", json={}, headers=headers)
assert resp.status_code == 422
def test_create_and_get_habit_success(client, user_token):
headers = {"Authorization": f"Bea... | Python | 1 |
;
pub fn PxHeightField_getFlags(self_: *const PxHeightField, ) -> PxHeightFieldFlags;
pub fn PxHeightField_getHeight(self_: *const PxHeightField, x: f32, z: f32, ) -> f32;
pub fn PxHeightField_getReferenceCount(self_: *const PxHeightField, ) -> u32;
pub fn PxHeightField_acquireReference_mut(self_: *mut PxHeightField, )... | Rust | 0 |
8) / 2) / 2;
let mut res = _mm_setzero_si128();
let mut acc = [_mm_setzero_si128(); 2];
let a_ptr = a.as_ptr() as *const __m128i;
let b_ptr = b.as_ptr() as *const __m128i;
let lut = _mm_set_epi64x(0x0202020102020201, 0x0202020101010100);
let mask = _mm_set1_epi8(0x0F);
#[cfg(any(target_a... | Rust | 0 |
use std::libc::*;
type enum_unnamed1 = c_uint;
static STBI_default: u32 = 0_u32;
static STBI_grey: u32 = 1_u32;
static STBI_grey_alpha: u32 = 2_u32;
static STBI_rgb: u32 = 3_u32;
static STBI_rgb_alpha: u32 = 4_u32;
#[link_args="-L. -lstb-image"]
#[nolink]
extern {
}
pub mod bindgen {
use std::libc::*;
type stbi... | Rust | 0 |
());
scroll_container.add_content(list_widget.clone());
let mut scroll_container = Widget::from_modifier(scroll_container);
scroll_container.set_draw_state(RectState::default());
scroll_container.layout().add(constraints![
below(&button_container).padding(20.0),
match_width(&container),
... | Rust | 0 |
creator,&ctx.tile_set)
.add(MenuItem::new("Micro-mode",360, Keycode::F9, &texture_creator, &ctx.tile_set)));
game_loop(&mut game, &mut ctx, &mut canvas, &mut event_pump, &mut menu_bar, &mut event_subsystem)
}
/// Opcode enum represents the opcodes for all the instructions supported by th... | Rust | 0 |
from db.Mongo import Mongo as Mongo
from auth import Auth
import time
"""
Transport registering. See "Transaction Format: Transport" section of docs/datascheme.md
"""
def run(args):
res = args["api"].res
api = args["api"]
data = args["payload"]
if not api.auth.guard(res, "authenticated"):
... | Python | 1 |
import warnings
warnings.warn(
f"{__name__!r} has been deprecated since 18.0 and is completely "
"empty, all controllers and utility functions were moved to sibling "
"submodules in Odoo 16",
DeprecationWarning,
stacklevel=2,
)
| Python | 1 |
# -*- coding: utf-8 -*-
"""
测试Markdown解析器的基本功能
"""
import unittest
import sys
from pathlib import Path
# 添加src目录到Python路径
project_root = Path(__file__).parent.parent.parent
sys.path.insert(0, str(project_root / "src"))
from converters.markdown_parser import MarkdownParser, MarkdownElement
class TestMarkdownParser(... | Python | 1 |
"""W sklepie ze sprzętem AGD oferowana jest sprzedaż ratalna. Napisz program
umożliwiający wyliczenie wysokości miesięcznej raty za zakupiony sprzęt. Danymi
wejściowymi dla programu są:
� cena towaru (od 100 zł do 10 tyś. zł),
� liczba rat (od 6 do 48).
Kredyt jest oprocentowany w zależności od liczby rat:
� od 6–12 wy... | Python | 1 |
from app import app, db
from models import User, Win
# Original milestones from the frontend
original_milestones = [
{ 'date': '02.02', 'desc': 'Summer Breeze x Aaaah.Culture at American Dream stage' },
{ 'date': '02.06', 'desc': 'Modeling at South Seaport Museum' },
{ 'date': '02.21', 'desc': 'Concert at ... | Python | 1 |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from io import open
import unittest
from NoisyNLP.utils import *
class UtilsTest(unittest.TestCase):
def test_load_sequences(self):
sequences = load_sequences("./data/cleane... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.