text string | label_name string | labels int64 |
|---|---|---|
from falcor import *
def render_graph_OptixDenoiser():
g = RenderGraph("OptixDenoiser")
VBufferRT = createPass("VBufferRT")
g.addPass(VBufferRT, "VBufferRT")
AccumulatePass = createPass("AccumulatePass")
g.addPass(AccumulatePass, "AccumulatePass")
ToneMappingPass = createPass("ToneMapper")
... | Python | 1 |
gin: wgpu::Origin3d { x, y, z: 0, }, aspect: wgpu::TextureAspect::All },
wgpu::ImageCopyBuffer {
buffer, layout: wgpu::ImageDataLayout { offset, bytes_per_row: NonZeroU32::new(4 * bf_w), rows_per_image: NonZeroU32::new(bf_h) }
},
wgpu::Extent3d {width: w, height: h, ... | Rust | 0 |
// nodes.push(nodes_toks.parse()?);
// }
// NodeOrList::List(NodeList(nodes))
// } else {
// NodeOrList::Node(s.parse()?)
// };
// Ok(HtmlRender { kind })
}
}
impl ToTokens for RsxTemplate {
fn to_tokens(&self, out_tokens: &mut TokenS... | Rust | 0 |
b.bytes = 1024;
}
#[bench]
fn gen_1k_sample_iter(b: &mut Bencher) {
use rand::distributions::{Distribution, Standard};
let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap();
b.iter(|| {
let v: Vec<u64> = Standard.sample_iter(&mut rng).take(128).collect();
v
});
b.bytes = 1024... | Rust | 0 |
:result;
use getrandom;
/// Fills a buffer, `buffer`, with random bytes sampled from the random number
/// source provided by the host operating system, as provided by `getrandom`.
///
/// This is for use with "offline-chihuahua".
pub fn platform_getrandom(buffer: &mut [u8]) -> result::Result {
if let Ok(_) = get... | Rust | 0 |
import datetime
from functools import wraps
from types import FunctionType
from Script.Core import cache_control, constant, constant_promise, game_type, get_text
from Script.Design import map_handle, game_time, attr_calculation
from Script.Config import normal_config, game_config
cache: game_type.Cache = cache_control... | Python | 1 |
import basetest_dqn_like
from basetest_training import _TestBatchTrainingMixin
from pfrl.agents.double_dqn import DoubleDQN
class TestDoubleDQNOnDiscreteABC(
_TestBatchTrainingMixin, basetest_dqn_like._TestDQNOnDiscreteABC
):
def make_dqn_agent(self, env, q_func, opt, explorer, rbuf, gpu):
return Dou... | Python | 1 |
he image. Defaults to ``None``.
**kwargs: Must contain ``global_step`` (int) indicating the step at
which to log the image. Additional keyword arguments are passed
to the TensorBoard logging method.
Raises:
ValueError: If ``global_step`` is not provided i... | Python | 1 |
epoch_libero_ddp(args, model, image_processor, tokenizer, cur_time):
cast_dtype = get_cast_dtype(args.precision)
hist_len = args.sequence_length
wrapped_model = ModelWrapper(
model,
tokenizer,
image_processor,
... | Python | 1 |
",
"DEA",
"MDVXW",
"VNRX",
"HQCL",
"AVNU",
"NSAT",
"OA",
"TCCB",
"VSTO",
"GHII",
"PZB.CL",
"INOV",
"NVTA",
"AJX",
"ARN.CL",
"BLPH",
"FNTCU",
"GDJJ",
"GDJS",
"GDXS",
"GDXX",
"KEMP",
"NHTC",
"IRCP",
"ITEK",
"CHEKU",
"FLRT",
"RISE",
"PLpB.CL",
"TOTL",
"BLBD",
... | Rust | 0 |
doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: EDIS_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Sleep mode request is enabled and functional"]
#[inline(always)]
pub fn value1(self) -> &'a mut W {
self.vari... | Rust | 0 |
impl_partial_eq! { Value for Uint32Array use identity }
impl_partial_eq! { Object for Uint32Array use identity }
impl_partial_eq! { ArrayBufferView for Uint32Array use identity }
impl_partial_eq! { TypedArray for Uint32Array use identity }
impl_partial_eq! { Uint32Array for Uint32Array use identity }
/// An instance o... | Rust | 0 |
nparts as *mut Idx;
let tpwgts = if let Some(tpwgts) = self.tpwgts {
tpwgts.as_mut_ptr()
} else {
ptr::null_mut()
};
let options = self.options.as_mut_ptr();
let mut edgecut = mem::MaybeUninit::uninit();
unsafe {
m::METIS_PartMeshNodal(... | Rust | 0 |
ou 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 agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRAN... | Rust | 0 |
// TODO ECS: use this to handle optional components properly.
// pub trait OptionalComponentSet<T> {
// fn get(&self, handle: Index) -> Option<&T>;
// }
/// A set of optional elements of type `T`.
pub trait ComponentSetOption<T>: Sync {
/// Get the element associated to the given `handle`, if there is one.
... | Rust | 0 |
_iter()
.zip(self.inputs.clone().into_iter())
.collect::<Vec<(_, _)>>();
inputs.sort_by_key(|(k, _)| k.previous_output);
let mut outputs = tx
.output
.clone()
.into_iter()
.zip(self.outputs.clone().into_iter())
.collect... | Rust | 0 |
# Hello world controller
from fastapi import APIRouter
from pydantic import BaseModel
class HealthCheckResponse(BaseModel):
"""Response model for the health_check_controller"""
message: str
router = APIRouter()
@router.get(
"/",
response_model=HealthCheckResponse,
status_code=200,
)
async de... | Python | 1 |
a = 0
b =0
while b < 50:
print('b: ',b)
b = b + a
a = b - a
if b == 0:
b = b +1 | Python | 1 |
def draw_kps(image_pil, kps, color_list=[(255, 0, 0), (0, 255, 0), (0, 0,
255), (255, 255, 0), (255, 0, 255)]):
stickwidth = 4
limbSeq = np.array([[0, 2], [1, 2], [3, 2], [4, 2]])
kps = np.array(kps)
w, h = image_pil.size
out_img = np.zeros([h, w, 3])
for i in range(len(limbSeq)):
i... | Python | 1 |
import numpy as np
import numba as nb
import math
from numba import float64, njit
from numba.experimental import jitclass
from planner.utils import *
from highway_env.vehicle.kinematics import Vehicle
from highway_env.road.lane import AbstractLane
from highway_env.road.road import Road
from asp_decider.asp_utils imp... | Python | 1 |
import os
import numpy as np
acc = 0
psnr = 0
def argmax(lst):
return max(range(len(lst)), key=lambda i: lst[i])
def ruled_selection(iter_adv_scores, iter_psnr_scores):
success_indexs = []
for k in range(len(iter_adv_scores)):
if iter_adv_scores[k] >= 0:
success_indexs.append(k)
if... | Python | 1 |
def verbalize_age(generation):
if generation == "GenZ":
perspective = "una persona giovane della generazione Z"
elif generation == "GenY":
perspective = "una persona giovane della generazione Y"
elif generation == "GenX":
perspective = "una persona adulta della generazione X"
els... | Python | 1 |
import json
from urllib.parse import unquote
from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def closed_accordions(context, project_id):
request = context["request"]
cookie = request.COOKIES.get("dashboard_projects_closed_accordions", "[]")
ids = json.l... | Python | 1 |
yDLL(read_lib_name,ctypes.RTLD_GLOBAL)
if self.nativelib is None:
return -1
# python里,对c语言的库 ,需要显式定义入参和出参,否则ctypes可能会出错
self.nativelib.ssock_create.argtypes = FN_ssock_create["argtypes"]
self.nativelib.ssock_create.restype = FN_ssock_create["restype"]
self.nativelib.... | Python | 1 |
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import torch
from data.util import load_structure, extract_coords_from_structure, load_model, get_sec_structure, add_cryst1_if_missing
from tqdm import tqdm
import pickle
import warnings
warnings.filterwarnings("ignore")
... | Python | 1 |
ode.
use std::sync::Arc;
use grpcio::{Channel, ChannelBuilder, Environment};
/// An Oasis node connection.
pub struct Node {
channel: Channel,
}
impl Node {
/// Create a new Oasis node connection.
pub fn new(environment: Arc<Environment>, address: &str) -> Self {
// Create a gRPC channel with the... | Rust | 0 |
ete) == 1
else f"Detectados {set_bold_text(len(events_to_delete))} eventos huérfanos que serán eliminados del Calendar."
)
for event in events_to_delete:
LOGGER.warning(
f"Eliminando evento {set_bold_text(event['summary'])} del {set_bold_text(event['startDateTime... | Python | 1 |
Parser<'i, 't>) -> Result<Color, ParseError<'i, ()>> {
input.expect_function_matching("hwb")?;
let component_parser = DefaultComponentParser;
input.parse_nested_block(|input| {
parse_rgb_components_hwb(&component_parser, input)
})
}
#[inline]
fn parse_rgb_components_hwb<'i, 't, ComponentParser>(
compone... | Rust | 0 |
)
.retry(&mut backoff)
.unwrap();
let config = AlterConfig::new(broker).set("log.flush.interval.ms", &orig_val);
let res = admin_client
.alter_configs(&[config], &opts)
.wait()
.expect("alter configs failed");
assert_eq!(res, &[Ok(OwnedResourceSpecifier::Broker(0))]);
}
// ... | Rust | 0 |
pool(x)
if self.drop_rate:
x = F.dropout(x, p=float(self.drop_rate), training=self.training)
return x if pre_logits else self.fc(x)
def forward(self, x):
x = self.forward_features(x)
x = self.forward_head(x)
return x
#def _create_resnet(variant, pretrained=Fals... | Python | 1 |
PathLengthMapping {
#[inline]
fn eq(&self, other: &PyAny, py: Python) -> PyResult<bool> {
PyEq::eq(&self.path_lengths, &other.to_object(py), py)
}
}
impl PyDisplay for PathLengthMapping {
fn str(&self, py: Python) -> PyResult<String> {
Ok(format!("PathLengthMapping{}", self.path_lengths... | Rust | 0 |
itcnt: __kernel_long_t,
pub calcnt: __kernel_long_t,
pub errcnt: __kernel_long_t,
pub stbcnt: __kernel_long_t,
pub tai: int,
// Further padding bytes to allow for future expansion.
pub i_1: u32,
pub i_2: u32,
pub i_3: u32,
pub i_4: u32,
pub i_5: u32,
pub i_6: u32,
pub i_... | Rust | 0 |
uuid/{puuid}/ids?start=0&count=1'
headers = {'X-Riot-Token': API_KEY}
for attempt in range(retries):
try:
async with aiohttp.ClientSession() as session:
async with session.get(url, headers=headers) as response:
now = datetime.now().strftime("%Y-%m-%d %H:%... | Python | 1 |
ontext)
-> uw::_Unwind_Reason_Code;
}
#[lang = "eh_personality"]
#[no_mangle]
extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
ue_header: *mut uw::_Unwind_Exception,
context: *mut uw::... | Rust | 0 |
a0 : np.ndarray
The original adjacency matrix.
pred : np.ndarray
The predicted adjacency matrix.
mask : Optional[np.ndarray], optional
The mask to apply on the data, by default None.
threshold : float, optional
The threshold to binarize the predictions, by default 0.1.
R... | Python | 1 |
et=US-ASCII')
body.append('Content-Transfer-Encoding: 8bit')
body.append('')
body.append(lat)
if long is not None:
body.append('--' + BOUNDARY)
body.append('Content-Disposition: form-data; name="long"')
body.append('Content-Type... | Python | 1 |
listed.
# 1 liners for in html syntax
contrib_companies = (
"<b>Unity Technologies</b> - FBX Exporter",
"<b>BioSkill GmbH</b> - H3D compatibility for X3D Exporter, "
"OBJ Nurbs Import/Export",
"<b>AutoCRC</b> - Improvements to fluid particles, vertex color baking",
"<b>A... | Python | 1 |
_for_sdk)
}
if 'key_content' in profile_config and 'key_file' not in profile_config:
if os.path.exists(key_file_path):
os.remove(key_file_path)
return clients, None
except Exception as e:
return None, f"创建OCI客户端失败: {str(e)}"
def _ensure_subnet_in_profi... | Python | 1 |
from discord.ext import commands
import discord
import json
# Load config
with open('config.json', 'r') as f:
config = json.load(f)
OWNER_ID = int(config['OWNER_ID'])
async def setup(bot):
"""
Setup function to add the logclear command to the bot.
Args:
bot: The bot instance
"""
b... | Python | 1 |
import numpy as np
def get_lr_cosine_schedule(
it: int,
max_learning_rate: float,
min_learning_rate: float,
warmup_iters: int,
cosine_cycle_iters: int,
):
"""
Given the parameters of a cosine learning rate decay schedule (with linear
warmup) and an iteration number, return the learning... | Python | 1 |
in_top: f64,
pub margin_bottom: f64,
pub margin_left: f64,
pub margin_right: f64,
pub page_ranges: String,
pub ignore_invalid_page_ranges: bool,
pub header_template: String,
pub footer_template: String,
pub prefer_css_page_size: bool,
}
/**
* Refer to https://chromedevtools.github.io/d... | Rust | 0 |
rgs.classes, bilinear=args.bilinear,
c_attention=False, s_attention=False)
model = model.to(memory_format=torch.channels_last)
logging.info(f'Network:\n'
f'\t{model.n_channels} input channels\n'
f'\t{model.n_classes} output channels (classes)\n'
... | Python | 1 |
import discord
import json
from discord.ext import commands, tasks
import os
# Define the intents
intents = discord.Intents.default()
intents.messages = True # Enable message intents
intents.guilds = True
intents.voice_states = True
intents.members = True
intents.message_content = True # Necessário para ler mensagen... | Python | 1 |
_REGISTERED);
assert!(
self.whitelisted_tokens.contains(token_id)
|| account_deposit.tokens.contains_key(token_id),
"ERR_TOKEN_NOT_WHITELISTED"
);
account_deposit.add(token_id.clone(), amount);
self.deposited_amounts.insert(sender_id, &account_depo... | Rust | 0 |
from collections import deque
def create_graph(tubes):
graph = {}
for i, tube in enumerate(tubes):
color_count = {}
for color in tube:
if color in color_count:
color_count[color] += 1
else:
color_count[color] = 1
graph[i] = color_... | Python | 1 |
import argparse
import torch
from models.otter.modeling_otter import OtterForConditionalGeneration
# Define argument parser
parser = argparse.ArgumentParser(description="Load a model with specified precision and save it to a specified path.")
# Add arguments
parser.add_argument(
"--load_bit",
type=str,
ch... | Python | 1 |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from renate.utils.misc import (
AdditionalTrainingMetrics,
int_or_str,
maybe_populate_mask_and_ignore_logits,
)
@pytest.mark.parametrize(
"data_type,target",
[
... | Python | 1 |
X86_INS_VPMAXUW = 1239,
X86_INS_VPMINSB = 1240,
X86_INS_VPMINSD = 1241,
X86_INS_VPMINSQ = 1242,
X86_INS_VPMINSW = 1243,
X86_INS_VPMINUB = 1244,
X86_INS_VPMINUD = 1245,
X86_INS_VPMINUQ = 1246,
X86_INS_VPMINUW = 1247,
X86_INS_VPMOVB2M = 1248,
X86_INS_VPMOVD2M = 1249,
X86_INS_VP... | Rust | 0 |
if icon_path:
_toast_notify(t_title, message, app_id=APP_NOTIFY_NAME, icon={"src": icon_path, "placement": "appLogoOverride", "hint-crop": "none"}) # type: ignore
else:
_toast_notify(t_title, message, app_id=APP_NOTIFY_NAME) # type: ignore
except Exception as e:
... | Python | 1 |
"train_classification_loss": losses_dict["classification_loss"].detach().item(),
# "train_total_loss": total_loss.detach().item() # Detach total_loss before calling .item()
# }
# self.log(logs)
# return total_loss # Return total_loss for backpropagation
# def... | Python | 1 |
NYIJGLVIUQ";
assert_eq!(
enigma.encrypt_string(cleartext.to_string()),
expected.to_string()
);
}
}
pub struct LineBuf {
buf: Vec<u8>,
buffer_size: usize,
pending_cr: bool,
}
const LF: u8 = b'\n';
const CR: u8 = b'\r';
impl LineBuf {
pub fn new(buffer_size: u... | Rust | 0 |
ted_img))
ssim.append(utils.SSIM(gt_img, restorted_img))
gt_img_ = torch.from_numpy(gt_img).unsqueeze(0).permute(0,3,1,2).cuda()
restorted_img_ = torch.from_numpy(restorted_img).unsqueeze(0).permute(0,3,1,2).cuda()
pips.append(alex(gt_img_, restorted_img_, normalize=True... | Python | 1 |
astype(np.float32)
img = [img[..., i] for i in range(img.shape[-1])]
sweep_imgs_list.extend(img)
sweep_ts = [lidar_timestamp - sweep[sensor]['timestamp'] / 1e6 for sensor in self.sensors]
timestamp_imgs_list.extend(sweep_ts)
for sensor in ... | Python | 1 |
import hashlib
import os
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backe... | Python | 1 |
return kbk4nbzwjwm
'# plug_back_decrement -> telecommunication_radio_ounces'
'# plug_back_decrement -> telecommunication_radio_ounces'
def oq7on8s9k4j(kll6ld_fe_o, ox8nical344: w95snj_0b9i, inaitr530_a: p9v7u3hgput, mkyepu8nx8h, riylu7n2m4d: ht8h_cg5qfh):
assert v40zie3hqd0
csdp4o46o45: u11qo1gt5f5 = ... | Python | 1 |
od returns [pwd_set::R](pwd_set::R) reader structure"]
impl crate::Readable for PWD_SET {}
#[doc = "`write(|w| ..)` method takes [pwd_set::W](pwd_set::W) writer structure"]
impl crate::Writable for PWD_SET {}
#[doc = "USB PHY Power-Down Register"]
pub mod pwd_set;
#[doc = "USB PHY Power-Down Register\n\nThis register y... | Rust | 0 |
OVEMENT_SPEED * rot.sin();
}
// break
if input & INPUT_UP == 0 && input & INPUT_DOWN != 0 {
vel_x -= MOVEMENT_SPEED * rot.cos();
vel_y -= MOVEMENT_SPEED * rot.sin();
}
// turn left
if input & INPUT_LEFT != 0 && input... | Rust | 0 |
same file as given fd.
/// Returns Ok(new file descriptor) on success, Err(()) on error.
pub fn sys_dup(&self, proc: &mut CurrentProc<'_>) -> Result<usize, ()> {
let (_, f) = argfd(0, proc)?;
let newfile = f.clone();
let fd = newfile.fdalloc(proc).map_err(|_| ())?;
Ok(fd as usize... | Rust | 0 |
import numpy as np
# Map joints Name to SMPL joints idx
JOINT_MAP = {
'MidHip': 0,
'LHip': 1, 'LKnee': 4, 'LAnkle': 7, 'LFoot': 10,
'RHip': 2, 'RKnee': 5, 'RAnkle': 8, 'RFoot': 11,
'LShoulder': 16, 'LElbow': 18, 'LWrist': 20, 'LHand': 22,
'RShoulder': 17, 'RElbow': 19, 'RWrist': 21, 'RHand': 23,
'spine1': 3, 'spine2'... | Python | 1 |
othoracic surgery",
"MNJ" => "Vascular surgery",
"MNK" => "Surgical oncology",
"MNL" => "Critical care surgery",
"MNN" => "Neurosurgery",
"MNP" => "Plastic & reconstructive surgery",
"MNPC" => "Cosmetic surgery",
"MNQ" => "Transplant surgery",
"MNS" => "Surgical orthopaedics & fractures"... | Rust | 0 |
id();
let LegacyTransaction { nonce, gas_price, gas_limit, value, kind, input, .. } = tx;
TxEnv {
caller,
transact_to: transact_to(kind),
data: input.0.clone(),
chain_id,
nonce: Some(nonce... | Rust | 0 |
ted_properties[pt.id]['food_values'][i.food.id] = {'id': i.food.id, 'food': {'id': i.food.id, 'name': i.food.name}, 'value': None}
if has_property_value and i.unit is not None:
computed_properties[pt.id]['food_values'][i.food.id]['missing_conversion'] = {'base... | Python | 1 |
"""IMAP4 client.
Based on RFC 2060.
Public class: IMAP4
Public variable: Debug
Public functions: Internaldate2tuple
Int2AP
ParseFlags
Time2Internaldate
"""
# Author: Piers Lauder <piers@cs.su.oz.au> December 1997.
#
# Auth... | Python | 1 |
import tkinter as tk
from tkinter import messagebox
from tkinter import PhotoImage
import os
import subprocess
from PIL import Image, ImageTk # Importing PIL for image resizing
# List of images and corresponding project paths
image_paths = [
("1_email_validation/demo.PNG", "1_email_validation/app.py", "Email Vali... | Python | 1 |
_0::StructureType {
pub const PHYSICAL_DEVICE_PIPELINE_EXECUTABLE_PROPERTIES_FEATURES_KHR: Self = Self(1000269000);
pub const PIPELINE_INFO_KHR: Self = Self(1000269001);
pub const PIPELINE_EXECUTABLE_PROPERTIES_KHR: Self = Self(1000269002);
pub const PIPELINE_EXECUTABLE_INFO_KHR: Self = Self(1000269003)... | Rust | 0 |
false)
}
#[doc = r" Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
const MASK: bool = true;
const OFFSET: u8 = 7;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u3... | Rust | 0 |
PAST_TIMESTAMP,
);
single_from_string_to_string_special_case(
&(PAST_TIMESTAMP_PART.to_owned() + "00O0000000000000"),
&(PAST_TIMESTAMP_PART.to_owned() + "0000000000000000"),
PAST_TIMESTAMP,
);
}
fn single_from_string_to_string_special_cas... | Rust | 0 |
=> {
let channel = ProjectIdChannel::new();
let receiver = channel.receiver();
entry.insert(channel);
// Fetch each project id individually. The result is cached indefinitely and those
// requests only happen infrequently. Since the store... | Rust | 0 |
(DataSource)
if user_id:
base_query = base_query.filter(DataSource.user_id == user_id)
total = base_query.count()
active = base_query.filter(DataSource.is_active == True).count()
# 按类型统计
type_stats = {}
... | Python | 1 |
t
}
let (device_index, _device_name, device_latency) =
portaudio_device(&portaudio, audio_device.map(|d| pa::DeviceIndex(d as u32))).unwrap();
const INTERLEAVED: bool = true;
let stream_parameters: pa::StreamParameters<f32> =
pa::StreamParameters::new(device_index, CHANNELS as i32, INTERLEAVED, de... | Rust | 0 |
DecoratedCustomViewStyle.html)
///
/// Required feature: android-app-Notification_DecoratedCustomViewStyle
public class Notification_DecoratedCustomViewStyle ("android/app/Notification$DecoratedCustomViewStyle") extends crate::android::app::Notification_Style {
/// [DecoratedCustomViewStyle](https:... | Rust | 0 |
] [-p <port>]
echo_udp (-h | --help)
echo_udp (-v | --version)
Options:
-h --help Show this screen.
-v --version Show version.
-t <threads> number of threads to use [default: 1].
-p <address> port of the server [default: 30000].
";
#[derive(Debug, Deserialize)]
struct Args {
fla... | Rust | 0 |
::Opcode::JrGtF => ir::Opcode::CpGtF,
ir::Opcode::JrEq8 => ir::Opcode::CpEq8,
ir::Opcode::JrEq16 => ir::Opcode::CpEq16,
ir::Opcode::JrEq32 => ir::Opcode::CpEq32,
ir::Opcode::JrEqF => ir::Opcode::CpEqF,
ir::Opcode::JrNeq8 => ir::Opcode::CpNeq8,
... | Rust | 0 |
Regression predicted features to split.
base_xyz (torch.Tensor): Coordinates of points.
prefix (str): Decode predictions with specific prefix.
Defaults to ''.
Returns:
dict[str, torch.Tensor]: Split results.
"""
results = {}
start, en... | Python | 1 |
"""fix_memory
迁移 ID: 1d99948099bb
父迁移: 3537b7cb6a29
创建时间: 2025-08-16 18:08:27.480805
"""
from __future__ import annotations
from collections.abc import Sequence
import sqlalchemy as sa
from alembic import op
revision: str = "1d99948099bb"
down_revision: str | Sequence[str] | None = "3537b7cb6a29"
branch_labels: s... | Python | 1 |
def dfs(level, tri):
print(*tri)
if level == N-1:
return
if len(tri) == 1:
tri.append(1)
else:
for i in range(len(tri)-1):
tri.insert(i+1, tri[2*i]+tri[2*i+1])
if level >= 2:
for i in range(level-1):
tri.pop(len(tri)-2)
dfs(lev... | Python | 1 |
from fastapi import APIRouter, HTTPException,Request
from model.Message import FeedbackUpdate, ChatRequest
from model.ApiConfiguration import ApiEndpoint, ApiConfigurationUpdate
from useCases.chatUseCase import sendMessage
from useCases.feedbackUseCase import give_feedback
from useCases.feedbackAnalysisUseCase import... | Python | 1 |
2dqlzbiorl as ee03r4cxf2u, d0gzy9iqugd as m1bvdex6jwa, h3a3nqgmvtj, s_m0k5i8m03, n9j4p5c_1zu as ptt1qe0dfkn
@[False, ttxjio7d4um, 0j, f5ibpovl4f8]
@('' for ehk7e521b0m in okkbtzjkdmt if b'' for t_2e83y3q87 in l1uu0vodkmt if ve0znuqdnn0 if 0.0 for f6p507kdk1y in umtu8tuxd5y)
@{0j}
def y7cdguz8bvr(izugmq_nsbh=b''):
a... | Python | 1 |
y, Key::EditionMarker);
}
#![recursion_limit = "2560"]
use insta::assert_debug_snapshot;
use optic_engine::{
diff_interaction, DiffInteractionConfig, HttpInteraction, SpecEvent, SpecProjection,
};
use petgraph::dot::Dot;
use serde_json::json;
#[test]
fn scenario_32() {
let events: Vec<SpecEvent> =
serde_js... | Rust | 0 |
import os
import numpy as np
import tempfile
import pytest
from clip_retrieval.clip_inference.distributor import SequentialDistributor, PysparkDistributor
@pytest.mark.parametrize("distributor_kind", ["sequential", "pyspark"])
def test_distributor(distributor_kind):
os.environ["CUDA_VISIBLE_DEVICES"] = ""
w... | Python | 1 |
=> Orientation::new(p1, p, p2),
}
}
pub fn orient_along_vector(
p1: &Point<T, 2>,
vector: &Vector<T, 2>,
p2: &Point<T, 2>,
) -> Orientation {
Orientation::along_vector(&p1, &vector, &p2)
}
pub fn orient_along_perp_vector(
p1: &Point<T, 2>,
vector: &Vector<T, 2>,
p2: &Point<T... | Rust | 0 |
UTHORIZED,
detail="Invalid username or password"
)
if not user.is_active:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail="User account is disabled"
)
return user
@router.get("/username/{username}", response_model=UserRe... | Python | 1 |
', ' ', '.', '3', '1', '0', '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '/', '2', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', '... | Python | 1 |
for the dataframe",
example: r#"[[a b]; [6 2] [1 4] [4 1]]
| dfr to-lazy
| dfr with-column (
dfr when ((dfr col a) > 2) 4 | dfr otherwise 5 | dfr as c
)
| dfr with-column (
dfr when ((dfr col a) > 5) 10 | dfr when ((dfr col a) < 2) 6 | dfr otherwise 0 | dfr as d
)
| d... | Rust | 0 |
screen_pos += screen_offset;
// hacky way to ensure that the text is only being rendered when
// (more or less) on the screen, without being cut off if the
// center of the text is just outside the visible area
if screen_pos.x > -screen_rect.width()
&& screen_pos.x < 2.0 * s... | Rust | 0 |
for (_, count) in &mut column.rows {
*count = 1;
}
}
fn count_op(column: &TableView) -> Result<ColValN, EvalError> {
let mut total_count: i32 = 0;
for (val_row, count) in &column.rows {
let val = val_row.iter().next().unwrap();
ma... | Rust | 0 |
:16:3 -09:30) - datetime!(1615-6-30 15:39:33 +09:15),
Interval::default()
.with_years(-1010)
.with_months(-1)
.with_days(-29)
.with_hours(-10)
.with_minutes(-38)
.with_seconds(-30)
);
assert_eq!(
datetime!(1353-11-30 9:15:32... | Rust | 0 |
son(json_text=bits_json)
loaded_digits_result = cirq.read_json(json_text=digits_json)
if use_records:
assert loaded_bits_result.records['m'].dtype == np.uint8
assert loaded_digits_result.records['m'].dtype == np.uint8
else:
assert loaded_bits_result.measurements['m'].dtype == np.uin... | Python | 1 |
_qat_module(
build_fakequanted_net(build_observered_net(MyModule(), Q.MinMaxObserver), Q.TQT)
)
_check_qat_module(
build_fakequanted_net(build_observered_net(MyModule(), Q.MinMaxObserver), MyTQT)
)
def test_load_param():
def _check_param(moda: M.Module, modb: M.Module):
for nam... | Python | 1 |
service type"))?;
let mut gamma = std::collections::HashSet::new();
let t2 = env.merge_type(env2, t2);
crate::types::subtype::subtype(&mut gamma, &env, &t1, &t2)?;
Ok(())
}
/// Encode sequence of Rust values into Candid message of type `candid::Result<Vec<u8>>`.
#[macro_export]
macro_rules! Encode {
... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
单元测试 for channel_manager_lib.config_utils
"""
import pytest
import yaml
from pathlib import Path
from channel_manager_lib.config_utils import load_yaml_config # 假设函数路径正确
# TODO: 添加更多测试用例
def test_load_yaml_config_success(tmp_path: Path):
"""
测试 load_yaml_config 函数能否成功加载有效的 YAML 文件... | Python | 1 |
/// rate 2/3 short FECFRAME
R2_3short,
/// rate 3/4 short FECFRAME
/// (the LDPC rate is actually 11/15)
R3_4short,
/// rate 4/5 short FECFRAME
/// (the LDPC rate is actually 7/9)
R4_5short,
/// rate 5/6 short FECFRAME
/// (the LDPC rate is actually 37/45)
R5_6short,
/// rate... | Rust | 0 |
them into the bezier function
// to get x,y values (make vec 2 bigger for t=0,t=1 values)
// loop over any of the points dimensions (they're all the same)
for (dim, _) in a.into_iter().enumerate() {
let mut extrema: ArrayVec<[P::Scalar; 4]> = ArrayVec::new();
extrema.ext... | Rust | 0 |
# Copyright (c) 2021 - present / Neuralmagic, Inc. 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 required b... | Python | 1 |
b, c, d] => {
Some(Inet4Addr::new(a, b, c, d))
}
_ => None,
}
}
}
impl AsRef<libc::in6_addr> for Inet6Addr {
#[inline]
fn as_ref(&self) -> &libc::in6_addr {
&self.0
}
}
impl From<libc::in6_addr> for Inet6Addr {
#[inline]
fn from(a: libc::... | Rust | 0 |
:NAVIGATE.with(Nav::ArtistDetail(link.to_owned())));
})
.context_menu(artist_menu)
}
pub fn cover_widget(size: f64) -> impl Widget<Artist> {
let radius = size / 2.0;
RemoteImage::new(placeholder_widget(), move |artist: &Artist, _| {
artist.image(size, size).map(|image| image.url.clone()... | Rust | 0 |
# Databricks notebook source
# MAGIC %run "../includes/common_functions"
# COMMAND ----------
dbutils.widgets.text("p_data_source", "")
# COMMAND ----------
v_data_source = dbutils.widgets.get("p_data_source")
# COMMAND ----------
from pyspark.sql.types import IntegerType, StringType, DateType, StructField, Struc... | Python | 1 |
y::PageUp),
XK_Page_Down | XK_KP_Page_Down => Some(Key::PageDown),
XK_Shift_L | XK_Shift_R => {
update_modifiers(Modifiers::SHIFT);
None
}
XK_Alt_L | XK_Alt_R => {
update_modifiers(Modifiers::ALT);
None
}
XK_Control_L | XK_C... | Rust | 0 |
# Copyright 2022 by Autodesk, Inc.
# Permission to use, copy, modify, and distribute this software in object code form
# for any purpose and without fee is hereby granted, provided that the above copyright
# notice appears in all copies and that both that copyright notice and the limited
# warranty and restricted ... | Python | 1 |
# Exploit Title: nipper-ng CVE-2019-17424
# Date: 20/10/2019
# Exploit Author: Guy Levin (@va_start - twitter.com/va_start) https://blog.vastart.dev
# Vendor Homepage: https://tools.kali.org/reporting-tools/nipper-ng
# Software Link: https://code.google.com/archive/p/nipper-ng/source/default/source
# Version: 0.11.10
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.