text string | label_name string | labels int64 |
|---|---|---|
N = int(input())
Shoes = list(map(int, input().split()))
def compare(a, b):
if a <= b:
return a
else:
return b
def Calculate_2(a , b):
T = a + b
T2 = T - min(a, b) * 0.5
return T2
def Calculate_3(a, b, c):
T = a + b + c
# two pair
T2_1 = T - min(a, b) * 0.5
T2_2 ... | Python | 1 |
error);
self.push(Value::ObjInstance(obj_err.as_gc()));
self.unwind_stack()
}
fn build_hash_map(&mut self, num_elements: usize) -> Result<Root<RefCell<ObjHashMap>>, Error> {
let map = self.new_root_obj_hash_map();
let begin = self.stack_size() - num_elements * 2;
for i i... | Rust | 0 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | Python | 1 |
par = 0
impar = 0
for i in range(9):
if i % 2 == 0:
par += 1
elif i % 3 == 0:
impar += 1
printf'Pares: {par}') | Python | 1 |
pub use super::HUFFBASE0::HuffBase_RAM_0;
pub use super::HUFFBASE0::HuffBase_RAM_1;
}
/// JPEG HuffSymb tables
pub mod HUFFBASE26 {
pub use super::HUFFBASE0::HuffBase_RAM_0;
pub use super::HUFFBASE0::HuffBase_RAM_1;
}
/// JPEG HuffSymb tables
pub mod HUFFBASE27 {
pub use super::HUFFBASE0::HuffBas... | Rust | 0 |
m = b.len();
let mut xbs = HashSet::with_capacity(m);
for i in xb.iter() {
xbs.insert(*i);
}
let mut cb = Vec::with_capacity(n);
for i in 0..m {
cb.push(c[xb[i]]);
}
let mut z = 0.0;
for i in 0..m {
z += c[xb[i]] * b[i];
}
loop {
let mut j = 0;
... | Rust | 0 |
from rest_framework import serializers
from django.contrib.auth import get_user_model
from .models import Profile
from django.contrib.auth.password_validation import validate_password
User = get_user_model()
class ProfileSerializer(serializers.ModelSerializer):
"""사용자 프로필 정보를 직렬화하는 시리얼라이저"""
class Meta:
... | Python | 1 |
r_teacher', np.array(psnr_list_teacher).mean(), nr_eval)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--epoch', default=300, type=int)
parser.add_argument('--batch_size', default=64, type=int, help='minibatch size')
parser.add_argument('--local_rank', d... | Python | 1 |
(('policy_network', policy_network))
if FLAGS.load_checkpoint_file:
checkpoint.restore(FLAGS.load_checkpoint_file)
policy_network.eval()
# Create evaluation agent instance
eval_agent = greedy_actors.PolicyGreedyActor(
network=policy_network,
device=runtime_device,
name... | Python | 1 |
arch_type}_{column_range_min}_{column_range_max}_{value_lower_bound}_{value_upper_bound}_.csv"
xlsx_filename = f"{config_name}_{search_type}_{column_range_min}_{column_range_max}_{value_lower_bound}_{value_upper_bound}_.xlsx"
csv_save_path = os.path.join(save_directory, csv_filename)
xlsx_save_path = os.pat... | Python | 1 |
ән һичберсенә һичберәү һичберәүгә
һичберәүдә һичберәүдән һичберәүне һичберәүнең һичкайсы һичкайсыга һичкайсыда
һичкайсыдан һичкайсыны һичкайсының һичкем һичкемгә һичкемдә һичкемне һичкемнең
һичкемнән һични һичнигә һичнидә һичнидән һичнинди һичнине һичнинең һичнәрсә
һичнәрсәгә һичнәрсәдә һичнәрсәдән һичнәрсәне һичнәрсән... | Python | 1 |
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from nagini_contracts.contracts import *
from typing import Optional
class ListClass():
def __init__(self, v: int) -> None:
self.val = v
self.next = None #type: Optional[ListClass]
Fold(M... | Python | 1 |
VPSRAQ_ZMMu64_MASKmskw_ZMMu64_IMM8_AVX512 = 5286,
XED_IFORM_VPSRAQ_ZMMu64_MASKmskw_ZMMu64_MEMu64_AVX512 = 5287,
XED_IFORM_VPSRAQ_ZMMu64_MASKmskw_ZMMu64_XMMu64_AVX512 = 5288,
XED_IFORM_VPSRAVD_XMMdq_XMMdq_MEMdq = 5289,
XED_IFORM_VPSRAVD_XMMdq_XMMdq_XMMdq = 5290,
XED_IFORM_VPSRAVD_XMMu32_MASKmskw_XMMu... | Rust | 0 |
feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_30")))]
#[doc(hidden)]
impl IntoGlib for AutoplayPolicy {
type GlibType = ffi::WebKitAutoplayPolicy;
fn into_glib(self) -> ffi::WebKitAutoplayPolicy {
match self {
Self::Allow => ffi::WEBKIT_AUTOPLAY_ALLOW,
Self::AllowWithoutSoun... | Rust | 0 |
_base_ = ['./rotated-retinanet-rbox-le90_r50_fpn_1x_dota.py']
optim_wrapper = dict(type='AmpOptimWrapper')
| Python | 1 |
When off, atime will be treated like ctime.
Atime(bool),
/// Suggested block size for newly written data.
///
/// Units are in bytes, log base 2. So `RecordSize(16)` means 16KB records.
/// BFFFS will usually divide files into blocks of this many bytes. But the
/// record size is only adviso... | Rust | 0 |
use hashbrown::HashMap;
use laythe_env::stdio::Stdio;
use std::ptr::NonNull;
use std::{cell::RefCell, io::Write};
#[cfg(any(feature = "gc_log_free", feature = "gc_log_alloc"))]
use crate::managed::DebugWrap;
#[cfg(feature = "gc_log_free")]
use crate::managed::DebugWrapDyn;
/// The garbage collector and memory manage... | Rust | 0 |
_, _, _ = await async_mock_setup(
hass, hass_ws_client, config_options={CONF_OVERRIDE: overrides}
)
await ws_client.send_json(
{
ID: 2,
TYPE: "insteon/config/device_override/remove",
"device_address": "99.99.99",
}
)
msg = await ws_client.recei... | Python | 1 |
x83\x16\xc68\xa7\x19\xe0\x93\xcc\
\xcb\xffJ\x00(\x93\xce{\x14@\xf9\xffmd\x0c\x0e\
\xb5\x14\xa4[\x9ft\xc3f\xad\x98\xf4f\xea\x9b\x02%\
\x01\x82 \x22\xa5\x02#\x22b\xda\xa7h\xf3\xdc\xdc\xe1\
\xe4\xe4\xdam\x0a\x1b\xbb\xaa\xa3\xd8B\xa8t*\x0a\xcb\
u\xb4\xcd#u\xc3\xb1<\xf6\x99\x8e\xb0\x097it\
\xa5m4D\xd3\x18\x9b\x83\x1b:G\xd9+... | Python | 1 |
// (constant_index)
pub const GET_DYNAMIC: OpCode = 3; // (symbol_index)
pub const GET_STATIC: OpCode = 4; // (up_count, offset)
pub const LAMBDA: OpCode = 5; // (code_index)
pub const CALL: OpCode = 6; // (argc)
pub const TAIL_CALL: OpCode = 7; // (argc)
pub const JUMP_IF_FALSE: OpCode = 8; // ... | Rust | 0 |
__all__ = [
'cmd_format',
'validate_generated_dir'
]
from .command_formater.command_formater import cmd_format
from .dir_inspector.inspector import validate_generated_dir
| Python | 1 |
import torch
from torch import Tensor
from torch import nn
from typing import Union, Tuple, List, Iterable, Dict
import os,sys
import json
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from log import logging
logger=logging.getLogger(__name__)
class Pooling(nn.Module):
"""
Poo... | Python | 1 |
cv2.putText(img, label, (c1[0], c1[1] - 2), 0, tl / 3, [225, 255, 255], thickness=tf, lineType=cv2.LINE_AA)
def infer(self, image, agnostic_nms=False):
# read image
# image=cv2.imread(img_path)
# Padded resize
img = self.letterbox(image, self.imgsz, stride=self.stride)[0]
... | Python | 1 |
#!/usr/bin/env python3
'''
Author: SRM
'''
import subprocess
import os
import sys
import json
sys.path.append("../")
sys.path.append("../../system/lib/")
sys.path.append("../system_overall/")
import json_parser
import cli
import api
import pos
import pos_util
total_numa = 0
TEST_DEVICE_PREFIX = "URAM_TEST"
def c... | Python | 1 |
import taichi as ti
from fs.boundary_condition import BoundaryCondition, DyeBoundaryCondition
from fs.differentiation import diff_x, diff_y
from fs.double_buffer import DoubleBuffer
@ti.data_oriented
class VorticityConfinement:
def __init__(
self,
boundary_condition: BoundaryCondition | DyeBounda... | Python | 1 |
()
.borrow()
.start()
{
let nt_nextstate = self.state_table.tuple_table.find_id(
ReplaceStateTuple::new(nt_prefix, Some(*nonterminal), Some(nt_start)),
);
let ilabel = if epsilon_o... | Rust | 0 |
CopyTexture {
texture: &texture,
mip_level: 0,
origin: wgpu::Origin3d {
x: 0,
y: 0,
z: i as u32,
}
},
data,
wgpu::ImageD... | Rust | 0 |
rc/main.rs");
ignored!(ig5, ROOT, "/*.c", "cat-file.c");
ignored!(ig6, ROOT, "/src/*.rs", "src/main.rs");
ignored!(ig7, ROOT, "!src/main.rs\n*.rs", "src/main.rs");
ignored!(ig8, ROOT, "foo/", "foo", true);
ignored!(ig9, ROOT, "**/foo", "foo");
ignored!(ig10, ROOT, "**/foo", "src/foo");
ignor... | Rust | 0 |
// The object is being deleted but we've already finished our finalizer
// So there's nothing left to do for us on this one.
None
}
}
/// Creates a vector of tolerations we need to work with the Krustlet
pub fn create_tolerations() -> Vec<Toleration> {
vec![
Toleration {
... | Rust | 0 |
import os, signal, time
workspace_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)),
'workspaces', f'project_{project.id}')
pid_file = os.path.join(workspace_dir, '.jupyter.pid')
... | Python | 1 |
layer.weight.data[idx] = 0
layer.weight.grad[idx] = 0
self.net.lif1.recurrent = layer
self.optimizer.step()
if indices is not None and self.target_sparcity != 1.0:
layer = self.net.lif1.recurrent
... | Python | 1 |
,
ChannelTrySendError::Disconnected(t) => t,
}
}
}
<gh_stars>0
// Copyright 2021 <NAME>, <NAME>
//
// 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://ww... | Rust | 0 |
status_code=500,
detail="OrpheusTTS does not currently support deleting custom voice characters.")
try:
await engine.delete_speaker(name=name)
except Exception as e:
err_msg = f'Failed to remove the voice character "{name}": {str(e)}'
logger.error(err_msg)
... | Python | 1 |
or},
registry::{LocalRegistry, Registry},
},
hashbrown::hash_map::{Entry, HashMap, RawEntryMut},
std::{
any::TypeId,
borrow::Borrow,
cell::RefCell,
fmt::{self, Debug},
future::Future,
hash::{BuildHasher, Hash, Hasher},
rc::Rc,
sync::{Ar... | Rust | 0 |
fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
while !is.eof()? {
let (field_number, wire_type) = is.read_tag_unpack()?;
match field_number {
1 => {
::protobuf::rt::read_repeated_message_in... | Rust | 0 |
while True:
msg = alt.select()
if alt.last_selected == chan_in:
queue.append(msg)
print 'QUEUE:', queue # Bad style
elif alt.last_selected == chan_next:
chan_pass.write(queue[0])
queue = queue[1:]
@process
def o... | Python | 1 |
std::fs::File::from_raw_handle(winapi::um::processenv::GetStdHandle(
winapi::um::winbase::STD_OUTPUT_HANDLE,
))
};
stdout
};
}
pub fn init(i: &mut Isolate, s: &State) {
i.register_op(
"op_read",
s.core_op(minimal_op(s.stateful_minimal_op(op_read))),
);
i.register_op(
"... | Rust | 0 |
(a, b))
#define UCHARPAIR_TOUINT32(a, b) \\
((((uint32_t)(b)) << 16) + (uint32_t)(a))
#define UCHARQUAD_TOUINT64(a, b, c, d) \\
((((uint64_t)(UCHARPAIR_TOUINT32(c, d))) << 32) + UCHARPAIR_TOUINT32(a, b))
#endif // CPU(BIG_ENDIAN)
#define COMPARE_2CHARS(address, char1, char2) \\
((reinterpret_cast<const u... | Python | 1 |
NetworkId},
};
use diem_crypto::x25519;
use diem_infallible::RwLock;
use diem_mempool::mocks::MockSharedMempool;
use diem_network_address::{parse_memory, NetworkAddress, Protocol};
use diem_types::{
chain_id::ChainId, ledger_info::LedgerInfoWithSignatures, on_chain_config::ValidatorSet,
transaction::Transaction... | Rust | 0 |
e(rename = "contractAddress")]
pub contrace_address: Option<Address>,
/// Logs generated within this transaction.
pub logs: Vec<Log>,
/// Status: either 1 (success) or 0 (failure).
pub status: Option<U64>,
/// State root
pub root: Option<H256>,
/// Logs bloom
#[serde(rename = "logsBl... | Rust | 0 |
ache: dict, model_file: str, oid: str, cum_M: np.ndarray):
"""
Рекурсивно разворачивает объект (mesh или composite) с накопленной матрицей.
Возвращает: (V_mm_transformed, T, vol_mm3_fast), где vol_mm3_fast — fast-объём через |det(R)|.
"""
entry = cache.get(model_file)
if entry is None:
r... | Python | 1 |
# employees/views.py
from django.shortcuts import render
from .models import Employee
from .serializers import EmployeeSerializer
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import generics
def employee_list(request):
employees = Employee.objects.all()
... | Python | 1 |
;
// if the block is not a direct ancestor of the current best chain,
// then some other block is the common ancestor.
if route_from_best.common_block().hash != block {
// FIXME: #1442 reorganize best block to be the best chain containing
// `block`.
}
let enacted = route_from_finalized.enacted();
a... | Rust | 0 |
= 1,
}
impl NlAttrType for Nl80211Mfp {}
/// nl80211WpaVersions
///
/// Enumeration from nl80211/nl80211.h:3661
#[neli_enum(serialized_type = "u16")]
pub enum Nl80211WpaVersions {
WpaVersion1 = 1 << 0,
WpaVersion2 = 1 << 1,
}
impl NlAttrType for Nl80211WpaVersions {}
/// nl80211KeyDefaultTypes
///
/// Enum... | Rust | 0 |
"mediaType": "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip",
"size": 1612893008,
"digest": "sha256:9038b92872bc268d5c975e84dd94e69848564b222ad116ee652c62e0c2f894b2",
"urls": [
"https://mcr.microsoft.com/v2/windows/servercore/blobs/sha256:9038b9287... | Rust | 0 |
>>>>,
async_gvar: Arc<Mutex<Option<SharedMem<f32>>>>,
async_vparam: Arc<Mutex<Option<SharedMem<f32>>>>,
async_vgmean: Arc<Mutex<Option<SharedMem<f32>>>>,
async_vgvar: Arc<Mutex<Option<SharedMem<f32>>>>,
}
impl AdamA3CBuilder
/*impl<E, V, EvalV> AdamA3CBuilder<E, V, EvalV>
where E: 'static + Env + EnvInputRe... | Rust | 0 |
class TaskFamily:
@staticmethod
def get_tasks() -> dict[str, dict]:
return {
"1": {"figure1": "Albert Einstein", "figure2": "Isaac Newton", "topic": "the nature of gravity"},
"2": {"figure1": "Cleopatra", "figure2": "Julius Caesar", "topic": "political strategy"}
}
@... | Python | 1 |
```
# Alternatives
Note that as of Rust 1.32, the standard numeric types provide built-in methods
like `to_le_bytes` and `from_le_bytes`, which support some of the same use
cases.
[big-endian or little-endian order]: https://en.wikipedia.org/wiki/Endianness
[`byteorder`]: https://github.com/BurntSushi/byteorder/
[`Byt... | Rust | 0 |
start_span: Span = start_elem.into();
let end_span: Span = end_elem.into();
Self {
start: start_span.start,
end: end_span.end,
}
}
}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct Node<T> {
pub kind: T,
#[serde(skip_serializing, skip_... | Rust | 0 |
"""
ASGI config for weather_project project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJAN... | Python | 1 |
or {models.env.title}! "
"Please check the logs for more information."
)
return
except PyiCloudAPIResponseException as error:
logger.error(error)
speaker.speak(
text=f"I was unable to get the device information {models.env.title}!"
"Please check th... | Python | 1 |
# copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 1 |
he "notify"
/// method from ActorAssistant
///
/// Keep in mind that if someone waits for this service to respond and this service has a long queue of messages
/// to process, the response can take long time, slowing down who is calling this service. Preffer always to use
/// the [Serve trait](./trait.Serve.html) if yo... | Rust | 0 |
JPPFFEWTEDu3HJ+YUVDkxtpbmOsjZADEfjirEM5jJLMCcf3hRRWrSE0mOjvhGMAHnk4oooo5ULkRw==\\\"}]}}\",\"entities\":[],\"meta\":{\"views\":3176,\"forwardsCount\":0,\"commentsCount\":0,\"reactionsCount\":8,\"publishDate\":\"2024-09-22T09:53:53Z\",\"deletedAt\":null,\"reactions\":[{\"count\":5,\"emoticon\":\"❤\"},{\"count\":3,\"emoti... | Python | 1 |
(p.path())?;
}
}
Ok(())
});
}
}
<filename>src/imap/response/flags.rs
#[derive(Debug, PartialEq, Eq)]
pub enum Flags {
NonExistent,
NoInferiors,
NoSelect,
HasChildren,
HasNoChildren,
Marked,
Unmarked,
Subscribed,
Remote,
All,
... | Rust | 0 |
from django.conf import settings
from images.models import Metadata
from images.utils import get_aux_field_names, get_aux_label
def metadata_field_names_to_labels(source):
"""
Get a dict of Metadata field names to field labels.
e.g. 'photo_date': "Date", 'aux1': "Site", 'camera': "Camera", ...
Note t... | Python | 1 |
AWS",
*b"CHAYA",
*b"CHAYS",
*b"CHEEP",
*b"CHEFS",
*b"CHEKA",
*b"CHELA",
*b"CHELP",
*b"CHEMO",
*b"CHEMS",
*b"CHERE",
*b"CHERT",
*b"CHETH",
*b"CHEVY",
*b"CHEWS",
*b"CHEWY",
*b"CHIAO",
*b"CHIAS",
*b"CHIBS",
*b"CHICA",
*b"CHICH",
*b"CHICO",
*b"CHICS",
*b"CHIEL",
*b"CHIKS",
... | Rust | 0 |
ref().unwrap();
write!(output, "202={}\u{01}", val )?; // FIELD_STRIKEPRICE
}
if flds.opt_attribute.is_some() {
let val = flds.opt_attribute.as_ref().unwrap();
write!(output, "206={}\u{01}", val )?; // FIELD_OPTATTRIBUTE
}
if flds.contract_multiplier.is_some() {
let val... | Rust | 0 |
# vgg16(D)
model = [[3, 1],
[3, 1],
[2, 2], # maxpool
[3, 1],
[3, 1],
[2, 2], # maxpool
[3, 1],
[3, 1],
[3, 1],
[2, 2], # maxpool
[3, 1],
[3, 1],
[3, 1],
[2, 2], # maxpool
[3, 1],
[... | Python | 1 |
ently does not work due to a
/// [compiler bug](https://github.com/rust-lang/rust/issues/62529).
///
/// [`read_process_fasta_records`](read_process_fasta_records),
/// [`read_process_fastq_records`](read_process_fastq_records) and
/// [`read_process_fastx_records`](read_process_fastx_records)
/// provide the same fun... | Rust | 0 |
let roundtrip_plan = LogicalPlan::Repartition(Repartition {
input: plan.clone(),
partitioning_scheme: rr_repartition,
});
roundtrip_test!(roundtrip_plan);
let h_repartition = Partitioning::Hash(test_expr.clone(), *partition_count);
... | Rust | 0 |
scSelct/MiscMask settings are not correct.*/
SGX_ERROR_INVALID_LAUNCH_TOKEN = 0x00002011, /* The launch token is not correct.*/
SGX_ERROR_MAC_MISMATCH = 0x00003001, /* Indicates verification error for reports, sealed datas, etc */
SGX_ERROR_INVALID_ATTRIBUTE = 0x00003002, /... | Rust | 0 |
from vietocr.loader.dataloader_v1 import DataGen
from vietocr.model.vocab import Vocab
def test_loader():
chars = "aAàÀảẢãÃáÁạẠăĂằẰẳẲẵẴắẮặẶâÂầẦẩẨẫẪấẤậẬbBcCdDđĐeEèÈẻẺẽẼéÉẹẸêÊềỀểỂễỄếẾệỆfFgGhHiIìÌỉỈĩĨíÍịỊjJkKlLmMnNoOòÒỏỎõÕóÓọỌôÔồỒổỔỗỖốỐộỘơƠờỜởỞỡỠớỚợỢpPqQrRsStTuUùÙủỦũŨúÚụỤưƯừỪửỬữỮứỨựỰvVwWxXyYỳỲỷỶỹỸýÝỵỴzZ0123456789!\"... | Python | 1 |
"""
Backtesting engine module for simulating investment strategies.
""" | Python | 1 |
shell command",
name.as_str().unwrap()
)
})
}
fn get_env(env: &mut HashMap<String, String>, config_env: &Value) -> Result<()> {
let config_env = config_env
.as_mapping()
.ok_or_else(|| anyhow!("env must be an object"))?;
for (name, value) in config_env.iter() {
... | Rust | 0 |
from ollama import chat
from ollama import ChatResponse
response: ChatResponse = chat(
model="gpt-oss:20b",
messages=[
{
"role": "user",
"content": "Why is the sky blue?",
},
],
)
response: ChatResponse = chat(
model="gpt-oss:120b",
messages=[
{
... | Python | 1 |
t-extension-md.txt.exp
│ │ ├── sorbet.txt
│ │ ├── sorbet.txt.exp
│ │ ├── symbol.txt
│ │ └── symbol.txt.exp
│ └── update_one.sh
├── third_party
│ ├── BUILD
│ └── externals.bzl
└── tools
├── BUILD
├── clang.bzl
└── scripts
├── build_compilation_db.sh
└── generate_compdb_t... | Rust | 0 |
:index_all("evening", "o", 0);
/// // => []
/// use voca_rs::Voca;
/// "morning"._index_all("n", 0);
/// // => [3, 5]
/// ```
pub fn index_all(subject: &str, search: &str, from_index: usize) -> Vec<usize> {
if subject.is_empty() || crate::count::count(&subject) < from_index {
return vec![];
}
let st... | Rust | 0 |
to()),
i => panic!("Didn't expect instruction to be {:?}", i),
}
}
pub fn into_air(self) -> String {
use Instruction::*;
match self {
Null => "(null)".to_string(),
Call(call) => call,
Seq(l, r) => {
let l = l.into_air();
... | Rust | 0 |
Id = serde_json::from_str(&json_str).unwrap();
assert_eq!(id, id2, "Value serializes and deserializes to itself");
}
}
<reponame>songyzh/leetcode-rust
/**
* [378] Kth Smallest Element in a Sorted Matrix
*
* Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kt... | Rust | 0 |
deriv[1][0] = sm * (9.0 * (2.0 * r + 3.0 * r * r + s * s) - 10.0) / 32.0;
deriv[2][0] = sp * (9.0 * (2.0 * r + 3.0 * r * r + s * s) - 10.0) / 32.0;
deriv[3][0] = sp * (9.0 * (2.0 * r - 3.0 * r * r - s * s) + 10.0) / 32.0;
deriv[4][0] = 9.0 * sm * (9.0 * r * r - 2.0 * r - 3.0) / 32.0;
der... | Rust | 0 |
type ApiKey = FollowerPeerApiEnum;
fn decode_with_header<T>(src: &mut T, header: RequestHeader) -> Result<Self, IoError>
where
Self: Default + Sized,
Self::ApiKey: Sized,
T: Buf,
{
trace!("decoding with header: {:#?}", header);
let version = header.api_version();
... | Rust | 0 |
SurfaceOrigin::BottomLeft,
None,
false,
) {
Some(surface) => {
stats.log(gpu_surface_time, String::from("Create GPU Surface"));
stats.set_surface_type(RasterizerSurfaceType... | Rust | 0 |
# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES.
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
import pytest
import polars as pl
from cudf_polars.testing.asserts import assert_gpu_result_equal
from cudf_polars.utils.versions import POLARS_VERSION_LT_130
... | Python | 1 |
false), 1);
assert_eq!(break_value(false, true), 2);
assert_eq!(break_value(false, false), 3);
assert_eq!(label_break_mixed(0), 0);
assert_eq!(label_break_mixed(1), 1);
assert_eq!(label_break_mixed(2), 2);
assert_eq!(label_break_mixed(3), 3);
assert_eq!(label_break_mixed(4), 4);
assert_... | Rust | 0 |
s[0].push(normal.x);
normals[1].push(normal.y);
normals[2].push(normal.z);
}
(vertices, edges, normals, is_padding_triangle)
}
pub fn do_intersection_soa(
ray: &Ray,
vertices: &[[std::vec::Vec<f32>; 3]; 3],
edges: &[[std::vec::Vec<f32>; 3]; 2],
is_padding_triangle: &[bool],
... | Rust | 0 |
import torch
import torch.nn as nn
from toolbox.models.A__Paper.SDGCDNet.scripts import ASFE, RRM
from toolbox.models.A__Paper.SDGCDNet.scripts import bilateral_filter
from toolbox.models.A__Paper.SDGCDNet.scripts import DecoderBlock
from toolbox.backbone.mobilenetv2 import mobilenet_v2
# 仅对深度图应用双边滤波器
class fuse(nn.Mo... | Python | 1 |
"如有版权问题,请联系删除",
"",
"🔔 喜欢的话请点赞订阅支持!",
"",
"#小说解说 #AI视频 #一口气看完"
]
if chapter_info:
description_parts.insert(2, f"📑 章节:{chapter_info}")
description = "\n".join(description_parts)
# 生成标签
... | Python | 1 |
#!/usr/bin/env python3
# encoding: utf-8
import codecs
import glob
import os
## SETTING
log_file = "/mnt/kiso-qnap/fujiwara/B4/main/espnet/egs2/librispeech_100/asr1/exp/asr_train_asr_whisper_large_decselfatten_finetune_raw_en_whisper_multilingual_sp/decode_asr_whisper_noctc_primtext_tmp_asr_model_valid.acc.ave/test_c... | Python | 1 |
|| {
let s = arc_state.clone();
return App::new()
.resource("/", |r| r.h(endpoints::IndexEndpoint::new()))
.resource("/queue/size", |r| r.h(endpoints::QueueSizeEndpoint::new(s)));
};
let addr: String = format!("127.0.0.1:{}", args.flag_port);
server::new(factory)
... | Rust | 0 |
# HELL YEAH THIS WORKS TOO
import json
COLOR_GREEN = '\033[92m'
COLOR_RESET = '\033[0m'
def parse_json_to_mmd(json_data):
section_number = json_data.get("sectionNumber", "")
section_description = json_data.get("sectionDescription", "")
definition = json_data.get("definition", "")
result = json_data.g... | Python | 1 |
ChecksBox, ExtraChecksError, ExtraChecksRef, TypeChecker, TypeCheckerMut,
},
ConstGeneric,
},
prefix_type::{FieldAccessibility, FieldConditionality},
sabi_types::{CmpIgnored, ParseVersionError, VersionStrings},
std_types::{RArc, RBox, RBoxError, RErr, RNone, ROk, RResult, RSome, RStr, RV... | Rust | 0 |
(Clone, Debug, Serialize, Deserialize)]
pub struct VeraSprite<'a> {
/// id
pub id: String,
/// colour depth
pub depth: VeraPixelDepth,
/// width
pub frame_width: VeraSpriteDim,
/// height
pub frame_height: VeraSpriteDim,
/// We won't serialize this, will just need to ensure
/// `init_from_imageset` populates ... | Rust | 0 |
from utilities.testing import APIViewTestCases, create_tags
from netbox_dns.tests.custom import APITestCase
from netbox_dns.models import View, Zone, NameServer
class ZoneTest(
APITestCase,
APIViewTestCases.GetObjectViewTestCase,
APIViewTestCases.ListObjectsViewTestCase,
APIViewTestCases.CreateObject... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
from .hr_homeworking import DAYS
class User(models.Model):
_inherit = ['res.users']
monday_location_id = fields.Many2one("hr.work.location", related="employee_id.monday_location_id", readonly=False, str... | Python | 1 |
destination = cups.iter().position(|&x| x == j).unwrap() + 1;
break;
}
}
if destination >= cups.len() {
cups.extend(&pick_up);
} else {
cups.insert(destination, pick_up[2]);
cups.insert(destination, pick_up[1]);
... | Rust | 0 |
#!/usr/bin/env python
from __future__ import print_function
from elfsize import add_node, output_to_file, default_op, default_datafile, repo_root
from collections import OrderedDict
from os import path
import sys
def main(output):
root = OrderedDict({"name": "mbed", "children": []})
# cycle through stdin
... | Python | 1 |
PAuthExt: 'static {
fn add_basic(&self, basic: &str, token: &RTSPToken);
#[cfg(any(feature = "v1_12", feature = "dox"))]
fn add_digest(&self, user: &str, pass: &str, token: &RTSPToken);
fn get_default_token(&self) -> Option<RTSPToken>;
#[cfg(any(feature = "v1_16", feature = "dox"))]
fn get_re... | Rust | 0 |
minh",
"mogadishu",
"moldova",
"monaco",
"monday",
"mongolia",
"montenegro",
"monterrey",
"montreal",
"morocco",
"moscow",
"mozambique",
"mr",
"mrs",
"mumbai",
"munich",
"myanmar",
"nagoya",
"nairobi",
"namibia",
"nanjing",
"naples",
... | Rust | 0 |
list(merged_df.columns[8:10]) + list(merged_df.columns[:8]) + list(merged_df.columns[10:])
#
# # merged_df = merged_df[new_cols]
# # 追加到输出文件,如果是第一个文件则包含表头,否则不包含
# merged_df.to_csv(output_csv, mode='a', index=False, header=with_header)
# # with_header = False
# print(i)
# camels-gb
... | Python | 1 |
TxtCtl.Clear,
'#0080111932V我们连他的那份也一起享受算了~!\n',
' ',
TxtCtl.Enter,
),
)
CloseMessageWindow()
ChrTalk(
0x0101,
(
'#0010111933V#007F#5P嗯……没办法。',
TxtCtl.Enter,
TxtCtl.Clear,
'#0010111934V#0... | Python | 1 |
from allauth.account.models import EmailAddress
from allauth.socialaccount.admin import SocialAppForm, SocialAppAdmin
from allauth.socialaccount.models import SocialApp
from django.contrib import admin
from django.core.exceptions import ValidationError
from django.db.models import Q
from .models import EmailAddressAdm... | Python | 1 |
estimated = len(known_initial_tiles) + unknown_draws_estimate
print(f" 🎯 推导结果:")
print(f" 已知初始牌: {known_initial_tiles} ({len(known_initial_tiles)}张)")
print(f" 估算未知摸牌: {unknown_draws_estimate}张")
print(f" 估算总初始牌数: {len(known_initial_tiles)} + {unknown_draws_estimate} ... | Python | 1 |
Result<Self, String> {
let lookup_symbol = |symbol_name: &str| {
match watchable_symbols.iter().find(|s| s.name == symbol_name) {
Some(s) => Ok(s.clone()),
None => Err(format!("the AVR executable does not contain the libavrlit special symbol '{}'", symbol_name)),
... | Rust | 0 |
(parts, bod) = value.into_parts();
let (is_base64_encoded, body) = match bod.into() {
Body::Empty => (false, None),
b @ Body::Text(_) => (false, Some(b)),
b @ Body::Binary(_) => (true, Some(b)),
};
let mut headers = parts.headers;
let status_code = p... | Rust | 0 |
def main():
args = parse_args()
coco_path = args.coco_path
nproc = args.nproc
out_dir = args.out_dir or coco_path
out_img_dir = osp.join(out_dir, 'images')
out_mask_dir = osp.join(out_dir, 'annotations')
mmcv.mkdir_or_exist(osp.join(out_img_dir, 'train2014'))
mmcv.mkdir_or_exist(osp.... | Python | 1 |
pub static HTML_REPLACER_END: &str = "--->";
pub static HTML_REPLACE_HOSTNAME: &str = "HOSTNAME";
pub static HTML_REPLACE_PATHS_MAX: &str = "PATHS_MAX";
pub static HTML_REPLACE_PEER_HASH: &str = "PEER_HASH";
pub static HTML_REPLACE_PEER_PAGE: &str = "PEER_PAGE";
pub static HTML_REPLACE_VERSION:... | Rust | 0 |
izing_if = "Option::is_none")]
pub target_workspace_id: Option<String>,
#[serde(rename = "targetVersionId", skip_serializing_if = "Option::is_none")]
pub target_version_id: Option<String>,
#[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[ser... | Rust | 0 |
import tensorflow as tf
from skimage.transform import resize
from skimage.color import rgb2gray
import numpy as np
from collections import deque
class AtariEnvironment(object):
"""
Small wrapper for gym atari environments.
Responsible for preprocessing screens and holding on to a screen buffer
of size... | Python | 1 |
std::process::Command;
fn main() -> Result<()> {
let username =
std::env::var("RADIUS_USER").context("Cannot get radius username")?;
let cookie = std::env::var("RADIUS_USER_COOKIE")
.context("Cannot get radius cookie")?;
let root = nix::unistd::Uid::from_raw(0);
nix::unistd::setuid(r... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.