text string | label_name string | labels int64 |
|---|---|---|
n
# Does the pattern match the fully qualified class name?
for pattern in self.patterns:
full_class_name = '{}.{}'.format(
event.testCase.__module__, event.testCase.__name__)
if re.search(pattern, full_class_name):
# Don't suppress this test class.... | Python | 1 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
::*;
use crate::vtable::VTable;
use dync_derive::dync_trait_method;
use std::fmt;
use std::hash::{Hash, Hasher};
use std::mem::{ManuallyDrop, MaybeUninit};
pub trait DropBytes {
#[doc(hidden)]
unsafe fn drop_bytes(bytes: &mut [MaybeUninit<u8>]);
}
pub trait CloneBytes: Clone {
#[dync_trait_method]
fn ... | Rust | 0 |
# Copyright 2025 The Marin Authors
#
# 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
#
# Unless required by applicable law or agreed to in wr... | Python | 1 |
Event::MouseLeave => {
event_state.pressed_mouse_buttons.clear();
}
Event::PointerLocked => {
event_state.pointer_locked = true;
}
Event::PointerUnlocked => {
... | Rust | 0 |
possible_hexes.push(hex.clone())
}
pub fn get_rotated_hex_at_coord(&self, coord: hex2d::Coordinate, hex: Hex) -> Option<Hex> {
let hex = hex;
let possible = self.get(coord)?;
let rotations = possible.get_matching_rotations(&hex.sides);
Some(rotations.get(0).unwrap().clone())
... | Rust | 0 |
CallFrozenGenericImpl<F, A> {
type Pop<'v> = ();
type Push<'v> = Value<'v>;
type Arg = (F, A, FrozenRef<'static, FrozenFileSpan>);
#[inline(always)]
fn run_with_args<'v>(
eval: &mut Evaluator<'v, '_>,
stack: &mut BcStackPtr<'v, '_>,
_ip: BcPtrAddr,
(fun, args, span):... | Rust | 0 |
total_files = len(job.results)
results_text += f"📈 <b>סטטיסטיקות:</b>\n"
results_text += f" • סה״כ קבצים: <b>{total_files}</b>\n"
results_text += f" • ✅ עברו בהצלחה: <b>{len(successful_files)}</b>\n"
results_text += f" • ❌ נכשלו: <b>{len(failed_files)}</b>\n\... | Python | 1 |
p_h: int):
"""处理触摸事件并更新开关状态。
Args:
x (int): 触摸点的 X 坐标。
y (int): 触摸点的 Y 坐标。
pressed (bool | int): 触摸屏是否被按下。
img_w (int): 图像缓冲区的宽度。
img_h (int): 图像缓冲区的高度。
disp_w (int): 显示屏的宽度。
disp_h (int): 显示屏的高度。
"""
se... | Python | 1 |
(
np.log(cpi["CPIAUCSL"].resample("QS").mean()).diff().iloc[1:], 0.95,
10 * 4)
# After constructing the moving averages using the $\beta = 0.95$ filter
# of Lucas (with a window of 10 years on either side), we plot each of the
# series below. Although they appear to move together prior for part of the
# sample... | Python | 1 |
import sys
sys.stdin = open('input.txt', 'r')
testcase = int(input())
def getSum(a, b):
Sum = 0
for i in range(M):
for j in range(M):
Sum += ai[i + a][j + b]
return Sum
for i in range(1, testcase + 1):
N, M = map(int, input().split())
ai = [list(map(int, input().split())) f... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, _
from odoo.fields import Domain
class ProductTemplate(models.Model):
_inherit = "product.template"
l10n_br_pos_warning = fields.Text("Brazilian POS Warning", compute="_compute_l10n_br_pos_warning... | Python | 1 |
the renderer
var render = new dagreD3.render();
// Run the renderer. This is what draws the final graph.
render(inner, g);
// Center the graph
var initialScale = 0.75;
svg.call(zoom.transform, d3.zoomIdentity.translate(
(svg.attr("width")-g.graph().width*in... | Python | 1 |
# Copyright (c) OpenMMLab. All rights reserved.
import copy
from typing import Dict
import torch.nn as nn
from mmrazor.models.mutators import ChannelMutator
from .ops import ExpandableMixin
from .unit import ExpandableUnit
def to_expandable_model(model: nn.Module) -> ChannelMutator[ExpandableUnit]:
"""Convert a... | Python | 1 |
r Rating', 'Texture Rating', 'Overall Rating'], kind='line', figsize=(12,10))
#can also add title, grid, legend, style, change 'labels'...
#'subplots = True' gives SEPARATE PLOTS for EACH 'y' Variable:
df.plot(x='Date', y=['Flavor Rating', 'Texture Rating', 'Overall Rating'], subplots=True, kind='line')
#Adding T... | Python | 1 |
or, name, input);
assert_eq!(output.map(|token| token.to_owned()), actual_output)
}
pub fn call_function(
&self,
executor: &mut Executor,
name: &str,
input: &[ethabi::Token],
) -> Option<ethabi::Token> {
let function = &self.abi.functions[name][0];
m... | Rust | 0 |
#!/usr/bin/env python3
"""
HOUSELYTICS - House Price Prediction Web Application
A sophisticated web interface with silent colors and advanced visualizations
"""
from flask import Flask, render_template, request, jsonify, session
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_spli... | Python | 1 |
def state_after_iterations(n):
happy = n
sad = 0
for _ in range(3):
new_happy = 0.3 * happy + 0.5 * sad
new_sad = 0.7 * happy + 0.5 * sad
happy = new_happy
sad = new_sad
return int(round(happy)), int(round(sad))
n = int(input())
happy_count, sad_count = state_... | Python | 1 |
)
} else if args.cmd_print_cfg {
print_cfg::run(&args.arg_file)
} else if args.cmd_compile {
compile::run(
args.arg_file,
args.flag_print,
&args.flag_set,
&args.flag_target,
)
} else if args.cmd_wasm {
#[cfg(feature = "wasm")]
... | Rust | 0 |
id3v2;
///
/// let mut tag = id3v2::Tag::new();
///
/// tag.add_txxx("key1", "value1");
/// tag.add_txxx("key2", "value2");
///
/// assert_eq!(tag.txxx().len(), 2);
/// assert!(tag.txxx().contains(&("key1".to_owned(), "value1".to_owned())));
/// assert!(tag.txxx().contains(&("key2".t... | Rust | 0 |
# Copyright 2021 Agnostiq Inc.
#
# This file is part of Covalent.
#
# Licensed under the Apache License 2.0 (the "License"). A copy of the
# License may be obtained with this software package or at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Use of this file is prohibited except in compliance with the Licen... | Python | 1 |
e56511e8cce752944d920bd6b9a536381a9628b
if "mensual" in plan_raw:
plan = "mensual"
elif "trimestral" in plan_raw:
plan = "trimestral"
elif "anual" in plan_raw:
plan = "anual"
else:
plan = ""
<<<<<<< HEAD
=======
>>>>>>> 5e56511e8cce752944d... | Python | 1 |
(),
_ => panic!("too many intersections"),
};
self.turn += 1;
}
let CartPosition { x, y } = self.position;
let (nx, ny) = match self.facing {
Direction::Down => (x, y + 1),
Direction::Up => (x, y - 1),
Direction::Left =... | Rust | 0 |
formatter.write_str("ristretto")
}
fn visit_str<E: de::Error>(self, s: &str) -> Result<RistrettoScalar, E> {
let v = BigInt::from_str_radix(s, 16).expect("Failed in serde");
Ok(ECScalar::from(&v))
}
}
impl PartialEq for RistrettoScalar {
fn eq(&self, other: &RistrettoScalar) -> bool {
... | Rust | 0 |
#! /usr/bin/env python
# '''
# Wolfinch Auto trading Bot
# Desc: exchange interactions Simulation
# Copyright: (c) 2017-2020 Joshith Rayaroth Koderi
# This file is part of Wolfinch.
#
# Wolfinch is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | Python | 1 |
svs, list) and len(args.scores_csvs) == 1:
args.scores_csvs = args.scores_csvs[0]
args.title_line = not args.no_title_line
args_to_remove = {"no_title_line"}
if args.metric != "ei" or args.metric != "pi":
args_to_remove.add("xi")
if args.metric != "ucb":
args_to_remove.add("be... | Python | 1 |
import pytest
from fastapi import status
from fastapi.testclient import TestClient
from sqlalchemy.orm import Session
from src.clean_python.main import app
client = TestClient(app)
@pytest.mark.asyncio
async def test_create_character(sqlite_session: Session) -> None:
"""Test creating a new Bloodborne character.... | Python | 1 |
const FromUnchecked<PathSegment<'a>> for NonEmptyPathSegment<'a>
{
#[inline(always)]
unsafe fn from_unchecked(value: PathSegment<'a>) -> Self
{
transmute(value)
}
}
impl<'a> const TryFrom<PathSegment<'a>> for NonEmptyPathSegment<'a>
{
type Error = PathSegment<'a>;
#[inline(always)]
fn try_from(value: PathS... | Rust | 0 |
with open("arquivo.txt", "w") as arquivo:
arquivo.write("Escrevendo no arquivo!")
with open("arquivo.txt", "r") as arquivo:
conteudo = arquivo.read()
print(conteudo)
| Python | 1 |
_indexes.repeat(1, 1, memory_mask.size(-1)), valid_flag) # (B_n, HW, 1) 将fined query给标记
memory_mask = memory_mask.permute(0, 2, 1).reshape(memory_mask.shape[0], 1, H, W) # (B_n, 1, H, W)
""" # 所有single先卡置信度阈值, 得到筛选后的结果 因此需要返回一个索引 能从query_num中索引出筛选后的query
# filter_bbox: [(n1,8), (n2,8) ...], f... | Python | 1 |
fields = [s.strip().replace(':', '') for s in response.css('div#info span.pl::text').extract()]
# 提取所有字段的值
values = [re.sub('\s+', '', s.strip()) for s in re.split('\s*(?:%s):\s*' % '|'.join(fields), info)][1:]
# 处理列名称
for i in range(len(fields)):
if '导演' == fields[i]:
... | Python | 1 |
gpioa::*;
use hal::gpio::gpiob::*;
use hal::gpio::gpioc::*;
use hal::spi::Spi;
use hal::stm32f30x;
use hal::cortex_m;
extern crate mpu9250;
use mpu9250::Mpu9250;
pub mod write;
type Led = PC15<Output<PushPull>>;
type BoardSpi = Spi<stm32f30x::SPI1, (PB3<AF5>, PB4<AF5>, PB5<AF5>)>;
type BoardSpiNss = PA15<Output<Pus... | Rust | 0 |
SE
ATOM 2 SE SUB 2 -28.543 -78.848 -28.830 0.96 0.00 SE
ATOM 3 SE SUB 3 -6.147 -3.557 -53.677 0.87 0.00 SE
ATOM 4 SE SUB 4 -4.949 -0.129 -55.688 0.84 0.00 SE
ATOM 5 SE SUB 5 -2.374 -4.774 -71.923 0.84 0.00 SE
A... | Python | 1 |
import sys, os, signal, tarfile
vgosdb_dirs = [ \
"Apriori", \
"CrossReference", \
"Head.nc", \
"History", \
"ObsCalTheo", \
"ObsDerived", \
"ObsEdit", \
"ObsPart", \
... | Python | 1 |
VarLenType::BigVarChar => ColumnData::String(None),
VarLenType::BigBinary => ColumnData::Binary(None),
VarLenType::BigChar => ColumnData::String(None),
VarLenType::NVarchar => ColumnData::String(None),
VarLenType::NChar => ColumnData::String(None),
... | Rust | 0 |
compno = compno.wrapping_add(1)
}
}
return image;
}
#[no_mangle]
pub unsafe extern "C" fn opj_image_destroy(mut image: *mut opj_image_t) {
if !image.is_null() {
if !(*image).comps.is_null() {
let mut compno: OPJ_UINT32 = 0;
/* image components */
compno = 0 as libc::c_int as OPJ_UINT32;
... | Rust | 0 |
# This file was auto-generated by Fern from our API Definition.
import typing
import typing_extensions
from .custom_attribute_event_data import CustomAttributeEventDataParams
class CustomerCustomAttributeDeletedEventParams(typing_extensions.TypedDict):
"""
Published when a customer [custom attribute](entity... | Python | 1 |
self.migrate_table_data_fixed(table_key, table_data)
def validate_migration_detailed(self):
"""Validação detalhada da migração"""
self.log("\n🔍 VALIDAÇÃO DETALHADA DA MIGRAÇÃO")
self.log("=" * 50)
validation_queries = {
'users': 'SELECT COUNT(*) FROM "us... | Python | 1 |
# Copyright (c) 2024 PaddlePaddle 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 appli... | Python | 1 |
model = dict(
type='Recognizer3DBNN',
backbone=dict(
type='ResNet3dSlowFast',
pretrained=None,
resample_rate=4, # tau
speed_ratio=4, # alpha
channel_ratio=8, # beta_inv
slow_pathway=dict(
type='resnet3d',
depth=50,
pretrained... | Python | 1 |
modelFiles = ' '.join(file for file in modelFiles)
self.cmd2 = self.OMPath+"/OMEdit " + modelFiles
print(self.cmd2)
self.obj_workThread2 = Worker.WorkerThread(self.cmd2)
self.obj_workThread2.start()
print("OMEdit called")
self.obj_appcon... | Python | 1 |
if let Some(char_nexts) = self.states[state.0].char_transitions.get(&char) {
next_states.extend(char_nexts.into_iter());
for (range, range_nexts) in &self.states[state.0].range_transitions {
if char >= range.0 && char <= range.1 {
... | Rust | 0 |
ench_lazy_batch_column_by_vec_push_primitive_causet_10bytes(b: &mut test::Bencher) {
let mut column = VectorQuiesceBatchColumn::primitive_causet_with_capacity(1000);
let val = vec![0; 10];
b.iter(|| {
let column = test::black_box(&mut column);
for _ in 0..1000 {
... | Rust | 0 |
euse agenda logic
slash_command(f"/agenda {day}")
elif intent == "remind":
r = store.add_reminder(payload["text"], payload["at"], owner=None)
schedule_console_notification(f"Напоминание: {r['text']}", r["at"])
console.print(
f"[cyan]Напоминание:[/c... | Python | 1 |
t_file, device, args = file_info
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_path, torch_dtype="auto", device_map="auto"
)
print(f"Processing file: {one_data_info}")
generate_chat_responses(model, tokenizer... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.ExRefRateInfoVO import ExRefRateInfoVO
class AlipayAccountExrateRatequeryResponse(AlipayResponse):
def __init__(self):
super(AlipayAccountExrateRatequery... | Python | 1 |
= "*Required features: 'Win32_Devices_Tapi'*"]
pub const PHONEHOOKSWITCHMODE_UNKNOWN: u32 = 16u32;
#[doc = "*Required features: 'Win32_Devices_Tapi'*"]
pub const PHONEINITIALIZEEXOPTION_USECOMPLETIONPORT: u32 = 3u32;
#[doc = "*Required features: 'Win32_Devices_Tapi'*"]
pub const PHONEINITIALIZEEXOPTION_USEEVENT: u32 =... | Rust | 0 |
# Copyright 2019-2021 Canaan 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 writ... | Python | 1 |
{
write!(f, "Error Code: {} Error Message: {}", self.error.code, self.error.message)
}
}
impl Error for ErrorMessage {}
/*
* Copyright 2022. gudaoxuri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtai... | Rust | 0 |
self.transmogrifiers,
AppContext::new(
self.stylesheet.unwrap_or_else(default_stylesheet),
self.language,
self.localizer,
),
initial_window.as_mut(),
);
crate::run(frontend, initial_window.configuration());
}
... | Rust | 0 |
"""
Simple Test of Contemplative Ignorance Mapping Integration
"""
# Simulating the integration without full execution
def demonstrate_integration_value():
print("="*80)
print("CONTEMPLATIVE IGNORANCE MAPPING - INTEGRATION DEMONSTRATION")
print("="*80)
test_query = "All politicians are corrupt bec... | Python | 1 |
_s_path)
export_header_file(level_name, layer, level_array, compressed, output_h_path)
print(f"Exported compressed data to {output_s_path} and header to {output_h_path}")
layer = f"l2"
output_s_path = f"levels/{level_name}/{layer}.s" # Output .s file
output_h_path = f"levels/{l... | Python | 1 |
#!/usr/bin/env python
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... | Python | 1 |
import json
import re
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--dataset_name', type=str, default='msmarco_beir')
args = parser.parse_args()
dataset_name = args.dataset_name
file_path = f'../results_dense/no_reason/claude-3.5_{dataset_name}.json'
with open(file_path, 'r') as file:
... | Python | 1 |
_path}")
lit_best = UNet1DClsLit.load_from_checkpoint(best_path)
device = "cuda" if torch.cuda.is_available() else "cpu"
lit_best = lit_best.to(device)
lit = lit_best
else:
last_path = os.path.join(ckpt_dir, "last.ckpt")
if os.path.isfile(last_path):
print... | Python | 1 |
r::proto::Color::new();
v.set_red(1.);
v.set_green(1.);
v.set_blue(1.);
v.set_alpha(1.);
reply.mut_colors().push(v);
reply.mut_intensities().push(1.);
let final_proto_size = reply.compute_size();
reply.mut_positions().clea... | Rust | 0 |
ence.setter
def Confidence(self, Confidence):
self._Confidence = Confidence
@property
def Label(self):
r"""嫌疑片段涉及令人反感的信息的结果标签。
:rtype: str
"""
return self._Label
@Label.setter
def Label(self, Label):
self._Label = Label
@property
def Suggest... | Python | 1 |
};
let server = match settings.get_str("server") {
Ok(server) => server,
Err(_) => {
error!("Server is not set in config. Set `server` directive.");
process::exit(0x0002);
}
};
let mountpoint = match settings.get_str("mountpoint") {
Ok(mountpoint) => m... | Rust | 0 |
y(key))
}
extern "C" fn keys(this: ffi::VALUE) -> ffi::VALUE {
let this = unsafe { get_struct::<AttributeSet>(this) };
this.keys()
}
extern "C" fn fetch_value(this: ffi::VALUE, key: ffi::VALUE) -> ffi::VALUE {
let this = unsafe { get_struct::<AttributeSet>(this) };
let key = string_or_symbol_to_id(key... | Rust | 0 |
# This file is part of Bertini 2.
#
# python/bertini/nag_algorithms/__init__.py 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.
#
# p... | Python | 1 |
Darker red
bg_color = "#F9EBEA" # Light red background
border_color = "#F5B7B1" # Medium red border
text = "✗ " + text
icon = "✗"
else:
fg_color = "#5B2C6F" # Darker purple
bg_color = "#E8DAEF" # Light purple background
bord... | Python | 1 |
512 = 2501,
XED_IFORM_VEXPANDPS_ZMMf32_MASKmskw_ZMMf32_AVX512 = 2502,
XED_IFORM_VEXTRACTF128_MEMdq_YMMdq_IMMb = 2503,
XED_IFORM_VEXTRACTF128_XMMdq_YMMdq_IMMb = 2504,
XED_IFORM_VEXTRACTF32X4_MEMf32_MASKmskw_YMMf32_IMM8_AVX512 = 2505,
XED_IFORM_VEXTRACTF32X4_MEMf32_MASKmskw_ZMMf32_IMM8_AVX512 = 2506,
... | Rust | 0 |
{
let components = vec![1., 2., 3., 4.];
assert!((product(&components) - 24.).abs() < f64::EPSILON);
}
#[test]
fn sum_works() {
let components = vec![1., 2., 3., 4.];
assert!((sum(&components) - 10.).abs() < f64::EPSILON);
}
#[test]
fn max_works() {
l... | Rust | 0 |
b6397fb35900ff46ae1df1e86eed2d23005c6b9c61caa4e12af8
bf5
KE1: 03884e56429f1ee53559f2e244392eb8f994fd46c8fd9ffdd24ac5a7af963a66
3b967fcded96ed46986e60fcbdf985232639f537377ca3fcf07ad489956b2e9019033
58b4eae039953116889466bfddeb40168e39ed83809fd5f0d5f2de9c5234398
KE2: 0383fff1b3e8003723dff1b1f90a7934a036bd6691aca0366b07a1... | Rust | 0 |
import xml.etree.ElementTree as ET
import numpy as np
import matplotlib.pyplot as plt
import cv2
import os
# XML 파일 경로
file_path = "/home/hice1/skim3513/scratch/darai-anticipation/FUTR_proposed/datasets/utkinect/depth/s01_e01/depthImg190.xml"
# XML 파일 파싱
tree = ET.parse(file_path)
root = tree.getroot()
tag = os.path.... | Python | 1 |
# -*- coding: utf-8 -*-
import io
import os
import pandas as pd
import scrapy
from scrapy import Request
from scrapy import signals
from fooltrader.consts import DEFAULT_SH_HEADER, DEFAULT_SZ_HEADER
from fooltrader.contract import files_contract
from fooltrader.contract.data_contract import STOCK_META_COL
class Ch... | Python | 1 |
&hex!("37d215a13362bf087bcba8f95901eb05"),
tag: &hex!("1b3eecb7ae9386dbc1409e70f5827f58"),
},
TestVector {
key: &hex!("<KEY>"),
nonce: &hex!("f1f855eb8aeccc9ddf7aa80e"),
plaintext: &hex!("1a89c9c9623a26b7c8062c5f6a5f7f98"),
aad: &hex!("68fedf6a42b780eeb011aa0b242636668e5c... | Rust | 0 |
C8A, "M", "ⲋ"),
(0x2C8B, "V"),
(0x2C8C, "M", "ⲍ"),
(0x2C8D, "V"),
(0x2C8E, "M", "ⲏ"),
(0x2C8F, "V"),
(0x2C90, "M", "ⲑ"),
(0x2C91, "V"),
(0x2C92, "M", "ⲓ"),
(0x2C93, "V"),
(0x2C94, "M", "ⲕ"),
(0x2C95, "V"),
(0x2C96, "M", "ⲗ")... | Python | 1 |
from .accept import AcceptMixin
from .auth import AuthorizationMixin
from .base_request import BaseRequest
from .common_descriptors import CommonRequestDescriptorsMixin
from .etag import ETagRequestMixin
from .user_agent import UserAgentMixin
class Request(
BaseRequest,
AcceptMixin,
ETagRequestMixin,
... | Python | 1 |
"""
====================================
Differentially rotating a coordinate
====================================
How to differentially rotate a coordinate.
The example uses the `~sunpy.coordinates.metaframes.RotatedSunFrame` coordinate
metaframe in `sunpy.coordinates` to apply differential rotation to a
coordinate.... | Python | 1 |
IntoFuncWasm))
# let get_wasm_buffer_from_somewhere = || unimplemented!();
let raw_wasm: Vec<u8> = get_wasm_buffer_from_somewhere();
let mut config = walrus::ModuleConfig::default();
// Register a function to run after the module is parsed, but with access to the
// mapping from indices in the original Wasm binary to... | Rust | 0 |
import fnmatch
import os
import io
import re
import json
import boto3
import botocore
from .storage import Storage
from PIL import Image
class S3Storage(Storage):
def __init__ (self, aws_access_key_id, aws_secret_access_key, endpoint_url, region_name, bucket_name, s3_prefix):
self.aws_access_key_id = aws_... | Python | 1 |
diagnostics {
println!("{}", d);
}
if rest > 0 {
println!("Hiding the remaining {} diagnostics", rest);
}
bail!("docs do not pass lint");
}
Ok(())
}
/// Parse documentation for the specified directory.
fn parse_docs(
stdlib_dir: &Path,
dir: &Path... | Rust | 0 |
f[start_index..]
.iter()
.position(|e| e == element);
option.map(|index| index + start_index)
}
fn rindex_of(&self, element: &T) -> Option<usize> {
self.iter().rposition(|e| e == element)
}
fn rindex_from(&self, element: &T, start_index: usize) -> Option<usiz... | Rust | 0 |
_rate),
feedback,
}
}
pub fn tick(&mut self, input: f64) -> f64 {
let delayed = self.delay_line.read();
self.delay_line.write(input + delayed * self.feedback);
-input + delayed
}
}
/// A stateful comb filter.
///
/// https://en.wikipedia.org/wiki/Comb_filter
///... | Rust | 0 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import json
import os
class PhoneNumberMLP(nn.Module):
def __init__(self, config):
super(PhoneNumberMLP, self).__init__()
self.input_size = config['model']['input_size']
self.hidden_sizes = config['model']['hidden_sizes']
... | Python | 1 |
};
Some(Arg {
attrs,
name,
ty: (*arg.ty).clone(),
})
})
.collect();
Some(Method {
attrs,
name: sig.ident,
args,
return_ty: match sig.output {
syn::ReturnType::Default => syn:... | Rust | 0 |
., .1, .1]
clf.fit(X, Y, sample_weight=sample_weight, queue=queue)
y_pred = clf.predict([[-1., 1.]], queue=queue)
assert y_pred > 1.5
sample_weight = [1] * 6
clf.fit(X, Y, sample_weight=sample_weight, queue=queue)
y_pred = clf.predict([[-1., 1.]], queue=queue)
assert y_pred == pytest.approx... | Python | 1 |
to {
type Target = str;
#[inline(always)]
fn deref(&self) -> &str {
use TinyStrAuto::*;
match self {
Tiny(value) => value.deref(),
Heap(value) => value.deref(),
}
}
}
impl PartialEq<&str> for TinyStrAuto {
#[inline(always)]
fn eq(&self, other: &&... | Rust | 0 |
Move::B2,
Move::U2,
Move::R2,
Move::F,
Move::D2,
Move::Lp,
Move::R,
Move::Fp,
Move::R,
Move::Up,
Move::Rw2,
Move::Bp,
Move::L2,
Move::Fw2,
Move:... | Rust | 0 |
ists::all());
} else {
self.remove_child(context, child, Lists::DEPTH);
}
}
Ok(())
}
#[inline]
fn set_background_color(
self,
context: &mut UpdateContext<'_, 'gc, '_>,
reader: &mut SwfStream<'a>,
) -> DecodeResult {
... | Rust | 0 |
,134,110,255,161,122,137,255,181,140,141,255,125,144,120,255];
let mut photon_image = PhotonImage::new(raw_pix, width, height);
alter_red_channel(&mut photon_image, 40);
assert_eq!(photon_image.raw_pixels, altered_r_channel_pix);
}
#[test]
fn test_alter_blue_channel() {
let... | Rust | 0 |
#!/usr/bin/env python3
# Downloads domain pytorch and library packages from channel
# And backs them up to S3
# Do not use unless you know what you are doing
# Usage: python backup_conda.py --version 1.6.0
import argparse
import hashlib
import os
import urllib.request
from typing import List, Optional
import boto3 ... | Python | 1 |
te!(
f,
"{}-{:02}-{:02} {:02}:{:02}:{:02} ",
time.year,
time.month + 1,
time.day,
time.hour,
time.minute,
time.second
)?;
if let Some(info) = self.info.as_ref() {
write!(
f,
... | Rust | 0 |
x99, 0x25, 0x12, 0x74, 0xb0, 0xfa, 0xe0, 0x2,
0xe2, 0x53, 0x6f, 0x4d, 0x4, 0xd5, 0xe, 0x91, 0xd3, 0x1a, 0x57, 0x83, 0x84, 0xd, 0x19,
0x20, 0x67, 0xbd, 0x9, 0x1, 0xfb, 0xa9, 0x56, 0x28, 0xbf, 0x83, 0xf4, 0x43, 0x8e, 0xef,
0x2d, 0x8f, 0x50, 0xe4, 0x3e, 0x60, 0x65, 0x50, 0x8a, 0x72, 0xd7, 0x36, 0x8... | Rust | 0 |
}
}
/// Build a new "immediate" strategy.
fn new_immediate() -> Self {
let immediate = StrategyImmediate::default();
UpdateStrategy::Immediate(immediate)
}
/// Build a new "fleet_lock" strategy.
fn new_fleet_lock(cfg: inputs::UpdateInput, identity: &Identity) -> Result<Self>... | Rust | 0 |
"""
Revision ID: 0141_remove_unused
Revises: 0140_sms_prefix_non_nullable
Create Date: 2017-11-20 11:35:24.402021
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
revision = "0141_remove_unused"
down_revision = "0140_sms_prefix_non_nullable"
def upgrade():
op.drop_... | Python | 1 |
error!("message error : {}", e);
return Err(anyhow!("not found link id \n"));
}
};
let named_file = match NamedFile::open(path) {
Ok(n) => n,
Err(e) => {
error!("message error : {}", e);
return Err(anyhow!("failed open file"));
}
... | Rust | 0 |
from carro import Carro
from moto import Moto
carro1 = Carro("Toyota", "Corolla", 4)
carro2 = Carro("Honda", "Civic", 2)
carro3 = Carro("Ford", "Fusion", 4)
moto1 = Moto("Harley-Davidson", "Street 750", "Esportiva")
moto2 = Moto("Honda", "CB 500", "Casual")
moto3 = Moto("Yamaha", "MT-09", "Esportiva")
print(carro1)... | Python | 1 |
'store_nbr': 'category',
'family': 'category',
'onpromotion': 'uint32',
},
parse_dates=['date'],
infer_datetime_format=True,
)
df_test['date'] = df_test.date.dt.to_period('D')
df_test = df_test.set_index(['store_nbr', 'family', 'date']).sort_index()
# Create features for test set
X_test =... | Python | 1 |
sage(&message, "0.0.0.0:8001".parse().unwrap()).unwrap();
//!
//! match cbor_connection.recv_message_peer_timeout(Duration::from_millis(10)) {
//! Ok((source, message)) => {
//! println!("Received message from {:?}: {:?}", source, message);
//! }
//! Err(ProtocolError::Timeout) => println!("Timed ou... | Rust | 0 |
assert timepoints == expected
def test_get_timepoints_asymmetric(self):
"""Test getting timepoints for asymmetric window"""
window_avg = WindowAverage(left_edge=-1, right_edge=3, n_timepoints=20)
timepoints = window_avg.get_timepoints()
expected = [-1, 0, 1, 2,... | Python | 1 |
(m, m, qdata)
}
// Least squares solution of A*X = B
// B : A Matrix with as many rows as A and any number of columns.
// returns X that minimizes the two norm of Q*R*X-B.
pub fn solve(&self, b : &Matrix<T>) -> Option<Matrix<T>> {
assert!(b.rows() == self.qr.rows());
if !self.is_full_rank() {
r... | Rust | 0 |
# coding: utf-8
class SensitiveInfo:
def __init__(self):
self.users = ['nick', 'tom', 'ben', 'mike']
def read(self):
print('There are {} users: {}'.format(len(self.users), ' '.join(self.users)))
def add(self, user):
self.users.append(user)
print('Added user {}'.format(us... | Python | 1 |
]
#[doc = " \\rst"]
#[doc = " .. versionadded:: 1.16"]
#[doc = " \\endrst"]
pub fn TCOD_color_alpha_blend(dst: *mut TCOD_ColorRGBA, src: *const TCOD_ColorRGBA);
}
extern "C" {
pub fn TCOD_color_set_HSV(color: *mut TCOD_color_t, hue: f32, saturation: f32, value: f32);
}
extern "C" {
pub fn TCO... | Rust | 0 |
ETRATION REPORT GENERATED: {report_file}")
return report_file
def execute_full_penetration_test(self):
"""🚀 Execute complete penetration test"""
print("🔥 REAL INSTAGRAM PENETRATION TESTING 2025")
print("=" * 60)
print(f"🎯 Target: @{self.target}")
print(f"⏰ Started... | Python | 1 |
ingDynamic(SetuptoolsWarning):
_SUMMARY = "`{field}` defined outside of `pyproject.toml` is ignored."
_DETAILS = """
The following seems to be defined outside of `pyproject.toml`:
`{field} = {value!r}`
According to the spec (see the link below), however, setuptools CANNOT
consider this value ... | Python | 1 |
h_reason
if choice.logprobs is not None:
logprob_results[choice.index] = choice.logprobs
assert all(finish_reason is not None for finish_reason in finish_reasons)
return engine_base.wrap_completion_response(
request_id=request_id,
model=reques... | Python | 1 |
V, Update, ValueFn> DiffQWorker<E, F, V, EvalV, Update, ValueFn>
where E: 'static + Env + EnvObsRepr<F>,
F: 'static + SampleExtractInput<[f32]> + SampleInputShape<(usize, usize, usize)> + Deref<Target=[u8]> + Clone,
E::Action: DiscreteAction,
V: Value<Res=E::Response>,
EvalV: Value<Res=E::Respon... | Rust | 0 |
from woningwaardering.vera.bvg.generated import Referentiedata
from woningwaardering.vera.referentiedatasoort import Referentiedatasoort
class WoningwaarderingstelselReferentiedata(Referentiedata):
pass
class Woningwaarderingstelsel(Referentiedatasoort):
onzelfstandige_woonruimten = WoningwaarderingstelselR... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.