text string | label_name string | labels int64 |
|---|---|---|
/P1PPPPPP/RNBQKBNR w KQkq - 0 1",
1,
"a2a3: 1
c2c3: 1
d2d3: 1
e2e3: 1
f2f3: 1
g2g3: 1
h2h3: 1
b3b4: 1
a2a4: 1
c2c4: 1
d2d4: 1
e2e4: 1
f2f4: 1
g2g4: 1
h2h4: 1
b1a3: 1
b1c3: 1
g1f3: 1
g1h3: 1
c1b2: 1
c1a3: 1",
);
}
#[test]
fn test_divide_2_b2b3() {
test_divide(
"rnbqkbnr/pppppppp/8/8/8/1P... | Rust | 0 |
str("F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4").is_ok());
assert!(Uuid::parse_str("67e5504410b1426f9247bb680e5fe0c8").is_ok());
assert!(Uuid::parse_str("01020304-1112-2122-3132-414243444546").is_ok());
assert!(Uuid::parse_str(
"urn:uuid:67e55044-10b1-426f-9247-bb680e5fe0c8"
)
... | Rust | 0 |
d, src.to_node(db));
Attrs::from_attrs_owner(db, src.as_ref().map(|it| it as &dyn AttrsOwner))
}
fn attrs_from_loc<T, D>(node: T, db: &D) -> Attrs
where
T: HasSource,
T::Value: ast::AttrsOwner,
D: DefDatabase,
{
let src = node.source(db);
Attrs::from_attrs_owner(db, src.as_ref().map(|it| it as ... | Rust | 0 |
mes[int(class_nr)]
confidence_percentage = round(float(conf) * 100, 2)
label = f"{class_name}: {confidence_percentage}%"
if conf > conf_threshold:
annotator.rectangle(box.cpu().numpy(), outline=color)
annotator.box_label(box.cpu().... | Python | 1 |
}
| Event::KeyDown {
keycode: Some(Keycode::Escape),
..
} => break 'running,
_ => {}
}
}
}
}
<reponame>markglenn/nesrs
pub(crate) mod header;
pub(crate) mod rom;
// This file is generated by rust-protobuf 2.... | Rust | 0 |
xxx
assert_eq!(encode_to_binary(-127, 7), 0b0000000010000001);
assert_eq!(encode_to_binary(-63, 7), 0b0000000011000001);
assert_eq!(encode_to_binary(63, 7), 0b0000000000111111);
assert_eq!(encode_to_binary(127, 7), 0b0000000001111111);
// ... | Rust | 0 |
from . import ZoneEntityBase
from . import BasicEntities
class ZoneEntity(ZoneEntityBase.ZoneEntityBase, BasicEntities.NodePathAttribs):
def __init__(self, level, entId):
ZoneEntityBase.ZoneEntityBase.__init__(self, level, entId)
self.nodePath = self.level.getZoneNode(self.entId)
if self.n... | Python | 1 |
String {
use percent_encoding::{define_encode_set, utf8_percent_encode, USERINFO_ENCODE_SET};
define_encode_set! {
pub CUSTOM_ENCODE_SET = [USERINFO_ENCODE_SET] | { '+', ',' }
}
let signature = utf8_percent_encode(&source, CUSTOM_ENCODE_SET).to_string();
signature
}
pub fn get_timestamp() ... | Rust | 0 |
self.dense_block_0(feature_maps)
feature_maps = self.transition_block(feature_maps)
feature_maps = self.dense_block_1(feature_maps)
feature_maps = self.global_pooling(feature_maps)
return torch.flatten(feature_maps, start_dim=1)
# Debug
if __name__ == "__main__":
dummy = torch.r... | Python | 1 |
ath" => Some(&crate::flat::PERSON_TAKING_BATH.default as &crate::Emoji),
"rson_tipping_hand" => Some(&crate::flat::PERSON_TIPPING_HAND.default.default as &crate::Emoji),
"rson_walking" => Some(&crate::flat::PERSON_WALKING.default.default as &crate::Emoji),
"rson_wearing_turban" => Some(&crate::flat::PERS... | Rust | 0 |
from sqlalchemy.ext.asyncio import create_async_engine
from sqlmodel import SQLModel, pool
from src import config
engine = create_async_engine(
url=config.db.async_url,
echo=config.db.echo,
poolclass=pool.StaticPool,
)
async def create_db_and_tables() -> None:
async with engine.begin() as conn:
... | Python | 1 |
lf.key(storage);
let val = self.val(storage);
let logic2 = &self.logic;
self.cursor.map_times(&storage.batch, |time, diff| {
logic(&logic2(key, val, time), diff)
})
}
#[inline(always)] fn step_key(&mut self, storage: &Self::Storage) { self.cursor.step_key(&storage.ba... | Rust | 0 |
from youtube_transcript_api import (
YouTubeTranscriptApi,
TranscriptsDisabled,
NoTranscriptFound,
)
from llms.llm import GeminiLLM
from dotenv import load_dotenv
import os
from data_preparation.prompts import system_prompt, user_prompts_dict
# init LLM model
load_dotenv()
api_key = os.getenv("GEMINI_AP... | Python | 1 |
::sys;
/// Indicates the data type of the indices computed by a reduction operation.
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum IndicesType {
U8,
U16,
U32,
U64,
}
impl From<IndicesType> for sys::cudnnIndicesType_t {
fn from(mode: IndicesType) -> Self {
ma... | Rust | 0 |
S r SSKrSSKrSSKJr SSKJr SSKJ r J
r
" S S\5 r SS jr
SS
jrSS jrS rS
rg),
Spectral Algorithm for Nonlinear Equations
NOptimizeResult_check_unknown_options _nonmonotone_line_search_cruz_nonmonotone_line_sear... | Python | 1 |
}
<reponame>mbc-git/rust
// gate-test-raw_dylib
// only-windows-gnu
#[link(name = "foo", kind = "raw-dylib")]
//~^ ERROR: kind="raw-dylib" is unstable
//~| WARNING: `#[link(...)]` with `kind = "raw-dylib"` not supported on windows-gnu
extern "C" {}
fn main() {}
<reponame>nuxeh/aoc-2020
use aocf::Aoc;
#[derive(Debug)]... | Rust | 0 |
o(),
Operator::Add.into(),
])
.into()
))]
)
}
#[test]
#[cfg(feature = "parse-parameters")]
fn parse_expressions_with_parameter_get() {
let input = "G#[32+25]\n".bytes();
assert_eq!(
block_on(input),
&[
Ok(GCode::Word(
... | Rust | 0 |
denominator",
|m: &CStreamVideoMode| { &m.refresh_rate_denominator },
|m: &mut CStreamVideoMode| { &mut m.refresh_rate_denominator },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<CStreamVideoMode>(
"CStreamVideoMode",
f... | Rust | 0 |
_name": "test/image",
"image_id": "abcdefghijklmnopqrstuv",
"tag": "latest"
},
"gelf": {
"host": "example.org",
"full_message": "Backtrace here"
}
}... | Rust | 0 |
d
masscanned = subprocess.Popen(
[
"./target/debug/masscanned",
"-vvvvv",
"-i",
f"{IFACE}b",
"--self-ip-file",
ipfile.name,
"-m",
MAC_ADDR,
]
# if args in CLI, they are passed to masscanned
+ sys.argv[1:],
env=dict(os.environ, RUST_BACK... | Python | 1 |
import math
import numpy as np
import pandas as pd
import plotly.express as px
import pickle
import seaborn as sns
import os
def Linear_Regression_preduct(x):
weights_path = "weights.csv"
theta0 = theta1 = std = mean = 0
if os.path.exists(weights_path):
weights_df = pd.read_csv("weights.csv", index... | Python | 1 |
from dagster import define_asset_job, AssetSelection
from dag.constants import EXTRACT, TRANSFORM, LOAD
all_job = define_asset_job("all_assets")
extract_job = define_asset_job(
"extract_assets", selection=AssetSelection.groups(EXTRACT)
)
transform_job = define_asset_job(
"transform_assets",
selection=Ass... | Python | 1 |
rn real_loss + fake_loss + real_gp(real_images, real_logit)
def real_gp(real_images, real_logit) :
grad_out = tf.gradients(tf.reduce_mean(real_logit), [real_images])[0]
grad_out2 = tf.square(grad_out)
r1_penalty = 10 * tf.reduce_mean(tf.reduce_sum(grad_out2, axis=[1, 2, 3]))
return r1_penalty
def ge... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name' : 'Remove Powered By Odoo',
'version' : '18.0.0.1',
'summary': """
Remove powered by odoo, Remove powered by odoo from login page, remove powered by from signup page, remove powered by odoo l... | Python | 1 |
# Extracted from ./data/repos/black/src/black/__init__.py
"""Format code in given cell of Jupyter notebook.
General idea is:
- if cell has trailing semicolon, remove it;
- if cell has IPython magics, mask them;
- format cell;
- reinstate IPython magics;
- reinstate trailing semicolon... | Python | 1 |
4]),
vec!["Gold Medal", "5", "Bronze Medal", "Silver Medal", "4"]
);
}
}
<reponame>jmeyers35/abstreet<filename>sim/src/trips.rs
use crate::{
AgentID, AlertLocation, CarID, Command, CreateCar, CreatePedestrian, DrivingGoal, Event,
OffMapLocation, OrigPersonID, ParkedCar, ParkingSimState,... | Rust | 0 |
f.templateGrp + '.prependNameTxt')
preName = ''
if prependName:
preName = prependNameTxt
scalable = cmds.getAttr(self.templateGrp + '.scalable')
for axe in ['X', 'Y', 'Z']:
cmds.setAttr("{}.scaleRig{}".format(self.rigDefaultNode, axe), 1)
node = self.get... | Python | 1 |
local<F>(self, future: F) where F: Future<Output = ()> + 'static {
match self.inner_runtime {
#[cfg(feature = "tokio_executor")]
TokioRuntime(runtime) => {
runtime.block_on(future);
},
#[cfg(feature = "async_std_executor")]
AsyncStdRunt... | Rust | 0 |
compare-mode-nll
//[nll] compile-flags: -Z borrowck=mir
pub struct Lexer<'a> {
input: &'a str,
}
impl<'a> Lexer<'a> {
pub fn new(input: &'a str) -> Lexer<'a> {
Lexer { input: input }
}
}
struct Parser<'a> {
lexer: &'a mut Lexer<'a>,
}
impl<'a> Parser<'a> {
pub fn new(lexer: &'a mut Lexer... | Rust | 0 |
, f32) {
while vert_data.len() <= num_norm {
vert_data.push(vertex_new());
}
let vert = &mut vert_data[num_pos];
vert.normal = Vec3::new(nx.unwrap(), ny.unwrap(), nz.unwrap());
num_norm = num_norm + 1;
}
/*
else if (sscanf(line, "g %512s", group) == 1) {
... | Rust | 0 |
turn super().execute_(context, '.txt')
def _blender_export_operator_function(topbar_file_import, context):
topbar_file_import.layout.operator(
BlenderExporterForColmapText.bl_idname, text="Colmap dataset (.txt)"
)
topbar_file_import.layout.operator(
BlenderExporterForColmapBinary.bl_idname... | Python | 1 |
sage: phi.scaling_factor()
7
ALGORITHM: The scaling factor is multiplicative under
composition, so we return the product of the individual
scaling factors associated to each factor.
"""
return prod(phi.scaling_factor() for phi in self._phis)
def inse... | Python | 1 |
let mut iter = parts.iter();
if let Some(part) = iter.next() {
let cmd = part.to_string();
if cmd.is_empty() {
None
} else {
Some((cmd, iter.map(|s| s.to_string()).collect::<Vec<String>>()))
}
} else {
None
}
}
fn interpret(line: String)... | Rust | 0 |
# Warning: it's good to have about 32 GB of RAM or even more (64 GB)
# Warning: this should be both valid Python and valid Julia code
mpodims_triv = (
[10, 40, 160, 640, 2560, 100, 200, 300], # mps
[4, 4, 4, 4, 4, 10, 10, 20], # mpo
[3, 3, 3, 3, 3, 10, 10, 20],
) # phys
mpodims_z2 = (
[10, 40, 160, 6... | Python | 1 |
"""
Write a function to check if the given tuples contain the k or not.
assert check_K((10, 4, 5, 6, 8), 6) == True
"""
def check_K(tup, k):
"""
Check if the given tuples contain the k or not.
:param tup: tuple
:param k: int
:return: bool
"""
return k in tup
if __name__ == '__main__':
... | Python | 1 |
#!/usr/bin/env python3
"""
Отладка запуска сервера
"""
import sys
import traceback
def test_imports():
"""Тестирование импортов"""
print("🔍 Тестирование импортов...")
try:
print(" - Импорт FastAPI...")
from fastapi import FastAPI
print(" ✅ FastAPI импортирован")
... | Python | 1 |
>>> = vec![];
let new_attr= Nlattr::new(None, Nl80211Attr::AttrIfindex, interface_attr_if_index.to_owned())?;
attrs.push(new_attr);
let genlhdr = Genlmsghdr::new(Nl80211Cmd::CmdGetStation, NL_80211_GENL_VERSION, attrs)?;
let nlhdr = {
let len = None;
let nl_type ... | Rust | 0 |
ynchronization Busy"]
pub syncbusy: crate::Reg<self::host::syncbusy::SYNCBUSY_SPEC>,
#[doc = "0x03 - USB Quality Of Service"]
pub qosctrl: crate::Reg<self::host::qosctrl::QOSCTRL_SPEC>,
_reserved3: [u8; 0x04],
#[doc = "0x08 - HOST Control B"]
pub ctrlb: crate::Reg<self::host::ctrlb::CTRLB_SPEC>,... | Rust | 0 |
KS_PER_SECOND / 1000,
}
}
pub fn checked_add(self, rhs: Duration) -> Option<Duration> {
self.ticks
.checked_add(rhs.ticks)
.map(|ticks| Duration { ticks })
}
pub fn checked_sub(self, rhs: Duration) -> Option<Duration> {
self.ticks
.checked_su... | Rust | 0 |
f.lr_step_multiplier ** j)
else:
raise NotImplementedError
lr = max(lr, self.end_lr)
self.now_lr = lr
# adjust learning rate
self._adjust_learning_rate(optimizer, lr)
def _adjust_learning_rate(self, optimizer, lr):
"""adjust the leaning rate"""... | Python | 1 |
ed, the restart is delayed by the max clip length; otherwise, it proceeds immediately.
To disable scheduled restarts, set the value to 0.""",
type=obs.OBS_TEXT_INFO
)
obs.obs_properties_add_int(
props=group_obj,
name=PN.PROP_RESTART_BUFFER_LOOP,
description="Restart every (s)",
... | Python | 1 |
# -*- coding: UTF-8 -*-
#/**
# * Software Name : pycrate
# * Version : 0.4
# *
# * Copyright 2018. Benoit Michau. ANSSI. P1sec.
# *
# * This library is free software; you can redistribute it and/or
# * modify it under the terms of the GNU Lesser General Public
# * License as published by the Free Software Foundation; e... | Python | 1 |
// Indices of the register
pub indices: Vec<u64>,
/// Number of qubits in the register
pub n: u64,
/// Index of the register as arg to program!
pub index: usize,
}
impl RegisterDataWrapper {
/// Make a new RegisterDataWrapper for a register (with given index)
pub fn new(r: &Register, index:... | Rust | 0 |
hange its value in self.targets list and send signals
# to Collective2 API from self.targets
if fast > slow * 1.001 and (not self.ema_fast_was_above):
self.set_holdings("SPY", 0.1)
self.targets[0] = PortfolioTarget(self.portfolio["SPY"].symbol, 0.1)
self.signal_expor... | Python | 1 |
# coding: utf-8
from __future__ import unicode_literals
from .telecinco import TelecincoIE
from ..utils import (
int_or_none,
parse_iso8601,
)
class MiTeleIE(TelecincoIE):
IE_DESC = 'mitele.es'
_VALID_URL = r'https?://(?:www\.)?mitele\.es/(?:[^/]+/)+(?P<id>[^/]+)/player'
_TESTS = [{
'url... | Python | 1 |
struct DamlStructUpd<'a> {
struct_expr: Box<DamlExpr<'a>>,
update: Box<DamlExpr<'a>>,
field: Cow<'a, str>,
}
impl<'a> DamlStructUpd<'a> {
pub fn new(struct_expr: Box<DamlExpr<'a>>, update: Box<DamlExpr<'a>>, field: Cow<'a, str>) -> Self {
Self {
struct_expr,
update,
... | Rust | 0 |
_base_ = [
"../_base_/models/convnextv2_femto_vit_segformer_vegseg.py",
"../_base_/datasets/grass.py",
"../_base_/default_runtime.py",
"../_base_/schedules/grass_schedule.py",
]
data_preprocessor = dict(size=(256, 256))
model = dict(
teach_backbone=dict(
type="mmpretrain.VisionTransformer",... | Python | 1 |
import abc
import logging
from django.conf import settings
import services.self_hosted as self_hosted
from codecov_auth.models import Owner
log = logging.getLogger(__name__)
class BaseActivator(abc.ABC):
def __init__(self, org: Owner, owner: Owner):
self.org = org
self.owner = owner
@abc.a... | Python | 1 |
import json
import logger
async def set_group_kick_members(
websocket, group_id, user_id, reject_add_request=False, note=""
):
"""
批量踢出群成员
Args:
websocket: WebSocket连接对象,用于与上游通信
group_id (str|int): 群号
user_id (list): 要踢出的用户ID列表
reject_add_request (bool, optional): 是否群拉... | Python | 1 |
3)
WeepingVines, // 1.16.1 (id: 29267, stack: 0)
WeepingVinesPlant, // 1.16.1 (id: 19437)
ZoglinSpawnEgg, // 1.16.1 (id: 7442)
ZombifiedPiglinSpawnEgg, // 1.16.1 (id: 6626)
PiglinBruteSpawnEgg, // 1.16.2 (id: 30230)
Deepslate, // 1.17 (id: 26842, stack: 0)
CobbledDeepslate, // 1.17 (id: 8021... | Rust | 0 |
#-----------------------------------------------------------------------------#
#------------------Skills Progression 3 - Pick and Place----------------------#
#-----------------------------------------------------------------------------#
#--------------Lab 1 - Forward Kinematics - Lead Through: Follow--------------#
... | Python | 1 |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from scipy.optimize import linprog
from scipy.optimize import minimize
x = np.sort(np.random.rand(10))
y = 1 + 2*x + np.random.rand(x.size) - 0.5
# 添加异常值
x = np.append(x, [0.1,0.5,0.9])
k = -5
y = np.append(y, [k, k ,... | Python | 1 |
import os
import KratosMultiphysics.KratosUnittest as KratosUnittest
import test_helper
class KratosGeoMechanicsAvoidSmallEndStepTests(KratosUnittest.TestCase):
def test_avoid_small_end_step(self):
"""
Test calculation that without countermeasure does a very small step to reach the end_time.
... | Python | 1 |
gic.add_ability(3, "Radiance")
def use_light_magic(level):
return light_magic.use_ability(level)
# Define Water Magic skill
water_magic = Skill(
name="Water Magic",
dependent_stat="Intelligence",
skill_description="The power to control and conjure water.",
skill_icon="water_magic_icon.png",
ma... | Python | 1 |
print("❌ 轨迹池数据加载失败")
return False
print(f"✅ 成功加载轨迹池数据")
print(f"📊 数据项: {list(approaches_data.keys())}")
# 测试最近失败尝试提取
latest_approach = operator._get_latest_failed_approach(approaches_data)
if not latest_approach:
print("❌ 最近失败尝... | Python | 1 |
display.gl_window().window().request_redraw(); // TODO: ask egui if the events warrants a repaint instead
}
_ => (),
}
});
}
<gh_stars>0
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distri... | Rust | 0 |
# uncompyle6 version 2.11.5
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.18 (default, Apr 20 2020, 20:30:41)
# [GCC 9.3.0]
# Embedded file name: Tools\getSMTP.py
import requests
import re
Headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0'}
def GETSmtpJ... | Python | 1 |
.2,
CallContextAction::Fail {
error: HypervisorError::Trapped(TrapCode::StableMemoryTooBigFor32Bit),
refund: Cycles::from(0),
}
);
});
}
#[test]
#[ignore] // TODO(EXC-387): Enable the test after shipping 64-bit stable memory.
fn sys_api_call... | Rust | 0 |
max_bytes_for_level_multiplier: 10,
compaction_style: DBCompactionStyle::Level,
disable_auto_compactions: false,
soft_plightlikeing_compaction_bytes_limit: ReadableSize::gb(64),
hard_plightlikeing_compaction_bytes_limit: ReadableSize::gb(256),
force_consiste... | Rust | 0 |
m_side = lesser_side_face_perp_to_axis(Dim(1));
let top_side = greater_side_face_perp_to_axis(Dim(1));
let back_side = lesser_side_face_perp_to_axis(Dim(2));
let front_side = greater_side_face_perp_to_axis(Dim(2));
let one = Mon3d { exps: [Deg(0), Deg(0), Deg(0)] };
let x = Mon3d { exps: [Deg(1), Deg(0), Deg... | Rust | 0 |
")]).to_roff();
assert_eq!(text, "foo\n");
}
#[test]
fn render_dash() {
let text = Roff::new().text([roman("foo-bar")]).to_roff();
assert_eq!(text, "foo\\-bar\n");
}
#[test]
fn render_italic() {
let text = Roff::new().text([italic("foo")]).to_roff();
ass... | Rust | 0 |
between camera pairs,
Z here refers to measurements. The measurements are of camera j with reference
to camera i (iZj), in camera i's coordinate frame (i_). iZj represents a unit
vector to j in i's frame and is not a transformation.
wRc_values: Rot... | Python | 1 |
rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [random_num_3](random_num_3) module"]
pub type RANDOM_NUM_3 = crate::Reg<u32, _RANDOM_NUM_3>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _RANDOM_NUM_3;
#[doc = "`read()` method returns [random_num_3::R](random_num_3::R) reader st... | Rust | 0 |
import pygame
from pygame.examples.aliens import load_image
class ImageManager:
def __init__(self):
self.images = {}
self._initialized = False
self.init()
def load_image(self, name, path,scale_size=None):
if name not in self.images:
try:
image = pyg... | Python | 1 |
RTC_4KHZ)
}
#[doc = "AUX_EVCTL:EVSTAT2.AON_RTC_CH2_DLY"]
#[inline]
pub fn aon_rtc_ch2_dly(self) -> &'a mut W {
self.variant(STOP_SRCW::AON_RTC_CH2_DLY)
}
#[doc = "AUX_EVCTL:EVSTAT2.AON_RTC_CH2"]
#[inline]
pub fn aon_rtc_ch2(self) -> &'a mut W {
self.variant(STOP_SRCW::AON... | Rust | 0 |
3; 5]; //repeat same value: [3; 5] = [3,3,3,3,3]
println!("I am last value of array a: {}", a[4]);
// Element Access Error
let a = [1, 2, 3, 4, 5];
println!("Please enter an array index.");
let mut index = String::new();
io::stdin()
.read_line(&mut index)
.expect("Failed to r... | Rust | 0 |
idx += 1;
}
Ok($name(buffer))
}
}
};
}
bytestring!(AudioEmulator, AudioEmulatorVisitor, 16);
bytestring!(Md5, Md5Visitor, 16);
bytestring!(Reserved2, Reserved2Visitor, 12);
bytestring!(GitRevision, GitRevisionVisitor, 20);
bytestring!(Reserved3, Reserved3Visitor... | Rust | 0 |
from LDOS_generator.LDOS_generator import LDOS_generator
if __name__ == '__main__':
k_min = 21
k_max = 21
band_min = 1
band_max = 10
cube_dir = '~/path/to/cube_files'
eigenval_path = '~/path/to/EIGENVAL'
skip = 3 # Adjust the step from which you want to start
ldos_generator = LDOS_gen... | Python | 1 |
)[0].name + ':0': input})
#print(pred)
pred_eran = np.asarray([(i+j)/2 for i, j in zip(nlb[-1], nub[-1])])
pred_model = np.asarray(pred[-1]).reshape(-1)
if len(pred_eran) != len(pred_model):
tested_file.write(', '.join([dataset, network, domain, 'predi... | Python | 1 |
#!/usr/bin/env python3
# Copyright (c) 2020 The Plankton Authors.
# All rights reserved.
#
# This source code is derived from UUV Simulator
# (https://github.com/uuvsimulator/uuv_simulator)
# Copyright (c) 2016-2019 The UUV Simulator Authors
# licensed under the Apache license, Version 2.0
# cf. 3rd-party-licenses.txt ... | Python | 1 |
r: If more changes than :meth:`get` returns are passed;
``done(get())`` should always work.
"""
@dataclass(frozen=True)
class Change:
"""A change to be applied to the search index.
The change can be of an entry, a feed, or a resource tag.
"""
#: Action to take.
action: ... | Python | 1 |
client::{HttpClient, RestApiResult}, info::{RoomInfo, UserInfo, GetRoomInfo, GetUserInfo}};
use livekit_feed::{schema::Event as FeedEvent, storage::{Db, open_db}};
use crate::config::*;
macro_rules! template {
($template:expr, $($k:expr => $v:expr),*, $(,)?) => {
$template
$(
.replace($... | Rust | 0 |
from transformers import CLIPTextModel, CLIPVisionModel, CLIPProcessor
from PIL import Image
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
class EntropyController(nn.Module):
def __init__(self, dim):
super(EntropyController, self).__init__()
self.entropy_estimator ... | Python | 1 |
under_fwd=bool(argv[8]=='True'),
whether_reason_fwd=bool(argv[9]=='True'),
whether_gen_fwd=bool(argv[10]=='True'))
if data_small['answer_number'] == answer_small:
correct_small += 1
print(answer_small)
print(data_small['answer_number']... | Python | 1 |
70220568V#562F我还以为以后再也见不到你们了!\n',
'一直……都好难过的……',
TxtCtl.Enter,
),
)
CloseMessageWindow()
ChrTalk(
0x0101,
(
'#0010220569V#1025F#6P是嘛……',
TxtCtl.Enter,
TxtCtl.Clear,
'#0010220570V对不起……\n',
'对不起…没和你打招... | Python | 1 |
K%?%sh<' '>' ref sh
add-highlighter shared/kakrc/shell5 region -recurse '\{{' '(^|\h)\K-shell-script-(completion|candidates)\h+%\{{' '\}}' ref sh
add-highlighter shared/kakrc/shell6 region -recurse '\(' '(^|\h)\K-shell-script-(completion|candidates)\h+%\(' '\)' ref sh
add-highlighter shared/kakrc/shell7 region -recurse... | Rust | 0 |
use webpki::DNSNameRef;
// Self Signed Certificate
pub(crate) const CERTIFICATE: &'static str = r#"-----BEGIN CERTIFICATE-----
<KEY>
-----END CERTIFICATE-----"#;
// Self Signed Private Key
pub(crate) const PRIVATE_KEY: &'static str = r#"-----BEGIN PRIVATE KEY-----
<KEY>"#;
struct TestCertVerifier... | Rust | 0 |
{
"label": "训练阶段",
"info": "目前采用的训练方式。",
},
"ko": {
"label": "학습 단계",
"info": "수행할 학습 방법.",
},
},
"dataset_dir": {
"en": {
"label": "Data dir",
"info": "Path to the data directory.",
},
"ru":... | Python | 1 |
) -> schemas.ApiEventBundle[schemas.ApiEventRead_U]:
query = schemas.ApiEventBundle[schemas.ApiEventQuery_U].model_validate(to_fetch)
async with self.post(
url="/api/events/fetch", json=query.model_dump(exclude_none=True)
) as resp:
raw_json = await resp.json()
... | Python | 1 |
y,
}
def bulk_process(
debug = False, number_of_cycles_before_rate_analysis = 10, cell_ids = None,
):
"""
TEMPDOC
first calls process_single_file then, calls process_cell_id
"""
if cell_ids is None:
errors = list(
map(
lambda x: process_single_file(x, de... | Python | 1 |
import os
import openai
import json
openai.api_key = os.getenv("OPENAI_API_KEY")
BACKGROUND = """
我是陳鍾誠,你是我的秘書,必須要負責記錄我的行事曆
請你負責做下列事項:
1. 新增行程
例如: 2023/10/1 我說:我後天下午三點要搭華航飛機去泰國
這時請傳回
{"分類":"行事曆", "操作":"新增", "日期":"2023/10/3", "時間":"15:00", "任務":"搭華航飛機去泰國"}
注意,2023/10/1 所說的後天下午三點,應該是 2023/10/3 15:00,日期時間必須明確化表達
... | Python | 1 |
c2, 1.0), c2);
assert_relative_eq!(c1.lerp(&c2, 0.5), Lab::<_, D65>::new(77.5, 0.0, 50.0));
assert_relative_eq!(c1.lerp(&c2, 0.25), Lab::<_, D65>::new(66.25, 12.5, 65.0));
}
#[test]
fn test_normalize() {
let c1 = Lab::<_, D65>::new(100.0, -50.0, 50.0);
assert!(c1.is_normaliz... | Rust | 0 |
_client
.request(&CreateDnsRecord {
zone_identifier: &self.zone_identifier,
params: CreateDnsRecordParams {
ttl: Some(ttl),
priority: None,
proxied: None,
name: &self.dns,
cont... | Rust | 0 |
s device properties for devices with
//! property lookup functionality.
use crate::errors::CueSdkError;
mod boolean;
mod int32;
#[derive(Debug, Clone, PartialEq, Fail)]
#[fail(display = "Failed to refresh value, error: {:?}", _0)]
pub struct RefreshValueError(Option<CueSdkError>);
pub use self::boolean::{BooleanProp... | Rust | 0 |
"""
Raises an assertion error if two workspaces are equal within specified tolerance.
Parameters
----------
Workspace1, Workspace2 : Workspace
Input workspaces to compare.
rtol : float
The relative tolerance parameter.
atol : float
The absolute tolerance parameter.
... | Python | 1 |
ager=pm, path=found_path, version_output=version_output
)
)
else:
# Should not happen if is_missing is False, but as a safeguard
log.warning(
f"Manager {pm.name} was marked as found, but version output is missing."
... | Python | 1 |
# Repair order and linked invoice both should be cancelled.
self.assertEqual(repair.state, 'cancel', 'Repair order should be in cancel state.')
self.assertEqual(repair.invoice_id.state, 'cancel', 'Invoice should be in cancel state.')
repair.action_repair_cancel_draft()
# Linked invoi... | Python | 1 |
# File under GNU GPL (v3) licence, see LICENSE file for details.
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.
from dolfin import inner, grad
def extrapolate_setup(F_fluid_linear, extrapolation_sub_type, d_, w_, phi,... | Python | 1 |
# it has 6 areas instead, so we generate info file for each of them
# in training, we will use dataset to wrap different areas
splits = [f'Area_{i}' for i in [1, 2, 3, 4, 5, 6]]
for split in splits:
dataset = S3DISData(root_path=data_path, split=split)
info = dataset.g... | Python | 1 |
"""
#!-*- coding=utf-8 -*-
@author: BADBADBADBADBOY
@contact: 2441124901@qq.com
@software: PyCharm Community Edition
@file: shrinkbox.py
@time: 2020/4/5 10:48
"""
import numpy as np
from shapely.geometry import Polygon
import cv2 as cv
def Add_Padding(image,top, bottom, left, right, color):
padded_image = cv.copy... | Python | 1 |
NoteData { kind: 1, name: &ELF_NOTE_1_NAME, desc: &ELF_NOTE_1_DESC },
//! NoteData { kind: 4, name: &ELF_NOTE_2_NAME, desc: &ELF_NOTE_2_DESC },
//! NoteData { kind: 2, name: &ELF_NOTE_3_NAME, desc: &ELF_NOTE_3_DESC },
//! ];
//!
//! let mut buf = [0; 80];
//! let res: Result<(Notes<'_, LittleEndian>, &'_ mu... | Rust | 0 |
OBRA",
*b"DOBRO",
*b"DOCHT",
*b"DOCKS",
*b"DOCOS",
*b"DOCUS",
*b"DODDY",
*b"DODOS",
*b"DOEKS",
*b"DOERS",
*b"DOEST",
*b"DOETH",
*b"DOFFS",
*b"DOGAN",
*b"DOGES",
*b"DOGEY",
*b"DOGGO",
*b"DOGGY",
*b"DOGIE",
*b"DOHYO",
*b"DOILT",
*b"DOILY",
*b"DOITS",
*b"DOJOS",
*b"DOLCE",
... | Rust | 0 |
# Copyright (C) 2015-2023 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from rbnics.backends import LinearProblemWrapper, LinearSolver
from rbnics.utils.decorators import PreserveClassName, RequiredBaseDecorators
@RequiredBaseDecorators(None)
def LinearProblem(... | Python | 1 |
"""
Tests for np.foo applied to Series, not necessarily ufuncs.
"""
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import Series
import pandas._testing as tm
class TestPtp:
def test_ptp(self):
# GH#21614
N = 1000
arr = np.random.default_rng(2).sta... | Python | 1 |
pub dupInternalRepProc: *mut Tcl_FSDupInternalRepProc,
pub freeInternalRepProc: *mut Tcl_FSFreeInternalRepProc,
pub internalToNormalizedProc: *mut Tcl_FSInternalToNormalizedProc,
pub createInternalRepProc: *mut Tcl_FSCreateInternalRepProc,
pub normalizePathProc: *mut Tcl_FSNormalizePathProc,
pub ... | Rust | 0 |
"""
Find Kth bit in Nth Binary String
Given two positive integers n and k, the binary string Sn is formed as follows:
S1 = "0"
Si = Si - 1 + "1" + reverse(invert(Si - 1)) for i > 1
Where + denotes the concatenation operation, reverse(x) returns the reversed string x, and invert(x) inverts all the bits in x (0 changes... | Python | 1 |
x2, y2 = grid.shape
selem = skimage.morphology.square(1)
traversible = skimage.morphology.binary_dilation(
grid[y1:y2, x1:x2],
selem) != True
if not(traversible[start[0], start[1]]):
print("Not traversible, step is ", self.navigate_steps)
... | Python | 1 |
LPSPI0>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _LPSPI0;
#[doc = "`read()` method returns [lpspi0::R](lpspi0::R) reader structure"]
impl crate::Readable for LPSPI0 {}
#[doc = "`write(|w| ..)` method takes [lpspi0::W](lpspi0::W) writer structure"]
impl crate::Writable for LPSPI0 {}
#[doc = "TRGMUX LPSPI0 Regis... | Rust | 0 |
Self::DocComment => true,
_ => false,
}
}
/// Returns `true` if this [`Token`] is a punctuator.
pub fn is_punctuator(&self) -> bool {
match self {
Self::Punctuator => true,
_ => false
}
}
}use std;
use goauth::error::GOErr as go_e... | Rust | 0 |
}
#[doc = "Bit order\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ORDER_A {
#[doc = "0: Most significant bit shifted out first"]
MSBFIRST = 0,
#[doc = "1: Least significant bit shifted out first"]
LSBFIRST = 1,
}
impl From<ORDER_A> for bool {
#[inline(always)]
fn fro... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.