text string | label_name string | labels int64 |
|---|---|---|
four_augment_three_val = ""
if onscreen("./captures/4-2.png"):
augments_ss = ImageGrab.grab(bbox = (903, 1080, 1403, 1130))
augments_ss.save("stage_four_first_augment.png")
augments_ss.close()
stage_four_augment_one_img = cv2.imread("stage_four_first_augment.png")... | Python | 1 |
me {
object.key("ModelPackageName").string(var_709);
}
}
pub fn serialize_structure_describe_model_package_group_input(
object: &mut smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DescribeModelPackageGroupInput,
) {
if let Some(var_710) = &input.model_package_group_name {
... | Rust | 0 |
import random
from statistics import mean
def round_off(x: float):
x = str(x)
number, decimals = x.split('.')
number = int(number)
if int(decimals[0]) >= 5:
number +=1
return int(number)
def simulate_fixture(team1, team2):
team1.P += 1; team2.P += 1
# get all the player avg's as ... | Python | 1 |
from kubepyhound.models.entries import (
Node,
NodeProperties,
StaleReference,
EdgePath,
Edge,
)
class ExtendedProperties(NodeProperties):
source_ref: str
source_edge_type: str
class StaleNode(Node):
properties: ExtendedProperties
@property
def _source_refs(self):
st... | Python | 1 |
from django.contrib.auth.models import AbstractUser, BaseUserManager
from django.db import models
class CustomUserManager(BaseUserManager):
def create_user(self, phone_number, password=None, email=None, **extra_fields):
if not phone_number:
raise ValueError('Необходимо указать номер телефона.'... | Python | 1 |
from modules.model.PixArtAlphaModel import PixArtAlphaModel
from modules.modelSaver.BaseModelSaver import BaseModelSaver
from modules.modelSaver.mixin.InternalModelSaverMixin import InternalModelSaverMixin
from modules.modelSaver.pixartAlpha.PixArtAlphaEmbeddingSaver import PixArtAlphaEmbeddingSaver
from modules.modelS... | Python | 1 |
式29中的m)
"""
log_prior_s = 0
log_va_poser_s = 0
model_preds_s = []
for _ in range(sample_num): # 算法2:第4行
model_preds, log_prior, log_va_poster = self.run_sample(inputs, self.training)
log_prior_s += log_prior ... | Python | 1 |
{
assert_ne!(x, x, "custom panic message");
});
assert!(result.is_err());
let result = result.unwrap_err().payload_str().to_owned();
println!("expect={}", expect);
println!("result={}", result);
with_config_assert_eq!(
pretty_assertions::Config {
auto_label: true,
... | Rust | 0 |
)
return parser
@torch.inference_mode()
def main(model_provider: str = "gpt"):
"""Runs the text generation server with the specified model provider."""
initialize_megatron(
extra_args_provider=add_text_generate_args,
args_defaults={
'no_load_rng': True,
'no_loa... | Python | 1 |
# allows to red the (python) configuration file and update the layout dictionary
def read_config(filepath: str):
# Create a dictionary to hold the variables defined in the file
local_vars = {}
try:
# Read the file content
with open(filepath, "r") as file:
code = file.read()
... | Python | 1 |
sr-Latn': 'mosi', 'sv': 'mossi', 'sw': 'Kimoore', 'ta': 'மோஸ்ஸி', 'te': 'మోస్సి', 'th': 'โมซี', 'ti': 'ሞሲ', 'tk': 'mossi dili', 'to': 'lea fakamosi', 'tr': 'Mossi', 'ug': 'موسسىچە', 'uk': 'моссі', 'ur': 'موسی', 'uz': 'mossi', 'uz-Cyrl': 'мосси', 'uz-Latn': 'mossi', 'vec': 'mosi', 'vi': 'Tiếng Mossi', 'xnr': 'मोस्सी', '... | Python | 1 |
"Distortion 1";
const PARAM_DISTORTION_2_LABEL: &str = "Distortion 2";
const PARAM_DISTORTION_3_LABEL: &str = "Distortion 3";
const PARAM_CALIB_DIM: &str = "calDim";
const PARAM_CALIB_WIDTH: &str = "calWidth";
const PARAM_CALIB_HEIGHT: &str = "calHeight";
const PARAM_CALIB_WIDTH_LABEL: &str = "Calibration width";
c... | Rust | 0 |
# -*- coding: utf-8 -*-
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
# Structurable.py ---
# --------------------------------
# Copyright (c) 2013
# Laurent CAPOCCHI
# University of Corsica
# ... | Python | 1 |
Asset}, prelude::info};
use thiserror::Error;
use crate::prelude::Svg;
#[derive(Default)]
pub struct SvgAssetLoader;
impl AssetLoader for SvgAssetLoader {
fn load<'a>(
&'a self,
bytes: &'a [u8],
load_context: &'a mut LoadContext,
) -> BoxedFuture<'a, Result<(), anyhow::Error>> {
... | Rust | 0 |
peline {
One(i32),
Two,
}
static mut REF_ONE_VALUE: i32 = 0;
static mut REF_TWO_COUNT: i32 = 0;
struct RefDataPipelineData {
mult: i32,
}
impl RefDataPipeline {
fn handle_one(v: i32, arg: &RefDataPipelineData) {
unsafe {
REF_ONE_VALU... | Rust | 0 |
print("~$Hack ", Fore.RED + "[Error]" + Style.RESET_ALL)
sound_error.play()
time.sleep(1)
starthack()
print(random_num_nine)
a = input("$ ")
c = int(a)
if c == random_num_nine:
os.system('cls||c... | Python | 1 |
attributes.get(
raw.types.DocumentAttributeFilename, None
), "file_name", None
)
video_attributes = attributes[raw.types.DocumentAttributeVideo]
... | Python | 1 |
ument("--seed", type=int, default=0)
parser.add_argument("--model-path", type=str, default="hf/BAGEL-7B-MoT/")
args = parser.parse_args()
if not os.path.exists(args.out_dir):
os.makedirs(args.out_dir, exist_ok=True)
args.datasets = args.datasets.split(",")
print("datasets:", args.datasets)... | Python | 1 |
pub const COD_COMPUTER_MINOR_LAPTOP: u32 = 3u32;
#[doc = "*Required features: 'Win32_Devices_Bluetooth'*"]
pub const COD_COMPUTER_MINOR_PALM: u32 = 5u32;
#[doc = "*Required features: 'Win32_Devices_Bluetooth'*"]
pub const COD_COMPUTER_MINOR_SERVER: u32 = 2u32;
#[doc = "*Required features: 'Win32_Devices_Bluetooth'*"]
p... | Rust | 0 |
ts/tts.test?message=Hello%20World"
media = await media_source.async_resolve_media(hass, media_id, None)
assert media.url.startswith("/api/tts_proxy/")
assert media.mime_type == "audio/mpeg"
assert await retrieve_media(hass, hass_client, media_id) == HTTPStatus.OK
assert len(mock_get_tts_audio.mock_... | Python | 1 |
reduce_map_dimenstions() {
for &(normal, reduced) in UTF_REDUCE_MAP {
assert_eq!(normal .chars().count(), 1, "UTF_REDUCE_MAP['{}'] != 1", normal);
assert_eq!(reduced.chars().count(), 1, "UTF_REDUCE_MAP['{}'].len() != 1", reduced);
}
}
#[test]
fn get_char_class() {
... | Rust | 0 |
c - TCD Last Source Address Adjustment"]
pub tcd5_slast: TCD5_SLAST,
#[doc = "0x10b0 - TCD Destination Address"]
pub tcd5_daddr: TCD5_DADDR,
#[doc = "0x10b4 - TCD Signed Destination Address Offset"]
pub tcd5_doff: TCD5_DOFF,
_reserved_110_tcd5_citer: [u8; 2usize],
#[doc = "0x10b8 - TCD Last ... | Rust | 0 |
lossyq-send", |i| {
tx.put(|v| *v = Some(i));
});
}
fn lossyq_recv() {
let (mut _tx, mut rx) = channel::<u64>(100);
bench_200ms("lossyq-recv", |_i| {
for _ii in rx.iter() {
}
});
}
fn lossyq_send_recv() {
let (mut tx, mut rx) = channel(100);
bench_200ms("lossyq-send-recv", |i| {
tx.put(|v|... | Rust | 0 |
# Problem: Redundant Connection - https://leetcode.com/problems/redundant-connection/
class Solution:
def findRedundantConnection(self, edges: List[List[int]]) -> List[int]:
N= len(edges)
par= [i for i in range(N+1)] #ith node-> parent (1-n)
rank=[1] *(N+1)
def find(n):
... | Python | 1 |
)
return GLib.SOURCE_REMOVE
for hit_element in packages_array:
source_obj = hit_element["_source"]
name = source_obj["package_attr_name"]
version = source_obj["package_pversion"]
description = source_obj["package_descr... | Python | 1 |
#!/usr/bin/env python3
"""
50銘柄を500株ずつ購入するテスト用スクリプト
liquidity_data.txtから銘柄コードと価格を読み込み、
.posファイルを生成する処理
このスクリプトは実際の取引を行わず、テスト用のポジションファイルのみを生成します。
"""
import os
import re
import datetime
from taq.portfolio import save_execution_to_position_file
def parse_liquidity_data():
"""
liquidity_data.txtから銘柄コードと価格を抽出する
... | Python | 1 |
}
}
}
ExprF::Field(ref v, ref l) => {
let v_borrow = v.as_whnf();
match &*v_borrow {
RecordLit(kvs) => match kvs.get(l) {
Some(r) => Ret::Value(r.clone()),
None => {
drop(v_borrow);... | Rust | 0 |
self.SIGNATURE_HEADER,
'',
self.NOTIFICATION_URL)
def test_signature_validation_signature_key_not_configured(self):
with self.assertRaisesRegex(ValueError, 'signature_key is empty'):
... | Python | 1 |
from dateutil.easter import EASTER_WESTERN
from holidata.holiday import Country
from holidata.utils import day
__all__ = [
"CZ",
]
"""
source: https://www.zakonyprolidi.cz/cs/2000-245, §1 and §2.
https://www.zakonyprolidi.cz/cs/2000-245/zneni-20200201 (>2020-02-01)
https://www.zakonyprolidi.cz/c... | Python | 1 |
#!/usr/bin/env python
from vtkmodules.vtkFiltersCore import vtkMarchingCubes
from vtkmodules.vtkIOImage import vtkVolume16Reader
from vtkmodules.vtkRenderingCore import (
vtkActor,
vtkPolyDataMapper,
vtkRenderWindow,
vtkRenderWindowInteractor,
vtkRenderer,
)
import vtkmodules.vtkInteractionStyle
imp... | Python | 1 |
// if the item in question doesn't have a position or item.
let &vec_of_pos!(i_loc) = poses.get(item_ent)?;
let item_item = items.get(item_ent)?;
info!("passed requirements");
let player_to_item_distance_squared =
... | Rust | 0 |
#!env python3
#
# Copyright (c) 2015 Jon Szymaniak <jon.szymaniak@gmail.com>
#
# 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
# t... | Python | 1 |
if fp.is_dir():
# If the path is a directory, we want to deploy all environments in that directory
return EnvFiles(directory=fp)
return EnvPerFileGroup(
filename=fp,
deploy_args=deploy_args,
name=filename,
help="Deploy a single environment ... | Python | 1 |
import json
import os
from stack.libs.shared.aws import client as aws_client
from stack.libs.shared.aws import ensure_bucket
class S3JobRepository:
def __init__(self, bucket: str, prefix: str = "results/"):
self.bucket = bucket
self.prefix = prefix
self.s3 = aws_client("s3")
@classme... | Python | 1 |
def main(opt):
model = get_model(model_name=opt.model, dataset_name=opt.dataset,
num_classes=opt.num_classes, pretrained=opt.pretrained)
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model.to(device)
img_size = 3, opt.img_size, opt.img_size
input_tensor = torch.randn(... | Python | 1 |
"""
src module docstring.
The src module provides some continual learning algorithm implementations.
Author: Shihong Wang
Date: 2024/9/25
"""
available_model = ["finetune", "iCaRL", "LUCIR", "LingoCL"]
| Python | 1 |
),
)
Jump('loc_34C4')
def _loc_34C1(): pass
label('loc_34C1')
Jump('loc_34C4')
def _loc_34C4(): pass
label('loc_34C4')
Jump('loc_34C7')
def _loc_34C7(): pass
label('loc_34C7')
Jump('loc_31AD')
def _loc_34CA(): pass
label('loc_34CA')
Switch(
... | Python | 1 |
toolState = self.TOOLSTATE_Dynamics
self.SetToolState(toolState)
self._SetupAndPromptForNextAction()
_BeginDynamics()
else:
textEditElementHandle = EditElementHandle()
if BentleyStatus.eSUCCESS == self.CreateTextElement(textEditElementHandle, textBl... | Python | 1 |
# Draw the crosshair
pygame.draw.line(self.screen, self.green, (self.cross_hair_obj_x.centerx,self.cross_hair_obj_x.centery - self.crosshair_size),\
(self.cross_hair_obj_x.centerx,self.cross_hair_obj_x.centery + self.crosshair_size), 2)
pygame.draw.... | Python | 1 |
# This upgrader moves memory pool attributes from a vector of pointers to the
# next free page and a vector of the limit of each pool to sections which each
# represent one pool and which hold the page shift amount, the next free page,
# and the total pages in the pool.
def upgrader(cpt):
systems = {}
for sec i... | Python | 1 |
content.
Returns:
list: A list of dictionaries containing climber's name, ascent
type, and date.
"""
# locate the log elements containing the ascents
log_elements = soup.find_all('div', attrs={'class': 'result-row'})
asc... | Python | 1 |
re_signed(origin)?;
let ledger = Self::ledger(&controller).ok_or(<Error<T>>::NotController)?;
Self::chill_stash(&ledger.stash);
}
/// (Re-)set the payment target for a controller.
///
/// Effects will be felt at the beginning of the next era.
///
/// The dispatch origin for this call must be _Signed... | Rust | 0 |
from core.blueprints.base_blueprint import BaseBlueprint
profile_bp = BaseBlueprint('profile', __name__, template_folder='templates')
| Python | 1 |
d'),
'resnet50_unet': dict(model=smp.Unet, encoder_name='resnet50', encoder_weights='imagenet', in_channels=3, classes=1, activation='sigmoid'),
'mobilenet_v2_unet': dict(model=smp.Unet, encoder_name='mobilenet_v2', encoder_weights='imagenet', in_channels=3, classes=1, activation... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Test Main Flow',
'version': '1.0',
'category': 'Hidden/Tests',
'description': """
This module will test the main workflow of Odoo.
It will install some main apps and will try to execute the most... | Python | 1 |
try:
response = requests.get(article_url, headers=headers, timeout=10) # Fetch article page.
response.encoding = 'utf-8' # UTF-8 encoding.
response.raise_for_status() # Handle HTTP errors.
article_soup = BeautifulSo... | Python | 1 |
le.markdown("<center>" + clicked_coffee["Bild"].values[0] + "</center>", unsafe_allow_html=True)
col1,col2 = st.columns([1,1])
with col1:
save_btn = st.form_submit_button("Speichern", use_container_width=True, type="primary")
with col2:
del_btn = st.fo... | Python | 1 |
receiver.poll_recv_from(cx, &mut read)).await?;
assert_eq!(read.filled(), msg);
assert_eq!(addr.as_pathname(), Some(sender_path.as_ref()));
Ok(())
}
#[tokio::test]
async fn send_recv_poll() -> std::io::Result<()> {
let dir = tempfile::tempdir().unwrap();
let sender_path = dir.path().join("sender.... | Rust | 0 |
import py_trees as ptree
from typing import Any
import enum
from py_trees.common import Status
# _base Behavior
class Bahavior(ptree.behaviour.Behaviour):
can_be_expanded = False
num_params = 0
valid_params='''
None
'''
scene = None
print_name_prefix = ""
tables_for_placement ... | Python | 1 |
import keras
import numpy as np
def allclose(x1, x2, rtol=1e-5, atol=1e-5):
return keras.ops.all(keras.ops.isclose(x1, x2, rtol, atol))
def assert_allclose(x1, x2, rtol=1e-5, atol=1e-8, msg=""):
x1 = keras.ops.convert_to_numpy(x1)
x2 = keras.ops.convert_to_numpy(x2)
assert x1.shape == x2.shape, "In... | Python | 1 |
:
yield coin_entry.coin
def all_unspent_coins(self) -> Iterator[Coin]:
for coin_entry in self._db.values():
if not coin_entry.spent:
yield coin_entry.coin
def _add_coin_entry(self, coin: Coin, birthday: CoinTimestamp) -> None:
name = coin.name()
... | Python | 1 |
= "Bit 9 - Pad 65 input enable"]
#[inline(always)]
pub fn pad65inpen(&self) -> PAD65INPEN_R {
PAD65INPEN_R::new(((self.bits >> 9) & 0x01) != 0)
}
#[doc = "Bit 8 - Pad 65 pullup enable"]
#[inline(always)]
pub fn pad65pull(&self) -> PAD65PULL_R {
PAD65PULL_R::new(((self.bits >> 8)... | Rust | 0 |
s where a persistent character buffer
/// is needed.
#[inline]
pub (crate)
fn str2cstring(s: &str) -> CString {
CString::new(s).unwrap()
}
/// ```&str -> *const c_char```
///
/// Used internally by the Rust Hexchat API.
/// Creates a C compatible character buffer from the `&str` that can be passed
/// as a paramet... | Rust | 0 |
#!/bin/python3
import argparse
import pcapng
import zipfile
import hashlib
def extract_packets(pcap_file):
"""Reads a wireshark packet capture and extracts the binary packets"""
packets = []
with open(pcap_file, 'rb') as fp:
scanner = pcapng.FileScanner(fp)
for block in scanner:
... | Python | 1 |
_IPREFETCH_CACHEW {
_IPREFETCH_CACHEW { w: self }
}
#[doc = "Bit 0 - When set, instruction accesses to the SRAM banks will be prefetched (normally 2 cycle read access). Generally, this mode bit should be set for improved performance when executing instructions from SRAM."]
#[inline]
pub fn ipre... | Rust | 0 |
ler(ColorizingStreamHandler):
def colorize(self, line, record):
# comment out this method if you don't like the job_lifecycle
# logs rendered with cyan text
previous_level_map = self.level_map.copy()
if record.name == "awx.analytics.job_lifecyc... | Python | 1 |
{
'name': 'ipinfo.io',
'url': 'https://ipinfo.io/{ip}/json',
'free': True
}
]
def lookup_ip(self, ip: str) -> Dict[str, Any]:
"""Геолокация IP адреса"""
print(f"\n{Colors.YELLOW}🌍 Геолокация IP {ip}...{Colors.END}")
... | Python | 1 |
use std::fs;
use std::io::Write;
use std::net::Ipv4Addr;
use actix_multipart::{Field, Multipart, MultipartError};
use actix_web::{error, guard, middleware, web, App, Error, HttpResponse, HttpServer};
use futures::future::{err, Either};
use futures::{Future, Stream};
pub fn save_file(field: Field) -> impl Future<Item... | Rust | 0 |
"""Tests for the auto-generated PKI."""
import pytest
from devices.issuer import LocalDomainCredentialIssuer
from devices.models import DeviceModel
from pki.auto_gen_pki import AutoGenPki
from pki.models import CertificateModel, DomainModel, IssuingCaModel
from pki.util.keys import AutoGenPkiKeyAlgorithm
@pytest.ma... | Python | 1 |
use blocking IPC sockets.
/// Arguments are:
/// 1. ipc, a &str specifying the IPC type
/// (either "unix", "netlink", or "char"): see [`ipc`](./ipc/index.html).
/// 2. alg, an instance of `impl CongAlg<T: Ipc>`.
/// 3. blk, optional argument, either [`Blocking`](./ipc/struct.Blocking.html) or
/// [`Nonblocking`](.... | Rust | 0 |
8, 6, 2, 10],
[ 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5],
[10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0],
[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
[14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3],
];
fn b2b_compress(h: &... | Rust | 0 |
batch_size, v_seq_length, num_heads, head_dim)
q = q.permute(0, 2, 1, 3) # [Batch, Head, SeqLen, Embed]
k = k.permute(0, 2, 1, 3)
v = v.permute(0, 2, 1, 3)
# -- perform attention on each head
with torch.no_grad():
attn_logits = torch.matmul(q, k.transpose(-2, -1)) / math.sqrt(q.shape[-1])
... | Python | 1 |
_index_server(
indexer: Rc<Indexer>,
stream: DriverIndexRequestStream,
) -> Result<(), anyhow::Error> {
stream
.map(|result| result.context("failed request"))
.try_for_each(|request| async {
let indexer = indexer.clone();
match request {
DriverIndexReq... | Rust | 0 |
from fufanrag.evaluator.evaluator import *
from fufanrag.evaluator.metrics import * | Python | 1 |
ger_state.mining_target.unwrap().0] = Tile::Background;
digger_state.mining_target = None;
digger_state.mining = 0.;
break;
}
}
}
struct Mining;
struct Mined;
fn mark_mining_target(
mut commands: Commands,
mut tile_query: Query<(Entity, &MapTile, &mut Handle<Col... | Rust | 0 |
square_sum(feature_map=feats) # [bs, 1, 7, 7] # 获取特征激活图,2次方能够更加凸显高亮区域
feats_sum = self.adaptor(feats)
#print('distill feats_sum ', feats_sum.size())
anomaly_maps = resize(
input=anomaly_maps,
size=feats.shape[2:],
mode='bili... | Python | 1 |
import pytest
import torch
import numpy as np
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from detector.rplmsed import *
# 创建一个示例数据集
@pytest.fixture
def sample_dataset():
data = [
DataItem(event_id=1, tweet_id=1, text="Hello world", user_id=1, created_at... | Python | 1 |
fn initialize(mut timer: Timer<TIMER>) {
unsafe { NVIC::unmask(stm32l4xx_hal::stm32::Interrupt::TIM15) };
let timer = Self {
timer: UnsafeCell::new(timer),
waiters: UnsafeCell::new([
None, None, None, None,
None, None, None, None,
]),... | Rust | 0 |
j | | | } d
j | | _ t
j | t j | n XWd t
j d Xn | rCt j
n Wd t
j | Xt! t
j" | d } g } x, | r| j# | t! t
j" | d } qsWd
j | } Wd | d k r|
d k r| | n | d k r| d k r| | n | d k r!| d k r!| | n t
j | ... | Python | 1 |
\c @ sR d d l m Z d d l Td d l m Z d Z d Z d Z d Z d S(
i( t unicode_literalsi ( t *( t renderc C s
t | d S( Nu
etv/home.html( R ( t request( ( s& |