text string | label_name string | labels int64 |
|---|---|---|
import yaml
# Mostrar mensaje de bienvenida
print("********************************")
print(" Clasificador de Figuras")
print("********************************")
print("\n ¡Vamos a Adivinar\n")
# Cargar los datos del archivo YAML
with open("C:/Users/ramir/Downloads/Ultimo Semestre/IA/Figuras/figpyr.yaml", ... | Python | 1 |
pub struct TestCase {
pub hash: String,
pub r#box: geohash::Box,
}
const DATA: &str = r#"
{"91rc", Box{7.20703125, 7.3828125, -124.1015625, -123.75}},
{"c", Box{45.0, 90.0, -135.0, -90.0}},
{"0fuz", Box{-73.30078125, -73.125, -139.5703125, -139.21875}},
{"dwfcndf", Box{38.1596374512, 38.1610107422, -63.344421386... | Rust | 0 |
# Copyright (c) OpenMMLab. All rights reserved.
import pytest
import torch
from mmaction.models import ResNet3dSlowOnly
from mmaction.testing import generate_backbone_demo_inputs
def test_slowonly_backbone():
"""Test SlowOnly backbone."""
with pytest.raises(AssertionError):
# SlowOnly should contain ... | Python | 1 |
.SetAutoWindowLevel(0)
liveUsDisplayNode.SetWindowLevelMinMax(minLevel,maxLevel)
def onBrightnessContrastNormalClicked(self):
logging.debug('onBrightnessContrastNormalClicked')
self.brightnessSliderWidget.setMaximumValue(200)
self.brightnessSliderWidget.setMinimumValue(0)
self.setImageMinMaxLevel... | Python | 1 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
import re
from lib.core.common import singleTimeWarnMessage
from lib.core.data import kb
from lib.core.enums import DBMS
from lib.core.enums import PRIORITY
__prio... | Python | 1 |
from src.core.database import clear_database, add_to_chroma
from src.core.loader import load_pdf_directory, split_documents
import time
def populate_database():
documents = load_pdf_directory()
chunks = split_documents(documents)
add_to_chroma(chunks)
print('Database populated!')
def clear_db():
cl... | Python | 1 |
#!/usr/bin/env python3
"""
- solid mechanics
- basic rate-dependent solid material
"""
import ambit_fe
import sys
import numpy as np
from pathlib import Path
import pytest
@pytest.mark.solid
def test_main():
basepath = str(Path(__file__).parent.absolute())
# reads in restart step from the command line
... | Python | 1 |
from draw import *
class Simulation:
def __init__(self, boats, dt, r):
self.boats = boats
self.dt = dt
self.r = r
def run(self, num_steps, ax, Ɛ, s):
for _ in range(num_steps):
clear(ax)
# record the boats that are already checked
check... | Python | 1 |
pub bottom_margin: f64,
#[serde(rename = "base thickness pt")]
pub base_thickness: f64,
#[serde(rename = "base color cmyk")]
pub base_color: CmykDef,
#[serde(rename = "aux thickness pt")]
pub aux_thickness: f64,
#[serde(rename = "aux color cmyk")]
pub aux_color: CmykDef
}
#[derive(Deser... | Rust | 0 |
"updating stLuna token address is forbidden",
));
}
last_config.stluna_token_contract = Some(token_raw);
Ok(last_config)
})?;
}
if let Some(airdrop) = airdrop_registry_contract {
let airdrop_raw = deps.api.addr_canonicaliz... | Rust | 0 |
c @ s- d d l Td d l Z d d d YZ d S( i( t *Nt Resultc B s8 e Z d Z d Z d Z d Z d d Z RS( c C s t j d | j d <d S( Nt Bt memDump( t arrayt __dict__( t self( ( s type_Result.py... | Python | 1 |
ps(right_points), "foamPoints":foamPoints, "foamPointsShort":foamPointsShort, "insoleLeftForm":insoleLeftForm,"insoleRightForm":insoleRightForm })
class FoamPrintPointViewSet(viewsets.ModelViewSet):
queryset = FoamPrintPoint.objects.all()
serializer_class = FoamPrintPointSerializer
filterset_fields = [... | Python | 1 |
tor<Item=PathEvent>>(path : T) -> Vec<PathOp> {
path.filter_map(move |path_event| {
match path_event {
PathEvent::End { close : false, ..} => {
None
}
PathEvent::End { close : true, ..} => {
Some(PathOp::Close())
}
... | Rust | 0 |
SANITY {
if !$arg {
rtabort!("assertion failed: %s", stringify!($arg));
}
}
} )
)
macro_rules! rtabort(
($( $msg:expr),+) => ( {
::rt::util::abort(fmt!($($msg),+));
} )
)
macro_rules! assert_once_ever(
($( $msg:expr),+) => ( {
// FIXME(#... | Rust | 0 |
17144678027117236568, // 29^-126
9497678206828984163, // 29^-120
10522902929736936910, // 29^-114
11658795303156142066, // 29^-108
12917301321555931503, // 29^-102
14311656487072982013, // 29^-96
15856525005124406387, // 29^-90
17568154005459773215, // 29^-84
9732272205284828726, /... | Rust | 0 |
from enum import Enum
class TransactionPartnerType(str, Enum):
"""
This object represents a type of transaction partner.
Source: https://core.telegram.org/bots/api#transactionpartner
"""
FRAGMENT = "fragment"
OTHER = "other"
USER = "user"
TELEGRAM_ADS = "telegram_ads"
| Python | 1 |
\'VK_KHR_imageless_framebuffer\'"]
impl StructureType {
pub const FRAMEBUFFER_ATTACHMENTS_CREATE_INFO_KHR: Self =
StructureType::FRAMEBUFFER_ATTACHMENTS_CREATE_INFO;
}
#[doc = "Generated from \'VK_KHR_imageless_framebuffer\'"]
impl StructureType {
pub const FRAMEBUFFER_ATTACHMENT_IMAGE_INFO_KHR: Self =
... | Rust | 0 |
)
args.append('-DTIMEMORY_BUILD_NCCLP_LIBRARY=ON')
if '+mpi' in spec:
args.append('-DTIMEMORY_USE_MPI_LINK_FLAGS=OFF')
args.append('-DMPI_C_COMPILER={0}'.format(spec['mpi'].mpicc))
args.append('-DMPI_CXX_COMPILER={0}'.format(spec['mpi'].mpicxx))
if '+cud... | Python | 1 |
{
max = &slice[index];
max_pos = index;
}
}
(*max, *min, max_pos, min_pos)
}
#[macro_use]
extern crate diesel;
mod database;
mod schema;
mod domain;
mod logger;
mod routes;
use dotenv::dotenv;
use rocket::http::Status;
use rocket::serde::json::Json;
use rocket::serde::Serializ... | Rust | 0 |
std = np.std(pDs_i)
mean = np.mean(pDs_i)
coms[i] = (1 / len(indices_i)) * std * mean
ret[i] = seps[i] / coms[i]
return ret
def cvdd(X, labels, k=7):
unique_labels = np.unique(labels)
# CVDD = Null
# den = Eqn1w
distances = pairwise_distances(X, n_jobs=1)
nbrs = Near... | Python | 1 |
"])
socketio.sleep(0.1)
socketio.emit("pty-output", {"output": app.config["hist"]}, namespace="/pty", to=request.sid)
logger.debug(f"Sent pty-output to {request.sid}, length: {len(app.config['hist'])}.")
else:
logger.debug("Starting new process.")
star... | Python | 1 |
import imageio
import numpy as np
from tqdm import tqdm
from typing import Union, List
from pathlib import Path
from glob import glob
from .edit import flex_resize_img, flex_resize_video
def load_img_meta(
img_path : Union[str, Path],
):
''' Read the image meta from the given path without opening image. '''... | Python | 1 |
{
// line.drain(0.."#DEFINE".len());
//
// //TODO Should this trim end?
// let mut var = line.trim_start().to_string();
// var.drain(0..spilt.get(1).unwrap().len());
// let var = var.trim_start().to_... | Rust | 0 |
ts::{events::*, matcher::EventMatcher},
fidl::endpoints,
fidl_fuchsia_io::DirectoryMarker,
fidl_fuchsia_sys2 as fsys, fuchsia_async as fasync,
fuchsia_component::client::connect_to_protocol,
fuchsia_syslog as syslog,
hub_report::*,
};
#[fasync::run_singlethreaded]
async fn main() {
syslog::... | Rust | 0 |
index", &self.segment_index)
.field("buffer", &EventBufferLen(self.buffer.len()))
.finish()
}
}
#[derive(Serialize, Deserialize)]
#[serde(rename = "EventLog")]
#[serde(deny_unknown_fields)]
struct EventLogRecorderRaw {
directory: PathBuf,
#[serde(default = "default_event_log_recorde... | Rust | 0 |
spec[res["specific_harm"]] += 1
if fout:
out_row = {**item, **res}
if args.hf_field_id not in out_row:
out_row[args.hf_field_id] = i
fout.write(json.dumps(out_row, ensure_ascii=False) + "\n")
fo... | Python | 1 |
,
**{
"dummy-cc": (lambda: gym.make("example-cc-v0"), "runtime"),
"dummy-py": (lambda: gym.make("example-py-v0"), "runtime"),
},
)
@pytest.mark.parametrize("args", _args.values(), ids=_args.keys())
def test_reward(benchmark, args):
make_env, reward_space = args
with make_env() as env:
... | Python | 1 |
pub fn new(tt: TokenType, lit: String) -> Token {
Token {
tokentype: tt,
literal: lit,
}
}
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Keyword {
Function,
Let,
}
lazy_static! {
static ref KEYWORDS: HashMap<&'static str, Keyword> = {
let m... | Rust | 0 |
.join(transcription)
def build_argparser():
parser = ArgumentParser(add_help=False)
parser.add_argument('-h', '--help', action='help', default=SUPPRESS, help='Show this help message and exit.')
parser.add_argument('-m', '--model', help='Required. Path to an .xml file with a trained model.', required=True)... | Python | 1 |
= chars.iter();
let mut line = Vec::new();
let mut word = Vec::new();
loop {
match itr.next() {
Some(c) => {
word.push(c.clone());
if is_separator(c) || is_newline(c) || word.len() == line_width {
// word end
appen... | Rust | 0 |
:IOCFGn.EDGE_IRQ_EN and IOC:IOCFGn.EDGE_DET settings"]
AON_GPIO_EDGE,
#[doc = "AON programmable event 2. Event selected by AON_EVENT MCU event selector, AON_EVENT:EVTOMCUSEL.AON_PROG2_EV"]
AON_PROG2,
#[doc = "AON programmable event 1. Event selected by AON_EVENT MCU event selector, AON_EVENT:EVTOMCUSEL... | Rust | 0 |
(1, 0),
(4, 0),
(6, 0),
(12, 0),
(14, 0),
(1, 0),
(4, 0),
(6, 0),
(8, 0),
(1, 0),
(4, 0),
(20, 0),
(8, 2),
(14, 2),
]));
assert_eq!(paths[5], pa... | Rust | 0 |
############# MODEL VERSION 3.#############
###########################################
pointtracker = Flow3D_Extraction((height,width),intrinsic,train_cams,rgbpcd_mod=True,exhaustive_RAFT_mode=exhaustive_RAFT_mode,
debug=False,
... | Python | 1 |
])* $name:ident: $val:expr,)* } ) => {
#[allow(non_camel_case_types)]
$(#[$attr])*
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub enum $enum_name {
$($(#[$fattr])* $name = $val,)*
}
impl EnumI64 for $enum_name {
... | Rust | 0 |
));
} else {
bindings.insert((modkey, keybind.key), keybind.command);
}
}
if returns.is_empty() {
println!("\x1b[0;92m -> All keybinds OK\x1b[0m");
true
} else {
for error in returns {
match error.0 {
Some(binding) => {
... | Rust | 0 |
this stage.")
return [curr_map_images, curr_map]
def main():
args = parse_args()
print(("Using histogram_equalization: " + str(args.histogram_equalization)))
if not os.path.exists(args.small_map):
raise Exception("The input small map does not exist.")
if not os.path.exists(args.big_map)... | Python | 1 |
sults: Dict[str, Any], emit_status_func) -> str:
"""
Genera respuesta final optimizada con menos tokens.
"""
try:
# Permitir frenar la respuesta final si el usuario lo solicita
if self.assistant and getattr(self.assistant, 'stop_emit', False):
emit... | Python | 1 |
from yt_dlp.extractor.youtube import YoutubeIE
class PatchedYoutubeIE(YoutubeIE):
def _download_player_responses(self, url, smuggled_data, video_id, webpage_url):
webpage = None
if 'webpage' not in self._configuration_arg('player_skip'):
query = {'bpctr': '9999999999', 'has_verified':... | Python | 1 |
regtest::HRP_SAPLING_EXTENDED_SPENDING_KEY
}
fn hrp_sapling_extended_full_viewing_key(&self) -> &str {
regtest::HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY
}
fn hrp_sapling_payment_address(&self) -> &str {
HRP_SAPLING_PAYMENT_ADDRESS
}
fn b58_pubkey_address_prefix(&self) -> [u8; 2] {
regtest::B58_PUB... | Rust | 0 |
spread: None,
truncate: None,
},
Group {
filters: vec![],
root: None,
selectors: vec![Default(String::from("array")), Range((Some(2), Some(1)))],
spread: None,
truncate: None,
... | Rust | 0 |
it()
if renderer is not None:
self._renderer = renderer
if self._renderer is None:
self._renderer = self.get_figure(root=True)._get_renderer()
if self._renderer is None:
raise RuntimeError('Cannot get window extent without renderer')
self.update_posit... | Python | 1 |
rn empty_result(status="error", data="filename should be a string")
total_count: Optional[int] = None
nr = cnaas_init()
if "hostname" in json_data:
hostname = str(json_data["hostname"])
if not Device.valid_hostname(hostname):
return empty_result(status="... | Python | 1 |
ap.clone();
self.transform(Affine2::new());
let sizef = self.size().map(|v| v as f64);
unsafe {
js_canvas_fill_style(self.id_, c[0],c[1],c[2],c[3]);
js_canvas_fill_rect(self.id_, 0.0, 0.0, sizef[0], sizef[1]);
}
self.transform(map);
}
fn draw_pat... | Rust | 0 |
ce)
key, value = trace.split(':', 1)[0],trace.split(':', 1)[1]
# store the sentence
if (key == "SentenceFound"):
Sentence = value.split('"')[7]
if len(value.split('"')) > 9: # i.e. if the sentence contains quotes (")
for i in range(8, len(value.split('"')... | Python | 1 |
d,
value,
high,
low,
required_value
)));
}
vmcs_write(field, required_value)?;
Ok(required_value)
}
fn vmcs_write(field: VmcsField, value: u64) -> Result<()> {
let rflags = unsafe {
let rflags: u64;
asm!(
"vmwrite rax,... | Rust | 0 |
, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "AuthClient {{ ... }}")
}
}
}
//! The Multiboot standard specifies an interface to load and boot the kernel image. It provides
//! critical informations such as the memory mapping and the ELF structure of the kernel.
use core::f... | Rust | 0 |
, T::ChainIdMaxLength> =
chain_id.clone().try_into().map_err(|_| Error::<T>::BadChainId)?;
ensure!(Self::chain_ids().contains(&bounded_chain_id), Error::<T>::NotExist);
<Providers<T>>::insert(
&provider_id,
Provider {
provider_type,
operator: operator.clone(),
chain_id: bounded_chain_i... | Rust | 0 |
'ஐ', 'ஒ', 'ஓ', 'ஔ'];
pub const UYIR_LETTERS: &'static [char; 12] = &UYIR;
pub const VOWEL_A: char = 'அ';
pub const VOWEL_AA: char = 'ஆ';
pub const VOWEL_I: char = 'இ';
pub const VOWEL_II: char = 'ஈ';
pub const VOWEL_U: char = 'உ';
pub const VOWEL_UU: char = 'ஊ';
pub const VOWEL_E: char = 'எ';
pub const VOWEL_EE: char ... | Rust | 0 |
34465506516862552545258696972716937562372351790286196984704869152637760700476220871993781991464031637729551399469234588981419452569180448522181046252068448646546664464576280838609632182502749167739074199676547708981285010263628129030634922502110975068922112281320958506259848729761607769020721064779348045073889472408793... | Rust | 0 |
eater) {
has_value = true;
n = *item
}
}
} else {
// optimized path for arrays without null values
n = m[1..].iter().fold(m[0], |max, item| {
if cmp(&max, item) == std::cmp::Ordering::Greater {
*item
} else {... | Rust | 0 |
();
}
Ok(())
}
/// Called when a connexion is terminated from the client side.
fn on_close(&mut self, _: CloseCode, _: &str) {
println!("Terminate socket.");
}
}
<filename>pokemon_rust/src/map/conversions.rs
use crate::constants::TILE_SIZE;
use std::convert::TryFrom;
use supe... | Rust | 0 |
rame) -> io::Result<()> {
// not a mutable reference needed (see std::net::UdpSocket) for
// a comparison
// debug!("Sending: {:?}", frame);
let write_rv = unsafe {
let frame_ptr = frame as *const CanFrame;
write(self.fd, frame_ptr as *const c_void, size_of::<Can... | Rust | 0 |
import config
from distexprunner import *
NUMBER_NODES = 4
parameter_grid = ParameterGrid(
dramGB=[50],
numberNodes= range(2,5),
# numberNodes= [],
# zipf= [0],
# readRatio=[100], # A, B, C workloads
# readRatio=[50,95,100], # A, B, C workloads
initialFillDegree = [180], # 90 pe... | Python | 1 |
{
"field_id": "tjZlml",
"form_name": "declarations-cof-25",
"field_type": "yesNoField",
"presentation_type": "text",
"question": "Confirm that the inform... | Python | 1 |
from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
import math
import json
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
with op... | Python | 1 |
'account_id': 'chart_skr04_6931',
'amount_type': 'percentage',
'tax_ids': [
Command.set([
'tax_ust_7_taxinclusive_skr04',
]),
],
... | Python | 1 |
@DeviceAliases.setter
def DeviceAliases(self, DeviceAliases):
self._DeviceAliases = DeviceAliases
def _deserialize(self, params):
if params.get("DeviceAliases") is not None:
self._DeviceAliases = []
for item in params.get("DeviceAliases"):
obj = Dev... | Python | 1 |
#!/usr/bin/python3
only_diff_elements = __import__('4-only_diff_elements').only_diff_elements
set_1 = { "Python", "C", "Javascript" }
set_2 = { "Bash", "C", "Ruby", "Perl" }
od_set = only_diff_elements(set_1, set_2)
print(sorted(list(od_set)))
| Python | 1 |
perty.foreign_key.foreign_key_on_delete}'), "
foreign_key_model_pascal_case = NamingUtils.convert_to_pascal_case(property.foreign_key.foreign_key_table)
orm_column_relationships += f"relationship('{foreign_key_model_pascal_case}', back_populates='{self.o... | Python | 1 |
VALUE, GSW_INVALID_VALUE, GSW_INVALID_VALUE),
};
*specvol = result.0;
*alpha = result.1;
*beta = result.2;
}
#[no_mangle]
pub unsafe extern "C" fn gsw_rho(sa: f64, ct: f64, p: f64) -> f64 {
match crate::rho(sa, ct, p) {
Ok(v) => v,
Err(_) => GSW_INVALID_VALUE,
}
}
////////////... | Rust | 0 |
), expected_leader_sockets);
let third_leader = mundis_ledger::leader_schedule_utils::slot_leader_at(
slot + (2 * NUM_CONSECUTIVE_LEADER_SLOTS),
&bank,
)
.unwrap();
let mut expected_leader_sockets = vec![
recent_peers.get(&... | Rust | 0 |
: test_data_5m, # Explicit request with '' as candletype
('NEO/USDT', '15m', candle_def): test_data_5m, # Explicit request with '' as candletype
('NEO/USDT', '1h', candle_def): test_data_1h,
('ETH/USDT', '1h', candle_def): test_data_1h,
('ETH/USDT', '30m', candle_def): test_data_30m,
... | Python | 1 |
structure, to specify the type of selector to match
/// - on each variant, to specify the value associated with this variant.
///
/// Expected values:
/// - top-level: a valid Rust type
/// - fields: a valid Rust match arm expression (for ex: `0`). *Note*: this expression can
/// contain a pattern guard (for... | Rust | 0 |
let err = unsafe {
$($call)*
};
if err != 0 {
Err(SyscallError::from(err))
} else {
Ok(())
}
}
}
}
#[inline(never)]
pub fn eddsa_sign(
m: &[u8],
ec_k: &cx_ecfp_private_key_t,
) -> Option<EdDSASig> {
... | Rust | 0 |
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import GenInferencer
from opencompass.openicl.icl_evaluator import AccEvaluator
from opencompass.datasets import crowspairsDataset_V2
from opencompass.ut... | Python | 1 |
indices.push([base_index + 4, base_index + 1, base_index + 5]);
indices.push([base_index + 4, base_index + 0, base_index + 1]);
indices.push([base_index + 6, base_index + 5, base_index + 1]);
indices.push([base_index + 6, base_index + 1, base_index + 2]);
... | Rust | 0 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
from threading import RLock
from doubanfm.colorset.colors import color_func # colors
from doubanfm.dal.dal_main import MainDal
from doubanfm.views.base_view import Cli
mutex = RLock()
class Win(Cli):
"""窗体"""
def __init__... | Python | 1 |
, F, T, E: ParseError<&'a [u8]>>(
input: &'a [u8],
parser: F,
) -> IResult<&'a [u8], Vec<T>>
where
F: Fn(&'a [u8]) -> Result<T, E>,
{
separated_list0(tag(","), map_res(is_not(",\n"), parser))(input)
}
fn parse_str_list(input: &[u8]) -> IResult<&[u8], Vec<&str>> {
parse_list(input, str_from_bytes)
}... | Rust | 0 |
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any, TypeVar
from attrs import define as _attrs_define
from attrs import field as _attrs_field
if TYPE_CHECKING:
from ..models.time_plan_change_time_config_args_period import TimePlanChangeTimeConfigArgsPeriod
from ..models.time_plan_change... | Python | 1 |
s(self):
tests_run_count = self.get_tests_run_count()
self.update_count()
if tests_run_count != self.count:
raise Exception('Should success on retry')
def test_retry_1_fails(self):
raise Exception('Should fail twice')
def test_retry_2_fails(self):
raise Exce... | Python | 1 |
e function has been called with `Ok(None)` or `Err(error)`,
/// it is guaranteed never to be called again.
///
/// See also [`subscribe()`](#tymethod.subscribe).
fn subscribe_result<FnResult>(&mut self,
on_next_or_completed_or_error: FnResult)
... | Rust | 0 |
3C) as *mut c_void, &armor as *const _ as *const c_void, 4, null_mut());
}
if c6.get_checkstate() == CheckState::Checked {
ReadProcessMemory(**phw as *mut c_void, ((**pt as i32)+0x628) as *const c_void, &mut val as *mut _ as *mut c_void, 4, null_mut());
... | Rust | 0 |
epeatControllerState(widget_id, dev_id, period_sec) {
setInterval(function () {
getControllerState(widget_id, dev_id)
}, period_sec * 1000);
}
""",
'widget_dashboard_js_ready': """
$('.activate_controller').click(function() {
const btn_val = this.name;
const id = btn_val.split('/')[0];
... | Python | 1 |
ws_for_release_to_start_with_hyphen() {
let _server = mock("POST", "/api/0/projects/wat-org/wat-project/releases/")
.match_body(Matcher::PartialJsonString(
r#"{"version":"-wat-release","projects":["wat-project"]}"#.to_string(),
))
.with_status(201)
.with_header("content-t... | Rust | 0 |
ENTS {
pub SequenceControlDesc: D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC,
pub PictureControlDesc: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC,
pub pInputFrame: super::super::Graphics::Direct3D12::ID3D12Resource,
pub InputFrameSubresource: u32,
pub CurrentFrameBitstreamMetadataSize: u32,
}
#[cfg(all(fe... | Rust | 0 |
paragraph = paragraph.replace("/", "")
words = paragraph.split(" ")
for word in words:
if word.strip() == "":
continue
if "*" in word:
word = word.replace("*", "")
article_input.send... | Python | 1 |
c="Modify the DATAH register."]
#[inline] pub fn with_datah<F: FnOnce(Datah) -> Datah>(&self, f: F) -> &Self {
self.datah_reg().with(f);
self
}
#[doc="Get the DATAHL Register."]
#[inline] pub fn datahl_reg(&self) -> ::bobbin_mcu::register::Register<Datahl> {
::bobbin_mcu::regis... | Rust | 0 |
pattern_counts)
})
result['passed'] = False
return result
def _check_accuracy(self, df: pd.DataFrame, rules: Dict) -> Dict[str, Any]:
"""检查数据准确性"""
result = {
'numeric_range_validation': {},
'text_length_va... | Python | 1 |
{
global_automatic_glGetError("glCheckFramebufferStatus");
}
out
}
static glCheckFramebufferStatus_p: APcv = ap_null();
/// Tries to load [`glCheckFramebufferStatus`], returns if a non-null pointer
/// was obtained.
#[doc(hidden)]
pub unsafe fn glCheckFramebufferStatus_load_with_dyn(
... | Rust | 0 |
"""
EJERCICIO:
- Crea ejemplos de funciones basicas que representen las diferentes
posibilidades del lenguaje:
Sin parametros ni retorno, con uno o vario parametros, con retorno...
- Comprueba si puedes crear funciones dentro de funciones.
- Utiliza algun ejemplo de funciones ya creadas en el lenguaje.
- Pon a prueba e... | Python | 1 |
random_step: &Self::RandomStep,
// max_cplx: f64,
// ) -> Self::Concrete<'a> {
// let value_cplx = mutator.complexity(value, cache);
// let spare_cplx = max_cplx - value_cplx;
// let (el, cplx) = mutator.m.random_arbitrary(spare_cplx);
// ConcreteInsertElement {
// ... | Rust | 0 |
'val_acc': val_acc
})
is_best = val_acc > best_acc
best_acc = max(val_acc, best_acc)
save_checkpoint({
'epoch': epoch + 1,
'model_state_dict': model.state_dict(),
'optimizer_state_dict': optimizer.state_dict(),
'best_acc':... | Python | 1 |
_GRAVITY_EAST: ClutterGravity = 3;
pub const CLUTTER_GRAVITY_SOUTH_EAST: ClutterGravity = 4;
pub const CLUTTER_GRAVITY_SOUTH: ClutterGravity = 5;
pub const CLUTTER_GRAVITY_SOUTH_WEST: ClutterGravity = 6;
pub const CLUTTER_GRAVITY_WEST: ClutterGravity = 7;
pub const CLUTTER_GRAVITY_NORTH_WEST: ClutterGravity = 8;
pub co... | Rust | 0 |
"""
Prepare rust dependencies.
This script generates a cargo configuration file and prepares each crate
in the specified directory as a vendored dependency.
IMPORTANT: KEEP THIS SCRIPT RELYING EXCLUSIVELY ON PYTHON STANDARD LIBRARY AS ITS
USAGE WITHIN THE BUILD PROCESS OCCUR BEFORE BUILDING ANY EXTERNAL LIBRARY.
"""
... | Python | 1 |
offset in one.
// Load the uv coords from the texture.
// -----------------------------------------------------------------------------
texture.bind();
let num_of_instances = vertex_data.len() as i32;
self.vbo.load_data(&vertex_data);
// Clip
let clip = vi... | Rust | 0 |
borrow();
let sum_of_scope = FieldRefResolveScope::SumOf(SumOfFieldRefResolveScope {
parent: scope.as_normal().unwrap(),
struct_fields: &struct_fields,
});
resolve_field_refs_in_expr(&sum_of_expr.operand, &sum_of... | Rust | 0 |
",
"edge": "none",
"value": "1",
},
"BMC_UART_SEL5": {
"active_low": "0",
"direction": "out",
"uevent": "",
"edge": "none",
"value": "1",
},
"BMC_SPI_1_WP_N": {
"active_low": "0",
"direction": "out",
"uevent": "",
"e... | Python | 1 |
tialize_providers(self):
"""初始化所有Provider"""
# DeepSeek
deepseek_config = {
"model_name": toml_config.llm.model_name,
"api_key": toml_config.llm.api_key,
"temperature": self.dynamic_config["temperature"],
"max_tokens": self.dynamic_config["max_toke... | Python | 1 |
get_func(&kbc_name)?;
let kbc_instance = (instantiate_func)(kbs_uri);
self.register_instance(kbc_name, kbc_instance);
Ok(())
}
#[allow(dead_code)]
fn check(&self, kbc_name: String) -> Result<KbcCheckInfo> {
let kbc_instance = self
.kbc_instance_map
.g... | Rust | 0 |
("font-weight", "bold")
]}
])
for col in numeric_cols:
top_5 = df[col].nlargest(5)
bottom_5 = df[col].nsmallest(5)
styled = styled.apply(lambda row, top_5=top_5: ['background-color: green' if val in top_5.values else '' ... | Python | 1 |
Status::INTERNAL
}
}
}
fn get_ap_sme(ifaces: &IfaceMap, iface_id: u16, endpoint: station::ap::Endpoint) -> zx::Status {
let iface = ifaces.get(&iface_id);
let server = match iface {
None => return zx::Status::NOT_FOUND,
Some(ref iface) => match iface.sme_server {
device:... | Rust | 0 |
class Solution:
def findMaxAverage(self, nums: List[int], k: int) -> float:
x = y = sum(nums[:k])
for i in range(k, len(nums)):
x = x + nums[i] - nums[i - k]
y = max(x, y)
result = y / k
return result | Python | 1 |
<(), CodegenError> {
match *self {
VarLocation::Local(id) => {
fb.get_current_bb().opcodes.push(
OpCode::SetLocal(id)
);
Ok(())
},
VarLocation::This(ref key) => {
fb.get_current_bb().opcodes.e... | Rust | 0 |
iption.lower():
property_type = "House"
elif 'apartment' in description.lower():
property_type = "Apartment"
elif 'studio' in description.lower():
property_type = "Studio"
... | Python | 1 |
t path = path.as_ref();
let modules = path.join("lib").join("modules");
if modules.exists() {
let jimage = path.join("bin").join(jimage::Library::NAME);
if jimage.exists() {
return Self::from_jimage_modules(jimage, modules);
} else {
re... | Rust | 0 |
Collider::new(radius))
}
}
impl Component for ParticleCollider {
type Storage = VecStorage<Self>;
}
pub struct ParticleCollisionSystem;
impl<'s> System<'s> for ParticleCollisionSystem {
type SystemData = (
ReadExpect<'s, ArenaBounds>,
ReadStorage<'s, ParticleCollider>,
ReadStorage... | Rust | 0 |
broadcast: None }, &[98, 18, 69, 210, 187, 241], OperandSize::Qword)
}
#[test]
fn vfmsub231ss_8() {
run_test(&Instruction { mnemonic: Mnemonic::VFMSUB231SS, operand1: Some(Direct(XMM12)), operand2: Some(Direct(XMM21)), operand3: Some(IndirectScaledIndexedDisplaced(RDX, RCX, Four, 1268978296, Some(OperandSize::Dwo... | Rust | 0 |
random.shuffle(batch)
return iter(batch)
def __len__(self):
return 1
# dataloader
def get_HBKC_data_loader(task, num_per_class=1, split='train',shuffle = False):
# 参数:
# task: 当前任务
# num_per_class:每个类别的样本数量,与split有关
# split:‘train'或‘test'代表support和querya
# shuffle:样本是否... | Python | 1 |
import json
class Timeout(Exception):
"""
Used when a timeout occurs.
"""
pass
class HTTPException(Exception):
def __init__(self, response, *args, **kwargs):
try:
errors = json.loads(response.content.decode("utf8"))["errors"]
message = "\n".join([error["message"]... | Python | 1 |
fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 0 - BRK BKIN input enable"]
#[inline]
pub fn bkine(&mut self) -> _BKINEW {
_BKINEW { w: self }
}
#[doc = "Bit 1 - BRK COMP1 enable"]
#[inline]
pub fn bkcmp1e(&mut self) ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.