text string | label_name string | labels int64 |
|---|---|---|
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import hello_pb2 as hello__pb2
class GreeterStub(object):
"""定义服务
"""
def __init__(self, channel):
"""Constructor.
Args:
... | Python | 1 |
_INIT, AtomicUsize, Ordering};
use traits::{ThreadId, Trace, TraceId};
use ring_buffer::RingBuffer;
/// A simple `Trace` type for tests, benches, and to serve as an example.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum SimpleTrace {
/// Some one off "foo" event.
FooEvent,
/// Some "thing" operatio... | Rust | 0 |
es completely
continue;
}
result.push(pred.clone().subst(substs).to_chalk(db));
}
result
}
pub(super) fn generic_predicate_to_inline_bound(
db: &dyn HirDatabase,
pred: &GenericPredicate,
self_ty: &Ty,
) -> Option<rust_ir::InlineBound<Interner>> {
// An InlineBound is... | 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
class DeleteAilySessionRequest(BaseRequest):
def __init__(self) -> None:
super().__init__... | Python | 1 |
gn(csmaDevices)
address.SetBase(ns.network.Ipv4Address("10.1.3.0"), ns.network.Ipv4Mask("255.255.255.0"))
address.Assign(staDevices)
address.Assign(apDevices)
echoServer = ns.applications.UdpEchoServerHelper(9)
serverApps = echoServer.Install(csmaNodes.Get(nCsma.value))
serverApps.Start(ns.core.Seconds(1.0))
serverA... | Python | 1 |
base = i
break
i = start
while i < start + (3 if has_reph else 0):
set_pos(i, IndicPosition.AFTER_MAIN)
i += 1
while i < base:
set_pos(i, IndicPosition.PRE_C)
i += 1
if i < end:
set_pos(i, IndicPosition.BASE_... | Python | 1 |
from datetime import datetime
import logging
from roboquant.event import Event
from roboquant.feeds.feed import Feed
from roboquant.signal import Signal
from roboquant.strategies.strategy import Strategy
from roboquant.timeframe import Timeframe
logger = logging.getLogger(__name__)
class CachedStrategy(Strategy):
... | Python | 1 |
"""
This is a file that allows sampling of a large dataset.
"""
import sys
sys.path.insert(0, 'C:/Users/wb305167/OneDrive - WBG/python_latest/Tax-Revenue-Analysis')
#from stata_python import *
import pandas as pd
import numpy as np
pit_df_2021=pd.read_csv('taxcalc/pit_armenia_full_mortgage_updated1.csv')
pit_df_2021[... | Python | 1 |
import asyncio
import importlib
from pyrogram import idle
from pytgcalls.exceptions import NoActiveGroupCall
import config
from JaniMusic import LOGGER, app, userbot
from JaniMusic.core.call import Jani
from JaniMusic.misc import sudo
from JaniMusic.plugins import ALL_MODULES
from JaniMusic.utils.database import get_... | Python | 1 |
import os
import datetime
import re
from crosshair.main import long_describe_message
from src import ROOT_PATH
LOGS_PATH = os.path.join(ROOT_PATH, "logs")
def _remove_ansi(text):
ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
return ansi_escape.sub('', text)
def log_analysis_results(targe... | Python | 1 |
del:
logger.info(f"Generating response using loaded model: {self.llm_model_name}")
try:
# TODO: Make generation parameters (max_new_tokens, temp, etc.) configurable
# Simple prompt formatting - adjust as needed for your model
prompt = f"User: {quer... | Python | 1 |
:
# Transform streaming completion response to generate_content format
transformed_stream = GOOGLE_GENAI_ADAPTER.translate_completion_output_params_streaming(
completion_response
)
if transformed_stream is not None:
... | Python | 1 |
"""
Read and plot transient data
============================
"""
from pathlib import Path
import matplotlib.pyplot as plt
import pandas as pd
import vallenae as vae
HERE = Path(__file__).parent if "__file__" in locals() else Path.cwd()
TRADB = HERE / "1p12_Ft_25000.tradb" # uncompressed
TRAI = 1 # just an example... | Python | 1 |
wait',
action='store_true')
self.parser.add_argument(
'--max-wait',
type=int,
default=60)
self.parser.add_argument(
'--timeout',
type=int)
self.parser.add_argument(
'-v',
'--verbose',
acti... | Python | 1 |
static mut [u8; 64],
}
impl<U: 'static + hil::usb::UsbController<'static>> CtapComponent<U> {
pub fn new(
usb: &'static U,
vendor_id: u16,
product_id: u16,
strings: &'static [&'static str; 3],
board_kernel: &'static kernel::Kernel,
send_buffer: &'static mut [u8; 64],... | Rust | 0 |
# Copyright (c) 2024
# United States Army Corps of Engineers - Hydrologic Engineering Center (USACE/HEC)
# All Rights Reserved. USACE PROPRIETARY/CONFIDENTIAL.
# Source may not be released without written approval from HEC
import json
from datetime import datetime
import cwms
cwms.api.init_session(
api_root=... | Python | 1 |
nia_assert_nequal(interned, gensym3);
nia_assert_nequal(gensym1, gensym2);
nia_assert_nequal(gensym1, gensym3);
nia_assert_nequal(gensym2, gensym3);
}
#[test]
fn returns_invalid_argument_error_when_attempts_to_gensym_special_symbols()
{
let mut interpreter = I... | Rust | 0 |
o are:
// - Different peers can use different IDs to describe the same agent IDs
// - If different peers see concurrent operations in different orders, the ops will have
// different order numbers assigned
let agent_a_to_b = agent_map_from(self, other);
// let agent_b_to_a = a... | Rust | 0 |
data>
</edge>
<node id="example.motd#BadDateValue">
<data key="type">structure</data>
</node>
<edge id="e1" source="example.motd#BadDateValue" target="smithy.api#error">
<data key="trait">true</data>
</edge>
<edge id="e2" source="example.motd#BadDa... | Rust | 0 |
"difficulty city": sample['difficulty_city'],
"city line count": sample['city_line_count'],
"city transfer count": sample['city_transfer_count']}, f, ensure_ascii=False, indent=4)
# clean cache
torch.cuda.empty_cache()
# tool code for load previous answer, use for test
... | Python | 1 |
from dataclasses import dataclass, field
from mjlab.rl import (
RslRlOnPolicyRunnerCfg,
RslRlPpoActorCriticCfg,
RslRlPpoAlgorithmCfg,
)
@dataclass
class UnitreeG1PPORunnerCfg(RslRlOnPolicyRunnerCfg):
policy: RslRlPpoActorCriticCfg = field(
default_factory=lambda: RslRlPpoActorCriticCfg(
init_noise_... | Python | 1 |
not stop in time.")
# Terminate any remaining rclone processes forcefully
for job_id, process in list(server.rclone_processes_state.items()): # type: ignore
if process.poll() is None: # If still running
server.logger.warning(f"Job {job_id} (PID {process.pid}): Force terminating rclone ... | Python | 1 |
import boto3 # The AWS SDK for python
from PIL import Image, ImageDraw, ImageFont# Python Imaging Library
def detect_labels(bucket, photo):
client = boto3.client('rekognition') # Creates a Rekognition client to interact with Amazon Rekognition
response = client.detect_labels(Image={'S3Object': {'Bucket': buck... | Python | 1 |
#!/usr/bin/python
import os,sys
import pyiec61850 as iec61850
if __name__=="__main__":
hostname = "localhost";
tcpPort = 102
if len(sys.argv)>1:
hostname = sys.argv[1]
if len(sys.argv)>2:
port = sys.argv[2]
con = iec61850.IedConnection_create()
error = iec61850.IedConnection_connect(con, hostname, tcpPort)
i... | Python | 1 |
########################################################
#
#
#######################################################
import time
import os, fnmatch
import sys
import shutil
import datetime
inc_file_list = []
revert_inc_file_list = {}
funcfilters = {}
######################################################### ... | Python | 1 |
i32),
}
impl fmt::Display for PropMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"PropMode::{}",
match *self {
PropMode::Replace => "Replace",
PropMode::Prepend => "Prepend",
PropMode::Append => "A... | Rust | 0 |
ags(0x0101, 0x1000)
ChrClearFlags(0x0101, 0x0004)
ChrWalkTo(0x0101, 18220, -1800, 10840, 3000, 0x00)
ChrTurnDirection(0x0101, 0x0102, 400)
@scena.Lambda('lambda_511C')
def lambda_511C():
ChrTurnDirection(0x00FE, 0x0102, 400)
Yield()
Jump('lambda_511C')
DispatchAsync2(0... | Python | 1 |
fn clone(&self) -> Self {
Index(self.0, PhantomData)
}
}
impl<T> Copy for Index<T> {}
#[allow(dead_code)]
impl<T> Arena<T> {
pub fn new() -> Self {
Arena(generational_arena::Arena::new())
}
pub fn with_capacity(n: usize) -> Self {
Arena(generational_arena::Arena::with_capac... | Rust | 0 |
http);
}
#[cargo_test]
fn registry_index_rejected_git() {
registry_index_rejected(cargo_stable);
}
fn registry_index_rejected(cargo: fn(&Project, &str) -> Execs) {
Package::new("dep", "0.1.0").publish();
let p = project()
.file(
".cargo/config",
r#"
[registry]
... | Rust | 0 |
Application,
ManagedIdentity,
Key,
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ErrorResponse {
#[serde(skip_serializing)]
pub code: Option<String>,
#[serde(skip_serializing)]
pub message: Option<String>,
#[serde(skip_serializing)]
pub target: O... | Rust | 0 |
url.host_str() {
Some(host_str) => host_str,
None => return Err(anyhow!("TCP connect URL should have a host")),
};
let duplexer = TcpStream::connect((host_str, port))?;
let duplexer = StreamDuplexer::tcp_stream(duplexer);
return Ok(Interactive {
nam... | Rust | 0 |
class ConfirmPage:
def __init__(self, driver):
self.driver = driver | Python | 1 |
11 & (0xff as u64)) as u8);
let x13: u64 = (x11 >> 8);
let x14: u8 = ((x13 & (0xff as u64)) as u8);
let x15: u64 = (x13 >> 8);
let x16: u8 = ((x15 & (0xff as u64)) as u8);
let x17: u8 = ((x15 >> 8) as u8);
let x18: u8 = ((x2 & (0xff as u64)) as u8);
let x19: u64 = (x2 >> 8);
let x20: u8 ... | Rust | 0 |
if !buf.is_empty() {
future::ok(Some(buf.len() as u64))
} else {
future::ok(None)
}
}
<reponame>vernonrj/codesearch-rs
// Copyright 2016 <NAME>. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
use std::io::{self... | Rust | 0 |
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( arr , n ) :
arr.sort ( )
return ( arr [ n - 1 ] + arr [ n - 2 ] + arr [ n - 3 ] )
#TOFILL
if __name__ ==... | Python | 1 |
import sys
import polars as pl
MAP_SIZE = 1000
SET_BUILD_FACTOR = 10 * MAP_SIZE
distr_order = [
"u32",
"u32pair",
"u64",
"u64lobits",
"u64hibits",
"u64pair",
"ipv4",
"ipv6",
"rgba",
"strenglishword",
"struuid",
"strurl",
"strdate",
"accesslog",
"kilobyte",
... | Python | 1 |
def arithmetic_arranger(problems, show_answers=False):
if len(problems) > 5:
return "Error: Too many problems."
first_line = []
second_line = []
dashes = []
results = []
for problem in problems:
parts = problem.split()
if len(parts) != 3:
return "Error: Each... | Python | 1 |
}}
}});
}}).call(this, require || RequireJS.require);
</script>'''
new_paths = []
for module in path_overrides:
# Calculate the full URL, including any hashes added to the filename by the pipeline.
# This will also include the base static URL (for example, "/static/... | Python | 1 |
\xf3\x9f\x8b\x7f\xff\xfb\xdfSq\xcf\
\xee{\xe1\x85\x17..\xba\xe8\xa2\xc5\x13\x9e\xf0\x84\xd3\
\xc5\xf6S\x9f\xfa\xd4\xc53\x9f\xf9\xcc\xc5\xb3\x9f\xfd\xec\
\xc5\xf3\x9e\xf7\xbc\xc5\x8b^\xf4\xa2\xa9\xbc\xf0\x85/\x5c\
<\xebY\xcfZ<\xe3\x19\xcf\x98\x8e=\xe5)O\xf9\
\x7f\xd7_p\xc1\x05S9\xa98\xb1\xe4P\xad\x83\x0c\
\xc7\x81\xff\x... | Python | 1 |
import pyttsx3 #pip install pyttx3
import datetime
import speech_recognition as sr #pip installsp
import wikipedia
import webbrowser
import os
name = "Alok kumar"
engine = pyttsx3.init("sapi5")
voices = engine.getproperty("voices")
engine.setproperty ("voice",voices[0].id)
def speak(audio):
engine.say(audio)
... | Python | 1 |
ldcard_attributes = []
self.available_properties = ['children', 'id', 'align', 'className', 'class_name', 'key', 'lg', 'loading_state', 'md', 'sm', 'style', 'width', 'xl', 'xs', 'xxl']
self.available_wildcard_properties = []
_explicit_args = kwargs.pop('_explicit_args')
... | Python | 1 |
val_loader = torch.utils.data.DataLoader(
datasets.ImageFolder(valdir, test_transform),
batch_size=100,
shuffle=False,
num_workers=24,
pin_memory=True)
loss, acc1 = test(net, val_loader, mark='imagenet-r')
print("loss: ",loss, ... | Python | 1 |
event_manager.add_subscriber(balloon.clone()).unwrap();
// Push a queue event, use the inflate queue in this test.
{
let addr = 0x100;
set_request(&infq, 0, addr, 4, 0);
balloon.lock().unwrap().queue_evts[INFLATE_INDEX]
.write(1)
.u... | Rust | 0 |
apply_lora_to_mlp=apply_lora_to_mlp,
apply_lora_to_output=apply_lora_to_output,
num_classes=1,
vocab_size=32_000,
num_layers=32,
num_heads=32,
num_kv_heads=32,
embed_dim=4096,
max_seq_len=4096,
attn_dropout=0.0,
norm_eps=1e-5,
... | Python | 1 |
transmute(f);
f(&Entry::from_glib_borrow(this).downcast_unchecked())
}
unsafe extern "C" fn notify_overwrite_mode_trampoline<P>(this: *mut ffi::GtkEntry, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Entry> {
let f: &&(Fn(&P) + 'static) = transmute(f);
f(&Entry::from_glib_borrow(thi... | Rust | 0 |
eqwest::Client::new();
let mut res = client
.get(&url)
.header(header::AUTHORIZATION, authorization)
.send()
.context(ErrorKind::N26GetTransactions)?;
let body = res.text().context(ErrorKind::N26GetTransactions)?;
if !res.status().is_success() {
... | Rust | 0 |
it's dropped.
file.flush().await?;
drop(file);
Ok(path)
}
async fn rename(&self, path_from: &Path, path_to: &Path) -> io::Result<()> {
tokio::fs::rename(path_from, path_to).await
}
async fn create_dir_all(&self, path: &Path) -> io::Result<()> {
tokio::fs::creat... | Rust | 0 |
d)
thresh_quant_rec = int(dynapcnn.sequence[idx+1].spk_layer.spike_threshold)
block.activation_ff = IAFSqueeze(batch_size=1, spike_threshold=thresh_quant_ff, min_v_mem=-thresh_quant_ff, reset_fn=MembraneReset())
block.activation_rec = IAFSqueeze(batch_size=1, spike_thres... | Python | 1 |
::transmute_copy(&c)
}
/// Same as `as_ref` but creates a mutable reference to the given type as a `Tensor`.
///
/// It is only valid to convert `T` to another composite type `U` that is the same as `T` but
/// is allowed to contain Tensor wrappers.
pub(crate) unsafe fn as_mut<U: ?Sized>(c: &mu... | Rust | 0 |
-> AnimId {uid!()}
pub fn anim_down() -> AnimId {uid!()}
pub fn shader_bg() -> ShaderId {uid!()}
pub fn instance_border_color() -> InstanceColor {uid!()}
pub fn instance_glow_size() -> InstanceFloat {uid!()}
pub fn theme(cx: &mut Cx) {
Self::layout_bg().set_base(cx, Layout {
... | Rust | 0 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES2 import _types as _cs
# End users want this...
from OpenGL.raw.GLES2._types import *
from OpenGL.raw.GLES2 import _errors
from OpenGL.constant import Constant as _C
import... | Python | 1 |
defined separately for src and tgt (then list or tuple)
Returns:
np.array: filtered sample array
list: list of removed indices
"""
if isinstance(max_sizes, float) or isinstance(max_sizes, int):
if hasattr(self, 'sizes') and isinstance(self.sizes, np.ndarray)... | Python | 1 |
(|e| e.into()),
DatasetStrId::Temporary(id) => {
Ok(self.extra.borrow().try_resolve(&id).map(|e| e.to_owned()))
}
}
}
fn get_str_id(&self, value: &str) -> Result<Option<DatasetStrId<S::StrId>>, EvaluationError> {
if let Some(id) = self.extra.borrow().get(... | Rust | 0 |
import heapq
def dijkstra(matrix, start, end):
rows, cols = len(matrix), len(matrix[0])
directions = [(0, 1), (0, -1), (1, 0), (-1, 0)] # Right, Left, Down, Up
def get_district(i, j):
if i <= 1: return 1
if i <= 5: return 2
return 3
def valid(i, j):
return 0 <= i < r... | Python | 1 |
f not start_date or not end_date:
logger.error("Invalid date format")
return
# Initialize pipelines
sourcing_pipeline = CryptoEventPipeline(
exa_api_key=exa_api_key,
openai_api_key=openai_api_key,
openai_model="gpt-4o-mini",
)
ranking_pipeline = CryptoEventRanki... | Python | 1 |
)
await self.render("tpl_run_failed.html", log=str(e))
return
class GetGroupHandler(BaseHandler):
@authenticated
async def get(self, taskid): # pylint: disable=unused-argument
user = self.current_user
_groups = {}
for task in await self.db.task.list... | Python | 1 |
e == 0
assert 'Commands' in result.stdout
# Test subcommand help for each major command
subcommands = ['generate', 'template', 'init', 'review', 'config', 'usage', 'budget']
for subcmd in subcommands:
result = cli_runner.invoke(app, [subcmd, '--help'])
... | Python | 1 |
6919, 0.57735026919, 0.57735026919, 0.0],
[-0.57735026919, -0.57735026919, 0.57735026919, 0.0],
[ 0.57735026919, 0.57735026919, -0.57735026919, 0.0],
[ 0.57735026919, -0.57735026919, -0.57735026919, 0.0],
[-0.57735026919, 0.57735026919, -0.57735026919, 0.0],
[-0.57735026919, -0.57735026919, -0.... | Rust | 0 |
's Leader uses this to heartbeat PD.
fn region_heartbeat(
&self,
_term: u64,
_region: metapb::Region,
_leader: metapb::Peer,
_region_stat: RegionStat,
) -> PdFuture<()> {
unimplemented!();
}
/// Gets a stream of Region heartbeat response.
///
/// ... | Rust | 0 |
self.layers['l' + str(l) + 'h' + str(h)](mfgs[l][h])
if 'time_transform' in self.gnn_param and self.gnn_param['time_transform'] == 'JODIE':
rst = self.layers['l0h' + str(h) + 't'](rst, mfgs[l][h].srcdata['mem_ts'], mfgs[l][h].srcdata['ts'])
if l != self.gnn_param['la... | Python | 1 |
root.borrow_mut(j);
// *root = Some(up);
// &self.root
// }
// #[inline]
// fn find_dest_node_in<'a>(
// &'a self,
// n: Ptr<PmemObj<Node<V>>, P>,
// key: u64,
// p: &mut usize,
// j: &'a Journal<P>,
// ) -> Ptr<PmemObj<Node<V>>, P> {
// f... | Rust | 0 |
o initialization of residual
model = SCNet(50, out_indices=(0, 1, 2, 3), zero_init_residual=True)
model.init_weights()
for m in model.modules():
if isinstance(m, SCBottleneck):
assert all_zeros(m.norm3)
model.train()
imgs = torch.randn(2, 3, 224, 224)
feat = model(imgs)
... | Python | 1 |
Mode::SjLj));
} else if arg == ZEROCOST {
return Some(Ok(EhMode::Zerocost));
} else {
return Some(Err(format!("`{}` is an unknown eh handler",
arg)));
}
} else if arg == "--pnacl-allow-exceptions" {
// TODO(mseaborn): Remove "--pnacl-allow-exce... | Rust | 0 |
me(intersection) = get_intersection(cuboid, &subtractive_cuboid) {
//println!("intersection = {:#?}", intersection);
new_additive_cuboids.push(intersection);
}
}
additive_cuboids.extend(new_additive_cuboids);
subtractive_cuboids.extend(new_subtractive_... | Rust | 0 |
file = open('nums-2a.txt')
result = 0
for line in file:
line_splits = line.strip().split(',')
str_list = list(filter(None, line_splits))
int_list = list(map(int, str_list))
for line_split in int_list:
if int(line_split) % 2 != 0:
result = result + int(line_split)
print(f"La suma... | Python | 1 |
_base_ = [
'../_base_/datasets/kitti-3d-3class.py',
'../_base_/schedules/cyclic_40e.py', '../_base_/default_runtime.py'
]
voxel_size = [0.05, 0.05, 0.1]
model = dict(
type='SASSD',
voxel_layer=dict(
max_num_points=5,
point_cloud_range=[0, -40, -3, 70.4, 40, 1],
voxel_size=voxel... | Python | 1 |
x, batch_x_mark, dec_inp, batch_y_mark)
if self.args.inverse:
outputs = dataset_object.inverse_transform(outputs)
f_dim = -1 if self.args.features == 'MS' else 0
# batch_y: [batch, label_len+pred_len, 1]
batch_y = batch_y[:, -self.args.pred_len:, f_dim:].to(self.device)
... | Python | 1 |
"""
Demonstrates the appearance / interactivity of GradientWidget
(without actually doing anything useful with it)
"""
import pyqtgraph as pg
from pyqtgraph.Qt import QtWidgets
app = pg.mkQApp("Gradiant Widget Example")
w = QtWidgets.QMainWindow()
w.show()
w.setWindowTitle('pyqtgraph example: GradientWidget')
w.setG... | Python | 1 |
5jB\x8e\x1e\x8c%*T\xf9=\x9c\
\x1f4\xa2\xee\xa3h\xb7)6\xdcU\xef\xae\xfa\xdc\x83\
Z\xf1\xed\xff\x00\x88\xae|O\xa0\xf8\x0ek\xcf\x07\xfc\
(\xf8{4~\x1c\xd6~*i0\xac\xd7\x1e!h\
m\xa0\xb5\xbf\xf0\xbf\x82\xb5\xab\x93u\x1d\xaa\xcbz\x7f\
\xb2\xaeu\x9f&\xefV\xd5\xb5\x89\xeea\xd2\xed\x8a\xdb\
=\xe4\xde\x97s\xe2O\x86_\x00\xbc-m\xf1'... | Python | 1 |
s.
Therefore, we allow missing `scheme`, making it possible to pass a file
path without prefix.
If `scheme` is missing, we assume it is a local file path.
"""
scheme = parts['scheme']
if scheme is None:
# allow missing scheme, unlik... | Python | 1 |
from django.urls import path
from . import views
urlpatterns = [
path('home', views.page_accueil, name="home"),
path('ajouter',views.ajout, name="ajouter_un_etudiant"),
path('affiche', views.affiche, name="affiche"),
path('modifier/ <int:pk>/', views.modifier_e, name='modifier_Etudiant'),
path('d... | Python | 1 |
let mut reader = self.read();
let t = <T>::decode(&mut reader)?;
reader.expect_finished()?;
Ok(t)
}
}
impl AsRef<[u8]> for CborData {
fn as_ref(&self) -> &[u8] {
&self.0
}
}
impl<T> AsRef<[u8]> for CborDataOf<T> {
fn as_ref(&self) -> &[u8] {
&self.1
}
}... | Rust | 0 |
, ignore_index=-1)
# lm_head wasn't chunked, chunk cross entropy
logit_chunks = logits.split(chunk_size)
target_chunks = targets.split(chunk_size)
loss_chunks = [
torch.nn.functional.cross_entropy(logit_chunk, target_chunk, ignore_index=-1, reduction="none")
for logit_chunk, target_chun... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Odoo 16 Fiscal Year & Lock Date',
'version': '16.0.1.0.0',
'category': 'Accounting',
'summary': 'Odoo 16 Fiscal Year, Fiscal Year in Odoo 16, Lock Date in Odoo 16',
'description': 'Odoo 16 ... | Python | 1 |
334, x295, x292, x268);
*out1 = x296;
out2[0] = x7;
out2[1] = x8;
out2[2] = x9;
out2[3] = x10;
out2[4] = x11;
out2[5] = x12;
out2[6] = x13;
out2[7] = x14;
out2[8] = x15;
out2[9] = x16;
out2[10] = x17;
out2[11] = x18;
out2[12] = x19;
out3[0] = x298;
out3[1] = x299;
out3[2] = x300;
out... | Rust | 0 |
wrapped("Within a view window, use the left mouse button to change the orientation of the projected globe. \
Use the mouse wheel to zoom in/out.\n\n");
ui.separator();
if ui.button("Close") {
ui.close_current_popup();
}
});
if about_clicked { ui.open_popup("About"); }
ui... | Rust | 0 |
'gpdvega.tex', 'gpdvega Documentation',
'ilia timofeev', 'manual'),
]
# -- Options for manual page output ------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'gpdvega', 'gpdvega ... | Python | 1 |
/// A custom deserializer that converts a millisecond Unix timestamp format
/// to an [`OffsetDateTime`].
pub(crate) fn datetime_from_millis_timestamp<'de, D>(
deserializer: D,
) -> StdResult<OffsetDateTime, D::Error>
where
D: Deserializer<'de>,
{
const NANOSECONDS_PER_MILLISECOND: i128 = 1_000_000;
let r... | Rust | 0 |
value,
} => {
let (mut secret, secret_key_hex) = get_secret(&secret_id, &config)
.context("set_secret loading secret from store failed")?;
secret
.set_value(&secret_value_type, secret_new_value)
.context("set secret value failed")?;
... | Rust | 0 |
# EuroParl-ST
EP_LANGS = ["de", "en", "es", "fr", "it", "nl", "pl", "pt", "ro"]
# VoxPopuli
VP_FAMS = [
"germanic",
"uralic",
]
VP_LANGS = [
"cs",
"de",
"en",
"es",
"et",
"fi",
"fr",
"hr",
"hu",
"it",
"lt",
"nl",
"pl",
"pt",
"ro",
"sk",
"sl",... | Python | 1 |
.unwrap().1 .0, e);
assert_eq!(urldecode_ex(&i_lower, &cfg.decoder_cfg).unwrap().1 .0, e);
}
#[test]
fn DecodingTest_DecodePathInplace1_UrlencodedInvalidNotEnoughBytes() {
let mut cfg = Config::default();
cfg.set_url_encoding_invalid_handling(HtpUrlEncodingHandling::PROCESS_INVALID)... | Rust | 0 |
))
.and_then(|(o, ok)| self.2.run(ok.to_cont(config, drop)).map(|(_, ok)| (o, ok)))
})
}
}
/// Pass a value to chain the parser together with the parser result, and let the parser continue.
/// Even if `bind` returns a lot of parsers of different types, `case` does not need to use `Either` ... | Rust | 0 |
mmary.employee_tax_summary.get_ytd_data_until_month",
"payroll_indonesia.payroll_indonesia.doctype.bpjs_account_mapping.bpjs_account_mapping.get_mapping_for_company",
"payroll_indonesia.payroll_indonesia.doctype.bpjs_account_mapping.bpjs_account_mapping.create_default_mapping",
"payroll_indonesia.payroll_in... | Python | 1 |
import pandas as pd
from pathlib import Path
# === Carregamento de Dados ===
def carregar_planilha():
dir_raiz=Path(__file__).parents[1]
caminho_planilha=dir_raiz / "dados" / "dados.xlsx"
df=pd.read_excel(caminho_planilha)
return df,dir_raiz
# === Filtro de Dados por mês ===
def filtrar_dados(df,mes_r... | Python | 1 |
W) writer structure"]
impl crate::Writable for IEN_A {}
#[doc = "Half SPORT A's Interrupt Enable"]
pub mod ien_a;
#[doc = "Half SPORT A's Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [stat... | Rust | 0 |
collection,
TsvQueries(manager.file_ref('train.queries.tsv'), namespace=NAME, lang='en'),
NqQrels(manager.file_ref('train.qrels.jsonl')),
NqScoredDocs(manager.file_ref('train.scoreddocs.tsv')),
documentation('train'),
)
subsets['dev'] = Dataset(
collection,
... | Python | 1 |
highlight_orders < 8) ||
matches!(unit.order(), order::DIE | order::RESET_COLLISION_HARVESTER);
}
if (*replay_gcfg).build == 8153 {
return (!order_supply_low && highlight_orders < 8) || unit.order() == order::DIE;
}
}
true
}
unsafe fn order_supply_low(bw: &... | Rust | 0 |
t=limit.limit, offset=offset.offset
)
except ContentDBError as error:
raise HTTPException(
status_code=HTTP_500_INTERNAL_SERVER_ERROR, detail=str(error)
) from error
@router.post("/restore/{content_id}", status_code=HTTP_200_OK)
async def restore_content(
content_id: UUID,
... | Python | 1 |
_run",
"the code block will either not be tested if not marked as a rust one \
or will be run (which you might not want)",
))
} else if s == "allow-fail" || s == "allow_fail" || s == "allowfail" {
... | Rust | 0 |
command: &'a mut ApplicationCommandInteraction,
) -> Result<(), CadencyError> {
debug!("Execute ping command");
utils::create_response(ctx, command, "Pong!").await?;
Ok(())
}
}
<reponame>LycrusHamster/muta<filename>core/cli/src/error.rs
use std::error::Error;
use derive_more::{Disp... | Rust | 0 |
ask_data):
"""更新任务信息"""
try:
tasks = self.config['baidu']['tasks']
if not (0 <= index < len(tasks)):
raise ValueError("任务索引无效")
# 保存旧任务配置用于比较
old_task = tasks[index].copy()
# 验证和清理数据
url = t... | Python | 1 |
<T> WorldWritable<World> for InsertBufferedCommand<T>
where
T: ComponentSource + Send + Sync,
{
fn write(self: StrongArc<Self>, world: &mut World, cmd: &EcsCommandBuffer) {
let consumed = StrongArc::try_unwrap(self).unwrap();
world.extend(PreallocComponentSource::new(
cmd.pending_in... | Rust | 0 |
resp: HttpResponse = ureq::get(url.as_str()).call()?.into_json()?;
debug!("response:\n{:?}", &resp);
Ok(resp.response.docs)
}
<reponame>DougLau/footile
use footile::{Path2D, Plotter};
use pix::matte::Matte8;
use pix::Raster;
mod png;
fn main() -> Result<(), std::io::Error> {
let path = Path2D::default()... | Rust | 0 |
PMOVDW_MEMu16_MASKmskw_XMMu32_AVX512 = 4658,
XED_IFORM_VPMOVDW_MEMu16_MASKmskw_YMMu32_AVX512 = 4659,
XED_IFORM_VPMOVDW_MEMu16_MASKmskw_ZMMu32_AVX512 = 4660,
XED_IFORM_VPMOVDW_XMMu16_MASKmskw_XMMu32_AVX512 = 4661,
XED_IFORM_VPMOVDW_XMMu16_MASKmskw_YMMu32_AVX512 = 4662,
XED_IFORM_VPMOVDW_YMMu16_MASKms... | Rust | 0 |
+= " (File was not found)."
return jsonify({
"message": message,
"recipes": updated_recipes,
"cleared_selection": cleared_selection
}), status_code
else:
print("Knowledge base update failed after recipe remo... | Python | 1 |
f.to_dense.data, &self.to_sparse, &self.data)
}
pub fn parts_mut(&mut self) -> (&[Option<DenseIndex>], &[SparseIndex], &mut [T]) {
(&self.to_dense.data, &self.to_sparse, &mut self.data)
}
}
/// Maps [`SparseIndex`] to [`DenseIndex`], but without checking the generations
#[derive(Debug, Clone)]
str... | Rust | 0 |
Factor "*" (*) Term ["-"]
// Factor = Factor "*" (*) Term ["/"]
// Num = (*) r#"[0-9]+"# [")"]
// Num = (*) r#"[0-9]+"# ["*"]
// Num = (*) r#"[0-9]+"# ["+"]
// Num = (*) r#"[0-9]+"# ["-"]
// Num = (*) r#"[0-9]+"# ["/"]
// Term = (*) Num [")"]
// Term = (*) Num ["*"]
/... | Rust | 0 |
ote_calls': 1,
'ignore_call_history': True,
},
},
)
for log in caplog.records:
assert log.levelname == 'INFO'
assert log.name == 'google_genai.models'
assert 'AFC is enabled with max remote calls: 1' in caplog.text
assert 'remote call 1 is done' in caplog.text
assert 'Re... | Python | 1 |
te path is just the
# path itself. In the MediaFileHandler, it's just the filename
return path
@classmethod
def get_content(
cls, abspath: str, start: int | None = None, end: int | None = None
) -> Any:
_LOGGER.debug("MediaFileHandler: GET %s", abspath)
try:
... | Python | 1 |
tions and improve performance and stability on relatively weak hosts as compared to the workload"]
pub const rs2_host_perf_mode_RS2_HOST_PERF_LOW: rs2_host_perf_mode = 1;
#[doc = "< high performance host mode, if host is strong as compared to the work and can handle workload without delay, this option sets smaller USB ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.