text string | label_name string | labels int64 |
|---|---|---|
, &T, &dyn MatchingContext) -> bool
) -> Option<(usize, HashMap<DocPath, Generator>)>
where T: Clone + std::fmt::Debug {
let result = variants.iter()
.find(|(index, rules, _)| {
debug!("find_matching_variant: Comparing variant {} with value '{:?}'", index, value);
let context = CoreMatchingContext::... | Rust | 0 |
eening_app_name";
/// public static final [CALL_SCREENING_COMPONENT_NAME](https://developer.android.com/reference/android/provider/CallLog.Calls.html#CALL_SCREENING_COMPONENT_NAME)
pub const CALL_SCREENING_COMPONENT_NAME : &'static str = "call_screening_component_name";
/// **get** public stat... | Rust | 0 |
255, 255]),
1 => Rgb([0, 0, 0]),
_ => panic!(),
};
let mut dst_image = RgbImage::new(dst_width, dst_height);
for y in 0..dst_height {
for x in 0..dst_width {
dst_image.put_pixel(x, y, color);
}
}
let scale = f64::mi... | Rust | 0 |
leq_from!(u32);
impl_vector_int_partialeq_from!(u64);
impl_vector_int_partialeq_from!(u128);
impl_vector_int_partialeq_from!(isize);
impl_vector_int_partialeq_from!(i8);
impl_vector_int_partialeq_from!(i16);
impl_vector_int_partialeq_from!(i32);
impl_vector_int_partialeq_from!(i64);
impl_vector_int_partialeq_from!(i128... | Rust | 0 |
f.put_u8(0);
}
Value::Date(year, mon, day, 0u8, 0u8, 0u8, 0u32) => {
buf.put_u8(4);
buf.put_u16_le(*year);
buf.put_u8(*mon);
buf.put_u8(*day);
}
Value::Date(year, mon, day, hour, min, sec, 0u32) => {
... | Rust | 0 |
import os
import comfy.utils
import folder_paths # type: ignore
from loguru import logger
class HordeLoraLoader:
def __init__(self):
self.loaded_lora = None
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"model": ("MODEL",),
"clip": (... | Python | 1 |
_USED_MEM,
pub pre_alloc: *mut MA_USED_MEM,
pub min_malloc: size_t,
pub block_size: size_t,
pub block_num: ::std::os::raw::c_uint,
pub first_block_usage: ::std::os::raw::c_uint,
pub error_handler: ::std::option::Option<unsafe extern "C" fn()>,
}
#[test]
fn bindgen_test_layout_st_ma_mem_root() {
... | Rust | 0 |
import numpy as np
from random import randint, choice
from trading_strategy_fitting import fit_strategy, offset_scan_validation, tic
from strategy_evaluation import output_strategy_results
def random_search(strategy_dictionary_local, n_iterations):
toc = tic()
counter = 0
error = -1e5
while counter <... | Python | 1 |
ype,
train_features_device=train_features_device,
max_train_iters=max_train_iters,
)
results_dict = {
"top-1": results_dict_logreg["top-1"].cpu().numpy() * 100.0,
"top-5": results_dict_logreg.get("top-5", torch.tensor(0.0)).cpu().numpy() * 100.0,
"best_C": re... | Python | 1 |
ms);
// println!("{} {}", target_for_peak, zdb_factor);
10.0f32.powf(db / 10.0) // * zdb_factor
// A power quanitty
},
NormalizeMetric::Peak => 10.0f32.powf(db / 20.0), // An amplitude quantity
_ => todo!("db_to_lin")
}
}
... | Rust | 0 |
const fn $update_kind(mut self, is_allowed: bool) -> Self {
self.$update_kind = is_allowed;
self
}
}
)+
}
impl Serialize for AllowedUpdates {
fn serialize<S>(&self, serializer: S) -> Result<S::O... | Rust | 0 |
e V: Visitor<'de>
{
ValueBase::deserialize_unit_struct(self, visitor)
}
forward_to_deserialize_any! {
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq
bytes byte_buf map tuple_struct struct
identifier tuple ignored_any
}
}
impl<'de> Deserializer<'de> ... | Rust | 0 |
# data/utils.py
from .processed_dataset import ProcessedDataset
def load_dataset(config):
train_dataset = ProcessedDataset("data/processed/train.npz")
val_dataset = ProcessedDataset("data/processed/val.npz")
return train_dataset, val_dataset | Python | 1 |
import torch
import os
class Config:
urchin_vid_path = r"C:\Users\kraw084\OneDrive - The University of Auckland\Desktop\urchin video\All"
urchin_vid_trimmed_path = r"C:\Users\kraw084\OneDrive - The University of Auckland\Desktop\urchin video\Trimmed"
cuda = torch.cuda.is_available() #use cuda or not
os... | Python | 1 |
// 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 writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// S... | Rust | 0 |
d-native.slack.com",
r"(?i)https?://slack.cncf.io",
r"(?i)https?://kubernetes.slack.com",
r"(?i)https?://slack.k8s.io",
]).expect("invalid exprs in SLACK_IN_README");
#[rustfmt::skip]
pub(crate) static ref SNYK_URL: Regex = Regex::new(
r#"(https://snyk.io/test/github/[^/]+/[... | Rust | 0 |
db = panbuild::db::Database::get_database();
let repo_url = &args[2];
let project = panbuild::projects::SoftwareProject::harvest(&repo_url);
if db.has_project(&project.id) {
db.update_project(&project);
} else {
db.add_project(project);
}
}
exit(... | Rust | 0 |
e.a]
codegen-units = 3
"#,
)
.file("a/Cargo.toml", &basic_manifest("a", "0.1.0"))
.file("a/src/lib.rs", "")
.file("b/Cargo.toml", &basic_manifest("b", "0.1.0"))
.file("b/src/lib.rs", "")
.build();
p.cargo("build -p b")
.with_stderr(
... | Rust | 0 |
import sys
sys.path.append("./lib")
import utility
import profiler
import time
import numpy as np
import nn_studio as nn_studio
import chiral_potential as chiral_potential
import matplotlib.pyplot as plt
utility.header_message()
#######################################################################################... | Python | 1 |
_CLK cycles acquisition time for scan samples"]
_8CYCLES,
#[doc = "4: 16 ADC_CLK cycles acquisition time for scan samples"]
_16CYCLES,
#[doc = "5: 32 ADC_CLK cycles acquisition time for scan samples"]
_32CYCLES,
#[doc = "6: 64 ADC_CLK cycles acquisition time for scan samples"]
_64CYCLES,
... | Rust | 0 |
# Ped not in surrounding, so binary mask should be zero
# #print("not surrounding")
# continue
# # If in surrounding, calculate the grid cell
# cell_x = int(np.floor(((other_x - width_low)/width_bound) * grid_size))
# cell_y = int(np.floor(((other_y -... | Python | 1 |
# Distributed under the MIT License.
# See LICENSE.txt for details.
from typing import Sequence, Union
import numpy as np
import spectre.IO.H5 as spectre_h5
from spectre.IO.H5.IterElements import iter_elements
def read_matrix(volfiles: Union[spectre_h5.H5Vol, Sequence[spectre_h5.H5Vol]]):
"""Read matrix repres... | Python | 1 |
schedule=CronSchedule(hour={23}, minute={0}, second={0}),
)
)
worker = ArqWorker(
redis_settings=create_arq_redis_settings(self._settings.REDIS_ARQ),
executor_fab=ExecutorFabric(
registry=REGISTRY,
state=state,
... | Python | 1 |
#
# Dumps Ethernet frames from a folder of pcapng files for use with AFL
# takes any packet going to dst_mac, or sent as a broadcast.
# Frames are encoded with an RLE style format -- a little-endian length followed by
# the data, followed by 0xdeadbeef
# When we load the data later after AFL gets to it,
# if the frame ... | Python | 1 |
# 12 - Sistema de Login:
# Desenvolva um programa que simule um sistema de login.
# O programa deve pedir o nome de usuário e a senha e verificar
# se correspondem a um usuário pré-cadastrado. Exiba mensagens
# apropriadas para login bem-sucedido ou falha.
login = input('Persona: ')
senha = input('Cadastre o código: '... | Python | 1 |
from django.apps import AppConfig
class ChatMessagesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'chat_messages'
| Python | 1 |
# @Author : 百年
# @FileName :01带类型参数的泛型.py
# @DateTime :2025/8/20 21:54
'''
带类型参数的泛型¶
有些数据结构可以包含其他值,如 `dict`、`list`、`set` 和 `tuple`。内部的值也可以有自己的类型。
这些具有内部类型的类型被称为“**泛型**”类型。并且可以声明它们,即使是带有它们的内部类型。
要声明这些类型和内部类型,可以使用标准的 Python 模块 `typing`。它专门用于支持这些类型提示。
Python 的新版本¶
使用 `typing` 的语法**兼容**所有版本,从 Python 3.6 到最新版本,包括 P... | Python | 1 |
# Copyright (c) ONNX Project Contributors
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from onnx.reference.ops._op import OpRunUnaryNum
class Asin(OpRunUnaryNum):
def _run(self, x): # type: ignore
return (np.arcsin(x),)
| Python | 1 |
from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class CustomUser(AbstractUser):
email = models.EmailField(unique=True)
| Python | 1 |
Interval] which can be constructed using the [interval
/// DSLs][interval dsls]
///
/// ### [`FromSql`](/diesel/types/trait.FromSql.html) impls
///
/// - [`PgInterval`][PgInterval] which can be constructed using the [interval
/// DSLs][interval dsls]
///
/// [PgInterval]: /diesel/pg/data_types/struct.PgInterval.htm... | Rust | 0 |
RESULT_REF: &u64 = unsafe { &RESULT };
static HELLO_WORLD: &str = "Hello World!";
static HELLO_WORLD_REF: &&str = &HELLO_WORLD;
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
htif::shutdown(1)
}
#[no_mangle]
pub extern "C" fn main() -> isize {
htif::print("*HELLO_WORLD_REF = ");
... | Rust | 0 |
TestResult {
run_test(
"[[lang, gems, grade]; [nu, 100, a]] | reject gems grade | to json",
r#"[
{
"lang": "nu"
}
]"#,
)
}
#[test]
fn command_filter_reject_3() -> TestResult {
run_test(
"[[lang, gems, grade]; [nu, 100, a]] | reject grade gems | to json",
r#"[
{
... | Rust | 0 |
tive-laplacian", type=int, default=1)
args = parser.parse_args()
data_path = args.data_path
name_path = args.name_path
rid = args.rid
random_seed = args.random_seed
sample_size = args.sample_size
epochs = args.epochs
lr = args.lr
verbal = args.verbal
prior = args.prior
beta ... | Python | 1 |
use crate::apply::{apply_system_update, ApplyProgress, ApplyState};
use crate::channel::{CurrentChannelManager, TargetChannelManager};
use crate::check::{check_for_system_update, SystemUpdateStatus};
use crate::connect::ServiceConnect;
use crate::update_monitor::{StateNotifier, UpdateMonitor};
use crate::update_servi... | Rust | 0 |
));
return Ok(());
}
let output_format = get_output_format_from_args(&matches)?;
output!(output_format, .display(
stdout(),
&issues,
Some(vec!["html_url", "title"]),
None,
))
}
}
<reponame>gin66/ESP32_projects
use serde::{D... | Rust | 0 |
'a str,
name: &'b str,
timeout: Option<f64>
}
let args = Args {
selector,
name,
timeout
};
let v = send_message!(self, "getAttribute", args);
let s = maybe_only_str(&v)?;
Ok(s.map(Into::into))
}
pub(crat... | Rust | 0 |
st CRC: Crc<u16> = Crc::<u16>::new(&CRC_16_UMTS);
Ok(CRC.checksum(&data))
}
#[pyfunction]
fn crc_16_usb(data: &[u8]) -> PyResult<u16> {
const CRC: Crc<u16> = Crc::<u16>::new(&CRC_16_USB);
Ok(CRC.checksum(&data))
}
#[pyfunction]
fn crc_16_xmodem(data: &[u8]) -> PyResult<u16> {
const CRC: Crc<u16> = Crc... | Rust | 0 |
les_work_as_expected() {
use crate::examples::test as test_examples;
test_examples(ToURL {})
}
}
use std::io::{self, Write};
use std::io::BufRead;
use regex::Regex;
use std::cmp::max;
use std::fmt::*;
use smallvec::SmallVec;
use crate::pipem::Fragment::{StaticValue, SingleField, FieldRange, Unboun... | Rust | 0 |
return bathroom_difference * self.adjustment_rates["bathroom_adjustment"]
def _calculate_age_adjustment(self, subject: Property, comparable: Property) -> float:
"""
Calculate adjustment for age difference
Newer properties are typically worth more
"""
if not (sub... | Python | 1 |
hen assign the first item
// (the text before the inline comment)
// otherwise move on because all the text
// is commented out
line = tmp[0].to_string();
} else {
continue;
}
}
if &line[..4] == "say ... | Rust | 0 |
se_halt(i: &str) -> IResult<&str, Instruction> {
let t = tag_no_case("halt")(i)?;
Ok((t.0, Instruction::Halt))
}
fn parse_kill(i: &str) -> IResult<&str, Instruction> {
let t = tag_no_case("kill")(i)?;
Ok((t.0, Instruction::Kill))
}
fn parse_host(i: &str) -> IResult<&str, Instruction> {
let t = tup... | Rust | 0 |
rizontal_line(p0, p1, p_min.y);
}
if (p1.y < p_min.y && p_min.y < p0.y) {
p1 = intersect_line_segment_with_horizontal_line(p1, p0, p_min.y);
}
if (p0.y < p_max.y && p_max.y < p1.y) {
p1 = inte... | Rust | 0 |
red::cell::{Ref, TrustCell};
///
/// let cb = TrustCell::new(Box::new(5));
///
/// // Borrowing the cell causes the `Ref` to store a reference to the `Box`, which is a
/// // pointer to the value on the heap, not the actual value.
/// let boxed_ref: Ref<'_, Box<usize>> = cb.borrow();
/// ass... | Rust | 0 |
add_argument(
"--latent_encoder_config",
type=str,
default=None,
help="Path to a config file for the slot attention.",
required=True,
)
parser.add_argument(
"--unet_config",
type=str,
default=None,
help="Path to a config file for the unet o... | Python | 1 |
shape: shape.to_shape(0),
eps,
gamma: Var::with_shape([1]),
beta: Var::with_shape([1]),
}
}
}
impl Parameter for LayerNorm {
fn init(&self) {
self.gamma.set_data(Tensor::scalar(1.0));
self.beta.set_data(Tensor::scalar(0.0));
}
fn param... | Rust | 0 |
"""
測試交易指標模組
此測試文件針對 src/core/indicators.py 模組進行全面測試,
包括技術指標、基本面指標和情緒指標的功能測試。
測試覆蓋:
- TechnicalIndicators 類的所有方法
- FundamentalIndicators 類的所有方法
- SentimentIndicators 類的所有方法
- 指標評估和訊號生成功能
"""
import pytest
import pandas as pd
import numpy as np
from datetime import datetime, timedelta
from unittest.mock import patch,... | Python | 1 |
": ["domain"],
"additionalProperties": False,
}
domain_create_response_body: dict[str, Any] = {
"type": "object",
"properties": {"domain": domain_schema},
"required": ["domain"],
"additionalProperties": False,
}
tags_response_body: dict[str, Any] = response_types.tags
tags_update_request_body: di... | Python | 1 |
bool {
raw.supports_feature_set(MTLFeatureSet::macOS_GPUFamily1_v1)
}
fn supports_any(raw: &metal::DeviceRef, features_sets: &[MTLFeatureSet]) -> bool {
features_sets.iter().cloned().any(|x| raw.supports_feature_set(x))
}
pub(crate) fn new(shared: Arc<Shared>) -> Self {
let pri... | 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 u... | Python | 1 |
fn transform(
&self,
relation: &mut RelationExpr,
_: TransformArgs,
) -> Result<(), crate::TransformError> {
relation.visit_mut(&mut |e| {
self.action(e);
});
Ok(())
}
}
impl ReductionPushdown {
/// Pushes Reduce operators toward sources.
... | Rust | 0 |
_factors:
logger.warning(f"以下因子暫未實現: {unavailable_factors}")
def _load_legacy_strategy(self) -> None:
"""
載入原始 Alpha101 因子庫。
從 ai_quant_trade-0.0.1 項目中導入 Alpha101 因子計算函數。
"""
try:
# 嘗試導入原始因子庫
self._import_alpha101_functions()
... | Python | 1 |
f self.training:
return self._forward_train(box_cls, box_regression, iou_pred,
targets, anchors, locations)
else:
return self._forward_test(box_cls, box_regression, iou_pred, anchors)
def _forward_train(self, box_cls, box_regression, iou_pred, ... | Python | 1 |
<&str>().expect(CHECKED).deref().into();
}
if TypeId::of::<T>() == TypeId::of::<()>() {
return ().into();
}
value = match unsafe_try_cast::<_, String>(value) {
Ok(s) => return s.into(),
Err(value) => value,
};
#[cfg(not(feature = "no_i... | Rust | 0 |
ate the end of the arrows.
""")
y_end = NumberSpec(default=field("y_end"), help="""
The y-coordinates to locate the end of the arrows.
""")
end_units = Enum(CoordinateUnits, default='data', help="""
The unit type for the end_x and end_y attributes. Interpreted as "data
space" units by defa... | Python | 1 |
let mut cachesize: usize;
x = libc::getenv((*b"IP\0").as_ptr() as *const libc::c_char);
if x.is_null() {
StrErr::die(
111i32,
(*b"dnscache: fatal: \0").as_ptr(),
(*b"$IP not set\0").as_ptr(),
0i32 as (*const u8),
0i32 as (*const u8),
... | Rust | 0 |
(
description,
"a",
attrib={
"referrerpolicy": "no-referrer",
"class": "bigImage",
"title": child.find("a/img").get("alt"),
... | Python | 1 |
ineTool Initialized")
query_engine_tools = [
QueryEngineTool(
query_engine=query_engine,
metadata=ToolMetadata(
name="llama_index",
description="Input provided by user",
),
),
]
if kwargs['query_engine_args'].get('SubQuestio... | Python | 1 |
#!/usr/bin/env python3
from types import SimpleNamespace
from unittest.mock import patch
import pytest
from cis_audit import CISAudit
test = CISAudit()
def mock_password_hashing_algorithm_pass(*args):
returncode = 0
stderr = ['']
stdout = [
'/etc/pam.d/system-auth:password sufficient pam_uni... | Python | 1 |
ith a click angle of 15 degrees produces 24 logical clicks per 360 degree rotation.
/// Where the physical angle matters, use [`PointerScrollEvent::scroll_value`] instead.
///
/// The magic number 120 originates from the [Windows Vista Mouse Wheel design document](http://download.microsoft.com/download/b/d/... | Rust | 0 |
map_binding,
map_assignment
)),
pre_ms0(stag(";")),
)(s)
}
#[derive(Clone, PartialEq, Eq, Debug)]
pub(crate) struct RHS<'a> {
rhs: Vec<Statement<'a>>
}
pub(crate) fn parse_rhs(s: Span) -> nom::IResult<Span, RHS> {
let statements = fold_many0(
parse_statement,
... | Rust | 0 |
nt, p_b32, p_b32, p_b32, POINTER(c_byte*16), c_void_p, c_uint)(adaptor)
sig = create_string_buffer(64)
sig_hash_bytes = to_bytes_32(val)
libsecp256k1.secp256k1_ecdsa_sign(
libsecp256k1.ctx, sig, sig_hash_bytes, to_bytes_32(secret_exponent), nonce_function, None)
compact_sign... | Python | 1 |
zer, [lambda opt: torch.optim.lr_scheduler.ExponentialLR(opt, 0.95),
lambda opt: torch.optim.lr_scheduler.ExponentialLR(opt, 0.95)])
if opt.checkpoint_path is not None:
print(f"Loading weights from {opt.checkpoint_path}...")
state_dict = torch.load(opt.checkpoint_path, map_locati... | Python | 1 |
dbg!("{err}");
/// });
/// // or don't care..
/// let _ = send_program_change(0, 42);
/// ```
///
/// # Errors
///
/// A list of errors that can occur:
/// - [`OutOfRange`](crate::error::SendError::OutOfRange)
pub fn send_program_change(channel: i32, value: i32) -> Result<(), SendError> {
unsafe {
// Return... | Rust | 0 |
self.cache[path] = True
break
else:
for (component_only, pattern), exclude in patterns:
if component_only:
match = pattern.match(name)
else:
... | Python | 1 |
# Copyright 2024 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 1 |
#!/usr/bin/env python
#
# Seccomp Library test program
#
# Copyright (c) 2013 Red Hat <pmoore@redhat.com>
# Author: Paul Moore <paul@paul-moore.com>
#
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License as
# published by... | Python | 1 |
# * * * * *
# * * * *
# * * *
# * *
# *
n=int(input())
for i in range(n):
for j in range(n-i):
print("*", end=" ")
print() | Python | 1 |
# Problem: Unique Paths II - https://leetcode.com/problems/unique-paths-ii/
class Solution:
def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:
m = len(obstacleGrid)
n = len(obstacleGrid[0])
if obstacleGrid[0][0] == 1 or obstacleGrid[m-1][n-1] == 1:
... | Python | 1 |
}
}
pub fn run<C, F>(mut self, consumer: C, body: F)
where
C: DatagramConsumer + Send + Sync + 'static,
F: FnOnce(&Path),
{
let temp = TempDir::new(&self.base).unwrap();
let socket = temp.new_path("cadence.sock");
let server = Arc::new(UnixSocketServer::new(&soc... | Rust | 0 |
"""Coordinator for Streamlabs water integration."""
from dataclasses import dataclass
from datetime import timedelta
from streamlabswater.streamlabswater import StreamlabsClient
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from .const import ... | Python | 1 |
idationFailed,
}
/// Compact string type for zero-copy parsing.
///
/// `Tendril`s have the semantics of owned strings, but are sometimes views
/// into shared buffers. When you mutate a `Tendril`, an owned copy is made
/// if necessary. Further mutations occur in-place until the string becomes
/// shared, e.g. with `... | Rust | 0 |
Down) => &images[2],
Some(Keycode::Left) => &images[3],
Some(Keycode::Right) => &images[4],
_ => current_surface,
};
{
let mut surface = window.surface_mut(&sdl_epump).unwrap();
... | Rust | 0 |
from .common import InfoExtractor
from ..utils import int_or_none
class HypemIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hypem\.com/track/(?P<id>[0-9a-z]{5})'
_TEST = {
'url': 'http://hypem.com/track/1v6ga/BODYWORK+-+TAME',
'md5': 'b9cc91b5af8995e9f0c1cee04c575828',
'info_dict... | Python | 1 |
ps_0/mu_0)*solver.gauss(solver.time + solver.dt)
#solver.Hy[:, :, k_s] += Px*np.sqrt(eps_0/mu_0)*solver.gauss(solver.time + solver.dt)
solver.Hz[i_s, j_s, :] += np.sqrt(eps_0/mu_0)*solver.gauss(solver.time + solver.dt)
# solver.Hz[i_s, j_s, k_s] += solver.gauss(solver.time)
# solver.Jz[i_s, j_s, k_s] = ... | Python | 1 |
ntry>,
}
/// A single entry within an image file directory (IDF). It consists of a tag, a type, and several
/// tag values.
#[derive(Debug)]
pub struct IFDEntry {
pub tag: TIFFTag,
pub tpe: TagType,
pub count: LONG,
pub value_offset: LONG,
pub value: Vec<TagValue>,
}... | Rust | 0 |
Bit 1 - 1:1\\]
0: Sector protected"]
#[inline(always)]
pub fn wrt_prot_sec_65(&self) -> WRT_PROT_SEC_65_R {
WRT_PROT_SEC_65_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0 - 0:0\\]
0: Sector protected"]
#[inline(always)]
pub fn wrt_prot_sec_64(&self) -> WRT_PROT_SEC_64_R {
... | Rust | 0 |
FROM tarefas")
id = int(input("Digite o ID da tarefa que deseja alterar: "))
editar_tarefa(id)
limpar_terminal()
mostrar_menu()
elif comando == 4: # 4- Excluir tarefa
limpar_terminal()
listar_tarefas("SELECT * FROM tarefas")
i... | Python | 1 |
}
/// public static final [ERROR_NONE](https://developer.android.com/reference/android/drm/DrmManagerClient.html#ERROR_NONE)
pub const ERROR_NONE : i32 = 0;
/// public static final [ERROR_UNKNOWN](https://developer.android.com/reference/android/drm/DrmManagerClient.html#ERROR_UNKNOWN)... | Rust | 0 |
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|... | Python | 1 |
# Simple class for learning an alignment of strings, MED-style.
# Weights are learned by a Chinese Restaurant Process sampler
# that weights single alignments x:y in proportion to how many times
# such an alignment has been seen elsewhere out of all possible alignments.
# Licensed under the Apache License, Version 2.0... | Python | 1 |
template_public_key().get_key(),
)?;
let mut credential_values_builder = utils::safe_indy_check(
issuer::Issuer::new_credential_values_builder(),
)?;
for pair in certificate_attribute_dict.get_pair() {
utils::safe_indy_check(
credential_values_builder
.add... | Rust | 0 |
ionLoss(nn.Module):
def __init__(self, max_depth):
super(DistributionLoss, self).__init__()
self.name = 'DistributionLoss'
self.max_depth = max_depth
def forward(self, input, target, mask=None, dist='biLaplacian'):
mu0 = input['mu0']
mu1 = input['mu1']
... | Python | 1 |
t:', byteSent)
print('------------------------------------------------')
# print('Get version floader...')
byteSent = serialPort.write(crc_blk(b'\x00\x00\x00\x00'))
read = serialPort.read(10)
if len(read)==6 and read[0]==0 and crc_chk(read):
cid = read[2] | (read[3]<<8)
ver = read[1]
if cid == 0 and ver ==... | Python | 1 |
"""
Interactive CLI for ChaosAgent.
"""
import argparse
import os
from typing import Optional
from chaos_agent import ChaosAgent
BANNER = """\
CHAOS Agent CLI 🌌
:open <path> load .sn/.chaos file
:dreams show visions
:emotions active emotions
:symbols known symbols
:action last action
:clea... | Python | 1 |
draft_if_exists: Option<bool>,
}
/// struct for passing parameters to the method `set_workflow_scheme_issue_type`
#[derive(Clone, Debug)]
pub struct SetWorkflowSchemeIssueTypeParams {
/// The ID of the workflow scheme.
pub id: i64,
/// The ID of the issue type.
pub issue_type: String,
/// The issue... | Rust | 0 |
xt,
termination_token_id,
prompt_len,
subtb_lambda=1.0,
):
assert (
log_pf.shape[1]
== log_r.shape[1]
== log_pterm.shape[1]
== generated_text.shape[1] - prompt_len
)
assert (
log_pf.shape[1] > 1
)
delta = (
log_r[:, :-1]
+ log_pf[... | Python | 1 |
from flask import Flask, request, redirect, url_for, render_template_string, session
import google.generativeai as genai
import db
app = Flask(__name__)
app.secret_key = "FLAG"
system_prompt = ["SYSTEM PROMPT HERE"]
model = genai.GenerativeModel('gemini-1.5-flash', system_instruction=system_prompt)
api_key = "API ... | Python | 1 |
7\xba\xd7\xef\x8cN/\x07\x88\
TjR\xf6q|\xca)\xd6\xa3nT\xda\xd5\xca)\
\xae\x8ft\xef\xae\xbaYx\xee\xb9\xa7\xeb\xb7\x97qJ\
\x9a$7\xa9\xe6F^+_\x10\xe9\xbax\xb6[\x8c\
,\xf7V\x92j\x11Ekw\xf6b\x03\x98\x1a\xfa\xd2\
K\x94\xe27\x04\x859\xf7wsiM-\xb6\xb0\xba\
\xd5\x8d\xa5\xbcby\xfe\xcf\xe1\xfdw]\xba\xc0tU\
\x92+m\x02\xcfQ\xbaeo1\x... | Python | 1 |
import numpy as np
import platform
import sys
import os
def get_k4a_module_path():
# Check if running in Jetson Nano or similar ARM chips
if platform.machine().lower() == 'aarch64':
return r'/usr/lib/aarch64-linux-gnu/libk4a.so'
# For non-Arm chips, first check if it is running linux
if platf... | Python | 1 |
_exp = self.exponent_raw().max(other.exponent_raw());
let mut infinite = false;
if new_mant.leading_zeros() < 5 {
let shift = 5 - new_mant.leading_zeros();
new_mant = new_mant.wrapping_shr(shift);
let exp_result = new_exp.overflowing_add(shift as u8);
new_... | Rust | 0 |
(lc - b_xy.get_variable());
let lc = expected_b_y_old.lc(&mut cs);
cs.enforce_zero(lc - b_y_old.get_variable());
let lc = expected_b_y_cur.lc(&mut cs);
cs.enforce_zero(lc - b_y_cur.get_variable());
let lc = expected_b_y_new.lc(&mut cs);
cs.enforce_zero(lc - b_y_new.get... | Rust | 0 |
(1/3., 1/2., 1, 2, 3),
(1/3., 1/2., 1, 2, 3),
(1/3., 1/2., 1, 2, 3),
(1/3., 1/2., 1, 2, 3),
(1/2., 1, 2),
(1/2., 1, 2)),
'sizes': [s / 512. for s in (20.48... | Python | 1 |
h.cat(val_targets, dim=0)
loss = criterion(val_logits, val_targets).item()
# Gather loss
v = torch.tensor([loss], device=cfg.local_rank)
torch.distributed.all_reduce(v, op=dist.ReduceOp.SUM)
val_loss = (v[0] / cfg.world_size).item()
# ========== Weights / Early sto... | Python | 1 |
import os
import shutil
import pytest
from s2p import disparity_to_ply, read_config_file
from s2p.initialization import build_cfg
from s2p.ply import read_3d_point_cloud_from_ply
from tests_utils import data_path
@pytest.mark.parametrize("out_crs", [None, "epsg:32740", "epsg:32740+5773"])
def test_disparity_to_ply(... | Python | 1 |
[{"depth": 2, "name": False}, {"depth": 1, "name": True}],
True,
[{"depth": 1, "name": True}, {"depth": 2, "name": False}],
),
(
"distros",
[{"depth": 2, "name": False}, {"depth": 1, "name": True}],
False,
[{"depth": 2,... | Python | 1 |
erence_mode=False,
)
trainer.fit(model, datamodule=data, ckpt_path=args.load_model)
test_trainer = pl.Trainer(
enable_model_summary=True,
logger=[csv_logger],
max_epochs=-1,
num_nodes=1,
devices=1,
default_root_dir=args.log_dir,
enabl... | Python | 1 |
even if external API fails after retry."""
mock_dependencies['report_to_external_api'].return_value = {"success": False, "message": "API error"}
with patch('source.time.sleep'), patch('source.print') as mock_print:
result = process_time_exchange(1, 2, 3, "Gardening")
assert result["status"... | Python | 1 |
# Write a function remove_duplicates(lst) that takes a list lst of integers
# and returns a new list with all duplicates removed while maintaining the original order.
# Example: remove_duplicates([1, 3, 3, 5, 5, 7, 9, 9])
# output : [1, 3, 5, 7, 9]
def remove_duplicates(lst):
new_list = []
for i in lst:
... | Python | 1 |
elf.rx_over_errors);
buffer.set_rx_crc_errors(self.rx_crc_errors);
buffer.set_rx_frame_errors(self.rx_frame_errors);
buffer.set_rx_fifo_errors(self.rx_fifo_errors);
buffer.set_rx_missed_errors(self.rx_missed_errors);
buffer.set_tx_aborted_errors(self.tx_aborted_errors);
b... | Rust | 0 |
"""
Sample Input 0:
1 3 1 3 1 4 1 3 2 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
abc
Sample Output 0:
9
Assuming all letters are 1mm wide.
The tallest letter in abc is b at 3mm . The selection area for this word is 3 X 1mm X 3mm = 9mm².
"""
#!/bin/python3
import math
import os
import random
import re
import sys
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.