text string | label_name string | labels int64 |
|---|---|---|
ER).unwrap(),
&"test-dst"
);
}
}
#[test]
fn test_redirect_307_does_not_try_if_reader_cannot_reset() {
let client = reqwest::blocking::Client::new();
let codes = [307, 308];
for &code in codes.iter() {
let redirect = server! {
request: format!("\
P... | Rust | 0 |
.batch_size):
start = time()
edited_model, weights_copy = self.apply_algo(
self.model,
self.tok,
requests, # record_chunks -> requests
self.hparams,
copy=False,
return_orig_weights=True,
keep_original_weight=keep_origi... | Python | 1 |
NoOp => 0,
ApplicationCallOnComplete::OptIn => 1,
ApplicationCallOnComplete::CloseOut => 2,
ApplicationCallOnComplete::ClearState => 3,
ApplicationCallOnComplete::UpdateApplication => 4,
ApplicationCallOnComplete::DeleteApplication => 5,
}
}
fn int_to_application_call_on_com... | Rust | 0 |
.unwrap();
output_writter.write_u64::<LittleEndian>(data_offset)?;
output_writter.write_u64::<LittleEndian>(file_size)?;
output_writter.write_u64::<LittleEndian>(string_offset)?;
// Write the actual file content
output_writter
.see... | Rust | 0 |
from typing import Generator
import pytest
from graphdatascience import QueryRunner
from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2
from graphdatascience.procedure_surface.cypher.node_embedding.hashgnn_cypher_endpoints import HashGNNCypherEndpoints
from graphdatascience.tests.integrationV... | Python | 1 |
words)
with col2:
st.metric("🎯 Alta Oportunidad", alta_oportunidad)
with col3:
st.metric("📊 Volumen Promedio", f"{volumen_promedio:.0f}")
with col4:
st.metric("💰 CPC Promedio", f"${cpc_promedio:.1f}")
... | Python | 1 |
#!/usr/bin/python
import socket
import socks
SERVER_IP = '127.0.0.1'
SERVER_PORT = 1081
if __name__ == '__main__':
# Test 1: same source port IPv4
sock_out = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM,
socket.SOL_UDP)
sock_out.set_proxy(socks.SOCKS5, SERVER_IP, S... | Python | 1 |
brace_triggers_a_delayed_action_1100!(
$globals
) {
// already processed
true
} else if crate::section_1118::Cases_of_handle_right_brace_where_a_right_brace_triggers_a_delayed_action_1118!(
$globals
) {
// already processed
true
} else if crate::section_11... | Rust | 0 |
the License.
use crate::{logger::Logger, lookup::LookupData};
use anyhow::Context;
use byteorder::{ByteOrder, LittleEndian};
use futures::future::FutureExt;
use http::{request::Request, response::Response};
use hyper::{
service::{make_service_fn, service_fn},
Body, Server, StatusCode,
};
use log::Level;
use o... | Rust | 0 |
thTicketStruct {
validate_infra: StaticValidateAuthTokenStruct {
check_nonce_infra: StaticCheckAuthNonceStruct {
config: standard_nonce_config(),
clock: standard_clock(),
nonce_metadata: standard_nonce_metadata()... | Rust | 0 |
Borrow<Q>,
Q: ?Sized + Ord + ToOwned<Owned = K>,
{
let i = match self.inner.binary_search_by(|(k, _)| k.borrow().cmp(key)) {
Ok(i) => i,
Err(i) => {
self.inner.insert(i, (key.to_owned(), V::default()));
i
}
};
&mut... | Rust | 0 |
b2():
zipped_db_url = const.ZIPPED_URLS.TESTDB2
# zipped_db_url = 'https://lev.cs.rpi.edu/public/databases/testdb2.tar.gz'
return ensure_db_from_url(zipped_db_url)
def ensure_testdb_curvrank():
return ensure_db_from_url(const.ZIPPED_URLS.DF_CURVRANK)
def ensure_db_from_url(zipped_db_url):
""" Se... | Python | 1 |
WHERE DATE(outreach_date) = ?
''', (date,))
metrics['candidates_contacted'] = cursor.fetchone()[0]
# Responses received today
cursor.execute('''
SELECT COUNT(*) FROM candidates
WHERE response_status = 'responded' AND DATE(last_contacted) = ?
''... | Python | 1 |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) QuantStack.
# Distributed under the terms of the Modified BSD License.
import pytest
from traitlets import TraitError
from ..openlayers import (
Map, RasterTileLayer, GeoTIFFTileLayer, VectorTileLayer,
GeoJSON, HeatmapLayer, ImageOverlay, VideoOverlay, ... | Python | 1 |
::SecondBanana,
5 => Weapon::Fists,
195 => Weapon::Fists, // Renamed/Strange
43 => Weapon::KillingGlovesOfBoxing,
239 => Weapon::GlovesOfRunningUrgently,
310 => Weapon::WarriorsSpirit,
331 => Weapon::FistsOfSteel,
426 => Weapon::EvictionNotice,
587 => Wea... | Rust | 0 |
for index in tqdm(indices):
if index < cum_length[cum_ind]:
# index is still in the current group
count += 1
else:
# index has exceeded the current group, need to switch to the next group
group_lengths.append(count)
... | Python | 1 |
= block.get_header();
self.current_block = Some(hdr.get_previous_header());
Some(block)
}
}
}
}
/* Copyright 2021 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (th... | Rust | 0 |
import os
import sys
import pytest
from tackle.main import tackle
# from tackle.exceptions import HookCallException
if os.name == 'nt':
pytest.skip("Skipping when run from windows.", allow_module_level=True)
# No idea why this fails - same command...
# def test_provider_system_hook_command():
# context =... | Python | 1 |
not a torch.Tensor. Got {type(input)}")
if not len(input.shape) >= 2:
raise ValueError(f"Invalid input shape, we expect BxCx*. Got: {input.shape}")
if input.size(0) != target.size(0):
raise ValueError(f'Expected input batch_size ({input.size(0)}) to match target batch_size ({target.size(0)}).... | Python | 1 |
Simple(*simple / 2 + *simple % 2));
true
} else {
false
}
}
Pair(leftright) => {
let (left, right) = leftright.as_mut();
left.split() || right.split()
}
}
}
fn ma... | Rust | 0 |
rated_tokens = output[input_length:]
generated_text = tokenizer.decode(generated_tokens, skip_special_tokens=True)
generated_texts.append(generated_text)
return generated_texts
def generate_logits(self, prompts, **kwargs):
"""
Generate logits for given p... | Python | 1 |
import streamlit as st
from langchain_groq import ChatGroq
from langchain_community.utilities import ArxivAPIWrapper,WikipediaAPIWrapper
from langchain_community.tools import ArxivQueryRun,WikipediaQueryRun,DuckDuckGoSearchRun
from langchain.agents import initialize_agent,AgentType
from langchain.callbacks import Strea... | Python | 1 |
# seed.py — cleaned seeder
from app import db, Challenge, hash_flag, app
with app.app_context():
db.create_all()
challenges = [
Challenge(
id="mosaicpixels",
title="Mosaic Pixels",
description='''
You've intercepted a classified transmission from a secret cyber lab.... | Python | 1 |
KlvReader<R>) -> Result<bool, Error> {
let mut ul = Ul::Unknown;
match ul.deserialize(&mut reader) {
Ok(true) => {},
Ok(false) => {
return Ok(false)
},
Err(msg) => return Err(msg)
}
let mut length = Length{ ..Default::default() };
match length.deserialize(&mut ... | Rust | 0 |
extern crate actix_web;
/// # #[macro_use] extern crate serde_derive;
/// # use actix_web::*;
/// #
/// #[derive(Serialize)]
/// struct MyObj {
/// name: String,
/// }
///
/// fn index(req: HttpRequest) -> Result<Json<MyObj>> {
/// Ok(Json(MyObj {
/// name: req.match_info().query("name")?,
/// }))
... | Rust | 0 |
러나 두 경우에 a가 가리키는 메모리의 위치는 다르다.
생략 기호는 데이터를 덮어쓰기 때문에 변수가 가리키는 메모리의 위치는 변하지 않는다.
a=b에서는 a가 가리키는 메모리 위치가 b가 가리키는 위치와 같아진다.
실제 데이터 (4,5,6)은 복제되지 않는다는 뜻으로, '얕은 복사'라고 한다.
a[...]=b는 a의 메모리 위치는 변하지 않고, 대신 a가 가리키는 메모리에 b의 원소가 복제된다.
실제 데이터가 복제된다는 뜻으로 '깊은 복사'라고 한다.
-> 생략 기호를 이용하여 변수의 메모리 주소를 고정할 수 있음을 알 수 있다.
-> 메모리 주소를 고정함으로써... | Python | 1 |
"/"), "cnn.pt"].join("/"), &self.device))
}
}
<reponame>yunwei37/os-summer-of-code-daily
impl Solution {
pub fn game_of_life(board: &mut Vec<Vec<i32>>) {
let board1 = board.clone();
for i in 0..board1.len(){
for j in 0..board1[0].len(){
let mut count = 0;
... | Rust | 0 |
# 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 |
{"accept": "application/json", "Authorization": f"Bearer {self.api_key}"}
response = requests.get(url, headers=headers)
print(response)
if response.status_code == 200:
filme_info = response.json() # Retorna diretamente o objeto do filme
generos_filme = [genero['name'] f... | Python | 1 |
rop1
D_out[:, 12] = ini_group_size_avg1
D_out[:, 13] = time_cut
D_out[:, 14] = profile_id_save
D_out[:, 15] = match_time
D_out[:, 16] = t0_ratio
D_out[:, 17] = t_end
"""
if D[0, 13] > 0.15:
raise Exception("first row time_cut is not 0.1")
if D[-1, 13] < 0.95:
raise Exception("last row time_cut is not 1.0... | Python | 1 |
assert_(c is None)
# should converge immediately
x1, count_1 = do_solve(CU=CU, discard_C=discard_C)
if discard_C:
assert_equal(count_1, 2 + len(CU))
else:
assert_equal(count_1, 3)
assert_(count_1 <= count_0/2)
... | Python | 1 |
I_B_TRANS"),
})
} else {
return Err(HardwareError::DeviceNotFound);
}
} else {
Err(HardwareError::DeviceNotFound)
};
}
#[cfg(unix)]
#[inline]
fn read_bool(j: &serde_json::Value, s: &str) -> bool {
j[s].as_bool()... | Rust | 0 |
::ptr() }
}
}
#[doc = "Power control 1"]
pub struct POWER_S {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for POWER_S {}
impl POWER_S {
#[doc = r"Returns a pointer to the register block"]
#[inline(always)]
pub const fn ptr() -> *const power_ns::RegisterBlock {
0x5000_5000 as *const _... | Rust | 0 |
f), 0o644)
# Sync from Telegram.
elif args.sync:
# Import because the Telegram client import is quite heavy.
from .sync import Sync
if args.id and args.from_id and args.from_id > 0:
logging.error("pass either --id or --from-id but not both")
sys.exit(1)
... | Python | 1 |
else:
glow_opacity = glow_opacity / 100.0
glow_radius = int(style_glow.get('radius', 10))
glow_intensity = style_glow.get('intensity', 100)
if isinstance(glow_intensity, (int, float)) and glow_intensity <= 1:
pass
else:
glow_intensity =... | Python | 1 |
ut("r11") _,
options(nostack),
);
// initialize padding
(*statbuf).__pad0 = 0;
(*statbuf).__unused = [0; 3];
ret
}
pub unsafe fn poll(fds: *mut structs::PollFd, nfds: u64, timeout: i32) -> i32 {
let ret: i32;
asm!(
"syscall",
in("rax") numbers::POLL,
in("rdi") fds,
in... | Rust | 0 |
from test_utils import run_query
def test_h3_toparent_invalid_input():
"""Returns null with invalid data."""
result = run_query(
"""
WITH ids AS
(
-- Invalid parameters
SELECT 1 AS id, NULL as hid UNION ALL
SELECT 2 AS id, 'ff2834... | Python | 1 |
import json
class UserData:
@staticmethod
def load_data():
try:
with open("users.json", "r") as f:
return json.load(f)
except FileNotFoundError:
return {}
@staticmethod
def save_data(data):
with open("users.json", "w") as f:
j... | Python | 1 |
################################################################################
# Creme is a free/open-source Customer Relationship Management software
# Copyright (C) 2009-2022 Hybird
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... | Python | 1 |
await choking_manager.report_uninterested(thisPeer)
# return requested blocks
for block in thisPeer.pipelined_requests:
piece_picker.deselect_block(block)
# change availability
if not thisPeer.is_in_endgame:
async with async... | Python | 1 |
<T> = Pin<Box<dyn Future<Output = T> + Send>>;
impl<S, M> Service<operation::Request> for AsyncMapRequestService<S, M>
where
S: Service<operation::Request, Error = SendOperationError> + Clone + Send + 'static,
M: AsyncMapRequest,
S::Future: Send + 'static,
{
type Response = S::Response;
type Error ... | Rust | 0 |
4T3_\xe3~\x8a\xe2\xf1\xb0\
\xb9\xa9\x82@ E\x94\xecv_D`G`\xec\xe3\
\x87\xb3[:\xf0n(\xd6X\xfez\xb5H\xf2j\xd4\
\x8a\xebLlDu\x0d\xff\x0c\xd3\x14\xce\xdf\xda<}\
\x05\xe7[Y\x9e\xd6\x5c|\xad>\xb1\xd8\x1d5\x83\x9b\
q\xb2!km\x82<\xb5PK%*\xe1\xe7\xe9f\
\xba3n>\x1b\xcbvi'_]1\xf6\xa0\xdeT\
\x9e\x02tf\xd6\xc7\x1b\xc9\x86<7*\xdb\xa7... | Python | 1 |
.g. if our prefix has a length of 25
// and we've all strides sized 4, we would end up with a last
// nibble_len of 1. `ms_nibble_len` will expand then from 2 up and
// till 4.
//
// ex.:
// nibble: 1 , (nibble_len: 1)
// Iteration:
// ms_nibble_len=1,n_l=... | Rust | 0 |
:
ignore_keys = []
with torch.no_grad():
loss, logits_dict = self.compute_loss(model, inputs, return_outputs=True)
if prediction_loss_only:
return (loss, None, None)
loss = loss.detach()
logits = tuple(v for k, v in logits_dict.items() if k not ... | Python | 1 |
from typing import Final, Optional
from moto.stepfunctions.parser.api import HistoryEventType, TaskFailedEventDetails
from moto.stepfunctions.parser.asl.component.common.error_name.failure_event import (
FailureEvent,
FailureEventException,
)
from moto.stepfunctions.parser.asl.component.common.error_name.state... | Python | 1 |
= 8192;
pub const FPDF_RENDER_NO_SMOOTHPATH: u32 = 16384;
pub const FPDF_REVERSE_BYTE_ORDER: u32 = 16;
pub const FPDF_CONVERT_FILL_TO_STROKE: u32 = 32;
pub const FPDFBitmap_Unknown: u32 = 0;
pub const FPDFBitmap_Gray: u32 = 1;
pub const FPDFBitmap_BGR: u32 = 2;
pub const FPDFBitmap_BGRx: u32 = 3;
pub const FPDFBitmap_... | Rust | 0 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='home'),
path('signup/', views.signup_view, name='signup'),
path('login/', views.login_view, name='login'),
path('logout/', views.logout_view, name='logout'),
path('dashboard/', views.logout_view, name='dashb... | Python | 1 |
0x9d, 0x5b, 0x7f, 0x63, 0x46, 0xee, 0xb6, 0x5f, 0xda,
0x0b, 0x07, 0x3a, 0x0c, 0x5f, 0x22, 0xe0, 0xe8, 0xf5, 0x48, 0x32, 0x28, 0xf0, 0x18,
0xd2, 0xc2, 0xf7, 0x11, 0x4c, 0x5d, 0x8c, 0x30, 0x8d, 0x0a, 0xbf, 0xc6, 0x98, 0xd8,
0xc9, 0xa6, 0xdf, 0x30, 0xdc, 0xe3, 0xbb, 0xc4, 0x6f, 0x95, 0... | Rust | 0 |
)
}
#[derive(Debug, Deserialize, Serialize)]
pub struct VerifyResponse {
pub verified: bool,
pub error: Option<String>,
}
impl VerifyResponse {
pub fn validate(&self) {
assert!(self.verified);
assert!(self.error.is_none());
}
}
<reponame>babaeee/hakim
use crate::brain::{self, TermRef}... | Rust | 0 |
if self.operador == "==":
return Symbol(line=self.line, col=self.col, value=op1.value == op2.value, type=ExpressionType.BOOLEAN)
# DIFERENTE
if self.operador == "!=":
return Symbol(line=self.line, col=self.col, value=op1.value != op2.value, type=ExpressionType.BOOLEAN)
... | Python | 1 |
import socket
computerName = socket.getfqdn()
print("This computer is: " + computerName) | Python | 1 |
orrow checker rules
// also the size matches
let payload = &storage[COUNTER_SIZE..COUNTER_SIZE + SLOT_SIZE];
let payload = unsafe { &*(payload.as_ptr() as *const [u8; SLOT_SIZE]) };
let crc = {
let mut array = [0; CRC_SIZE];
array.copy_from_slice(&storage[COUNTER... | Rust | 0 |
?, LineRange::RangeFull(..));
assert_eq!(LineRange::from_str(Some("0"))?, LineRange::Range(0..1));
assert_eq!(LineRange::from_str(Some("1"))?, LineRange::Range(0..1));
assert_eq!(LineRange::from_str(Some("5"))?, LineRange::Range(4..5));
assert_eq!(LineRange::from_str(Some("5:"))?, LineRa... | Rust | 0 |
const MSG6: &str = "No more cards in the Deck";
pub struct TPanel {
pub prize: String,
pub value: usize,
pub bets: isize,
pub wins: isize,
pub msg: String,
pub credits: isize,
}
impl TPanel {
pub fn new_panel() -> Self {
Self {
prize: "".to_string(),
value:... | Rust | 0 |
..= 64]` will implement the trait; wider arrays will need to
reborrow as slices `[T]` in order to use the slice implementation.
If you have a type that contains a [`BitRegister`] type that can be viewed with
this trait, then you can implement this trait by forwarding to the interior
view.
[`BitSlice`]: crate::slice::... | Rust | 0 |
ute bandwidth
// Size of an IPv6 header in bytes.
//const IPV6_HEADER_SIZE: u32 = 40;
/// Events to inform a resender of the current state of a connection.
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
pub enum ResenderState {
/// The connection is starting, reduce the timeout time.
Connecting,
/// The handsha... | Rust | 0 |
(e, f),
Kind::TooManyRedirects => f.write_str("Too many redirects"),
Kind::RedirectLoop => f.write_str("Infinite redirect loop"),
Kind::Status(ref code) => {
let prefix = if code.is_client_error() {
"Client Error"
} else if code.is_... | Rust | 0 |
a: String::from("Entonces habló, y levantó un viento tempestuoso, *"),
b: String::from("que alzaba las olas hasta lo alto.")
},
PsalmVerse {
number: 26,
a: String::from("Subían al cielo, bajaban al abismo; *"),
b: String::from("se derretían sus corazones ante el peligro.")
},
... | Rust | 0 |
save_to = save_to.join(DEFAULT_KEY_NAME);
}
let priv_u8 = key
.private_key_to_pem()
.map_err(|source| CryptoError::OpenSSLError { source })?;
let pub_u8 = key
.public_key_to_pem()
.map_err(|source| CryptoError::OpenSSLError { source })?;
// error will automatically be wrapped... | Rust | 0 |
ECURSION_DEPTH)
);
}
#[test]
fn refracted_color_with_refracted_ray() {
use crate::intersect::Intersection;
use crate::pattern::Pattern;
let mut w: World = Default::default();
{
let a = w.first_mut().unwrap();
a.material_mut().ambient = 1.0;
a.material_mut().pattern = Some(P... | Rust | 0 |
RRegField WWRegField }
/// SVC call active bit.
SVCALLACT { 7 1 RRRegField WWRegField }
/// Usage fault exception active bit.
USGFAULTACT { 3 1 RRRegField WWRegField }
/// Bus fault exception active bit.
BUSFAULTACT { 1 1 RRRegField WWRegField }
/// Memory management fault exception active b... | Rust | 0 |
error)
}
}
impl From<IoError> for Error {
fn from(error: IoError) -> Error {
Error::IO(error)
}
}
impl ::std::fmt::Display for Error {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
use crate::Error::*;
match *self {
Http(ref e) => writeln!(f,... | Rust | 0 |
elf_header.shdr_strtab.get(h.sh_name).unwrap().unwrap(),
h.sh_addr,
h.sh_addr + h.sh_size,
);
for (i, b) in program_elf[h.file_range()].iter().enumerate() {
mem.w8(h.sh_addr as u32 + i as u32, *b);
}
}
// setup e... | Rust | 0 |
")]
fn retrieve(id: PasteID) -> Option<Content<File>> {
let filename = format!("upload/{id}", id = id);
let metadata_filename = format!("upload/{id}.metadata.json", id = id);
let mut metadata_serialized = String::new();
match File::open(&metadata_filename) {
Err(_) => 0usize,
Ok(mut f... | Rust | 0 |
.info(f"For sizing function #{idx1}")
# interpolate all finer nests onto coarse func and enforce gradation rate
for k, finer in enumerate(list_of_grids[idx1 + 1 :]):
logger.info(
f" Interpolating sizing function #{idx1 + 1 + k} onto sizing function #{idx1}"
)
... | Python | 1 |
coco_nodes: Vec<coconodes::CocoPresence>,
pub mix_nodes: Vec<mixnodes::MixNodePresence>,
pub mix_provider_nodes: Vec<providers::MixProviderPresence>,
pub gateway_nodes: Vec<gateways::GatewayPresence>,
}
impl NymTopology for Topology {
// TODO: this will need some changes to not imply having to make an... | Rust | 0 |
#prognoza.py
import pandas as pd
import matplotlib.pyplot as plt
from statsmodels.tsa.arima.model import ARIMA
from statsmodels.tsa.statespace.sarimax import SARIMAX
# Wczytaj dane
df = pd.read_csv("portfel.csv", index_col='Data', parse_dates=True)
# Definiuj parametry modelu
best_params = {
'ALR': (0, 3, 1),
... | Python | 1 |
\n\nFor information about available fields see [trig6_result_7_6](trig6_result_7_6) module"]
pub type TRIG6_RESULT_7_6 = crate::Reg<u32, _TRIG6_RESULT_7_6>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _TRIG6_RESULT_7_6;
#[doc = "`read()` method returns [trig6_result_7_6::R](trig6_result_7_6::R) reader structure"]
... | Rust | 0 |
numeric(true);
max_spinner.set_hexpand(true);
max_spinner.set_value(model.config.max_bias_current.raw() * 1_000_000.0);
hbox.add(&max_spinner);
hbox.add(>k::Label::new(Some("µA")));
connect!(
relm,
min_spinner,
connect_value_changed(btn),
... | Rust | 0 |
user, contact02.is_user)
self.assertEqual(first_name1, contact02.first_name)
def test_merge_user_contact03(self):
"Cannot merge 2 Contacts that represent 2 users."
user = self.login_as_root_and_get()
contact01 = user.linked_contact
contact02 = self.create_user().link... | Python | 1 |
from pseudonymizer.cryptocontainers.DBContainer import DBContainer
from pseudonymizer.encryptionPseudonyms.pyMySQLQuery import PyMySQLQuery
from typing import *
class JoinTargetTables(PyMySQLQuery):
"""
매핑테이블의 일련번호를 기준으로 결합대상 가명정보를 결합하는 클래스
Parameters
----------
pw, serverIP, port_num, user_n... | Python | 1 |
_rsrv_8e_8f: [u8; 2],
fifos: AtomicU16,
fmt: AtomicU16,
_rsrv_94_97: [u8; 4],
bdpl: AtomicU32,
bdpu: AtomicU32,
}
impl StreamDescriptorRegisterSet {
#[inline]
pub fn get_control(&self) -> StreamDescriptorControl {
StreamDescriptorControl::from_bits_truncate(
self.ctl_lo.... | Rust | 0 |
l']
print(f"\n[艺术文字节点-填充渐变] 类型: {fill.get('type')}")
print(f"[艺术文字节点-填充渐变] 方向: {fill.get('direction')}")
print(f"[艺术文字节点-填充渐变] 颜色: {fill.get('colors', [])}")
# 外发光调试
if 'glow' in style_data:
glow = style_data['glow']
... | Python | 1 |
results.append(tweet.content)
except Exception as e:
log_warning(f"[x_interface] Error searching: {e}")
return results
results = await asyncio.to_thread(fetch)
for r in results:
log_info(f"[x_interface] {r}")
return result... | Python | 1 |
env = multi_agent_to_single_agent(env)
# wrap around environment for rsl-rl
env = RslRlVecEnvWrapper(env)
# create runner from rsl-rl
runner = OnPolicyRunner(env, agent_cfg.to_dict(), log_dir=log_dir, device=agent_cfg.device)
# write git state to logs
runner.add_git_repo_to_log(__file__... | Python | 1 |
import random
def generate_matrix(seed, n):
random.seed(seed)
return [[random.randint(0, 100) for _ in range(n)] for _ in range(n)]
def transpose_matrix(matrix):
n = len(matrix)
return [[matrix[j][i] for j in range(n)] for i in range(n)]
# 输入种子数和矩阵大小
x, n = map(int, input().split())
# 生成随机方阵
matrix ... | Python | 1 |
# Copyright (c) 2025 Kodo Robotics
#
# 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 wri... | Python | 1 |
Identifier(&'a str),
CompoundIdentifier(&'a [String]),
Expr(&'a Expr),
TwoExprs(&'a Expr, &'a Expr),
ThreeExprs(&'a Expr, &'a Expr, &'a Expr),
MultiExprs(Vec<&'a Expr>),
Query(&'a Query),
QueryAndExpr { query: &'a Query, expr: &'a Expr },
}
impl<'a> From<&'a Expr> for PlanExpr<'a> {
... | Rust | 0 |
control message",
)),
None => Err(io::Error::new(
io::ErrorKind::InvalidData,
"no control message found",
)),
}
}
pub fn send_fds<S>(stream: &S, fds: &[RawFd]) -> io::Result<usize>
where
S: AsRawFd,
{
use nix::sys::socket::{sendmsg, ControlMessage, MsgFlags};... | Rust | 0 |
.
// Also use canonical == 0 instead of non-canonical u<= 0.
// FIXME(eddyb) check the actual primitive type here.
bx.icmp(IntPredicate::IntEQ, relative_discr, bx.cx().const_null(niche_llty))
} else {
let relative_max = bx.c... | Rust | 0 |
r': 'work_dirs',
'ex_name': 'Debug',
'use_gpu': True,
'fp16': False,
'torchscript': False,
'seed': 42,
'diff_seed': False,
'fps': False,
'empty_cache': True,
'find_unused_parameters': False,
'broadcast_buffers': True,
'resume_from':... | Python | 1 |
import matplotlib.pyplot as plt
import numpy as np
# Commonly used window functions are found in
# the scipy.signal.windows module.
from scipy.signal.windows import hann
# Calculate the DTFT of signal x using zero-padded FFT
# at N evenly spaced points between -\pi and \pi.
def dft_dtft(x, N, sample_rate=1e3):
# ... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Intel Corporation
#
# 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
#
# Unl... | Python | 1 |
"""
DEX pool metadata handler implementations.
This module contains the implementation of various pool metadata handlers
for different DEX protocols.
"""
# Registry of pool handlers
from ..registry import pool_handler_registry
from .base import PoolFetcher
from .default import DefaultPoolFetcher
from .uniswap_v4 impo... | Python | 1 |
(cx)
}
}
struct ChannelSender<P> {
sender: Sender<MuxPacket<P>>,
statistics: Arc<ChannelStatisticsData>,
}
struct ChannelReceiver<P> {
channel: PacketChannel,
receiver: Receiver<MuxPacket<P>>,
statistics: Arc<ChannelStatisticsData>,
}
impl<P> Stream for ChannelReceiver<P>
where
P: Packet ... | Rust | 0 |
import streamlit as st
import pandas as pd
import os
import numpy as np
import sys
# プロジェクトのルートディレクトリをモジュール検索パスに追加
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from src.components.charts.DailyReportAnalysisCharts import DailyReportAnalysisCharts
from src.components.charts.HourlyReport... | Python | 1 |
::cmp::max(0, value))
}),
device_config: DeviceConfiguration::builder()
.color_format(format_resolution.0)
.color_resolution(format_resolution.1)
.depth_mode(to_depth_mode(args.value_of("depth-mode").unwrap())?)
.camera_fps(to_frame... | Rust | 0 |
>;
}
<filename>src/adc0/ctl.rs
#[doc = r"Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r"Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::CTL {
#[doc = r"Modifies the contents of the register"]
#[inline(always)]
pub fn modify<F>(&self, f: F)
where
... | Rust | 0 |
from tests.base_case import ChatBotTestCase
from chatterbot.trainers import ChatterBotCorpusTrainer
class ChatterBotCorpusTrainingTestCase(ChatBotTestCase):
"""
Test case for training with data from the ChatterBot Corpus.
Note: This class has a mirror tests_django/integration_tests/
"""
def setU... | Python | 1 |
import os
import matplotlib
import numpy as np
import pandas as pd
import yasa
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import seaborn as sns
folder_path = r'C:\Users\Jonas\OneDrive\Bachelorarbeit\open-earable-ExG-sleep-analysis\recordings\open-earable-ExG\AppVersion4_BLE\P011\250111\rawData'
filtered_... | Python | 1 |
doesn't hold");
}
}
stack.push_back(neighbour);
}
}
}
true
}
use std::fmt::Debug;
use std::ops::Add;
/// Associated data that can be used for measures (such as length).
pub trait Measure: Debug + PartialOrd + Add<Self, Output = Self> +... | Rust | 0 |
rease => write!(f, "-"),
}
}
}
#[cfg(test)]
mod tests {
use super::*;
use chain_core::state::account::ConfidentialInit;
use chain_core::state::tendermint::TendermintValidatorPubKey;
use chain_core::tx::fee::Fee;
use std::str::FromStr;
mod staking_diff_field {
use super::*;
... | Rust | 0 |
CPU_EXIT_SIGNAL) {
Ok(_) => {}
Err(e) => {
error!(
"killing VCPU{} thread({}) failed: {}",
self.id(),
self.tid(),
e
);
}
},
... | Rust | 0 |
import cv2
import mediapipe as mp
import numpy as np
import requests
mp_drawing = mp.solutions.drawing_utils
mp_drawing_styles = mp.solutions.drawing_styles
mp_pose = mp.solutions.pose
# For static images:
IMAGE_FILES = []
BG_COLOR = (192, 192, 192) # gray
with mp_pose.Pose(
static_image_mode=True,
model_co... | Python | 1 |
item(), "lr": lr_scheduler.get_last_lr()[0]}
progress_bar.set_postfix(**logs)
accelerator.log(logs, step=global_step)
if global_step >= args.max_train_steps:
break
# Create the pipeline using the trained modules and save it.
accelerator.wait_for_everyone()
... | Python | 1 |
of ABCI into four cloneable
/// component services, each implementing one category of ABCI requests. See the
/// module documentation for details.
///
/// The `bound` parameter bounds the size of each component's request queue. For
/// the same reason as in Tower's [`Buffer`](tower::buffer::Buffer) middleware,
/// it'... | Rust | 0 |
gradient = self.estimate_gradient::<F>(v, f);
g(self.s.vertex_mut(v), gradient);
}
}
}
#[cfg(test)]
mod test {
use super::delaunay_basic::BasicDelaunaySubdivision;
use super::{FloatDelaunayTriangulation, IntDelaunayTriangulation};
use crate::testutils::*;
use crate::traits::{Ha... | Rust | 0 |
from setuptools import setup
setup(
name='hx711',
version='0.1.0',
description='HX711 Python Library for Raspberry Pi',
py_modules=['hx711'],
install_requires=['Rpi.GPIO'],
)
| Python | 1 |
ransformESNType),
/// Unknown tranform (type,id)
Unknown(IkeTransformType,u16),
}
impl<'a> From<&'a IkeV2RawTransform<'a>> for IkeV2Transform {
fn from(r: &IkeV2RawTransform) -> IkeV2Transform {
match r.transform_type {
IkeTransformType::EncryptionAlgorithm => {
IkeV2Tra... | Rust | 0 |
},
rust_name: $rust_name:tt,
ruby_name: $ruby_name:tt,
attributes: { $($attributes:tt)* },
struct: { $($struct:tt)* }
} => {
#[repr(C)]
$($attributes)*
$($pub)* struct $rust_name {
helix: $crate::Metadata,
$($struct)*
}
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.