text string | label_name string | labels int64 |
|---|---|---|
1.0], [-1.0, 1.0, -1.0], [-1.0, -1.0, -1.0],
// back
[-1.0, 1.0, -1.0], [1.0, 1.0, -1.0], [1.0, -1.0, -1.0], [-1.0, -1.0, -1.0],
// bottom
[1.0, -1.0, 1.0], [-1.0, -1.0, 1.0], [-1.0, -1.0, -1.0], [1.0, -1.0, -1.0],
),
normals: Some... | Rust | 0 |
::retro_key::RETROK_5, concat_to_c_str!("5")),
make_keyboard_descriptor(lr::retro_key::RETROK_6, concat_to_c_str!("6")),
make_keyboard_descriptor(lr::retro_key::RETROK_7, concat_to_c_str!("7")),
make_keyboard_descriptor(lr::retro_key::RETROK_8, concat_to_c_str!("8")),
make_keyboard_descriptor(lr::retro_... | Rust | 0 |
if !self.enabled.get() {
self.enabled.set(true);
// Start the APB clock (CLK_DACC)
unsafe {
pm::enable_clock(Clock::PBA(PBAClock::DACC));
nvic::enable(nvic::NvicIdx::DACC);
}
// Reset DACC
regs.cr.set(1);
... | Rust | 0 |
action_vault(
transaction: &Transaction<'_>,
action: &str,
vault_arn: &str,
) -> Result<AwsJob> {
debug!(
"getting job by action \"{}\" and vault \"{}\"",
action, vault_arn
);
let rows = transaction.query(
"SELECT * from jobs WHERE ... | Rust | 0 |
if not isinstance(metadata, dict):
return {}
useful_fields = ['title', 'author', 'subject', 'keywords', 'creator', 'producer']
result = {}
for field in useful_fields:
if field in metadata and metadata[field]:
result[field] = str(metadata[field])
return resul... | Python | 1 |
Result<Mixin> {
let name = name.map_node(Into::into);
match self.mixins.get(&name.node) {
Some(v) => Ok(v.clone()),
None => global_scope.get_mixin_no_global(&name),
}
}
pub fn insert_mixin<T: Into<Identifier>>(&mut self, s: T, v: Mixin) -> Option<Mixin> {
... | Rust | 0 |
aws_smithy_types::Number::NegInt((*var_247).into()),
);
}
if let Some(var_248) = &input.participant_role {
object.key("ParticipantRole").string(var_248.as_str());
}
if let Some(var_249) = &input.absolute_time_range {
let mut object_250 = object.key("AbsoluteTimeRange").s... | Rust | 0 |
from aiogram import types
from loader import dp
@dp.callback_query_handler(text=["show_id"])
async def show_tg_id(call: types.CallbackQuery):
await call.message.answer(F"Your id: {call.message.chat.id}")
# await call.answer(f'Your id: {call.message.chat.id}')
# await call.answer(cache_time=60)
| Python | 1 |
ce='mixed',
output_type=output_type)
outputs.append(image.gpu())
return outputs
# Decode image with CPU if cropping with dynamic size.
if self.center_crop:
crop_pos = 0.5
else:
crop_pos = fn.random.uni... | Python | 1 |
from django.shortcuts import render,redirect
from .models import *
from django.contrib.auth import authenticate,login,logout
from .forms import UserCreationForm, LoginForm
# Create your views here.
def categorymodel(request):
categorys = CategoryModel.objects.all()
context = {
'categorys': categorys
... | Python | 1 |
import cv2
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
#test
# Step 1: Read image
image = cv2.imread("./Python Scripts/Image processing/test3.png")
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
# Mirror the image horizontally
image = cv2.flip(image, 1) # 1 for horizontal flip, 0 for v... | Python | 1 |
")]
lock_index: u64,
#[serde(rename = "Key")]
key: String,
#[serde(rename = "Flags")]
flags: u64,
#[serde(rename = "Value", deserialize_with = "_deserialize_base64")]
value: Vec<u8>,
#[serde(default, rename = "Session")]
session: Option<String>,
}
fn _deserialize_base64<D>(deseriali... | Rust | 0 |
ader)
max_valid_acc = max(max_valid_acc, acc)
print(f"Epoch {epoch}, train accuracy {train_acc}, valid/test accuracy: {acc}")
train_acc = test(model, train_loader)
if args.use_test:
test_acc = max(max_valid_acc, test(model, test_loader))
valid_acc = 0.0
else:
valid_a... | Python | 1 |
ideos<'a>(&self, videos: impl Iterator<Item = &'a VideoInfo>) {
conn_db!(db);
for v in videos {
self.db_update_video(db, v);
}
}
fn db_update_video(&self, db: DbType, info: &VideoInfo) {
db.execute(
"INSERT OR IGNORE INTO videoinfo VALUES \
(?... | Rust | 0 |
) from exc
body = render_blocks(
template_engine.engine, template, self.block_names, context
)
else:
body = template.render(**context).encode(self.encoding)
return ASGIResponse(
background=self.backgrou... | Python | 1 |
,
(Typical, (1,), {"bar": 2}, None),
(Typical, (1, 2, 3), {}, TypeError),
(Typical, (1,), {"foo": 1}, TypeError),
(Typical, (1,), {"baz": 1}, TypeError),
],
)
def test_layers_decorator_instantiation(cls, args, kwargs, error):
"""Test layer instantiation from decorator."""
if ... | Python | 1 |
<Vec<String>> = Vec::new();
let _noline = Regex::new(r"^[\r\n]*$").unwrap();
let mut records:Vec<AtomRecord> = vec![];
let mut terflag:bool = false;
let mut modelflag:bool = false;
for (_lcount,line) in reader.lines().enumerate() {
let sstr = line.unwrap_or_else(|e|panic!("{:?}",e));
... | Rust | 0 |
/ }
// ]
// )
// })
// }
#[test]
fn breed_kitty_fail_when_same() {
new_test_ext().execute_with(|| {
run_to_block(10);
let _ = Kitties::create(Origin::signed(1));
assert_noop!(
Kitties::breed(Origin::signed(1), 0, 0),
Error::<Test>::RequireDifferentParent
);
})
}
#[te... | Rust | 0 |
pe,
// so we create an integral type variable for it.
ty::mk_int_var(tcx, fcx.infcx().next_int_var_id())
}
ast::LitFloat(_, t) => ty::mk_mach_float(t),
ast::LitFloatUnsuffixed(_) => {
// An unsuffixed floating point literal could have any floating point
... | Rust | 0 |
div["class"]
if c.startswith("language-")
]
if lang_class:
code_language = lang_class[0].replace("language-", "")
code_text = (
element.find("code").get_text() if element.find("code") else ""
... | Python | 1 |
import numpy as np
import numpy.random as npr
import kayak
from . import *
def test_softmax_values_1():
npr.seed(1)
for ii in xrange(NUM_TRIALS):
np_X = npr.randn(5,6)
X = kayak.Parameter(np_X)
Y = kayak.SoftMax(X, axis=None)
np_Y = np.exp(np_X)
# np_Y ... | Python | 1 |
ctPointer {
let outer: TURef<Key> = contract_api::get_uref("pos")
.and_then(Key::to_turef)
.unwrap_or_else(|| contract_api::revert(Error::GetPosInnerURef as u32));
if let Some(ContractPointer::URef(inner)) = contract_api::read::<Key>(outer).to_c_ptr() {
ContractPointer::URef(TURef::new(i... | Rust | 0 |
l888(l565: u16) -> [u8; 3] {
let (r, g, b) = unpack_565(l565);
[l5_to_l8(r), l6_to_l8(g), l5_to_l8(b)]
}
l565_to_s888(l565: u16) -> [u8; 3] {
let (r, g, b) = unpack_565(l565);
[l5_to_s8(r), l6_to_s8(g), l5_to_s8(b)]
}
l8_to_l5(l8: u8) -> u8 { ((l8 as u16 + 1) * 0b11111 / 255) as u8 }
l8_to_l6(l8: u8) -> ... | Rust | 0 |
import os
from argparse import Namespace
from aphrodite import LLM, EngineArgs
from aphrodite.utils import FlexibleArgumentParser
# needs V0 engine
os.environ["APHRODITE_USE_V1"] = "0"
def parse_args():
parser = FlexibleArgumentParser()
parser = EngineArgs.add_cli_args(parser)
# Set example specific arg... | Python | 1 |
import pygame
import os
def load_olive_cat_image():
olive_path = os.path.join("Game", "Assets", "olive_cat.png")
if os.path.exists(olive_path):
try:
return pygame.image.load(olive_path)
except pygame.error:
print(f"Error loading olive cat from {olive_path}")
# ... | Python | 1 |
tream.pyR s c C` s3 | j d j j | j d | _ t j | d S( Ni u replace( RL t
codec_infot streamreaderR RN R= RO ( R ( ( sr /private/var/folders/vy/31wknkcs30l6xb2fzgwnrkh80000gn/T/pip-build-H4rTmN/pip/pip/_vendor/html5... | Python | 1 |
let mut processed = 0;
let mut offset = 0;
// optimization: if we are in the initial state, quickly skip to the first non-MSB-set byte.
if state == INITIAL_STATE {
let first_msb = input.iter().position(|&ch| ch >= 0x80).unwrap_or(input.len());
offset += first_msb;
... | Rust | 0 |
import _plotly_utils.basevalidators
class AutorangeoptionsValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="autorangeoptions", parent_name="layout.scene.zaxis", **kwargs
):
super(AutorangeoptionsValidator, self).__init__(
plotly_name=plotly... | Python | 1 |
#coding:utf-8
def geoGCP(dataFilename, outGeoName, rpcFileName):
from osgeo import gdal
from osgeo import osr
import geo_rpc_copy
# dataFilename = r'F:\博士\山西煤矿调查\代码\Step2_浓度增强反演\output_data\GF5B_AHSI_E113.0_N36.3_20220504_003482_L10000124874_SW.tiftemptif.tif'
# outGeoName = r'F:\博士\山西煤矿调查\代码\Step2... | Python | 1 |
Self(Arc::clone(&self.0))
}
}
impl Default for Broker {
fn default() -> Self {
Self::new()
}
}
impl Broker {
/// Construct [`Broker`].
pub fn new() -> Self {
Self(Arc::new(MessageMap::new()))
}
fn entry(&'_ self, id: TypeId) -> Entry<'_, TypeId, ActorMap<BrokerRecipient>> ... | Rust | 0 |
Ok(res) => {
if res == 1 {
Ok(HttpResponse::Ok())
} else {
Ok(HttpResponse::BadRequest())
}
}
Err(err) => Err(err),
})
... | Rust | 0 |
from typing import Iterator, Union
import torch
class EpisodeAwareSampler:
def __init__(
self,
episode_data_index: dict,
episode_indices_to_use: Union[list, None] = None,
drop_n_first_frames: int = 0,
drop_n_last_frames: int = 0,
shuffle: bool = False,
):
... | Python | 1 |
kgId(config.dkg_id());
let crypto_components = TestEnvironment::new_for_config(&config).crypto_components;
(config, dkg_id, crypto_components)
}
fn run_ni_dkg_and_load_transcript_for_receivers(
config: &NiDkgConfig,
crypto_components: &BTreeMap<NodeId, TempCryptoComponent>,
) {
let transcript = run... | Rust | 0 |
{
Some(state::InProgress::Rebase)
} else if git_dir.join("rebase-apply").is_dir() {
Some(state::InProgress::ApplyMailboxRebase)
} else if git_dir.join("rebase-merge/interactive").is_file() {
Some(state::InProgress::RebaseInteractive)
} else if git_dir.join("r... | Rust | 0 |
# vim: set expandtab ts=4 sw=4:
# === UCSF ChimeraX Copyright ===
# Copyright 2022 Regents of the University of California. All rights reserved.
# The ChimeraX application is provided pursuant to the ChimeraX license
# agreement, which covers academic and commercial uses. For more details, see
# <https://www.rbvi.ucsf... | Python | 1 |
s.capacity::<TabMetadata>(256)?;
let _main_tab = tab_bus.carry_from(main_bus)?;
let websocket_bus = WebsocketConnectionBus::default();
let websocket = main_bus.resource::<WebsocketResource>()?;
websocket_bus.store_resource(websocket);
let _main_websocket = websocket_bus.carry_f... | Rust | 0 |
(id == workchain_id) || (id >= count) {
list.push(descr.clone());
}
}
if list.len() >= cc_config.shard_validators_num as usize {
let vset = ValidatorSet::new(
vset.utime_since(),
vset.utime_until(),
... | Rust | 0 |
[serde(tag = "type")]
pub enum RasterPropertiesEntry {
Number(f64),
String(String),
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub enum RasterPropertiesEntryType {
Number,
String,
}
impl From<RasterPropertiesEntry> for String {
fn from(prop: RasterPropertiesEntry) -> String {
... | Rust | 0 |
mut v: u64 = (u64::from(filtered[pos] - addend) * c_85_4)
+ (u64::from(filtered[pos + 1] - addend) * c_85_3);
match bytes_left {
2 => {
bytes_needed = 1;
v += (padding * c_85_2) + (padding * c_85_1) + padding;
}
3 => {
... | Rust | 0 |
fn visit_bytes<E: de::Error>(self, value: &[u8]) -> Result<IBytes, E> {
Ok(IBytes::new(value))
}
}
}
<filename>hphp/hack/src/rupro/hackrs/typing/env/typing_env_decls.rs
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
//... | Rust | 0 |
import json
from pathlib import Path
input_file = Path("normalized.json")
output_file = Path("normalized_by_cnpj.json")
def main():
with open(input_file, "r", encoding="utf-8") as f:
data = json.load(f)
# Se já está no formato dict, não faz nada
if isinstance(data, dict):
print("O arquivo... | Python | 1 |
"{:?}",
cornell_red.convert_to_xyz(Bounds1D::new(400.0, 700.0), 1.0, true)
);
println!(
"{:?}",
cornell_green.convert_to_xyz(Bounds1D::new(400.0, 700.0), 1.0, true)
);
}
#[test]
fn test_parse_linear_spectra() {
let spectra = load_linear(
... | Rust | 0 |
HID3_CONFIGURATION_MSB: u32 = 7;
pub const SPI_SSPPERIPHID3_CONFIGURATION_LSB: u32 = 0;
pub const SPI_SSPPERIPHID3_CONFIGURATION_ACCESS: &'static [u8; 3usize] = b"RO\0";
pub const SPI_SSPPCELLID0_OFFSET: u32 = 4080;
pub const SPI_SSPPCELLID0_BITS: u32 = 255;
pub const SPI_SSPPCELLID0_RESET: u32 = 13;
pub const SPI_SSPP... | Rust | 0 |
ger.set_outcome(node, LedgerOutcome::Success)?;
}
if cpid.len() > 0 {
let node = ledger.add_node(
&format!("Daemon are still running, PID: {}", format_vec(cpid)),
LedgerMode::Automatic,
)?;
ledger.set_outcome(node, LedgerOutcome::Warni... | Rust | 0 |
(phase * (FREQS[self.freq_idx].0 * 2.0 + self.angle * 10.0) * f32::consts::PI).sin() * 0.2 + 0.5
)
};
let (x,y) = (x * 2.0 - 1.0, 1.0 - y * 2.0);
return (x, y);
}
}<reponame>VladasZ/test_engine
#![feature(default_free_fn)]
mod body;
mod collider;
mod level;
mo... | Rust | 0 |
Vec<String>,
}
impl From<&str> for Entry {
fn from(line: &str) -> Self {
let (ins, outs) = line.split_once(" | ").unwrap();
let input: Vec<String> = ins.split_whitespace().map(Entry::sort_str).collect();
let output: Vec<String> = outs.split_whitespace().map(Entry::sort_str).collect();
... | Rust | 0 |
RedirectPath: str
:param _StdoutRedirectFileName: 标准输出重定向文件名
注意:此字段可能返回 null,表示取不到有效值。
:type StdoutRedirectFileName: str
:param _StderrRedirectFileName: 标准错误重定向文件名
注意:此字段可能返回 null,表示取不到有效值。
:type StderrRedirectFileName: str
"""
self._TaskInstanceIndex = None
self.... | Python | 1 |
from abc import ABC, abstractmethod
from datetime import datetime
from qte.core.events import MarketEvent # Assuming MarketEvent is in qte.core.events
from typing import Any, Generator, Optional, Union, List, Dict
# For now, using Any for data return types.
# Consider more specific types later, e.g., pandas DataFrame,... | Python | 1 |
=> {};
//~^ ERROR repetition matches empty token tree
( $($()? $(),* $(a)? $(a),* )+ ) => {};
//~^ ERROR repetition matches empty token tree
( $($()? $(),* $(a)? $(a),* )? ) => {};
//~^ ERROR repetition matches empty token tree
( $(a $(),* $(a)* $(a),* )* ) => {}; // PASS
( $($(a)+ $(),... | Rust | 0 |
from sistema.gestion_json import cargar_json, guardar_json
ARCHIVO_TAREAS = "data/nombre_empleado/tareas.json"
# Auxiliar para cargar el JSON de tareas (DEBERIA CARGARSE SIEMPRE AL INICIAR EL PROGRAMA)
def obtener_tareas():
"""
Carga y retorna las tareas desde el archivo JSON.
Retorna:
dict... | Python | 1 |
proto"],
includes: &["protos"],
customize: Customize {
..Default::default()
},
}).expect("protoc");
}
//! Event logging types.
//!
//! # Examples
//!
//! ```no_run
//! use tide::log;
//!
//! // `tide::log` requires starting a third-party logger such as `femme`. We may
//! // ship... | Rust | 0 |
Levels", item),
)?;
visitor.visit_i64("TotalMedalCount", &mut self.total_medal_count)?;
visitor.visit_i32("AdventureIndex", &mut self.adventure_index)?;
visitor.visit_i64("FinishedAdventureCount", &mut self.finished_adventure_count)?;
visitor.visit_i64(
... | Rust | 0 |
ofSMRTier: i64,
pub FreeSpaceInSMRTier: i64,
pub UsableFreeSpaceInSMRTier: i64,
pub VolumeGcState: REFS_SMR_VOLUME_GC_STATE,
pub VolumeGcLastStatus: u32,
pub CurrentGcBandFillPercentage: u32,
pub Unused: [u64; 6],
}
impl ::core::marker::Copy for REFS_SMR_VOLUME_INFO_OUTPUT {}
impl ::core::clone:... | Rust | 0 |
from enum import Enum
from typing import Optional, Any
from FlaUILibrary.flaui.exception import FlaUiError
from FlaUILibrary.flaui.interface import (ModuleInterface, ValueContainer)
class ToggleButton(ModuleInterface):
"""
ToggleButton module wrapper for FlaUI usage.
Wrapper module executes methods from T... | Python | 1 |
to_string(),
path: constants::EOS_PATH.to_string(),
network: "".to_string(),
input: None,
payment: "".to_string(),
receiver: "".to_string(),
sender: "".to_string(),
fee: "".to_string(),
};
let output = EosTransaction::s... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
from model.rl_model.env import EEGWheelchairEnv
from model.rl_model.rlmodel import DQNAgent
# Load trained model
model = tf.keras.models.load_model('dqn_wheelchair_model.keras')
# Initialize environment
env = EEGWheelchairEnv()
# Evaluation parameters
episodes = 100... | Python | 1 |
();
stmt.execute(sql::params![tx.id, &serialized])?;
Ok(())
}
}
#[cfg(test)]
mod tests {
use super::*;
extern crate test;
use durable_tree::{Node, LeafNode};
#[test]
fn test_kv_store() {
let root: Node<String> = Node::Leaf(LeafNode { items: vec![] });
let sto... | Rust | 0 |
asick::AhoCorasickBuilder::new()
.dfa(true)
.build(patterns);
format_memory("aho_corasick (dfa)", pma.heap_bytes());
}
{
let fst = fst::raw::Fst::from_iter_map(
patterns
.iter()
.cloned()
.enumerate()
... | Rust | 0 |
width // 2]
right_half = mask[:, width // 2 :]
# left_sum = np.sum(left_half)
# right_sum = np.sum(right_half)
left_half = np.logical_or(left_half, np.fliplr(right_half))
right_half = np.logical_or(right_half, np.fliplr(left_half))
# Merge the two halves back together
mask = np.hstack((lef... | Python | 1 |
# les_turbulence.py
"""
LES (Large Eddy Simulation) 大渦模擬湍流模型
基於Smagorinsky模型的高性能湍流建模實現,專為格子Boltzmann方法
設計的亞格子尺度湍流模擬。適用於高Reynolds數流動的Pour-over咖啡模擬。
大渦模擬原理:
- 直接解析大尺度渦流結構
- 建模亞格子尺度湍流效應
- Smagorinsky亞格子模型
- 各向同性湍流假設
主要特性:
- Smagorinsky SGS模型 (C_s = 0.18)
- 動態應變率計算
- 湍流黏性係數更新
- 數值穩定性保證
... | Python | 1 |
);
i += 1;
j -= 1;
}
}
fn curve_divs(r: f32, arc: f32, tess_tol: f32) -> usize {
let da = (r / (r + tess_tol)).acos() * 2.0;
i32::max((arc / da).ceil() as _, 2) as _
}
fn choose_bevel(bevel: bool, p0: &mut VPoint, p1: &mut VPoint, w: f32) -> (f32, f32, f32, f32) {
if bevel {
le... | Rust | 0 |
});
( sh ( $( $minisc:tt )* ) ) => ({
$crate::impl_top_level_sh!(Sh, new, new_sortedmulti, Legacy, $( $minisc )*)
});
( wsh ( $( $minisc:tt )* ) ) => ({
$crate::impl_top_level_sh!(Wsh, new, new_sortedmulti, Segwitv0, $( $minisc )*)
});
}
#[doc(hidden)]
pub struct TupleTwo<A, B> {
... | Rust | 0 |
= []
with tqdm(total=len(tasks), desc="Processing Motions") as pbar:
remaining_tasks = [task for task, _ in tasks]
task_to_name = {task: name for task, name in tasks}
while remaining_tasks:
# Check for completed tasks
... | Python | 1 |
d<Xc @ s d d l Z d d l Z d d l Z d d l Z d d l Z e j j e j j e Z d Z
d Z d Z e
d k r e e j d k r e
n e j d d k r e q e j d d k r e q e
n d S(
iNc C s d GHt j d d S( Ns" Usage: re-vendor.... | Python | 1 |
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _
class AccountAnalyticTag(models.Model):
_inherit = 'account.analytic.tag'
building_id = fields.Many2one('project.building', compute='get_related_building')
def get_related_building(self):
for rec in self:
building_id = s... | Python | 1 |
import torch
class OptimHandler():
def __init__(self, config):
self.config = config
def initialize_optimizer(self, params, lrs_dict, tracking=True):
lrs = lrs_dict
param_groups = [{'params': [v], 'name': k, 'lr': lrs[k]} for k, v in params.items()]
if tracking:
... | Python | 1 |
h-first order.
let mut depth = 0;
while let Some((delta, entry)) = die_cursor.next_dfs()? {
// Update depth value, and break out of the loop when we
// return to the original starting position.
depth += delta;
if depth <= 0 {
break;
}
let _ir_id = ir:... | Rust | 0 |
in valid_files:
is_valid = is_valid or path.endswith(fi)
if not is_valid:
message = f"{path} is not a valid file for polars_readstat. It must be one of these: {valid_files} ( is not a valid file )"
raise Exception(message)
if path.endswith(".sas7bdat") and engine not in ["cpp","r... | Python | 1 |
from bs4 import BeautifulSoup
# Open and read the HTML file
with open('D:\\Python\\Beautiful_Soup\\index3.html', 'r', encoding='utf-8') as file:
content = file.read() # Read the file's content into a variable
# Parse the HTML content using BeautifulSoup with the lxml parser
soup = BeautifulSoup(content, 'lxml')
... | Python | 1 |
writer.open_tlv(FORWARD_TSN_SUPPORTED_TYPE)?;
writer.close_tlv()?;
}
&Parameter::Unknown(ptype, ref v) => {
writer.open_tlv(ptype)?;
writer.write_bytes(v)?;
writer.close_tlv()?;
}
};
Ok(())
}
#[cfg(test)]
mod tests {
use su... | Rust | 0 |
ew
{
pub data: *const u8,
pub size: size_t
}
#[repr(C)]
pub struct Value
{
_opaque: [u8; 0]
}
#[repr(C)]
pub struct Blob
{
_opaque: [u8; 0]
}
#[repr(C)]
#[derive(PartialEq)]
pub struct InfoHash
{
pub d: [u8; HASH_LEN],
}
#[repr(C)]
pub struct PkId
{
pub d: [u8; PKID_LEN],
}
#[repr(C)]
pub s... | Rust | 0 |
build_rocksdb();
}
if cfg!(feature = "snappy") {
if !use_pkg_config {
fail_on_empty_directory("snappy");
println!("cargo:rerun-if-changed=snappy/");
build_snappy();
} else if let Err(err) = probe_library("libsnappy", SNAPPY_VERSION, true) {
... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.scdoc
~~~~~~~~~~~~~~~~~~~~~
Lexer for scdoc, a simple man page generator.
:copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups,... | Python | 1 |
Some(l) => l,
// error_len() == None means unexpected eof
None => {
if !final_decode {
break;
}
handle_error!(err_idx..data.len(), "unexpected end of data")... | Rust | 0 |
# BUILD VECTOR STORE FROM FILES
import re
import json
from glob import glob
from urllib.parse import urlparse
import requests
import openai
import nearai
def replace_github_with_code(content: str) -> str:
githubs = re.findall(r"<Github\s[^>]*?/>", content)
for gh in githubs:
gh = gh.replace("'", '"'... | Python | 1 |
print(f"✅ Step 4 PASS: Response validation completed")
print(f"Response valid: {response_valid}")
print(f"Validation details: {json.dumps(validation_details, indent=2)}")
result["status"] = "PASS"
result["final_response"] = workflow_response
print(f"\n🎉 EXECUTE... | Python | 1 |
= file_pattern.search(os.path.basename(original_path))
if not match:
print(f"{original_path}は,rgb_().pngとマッチしませんでした")
continue
idx = match.group(1)
# 写真の番号ごとにフォルダ作成
os.makedirs(os.path.join(output_dir, f"image_{idx}"), exist_ok=True)
# 同じ... | Python | 1 |
to());
// +--> V1 ---E14--> V4
// | |
// E21 E12
// | |
// | v
// +--- V2 ---E23--> V3
assert!(e12.is_some() && e23.is_some() && e21.is_some() && e14.is_some());
let i = g.in_edges(v1).collect::<Vec<_>>();
assert!(i == vec![e21.unwrap(... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The settings of the modules and the process
"""
# imports
import os
__author__ = 'Konstantinos Drossos'
__docformat__ = 'reStructuredText'
__all__ = [
'debug',
'dataset_paths',
'output_audio_paths',
'metrics_paths',
'output_states_path',
'train... | Python | 1 |
import imgaug.augmenters as iaa
from dfgiatk.ops.img import cvt_batch, CVT_HWC2CHW
import numpy as np
import cv2
from dfgiatk.experimenter import e
def img_transform(partition, endpoint, modality):
aug_key = f'{partition}_{endpoint}{modality}_transform'
aug = aug_key in e
def _(img_batch, samples):
... | Python | 1 |
N: Rpc + PeerTrust + Gossip + 'static,
S: Storage + 'static,
DB: cita_trie::DB + 'static,
Mapping: ServiceMapping + 'static,
{
#[muta_apm::derive::tracing_span(kind = "consensus.adapter")]
async fn get_txs_from_mempool(
&self,
ctx: Context,
_height: u64,
cycle_limit: ... | Rust | 0 |
"""
Branin function.
-- kvysyara@andrew.cmu.edu
-- kandasamy@cs.cmu.edu
"""
# pylint: disable=invalid-name
import numpy as np
# Branin Function ------------------------------------------------------------------------
def branin_with_params(x, a, b, c, r, s, t):
""" Computes the Branin function. """
x1 = x... | Python | 1 |
LOW_INDEX_MUL_POS,
NoAutoHelp("noautohelp")
=> Flags::NO_AUTO_HELP,
NoAutoVersion("noautoversion")
=> Flags::NO_AUTO_VERSION,
NoBinaryName("nobinaryname")
=> Flags::NO_BIN_NAME,
StrictUtf8("strictutf8")
=> Flags::UTF8_STRICT,
SubcommandsNegateReqs("subcommandsnegatere... | Rust | 0 |
n()
check_info_disclosure(url)
elif choice == "5":
loading_animation()
check_ssrf(url)
elif choice == "6":
loading_animation()
check_file_inclusion(url)
elif choice == "7":
loading_animation()
check_directory_tra... | Python | 1 |
dataset.id, skip_id=True
)
file_path = f"datasets/{db_file_name}/{ds_file_name}.yaml"
payload = dataset.export_to_dict(
recursive=True,
include_parent_ref=False,
include_defaults=True,
export... | Python | 1 |
o open set
if neighbour_state not in open_set:
came_from[neighbour_state] = current_state
heappush(open_set, neighbour_state)
if debug:
print('STA*: Open set is empty, no path found.')
return np.array([])
'''
Reconstruct path ... | Python | 1 |
import re
from app.models import db
from app.models.base import SoftDeletionModel
class Microlocation(SoftDeletionModel):
"""Microlocation model class"""
__tablename__ = 'microlocations'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String, nullable=False)
latitude = db.Column... | Python | 1 |
nic!("Error: {:?}", err),
};
let value = vm.ctx.new_float(x);
Ok(value)
}
fn pyfloat_to_secs_and_nanos(seconds: &PyObjectRef) -> (i64, u32) {
let seconds = objfloat::get_value(seconds);
let secs: i64 = seconds.trunc() as i64;
let nanos: u32 = (seconds.fract() * 1e9) as u32;
(secs, nanos)
}
... | Rust | 0 |
.end()));
}
let deferred_action: DeferredAllocAction;
// Since we're updating the chunk in-place here, we need to make sure we preserve the ordering of the free pages list.
// Thus, we set that chunk to be the `before` chunk, unless `before` is zero-sized,
// in which case we set that chunk to be `new_allocat... | Rust | 0 |
# Copyright (C) 2023-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Test lightning inference entrypoint script."""
import sys
from collections.abc import Callable
from importlib.util import find_spec
from pathlib import Path
import pytest
sys.path.append("tools/inference")
class TestLightningInfe... | Python | 1 |
"""
RTKLIB-Py: Top level code for post-processing solution from rinex data
Copyright (c) 2022 Tim Everett
"""
import sys, os, shutil
# set run parameters
maxepoch = None # max # of epochs, used for debug, None = no limit
trace_level = 3 # debug trace level
basepos = [] # default to not specified here
######## spe... | Python | 1 |
pixel - 0.5 * bin_size_in_pixel)
selected_ad = get_region(adata, selected)
if selected_ad.shape[0] < 1:
logger.warning(f"No cells at distance {dist} to edge.")
continue
selected_expr = get_adata_layer(selected_ad, layer_key)
cellsxgenes_expr = get_expression_fc(ba... | Python | 1 |
pub name_strobj: *mut PyObject,
}
pub const PyWrapperFlag_KEYWORDS: c_int = 1;
#[repr(C)]
pub struct PyDescrObject {
pub ob_base: PyObject,
pub d_type: *mut PyTypeObject,
pub d_name: *mut PyObject,
pub d_qualname: *mut PyObject,
}
// skipped non-limited PyDescr_TYPE
// skipped non-limited PyDesc... | Rust | 0 |
RESERVED6 as u64
});
__bindgen_bitfield_unit
}
}
#[doc = "\\brief User's DS settings."]
#[doc = "Defines the structure the DS firmware uses for transfer"]
#[doc = "of the user's settings to the booted program."]
#[doc = ""]
#[doc = "Theme/Color values:"]
#[doc = "- 0 = Gray"]
#[doc = "- 1... | Rust | 0 |
fn otl_gsub_select(
gsub_list: *mut otl_gsub,
script: *const i8,
language: *const i8,
feature: *const i8,
) -> i32;
#[no_mangle]
fn otl_gsub_apply(gsub_list: *mut otl_gsub, gid: *mut u16) -> i32;
/* Handle a list of OTL features */
#[no_mangle]
fn otl_gsub_apply_c... | Rust | 0 |
rA r( stderrwriteZauthenticatorsKeyErrorr r rr rD rB r stdoutr' )r r< |