text string | label_name string | labels int64 |
|---|---|---|
v_x8"
self.I = {}
self.O = {}
for SliceIndex in range ( Slices ) :
self.I[SliceIndex] = Inst ( Model
, "i_%d" % SliceIndex
, map = { 'i' : self._shamt[SliceIndex]
... | Python | 1 |
= 2048;
const GET_APPOINTMENT_BODY_LEN: u64 = 178;
const GET_SUBSCRIPTION_INFO_BODY_LEN: u64 = 127;
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
pub(crate) struct ApiError {
error: String,
error_code: u8,
}
impl reject::Reject for ApiError {}
impl ApiError {
fn new(error: String, error_code: ... | Rust | 0 |
// c2_i1 = cdf2[i - 1] = Pr[X_2 <= prev(x_i)]
let c2_i1 = 0.0;
let (p, _c1_i1, _c2_i2) = cdf1.into_iter().zip(cdf2.into_iter()).fold(
(p, c1_i1, c2_i1),
|(p, c1_i1, c2_i1), (&c1_i, &c2_i)| {
// c1_i = cdf1[i] = Pr[X_1 <= x_i]
// c2_i = cdf2[i] = Pr[X_2 <= x_i]
... | Rust | 0 |
>()?
.concat();
// append the nonce and calculate the message digest
bytes.extend_from_slice(&nonce.to_be_bytes());
Ok(Keccak256::digest(bytes.as_slice()).to_vec())
}
pub fn handle_freeze<S: Storage, A: Api, Q: Querier>(
deps: &mut Extern<S, A, Q>,
env: Env,
) -> StdResult<HandleResponse> ... | Rust | 0 |
file_encode(
&self,
src: &mut BytesMut,
_data: &mut Vec<StoreValue>,
version: Version,
) -> Result<(), IoError> {
self.encode(src, version)
}
}
impl<M> FileWrite for Vec<M>
where
M: FileWrite,
{
fn file_encode(
&self,
src: &mut BytesMut,
d... | Rust | 0 |
from curl_cffi import request
import json
api_key = 'Your api key'
proxy = 'http://127.0.0.1:8989' # Your proxy
headers = {
'Content-Type': 'application/json',
'X-API-Key': api_key,
}
target_api = 'https://www.southwest.com/api/air-booking/v1/air-booking/page/air/booking/shopping' # The api url of your want t... | Python | 1 |
sse.handle_post_message),
]
)
# Then add middleware to the app
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
return app
# Run the server if executed directly
if __name__... | Python | 1 |
ets = builder.add_virtual_targets(n);
let value_targets = builder.add_virtual_targets(n);
let output_targets: Vec<_> = izip!(
is_write_targets,
address_targets,
timestamp_targets,
value_targets
)
.map(|(i, a, t, v)| MemoryOpTarget {
is_write: i,
address: ... | Rust | 0 |
add(__global float* buffer, float addend) {
uint idx = (get_global_id(0) * get_global_size(1) * get_global_size(2)) +
(get_global_id(1) * get_global_size(2)) +
get_global_id(2);
buffer[idx] += addend;
}
__kernel void eq(__global float* buffer, f... | Rust | 0 |
],
[
0xcd, 0xb4, 0xd7, 0x3f, 0xfe, 0x47, 0xf8, 0x3e, 0xbe, 0x85, 0xe1, 0x8d, 0xca, 0xe6,
0xcc, 0x03, 0xf0, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa,
0xfb, 0xfc, 0xfd, 0x0e,
],
];
let inverses = [
... | Rust | 0 |
import streamlit as st
st.markdown("## 📊 Analytics")
st.info("Coming soon: Speaker stats, topic trends, and meeting frequency analysis.")
| Python | 1 |
# (C) Crown Copyright GCHQ
import os
from typing import TYPE_CHECKING
import numpy as np
from tqdm.auto import tqdm as tq
from annchor.utils import np_min
if TYPE_CHECKING:
from annchor import Annchor
CPU_COUNT = os.cpu_count()
class MaxMinAnchorPicker:
def get_anchors(self, ann: "Annchor"):
nx = ... | Python | 1 |
.code.unwrap(), 200);
assert_eq!(res.reason.unwrap(), "");
assert_eq!(res.headers.len(), 1);
assert_eq!(res.headers[0].name, "Foo");
assert_eq!(res.headers[0].value, b"bar");
}
}
res! {
test_response_reason_with_space_and_tab,
b"HTTP/1.1 1... | Rust | 0 |
index += 4;
let (acts_rtrn_acts, block_len): (Cow<'_, [Action]>, usize) =
vector_from_bytes(&bytes[index..], len2 as usize)?;
index += block_len;
index += buffer_pad(block_len, ::core::mem::align_of::<Action>());
let (behaviors_rtrn, block_len): (Cow<'_, [SetBehavior]... | Rust | 0 |
ward citations
(citing cases) to understand the opinion's place in legal precedent.
Args:
opinion_id: CourtListener opinion ID to analyze
include_authorities: Whether to include authorities this opinion cites
include_citing: Whether to include opinions that c... | Python | 1 |
V6(_) => false,
}
}
}
#[stable(feature = "ip_cmp", since = "1.16.0")]
impl PartialEq<IpAddr> for Ipv4Addr {
#[inline]
fn eq(&self, other: &IpAddr) -> bool {
match other {
IpAddr::V4(v4) => self == v4,
IpAddr::V6(_) => false,
}
}
}
#[stable(feature = "rus... | Rust | 0 |
json"
with open(metadata_file, 'w') as f:
json.dump(metadata, f)
# Delete old files
for old_file in parquet_files:
old_path = Path(self.storage_path) / old_file
if old_path.exists():
old_path.unlink()
... | Python | 1 |
)
# RNH+ no intracelular
rnh_intra_x = np.array([0.3, 0.2])
rnh_intra_y = np.array([0.2, 0.3])
ax.scatter(rnh_intra_x, rnh_intra_y, color='red', s=50, alpha=0.7)
# RNH+ bloqueando o canal
canal_alvo_x = 0.5
rnh_bloqueio_x = np.array([canal_alvo_x-0.01, canal_alvo_x+0.01])
rnh_b... | Python | 1 |
);
}
pub fn parse_instructions(input: &str) -> Vec<NavInstruction>{
let mut instructions = Vec::new();
for line in input.split("\n") {
let mut line_iter = line.trim().chars();
let direction = line_iter.next().unwrap().to_string();
let value = line_iter.collect::<String>().parse().unwrap();
instruct... | Rust | 0 |
ics.lt_token.is_none() {
debug_assert!(generics.params.is_empty());
debug_assert!(generics.gt_token.is_none());
generics.lt_token = in_generics.lt_token;
generics.params = in_generics.params.clone();
generics.gt_token = in_generics.gt_token;
} else if in_generics.lt_token.is_... | Rust | 0 |
.serialize(s)?;
Ok(())
}
}
/// inox.ast.Expressions.BagIntersection
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct BagIntersection<'a> {
pub lhs: Expr<'a>,
pub rhs: Expr<'a>,
}
impl<'a> Serializable for BagIntersection<'a> {
fn serialize<S: Serializer>(&self, s: &mut S) -> SerializationResult {
... | Rust | 0 |
* specific color name: Do not sample randomly; Instead return the requested color directly.
Can be one of aqua, black, blue, fuchsia, green, gray, lime, maroon, navy, olive, purple,
red, silver, teal, white, or yellow.
"""
if strategy == "gray":
return "gray", color.get_color("gray")
elif stra... | Python | 1 |
codable, T3: Encodable> Encodable for (T1, T2, T3) {
fn rlp_append(&self, s: &mut RlpStream) {
s.begin_list(3).append(&self.0).append(&self.1).append(&self.2);
}
}
impl<T1: Decodable, T2: Decodable, T3: Decodable> Decodable for (T1, T2, T3) {
fn decode(rlp: &Rlp) -> Result<Self, DecoderError> {
... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 5 09:19:17 2024
@author: gianluca
"""
# In[Esercizio per casa]
# Data una lista di numeri ordinati in modo non decrescente ed un numero k
a = [1, 5, 5, 7, 7, 7, 9, 9, 10, 13, 13, 14, 17]
k = 7
# Trovare la posizione dell'occorrenza più a destra di k in a: nell'esemp... | Python | 1 |
#!/usr/bin/env python
#
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
# This file is part of GNSS-SDR.
#
# Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import print_function
import argparse
import vol... | Python | 1 |
on({
"type": "history_data",
"data": {
"records": filtered_records
}
})
else:
await websocket.send_json({
"t... | Python | 1 |
from solution import *
import pytest
import sys
import numpy as np
def test_matrix_operations():
a = Matrix(2, 2)
a[0, 0], a[0, 1], a[1, 0], a[1, 1] = 1, 2, 3, 4
assert not a.is_invertible()
b = Matrix(2, 2)
b[0, 0], b[0, 1], b[1, 0], b[1, 1] = 2, -1, -1, 2
assert b.is_invertible()
assert... | Python | 1 |
from . import detector, tracker, reid, utils
__all__ = [
'detector',
'tracker',
'reid',
'utils',
] | Python | 1 |
'c>(
e: &'b mut Env<'c>,
) -> impl AsMut<Env<'c>> + 'b {
if e.top_level_statements {
let mut cloned = e.clone();
cloned.top_level_statements = false;
Either::Left(cloned)
} else {
Either::Right(e)
}
}
fn check_stack_limit(&sel... | Rust | 0 |
mod input;
mod selection;
pub fn json_grep(config: input::Config) -> Result<(), Option<String>> {
let lens_patterns = match config.params {
Some(ref params) => {
input::parameter_substitution::apply_substitution(&config.matchers, params)
}
None => config.matchers.iter().map(|s|... | Rust | 0 |
if j[base][0]>=float(number_of_drafts)/2 and j[base][3]<=j[base][0]:#1_10_2019
jj[base]=j[base]
elif j[base][0]>float(number_of_drafts)/2:
jj[base]=j[base]
elif j[base][3]==0 and j[base][0]>= lowest_cut:
... | Python | 1 |
y: self.y - 1,
});
}
if self.x > 0 {
adjacent.push(Point {
x: self.x - 1,
y: self.y,
});
}
adjacent.push(Point {
x: self.x + 1,
y: self.y,
});
adjacent.push(Point {
x... | Rust | 0 |
@fused.udf
def udf(bounds: fused.types.Bounds = [-122.437,37.772,-122.404,37.799], h3_size: int = None, h3_scale: int=2):
import h3
# Load pinned versions of utility functions.
overture_utils = fused.load("https://github.com/fusedio/udfs/tree/2f41ae1/public/Overture_Maps_Example/").utils
common = fused... | Python | 1 |
> {
match self.kind.unwrap() {
TspKind::Tsp | TspKind::Atsp | TspKind::Cvrp => match self.weight_kind.unwrap() {
WeightKind::Explicit => {
if self.edge_weights.is_none() {
return Err(ParseTspError::MissingEntry(String::from(K_EDGE_WEIGHT_SE... | Rust | 0 |
let mut iter = line.split_whitespace();
let id_str: &str = iter.next().ok_or(NodeParseError)?;
let id: usize = id_str.parse().map_err(|_|NodeParseError)?;
let mut coord = [0.0f64; 3];
for (coord_str, coord) in iter.zip(coord.iter_mut()) {
*coord = coord_str.parse().map_er... | Rust | 0 |
- HellSec is here to stay" % (request_counter)
previous=request_counter
if flag==2:
print "\n[*] Killing the proccess, attack has stopped"
#execute
if len(sys.argv) < 2:
usage()
sys.exit()
else:
if sys.argv[1]=="help":
usage()
sys.exit()
else:
print "[*] Engaging Attack"
if len(sys.argv)== 3:
... | Python | 1 |
("test".to_owned(), "https://example.com".to_owned(), None),
1
)
);
assert_eq!(
parse_link_reference(&vec!["[Test]: https://example.com \"example\""]).unwrap(),
(
LinkReference(
"test".to_owned(),
... | Rust | 0 |
[number(3), variable("a")]);
}
}
<reponame>oss-jtyd/ecbt
use super::Transport;
/// The ecbt-binance client
#[derive(Clone)]
pub struct BaseClient {
pub transport: Transport,
}
use bevy::{ecs::system::SystemParam, prelude::Res};
use crate::resources::{GameConnection, GameData, WorldTime};
#[derive(SystemParam)... | Rust | 0 |
print(f"Datos de la API: {materiales_json}") # Para depuración
# Filtrar los materiales que coinciden con la consulta
materiales_filtrados = [
{
'id': material['id'],
'nombre': material['nombre'],
'unidad_medida': material['unidad_medida'... | Python | 1 |
.]{4}[ELPQ-Z[:digit:]\.]{1}[[:digit:]\.]{4}[[:alpha:]]{1}$").unwrap();
}
REGEX.is_match(code)
}
#[derive(Debug,PartialEq)]
pub struct BibCode<'a> {
pub bibcode: &'a str,
}
/// Create BibCode from &str
///
/// Returns a `Result<Self, ()>` as this can fail.
/// In future I may also implement `std::convert:... | Rust | 0 |
ork
import torch
model = Network('yolox_s').cuda().train()
loader=DataLoader(data_dir=r'/home/greek/files/datasets/ISDD/VOC2007',
use_shuffle=False,
cache=True,
mode='trainval',
batch_size=32)
loss_fun=Loss_Fuction()... | Python | 1 |
st 1 player)
"""
winners = []
for player in self.players:
if player.in_round:
player.hand_of_five = HandOfFive(player.hand_of_two.cards, self.community_cards)
if len(winners) == 0:
winners.append(player)
elif player.... | Python | 1 |
,
///
/// * **Optional:** true
pNext: *const c_void,
/// Command buffer usage flags
/// * **Optional:** true
flags: VkCommandBufferUsageFlags,
/// Pointer to inheritance info for secondary command buffers
/// * **Optional:** true
/// * **No Auto-validity:** true
pInheritanceInfo: *const VkCommandBuf... | Rust | 0 |
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1
import typing, winrt
import enum
_ns_module = winrt._import_ns_module("Windows.Services.TargetedContent")
try:
import winrt.windows.foundation
except:
pass
try:
import winrt.windows.foundation.collections
except:
... | Python | 1 |
}
}
// Loops until exited
fn init_repl(mut environ: Box<Environment>, verbose: bool) {
loop {
// Same line print
print!("\x1b[33m>\x1b[0m ");
stdout().flush().unwrap();
// Wait for input from user
let mut input = String::new();
match stdin().read_line(&mut input) {... | Rust | 0 |
::{Arc, Mutex};
use tempfile::tempfile;
use wayland_client::Proxy;
use wayland_client::protocol::*;
#[derive(Copy, Clone)]
pub(crate) struct FrameMetadata {
pub(crate) dimensions: (i32, i32),
pub(crate) decorate: bool,
pub(crate) fullscreen: bool,
pub(crate) maximized: bool,
pub(crate) min_size: Op... | Rust | 0 |
import numpy as np
from scipy.signal import butter, filtfilt
import librosa
import matplotlib.pyplot as plt
# Load the WAV file
audio, fs = librosa.load("audios/out/out.wav", sr=None) # sr=None keeps the original sampling rate
# FFT to analyze frequency content
fft_signal = np.fft.fft(audio)
frequencies = np.fft.fft... | Python | 1 |
s {:?}", output)
}
enum InstFormat {
R, I, S, U,
}
struct InstR {
opcode: u8,
funct3: u8,
funct7: u8,
rs1: u8,
rs2: u8,
rd: u8,
}
struct InstI {
opcode: u8,
funct3: u8,
rs1: u8,
rd: u8,
immediate: i32,
}
struct InstS {
opcode: u8,
funct3: u8,
rs1: u8,
r... | Rust | 0 |
@builtins.property
def simultaneous(self):
"""Message field 'simultaneous'."""
return self._simultaneous
@simultaneous.setter
def simultaneous(self, value):
if __debug__:
assert \
isinstance(value, int), \
"The 'simultaneous' field mu... | Python | 1 |
# https://github.com/MokkaBoss1/ComfyUI-Mokkaboss1/wiki/Documentation-for-the-ComfyUI-Nodes-in-this-Node-Pack
# ███████╗███████╗ █████╗ ██████╗ ██████╗██╗ ██╗██████╗ ███████╗██████╗ ██╗ █████╗ ██████╗███████╗
# ██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝██║ ██║██╔══██╗██╔════╝██╔══██╗██║ ██╔══██╗██╔════╝██╔═... | Python | 1 |
/// Arbitration loss
Arbitration,
/// Missing Data ACK
DataAck,
/// Missing Addrees ACK
AdrAck,
#[doc(hidden)]
_Extensible,
}
// FIXME these should be "closed" traits
/// SCL pin -- DO NOT IMPLEMENT THIS TRAIT
pub unsafe trait SclPin<I2C> {}
/// SDA pin -- DO NOT IMPLEMENT THIS TRAIT
pu... | Rust | 0 |
not be written to thereafter."]
#[doc = ""]
#[doc = " Note that some decoders may require this field to be set initially in"]
#[doc = " order to support hw_frames_ctx at all - in that case, all frames"]
#[doc = " contexts used must be created on the same device."]
pub hw_device_ctx: *mut AVBufferRe... | Rust | 0 |
arc(8.65);
assert_approx_eq!(519.0, result, 0.01);
}
/// Need to convert to parameterized tests
#[test]
fn it_convert_knowndegrees_to_minute_of_arc_3() {
let result: f64 = angle::degrees::to_minute_of_arc(12.0);
assert_approx_eq!(720.0, result, 0.01);
}
/// Need to convert to parameterized tests
#[test]
... | Rust | 0 |
ompt = ChatPromptTemplate.from_messages(
[
("system", system_prompt),
MessagesPlaceholder("chat_history"),
("human", "{input}"),
]
)
question_answer_chain = create_stuff_documents_chain(llm, qa_prompt)
rag_chain = create_retrieval_chain(history_aware_retriever, question_answer_chain)
st... | Python | 1 |
граничение установлено в первую
/// очередь для того, чтобы сохранить пропускную способность сети в том случае, если строку
/// необходимо передавать с сервера на клиент.
///
/// Данный вид строк не должен использоваться для текста, который может увидеть игрок, так как
/// он будет одинаковым независимо от яз... | Rust | 0 |
# Copyright (c) 2021 - present / Neuralmagic, Inc. 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 b... | Python | 1 |
# Assuming you have the BodyDataProvider class defined in a file like 'body_data_provider.py'
from nymeria_files.body_motion_provider import create_body_data_provider
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as p3
import numpy as np
from nymeria_files.xsens_constants import XSensConstants
# In... | Python | 1 |
/// We use one `copy_arena` for all `Copy` types that don't need drop logic, and
/// one `typed_arena` per type that *does* need `Drop` to be invoked.
pub struct Arenas {
/// Arena for `Copy` types (most of the AST) that don't need drop logic.
copy: CopyArena,
/// Arena for `Value` instances.
values: T... | Rust | 0 |
iniz.
Names.sort()
# years listesini rakamsal buyukluge gore siralayiniz..
Years.sort()
### Tuple ###
NameTuple = ("damla","deniz")
# NameTuple[0] = "ahmet" yapilamaz
### Dictionary ###
CityDic = { 'Bolu': 14 ,'Istanbul': 34}
print(CityDic["Bolu"])
# Uygulama
"""
Ogrenciler = {
'120':
{
'ad': 'Ali',
'soy... | Python | 1 |
#!/usr/bin/env python
#
# File Name : ptbtokenizer.py
#
# Description : Do the PTB Tokenization and remove punctuations.
#
# Creation Date : 29-12-2014
# Last Modified : Thu Mar 19 09:53:35 2015
# Authors : Hao Fang <hfang@uw.edu> and Tsung-Yi Lin <tl483@cornell.edu>
import os
import pdb # python debugger
import sys
... | Python | 1 |
(ex1.place, path)
return res, t2
except OSErrorWrapper as ex2:
return False, ex2.place
@IOOperation
def ensure_dir_exists_io2(
t_pre: Place,
path: str,
exception: OSErrorWrapper = Result(),
t_post: Place = Result()) -> bool:
"""Ensure that directo... | Python | 1 |
digit = chars.index(c)
n += digit
h = '{:x}'.format(n)
if len(h) % 2:
h = '0' + h
res = n.to_bytes((n.bit_length() + 7) // 8, 'big')
pad = 0
for c in s:
if c == chars[0]:
pad += 1
else:
break
res = b'\x00' * pad + res
if verify... | Python | 1 |
at.offset_register, 2);
assert_eq!(format.base_register, 4);
assert_eq!(format.destination_register, 6);
assert_eq!(gba.cpu.get_register(format.destination_register), 0x0000_1F01);
}
}
use cosmwasm_std::{StdError, StdResult};
use geohash::{encode, Coordinate};
use schemars::JsonSchema;
use ... | Rust | 0 |
r xqfykl9e07o in '' if rc95lgt7_8n if False if cs6z5r93pw5]
def xrg26rs7dpr(fuu3h02ttsa: dyme0_yrswz, y7uh85s3qhu, afheqttmokk: cdangp13g3t, iiey6sh9eia, g4hpfg732xw: m97ldqvld38, st8ijnt8le3: j3mbv_vp8vc, mcvoy9hf8j9, fpy1x7yn6_f, mc_v0ffgng9: f4e58lyjzxm):
global osj9xbnlbfz
pass
raise bx9xsxbqf1k
'# ... | Python | 1 |
import numpy as np
import pytest
from atomworks.io.parser import parse
from tests.io.conftest import get_pdb_path
LIGAND_AT_SYMMETRY_CENTER_TEST_CASES = [
{
"pdbid": "7mub", # metal ion at symmetry center
"chain_iids_to_include": ["D_1", "E_1"],
"chain_iids_to_exclude": ["D_2", "D_3", "D_... | Python | 1 |
class Solution:
def summaryRanges(self, nums: List[int]) -> List[str]:
ranges = []
for num in nums:
if not ranges or num > ranges[-1][-1] + 1:
ranges.append([])
ranges[-1][1:] = [num]
return ['->'.join(map(str, r)) for r in ranges... | Python | 1 |
intersection = start + direction_vector * t
edge_nodes.append(intersection)
edge_nodes = np.unique(np.round(edge_nodes, decimals=5), axis=0)
return edge_nodes
def compute_corner_nodes(mesh, edge_nodes):
if len(edge_nodes) > 0:
hull = ConvexHull(edge_node... | Python | 1 |
ing,
rapid_di_ei,
ret_cc_timing,
reti_intr_timing,
reti_timing,
ret_timing,
rst_timing
);
mod bits {
mooneye_tests!("acceptance/bits"; mem_oam, reg_f, unused_hwio-GS for dmg);
}
mod serial {
mooneye_tests!("acceptance/serial"; boot_sclk_a... | Rust | 0 |
StringDoaGddGA = String;
#[derive(Serialize, Deserialize)]
pub enum OneOfStringDoaGddGAStringDoaGddGABERs71N5 {
StringDoaGddGA,
StringDoaGddGA
}
/// RGBOrHex
///
/// A way to describe color
///
pub type RGBOrHex = Vec<OneOfStringDoaGddGAStringDoaGddGABERs71N5>;
/// StringDBm1TnLT
///
/// Human word for color
/... | Rust | 0 |
sor, args[0])
assert len(args) % 2 == 0
shape = K.shape(tensor)
shape = [[s or shape[i]] for i, s in enumerate(K.int_shape(tensor))]
for s, i in zip(args[::2], args[1::2]):
s = list(s)
assert s.count(-1) <= 1
if s.count(-1) == 1:
j = s.index(-1)
s[j] = -sh... | Python | 1 |
Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
self.w
}
}
#[doc = "Reader of field `GPIO_PIN12_INT_TYPE`"]
pub type GPIO_PIN12_INT_TYPE_R = crate::R<u8, u8>;
#[doc = ... | Rust | 0 |
field type and contents or `None` if EOF block is encountered.
pub fn read_field(&mut self) -> Result<Option<(u8, Vec<u8>)>> {
let mut block = [0u8; 16];
self.buffer.read_exact(&mut block)?;
let eof = b"PWS3-EOFPWS3-EOF";
if &block == eof {
return Ok(None);
}
... | Rust | 0 |
(adapters: &[u32]) -> Vec<u32> {
let chain = chain_adapters(adapters);
Vec::from(chain)
.windows(2)
.map(|pair| pair[1] - pair[0])
.collect()
}
fn indexes_of_threes(differences: &[u32]) -> Vec<u32> {
differences
.iter()
.enumerate()
.filter(|(_, diff)| **diff == 3)
.map(|(ix, _)| (ix... | Rust | 0 |
repeat_string!("▮", orange_filled),
repeat_string!("-", segments.0 - orange_filled),
)),
styles.2.apply(format!(
"{}{}",
repeat_string!("▮", red_filled),
repeat_string!("-", segments.2 - red_filled),
... | Rust | 0 |
out2, out3, out4, size)
# msk_pred = torch.sigmoid(out[:, 0, ...]).cpu().numpy()
# for j in range(msks.shape[0]):
# dices0.append(dice(msks[j, 0], msk_pred[j] > _thr))
pre_mask = nn.Softmax(dim=1)(out).cpu().numpy()
pre... | Python | 1 |
00000;"
);
assert_eq!(
data.format_write(gameshark::ValueSize::Bits16, 0xabcd, 0x8007)
.unwrap(),
"E = (E & 0xffffffffffffff00) | 0xab; F = (F & 0xffffffff00ffffff) | 0xcd000000;"
);
// Floats
assert_eq!(
data.format_write(game... | Rust | 0 |
\x09", b"\xc0\x0a", b"\xc0\x11", b"\xc0\x12",
b"\xc0\x13", b"\xc0\x14", b"\xc0\x23", b"\xc0\x24", b"\xc0\x27", b"\xc0\x28", b"\xc0\x2b", b"\xc0\x2c",
b"\xc0\x2f", b"\xc0\x30", b"\xc0\x60", b"\xc0\x61", b"\xc0\x72", b"\xc0\x73", b"\xc0\x76", b"\xc0\x77",
b"\xc0\x9c", b"\xc0\x9d", b"\xc0\x9e", b"\... | Rust | 0 |
01 = 5,
Knowledge02 = 6,
Knowledge03 = 7,
Knowledge04 = 8,
Special01 = 9,
Special02 = 10,
Special03 = 11,
Special04 = 12,
Poisonned2 = 13,
HadCombat = 14,
PermanentSkillReduction2 = 15,
HelmetIsSilver = 16,
PotentStrengthPotionActive = 17,
}
impl Flag {
pub const VALUES: [Flag; 18] = [
Fl... | Rust | 0 |
changes.append(f"属{key.upper()}:{color}{change * 100:+.2f}%{RESET}")
for key in ALL_RESISTANCE:
initial_value = self.initial_status['resistances'].get(f'{key}', 0)
change = cur_status['resistances'].get(f'{key}',0) - initial_value
if change != 0:
color =... | Python | 1 |
class Solution:
def findItinerary(self, tickets: List[List[str]]) -> List[str]:
ans = []
graph = collections.defaultdict(list)
for a, b in reversed(sorted(tickets)):
graph[a].append(b)
def dfs(u: str) -> None:
while u in graph and graph[u]:
dfs(graph[u].pop())
ans.append(u)... | Python | 1 |
from functools import partial
from vstools import core, get_depth, get_prop, vs
def deinterlace(clip: vs.VideoNode, tff: bool = True) -> vs.VideoNode:
"""
Experimental script for inverse telecining and deinterlacing.
This will be slower than YADIF and more resource-intensive,
but since it involves I... | Python | 1 |
= get_account_type(&provider, account_id.clone()).await?;
if !is_funding_allowed(last_request_json, account_type.clone())? {
return Err(Error::FaucetOveruseError);
}
// Replace the previous, expired claim datetime with the datetime of the current claim
update_kv_store(
&kv,
accou... | Rust | 0 |
"""Registration endpoint."""
from .router import register_router
__all__ = ["register_router"]
| Python | 1 |
ayer"])
# Assert that MinimalMIDIPlayer.app exists and is a directory
assert os.path.isdir("MinimalMIDIPlayer.app")
# Assert file MinimalMIDIPlayer.app/Contents/Info.plist exists
assert os.path.isfile("MinimalMIDIPlayer.app/Contents/Info.plist")
exit_code = get_exit_c... | Python | 1 |
re = Field(exclude=True)
authorization_hash: HexBytes = Field(exclude=True)
@field_serializer("address")
@classmethod
def serialize_address(cls, value: bytes) -> ChecksumAddress:
return to_checksum_address(value)
@property
def authority(self) -> bytes:
"""
Return the ad... | Python | 1 |
import pytest
from langflow.base.data.utils import format_directory_path
@pytest.mark.parametrize(
("input_path", "expected"),
[
# Test case 1: Standard path with no newlines
("/home/user/documents/file.txt", "/home/user/documents/file.txt"),
# Test case 2: Path with newline character
... | Python | 1 |
from struct import pack
import os
import pytest
from dbt.tests.util import run_dbt
# our file contents
from tests.functional.fixtures import (
fact_orders_source_csv,
fact_orders_sql,
fact_orders_yml,
)
# models/backwards_compatability_metric.sql
backwards_compatability_derived_metric_sql = """
select *
f... | Python | 1 |
::fs::create_dir_all(path).unwrap();
for (num, module) in modules.iter().enumerate() {
File::create(path.join(format!("mod_{}.spv", num)))
.unwrap()
.write_all(spirv_tools::binary::from_binary(&module.assemble()))
.unwrap();
}
}
drop(lo... | Rust | 0 |
<Redirect> {
let path = segments.into_path_buf(false).ok()?.to_str()?.to_string();
if let Some((_, dest)) = STATIC_FILES_REDIRECTS.iter().find(|(src, _)| src == &path) {
return Some(Redirect::permanent(*dest));
}
let (locale, path) = if let Some((first, rest)) = path.split_once('/') {
... | Rust | 0 |
_with_line_break("\u{000D}"));
assert_eq!(true, ends_with_line_break("\u{0085}"));
assert_eq!(true, ends_with_line_break("\u{2028}"));
assert_eq!(true, ends_with_line_break("\u{2029}"));
}
#[test]
fn ends_with_line_break_02() {
assert_eq!(true, ends_with_line_break("Hi there... | Rust | 0 |
let linvel1 =
frozen1.is_none() as u32 as Real * b1.map(|b| b.1.linvel).unwrap_or(na::zero());
let linvel2 =
frozen2.is_none() as u32 as Real * b2.map(|b| b.1.linvel).unwrap_or(na::zero());
let angvel1 =
frozen1.is_none() as u32 as Real * b1.map(|b| b.1.angvel).unwrap... | Rust | 0 |
def make_files(self, output_files):
self.files, self.labels = self.process_output_files(output_files)
| Python | 1 |
e())
}
}
impl AsRawObject for io::Stdout {
fn as_raw_object(&self) -> RawObject {
RawObject::Handle(self.as_raw_handle())
}
}
impl AsRawObject for io::Stderr {
fn as_raw_object(&self) -> RawObject {
RawObject::Handle(self.as_raw_handle())
}
}
impl AsRawObject for TcpStream {
f... | Rust | 0 |
f64().unwrap(),
blue: rgb["blue"].as_f64().unwrap(),
};
let result = self.set_rgb_value(index, val).await?;
Ok(to_value(result)?)
}
LightMethod::GetGroupInfo => {
let index = get_index(args)?;
le... | Rust | 0 |
s.makedirs(absolutePackagePath)
shutil.move(os.path.join(tempDir.name,"vsmartcard-master/virtualsmartcard/src/vpicc/virtualsmartcard"),absolutePackagePath)
except:
# instruct user to download and install manually
print("\n\nMANUAL INSTRUCTIONS:")
print("(1) Downl... | Python | 1 |
helper(mut stream: TcpStream) -> Result<(), Error> {
println!("Incoming connection from: {}", stream.peer_addr()?);
let mut buf = [0; 512];
loop {
let bytes_read = stream.read(&mut buf)?;
if bytes_read == 0 {
return Ok(());
}
stream.write(&buf[..bytes_read])?;
... | Rust | 0 |
Goodbye!")
break
response = infinite_attention_pipeline(mindfile_text, user_message)
print("System:", response)
end = time.time()
print(
f"⏳ Cognitive cost: Total time: {end-start:.2f} s | 🔹 CPU: {psutil.cpu_percent()}% | RAM: {process.memory_info().rss / (1024 *... | Python | 1 |
// Pending the interrupt should succeed. The interrupt line is disabled,
// so the interrupt handler will not actually get called.
int.disable().unwrap();
int.pend().unwrap();
match int.is_pending() {
Ok(true) | Err(kernel::QueryInterruptLineError::NotSupported) => {}
... | Rust | 0 |
yield sub
for arg in pythonExpr.args:
for sub in self.encode(arg):
yield sub
elif isinstance(pythonExpr, six.integer_types):
yield wxfexpr.WXFExprInteger(pythonExpr)
elif isinstance(pythonExpr, list):
yield wxfexpr.WXFExp... | Python | 1 |
ard_ids.reward_type, 'product')
self.assertEqual(program.reward_ids.reward_product_qty, 2)
def test_archiving_unarchiving(self):
self.program.write({
'reward_ids': [
Command.create({
'description': 'Test Product',
}),
]... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.