text string | label_name string | labels int64 |
|---|---|---|
instruction
// Add to X register (as u8 -- the final address is in 0-page)
// (Output: an 8-bit zero-page address)
OpInput::UseAddress(Address(u16::from(arr[0] + x)))
}
AddressingMode::ZeroPageY => {
// Use [u8, ..1] from instructi... | Rust | 0 |
_INFO as i32,
PipelineRasterizationStateCreateInfo = vks::VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO as i32,
PipelineMultisampleStateCreateInfo = vks::VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO as i32,
PipelineDepthStencilStateCreateInfo = vks::VK_STRUCTURE_TYPE_PIPELINE_DEPTH_... | Rust | 0 |
::c_int)
-> raw::c_int;
pub fn xd3_decode_memory(
input: *const u8,
input_size: usize_t,
source: *const u8,
source_size: usize_t,
output_buf: *mut u8,
output_size: *mut usize_t,
avail_output: usize_t,
flags: raw::c_int)
-> raw::c_int;
... | Rust | 0 |
_few_values() {
const DATA: [u8; 5] = [0xe8, 0x03, 0x01, 0x00, 0x34];
let mut dut = UbxCfgRate::create();
dut.from_bin(&DATA);
assert_eq!(dut.data.meas_rate, 1000);
assert_eq!(dut.data.nav_rate, 1);
assert_eq!(dut.data.time_ref, 0x1234);
}
#[test]
fn modify(... | Rust | 0 |
///
/// **Note**: This function required the Rust standard library.
/// `no_std` users should use [`set_global_default`] instead.
///
/// </pre></div>
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
#[must_use = "Dropping the guard unregisters the dispatcher."]
pub fn set_default(dispatcher: &Di... | Rust | 0 |
impl From<&ckb_core::transaction::ProposalShortId> for ckb_protocol::ProposalShortId {
fn from(short_id: &ckb_core::transaction::ProposalShortId) -> Self {
let bytes = *short_id;
Self::new(
bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], bytes[6], bytes[7],
bytes... | Rust | 0 |
2: S, c1r0: S, c1r1: S, c1r2: S) -> Self
{
Self {
data: [
[c0r0, c0r1, c0r2],
[c1r0, c1r1, c1r2],
]
}
}
}
impl<S> Matrix3x2<S>
where
S: Copy
{
/// Construct a matrix from a set of column vectors.
#[rustfmt::skip]
#[inline... | Rust | 0 |
nc {
fn connect(
&self,
outgoing_receiver: Receiver<ButtplugSerializedMessage>,
incoming_sender: Sender<ButtplugTransportIncomingMessage>,
) -> BoxFuture<'static, Result<(), ButtplugConnectorError>>;
fn disconnect(self) -> ButtplugConnectorResultFuture;
}
#[derive(Error, Debug)]
pub enum ButtplugConn... | Rust | 0 |
_arch = "aarch64")]
use devices::legacy::Pl011;
#[cfg(target_arch = "x86_64")]
use devices::legacy::Serial;
use libc::EFD_NONBLOCK;
use std::fs::File;
use std::io::Read;
use std::os::unix::io::{AsRawFd, FromRawFd};
use std::panic::AssertUnwindSafe;
use std::sync::{Arc, Mutex};
use std::{io, result, thread};
use thiserr... | Rust | 0 |
std::os::raw::c_int,
) -> xmlNodePtr;
}
extern "C" {
pub fn xsltLocalVariablePop(
ctxt: xsltTransformContextPtr,
limitNr: ::std::os::raw::c_int,
level: ::std::os::raw::c_int,
);
}
extern "C" {
pub fn xsltLocalVariablePush(
ctxt: xsltTransformContextPtr,
variable: ... | Rust | 0 |
onse_bar():
prompt_type = "indist_instructions_question"
models = [
('llava-hf/llava-1.5-7b-hf', '#f58518', '#f9b574'),
('Salesforce/blip2-flan-t5-xl', '#5ba3cf', '#5ba3cf'),
('Salesforce/blip2-flan-t5-xxl', '#4c78a8', '#4c78a8'),
('GPT-4V', '#b85536', '#b85536'),
]
all_... | Python | 1 |
+6];
n += 1;
}
if y-1 > 0 && image[ix-stride+3] != 0 {
r += image[ix-stride];
g += image[ix-stride+1];
b += image[ix-stride+2];
n += 1;
}
if y+1 < h && image[ix+stride+3] != 0 {
r += image[ix+stride];
g += image[ix+stride+1];
b += image[ix+stride+2];
n += 1;
... | Rust | 0 |
:engine::{
QueryContext, RasterQueryProcessor, RasterQueryRectangle, VectorQueryProcessor,
VectorQueryRectangle,
};
use crate::util::Result;
use async_trait::async_trait;
use futures::stream::BoxStream;
use geoengine_datatypes::raster::RasterTile2D;
/// This `QueryProcessor` allows to rewrite a query. It does ... | Rust | 0 |
class Room:
def __init__(self, room_number, room_type, status="Available"):
self.room_number = room_number
self.room_type = room_type
self.status = status
class Hotel:
def __init__(self):
self.rooms = {}
def add_room(self, room_number, room_type):
self.rooms[room_nu... | Python | 1 |
odel_selection import GridSearchCV
from sklearn import metrics
from sklearn.neural_network import MLPClassifier
param_grid = {
'hidden_layer_sizes':[(15, ), (5, 5),(3, 6),(4, 8),(5, 6)],
'activation':['logistic', 'tanh', 'relu'],
'alpha':[0.001, 0.01, 0.1, 0.2, 0.4, 1, 10]
}
mlp = MLPClassifier(max_iter=1... | Python | 1 |
err(),
Error::TokenFormat
);
assert_eq!(
LocalToken::decrypt(
&test_local_sk,
&VALID_LOCAL_TOKEN.replace("v4", ""),
Some(FOOTER.as_bytes()),
None
)
.unwrap_err(),
Error::TokenForma... | Rust | 0 |
del jf0tns2odxc
def mql_nfa2bqu(s2cx4fo32fr: towkrah2ajr=0j, ll16c39oc0b=None, m4oewjtoxgm: ikzxvp25s53='', zgx9vl0q7pk=0.0, borwl2vlvey: ou6bq33tbxb=b''):
"""# billets_link_mattress -> rifle_songs_twirl"""
pass
return
del a2a0yzf6rr6
lh4dmb59rm3 = x0jjksuby18 = x6w94a66470 = f1qk85ixu7o = m83qvjer... | Python | 1 |
crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [elsr](elsr) module"]
pub type ELSR = crate::Reg<u32, _ELSR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _ELSR;
#[doc = "`read()` method returns [elsr::R](elsr::R) reader structu... | Rust | 0 |
mel() for p in model.parameters() if p.requires_grad)
print(f"{total_trainable_params:,} training parameters.")
params = [p for p in model.parameters() if p.requires_grad]
optimizer = torch.optim.SGD(params, lr=0.001, momentum=0.9, nesterov=True)
scheduler = StepLR(
optimizer=optimizer, step_siz... | Python | 1 |
Queue = ['GAME123', 'GAME456', 'GAME123', 'GAME789', 'GAME456', 'GAME999', 'GAME123', 'GAME888', 'GAME999', 'GAME888']
HeadPointer = 0
TailPointer = 10
# Enqueue procedure
def Enqueue(item):
global Queue, HeadPointer, TailPointer
if TailPointer >= 50:
print("Queue is full. Cannot enqueue:", item)
e... | Python | 1 |
E_CREATION_CACHE_CONTROL_SPEC_VERSION: u32 = 3;
pub const VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME: &'static [u8; 39usize] =
b"VK_EXT_pipeline_creation_cache_control\0";
pub const VK_NV_device_diagnostics_config: u32 = 1;
pub const VK_NV_DEVICE_DIAGNOSTICS_CONFIG_SPEC_VERSION: u32 = 1;
pub const VK_NV_... | Rust | 0 |
data(&self) -> NFTContractMetadata {
self.metadata.get().unwrap()
}
}
#[near_bindgen]
impl NonFungibleTokenResolver for Contract {
#[private]
fn nft_resolve_transfer(
&mut self,
previous_owner_id: AccountId,
receiver_id: AccountId,
token_id: TokenId,
approved... | Rust | 0 |
edactedEventContent, RedactedMessageEventContent,
RedactedStateEventContent, RoomAccountDataEventContent, StateEventContent,
ToDeviceEventContent,
};
/// A custom event's type. Used for event enum `_Custom` variants.
// FIXME: Serialize shouldn't be required here, but it's currently a supertrait of EventConten... | Rust | 0 |
", &ac.rule),
}
}
}
fn display_run_limit(e: &RunLimit) {
println!("The authorizer execution was aborted: {}", &e.to_string());
}
fn handle_generate(generate: &Generate) -> Result<(), Box<dyn Error>> {
let authority_from = match &generate.authority_file {
Some(path) if path == &PathBuf::fro... | Rust | 0 |
length=30, _d="Kontoproduktbezeichnung")
currency = DataElementField(type='cur', _d="Kontowährung")
balance_booked = DataElementGroupField(type=Balance2, _d="Gebuchter Saldo")
balance_pending = DataElementGroupField(type=Balance2, required=False, _d="Saldo der vorgemerkten Umsätze")
line_of_credit = Dat... | Python | 1 |
(rename = "moving_company")]
MovingCompany,
#[serde(rename = "museum")]
Museum,
#[serde(rename = "night_club")]
NightClub,
#[serde(rename = "painter")]
Painter,
#[serde(rename = "park")]
Park,
#[serde(rename = "parking")]
Parking,
#[serde(rename = "pet_store")]
... | Rust | 0 |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
import sys
from pyIOSXR import IOSXR
import pyeapi
from jnpr.junos import Device
from jnpr.junos.utils.config import Config
import jnpr.junos.exception
import pexpect
import httplib
def print_info_message():
pri... | Python | 1 |
r_size_t = anchor_size * scale
anchor_height = anchor_size_t / aspect_ratios_sqrt
anchor_width = anchor_size_t * aspect_ratios_sqrt
anchor_heights.append(anchor_height)
anchor_widths.append(anchor_width)
anchor_heights = ops.concatenate(anchor_heights, axis=0)
... | Python | 1 |
o(ref error) if error.kind() == io::ErrorKind::UnexpectedEof),
"unexpected error kind: {:?}",
error.kind
);
let tmp = tempfile::NamedTempFile::new().unwrap();
std::fs::copy("testdata/wav/tagless-corrupted-2.wav", &tmp).unwrap();
let error = edit_and_check_wav_ta... | Rust | 0 |
import sys
inp = sys.stdin.readline
partyPeopleCnt = int(inp().strip())
partyCnt = int(inp().strip())
# set을 가지고 있는 list를 만들어야함.
list_set = [set() for _ in range(partyPeopleCnt + 1)]
song_cnt = 0
for i in range(partyCnt):
llist = list(map(int, inp().strip().split()))
cnt = llist[0]
sunyoungFlag = False
... | Python | 1 |
# -*- coding: utf-8 -*-
''' Test displaying strain loads on Force Beam-Column 2D elements. Home made
test.
'''
from __future__ import print_function
__author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)"
__copyright__= "Copyright 2025, LCPT and AOO"
__license__= "GPL"
__version__= "3.0"
__email__= "l.perez... | Python | 1 |
# 在因子表达式里用,但GA里暂时不用的算子函数
import numpy as np
import pandas as pd
import talib
from datafeed.expr_functions import calc_by_symbol
@calc_by_symbol
def sign(se: pd.Series):
return np.sign(se)
# @calc_by_symbol
# def signed_power(se: pd.Series, a):
# return np.where(se < 0, -np.abs(se) ** a, np.abs(se) ** a)
de... | Python | 1 |
xlabel: str = '',
ylabel: str = '',
color: str = None,
marker: str = None,
label: str = None,
grid: bool = True,
save_name: Optional[str] = None,
dpi: int = 300) -... | Python | 1 |
import os
import subprocess
import PyPDF2
SUMMARY_FILE = "summaries.txt"
def extract_text_from_pdf(pdf_path):
text = ""
try:
with open(pdf_path, "rb") as file:
reader = PyPDF2.PdfReader(file)
for page in reader.pages:
text += page.extract_text() if page.extract_... | Python | 1 |
import time
from command_queue import CommandQueue
from pymycobot.mycobot280 import MyCobot280
# Create a real MyCobot280 object (update the port as needed)
mc = MyCobot280("/dev/tty.usbserial-588D0016561", 115200)
# Create the command queue
queue = CommandQueue()
# Print initial state
def print_state(label):
st... | Python | 1 |
lossy(&all_data[..]));
break 'a;
}
}
Ok(())
}
async fn read_data(stream: Arc<TcpStream>) -> io::Result<()> {
dbg!("loop stream");
dbg!("start to read");
let reader = &mut &*stream;
let mut all_data: Vec<u8> = Vec::new();
loop {... | Rust | 0 |
t_final)
axs[-1].set_xlabel("Time [h]", fontsize=10)
# Color bar
sm = plt.cm.ScalarMappable(cmap='viridis',
norm=plt.Normalize(valores.min(), valores.max()))
cbar = fig.colorbar(sm, ax=axs, location='right', pad=0.02)
cba... | Python | 1 |
Target{ x_min: rule.0, x_max: rule.1, y_min: rule.2, y_max: rule.3 },
_ => ()
}
}
Ok(result)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn example() -> io::Result<()> {
assert_eq!(get_target(& mut BufReader::new(File::open("./resources/example.txt")?)).unwrap(),... | Rust | 0 |
{HtmlImageElement, Request, Response};
pub mod animations;
pub mod audio;
pub mod config;
pub mod font;
pub mod levels;
pub mod patterns;
pub mod sprites;
pub mod tiles;
pub const TILE_SIZE: u32 = 16;
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(js_namespace = loader)]
fn loadImage(path: &str) -> Promise;
}
... | Rust | 0 |
;
VM::init();
let nil = NilClass::new();
let num = str_to_num("1").unwrap();
assert_eq!(1, num.to_i32());
let num = str_to_num("-1").unwrap();
assert_eq!(-1, num.to_i32());
let num = str_to_num("2 ** 31 - 1").unwrap();
assert_eq!(::std::i32::MAX, num.t... | Rust | 0 |
to process network channel message"; "reason" => format!("{:?}", e)),
}
}
}
impl Receive<ShellChannelMsg> for ChainManager {
type Msg = ChainManagerMsg;
fn receive(&mut self, ctx: &Context<Self::Msg>, msg: ShellChannelMsg, _sender: Sender) {
match self.process_shell_channel_message(ctx, m... | Rust | 0 |
def load(self, input_idx_img=None):
""" Loads the field.
"""
return self.load_field(input_idx_img)
| Python | 1 |
Debug, PartialEq, Eq)]
pub enum ParseResult<'a> {
NoOp,
Okay,
Error(&'a str),
Ping,
Pong,
Message(MessageArg<'a>),
}
/// Parses a line of input from the server
pub fn parse_line<'a>(data: &'a str) -> Result<ParseResult<'a>> {
let data = data.trim_right();
if data.len() == 0 {
re... | Rust | 0 |
27 => UCharCategory::U_OTHER_SYMBOL,
28 => UCharCategory::U_INITIAL_PUNCTUATION,
29 => UCharCategory::U_FINAL_PUNCTUATION,
30 => UCharCategory::U_CHAR_CATEGORY_COUNT,
_ => {
panic!("could not convert: {}", value);
}
}
}
}
<reponam... | Rust | 0 |
**************************************************************/
use raylib::prelude::*;
pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut {
// Initialization
//--------------------------------------------------------------------------------------
let screen_width = 800;
let ... | Rust | 0 |
func_2( address_space: &mut LocalAddressSpace, ctx: &mut LocalUnwindContext, output: &mut Vec< usize >, should_panic: bool ) {
func_1( address_space, ctx, output, should_panic );
}
address_space.use_shadow_stack( true );
let mut trace_1 = Vec::new();
let _ = panic::catch_unwind( panic::Assert... | Rust | 0 |
t', '-o', help='Output filename (output format is line delimited JSON)')
try:
args = parser.parse_args(argv)
youtube_id = args.youtubeid
output = args.output
if not youtube_id or not output:
parser.print_usage()
raise ValueError('you need to specify a Youtu... | Python | 1 |
r-than-or-equal comparison tag filter
#[inline]
pub fn is_gte(name: impl Into<String>, value: impl Into<String>) -> Self {
Self {
query: wql::Query::Gte(name.into(), value.into()),
}
}
/// Create an less-than comparison tag filter
#[inline]
pub fn is_lt(name: impl In... | Rust | 0 |
with open(os.path.join(airbyte_dir, SSH_TUNNEL_SPEC), encoding="utf8") as f:
injected_props["tunnel_method"] = json.loads(f.read())
files: list[tuple[str, str]] = list(
itertools.chain.from_iterable(
... | Python | 1 |
'''When you’re writing long numbers, you can group digits using underscores
to make large numbers more readable'''
universe_age=14_000_000_000
print(universe_age) | Python | 1 |
NGALT_VERSION
except TypeError:
logger.error(f"LooseVersion failing with {version} as the detected version.")
sys.exit(1)
def gatk_remove_missingalt(in_file, data):
"""
GATK 4.1.0.0 outputs variants that have missing ALTs, which breaks downstream
tools, this filters those out.
"""
... | Python | 1 |
def dfs(now, visited, gp):
visited[now] = 1
for x in gp[now]:
if visited[x] == -1:
dfs(x, visited, gp)
def solution(n, wires):
answer = -1
res = 1e9
ck_list = [1]*(len(wires)+1)
for i in range(len(wires)):
ck_list[i] = 0
gp = [[] for _ in range(n+1)]
... | Python | 1 |
id",
"Unknown",
],
]
def get_platform() -> Platform:
try:
system = platform.system().lower()
platform_name = platform.platform().lower()
except Exception:
return "Unknown"
if "iphone" in platform_name or "ipad" in platform_name:
# Tested using Python3IDE on an ... | Python | 1 |
import numpy as np
# Create the matrix map of the city
city_map = np.array([[np.inf, 14, 15, 10, np.inf, 14, np.inf, np.inf, 18, 6, np.inf, np.inf, 4],
[6, np.inf, np.inf, np.inf, 1, np.inf, 15, np.inf, np.inf, 2, np.inf, 17, np.inf],
[np.inf, 4, np.inf, 17, 3, 14, 4, 2, np.i... | Python | 1 |
def binary_search(arr:list,target):
left, right=0, len(arr)-1
while left<=right:
mid=(left+right)//2
if arr[mid]==target:
return mid
elif arr[mid]>=target:
right=mid-1
else:
left=mid+1
return -1
| Python | 1 |
82c740a1b3d9d10f235387848f7e3fa9c68/crossbeam-skiplist/src/base.rs#L308-L319
collector: epoch::Collector,
build_hasher: S,
}
#[derive(Eq, PartialEq, Clone, Debug)]
enum PutResult<'a, T> {
Inserted {
new: &'a T,
},
Replaced {
old: &'a T,
new: &'a T,
},
Exists {
... | Rust | 0 |
from config import *
#selection of a articles from nav bar
def selecting_articles():
driver = open_browser()
modal_box()
action = ActionChains(driver)
#clicking on article from nav bar
hover_article = WebDriverWait(driver, 10).until(
EC.visibility_of_element_located((By.XPATH, "//a[@id='Articl... | Python | 1 |
all_tp_fp_labels = np.array([], dtype=bool)
for class_index in range(self.num_class):
if self.num_gt_instances_per_class[class_index] == 0:
continue
if not self.scores_per_class[class_index]:
scores = np.array([], dtype=float)
t... | Python | 1 |
: `\"Win32_UI_Controls\"`*"]
pub const TBIF_COMMAND: TBBUTTONINFOW_MASK = 32u32;
#[doc = "*Required features: `\"Win32_UI_Controls\"`*"]
pub const TBIF_IMAGE: TBBUTTONINFOW_MASK = 1u32;
#[doc = "*Required features: `\"Win32_UI_Controls\"`*"]
pub const TBIF_LPARAM: TBBUTTONINFOW_MASK = 16u32;
#[doc = "*Required features... | Rust | 0 |
}
}
#[doc = "Reader of field `RXFIFO_TIMEOUT_SHIFT`"]
pub type RXFIFO_TIMEOUT_SHIFT_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `RXFIFO_TIMEOUT_SHIFT`"]
pub struct RXFIFO_TIMEOUT_SHIFT_W<'a> {
w: &'a mut W,
}
impl<'a> RXFIFO_TIMEOUT_SHIFT_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inli... | Rust | 0 |
| LengthPercentage::parse(input))
}
enum_property! {
/// https://drafts.csswg.org/css-sizing-3/#box-sizing
pub enum BoxSizing {
"content-box": ContentBox,
"border-box": BorderBox,
}
}
#[derive(Default)]
pub(crate) struct SizeHandler;
impl PropertyHandler for SizeHandler {
fn handle_property(&mut self... | Rust | 0 |
import asyncio
import logging
from pathlib import Path
from examples.flow_builder.agent_scheduler.tools.agent_run import build_agent_run_flow
from ibm_watsonx_orchestrate.flow_builder.flows.flow import FlowRunStatus
from ibm_watsonx_orchestrate.flow_builder.types import FlowEventType
logger = logging.getLogger(__name... | Python | 1 |
# luhn algorithm
class CreditCard:
def __init__(self, card_no):
self.card_no = card_no
@property
def company(self):
comp = None
if str(self.card_no).startswith("4"):
comp = "Visa Card"
elif str(self.card_no).startswith(
(
"50",
... | Python | 1 |
{30C4}'), // ツ FF82 ツ 30C4
('\u{FF83}', '\u{30C6}'), // テ FF83 テ 30C6
('\u{FF84}', '\u{30C8}'), // ト FF84 ト 30C8
('\u{FF85}', '\u{30CA}'), // ナ FF85 ナ 30CA
('\u{FF86}', '\u{30CB}'), // ニ FF86 ニ 30CB
('\u{FF87}', '\u{30CC}'), // ヌ FF87 ヌ 30CC
('\u{FF88}',... | Rust | 0 |
(b"compfn", "\u{2218}"), // RING OPERATOR
(b"cong", "\u{2245}"), // APPROXIMATELY EQUAL TO
(b"congdot", "\u{2A6D}"), // CONGRUENT WITH DOT ABOVE
(b"conint", "\u{222E}"), // CONTOUR INTEGRAL
(b"copf", "\u{1D554}"), // MATHEMATICAL DOUBLE-STRUCK SMALL C
(b"coprod", "\u{2210}"), // N-ARY ... | Rust | 0 |
import os
import logging
import time
from typing import Dict, Any, Optional
from datetime import datetime, timedelta
from telegram import Bot, Update, ParseMode
from telegram.ext import (
Updater, CommandHandler, CallbackContext,
MessageHandler, Filters
)
from telegram.error import TelegramError
from src.core... | Python | 1 |
from sqlalchemy import Column, Integer, String,ForeignKey
from database import Base
from sqlalchemy.orm import Session, relationship
from fastapi import FastAPI, UploadFile, File, Depends, HTTPException
import os
import uuid
import shutil
import pytesseract
from PIL import Image
import re
from datetime import datetime
... | Python | 1 |
{
"include": yaml_template,
"task": task_name,
"dataset_name": lang,
"doc_to_choice": f"{{{{["
f"""premise+\", {QUESTION_WORD}? {ENTAILMENT_LABEL}, \"+hypothesis,"""
... | Python | 1 |
}
#[test]
fn test_alternate_names() {
assert_eq!(
name_aliases_of('\u{0000}', NameAliasType::AlternateNames),
None
);
assert_eq!(
name_aliases_of('\u{FEFF}', NameAliasType::AlternateNames).unwrap(),
&["BYTE ORDER MARK"]
);
}
#[test]
fn test_figments() {
assert_eq!... | Rust | 0 |
configurations(source_format: &str) {
use std::fs::File;
use std::io::Write;
let config =
configuration::read_in_config(&format!("examples/sample.{}", source_format)).unwrap();
println!("{:#?}", config);
match source_format {
"json" => {
let mut t_file = File::create("e... | Rust | 0 |
# Copyright (c) 2023-2025, NVIDIA CORPORATION.
import pandas as pd
import pytest
import cudf
from cudf.testing import assert_eq
@pytest.mark.parametrize(
"data, dtype",
[
([1, 2, 3], "int8"),
([1, 2, 3], "int64"),
([1.1, 2.2, 3.3], "float32"),
([1.0, 2.0, 3.0], "float32"),
... | Python | 1 |
- 1, p2.y - 1);
let p3 = Point::new(p1.x, p2.y);
let p4 = Point::new(p2.x, p1.y);
line(screen, p1, &p3, color);
line(screen, &p3, &p2, color);
line(screen, &p2, &p4, color);
line(screen, &p4, p1, color);
}
<filename>src/client.rs
//! OCI distribution client
//!
//! *Note*: This client is very ... | Rust | 0 |
None,
},
})
.collect::<BinaryHeap<SimpleBattery>>()
.pop();
if let Some(battery) = fullest_battery {
self.notify(&battery);
} else {
self.capacity = None;
}
}
#[allow(clippy::cast_possible_truncation, clippy::... | Rust | 0 |
return None;
}
fn f(
ref_array: &[u8],
alt_array: &[u8],
parameters: Parameters,
overhang_strategy: OverhangStrategy,
) -> Result<(Vec<u8>, isize)> {
if ref_array.len() > super::MAX_SW_SEQUENCE_LENGTH
|| alt... | Rust | 0 |
from floki.workflow import WorkflowApp, workflow, task
from floki.types import DaprWorkflowContext
import logging
@workflow(name='random_workflow')
def task_chain_workflow(ctx:DaprWorkflowContext, input: int):
result1 = yield ctx.call_activity(step1, input=input)
result2 = yield ctx.call_activity(step2, input=... | Python | 1 |
6));
// Automatically generated using command: gendaylit 1 1 13.0 -W 300.0 300.0 -a 47 -o 12 -m 12 -O 1 | tail -n 1 | rcalc -e 'A1=$2; A2=$3; A3=$4; A4=$5; A5=$6; A6=$7; A7=$8; A8=$9; A9=$10; A10=$11; Dx=-0.9912279006826347; Dy=0.0; Dz=0.13216372009101796' -f ./perezlum.cal -o '${intersky}'
let expect... | Rust | 0 |
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
import logging
from apscheduler.schedulers.blocking import BlockingScheduler
from cities.philly.fetch_philly_rss import main as fetch_philly_rss
from sports.cbb.fetch_ncaa_rss import main as fetch_ncaa_rss
from sports.nfl.fetch_pff_r... | Python | 1 |
d_value.clone(),
get_test_command_context()
))
.await
.is_ok());
let BrowserStorageBackend { browser_storage } = backend;
let browser_storage = browser_storage
.read()
.expect("Could not acquire lock for reading");
let d... | Rust | 0 |
import numpy as np
dat = [[3, 5, 7], [2, 9, 3], [1, 9, 4]]
###############################################
# Calculate the mean of each list
# for loop
means = []
for d in dat:
means.append(sum(d) / len(d))
# list comprehension
means = [sum(d) / len(d) for d in dat]
# lambda expression
means = list(map(lambda x... | Python | 1 |
.await
// .unwrap();
// thread::sleep(Duration::from_secs(1));
// cleanup_sqlite(&test_working_dir_path, &EXISTING_DB);
// }
// #[actix_rt::test]
// async fn on_data_import__existing_database_and_new_data__db_is_populated_with_new_data() {}
// }
/*
* Copyright 2019 Cargill Inc... | Rust | 0 |
= y + 1;
}
x = 0; // queen can attack whole row
y = position.y;
// row
while x < board[0].len() {
let pos = Position { x, y };
if x < board[0].len() {
positions.push(pos);
}
x = x + 1;
y = y;
}
positions
}
}
<reponame>chrisk700/Basilisk-node
#![cfg_attr(not(feature = "std"), no_st... | Rust | 0 |
nd Sync.
//
// The reason why QCell<T>'s impl of Sync requires T: Send + Sync
// instead of just T: Sync is that QCell provides interior mutability.
// If you send a &QCell<T> (and its owner) to a different thread, you
// can call .rw() to get a &mut T, and use std::mem::swap() to move
// the T, effectively sending the... | Rust | 0 |
e b" E'"
return self._qprefix + escaped + b"'"
# We don't have a connection, so someone is using us to generate a file
# to use off-line or something like that. PQescapeBytea, like its
# string counterpart, is not predictable whether it will escape
# backslashes.
rv... | Python | 1 |
- b'0' as usize;
if (0..8).contains(&position) && password[position] == '_' {
password[position] = md5.chars().nth(6).unwrap();
count += 1;
}
}
if count == password.len() {
break;
}
}
password.iter().collect()
}
#[c... | Rust | 0 |
"""Command-line interface for unzipall."""
import argparse
import sys
from pathlib import Path
from .core import ArchiveExtractor, ArchiveExtractionError
def main() -> int:
"""Main CLI entry point."""
parser = argparse.ArgumentParser(
description="Universal archive extractor supporting 30+ formats"
... | Python | 1 |
(y_interval))
if y_max is not None:
# 각 bar에 대해 실제 bar top 값이 y_max를 초과하면 텍스트로 실제값을 표시
# (여기서 offset은 y_max 대비 약간의 여백, 필요에 따라 조정)
offset = 0.02 * (y_max - (y_min if y_min is not None else 0))
for patch in ax.patches:
bar_top = patch.get_y() + patch... | Python | 1 |
.map_err(|_e| Error::MnemonicSize)?;
write_keyfiles(
path.as_ref(),
&keyfile_name(i),
&mnemonic,
0,
fog_report_url,
fog_report_id,
fog_authority_spki,
)?;
}
Ok(())
}
/// Read default pubkeys used in... | Rust | 0 |
itor.visit_newtype_struct(self)
}
fn deserialize_enum<V>(
self,
_name: &'static str,
_variants: &'static [&'static str],
visitor: V,
) -> Result<V::Value, Self::Error>
where
V: Visitor<'de>,
{
visitor.visit_enum(EnumAccess { de: self })
}
for... | Rust | 0 |
)
self.platfrom_layout = QVBoxLayout(self.platform_group)
self.platfrom_layout.setObjectName(u"platfrom_layout")
self.filter_container_layout.addWidget(self.platform_group)
self.genre_group = QGroupBox(self.filter_container)
self.genre_group.setObjectName(u"genre_group")
... | Python | 1 |
from serpapi.serp_api_client import *
from serpapi.serp_api_client_exception import SerpApiClientException
class GoogleScholarSearch(SerpApiClient):
"""GoogleScholarSearch enables to search google scholar and parse the result.
```python
from serpapi import GoogleScholarSearch
query = GoogleScholarSearc... | Python | 1 |
import tvm
from functools import reduce
from tvm import auto_scheduler
from tvm.auto_scheduler.cost_model import RandomModel, XGBModel
from tvm.auto_scheduler.search_policy import SketchPolicy
def establish_task_ansor(
schedule_gen, schedule_app,
measure_opt, task_name):
target_dag = schedule_app.targ... | Python | 1 |
from langchain_openai import ChatOpenAI
import os
from typing import Dict, Any
# 基础配置
UNICN_API_KEY = os.environ.get("UNICN_API_KEY", "850cbd86-e83f-42c5-8fbe-96f1e43753ae")
YUANJING_API_KEY = os.environ.get("YUANJING_API_KEY")
# 模型配置字典
MODEL_CONFIGS = {
"unicn": {
"model": "Qwen3-235B-A22B",
"bas... | Python | 1 |
status. for example, using napi3 module in napi7 Node.js, and generate an invalid napi3 status
}
impl Display for Status {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
let status_string = format!("{:?}", self);
write!(f, "{}", status_string)
}
}
impl From<i32> for Status {
fn from(code: i32) -> Sel... | Rust | 0 |
from __future__ import annotations
from typing import TYPE_CHECKING
from ..ruler import StateBase
from ..token import Token
from ..utils import EnvType
if TYPE_CHECKING:
from markdown_it import MarkdownIt
class StateCore(StateBase):
def __init__(
self,
src: str,
md: MarkdownIt,
... | Python | 1 |
,
log_cx: &LogContext,
) -> Result<Vec<Resource>> {
let unix_timestamp = delete_before
.duration_since(SystemTime::UNIX_EPOCH)?
.as_secs();
let mut offset = 0;
let mut delete_resources = vec![];
loop {
match sqlx::query_as::<_, Resource>... | Rust | 0 |
rupt) = cortexm4::nvic::next_pending() {
if !self.interrupt_service.service_interrupt(interrupt) {
panic!("unhandled interrupt, {}", interrupt);
}
let n = cortexm4::nvic::Nvic::new(interrupt);
n.clear_pending();
... | Rust | 0 |
(Debug, PartialEq, Clone)]
pub enum Visibility {
External(Loc),
Public(Loc),
Internal(Loc),
Private(Loc),
}
impl Visibility {
pub fn to_string(&self) -> &'static str {
match self {
Visibility::Public(_) => "public",
Visibility::External(_) => "external",
... | Rust | 0 |
ntained `row` (no proper error handling)
// and second call to `map` will map each `row` to `Payment`
result.map(|x| x.unwrap()).map(|row| {
// ⚠️ Note that from_row will panic if you don't follow your schema
let (customer_id, amount, account_name) = my::from_row(row);
... | Rust | 0 |
st_jar)
else:
kinesis_jar_present = True
jars = "%s,%s,%s,%s,%s" % (kafka_assembly_jar, flume_assembly_jar, mqtt_assembly_jar,
mqtt_test_jar, kinesis_asl_assembly_jar)
os.environ["PYSPARK_SUBMIT_ARGS"] = "--jars %s pyspark-shell" % jars
testcases = [BasicO... | Python | 1 |
/normal
struct Hit {
hit_type: HitType,
pose: Vec3f,
normal: Vec3f,
}
fn ray_marching(ray: Ray) -> Hit {
let mut hit_type = HitType::NoHit;
let mut no_hit_count = 0;
let mut hit_position: Vec3f = Vec3f::ones();
let mut hit_normal: Vec3f = Vec3f::ones();
let mut shortest_distance; // distance from clos... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.