text string | label_name string | labels int64 |
|---|---|---|
err
)
});
trainers.insert(id, trainer);
}
(
WorldNpcData {
groups: npcs,
trainers,
},
textures,
)
}
fn get_npc_type_file(path: &Path) -> PathBuf {
for entry in read_dir(path).unwrap().flatten() {
let path = entry.pat... | Rust | 0 |
k(s);
}
Err(err) => {
// Connection failure, retry
debug!(
"Failed to connect {}, retried {} times (last err: {})",
svr_addr, retry_time, err
);
last_err = Some(err);
// Yield... | Rust | 0 |
from django.contrib import admin
from . import models
# Register your models here.
class WeekMealPlanModelAdmin(admin.ModelAdmin):
search_fields = ('pk', 'year', 'number_of_week')
list_display = ('pk', 'year', 'number_of_week')
class DailyMealPlanModelAdmin(admin.ModelAdmin):
list_display = ('pk', 'day... | Python | 1 |
f.assertEqual(actual.shape, (n_devices, n_devices, n_copies))
self.assertEqual(jnp.sum(actual), n_copies * n_devices**3)
@variants.variants(with_pmap=True)
def test_pmap_wrong_axis_size(self):
n_devices, backend = self.n_devices, self.backend
@self.variant(
broadcast_args_to_devices=False,
... | Python | 1 |
2_int_map: INTERRUPT_CORE0_DMA_CH2_INT_MAP,
#[doc = "0xbc - INTERRUPT_CORE0_RSA_INT_MAP"]
pub interrupt_core0_rsa_int_map: INTERRUPT_CORE0_RSA_INT_MAP,
#[doc = "0xc0 - INTERRUPT_CORE0_AES_INT_MAP"]
pub interrupt_core0_aes_int_map: INTERRUPT_CORE0_AES_INT_MAP,
#[doc = "0xc4 - INTERRUPT_CORE0_SHA_INT_... | Rust | 0 |
val bar: t -> unit
end
structure A:> SIG = struct
type t = int
val foo = 3
fun bar _ = ()
end
structure B:> SIG = struct
type t = int
val foo = 3
fun bar _ = ()
end
val _ = A.bar A.foo = B.bar B.foo
val _ = A.bar B.foo
(** ^^^^^ expected t, found t *)
"#,
);
}
#[test]
fn same_identifier_o... | Rust | 0 |
from typing import Optional
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
def build_tree(values):
if not values:
return None
nodes = [TreeNode(val) if val is not None... | Python | 1 |
self.main_wnd.window(control_id=0x3EE, class_name="Button").click()
except:
time.sleep(API_Config.cfg["sleepC"])
self.main_wnd.window(control_id=0x3EE, class_name="Button").click()
# 系统设置 快速交易设置中 委托成功后弹出提示对话框 弹出对话框获取合同号
time.sleep(API_Config.cfg["sleepB"])
... | Python | 1 |
), (0, pointer_rprimitive)],
)
# obj.decode(encoding)
method_op(
name="decode",
arg_types=[bytes_rprimitive, str_rprimitive],
return_type=str_rprimitive,
c_function_name="CPy_Decode",
error_kind=ERR_MAGIC,
extra_int_constants=[(0, pointer_rprimitive)],
)
# obj.decode(encoding, errors)
method_o... | Python | 1 |
, L> {
/// Position the iterator on the first element with key >= `key`
fn seek(&mut self, key: &[u8]) -> Result<(), TrieHash<L>, CError<L>> {
TrieIterator::seek(&mut self.inner, key)
}
}
impl<'a, L: TrieLayout> TrieDBKeyIterator<'a, L> {
/// Create a new iterator.
pub fn new(db: &'a TrieDB<L>) -> Result<TrieDB... | Rust | 0 |
ile);
Box::new(handle) as Box<dyn Write + Send + Sync>
}
None => Box::new(BufWriter::new(std::io::stdout())) as Box<dyn Write + Send + Sync>,
};
let mut trace = U64Trace::new(u64_ctrl, handle, vcd)?;
trace.start_trace(start_addr, stop_addr)?;
if args.is_present("program") {... | Rust | 0 |
use_se=block_use_se,
deploy=deploy,
use_pw=False if stage_idx==0 else True))
in_channels = out_channels
self.stages.append(nn.Sequential(*st... | Python | 1 |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
current=root
while current:... | Python | 1 |
feature = "dox", doc(cfg(feature = "v1_50")))]
#[doc(alias = "pango_layout_iter_get_run_baseline")]
#[doc(alias = "get_run_baseline")]
pub fn run_baseline(&mut self) -> i32 {
unsafe { ffi::pango_layout_iter_get_run_baseline(self.to_glib_none_mut().0) }
}
#[doc(alias = "pango_layout_iter_get... | Rust | 0 |
ureTemplate
for name, value in replaces.items():
templates = templates.replace(name, value)
styleSheet += templates.format(
os.path.abspath(image).replace(
'\\', '/')) + StyleColorTemplate.format(*color)
widget ... | Python | 1 |
# -*- coding=utf-8 -*-
import xml.etree.ElementTree as ET
import xml.dom.minidom as DOC
# 从xml文件中提取bounding box信息, 格式为[[x_min, y_min, x_max, y_max, name]]
def parse_xml(xml_path):
'''
输入:
xml_path: xml的文件路径
输出:
从xml文件中提取bounding box信息, 格式为[[x_min, y_min, x_max, y_max, name]]
'''
tre... | Python | 1 |
nouncement_id.clone()))
.set(&announcement)
.get_result::<Announcement>(conn)?)
}
fn delete(&self, conn: &PgConnection) -> ThearningResult<Self> {
Ok(diesel::delete(announcements::table.find(self.announcement_id.clone()))
.get_result::<Announcement>(conn)?)
}
... | Rust | 0 |
"""
Single Border Router, Grid Radio 1:3 Topology, Static
A grid topology of ratio 1:3 with a variable number of nodes. The mote_count variable is a list of mote counts.
There will be 1 topology generated per mote_count.
All motes are of type 'node' except the first which is the 6LBR's slip-radio and the last
which is... | Python | 1 |
eat: AtomicU64,
}
impl DogEvents for Arc<DogEventMetrics> {
fn inc_bark(&self) {
self.bark.inc();
}
fn inc_eat(&self) {
self.eat.inc();
}
}
// This is the central object of mini-app built in this exampl... | Rust | 0 |
assert_eq!(super::css_to_core_text_font_weight(Weight(100.0)), -0.7);
assert_eq!(super::css_to_core_text_font_weight(Weight(400.0)), 0.0);
assert_eq!(super::css_to_core_text_font_weight(Weight(700.0)), 0.4);
assert_eq!(super::css_to_core_text_font_weight(Weight(900.0)), 0.8);
// L... | Rust | 0 |
tests::{
hash_test_tries, HashedTestTrie, HashedTrie, InMemoryTestContext, TestKey,
TestValue, TEST_LEAVES,
},
},
},
};
fn create_invalid_extension_trie() -> Result<(Digest, Vec<HashedTestTrie>), bytesrepr::Error> {
... | Rust | 0 |
import numpy as np
from dctwin.registraion import make_env
engine_config = "configs/test_eplus.prototxt"
env = make_env(
env_proto_config=engine_config,
reward_fn=lambda x: 0.0,
is_k8s=True,
)
env.reset()
acu_setpoint_sp = 18.0
acu_supply_flow = 15.0
water_supply_sp = 7.0
act = np.array([acu_setpoint_sp... | Python | 1 |
# Copyright 2024-2025 ModelCloud.ai
# Copyright 2024-2025 qubitium@modelcloud.ai
# Contact: qubitium@modelcloud.ai, x.com/qubitium
#
# 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... | Python | 1 |
DEMAND_BID_TOPIC = "/transactions/demand-bid"
BID_OFFER_TOPIC = "/transactions/bid-offer"
MARKET_CLEARING_TOPIC = "/transactions/market-clearing"
MARKET_STATE_TOPIC = "/transactions/market-state"
MARKET_FINAL_TOPIC = "/transactions/market-final"
###
MARKET_AGGREGATE = "/transactions/market-aggregate"
BIDDERS_INCOME = "... | Python | 1 |
"""
Functions for dividing data into random sets.
"""
__version__ = "$Revision: 1.3 $"
import random
def getSample(popSize, sampleFraction, seed=0):
"""
Generates a list of 1/0 values for defining a random sample for a list of length popSize.
List elements with value 0 belong to the sample.
@par... | Python | 1 |
tokens.next();
Ok(op)
}
parse_left_binop(tokens, parse_expr2, parse_expr3_op)
}
fn parse_expr4<Tokens>(tokens: &mut Peekable<Tokens>) -> Result<Ast, ParseError>
where
Tokens: Iterator<Item = Token>,
{
fn parse_expr4_op<Tokens>(tokens: &mut Peekable<Tokens>) -> Result<BinOp, ParseError>
where
Tokens:... | Rust | 0 |
min: uint, /* Minutes [0-59] */
hour: uint, /* Hours [0-23] */
mday: uint, /* Day [0-30] */
month: uint, /* Month [0-11] */
year: uint, /* Year - 1900 */
wday: uint, /* Day of week [0-6] */
yday: uint ... | Rust | 0 |
from .qwen_vit import QwenVisionModel
VISION_TRANSFORMER_CLASSES = {
'qwen_vit': QwenVisionModel
}
| Python | 1 |
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* -------------------------------------------------------------------... | Rust | 0 |
sion.query(Attendee) \
.filter(Attendee.hotel_eligible == True, Attendee.badge_status.in_([c.NEW_STATUS, c.COMPLETED_STATUS])) \
.options(joinedload(Attendee.hotel_requests), subqueryload(Attendee.shifts).subqueryload(Shift.job)) \
.order_by(Attendee.full_name).all() # noqa: E712
... | Python | 1 |
th),
(1819, 1820, JoiningGroup::Teth),
(1821, 1821, JoiningGroup::Yudh),
(1822, 1822, JoiningGroup::YudhHe),
(1823, 1823, JoiningGroup::Kaph),
(1824, 1824, JoiningGroup::Lamadh),
(1825, 1825, JoiningGroup::Mim),
(1826, 1826, JoiningGroup::Nun),
(1827, 1827, JoiningGroup::Semkath),
(1... | Rust | 0 |
#Introducing Python Operators
print("Python Operators")
print("================")
print()
#Create The variable & Assigning The values
x = 65
y = 35
#Display x & y
print("x :",x)
print("y :",y)
print()
#Display Results Using Arithmetic Operations
print("Arithmetic Operators")
print("____________________")
print()
... | Python | 1 |
# coding: utf-8
"""
Slurm REST API
API to access and control Slurm
The version of the OpenAPI document: Slurm-24.11.5&openapi/slurmdbd&openapi/slurmctld
Contact: sales@schedmd.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E50... | Python | 1 |
le(config)
@classmethod
def from_arrow(cls, table: pa.Table) -> PmgVolumetricData:
cls_config: dict[str, Any] = {}
for data_key in ("data", "data_aug"):
cls_config[data_key] = {}
for vlab in VolumetricLabel: # type: ignore[attr-defined]
comp_key = f"{dat... | Python | 1 |
UInt8(1), // major version
UInt8(0), // minor version
UInt8(4), // header size
UInt8(0), // absolute offset
// Name INDEX
UInt16(0), // count
// Top DICT
// INDEX
UInt16(1), // count
UInt8(1), // offset size
UInt8(1), // index[0]... | Rust | 0 |
::io::Read;
use std::io::Write;
use std::io::stdin;
use std::io::stdout;
use std::path::Path;
/// The virtual machine memory is 0x8000 elements followed by 8 registers.
type Memory = [u16; 0x8008];
/// The default memory image name used when no arguments are provided.
const DEFAULT_BIN_NAME: &'static str = "challenge... | Rust | 0 |
BufShared::from(Vec::from(value2a.as_bytes())));
let extent2 = InlineExtent::new(dbs2);
let name = name2b.clone();
let iea2 = InlineExtAttr{namespace, name, extent: extent2};
let extattr2 = ExtAttr::Inline(iea2);
let v = FSValue::ExtAttr(extattr2);
future::ok(Some(v)).box... | Rust | 0 |
- For simplicity we don't test online conversion which requires setting the
# Grappler config in default eager context.
# - INT8 without calibration behaves like FP32/FP16.
opts = list(
itertools.product([FP32, FP16, INT8], [convert_offline], [dynamic_engine],
[no_calibration]))
... | Python | 1 |
from(endpoint: &str) -> Self {
PravegaNodeUri(endpoint.to_owned())
}
}
impl From<(&str, u16)> for PravegaNodeUri {
fn from(tuple: (&str, u16)) -> Self {
let endpoint = format!("{}:{}", tuple.0, tuple.1);
PravegaNodeUri(endpoint)
}
}
impl From<SocketAddr> for PravegaNodeUri {
fn... | Rust | 0 |
ImageIndices: *const u32,
pub pResults: *mut VkResult,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VkImageSwapchainCreateInfoKHR {
pub sType: VkStructureType,
pub pNext: *const ::std::os::raw::c_void,
pub swapchain: VkSwapchainKHR,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VkBindIm... | Rust | 0 |
d::os::raw::c_uint,
pub __wchb: [::std::os::raw::c_char; 4usize],
_bindgen_union_align: u32,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _G_fpos_t {
pub __pos: __off_t,
pub __state: __mbstate_t,
}
pub type __fpos_t = _G_fpos_t;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct _G_fpos64_t {
pub __pos:... | Rust | 0 |
rans_params[2:3])
lm_pred = face_recon.inv_affine_ldmks_torch_(
face_recon.pred_lm).clip(0, 255)
lm_loss = torch.nn.L1Loss()(lm_input, lm_pred.detach())
print(f'lm loss: {lm_loss.data:.3f}')
opt.zero_grad()
lm_loss.backw... | Python | 1 |
# -*- coding: UTF-8 -*-
#!/usr/bin/python
import requests
def vuln_info():
info={
'vuln_name': 'S2_019_2', #漏洞名称
'vuln_referer':'未知', #漏洞来源
'vuln_author':'未知', #插件作者
'cms_name':'test',#cms_name需要和上级目录保持一致。扫描器自动添加会调用。GUI版本不会调用
'vuln_description':'''漏洞描述''',
'vuln_i... | Python | 1 |
from abc import ABCMeta, abstractmethod, abstractproperty
class HTMLBuilder(metaclass=ABCMeta):
@abstractproperty
def buildTitles(self): pass
@abstractproperty
def buildChars(self): pass
@abstractproperty
def buildLists(self): pass
@abstractproperty
def getProduct(self): pass
| Python | 1 |
es,
Vpclmulqdq,
Vtx,
Waitpkg,
Wbnoinvd,
X87,
Xop,
Xsave,
Xsavec,
Xsaves,
}
#[doc(hidden)]
impl TryFrom<ffi::ND_INS_SET> for IsaSet {
type Error = decode_error::DecodeError;
fn try_from(value: ffi::ND_INS_SET) -> Result<Self, Self::Error> {
match value {
... | Rust | 0 |
s::forbidden,
errors::not_found,
errors::internal_server_error,
errors::not_implemented,
])
.manage(config)
.launch();
Ok(())
}
<gh_stars>0
use std::path::PathBuf;
pub mod config;
mod connection;
mod executer;
use config::Config;
use connection::Connect... | Rust | 0 |
ties_punches_electrolyte -> trick_relief_swing'
assert 0
0
@g4m79lh364n
def a7xk0grhyri(th3onq_i97m, k5daaqxhh_f, alujdr4d2ie: qeszaej_b6n, wfrrdbvjkpw: m08mcfjj2yq):
return
zda5vhfg43f >>= ewntyrdoyfn
xw6o73qf50i.v5y5faqnity += ''
nonlocal zrbpqcbc6sk
0.0
pass
'# difficulties_punche... | Python | 1 |
}
}
mappings.insert(
'q',
KeyMapping {
ret_code: 1,
label: "abort".to_string(),
},
);
mappings.insert(
'c',
KeyMapping {
ret_code: 0,
label: "continue".to_string(),
},
);
Ok(mappings)
}
#[test]
fn test_parse_valid_mapping() {
let mapping = parse_mappin... | Rust | 0 |
meout(30):
while True:
try:
response: discord.Message = await self.bot.wait_for(
"message", timeout=300.0, check=check
)
cv = await check_valid(response)
print(... | Python | 1 |
eturn output_image_pil
# Gradio interface
def gradio_interface(original_image):
# Save the uploaded image temporarily
original_image.save("original_image.jpg")
# Run the monetify function
result_image = monetify_image("original_image.jpg")
return result_image
# Gradio UI setup
iface = gr.Interfac... | Python | 1 |
fn as_any(&self) -> &dyn std::any::Any { self }
}
);
);
/// Macro for declaring an appliance behavior
///
/// # Examples
///
/// ```
/// zara::inv_item_appl!(
/// MorphineInjection,
/// "MorphineInjection",
/// /* weight per unit */ 87.,
/// /* appliance option */ Some(&MorphineInjectionApp... | Rust | 0 |
RunningJail, JailError> {
trace!("RunningJail::from_name({})", name);
sys::jail_getid(name).map(RunningJail::from_jid_unchecked)
}
/// Return the jail's `name`.
///
/// # Examples
///
/// ```
/// # use jail::StoppedJail;
/// #
/// # let running = StoppedJail::new("/r... | Rust | 0 |
stars>0
use std::io::{Error, ErrorKind, SeekFrom};
use std::pin::Pin;
use std::task::{Context, Poll};
use futures::io::{AsyncRead, AsyncBufRead, AsyncWrite, AsyncSeek};
use ::tokio::io::{
AsyncRead as TokioAsyncRead,
AsyncBufRead as TokioAsyncBufRead,
AsyncWrite as TokioAsyncWrite,
AsyncSeek as TokioA... | Rust | 0 |
class UnitedKingdom:
@staticmethod
def get_capital():
print("London is the capital of Great Britain.")
@staticmethod
def get_language():
print("English is the primary language of Great Britain.")
class Spain:
@staticmethod
def get_capital():
print("Madrid is the capi... | Python | 1 |
import numpy as np
import pandas as pd
import plotly.graph_objects as go
A = 1.0
k = 2.0
ω = 3.0
ϕ = np.pi / 4.0
x = np.linspace(0, 10, 100)
t = np.linspace(0, 5, 50)
X, T = np.meshgrid(x, t)
y = A * np.sin(k * X - ω * T + ϕ)
velocity = A * k * np.cos(k * X - ω * T + ϕ)
acceleration = -A * ω**2 * np.sin(k * X - ω * ... | Python | 1 |
Result<Vec<ExecutionReport>>>,
},
ServerGetExecutionReports {
offset: Option<i64>,
resp: OneShotMessageResponse<anyhow::Result<Vec<ExecutionReport>>>,
},
ServerGetExecutionReport {
report_id: Uuid,
resp: OneShotMessageResponse<anyhow::Result<ExecutionReport>>,
},
... | Rust | 0 |
tor(123),
&mut publisher,
),
Err(transport::Error::INTERNAL_ERROR)
);
// Expectation:
assert_eq!(helper.manager.active, helper.first_path_id.as_u8());
}
#[test]
fn set_path_challenge_on_active_path_on_connection_migration() {
// Setup:
let mut publisher = Publisher::sna... | Rust | 0 |
}
_ => {
script_g = 0;
script_f = 0;
}
}
}
if let Some(Node::Text(TxtNode::WhatsIt(WhatsIt::Glyph(p)))) = p.opt().map(Node::from) {
sup_kern = get_ot_math_... | Rust | 0 |
..")
config.push_to_hub(
repo_id=repo_id, commit_message="Add config from convert_rt_detr_original_pytorch_checkpoint_to_pytorch.py"
)
model.push_to_hub(
repo_id=repo_id, commit_message="Add model from convert_rt_detr_original_pytorch_checkpoint_to_pytorch.py"
)
... | Python | 1 |
from pydantic import BaseModel, constr
from .voice import VoicePreset
from ..logger import model_logger
import random
class BotSecret(BaseModel):
model: str = "mockai"
api_key: str = "sk-"
base_url: str = "http://localhost:5002/v1"
class BotParams(BaseModel):
"""parameters to pass into bots"""
t... | Python | 1 |
mission.objects.get(codename=f"view_{model_name}")
operator.permissions.add(permission.pk)
except Permission.DoesNotExist:
pass
for action in manage_operations:
permission_ad = Permission.objects.get(codename=f"{action}_{model_name}")
admin.permissions.add... | Python | 1 |
rograms
.values()
.map(|p| p.children.clone())
.flatten()
.flatten()
.collect();
let difference: Vec<String> = program_names.difference(&children_names).cloned().collect();
match difference.len() {
1 => Ok(difference[0].clone()),
_ => Err(anyhow!("None o... | Rust | 0 |
_arch = "x86_64"))]
fn align_up(addr: u64, align: u64) -> usize {
assert!(align.is_power_of_two(), "`align` must be a power of two");
let align_mask = align - 1;
if addr & align_mask == 0 {
addr as usize // already aligned
} else {
((addr | align_mask) + 1) as usize
}
}
#[cfg(test)]... | Rust | 0 |
# coding: utf-8
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import unittest
from bugbot.people import People
from bugbot.round_robin_calendar import ICSCalendar
... | Python | 1 |
# Beggining of the book
"""
print("Here We Go Again")
message = ("Hwga but really serous")
print (message)
another_message = ("Hwga brs")
print (another_message)
message = ("Hwga but really serous")
print (message)
"""
# Some variable actions
"""
first_name = "Thony"
last_name = "Gc"
full_name = f"{first_name} {la... | Python | 1 |
# Copyright 2025 - Solely by BrotherBoard - Feel free to utilize/modify this for personal use
# Feedback is appreciated - Telegram >> @GalaxyA14user
"""
SetAudio v1.0 - Make audio texts clickable
SetAudio allows you to set a custom audio value
in settings by making audio texts clikcable.
Read code to know more.
"""
... | Python | 1 |
read(&mut rd).unwrap();
if rd.any_left() {
None
} else {
Some(ecdh_params)
}
}
pub fn server_complete(self, kx_params: &[u8]) -> Option<KeyExchangeResult> {
self.decode_client_params(kx_params)
.and_then(|ecdh| self.complete(&ecdh.public.0))
... | Rust | 0 |
sender.send(data).expect("Failed to send WaitData!");
}
}
}
}
});
}
}
/// Information associated with a breakpoint
#[derive(Debug)]
struct BreakpointInfo {
/// Creating a breakpoint requires injecting the breakpoint opcode into... | Rust | 0 |
assertEqual(len(rec_msgs), 5)
def test_get_seq_no_wait_time(self):
# no msgs yet
self.assertEqual(hosts['bob']._classical_messages.last_msg_added_to_host, None)
rec_msg = hosts['bob'].get_classical_any_host(0, wait=0)
self.assertEqual(hosts['bob']._classical_messages.last_msg_added... | Python | 1 |
ト"""
test_facility.current_party = test_party
test_facility.is_active = True
# クリーンアップメソッドの存在確認
assert hasattr(test_facility, '_cleanup_ui_windows')
# クリーンアップ実行
test_facility._cleanup_ui_windows()
# 状態の確認は実装により異なるため、エラーがないことのみ確認
def... | Python | 1 |
glm::vec2(0.5, 0.5), color: glm::vec3(0.0, 1.0, 0.0) },
Vertex { pos: glm::vec2(-0.5, 0.5), color: glm::vec3(0.0, 0.0, 1.0) },
];
}
fn main() -> Result<()> {
unsafe { App::new("Triangle", TriangleExample::default())?.run() }
}
#[derive(Copy, Clone, Debug, Default)]
struct TriangleExample {
vertex... | Rust | 0 |
resource!(RAW_FILE, "../../raws/spawns.json");
lazy_static! {
pub static ref RAWS : Mutex<RawMaster> = Mutex::new(RawMaster::empty());
}
#[derive(Deserialize, Debug)]
pub struct Raws {
pub items : Vec<Item>,
pub mobs : Vec<Mob>,
pub props : Vec<Prop>,
pub spawn_table : Vec<SpawnTableEntry>,
pu... | Rust | 0 |
target = int(input())
num_shock = list(int(num) for num in input().split())
sym_shock = input().split()
symbol_dict = {"+": int(sym_shock[0]),
"*": int(sym_shock[1]),
"=": int(sym_shock[2])}
answer = []
# addition only
if target <= 9:
answer.append(num_shock[target])
if target <= 18:... | Python | 1 |
L_P : L_P.to_vec(),
s_S : s_S.to_vec(),
r_S : r_S.to_vec(),
r_R : r_R.to_vec(),
A_PS : A_PS.to_vec(),
W_P : W_P,
P_proof_R : P_proof_R.to_vec(),
F : F.to_vec(),
j : j.to_vec(),
L : L.to_vec(),
P_proof_S : P_proof_S.to_vec(),
A_R : A... | Rust | 0 |
cs[category]["precision"] = precision = float(TP) / float(TP + FP)
if TP + FN == 0:
metrics[category]["recall"] = recall = 0
else:
metrics[category]["recall"] = recall = float(TP) / float(TP + FN)
if precision + recall == 0:
metrics[c... | Python | 1 |
rand_h[..., np.newaxis]), axis=1)
indices = torch.from_numpy(indices)
rand_s = torch.from_numpy(rand_s)
sparse_sketch_matrix = torch.sparse.FloatTensor(
indices.t(), rand_s, torch.Size([input_dim, output_dim]))
return sparse_sketch_matrix.to_dense()
... | Python | 1 |
/// User-specified filename.
File(String),
}
/// Represents an icon information for notification.
#[derive(Debug, Clone)]
pub enum NotificationIcon {
/// Default icon.
Default,
/// Error icon.
Error,
/// Warning icon.
Warning,
/// User-specified filename.
File(String),
... | Rust | 0 |
# Importing the required libraries
import numpy as np
import os
def getData():
labels = ['nothin', 'Acetone', 'Ethanol','Gin','Methane']
X = []
y = []
labelIndex = 0
counter = 0
directory = os.getcwd()+"\data"
files = os.listdir(directory)
for file in files:
path = directory ... | Python | 1 |
ion to create messages
fn create_message(&self) -> Bytes;
///Function to check messages created by create_message
fn verify_message(&self, buffer: Bytes) -> VerificationStatus;
}
///Fills in a constant value
pub struct ConstantVerifier<T = u64>
where
T: Sized,
{
value: T,
}
impl<T> Default for Co... | Rust | 0 |
uri","value":"http://jbalint/javap#java.lang.Object"}}]}}
// https://www.w3.org/TR/sparql11-results-json/
use std::collections::HashMap;
use reqwest::Client;
use crate::http_util::AuthRequest;
use crate::http_util::CheckedResponse;
static APPLICATION_JSON: &str = "application/json";
static APPLICATION_SPARQL_RESUL... | Rust | 0 |
strip_prefix(",")}
//!
//! try_rebind!{(let colors, parser) = parse_colors(parser.trim_start())}
//!
//! Ok((Struct{amount, repeating, colors}, parser))
//! }
//!
//! pub const fn parse_shape(mut parser: Parser<'_>) -> ParseValueResult<'_, Shape> {
//! let shape = parse_any!{parser, strip_prefix;
//! ... | Rust | 0 |
e(self, key):
# check input
try:
key = int(key)
except:
return {"status": "failure", "message": "Invalid key value"}
if not self._are_positive_int([key]):
return {"status": "failure", "message": "Invalid key value"}
# remove
if f'{key}... | Python | 1 |
Self: Sized {
if stream.len() < 1 {
return Err(Error::InvalidOp);
}
let code = stream[0];
*stream = &stream[1..];
match code {
$(
$variant_cod... | Rust | 0 |
panic!("Internal consistency error: Invalid prepend");
},
}
}
}
impl MergableSpan for MarkerEntry {
fn can_append(&self, other: &Self) -> bool {
self.inner.can_append(&other.inner)
}
fn append(&mut self, other: Self) {
self.len += other.len;
self.inner.appen... | Rust | 0 |
the rate of a navigation message is set to 2,
/// the message is sent every second navigation solution
#[ubx_packet_send]
#[ubx(class = 6, id = 1, fixed_payload_len = 8)]
struct CfgMsgAllPorts {
msg_class: u8,
msg_id: u8,
/// Send rate on I/O Port (6 Ports)
rates: [u8; 6],
}
impl CfgMsgAllPortsBuilde... | Rust | 0 |
import sys
import time
import pygame
from components import Button
from utils import draw_main_menu_game_title
import config
def continue_game():
config.game_is_paused = False
config.prevent_shoot = True
def draw_pause_menu():
"""Draw the pause menu and handle events."""
from utils import draw_backgr... | Python | 1 |
'𒐠', 'ⱸ', '𐭝', '𔕯', '‗', '\u{ac8}', '𝙛',
'🂣', 'ﬧ', '\u{11234}', '𝕌', 'ꎋ', '𨗭', '᪆', '𝔼', '𐣾', '𐌚', '꣹',
'ൕ', '\u{1ba9}', '、', '𐍃', '𒍶', 'ꠁ', '𛃯', '\u{1fb70}', 'ᒤ', 'ꜞ', 'ఏ',
'✾', '\u{11cab}', 'ᥴ', '𘨭', 'উ', 'ꌌ', 'ꅣ', '⍫', '𑑁', 'ힾ', '\u{8ee}',
'𖣐', '\u{e0199}', '🄋', '\u{1f9a8}', '𒎂', 'ꑦ... | Rust | 0 |
import json
import os
from pathlib import Path
from typing import Dict, List
import rootpath
pytest_plugins = [
"utils.fixtures.driver",
"utils.fixtures.applications",
]
# pylint: disable=unused-argument
used_locators: Dict[str, List[str]] = {}
directory = rootpath.detect() / Path("ui_coverage")
def pytest... | Python | 1 |
溝玖穰玖秭玖垓玖京玖兆玖億玖萬玖仟玖佰玖拾玖"
);
to_uppercase_low_batch_test!(
-9999999999999999i64,
"負玖極玖載玖正玖澗玖溝玖穰玖秭玖垓玖京玖兆玖億玖萬玖仟玖佰玖拾玖"
);
to_uppercase_low_batch_test!(
9999999999999999u64,
"玖極玖載玖正玖澗玖溝玖穰玖秭玖垓玖京玖兆玖億玖萬玖仟玖佰玖拾玖"
);
to_uppercase_low_batch_test!(
9999999999999999i128,... | Rust | 0 |
from shapes_abc import Circle
circle = Circle(100)
print(circle.radius)
print(circle.get_area())
print(circle.get_perimeter()) | Python | 1 |
>")));
assert_eq!(
builder.connect(),
ConnectProperties {
session_expire_interval: Some(20),
receive_maximum: Some(1000),
maximum_packet_size: Some(1024),
topic_alias_maximum: Some(1024),
request_response_inf... | Rust | 0 |
'''
Run a convergence test with divergence computed by Gauss theorem in 3d.
'''
from dolfin import *
from fenicstools import gauss_divergence
import numpy
def demo_3d_divergence(mesh, u_exact, divu_exact):
# Compute the divergence with Gauss theorem
cr_divu = gauss_divergence(u_exact, mesh=mesh)
# Repre... | Python | 1 |
t_health_check),
("搜索建议", test_search_suggestions),
]
results = []
for test_name, test_func in tests:
print(f"\n🧪 开始测试: {test_name}")
try:
result = await test_func()
results.append((test_name, result))
print(f"✓ 测试完成: {test_name} - {'通过' if resu... | Python | 1 |
ke_matches_macro)]
match ty.name() {
"UUID" | "TEXT" | "SERIAL" => true,
_ => false,
}
}
}
/// ## Type of resource id
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Hash)]
pub enum CibouletteIdType {
Number(ArcStr),
Text(ArcStr),
Uuid(ArcStr),
}
impl<'re... | Rust | 0 |
riginal_device), )
else:
x = (t.to(original_device) for t in x)
handler_collection = []
profiler = ModelProfiler(custom_ops, mode)
prev_m = None
for name, m in model.named_modules():
# dealing with weight mask here
if isinstance(prev_m, ModuleWrapper):
# weight ... | Python | 1 |
if lt.get("visited"):
continue
lt = deepcopy(lt)
del lt["type"]
lt["text"] = ""
lt["layout_type"] = "figure"
lt["layoutno"] = f"figure-{i}"
bxs.append(lt)
boxes.extend(bxs)
... | Python | 1 |
bone_name = f'{target_bone_name}-{(yidx + 1):02d}-{(xidx + 1):02d}'
# 表示先ボーン名
display_bone_name = f'{target_bone_name}-{(yidx + 2):02d}-{(xidx + 1):02d}'
if bone_name in model.bones and display_bone_name in model.bones:
# 表示先ボーンを定義
... | Python | 1 |
Vec<StructDesc>,
imp_desc: &'a Vec<ImpDesc>,
java_namespace: &'a str,
) -> BridgeFileGen<'a, JniFileGenStrategy<'a>> {
BridgeFileGen {
out_dir,
trait_descs,
struct_descs,
imp_desc,
strategy: JniFileGenStrategy {
java_namespace,
java_callback_s... | Rust | 0 |
) -> Result<Response<Self::GetPlanetsStream>, Status> {
debug!("Got a request: {:?}", request);
let (tx, rx) = mpsc::channel(4);
let planets: Vec<Planet> = persistence::repository::get_all(&self.get_connection())
.expect("Can't load planets")
.into_iter()
... | Rust | 0 |
,
}
/// This object represents one special entity in a text message.
/// For example, hashtags, usernames, URLs, etc.
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct MessageEntity {
/// Offset in UTF-16 code units to the start of the entity
pub offset: Integer,
/// Length of the entity in UTF-16 ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.