text string | label_name string | labels int64 |
|---|---|---|
#[link(name = "qgrep", kind="static")]
extern "C" {
fn main_cpp(app: *const c_char) -> c_int;
}
fn main() {
let mut args = env::args();
let app = CString::new(args.next().unwrap()).unwrap();
unsafe {
main_cpp(app.as_ptr());
}
}
mod merge;
mod toolbox;
#[test]
fn test_merge() {
merge::... | Rust | 0 |
import random
import xml.etree.ElementTree as ET
from xml.dom.minidom import parseString
def generate_tasks_data(num_seconds, num_tasks, num_creators, filename, power_range=(1, 10), size_range=(1, 10), deadline_range=(1, 10)):
root = ET.Element('tasks')
task_id = 1
tasks_per_second = [0] * num_seconds
... | Python | 1 |
Bme680Controller<I2cBmeInstance, DelayWrapper<'static, ClockType>, StaticProvider>;
type NetworkStack = SslTcpStack<Esp8266IpNetworkDriver<'static, SerialTx>>;
#[exception]
fn MemoryManagement() -> ! {
panic!("Memory management error")
}
#[exception]
fn HardFault(ef: &cortex_m_rt::ExceptionFrame) -> ! {
// p... | Rust | 0 |
to complete
for hotkey, task in chunk_tasks:
try:
result = await task
results[hotkey] = result
except Exception as e:
bt.logging.error(f"Error processing {hotkey}: {str(e)}")
results[hotkey] = No... | Python | 1 |
lt> {
unimplemented!()
}
/// Updates all documents matching `query` in the collection.
pub fn update_many(
&self,
query: Document,
update: Document,
options: Option<UpdateOptions>,
) -> Result<UpdateResult> {
unimplemented!()
}
/// Updates up to ... | Rust | 0 |
Builder, EnvBuilder};
use logger::{self, prelude::*};
use metrics::metric_server::start_server;
use std::{ops::DerefMut, sync::Arc};
/// Play given TXN pattern with Benchmarker for several epochs and measure burst throughput,
/// e.g., the average committed txns per second. Since time is counted from submission
/// un... | Rust | 0 |
n page that the customer is redirected to.
/// Can be one of `en`, `de`, `fr`, or `nl`.
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_language: Option<SetupAttemptPaymentMethodDetailsSofortPreferredLanguage>,
/// Owner's verified full name.
///
/// Values are verified or provi... | Rust | 0 |
"credits": {
"total": total_credits,
"used": used_credits,
"remaining": total_credits - used_credits
},
"mockups": {
"total": total_mockups,
"completed": completed_mockups,
"success_rate": comple... | Python | 1 |
# _*_ coding: utf-8 _*_
"""类型和运算----类型和运算----类型和运算----类型和运算----类型和运算----类型和运算----类型和运算----类型和运算----类型和运算----类型和运算----类型和运算"""
#-- 寻求帮助:
dir(obj) # 简单的列出对象obj所包含的方法名称,返回一个字符串列表
help(obj.func) # 查询obj.func的具体介绍和用法
#-- 测试类型的三种方法,推荐第三种
if type(L) == type([]):
print("L is list")
... | Python | 1 |
struct Circle {
center: Vec3,
_radius: f32,
radius_2: f32,
// radius^2
normal: Vec3,
movement: Movement,
}
impl Circle {
pub fn new(center: Vec3, radius: f32, normal: Vec3, movement: Movement) -> Circle {
Circle {
center,
_radius: radius,
normal,... | Rust | 0 |
c @ s d Z d d l Z d e j f d YZ d e j f d YZ d e j f d YZ d e e j f d
YZ d e e j f d YZ d
Z d Z e j e Z
d S( sj Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.TXT' with gencodec.py.
iNt ... | Python | 1 |
GetSchemaRequest,
}
#[async_trait]
impl ServerOp for GetSchemaOp {
type Locks = TableReadLocks;
type Response = GetSchemaResponse;
fn get_key(&self) -> ServerResult<String> {
Ok(self.req.table_name.clone())
}
async fn execute_with_locks(&self, _server: &Server, locks: TableReadLocks) -> ServerResult<G... | Rust | 0 |
res_eax: u32,
}
impl Default for DisableCPUIDFeatures {
fn default() -> Self {
Self::new()
}
}
impl DisableCPUIDFeatures {
pub fn new() -> Self {
Self {
features_ecx: 0,
features_edx: 0,
extended_features_ebx: 0,
extended_features_ecx: 0,
... | Rust | 0 |
}
},
"author_association": "OWNER",
"draft": false,
"merged": false,
"mergeable": null,
"rebaseable": null,
"mergeable_state": "unknown",
"merged_by": null,
"comments": 0,
"review_comments": 0,
"maintainer_can_modify": false,
"commits": 1,
"additions": 1,
"del... | Rust | 0 |
#!/usr/bin/env python
"""
Horizontal cases are for special use by advanced users.
"""
from pathlib import Path
from matplotlib.pyplot import show
from argparse import ArgumentParser
import lowtran
from lowtran.plots import plotradtime
def main():
p = ArgumentParser(description='Lowtran 7 interface')
p.add_arg... | Python | 1 |
l1 = list(map(float,input("radif aval: ").split()))
l2 = list(map(float,input("radif dovom: ").split()))
l3 = list(map(float,input("radif sevom: ").split()))
j = (l1[0]*l2[1]*l3[2])+(l1[1]*l2[2]*l3[0])+(l1[2]*l2[0]*l3[1])-((l1[1]*l2[0]*l3[2])+(l1[0]*l2[2]*l3[1])+(l1[2]*l2[1]*l3[0]))
print(j) | Python | 1 |
'a>> for crate::properties::Parameter {
fn from(parameter: Parameter<'_>) -> crate::properties::Parameter {
crate::properties::Parameter::new(
parameter.key.as_ref(),
parameter.val.as_ref().map(AsRef::as_ref).unwrap_or(""),
)
}
}
#[test]
fn test_parameter() {
assert_... | Rust | 0 |
# SPDX-License-Identifier: BSD-2-Clause
# Copyright Sphinx Confluence Builder Contributors (AUTHORS)
from docutils import nodes
from sphinxcontrib.confluencebuilder.compat import docutils_findall as findall
from sphinxcontrib.confluencebuilder.logger import ConfluenceLogger
from sphinxcontrib.confluencebuilder.nodes i... | Python | 1 |
from sciapp.action import ImageTool
from sciapp.object import mark2shp
import numpy as np
def floodfill(img, x, y):
buf = np.zeros((131072,2), dtype=np.uint16)
color = img[int(y), int(x)]
img[int(y), int(x)] = 0
buf[0,0] = x; buf[0,1] = y;
cur = 0; s = 1;
while True:
xy = buf[cur]
... | Python | 1 |
omega_s = np.append(omega_s, 1.0 - sum(omega_s))
## Updating xk in a relaxed version
if k >= m_Anderson:# + 1:
xks = np.roll(xks, -1, axis=0)
xks[mk + 2, ::] = (1-relax) * np.sum(np.transpose(np.multiply(np.transpose(xks[:mk+2,::]), omega_s)),axis=0)\
... | Python | 1 |
Index).
let n = args
.get(1)
.cloned()
.unwrap_or_default()
.to_integer_or_infinity(context)?;
// 5. Assert: If fromIndex is undefined, then n is 0.
let n = match n {
// 6. If n is +∞, return -1𝔽.
IntegerOrInfinity::Positiv... | Rust | 0 |
from matplotlib import rcParams
# set plot attributes
fig_width = 5 # width in inches
fig_height = 3 # height in inches
fig_size = [fig_width, fig_height]
params = {
"backend": "Agg",
"axes.labelsize": 8,
"axes.titlesize": 8,
"font.size": 8,
"xtick.labelsize": 8,
"ytick.labelsize": 8,
"fi... | Python | 1 |
# Copyright (C) 2013-2014 Camptocamp (<http://www.camptocamp.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class PrinterTray(models.Model):
_name = "printing.tray"
_description = "Printer Tray"
_order = "name asc"
name = fields.Char(required=T... | Python | 1 |
self.facing = match turn {
0 => self.facing.left(),
1 => self.facing.right(),
n => panic!("invalid facing: {}", n),
};
self.position = match self.facing {
North => (self.position.0, self.position.1 + 1),
East => (self.position.0 + 1, self.posit... | Rust | 0 |
);
}
#[test]
fn intersects_range3() {
let range1 = 0..4;
let range2 = 0..1;
assert!(range1.intersects_range(&range2));
}
#[test]
fn intersects_range4() {
let range1 = 4..8;
let range2 = 3..9;
assert!(range1.intersects_range(&range2));
}
... | Rust | 0 |
dsl::queries::*;
/// # use elasticsearch_dsl::queries::params::*;
/// # let query =
/// Query::rank_feature("test");
/// ```
/// To apply mathematical functions:
/// ```
/// # use elasticsearch_dsl::queries::*;
/// # use elasticsearch_dsl::queries::params::*;
/// # let query =
/// Query::rank_feature("test").saturation... | Rust | 0 |
Dictionary with reset values
"""
return {
'interval': 0,
'repetitions': 0,
'ease_factor': 2.5,
'next_review': timezone.now(),
'last_review': None,
'total_reviews': 0,
'correct_reviews': 0
}
def get... | Python | 1 |
src),
quality,
count,
size,
}
}
}
impl WindowSource {
/// # Format Value.
///
/// This returns a value suitable for the `lbl_format_val` widget. It is
/// the image kind, optionally with an iteration number (for candidates).
fn format_val(&self) -> Cow<str> {
if self.count == 0 { Cow::Borrowed(self.... | Rust | 0 |
# Copyright 2025 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; with... | Python | 1 |
import asyncio
import calendar
import time
import gc
import traceback
from framework_common.database_util.ManShuoDrawCompatibleDataBase import AsyncSQLiteDatabase
from framework_common.manshuo_draw.manshuo_draw import manshuo_draw
from datetime import datetime
from framework_common.manshuo_draw import *
import aiosql... | Python | 1 |
th(".ic_nns_common.pb.v1", "::ic-nns-common::pb::v1");
config.out_dir("gen");
println!("cargo:rerun-if-changed={}", proto_file);
config
.compile_protos(
&[proto_file],
&[
"proto",
&transport_proto_dir,
&ic_protos,
... | Rust | 0 |
any reason,
/// the output file could not be opened, then `Some(Err(_))` is returned.
///
/// This file is writeable.
fn output_file() -> Option<Result<File>> {
let output_file_path = env::args_os()
.nth(1)
.map(PathBuf::from)?
.with_extension("txt");
let output = OpenOptions::new()
... | Rust | 0 |
# Copyright 2020 The TensorFlow Authors 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 by applicab... | Python | 1 |
import fsspec
import json
from pathlib import Path
def datamine_folder_fetcher(destination_folder, source_folder, tag):
destination = Path.cwd() / destination_folder
destination.mkdir(exist_ok=True, parents=True)
if tag:
fs = fsspec.filesystem("github", org="gszabi99", repo="War-Thunder-Datamine", ... | Python | 1 |
import os
import tkinter as tk
from tkinter import filedialog, messagebox
from PyPDF2 import PdfReader, PdfWriter
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
def agregar_texto_pdf(pdf_input, pdf_output, texto, x, y):
temp_pdf = os.path.join(os.path.dirname(pdf_output), "temp.pdf"... | Python | 1 |
false,
owns_buffer: false
}))
}
pub fn delete_file(&self, path: &str) -> Arc<Mutex<WorkItem>> {
let path = CString::new(path).unwrap();
let work_item = unsafe { laminafs_sys::lfs_delete_file(
self.context,
path.as_c_str().as_ptr(),
None,
0 as *mut std::ffi::c_void) };
Arc::new(Mutex::new(Wor... | Rust | 0 |
i..]);
tail = &tail[i..];
pos += i;
}
}
if !text.is_empty() {
let node = arena.append(Element::Paragraph { post_blank: 0 }, parent);
containers.push(Container::Inline {
content: &text[0..pos].trim_end(),
node,
});
}
}
pub fn ... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Download all the models for a given PMID or doi."""
usage_str = """
Usage:
python get_models_for_reference.py pmid 24277855
or
python get_models_for_reference.py doi "10.1128/ecosalplus.10.2.1"
"""
import requests
from sys import argv, exit
import zipfile
import zl... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2015 Cask Data, Inc.
#
# Used to generate JSONP from a CDAP documentation directory on a webserver.
#
# sudo echo "versionscallback({\"development\": \"2.6.0-SNAPSHOT\", \"current\": \"2.5.2\", \"versions\": [\"2.5.1\", \"2.5.0\"]});" > json-versions.js; l... | Python | 1 |
- ``visualization`` (Any): Returned by :meth:`visualize`.
- ``predictions`` (dict or DataSample): Returned by
:meth:`forward` and processed in :meth:`postprocess`.
If ``return_datasample=False``, it usually should be a
json-serializable dict containing... | Python | 1 |
, pre: &str) -> bool {
self.prefix.starts_with(pre)
}
}
impl FromStr for Version {
type Err = Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let caps = PREFIX
.captures(s)
.ok_or_else(|| anyhow!("Can't find semver format. value: {}", s))?;
let cap_... | Rust | 0 |
(
regex=r"^(^[0-9]{5}(?:-[0-9]{4})?$|^$)",
message="Must be a valid zipcode in formats 19107 or 19107-3200",
)
],
null=True,
blank=True,
)
newsletter_opt_in = models.BooleanField(blank=False, default=False)
def save(self, *args, **kwargs):... | Python | 1 |
m_blocks
i = 0
out = x
for module in self.inner_blocks:
if i == idx:
out = module(x)
i += 1
return out
def get_result_from_layer_blocks(self, x: Tensor, idx: int) -> Tensor:
"""
This is equivalent to self.layer_blocks[idx](x),
... | Python | 1 |
asp.set_label(a, b)
for a, b in IOC_EEPROM_PART3_EXPORTS.items():
asp.set_label(a, b)
for a, b in IOC_EEPROM_PART4_EXPORTS.items():
asp.set_label(a, b)
def add_exports(asp, exports):
''' Mark up exported entrypoints '''
for a, b in exports.items():
asp.set_block_comment(a, "... | Python | 1 |
let x2 = line.end.x as usize;
let y2 = line.end.y as usize;
if x1 == x2 {
let ys = (y1 as i64 - y2 as i64).abs() as usize;
let y1 = if y1 > y2 { y2 } else { y1 };
for y in 0..ys + 1 {
self.incr(x1, y1 + y);
}
} else if y1 == ... | Rust | 0 |
class TrieNode:
def __init__(self):
self.children = {}
self.is_end_of_word = False
class Trie:
def __init__(self):
self.root = TrieNode()
def insert(self, word):
current_node = self.root
for char in word:
if char not in current_node.children:
... | Python | 1 |
c::P_ALL, MU::uninit().assume_init()),
}
}
}
#[allow(missing_docs)]
mod wait_flags { bitflags! {
pub struct WaitFlags: usize {
const Exit = ::libc::WEXITED as usize;
const Stop = ::libc::WSTOPPED as usize;
const Cont = ::libc::WCONTINUED as usize;
/// Return immediately... | Rust | 0 |
"deepseek-ai/DeepSeek-V2-Lite-Chat": DeepseekHandler,
"ZJared/Haha-7B": QwenHandler,
"speakleash/Bielik-11B-v2.3-Instruct": BielikHandler,
"NovaSky-AI/Sky-T1-32B-Preview": QwenHandler,
"Qwen/QwQ-32B-Preview": QwenHandler,
"tiiuae/Falcon3-10B-Instruct-FC": Falcon3FCHandler,
"tiiuae/Falcon3-7B... | Python | 1 |
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | Python | 1 |
#[tokio::test]
async fn kill_should_send_kill_request_to_process_without_waiting() {
let child = Command::new("sleep")
.arg("60")
.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(Stdio::null())
.spawn()
.unwrap();
let m... | Rust | 0 |
'a>,
camera_uniforms: &'a camera::Uniforms,
sprite_uniforms: &'a Uniforms,
) {
for mesh in &self.meshes {
let material = &self.materials[mesh.material];
mesh.draw(render_pass, &material, camera_uniforms, sprite_uniforms);
}
}
pub fn draw_sprites<'a, '... | Rust | 0 |
}
.visit_ty(decl.1);
}
}
}
impl ASTVisitor for ArrayToPointer<'_> {
unit_result!();
type Err = ();
fn visit_lambda_param(&mut self, e: &mut LambdaParam) -> Result<(), ()> {
match e {
LambdaParam::Variadic => Ok(()),
LambdaParam::LambdaPar... | Rust | 0 |
let header = Header::Create(create);
prev_hash = HeaderHash::with_data_sync(&header);
hash_ops.push(to_op(header.clone()));
valid_hashes.push((header_seq, prev_hash.clone()));
let (el, op) = to_element_and_op(header);
valid_elements.push(el);
... | Rust | 0 |
, wrapper};
///
/// #[derive(Debug, PartialEq)]
/// #[repr(transparent)]
/// pub struct Xyz<T>(pub T);
///
/// unsafe impl<T> constmuck::TransparentWrapper<T> for Xyz<T> {}
///
/// {
/// // Casting from `[u32; 5]` to `[Xyz<u32>; 5]`
///... | Rust | 0 |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
f... | Python | 1 |
def jumpingOnClouds(c, k):
energy = 100
i = 0
n = len(c)
while True:
energy = energy - 1 - (2 *c[i])
i = (i + k) % n
if i == 0:
break
return energy
if __name__ == '__main__':
k = int(input("Enter the size of Jump on cloud: "))
c = list(map(int, input(... | Python | 1 |
data_vars, jax_coord_vars = children
static_coord_vars = aux
dataset = xarray.Dataset(data_vars)
if _DIMS_CHANGE_ON_UNFLATTEN_FN.get(None):
# Drop static coords which have dims not present in any of the data_vars.
# See corresponding comment in _unflatten_data_array.
static_coord_vars = _drop_with_non... | Python | 1 |
L_PEN: c_int = 0x140;
pub const BTN_TOOL_RUBBER: c_int = 0x141;
pub const BTN_TOOL_BRUSH: c_int = 0x142;
pub const BTN_TOOL_PENCIL: c_int = 0x143;
pub const BTN_TOOL_AIRBRUSH: c_int = 0x144;
pub const BTN_TOOL_FINGER: c_int = 0x145;
pub const BTN_TOOL_MOUSE: c_int = 0x146;
pub const BTN_TOOL_LEN... | Rust | 0 |
umWebview>;
let builder = builder.read();
drop(builder);
Box::from_raw(builder_ptr);
0
}
}
fn millennium_make_window_url(url: &str, is_external: u8) -> Result<millennium::utils::config::WindowUrl, anyhow::Error> {
if is_external == 1 {
let url = url::Url::parse(url)?;
Ok(millennium::utils::config::Window... | Rust | 0 |
from dataclasses import dataclass
from enum import Enum
from typing import List, Optional, Union
import numpy as np
import PIL
from PIL import Image
from ...utils import BaseOutput, is_torch_available, is_transformers_available
@dataclass
class SafetyConfig(object):
WEAK = {
"sld_warmup_steps": 15,
... | Python | 1 |
class Solution:
def maxVowels(self, s: str, k: int) -> int:
vowels = 'aeiou'
cur_v = max_v = sum([1 for x in s[:k] if x in vowels])
for i in range(0, len(s) - k):
cur_v += (s[i + k] in vowels) - (s[i] in vowels)
if cur_v > max_v:
max_v = cur_v
... | Python | 1 |
Ok(())
}
pub fn obtain_wf_files(
gh_token: impl AsRef<str>,
primary_wf: &raw_url::RawUrl,
url_type: &raw_url::UrlType,
) -> Result<Vec<config::types::File>> {
let primary_wf_url = primary_wf.to_url(url_type)?;
let base_dir = primary_wf.base_dir()?;
let base_url = primary_wf.to_base_url(url_type... | Rust | 0 |
python::put(&repo, version);
Ok(())
} else if let Some(_current) = rust::get(&repo) {
rust::put(&repo, version);
Ok(())
} else {
Err(SemanticError::IOError)
}
}
/// Add the version-file.
pub fn add(repo: &Repository) -> SemanticResult {
if let Some(_version) = py... | Rust | 0 |
print("Dia","Mês","Ano", sep='/')
print("Manha","Tarde","Noite", sep='-') | Python | 1 |
t_range=dirty_index, is_local=False)
for di, didx in enumerate(dirty_index.cpu().numpy().tolist()):
rr.set_time_sequence("frame", int(self.tstamp[int(didx)].item()))
pose_mat = SE3(self.poses[int(didx)]).inv().matrix().cpu().numpy()
rr.log(
f"world/kf_{didx:... | Python | 1 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2025 CEA, EDF
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#... | Python | 1 |
[`crate::dmc`] and
//! [`crate::octree`].
pub use crate::dmc::*;
pub use crate::octree::*;
// 1
// fn main() {
// let y = {
// let x = 3;
// x + 1
// };
// println!("The value of y is: {}", y);
// }
// 2
// fn main() {
// let number = 3;
// if number>0 {
// println!("numb... | Rust | 0 |
_SZIP_WRITE", info.has_szip_write);
}
info
}
fn emit_feature_flags(&self) {
if self.has_dap2 || self.has_dap4 {
println!("cargo:rustc-cfg=feature=\"has-dap\"");
println!("cargo:has-dap=1");
} else {
assert!(
feature!("DAP").is_... | Rust | 0 |
EntropyLoss().to(device)
print(f"Start training for {args.epochs} epochs")
start_time = time.time()
train_and_evaluate(model, model_without_ddp, original_model,
criterion, data_loader, optimizer, lr_scheduler,
device, class_mask, args)
total_time = time.time() ... | Python | 1 |
NaNs
pub fn min(vals: &[f64]) -> f64 {
*vals
.iter()
.min_by(|a, b| a.partial_cmp(b).unwrap())
.unwrap()
}
#[test]
fn test_max() {
let assert_float_eq = |a: f64, b: f64| {
assert!((a - b).abs() < f64::EPSILON);
};
assert_float_eq(1.0, max(&[1.0]));
assert_float_eq(... | Rust | 0 |
import os # noqa: F401
from typing import AsyncIterator
from starlette.applications import Starlette
from starlette.requests import Request
from starlette.responses import Response, JSONResponse
from starlette.routing import Route
from sse_starlette.sse import EventSourceResponse
from coagent.core import Address, Ra... | Python | 1 |
import json
import requests
import re
import sys
def getRecords(domain): #grab all the records so we know which ones to delete to make room for our record. Also checks to make sure we've got the right domain
allRecords=json.loads(requests.post(apiConfig["endpoint"] + '/dns/retrieve/' + domain, data = json.dumps(apiCo... | Python | 1 |
[255, 255, 255, 255u8]);
}
let bounding_box = Rect::from_wh(bb_width, bb_height);
let scaling_factor = image_width / bb_width;
let resource_colors: HashMap<&str, image::Rgba<_>> = [
("iron-ore", image::Rgba([0u8, 140u8, 255u8, 255u8])),
("copper-ore", image::Rgba([255u8, 55u8, 0u8, 255u8... | Rust | 0 |
clamp_at_left(spl1.front(), spl1);
let mut spl2_clamped = clamp_at_left(spl2.front(), spl2);
match_degrees(&mut spl1_clamped, &mut spl2_clamped);
let p = spl1_clamped.degree() as usize;
if join_cont >= p {
return Err(GeomErrorCode::JoinContinuityTooTight);
}
// let the two splines hav... | Rust | 0 |
7C00;
base_table[i1] = 0xFC00;
shift_table[i0] = 24;
shift_table[i1] = 24;
} else {
base_table[i0] = 0x7C00;
base_table[i1] = 0xFC00;
shift_table[i0] = 13;
shift_table[i1] = 13;
}
}
let mut file = fs::File::crea... | Rust | 0 |
normal_init,
)?;
let layer_norm = LayerNorm::new(
vs / "layer_norm",
vec![config.dims()],
config.layer_norm_eps(),
true,
);
let dropout = Dropout::new(config.dropout());
Ok(SinusoidalEmbeddings {
dropout,
... | Rust | 0 |
l, fn_com, fmt="gaussian", template=template, atom_line=atom_line)
with as_file(files("iodata.test.data").joinpath("input_gaussian_bsse.com")) as fn_expected:
check_load_input_and_compare(fn_com, fn_expected)
def test_input_orca_from_xyz(tmpdir):
# load geometry from xyz file & add level of theory & b... | Python | 1 |
("host", false ; "host")]
#[test_case("router", true ; "router")]
async fn sends_router_solicitations<E: netemul::Endpoint>(
test_name: &str,
sub_test_name: &str,
forwarding: bool,
) {
let name = format!("{}_{}", test_name, sub_test_name);
let name = name.as_str();
let sandbox = netemul::TestSa... | Rust | 0 |
{
text: "`NonlinearConjugateGradient`: No `param` in `state`".to_string(),
}
.into()
})?;
let grad = state
.take_grad()
.map(Result::Ok)
.unwrap_or_else(|| problem.gradient(&xk))?;
let cur_cost = state.cost;
//... | Rust | 0 |
mTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs()
};
// receiver_account.futures.insert(Pubkey::new_unique(), new_future);
// receiver_account.serialize(&mut &mut account.data.borrow_mut()[..])?;
Ok(())
// let instruction = TokenInstruction::unpack(input)?;
// match instruction {
/... | Rust | 0 |
llision_detected = (overlap_num >= CollisionArgs.overlap_num).squeeze()
return collision_detected, gripper_points
def has_collision(feature_field: FeatureFieldAdapter, grasps_to_world: Transform3d) -> Bool[torch.Tensor, "num_grasps"]:
"""
Check if the gripper has a collision with the scene for the given g... | Python | 1 |
.update_one(&mut l1, fields!(Level1, "level2_*"))
.await
.is_ok());
assert_eq!(
toql.take_unsafe_sql(),
"UPDATE Level2 SET text = 'level2' WHERE id = 2 AND level3_id = 3"
);
assert!(toql
.update_one(&mut l1, fields!(Level1, "level2_level3_*"))
.await
... | Rust | 0 |
sion: Version::V4_50,
vertex: CompilerVertexOptions::default(),
}
}
}
impl spirv::Parse<Target> for spirv::Ast<Target> {
fn parse(module: &spirv::Module) -> Result<Self, ErrorCode> {
let compiler = {
let mut compiler = ptr::null_mut();
unsafe {
... | Rust | 0 |
@Param {MessageEvent} event: 消息事件
"""
qqid = str(event.get_user_id())
if not is_already_bound(qqid):
await unbind.send("您还未绑定bot,无法解绑!")
return
bot_key = get_bot_key(qqid)
payload = {"botKey": bot_key}
try:
async with httpx.AsyncClient() as client:
response =... | Python | 1 |
if progress_callback:
progress_callback('warning', f'重命名失败,准备重试: {str(e)}')
time.sleep(retry_delay)
else:
# 第一轮重试都失败,加入批量重试列表
logger.... | Python | 1 |
t instance: ::protobuf::lazy::Lazy<UserField> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const UserField,
};
unsafe {
instance.get(UserField::new)
}
}
}
impl ::protobuf::Clear for UserField {
fn clear(&mut self) {
... | Rust | 0 |
pub fn send_attack_route(target: &str, request: Vec<u8>) -> String {
let mut stream;
match TcpStream::connect(target) {
Ok(v) => {
stream = v;
}
Err(v) => {
return "error connecting".to_string();
}
}
stream.write(&request[..]).unwrap();
let ... | Rust | 0 |
result = []
for _ in batch_hyp:
finished = False
for r in _:
if len(r) >= 8:
result.append(r)
finished = True
break
if not finished:
result.ap... | Python | 1 |
impl AsRawFd for Tube {
fn as_raw_fd(&self) -> RawFd {
self.socket.as_raw_fd()
}
}
impl ReadNotifier for Tube {
fn get_read_notifier(&self) -> &dyn AsRawDescriptor {
&self.socket
}
}
impl FromRawDescriptor for Tube {
/// # Safety:
/// Requirements:
/// (1) The caller owns ... | Rust | 0 |
num = float(input("check number +,- = "))
if num > 0:
print("positive")
elif num == 0:
print("zero")
else:
print("negative number")
| Python | 1 |
import pickle
import numpy as np
import cv2
from FLAGS import * # Stores parameters and hy
from keras.optimizers import Adam
from DatNet import DatNet, mse_steer_angle # Compute the loss of steering angle
from keras.models import model_from_json
from keras.callbacks import ModelCh... | Python | 1 |
from datetime import timedelta
from pathlib import Path
from typing import Annotated, Any, Literal, Union
from pydantic import BaseModel, BeforeValidator, Discriminator, Field, RootModel, Tag, WrapSerializer, model_validator
from ... import exceptions as ade
from .common import ParsedTimedelta
class SequenceStep(Ba... | Python | 1 |
"""
LlamaIndex适配器模块: 集成其他AI框架作为LlamaIndex调用链的组件
"""
| Python | 1 |
"camelCase")]
pub enum Action {
Run,
Test,
Format,
Clippy,
}
#[derive(Serialize, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
pub enum Channel {
Stable,
Beta,
Nightly,
}
#[derive(Serialize, Debug, PartialEq)]
#[serde(rename_all = "camelCase")]
pub enum Mode {
Debug,
Relea... | Rust | 0 |
_PRIVATE_PROPERTIES: CLUSCTL_RESOURCE_CODES = 16777337i32;
#[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"]
pub const CLUSCTL_RESOURCE_GET_RO_PRIVATE_PROPERTIES: CLUSCTL_RESOURCE_CODES = 16777341i32;
#[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"]
pub const CLUSCTL_RESOURCE_GET_PRIVAT... | Rust | 0 |
e), usize),
{
let mut cursor: (isize, isize) = (0, 0);
let mut steps: usize = 0;
for seg in wire {
let delta: (isize, isize) = match seg.direction {
Direction::Left => (-1, 0),
Direction::Right => (1, 0),
Direction::Up => (0, 1),
Direction::Down => (0,... | Rust | 0 |
import os #Importar biblioteca para utilizar o comando "cls"
maquinistas = [] #Duas listas globais para armazenar os valores emitidos
trens = []
def exibir_titulo(): #Função com objetivo de Mostrar o título
print("𝑪𝑪𝑹 𝑹𝒂𝒊𝒍𝑺𝒚𝒏𝒄\n" )
def exibir_option(): #Função com objetivo de Mostrar as opções
... | Python | 1 |
recvfrom(
fd_accepted,
recv_buf.as_mut_ptr() as *mut core::ffi::c_void,
recv_buf.len(),
0,
std::ptr::null_mut(),
std::ptr::null_mut(),
)
};
let errno = test_uti... | Rust | 0 |
Some(text) => filelist
.defines
.insert(d.to_string(), Some(text.to_string())),
None => filelist.defines.insert(d.to_string(), None),
};
}
}
LineType::IncDir(incdirs) => ... | Rust | 0 |
nter: bool, ddof: int
) -> Self:
return self._reuse_series(
"rolling_std",
call_kwargs={
"window_size": window_size,
"min_samples": min_samples,
"center": center,
"ddof": ddof,
},
)
def rolling_v... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.