text string | label_name string | labels int64 |
|---|---|---|
_buffer, vertex_array)
};
TextRender {
vertex_buffer,
vertex_array
}
}
pub fn render_line<'b, TextIterator>(&self,
shader: &Shader,
transform: &Matrix4<f32>,
... | Rust | 0 |
G=GA -> complementary to original bottom strand (CTOB)
// OB and CTOB reads are mapped as reverse
let xr = record.aux(b"XR").expect("Missing XR tag").string();
let xg = record.aux(b"XG").expect("Missing XG tag").string();
let reverse = if xr == b"CT" && xg == b"CT" {
total_ot... | Rust | 0 |
supported_models.models = [Kolors]
self.original_load_clipvision_from_sd = comfy.clip_vision.load_clipvision_from_sd
comfy.clip_vision.load_clipvision_from_sd = load_clipvision_vitl_336
def __exit__(self, type, value, traceback):
import comfy.ldm.modules.diffusionmodules.openaimodel
... | Python | 1 |
let proxy_port = tcp_proxy_handle
.register_client(tcp_proxy_server_end)
.map_err(|_| anyhow!("Error on register client"))
.unwrap();
let tcp_proxy_fut = tcp_proxy.serve_proxy_while_open_clients().shared();
fasync::Task::spawn(tcp_proxy_fut.clone()).detach();
... | Rust | 0 |
None => {
compile_error(format!("The path {:?} cannot be canonicalized to a UTF-8 string.", p))
}
}
}
#[inline]
pub fn output_expr(expr: &Expr) -> TokenStream {
let code = quote! {
#expr
};
code.into()
}
// Copyright 2019 WHTCORPS INC Project Authors. Licensed under A... | Rust | 0 |
tact_sensors=True,
rigid_props=sim_utils.RigidBodyPropertiesCfg(
disable_gravity=False,
retain_accelerations=False,
linear_damping=0.0,
angular_damping=0.0,
max_linear_velocity=1000.0,
max_angular_velocity=1000.0,
max_depenetrat... | Python | 1 |
_unicast(
buffer_unicast[..sz].to_vec(),
client
);
}
};
});
// 注册设备发现, 设备发现必须要在主线程, 当设备发现出错的时候直接中断线程, 而不是等待服务线程主导中断
let mut buffer_multicast = vec![0;self.capacity];
let main_cb = cb.clone();... | Rust | 0 |
tion,
TokenTransaction,
}
#[derive(Default)]
struct RequestCount {
create_address: AtomicU64,
send_transaction: AtomicU64,
recv_transaction: AtomicU64,
send_token_transaction: AtomicU64,
recv_token_transaction: AtomicU64,
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub struct ClientServiceM... | Rust | 0 |
c<f32> {
let character = 'A';
let font_data = include_bytes!("../assets/font/FiraMono-Regular.ttf");
let mut generator = MeshGenerator::new(font_data);
let result: MeshText = generator
.generate_glyph_2d(character, None)
.expect("Failed to generate glyph.");
result.vertices
}
fn ma... | Rust | 0 |
ef ctdet_decode(heat, wh, reg=None, cat_spec_wh=False, K=100):
batch, cat, height, width = heat.size()
# heat = torch.sigmoid(heat)
# perform nms on heatmaps
heat = _nms(heat)
scores, inds, clses, ys, xs = _topk(heat, K=K)
if reg is not None:
reg = _tranpose_and_gather_feat(reg, in... | Python | 1 |
tion.notifications.context_processors.notifications',
'oscar.core.context_processors.metadata',
],
},
},
]
WSGI_APPLICATION = 'Ecommerce.wsgi.application'
# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE... | Python | 1 |
activated, true);
assert!(matches!(block.activate(), Err(Error::AlreadyActivated)));
}
// Test a read-only root device.
{
let mut mock = CommonArgsMock::new();
let common_args = mock.args();
let args = BlockArgs {
common: common_ar... | Rust | 0 |
# Copyright 2015 Ufora Inc.
#
# 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 agreed to i... | Python | 1 |
base = Url::parse(fallback_url).map_err(|_| "Failed to parse fallback URL")?;
let cert_base = Url::parse(cert_origin).map_err(|_| "Failed to parse cert origin")?;
// 16384 is the max mice record size allowed by SXG spec.
// https://wicg.github.io/webpackage/draft-yasskin-http-origin-signed-respo... | Rust | 0 |
+= F::EMSCRIPTEN_SIZE_IN_BYTES;
Some(current_value)
})
}
}
use std::io::{Cursor, Read};
use std::iter::Iterator;
use anyhow::Result;
use blstrs::Scalar as Fr;
use filecoin_proofs::{
add_piece, commitment_from_fr,
pieces::{
compute_comm_d, get_piece_alignment, get_piece_start_byt... | Rust | 0 |
PageNs], &[PageNs]),
buffer_size: usize,
) -> Result<AHashMap<(PageNs, PageTitle), LinkCount>>
where
T: Read + Send,
{
let pagelinks: Mutex<AHashMap<(PageNs, PageTitle), LinkCount>> = Mutex::new(AHashMap::new());
let mut source = ChunkedReader::new(source);
let buffers = BufferQueue::new(num_cpus::... | Rust | 0 |
#! /usr/bin/env python3
"""
Command-line script to merge a branch.
"""
import io
from os import path
import sys
import logging
import yaml
import click
import click_log
# Add top-level module path to sys.path before importing tubular code.
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from tu... | Python | 1 |
med automatically if required.
///
/// For best performance, prefer passing a value of:
/// 1. [PStr], if the string can be known at compile-time
/// 2. [IntoParameterString], if one is available
/// 3. A platform-specific type, such as the result of calling an OS API.
/// 4. A type with the native encoding, such a... | Rust | 0 |
it complete
# Should return to idle
assert chat_interface._callback_state == CallbackState.IDLE
async def test_adaptive_parameter_inheritance(self):
"""Test that adaptive parameter is properly inherited from ChatFeed."""
# Test that the parameter exists in the ChatFeed base class
... | Python | 1 |
// invocation of the prefilter.
#[inline]
fn update_skipped_bytes(&mut self, skipped: usize) {
self.skips += 1;
self.skipped += skipped;
}
/// Updates the position at which the last scan stopped. This may be
/// greater than the position of the last candidate reported. For example,
... | Rust | 0 |
AIA,
/// Antarctica
ATA,
/// Antigua and Barbuda
ATG,
/// Argentina
ARG,
/// Armenia
ARM,
/// Aruba
ABW,
/// Australia
AUS,
/// Austria
AUT,
/// Azerbaijan
AZE,
/// Bahamas
BHS,
/// Bahrain
BHR,
/// Bangladesh
BGD,
/// Barba... | Rust | 0 |
file may not be copied, modified, or distributed
// except according to those terms.
//
// Portions copyright The Rust Project Developers. Licensed under
// the MIT License.
extern crate thincollections;
use thincollections::thin_hasher::*;
use thincollections::thin_map::ThinMap;
use thincollections::thin_sentinel::... | Rust | 0 |
pdate_secrets(
mock_sys: MagicMock,
mock_print_warn: MagicMock,
mock_update_secret: MagicMock,
mock_load_k8s_config: MagicMock,
):
_update_secret("foo", "prod", ["bad-secret-data"])
mock_print_warn.assert_called_once()
_update_secret("foo", "prod", ["FOO=BAR"])
mock_update_secret.assert... | Python | 1 |
(msg: T) -> Error {
Error::Custom(msg.into())
}
fn end_of_stream() -> Error {
Error::EndOfStream
}
fn invalid_type(ty: de::Type) -> Error {
Error::InvalidType(ty)
}
fn invalid_value(msg: &str) -> Error {
Error::InvalidValue(msg.to_owned())
}
fn invalid... | Rust | 0 |
import time
from selenium import webdriver
from selenium.webdriver import Keys
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
opt = Options()
opt.add_experimental_option("debuggerAddress", "localhost:8989")
driver = webdriver.Chrome(options=opt)
# Colocar os ceps da... | Python | 1 |
2.field_behavior].append(
field_behavior_pb2.FieldBehavior.Value("REQUIRED")
)
# Field Octopus Errors
# - Not annotated with google.api.field_info.format = UUID4
octopus = make_field_pb2(name="octopus", type="TYPE_STRING", number=1)
fd = get_file_descriptor_proto_for_tests(fields=[squid, oc... | Python | 1 |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from contextlib import contextmanager
from torch._C._functorch import _vmap_add_layers, _vmap_remove_layers
_en... | Python | 1 |
session"), is_length_under(20));
//!
//! ```
//!
//! For more details about examples check out [the `examples` directory on GitHub](https://github.com/bnjjj/tide-validator/tree/master/examples)
use serde::Serialize;
use serde_json::json;
use std::collections::HashMap;
use std::str::FromStr;
use std::{fmt::Debug, sync:... | Rust | 0 |
::Primary>{"主要按钮"}</Button>
<Button plain=true btype=ButtonType::Success>{"成功按钮"}</Button>
<Button plain=true btype=ButtonType::Info>{"信息按钮"}</Button>
<Button plain=true btype=ButtonType::Warning>{"警告按钮"}</Button>
<Button plain=true btype=B... | Rust | 0 |
or supervisor
B27,
/// Thesis examiner
B28,
/// Scientific editor: Responsible overall for the scientific content of the publication
B29,
/// Historical advisor: For use in ONIX 3.0 only
B30,
/// Original editor: Editor of the first edition (usually of a standard work) who is not an edi... | Rust | 0 |
from cleanil.utils import (
load_yaml,
set_seed,
get_device,
get_logger,
LoggerConfig,
)
from cleanil.envs.utils import make_environment, EnvConfig
from cleanil.rl import sac
from cleanil.rl.actor import make_tanh_normal_actor
from cleanil.rl.critic import DoubleQNetwork
from torchrl.data import... | Python | 1 |
.
///
/// This macro only takes one argument which is a string literal of the feature
/// being tested for. The feature names supported are the lowercase versions of
/// the ones defined by Intel in [their documentation][docs].
///
/// ## Supported arguments
///
/// This macro supports t... | Rust | 0 |
ua=ua,
proxy=proxy,
site=site)
except (FileNotFoundError, IOError, OSError) as e:
self.debug("查询本地已知答案失败,继续请求豆瓣查询")
# 本地不存在正确答案则请求豆瓣查询匹配
for value, ans... | Python | 1 |
#User function Template for python3
def distinct(arr):
# Your Code here
distinct_elements=set(arr) # distinct elements are not repeatable elements in an array
c=0
for i in range(len(distinct_elements)):
c+=1
return c
| Python | 1 |
#[derive(Clone,Copy,PartialEq,Debug)]
enum ParentType {
L1,
L2,
T,
Z1,
Z2,
Line,
Block,
}
#[derive(Copy,Clone,PartialEq,Debug)]
struct Cell {
pos: V2,
offset: V2,
hitbox: ggez::graphics::Rect,
parent: ParentType,
color: ggez::graphics::Color,
back_color: ggez::graphi... | Rust | 0 |
use serde::ser::{Serialize, Serializer};
use serde_utils::hex::encode as hex_encode;
use ssz::{Decode, Encode};
use std::fmt;
use std::marker::PhantomData;
use tree_hash::TreeHash;
/// The compressed bytes used to represent `GenericAggregateSignature::empty()`.
pub const EMPTY_SIGNATURE_SERIALIZATION: [u8; SIGNATURE_... | Rust | 0 |
* (-2.0 / 3.0));
right_grad.set(right_grad.get() + output_grad * (1.0 / 12.0));
} else if x >= 1.0 {
left_grad.set(left_grad.get() + output_grad * (-1.0 / 12.0));
centre_grad.set(centre_grad.get() + output_grad * (2.0 / 3.0));
right_grad.set(right_grad.get() + output_grad * (x - 7.0 / 12.0... | Rust | 0 |
ent>($($arg:ident : $ty:ty),*)) => {
#[inline]
fn $func<$v>(self, $($arg: $ty,)* visitor: $v) -> $crate::export::Result<$v::Value, Self::Error>
where
$v: $crate::de::Visitor<$l>,
{
$(
let _ = $arg;
)*
self.deserialize_any(vi... | Rust | 0 |
from bank import value
def test_bank():
assert value("hello sir") == 0
assert value("sir") == 100
assert value("HI sir") == 20
| Python | 1 |
> Channel {
Channel {
enabled: false,
length: 0,
carrier: Waveform {
waveform_type: 0,
pitch: 0.0,
level: 0,
offset: 0,
},
frequency: Waveform {
waveform_type: 0,
... | Rust | 0 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
g()).unwrap();
assert!(res.gateway.is_some());
// but after unbonding it, he doesn't own one anymore
crate::gateways::transactions::try_remove_gateway(deps.as_mut(), mock_info("fred", &[]))
.unwrap();
let res = query_owns_gateway(deps.as_ref(), "fred".to_string()).unwrap();... | Rust | 0 |
class super:
msg = "truly super"
class C:
def method(self):
return super().msg
| Python | 1 |
import torch
from datasets import load_dataset
from transformers import Llama4ForConditionalGeneration, Llama4Processor
from llmcompressor import oneshot
from llmcompressor.modeling import replace_modules_for_calibration
from llmcompressor.modifiers.quantization import GPTQModifier
# Select model and load it.
model_i... | Python | 1 |
zero());
assert!(!f1f2g.is_zero());
let f1g = g.mul(f1).into_affine();
assert_eq!(g.mul(f1 * &f2).into_affine(), f1f2g);
assert_eq!(f1g.mul(f2).into_affine(), f1f2g);
}
#[test]
fn test_bytes() {
let g_from_repr = EdwardsAffine::from_str(
"(11588701171769672691928993436365535229710097772372... | Rust | 0 |
ag, true);
assert_eq!(client_flag, false);
});
}
#[test]
fn fn_micropayment_statistics() {
new_test_ext().execute_with(|| {
Micropayment::update_micropayment_information(&2, &1, 7);
Micropayment::update_micropayment_information(&4, &1, 3);
run_to_block(3);
Micropayment::... | Rust | 0 |
.id.clone(),
}
}
}
use futures::stream::{Stream, StreamExt};
use std::{pin::Pin, task::Context, task::Poll};
pub struct NashStream {
pub client: Client,
}
impl Stream for NashStream {
type Item = std::result::Result<
nash_protocol::protocol::subscriptions::SubscriptionResponse,
na... | Rust | 0 |
#Get the total number of attendees
totalAttendees = int(input())
#Create a blank list to store the number of guests for each day
numGuests = [0] * 5
#Create a variable to store the highest number of attendees a day has
mostAttendees = 0
for x in range(totalAttendees):
#Get the schedule of the guests
schedule = inp... | Python | 1 |
ath, import_from
)
import_name = node.parent.text
assert import_name is not None
import_name = import_name.decode("utf-8")
import_statement_to_count[
f"from {import_from} import {import_name}"
] += 1
... | Python | 1 |
from django.shortcuts import render
from articles.models import Article
def articles_list(request):
template = 'articles/news.html'
ordering = '-published_at'
article = Article.objects.prefetch_related('tags').order_by(ordering)
context = {'object_list': article}
return render(request, template, ... | Python | 1 |
as *const _ as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(ATCAIfaceCfg),
"::",
stringify!(cfg_data)
)
);
}
pub type ATCAIface = *mut atca_iface;
#[doc = " \\brief atca_iface is the C object backing ATCAIface. See the atca_iface... | Rust | 0 |
)
.entry( &"time_zero", &self.time_zero )
.entry( &"size", &self.size )
.entry( &"data_head", &self.data_head )
.entry( &"data_tail", &self.data_tail )
.entry( &"data_offset", &self.data_offset )
.entry( &"data_size", &self.data_size )
... | Rust | 0 |
self.assertEqual(indtopoCC.sum(), 10496)
self.assertEqual(indtopoN.sum(), 10084)
# test 3D Curvilinear mesh
nodes_x = mesh_tensor.gridN[:, 0].reshape(mesh_tensor.vnN, order="F")
nodes_y = mesh_tensor.gridN[:, 1].reshape(mesh_tensor.vnN, order="F")
nodes_z = mesh_tensor.gridN[:,... | Python | 1 |
#!/usr/bin/env python
# encoding: utf-8
from .fetcher import *
from .territory import *
class KKBOXNewHitsPlaylistFetcher(Fetcher):
'''
List all new hits playlists and fetch tracks for specific new hit playlist.
See 'https://docs-en.kkbox.codes/v1.1/reference#new-hits-playlists'.
'''
@assert_acces... | Python | 1 |
ce).view(
timesteps.size(0), *[1 for _ in original_samples.shape[1:]]
)
noisy_samples = alpha_cumprod.sqrt() * original_samples + (1 - alpha_cumprod).sqrt() * noise
return noisy_samples.to(dtype=dtype)
def __len__(self):
return self.config.num_train_timesteps
def pr... | Python | 1 |
ip.extractall(target_dir)
def create_folders(dirs: List[Path]) -> None:
try:
for _dir in dirs:
if _dir.exists():
continue
_dir.mkdir(exist_ok=True)
Logger.print_ok(f"Created directory '{_dir}'!")
except OSError as e:
Logger.print_error(f"Erro... | Python | 1 |
C, 0x37, 0xE4, 0x29, 0xC2, 0xD8, 0x2A, 0xFD, 0xFE, 0x9B, 0x74, 0x2F, 0x54, 0x5D, 0x7E,
0x69, 0xAF, 0x1D, 0x4D, 0x51, 0xD9, 0x20, 0x9A, 0x47, 0x26, 0x3B, 0x96, 0xA7, 0x13, 0x0D,
0x8B, 0x92, 0xA7, 0x06, 0xD4, 0x34, 0x85, 0xB3, 0xCA, 0x9C, 0xB2, 0xC0, 0x97, 0x1C, 0xD0,
0xC7, 0x98,
]
);
set_pok... | Rust | 0 |
tal",
"Total number of sync committee contributions imported to fork choice, etc."
);
}
lazy_static! {
pub static ref GOSSIP_ATTESTATION_ERRORS_PER_TYPE: Result<IntCounterVec> =
try_create_int_counter_vec(
"gossipsub_attestation_errors_per_type",
"Gossipsub attestation ... | Rust | 0 |
from decimal import *
import requests, json, random, datetime, asyncio
import discord
from discord.ext import commands, tasks
from datetime import datetime
from decouple import config
import time
DISCORD_TOKEN = config('DISCORD_TOKEN')
OPENWEATHER_API_KEY = config('OPENWEATHER_API_KEY')
CHANNEL_ID = config('CHANNEL_ID... | Python | 1 |
import cv2
img = cv2.imread("pele.png")
cv2.imshow("pele",img)
cv2.waitKey()
cv2.destroyAllWindows() | Python | 1 |
self.clear_barrier_size();
self.unknown_fields.clear();
}
}
impl ::std::fmt::Debug for BarrierArgumentProto {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for BarrierArgumentProto {
... | Rust | 0 |
> {
&self.outgoing_edges
}
/// Returns a borrowed Set to the `Block` incoming edges
pub fn incoming_edges(&self) -> &IndexSet<Edge> {
&self.incoming_edges
}
}
impl<'f> Debug for Block<'f> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
if self.is_empty() {
... | Rust | 0 |
set(current_steps)
await self.update()
def __enter__(self):
self.start = utc_now()
previous_steps = local_steps.get() or []
parent_step = previous_steps[-1] if previous_steps else None
if not self.parent_id:
if parent_step:
self.parent_id = par... | Python | 1 |
# SPDX-License-Identifier: CC-BY-NC-SA-4.0
# Author: Miriel (@mirielnet)
import discord
from discord.ext import commands
from discord import app_commands
import whois
from datetime import datetime
class WhoisLookup(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(name="who... | Python | 1 |
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | Python | 1 |
use crate::Python;
use crate::ToPyObject;
#[test]
fn test_u32_max() {
let gil = Python::acquire_gil();
let py = gil.python();
let v = std::u32::MAX;
let obj = v.to_object(py);
assert_eq!(v, obj.extract::<u32>(py).unwrap());
assert_eq!(u64::from(v), obj.extra... | Rust | 0 |
import numpy as np
def combine_problem_matrices(G_ort1, h_ort1, G_soc1, h_soc1, G_ort2, h_ort2, G_soc2, h_soc2):
"""
Combine problem matrices for two primitives.
Args:
G_ort1, h_ort1: Orthogonal constraints for the first primitive.
G_soc1, h_soc1: Second-order cone constraints for the firs... | Python | 1 |
SetSize(100.0, 200.0)
]);
}
#[test]
fn size_changes_after_being_set() {
let anim = create_animation();
assert!(anim.size() == (1920.0, 1080.0));
anim.perform_edits(vec![
AnimationEdit::SetSize(100.0, 200.0)
]);
assert!((anim.size().0-100.0).abs() < 0.01);
assert!((anim.size().1-... | Rust | 0 |
SF_CS_DLY_SEL_W { w: self }
}
#[doc = "Writes raw bits to the register."]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "sf_if_io_dly_0.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg... | Rust | 0 |
freq = self.freq
else:
# Adding a single item to an empty index may preserve freq
if isinstance(self.freq, Tick):
# all TimedeltaIndex cases go through here; is_on_offset
# would raise TypeError
fr... | Python | 1 |
cast::Gossip, bytes))
.await;
}
while let Some(message) = recv.recv().await {
match message {
ReceiveMessage::Data(remote_id, bytes) => {
println!(
"Recv permissionless data from: {}, {}-{:?}",
remote_id.short_show(),
... | Rust | 0 |
#!/usr/bin/env python3
"""
Test script for ensemble matching system.
This script demonstrates the new ensemble matching features
and tests them with various types of manuscript content.
"""
from src.ensemble_matcher import EnsembleJournalMatcher, MatchingMethod, create_ensemble_matcher
from src.match_journals import ... | Python | 1 |
from oe_eval.data.styled_tasks_perturbations import STYLED_TASKS
from oe_eval.tasks.oe_eval_tasks.minerva_math_500 import MATH500
from oe_eval.utils import get_dict_with_defaults
def create_core_styled_math500_tasks() -> dict:
return {
f"styled_math500_{task_type}": create_styled_math500_task(task_type)
... | Python | 1 |
init_attr_mask(2);
}
impl ibv_qp_init_attr_mask {
pub const IBV_QP_INIT_ATTR_CREATE_FLAGS: ibv_qp_init_attr_mask = ibv_qp_init_attr_mask(4);
}
impl ibv_qp_init_attr_mask {
pub const IBV_QP_INIT_ATTR_MAX_TSO_HEADER: ibv_qp_init_attr_mask = ibv_qp_init_attr_mask(8);
}
impl ibv_qp_init_attr_mask {
pub const IB... | Rust | 0 |
in a page stream to use a font. Calling Canvas::get_font
/// will make sure the font dictionary is created in the file, associate it
/// with a name in the page resources and return a FontRef representing that
/// name.
///
/// The `serif` variable in [the TextObject
/// example](struct.TextObject.html#example) is a F... | Rust | 0 |
_i32, 4_i32);
/// let v = Vector3::new(43_i32, 5_i32, 89_i32);
/// let cross_a = Matrix3x3::cross_matrix(&a);
///
/// assert_eq!(cross_a * v, a.cross(&v));
/// ```
#[rustfmt::skip]
#[inline]
pub fn cross_matrix(vector: &Vector3<S>) -> Self {
Matrix3x3::new(
S::zero(... | Rust | 0 |
# https://codeforces.com/contest/230/problem/A - Dragons
# def dragons_game(k, dd):
# d = sorted(dd, key = lambda x: (x[0], x[1]))
# for i in d:
# if k <= i[0]:
# return 'NO'
# else:
# k += i[1]
# return 'YES'
#
#
# # -------------------------------------------------... | Python | 1 |
t1 = time.time()
print(
"\n\nstep: ", t,
"| time: %.2f" % (t1 - t0),
"| loss: %.3f" % loss.numpy(),
"\n| tgt: ", " ".join([data.i2v[i] for i in seqs[0, 1:][:xlen[0].sum()+1]]),
"\n| prd: ", " ".join([data.i2v[i] for i in pr... | Python | 1 |
def clean_response(text: str) -> str:
lines = text.strip().splitlines()
if lines and lines[0].strip().startswith("###"):
lines.pop(0)
return "\n".join(lines).strip()
| Python | 1 |
;
phase
} else {
rx.recv().unwrap()
}
};
let output = |out_signal: i32| {
// This will fail for the last output of the last amplifier, since the first one
// will have closed the channel
... | Rust | 0 |
class="footnote-reference"><a href="#a">1</a></sup> <sup class="footnote-reference"><a href="#xkcd">2</a></sup></p>
<div class="footnote-definition" id="a"><sup class="footnote-definition-label">1</sup>
<p>This does not mean that footnotes cannot reference each other. <sup class="footnote-reference"><a href="#b">3</a><... | Rust | 0 |
import sys, os, time, cv2, glob
wdir = os.path.dirname(__file__) + "/../src"
sys.path.append(wdir)
# Recursos adicionais: configuracoes e utilitario de visao computacional.
from library import dlc
print('\nValidando tamanho das imagens em "{}", aguarde...'.format(dlc.CONFIG["DATASET_TRAIN_PATH"].split('/')[-1]))
# ... | Python | 1 |
#coding:utf-8
# 通过该程序可以发现被删除的好友
import os
import urllib, urllib2
import re
import cookielib
import time
import xml.dom.minidom
import json
import sys
import math
DEBUG = False
MAX_GROUP_NUM = 35 # 每组人数
QRImagePath = os.getcwd() + '/qrcode.jpg'
tip = 0
uuid = ''
base_uri = ''
redirect_uri = ''
skey = ''
wxsid = '... | Python | 1 |
import os
import torch
from torch.autograd import Variable
import argparse
import json
import dataset
from CSRNet_IADM import FusionCSRNet
from utils import cal_para
parser = argparse.ArgumentParser(description='PyTorch CSRNet')
parser.add_argument('--test_json', '--test', metavar='TEST',
help='... | Python | 1 |
import pytest
from pcapi.core.achievements import factories as achievements_factories
from pcapi.core.achievements import models as achievements_models
from pcapi.core.users import factories as users_factories
@pytest.mark.usefixtures("db_session")
class MarkAchievementsAsSeenTest:
def test_mark_achievements_as_... | Python | 1 |
#encoding:utf-8
import re
import os
import csv
#------------------------------------------------------------------------
#第一步 生成词典
#------------------------------------------------------------------------
train_data_path = "dataset-train.txt" #训练数据
test_data_path = "dataset-test.txt" #测试数据
val_data_path = "dataset... | Python | 1 |
AllocationFailure,
ForceCollect,
ForceMinorCollect,
Stress,
StressMinor,
}
impl GcReason {
fn message(&self) -> &'static str {
match self {
GcReason::PromotionFailure => "promo failure",
GcReason::AllocationFailure => "alloc failure",
GcReason::ForceColle... | Rust | 0 |
pe
cam_loc = cam_loc.unsqueeze(-1)
ray_cam_dot = torch.bmm(ray_directions, cam_loc).squeeze()
under_sqrt = ray_cam_dot ** 2 - (cam_loc.norm(2,1) ** 2 - r ** 2)
under_sqrt = under_sqrt.reshape(-1)
mask_intersect = under_sqrt > 0
sphere_intersections = torch.zeros(n_imgs * n_pix, 2).cuda().floa... | Python | 1 |
);
}
common::Error::ok_or_warning(status)?;
Ok(rules)
}
}
/// Iterator over the locales for which text breaking information is available.
pub struct Locales {
// The index to be passed to `ubrk_getAvailable` on the next call to `next`.
index: i32,
// The number of ava... | Rust | 0 |
, name, sig)
}
pub fn get_bytecodes_i<K, M, V>(&self, class: K, name: M, sig: V) -> Result<JMemoryAllocate>
where
K: Transform<'a, JClass<'a>>,
M: Into<JNIString>,
V: Into<JNIString> {
self.jvmti_rust().get_bytecodes_i(self.jni_rust(), class, name, sig)
}... | Rust | 0 |
with pytest.raises(
ValueError, match=r"n_classes should be greater than 1.*label smoothing.*but 1"
):
to_categorical(numpy.asarray([0, 0, 0]), label_smoothing=0.01),
with pytest.raises(ValueError, match=r"label_smoothing parameter"):
to_categorical(numpy.asarray([0, 1, 2, 3, 4]), l... | Python | 1 |
"""add cluster head type to nodestate
Revision ID: 3a4338e38dea
Revises: 2e63cc74b5ad
Create Date: 2013-02-28 15:27:39.736026
"""
from alembic import op
from sqlalchemy import DateTime, Integer, String
from sqlalchemy.sql import column, table
# revision identifiers, used by Alembic.
revision = "3a4338e38dea"
down_r... | Python | 1 |
'''
MATH moduli fazifalari:
1 Doira yuzasini hisoblash, aylana uzunligini hisoblash
radius ni foydalanuvchidan so'rab, quyidagilarni hisoblang:
1. Doira yuzasi (πr²)
2. Aylana uzunligi (2πr)
Natijalarni yaxlitlab, 2 xona aniqlikda chiqaring
'''
import math
def doira_yuzasi(radius):
"""Doira yuzasini hisoblaydi"""... | Python | 1 |
tx_in_pool(&deploy_confirmation_hash));
let expected_err = ErrorMatch::from_fail(&SupervisorCommonError::ActualFromIsPast)
.for_service(SUPERVISOR_INSTANCE_ID);
assert_eq!(*block[hash].status().unwrap_err(), expected_err);
}
#[tokio::test]
async fn test_start_service_instance_with_already_passed_deadl... | Rust | 0 |
self.last_hidden_mean)
self.last_hidden_disp = Dropout(hid_drop, name='%s_disp_drop'%layer_name)(self.last_hidden_disp)
else:
last_hidden = Dense(hid_size, activation=None, kernel_initializer=self.init,
kernel_regularizer=l1_l2(l1, l2)... | Python | 1 |
ev_allow = self.context.allow_yield;
self.context.allow_yield = true;
let start_position = self.look_ahead_position;
let params = self.parse_formal_params()?;
self.context.allow_yield = prev_allow;
if params.params.len() != 1 {
self.tolerate_error(Error::InvalidSetter... | Rust | 0 |
})??;
// Demonstrate nested use (right side)
b.with_temporary(&root_cnode, |inner_right| -> Result<(), SeL4Error> {
let (_e, _f) = inner_right.split(slot_f)?;
track_ref.set(track_ref.get() + 1);
Ok(())
})??;
// Demonstrate nested re-use (right side)
... | Rust | 0 |
, To]}
use algolia::{
model::attribute::{Attribute, FacetAttribute, SearchableAttributes},
request::SetSettings,
};
use futures::future::BoxFuture;
#[derive(Copy, Clone, Debug)]
pub enum ResyncKind {
None,
Complete,
}
fn bad_batch_object<'a>(
client: &'a super::Inner,
media_index: &'a str,
... | Rust | 0 |
n. Literally `cpu` or `cuda`. Default `cuda`")
parser.add_argument("--metric", type=str, default="IC", choices=["MSE", "IC", "RankIC", "ICIR", "RankIC"], help="Eval metric type, literally `MSE`, `IC`, `RankIC`, `ICIR` or `RankICIR`. Default `IC`")
parser.add_argument("--plot_index", type=int, nargs="+", default... | Python | 1 |
al(xblock_type_display_name('chapter'), 'Section')
# Verify sequential type display name
sequential = BlockFactory.create(parent_location=chapter.location, category='sequential')
self.assertEqual(xblock_type_display_name(sequential), 'Subsection')
self.assertEqual(xblock_type_display_na... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.