text string | label_name string | labels int64 |
|---|---|---|
le(paper.pdf_path)
paper.set_catelogue(titles['titles'])
paper.split_paper_by_titles()
tokens = paper.compute_part_tokens()
print('Beep....Beep....Beep.... I am reading')
reading_prompt = """
You are a researcher helper bot. You can help the user with research paper ... | Python | 1 |
alled.
fn from(waker: task::Waker) -> Self {
WakerToken {
waker: Some(waker),
waker_triggered: false,
}
}
}
<reponame>eduidl/rust-group-theory
use std::fmt::Debug;
use num_bigint::BigInt;
use num_rational::BigRational;
use crate::traits::{AbelianGroup, Field, Group, Gro... | Rust | 0 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/empty.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflec... | Python | 1 |
Because this pallet emits events, it depends on the runtime's definition of an event.
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
}
#[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)]
pub struct Pallet<T>(_);
// The pallet's runtime storage items.
// https://... | Rust | 0 |
= proxy.get_strings(&mut vec.into_iter()).await?;
if res.len() != 2 {
Err(anyhow!("Remote endpoint returned {} values, expected 2", res.len()))
} else {
Ok((res[0].clone(), res[1].clone()))
}
}
async fn get_service_url_from_vbmeta() -> Result<Option<String>, Error> {
let proxy = fuchsi... | Rust | 0 |
abihf"))]
STM32G473RBTx,
#[strum(props(target = "thumbv7em-none-eabihf"))]
STM32G473RCTx,
#[strum(props(target = "thumbv7em-none-eabihf"))]
STM32G473RETx,
#[strum(props(target = "thumbv7em-none-eabihf"))]
STM32G473VBHx,
#[strum(props(target = "thumbv7em-none-eabihf"))]
STM32G473VBIx,... | Rust | 0 |
}
)
elif task_dataset == "CHIP-CDN":
# 答案格式:
# 多个选中的标准化实体,用 , 符号分割
answer_str = gen_output.split("\n")[-1]
answers = answer_str.split(",")
answers = [w.strip() for w in answers if len(w.strip()) >... | Python | 1 |
W|E|R| |4|5|6|D|
|A|S|D|F| |7|8|9|E|
|Z|X|C|V| |A|0|B|F|
+-+-+-+-+ +-+-+-+-+
(The US Layout is a reference. The physical keys are used, not the values they are assigned to)")
.version_short("v")
.arg(
Arg::with_name("ROM")
.help("Filename of the chip8-program")
... | Rust | 0 |
);
assembler.write_vsar(VR::V4, VSARAccumulator::Mid);
assembler.write_vsar(VR::V5, VSARAccumulator::Low);
assembler.write_sqv(VR::V2, E::_0, 0x100, GPR::R0);
assembler.write_sqv(VR::V3, E::_0, 0x110, GPR::R0);
assembler.write_sqv(VR::V4, E::_0, 0x120, GPR::R0);
assembler.write_sqv(VR::V5, E::_... | Rust | 0 |
"Offset of field: ",
stringify!(OrtOpenVINOProviderOptions),
"::",
stringify!(blob_dump_path)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OrtApiBase {
pub GetApi: ::std::option::Option<unsafe extern "C" fn(version: u32) -> *const OrtApi>,
pub GetVe... | Rust | 0 |
pub collateral_asset_id: runtime_types::primitives::currency::CurrencyId,
pub reserved_factor: runtime_types::sp_arithmetic::per_things::Perquintill,
pub collateral_factor: runtime_types::sp_arithmetic::fixed_point::FixedU128,
}
impl ::subxt::Event for NewMarketCreated {
const PALLET: &'static str... | Rust | 0 |
# results/choices.py
from django.db import models
class DataTypeChoices(models.TextChoices):
FLOAT = 'F', 'Real para Romano'
TEXT = 'T', 'Romano para Real'
| Python | 1 |
rue),
pos_weight=-1,
debug=False)),
test_cfg=dict(
rpn=dict(
nms_pre=1000,
max_per_img=1000,
nms=dict(type='nms', iou_threshold=0.7),
min_bbox_size=0),
rcnn=dict(
score_thr=0.0... | Python | 1 |
println!("Building inline cpp");
let start = Instant::now();
cpp_build::Config::new()
.include(submodules.join("tensorflow"))
.include(flatbuffers_include_dir())
.tensorflow_build_setup()
.cpp_link_stdlib(None)
//.flag("-std=c++14")
.build("src/lib.rs");
... | Rust | 0 |
_prep(
root_path=args.root_path,
info_prefix=args.extra_tag,
version=args.version,
out_dir=args.out_dir,
workers=args.workers,
max_sweeps=args.max_sweeps,
)
elif args.dataset == "scannet":
scannet_data_prep(
root_pat... | Python | 1 |
Save current state data to a file.
"""
data = {
'system_stats': c.system_stats,
'disk_farms': c.disk_farms,
'reward_count': c.reward_count,
'farm_rewards': c.farm_rewards,
'farm_recent_rewards': c.farm_recent_rewards,
'farm_skips': c.farm_skips,
'farm_r... | Python | 1 |
expert_trajs=expert_trajs,
expert_policy=expert_policy,
custom_logger=custom_logger,
bc_trainer=bc_trainer,
beta_schedule=dagger["beta_schedule"],
rng=_rnd,
)
dagger_trainer.train(
total_timesteps=int(dagger["total_timeste... | Python | 1 |
padded.shape
max_k = np.max(n_categories)
#max_thresholds = max_k - 1 # 最大阈值数
# 维度重塑以利用广播机制
dot_product = theta@a.T # (num_total_theta, num_items)
logits = dot_product.reshape(num_total_theta, num_items, 1) + d_padded.reshape(1, num_items, -1)#(num_total_theta, num_items, max_thresholds)
logit... | Python | 1 |
mod util;
mod decomp {
pub mod cholesky;
pub mod eigen;
pub mod lu;
pub mod qr;
pub mod svd;
}
//pub mod eig {
// pub mod powermethod;
//}
<reponame>hashmismatch/finny.rs<gh_stars>10-100
#![cfg_attr(not(feature = "std"), no_std)]
//! # Finny - Finite State Machines for Rust
//!
//!  as f:
lines = f.readlines()
for id_, line in enumerate(lines):
field_values = re.split(r"\t", line.strip())
... | Python | 1 |
mut x: scaled_t, mut n: i32, mut d: i32) -> scaled_t {
let mut positive: bool = false;
let mut t: i32 = 0;
let mut u: i32 = 0;
let mut v: i32 = 0;
if x >= 0i32 {
positive = true
} else {
x = -x;
positive = false
}
t = (x as i64 % 32768 * n as i64) as i32;
u = ... | Rust | 0 |
/// - Cargo.toml
/// - turnstile/
/// - ...
/// - Cargo.toml
/// - ...
/// - Cargo.toml
/// ```
///
/// *Code*
///
/// ```rust,ignore
/// client.deploy_program(program_keypair(0), "awesome_contract");
/// client.deploy_program(program_keypair(1), "turnstile"... | Rust | 0 |
[doc = " @return style pointer to a style"]
pub fn lv_ddlist_get_style(
ddlist: *const lv_obj_t,
type_: lv_ddlist_style_t,
) -> *const lv_style_t;
}
extern "C" {
#[doc = " Get the alignment of the labels in a drop down list"]
#[doc = " @param ddlist pointer to a drop down list object"]
... | Rust | 0 |
ils;
use sha2::{Digest,Sha256};
use wasm_bindgen::prelude::*;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
// :: ------------------------------------------------... | Rust | 0 |
n ('0.0.0.0', '::'):
import socket
host = socket.gethostname()
expected = ('%s://%s%s%s/this/new/page'
% (self.scheme, host, port, sn))
self.getPage(sn + '/pageurl')
self.assertBody(expected)
# Test trailing slash (see
... | Python | 1 |
ref() }.unwrap();
let mut rsig = std::ptr::null_mut() as *mut ID3D12RootSignature;
let hr = unsafe {
device.CreateRootSignature(
0,
blob.GetBufferPointer(),
blob.GetBufferSize(),
&ID3D12RootSignature:... | Rust | 0 |
parameters(), 'lr': 0.01}
])
scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=config.step_size, gamma=config.gamma)
criterionCE = nn.CrossEntropyLoss()
criterionCon = SupConLoss(temperature=config.temperature)
# setup trainer
Trainer = Trainer(model, awl, criterionCE, criterionC... | Python | 1 |
.5, 2), 'o' as usize); // The second in "tobeo" should be "o"
/// assert_eq!(wm.quantile(0..5, 3), 'o' as usize); // The third in "tobeo" should be "o"
/// assert_eq!(wm.quantile(0..5, 4), 't' as usize); // The fourth in "tobeo" should be "t"
/// ```
#[inline]
pub fn quantile(&self, range: Range<usi... | Rust | 0 |
type Output = Self;
#[inline]
fn mul(self, rhs: Self) -> Self::Output {
Self(QuadraticOps::mul(self.0, rhs.0, &-T::one()))
}
}
impl<T: Integer + Signed + NumRef> Div for GaussianInt<T>
where
for<'r> &'r T: RefNum<T>,
{
type Output = Self;
#[i... | Rust | 0 |
log_device_memory(device=trainer_device, tag="After block sync")
# Possibly checkpoint after N mini-batches
if checkpoint_every_n_batches and (total_batches_processed % checkpoint_every_n_batches == 0):
maybe_save_checkpoint(epoch, batch_idx)
logger.info(f... | Python | 1 |
istItems().insert(
part='snippet',
body=body
).execute()
print("added a song!")
DEVELOPER_KEY = os.getenv('DEVELOPER_KEY')
YOUTUBE_API_SERVICE_NAME = 'youtube'
YOUTUBE_API_VERSION = 'v3'
def youtube_search(songNameandArtistName):
youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION,
de... | Python | 1 |
{
unsafe extern "C" fn teardown_trampoline<
F: Fn(&SignalListItemFactory, &ListItem) + 'static,
>(
this: *mut gtk_sys::GtkSignalListItemFactory,
listitem: *mut gtk_sys::GtkListItem,
f: glib_sys::gpointer,
) {
let f: &F = &*(f as *const... | Rust | 0 |
lled_once_with(
query=QuerySpec()
)
rdns_service_mock.delete_many.assert_called_once_with(
query=QuerySpec()
)
neighbours_service_mock.delete_many.assert_not_called()
async def test_clear_neighours(
self,
mdns_service_mock: Mock,
rdns_... | Python | 1 |
o, None)
.expect("Failed to create Texture Image!")
};
let image_memory_requirement = unsafe { device.get_image_memory_requirements(texture_image) };
let memory_allocate_info = vk::MemoryAllocateInfo {
s_type: vk::StructureType::MEMORY_ALLOCATE_INFO,
p_next: ptr::null(),
... | Rust | 0 |
type ScoreType = ResultType::ScoreType;
fn new() -> Self
{
DisplayProgress(ResultType::new())
}
fn best(&self) -> (Formula<State>, f64)
{
self.0.best()
}
/// update the result and displays a message if we improved on the best value so far
fn update(&mut self, formula: Formula<Stat... | Rust | 0 |
ecision ###")
st.image("urbanevo_streamlit/static/prec_yy5.png")
with col222:
st.markdown("### Recall ###")
st.image("urbanevo_streamlit/static/recall_yy5.png")
with col333:
st.markdown("### F1-Score ###")
st.image("urbanevo_streamlit/static/f1... | Python | 1 |
3, 5, 6, 9],
vec![1, 3, 4, 5, 6, 7, 8, 9],
vec![1, 5, 7, 9],
vec![1],
vec![8, 9],
vec![0, 11],
];
for domain in domains.into_iter() {
let exp_size = domain.len();
let var = IntVar::new_from_iterator(domain.into_iter()).... | Rust | 0 |
"darmani": "goron graveyard mask",
"goron race": "goron race reward",
"mikau": "great bay coast zora mask",
"seahorses": "pinnacle rock hp",
"beavers": "waterfall rapids beaver race 1",
"fisherman": "great bay coast fisherman hp",
"dampe": "beneath the graveyard dampe chest",
"pamela": "m... | Python | 1 |
C")),
Reaction::new(
vec![Term::new(3, "A"), Term::new(4, "B")],
Term::new(1, "AB"),
),
Reaction::new(
vec![Term::new(5, "B"), Term::new(7, "C")],
Term::new(1, "BC"),
),
Reaction::new(
... | Rust | 0 |
-------------')
e_tot = run_dft('B3LYP', mol_cart)
e_ref = -76.46723795965626 # data from PySCF
print(f'diff from PySCF {e_tot - e_ref}')
assert np.abs(e_tot - e_ref) < 1e-5
def test_rks_wb97m_d3bj(self):
print('-------- wB97m-d3bj -------------')
e_tot = run_dft('w... | Python | 1 |
itial value of 0xFFFFFFFF - all bits are set
input.iter().fold(0xFFFFFFFFu32,
| acc, &item | {
// Generate an index based on the low bits of our current
// CRC XOR'd with current item in our array
let index = (acc & 0xFF) ^ (item as u32);
// Right shift the crc by 8 bits and XOR it with the ... | Rust | 0 |
import numpy as np
import pandas as pd
from scipy import stats
from sklearn.metrics import roc_auc_score, roc_curve
def two_way_chi_square_test(data, categorical_feat_x, categorical_feat_y):
observed = pd.crosstab(data[categorical_feat_x], data[categorical_feat_y])
chi_s = stats.chi2_contingency(observed)
... | Python | 1 |
fig,
);
match bg_fill_mode {
Some(BgFillMethod::TryAnsiSequence) => {
Painter::right_fill_background_color(panel_line, fill_style)
}
Some(BgFillMethod::Spaces) if text_width >= panel_width => (),
Some(BgFillMethod::Spaces) => panel_line.push_str(
&fill_st... | Rust | 0 |
# print(texture_mask.size())
mask_renderer = NeuralRenderer(608)
faces_var = torch.autograd.Variable(torch.from_numpy(faces[None, :, :]).cuda(device=0))
vertices_var = torch.from_numpy(vertices[None, :, :]).cuda(device=0)
# Textures
texture_size = 2
textures = np.ones((1, faces.shape[0], textu... | Python | 1 |
_to_hex_str<'a>(
it: impl Iterator<Item = &'a u8>,
start: usize,
len: usize,
buf: &'a mut [u8],
) -> &'a [u8] {
const LUT: [u8; 16] = *b"0123456789abcdef";
buf[0] = b'0';
// Same small lookup table is ~25% faster than hex::encode_from_slice 🤷
it.enumerate().for_each(|(i, &b)| {
... | Rust | 0 |
# -*- coding: utf-8 -*-
'''Estimation of the reciprocal of the condition number using the 1-norm.'''
from __future__ import print_function
__author__= "Luis C. Pérez Tato (LCPT)"
__copyright__= "Copyright 2014, LCPT"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@gmail.com"
import xc
import numpy as n... | Python | 1 |
: Arc<AtomicU32>,
pub udp_max_active_connections: u32,
pub tcp_max_active_connections: u32,
pub udp_active_connections: Arc<Mutex<VecDeque<oneshot::Sender<()>>>>,
pub tcp_active_connections: Arc<Mutex<VecDeque<oneshot::Sender<()>>>>,
pub key_cache_capacity: usize,
pub hasher: SipHasher13,
pu... | Rust | 0 |
# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# 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 applicabl... | Python | 1 |
}
/// Versioned FarmSeed, used for lazy upgrade.
/// Which means this structure would upgrade automatically when used.
/// To achieve that, each time the new version comes in,
/// each function of this enum should be carefully re-code!
#[derive(BorshSerialize, BorshDeserialize)]
pub enum VersionedFarmSeed {
V101... | Rust | 0 |
1e_sgr_x_by_x: AlignedArray<[u8; 256]> = AlignedArray::new([
255, 128, 85, 64, 51, 43, 37, 32, 28, 26, 23, 21, 20, 18, 17,
16, 15, 14, 13, 13, 12, 12, 11, 11, 10, 10, 9, 9, 9, 9,
8, 8, 8, 8, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6,
6, 5, 5, 5, 5, ... | Rust | 0 |
in vec.iter() {
print!("[{}] \t", byte);
mut_in_line += 1;
if mut_in_line == per_line {
println!();
mut_in_line = 0;
}
}
mut_in_line
}
// Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in ... | Rust | 0 |
nst IN_JUMP = 1 << 1;
const IN_DUCK = 1 << 2;
const IN_FORWARD = 1 << 3;
const IN_BACK = 1 << 4;
const IN_USE = 1 << 5;
const IN_CANCEL = 1 << 6;
const IN_LEFT = 1 << 7;
const IN_RIGHT = 1 << 8;
const IN_MOVE_LEFT = 1 << 9;
const IN_MOVE_RIGHT = 1 ... | Rust | 0 |
l 2
// # pushed stack: (next_pid, output)
// # returned from call: sum
// # full stack: (sum, next_pid, output)
// # returns: sent
// sent = send(next_pid, sum)
// output.("send #{sent} to #{next_pid}")
// ```
label_2::place... | Rust | 0 |
#!/usr/bin/env python3
# pylint: disable=missing-class-docstring,no-self-use,line-too-long
from __future__ import annotations
import unittest
import angr
class TestUnlink(unittest.TestCase):
def test_file_unlink(self):
# Initialize a blank state with an arbitrary errno location
state = angr.SimS... | Python | 1 |
from __future__ import annotations
from pathlib import Path
from aws_cdk import CfnOutput, Duration, RemovalPolicy
from aws_cdk import aws_s3 as s3
from aws_cdk import aws_s3_deployment as s3deploy
from tests.e2e.utils.infrastructure import BaseInfrastructure
class StreamingStack(BaseInfrastructure):
def creat... | Python | 1 |
pub const BACKEND_HISTORY_TRANSACTION_LIST_PAGE: &str =
include_str!("transactions/backend_history_transaction_list_page.json");
pub const BACKEND_QUEUED_TRANSACTION_LIST_PAGE_NO_CONFLICTS: &str =
include_str!("transactions/backend_queued_transaction_list_page_no_conflicts.json");
pub const BACKEND_QUEUED_TRAN... | Rust | 0 |
ts
// Macros
// See the following post from kaj, on the Rust user foruns.
// https://users.rust-lang.org/t/3-things-that-the-rust-standard-library-should-have/68825/9
//
// Macro visibility rules.
// https://users.rust-lang.org/t/3-things-that-the-rust-standard-library-should-have/68825/11
//
macro_rules! graph {
... | Rust | 0 |
import socket
HOST = ""
PORT = 0
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.settimeout(0.3)
def recv_data():
buffer = b""
while True:
try:
received = s.recv(1)
except TimeoutError:
return buffer.decode(), True
... | Python | 1 |
from abc import ABC, abstractmethod
import torch.optim.lr_scheduler as L
class AbsScheduler(ABC):
@abstractmethod
def step(self, epoch: int = None):
pass
@abstractmethod
def state_dict(self):
pass
@abstractmethod
def load_state_dict(self, state):
pass
# If you need... | Python | 1 |
k_ver_ios:
:param min_lk_ver_pc:
:return:
:rtype: APIAppLink
指定 AppLink 协议能够兼容的最小飞书版本,使用三位版本号 x.y.z。
如果当前飞书版本号小于min_lk_ver,打开该 AppLink 会显示为兼容页面。
也可使用 min_lk_ver_android、min_lk_ver_ios、min_lk_ver_pc 参数对不同的客户端指定不同的版本。
"""
qs = [
('min_lk_ver',... | Python | 1 |
nonical solution.
Returns:
dict: The success metrics.
"""
n = len(responses)
if not n:
return {
"expected_success": 0,
"success": False,
"success_vote": 0,
"voted_answer": None,
"votes": 0,
}
success_list = []
i... | Python | 1 |
pub struct Response {
#[serde(with = "super::protocol::format")]
_format: (),
#[serde(rename = "accessToken")]
pub access_token: String,
pub user: String,
}
pub fn fetch_session<C: 'static + hyper::client::connect::Connect>(
client: &hyper::Client<C, hyper::Body>,
client_identifier: &str,
... | Rust | 0 |
D: u32 = 64u32;
#[repr(C, packed(1))]
#[doc = "*Required features: 'Win32_Media_Audio'*"]
pub struct MIDIEVENT {
pub dwDeltaTime: u32,
pub dwStreamID: u32,
pub dwEvent: u32,
pub dwParms: [u32; 1],
}
impl ::core::marker::Copy for MIDIEVENT {}
impl ::core::clone::Clone for MIDIEVENT {
fn clone(&self) ... | Rust | 0 |
te syntax;
// Unused: #[macro_use]
extern crate matches;
extern crate serde;
extern crate serde_yaml;
#[macro_use]
extern crate smallvec;
extern crate c2rust_xcheck_config as xcfg;
use rustc_plugin::Registry;
use std::borrow::Cow;
use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::fs;
use ... | Rust | 0 |
().into(),
Default::default(),
Default::default(),
&[],
))
.await
.unwrap();
// Send NUM_MSGS messages from node 1 to node 2
for i in 0..NUM_MSGS {
let outbound_msg = OutboundMessage::new(
node_identity2.node_id().clone(),
... | Rust | 0 |
# Plot and format
for c in range(10):
self.axes[c].plot(ap_waveforms[c])
self.axes[c].set_title(f"Class {c}", fontsize=9, pad=2)
self.axes[c].set_ylabel("") # Remove individual labels for cleanliness
# Shared y-label in the center of figure
# self.figur... | Python | 1 |
/// // must be equivalent to
/// # ==
///
/// foo.func_map_over::<TypeParam<M>, _>(g)
/// .func_map_over::<TypeParam<N>, _>(f)
/// # );
/// ```
pub trait FuncMap<A, B, P = TypeParam<0>>: Sized
where
P: FuncMarker<P>,
{
/// The output type of the functorial mapping
///
/// This is `Self`... | Rust | 0 |
key_pressed(Key::Enter) {
match candidates.iter().find(|candidate| {
candidate.name == *candidate_search_term
|| candidate
.installation_instruction
.ends_with(cand... | Rust | 0 |
# coding=utf-8
import jwt, uuid
import oneid_auth.constant
from . import constant
from datetime import UTC, datetime
from calendar import timegm
from urllib.parse import urlparse, urlencode, urlunparse
from cryptography.hazmat.primitives.serialization import load_pem_private_key
class UserInfo:
"""
用户信息
... | Python | 1 |
s u32) << OFFSET;
self.w
}
}
# [ doc = "Values that can be written to the field `CAP1_F`" ]
pub enum CAP1_FW {
# [ doc = "Disabled. This feature is disabled." ]
DISABLED_THIS_FEATU,
# [ doc = "Falling edge. A synchronously sampled falling edge on PWMn_CAP1 will ca... | Rust | 0 |
deps, env, info, amount),
}
}
fn receive_cw20(
deps: DepsMut,
env: Env,
info: MessageInfo,
msg: Cw20ReceiveMsg,
) -> StdResult<Response> {
match from_binary(&msg.msg) {
Ok(Cw20HookMsg::Stake {}) => stake(
deps,
env,
info,
msg.sender,
... | Rust | 0 |
S, Fut, I: 'static, E> Stream for WeightLimitedBufferedTryStream<S, I, E>
where
S: Stream<Item = Result<(Fut, u64), E>>,
Fut: Future<Output = Result<I, E>> + Send + 'static,
E: Send + 'static,
I: Send,
{
type Item = Result<I, E>;
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<... | Rust | 0 |
)")
.unwrap();
for tracked_time in self.tracked_times.iter() {
stmt.execute(params![
tracked_time.duration.num_seconds(),
tracked_time.description
])
.unwrap();
}
}
}
use sdl2::rect::Rect;
use crate::game::{WINDOW_WIDTH,... | Rust | 0 |
(self, value: bool) -> &'a mut W {
const MASK: bool = true;
const OFFSET: u8 = 9;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `REGION42`"]
pub enum REGION42W {
#[d... | Rust | 0 |
{
cpu.pc += 2;
}
} else if let 0x6000 = code {
debug_log!("6XNN V{} = {}", (opcode & 0x0F00) >> 8, opcode & 0x00FF);
let x = ((opcode & 0x0F00) >> 8) as usize;
cpu.V[x] = (opcode & 0x00FF) as u8;
cpu.pc += 2;
} else if let 0x7000 = code {
debug_log!("... | Rust | 0 |
}
Mutex::new(app_config)
}
Err(error) => {
error!("Error while creating AppConfig from TOML configuration file. {}", error);
std::process::exit(1);
}
}
});
fn test_configuration_file() {
/*
Challenge: We need to load the TOML c... | Rust | 0 |
Result<(http::Request<Vec<u8>>, fn(http::StatusCode) -> k8s_openapi::ResponseBody<GetRouteOpenshiftIoV1APIResourcesResponse>), k8s_openapi::RequestError> {
let __url = "/apis/route.openshift.io/v1/".to_owned();
let __request = http::Request::get(__url);
let __body = vec![];
match __request.body(__body... | Rust | 0 |
else {
println!("RPC SUCCEEDED: {}", String::from_utf8_lossy(&res.data));
}
}
Err(e) => {
println!("RPC FAILED: {}", e);
}
}
tokio::time::delay_until(Instant::now() + Duration::from_secs(1)).await;
}
}
fn init... | Rust | 0 |
()
.map_err(|e| match e.kind() {
Kind::Status(StatusCode::NOT_FOUND) => {
error::download_mod_not_found(game_id, mod_id)
}
_ => e,
})
.await?;
let (file, error) = match (list.... | Rust | 0 |
# response = S3_CLIENT.list_buckets()
# _logger.info(f"R2_INIT_SUCCESS: Successfully listed R2 buckets: {[b['Name'] for b in response.get('Buckets', [])]}")
# except Exception as e_list_buckets:
# _logger.warning(f"R2_INIT_WARN:... | Python | 1 |
from sqlalchemy import select
from sqlalchemy.orm import joinedload
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.ext.asyncio import AsyncSession
from fastapi import Query
from schemas import EnrolmentExamCreate, EnrolmentExamResponse
from crud import create_enrolment_exam, get_exam_by_id, get_e... | Python | 1 |
d::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _RuneRange {
pub __nranges: ::std::os::raw::c_int,
pub __ranges: *mut _RuneEntry,
}
impl Default for _RuneRange {
fn default() -> Self {
let mut s = ::std::mem... | Rust | 0 |
obs: &E::Obs) {
self.prev_obs.replace(Some(obs.clone()));
}
/// Update model parameters.
///
/// When the return value is `Some(Record)`, it includes:
/// * `loss_critic`: Loss of critic
/// * `loss_actor`: Loss of actor
fn observe(&mut self, step: Step<E>) -> Option<Record> {
... | Rust | 0 |
ir::{
color::{Decorated, LayerData},
cursor::{ArcCurve, Assembler, CellCursor},
draw::{curve::groups::Group, CircularArc, Resolution},
units::{AbsoluteLength, Angle},
zero, MICROMETER,
};
mod common;
#[test]
fn pulley() {
common::init();
#[allow(non_snake_case)]
let RING_WIDTH: [Absolu... | Rust | 0 |
"""
Compare Aircraft Airspeeds
--------------------------
Compare Aircraft Airspeeds via the DistributionDisplay
Scatter Plot
Written: Joe O'Brien
"""
from arm_test_data import DATASETS
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats.mstats import pearsonr
import act
from act.io.icartt import r... | Python | 1 |
-> Result<()> {
try!(validate_date(&Some(*self), &quandl_request.end_date));
quandl_request.start_date = Some(*self);
Ok(())
}
fn set_end_date(&self, quandl_request: &mut QuandlRequest) -> Result<()> {
try!(validate_date(&quandl_request.start_date, &Some(*self)));
quandl... | Rust | 0 |
("Card", 2)?;
// s.serialize_field("number", &self.number)?;
// s.serialize_field("suit", &self.suit)?;
// //s.serialize_field("num", &self.num)?;
// s.end()
// }
// }
use {
super::{
context::{BlendContext, FilterContext},
evaluate::evaluate,
},
crate::{
... | Rust | 0 |
includes:
if mod[-2:] == '.*':
mf.import_hook(mod[:-2], None, ['*'])
else:
mf.import_hook(mod)
for f in packages:
# If modulegraph has seen a reference to the package, then
# we prefer to believe that (imp_find_module doesn't seem to locate
# sub-pac... | Python | 1 |
Returns:
list[LyricInfo]: 歌曲歌词
"""
if not self.inited:
self.init()
return self.timeout_retry(self.cloud_apis[song_info.source].get_lyricslist, song_info)
def get_lyrics(self, info: SongInfo | LyricInfo | None = None, path: Path | None = None, data: str | bytearr... | Python | 1 |
from langchain_community.utilities.portkey import Portkey
__all__ = ["Portkey"]
| Python | 1 |
uct InnerItem;);
//! ```
//!
//! This works fine for bang macros, but is not so good for attribute or derive macros. So this
//! crate provides the attribute and derive macros `#[inline_attr]` and `InlineDerive`; they can be
//! used like this:
//!
//! ```
//! # use inline_proc::inline_proc;
//! # #[inline_proc]
//! # ... | Rust | 0 |
turn
dns_label = self._get_dns_label_for_interface(interface, node)
domain = await self.domain_service.get_domain_for_node(node)
if sip.ip:
await self.dnsresource_service.add_ip(sip, dns_label, domain)
await self.dnspublication_service.create_for_config_update(
... | Python | 1 |
A: SignalVec,
F: FnMut(&[A::Item]) -> B {
type Item = B;
fn poll_change(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
let ToSignalMapProj { mut signal, first, values, callback } = self.project();
let mut changed = false;
let done = loop {
... | Rust | 0 |
(&self) -> &::models::EncodedHash {
&self.id
}
pub fn set_ttl(&mut self, ttl: i64) {
self.ttl = ttl;
}
pub fn with_ttl(mut self, ttl: i64) -> NameEntry {
self.ttl = ttl;
self
}
pub fn ttl(&self) -> &i64 {
&self.ttl
}
pub fn set_pointers(&mut self, pointers: Vec<::models::NamePo... | Rust | 0 |
RangeInner<'a>>);
#[derive(Debug, Default)]
pub struct DateRangeInner<'a> {
format: Option<&'a str>,
ranges: Vec<DateRangeInst<'a>>,
}
impl<'a> DateRange<'a> {
add_extra_option!(with_format, format, &'a str);
pub fn with_ranges<A: Into<Vec<DateRangeInst<'a>>>>(mut self, ranges: A) -> Self {
s... | Rust | 0 |
Mov,
Str,
Ldr,
LdrSW,
Add,
Sub,
Mul,
SDiv,
MSub,
And,
Orr,
Eor,
Lsl,
Lsr,
Cmp,
B,
Beq, Bne,
Bl, Ble,
Bg, Bge,
Call,
Ret,
Svc
}
#[derive(Clone, PartialEq)]
#[allow(dead_code)]
pub enum Arm64Arg {
... | Rust | 0 |
NSFORMERS_VERSION) < Version("4.49.0"),
reason="Qwen2.5-VL require transformers version no lower than 4.49.0",
)
def test_qwen25vl_lora(qwen25vl_lora_files):
"""Test Qwen 2.5 VL model with LoRA"""
config = TestConfig(model_path=QWEN25VL_MODEL_PATH,
lora_path=qwen25vl_lora_files)
... | Python | 1 |
u64);
}
pub fn subtract_stats(group_stats: &EventFileGroupStats) {
let stats = STATS.lock().unwrap();
stats.total_bytes.subtract(group_stats.size);
stats.total_files.subtract(group_stats.file_count as u64);
}
pub fn set_current_group(name: &Path, stats: &EventFileGroupStats) {
{
let mut curre... | Rust | 0 |
fn read_response(dir_name: &str, file_name: &str) -> String;
}
pub struct MockResponseReader;
impl ReadMockResponse for MockResponseReader {
fn read_response(dir_name: &str, response_name: &str) -> String {
let file_name = format!("{}/{}", dir_name, response_name);
let mut input_file = File::o... | Rust | 0 |
: types::EGLenum = 0x3003;
#[allow(dead_code, non_upper_case_globals)] pub const BAD_ATTRIBUTE: types::EGLenum = 0x3004;
#[allow(dead_code, non_upper_case_globals)] pub const BAD_CONFIG: types::EGLenum = 0x3005;
#[allow(dead_code, non_upper_case_globals)] pub const BAD_CONTEXT: types::EGLenum = 0x3006;
#[allow(dead_cod... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.