text string | label_name string | labels int64 |
|---|---|---|
if np.any(targets_shape != true_targets_shape):
raise ValueError('the shape of targets and true_targets are not the same'
'{} != {}'.format(targets_shape, true_targets_shape))
if weights is not None:
# Filtering targets and true_targets using weights.
weights_shape = wei... | Python | 1 |
*) buf2287, *(uint*)buf2288);
rsSetObject((rs_element*) buf2289, *(rs_element*)buf2290);
rsSetObject((rs_type*) buf2291, *(rs_type*)buf2292);
rsSetObject((rs_allocation*) buf2293, *(rs_allocation*)buf2294);
rsSetObject((rs_sampler*) buf2295, *(rs_sampler*)buf2296);
rsSetObject((rs_script*) buf2297, ... | Rust | 0 |
vec.anneal()
# display output
import matplotlib.pyplot as plt
print('final energy: {}'.format(e))
print('rectified')
for cs, es in polys:
print(cs)
print('final')
for cs, es in new_polys:
print(cs)
raw_im = visualize_sample(types, polys_raw, conns)
before_im = vis... | Python | 1 |
tPos = posCmd
posCmdRev = rad2Rev(posCmd)
self.desPos = posCmd
self.desVolt = arbFF
if self.configSuccess:
err = self.closedLoopCtrl.setReference(
posCmdRev,
SparkMax.ControlType.kPosition,
ClosedLoopSlot.kSlot0,
... | Python | 1 |
T9: 9, T10: 10, T11: 11, T12: 12);
implement_resource_bindings!(14, T0: 0, T1: 1, T2: 2, T3: 3, T4: 4, T5: 5, T6: 6, T7: 7, T8: 8, T9: 9, T10: 10, T11: 11, T12: 12, T13: 13);
implement_resource_bindings!(15, T0: 0, T1: 1, T2: 2, T3: 3, T4: 4, T5: 5, T6: 6, T7: 7, T8: 8, T9: 9, T10: 10, T11: 11, T12: 12, T13: 13, T14: ... | Rust | 0 |
# === [05] FILE: tests/test_generate_mode_docs_smoke.py — START =======
from __future__ import annotations
import sys
from pathlib import Path
def test_generate_mode_docs_smoke(tmp_path: Path, monkeypatch) -> None:
"""
문서 생성기가 에러 없이 동작하고, 핵심 섭션 헤더/표준 섹션명이 포함되는지 확인.
- 레포 루트를 PYTHONPATH에 추가해 import 경로를 고정
... | Python | 1 |
, lsn: Lsn) -> Result<usize> {
let mut total_blocks: usize = 0;
let _enter = info_span!("calc logical size", %lsn).entered();
// list of all relations in this timeline, including ancestor timelines
let all_rels = self.list_rels(0, 0, lsn)?;
for rel in all_rels {
if... | Rust | 0 |
.unwrap();
let y = BigInt::from_hex(
&"b868891567ca1ee8c44706c0dc190dd7779fe6f9b92ced909ad870800451e3".to_string(),
)
.unwrap();
Secp256k1Point::from_coor(&x, &y).unwrap(); // x and y not of size 32 each
let r = random_point();
let r_expected = Secp... | Rust | 0 |
"middleNames": "",
"lastName": "",
"fullName": "",
"additionalNames": "",
"dateOfBirth": "1536-08-26T15:13:46Z",
"currentAddress": "",
"previousAddresses": [],
... | Python | 1 |
import pytest
import timm.models as tm
import torch
from timm_utils import split_model_and_compare_output
@pytest.mark.skip("balance split v2 is not ready")
def test_timm_models_without_control_flow():
MODEL_LIST = [
tm.resnest.resnest50d,
tm.beit.beit_base_patch16_224,
tm.cait.cait_s24_22... | Python | 1 |
# app/middleware.py
from starlette.middleware.sessions import SessionMiddleware
from starlette.middleware.cors import CORSMiddleware
from starlette.middleware.httpsredirect import HTTPSRedirectMiddleware
from fastapi import FastAPI
from src.artecommercellcapi.config import MIDDLEWARE_STRING
import os
from slowapi impor... | Python | 1 |
// At other levels all portals work, but start/end are blocked
adj != map.start && adj != map.end
}
});
for adj in adjacent {
let level = if map.inner_portals.contains_key(&pos) && map.outer_portals.contains_key(&adj) {
// This is ... | Rust | 0 |
ir, exist_ok=True)
for book in tqdm(glob.glob(f"{litbank_dir}/entities/tsv/*.tsv")):
tokens, entities = extract_entities(book)
conll_name = os.path.splitext(os.path.basename(book))[0] + ".conll"
write_conll_(f"{output_dir}/{conll_name}", tokens, entities)
if __name__ == "__main__":
pa... | Python | 1 |
mes="256th-coil")
all_coils = load_coils_from_makegrid_file(filecoils, order, points_per_period)
compare_coils = [all_coils[255]]
gamma = [coil.curve.gamma() for coil in coils]
compare_gamma = [coil.curve.gamma() for coil in compare_coils]
np.testing.assert_allclose(gamma, compar... | Python | 1 |
,
}
impl HeartbeatHandling {
pub fn should_execute_heartbeat(&self) -> bool {
match self {
Self::Execute { .. } => true,
Self::Skip => false,
}
}
}
/// Orders the canisters and updates their accumulated priorities according to
/// the strategy described in the Scheduler... | Rust | 0 |
pe = kwargs["TagSpecification"].get("ResourceType")
if kwargs["TagSpecification"].get("Tags", None):
tag = model.Tag()
tags = []
for t in kwargs["TagSpecification"]["Tags"]:
tag.Key = t.get("Key", None)
tag.Value = t.get... | Python | 1 |
Idx: int
The index of the player to fetch information for
Returns
-------
: tuple(list(Card), list(Card), list(Card), int, int)
"""
thisPlayer = self.__players[playerIdx]
otherPlayerInfo = {}
for i, player in enumerate(self.__players):
... | Python | 1 |
C_PREDICATEHINT);
}
impl_bitflag_operators!(QueryMiscFlags);
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct RaiseFlags(u32);
#[allow(non_upper_case_globals)]
impl RaiseFlags {
pub const DriverInternalError: Self = Self(D3D11_RAISE_FLAG_DRIVER_INTERNAL_ERROR);
}
impl_bitflag_operators!(RaiseFlags);
#[deri... | Rust | 0 |
3:
raise ValueError("Rewrite results format incorrect")
rewrite_json = rewrite_parts[-1]
rewrite_dict = json.loads(rewrite_json)
except Exception as e:
rewrite_dict = {
"error": f"Failed to parse rewrite_results: {str(e)}",
"ori... | Python | 1 |
def levenshtein_distance(word1, word2):
"""
Computes the Levenshtein distance.
[Reference]: https://en.wikipedia.org/wiki/Levenshtein_distance
[Article]: Levenshtein, Vladimir I. (February 1966). "Binary codes capable of correcting deletions,
insertions,and reversals". Soviet Physics Doklady 10... | Python | 1 |
URE_MATRIX[1][3][2]) / (texture.get_height() as f32),
width / (texture.get_width() as f32),
height / (texture.get_height() as f32),
)),
Some(texture.relative(
(offset_x
+ width * TEXTURE_MATRIX[0][4][0]
+ height * TEXTURE_MATRIX[0][4][1... | Rust | 0 |
import numpy as np
def baseline_policy(obs, env):
action = np.zeros(env.cfg.num_offense_players, dtype=int)
for i in range(env.cfg.num_offense_players):
if obs[i][1] == 1:
if obs[i][0] == 1:
defender_distances = obs[i][4 + 2 * env.cfg.num_offense_players + 1:4 + 2 * (env.cf... | Python | 1 |
pub use handlers::*;
pub use models::*;
pub use response::*;
pub fn init_routes() -> Router {
Router::new()
.route("/cr", post(cr))
.route("/cd", post(cd))
.route("/cat", post(cat))
.route("/ls", post(ls))
.route("/find", post(find))
.route("/up", post(up))
.... | Rust | 0 |
import abc
import logging
import jieba
import opencc
from . import utils
converter = opencc.OpenCC('t2s.json')
class AbstractTokenizer(abc.ABC):
def tokenize(self, text, **kwargs):
raise NotImplementedError()
def _uniform_text(self, text, **kwargs):
to_simplified = kwargs.get('to_simplifi... | Python | 1 |
# Copyright (c) 2019 European Organization for Nuclear Research (CERN)
#
# Authors: Corne Lukken <info@dantalion.nl>
#
# 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/... | Python | 1 |
AMESPACE))
.unwrap();
conn.batch_execute(&format!("CREATE TABLE {}.contacts (id serial PRIMARY KEY NOT NULL, name character varying(50) NULL, name2 character varying(50) NULL)", NAMESPACE)).unwrap();
conn.batch_execute(&format!(
"CREATE INDEX idx_contacts_name ON {}.contacts (name, name2)",
... | Rust | 0 |
raw_gtfs) => self::validate_and_metadata(raw_gtfs, max_issues),
Err(e) => {
let mut validations = BTreeMap::new();
validations.insert(
issues::IssueType::InvalidArchive,
vec![issues::Issue::new(
issues::Severity::Fatal,
... | Rust | 0 |
&T) -> Self
where
P: EmitTriangles<Vertex = usize>,
T: SharedVertex<Vertex> + IndexedPolygon<P>,
{
Self::generate(primitive, true)
}
pub fn from_genmesh_no_normals<T, P>(primitive: &T) -> Self
where
P: EmitTriangles<Vertex = usize>,
T: SharedVertex<Vertex> + I... | Rust | 0 |
# Created for BADS 2018
# See README.md for details
# Python 3
"""This module provides functions for sorting arrays of strings using msd sort.
For additional documentation, see Section 5.1 of Algorithms, 4th Edition
by Robert Sedgewick and Kevin Wayne.
"""
cutoff = 15
# compare characters at position d
def _less(... | Python | 1 |
ringify!(_float_const),
"::",
stringify!(_Double)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_float_const>()))._Long_double as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_float_const),
":... | Rust | 0 |
a68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606")), # noqa: E501
Address("52.176.7.10", 30303, 30303)),
Node.from_pubkey_and_addr(keys.PublicKey(decode_hex("02508da84b37a1b7f19f77268e5b69acc9e9ab6989f8e5f2f8440e025e633e4277019b91884e46821414724e790994a50... | Python | 1 |
u32>().map_err(|_| Kind::Parse)?)
}
}
impl<'de> Deserialize<'de> for ValidatorIndex {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
Ok(Self::from_str(&String::deserialize(deserializer)?)
.map_err(|e| D::Error::custom(format!("{}", e)))?)
}
}
impl Ser... | Rust | 0 |
user's config directory upon first run
// <command name="ToolPen" key = "A">
#[derive(Copy, Clone, EnumString, Display, Debug, PartialEq)]
pub enum Command {
// zoom
ResetScale,
ZoomIn,
ZoomOut,
// move camera
NudgeUp,
NudgeDown,
NudgeLeft,
NudgeRight,
// tools
ToolPan,
... | Rust | 0 |
",
"Cheepicus_8x8.png",
"Cheepicus_15x15.png",
"Cheepicus_16x16.png",
"Herrbdog_12x12.png",
"Kein_5x5.png",
"Mkv_curses_6x6.png",
"Runeset_24x24.png",
"Teeto_K_18x18.png",
"Terbert_7x7.png",
"Yayo_tunur_13x13.png",
];
struct MyRoguelike {
cur_font: usize,
cur_font_name: ... | Rust | 0 |
triage",
"patient_history": "patient's history"
}
prompt = f"You are a ER triage agent that helps nurses triage patients that come to the hospital. You need to take into account the symptoms of the patient, the current capacity of the ER and the history of the patient.\nThe patient {patient_id} has the ... | Python | 1 |
}
}
}
impl<T:Display> Display for $ty<T> {
fn fmt( &self, f: &mut Formatter ) -> fmt::Result {
if self.has_no_child() {
write!( f, "{}", self.$($data)+ )
} else {
write!( f, "{}", self.$($data)+ )?;
... | Rust | 0 |
debug!(
expected_value = ?repo,
current_value = ?signature_repo.repo,
"repo not satisfied"
);
return Ok(false);
}
}
let outcome = if let Some(av) = &self.annotation_verifier {
... | Rust | 0 |
"""Test Snooz configuration."""
from __future__ import annotations
import pytest
from homeassistant.core import HomeAssistant
from . import SnoozFixture
# This tests needs to be adjusted to remove lingering tasks
@pytest.mark.parametrize("expected_lingering_tasks", [True])
async def test_removing_entry_cleans_up_c... | Python | 1 |
as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `SETCLR5`"]
pub enum SETCLR5W {
#[doc = "Independent. Set and clear do not depend on any counter."]
INDEPENDENT,
#[doc = "L counter. Set and clear are reversed when counter L or the unified counter is counting down."... | Rust | 0 |
x87\xdd\x14DW|\
\xf0X\xa8j\x83bej\xb1\xcbB\x18qQ\xd2\xae\
/\xe8H\x1a\xf3.?\x8d\x8f\xc8Cq\xe9`\x96d\
BA\x5c3f)\xbb\xa1\xec\xdd1<p\xec\xc4\x0f\
\x17\xb1\x8f\xa0\xf6\x89\xa4\xe0\x1d\x7f=\xfd+\x0e\xbe\xc4\
\xe8\xa8e\xd7E\xff\x0c\xc7b\xcfx!B\xddXj\
\xd9UDWZ\xf0\x18x\x19\xd8\xb5a|\x9e\xe3d\
\xa4\x96]E\xf4\xa5\x05\x0fX7\xb1\x... | Python | 1 |
#!/usr/bin/env python3
import numpy as np
from scipy.optimize import minimize
from pyems.simulation import Simulation
from pyems.structure import PCB, Microstrip, ViaWall
from pyems.coordinate import Coordinate2, Box2, Axis
from pyems.pcb import common_pcbs
from pyems.mesh import Mesh
from pyems.utilities import mil_t... | Python | 1 |
y this crate. That executable is not
//! published on crates.io, but is at the projects Github page, where users can
//! get the exe in the releases page.
//!
//! The purpose of these typings are for downstream consumers of the Manual,
//! who will create their database offline and load those typings using Serde.
//! T... | Rust | 0 |
Index": aclVlanIndex,
"aclVlanAclType": aclVlanAclType,
"aclVlanAclId": aclVlanAclId,
"aclVlanDirection": aclVlanDirection,
"aclVlanSequence": aclVlanSequence,
"aclVlanStatus": aclVlanStatus,
"aclIpv6IndexNextFree": aclIpv6IndexNextFree,
"aclIpv6Table": aclIpv6Table,
... | Python | 1 |
signal_last}, "
f"RSI Last: {rsi_last}, Bollinger Upper: {bollinger_upper_last}, "
f"Bollinger Lower: {bollinger_lower_last}, VWAP: {vwap_last}")
return False, None
################################################################... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import re
from glob import glob
from os.path import basename, dirname, join, splitext
from setuptools import find_packages
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open("README.rst") as readme_file:
... | Python | 1 |
.ends_with("zip") => {
debug!("zip file name: {}", name);
let mut zip = zip::ZipArchive::new(Cursor::new(bytes))?;
let mut zip_bytes: Vec<u8> = vec![];
let mut filename: Option<String> = None;
for i in 0..zip.len() {
let mut file = zip.by_inde... | Rust | 0 |
q!(written, expected);
Ok(())
}
}
use chrono::prelude::*;
#[derive(Debug, Serialize, Deserialize)]
pub struct GovTalkRoot {
#[serde(
rename = "{http://www.govtalk.gov.uk/CM/envelope;http://xmlgw.companieshouse.gov.uk/v2-1/schema/Egov_ch-v2-0.xsd}GovTalkMessage",
alias = "{http://www.gov... | Rust | 0 |
.W0 91 /r`
///
/// `XOP`
///
/// `16/32/64-bit`
XOP_Vprotw_xmm_xmmm128_xmm = 4134,
/// `VPROTW xmm1, xmm2, xmm3/m128`
///
/// `XOP.128.X9.W1 91 /r`
///
/// `XOP`
///
/// `16/32/64-bit`
XOP_Vprotw_xmm_xmm_xmmm128 = 4135,
/// `VPROTD xmm1, xmm2/m128, xmm3`
///
/// `XOP.128.X9.W0 92 /r`
///
/// `XOP`
//... | Rust | 0 |
ton Code, passed to GrabButton */
pub static AllTemporary:i64 = 0; /* special Resource ID passed to KillClient */
pub static CurrentTime:u64 = 0; /* special Time */
pub static NoSymbol:i64 = 0; /* special KeySym */
/*****************************************************************
* EVENT DEFINITIONS
**********... | Rust | 0 |
import pandas as pd
import os
# 文件路径和基本文件名
base_path = '/Users/chenyaxin/Desktop/websitdata/filter_similirity/'
file_prefix = 'similar_complaints_'
file_suffix = '.csv'
output_file = '/Users/chenyaxin/Desktop/websitdata/filtered_data_90.csv'
file_list = [f"{base_path}{file_prefix}{i}{file_suffix}" for i in range(0, 2... | Python | 1 |
![
// "/path/peogle", // ignore it
"dimos",
"123456",
"search",
"name",
"age",
"sex",
"--name",
"Jack",
"Rose",
"Smith",
"--age",
"20",
"40",
"--sex",
"all",
"--",
"a",
... | Rust | 0 |
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-Licens... | Python | 1 |
# Generated by Django 5.1.4 on 2025-01-08 12:22
import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("nodes", "0039_alter_node_authors_alter_node_creator_and_more"),
migrati... | Python | 1 |
ahead/projects$',
typeaheads.ProjectsTypeAhead.as_view(), name='xhr_projectstypeahead'),
url(r'^xhr_typeahead/gitrev$',
typeaheads.GitRevisionTypeAhead.as_view(),
name='xhr_gitrevtypeahead'),
url(r'^xhr_typeahead/(?P<pid>\d+)/distros$',
typeaheads.Distros... | Python | 1 |
h bw.status() {
ShapesOpStatus::Unknown => {
let curve = bw[0].oriented_curve();
assert_near!(curve.subs(0.0)[2], -1.0);
assert!(flags[0]);
flags[0] = false;
}
ShapesOpStatus::Or => {
let curve = bw[0].or... | Rust | 0 |
import torch
import triton
import triton.language as tl
@triton.jit
def _fwd_kernel_token_softmax(
Logics, B_Start_Loc, B_Seqlen,
Prob_Out,
stride_logic_h, stride_logic_bs,
stride_prob_h, stride_prob_bs,
BLOCK_SIZE: tl.constexpr
):
cur_batch = tl.program_id(0)
cur_head = tl.program_id(1)
... | Python | 1 |
uni.set(-3, 1, true);
uni.set(3, 1, true);
uni.set(6, 3, true);
uni.set(4, 6, true);
assert_eq!(uni.debug_root(),
vec![
0b_0000_0000_0000_0000,
0b_0100_0000_0000_0000,
0b_0000_0000_1000_0000,
0b_0000_0000_0000_0000,
0b_0000_0000_0000_0000,
0b_00... | Rust | 0 |
import itertools
class SimilarityProcessor:
def __init__(self, target_count, reference_array):
# 存储输入的子列表
self.input_lists = []
# 设定要从一维列表中选取的元素个数
self.target_count = target_count
# 存储参考数组
self.reference_array = reference_array
def add_list(self, new_list):
... | Python | 1 |
{acc}, corr_count: {corr_count}, wrong_count: {wrong_count}")
sta_dict[subject]["corr"] = corr_count
sta_dict[subject]["wrong"] = wrong_count
sta_dict[subject]["accu"] = acc
with open(os.path.join(summary_path), 'a') as f:
f.write("Average accuracy {:.4f} - {}\n".format(sta_... | Python | 1 |
import matplotlib.pyplot as plt
# X-axis: time scaling factors (your independent variable)
time_scales = [200, 400, 600, 800, 1000, 1200, 1300, 1400, 1500, 1600]
# Y-axis data (copy-pasted from Excel)
torus_latency = [39.3406, 40.1997, 40.5123, 40.7898, 41.3417, 42.408, 42.785, 44.7366, 58.3454, 204.982]
cmesh_latency... | Python | 1 |
# Copyright 2025 Joe Bears
#
# 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, so... | Python | 1 |
pdf_release_obj(key);
spc_warn!(spe, "PDF object expected but not found.");
return -1i32;
}
} else {
pdf_release_obj(tmp);
pdf_release_obj(category);
spc_warn!(spe, "Invalid object type for pdf:names.");
return -1i... | Rust | 0 |
from os.path import join
from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe
class PandasRecipe(CppCompiledComponentsPythonRecipe):
version = '1.0.3'
url = 'https://github.com/pandas-dev/pandas/releases/download/v{version}/pandas-{version}.tar.gz' # noqa
depends = ['cython', 'numpy', ... | Python | 1 |
# Generated by Django 2.2.24 on 2021-07-05 11:59
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import economy.models
import uuid
class Migration(migrations.Migration):
dependencies = [
('dashboard'... | Python | 1 |
png = PngData::new(&input, false).unwrap();
b.iter(|| png.raw.change_interlacing(1));
}
#[bench]
fn interlacing_8_bits(b: &mut Bencher) {
let input = test::black_box(PathBuf::from("tests/files/rgb_8_should_be_rgb_8.png"));
let png = PngData::new(&input, false).unwrap();
b.iter(|| png.raw.change_inte... | Rust | 0 |
88947", 1),
],
)
@pytest.mark.asyncio
async def test_tricky_journal_quality_results(doi: str, score: int) -> None:
"""Test DOIs which won't be found in the journal quality data without munging.
Either their titles are non-canonical compared with the journal quality source,
they had a duplicate entry in... | Python | 1 |
let as FileMap, Config as FileMapConfig};
use codec::{Decode,alloc::string::ToString};
use frame_support::{
dispatch::UnfilteredDispatchable,
pallet_prelude::*,
traits::{Currency, CurrencyToVote, Get, Imbalance},
};
use sp_std::prelude::*;
use frame_system::RawOrigin;
pub struct Pallet<T: Config>(FileBank<T>);
pub... | Rust | 0 |
到对应颜色
output = cv2.cvtColor(output, cv2.COLOR_BGR2GRAY)
Matrix = np.ones((20, 20), np.uint8)
#使用一个 20x20 的卷积核
img_edge1 = cv2.morphologyEx(output, cv2.MORPH_CLOSE, Matrix) #闭运算
img_edge2 = cv2.morphologyEx(img_edge1, cv2.MORPH_OPEN, Matrix) #开运算
card_contours = img_mat... | Python | 1 |
!(
map_present_mode,
WGPUPresentMode,
wgt::PresentMode,
"Unknown present mode",
Immediate,
Mailbox,
Fifo
);
map_enum!(
map_primitive_topology,
WGPUPrimitiveTopology,
wgt::PrimitiveTopology,
"Unknown primitive topology",
PointList,
LineList,
LineStrip,
Triangle... | Rust | 0 |
elf.free_select.is_none() {
self.cur_target.is_some()
} else {
self.free_select_valid
}
}
pub fn on_activate(&mut self) {
if !self.is_valid_to_activate() {
return;
}
self.parent.borrow().explore_self_location();
self.cancel = ... | Rust | 0 |
ETH_MACIMR)
pub MACIMR: RWRegister<u32>,
/// Ethernet MAC address 0 high register (ETH_MACA0HR)
pub MACA0HR: RWRegister<u32>,
/// Ethernet MAC address 0 low register
pub MACA0LR: RWRegister<u32>,
/// Ethernet MAC address 1 high register (ETH_MACA1HR)
pub MACA1HR: RWRegister<u32>,
///... | Rust | 0 |
o response body as extension name of file
#[cfg(feature = "file")]
#[cfg_attr(feature = "docs", doc(cfg(feature = "file")))]
async fn write_file<P>(&mut self, path: P, typ: DispositionType) -> Result
where
P: Send + AsRef<Path>;
}
// Static header value.
lazy_static! {
static ref APPLICATIO... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# 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... | Python | 1 |
from grover_algorithm import run_grover_algorithm
from shor_algorithm import run_shor_algorithm
from qft_algorithm import run_qft
from amplitude_amplification import run_amplitude_amplification
from utils.visualization import plot_histogram
def main():
print("Quantum Algorithm Simulator")
choice = input("Choos... | Python | 1 |
stages in a shader program
#[derive(Clone, Debug)]
pub struct ShaderStages {
pub vertex: Handle<Shader>,
pub fragment: Option<Handle<Shader>>,
}
impl ShaderStages {
pub fn new(vertex_shader: Handle<Shader>) -> Self {
ShaderStages {
vertex: vertex_shader,
fragment: None,
... | Rust | 0 |
oin().unwrap();
}
//! Use a badge for color highlighting important information.
//!
//! *This API requires the following crate features to be activated: badge*
use iced_graphics::{Backend, Color, Primitive, Renderer};
use crate::native::modal;
pub use crate::native::modal::State;
pub use crate::style::modal::{Style,... | Rust | 0 |
wrap(
// not sure i need this if severing from here
Cors::new()
//.allowed_origin("http://localhost")
//.allowed_origin(&format!("http://localhost:{}", &port.clone()))
.max_age(3600)
.allowed_methods(vec!["GE... | Rust | 0 |
from gspread_models.base import BaseModel
class Book(BaseModel):
SHEET_NAME = "books"
COLUMNS = ["title", "author", "year"]
SEEDS = [
{"title": "To Kill a Mockingbird", "author": "Harper Lee", "year": 1960},
{"title": "1984", "author": "George Orwell", "year": 1949},
{"title": "... | Python | 1 |
'locked': False
},
{
'code': r"""
>>> bacon_strategy(90, 42, 1, 5)
0
""",
'hidden': False,
'locked': False
},
{
'code': r"""
>>> bacon_strategy(1, 35, 8, 10)
0
""",
'hidden': ... | Python | 1 |
import config
import math
WINDOW_SIZE = 5
PUNCTUATION_MARK = ['x'] # 标点
NOUN_MARK = ['n', 'ng', 'nr', 'nrfg', 'nrt', 'ns', 'nt', 'nz'] # 名词
VERB_MARK = ['v', 'vd', 'vg', 'vi', 'vn', 'vq'] # 动词
ADJECTIVE_MARK = ['a', 'ad', 'an', 'ag'] # 形容词
ADVERB_MARK = ['d', 'df', 'dg'] # 副词
ENG_MARK = ['eng']
RESERVED_MARK = N... | Python | 1 |
# Generated by Ollama Llama 3
# Task: inside_op_coverage_rich
# Attempt: 10
# Success: False
# Overall Score: 0.465
Here is a Python module for your requirement using PyVerilog and re (RegEx) to perform text transformations on Verilog/SystemVerilog source files, including handling of edge cases like empty arrays or bo... | Python | 1 |
("Invalid request!");
}
Ok(())
}
fn get_key_type(&self) -> KeyType {
KeyType::SealingKey
}
fn get_provider_name(&self) -> &str {
self.provider_key.get_provider_name()
}
fn get_key_data(&self) -> Vec<u8> {
self.provider_key.get_key_data()
}
fn d... | Rust | 0 |
from dataclasses import dataclass, field
import matplotlib.pyplot as plt
@dataclass
class LCG:
seed: int = 42
m: int = field(default=2 ** 31 - 1, init=False) # modulus
a: int = field(default=1103515245, init=False) # multiplier
c: int = field(default=12345, init=False) # increment
state: int =... | Python | 1 |
import sqlite3
def exibir_resultados(nome_tabela, consulta, cursor):
print(f"\n========== {nome_tabela.upper()} ==========")
cursor.execute(consulta)
linhas = cursor.fetchall()
if linhas:
for linha in linhas:
print(linha)
else:
print("Nenhum registro encontrado.")
p... | Python | 1 |
TicketSolver::parse_fields(fields_str);
let your_ticket = TicketSolver::parse_ticket(your_ticket_str);
let nearby_tickets = TicketSolver::parse_nearby_tickets(nearby_tickets_str);
return TicketSolver {
fields: fields,
your_ticket: your_ticket,
nearby_tickets... | Rust | 0 |
WithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
For more information, see https://www.github.com/lithic-com/lithic-python#with_streaming_response
"""
return AsyncBalancesWithStreamingResponse(self)
def list(
... | Python | 1 |
h, offset, limit)
def initialize(api):
"""
Initialize the API with the defined resources and permissions.
Args:
api (Api): Flask-RESTful API instance.
"""
api.add_resource(AssetGroups, "/api/v1/my-assets/asset-groups")
api.add_resource(AssetGroup, "/api/v1/my-assets/asset-groups/<stri... | Python | 1 |
!(Tera::one_off(input, context.clone(), true).unwrap(), expected);
}
}
#[test]
fn var_access_by_square_brackets_errors() {
let mut context = Context::new();
context.insert("var", &Test { a: "hi".into(), b: "there".into(), c: vec![] });
let t = Tera::one_off("{{var[csd]}}", context, true);
assert!(t... | Rust | 0 |
import json
from pathlib import Path
from typing import Tuple, Union
class GeoJSON:
def __init__(self, **metadata):
self._id = 1
self._geojson = {
"type": "FeatureCollection",
"features": [],
}
if metadata:
self._geojson["metadata"] = metadata
... | Python | 1 |
Gote,&State::new(banmen.clone()),&MochigomaCollections::Empty).into_iter().map(|m| {
LegalMove::from(m)
}).collect::<Vec<LegalMove>>()
);
assert_eq!(answer,
Rule::oute_only_moves_all(Teban::Gote,&State::new(banmen.clone()),&MochigomaCollections::Empty).into_iter().map(|m| {
LegalMove::from(m)
... | Rust | 0 |
import board
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
from kmk.quickpin.pro_micro.avr_promicro import translate as avr
from kmk.quickpin.pro_micro.boardsource_blok import pinout as pins
from kmk.scanners import DiodeOrientation
from kmk.scanners.keypad import MatrixScanner
class KMKKeyboard(_KMKKeybo... | Python | 1 |
from datetime import datetime, timezone
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from pycalista_ista import (
ColdWaterDevice,
Device,
HeatingDevice,
HotWaterDevice,
Reading,
)
from custom_components.ista_calista.const import CONF_OFFSET
# Mock user configuration (email, password... | Python | 1 |
# Draw label background
label = f"{cls_name} {conf:.2f}"
(label_width, label_height), baseline = cv2.getTextSize(
label, cv2.FONT_HERSHEY_SIMPLEX, font_scale, line_width
)
cv2.rectangle(
vis_img,
(x1, y1 - label_heigh... | Python | 1 |
nel: Channel + sealed::ConfigurableChannel {
fn degrade_configurable(self) -> AnyConfigurableChannel {
AnyConfigurableChannel {
number: self.number() as u8,
}
}
}
pub trait Group: sealed::Group + Sized {
fn number(&self) -> usize;
fn degrade(self) -> AnyGroup {
AnyGr... | Rust | 0 |
1600]
pub fn keccakf(a: &mut [u64; PLEN]) {
for i in 0..24 {
let mut array: [u64; 5] = [0; 5];
// Theta
array[0] ^= a[0 + 0*5];
array[0] ^= a[0 + 1*5];
array[0] ^= a[0 + 2*5];
array[0] ^= a[0 + 3*5];
array[0] ^= a[0 + 4*5];
array[1] ^= a[1 + 0*5];
... | Rust | 0 |
import aws_cdk
from aws_cdk import aws_lambda, aws_s3, PhysicalName
from constructs import Construct
class SearcherService(Construct):
def __init__(
self,
scope: Construct,
construct_id: str,
store_bucket: aws_s3.Bucket,
index_id: str,
memory_size: int,
envi... | Python | 1 |
nd"),
}
},
},
"SensorReading": {
"score": 1,
"type": "regular",
"dsl": "SensorReading(double value)",
"counterpart": "SensorReading",
"attributes": {
"double value": {
"score": 1,
"counterpart": ("measuredVal... | Python | 1 |
response = client.get(url, follow=True)
ok_(IdpProfile.objects.filter(pk=idp.pk).exists())
with override_script_prefix('/en-US/'):
url = reverse('phonebook:profile_edit')
self.assertRedirects(response, url, status_code=301)
msg = 'Sorry the requested Identity cannot be del... | Python | 1 |
import threading
import EventKit
from typing import List, Optional
import inject
from dspygen.pyautomator.event_kit.calendar_event import CalendarEvent
class CalendarEventList:
@inject.autoparams()
def __init__(self, name: str, event_store: EventKit.EKEventStore):
self.name = name
self.event_... | Python | 1 |
_support().is_ok();
#[cfg(not(target_os = "windows"))]
let enable_styles = true;
// Look up config file, if none is found fall back to default config.
let config = match Config::load(enable_styles) {
Ok(config) => config,
Err(ConfigError(msg)) => {
eprintln!("Could not load ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.