text string | label_name string | labels int64 |
|---|---|---|
ons import lookup_id_to_name
while not ctx.exit_event.is_set():
global death_link
if death_link and "DeathLink" not in ctx.tags:
await ctx.update_death_link(death_link)
if not death_link and "DeathLink" in ctx.tags:
await ctx.update_death_link(death_link)
if c... | Python | 1 |
_project_mixin_tester
with pytest.raises(TypeError) as cm:
data["test_foo_obj"].project = "a project"
assert str(cm.value) == (
"ProjMixClass.project should be an instance of stalker.models.project.Project "
"instance, not str: 'a project'"
)
def test_project_attribute_is_working_... | Python | 1 |
.as_micros()
.try_into()
.unwrap_or(std::u64::MAX);
Pong { id, queue_time }
}),
);
if out.0.is_some() || out.1.is_some() {
self.recalculate();
}
out
}
pub fn next_timeout(&self) -> Option<I... | Rust | 0 |
if not self._sc_list:
sc = self.sc_query.all()
self._sc_list = sc
return self._sc_list
def __sc_sorted_by_enrollment__(self):
if not self._sc_sorted_by_enrollment:
self._sc_sorted_by_enrollment = self.__sc_list__()
self._sc_sorted_by_enrollment.sort(k... | Python | 1 |
> Result<(), Error> {
ctx.say("Pong! : )").await?;
Ok(())
}
/// Sends an emoji with a cat.
#[poise::command(
prefix_command,
slash_command,
// Adds multiple aliases
aliases("kitty", "neko"),
// Allow only administrators to call this:
required_permissions = "ADMINISTRATOR",
category... | Rust | 0 |
nonlocal auto_continue, auto_continue_count
while auto_continue and (native_max_auto_continues == 0 or auto_continue_count < native_max_auto_continues):
# 重置 auto_continue 用于此迭代
auto_continue = False
# 运行一次线程,传递可能修改后的系统提示
# 仅在第一次迭代时传递 temp_ms... | Python | 1 |
import asyncio
from fastmcp import Client
import httpx
import json
def get_envelope(geometry):
rings = geometry.get("rings", [])
all_points = [point for ring in rings for point in ring]
if not all_points:
return None
xs = [p[0] for p in all_points]
ys = [p[1] for p in all_points]
return... | Python | 1 |
PeerAsync(
dst: *mut ::libc::c_void,
dstDeviceId: ::libc::c_int,
src: *const ::libc::c_void,
srcDevice: ::libc::c_int,
sizeBytes: usize,
stream: hipStream_t,
) -> hipError_t;
}
extern "C" {
#[doc = " @brief Explicitly initializes the HIP runtime."]
#[doc = ""]... | Rust | 0 |
from dolfin import *
from dolfin_adjoint import *
import windse
import numpy as np
import copy
import matplotlib
matplotlib.use('TKAgg')
import matplotlib.pyplot as plt
parameters['form_compiler']['quadrature_degree'] = 6
set_log_level(15)
### Create an Instance of the Options ###
windse.initialize("params.yaml")
... | Python | 1 |
_BRIGHTNESS_STATE_0_0 {
pub _bitfield: u32,
}
impl ::core::marker::Copy for PANEL_SET_BRIGHTNESS_STATE_0_0 {}
impl ::core::clone::Clone for PANEL_SET_BRIGHTNESS_STATE_0_0 {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[doc = "*Required features: 'Win32_Devices_Display'*"]
pub struct PATHDATA {
... | Rust | 0 |
ath"])
# Apply transforms on train and validation dataset and remove unrelated tag
dataset['train'] = dataset['train'].map(
lambda x: transforms_for_classification(x, feature_extractor),
batched=True,
remove_columns=config.get("remove_columns",
['audio'... | Python | 1 |
,
None => return log_and_err_internal!("Could not find free ParticipantId"),
};
listeners.insert(DISCOVERY_LISTENER_TOKEN, discovery_listener);
// Now the user traffic listeners
match UDPListener::new_multicast(
"0.0.0.0",
user_traffic_multicast_port(domain_id),
Ipv4Addr::new(2... | Rust | 0 |
out_str
.chars()
.map(Segment::try_from)
.collect::<Result<Signal, _>>()
})
.collect::<Result<Vec<Signal>, _>>()?;
Ok(Self { patterns, output })
}
}
use ezregexp::{start_with, digit};
use regex::Regex;
fn main() {
let ... | Rust | 0 |
import yfinance as yf
from telegram import Bot
import os
def analyse_ouverture():
tickers = ["TSLA", "AAPL", "NVDA"]
messages = []
for ticker in tickers:
df = yf.download(ticker, period="10d", interval="1d")
if df.empty or len(df) < 10:
continue
high9 = df['High'].rol... | Python | 1 |
Transaction(tx) => tx.get_many_records(model, query_arguments, selected_fields),
}
}
fn get_related_records<'a>(
&'a self,
from_field: &'a RelationFieldRef,
from_record_ids: &'a [GraphqlId],
query_arguments: QueryArguments,
selected_fields: &'a SelectedFields,
... | Rust | 0 |
self.assertEqual(spinRec.value(), 5)
spinSend.setValue(3)
self.assertEqual(spinRec.value(), 3)
self.assertEqual(spinSend.value(), 3)
def testSetValue(self):
"""Direct signal emission: QSpinBox using valueChanged(int)/setValue(int)"""
spinSen... | Python | 1 |
Eq,Debug,Hash)]
pub enum Cryptosuite {
CRYPTO_SUITE_SHANNON = 0,
CRYPTO_SUITE_RC4_SHA1_HMAC = 1,
}
impl ::protobuf::ProtobufEnum for Cryptosuite {
fn value(&self) -> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<Cryptosuite> {
match value {
0 => ... | Rust | 0 |
d for img_id in database.get_img_ids() if img_id.startswith('te')]
elif database_name.startswith('llff'):
val_ids = database.get_img_ids()[::8]
train_ids = [img_id for img_id in database.get_img_ids(check_depth_exist=depth_valid) if img_id not in val_ids]
elif database_name.start... | Python | 1 |
"""
https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html
"""
MOCK_LAMBDA_S3_EVENT = {
"Records": [
{
"eventVersion": "2.1",
"eventSource": "aws:s3",
"awsRegion": "us-east-2",
"eventTime": "2019-09-03T19:37:27.192Z",
"eventName": "ObjectCreate... | Python | 1 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... | Python | 1 |
)
}
}
}
<filename>tests/chashmap.rs<gh_stars>1-10
mod sync;
use fn_memo::sync::chashmap;
use recur_fn::from_pointer;
use std::sync::Arc;
#[test]
fn memoize_works() {
sync::test_sync(|f, callback| callback(Arc::new(chashmap::memoize(from_pointer(f)))))
}
<reponame>JacekKupiec/AoC2021
use std::io;
use s... | Rust | 0 |
CCtx) -> usize;
}
extern "C" {
#[doc = " This function is deprecated, and is equivalent to:"]
#[doc = ""]
#[doc = " ZSTD_DCtx_reset(zds, ZSTD_reset_session_only);"]
#[doc = " ZSTD_DCtx_loadDictionary(zds, dict, dictSize);"]
#[doc = ""]
#[doc = " note: no dictionary will be used if dict =... | Rust | 0 |
#!/usr/bin/env python3
"""
测试日志级别配置功能
"""
import logging
from provider.dify_sse_node_plugin import DifySseNodePluginProvider
def test_log_levels():
"""测试不同日志级别的配置"""
provider = DifySseNodePluginProvider()
# 测试不同的日志级别
test_levels = ['DEBUG', 'INFO', 'WARNING', 'ERROR']
for level in test_le... | Python | 1 |
ttings::new(flags.2),
},
Command::none(),
)
}
fn title(&self) -> String {
String::from("Sharmat")
}
fn view(&mut self) -> Element<Self::Message> {
Container::new(
Row::new().push(
Container::new::<iced_native::Element<_, _>>(
... | Rust | 0 |
");
}
#[test]
fn test_dim_default_type() {
do_ok_test("DIM i", &[Statement::Dim("i".to_owned(), VarType::Integer)]);
}
#[test]
fn test_dim_as_simple_types() {
do_ok_test("DIM i AS BOOLEAN", &[Statement::Dim("i".to_owned(), VarType::Boolean)]);
do_ok_test("DIM i AS DOUBL... | Rust | 0 |
f time_step is None: # len = N = 8
# Sample time step 采样时间步
time_step = self.diffusion_sched.uniform_sample_t(batch_size) # (N,) 范围[1, self.num_steps + 1),大小batch_size的随机整数张量,即 每个batch一个随机值
# The forward diffusion process 正向扩散加噪
alpha_bar = self.diffusion_sched.alpha_bars[... | Python | 1 |
"""
Reminder task handlers for static reminders only.
"""
from app.config.loggers import general_logger as logger
from app.models.reminder_models import (
AgentType,
ReminderModel,
StaticReminderPayload,
)
from app.services.notification_service import notification_service
from app.utils.notification.source... | Python | 1 |
r APIError {
fn into(self) -> Response<Body> {
let status_code: (StatusCode, String) = match self {
APIError::MethodNotAllowed { desc } => (StatusCode::METHOD_NOT_ALLOWED, desc),
APIError::ServerError { desc } => (StatusCode::INTERNAL_SERVER_ERROR, desc),
APIError::NotImp... | Rust | 0 |
import cv2 as cv
import matplotlib.pyplot as plt
import functions
def main():
img=functions.read_image('flower.jpg')
im_gray=cv.cvtColor(img,cv.COLOR_RGB2GRAY)
plt.figure('photo')
plt.subplot(1,2,1)
plt.imshow(cv.cvtColor(im_gray, cv.COLOR_BGR2RGB))
plt.title("Original Image")
plt.axis('... | Python | 1 |
import pandas as pd
import os
if ("df_despesas.csv" in os.listdir()) and ("df_receitas.csv" in os.listdir()):
df_despesas = pd.read_csv("df_despesas.csv", index_col=0, parse_dates=True)
df_receitas = pd.read_csv("df_receitas.csv", index_col=0, parse_dates=True)
df_despesas["Data"] = pd.to_datetime(df_despe... | Python | 1 |
# from PIL import Image
# import cv2
# import numpy as np
# img_path = "/home/llm/bhpeng/github/ControlAny/ControlAny-SDXL/examples/vidit_depth/condition_0.png"
# save_path = "/home/llm/bhpeng/github/ControlAny/ControlAny-SDXL/examples/vidit_depth/condition_02.png"
# length = 1
# select_id = []
# image = cv2.imread(... | Python | 1 |
ration <= 300:
# 中长视频:选择3-4个片段
segments = [
{"start": 10, "duration": target_duration * 0.25, "role": "opening"},
{"start": video_duration * 0.3, "duration": target_duration * 0.4, "role": "main_content"},
{"start": video_duration * 0.75, "duration... | Python | 1 |
=> {
warn!("Unknown mouse button {}", b);
return None;
}
}
}])
},
Event::Pointer(PointerEvent::ScrollWheel(ref e)) if e.has_axis(Axis::Vertical) => {
... | Rust | 0 |
cs coefficients. This ensures that at
# initialization, the coefficients are biased towards having a large DC
# component and small view-dependent components.
self.register_buffer(
"sh_mask",
torch.ones((self.d_sh,), dtype=torch.float32),
persistent=False,
... | Python | 1 |
from fastapi import APIRouter, Depends, HTTPException, Query
from sqlalchemy.orm import Session
from typing import List, Optional
from app.db.base import get_db
from app.models.article import Article as ArticleModel
from app.schemas.article import Article, ArticleCreate, ArticleUpdate
router = APIRouter()
@router.ge... | Python | 1 |
er"
);
let win = self.connection.generate_id();
xcb::create_window(
&self.connection,
xcb::COPY_FROM_PARENT as u8,
win, screen.root(),
x, y, w, h, 0,
xcb::WINDOW_CLASS_INPUT_OUTPUT as u16,
screen.root_visual(), &[
... | Rust | 0 |
callback
wait_for_python_job_async_metric = DataflowJobMetricsSensor(
task_id="wait_for_python_job_async_metric",
job_id="{{task_instance.xcom_pull('start_python_job_async')['dataflow_job_id']}}",
location=LOCATION,
callback=check_metric_scalar_gte(metric_name="Service-cpu_num_seco... | Python | 1 |
match c {
'\u{16E40}'..='\u{16E5F}' => Mapping::Single(codepoint.wrapping_add(0x0020)),
_ => Mapping::Single(codepoint),
},
(0x0001, 0xE9) => match c {
'\u{1E900}'..='\u{1E921}' => Mapping::Single(codepoint.wrapping_add(0x0022)),
_ => Mapping::Single(code... | Rust | 0 |
age_div = WebDriverWait(driver, 10).until(
EC.visibility_of_element_located((By.CSS_SELECTOR, "div.page")))
# 修改 onclick 属性
driver.execute_script("arguments[0].setAttribute('onclick', 'finishWxCourse();')", page_div)
# print("设置onclick属性")
time.sleep(1)
# 等待 <h2> 标签可见后再查找
h2_element = WebDriverWait(drive... | Python | 1 |
from moonshot.src.redteaming.attack.attack_module import AttackModule
from moonshot.src.redteaming.attack.attack_module_arguments import AttackModuleArguments
# How to only download this when user wants to run this attack module?
from transformers import pipeline
# Configurble PARAMS - Number of prompts to be sent to... | Python | 1 |
();
}
#[derive(Debug)]
struct Rectangle {
x0: i64,
x1: i64,
y0: i64,
y1: i64,
}
impl Rectangle {
const fn inside(&self, x: i64, y: i64) -> bool {
if x > self.x1 {
return false;
}
if y > self.y1 {
return false;
}
if x < self.x0 {
... | Rust | 0 |
/// As `k` is constant, the time complexity can be considered O(n).
/// ASSERT: `shapes` must not be empty
fn split_axis< FAxis : Fn(&ShapeRep) -> f32 >(
shapes : &[ShapeRep]
, f_axis : FAxis
, dst_bins : &mut BinResult< ShapeRep >
) -> Option< (AABB, AABB, usize) > {
let num_bins = dst_bins.num... | Rust | 0 |
s![
"--tempo_tiny_quorums",
self.config.tempo_tiny_quorums()
]);
if let Some(interval) = self.config.tempo_clock_bump_interval() {
args.extend(args![
"--tempo_clock_bump_interval",
interval.as_millis()
]);
}
... | Rust | 0 |
argo_bin("bin_fixture").unwrap();
//! cmd
//! .arg("-A")
//! .env("stdout", "hello")
//! .env("exit", "42")
//! .with_stdin()
//! .buffer("42");
//! let assert = cmd.assert();
//! assert
//! .failure()
//! .code(42)
//! .stdout("hello\n");
//! ... | Rust | 0 |
=opt.save_conf,
)
elif opt.task == 'study':
for weights in ['yolov5s.pt', 'yolov5m.pt', 'yolov5l.pt', 'yolov5x.pt']:
f = 'study_%s_%s.txt' % (Path(opt.data).stem, Path(weights).stem)
x = list(range(320, 800, 64))
y = []
for i in x:
... | Python | 1 |
lf.number {
super::ValidationState::new()
} else {
val_error!(
errors::Maximum {
path: path.to_string()
}
)
}
}
}
#[allow(missing_copy_implementations)]
pub struct Minimum {
pub number: f64
}
impl super::Va... | Rust | 0 |
|nop| 138. No operation, do nothing. Any number of |nop|'s
//! may occur between \.{DVI} commands, but a |nop| cannot be inserted between
//! a command and its parameters or between two parameters.
//!
//! \yskip\hang|bop| 139 $c_0[4]$ $c_1[4]$ $\ldots$ $c_9[4]$ $p[4]$. Beginning
//! of a page: Set |(h,v,w,x,y,z):=(0,0... | Rust | 0 |
slice.setExploded()
slice.setLabelVisible()
self.chart = QtCharts.QChart()
self.chart.addSeries(self.series)
self.chartView = QtCharts.QChartView(self.chart)
self.setCentralWidget(self.chartView)
if __name__ == '__main__':
app = QApplication(sys.argv)
mainWin = Main... | Python | 1 |
u Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun
1 1 2 3 4 5 6
2 3 4 5 6 7 8 7 8 9 10 11 12 13
9 10 11 12 13 14 15 14 15 16 17 18 19 20
16 17 18 19 20 21 22 ... | Python | 1 |
>::NotActivated
);
assert_ok!(OctopusAppchain::force_set_is_activated(Origin::root(), true));
assert_noop!(
OctopusAppchain::lock(origin.clone(), vec![0, 159], 1000000000),
Error::<Test>::InvalidReceiverId
);
// TODO:
// assert_noop!(
// OctopusAppchain::lock(
// origin.clone(),
// "test-... | Rust | 0 |
}
soft_assert_eq(result, 6, "Jump target modification within delay slot should be ignored")?;
Ok(())
}
}
pub struct JALRWithRegisterChangeInDelaySlot {}
impl Test for JALRWithRegisterChangeInDelaySlot {
fn name(&self) -> &str { "JALR: With register change in delay slot" }
fn level(&self... | Rust | 0 |
dels/model_epoch_300.pth'
# model_path = 'trained_models/dp_w_action_wrench_w_robot_1ob_cocozelle_peel_turn/20240907000456/models/model_epoch_100.pth'
model_path = 'trained_models/dp_ft_w_a_wrench_w_state_1ob_all_shave/20240909202327/models/model_epoch_100.pth'
# model_path = 'trained_models/dp_ft_w_a_wrenc... | Python | 1 |
, it_step-1]} \n"
+ f"pos2={trajectory_points[ii][:, it_step]} \n\n")
ax.plot([trajectory_points[ii][0, it_step]],
[trajectory_points[ii][1, it_step]],
[trajectory_points[ii][2, it_step]], 'k.' )
... | Python | 1 |
.key());
Ok(())
}
#[derive(Clone, Copy, Serialize, Deserialize)]
pub enum BehaviourType {
Null,
PlayerInput,
SimpleNpc,
Tear,
}
<filename>day-02/src/lib.rs
use std::{error::Error, str::FromStr};
use advent_utils::{parse_raw_data, Part, Solver};
mod password;
use password::Record;
#[derive(Debug... | Rust | 0 |
Ok(public_coefficients
.coefficients
.get(0)
.map(PublicKey::try_from)
.unwrap_or_else(|| Ok(PublicKey(G2Projective::identity())))?)
}
}
/// Returns the public key associated to the given `public_coefficients`.
///
/// Empty public_coefficients represent an a... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright (C) 2020 momosecurity
#
# This file is part of Bombus.
#
# Bombus 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, either version 3 of the License, or
# (at yo... | Python | 1 |
ef _loc_302F(): pass
label('loc_302F')
Jump('loc_2A88')
def _loc_3032(): pass
label('loc_3032')
FadeIn(300, 0)
ExecExpressionWithVar(
0x28,
(
(Expr.PushLong, 0xFFFF),
Expr.Nop,
Expr.Return,
),
)
OP_5F(0x0000)
OP_56(0x... | Python | 1 |
rink the storage holding active sessions.
///
/// This is automatically called whenever the number of active sessions is less than 25% the
/// capacity of the backing hash-map, but can be called manually if desired.
pub fn shrink_to_fit(&self) {
self.managed.shrink_to_fit();
}
}
// Retry a ... | Rust | 0 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn.functional as F
class MeanPoolGatingNetwork(torch.nn.Module):
"""A simple mean-pooling gating network for s... | Python | 1 |
ilder::default();
b.set_display(DisplayState::On);
let cmd = b.build_command();
assert!(has_bit(cmd, DISPLAY_STATE_FLAG));
b.set_display(DisplayState::Off);
let cmd = b.build_command();
assert_eq!(has_bit(cmd, DISPLAY_STATE_FLAG), false);
}
#[test]
fn defau... | Rust | 0 |
rinal_log).T.to_csv(os.path.join(folder_path, 'marginal_log.csv'))
pd.DataFrame(joint_log).T.to_csv(os.path.join(folder_path, 'joint_log.csv'))
pd.DataFrame(EFO1_log).T.to_csv(os.path.join(folder_path, 'EFO1_log.csv'))
return marinal_log, joint_log, EFO1_log
# output_dict = process_output_whole_folder('EFO... | Python | 1 |
def test_bot():
assert "works on my machine"
| Python | 1 |
{
"Title": "INTRODUCTION",
"Headings": [
{
"H3": "GUIDE FOR TRAVEL & TOURISM LEADERS"
},
{
"H3": "CONTENTS"
},
{
"H3": "FOREWORD"
},
{
"H3": "INTRODUCTION"
},
{
"H3": "QUIZ"
... | Python | 1 |
Uninit::uninit();
let mut rx_q_ptr: MaybeUninit<xsk_ring_cons> = MaybeUninit::uninit();
let if_name = CString::new(if_name).map_err(|e| SocketCreateError::InvalidIfName(e))?;
let err = unsafe {
libbpf_sys::xsk_socket__create(
&mut xsk_ptr,
if_name.as... | Rust | 0 |
_incomplete: uint8_t,
pub state: uint8_t,
}
/* Last saved inst indication */
/* next link */
/*
* Things on the top half may be able to be split into a common
* structure shared by all.
*/
/*
* The following two in combination equate to a route entry for v6
* or v4.
*/
/* mtu discovered so far */
/* not sure ... | Rust | 0 |
tiles,
epochs=EPOCHS,
batch_size=BATCH_SIZE,
learning_rate=LR,
)
m.fit(df, freq="MS")
future = m.make_future_dataframe(df, periods=50, n_historic_predictions=len(df))
m.predict(future)
def test_split_conformal_prediction():
log.info("testing: Nai... | Python | 1 |
import os
import oss2
from oss2.models import BucketCors, CorsRule
# Specify access information, such as AccessKeyId, AccessKeySecret, and Endpoint.
# You can obtain access information from evironment variables or replace sample values in the code, such as <your AccessKeyId> with actual values.
#
# For example, if yo... | Python | 1 |
console::Console;
use tcod::Color;
use tcod::colors;
use traits::{Position, Renderable};
use units::Unit;
use {SCREEN_HEIGHT, SCREEN_WIDTH, PANEL_HEIGHT};
use point::Point;
const MAP_WIDTH: i8 = SCREEN_WIDTH;
const MAP_HEIGHT: i8 = SCREEN_HEIGHT - PANEL_HEIGHT;
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum ... | Rust | 0 |
e63 = 0
global obazdxpmgvq
del cs3qly9w5cg
from uzgrr0h_4x_ import wadwt4clgq2, k9rte4r1wl8
'# reinforcements_gas_interviewers -> overcurrent_crowns_misalinement'
'# reinforcements_gas_interviewers -> overcurrent_crowns_misalinement'
nonlocal wp9azb4lqtf
hhwt3l5sojn >>= ylta2xcnmgr
impor... | Python | 1 |
from django import template
from django.db.models import Count, Q
from taggit.models import Tag
from datetime import datetime, date, time, timedelta
from django.utils import timezone
from ..models import Comment, Article
register = template.Library()
@register.simple_tag
def popular_tags():
tags = Tag.objects.an... | Python | 1 |
, obj_rect_1, x_radius, y_radius, enum_mode_4);
}
self
}
///
/// Draws the given rectangle *rect* with rounded corners.
///
/// The *xRadius* and *yRadius* arguments specify the radii
/// of the ellipses defining the corners of the rounded rectangle.
/// When *mode* is Qt::Re... | Rust | 0 |
to get DB connection.");
let deck_ids: Vec<i32> = deck_contents
.filter(card.eq(id))
.select(deck)
.distinct()
.get_results(&conn)
.expect("Unable to connect to DB");
decks
.filter(id_.eq_any(deck_ids).and(active.eq(false)))
... | Rust | 0 |
"""
Create CV dataset folds yaml file based on a source CV dataset folds yaml file. This is useful when running a new CV
experiment using a CV dataset that was built in a different system/directory than the current copy.
"""
# 3rd party
from pathlib import Path
import yaml
import re
src_fp = Path('/Users/msaragoc/Pro... | Python | 1 |
arg2:
*const ::std::os::raw::c_char,
arg3:
::std::os::raw::c_int)
... | Rust | 0 |
help="Minimum number of associated detections before track is initialised.",
type=int, default=3)
parser.add_argument("--iou_threshold", help="Minimum IOU for match.", type=float, default=0.3)
args = parser.parse_args()
return args
if __name__ == '__main__':
# all train
... | Python | 1 |
VERSION = "0.9"
WALLPAPER = "default.png" | Python | 1 |
table,
where_clause,
returning,
}
}
/// Adds the given predicate to the `WHERE` clause of the statement being
/// constructed.
///
/// If there is already a `WHERE` clause, the predicate will be appended
/// with `AND`.
///
/// See [`DeleteStatement... | Rust | 0 |
uments=[
"-d", rviz_config_file,
"--ros-args", "--log-level", "error"
],
condition=IfCondition(launch_rviz),
parameters=[{"use_sim_time": LaunchConfiguration("use_sim_time")}],
)
if activate_joint_controller.perform(context).lower() in ["true", "1"]:
join... | Python | 1 |
io::ErrorKind::InvalidData,
"Inconsistent grid endianness in NetCDF file".to_string(),
)),
}?;
let dzidzdn = match super::read_snapshot_1d_variable::<fdt>(group, "dzidzdn")? {
(dzidzdn, e) if e == endianness => Ok(dzidzdn),
_ => Err(io::Error::new(
... | Rust | 0 |
{
let prefix: String = thread_rng()
.sample_iter(&Alphanumeric)
.take(6)
.map(char::from)
.collect();
let mut file_name = OsString::from(format!(".tmp.{}-", prefix));
file_name.push(name.as_ref());
file_name
}
//! A deterministic game bot using alpha beta pruning.
use cr... | Rust | 0 |
e
coord.request_stop(e)
self.assertTrue(reported)
# If we clear_stop the exceptions are handled normally.
coord.clear_stop()
try:
raise RuntimeError("After clear")
except RuntimeError as e:
coord.request_stop(e)
with self.assertRaisesRegexp(RuntimeError, "After clear"):
... | Python | 1 |
let route_service: RouteService = RouteService::new();
let mut route = route_service.get_route();
fix_fragment_routes(&mut route);
App {
auth: Auth::new(),
current_route: AppRoute::switch(route),
router_agent,
current_user: None,
... | Rust | 0 |
# The MIT License (MIT)
#
# Copyright (c) 2023 Huimao Chen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | Python | 1 |
ned(np.byte)
np_short = _make_signed(np.short)
np_ushort = _make_unsigned(np.short)
np_int_ = _make_signed(np.int_)
np_uint = _make_unsigned(np.int_)
np_intc = _make_signed(np.intc) # C-compat int
np_uintc = _make_unsigned(np.uintc) # C-compat uint
np_long_ = _make_signed(np.int_) # C-compa... | Python | 1 |
{:?}", e);
assert_eq!(
"505 is too many jobs. Limit is 500 for /user/jobs API. See Sauce Labs API docs",
e.to_string()
)
}
}
}
#[test]
#[should_panic]
fn all_jobs_bad_input() {
let fake_user = super::users::User::new(
Some("bad.user12b158... | Rust | 0 |
arget; d3d12::D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT as usize];
for (raw, ct) in raw_targets.iter_mut().zip(color_targets.iter()) {
raw.RenderTargetWriteMask = ct.write_mask.bits() as u8;
if let Some(ref blend) = ct.blend {
let (color_op, color_src, color_dst) = map_blend_component(&ble... | Rust | 0 |
cur_features, cur_indices = self.SA_modules[i](
sa_xyz[i], sa_features[i])
sa_xyz.append(cur_xyz)
sa_features.append(cur_features)
sa_indices.append(
torch.gather(sa_indices[-1], 1, cur_indices.long()))
fp_xyz = [sa_xyz[-1]]
fp_featur... | Python | 1 |
logging.info(f"Created temporary directory to clone repo: {repo_dir}")
self._clone_repository(self.repo_url, access_token, output_path=repo_dir)
if len(new_files) > 0:
self._create_files(Path(repo_dir), new_files)
tag = str(uuid4()).split("-")[0]
self.... | Python | 1 |
ed::<frame_server::ToFrameServer>();
let (s_from_frame_server, r_from_frame_server) = unbounded::<frame_server::FromFrameServer>();
let frame_server =
frame_server::FrameServerCache::spawn(r_to_frame_server, s_from_frame_server);
let (s_from_client_to_manager, r_from_client_to_manager) = unbounded... | Rust | 0 |
ruct _CLOCK_STA;
#[doc = "`read()` method returns [clock_sta::R](clock_sta::R) reader structure"]
impl crate::Readable for CLOCK_STA {}
#[doc = "`write(|w| ..)` method takes [clock_sta::W](clock_sta::W) writer structure"]
impl crate::Writable for CLOCK_STA {}
#[doc = "Clock status register This register reflects the cu... | Rust | 0 |
tput == target.view(-1,1), dim=1))[0]
top1_output = output[:,0].float()
top1_output[soft_intersection] = target[soft_intersection].float()
intersection = output[top1_output == target]
# https://github.com/pytorch/pytorch/issues/1382
area_intersection = torch.histc(intersection.float().cpu(), bi... | Python | 1 |
f.kafka_consumer.as_mut().unwrap().run()?;
}
if self.kafka_producer.is_some() {
self.kafka_producer.as_mut().unwrap().run()?;
}
Ok(())
}
}
#[derive(PartialEq, Copy, Clone)]
pub enum PostmanType {
Upper,
Downer,
}
impl PostmanType {
pub fn writer_channel_su... | Rust | 0 |
ert_eq!("ona".to_kana(), "おな");
//! assert_eq!("onaji".to_kana(), "おなじ");
//! assert_eq!("onaji BUTTSUUJI".to_kana(), "おなじ ブッツウジ");
//! assert_eq!("ONAJI buttsuuji".to_kana(), "オナジ ぶっつうじ");
//! assert_eq!("座禅‘zazen’スタイル".to_kana(), "座禅「ざぜん」スタイル");
//! // to hiragana
//! assert_eq!("toukyou,オオサカ".to_hiragana(), "とうきょう、お... | Rust | 0 |
import os
import dashscope
from dotenv import load_dotenv
class APIConfig:
_instance = None
def __new__(cls, env_path: str = "api.env"):
if cls._instance is None:
cls._instance = super().__new__(cls)
cls._instance._initialize(env_path)
return cls._instance
def _in... | Python | 1 |
from enum import Enum
from typing import Literal
class ConditionTaskOp(Enum):
"""
* `EQUAL_TO`, `NOT_EQUAL` operators perform string comparison of their operands. This means that `“12.0” == “12”` will evaluate to `false`.
* `GREATER_THAN`, `GREATER_THAN_OR_EQUAL`, `LESS_THAN`, `LESS_THAN_OR_EQUAL` operato... | Python | 1 |
# Copyright (c) 2017 Ansible, Inc.
# All Rights Reserved.
from django.urls import re_path
import awx.api.views.analytics as analytics
urls = [
re_path(r'^$', analytics.AnalyticsRootView.as_view(), name='analytics_root_view'),
re_path(r'^authorized/$', analytics.AnalyticsAuthorizedView.as_view(), name='analy... | Python | 1 |
</tspan></text>
/// <text style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" x="175.22902" y="774.8031"><tspan x="175.22902" y="774.8031">2</tspan></text>
/// <text style="font-size:40px;font-s... | Rust | 0 |
�', '𐳩', 'ᨥ', '𑓄', '𐪕', '𐕗', '𒅋', '𝁃',
'\u{1da23}', 'ဂ', '䷣', '˂', '𞺀', '\u{31a}', 'ㆭ', '༞', 'ᲆ', 'پ', '䷸',
'⇻', 'ᠯ', '𓃧', 'ᒷ', '𝞐', '🙮', '𔑽', '⊕', '𐏉', '↧', '𑈔', 'ฆ',
'㇔', '𐔋', '𘦰', '𐙢', '㇀', '𑱴', '善', '౫', '𑈚', 'ꯙ', '𖢅',
'𖣠', 'ꬤ', '㊸', '𝖭', '〾', 'ⶁ', '𝀇', '𐨳', '𝚘', 'ഫ', '𝌡', '... | Rust | 0 |
today().year - (int(curr_row['建築完成年月'][:-4]) + 1911)
house_so_old = house_num_old
else:
house_so_old = -1
# 每坪數單價
single_land_cost = round(float(curr_row['單價元坪'] / 10000), 2)
if math.isnan( curr_row['單價元坪'] ):
continue
... | Python | 1 |
k += 1
j += 1
else: # sorted_arr1[i] == sorted_arr2[j]
if k == 0 or unique_array[k - 1] != sorted_arr1[i]: # 添加新元素,并确保不重复
unique_array[k] = sorted_arr1[i]
k += 1
i += 1
j += 1
# 处理剩余的元素
if i < len(sorted_arr1):
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.