text string | label_name string | labels int64 |
|---|---|---|
stringify!(WindowFunc),
"::",
stringify!(location)
)
);
}
impl Default for WindowFunc {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[doc = " SubscriptingRef: describes a subscripting operation over a container"]
#[doc = " (array, etc... | Rust | 0 |
#!/usr/bin/env python3
"""
Test script for xAI SDK integration
"""
import os
from xai_sdk import Client
from xai_sdk.chat import user, system
def test_xai_integration():
"""Test xAI SDK integration"""
# Check if API key is available
api_key = os.getenv("GROK_API_KEY")
if not api_key:
prin... | Python | 1 |
storage_command(lun, common_cmnd, USB_DIR_IN, datasize)
ret_tag = self.send_mass_storage_command(lun, common_cmnd2, USB_DIR_IN, datasize)
ret_tag += self.send_mass_storage_command(lun, common_cmnd2, USB_DIR_IN, datasize)
if datasize > 0:
data = self.usb.read(datasize, timeout)
... | Python | 1 |
_excluded(&Path::new("README.md")));
}
#[test]
fn test_multiple_ignores() {
let ignores = &["*.rs".into(), "*.toml".into()];
let filter =
NotificationFilter::new(&[], ignores, gitignore::load(&[]), ignore::load(&[])).unwrap();
assert!(filter.is_excluded(&Path::new("hell... | Rust | 0 |
.matrix())
}
#[inline]
unsafe fn from_superset_unchecked(t: &Transform<N2, D, C>) -> Self {
Self::from_superset_unchecked(t.matrix())
}
}
impl<N1, N2, D, R> SubsetOf<MatrixN<N2, DimNameSum<D, U1>>> for Similarity<N1, D, R>
where
N1: RealField,
N2: RealField + SupersetOf<N1>,
R: Rot... | Rust | 0 |
base_mac {
let event = models::events::Event::device_base_mac_changed_event(
&device_fqdn, &device.base_mac, &device_json.base_mac);
if let Ok(ref mut msgbus) = msgbus.lock() {
msgbus.event(event);
}
changed = true;
device.base_... | Rust | 0 |
es: `\"Win32_Graphics_DirectDraw\"`*"]
pub const DDOVERZ_INSERTINFRONTOF: i32 = 4i32;
#[doc = "*Required features: `\"Win32_Graphics_DirectDraw\"`*"]
pub const DDOVERZ_MOVEBACKWARD: i32 = 3i32;
#[doc = "*Required features: `\"Win32_Graphics_DirectDraw\"`*"]
pub const DDOVERZ_MOVEFORWARD: i32 = 2i32;
#[doc = "*Required ... | Rust | 0 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from dora import Explorer
import treetable as tt
class MyExplorer(Explorer):
test_metrics = ['nsdr', 'sdr_med']
... | Python | 1 |
"""
@file main.py
@brief L2マップツールメインモジュール
"""
##@brief L2マップ作成ツールメインモジュール
def main():
import sys
args = sys.argv
if len(args) < 3:
print("引数が不足しています")
print("第1引数:制御データファイル")
print("第2引数:実行リストファイル")
sys.exit(1)
print('********処理開始********')
sysin_file = args... | Python | 1 |
动和疲劳状态具有一定的意义。"""
# 频率域转换
spectrum = fft(signal)
frequency = np.fft.fftfreq(len(signal), 1 / sampling_rate)
# 计算功率谱密度 PSD
power_spectrum_density = np.abs(spectrum) ** 2
# 计算 SM1
SM1 = np.sum(frequency * power_spectrum_density) / np.sum(power_spectrum_density)
# 计算 SM2
deviation = fre... | Python | 1 |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab
import aws_cdk as cdk
from aws_cdk import (
Stack,
aws_iam,
aws_lambda
)
from constructs import Construct
class OpenSearchIndexCreationLambdaStack(Stack):
def __init__(self, scope: Construct, construct_id... | Python | 1 |
b(x_enc)
bias = x
# [B, N, T, D]
if self.channel_independence == '0':
x = self.MLP_channel(x, B, N, T)
# [B, N, T, D]
x = self.MLP_temporal(x, B, N, T)
x = x + bias
x = self.fc(x.reshape(B, N, -1)).permute(0, 2, 1)
return x
def forward(sel... | Python | 1 |
pub mappings: Vec<MappingDefinition>,
}
#[derive(Deserialize, Serialize, Clone)]
pub struct ServerConfig {
pub host: String,
pub port: i32,
}
#[derive(Deserialize, Serialize, Clone)]
pub struct MappingDefinition {
pub name: String,
pub path: String,
pub flags: MappingFlags,
}
#[derive(Deseri... | Rust | 0 |
#!/usr/bin/env python
# Copyright NumFOCUS
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0.txt
#
# Unless required by applicable law or... | Python | 1 |
ecord could not be parsed.
#[error("Failed to parse record")]
ParseError {
source: needletail::errors::ParseError,
},
/// Indicates that the specified output file could not be created.
#[error("Output file could not be created")]
CreateError { source: std::io::Error },
/// Indicate... | Rust | 0 |
import dataclasses
import logging
import os
from pathlib import Path
from typing import Dict
from typing import List
from kloch.launchers import BaseLauncherSerialized
from kloch.launchers import BaseLauncherFields
from ._dataclass import PythonLauncher
LOGGER = logging.getLogger(__name__)
# noinspection PyTypeChec... | Python | 1 |
i32,
SoundData: *const libc::c_void,
AddSampleNum: i32,
) -> i32;
pub fn dx_AddOneDataSoftSoundPlayer(
SSoundPlayerHandle: i32,
Channel1: i32,
Channel2: i32,
) -> i32;
pub fn dx_GetSoftSoundPlayerFormat(
SSoundPlayerHandle: i32,
Channels: *mut i32... | Rust | 0 |
NUM_OBDII_DATA, "OBDII Data".to_string());
global_msg_name_map.insert(GLOBAL_MSG_NUM_NMEA_SENTENCE, "NMEA Sentence".to_string());
global_msg_name_map.insert(GLOBAL_MSG_NUM_AVIATION_ATTITUDE, "Aviation Attitude".to_string());
global_msg_name_map.insert(GLOBAL_MSG_NUM_VIDEO, "Video".to_string());
global_m... | Rust | 0 |
keep: bool,
}
impl Separator {
pub fn new(symbol: char, keep: bool) -> Separator {
Separator { symbol, keep }
}
}
impl PartialEq for Separator {
fn eq(&self, other: &Self) -> bool {
self.symbol == other.symbol
}
}
impl Eq for Separator {... | Rust | 0 |
// # Example
///
/// ```rust
/// # extern crate strum;
/// # #[macro_use] extern crate strum_macros;
/// # use std::fmt::Debug;
/// // You need to bring the type into scope to use it!!!
/// use strum::IntoEnumIterator;
///
/// #[derive(EnumIter,Debug)]
/// enum Color {
/// Red,
/// Green { r... | Rust | 0 |
c_file = dst_file = pair
# os.path.join() only works on relative path components.
# If a component is an absolute path, all previous components are thrown
# away and joining continues from the absolute path component.
# So make sure the file name is not absolute before calling os.path.join().
if sr... | Python | 1 |
#[inline(always)]
fn default_read_16(&mut self, addr: Addr) -> u16 {
self.read_8(addr) as u16 | (self.read_8(addr + 1) as u16) << 8
}
fn read_8(&mut self, addr: Addr) -> u8;
fn write_32(&mut self, addr: Addr, value: u32) {
self.write_16(addr, (value & 0xffff) as u16);
sel... | Rust | 0 |
s=30, duration_sec=2, synched_time=True)
# Set up
nc.login()
nc.connect_robot(config.robot_name)
nc.create_dataset(config.dataset_name)
segments = 3
total_frames = 0
for segment in range(segments):
logger.info(f"Starting recording segment {segment+1}/{segments}")
with Time... | Python | 1 |
ops.set_hint_max_ts(Bound::Included(10));
assert_eq!(ops.hint_min_ts(), Some(1));
assert_eq!(ops.hint_max_ts(), Some(10));
ops.set_hint_min_ts(Bound::Excluded(1));
ops.set_hint_max_ts(Bound::Excluded(10));
assert_eq!(ops.hint_min_ts(), Some(2));
assert_eq!(ops.h... | Rust | 0 |
k."""
return self.stock_units > 0
@property
def stock_packets(self):
"""Return inventory level in 'packs:units' format."""
packs = self.stock_units // self.medicine.units_per_pack
units = self.stock_units % self.medicine.units_per_pack
return f"{packs}:{units}"
... | Python | 1 |
:Formatter) -> fmt::Result {
let strrepr = match self {
ErrorKind::Cancelled => "Cancelled".to_owned(),
ErrorKind::Weird => "Weird".to_owned(),
ErrorKind::Serialization => "Serialization".to_owned(),
};
write!(f, "{}", strrepr)
}
}
impl fmt::Display for ... | Rust | 0 |
_item(idx))
// }
// }
// impl<T> Query for Option<&mut T>
// where
// T: Component,
// {
// type Fetch = Option<FetchWrite<T>>;
// #[inline]
// fn mutates() -> bool {
// true
// }
// #[inline]
// unsafe fn fetch(
// archetype: &Archetype,
// track: u64,
// ... | Rust | 0 |
t_id = 10
nsplits = 0
save_dir = '/workspace/idcard_bjxj_mtcnn_aligned'
print(sys.argv)
if len(sys.argv) > 1:
nsplits = int(sys.argv[1])
if len(sys.argv) > 2:
split_id = int(sys.argv[2])
if len(sys.argv) > 3:
list_fn = sys.argv[3]
if len(sys.argv) > 4:
im... | Python | 1 |
BracketRcContext<'input>) { }
/**
* Exit a parse tree produced by {@link CqlParser#syntaxBracketRc}.
* @param ctx the parse tree
*/
fn exit_syntaxBracketRc(&mut self, _ctx: &SyntaxBracketRcContext<'input>) { }
/**
* Enter a parse tree produced by {@link CqlParser#syntaxBracketLa}.
* @param ctx the parse tree
*/
... | Rust | 0 |
oatingbutton")
r("MDFloatingLabel", module="kivymd.uix.stackfloatingbutton")
r("MDFloatingLabel", module="kivymd.uix.tab")
r("MDTabsLabel", module="kivymd.uix.tab")
r("MDTabsBase", module="kivymd.uix.tab")
r("MDTabsMain", module="kivymd.uix.tab")
r("MDTabsCarousel", module="kivymd.uix.tab")
r("MDTabsScrollView", module... | Python | 1 |
}
} else {
Some((last >> 32) as u32)
}
}
None => None,
}
}
}
#[cfg(u64_digit)]
impl ExactSizeIterator for U32Digits<'_> {
#[inline]
fn len(&self) -> usize {
self.data.len() * 2 - usize::from(self.last_hi_is_zero... | Rust | 0 |
import os
print(" OpenAI Key:", os.getenv("OPENAI_API_KEY"))
print(" SERPAPI", os.getenv("SERPAPI_API_KEY"))
| Python | 1 |
=======================
// === Compound Shapes ===
// =======================
pub use immutable::*;
define_modifiers! {
Translate translate (child) (v:Vector2<Pixels>)
Rotation rotation (child) (angle:Radians)
Scale scale (child) (value:f32)
Union... | Rust | 0 |
#!/usr/bin/python3
# Run this to create pictures to create animated gifs for the first five
# hilbert order curves and linear and snake pictures as a bonus
#
# In the end, I only used one of them in the documentation (hilbert 5)
import heatmap
import os
size = 8
white = b'\xff'
def dump_grid(filename, grid, scale,... | Python | 1 |
1%)}\
\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\
\n \'\
\n input.scss 1:7 root stylesheet",
);
}
<gh_stars>0
enum InstrType {
FORWARD,
UP,
DOWN,
}
struct Instruction {
op: InstrType,
value: u32,
}
fn parse_instruction(instr_txt: &str) -> Inst... | Rust | 0 |
import numpy as np
import string
file = open("input.txt", 'r')
Lines = file.readlines()
#Problem 1
common_list = []
for line in Lines:
linelen = len(line)
word1 = line[0:linelen//2]
word2 = line[linelen//2:linelen]
temp = []
for s in word1:
for c in word2:
if s == c:
... | Python | 1 |
impl<T: Serialize<S>, S: Serializer + ?Sized> SerializeUnsized<S> for T {
#[inline]
fn serialize_unsized(&self, serializer: &mut S) -> Result<usize, S::Error> {
serializer.serialize_value(self)
}
#[inline]
fn serialize_metadata(&self, _: &mut S) -> Result<(), S::Error> {
Ok(())
... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright 2016-2025 The pyXem developers
#
# This file is part of pyXem.
#
# pyXem 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, either version 3 of the License, or
# (at your optio... | Python | 1 |
- Show OAuth statistics")
sys.exit(1)
command = sys.argv[1]
try:
if command == "list-registrations":
await list_registrations()
elif command == "list-tokens":
await list_tokens()
elif command == "delete-registration":
if len(s... | Python | 1 |
.into();
let create_single_idx_config = Some(CreateSingleIndexConfig {
bone_influences_per_vertex: None,
calculate_face_tangents: true,
..CreateSingleIndexConfig::default()
});
CombineIndicesTest {
mesh_to_combine,
expected_combined_m... | Rust | 0 |
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from source_weatherstack.run import run
if __name__ == "__main__":
run()
| Python | 1 |
import json
import os
CONFIG_FILE = "config.json"
# Ak súbor neexistuje, vytvor prázdny
if not os.path.exists(CONFIG_FILE):
with open(CONFIG_FILE, "w") as f:
json.dump({}, f, indent=4)
def load_config():
with open(CONFIG_FILE, "r", encoding="utf-8") as f:
return json.load(f) | Python | 1 |
d_prompt += "<|assistant|>\n"
# Generate with parameters
response_stream = llm(
formatted_prompt,
max_tokens=512,
stop=["<|end|>", "== END OF GENERATION =="],
stream=True,
temperature=0.3,
top_p=0.85,
top_k=30,
... | Python | 1 |
# modules/data_loader.py
import pandas as pd
import os
import streamlit as st
@st.cache_data
def load_csv(filepath):
df = pd.read_csv(filepath, parse_dates=["Reference Period", "Release Date"])
df["Surprise"] = df["Actual"] - df["Median_Forecast"]
return df
def load_data(config):
df_target = load_csv... | Python | 1 |
}
s.truncate(0);
}
}
if s.len() > 0 {
if !set.contains(&s) {
ans += 1;
}
}
ans
}
}
<filename>datanymizer_engine/src/transformers/phone/transformer.rs
use super::deserialize_phone_format;
use super::phone_format::Phon... | Rust | 0 |
Some(obj), Some(cls), vm).map(Self::Attribute);
}
}
descr_get
};
drop(descr_cls);
Some((descr, descr_get))
}
None => None,
};
if let Some(dict) = obj.dict() {
... | Rust | 0 |
l.encoder, True, False)
if freeze_encoder:
set_trainable(model.encoder, trainable=False, freeze_bn=False)
optimizer = get_optimizer(optimizer_name, get_optimizable_parameters(model),
learning_rate=learning_rate,
weight_deca... | Python | 1 |
import json
def create_history(func):
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except FileNotFoundError:
with open('history.json', 'w', encoding='utf-8') as f:
json.dump([], f, ensure_ascii=False, indent=4)
return func(*arg... | Python | 1 |
import logging
import random
from datetime import datetime, timedelta, timezone
from typing import Any
from app.config import settings
from app.core.configs.enums import (
ExerciseType,
LanguageLevel,
UserAction,
)
from app.core.configs.generation.config import ExerciseTopic
from app.core.configs.texts imp... | Python | 1 |
am func: the function to evaluate.
:param inputs: the argument sequence to pass to `func`.
:param params: a sequence of parameters `func` depends on but does not
explicitly take as arguments.
:param flag: if False, disable gradient checkpointing.
"""
if flag:
args = tuple(... | Python | 1 |
SwitchKey, VerifyKey};
pub use key_establishment::KeyEstablishment;
pub use transport_key::TransportKey;
pub use tunnel::Tunnel;
extended_enum!(
// 4.4.9 Command Frames
/// Application services command identifiers
CommandIdentifier, u8,
/// Key establishment stage one command identifier
SymmetricK... | Rust | 0 |
9, amtdop7x5ex
def risprg39e67(wgy4pb66y49=0.0, ggf9pz0xs80=b''):
global b2netk1u0oe
return
vvpm2z4tlnc *= 0
import bhfloz297u2 as xevgy35u17z, mc_f15vitwm
'# hatchet_canister_header -> machines_battleships_unions'
pkak963bfn1
(gto6i9en9ro): puaojp0mvj9 = None
pass
assert 0.0
non... | Python | 1 |
BiDiMode(AObj: usize) -> TBiDiMode;
pub fn Panel_SetBiDiMode(AObj: usize, AValue: TBiDiMode);
pub fn Panel_GetBorderWidth(AObj: usize) -> i32;
pub fn Panel_SetBorderWidth(AObj: usize, AValue: i32);
pub fn Panel_GetBorderStyle(AObj: usize) -> TBorderStyle;
pub fn Panel_SetBorderStyle(AObj: usize, AValue: TBord... | Rust | 0 |
2, MeshIndex: i32) -> i32;
pub fn dx_MV1GetMeshMaxPosition(MHandle: i32, MeshIndex: i32) -> Vector;
pub fn dx_MV1GetMeshMinPosition(MHandle: i32, MeshIndex: i32) -> Vector;
pub fn dx_MV1GetMeshTListNum(MHandle: i32, MeshIndex: i32) -> i32;
pub fn dx_MV1GetMeshTList(MHandle: i32, MeshIndex: i32, Index: i... | Rust | 0 |
from fastapi import Security, Depends, HTTPException, status
from sqlalchemy.orm import Session
from fastapi.security import OAuth2PasswordBearer
from typing import Optional
from datetime import datetime, timedelta, timezone
from jose import jwt, JWTError
import secrets
from DB.database import get_db
from DB.db_user i... | Python | 1 |
13, // b
0xFF, 0xFF, // alignment
0x01, 0x00, 0x00, 0x00, // version
0x00, 0x22, 0x44, 0x66, 0x88, 0xAA, 0xCC, 0xEE, // extra_features
];
let (s, len) = Struct::parse((), &stable_bytes).unwrap();
assert_eq!(len, 20);
assert_eq!(
s,
... | Rust | 0 |
import unittest
from modules.odota_position_normaliser import ODOTAPositionNormaliser
MOCK_DATA_ONE = ([{ 'hero_id': 58, 'neutral_kills': 9, 'lane_role': 1 },
{ 'hero_id': 65, 'neutral_kills': 43, 'lane_role': 2 },
{ 'hero_id': 94, 'neutral_kills': 112, 'lane_role': 1 },
... | Python | 1 |
00000000010140d43a99926d43eb0e619bf0b3d83b4a31f60c176beecfb9d35bf45e54d0f7420100000017160014a4b4ca48de0b3fffc15404a1acdc8dbaae226955ffffffff0100e1f5050000000017a9144a1154d50b03292b3024370901711946cb7cccc387024830450221008604ef8f6d8afa892dee0f31259b6ce02dd70c545cfcfed8148179971876c54a022076d771d6e91bed212783c9b06e0de600... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
import mpmath
from scipy.ndimage import label
def compute_num(S):
structure = np.array([[0,1,0],
[1,1,1],
[0,1,0]])
labeled, num_features = label(S, structure=structure)
sizes = np.bincount(labeled.rav... | Python | 1 |
class Solution:
def setZeroes(self, matrix: List[List[int]]) -> None:
"""
Do not return anything, modify matrix in-place instead.
"""
if not matrix or not matrix[0]:
return
rs, cs = len(matrix), len(matrix[0])
frz = any(matrix[0][j] == 0 for j in ... | Python | 1 |
multicast locator is present but none found.");
// TODO: Convert the above error to warning only.
} else {
self.multicast_reply_locator_list.clear();
}
}
InterpreterSubmessage::InfoDestination(info_dest, _flags) => {
if info_dest.guid_prefix == GUID::GUID_UNKNOWN.p... | Rust | 0 |
, lit)| ByteCode::ConstHigh16(reg, lit)),
Ok(0x16) => self
.format21s()
.ok()
.map(|(reg, lit)| ByteCode::ConstWide16(reg, i64::from(lit))),
Ok(0x17) => self
.format31i()
.ok()
.map(|(reg, lit)| ByteC... | Rust | 0 |
.sum(alpha, dim=1, keepdim=True)
_, preds = torch.max(output, 1)
classifications.append(selected_classes[preds[0].item()])
lu.append(uncertainty.mean().detach().cpu().numpy())
scores += prob.detach().cpu().numpy() >= threshold
l_std_dev.append(std_dev)
lp.append(prob.cpu... | Python | 1 |
};
let mut highest_position = 0;
let drag_effect = - initial_velocity[0].signum();
loop {
state.position[0] += state.velocity[0];
state.position[1] += state.velocity[1];
if state.velocity[0] != 0 {
state.velocity[0] += drag_effect;
... | Rust | 0 |
roids", glfw::WindowMode::Windowed)
.expect("Failed to create GLFW window.");
window.set_key_polling(true);
// It is essential to make the context current before calling `gl::load_with`.
window.make_current();
// Load the OpenGL function pointers
// gl::load_with(|s| glfw.get_proc_address(... | Rust | 0 |
f::Target {
&self.0
}
}
#[doc = "Field `EDREQ_2` writer - Enable asynchronous DMA request in stop mode for channel 2."]
pub struct EDREQ_2_W<'a> {
w: &'a mut W,
}
impl<'a> EDREQ_2_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: EDREQ_2_A) -> ... | Rust | 0 |
:Base(REG_SP, offset_dtn + DoraToNativeInfo::pc_offset()),
REG_TMP1.into(),
);
self.masm.store_mem(
MachineMode::Ptr,
Mem::Base(REG_THREAD, ThreadLocalData::dtn_offset()),
REG_SP.into(),
);
self.masm.copy_sp(REG_PARAMS[0]);
self.m... | Rust | 0 |
::path::Path::new(file!()).file_name().unwrap().to_string_lossy();
let input_sizes = sum!($($args)*);
solana_program::msg!("input sizes {}", input_sizes);
if input_sizes > 512 {
// slow path
solana_program::msg!("{}", format!("'{}', '{}:{}", format!($($args)*), file_name,... | Rust | 0 |
CollectionKind::Unknown,
vec![Record::Int(BigInt::from(0)), Record::Int(BigInt::from(1))]
)),
Ok(BTreeSet::from_iter(vec![0, 1]))
);
let mut v = <BTreeSet<u32>>::from_record(&Record::Array(
CollectionKind::Unknown,
vec![Record::Int(BigInt::from(... | Rust | 0 |
from orchestrator.config_loader import load_config
from agents.risk import RiskGuard
def test_risk_guard_limits_ok(tmp_path):
cfg = load_config("/app/config/config.json")
rg = RiskGuard(cfg)
status = rg.evaluate_proposed_trade(
{
"proposed_risk_pct": 0.05,
"portfolio_risk_p... | Python | 1 |
ed &= change;
} else {
seat_container.seats[*idx].occupied |= change;
}
});
}
Err("failed to find stable state after 100,000 iterations".to_owned())
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_parse_input() ... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2022 Google LLC. 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 requir... | Python | 1 |
pc;
trace!("Loading opcode at {:#6X}", pc);
let opcode = Operand8::Immediate.read(ctx);
let opcode = Self::decode(opcode);
debug!("Executing @ {:#6X}: {}", pc, opcode);
opcode.execute(ctx);
}
/// Execute this opcode on the given context.
fn execute(self, ctx: &mut im... | Rust | 0 |
_GAINHF?;
efx.AL_EAXREVERB_GAINLF?;
efx.AL_EAXREVERB_DECAY_TIME?;
efx.AL_EAXREVERB_DECAY_HFRATIO?;
efx.AL_EAXREVERB_DECAY_LFRATIO?;
efx.AL_EAXREVERB_REFLECTIONS_GAIN?;
efx.AL_EAXREVERB_REFLECTIONS_DELAY?;
efx.AL_EAXREVERB_REFLECTIONS_PA... | Rust | 0 |
import torch
import torch.utils.checkpoint
from torch import nn
class MultiwayNetwork(nn.Module):
def __init__(self, module_provider, num_multiway=2, out_features=None):
super(MultiwayNetwork, self).__init__()
self.multiway = torch.nn.ModuleList([module_provider() for _ in range(num_multiway)])... | Python | 1 |
(f"尝试手动跟随重定向: {redirect_url}")
# 如果重定向URL是相对路径,转换为绝对URL
if not redirect_url.startswith('http'):
redirect_url = f"{base_url.rstrip('/')}/{redirect_url.lstrip('/')}"
# 发送新请求
response = await client.... | Python | 1 |
# Calculate the vector-quantizer loss.
# loss - torch.float32
loss = self.loss(Z_e, Z_q)
# Re-parameterize `Z_q` to allow gradients to flow back to other layers.
Z_q = Z_e + (Z_q - Z_e).detach()
# Calculate perplexity to measure the codex usage.
# perplexity - torch... | Python | 1 |
| Model::RaspberryPi3APlus
| Model::RaspberryPi3B
| Model::RaspberryPi3BPlus
| Model::RaspberryPi4B
| Model::RaspberryPiZero
| Model::RaspberryPiZeroW => print_header(&HEADER[..MAX_PINS_LONG]),
model => {
eprintln!("Error: No GPIO header information available ... | Rust | 0 |
displays base units.
///
/// The scalar is attached using the full crate path, so it does not need to be in scope for this
/// macro to be used.
#[macro_export]
macro_rules! view
{
( $u:expr ) => {
$u.display_base()
};
( $u:expr, $prefix:ident ) => {
$u.display::<$crate::units::scalar::$pref... | Rust | 0 |
();
out.write_all(buf.as_ref())?;
Ok(())
}
fn patch_lib_kind_in_target(ws: &mut Workspace, libkinds: &[&str]) -> anyhow::Result<()> {
use cargo::core::LibKind::*;
let pkg = ws.current_mut()?;
let manifest = pkg.manifest_mut();
let targets = manifest.targets_mut();
let kinds: Vec<_> = li... | Rust | 0 |
BNAIL: u32 = 17u32;
#[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServicing'*"]
pub const PID_TITLE: u32 = 2u32;
#[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServicing'*"]
pub const PID_WORDCOUNT: u32 = 15u32;
#[doc = "*Required features: 'Win32_System_ApplicationInstallat... | Rust | 0 |
),
min_timestamp: Utc.timestamp_nanos(1),
max_timestamp: Utc.timestamp_nanos(340),
row_count: 21
},
WriteSummary {
time_of_first_write: created_at_time
+ closed_duration
... | Rust | 0 |
import os
from unittest.mock import patch
from scanners.zap.zap_none import ZapNone
@patch("os.path.exists")
@patch("scanners.zap.zap.shutil.copy")
@patch("scanners.zap.zap.shutil.copytree")
@patch("scanners.zap.zap.tarfile")
def test_zap_none_postprocess_copy_site_tree_path(mock_tarfile, mock_copytree, mock_copy, m... | Python | 1 |
=> x.id,
AnyNode::Expr(x) => x.id,
AnyNode::Pat(x) => x.id,
AnyNode::Ty(x) => x.id,
AnyNode::Param(x) => x.id,
AnyNode::Field(x) => x.id,
}
}
pub fn vis(&self) -> Option<&'ast Visibility> {
match *self {
AnyNode::Item(i) =>... | Rust | 0 |
schema: String,
}
impl Convert {
fn run(&self) -> Result<(), Box<Error>> {
let schema = kobuta::schema::parse(&self.schema)?;
if self.input.ends_with(".csv") && self.output.ends_with(".kbt") {
return self.from_csv(&schema, self.has_headers);
}
if self.input.ends_with("... | Rust | 0 |
"""test_cmd_fileDownlink.py:
Test the command FileDownlink with basic integration tests.
fileDownlink.SendFile
fileDownlink.SendPartial
fileDownlink.Cancel
"""
def test_send_fileDownlink_command(fprime_test_api):
"""Test that commands may be sent
Tests command send, dispatch, and receipt using... | Python | 1 |
nError(#[from] serde_json::Error),
/// Any other errors that are too trivial to be put here explicitly.
#[error(transparent)]
Other(#[from] anyhow::Error),
}
impl From<ConnectorXPythonError> for PyErr {
fn from(e: ConnectorXPythonError) -> PyErr {
PyRuntimeError::new_err(format!("{}", e))
... | Rust | 0 |
vert_btn = QPushButton("🔄 转换")
convert_btn.setStyleSheet("""
QPushButton {
background-color: #E5E7EB;
color: #715D46;
padding: 8px 16px;
border-radius: 8px;
font-weight: bold;
}
""")
... | Python | 1 |
let nns_init_payload = nns_builder.build();
let nns_canisters = NnsCanisters::set_up(&runtime, nns_init_payload).await;
//
// Execute operations to be tested
//
// The balance of the main account should be 0.
let user_balance: Tokens = nns_canisters
.led... | Rust | 0 |
ece as usize] ^= square(sq);
color_bb[color] ^= square(sq);
}
#[inline(always)]
pub fn toggle_hash(piece: PieceType, square: u8, color: usize, hash: &mut u64) {
*hash ^= piece.to_zobrist_key(color, square as usize);
}
#[inline(always)]
pub fn enpassant_hash(old: u64, new: u64, hash: &mut u64) {
if old != 0... | Rust | 0 |
# Adagios is a web based Nagios configuration interface
#
# Copyright (C) 2014, Pall Sigurdsson <palli@opensource.is>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of... | Python | 1 |
_span),
RawToken::String(span) => hir::Expression::string(span, token_span),
})
})
}
}
impl FallibleColorSyntax for IntShape {
type Info = ();
type Input = ();
fn color_syntax<'a, 'b>(
&self,
_input: &(),
token_nodes: &'b mut TokensIterator<'... | Rust | 0 |
roxy) -> Result<Option<String>, Error> {
let children = files_async::readdir(&dir_proxy).await?;
let (channel, remote) = zx::Channel::create()?;
dir_proxy
.clone(fio::OpenFlags::CLONE_SAME_RIGHTS, fidl::endpoints::ServerEnd::new(remote))?;
for entry in children.iter() {
... | Rust | 0 |
)),
"-h" => Ok(RunCommand::Help(exec_path)),
"run" => Ok(RunCommand::Run(exec_path, parse_config_opts(args)?)),
"config" => Ok(RunCommand::ShowConfig(exec_path, parse_config_opts(args)?)),
x => Err(format!(
"Unknown subcommand: `{}`. Use `help` to see a list of available opti... | Rust | 0 |
pe("category")
result = cat.astype(str)
tm.assert_frame_equal(result, expected)
class IntegerArrayNoCopy(pd.core.arrays.IntegerArray):
# GH 42501
@classmethod
def _from_sequence(cls, scalars, *, dtype=None, copy=False):
values, mask = coerce_to_array(scalars, dtype=dtype, copy=cop... | Python | 1 |
新浪体育"
},
{
"name": "白胖浪浪",
"symbolSize": 5,
"draggable": "False",
"value": 0,
"category": "新浪体育"
},
{
"name": "美丽居曹亮",
"symbolSize": 5,
"draggable": "False",
"value": 0,
... | Python | 1 |
01 responses, anything else we want to just
# pass through the actual response
if resp.status_code != 401:
return resp
# We are not able to prompt the user so simply return the response
if not self.prompting:
return resp
parsed = urllib_parse.urlparse(... | Python | 1 |
import os
import pygame
from pydub import AudioSegment
from pydub.generators import Sine
# 定义音符频率
notes_freq = {
'1': 261.63, # C4
'2': 293.66, # D4
'3': 329.63, # E4
'4': 349.23, # F4
'5': 392.00, # G4
'6': 440.00, # A4
'7': 493.88, # B4
'8': 523.25, # C5
'9': 587.33, # D5... | Python | 1 |
def PatternCount(text, pattern):
len_text = len(text)
len_pattern = len(pattern)
count = 0
for i in range(len_text-len_pattern):
if(text[i:i+len_pattern] == pattern):
count = count +1
return count
txt = "CTTCAGGTCTTTCAGGTCTTCAGGTCCTCAGGTCCGCTCAGGTCTCAGGTCTCAGGTCTATCTCAGGTCTAATC... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import new_test_user, tagged
from odoo.addons.im_livechat.tests.common import TestImLivechatCommon
@tagged("-at_install", "post_install")
class TestImLivechatSessionHistory(TestImLivechatCommon):
def test_session_history_n... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.