text string | label_name string | labels int64 |
|---|---|---|
#!/usr/bin/python3
from add_0 import add
if __name__ == "__main__":
a = 1
b = 2
print('{:d} + {:d} = {:d}'.format(a, b, add(a, b)))
| Python | 1 |
../../tests/examples/test_proj/test_proj.yyp");
let parse_yyp: Yyp =
serde_json::from_str(&TrailingCommaUtility::clear_trailing_comma_once(yyp)).unwrap();
let no_mangled_yyp = parse_yyp.yyp_serialization(0);
assert_eq!(yyp, no_mangled_yyp);
}
}
<gh_stars>1-10
use std::vec::Vec;... | Rust | 0 |
class Solution:
def numRollsToTarget(self, n: int, k: int, target: int) -> int:
kMod = 1_000_000_007
dp = [1] + [0] * target
for _ in range(n): # N dices
newDp = [0] * (target + 1)
for i in range(1, k + 1): # Number 1, 2, ..., f
for t in range(i, target + 1): # Possible targets
... | Python | 1 |
yield ['Id'] + features_all # yield header
if train == True:
ds = 'train'
else:
ds = 'test'
directory_names = list(set(glob.glob(os.path.join(ds, "*.asm"))))
for f in directory_names:
f_id = f.split('/')[-1].split('.')[0]
if verbose == True:
print 'doing %s'%f... | Python | 1 |
a, rescale):
"""Inference with slide/whole style.
Args:
img (Tensor): The input image of shape (N, 3, H, W).
img_meta (dict): Image info dict where each dict has: 'img_shape',
'scale_factor', 'flip', and may also contain
'filename', 'ori_shape', '... | Python | 1 |
th ] )
if result is not None:
yield result
if overlapping:
last = pos + 1
else:
last = pos + length
pos, length = find(buffer, last)
@classmethod
def e... | Python | 1 |
_SPEC>`"]
pub type WDT_SR = crate::Reg<wdt_sr::WDT_SR_SPEC>;
#[doc = "Status Register"]
pub mod wdt_sr;
extern crate term_cursor as cursor;
fn main() {
print!("{}", cursor::Clear);
print!("{}Circle ->{}Rectangle ->", cursor::Goto(15, 6), cursor::Right(13));
filled_rectangle((50, 3), (8, 8));
circle((3... | Rust | 0 |
#[cfg(target_arch = "x86_64")]
pci_config_io: None,
allocator,
start_of_device_area,
end_of_device_area,
pci_irq_slots: *pci_irq_slots,
};
info!(
"Adding PCI segment: id={}, PCI MMIO config address: 0x{:x}, device area ... | Rust | 0 |
onment::is_appveyor() {
return;
}
let _lock = THROTTLE_MUTEX.lock().unwrap();
if let Some((id, client)) = OAuthTestClient::ClientCredentials.graph() {
let result = client
.v1()
.user(id.as_str())
.mail_folder("drafts")
.get_mail_folders()
... | Rust | 0 |
class Solution(object):
def addNegabinary(self, arr1, arr2):
"""
:type arr1: List[int]
:type arr2: List[int]
:rtype: List[int]
"""
m, n = len(arr1) - 1, len(arr2) - 1
if m < n:
return self.addNegabinary(arr2, arr1)
temp, res = 0, 0
... | Python | 1 |
ndex.cs.verify(&witness_cols, &[]).unwrap();
//
let prev = {
let k = ceil_log2(index.srs.g.len());
let chals: Vec<_> = (0..k).map(|_| Fp::rand(rng)).collect();
let comm = {
let coeffs = b_poly_coefficients(&chals);
let b = DensePolynom... | Rust | 0 |
job}, **kwargs)
returnD(tot)
@inlineCallbacks
def clean_queue(self, corpus, specs, **kwargs):
if type(specs) == list:
specs = {"_id": {"$in": [ObjectId(_i) for _i in specs]}}
elif type(specs) in [str, unicode, bytes]:
specs = {"_id": ObjectId(specs)}
yiel... | Python | 1 |
);
// Make sure `MyPark` and `MyUnpark` were dropped during shutdown.
assert_eq!(park_rx.try_recv(), Err(mpsc::TryRecvError::Disconnected));
assert_eq!(unpark_rx.try_recv(), Err(mpsc::TryRecvError::Disconnected));
// If the future is forcefully dropped, then we will get a signal here.
drop_rx.recv... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time 2024/10/14 11:28
# @Author will
# @File project_contract.py
# @Brief
from sqlalchemy import Column, PrimaryKeyConstraint, func, text
from sqlalchemy.dialects.postgresql import BIGINT, BOOLEAN, BYTEA, INTEGER, TIMESTAMP, VARCHAR
from common.models import HemeraMo... | Python | 1 |
import sqlite3
from typing import Union
from utils import Database
class GuildSettings:
def __init__(self,
guild_id: int,
client_role: Union[int, None],
buyer_role: Union[int, None],
admin_role: Union[int, None],
verify_role: Un... | Python | 1 |
atch val {
Ok(()) => {},
Err(e) => {
error!("Disconnected! {:?}\nBlocking computation until connection is recovered...", e);
let clone = self.current_job.clone();
let mut guard = clone.loc... | Rust | 0 |
from fastapi import APIRouter, HTTPException
from services.caption_services.caption_service import get_caption_for_image
# Create a dedicated router for image captioning
caption_router = APIRouter()
@caption_router.get("/get-caption")
async def generate_caption(image_url: str):
"""
Generate or retrieve a capt... | Python | 1 |
0]
dy = index_finger_coords[1] - prev_index_finger[1]
dist = hypot(dx, dy)
dt = current_time - prev_time
velocity = dist / (dt * 1000) if dt > 0 else 0 # pixels/ms
# Detect swipe gesture: fingers apart, fast movement, and cooldown
... | Python | 1 |
import pandas as pd
from .utils_llm import LanguageFunction
import os
import inspect
UTILS_DIR = os.path.dirname(inspect.getabsfile(inspect.currentframe()))
def extract_test_cases(dataset: pd.DataFrame, lang: str) -> pd.DataFrame:
"""
Add test cases to the dataset
Adds columns: 'test_cases' (List[str])
... | Python | 1 |
Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.retranslateUi(OnStartDialogWindow)
self.buttonBox.accepted.connect(OnStartDialogWindow.accept)
self.buttonBox.rejected.connect(OnStartDialogWindow.reject)
QtCore.QMetaObject.connectSlotsByName(O... | Python | 1 |
RANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHER... | Rust | 0 |
import warnings
warnings.filterwarnings("ignore")
from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
# 指定本地模型的路径
local_model_path = "C:\\Users\\15711\\.cache\\huggingface\\hub\\models--ahmedrachidFinancialBERT-Sentiment-Analysis"
# 加载分词器
tokenizer = AutoTokenizer.from_pretrained(loc... | Python | 1 |
# land_drags_scratch -> smash_values_fronts'
'# land_drags_scratch -> smash_values_fronts'
return
from c94bbcmr2a8 import njiwxnsfoel, b202ac4kluj as wyti_s3lnsz, atlv5jjpc9k as v1beewzcynl, mrfr4h95p9x, nphlv73zlrv, c9k5kmapk6v as cszgkzqi1hq, su8riplwvyk, ouv5xr552vb as lpxpgv715x0
@[nku_dm4j5gt, fyg61alo... | Python | 1 |
17471, 17477, 17483, 17489, 17491,
17497, 17509, 17519, 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599,
17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683, 17707, 17713, 17729,
17737, 17747, 17749, 17761, 17783, 17789, 17791, 17807, 17827, 17837, 17839,
17851, 17863 ];
/// Perform test bas... | Rust | 0 |
8_NBYTES_MLOFFNO =
crate::Reg<dma_tcd8_nbytes_mloffno::DMA_TCD8_NBYTES_MLOFFNO_SPEC>;
#[doc = "TCD Signed Minor Loop Offset (Minor Loop Mapping Enabled and Offset Disabled)"]
pub mod dma_tcd8_nbytes_mloffno;
#[doc = "DMA_TCD8_NBYTES_MLOFFYES register accessor: an alias for `Reg<DMA_TCD8_NBYTES_MLOFFYES_SPEC>`"]
pub... | Rust | 0 |
.len() {
data[i] = s[i];
}
0
}
Err(r) => translate_error(r),
}
}
#[no_mangle]
pub extern "C" fn real_statistics_split_prec32(vector: &VecBuf,
data: *mut Statistics<f64>,
... | Rust | 0 |
max: Option<u32>,
action: ActionExpr,
source_origin: SourceOrigin,
},
PrecedencedRule {
lhs: SymbolEntity,
rhs_levels: Vec<PrecedenceLevel<S>>,
},
}
#[derive(Clone, Debug)]
pub struct PrecedenceLevel<S> {
pub rules: Vec<PrecedencedRuleAlternative<S>>,
}
#[derive(Clone, ... | Rust | 0 |
# Plot decomposition
plot_signal_decomposition(x, n, f"Example 2: Exponential Signal (a={a}) Decomposition")
def example_3_sinusoidal_signal():
"""Example 3: Sinusoidal signal"""
print("\n\nExample 3: Sinusoidal Signal")
print("="*50)
# Define sinusoidal signal
n = np.arange(-5, 6)
... | Python | 1 |
if self.trainer.is_global_zero:
val_losses = [output["val_loss"].mean() for output in outputs]
val_rouge_ls = [output["val_rouge_l"].mean() for output in outputs]
val_loss_mean = sum(val_losses) / len(val_losses)
val_rouge_l_mean = sum(val_rouge_ls) / len(val_rouge... | Python | 1 |
import math
import scipy.optimize
import torch
class TemperatureWrapper:
def __init__(self, net):
self.net = net
self.device = next(iter(self.net.parameters())).device
self.temperature = None
def fit_temperature(self, data_loader):
self.net.eval()
logits = []
t... | Python | 1 |
# Author: Qize Liu
# Description: Document of Operator Information
from AutoAlpha import SingleAttrTsOperator, SingleAttrOperator, DoubleAttrOperator
import pandas as pd
from AutoAlpha.column_type_check import *
SUB_POP_SIZE = 1000
"""
types:
- price: 价格数据
- ticker_float: ticker 自身数据,比如volume, turnover, 什么数据都可以往... | Python | 1 |
# --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
import _plotly_utils.basevalidators as _bv
class FamilyValidator(_bv.StringValidator):
def __init__(
self, plotly_name="family", parent_name="scatterpolar.hoverlabel.font", **kwar... | Python | 1 |
KafkaLogLevel::Debug => {
debug!(target: "librdkafka", "librdkafka: {} {}", fac, log_message)
}
}
}
/// Receives global errors from the librdkafka client.
fn error(&self, error: KafkaError, reason: &str) {
if !self.should_emit_message(reason) {
return... | Rust | 0 |
# aeiva/tool/api/navigate_to_webpage/test.py
import asyncio
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../../..")))
from aeiva.tool.toolkit.browser.browser_toolkit import BrowserToolkit
from aeiva.tool.api.open_browser_tab.api import open_browser_tab
from aeiva.tool... | Python | 1 |
ect."""
player_x = player[..., 1]
obj_x = obj[..., 1]
obj_prob = obj[:, 0]
return bool_to_probs(player_x < obj_x) * obj_prob
def right_of_diver(player: th.Tensor, obj: th.Tensor) -> th.Tensor:
"""True iff the player is 'right of' the object."""
player_x = player[..., 1]
obj_x = obj[..., 1]
... | Python | 1 |
NMAR LETTER SHAN KA..MYANMAR LETTER SHAN HA
0x108E..=0x108E, // Lo MYANMAR LETTER RUMAI PALAUNG FA
0x10A0..=0x10C5, // L& [38] GEORGIAN CAPITAL LETTER AN..GEORGIAN CAPITAL LETTER HOE
0x10C7..=0x10C7, // L& GEORGIAN CAPITAL LETTER YN
0x10CD..=0x10CD, // L& ... | Rust | 0 |
import click
from app.note_app import NoteApp
@click.group()
@click.option("--memory-only", is_flag=True, help="Use memory-only mode for testing.")
@click.pass_context
def cli(ctx, memory_only):
"""Note Taking CLI Application."""
ctx.obj = NoteApp(use_memory=memory_only)
@cli.command()
@click.argument("title... | Python | 1 |
; 128];
let mut one = 0;
let mut four = 0;
patterns.iter().cloned().map(usize::from).for_each(|n| {
result[n] = match n.count_ones() {
5 | 6 => None,
2 => {
one = n;
Some(1)
}
3 => Some(7),
4 => {
... | Rust | 0 |
#!/usr/bin/env python3
import os
import subprocess
import sys
def get_git_root():
try:
# NOTE: Get the absolute path of the Git repository root
git_root = (
subprocess.check_output(
["git", "rev-parse", "--show-toplevel"], stderr=subprocess.STDOUT
)
... | Python | 1 |
lf, env)
# most recent raw observations (for max pooling across time steps)
self._obs_buffer = np.zeros((2,) + env.observation_space.shape, dtype=env.observation_space.dtype)
self._skip = skip
def step(self, action: int) -> GymStepReturn:
"""
Step the environment with the gi... | Python | 1 |
ting
let mut router = mock_app();
// Store the stablecoin vault as a code object
let vault_id = router.store_code(contract_stablecoin_vault());
// Store the gov contract as a code object
let gov_id = router.store_code(contract_gov());
// Set the block height and time, we will later modify this ... | Rust | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created by PyCharm.
File Name: LinuxBashShellScriptForOps:py-schedule-examples.py
Version: 0.0.1
Author: dgden
Author Email: dgdenterprise@gmail.com
URL: https://github.com/DingGuodong/LinuxBashShellSc... | Python | 1 |
symmetry(symmetry: u64,
(bx, by, bz): (usize, usize, usize),
(mut x, mut y, mut z): (usize, usize, usize))
-> (usize, usize, usize) {
use std::mem::swap;
match symmetry & JS3_ROT180_MASK {
... | Rust | 0 |
HMAC-SHA512
Group: ristretto255
Context: 4f50415155452d504f43
Nh: 64
Npk: 32
Nsk: 32
Nm: 64
Nx: 64
Nok: 32
~~~
#### Input Values
~~~
oprf_seed: 5c4f99877d253be5817b4b03f37b6da680b0d5671d1ec5351fa61c5d82
eab28b9de4c4e170f27e433ba377c71c49aa62ad26391ee1cac17011d8a7e9406657c
8
credential_identifier: 31323334
password: ... | Rust | 0 |
class car : #현실세계의 사물을 컴퓨터 안에서 구현할려고 고안한 개념 (field) (자용차의 기능은 함수 - 메서드, 속성은 변수처럼 생성)
color = ""
speed = 0
def up_speed(self, value): #클래스 사용 순서
self.speed += value
def down_speed(self, value): #self는 이용시 필수
self.speed -= value
def print_message() :
print("시험 출력이다")... | Python | 1 |
# 卡尔曼滤波的运用:位置滤波
# 概述:追踪一个运动的物体,通过卡尔曼滤波来估计物体的位置
# 背景:视觉模块:maixcam,被追踪的物体:apriltags标签
# 思路:利用maixcam的find_apriltags()函数来检测apriltags标签,返回标签的位置信息作为观测值
# 利用卡尔曼滤波来估计标签的位置,并画出和apriltags相同高宽的检测框
from maix import image, camera, display, app, time
import numpy as np
# 创建显示对象
disp = display.Display()
# 创建摄像头对象
cam = camera.Came... | Python | 1 |
import up7k91vx8l5, wrgbppdho5h as wdmr9fr_2i6, s5sufx8lnxs, wld9ds36k3d, y7nwwxcnaxl as xq8n2dl0d8e, wugjrr0pwta, upbvinbpjsy as ewr7i5iyoys, rmakdatnjqs
nonlocal lyp0gxk07t0
del y3f3l8qjs4x
'# documentation_contrast_horizon -> wait_junctions_buzzer'
f6pzgl51_zc: zr0hg36o87h = dmedppsjke5
'# docum... | Python | 1 |
th) = parse_uri_location_v2(
dst_protocol,
dst_name,
dst_path,
dst_credentials,
dst_encryption,
)?;
self.apply_stage_options(stmt, &mut stage_info)?;
Ok(Plan::Copy(Box::new(CopyPlanV2::IntoStage {
stage: Box::new(stage_info... | Rust | 0 |
/ insert to global map
let array = Arc::new(SemArray {
_key: key,
sems: semaphores,
});
key2sem.insert(key, Arc::downgrade(&array));
array
}
}
<gh_stars>10-100
//! The core syntax of the language.
use std::fmt;
use std::rc::Rc;
use super::literal::{LiteralIn... | Rust | 0 |
args.dataset}", dataset)
if args.alpha is not None:
alpha = args.alpha
# Represents adjacency matrix (for GCN inference)
a = set_adjacency_matrix(args.nn, dataset.edge_index, alpha=alpha)
# Model setup
model = NodePrediction(args.nn,
dataset.num_features,
... | Python | 1 |
from typing import List, Optional
import httpx
from uuid import uuid4
import asyncio
from daprgen.prototypes.calendar.models import AppointmentResponse
class GoHighLevelAppointmentRepository:
BASE_URL = "https://stoplight.io/mocks/highlevel/integrations/39582850/calendars/events/appointments"
HEADERS = {
... | Python | 1 |
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import sys
from airbyte_cdk.entrypoint import launch
from source_zendesk_sunshine import SourceZendeskSunshine
def run():
source = SourceZendeskSunshine()
launch(source, sys.argv[1:])
| Python | 1 |
#!/usr/bin/python3
"""Write a script that reads stdin line by line and computes metrics:
Input format: <IP Address> - [<date>] "GET /projects/260 HTTP/1.1"
<status code> <file size> (if the format is not this one, the line
must be skipped)
After every 10 lines and/or a keyboard interruption (CTRL + C),
print these sta... | Python | 1 |
import socket
import threading
import time
from typing import Callable
# Let's implement a simple application that just handles messages by printing them
TIME_TO_RUN = 30.0
class MyServerLogic:
def __init__(self):
self.t_start = None
def on_message(self, addr, msg):
print("Server: Received chu... | Python | 1 |
oAny for TssPCRCompositeInfo<'c> {
fn get_handle(&self) -> TssHPCRS { self.handle }
}
impl<'c> TcpaPcrInfo1_1 for TssPCRCompositeInfo<'c> {
fn get_handle(&self) -> TssHPCRS { self.handle }
}
impl<'c> TcpaPcrInfoAny for TssPCRCompositeInfoLong<'c> {
fn get_handle(&self) -> TssHPCRS { self.handle }
}
impl<'c>... | Rust | 0 |
, 4);
}
// TODO: Replace with verbose
// TODO: Print more information with verbose like the file types which are checked
if !settings.quite {
print!("Checking Packages: ");
for (index, package) in settings.packages.iter().enumerate() {
if index != 0 {
print!("... | Rust | 0 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from googletr... | Python | 1 |
] extern crate tower_web;
/// use tower_web::ServiceBuilder;
///
/// struct MyResource;
///
/// impl_web! {
/// impl MyResource {
/// // ...
/// }
/// }
///
/// # if false {
/// # let addr = "127.0.0.1:8080".parse().unwrap();
/// ServiceBuilder::new()
... | Rust | 0 |
() -> clap::ArgMatches<'static> {
log::trace!("fn get_args()");
clap::App::new("ddns_external_server")
.version("0.1.0")
.author("<NAME> <<EMAIL>>")
.about("Responds to requests with the remote IP address")
.arg(
clap::Arg::with_name("host")
.long("ho... | Rust | 0 |
tile_data[i] = row * cols + col;
if verbose {
progress = (100.0_f64 * i as f64 / num_points) as i32;
if progress != old_progress {
println!("Progress (Loop 1 of 3): {}%", progress);
old_progress = progress;
}
... | Rust | 0 |
panic_str("Balance overflow");
}
}
pub fn internal_withdraw(
&mut self,
#[allow(clippy::ptr_arg)] token_id: &TokenId,
account_id: &AccountId,
amount: Balance,
) {
let balance = self.internal_unwrap_balance_of(token_id, account_id);
if let Some(new_balance) = balance.checked_sub(amount) {
self.ft_ow... | Rust | 0 |
class Solution:
def isThereAPath(self, grid: List[List[int]]) -> bool:
m = len(grid)
n = len(grid[0])
if m + n - 1 & 1:
return False
@functools.lru_cache(None)
def dp(i: int, j: int, summ: int) -> bool:
if i == m or j == n:
return False
summ += 1 if grid[i][j] == 0 else ... | Python | 1 |
&[u8] = include_bytes!("../shaders/fragment/sprite.glsl");
static TEXTURES: [TextureType; 1] = [TextureType::Albedo];
#[derive(Clone, Debug)]
enum DirX {}
impl Attribute for DirX {
const NAME: &'static str = "dir_x";
const FORMAT: Format = Format(SurfaceType::R32_G32, ChannelType::Float);
const SIZE: u32... | Rust | 0 |
resource::Sensor = parse_response(
self.api_request(&format!("sensors/{}", id.as_ref()), RequestType::Get)?,
)?;
Ok(sensor.with_id(id.as_ref()))
}
/// Returns all sensors that are connected to the bridge.
pub fn get_all_sensors(&self) -> Result<Vec<resource::Sensor>> {
... | Rust | 0 |
hack" directory of this source tree.
use crate::aast;
use crate::aast_defs;
use crate::ast_defs;
use crate::pos::Pos;
pub use aast::*;
pub use aast_defs::*;
pub use ast_defs::*;
pub trait Annot {
type Ex;
type Fb;
type En;
type Hi;
}
pub trait ClonableAnnot {
type Ex: Clone;
type Fb: Clone;
... | Rust | 0 |
ction_item.title}\n")
rows.append(data_collection_item.rationale)
data_to_collect = DataCollection._format_bullet_list(data_collection_item.data_to_collect)
rows.append(f"\n### Data to Collect\n\n{data_to_collect}")
simulation_steps = DataCollection._format_bullet_list(... | Python | 1 |
peer);
}
}
fn insert_new(&mut self, peer: SocketAddr) {
self.peers.push_back(peer);
self.add_count += 1;
if self.peers.len() > MAX_CACHE_SIZE {
let _ = self.peers.pop_front();
}
self.try_sync_to_disk(false);
}
pub fn clear_from_disk(user_over... | Rust | 0 |
nten));
path_builder.close();
// Rückgabewert
(transformations, path_builder.build())
}
}
/// Definition einer Kreuzung
#[derive(Clone, Debug)]
pub struct Kreuzung {
pub laenge: f32,
pub radius: f32,
pub variante: Variante,
pub beschreibung: String,
}
#[derive(Debug, Clone, ... | Rust | 0 |
or(f"Video height must be at most {max_height}px, got {height}px")
def validate_video_duration(
video: Input.Video,
min_duration: Optional[float] = None,
max_duration: Optional[float] = None,
):
try:
duration = video.get_duration()
except Exception as e:
logging.error("Error gettin... | Python | 1 |
Err(error) => panic!("unable to parse int: {}", error)
};
Ok(Some(token!(tokenizer, Int, accum)))
}
}
}
}
pub struct KeyMatcher {
token_type: TokenType,
constants: &'static [&'static str],
}
impl KeyMatcher {
pub fn new(token_type: TokenType, constants: &'static [&'stati... | Rust | 0 |
BREAK_EXPR,
CONDITION,
BIND_PAT,
PLACEHOLDER_PAT,
ARG_LIST,
NAME,
NAME_REF,
PATH,
PATH_SEGMENT,
RECORD_LIT,
RECORD_FIELD_LIST,
RECORD_FIELD,
// Technical kind so that we can cast from u16 safely
#[doc(hidden)]
__LAST,
}
use self::SyntaxKind::*;
#[macro_export]
ma... | Rust | 0 |
D04;
#[allow(dead_code, non_upper_case_globals)] pub const PACK_SKIP_ROWS: types::GLenum = 0x0D03;
#[allow(dead_code, non_upper_case_globals)] pub const PIXEL_BUFFER_BARRIER_BIT: types::GLenum = 0x00000080;
#[allow(dead_code, non_upper_case_globals)] pub const PIXEL_PACK_BUFFER: types::GLenum = 0x88EB;
#[allow(dead_cod... | Rust | 0 |
"""Tensorflow utility functions for evaluation"""
import logging
import os
from tqdm import trange
import tensorflow as tf
from model.utils import save_dict_to_json
def evaluate_sess(sess, model_spec, num_steps, writer=None, params=None):
"""Train the model on `num_steps` batches.
Args:
sess: (tf.... | Python | 1 |
builder.py_get_attr(typing_mod, "ParamSpec", line)
if type_param.kind != TYPE_VAR_TUPLE_KIND:
# To match runtime semantics, pass infer_variance=True
tv = builder.py_call(
tvt,
[builder.load_str(type_param.name), builder.true()],
line,
... | Python | 1 |
EVENT_SHUTDOWN_ANY: ::std::os::raw::c_uint = 3;
pub const OCI_EVENT_DROP_DB: ::std::os::raw::c_uint = 4;
pub const OCI_EVENT_DEREG: ::std::os::raw::c_uint = 5;
pub const OCI_EVENT_OBJCHANGE: ::std::os::raw::c_uint = 6;
pub const OCI_EVENT_QUERYCHANGE: ::std::os::raw::c_uint = 7;
pub const OCI_OPCODE_ALLROWS: ::std::os:... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
豆包播客音频转换工具 - 快速开始脚本
这个脚本帮助用户快速开始使用豆包播客音频转换工具。
"""
import os
import sys
from pathlib import Path
def print_banner():
"""打印欢迎横幅"""
print("=" * 60)
print("🎵 豆包播客音频转换工具 v1.1.0")
print("=" * 60)
print("欢迎使用豆包播客音频转换工具!")
print("这个工具可以帮助您从Charles抓包... | Python | 1 |
import time
import ray
from ekya.models.icarl_model import ICaRLModel
from ekya.utils.loggeractor import Logger
#TODO - This example is incompelete
if __name__ == '__main__':
ray.init()
init_tasks = []
checkpoint_restore_times = []
checkpoint_write_time = 0
logger_actor = ray.remote(Logger).remote... | Python | 1 |
import collections
from collections import deque, defaultdict
import sys
from functools import lru_cache, cache, cmp_to_key
from itertools import zip_longest, product
import heapq
import math
import re
from utils import *
def process():
s = []
for line in sys.stdin:
s.append(line.strip())
return s
... | Python | 1 |
kba15pbeiq
raise c0cu7zwm6fd
@('' for zhkufuq8ism in False for alz7zjs9hkz in tkmvbm6_y1l if b'' if vso67suujdy)
def w8sq45fe18p(mfekpwthzqw: hhjktnypyqk):
n2q5927j0r5 |= bcgs3uy9fi2
from kx_rzlo5ck6 import i0rsgkyy85i, p007s89r8zt, x4qxx02mn9t as a58r4yzpx84, j1ewdszdyq4 as k1bhpidx956
l_spg1osjd5 = No... | Python | 1 |
# read arguments
if len(sys.argv) != 2:
print('Please specify input file path (e.g., bif/sm/asia.bif).')
sys.exit()
filePath = sys.argv[1]
# algorithms = ['gmp', 'lmp', 'listci']
algorithms = ['lmp', 'listci']
try:
with open(filePath, 'r') as f:
fileContent = ... | Python | 1 |
ROP_ARRAY_CALLBACK not set"),
}
}
}
}
<reponame>whiter4bbit/milliseriesdb
use crate::storage::{error::Error, Entry, SeriesReader, SeriesIterator};
use std::sync::Arc;
pub trait IntoEntriesIter {
type Iter: Iterator<Item = Result<Entry, Error>>;
fn into_iter(&self, from: i64) -> Result<S... | Rust | 0 |
view: AffineMatrix3<f32> = Transform::look_at(
&Point3::new(x * 32.0, y * 32.0, 16.0),
&Point3::new(0.0, 0.0, 0.0),
&Vector3::unit_z(),
);
data.view = view.mat.into_fixed();
graphics.clear(clear_data, gfx::COLOR | gfx::DEPTH, &frame);
graphics.draw(&b... | Rust | 0 |
write M or Z or C"),
};
players.push((p, id));
}
player_num
};
// ビジュアライザ起動
let opengl = OpenGL::V3_2;
let mut window: Window = WindowSettings::new(WINDOW_TITLE, [WINDOW_SIZE, WINDOW_SIZE])
.opengl(opengl)
.exit_on_esc(true)
.build()
... | Rust | 0 |
// The result of a shrinking pass.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum ShrinkReport {
/// The last test passed.
Pass,
/// The last test failed.
Fail,
}
impl ShrinkReport {
/// Returns `true` if the shrink_result is [`Pass`].
///
/// [`Pass`]: ShrinkReport:... | Rust | 0 |
irectly implements an invoke handler instead of reyling on the
//! [`tauri::generate_handler`] macro.
//! Since the invoke handler implementation is not considered stable and might
//! change between releases **this plugin has no backwards compatibility
//! guarantees**.
//!
//! [`Stream`]: https://docs.rs/futures/late... | Rust | 0 |
t outlive lifetime 'a.
// 2. `T: Trait + 'a`: Type T must implement trait Trait and all references ni T must outlive 'a.
use std::fmt::Debug;
#[derive(Debug)]
struct Ref<'a, T: 'a>(&'a T);
// A generic function prints using the `Debug` trait.
fn print<T>(t: T) where
T: Debug {
println!("`print`: t is {:?}", ... | Rust | 0 |
import math
import v2_10.Constants as Constants
class NumericUtils:
def roundDown(n, m):
return n - n % m
def roundUp(n, m):
return (n - 1) + m - (n - 1) % m
class StreamUtils:
kDataBitsPerByte = 7
kByteMask = (1 << kDataBitsPerByte) - 1
kMaxUnsignedDataPerByte = kByteMask
kMinDataPerByte = -(1 << (kDataB... | Python | 1 |
(royal_blue: $s:expr) => ( $s );
(royal_blue_bold: $s:expr) => ( $s );
(magenta: $s:expr) => ( $s );
(magenta_bold: $s:expr) => ( $s );
(teal: $s:expr) => ( $s );
(teal_bold: $s:expr) => ( $s );
(white: $s:expr) => ( $s );
(white_bold2: $s:expr) => ( $s );
}
/// `print!` with all the gl... | Rust | 0 |
b struct Trie<K: std::cmp::Eq + std::hash::Hash, V> {
root_node: TrieNode<K, V>
}
impl <K: std::cmp::Eq + std::hash::Hash + Copy, Data> std::default::Default for Trie<K, Data> {
fn default() -> Self {
Trie {
root_node: TrieNode::default()
}
}
}
impl <K: std::cmp::Eq + std::hash... | Rust | 0 |
"latin_1",
],
"iso8859_16": [
"iso8859_14",
"iso8859_15",
"iso8859_2",
"iso8859_3",
"iso8859_9",
"latin_1",
],
"iso8859_2": ["cp1250", "iso8859_16", "iso8859_4"],
"iso8859_3": ["iso8859_14", "iso8859_15", "iso8859_16", "iso8859_9", "latin_1"],
"i... | Python | 1 |
# BioPandas
# Author: Sebastian Raschka <mail@sebastianraschka.com>
# License: BSD 3 clause
# Project Website: http://rasbt.github.io/biopandas/
# Code Repository: https://github.com/rasbt/biopandas
import sys
if sys.version_info >= (3, 9):
import importlib.resources as pkg_resources
else:
import importlib_re... | Python | 1 |
> = Recv<Branching1fromCtoS<N>, End>;
// Creating the MP sessions
// A
type ChoiceA<N> = MeshedChannelsThree<Choice1fromCtoA<N>, End, RoleC<RoleEnd>, NameA>;
type EndpointA<N> = MeshedChannelsThree<Choice0fromCtoA<N>, End, RoleC<RoleEnd>, NameA>;
// C
type ChoiceC<N> = MeshedChannelsThree<Choose1fromCtoA<N>, Choose1f... | Rust | 0 |
#[ocaml::func]
pub fn caml_pasta_fp_negate(x: ocaml::Pointer<Fp>) -> Fp {
-(*x.as_ref())
}
#[ocaml::func]
pub fn caml_pasta_fp_mul(x: ocaml::Pointer<Fp>, y: ocaml::Pointer<Fp>) -> Fp {
*x.as_ref() * *y.as_ref()
}
#[ocaml::func]
pub fn caml_pasta_fp_div(x: ocaml::Pointer<Fp>, y: ocaml::Pointer<Fp>) -> Fp {
... | Rust | 0 |
ariance(scaling_modifier)
else:
scales = self.gaussians.get_scaling
rotations = self.gaussians.get_rotation #(5000,4)
# If precomputed colors are provided, use them. Otherwise, if it is desired to precompute colors
# from SHs in Python, do it. If not, then SH -> RGB con... | Python | 1 |
vertical_position = (py - y) / h
# Score - higher for farther left and in middle vertical section
# The 0.2-0.7 vertical range is where sleeves typically are
if 0.2 <= vertical_position <= 0.7:
sleeve_candidates.append((left_extension, vertical_position, (px, py)))
... | Python | 1 |
#[test]
fn test_70() {
assert_eq!(Solution::climb_stairs(2), 2);
assert_eq!(Solution::climb_stairs(3), 3);
}
}
mod with_authorization;
mod with_service;
pub use with_authorization::*;
pub use with_service::*;
use crate::api::um::prelude::*;
/// Filters define trading rules on a symbol or... | Rust | 0 |
#%%
from argparse import ArgumentParser
from datetime import datetime
def get_args():
parser = ArgumentParser(description="Get the main args")
# Generate arXiv list URL
parser.add_argument("--category", type=str, help="The category for the arXiv submissions (e.g., gr-qc).")
parser.add_argument("--submi... | Python | 1 |
pub const NAVX_REG_QUAT_OFFSET_W_L: u8 = 0x4E; /* Lower 8 bits of Quaternion W */
pub const NAVX_REG_QUAT_OFFSET_W_H: u8 = 0x4F; /* Upper 8 bits of Quaternion W */
pub const NAVX_REG_QUAT_OFFSET_X_L: u8 = 0x50; /* Lower 8 bits of Quaternion X */
pub const NAVX_REG_QUAT_OFFSET_X_H: u8 = 0x51; /* Upper 8 bits of Quaterni... | Rust | 0 |
from copy import deepcopy
from time import sleep, time
from typing import Any
import numpy as np
import tawazi
from tawazi import dag, xn
def closeness(a: float, b: float) -> float:
return abs(a - b)
def almost_equal(a: float, b: float, level: float = 0.02) -> bool:
return closeness(a, b) < level
@xn
def... | Python | 1 |
end_point();
let (cp1, cp2) = self.control_points();
find_extremities(start, cp1, cp2, end)
}
///
/// Attempts to estimate the length of this curve
///
fn estimate_length(&self) -> f64 {
curve_length(self, 0.01)
}
///
/// Create a section from this curve. Con... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.