text
string
label_name
string
labels
int64
= torch.from_numpy(label.astype(np.float32)) low_res_label = torch.from_numpy(low_res_label.astype(np.float32)) image = image.permute(2, 0, 1) label = label.permute(2, 0, 1) low_res_label = low_res_label.permute(2, 0, 1) bbox = torch.from_numpy(np.array(bbox).astype(np.float32))...
Python
1
'back_box_min':back_box_min1, 'back_box_max':back_box_max1, 'front_box_cls_pred':front_box_cls_pred1, 'back_box_cls_pred':back_box_cls_pred1, 'x': x, 'y_gt': y_gt, 'z_gt': z_gt, 'front_translation':fro...
Python
1
::raw::c_int, ) -> isize; /// Specify with which local address and port the SCTP endpoint should /// associate itself. /// /// * `so`: Pointer to the socket as returned by [`usrsctp_socket()`]. /// * `addr`: The address structure ([`sockaddr_in`] for an IPv4 address /// or [`sockaddr_in6`...
Rust
0
> = BBBuffer::new(); static mut URC_QUEUE: BBBuffer<URC_CAPACITY_BYTES> = BBBuffer::new(); static mut COM_QUEUE: ComQueue = Queue::new(); // Setup clocks & peripherals let mut flash = ctx.device.FLASH.constrain(); let mut rcc = ctx.device.RCC.constrain(); let mut pwr = c...
Rust
0
de(default, with = "url_serde")] #[serde(skip_serializing_if = "Option::is_none")] pub api: Option<Url>, #[doc(hidden)] #[serde(skip)] __nonexhaustive: (), } /// Return the configuration file in an index. pub fn load_config(index: impl AsRef<Path>) -> Result<IndexConfig, Error> { let path = ind...
Rust
0
(self.as_array_mut(), pnidx); } pub fn load_as_nrm_mtx(&mut self, pnidx: u32) { Gx::load_nrm_mtx_imm(self.as_array_mut(), pnidx); } pub fn load_as_tex_mtx(&mut self, pnidx: u32) { Gx::load_tex_mtx_imm(self.as_array_mut(), pnidx); } } //! High-level intermediate representation //! //!...
Rust
0
_path() -> Option<OsString> { var_os("PATH") } /// Get the value for the `$PATH` environment variable, split across a vector. pub fn read_path() -> Vec<PathBuf> { match read_raw_path() { Some(path_str) => split_path_like(&path_str), None => vec![PathBuf::from("")], } } /// Split an `OsStri...
Rust
0
x(form, textvariable=tipo_var, values=["Entrada", "Saida"], width=18, bootstyle="secondary").grid(row=0, column=1, padx=10, pady=5) ttk.Label(form, text="Categoria:", font=default_font).grid(row=0, column=2, sticky=W, padx=5, pady=5) ttk.Entry(form, textvariable=categoria_var, width=25).grid(row=0, column=3, padx=10, ...
Python
1
precision_synchronous; pub mod decentralized_low_precision_synchronous; pub mod python_ffi_op; use crate::datatypes::BaguaBucket; use crate::{BaguaCommOpChannels, BaguaCoreError}; use std::fmt::Debug; use std::sync::Arc; pub trait CommOpTrait: Debug { fn execute_background_communication( &self, bu...
Rust
0
import numpy as np import scipy import pandas as pd from VerificadorTabelacar import VerificadorTabelacar def otimiza_regua(regua_ideal:pd.DataFrame, livres:pd.DataFrame)->tuple[pd.DataFrame,float]: """ Dado uma DF régua ideal de alocação de um ativo em vários fundos e um DF diferenças que dita qual a diferença...
Python
1
=================== // ===================================================================================== #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd)] pub enum BoundaryCond{ // Boundary condition Periodic, // Only valid for Rectanuglar system or La...
Rust
0
-------------------------- #[derive(Debug, StructOpt)] #[structopt(raw( long_version = "option_env!(\"LONG_VERSION\").unwrap_or(env!(\"CARGO_PKG_VERSION\"))" ))] #[structopt(raw(setting = "clap::AppSettings::ColoredHelp"))] #[structopt(raw(setting = "clap::AppSettings::DeriveDisplayOrder"))] pub struct Opt { /...
Rust
0
32, } #[derive(Debug)] pub enum Error { IO(std::io::Error), Parsing(crate::protocol::parser::ParsingError), } extern crate nalgebra as na; extern crate ncollide3d; extern crate nphysics3d; extern crate nphysics_testbed3d; use na::{Point3, Vector3}; use ncollide3d::query::Proximity; use ncollide3d::shape::{Bal...
Rust
0
ear(1 + 8 * 2 * 1, 64).to(device) self.layer2 = torch.nn.Linear(64, 30).to(device) self.layer3 = torch.nn.Linear((3 + 10 * 2 * 3) + 30, 64).to(device) self.layer4 = torch.nn.Linear(64, 64).to(device) self.layer5 = torch.nn.Linear(64, 3).to(device) # density估计网络 self.dens...
Python
1
from dataclasses import dataclass from typing import Any from uuid import UUID from src.domain.course.entities import Lesson from src.domain.course.protocols import LessonRepo from src.domain.exceptions import DomainError from src.infra.protocols import S3Storage @dataclass class BaseCommand: lesson_repo: Lesson...
Python
1
idx is None: bidx = i if p == 0 and bidx is not None: idxs.append((bidx, i)) bidx = None if i == len(pred) - 1 and bidx is not None: idxs.append((bidx, i+1)) # convert each bidx, eidx to a np array of the size of pred # with 1 for each span pre...
Python
1
.any(|w| { w[0] == triplet[0] && w[0] == w[1] && w[1] == w[2] && w[2] == w[3] && w[3] == w[4] }) }) { key_i += 1; if key_i == 64 { retu...
Rust
0
import dataclasses from typing import List import numpy as np from akuire.events import ManagerEvent from akuire.events.data_event import DataEvent, ImageDataEvent @dataclasses.dataclass class PairedEvent: manager: str event: ManagerEvent @dataclasses.dataclass class Acquisition: """Class that represe...
Python
1
ait } _ => Err(anyhow::Error::msg("unexpected subcommand")), }, None => Err(anyhow::Error::msg("no subcommand found")), } } async fn job_output( secret_key: &str, key_id: &str, region: &str, vault_name: &str, job_id: &str, ) -> Result<()> { let http_m...
Rust
0
__author__ = 'ssj' import json import urllib import logging import sys import time # --------------------------------- # Generate URL # --------------------------------- # This function converts the servername to URL which we need to query. def get_url(server_name, listen_port): """ Generating URL to get ...
Python
1
_median_conversion_time FROM (SELECT aggregation_target, steps, avg(step_1_conversion_time) AS step_1_average_conversion_time_inner, median(step_1_conversion_time) AS step_1_median_conversion_time_inner FROM (SELECT aggregation_target, steps, ...
Python
1
ution._validate_metadataQr8DMM* *t}}c40 *  % :7)DC%c* *  AAc URR5H=up#[UR5R X!R X#"555 M?...
Python
1
, causing all execution to stop. page_allocator::convert_to_heap_allocated(); frame_allocator::convert_to_heap_allocated(); let mut higher_half_mapped_pages: Vec<MappedPages> = higher_half_mapped_pages.iter_mut().filter_map(|opt| opt.take()).collect(); higher_half_mapped_pages.push(heap_mapped_pages...
Rust
0
id: {:#066x}", tx_id); let start = Instant::now(); while Instant::now() - start < TOTAL_TIMEOUT { match ( start_coin.clone(), check_cosmos_balance(dest, &contact).await, ) { (Some(start_coin), Some(end_coin)) => { if start_coin.amount + amount...
Rust
0
_ticket_type> for $ticket_type { type Error = Error; fn try_from(tss_ticket: $tss_ticket_type) -> Result<Self> { let tag = match StructureTag::try_from(tss_ticket.tag) { Ok(val) => { if !<$ticket_type>::POSSIBLE_TAGS.contains(&val) { ...
Rust
0
timer if it was running. pub fn cancel(&mut self) { if let Some(abort_handle) = &mut self.abort_handle { abort_handle.abort(); } } } impl<E> Publisher for Timer<E> where E: Message, { type Message = E; fn sender(&self) -> &Sender<E> { match &self.sender { ...
Rust
0
plexinterval_constraints( lin_exp, eq_bound)) ref_bounds = lin_coeffs @ inp_bound.lower + shifted_prob_sol _check_bounds(inp_bound, lin_coeffs, ref_bounds) def test_project_onto_bound(self): shape = (1, 10) lower, upper = test_utils.sample_bounds(jax.random.PRNGKey(0), ...
Python
1
def calculate_total( oranges, apples): return 2*oranges + 3*apples def plastic_bags_price(bags): """one bag 0.1, two bags 0.4, three bags 0.9 """ return 0.1*bags*bags
Python
1
from skfp.fingerprints import ECFPFingerprint >>> smiles = ["O", "CC", "[C-]#N", "CC=O"] >>> fp = ECFPFingerprint() >>> fp ECFPFingerprint() >>> fp.transform(smiles) array([[0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ...,...
Python
1
def is_on(self) -> bool: """Return true if low battery is detected from the binary sensor.""" return self.service.value(CharacteristicsTypes.STATUS_LO_BATT) == 1 ENTITY_TYPES = { ServicesTypes.MOTION_SENSOR: HomeKitMotionSensor, ServicesTypes.CONTACT_SENSOR: HomeKitContactSensor, Serv...
Python
1
, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, ...
Rust
0
::c_int + 2 as libc::c_int + 3 as libc::c_int) as libc::c_int & crate::jdct_h::RANGE_MASK) as isize, ); *outptr.offset(7 as libc::c_int as isize) = *range_limit.offset( ((tmp27 + tmp13 >> 13 as libc::c_int + 2 as libc::c_int + 3 as libc::c_int) ...
Rust
0
event["log"]["hello"] = "goodbye" emit(event) end """ "#, ) .unwrap(); let n: usize = 10; let events = (0..n).map(|i| Event::from(format!("program me {}", i))); let in_stream = Box::pin(stream::iter(events)); let ou...
Rust
0
es(), &(headers.len() as u64).to_be_bytes(), &headers, ].concat(); let sig = signer.sign(&message).await; Signature { cert_url, cert_sha256, date, expires, id, sig, validity_url, }...
Rust
0
); } pub fn set_play_pos(&self, pos: f64) { #[cfg(not(feature="mpris"))] let _ = pos; #[cfg(feature="mpris")] self.mpris.set_play_pos(pos); } pub fn set_is_shuffled(&self, is_shuffled: bool) { #[cfg(not(feature="mpris"))] let _ = is_shuffled; #[cfg...
Rust
0
f64, f64); pub type TripleF64 = (f64, f64, f64); pub type Sector = (u64, u64, u64, u64); pub type Thread = JoinHandle<()>; pub const DEFAULT_WIDTH : u64 = 640; pub const DEFAULT_HEIGHT : u64 = 480; pub const DEFAULT_FOV : f64 = 90.; pub const DEFAULT_APERTURE : f64 = 1.; pub const DEFAULT_ASPECT...
Rust
0
earch_img": cache = os.path.join(save_path, dataset_name, f"image_search_res_{idx}.json") if os.path.exists(cache): with open(cache) as f: saved = json.load(f) imgs, txts = parse_image_search_result_by_image(saved, save_path, idx, conversation_num) if ...
Python
1
layout: String }, } lazy_static!{ static ref ORACLE_RE: Regex = Regex::new(r"(?P<reminder>\(.+\))").unwrap(); static ref MANACOST_RE: Regex = Regex::new(r"(?P<symbol>\{.+?\})").unwrap(); } fn prettify_oracle_text(text: &str) -> String { ORACLE_RE.replace_all(text, "<i>$reminder</i>") .lines() ...
Rust
0
class FilteredOutput: """ A class returned by the filter objects containing the sanitized or blocked prompt and an evaluation flag. Attributes: output (str): The sanitized or original prompt. eval (Literal["SAFE", "UNSAFE", "BLOCKED"]): The evaluation flag. """ def __init__(self, o...
Python
1
app, commands: HashMap::new(), default_action: Box::new(default_action), state_initializer: Box::new(state_initializer), console_support: None, } } pub fn with_console_support_default(self) -> Self { self.with_console_support( ...
Rust
0
ce=mask_ms["stage1"].device, requires_grad=False) if inverse: depth_itv = (1/hypo_depth[:,2,:,:]-1/hypo_depth[:,1,:,:]).abs() # B H W mask_out_of_range = ((1/hypo_depth - 1/depth_gt.unsqueeze(1)).abs() <= depth_itv.unsqueeze(1)).sum(1) == 0 # B H W else: depth_itv =...
Python
1
{ contents.splice(.., new_contents.into_iter()); } else { self.0.push((new_filename, new_contents)); } } pub fn clear(&mut self) { self.0.clear(); } pub fn checksums(&self) -> Checksums { self.0.iter() .map(|(filename, data)|...
Rust
0
: FormatType = "podcast", system_prompt: str = None ) -> str: try: output_dir = Path(output_dir) output_dir.mkdir(parents=True, exist_ok=True) try: metadata = get_pdf_metadata(pdf_path) if metadata: logger.info(f"PDF Pages: {metadata['num_pages']}...
Python
1
{constants, Buffer, BUFSIZ, FILE}; use core::{cell::UnsafeCell, ptr}; use crate::{fs::File, io::LineWriter, platform::types::*, sync::Mutex}; use alloc::vec::Vec; pub struct GlobalFile(UnsafeCell<FILE>); impl GlobalFile { fn new(file: c_int, flags: c_int) -> Self { let file = File::new(file); let ...
Rust
0
:launched=20230124 ]} :current=1 :time=20221221 :expires=2023 :price=1000000 :currency=usd ] ''') self.len(1, nodes) self.nn(...
Python
1
ygame.K_r: tetris.reset_game() elif event.key == pygame.K_LEFT and not tetris.check_collision(dx=-1): tetris.current_tetromino.x -= 1 elif event.key == pygame.K_RIGHT and not tetris.check_collision(dx=1): tetris.current_tetromin...
Python
1
# -*- coding: utf-8 -*- '''Hierarchical Model for inferring the mean (mu) and sample size (kappa) of various Bernoulli trials via MCMC. Python (PyMC) adaptation of the R code from "Doing Bayesian Data Analysis", by John K. Krushcke. More info: http://doingbayesiandataanalysis.blogspot.com.br/ ''' from __future__ impor...
Python
1
from builder import rule import os, shutil, glob # for a complete distribution build from scratch, say 'build clean all' @rule() def html(): "Create html files" os.system("make html") @rule("../winhelp") def winhelp(): "Create Windows Help file" dest = os.path.join(os.getcwd(), "..", "winhelp") os...
Python
1
default=None, title="Random vertical flip", description="Randomly flip images vertically along the horizontal axis (swap top and bottom)", ) color_jitter: ColorJitter | None = Field( default=None, title="Color jitter", description="Settings for random color jitter (bright...
Python
1
55$)Nrrrr ScalarListr)rrrs r:_foreach_lerp_scalarlistrJ    ! ! $$    " "; >  r< running_mean running_vartrainingexponential_average_factorepsilonc [RUUUUUUUU5...
Python
1
ton(ax_button, 'Remove DC Shift') # Function to handle button click def remove_dc_shift(event): # Apply high-pass filter to the original channels filtered_channel1 = highpass_filter(channel1, 0.1, fs) filtered_channel2 = highpass_filter(channel2, 0.1, fs) # Update the filtered data to the new line...
Python
1
import librosa import numpy as np import time def extract_features(file_path, sr=22050, duration=None, hop_length=1024, verbose=True): y, sr = librosa.load(file_path, sr=sr, duration=duration) features = {} if verbose: print(f"[INFO] Loaded {file_path} | Duration: {librosa.get_duration(y=y, sr=sr):...
Python
1
import dfa_nfa as dfa_module #import dfa_deriv2 as dfa_module import dfa_statecount from parse import make_parser maker = dfa_module.Maker() parse = make_parser(maker) whitespace = parse('( |\t)*') re_strings = open('c-lex0').read().splitlines() res = map(parse, re_strings) alts = maker.make_scanner(whitespace, res) ...
Python
1
eighted data / Proportion of non-weighted data if ts_code == "": csv_files = glob.glob(daily_path + "/*.csv") ts_codes = [] for csv_file in csv_files: ts_codes.append(os.path.basename(csv_file).rsplit(".", 1)[0]) ts_code = random.sample(ts_codes, 1)[0] data_file_...
Python
1
self.rl_models[model_name] = CVaRWrapper.load(model_path) elif model_name == "qr_dqn": self.rl_models[model_name] = QRDQN.load(model_path) logger.info(f"Modèles RL chargés pour {self.market}") except Exception as e: error_msg =...
Python
1
#!/usr/bin/env python # # MIT License # # Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to us...
Python
1
an incorrect use of DoubleEndedIterator. Use Step instead /*let impl_diter = quote!{ #[automatically_derived] #[allow(unused_attributes)] impl #impl_generics ::#std::iter::Iterator for ::#std::iter::Rev<#struct_ident> #ty_generics #where_clause{ #[inline] fn next_back(&mut self) -> Option<Self::Item...
Rust
0
import psycopg2 from typing import Dict,Union DB_CONFIG:Dict[str,Union[str,int]] = { 'host': 'my_postgres', 'port': 5432, 'database': 'mydatabase', 'user': 'user', 'password': 'password', } def get_connection(): conn = psycopg2.connect(**DB_CONFIG) return conn
Python
1
ative(Debug)] pub struct EnergyComponentStorages<'s> { /// `MapUnboundedDelete` component storage. #[derivative(Debug = "ignore")] pub map_unbounded_deletes: WriteStorage<'s, MapUnboundedDelete>, /// `HitTransition` components. #[derivative(Debug = "ignore")] pub hit_transitions: WriteStorage<'s...
Rust
0
# 763. Partition Labels from typing import List class Solution: def partitionLabels(self, s: str) -> List[int]: a = {} for i, j in enumerate(s): a[j] = i cur, size, res = 0, 0, [] for i, j in enumerate(s): h = a[j] size += 1 if h > cu...
Python
1
ol>, // on_queue[v] = is v currently on the queue? queue: Queue<usize>, // queue of vertices to relax cost: usize, // number of calls to relax() cycle: Option<Vec<DirectedEdge>>, // negative cycle (or null if no such cycle) } impl BellmanFordSP { /...
Rust
0
CCLTOIFGW { _UCCLTOIFGW { w: self } } #[doc = "Bit 8 - I2C Receive Interrupt Flag 1"] #[inline] pub fn ucrxifg1(&mut self) -> _UCRXIFG1W { _UCRXIFG1W { w: self } } #[doc = "Bit 9 - I2C Transmit Interrupt Flag 1"] #[inline] pub fn uctxifg1(&mut self) -> _UCTXIFG1W { ...
Rust
0
from mir.extractors import ExtractorBase from mir import io import librosa import numpy as np class ChromaAlignedFramedWave(ExtractorBase): def get_feature_class(self): return io.SpectrogramIO def extract(self,entry,**kwargs): hop_length=entry.prop.hop_length n_frame=entry.prop.n_fra...
Python
1
)]) -> usize { let (horizontal, fold_coordinate) = folds.first().expect("No folds"); fold(points, *horizontal, *fold_coordinate).len() } // end::part1[] // tag::part2[] /// perform all fold operations and return result as a ``String`` pub fn solution_2(points: &BTreeSet<(usize, usize)>, folds: &[(bool, usize)]...
Rust
0
&PPlig;': '\ueedd', '&ppflourlig;': '\ueed7', '&ppliguml;': '\uebe7', '&PPliguml;': '\uebe6', '&Prev;': 'ꟼ', '&qenl;': '\ueef2', '&qscap;': '\uef0c', '&qslstrok;': 'ꝙ', '&Qslstrok;': 'Ꝙ', '&qbardes;': 'ꝗ', '&Qbardes;': 'Ꝗ', '&qbardestilde;': '\ue68b', '&q2app;': '\ue8b3', '&q3app;': ...
Python
1
import os import json import yaml from typing import Any, IO from utils.dynamic_import import get_class_by_name class IncludeLoader(yaml.SafeLoader): """ Class extending the YAML Loader to handle nested documents YAML Loader with `!include` constructor. From: https://gist.github.com/joshbode/569627c...
Python
1
e='conv1')(x) x = tf.keras.layers.BatchNormalization( momentum=BATCH_NORM_DECAY, epsilon=BATCH_NORM_EPSILON, name='bn_conv1')(x) x = tf.keras.layers.Activation('relu')(x) x = dropout_layer(x) x = tf.keras.layers.MaxPooling2D(3, strides=2, padding='same')(x) x = group( x, [64, 64, 256]...
Python
1
[4963, 4964], [4964, 4965], [4965, 4966], [4966, 4967], [4967, 4968], [4968, 4969], [4969, 4970], [4970, 4971], [4971, 4972], [4972, 4973], [4973, 49...
Python
1
:{self, WebSocket, WebSocketUpgrade}, Extension, TypedHeader, }, http::header, response::{Html, IntoResponse, Response}, routing::get, AddExtensionLayer, Router, }; use clap::Parser; use futures::{sink::SinkExt, stream::StreamExt}; use headers::HeaderValue; use msg::ToSlaveMessage; use std::...
Rust
0
import json import os import time import uuid from datetime import datetime, timezone from typing import Optional, Any import httpx from fastapi import APIRouter, Depends from fastapi.encoders import jsonable_encoder from fastapi_cache.decorator import cache from httpx import HTTPError from pydantic import ValidationE...
Python
1
izedCfg<H> where &'a Self: ContextFreeRef<'a, Target = Self>, H: Binarize + Clone + 'static { let mut grammar = BinarizedCfg::from_context_free(self); SequencesToProductions::rewrite_sequences(&self.sequence_rules[..], &mut grammar); grammar } } impl<H, Hs> Context...
Rust
0
} self } pub fn selected(mut self, selected: bool) -> Self { let is_already_selected = self.html.is_contains_class(Self::SELECTION_CLASS); if is_already_selected && !selected { self.html.remove_class(Self::SELECTION_CLASS); } else if !is_already_selected &&...
Rust
0
or in-distribution samples. aupr_out (float): Area under the precision-recall curve for out-of-distribution """ print("MLS inference..") id_conf, id_pred = torch.max(id_logits, dim=1) ood_conf, ood_pred = torch.max(ood_logits, dim=1) conf = np.concaten...
Python
1
pub fn new() -> Digest { Digest { inner: Context::new(&SHA512) } } /// Calculate the SHA-512 digest of the contents of `path`, running /// the actual hash computation on a background thread in `pool`. pub fn file<T>(path: T, pool: &CpuPool) -> SFuture<String> where T: AsRef<Path> { ...
Rust
0
fn run(&self); } fn observe_bridge(shared_data: Shared<AppsSharedData>, config: &Config) { let receiver = GeckoBridgeService::shared_state().lock().observe_bridge(); loop { if GeckoBridgeService::shared_state().lock().is_ready() { if let Err(err) = shared_data.lock().registry.register_...
Rust
0
e if (x.inner() <= (max_answer.inner() - y.inner()) / n) && (-x.inner() <= (max_answer.inner() + y.inner()) / n) { // mult_and_add:=n*x+y mult_and_add = scaled::new_from_inner(n * x.inner() + y.inner()); } // else begin arith_error:=true; mult_and_add:=0; else { globals....
Rust
0
, boost=1.0, ) shoulds.append(should) if query.similar_words is not None and len(query.similar_words) > 0: should = self.__make_function_score( phrases=query.similar_words, boost=0.3, ) shoulds.append(sho...
Python
1
192; pub const G_REGEX_FIRSTLINE: GRegexCompileFlags = 262144; pub const G_REGEX_DUPNAMES: GRegexCompileFlags = 524288; pub const G_REGEX_NEWLINE_CR: GRegexCompileFlags = 1048576; pub const G_REGEX_NEWLINE_LF: GRegexCompileFlags = 2097152; pub const G_REGEX_NEWLINE_CRLF: GRegexCompileFlags = 3145728; pub const G_REGEX_...
Rust
0
FLATED, } #[derive(Clone, Copy, PartialEq, Eq, Debug)] #[repr(u32)] pub enum PosterizeProp { RedValueCount = D2D1_POSTERIZE_PROP_RED_VALUE_COUNT, GreenValueCount = D2D1_POSTERIZE_PROP_GREEN_VALUE_COUNT, BlueValueCount = D2D1_POSTERIZE_PROP_BLUE_VALUE_COUNT, } #[derive(Clone, Copy, PartialEq, Eq, Debug)] #...
Rust
0
c::AtomicUsize = atomic::AtomicUsize::new(0); let id = ATOMIC_ID.fetch_add(1, atomic::Ordering::SeqCst); format!("runtime-{}", id) }) .build() .map_err(Into::into) } pub(crate) fn initialize_runtime01() -> Result<runtime01::Runtime> { runtime01::Builder::new() ...
Rust
0
{ self.clear_ident(); self.unknown_fields.clear(); } } impl ::std::fmt::Debug for SvcGetDefaultCfg { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } impl ::protobuf::reflect::ProtobufValue for SvcGetDefaultCfg { fn...
Rust
0
g(); let manager = crate::Manager::new(url, self.connection_properties.clone()); let pool_config = self.get_pool_config(); Pool::from_config(manager, pool_config) } /// Get `URL` which can be used to connect to /// the database. pub fn get_url(&self) -> &str { if let Some...
Rust
0
s): return PlaceSuccess.cls_uuid def reset_metric(self, *args, episode, task, observations, **kwargs): task.measurements.check_measure_dependencies( self.uuid, [ ObjAtGoal.cls_uuid, EndEffectorToRestDistance.cls_uuid, ], ) ...
Python
1
(&mut self) -> &mut ::std::any::Any { self as &mut ::std::any::Any } fn into_any(self: Box<Self>) -> ::std::boxed::Box<::std::any::Any> { self } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { Self::descriptor_static() } fn new() -> CountArgume...
Rust
0
execs().with_status(0) .with_stdout(&format!("\ {compiling} a2 v0.5.0 ([..]) {compiling} a1 v0.5.0 ([..]) {compiling} b v0.5.0 ([..]) ", compiling = COMPILING))); }); #[doc = "Reader of register EVTOMCUPOL"] pub type R = crate::R<u32, super::EVTOMCUPOL>; #[doc = "Writer for register EVTOMCUPOL"...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2025 Google LLC. 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 requir...
Python
1
is a sell, so u can buy stock at i-th transaction dp[i][0] = max(dp[i][0], dp[i - 1][1] - price); // i-th transaction is a but, so u can sell stock at i-th transaction dp[i][1] = max(dp[i][1], dp[i][0] + price); } } dp[k - 1][1] } } #[cf...
Rust
0
pan.html fn record_debug(&mut self, field: &field::Field, value: &dyn fmt::Debug) { let attribute = api::Key::new(field.name()).string(format!("{:?}", value)); if let Some(attributes) = &mut self.0.attributes { attributes.push(attribute); } else { self.0.attributes = ...
Rust
0
import os.path as osp from cvpods.configs.rcnn_fpn_config import RCNNFPNConfig _config_dict = dict( MODEL=dict( WEIGHTS="../mask_rcnn.res50.fpn.lvis.multiscale.1x/log/plain_model_final.pth", MASK_ON=True, BACKBONE=dict(FREEZE=True), PROPOSAL_GENERATOR=dict(FREEZE=True), RES...
Python
1
import _plotly_utils.basevalidators class TextfontValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="textfont", parent_name="scattergeo.unselected", **kwargs ): super(TextfontValidator, self).__init__( plotly_name=plotly_name, pa...
Python
1
library makes use of `unsafe` to get better performance. Generally speaking, it's not possible to have a high performance serialization library without `unsafe`. It is only used where performance improvements are significant and additional checks are performed so that the worst case for any `unsafe` block is it lead...
Rust
0
.khz(), clocks); let mut ht16k33 = HT16K33::new(i2c, DISP_I2C_ADDR); ht16k33.initialize().expect("Failed to initialize ht16k33"); ht16k33 .set_display(Display::ON) .expect("Could not turn on the display!"); ht16k33 .set_dimming(Dimming::BRIGHTNESS_MAX)...
Rust
0
from django.shortcuts import render, redirect from .models import Task from .forms import TaskForm from django.shortcuts import get_object_or_404 # Create your views here. # Homepage def homepage(request): return render(request, 'tasks/homepage.html') # fetching all tasks from the database def task_list(request): ...
Python
1
&T, state: &InfoInfo) -> String { let mut res = String::new(); thing .fmt(&mut res, state) .expect("formatting to string should not fail"); res } #[derive(Copy, Clone)] pub struct InfoInfo<'a> { game_time: u32, users: &'a HashMap<String, Arc<RoomUserInfo>>, } impl<'a> InfoInfo<'a>...
Rust
0
_base_ = './yolov7_l_fast_1xb16-100e_ionogram.py' # ======================== Modified parameters ======================= load_from = 'https://download.openmmlab.com/mmyolo/v0/yolov7/yolov7_x_syncbn_fast_8x16b-300e_coco/yolov7_x_syncbn_fast_8x16b-300e_coco_20221124_215331-ef949a68.pth' # noqa # ===================== ...
Python
1
# lists in python marks = [87, 74, 44, 98, 49] print(len(marks)) print(marks) student = ["afzal" , 89 , "Yasir"] student[0] = "Bilal" # lists are mutuble in python print (student) string = "SOOMRO" # string[0] = "M" // THIS ONE shows error because string are imutable in python print(string[0]) # list...
Python
1
e)) } } #[cfg(any(feature = "v1_2", feature = "dox"))] impl<'a> FromValue<'a> for SettingIP6ConfigAddrGenMode { unsafe fn from_value(value: &Value) -> Self { from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0)) } } #[cfg(any(feature = "v1_2", feature = "dox"))] impl SetValue for Settin...
Rust
0
from typing import List from collections import Counter import pandas as pd from lib.utils import get_seqential_user_ids class PopularRecommender: def __init__( self, top_items: List[int], ): self.top_items = top_items def recommend(self, data: List[List[int]]) -> pd.D...
Python
1
perplexity is: ',(np.exp(np.mean(np.array(cost)))) def main(argv): global vae, emb m = '' f = '' s = '' t = '' b = '' r = '' e = '' try: opts, args = getopt.getopt(argv,"hpnm:f:s:t:b:r:,e:",["default=","model=","layer1=","layer2=","num_topics=","batch_size=","learning_rate=","...
Python
1
true', help='Push to HuggingFace hub') parser.add_argument('--hub-name', help='HuggingFace hub dataset name (username/dataset)') parser.add_argument('--private', action='store_true', default=True, help='Make dataset private on HuggingFace Hub') parser.add_argument('--public', dest='private', action='store_f...
Python
1