text string | label_name string | labels int64 |
|---|---|---|
ode_length, torch.ones_like(resets), resets
)
resets = torch.where(object_height <= 0.3, torch.ones_like(resets), resets)
successes = torch.where(
goal_object_dist <= success_tolerance,
torch.where(
flag >= 1, torch.ones_like(successes), successes
),
torch.zeros_l... | Python | 1 |
21, 0x4c, 0xb7,
0xe3, 0x9f, 0xf2, 0xdb, 0x66, 0x97, 0x06, 0x01, 0x01, 0x00, 0x4e, 0x76, 0x32, 0x0e, 0xa2, 0xb2,
0x9f, 0x1c, 0xe0, 0x54, 0xff, 0x5c, 0xc7, 0xc4, 0x1b, 0xbc, 0x82, 0x8c, 0xfa, 0x05, 0xb7, 0xf3,
0x58, 0x0a, 0xa9, 0x12, 0x41, 0xb2, 0x4a, 0xfa, 0x3f, 0x0a, 0xc2, 0x30, 0xf3, 0xd7, 0x23, 0x28,
... | Rust | 0 |
s()
return
# 初始化
if task_name == 'sorting_program_sawyer21':
go_to_initial_position()
elif task_name == 'sorting_program_sawyer22':
# go_to_waypoint0_position()
x = 1
wrist_cam_Subscriber = rospy.Subscriber("/camera/color/image_raw", Image, get_observations) # wrist rgb
endpoi... | Python | 1 |
ache.html#method.get_cloned
/// [`boxed`]: ../boxed/index.html
/// [`get_mut`]: struct.Cache.html#method.get_mut
///
pub fn get_ref<AP, B: ?Sized>(
&mut self,
promise: &AP
) -> Result<&B::Artifact, B::Err>
where
ArtCan: CanRef<B::Artifact>,
B: Builder<ArtCan, BCan>,
BCan: Can<AP::Builder>,
... | Rust | 0 |
the socket.
///
/// Note that this will allocate a new vector for each message part; for many applications it
/// will be possible to process the different parts sequentially and reuse allocations that
/// way.
fn recv_multipart(&self, flags: i32) -> io::Result<Vec<Vec<u8>>> {
if let Async:... | Rust | 0 |
))
}
pub(super) fn is_c40(&self) -> bool {
matches!(self.plan, PlanImpl::C40(_))
}
pub(super) fn is_x12(&self) -> bool {
matches!(self.plan, PlanImpl::X12(_))
}
/// Get the total cost after switching to the given mode.
pub(super) fn cost_for_switching_to(&self, other: Enco... | Rust | 0 |
executed: Vec<Cuboid>,
}
impl Reactor2 {
fn new() -> Reactor2 {
Reactor2 {
executed: Vec::new(),
}
}
fn execute(&mut self, cuboid: Cuboid) {
let mut newly_executed = Vec::new();
for other in self.executed.iter() {
if let Some(overlap) = cuboid.ge... | Rust | 0 |
nnect_sentinelone_agent_info"]["registeredAt"] = timedate(
properties["connect_sentinelone_agent_info"]["registeredAt"]
)
if properties["connect_sentinelone_agent_info"]["lastActiveDate"]:
properties["connect_sentinelone_agent_info"]["lastA... | Python | 1 |
import streamlit as st
import matplotlib.pyplot as plt
import pandas as pd
from PIL import Image
import os
st.header("Periodic Table Explorer")
# Title
st.sidebar.title("Sidebar Menu")
page = st.sidebar.radio("Select Page", ["Search", "Radius Trends","ionization_energy Trends","electron_affinity Trends"])
# Search page... | Python | 1 |
0, 0, 1 => 0, 0, 1;
0, 1, 0 => 0, 1, 0;
0, 1, 1 => 0, 1, 1;
1, 0, 0 => 1, 0, 0;
1, 0, 1 => 1, 0, 1;
1, 1, 0 => 1, 1, 1;
1, 1, 1 => 1, 1, 0;
});
}
#[test]
fn operate_ccnot_with_redundancy() {
let mut sim = rusq::simulator::QuantumSimulator::new(10);
let qubits... | Rust | 0 |
# Problem link - https://leetcode.com/problems/number-of-substrings-containing-all-three-characters/
# Solution - https://www.youtube.com/watch?v=xtqN4qlgr8s&list=PLgUwDviBIf0q7vrFA_HEWcqRqMpCXzYAL&index=7
class Solution:
@staticmethod
def _count_less_than_equal_to(string, k):
"""
This met... | Python | 1 |
doc = "Bit 3 - FULL0"]
#[inline(always)]
pub fn full0(&self) -> FULL0_R {
FULL0_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bits 0:1 - FMP0"]
#[inline(always)]
pub fn fmp0(&self) -> FMP0_R {
FMP0_R::new((self.bits & 0x03) as u8)
}
}
impl W {
#[doc = "Bit 5 - RFOM0"]... | Rust | 0 |
from pathlib import Path
from collections import defaultdict
from typing import Dict, Union, List
_FileTree = Dict[str, Union["_FileTree", None]]
def generate_tree_visualizer(root_path: Path, paths: List[Path]) -> str:
"""
Generates a visual tree structure of the provided paths relative to a root directory.
... | Python | 1 |
)(input)
}
fn header_v1(input: &[u8]) -> IResult<&[u8], HeaderV1> {
preceded(
pair(tag(V1_MAGIC), newline),
map(
pair(
terminated(separated_nonempty_list(newline, recipient_line), newline),
preceded(
... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
@Createtime: 2024-08-05 10:15
@Updatetime: 2025-05-09 15:51
@description: 从SQLite数据库中读取漏洞和备案信息
"""
import sqlite3
import pandas as pd
from datetime import datetime
class DbDataReader:
def __init__(self, db_path):
self.db_path = db_path
def read_Icp_from_db(self):
"... | Python | 1 |
import pytest
from playwright.sync_api import sync_playwright
from tests.main_page import MainPage
@pytest.fixture(scope="module")
def browser():
with sync_playwright() as p:
browser = p.chromium.launch()
yield browser
browser.close()
def test_check_links(browser):
page = browser.new... | Python | 1 |
them.
pub fn branches(&self) -> Vec<&Miniscript<Pk, Ctx>> {
match self.node {
Terminal::PkK(_) | Terminal::PkH(_) | Terminal::Multi(_, _) => vec![],
Terminal::Alt(ref node)
| Terminal::Swap(ref node)
| Terminal::Check(ref node)
| Terminal::DupIf(r... | Rust | 0 |
# synapse_desk/pages/12_📚_Playbook.py
import streamlit as st
from view_utils import setup_sidebar
from utils.playbook_utils import (
get_playbook_setups, add_playbook_setup,
update_playbook_setup, delete_playbook_setup
)
from utils.config import yahoo_finance_map
# --- CONFIGURAÇÃO DA PÁGINA E AUTENTICAÇÃO -... | Python | 1 |
import pytest
from sqlalchemy.dialects import registry
registry.register("altibase.pyodbc", "sqlalchemy_altibase.pyodbc", "AltibaseDialect_pyodbc")
pytest.register_assert_rewrite("sqlalchemy.testing.assertions")
| Python | 1 |
in order.
#[cfg_attr(feature = "clippy", allow(needless_range_loop))]
fn bubble_sort<T: PartialOrd>(v: &mut [T]) {
(1..v.len() + 1).rev().all(|length| {
let mut changes = 0;
for index in 0..length - 1 {
if v[index] > v[index + 1] {
changes += 1;
v.swap(i... | Rust | 0 |
# This script generates a Python interface for an Apple Macintosh Manager.
# It uses the "bgen" package to generate C code.
# The function specifications are generated by scanning the mamager's header file,
# using the "scantools" package (customized for this particular manager).
import string
# Declarations that cha... | Python | 1 |
import cv2 as cv
import numpy as np
img = cv.imread("C:\\Users\\Japjot Singh\\Desktop\\Kotlin\\python-backup-codes\\OpenCV\\images\\2.jpeg")
cv.imshow('Original img',img)
gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY)
cv.imshow('Gray',gray)
# Single Thresholding
threshold , thresh = cv.threshold(gray,150,255,cv.THRESH_B... | Python | 1 |
# Optimal Solution
class Solution(object):
def lowerBound(self, nums, target):
n = len(nums)
low = 0
high = n - 1
lo_bo = -1
while low <= high:
mid = (low + high) // 2
if nums[mid] >= target:
lo_bo = mid
high = mid - 1... | Python | 1 |
ta portion of a
// cmsghdr. The pointer returned cannot be assumed to be
// suitably aligned for accessing arbitrary payload data types.
// Applications should not cast it to a pointer type matching the
// payload, but should instead use memcpy(3) to copy data to or
... | Rust | 0 |
if "pred_coords" in show:
# Second draw a green box and x/y coordinate based on predicted coordinates
# The predicted coordinates are the raw output of the model,
# Whereas the predicted element is the inferred element from the predicted coordinates
if pred["args"].get("x") and pred["a... | Python | 1 |
to_windows_str(&program.as_ref().to_string_lossy());
let mut command_str = to_windows_str(&command);
let mut cwd = to_windows_str(cwd);
assert_win_success!(CreateProcessW(
application_str.as_mut_ptr(),
command_str.as_mut_ptr(),
ptr::null_mut(),
... | Rust | 0 |
2018/Reflection_Models/Microfacet_Models#TheTorrancendashSparrowModel
pub trait MicrofacetDistribution {
/// Evaluates the distribution function for the given surface normal
fn d(&self, wh: Vec3<f32>) -> f32;
/// Evaluates the invisible masked microfacet area per visible microfacet area
fn lambda(&self... | Rust | 0 |
adc12mctl6::ADC12MCTL6_SPEC>,
#[doc = "0x17 - ADC12 Memory Control 7"]
pub adc12mctl7: crate::Reg<adc12mctl7::ADC12MCTL7_SPEC>,
#[doc = "0x18 - ADC12 Memory Control 8"]
pub adc12mctl8: crate::Reg<adc12mctl8::ADC12MCTL8_SPEC>,
#[doc = "0x19 - ADC12 Memory Control 9"]
pub adc12mctl9: crate::Reg<ad... | Rust | 0 |
low (`OF=1`)
o = 1,
/// Not overflow (`OF=0`)
no = 2,
/// Below (unsigned) (`CF=1`)
b = 3,
/// Above or equal (unsigned) (`CF=0`)
ae = 4,
/// Equal / zero (`ZF=1`)
e = 5,
/// Not equal / zero (`ZF=0`)
ne = 6,
/// Below or equal (unsigned) (`CF=1 or ZF=1`)
be = 7,
/// Above (unsigned) (`CF=0 and ZF=0`)
a ... | Rust | 0 |
nt);
let tech_count = reader.read_u32() as usize;
w3i.techs = reader.read_vec::<TechAvailability>(tech_count);
let random_unit_table_count = reader.read_u32() as usize;
w3i.random_unit_tables = reader.read_vec::<RandomUnitTable>(random_unit_table_count);
if w3i.version.is_tft(){... | Rust | 0 |
_T += 1;
DROP += 1;
}
}
}
fn g(ref _t: T) {}
fn do_test() {
let s = S;
f(s);
unsafe {
assert_eq!(1, DROP);
assert_eq!(1, DROP_S);
}
let t = T { i: 1 };
g(t);
unsafe { assert_eq!(1, DROP_T); }
}
fn main() {
do_test();
unsafe {
assert_e... | Rust | 0 |
, Debug)]
pub struct TraceChainEntryV17 {
pub next_index: u32,
pub block_load_count: u32,
#[serde(serialize_with = "serialize_tc_flags")]
pub flags: TcFlag,
pub unknown2: u8,
#[serde(serialize_with = "serialize_tc_usage")]
pub usage: u8,
#[serde(serialize_with = "serialize_tc_prefetched"... | Rust | 0 |
u64::from_ne_bytes(value);
if let Some(key) = key_to_value(key as u64) {
current.insert(key, value as u32);
}
// clear the source counter
let _ = table.set(&mut entry.key, &mut [0_u8; 8]);
}
current
}
#[cfg(feature = "bpf")]
pub fn perf_table_to_map(table: &bcc::t... | Rust | 0 |
tetime.relative_time_patterns", default={})
# 检查各种相对时间模式
for time_type, patterns in relative_time_patterns.items():
for pattern in patterns:
try:
if re.search(pattern, text_lower, re.IGNORECASE):
if time_type in ["just_now", "today"]:
... | Python | 1 |
let (b, t) = be_u8(buf)?;
len8 = t;
(b, t as u16)
}
};
// Explicitly read the attribute here and pass the attribute only buffer to the child parser.
let (buf, pa_buf) = nom::bytes::complete::take(len)(buf)?;
let (_, res): (_, PathAttribute) = m... | Rust | 0 |
.values[1].value,
"Bad value, adding a value with add"
);
assert_eq!(
"bar", status.values[2].value,
"Bad value, adding a string with add"
);
assert_eq!(
"toto", status.values[0].key,
"Bad label, adding a string with add"
);
assert_eq!(
"baba", sta... | Rust | 0 |
;
pub use kind::*;
pub use value::*;
// 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 t... | Rust | 0 |
import logging
import pwnagotchi.ui.fonts as fonts
from pwnagotchi.ui.hw.base import DisplayImpl
class WaveshareV2(DisplayImpl):
def __init__(self, config):
super(WaveshareV2, self).__init__(config, 'waveshare_2')
def layout(self):
fonts.setup(10, 8, 10, 35, 25, 9)
self._layout['widt... | Python | 1 |
(20, vec![(1, 0), (3, 20)]),
);
assert_eq!(
voters.iter().find(|x| x.who == 10).map(|v| (
v.who,
v.edges.iter().map(|e| (e.who, e.weight)).collect::<Vec<_>>()
)).unwrap(),
(10, vec![(1, 0), (2, 10)]),
);
// finish the round.
winner.borrow_mut().elected = true;
winner.borrow_mut().round = ... | Rust | 0 |
'''You can loop over all the values in a tuple using a for loop'''
integers=(1,2,2,3,4)
for integer in integers:
print(integer)
'''Although you can’t modify a tuple, you can assign a new value to a variable
that represents a tuple. So if we wanted to change our dimensions, we could
redefine the entire tu... | Python | 1 |
import pytest
from mlagents.plugins.stats_writer import register_stats_writer_plugins
from mlagents.trainers.settings import RunOptions
from mlagents_plugin_examples.example_stats_writer import ExampleStatsWriter
@pytest.mark.slow
def test_register_stats_writers():
# Make sure that the ExampleStatsWriter gets r... | Python | 1 |
2::datatypes::DataType::Decimal(15, 5)),
) as std::sync::Arc<dyn arrow2::array::Array>,
std::sync::Arc::new(
arrow2::array::PrimitiveArray::from(marketpricefloor_array)
.to(arrow2::datatypes::DataType::Decimal(15, 5)),
) as std:... | Rust | 0 |
# Copyright 2015, Pinterest, 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 |
_base_ = [
'../_base_/models/pspnet_r50-d8.py',
'../_base_/datasets/cityscapes_769x769.py', '../_base_/default_runtime.py',
'../_base_/schedules/schedule_80k.py'
]
crop_size = (769, 769)
data_preprocessor = dict(size=crop_size)
model = dict(
data_preprocessor=data_preprocessor,
decode_head=dict(alig... | Python | 1 |
ectored<'a>(
&self,
bufs: &'a [io::IoSlice<'a>],
addr: &socket2::SockAddr,
cx: &mut Context<'_>,
) -> Poll<io::Result<usize>> {
ready!(EventedFd::poll_writable(&self.0, cx))?;
match self.0.as_ref().send_to_vectored(bufs, addr) {
Err(e) => {
... | Rust | 0 |
_height
scaled_width, scaled_height = int(img_width * scale_h), target_height
img = img.resize((scaled_width, scaled_height), Image.Resampling.LANCZOS)
left = (scaled_width - target_width) // 2
return img.crop((left, 0, left + target_width, scaled_height))... | Python | 1 |
from django.db import models
from django.contrib.auth.models import User
class GradingSystem(models.Model):
name = models.CharField(max_length=255, unique=True)
description = models.TextField(default='About the grading system!')
creator = models.ForeignKey(User, null=True, blank=True,
... | Python | 1 |
ompile()
# test the definitions by making sure that some quantities have applicable
# units
quantities_without_units = list(
g.query(
"SELECT ?q WHERE { \
?q rdf:type brick:Quantity .\
FILTER NOT EXISTS {?q qudt:applicableUnit ?unit} }"
)
)
if l... | Python | 1 |
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<MASK_ID0_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<MASK_ID0_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `revision_id` re... | Rust | 0 |
et()?));
}
results.push(DNetResult::KeepAlive);
if self.last_seq_received != seq_num && packet_type == NetPacketType::DataPacket as u32 {
results.push(DNetResult::HandlePacket(stream));
}
self.last_seq_received = seq_num;
Ok(results)
}
fn make_ping... | Rust | 0 |
) >= len,
::edgedb_protocol::errors::Underflow);
let off = ::std::io::Cursor::position(buf) as usize;
let mut chunk = ::std::io::Cursor::new(
buf.get_ref().slice(off..off + len));
::bytes::buf::Buf::advance(buf, ... | Rust | 0 |
ntry_2827, item_2825)?;
}
list_2826.finish();
}
writer.finish();
Ok(aws_smithy_http::body::SdkBody::from(out))
}
pub fn serialize_operation_crate_operation_describe_local_gateway_route_tables(
input: &crate::input::DescribeLocalGatewayRouteTablesInput,
) -> Result<aws_smithy_http::body:... | Rust | 0 |
.as_reader().total_size()
}
#[inline]
pub fn get_throttle(self) -> bool {
self.builder.get_bool_field(0)
}
#[inline]
pub fn set_throttle(&mut self, value : bool) {
self.builder.set_bool_field(0, value);
}
#[inline]
pub fn get_turn_left(self) -> bool {
self.builder.... | Rust | 0 |
gister accessor: an alias for `Reg<MATRIX_PRAS7_SPEC>`"]
pub type MATRIX_PRAS7 = crate::Reg<matrix_pras7::MATRIX_PRAS7_SPEC>;
#[doc = "Priority Register A for Slave 7"]
pub mod matrix_pras7;
#[doc = "MATRIX_PRBS7 register accessor: an alias for `Reg<MATRIX_PRBS7_SPEC>`"]
pub type MATRIX_PRBS7 = crate::Reg<matrix_prbs7:... | Rust | 0 |
,
#[doc = "5: Input inverted - Internal pull-down device active"]
VALUE6,
#[doc = "6: Input inverted - Internal pull-up device active"]
VALUE7,
#[doc = "7: Input inverted - No internal pull device, Pn_OUTx = input value"]
VALUE8,
#[doc = "16: Output Push-Pull - General-purpose output"]
V... | Rust | 0 |
ne::{self, Rsne}, Supplicant, OUI};
use crate::DeviceInfo;
#[derive(Debug, PartialEq)]
pub struct Rsna {
pub negotiated_rsne: NegotiatedRsne,
pub supplicant: Supplicant,
}
/// Supported Ciphers and AKMs:
/// Group Data Ciphers: CCMP-128, TKIP
/// Pairwise Cipher: CCMP-128
/// AKM: PSK
pub fn is_rsn_compatibl... | Rust | 0 |
class House:
def __init__(self, name, number_of_floors):
self.name = name
self.number_of_floors = number_of_floors
def __str__(self):
return f'Название: {self.name}, кол-во этажей: {self.number_of_floors}'
def __eq__(self, other):
return self.number_of_floors == other
... | Python | 1 |
"""
Sensor tools for micro:bit MCP server.
This module contains tools for reading sensor data from the micro:bit.
"""
import json
import mcp.types as types
def get_sensor_tools() -> list[types.Tool]:
"""Get all sensor-related MCP tools."""
return [
types.Tool(
name="get_temperature",
... | Python | 1 |
": [
"Removes: Fracture",
"Removes: Destroyed body part (except head and thorax)",
"Adds: 60%-72% of maximum part HP",
],
"ja": [
"除去:骨折",
"除去:破壊された部位(頭部と胸部を除く)",
"追加:最大部位HPの60%~72%",
],
... | Python | 1 |
[inline] pub(crate) fn into_af1_no_pull(self) -> $PTXi<ALT1> {
unsafe { &*PORT_PTR }.$pcri.write(|w|
w.mux().mux_1() // Pin Mux Control: ALT1
.pe().clear_bit() // Pull Enable: 0
);
$PTXi { _function: PhantomData }
}
#[inline] pub(crate... | Rust | 0 |
se:
features.extend(random.sample(biome_features.get(biome, []), 4))
return features
def _generate_description(self, biome: BiomeType, features: list, weather: WeatherType) -> str:
"""Generate descriptive text for the location"""
base_desc = {
BiomeType.FOREST: "Dens... | Python | 1 |
(RegexValidator('.*'), 'xxxxx', None),
(RegexValidator('x'), 'y', ValidationError),
(RegexValidator(re.compile('x')), 'y', ValidationError),
)
def create_simple_test_method(validator, expected, value, num):
if isinstance(expected, type) and issubclass(expected, Exception):
test_mask = 'test_%s_ra... | Python | 1 |
import torch
from src import EinsumNetwork, Graph
from src.nns import MLP
def init_spn(device, obs_shape, int_shape, args):
"""
Build a SPN (implemented as an einsum network). The structure is either
the same as proposed in https://arxiv.org/pdf/1202.3732.pdf (referred to as
poon-domingos) or a binary... | Python | 1 |
key_pressed(raylib::consts::KeyboardKey::KEY_G)
{
lights[2].enabled = !lights[2].enabled;
}
if rl.is_key_pressed(raylib::consts::KeyboardKey::KEY_B)
{
lights[3].enabled = !lights[3].enabled;
}
rl.update_camera(&mut camera); // Update camera
... | Rust | 0 |
Julia set formula of (f(z) = z^2 + c), and will continue to
/// do so until the value is outside the appropriate range where it can still generate
/// correctly. The int value that is broken out of the function is returned
/// and used for the color shade of the currently specfied pixel.
pub fn pixel_setter((complex_x... | Rust | 0 |
.split(',')
blacklist = [word.strip().lower() for word in blacklist if word.strip()]
save_choice = input(gradient_text("Do you want to save this configuration as a profile? (y/n): ", PROMPT_COLOR_START, PROMPT_COLOR_END))
if save_choice.lower() == 'y':
profile_name = input(gradient_text("Enter a nam... | Python | 1 |
if len(inputs.shape) != 1:
raise ValueError("We expect a single channel audio input for AudioClassificationPipeline")
processed = self.feature_extractor(
inputs, sampling_rate=self.feature_extractor.sampling_rate, return_tensors="pt"
)
return processed
def _forw... | Python | 1 |
assert len(split_docs) == 2, "文本应该被分割成两部分"
# 验证第一部分的内容
assert split_docs[0].content == "这是一个非常长的句子,需要被正确地切分开来。"
# 验证第二部分的内容
assert split_docs[1].content == "这是第二部分。"
# 验证元数据
assert split_docs[0].metadata['source'] == 'test.txt'
finally:
# 恢复原始配置
cur... | Python | 1 |
its() != 0 {}
// - calibration complete
// configure ADC1 for TIM15-driven sampling
let adc12 = ADC1_2.borrow(cs);
adc12.ccr.modify(|_, w| unsafe {
w.ckmode().bits(0b10) // ADC clock is AHB/2
.mdma().bits(0b00) // dual DMA mode: disabled
.dmacfg()... | Rust | 0 |
get_root::<fb::TypeEnvironment>(buf).into()
}
pub fn imports() -> Option<Environment> {
let buf = include_bytes!(concat!(env!("OUT_DIR"), "/stdlib.data"));
flatbuffers::get_root::<fb::TypeEnvironment>(buf).into()
}
pub fn fresher() -> Fresher {
let buf = include_bytes!(concat!(env!("OUT_DIR"), "/fresher.d... | Rust | 0 |
# Livros com capa_url quebrada (opcional - para verificação futura)
# books_with_broken_urls = Book.objects.exclude(
# Q(capa_url='') | Q(capa_url__isnull=True)
# ).filter(external_id__isnull=False)
return books_without_cover_url
def test_image_url(self, url, timeout=... | Python | 1 |
:FromStr;
use std::fmt;
use std::fmt::Display;
use std::fmt::Formatter;
/// Cast mode defines the rules of conversion from the native value of a certain programming language to the serialized field value.
///
/// Cast mode may be left undefined, in which case the default will be used.
#[derive(Clone, Copy, Debug, Part... | Rust | 0 |
-> PredicateType {
PredicateType {
lifetimes: (_i.lifetimes).map(|it| _visitor.fold_bound_lifetimes(it)),
bounded_ty: _visitor.fold_type(_i.bounded_ty),
colon_token: Token ! [ : ](tokens_helper(_visitor, &_i.colon_token.spans)),
bounds: FoldHelper::lift(_i.bounds, |it| _visitor.fold... | Rust | 0 |
range
fn feerate_limits(feerate: Decimal) -> Result<Decimal, ContractError> {
if feerate > Decimal::one() || feerate < Decimal::zero() {
return Err(ContractError::FeeRateOutOfLimits {});
}
Ok(feerate)
}
/// withdraw token from gov to user.
pub fn withdraw_token(
deps: DepsMut,
env: Env,
... | Rust | 0 |
.Type)",
"$s8mangling10HasVarInitV5stateSbvpZfiSbyKXKfu_" => "implicit closure #1 in variable initialization expression of static HasVarInit.state",
"$s8mangling19autoClosureOverload1fySiyXK_tF" => "autoClosureOverload(f: @autoclosure ())",
"$s8mangling19autoClosureOverload1fySiyXE_tF" => "autoC... | Rust | 0 |
from setuptools import find_packages
from setuptools import setup
setup(
name="DetectoBuddy",
version="0.1.0",
author="AR10Dev & LF-D3v",
description=
"An advanced object detection application to identify objects in images, videos, and live webcam feeds",
long_description=open("README.md").read... | Python | 1 |
= try!(str::from_utf8(resource.read_response()));
trace!("Processing CSS with base {}", base);
let (css, urls) = try!(process_css(input, &base));
Ok((css.into_bytes(), urls))
}
peg! lexer(r#"
use super::Token;
#[pub]
css -> Vec<Token<'input>>
= t:(uri / import / ignored)+ {
... | Rust | 0 |
akeMoneyOutSafe,
TakeOffWeighingScales,
TakePlateOffColoredDishRack,
TakeShoesOutOfBox,
TakeToiletRollOffStand,
TakeUsbOutOfComputer,
WaterPlants,
WeighingScales,
WipeDesk,
ChangeChannel,
OpenGrill,
CloseGrill,
SolvePuzzle,
... | Python | 1 |
Error::Acknowledge)) {
self.nb.send_stop();
}
ret
}
}
impl<I2C, SCLPIN, SDAPIN> Write for BlockingI2c<I2C, SCLPIN, SDAPIN>
where
I2C: Deref<Target = I2cRegisterBlock>,
{
type Error = NbError<Error>;
fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Self::Error> {
... | Rust | 0 |
};
($qatype: ty, $diags: expr) => {
$crate::Sqrid::<
{ <$qatype>::WIDTH },
{ <$qatype>::HEIGHT },
$diags,
{ (((<$qatype>::WIDTH as usize) * (<$qatype>::HEIGHT as usize)) / 32 + 1) },
{ (<$qatype>::WIDTH as usize) * (<$qatype>::HEIGHT as usize) ... | Rust | 0 |
8, 0x70, 0x65, 0x72, 0x6D, 0x74, 0x32, 0x70, 0x73,// permt2ps
0x08, 0x70, 0x65, 0x72, 0x6D, 0x74, 0x32, 0x70, 0x64,// permt2pd
0x06, 0x69, 0x6E, 0x76, 0x65, 0x70, 0x74,// invept
0x07, 0x69, 0x6E, 0x76, 0x76, 0x70, 0x69, 0x64,// invvpid
0x07, 0x69, 0x6E, 0x76, 0x70, 0x63, 0x69, 0x64,// invpcid
0x0D, 0x70, 0x6D, 0x7... | Rust | 0 |
_error;
pub mod map_error;
pub mod metrics;
pub mod node;
pub mod proxy;
pub mod response_body;
pub mod retry;
pub mod root_span;
pub mod timeout;
pub mod tls_metrics;
pub mod trace_propagation;
pub mod user_agent;
pub mod wait_for_spans;
/// A function from one service type to another.
///
/// This trait is based off... | Rust | 0 |
}
if player.intersects_blob(blob) {
blob.dead = true;
player.mass += blob.mass;
player.r = mass2radius(player.mass).min(world_size.x - 20);
hw.audio.start_tone(440 * 3);
} else {
if rng.ra... | Rust | 0 |
import json
from six.moves.urllib import parse as urlparse
from .abstract_api import AbstractApi
from .models import NotificationPayload
from ..utils.xbmc import get_playing_file_path
class InvidiousApi(AbstractApi):
def parse_notification_payload(self, data): # type: (str) -> NotificationPayload | None
... | Python | 1 |
contains
/// the peer identity and the network address of a peer which is selected by RPS at random. In
/// addition to this it also contains a portmap for the P2P listen ports of the various modules
/// on the random peer. RPS should sample random peers from the currently online peers.
/// Therefore t... | Rust | 0 |
ta.copy_(bn_rv)
ptr += num_b
print("loading weight {}".format(bn_layer))
else:
# Load conv. bias
num_b = conv_layer.bias.numel()
conv_b = torch.from_numpy(weights[ptr:ptr + num_b]).view_as(conv_layer.bia... | Python | 1 |
import iniconfig
from bird_feeder import use
def fly():
pass
if __name__ == "__main__":
print("Caw")
use()
| Python | 1 |
if self.mahimahi_ptr >= len(self.cooked_bw):
# loop back in the beginning
# note: trace file starts with time 0
self.mahimahi_ptr = 1
self.last_mahimahi_time = 0
# the "last buffer size" return to the controller
# ... | Python | 1 |
edAlarmSeverityCode,
"ptpPortListeningAlarmSeverityCode": ptpPortListeningAlarmSeverityCode,
"ptpPortActiveStatusSeverityCode": ptpPortActiveStatusSeverityCode,
"ptpPortRadioCapacityAlarmSeverityCode": ptpPortRadioCapacityAlarmSeverityCode,
"ptpClockPPSDataSet": ptpClockPPSDataSet,
"p... | Python | 1 |
s.to_owned().into());
let response = response.0.clone();
poll_fn(move || {
info!("Starting response send");
let mut sender = response.lock().unwrap();
let sender = sender
.as_mut()
.expect("Sender has been dropped while still in use");
let chunk = unsent_c... | Rust | 0 |
Processor 0x{:x}", self.kind, self.proc_id),
text: format!("{:?} Proc {}", self.kind, self.proc_id.proc_in_node()),
tsv: filename,
levels: level,
})
}
}
struct CopySize(u64);
impl fmt::Display for CopySize {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result ... | Rust | 0 |
:into_raw(f) as *mut _)
}
}
#[cfg(any(feature = "v2_16", feature = "dox"))]
fn connect_property_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none... | Rust | 0 |
num = int(input("enter the number :"))
print(bin(num), "in binary conversion")
print(oct(num), "in octal conversion")
print(hex(num), "in hexadecimal conversion") | Python | 1 |
from turtle import Turtle
MOVE_FORWARD = 20
STARTING_POSITIONS = [(0, 0), (-20, 0), (-40, 0)]
class Snake:
def __init__(self):
self.snake_body = []
self.create_snake()
self.head = self.snake_body[0]
def create_snake(self):
for position in STARTING_POSITIONS:
self.... | Python | 1 |
csv_path.unlink() # Remover arquivo de teste
print(f"\n🧹 Arquivo de teste removido: {csv_path}")
except:
pass
print(f"\n{'='*60}")
print("🎯 RESULTADO FINAL:")
print("✅ Sistema é GENÉRICO e funciona com qualquer CSV")
print("✅ Abstração LLM está madura e multi-provider... | Python | 1 |
{
// Hang a few seconds so requests are not spammed
// Stop hanging if new info arrives
let mut duration = body.timeout.unwrap_or_default();
if duration.as_secs() > 30 {
duration = Duration::from_secs(30);
}
let _ = tokio::time::timeout(duration, watcher).... | Rust | 0 |
# Read It
# Demonstrates reading from a text file
print("Opening and closing the file.")
text_file = open("read_it.txt", "r")
text_file.close()
print("\nReading characters from the file.")
text_file = open("read_it.txt", "r")
print(text_file.read(1))
print(text_file.read(5))
text_file.close()
print("\nReading the en... | Python | 1 |
from picographics import PicoGraphics, DISPLAY_TUFTY_2040, PEN_P4
from breakout_as7343 import BreakoutAS7343
from pimoroni_i2c import PimoroniI2C
display = PicoGraphics(DISPLAY_TUFTY_2040, pen_type=PEN_P4, rotate=90)
WIDTH, HEIGHT = display.get_bounds()
BLACK = display.create_pen(0, 0, 0)
FZ = display.create_pen(0... | Python | 1 |
status, symbol, side")
print("📊 Fields: entry_action, entry_price, entry_datetime, position_size")
print("📊 Fields: Close, Volume (from embedded market_data_at_entry/exit)")
print("🔗 Drawing lines between entry/exit with P&L markers")
print()
# Create visualizer
visualizer = PureTradeAn... | Python | 1 |
point_in_robot_frame.header.frame_id = "/base_link"
point_in_robot_frame.header.stamp = data.header.stamp
point_in_robot_frame.point.x = float(d[0])
point_in_robot_frame.point.y = float(d[1])
point_in_robot_frame.point.z = float(d[2])
self.publis... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.