text string | label_name string | labels int64 |
|---|---|---|
su, target = map(int, input().split())
A = list(map(int, input().split()))
left = 0
right = 0
count = 0
sum = 0
while True:
if sum < target:
if right < su:
sum += A[right]
right += 1
else:
break
elif sum > target:
sum -= A[left]
left += 1
... | Python | 1 |
ds=True):
"""创建预处理过的Atari环境"""
env = create_gym_env(env_id, seed=seed)
# Atari预处理
env = GrayScaleObservation(env, keep_dim=True)
env = ResizeObservation(env, (84, 84))
env = FrameSkip(env, skip=4)
env = FrameStack(env, n_frames=frame_stack)
if clip_rewards:
from environments.en... | Python | 1 |
self, x):
b, n, c, h, w = x.size()
x_1 = x[:, :-1, :, :, :].reshape(-1, c, h, w)
x_2 = x[:, 1:, :, :, :].reshape(-1, c, h, w)
flows_backward = self.spynet(x_1, x_2).view(b, n - 1, 2, h, w)
flows_forward = self.spynet(x_2, x_1).view(b, n - 1, 2, h, w)
return flows_forwa... | Python | 1 |
/// The [IDP Group](https://slack.com/help/articles/115001435788-Connect-identity-provider-groups-to-your-Enterprise-Grid-org) ID to be an allowlist for the private channel.
pub group_id: Cow<'a, str>,
/// The workspace where the channel exists. This argument is required for channels only tied to one worksp... | Rust | 0 |
for xi, yi in itertools.product(indices, indices):
v = np.arange(1, 1 + n*2 + k, dtype=dtype)
x = v[xi]
y = v[yi]
with np.errstate(all='ignore'):
check(x, y)
# Scalar cases
check(x[:1], y)
... | Python | 1 |
,
}
}
/// Create a [`CircleSegment`] by cutting out parts of this circle.
pub fn segment(self, inner_radius: f64, start_angle: f64, sweep_angle: f64) -> CircleSegment {
CircleSegment {
center: self.center,
outer_radius: self.radius,
inner_radius,
... | Rust | 0 |
import os
import requests
import xmltodict
from ibm_cloud_sdk_core.authenticators import ContainerAuthenticator
if __name__ == '__main__':
# read environment variables
cosBucket = os.getenv('COS_BUCKET')
if cosBucket is None:
print('environment variable COS_BUCKET is not set')
exit(1)
... | Python | 1 |
')
arg_parser.add_argument('--test_file', type=str, help='Path to the test file')
arg_parser.add_argument('--save_decode_to', default=None, type=str, help='Save decoding results to file')
#### reranking ####
arg_parser.add_argument('--features', nargs='+')
arg_parser.add_argument('--load_reconstruc... | Python | 1 |
DataProto,
};
unsafe {
instance.get(VariantTensorDataProto::new)
}
}
}
impl ::protobuf::Clear for VariantTensorDataProto {
fn clear(&mut self) {
self.clear_type_name();
self.clear_metadata();
self.clear_tensors();
self.unknown_fields.clear();
... | Rust | 0 |
}
pub fn SigTimer(&mut self) -> &mut SigTimer {
let addr = &self.fields[0] as *const _ as u64;
return unsafe {
&mut *(addr as *mut SigTimer)
}
}
pub fn SigRt(&mut self) -> &mut SigRt {
let addr = &self.fields[0] as *const _ as u64;
return unsafe {
... | Rust | 0 |
TIME_FORMAT) {
Ok(date_time) => Some(date_time),
Err(_) => None,
},
)
}
/// Extract the `BODYSTRUCTURE` of a `FETCH` response
///
/// See [section 2.3.6 of RFC 3501](https://tools.ietf.org/html/rfc3501#section-2.3.6) for
/// detail... | Rust | 0 |
match orig_value {
Some(orig_value) => env::set_var(env_key, orig_value),
None => env::remove_var(env_key),
}
config_res.expect("Could not load configuration.")
};
assert_eq!(config, custom_config);
}
#[cfg(unix)]
#[test]
#[serial... | Rust | 0 |
import torch
from .utils import LayerRelevance
class YOLOv8RelevanceInitializer(object):
"""
Assign initial relevance for YOLOv5 model explanation
Attributes
----------
cls : int
Index to the class of interest.
conf_thres : float
Threshold set for object detect... | Python | 1 |
], ah
);
Default::default()
}
use crate::util::{base64, conversion};
use crate::{Limit, Prng};
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RunCode {
pub prng: Prng,
pub limit: Limit,
}
impl RunCode {
pub fn from_base64(string: &str) -> Result<Self, String> {
let bytes = base64::deco... | Rust | 0 |
, deveui: Vec<u8>) -> DispatchResult {
let who = ensure_signed(origin)?;
debug::info!("submit_number_signed: ({}, {:?})", number, who);
debug::info!("Final check for devEui and status: {:?} {}", deveui, status);
Self::append_or_replace_number(number);
// update data in parking pallet
d... | Rust | 0 |
# Copyright 2014 Netflix, Inc.
#
# 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 applicable law... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Обработчики AI команд (/ai, /status)
"""
import logging
from telegram import Update
from telegram.ext import ContextTypes
from ..config import Config
from ..services.ai_service import AIService
logger = logging.getLogger(__name__)
class AIHandlers:
"""Обработчики AI команд"""
... | Python | 1 |
usize, texture_desc.Height as usize),
))
}
/// Captures the frame and returns it.
///
/// # Returns
///
/// Returns a tuple with the:
/// - Frame
/// - Width and Height
pub fn capture_frame<T>(&mut self) -> Result<(&mut [T], (usize, usize)), ObsError> {
// Restart t... | Rust | 0 |
exit(1);
}
}
}
if Path::new(&sock_file_path).exists() {
log::trace!("Sockfile exists, attempting to remove it.");
match fs::remove_file(&sock_file_path) {
Ok(_) => {
log::debug!("Removed old socket file");
}
Err(e) => {
... | Rust | 0 |
#[doc = "*Required features: `\"Win32_Networking_Ldap\"`*"]
pub const LDAP_CAP_ACTIVE_DIRECTORY_W8_OID: &str = "1.2.840.113556.1.4.2237";
#[doc = "*Required features: `\"Win32_Networking_Ldap\"`*"]
pub const LDAP_CAP_ACTIVE_DIRECTORY_W8_OID_W: &str = "1.2.840.113556.1.4.2237";
#[doc = "*Required features: `\"Win32_Netw... | Rust | 0 |
*mut IMAGE_COFF_SYMBOLS_HEADER;
pub const FRAME_FPO: WORD = 0;
pub const FRAME_TRAP: WORD = 1;
pub const FRAME_TSS: WORD = 2;
pub const FRAME_NONFPO: WORD = 3;
STRUCT! {struct FPO_DATA {
ulOffStart: DWORD,
cbProcSize: DWORD,
cdwLocals: DWORD,
cdwParams: WORD,
BitFields: WORD,
}}
BITFIELD! {FPO_DATA ... | Rust | 0 |
SystemServices'*"]
pub const TAPE_DRIVE_HIGH_FEATURES: u32 = 2147483648u32;
#[doc = "*Required features: 'Win32_System_SystemServices'*"]
pub const TAPE_DRIVE_INITIATOR: u32 = 4u32;
#[doc = "*Required features: 'Win32_System_SystemServices'*"]
pub const TAPE_DRIVE_PADDING: u32 = 262144u32;
#[doc = "*Required features: ... | Rust | 0 |
rs: USRS<E>,
/// g^y, where y is the update x-permutation.
g_y: E::G1Affine,
/// g^{beta * y}, where beta is the update alpha-permutation.
g_by: E::G1Affine,
/// The proof of knowledge of exponent for g^y and g^{beta * y}.
pi: N::Proof,
}
impl<E: Engine, N: NIZK<X = CurvePair<E::G1Affine>, W = ... | Rust | 0 |
self
}
/// SHA that pull request head must match to allow merge.
pub fn sha(mut self, sha: impl Into<String>) -> Self {
self.sha = Some(sha.into());
self
}
/// Merge method to use. Default is `Merge`.
pub fn method(mut self, method: impl Into<crate::params::pulls::MergeMethod... | Rust | 0 |
::Option<std::string::String>,
/// <p>The unique identifier for the job.</p>
#[serde(rename = "jobId")]
#[serde(default)]
pub job_id: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for SubmitJobOutputBody {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
... | Rust | 0 |
dify(|_, w| unsafe { w.top().bits(top) });
}
pub fn interrupt_enable(&mut self, interrupt: InterruptFlag) {
self.register.ien.modify(|r, w| unsafe { w.bits(interrupt.bits() | r.bits()) });
}
pub fn interrupt_is_pending(interrupt: InterruptFlag) -> bool {... | Rust | 0 |
"1",
"order" : 1}
all_opt["use_cookies"] = {
"getopt" : "",
"longopt" : "use-cookies",
"help" : "--use-cookies Reuse cookies for authentication",
"required" : "0",
"shortdesc" : "Reuse cookies for authentication",
"order" : 1}
all_opt["cookie_file"] = {
"getopt" : ":",
"longopt" : ... | Python | 1 |
from typing import TYPE_CHECKING
from .measure import Measurement
from .segment import Segment
from .style import StyleType
if TYPE_CHECKING:
from .console import Console, ConsoleOptions, RenderResult, RenderableType
class Styled:
"""Apply a style to a renderable.
Args:
renderable (RenderableTy... | Python | 1 |
# Generated by Django 3.0.11 on 2020-12-10 22:18
from django.db import migrations, models
def add_plugin_types(apps, schema_editor):
Plugin = apps.get_model("posthog", "Plugin")
for plugin in Plugin.objects.filter(plugin_type__isnull=True):
plugin.plugin_type = "local" if plugin.url and plugin.url.st... | Python | 1 |
_FMOD_DSP_PAN_2D_STEREO_POSITION: FMOD_DSP_PAN = 1;
pub const FMOD_DSP_PAN_FMOD_DSP_PAN_2D_DIRECTION: FMOD_DSP_PAN = 2;
pub const FMOD_DSP_PAN_FMOD_DSP_PAN_2D_EXTENT: FMOD_DSP_PAN = 3;
pub const FMOD_DSP_PAN_FMOD_DSP_PAN_2D_ROTATION: FMOD_DSP_PAN = 4;
pub const FMOD_DSP_PAN_FMOD_DSP_PAN_2D_LFE_LEVEL: FMOD_DSP_PAN = 5;
... | Rust | 0 |
Some(round.mana_spent);
}
continue;
}
round.player.hit_points -= max(round.boss.damage - round.player.armour, 1);
// If player dead, lose.
if round.player.hit_points <= 0 {
continue;
}
get_spells()
.iter()
.fi... | Rust | 0 |
the former alignment is always >=
//! the latter.
pub use crate::offset::{align_offset, AlignedOffset};
#[cfg(feature = "alloc")]
use alloc::{
borrow::{Cow, ToOwned},
boxed::Box,
};
use core::ops::{
Deref, DerefMut, Index, IndexMut, Range, RangeFrom, RangeFull, RangeInclusive, RangeTo,
RangeToInclusi... | Rust | 0 |
from django.urls import path
from .feeds import FBInstantArticles, LatestEntriesFeed, TagFeed
from .settings import get_setting
from .views import (
AuthorEntriesView,
CategoryEntriesView,
PostArchiveView,
PostDetailView,
PostListView,
TaggedListView,
)
def get_urls():
urls = get_setting(... | Python | 1 |
mt_.u24(#arg)));
}
defmt_parser::Type::U32 => {
exprs.push(quote!(_fmt_.u32(#arg)));
}
defmt_parser::Type::U8 => {
exprs.push(quote!(_fmt_.u8(#arg)));
}
defmt_parser::Type::Usize => {
... | Rust | 0 |
inputs["required"][f"{header}_to_{next_header}"] = ("STRING", {"default": ", "})
return inputs
RETURN_TYPES = ("STRING",)
FUNCTION = "build_prompt"
CATEGORY = "Prompt Nodes"
def build_prompt(self, csv_file, seed, **kwargs):
script_directory = os.path.dirname(os.path.abspath(__fil... | Python | 1 |
ect)
# 绘制网格
if self._draw_grid:
# 设置网格样式
painter.setPen(QPen(self._grid_color, 0.5))
# 计算可见区域的网格线
left = int(rect.left()) - (int(rect.left()) % self._grid_size)
top = int(rect.top()) - (int(rect.top()) % self._grid_size)
... | Python | 1 |
t::descrsetfunc>,
pub tp_dictoffset: Py_ssize_t,
pub tp_init: Option<ffi3::object::initproc>,
pub tp_alloc: Option<ffi3::object::allocfunc>,
pub tp_new: Option<ffi3::object::newfunc>,
pub tp_free: Option<ffi3::object::freefunc>,
pub tp_is_gc: Option<ffi3::object::inquiry>... | Rust | 0 |
until_hour=until_hour,
)
]
# calculate a grid
# fmt: off
number_of_half_hours: int = (self.__until_hour - self.__from_hour).seconds // 1800
self.__grid = [[-1 for _ in range(0, number_of_half_hours)]]
for i, e in enumerate(self.__events):
... | Python | 1 |
_ok());
let ctx = SSL_CTX_new(SSLv23_client_method());
let ssl = SSL_new(ctx);
assert_eq!(
SSL_SUCCESS,
SSL_set_tlsext_host_name(ssl, b"google.com\0".as_ptr() as *const c_char)
);
assert_eq!(SSL_SUCCESS, SSL_set_fd(ssl, sock.as_raw_fd()));
assert_eq!(SSL_SUCCESS, SSL_connect(ssl)... | Rust | 0 |
from collections import deque
import sys
input = sys.stdin.readline
n, m, dist, start = map(int, input().split())
graph = [[] for _ in range(n + 1)]
for _ in range(m):
a, b = map(int, input().split())
graph[a].append(b)
distance = [-1] * (n + 1)
def bfs(start):
queue = deque([start])
distance[start... | Python | 1 |
n self.total_file_size
def is_active(self) -> bool:
"""
Query if the download is active
Returns:
boolean: True if active, False if completed, failed, stopped, or inactive
"""
if self.status == DownloadStatus.DOWNLOADING:
return True
return ... | Python | 1 |
import pytest
from pysisyphus.helpers import geom_loader
from pysisyphus.run import run_from_dict
from pysisyphus.testing import using
@using("pyscf")
@pytest.mark.parametrize("coord_type, cos_type", [("dlc", "gs"), ("cart", "neb")])
def test_preopt(coord_type, cos_type, this_dir):
run_dict = {
"geom": {... | Python | 1 |
writes = uniq_writes_counter.len();
let uniq_writes_sorted = get_sorted_vec(&uniq_writes_counter);
let writes_ninety = ninety_perc(&uniq_writes_sorted, total_writes);
let global_entropy_writes = global_entropy(&uniq_writes_sorted, total_writes);
let local_entropy_writes = local_ent... | Rust | 0 |
oisson"
train_datas = [train_spikes[i, :, :].astype(int) for i in range(len(train_spikes))]
eval_datas = [eval_spikes[i, :, :].astype(int) for i in range(len(eval_spikes))]
train_masks = [np.full(masks[0, :, :].shape, True) for _ in range(len(train_datas))]
eval_masks = [masks[i, :, :] for i in range(len(masks))]
num... | Python | 1 |
tch r {
0x0001 => Ok(ResultKind::Void),
0x0002 => Ok(ResultKind::Rows),
0x0003 => Ok(ResultKind::SetKeyspace),
0x0004 => Ok(ResultKind::Prepared),
... | Rust | 0 |
to_option_url;
pub(crate) use crate::current_mode::utils::reqwest::check_response;
pub(crate) use crate::current_mode::utils::reqwest::build_array_query;
<filename>examples/tabular.rs
//! Tabular data display example.
//!
//! Accepts one command-line argument which is used as the format string for
//! printing a small ... | Rust | 0 |
'static [u8; 3usize] = b"RW\0";
pub const TIMER_INTE_ALARM_2_RESET: u32 = 0;
pub const TIMER_INTE_ALARM_2_BITS: u32 = 4;
pub const TIMER_INTE_ALARM_2_MSB: u32 = 2;
pub const TIMER_INTE_ALARM_2_LSB: u32 = 2;
pub const TIMER_INTE_ALARM_2_ACCESS: &'static [u8; 3usize] = b"RW\0";
pub const TIMER_INTE_ALARM_1_RESET: u32 = 0... | Rust | 0 |
_std::{format, vec, vec::Vec};
use core::ops::Neg;
use jf_rescue::RescueParameter;
use jf_utils::multi_pairing;
/// (Aggregated) polynomial commitment evaluation info.
/// * `u` - a random combiner that was used to combine evaluations at point
/// `eval_point` and `next_eval_point`.
/// * `eval_point` - the point to... | Rust | 0 |
::new(config, conn.is_server())?;
http3_conn.send_settings(conn)?;
http3_conn.open_qpack_streams(conn)?;
Ok(http3_conn)
}
/// Sends an HTTP/3 request.
///
/// The request is encoded from the provided list of headers, and sent on
/// a newly allocated stream.
///
//... | Rust | 0 |
SWAP8 = 151,
EVM_INS_SWAP9 = 152,
EVM_INS_SWAP10 = 153,
EVM_INS_SWAP11 = 154,
EVM_INS_SWAP12 = 155,
EVM_INS_SWAP13 = 156,
EVM_INS_SWAP14 = 157,
EVM_INS_SWAP15 = 158,
EVM_INS_SWAP16 = 159,
EVM_INS_LOG0 = 160,
EVM_INS_LOG1 = 161,
EVM_INS_LOG2 = 162,
EVM_INS_LOG3 = 163,
... | Rust | 0 |
econds=30),
]
+ _common_mismatch
)
def not_hourly(request):
"""
Several timedelta-like and DateOffset instances that are _not_
compatible with Hourly frequencies.
"""
return request.param
@pytest.fixture(
params=[
np.timedelta64(4, "h"),
pd.Timedelta(hours=23).to_pytime... | Python | 1 |
xa4, 0xa2], [], "\u{3042}");
assert_finish_ok!(d, "");
}
// #[bench]
// fn bench_encode_short_text(bencher: &mut test::Bencher) {
// let s = testutils::JAPANESE_TEXT;
// bencher.bytes = s.len() as u64;
// bencher.iter(|| test::black_box({
// EUCJPEncoding.encode(... | Rust | 0 |
#!/usr/bin/env python
# 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 applicable law or agreed to in writing, software
# d... | Python | 1 |
Z$h> D S SK rS SKJs Jr S SKJrJrJ r S r
S rS rg) N)CSV_FILE
EXCEL_FILEXML_FILEc 6 U R [ SS9 [ $ NF)index)to_csvr dfs MC:\Users\Bhanush\Documents\projects\flask_project\weather_api\co... | Python | 1 |
_attention(
query,
key,
value,
d_key,
q_mask,
k_mask,
dropout_rate,
mask_cache=mask_cache)
y = query + att_out
if is_layer_norm:
y = fluid.layers.layer_norm(
input=y,
begin_norm_axis=len(y.shape) - 1,
pa... | Python | 1 |
# -*- coding=UTF-8 -*-
# pyright: strict
from .. import action, config, imagetools, template, templates
from models.controller import missionController
def team_race():
while True and missionController.FLAG:
tmpl, pos = action.wait_image(
templates.CONNECTING,
templates.RETRY_BUTT... | Python | 1 |
{
break;
}
data.push(self.parse_datum()?);
}
Some(Datum::Vector(data))
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_lookahead() {
let xs = [1, 2, 3];
let mut iter = Lookahead::new(xs.iter());
assert_eq!(ite... | Rust | 0 |
import pandas as pd
from sqlalchemy import create_engine
# PostgreSQL connection string
postgres_user = "postgres"
postgres_password = "postgres"
postgres_host = "db" # Docker service name for Postgres
postgres_port = "5432"
postgres_db = "ny_taxi"
engine = create_engine(f"postgresql://{postgres_user}:{postgres_pass... | Python | 1 |
import math
#Notes:
# Note 1: requires install of qpsolvers, commands to run in terminal/powershell found below:
'''
pip install qpsolvers
'''
#Note 2:
#Grad(h, x) untested as I couldn't get numdifftools import to be recognized, even after intsalling the package.
#Could be a problem with how I installed or IDE... | Python | 1 |
_per_sec!(begin.pgscan_kswapd, end.pgscan_kswapd, duration, u64),
pgscan_direct: count_per_sec!(begin.pgscan_direct, end.pgscan_direct, duration, u64),
oom_kill: end.oom_kill.map(|v| v as u64),
}
}
}
#[derive(Clone, Debug, Default, PartialEq, BelowDecor)]
pub struct SingleDiskModel ... | Rust | 0 |
import flet as ft
points = [0,0] #curr/max
def vibeCheck(answer, correct):
points[1] += 1
if answer == correct:
points[0] += 1
def vibeMultiCheck(answer, corrects):
points[1] += 1
if answer in corrects:
points[0] += 1
genders = ["háromszög","négyszög", "ötszög"]
def main(page: ft.Pa... | Python | 1 |
horizontal_scale = 0.05 # [m]
vertical_scale = 0.005 # [m]
border_size = 25 # [m]
curriculum = False
static_friction = 0.5
dynamic_friction = 0.5
restitution = 0.
# rough terrain only:
rough_plane = False
roughness = 0.025
slope ... | Python | 1 |
.expect("process block ok");
}
for block in chain2.blocks().iter().take(switch_fork_number + 2) {
chain_controller
.process_block(Arc::new(block.clone()), true)
.expect("process block ok");
}
assert_eq!(
SharedError::UnresolvableTransaction(UnresolvableError::De... | Rust | 0 |
ck function
elif reporting_mode == 'json':
data['timestamp'] = strftime('%Y-%m-%d %H:%M:%S', localtime())
data['name'] = flora_name
data['name_pretty'] = flora['name_pretty']
data['mac'] = flora['mac']
data['firmware'] = flora['firmware']
p... | Python | 1 |
def obfuscate_email(value):
string_rep = str(value)
if "@" not in str(string_rep):
return obfuscate_string(string_rep)
local_part, domain = str(string_rep).split("@")
return f"{local_part[:1]}...@{domain}"
def obfuscate_string(value, phone=False):
if not value:
return ""
strin... | Python | 1 |
import matplotlib.pyplot as plt
# Data
x = ['Commission', 'Parliament', 'Council']
y = [0.51, 0.57, 0.44]
# Set y-axis range from 0 to 1
plt.ylim(0, 1)
# Create a customized line plot
plt.plot(x, y, color='green', linestyle='-', linewidth=2, marker='o', markersize=10, markerfacecolor='red')
# Add labels and title
p... | Python | 1 |
rds_zero(value: f64, scale: i8, towards: bool) -> f64 {
let digits = significant_digits(value, scale);
match digits.1 == 5 {
true => round(value, scale, (value < 0.) ^ !towards),
false => to_nearest(value, scale, digits.1),
}
}
fn up_or_down(value: f64, scale: i8, up: bool) -> f64 {
let digits = significant_di... | Rust | 0 |
// substract
(Integer(pre), Sub(Integer(arg))) => Integer(pre - arg),
(Integer(pre), Sub(Float(arg))) => Float(*pre as f64 - arg),
(Float(pre), Sub(Integer(arg))) => Float(pre - *arg as f64),
(Float(pre), Sub(Float(arg))) => Float(pre - arg),
... | Rust | 0 |
evel_num < 3:
self.total_score += self.current_level.score
self.total_artifacts += self.current_level.artifacts_collected
self.current_level_num += 1
self.current_level = self.create_level(self.current_level_num)
return True
return False
def updat... | Python | 1 |
error originating in DirectWrite code, which is not expected to occur but is safe to recover from.
pub const E_UNEXPECTED : HResultError = HResultError::from_constant(0x88985001); // DWRITE_E_UNEXPECTED
/// Indicates the specified font does not exist.
pub const E_NOFONT : HResultError = HResultError::from_constant(0x... | Rust | 0 |
PickupMethod.OUT_OF_RACK,
)
def high_volume_tip_with_filter() -> HamiltonTip:
"""High volume tip with a filter (`tt05` in venus)"""
return HamiltonTip(
has_filter=True,
total_tip_length=95.1, # 95 in the ctr file, but 95.1 in the log file (871-80)/10
maximal_volume=1065,
tip_size=TipSize.HIGH_V... | Python | 1 |
import requests
from bs4 import BeautifulSoup
import csv
# Yahoo 台灣娛樂新聞的 URL
url = 'https://tw.news.yahoo.com/entertainment/archive/'
# 發送請求
response = requests.get(url)
# 檢查請求是否成功
if response.status_code == 200:
# 解析 HTML
soup = BeautifulSoup(response.text, 'html.parser')
# 找到所有目標區塊程式碼 (根據 class 名稱)
... | Python | 1 |
from movie.Movies_pb2 import Movie
from movie.Movie import MovieDTO
class MovieService:
def __init__(self, database):
self.database = database
def create(self, movie):
print("[Movie Service] Executing method create()")
movie_created = self.database.insert(movie)
return MovieDT... | Python | 1 |
equestport__viprequestportpool__server_pool': pool_id
}
self.search['extends_search'] = \
[ex.append(extends_search) for ex in self.search['extends_search']] \
if self.search['extends_search'] else [extends_search]
vips_requests = facade.get_vip_request_by_search(self.se... | Python | 1 |
field_matcher_is_match_not() -> TestResult {
let subfield = Subfield::new('0', "abc")?;
let matcher = SubfieldMatcher::from_str("!1?")?;
let flags = MatcherFlags { ignore_case: false };
assert!(matcher.is_match(&subfield, &flags));
let matcher = SubfieldMatcher::from_str("!(1?)... | Rust | 0 |
/// | `(Foo { x: 5, y: 6 }, true)` | *error: restriction 2* | `5,6,true` |
pub async fn serialize<S: Serialize>(&mut self, record: S) -> Result<()> {
self.ser_wtr.serialize(record)?;
self.ser_wtr.flush()?;
self.asy_wtr.as_mut().unwrap().write_all(self.ser_wtr.data()).await?;
sel... | Rust | 0 |
from yacs.config import CfgNode as CN
_CN = CN()
_CN.name = 'default'
_CN.suffix ='sintel'
_CN.gamma = 0.75
_CN.max_flow = 400
_CN.batch_size = 6
_CN.sum_freq = 100
_CN.val_freq = 100000000
_CN.image_size = [432, 960]
_CN.add_noise = False
_CN.use_smoothl1 = False
_CN.critical_params = []
_CN.transformer = 'percostfo... | Python | 1 |
!(&opc);
// dbg!(¶m);
match opc {
"acc" => {
accu = accu + param;
idx = idx + 1;
}
"jmp" => {
let i = (idx as i16) + param;
idx = i as usize;
}
_ => idx = idx + 1,
};
... | Rust | 0 |
os.chdir(archive)
all_tools = AllTools()
all_tools.show_options()
# If not Linux and probably Windows
elif system() == "Windows":
print(
"\033[91m Please Run This Tool In Debian System For Best Result " "\e[00m")
sleep(2)
... | Python | 1 |
# coding: utf-8
"""
API Alegra Proveedor Electrónico Colombia
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class ma... | Python | 1 |
))]
fn get_phase2_client_cert_password_flags(&self) -> SettingSecretFlags;
/// Client certificates are used to identify the connecting client to the network
/// when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x
/// authentication method.
///
/// # Returns
///
/// path to ... | Rust | 0 |
});
}
let mut output = Raster::initialize_using_file(&output_file, &input1);
for r in 0..rows1 {
let (row, data) = rx.recv().unwrap();
output.set_row_data(row, data);
if verbose {
progress = (100.0_f64 * r as f64 / (rows1 - 1) as f64) as us... | Rust | 0 |
;
assert_eq!(output.0.data, vec![1, 2, 3, 4]);
});
}
#[test]
fn output_is_returned_on_failure() {
// Verifies that if a contract returns data with a failing exit status, this data
// is returned from the execution context.
let origin = ALICE;
let dest = BOB;
let return_ch = MockLoader::insert(
Cal... | Rust | 0 |
6053a466f8e235e86639526df385321f4ebb2e1dc32492fa03453a00c19d86e1a13b48a9ed4e524387b4718b49635a47ee4855a17cf86b7ffd5570bee2c7605402b90daff72ff33ed424c9dd57d42",
(32, 29, [0x7f832a0f, 0x8f10cd7c], [0x0580e490, 0x54084d6f]),
"<KEY>"
),
(
// Len = 704
"3383c02ef5bb62defeaa78d428b6278a7ad1ff0502279303a325f44c32e63... | Rust | 0 |
= j;
while ii < jj {
if v.get(ii) != v.get(jj) {
return false;
}
ii += 1;
jj -= 1;
}
true
}
#[cfg(test)]
mod tests {
use crate::palindrome::Solution;
#[test]
fn test() {
let res = Solution::valid_palindrome("abca".into());
assert!(re... | Rust | 0 |
f"loss {np.round(loss.item(), 3)} = {np.round(nll_loss, 3)} + {np.round(weight_decay, 3)} "
# f"avg prob of [{cur_sen}] "
f"avg prob {avg_prob}"
)
if loss < 1e-2:
break
if it == hparams.v_num_grad_steps - 1:
... | Python | 1 |
x] + \
query[verb_idx+1:verb_to_correct_idx] + \
[corrected] + query[verb_to_correct_idx+1:-1]
else:
query_new = query[:verb_idx] + \
query[verb_idx+1:verb_insert_idx] + \
[verb] + query[verb_insert_idx:-1]
if debug:
print(q_tokens, qw, ve... | Python | 1 |
F_PYRAMIDALQUAD` → ❌ <br>
//!
//! [`D3DTEXTUREOP`](https://docs.microsoft.com/en-us/windows/win32/direct3d9/d3dtextureop) → [`d3d::TextureOp`] <br>
//! * `D3DTOP_ADD` → ❌ <br>
//! * `D3DTOP_ADDSIGNED` → ❌ <br>
//! * `D3DTOP_ADDSIGNED2X` → ❌ <br>
//! * `D3DTOP_ADDSMOOTH` → ❌ <br>
//! * `D3D... | Rust | 0 |
f {
let command = &settings.command;
if let Some(ref default_attrs) = command.new.default_attrs {
for (key, value) in default_attrs.iter() {
self.issue.attrs.set_attr_value(key.as_str(), value.clone());
}
}
self
}
}
impl<T> Setup for List<T>
w... | Rust | 0 |
{}
def run_loading(self, total_records: int = 12400000):
"""Run the complete data loading process."""
logger.info(f"🚀 Starting final data loading for {total_records:,} records...")
self.setup_databases()
self.start_time = time.time()
# Progress trackin... | Python | 1 |
self._samples.append(formatted_data)
if len(self._samples) > 100 * self.num:
break
if self.num != -1:
if self.num > len(self._samples):
logging.warning(f"Requested sample size ({self.num}) is larger than availab... | Python | 1 |
l From<GliumCreationError<CreationError>> for Oops {
fn from(err: GliumCreationError<CreationError>) -> Oops {
oops("failed to create OpenGL context", err)
}
}
impl From<VertexBufferCreationError> for Oops {
fn from(err: VertexBufferCreationError) -> Oops {
oops("failed to create a vertex b... | Rust | 0 |
import math
import FreeCAD as App
import Part
# Constants
num_outlets = 6
total_flow_rate = 10 # standard liters per minute
outlet_velocity = 1 # m/s
# Calculate outlet diameter
outlet_flow_rate = total_flow_rate / num_outlets # L/min
outlet_flow_rate_m3s = outlet_flow_rate / (60 * 1000) # m³/s
outlet_area = outl... | Python | 1 |
staff_grp: Some(StaffGrp {
staff_def: Some(StaffDef {
n: Some(1),
clef_line: Some(2),
clef_shape: Some("G".to_string()),
clef_dis_place: S... | Rust | 0 |
self.read_value() {
self.test = value.starts_with(literal)
} else {
self.test = false;
}
}
pub(super) fn test_value_ends_with(&mut self, literal: &'a str) {
if let Some(value) = self.read_value() {
self.test = value.ends_with(literal)
} else {
self.test = false;
}
}
... | Rust | 0 |
lone() + b.clone()) * (a.clone() + b.clone()));
// println!("{:#?}", (b.clone() * a.clone()) / a.clone());
}
<filename>families/block_info/sawtooth_block_info/src/payload.rs
/*
* Copyright 2018 <NAME>, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in... | Rust | 0 |
"""
Object pool uses a set of initialized objects kept ready to use – a "pool" – rather than allocating
and destroying them on demand. A client of the pool will request an object from the pool and perform
operations on the returned object. When the client has finished, it returns the object to the pool
rather than de... | Python | 1 |
192, 192, 192, 192,
"max", "mixed_8")
# stage 5
in5a = Inception7E(in4e, 320,
384, 384, 384,
448, 384, 384, 384,
"avg", 192, "mixed_9")
in5b = Inception7E(in5a, 320,
384, ... | Python | 1 |
# -*- config: utf-8 -*-
"""Base class for embedding layers."""
# Standard imports
from abc import ABC, abstractmethod
# Third party imports
import torch
class BaseEmbedding(ABC, torch.nn.Module):
"""Base class for embedding layers.
This class serves as a base for all embedding layers, providing a common i... | Python | 1 |
e.backends.google.GoogleOAuth2',
'django.contrib.auth.backends.ModelBackend',
]
# SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = '841132686664-2agbn63nemst4l54nd79c0o23aj607mh.apps.googleusercontent.com'
# SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = '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'
# SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = '841132686664-2... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.