text string | label_name string | labels int64 |
|---|---|---|
"""
ドメイン層のパッケージ
""" | Python | 1 |
ass[1] as usize] {
continue;
}
// if the sequences aren't identical, the current string must be shortest, or
// the set of nodes visited by the input string must be a subset of the other sequences
// in the equivalence class.
let shortest = eq... | Rust | 0 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import torch
import sys
sys.path.append("../..")
import sgd
def test(num_versions, assertion_ground_truth):
# N is batch size; D_in is input dimension;
# D_out is output dimension.
N, D_in, D_H, D_out = 4, 4, 4, 4
# Create rando... | Python | 1 |
onal_millionths: 0,
excess_data: Vec::new()
});
// Capacity of 200 sats because this channel will be used by 3rd path as well.
add_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[2], &privkeys[3], ChannelFeatures::from_le_bytes(id_to_feature_flags(5)), 5);
update_channel(&net_graph_msg_handler, &secp_c... | Rust | 0 |
# -*-coding:utf-8-*-
class train_valid_test_fold:
train_fold = ['2iD-tVS8NPw', '8d-gEyoeBzc', 'Qr1Ca94K55A', 'Ci-AH39fi3Y', '8qrpnFRGt2A', 'Bfr499ggo-0',
'QN9ZIUWUXsY', '9T9Hf74oK10', '7JsX8y1ysxY', '1iG0909rllw', 'Oz06ZWiO20M', 'BioHAh1qJAQ',
'9c67fiY0wGQ', 'Iu2PFX3z_1s', 'Nzq8... | Python | 1 |
import logging
import time
from datetime import datetime
from typing import Any
# DO NOT USE mutable default arguments
# Mutable default arguments are evaluated only once when the module is loaded
# This means that the default argument is shared between all calls to the function
def append_to(element: int, to: list[... | Python | 1 |
eing
// invalid for the current task. Lucky for us `rust_swap_registers`
// is a C function so we don't have to worry about that!
match in_context.stack_bounds {
Some((lo, hi)) => record_stack_bounds(lo, hi),
// If we're going back to one of the origin... | Rust | 0 |
elif node.value in {"for"}:
node, end_line = __handle_skip(stack, 4)
elif node.value in {"else"}:
node, end_line = __handle_skip(stack, 1)
return end_line, from_keyword, node, stack
def __compute_start_end_lines(node, stack):
start_line, _ = node.start_pos
end_line, _... | Python | 1 |
"]
#[inline(always)]
pub fn is_tpri_3(&self) -> bool {
*self == TPRI_A::TPRI_3
}
#[doc = "Checks if the value of the field is `TPRI_4`"]
#[inline(always)]
pub fn is_tpri_4(&self) -> bool {
*self == TPRI_A::TPRI_4
}
#[doc = "Checks if the value of the field is `TPRI_5`"]
... | Rust | 0 |
inline]
pub fn encode_into(&self, dest: &mut Vec<u8>) {
// operation is infallible so it's ok to unwrap
Encode::encode_into(self, dest).unwrap()
}
#[inline]
pub fn encoding_length(&self) -> usize {
// operation is infallible so it's ok to unwrap
Encode::encoding_length(s... | Rust | 0 |
java::lang::Throwable>> {
// class.path == "java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock", java.flags == PUBLIC, .name == "getHoldCount", .descriptor == "()I"
unsafe {
let __jni_args = [];
let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
... | Rust | 0 |
import argparse
import numpy as np
def print_latency_stats(f, latencies):
mean = np.mean(latencies);
sd = np.std(latencies, ddof=1)
p50 = latencies[int(len(latencies) / 2)];
p90 = latencies[int(len(latencies) * 0.90)];
p95 = latencies[int(len(latencies) * 0.95)];
p99 = latencies[int(len(laten... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. 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 requir... | Python | 1 |
"""謬誤處理相關工具函式。"""
from __future__ import annotations
from typing import Any
def flatten_fallacies(messages: list) -> list:
if not messages:
return []
flat: list[dict[str, Any]] = []
for msg in messages:
falls = msg.get("fallacies") if isinstance(msg, dict) else getattr(msg, "fallacies", N... | Python | 1 |
symbols_on_mouth" => Some(&crate::flat::FACE_WITH_SYMBOLS_ON_MOUTH as &crate::Emoji),
"ce_with_tears_of_joy" => Some(&crate::flat::FACE_WITH_TEARS_OF_JOY as &crate::Emoji),
"ce_with_thermometer" => Some(&crate::flat::FACE_WITH_THERMOMETER as &crate::Emoji),
"ce_with_tongue" => Some(&crate::flat::FACE_WIT... | Rust | 0 |
ed_results:
actual_val = results.results[task][metric]
lo = mean - sigma_tol * std
hi = mean + sigma_tol * std
ok = (lo < actual_val) and (actual_val < hi)
msg = (
"{} > {} sanity check (actual vs. expected): "
"{:.3f} vs. mean={:.4f}, std={:.4}, range=({:... | Python | 1 |
or: Length of new names must be 1, got 2
print(pd.crosstab(df['Sex'], [df['Pclass'], df['Embarked']], normalize=True))
# Pclass 1 2 \
# Embarked C Q S C Q S
# Sex ... | Python | 1 |
read_u64_le()?;
assert!(_top_node_offset != 0, "invalid root offset");
//
Ok(())
}
impl VarFile {
pub fn read_top_node_offset(&mut self) -> Result<NodePieceOffset> {
self.seek_from_start(NodePieceOffset::new(IDX_HEADER_TOP_NODE_OFFSET))?;
self.read_u64_le().map(NodePieceOffset::new)
... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType
from .batch_create_app_role_member_request_body import BatchCreateAppRoleMemberRequestBody
class Batc... | Python | 1 |
from PySide6.QtCore import QThread, Signal
from airunner.utils.network.huggingface_downloader import HuggingfaceDownloader
class DownloadThread(QThread):
# Use object-typed signal to avoid OverflowError for very large values
progress_updated = Signal(object, object)
download_finished = Signal()
file_d... | Python | 1 |
_URL: DWORD = 87;
pub const WINHTTP_OPTION_REDIRECT_POLICY: DWORD = 88;
pub const WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS: DWORD = 89;
pub const WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE: DWORD = 90;
pub const WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE: DWORD = 91;
pub const WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE: DWORD... | Rust | 0 |
let value = sys.cpu.flags.get_16();
sys.push_16(value);
}
#[instr("SAHF")]
pub fn sahf(sys: &mut System) {
let value = sys.cpu.reg_8(Ah);
sys.cpu.flags.set_8(value);
}
#[instr("LAHF")]
pub fn lahf(sys: &mut System) {
let value = sys.cpu.flags.get_8();
sys.cpu.set_reg_8(Ah, value);
}
#[instr(... | Rust | 0 |
if the query fails for some reason
pub fn get(conn: &sql::Connection, name: &str) -> Result<Option<Context>> {
let mut stmt = conn.prepare("SELECT * FROM context WHERE name = :name")?;
stmt.query_row_named(&[(":name", &name)], of_row)
.optional()
.map_err(|e| Error::Query(e)... | Rust | 0 |
()
def edit():
regno=txt1.get()
name=txt2.get()
address=txt3.get()
phone=txt4.get()
if regno=='' or name=='' or address=='' or phone=='':
messagebox.showinfo("Insert Data","Please fill all feilds.")
else:
conn=mysql.connect(host='localhost',user='root',passwd='',database='mkd123'... | Python | 1 |
2S_LC_FIFO_TIMEOUT_ENA_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `I2S_LC_FIFO_TIMEOUT_ENA`"]
pub struct I2S_LC_FIFO_TIMEOUT_ENA_W<'a> {
w: &'a mut W,
}
impl<'a> I2S_LC_FIFO_TIMEOUT_ENA_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
sel... | Rust | 0 |
import json
import sys
from pathlib import Path
import pytest
from coverage import Coverage
from test_project.example import (
always,
if_gte_python36,
if_gte_python37,
if_gte_python38,
if_gte_python39,
if_gte_python310,
if_gte_python311,
)
#: This is just our specific example.
_EXCUDED_L... | Python | 1 |
x90C\x09{\xd4\x12a\xc4\xa8\xc1'\x9a\
>\xd9\x9d\x1f\xb5f;\x95\xb8\x84\xef/\x8c\xb7q\xde\
d\xb2\x8e^n\xbfF\xaa6\xcd\xa6\x8fU\xc2\xb6\x14\
d\x01\x1b\x95+l\x9dI\xa8\xd4\x0d\xb1OGy\xe3\
\xd6.\xb0\x0c?\xc4\x0c\xb9\xb4\xf3`0\xe4\xde*\xf7\
!\x95J\xd5\x0e\x8a0\xa4p\xbf\x83\x1f\xdaU\x1d\x92\
\x91\xc0y\xdf\xf5\xc7\xf9\x86\xfd_\x1... | Python | 1 |
x<Vec<MockCall<()>>>,
comment_pr_calls: Mutex<Vec<MockCall<()>>>,
create_branch_calls: Mutex<Vec<MockCall<()>>>,
delete_branch_calls: Mutex<Vec<MockCall<()>>>,
approve_pull_request_calls: Mutex<Vec<MockCall<()>>>,
get_timeline_calls: Mutex<Vec<MockCall<Vec<TimelineEvent>>>>,
get_suites_calls: Mu... | Rust | 0 |
Result<TestContext, Error> {
let launcher = launcher().context("Failed to open launcher service")?;
let region_service = launch(&launcher, COMPONENT_URL.to_string(), None)
.context("Failed to launch region service")?;
let configurator = region_service
.connect_to_service::<RegulatoryRegionC... | Rust | 0 |
from openai import OpenAI
from dotenv import load_dotenv
from tenacity import retry, wait_exponential, stop_after_attempt, retry_if_exception_type
import time, os, logging, gc
logging.basicConfig(level=logging.ERROR)
logger = logging.getLogger(__name__)
load_dotenv()
OPENAI_API_KEY = os.environ.get("ASSISTANT_KEY")... | Python | 1 |
if True:
import sys
sys.path.append('../../')
import dash
import json
import random
from dash import html
import feffery_antd_charts as fact
from dash.dependencies import Input, Output
from feffery_dash_utils.style_utils import style
app = dash.Dash(__name__)
app.layout = html.Div... | Python | 1 |
from fastapi import APIRouter, Query, Depends, Response, Request, status
from models.playlist import PlaylistsResponseModel, PlaylistResponseModel, PlaylistCreateModel
from services.auth import AuthService
from core.depends import get_playlist_service, get_user_service
router = APIRouter()
@router.get('/', response_... | Python | 1 |
writeln!(stream).unwrap();
writeln!(stream, "{}", message).unwrap();
}
fn main() -> io::Result<()> {
let (progname, args) = get_command_line();
if args.is_empty() {
eprintln!("");
eprintln!("Usage: {} sample.db", progname);
panic!("");
}
let listener = TcpListener::bind... | Rust | 0 |
W').unwrap(),
value('5').unwrap(),
value('5').unwrap(),
),
vec![97, 110, 121]
);
assert_eq!(
decode_four_chars(
value('T').unwrap(),
value('W').unwrap(),
value('F').unwrap(),
... | Rust | 0 |
ded
// before this point are to be rejected.
let now = <frame_system::Pallet<T>>::block_number();
let oldest_accepted = now.saturating_sub(dispute_post_conclusion_acceptance_period);
let set = set.as_ref();
// Load session info to access validators
let session_info = match <session_info::Pallet<T>>::sessi... | Rust | 0 |
('results/'+self.args.input_dir+f'/atac_emb{seed}.csv')
#pd.DataFrame(RNA_recon).to_csv('embedding/conAAE_SHARE_rna_recon.csv')
#pd.DataFrame(ATAC_recon).to_csv('embedding/conAAE_SHARE_atac_recon.csv')
#input('pause')
#for k in range(1,6):
#k=k*10
#print("When k = %d"%k)
pairlist=[]
... | Python | 1 |
visitor);
}
let mut false_visitor = NodeVisitor::<T, M>::new(
false_child_idx,
visitor.samples,
visitor.order,
visitor.x,
visitor.y,
visitor.level + 1,
);
if self.find_best_cutoff(&mut false_visitor, mtry) {
... | Rust | 0 |
import tensorflow as tf
class Distiller(tf.keras.Model):
"""Model distiller."""
def __init__(self, teacher: tf.keras.Model, student: tf.keras.Model, **kwargs):
super().__init__(inputs=student.inputs, outputs=student.outputs, **kwargs)
self.teacher = teacher
self.teacher.trainable = Fa... | Python | 1 |
conf)?;
///
/// assert_eq!(String::from("cc"), buffer.deref().borrow().as_ref());
/// Ok(())
/// }
/// ```
pub struct Debugger<Machine, S: Symbol>
where
Machine: TuringMachine<S>,
{
machine: Machine,
c_handler: Option<CHandler<S>>,
i_handler: Option<IHandler<S>>,
}
impl<Machine, S: Symbol> Debu... | Rust | 0 |
}-th or", i)),
&or_result,
should_be_zero,
)?;
let _ = bits_iter.next().unwrap();
}
or_result.enforce_equal(
&mut cs.ns(|| "Check that or of extra bits is zero"),
&Boolean::constant(false),
... | Rust | 0 |
-> Result<(Self, &[u8]), bytesrepr::Error> {
let (tag, bytes) = u8::from_bytes(bytes)?;
match tag {
ENTRYPOINTACCESS_PUBLIC_TAG => Ok((EntryPointAccess::Public, bytes)),
ENTRYPOINTACCESS_GROUPS_TAG => {
let (groups, bytes) = Vec::<Group>::from_bytes(bytes)?;
... | Rust | 0 |
n: discord.Button):
if self.__input_lock.locked():
return await interaction.response.send_message("Already waiting for your response...", ephemeral=True)
if self.message is None:
return
async with self.__input_lock:
channel = self.message.channel
... | Python | 1 |
class ListNode:
def __init__(self,val=0,next=None):
self.val=val
self.next=next
class Solution(object):
def insert(self,node,value):
if node.val==-1:
node.val=value
else:
new=ListNode(value)
currentNode=node
while(currentN... | Python | 1 |
from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple, AdminDateWidget
from employee.models import Employee
class SMSAnnounceForm(forms.Form):
employee_choice = Employee.objects.filter(active=True).all()
message = forms.CharField(widget=forms.Textarea)
employees = forms... | Python | 1 |
e with shape [batch_size, seq_len,
vocab_size], which is the output of a language model. Scores will be normalized internally using softmax.
target:
Ground truth values with a shape [batch_size, seq_len].
ignore_index:
Integer specifying a target class to ignore. If g... | Python | 1 |
// .default_value("sh -c"),
// )
//
// Interval optionMacの場合は更に背景画像も変わる
// [--interval,-n] second(default:2)
.arg(
Arg::with_name("interval")
.help("seconds to wait between updates")
.short("n")
.long("... | Rust | 0 |
destination.write(fake_image_bytes.read())
# Назначаем эту функцию нашему моку
fake_bot.download.side_effect = mock_download
# ---------------------------------------------
with patch("app.handlers.cyclegan.asyncio.get_running_loop") as mock_get_loop:
mock_loop = MagicMock()
mock_r... | Python | 1 |
import os, sys
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
# Get the long description from the README file
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_require_list = [
'numpy', 'torch', 'torchvision... | Python | 1 |
import numpy as np
import shapely
def new_grid(n_cells_per_side, bounds, n_cells_x=None, n_cells_y=None):
"""
Parameters
----------
n_cells int, number of cells per grid side (n_cells+1)
bounds [double,4] xmin, ymin, xmax, ymax
n_cells_x, n_cells_y int, number of cells per grid side (n_cells+... | Python | 1 |
())
}
use std::ops::Add;
use std::marker::PhantomData;
/// 単位を定義するため、空の列挙型を作成。
#[derive(Debug, Clone, Copy)]
enum Inch {}
#[derive(Debug, Clone, Copy)]
enum Mm {}
/// `Length`は`Unit`という幽霊型パラメータを持つ型
///
/// `f64`ははじめから`Clone`、`Copy`トレイトを持っている。
#[derive(Debug, Clone, Copy)]
struct Length<Unit>(f64,PhantomData<Unit>);
... | Rust | 0 |
1-08"],
(
r"None of \[Index\(\['2000-01-04', '2000-01-08'\], "
r"dtype='object'\)\] are in the \[index\]"
),
),
],
)
def test_loc_with_list_of_strings_representing_datetimes_not_matched_type(
self, idx, labels, m... | Python | 1 |
lineno
# get the context
context = nodes.ContextReference()
# get the arguments
args = [context]
try:
while True:
args.append(parser.parse_expression())
except TemplateSyntaxError:
pass # no more arguments
# get the tag_... | Python | 1 |
OTE: The returned texture will remain empty until the given `encoder` has its command buffer
/// submitted to the given `device`'s queue.
///
/// No format or size conversions are performed - the given buffer is loaded directly into GPU
/// memory.
///
/// Pixel type compatibility is ensured via the `Pixel` trait.
///
... | Rust | 0 |
: PhantomData,
}
}
/// Returns a list of accounts stored in the wallet (i.e. mappings between
/// user-specified labels and BIP32 derivation paths.
///
/// # Returns
/// * Result Containing:
/// * A Vector of [`AcctPathMapping`](../types/struct.AcctPathMapping.html) data
/// * or [`libwallet::Error`](../stru... | Rust | 0 |
"""
Universidade Federal do Rio de Janeiro // Instituto de Física // Métodos Computacionais em Física I // Tarefa 1
"""
"""
Escreva um programa em Python (polar.py) que, dado um par de coordenadas cartesianas em duas dimensões, x e y, calcule e imprima o par de coordenadas polares r e θ
correspondente. Imprima θ tant... | Python | 1 |
# Scrivi una funzione che prende una lista di numeri e ritorna un dizionario che classifica i numeri in liste separate per numeri pari e dispari.
def classifica_numeri(lista: int) -> dict[str:list[int]]:
return {'pari':[i for i in lista if i%2==0], 'dispari': [i for i in lista if i%2!=0]} | Python | 1 |
_WIDTH * self.app.app_scale))
def get_metadata(self) -> dict[str, Any]:
wallpaper_path = None
if self.wallpaper_file:
wallpaper = Path(self.wallpaper_file)
if appconfig.BACKGROUNDS_PATH == wallpaper.parent:
wallpaper_path = wallpaper.name
else:
... | Python | 1 |
# Copyright (c) OpenMMLab. All rights reserved.
import json
import os.path as osp
import tempfile
import unittest
from mmocr.datasets.preparers import FUNSDTextDetAnnParser
class TestFUNSDTextDetAnnParser(unittest.TestCase):
def setUp(self) -> None:
self.root = tempfile.TemporaryDirectory()
def _cr... | Python | 1 |
assert (
success
), f"prefix cache must be reset to prevent kv cache pollution! {success}"
return
client_outputs = {}
for req in abort_lists:
engine_output = EngineCoreOutput(
request_id=req.request_id,
new_token_ids=[],
finish_reason... | Python | 1 |
from django.urls import path
from . import views
urlpatterns = [
path('<str:disease>', views.DiseaseView.as_view(), name="disease"),
path('<str:disease>/<str:pathy>', views.TherapyView.as_view(), name="therapy"),
path('<str:disease>/<str:pathy>/books', views.BooksView.as_view(), name="books"),
path('<... | Python | 1 |
import shutil
from unittest.mock import Mock
import pytest
from pdm.backend.wheel import WheelBuilder
from tests import FIXTURES
from tests.fixtures.hooks import hook_class, hook_module
def make_entry_point(hook):
ep = Mock()
ep.load.return_value = hook
return ep
@pytest.fixture()
def project_with_hoo... | Python | 1 |
prev_concat = has_dash;
}
new_text
}
}<reponame>DICO-TEAM/dico-chain<filename>pallets/oracle/src/traits.rs
use sp_std::vec::Vec;
pub trait UpdateOraclesStorgage<AccountId, CurrencyId> {
fn initialize_members(members: Vec<AccountId>);
fn insert_members(memmber: &[AccountId]);
fn del... | Rust | 0 |
e, PanicAssertion};
use zebra_network as zn;
use zebra_state as zs;
use crate::{
components::{
sync::{self, SyncStatus},
ChainSync,
},
config::ZebradConfig,
};
use InventoryResponse::*;
/// Maximum time to wait for a request to any test service.
///
/// The default [`MockService`] value ... | Rust | 0 |
g(feature = "ta")]
crate::Annotation {
lang: "ta",
tts: Some(
"ஆனந\u{bcd}தக\u{bcd}கண\u{bcd}ண\u{bc0}ர\u{bcd} சிந\u{bcd}தும\u{bcd} பூனை முகம\u{bcd}",
),
keywords: &[
"ஆனந\u{bcd}தக\u{bcd} கண\u{bcd}ண\u{bc0}ர\u{bcd}",
"ஆன... | Rust | 0 |
turn chi2_per_n
def test_physics_improvements():
"""Test v4 physics on example galaxy"""
print("\n=== Testing Physics Improvements ===\n")
# NGC 3198-like test data
r = np.array([0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10, 12, 15, 18, 20, 25, 30]) * kpc
v_obs = np.array([65, 90, 108, 120, 135, 142, 145... | Python | 1 |
import pytest
from datetime import datetime
from flask.testing import FlaskClient
def test_dr_all(app, client: FlaskClient, dr_reg_form1):
from flaskr.services import add_user
from werkzeug.datastructures import ImmutableMultiDict
client, _ = client
assert client.get('/doctor', follow_redirects=True).j... | Python | 1 |
cy_sample - xy) / cell_size # 中心与左上坐标差值 (7*7)
# 坐标w,h代表了预测的bounding box的width、height相对于整幅图像width,height的比例
target[int(ij[1]), int(ij[0]), 2:4] = wh[i] # w1,h1
target[int(ij[1]), int(ij[0]), :2] = delta_xy # x1,y1
# 每一个网格有两个边框
target[int(ij[1]), int(ij[0]... | Python | 1 |
.azure_search.cli.build_search_pipeline",
return_value=FakePipeline(),
):
args: list[str] = [
"azure-search",
"run",
"what is life?",
"--embedding-deployment",
"emb",
"--generation-deployment",
"gen",
# k... | Python | 1 |
import os
from dotenv import load_dotenv
from email.message import EmailMessage
import ssl
import smtplib
import re
load_dotenv() # load env to secure the email and app password
# take valid input
def take_inp(prompt):
"""
Prompt until the user enters a valid input. Returns a string with leading/trailing w... | Python | 1 |
test]
fn test_entity() {
let mut world = World::new();
world.spawn();
}
#[test]
fn test_component() {
struct TestComponent {
test: u32,
}
impl Component for TestComponent {}
let mut world = World::new();
let entity = world.spawn().w... | Rust | 0 |
Some(S::zero_value())
}
}
impl<S> Source for Zero<S>
where S: Sample
{
#[inline]
fn current_frame_len(&self) -> Option<usize> {
None
}
#[inline]
fn channels(&self) -> u16 {
self.channels
}
#[inline]
fn samples_rate(&self) -> u32 {
self.samples_rate
... | Rust | 0 |
"deadbeef").unwrap());
}
#[test]
fn base64_decode_array() {
data_encoding_macro::base64_array!("const OUTPUT" = "deadbeef");
assert_eq!(&OUTPUT as &[u8], data_encoding::BASE64.decode(b"deadbeef").unwrap());
}
#[test]
fn hexlower_decode() {
const OUTPUT: &'static [u8] = &data_encoding_macro::hexlower!("dea... | Rust | 0 |
```python
from transformers.utils.fx import symbolic_trace
traced_model = symbolic_trace(model, input_names=["input_ids", "attention_mask", "token_type_ids"])
```
"""
if input_names is None:
input_names = model.dummy_inputs.keys()
input_names = list(input_names)
concre... | Python | 1 |
} else {
// 0
// }
// }
// }
#[cfg(test)]
mod test {
#[test]
fn test_data_u8_write() {
// let mut stream = Cursor::new(Vec::<u8>::new());
// let x = 1 as u8;
// x.write(&mut stream).unwrap();
// assert_eq!(stream.get_ref().as_slice(), [1])
}
}
pub mo... | Rust | 0 |
ECheckFileSignatureFileNotFound = 2,
k_ECheckFileSignatureNoSignaturesFoundForThisApp = 3,
k_ECheckFileSignatureNoSignaturesFoundForThisFile = 4,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CheckFileSignature_t {
pub m_eCheckFileSignature: ECheckFileSignature,
}
pub const CheckFileSignature_t_k_iCallback: ... | Rust | 0 |
ert_eq(Day::new(22, Part::A), 5755, position);
let card = poly(2020, &commands);
assert_eq(Day::new(22, Part::B), 42152620178084, card);
}
#![allow(unused_parens)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(dead_code)]
use crate::style::{StyledNode, Style, Display, Edge, Pixels};
use crate... | Rust | 0 |
essfully");
}
}
Ok(())
}
}
}
type InstallerResult<T> = Result<T, Box<dyn Error>>;
pub trait RoamProtocolInstaller {
fn install(&mut self) -> InstallerResult<()>;
fn uninstall(&mut self) -> InstallerResult<()>;
}
<reponame>liushuyu/conch-parser<filename>test... | Rust | 0 |
#!/usr/bin/env python3
import os
from mpi4py import MPI
from stable_baselines.common import set_global_seeds
from stable_baselines import bench, logger
from stable_baselines.common.atari_wrappers import make_atari, wrap_deepmind
from stable_baselines.common.cmd_util import atari_arg_parser
from stable_baselines.commo... | Python | 1 |
pub sf_aes_key_r2_3: crate::Reg<sf_aes_key_r2_3::SF_AES_KEY_R2_3_SPEC>,
#[doc = "0x410 - sf_aes_key_r2_4."]
pub sf_aes_key_r2_4: crate::Reg<sf_aes_key_r2_4::SF_AES_KEY_R2_4_SPEC>,
#[doc = "0x414 - sf_aes_key_r2_5."]
pub sf_aes_key_r2_5: crate::Reg<sf_aes_key_r2_5::SF_AES_KEY_R2_5_SPEC>,
#[doc = "0x4... | Rust | 0 |
r are found after ':'.
Return None if ':' but not a valid number.iNs ^(.*):(.*)$i i ( t
_nportprogR% R RU R RV Rs R ( Rf t defportR R R t nport( ( s D:\Python27_64\lib\urllib.pyR | s
c C sY t d k r* d d l... | Python | 1 |
class Colors:
dark_grey = (26, 31, 40)
green = (47, 230, 23)
red = (232, 18, 18)
orange = (226, 116, 17)
yellow = (237, 234, 4)
purple = (166, 0, 247)
cyan = (21, 204, 209)
blue = (13, 64, 216)
white = (255,255,255)
dark_blue = (44,44,127)
light_blue = (59,85,162)
@class... | Python | 1 |
IgnoreArgs => pandoc.args(&["--ignore-args"]),
Verbose => pandoc.args(&["--verbose"]),
}
}
}
/// equivalent to the latex document class
#[derive(Debug, Clone)]
pub enum DocumentClass {
/// compact form of report
Article,
/// abstract + chapt... | Rust | 0 |
mory.
/// Read only access (e.g. by directly uploading it to the GPU) is permitted for the lifetime of
/// the buffer instance.
/// Acquiring ownership of the data in userspace is not possible, so it has to be copied.
pub struct MappedBuffer<'a> {
view: &'a [u8],
metadata: buffer::Metadata,
}
impl<'a> MappedBu... | Rust | 0 |
dentifier>
{
self.source
}
}
impl UnitEntity for ProcessingUnitEntity
{
}
impl ProcessingUnitEntity
{
#[inline(always)]
fn choose_minimum_b_length(specification_version: Version) -> usize
{
if likely!(specification_version.is_1_1_or_greater())
{
10
}
else
{
9
}
}
#[allow(missing_docs)]
... | Rust | 0 |
(|| anyhow!("GameLoop: Loop is None"))?,
)?;
Ok(())
}
}
pub struct KeyState {
pressed_keys: HashMap<String, web_sys::KeyboardEvent>,
}
impl KeyState {
fn new() -> Self {
return KeyState {
pressed_keys: HashMap::new(),
};
}
pub fn is_pressed(&self, code:... | Rust | 0 |
edge_ids_Params,
pub par_iter_edges: Par_iter_edges_Params,
pub iter_edges_with_type_ids: Iter_edges_with_type_ids_Params,
pub iter_edges_with_type: Iter_edges_with_type_Params,
pub par_iter_edge_with_type: Par_iter_edge_with_type_Params,
pub par_iter_edge_with_type_ids: Par_iter_edge_with_type_ids_Params,
pub pa... | Rust | 0 |
[]
printer.print_grammar_ast(rules, printer=lines.append)
output = "\n".join(lines)
expected_output = textwrap.dedent(
"""\
└──Rule
└──Rhs
└──Alt
├──NamedItem
│ └──NameLeaf('a')
└──NamedItem
... | Python | 1 |
.unwrap_or_else(|| panic!("{} did not have a library", name));
// We see the newest version first. Any subsequent
// versions will have their version appended so that they
// are uniquely named
let exposed_name = if first {
crate_name.clone()
... | Rust | 0 |
from __future__ import annotations
from typing import Dict, Any, List
import os
from core.input.entity import InputEntity
from core.input.dto import InputResult, InputFile, InputArguments
from exceptions import PathIncorrect, IncorrectExt
from config.enum import EXTENSIONAL
class InputProcess:
def __init__(se... | Python | 1 |
u64,
raft_nodes: &[u64],
) -> Result<()>;
async fn key_ranges(&self) -> Result<Vec<KeyRange>>;
async fn in_range(&self, key: &[u8]) -> Result<Option<(KeyRange, u64, Vec<u64>)>>;
async fn all_in_range(&self, keys: &[&[u8]]) -> Result<Option<(KeyRange, u64, Vec<u64>)>>;
async fn update_ra... | Rust | 0 |
1)?;
let lpt1 = (s1 as u128)
.checked_mul(rlpt as u128)?
.checked_div(rs_prime as u128)? as u64;
let rlpt = rlpt.checked_add(lpt1)?;
let (_a2, _b2, s2) = Self::_rake(delta_a, ra, rb, rs)?;
let ra = ra.checked_add(delta_a)?;
let rs_prime = rs.checked_sub(s2)?;
let lpt2 = (s2 as u128)... | Rust | 0 |
s solicitadas)")
return QueryType.CSV_ANALYSIS
# NOVA LÓGICA: Se há dados no Supabase (mas não visualização ou stats), priorizar LLM analysis
if has_supabase_data and (csv_score > 0 or data_score > 0):
self.logger.info("🔄 Redirecionando para LLM analysis (dados no Supab... | Python | 1 |
f finetuning_args.include_effective_tokens_per_second:
train_result.metrics["effective_tokens_per_sec"] = cal_effective_tokens(
effective_token_num, train_result.metrics["epoch"], train_result.metrics["train_runtime"]
)
trainer.save_model()
trainer.log_metrics("t... | Python | 1 |
mut io = MetaIoHandler::default();
let rpc = RpcSolImpl;
io.extend_with(rpc.to_delegate());
let meta = Meta {
request_processor,
cluster_info,
drone_addr,
rpc_addr,
};
(io, meta, last_id, alice)
}
#[test]
fn test_rpc_n... | Rust | 0 |
p = np.array(warp_data, dtype=dtype).reshape(warp_shape)
expected = [[[0.0], [0.0]]]
self._assertForwardOpMatchesExpected(input_np, warp_np, expected)
expected_grad_data = [[[[0.81], [0.0]], [[0.09], [0.0]]]]
expected_grad_warp = [[[10.30, 2.7], [0.0, 0.0]]]
grad_output = np.ones([1, 2, ... | Python | 1 |
from turtle import *
state = {"turn": 0}
def spinner():
clear()
angle = state["turn"] / 10
right(angle)
forward(100)
dot(120, "red")
back(100)
right(120)
forward(100)
dot(120, "green")
back(100)
right(120)
forward(100)
dot(120, "blue")
back(100)
right(120)
... | Python | 1 |
rsion3MixerUnitEntity.rs");
include!("Version3MultiplierClockEntity.rs");
include!("Version3OutputTerminalEntity.rs");
include!("Version3PowerDomainEntity.rs");
include!("Version3ProcessingUnitEntity.rs");
include!("Version3SamplingRateConverterUnitEntity.rs");
include!("Version3SelectorClockEntity.rs");
include!("Vers... | Rust | 0 |
derive(Clone)]
pub struct BandedRangeGenerator<R, G> {
uniform: Uniform<usize>,
band_size: usize,
inner: G,
rng: R,
}
impl<R, G> BandedRangeGenerator<R, G>
where
R: Rng,
G: RangeGenerator,
{
#[allow(dead_code)]
pub fn new(rng: R, band_range_gen: G, band_size: usize) -> Self {
Ba... | Rust | 0 |
/// unimplemented
pub fn supervisor_software() {
panic!("Supervisor software: {:08x}", sepc::read());
}
/// S态外部中断
#[naked]
#[link_section = ".text"]
pub unsafe extern "C" fn supervisor_external() {
asm!(
save_non_switch!(),
"mv a0, sp",
"call {supervisor_external}",
resto... | Rust | 0 |
soning': reasoning
}])
], ignore_index=True)
print(f"🎯 Moon Dev's AI Analysis Complete for {token[:4]}!")
return response
except Exception as e:
print(f"❌ Error in AI analysis: {str(e)}")
# Still add to DataFr... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.