text string | label_name string | labels int64 |
|---|---|---|
tent
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
if no... | Python | 1 |
dedKey, HandleControl, Keyboard, ScancodeSet1};
use spin::Mutex;
use x86_64::instructions::port::Port;
use super::hw_interrupts;
const IO_PORT_ADDR: u16 = 0x60;
pub fn handle(_stack_frame: &mut InterruptStackFrame) {
lazy_static! {
static ref KEYBOARD: Mutex<Keyboard<layouts::Us104Key, ScancodeSet1>> =
... | Rust | 0 |
, key, value);
self.numparams += 1;
}
fn fetch(&self) -> error::Result<blocking::Response>{
vprintln!("Request URI: {}", self.uri);
vprintln!("Timeout set to {} seconds", self.timeout.as_secs());
let client = Client::builder().timeout(self.timeout).build().unwrap();
le... | Rust | 0 |
# Copyright (c) OpenMMLab. All rights reserved.
from enum import Enum
class Priority(Enum):
"""Hook priority levels.
+--------------+------------+
| Level | Value |
+==============+============+
| HIGHEST | 0 |
+--------------+------------+
| VERY_HIGH | 10 ... | Python | 1 |
A series of predicted labels
"""
X = self.transform(matrix)
y = self.classifier.predict(X)
y = pd.Series(y, index=matrix.index)
return y.map(self.categories)
def transform(self, matrix):
"""Subset gene expression data to differentially expressed genes
... | Python | 1 |
,
ros2_control_plugin=ros2_control_plugin,
ros2_control_params=ros2_control_params,
add_gripper=add_gripper,
add_vacuum_gripper=add_vacuum_gripper,
add_bio_gripper=add_bio_gripper,
add_realsense_d435i=add_realsense_d435i,
add_d435i_links=add_d435i_links,
a... | Python | 1 |
#!/usr/bin/python3
for i in range(122, 96, -1):
print("{:c}".format(i if i % 2 == 0 else i - 32), end="")
| Python | 1 |
def _reset(self):
"""Re-initialize object."""
self.__init__(self._filename)
| Python | 1 |
frame()`]. Note you'll have to
//! `use microbit::display::Frame` to make `set()` available.
//!
//! You can call `set_frame()` at any time, so long as you're not
//! interrupting, or interruptable by, `handle_display_event()`.
//!
//! Once you've called `set_frame()`, you are free to reuse the
//! `MicrobitFrame`.
//!... | Rust | 0 |
application_properties=_encode_app_props(self.app_properties),
)
args = CommonParserArguments(properties=["all"])
parser = self._create_parser(
device_template=device_template, message=message, args=args
)
# act
parsed_msg = parser.parse_message()
... | Python | 1 |
from telegram import Update
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext
import time
import threading
import os
TOKEN = os.environ.get("BOT_TOKEN") # Bot token from environment variable
# START command handler
def start(update: Update, context: CallbackContext):
msg ... | Python | 1 |
#coding:utf-8#coding:utf-8
import networkx as nx
import matplotlib.pyplot as plt
from networkx.generators.classic import empty_graph, path_graph, complete_graph
#from networkx.random_graphs import *
import sys
import random
#
def _random_subset(seq,m):
""" Return m unique elements from seq.
This differs from r... | Python | 1 |
"""
docstring
TODO: figure out hvad vi gør med payoff matrices
"""
import json
agent_dict = {
"RB": {
"name": "Random Bias",
"shorthand": "RB",
"example": "RB(bias = 0.7)",
"reference": "Devaine, et al. (2017)",
"strategy": "Chooses 1 randomly based on a probability or bia... | Python | 1 |
ist): lists of excited configurations and signs obtained by reordering the
creation operators
**Example**
>>> electrons = 3
>>> orbitals = 5
>>> excitation = 2
>>> _excited_configurations(electrons, orbitals, excitation)
([28, 26, 25], [1, -1, 1])
"""
if excitation not in [1, ... | Python | 1 |
except Exception as e:
print(f"Error during processing: {e}")
import traceback
traceback.print_exc()
finally:
conn.close()
await wnba_client.close()
if __name__ == "__main__":
# Test with multiple dates to find games
test_dates = [
dt.date(2024, 6, 15)... | Python | 1 |
pub struct Message {
pub message: String,
}
impl Message {
pub fn new(message: &str) -> Self {
Self {
message: message.to_string(),
}
}
}
#[derive(Debug, Error, Deserialize, Serialize)]
pub struct ErrorResp {
pub error: String,
}
impl ErrorResp {
pub fn new(error: &st... | Rust | 0 |
urn'] = ((portfolio_values.iloc[-1] / portfolio_values.iloc[0]) ** (252 / days) - 1) * 100
# 波動率
metrics['volatility'] = returns.std() * np.sqrt(252) * 100
# 夏普比率
risk_free_rate = 0.02 # 假設無風險利率2%
excess_returns = returns.mean() * 252 - risk_free_rate
m... | Python | 1 |
ntext: RecommendationContext) -> List[AIRecommendation]:
"""优化推荐结果"""
# 按置信度排序
sorted_recs = sorted(recommendations, key=lambda r: r.confidence_score, reverse=True)
# 确保多样性(避免太多相似构筑)
diversified = []
seen_patterns = set()
for rec in sorted_recs:
... | Python | 1 |
th to scale
if width > height:
width = 512
height = -1
elif height > width:
height = 512
width = -1
elif width == height:
width = 512
height = 512
converted_name = f"kangsticker_{user_id}.webm"
(
ffmpeg.input(input)
.filter("fps", fps... | Python | 1 |
from typing import Annotated
from pydantic import Field
from workout_api.contrib.schemas import BaseSchema
class CentroTreinamento(BaseSchema):
nome: Annotated[str, Field(description = 'Nome do Centro de treinamento', example = 'CT King', max_length = 20)]
endereço: Annotated[str, Field(description = 'Endere... | Python | 1 |
am
# class StreamSyncOp:
# __name__ = "uncritical_stream_sync"
# def __init__(self, uncritical_stream) -> None:
# self.uncritical_stream = uncritical_stream
# pass
... | Python | 1 |
"quantity": asset,
"commission": cash * commission_rate,
"macd": current_macd,
"signal": current_signal,
"histogram": histogram[i] if not np.isnan(histogram[i]) else 0
})
... | Python | 1 |
"""General interface script to launch poisoning jobs."""
import torch
import datetime
import time
import village
torch.backends.cudnn.benchmark = village.consts.BENCHMARK
torch.multiprocessing.set_sharing_strategy(village.consts.SHARING_STRATEGY)
# Parse input arguments
args = village.options().parse_args()
# 100% ... | Python | 1 |
scans)
if one_by_one:
y = y.view(B, 4, -1, H, W) if in_channel_first else y.view(B, H, W, 4, -1)
else:
y = y.view(B, -1, H, W) if in_channel_first else y.view(B, H, W, -1)
return y, None, None, None, None
class CrossMergeF(torch.autograd.Function):
@stati... | Python | 1 |
ions")
print(f" Mathematical universe in topological space!")
return results
async def main():
"""Main function to build topological gridding"""
print(" TOPOLOGICAL GRIDDING 3D MATHEMATICAL UNIVERSE")
print("" 60)
print("Revolutionary Topological Mapping of Mathematical Insi... | Python | 1 |
if info.range.start < i {
let range1 = info.range.start .. i;
stack.push(TreeRangeInfo { range: range1, root_idx: lefti });
pushed += 1;
}
if i+1 < info.range.end {
let range2 = i+1 .. info.range.end;
... | Rust | 0 |
import polars as pl
def test_flatten_alias() -> None:
assert (
"""len().alias("bar")"""
in pl.LazyFrame({"a": [1, 2]})
.select(pl.len().alias("foo").alias("bar"))
.explain()
)
| Python | 1 |
ub_purchase_id.clone(),
),
None
);
assert_eq!(
OracleFinance::get_record_point(
888,
AresOcw::get_stash_id(&public_key_2.clone()).unwrap(),
pub_purchase_id.clone(),
),
None
);
assert_eq!(
OracleFinance::get_record_point(
888,
AresOcw::get_stash_id(&public_key_3.clone()).unw... | Rust | 0 |
rious parts of the compiler that must impose arbitrary limits
// on how deeply they recurse to prevent stack overflow. Users can override
// this via an attribute on the crate like `#![recursion_limit="22"]`. This pass
// just peeks and looks for that attribute.
use session::Session;
use syntax::ast;
use syntax::attr:... | Rust | 0 |
) -> core::fmt::Result {
<JStr as core::fmt::Debug>::fmt(self, f)
}
}
impl Display for JString {
fn fmt(&self, f: &mut Formatter) -> core::fmt::Result {
<JStr as Display>::fmt(self, f)
}
}
extern crate chrono;
pub mod dailyrecurrence;
pub mod dateinterval;
pub mod datetimeinterval;
mod int... | Rust | 0 |
import json
import logging
from typing import Any, Dict, Iterator, Tuple
from introspector.aws.fetch import ServiceProxy
from introspector.aws.svc import RegionalService, ServiceSpec, resource_gate
_log = logging.getLogger(__name__)
def _import_certificate_authority(proxy: ServiceProxy,
... | Python | 1 |
n, a = map(int, input().split())
nums = [int(a) for a in input().split()]
ans = []
for i in nums:
ans.append(i % a)
print(sum(ans))
print("YES" if sum(ans) > a else "NO") | Python | 1 |
# -*- coding: utf-8 -*-
from django.conf import settings
import requests,json
from common.mymako import render_mako_context
from account.accounts import Account
from django.http.response import HttpResponseRedirect
class CheckAccessMiddleware(object):
'''
@note: app权限检查中间件
'''
def process_request(self... | Python | 1 |
0xab9be52fbda43021u64,
0x26f5577994e34c3du64,
0x049dfee82aefbd60u64,
0x65dadd7828505289u64,
0x0e93d431ea011aebu64,
])),
Fq(FqRepr([
0x90ee774bd6a74d45u64,
0x7ada1c8a41bfb185u64,
0x0f1a8953b325f464u64,
0x104c24211be4805cu64,
0x16913... | Rust | 0 |
sin).to_string()}
class="metrogauge-markstep"
/>
});
}
html! {
<svg
xmlns="http://www.w3.org/2000/svg"
version="1.1"
viewBox="0 0 200 130"
>
<g style="fill: #00000000;">
<circle
cx={cent... | Rust | 0 |
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.3, 2.4 fallback.
from django.utils.cache import patch_vary_headers
def vary_on_headers(*headers):
"""
A view decorator that adds the specified headers to the Vary header of the
response. Usag... | Python | 1 |
from django.shortcuts import render,HttpResponse
from .serializers import StudentSerializer
from .models import Student
from django.http import JsonResponse
import io
from rest_framework.parsers import JSONParser
from rest_framework.renderers import JSONRenderer
from django.views.decorators.csrf import csrf_exempt
# Cr... | Python | 1 |
PA0, WKUP4 - PA2).
syscfg.exticr1.modify(|_, w| w.exti0().pa0().exti2().pa2());
exti.rtsr.modify(|_, w| w.tr0().set_bit().tr2().set_bit());
exti.imr.modify(|_, w| w.mr0().set_bit().mr2().set_bit());
pwr.csr.modify(|_, w| w.ewup1().set_bit().ewup4().set_bit());
// Configure port... | Rust | 0 |
xd2~\x89\xe9\xa6\xbbz\x1e\xb2\xc1aj\xca1uj\
K\x91.G)\xddJ7IIo\xbb\x8b\xd3[h\
\xd6\xba\x1c\x1f\x84\xbcMgz.l5\x1bO\xec\x9f\
\x10i\xee,\xf5\xcd\x1d\xdd%6\xd3\x1d\xc9\x05\xd5\xbc\
\x84f}6\xfbd\x93\xd9\x5c\xb6\xdd\xc9\x95\x90\x06\x02\
\xacj\xbaLWr\xbb\xf9\xe5P\xcad\x01]w\x15\
\x18\xee\xa0\xe1\x8f8\x04\x8d\xc7\x83\xeaW\xc7\x... | Python | 1 |
nstruction of sparse matrices by stacking, by block, ...
use crate::indexing::SpIndex;
use crate::sparse::prelude::*;
use std::cmp;
use std::default::Default;
/// Stack the given matrices into a new one, using the most efficient stacking
/// direction (ie vertical stack for CSR matrices, horizontal stack for CSC)
pub... | Rust | 0 |
_target[coil_index, :, j]
+ factor * self.data.centerline_delta[coil_index, :, j],
color=color,
)
if stage > 2:
gpr_fiducial = (
self.data.centerline_target[coil_index]
+ factor * self.data.center... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
l10n_ke_cu_proxy_address = fields.Char(related='company_id.l10n_ke_cu_proxy_address', readonly=F... | Python | 1 |
import sys
import json
from concurrent.futures import ThreadPoolExecutor, as_completed
from tqdm import tqdm
TECHNIQUES_FILE = "resources/techniques_db.json"
DEFEND_FILE = "resources/defend_db.jsonl"
CVE_FILE = "results/new_cves.jsonl"
# Update the database with the new CVEs and save the results to a JSONL file
def... | Python | 1 |
if file_name in rec.get("EXTRAS", {}).get("DEPENDENCIES", []):
deps.append(rec["RENDERED_FILE_NAME"])
return deps
# --------------------------------------------------------------------------- #
# 6) Sorting primitive – exposed for tests / other modules #
# -------------------... | Python | 1 |
# Análisis de calificaciones con Pandas y Seaborn
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# Crear el DataFrame
nombres = ["Ana", "Juan", "María", "Pedro", "Laura", "Sofía", "Carlos", "Andrés", "Valeria", "Mateo"]
notas = [85, 70, 95, 60, 88, 92, 75, 80, 90, 65]
horas_estudio = [4, 3... | Python | 1 |
elif '+79826614260' == number and message.text == 'Меню мастера':
markup2mas = types.ReplyKeyboardMarkup(resize_keyboard=True, row_width= 1)
naz = types.KeyboardButton('Назад')
rab_vrem = types.Key... | Python | 1 |
d_name_leading_trailing_spaces_regex = ValidationRegex(
valid_name_leading_trailing_spaces_regex_base % {
'ws': _build_regex_range(),
'no_ws': _build_regex_range(ws=False)},
_("printable characters with at least one non space character"))
valid_description_regex_base = '^[%s]*$'
valid_descri... | Python | 1 |
,
0x00f21e95eee17c5e, 0x00ffffffffd5fb21,
0x00ffffffffffffff, 0x00ffffffffffffff,
0x00000fffffffffff ]);
impl Debug for Mod_e382_105 {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
try!(write!(f, "Mod_e382_105: [ {:x}", &self.0... | Rust | 0 |
use cosmwasm_std::entry_point;
use cosmwasm_std::{
to_binary, Addr, Binary, Coin, Deps, DepsMut, DistributionMsg, Env, MessageInfo, QueryResponse,
Response, StakingMsg, StdResult, Storage, Uint128,
};
use cw2::set_contract_version;
use cw_storage_plus::U64Key;
use crate::error::ContractError;
use crate::msg... | Rust | 0 |
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
warnings.filterwarnings("ignore")
# Load the dataset
df = pd.read_csv(r"C:\Users\anony\Downloads\python.csv", encoding='ISO-8859-1')
# Clean data (drop rows with NaNs in key numeric columns)
df = df.dropna(subset=['Electric Rang... | Python | 1 |
data.insert(
eop_data.0,
(eop_data.1, eop_data.2, eop_data.3, eop_data.4, eop_data.5, eop_data.6)
);
}
Ok(EarthOrientationData {
eop_type,
data,
extrapolate,
interpolate,
mjd_min,
mjd_max,
mjd_last_lod,
mjd_... | Rust | 0 |
resampled in order to minimize overall sample loss
"""
# there are significantly more cases than controls (a real use case)
cohort = pd.Series([1] * 382308 + [0] * 12381)
gender = pd.Series(['m'] * 207740 + ['f'] * 174568 # cases
+ ['m'] * 5197 + ['f'] * 7184) # controls
... | Python | 1 |
See the License for the specific language governing permissions and
limitations under the License.
*/
//! Remove a package from your direct dependencies.
use std::{io::Write, path::Path, process, sync::Arc};
use anyhow::Result;
use async_trait::async_trait;
use colored::Colorize;
use tokio::{
fs::{remove... | Rust | 0 |
ate_tweet(text=message)
# if response.data:
# print(f"Successfully tweeted: {message}")
# else:
# print(f"Failed to tweet: {response}")
# except tweepy.TweepyException as e:
# print(f"Error while tweeting: {e}")
#
# # Manually tweet without waiting for 12:00 AM for te... | Python | 1 |
# Python bytecode 2.7 (decompiled from Python 2.7)
# Embedded file name: scripts/client/messenger/proto/xmpp/extensions/ext_constants.py
class XML_NAME_SPACE(object):
BLOCKING_CMD = 'urn:xmpp:blocking'
CHAT_STATES = 'http://jabber.org/protocol/chatstates'
DELAY = 'urn:xmpp:delay'
STANZA_ERROR = 'urn:i... | Python | 1 |
Vertex{ position: [0f32, 0f32, 0f32], normal: [-1f32, 0f32, 0f32] }, Vertex{ position: [0f32, 0f32, 1f32], normal: [-1f32, 0f32, 0f32] }, Vertex{ position: [0f32, 1f32, 1f32], normal: [-1f32, 0f32, 0f32] },
Vertex{ position: [0f32, 0f32, 0f32], normal: [-1f32, 0f32, 0f32] }, Ver... | Rust | 0 |
* other.z),
z: (self.x * other.y) - (self.y * other.x),
}
}
}
/// A wrapper around `Vec3` that guarentees that it is if the contained `Vec3` has
/// had `Vec3::normalize` called on it. This guarentee means the inner `Vec3` either
/// has length one, or zero. Defaults to containing the all zero... | Rust | 0 |
entity from the table
let response = entity_client.get().execute().await?;
println!("response = {:?}\n", response);
let mut entity: MyEntity = response.entity;
entity.city = "Rome".to_owned();
let response = table_client
.insert()
.return_entity(true)
.execute(&entity)
... | Rust | 0 |
stfmt::skip]
pub fn with_repne_cmpsd(address_size: u32) -> Result<Self, IcedError> {
instruction_internal::with_string_segrsi_esrdi(Code::Cmpsd_m32_m32, address_size, Register::None, RepPrefixKind::Repne)
}
/// Creates a `CMPSQ` instruction
///
/// # Errors
///
/// Fails if `address_size` is not one of 16, 32... | Rust | 0 |
, AF_INET, AF_INET6};
use s2n_quic_core::{
inet::{
datagram, AncillaryData, ExplicitCongestionNotification, IpV4Address, IpV6Address,
SocketAddress, SocketAddressV4, SocketAddressV6,
},
io::{rx, tx},
path::{self, Handle as _, LocalAddress, RemoteAddress},
};
#[cfg(any(test, feature = "g... | Rust | 0 |
et=1,
text="white",
)
cell = default_cell_options | (cell or {})
# resolve the text marks
components = []
if cell is not None:
components.append(
text(
data,
x=x_value if orientation == "horizontal" else y_value,
y=y_value ... | Python | 1 |
t_point[1]:
new_right_point = [right_point[0], heigth_point[1]]
if (right_point[0] == heigth_point[0]):
card_img = old_img[int(left_point[1]):int(heigth_point[1]), int(left_point[0]):int(new_right_point[0])]
card_imgs.append(card_img)
continue
pts2 = np.float32([left_point, heigth_point, new... | Python | 1 |
from test.TestBase import TestBase
from ..data import Warp
class TestWarps(TestBase):
def test_warps_connect_ltr(self) -> None:
# 2-way
self.assertTrue(Warp("FAKE_MAP_A:0/FAKE_MAP_B:0").connects_to(Warp("FAKE_MAP_B:0/FAKE_MAP_A:0")))
self.assertTrue(Warp("FAKE_MAP_A:0/FAKE_MAP_B:2").connec... | Python | 1 |
result {
eprintln!("websocket send error: {}", e);
}
}));
users.write().await.insert(my_id, tx);
let users2 = users.clone();
while let Some(result) = user_ws_rx.next().await {
let msg = match result {
Ok(msg) => msg,
Err(e) => {
epr... | Rust | 0 |
y='risk_skoru',
title='Risk Skoru Trendi')
fig1.update_traces(line_color='#3498db')
st.plotly_chart(fig1, use_container_width=True)
# Anormal parametre dağılımı
fig2 = px.histogram(results_df,
... | Python | 1 |
at(dirfd, path, flags)`
#[inline]
pub fn statat<P: path::Arg, Fd: AsRawFd>(
dirfd: &Fd,
path: P,
flags: AtFlags,
) -> io::Result<LibcStat> {
let dirfd = dirfd.as_raw_fd();
let path = path.as_c_str()?;
unsafe { _statat(dirfd, &path, flags) }
}
unsafe fn _statat(dirfd: RawFd, path: &CStr, flags: ... | Rust | 0 |
.map(|ijk| (ijk[0], ijk[1], ijk[2]))
.collect::<Vec<_>>(),
Self::Circular(l) => {
assert!(l.len() >= 3);
let extended_l = l.iter().cycle().take(l.len() + 2).collect::<Vec<_>>();
extended_l
.windows(3)
... | Rust | 0 |
O_Safe_SensorFit
overscan.RO_Safe_SensorSize = -1
def RO_Menu(self, context):
scene = context.scene
overscan = scene.camera_overscan
layout = self.layout
row = layout.row()
active_cam = getattr(scene, "camera", None)
if active_cam and active_cam.type == 'CAMERA':
row.prop(... | Python | 1 |
Label,
_l2: DfsanLabel,
_l3: DfsanLabel,
_l4: DfsanLabel,
) {
let (arglen1, arglen2) = if size == 0 {
unsafe { (libc::strlen(parg1) as usize, libc::strlen(parg2) as usize) }
} else {
(size as usize, size as usize)
};
let lb1 = unsafe { dfsan_read_label(parg1, arglen1) };
... | Rust | 0 |
= w / w_norm;
constraint_dir = Vec2::new(unit_w.y(), -unit_w.x());
u = (combined_radii * inv_dt - w_norm) * unit_w;
} else {
// No collision, find u such as desired_velocity + u brings us out of the neighbor's velocity obstable
// Compute the vector... | Rust | 0 |
import numpy as np
import torch
def apply_sampling(target_bag_size, all_features, all_coords):
attn_mask = None
if target_bag_size > 0:
bag_size = all_features.size(0)
attn_mask = torch.ones(bag_size)
if bag_size < target_bag_size:
sampled_features = torch.cat([all_features,... | Python | 1 |
GarminProduct::Enduro => 3638,
GarminProduct::Swim2Apac => 3639,
GarminProduct::MarqAdventurerAsia => 3648,
GarminProduct::DescentMk2Asia => 3702,
GarminProduct::Venu2 => 3703,
GarminProduct::Venu2s => 3704,
GarminProduct::VenuDaimlerAs... | Rust | 0 |
label.pack(anchor="w", fill=tk.X)
if i == 0:
# 版本号之后插入占位 frame(用于显示更新信息)
update_frame = tk.Frame(text_frame, height=int(24*sf))
update_frame.pack(anchor="w", fill='x')
update_frame.pack_propagate(False) # 固定高度占位
# 后台线程检查更新
def update_info(about_win, ... | Python | 1 |
normalized_exp_logits = normalized_vocab_parallel_logits.exp()
normalized_sum_exp_logits = normalized_exp_logits.sum(axis=-1, keepdim=True)
if tensor_parallel_degree > 1 and tensor_parallel_output:
dist.all_reduce(normalized_sum_exp_logits, group=model_parallel_group)
softmax_logi... | Python | 1 |
value / src2.vt_data.inner.float_value);
Ok(())
} else {
Err(UncheckedException::InvalidBinaryOp { bin_op: '%', lhs: src1, rhs: src2 })
}
}
macro_rules! impl_checked_rel_op {
($fn_name:ident, $op_char:expr, $op:tt) => {
#[inline(never)] pub unsafe fn $fn_name(
src1: Valu... | Rust | 0 |
y(pred_torch["descriptors"][0]),
# rtol=1e-7,
# atol=1e-5,
# )
# np.testing.assert_allclose(
# pred_onnx[2],
# to_numpy(pred_torch["scores"][0]),
# rtol=1e-7,
# atol=5e-5,
# )
# np.testing.assert_allclose(
# pred_onnx[3],
# to_numpy(pred_to... | Python | 1 |
if (!["true"].includes(process.env.JD_Evaluation)) {
console.log("避免自动运行请设置评价环境变量JD_Evaluation为\"true\"来运行本脚本")
return
}
/*
京东评价
参考jd_Evaluation.py
变量 EVAL_IMGS 格式 //img30.360buyimg.com/shaidan/jfs/t1/169124/31/25110/42459/61a586c7Ec6b49656/1549ee98784f868d.jpg
export EVAL_IMGS=‘//img30.360buyimg.com/shaidan/... | Python | 1 |
self.hse
}
}
pub trait GetBusFreq {
fn get_frequency(clocks: &Clocks) -> Hertz;
fn get_timer_frequency(clocks: &Clocks) -> Hertz {
Self::get_frequency(clocks)
}
}
impl GetBusFreq for AHB1 {
fn get_frequency(clocks: &Clocks) -> Hertz {
clocks.hclk
}
}
impl GetBusFreq for A... | Rust | 0 |
}", i)?;
}
write!(f, ")")
}
}
};
}
macro_rules! impl_raw_debug {
($thing:ident) => {
impl ::std::fmt::Debug for $thing {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
for i in self[..].iter().cloned()... | Rust | 0 |
apb2enr.modify(|_, w| w.adc1en().enabled()); // ADC1
// setting GPIOA-4
peripheral.GPIOA.moder.modify(|_, w| w.moder4().analog()); // アナログ設定
config_adc(&peripheral);
config_exti(&peripheral);
// peripheral を グローバル変数にmove(つまり、以降peripheralの操作はグローバル変数使用必須)
cortex_m::interrupt::free(|cs| PERIPHE... | Rust | 0 |
from appium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
import time
# Appium 基本参数
platformName = 'Android'
platformVersion = '6'
deviceName = 'emulator-5554'
drvierserver = 'http://localhost:4725/wd/hub'
noReset = 'True'
timeout = 600
class Automation():
def __init__(self,appPackage... | Python | 1 |
"]
impl crate::ResetValue for super::UART_SWFC_CONF0 {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `UART_XOFF_CHAR`"]
pub type UART_XOFF_CHAR_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `UART_XOFF_CHAR`"]
pub struct UART_XOFF_CHAR_W... | Rust | 0 |
`VK_KHR_wayland_surface`
//! - `VK_KHR_android_surface`
//! - `VK_KHR_win32_surface`
//!
//! For example if you want to create a surface from an Android surface, you will have to enable
//! the `VK_KHR_android_surface` extension and use `Surface::from_anativewindow`.
//! See the documentation of `Surface` for all the ... | Rust | 0 |
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusNumbers
from hydrus.client import ClientGlobals as CG
from hydrus.client.gui.pages import ClientGUIPageManager
from hydrus.client.gui.pages import ClientGUIMediaResultsPanel
class MediaResultsPanelLoading( ClientGUIMediaResultsPanel.MediaResu... | Python | 1 |
total_yes_count: Uint128::new(0),
total_no_count: Uint128::new(0),
total_abstain_count: Uint128::new(0),
total_no_veto_count: Uint128::new(0),
};
for votebox in all_voteboxes {
stats.total_no_veto_count = stats
.total_no_veto_count
.checked_add(v... | Rust | 0 |
), 43);
let point: CppBox<QPoint> = window.pos();
assert_eq!(point.x(), 0);
assert_eq!(point.y(), 0);
window.set_pos(QPoint::new_2a(2, -3).as_ref());
let point: CppBox<QPoint> = window.pos();
assert_eq!(point.x(), 55);
assert_eq!(point.y(), -3);
}
}
#[test]
... | Rust | 0 |
let st = $crate::JanetStruct::builder(LEN)
$(.put($crate::Janet::from($key), $crate::Janet::from($value)))*;
st.finalize()
}};
}
/// Creates a [`JanetTable`] containing the arguments key-value pairs.
///
/// `table!` allows [`JanetTable`]s to be defined with a syntax that have key-value
/... | Rust | 0 |
KeysymAndName { keysym: 0x00000032, name_index: 2 }, /* 2 */
KeysymAndName { keysym: 0x00000033, name_index: 3 }, /* 3 */
KeysymAndName { keysym: 0x00000034, name_index: 34 }, /* 4 */
KeysymAndName { keysym: 0x00000035, name_index: 35 }, /* 5 */
KeysymAndName { keysym: 0x00000036, name_index: 36 }, /* ... | Rust | 0 |
from ..Utilities import *
class MESH:
def __init__(self) -> None:
self.size = 0
self.name = ""
self.face_buffer = []
self.vertex_buffer = {
"positions" : [],
"colors" : [],
"normals" : [],
"texCoords" : []
}
def read(... | Python | 1 |
if let Op::Get(get) = op {
let key = get.key.clone();
let val = get.val.clone();
if considering_transaction.writes(key.clone()) {
let read_froms = self
... | Rust | 0 |
use ushape::*;
use ucol::*;
use usearch::*;
use ubrk::*;
use uregex::*;
use usprep::*;
use uidna::*;
use uspoof::*;
use utmscale::*;
use umachine::*;
use parseerr::*;
use utext::*;
use uversion::*;
use uiter::*;
use uenum::*;
use urep::*;
use udisplaycontext::*;
use uformattable::*;
use umisc::*;
use ufieldpositer::*;
... | Rust | 0 |
_weights)
weights = torch.zeros_like(Atten_weights)
for i in len(Atten_weights):
weights[i] = Atten_weights[i]/torch.sum(Atten_weights[i])
# weights = F.softmax(Atten_weights, dim=-1).data.cpu().numpy()
for i in range (4): # nodes
end = start + n
A = weights[start:end].copy()
edges = sorted(ran... | Python | 1 |
ck::new(map);
let mut map = lock.write().unwrap();
let e1: *mut _ = map.get_mut(k1).unwrap();
let e2: *mut _ = map.get_mut(k2).unwrap();
//std::mem::swap(e1, e2);
unsafe {
ptr::swap(e1, e2);
}
dbg!(&map[k1]);
dbg!(&map[k2]);
let e3 = ... | Rust | 0 |
/// Tracks number of pending pubcomp's (not completed messages of QoS=2).
pending_pubcomp_count: AtomicIsize,
/// Notify on the condition when all requests have completed.
notify_completed: Notify,
}
impl InflightTracking {
fn new() -> Self {
Self {
pending_publish_count: Atom... | Rust | 0 |
0x3E4CCCCD), true);
// Inf <= 0.004 - false
assert_eq!(crate::soft_f32::f32_le(0x7F800000, 0x3B83126F), false);
// -Inf <= 0.004 - true
assert_eq!(crate::soft_f32::f32_le(0xFF800000, 0x3B83126F), true);
// -Inf <= Inf - true
assert_eq!(crate::soft_f32::f32_le(0xFF8000... | Rust | 0 |
== sensor_id), None)
# return None
# def find_sensor_only_by_id(sensor_id):
# users = CatalogReader()["users"]
# for user in users:
# user_houses = user.get("houses", [])
# for house in user_houses:
# sensors = house.get("sensors", [])
# for sensor in sensors:
# ... | Python | 1 |
017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025"]
# Online Stream and Download
STREAM_MODE = bool(environ.get('STREAM_MODE', False)) # Set True or False
# If Stream Mode Is True Then Fill All Required Variable, If False Then Don't Fill.
MULTI_CLIENT = False
SLEEP_THR... | Python | 1 |
the `JsonHttpConnector`. Other `Connector`s are used in a similar way.
//!
//! First we create an instance by calling the `new()` function. The `new()`
//! function takes a `DataSource` and a handle of a `reactor::Core` as
//! parameters.
//!
//! The `DataSource` is a data struct that holds the parameters needed to
//... | Rust | 0 |
{
v.to_owned()
}
#[derive(Copy, Clone)]
struct Kitten {}
impl Kitten {
// badly named method
fn to_vec(self) -> Kitten {
Kitten {}
}
}
impl Borrow<BorrowedKitten> for Kitten {
fn borrow(&self) -> &BorrowedKitten {
static VALUE: BorrowedKitten = BorrowedKitten {};
&VALUE
... | Rust | 0 |
alpha=2, beta=4, mean=0.33, variance=0.04, is_hallucination=True)
# Add edges
G.add_edge(0, 1)
G.add_edge(0, 2)
G.add_edge(1, 3)
G.add_edge(2, 3)
# Test visualization functions
visualize_reasoning_graph(G, "test_graph.png", show_uncertainty=True)
# Test uncerta... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.