text string | label_name string | labels int64 |
|---|---|---|
ce_4n90tv6v as sqgq3e1hhdx, shu2mduyvsl as gfnq_x9gnfb, wvd13zrpx1c, s8fa480i8f4, cvsf2cn_gtc as gpo4ts029i3, pqz55qvp3mv, opot03h32k3 as hufg95_6e6d
u926l4q0h8f
import n5fe359kasd, hyrf7l78hyw as vk30ib95ljq, gntcj6kkokb as vr9bjlhn__c
del c195jonysyv
0.0[0] //= z78xtnf3qwg
(s9ay5gpqa_r): nqdadsjcw... | Python | 1 |
parent_directories(path.as_ref())?;
let mut header = TarHeader::new_gnu();
header.set_mtime(self.time);
header.set_path(path)?;
header.set_mode(chmod);
header.set_size(out_data.len() as u64);
header.set_cksum();
self.tar.append(&header, out_data)?;
Ok(())... | Rust | 0 |
, solve_part2_captcha("1221"));
}
#[test]
fn part2_example3() {
assert_eq!(4, solve_part2_captcha("123425"));
}
#[test]
fn part2_example4() {
assert_eq!(12, solve_part2_captcha("123123"));
}
#[test]
fn part2_example5() {
assert_eq!(4, solve_part2_captcha("1... | Rust | 0 |
pub fn as_eb_read(&self, start: i32, size: i32, buff: &mut [u8]) -> Result<()> {
let res = unsafe {
Cli_AsEBRead(
self.handle,
start as c_int,
size as c_int,
buff as *mut [u8] as *mut c_void,
)
};
if res == ... | Rust | 0 |
Resource) -> Self {
Self {
tracked_resource,
properties: None,
system_data: None,
}
}
}
#[doc = "The LiveEvent action input parameter definition."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct LiveEventActionInput {
#[doc = "T... | Rust | 0 |
let mut is_disease_inverted = false;
let mut is_item_consumed = false;
let mut is_jacket_off = false;
let mut frame_time;
let mut now;
let mut console_update_counter = 0.;
let person = init_zara_instance();
register_side_effects(&person, &mut state);
... | Rust | 0 |
update_outputs:
tmp = graph.get_tensor_by_name(incr_update_outputs[tmp_key].name)
tensor_info_incr_update_outputs[tmp_key] = \
tf.saved_model.utils.build_tensor_info(tmp)
incr_update_signature = (
tf.saved_model.signature_def_utils.build_signature_def(
inputs=tensor_info_in... | Python | 1 |
from django.shortcuts import render
from .forms import UserRegisterForm
# Псевдо-список существующих пользователей
existing_users = ["user1", "user2", "user3"]
def sign_up_by_django(request):
info = {}
if request.method == "POST":
form = UserRegisterForm(request.POST)
if form.is_valid():
... | Python | 1 |
import json
from dvclive import Live
from dvclive.plots.custom import CustomPlot
def test_log_custom_plot(tmp_dir):
live = Live()
out = tmp_dir / live.plots_dir / CustomPlot.subfolder
datapoints = [{"x": 1, "y": 2}, {"x": 3, "y": 4}]
live.log_plot(
"custom_linear",
datapoints,
... | Python | 1 |
visit_pat_tuple(_binding_0);
}
Pat::TupleStruct(_binding_0) => {
v.visit_pat_tuple_struct(_binding_0);
}
Pat::Type(_binding_0) => {
v.visit_pat_type(_binding_0);
}
Pat::Verbatim(_binding_0) => {
skip!(_binding_0);
}
Pat:... | Rust | 0 |
es += [meter.summary() for meter in self.meters]
print(" ".join(entries))
def _get_batch_fmtstr(self, num_batches):
num_digits = len(str(num_batches // 1))
fmt = "{:" + str(num_digits) + "d}"
return "[" + fmt + "/" + fmt.format(num_batches) + "]"
def dict_to_cuda(input_dict):
... | Python | 1 |
str data for Cesu8Str");
assert_eq!(std.bytes.len(), 7, "string length was not as expected");
}
// not enough space
{
// buffer shouldn't even be used - leave it at length 0
let mut buf = [0; 0];
// needs to be Java variant to prevent borrowing from `text`
let res =... | Rust | 0 |
from django.db.migrations.operations.base import Operation
from .signals import composite_type_created
__all__ = ["BaseOperation"]
def sql_field_definition(field_name, field, schema_editor):
quoted_name = schema_editor.quote_name(field_name)
db_type = field.db_type(schema_editor.connection)
return f"{qu... | Python | 1 |
import torch
import triton
from sglang.srt.layers.moe.ep_moe.kernels import post_reorder_triton_kernel
batch_sizes = [64, 128, 256, 512, 640, 768, 1024, 2048, 4096]
configs = [(bs,) for bs in batch_sizes]
@triton.testing.perf_report(
triton.testing.Benchmark(
x_names=["batch_size"],
x_vals=[list... | Python | 1 |
xp_needed;
skill.next_level_percentage = (skill.next_level_progress * 100.0) / next_level_xp_needed;
}
}
fn calculate_skill_next_level_xp_neeeded(skill: &mut Skill, world_skill: &WorldSkill) -> f64 {
(100.0 + (4.0 * skill.level * skill.level)) as f64 * world_skill.xp_req_modifier
}
fn gain_stat_xp(gam... | Rust | 0 |
ot self.label_manager.has_regions:
# if we train with regions all segmentation heads predict some kind of foreground. In conventional
# (softmax training) there needs tobe one output for the background. We are not interested in the
# background Dice
# [1:] in order to rem... | Python | 1 |
# There are 5280 feet in a mile. Write a Python statement that calculates
# and prints the number of feet in 13 miles.
miles = 13
print(miles * 5280) | Python | 1 |
map.insert('\\', r#"\textbackslash"#);
map.insert('^', r#"\textasciicircum"#);
map.insert('_', r#"\_"#);
map.insert('~', r#"\~"#);
map.insert('$', r#"\$"#);
map.insert('{', r#"\{"#);
map.insert('}', r#"\}"#);
map.insert('#', r#"\#"#);
map.insert('&', r#"\&"#);
map.insert('%', r#"\%"#... | Rust | 0 |
self) -> RequestId {
RequestId::new(self.inner_command.get_request_id())
}
pub fn get_error(&self) -> ServerError {
self.inner_command.get_error().into()
}
pub fn get_message(&self) -> &str {
self.inner_command.get_message()
}
}
<reponame>deuszx/ibc-rs<gh_stars>1-10
use eyr... | Rust | 0 |
from keras_hub.src.api_export import keras_hub_export
from keras_hub.src.metrics.rouge_base import RougeBase
@keras_hub_export("keras_hub.metrics.RougeN")
class RougeN(RougeBase):
"""ROUGE-N metric.
This class implements the ROUGE-N variant of the ROUGE metric. The ROUGE-N
metric is traditionally used fo... | Python | 1 |
}
cntr_acct.adjust_balance(trigger.call_value).unwrap();
}
if trigger.call_token_value > 0 {
if owner_acct
.adjust_token_balance(trigger.call_token_id, -trigger.call_token_value)
.is_err()
{
return Err("insu... | Rust | 0 |
/// Private
/// Foo => { &0u32 },
/// /// Public
/// pub Bar => { &1u32 },
/// /// Unsafe and generic
/// {unsafe} pub Qux { num: &'a u32 } => { num }
/// } as pub UnsafeEnum ['a] impl Into<&'a u32>
/// }
/// ```
///
/// expands to:
/// ```
/// #[derive(Debug)]
/// enum UnsafeEnumInner<'a> {
/// Foo,
/// B... | Rust | 0 |
random activation functions for each node
node_fn = jr.categorical(key, jnp.ones(len(act_fns)) / len(act_fns), shape=(total_nodes,))
# output nodes should not have activation functions
node_fn = node_fn.at[-n_outputs:].set(0)
node_fn = node_fn.at[:n_inputs].set(0)
# Minimal rand... | Python | 1 |
a=int(input())
if(a%4==0 and a%100!=0):
print("YES")
elif (a%400==0):
print("YES")
else:
print("NO") | Python | 1 |
ARE_H1),
bishops: (SQUARE_C1 | SQUARE_F1),
knights: (SQUARE_B1 | SQUARE_G1),
pawns: RANK_2
};
pub const BLACK_START: Pieces = Pieces {
all: (RANK_7 | RANK_8),
king: SQUARE_E8,
queens: SQUARE_D8,
rooks: (SQUARE_A8 | SQUARE_H8),
bishops: (SQUARE_C8 | SQUARE_F8),
knights: (SQUARE_B8 | ... | Rust | 0 |
mages)
)
tags += ["force converged" if is_force_conv else "forces not converged"]
tags += [f"elapsed time {t_f - t_i} seconds"]
return NebResult(
images=images,
image_indices=list(range(len(images))),
initial_images=initial_images,
energie... | Python | 1 |
version, VersionTriplet(18, 27, 1));
assert!(version > VersionTriplet(17, 27, 1));
assert!(version > VersionTriplet(18, 26, 1));
assert!(version > VersionTriplet(18, 27, 0));
}
}
<filename>examples/simple/src/not_covered.rs
use mutagen::mutate;
#[cfg_attr(test, mutate)]
pub fn simple_assert... | Rust | 0 |
dynamic_decoder"](
features, is_training=False)
save_topview(
idx,
static_tv,
os.path.join(
args.out_dir,
"static",
"{}.png".format(output_name)))
... | Python | 1 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""File for Message object and associated functions.
The Message object's key function is to prevent users from editing
... | Python | 1 |
_BITS: u32 = 8;
pub const SPI_SSPIMSC_TXIM_MSB: u32 = 3;
pub const SPI_SSPIMSC_TXIM_LSB: u32 = 3;
pub const SPI_SSPIMSC_TXIM_ACCESS: &'static [u8; 3usize] = b"RW\0";
pub const SPI_SSPIMSC_RXIM_RESET: u32 = 0;
pub const SPI_SSPIMSC_RXIM_BITS: u32 = 4;
pub const SPI_SSPIMSC_RXIM_MSB: u32 = 2;
pub const SPI_SSPIMSC_RXIM_L... | Rust | 0 |
result = calculate_factorial(num)
print(f"{num}! = {result}")
# 测试练习4:斐波那契数列
print("\n练习4:斐波那契数列测试")
fib_sequences = [0, 1, 8, 10]
for n in fib_sequences:
result = fibonacci_sequence(n)
print(f"前{n}项斐波那契数列: {result}")
# 测试练习5:数字统计
print("\n练习5:数字统计测试")
... | Python | 1 |
import os
import sys
import unittest
import dragon
from dragon.native.process import Popen
from dragon.data.ddict.ddict import DDict
from dragon.native.machine import System, Node
from dragon.infrastructure.policy import Policy
from dragon.infrastructure.facts import DRAGON_LIB_DIR
import multiprocessing as mp
ENV = d... | Python | 1 |
rc/bin/kvs.rs<gh_stars>0
fn main() -> kvs::Result<()> {
kvs::run()?;
Ok(())
}
<reponame>thibault-martinez/iota.rs
pub use crate::{
iota_client, iota_constants, iota_conversion, iota_crypto, iota_model, iota_pow, iota_signing,
iota_utils, iota_validation,
};
/// This trait provides conversion methods for... | Rust | 0 |
{
use gtk::prelude::*;
let text = entry.get_text();
let stored = app.stored();
let map = stored.history();
let text = text.unwrap_or_else(|| String::new());
let history = app.history();
let count = history.search(&text, &map.model);
map.summary.set_text(&format!("{} {}",
count,... | Rust | 0 |
nodes = spawn_nodes(N, Topology::Mesh).await;
for node in &nodes {
assert_eq!(node.peers().await.unwrap().len(), N - 1);
}
}
#[tokio::test(max_threads = 1)]
async fn check_topology_star() {
let nodes = spawn_nodes(N, Topology::Star).await;
for (i, node) in node... | Rust | 0 |
TDH_HANDLE, eventrecord: *const EVENT_RECORD, propertyname: ::windows_sys::core::PCWSTR, buffersize: *mut u32, buffer: *mut u8) -> u32;
#[doc = "*Required features: `\"Win32_System_Diagnostics_Etw\"`*"]
pub fn TdhLoadManifest(manifest: ::windows_sys::core::PCWSTR) -> u32;
#[doc = "*Required features: `\"Wi... | Rust | 0 |
from dataset import CrossDocked2020_SBDD, collate_mols
from torch.utils.data import DataLoader
from rdkit import Chem
dataset = CrossDocked2020_SBDD()
atomic_num_to_type = {}
atomic_element_to_type = {}
for i in range(len(dataset)-1, -1, -1):
if i%1000 == 0:
print(i)
print(atomic_num_to_type)
... | Python | 1 |
(i, _) in extra_fds.iter().enumerate() {
let mut e = fds.reborrow().get(i as u32);
let r = &extra_fds[i];
e.set_tid(r.tid);
e.set_fd(r.fd);
}
map.set_skip_monitoring_mapped_fd(skip_monitoring_mapped_fd);
let mut src = m... | Rust | 0 |
a = 16
b = 17
if (a + b) == 3:
print((a + b))
else:
print((a - b))
if (a + b) == 3:
z = (a + b) + 10
else:
z = ((a - b) - 10)
x = z
print(x)
| Python | 1 |
from nonebot import on_command
from nonebot.params import CommandArg
from nonebot.adapters.onebot.v11 import (
Message,
GroupMessageEvent
)
from src.config import Config
from src.const.jx3.server import Server
from src.const.prompts import PROMPT
from .api import get_sandbox_image
sandbox_matcher = on_comman... | Python | 1 |
) GST_STATE_CHANGE_PLAYING_TO_PAUSED", "35"),
("(gint) GST_STATE_CHANGE_PLAYING_TO_PLAYING", "36"),
("(gint) GST_STATE_CHANGE_READY_TO_NULL", "17"),
("(gint) GST_STATE_CHANGE_READY_TO_PAUSED", "19"),
("(gint) GST_STATE_CHANGE_READY_TO_READY", "18"),
("(gint) GST_STATE_CHANGE_SUCCESS", "1"),
("(g... | Rust | 0 |
it.n = it.n.face_foward(&ns);
} else if self.reverse_orientation ^ self.transform_swapshandedness {
it.n *= -1.0;
}
// Compute error bounds for sampled point on triangle
let pabs_sum = (*p0 * b[0]).abs() + (*p1 * b[1]).abs() + (*p2 * (1.0 - b[0] - b[1])).abs();
it.p_... | Rust | 0 |
from app.core.date_utils import parse_relative_dates
from app.core.chat_history import get_session_history, chat_history_to_string
from app.core.recent_docs_cache import get_top_recent_docs
from app.core.retriever_factory import create_ensemble_retriever
from app.models.prompt_template import chatbot_rag_prompt
from ap... | Python | 1 |
LSN_GAUGE.with_label_values(&[&ztli_str]),
write_wal_bytes: WRITE_WAL_BYTES.with_label_values(&[&ztli_str]),
write_wal_seconds: WRITE_WAL_SECONDS.with_label_values(&[&ztli_str]),
}
}
fn new_noname() -> SafeKeeperMetrics {
SafeKeeperMetrics {
flush_lsn: FLUSH_... | Rust | 0 |
env __jni_bindgen::Env) -> __jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::java::lang::Character_UnicodeScript>> {
unsafe {
let (class, field) = env.require_class_static_field("java/lang/Character$UnicodeScript\0", "MEETEI_MAYEK\0", "Ljava/lang/Character$UnicodeScript;\0... | Rust | 0 |
W),
Reg::new("XC430-W240", V2, "DriveMode", 10, Byte, RW),
Reg::new("XC430-W240", V2, "OperatingMode", 11, Byte, RW),
Reg::new("XC430-W240", V2, "Secondary", 12, Byte, RW),
Reg::new("XC430-W240", V2, "ProtocolType", 13, Byte, RW),
Reg::new("XC430-W240", V2, "HomingOffset", 20, Word, RW),
Reg::ne... | Rust | 0 |
rate::Reg<scl_low_period::SCL_LOW_PERIOD_SPEC>,
#[doc = "0x04 - I2C_CTR_REG"]
pub ctr: crate::Reg<ctr::CTR_SPEC>,
#[doc = "0x08 - I2C_SR_REG"]
pub sr: crate::Reg<sr::SR_SPEC>,
#[doc = "0x0c - I2C_TO_REG"]
pub to: crate::Reg<to::TO_SPEC>,
#[doc = "0x10 - I2C_SLAVE_ADDR_REG"]
pub slave_add... | Rust | 0 |
poll(&mut self) -> Poll<Self::Item, Self::Error> {
loop {
match mem::replace(&mut self.inner, FutureInner::Poisoned) {
FutureInner::Sending {
mut substream,
mut message,
} => {
match substream.write_buf(&mut... | Rust | 0 |