text
string
label_name
string
labels
int64
e(Parser)] #[clap(version = config::VERSION, author = config::AUTHOR_EMAIL, about = config::ABOUT)] struct Opts { #[clap(subcommand)] subcmd: SubCommand, } #[async_std::main] async fn main() { let opts: Opts = Opts::parse(); match opts.subcmd { SubCommand::List(list) => list.exec().await, ...
Rust
0
""" ¿Preparad@ para aprender o repasar el lenguaje de programación que tú quieras? - Recuerda que todas las instrucciones de participación están en el repositorio de GitHub. Lo primero... ¿Ya has elegido un lenguaje? - No todos son iguales, pero sus fundamentos suelen ser comunes. - Este primer reto te servirá para ...
Python
1
# # @lc app=leetcode id=452 lang=python # # [452] Minimum Number of Arrows to Burst Balloons # # @lc code=start class Solution(object): def findMinArrowShots(self, points): """ :type points: List[List[int]] :rtype: int """ # sort the points with the points[1] # if ba...
Python
1
_simple(size, size, gdk_pixbuf::InterpType::Bilinear) { gtk::Image::from_pixbuf(Some(&pixbuf)) } else { panic!("File: {:?} Line: {:?}", file!(), line!()) } } // SAVE pub fn colln_save_pixbuf() -> gdk_pixbuf::Pixbuf { gdk_pixbuf::Pixbuf::from_xpm_data(COLLN_SAVE_XPM) } pub fn colln_save...
Rust
0
des def make_output_human_readable( self, output_dict: Dict[str, torch.Tensor] ) -> Dict[str, torch.Tensor]: """ Converts indices to string labels, and adds a `"label"` key to the result. """ predictions = output_dict["probs"].cpu().data.numpy() argmax_indices = n...
Python
1
if streamtype is HLSStream: return HLSStream.parse_variant_playlist(self.session, videos[fmt], name_fmt="{pixels}_{bitrate}") if streamtype is DASHStream: subtitlestreams = {} if self.session.get_option("mux-subtitles") and "webvtt" in subtitles: ...
Python
1
Err("Unknown error") } } } /// Function used to create a [Exchange][Exchange] struct. /// /// Instead of using this function directly calling through [APIKey][APIKey] /// method is recommended #[must_use] pub fn exchange(from: &str, to: &str, api_data: (&str, Option<u64>)) -> Exchange { let api; ...
Rust
0
rt inspect def mygetmodule(object): """Return the module an object was defined in, or None if not found.""" import os.path if inspect.ismodule(object): return object if hasattr(object, '__module__'): return sys.modules.get(object.__module__) try: file = inspect.getabsfile(o...
Python
1
); /// assert_eq!(u8_component, 255); /// ``` pub trait FromStimulus<T> { /// Converts `other` into `Self`, while performing the appropriate scaling, /// rounding and clamping. #[must_use] fn from_stimulus(other: T) -> Self; } impl<T, U: IntoStimulus<T>> FromStimulus<U> for T { #[inline] fn fro...
Rust
0
rt m09nljom75i as f4715jkbkk9 pass from ao5nh0wz72e import m4su7wt5o93 as ie3gy8yt95u, kcwo9aisd8_, vq_ysakqqu_, q7_b48fnfye as amgkr6qw2fw, rngx8gk1uim as mee3fj9ywfo, gc02c9bi907, ahc5ltp3ntv as pc0ckv6lrfr, cfm8jfgwx8b, t60vecklh3o j04tfb2jrl3 import bp30_np5on1 as r5u8o79c8p5, se5iy29hh26 as avepd3i...
Python
1
import json import sqlite3 # sqlite数据库 from flask import Flask, render_template, request, g from flask_bootstrap import Bootstrap # render_template是把模板渲染成 html文件的函数 # g是一个用于存储一个请求的全局变量的特殊对象,且每次请求都会重置这个对象。 # Bootstrap是一个用于美化页面的库 # -----Flask设置----- app = Flask(__name__) bootstrap = Bootstrap(app) # -----Flask设置----- ...
Python
1
"""Создайте две функции для кодирования и декодирования строки с помощью шифра «Рельсы». Этот шифр используется для кодирования строки путём последовательного размещения каждого символа по диагонали вдоль набора «рельсов». Сначала начните двигаться по диагонали вниз. Когда вы дойдёте до конца, измените направление и...
Python
1
Chunk; } extern "C" { pub fn g_mem_chunk_destroy(mem_chunk: *mut GMemChunk); } extern "C" { pub fn g_mem_chunk_alloc(mem_chunk: *mut GMemChunk) -> gpointer; } extern "C" { pub fn g_mem_chunk_alloc0(mem_chunk: *mut GMemChunk) -> gpointer; } extern "C" { pub fn g_mem_chunk_free(mem_chunk: *mut GMemChunk, ...
Rust
0
omaly Detection def perform_anomaly_detection(y_test, y_pred, threshold=0.3): anomalies = [] for actual, predicted in zip(y_test, y_pred): if actual != 0 and np.abs((actual - predicted) / actual) > threshold: anomalies.append(True) else: anomalies.append(False) i...
Python
1
w: &mut W ) -> io::Result<()> { let n = arr.len(); let (ty, s) = <Self as Scalar>::ty().scalar(); let state = State::new() .write_type_format(ty, w)? .write_property_id(property_id, w)? .write_bytes(s * n as u64, w)? .write_offset_insta...
Rust
0
import torch import torch.nn as nn import torch.nn.functional as F from coperception.models.seg.FusionBase import FusionBase class DiscoNet(FusionBase): def __init__( self, n_channels, n_classes, num_agent, kd_flag=True, compress_level=0, only_v2i=False ): super().__init__( n_chan...
Python
1
output_buf.copy_from_slice(&bytes[..output_byte_size]); Ok(()) } } impl<P: $params> CanonicalDeserialize for $field<P> { fn deserialize(bytes: &[u8], extra_info_buf: &mut [bool]) -> Result<Self, crate::serialize::SerializationError> whe...
Rust
0
node( self, node: RVIdentifier ) -> Tuple[dist.Distribution, Set[RVIdentifier]]: """ Invoke a random variable function conditioned on the current world. Args: node (RVIdentifier): RVIdentifier of node. Returns: Its distribution and set of parent nodes ...
Python
1
r `()`, `(A, B)` and the subcomponent itself. #[macro_export] macro_rules! make_index_trait { ([<$($lft:lifetime),*>, $ty:ident, $trait:ident, $notrait:ident, $f:ident, $f_mut:ident] $($fns:item)*) => { /// A trait for looking up a subcomponent of the data of [`MmbIndex`]. pub trait $trait<$($lft),*> { ...
Rust
0
from typing import List import torch import torch.nn.functional as F from nuplan.planning.training.modeling.metrics.abstract_training_metric import AbstractTrainingMetric from nuplan.planning.training.modeling.types import TargetsType def calculate_perplexity(logits, targets, token_mask): """ Calculates per...
Python
1
execution_time = time.time() - start_time metadata["execution_time"] = execution_time metadata["fatal_error"] = error_message # Sidste udvej: Returner helt basale vinkler angles = [ { "overskrift": f"Nyheder om {topic}", "beskrivel...
Python
1
330.0, 329.0, 328.0, 327.0, 326.0, 325.0, 324.0, 323.0, 322.0, 321.0, 320.0, 319.0, 318.0, 317.0, 316.0, 315.0, 314.0, 313.0, 312.0, 311.0, 310.0, 309.0, 308.0, 307.0, 306.0, 305.0, 304.0, 303.0, 302.0, 301.0, 300.0, 299.0, 298.0, 297.0, 296.0, 295.0, 294.0, 293.0, 292.0, 291.0, 290.0, 289.0, 288.0, 287.0, 286.0, 285....
Python
1
(buf)) } pub async fn get_device_image_url(token: &str, uuid: &str) -> Result<String> { info!("Getting image URL from '{}' device state", uuid); let value = get(token, &get_device_state_endpoint(uuid)) .await? .json::<Value>() .await?; let image_url = get_image_from_device...
Rust
0
_AUTOTAKE_DONE => 6, VEC2_EVR::TIMER1_EV => 5, VEC2_EVR::TIMER0_EV => 4, VEC2_EVR::TDC_DONE => 3, VEC2_EVR::AUX_COMPB => 2, VEC2_EVR::AUX_COMPA => 1, VEC2_EVR::AON_RTC_CH2 => 0, } } #[allow(missing_docs)] #[doc(hidden)] #[in...
Rust
0
iv_der)); let dec = try!(privkey.decrypt(pkey::RSAPadding::OAEP_MGF1_SHA1, &*enc)); println!("Decoded: {}", String::from_utf8(dec).unwrap()); Ok(()) } fn main() { println!("{:?}", doit()); let _ = nss::close(); } use pkmnapi_db::{PokemonStats, TypeName}; use rocket_okapi::JsonSchema; use serde::{D...
Rust
0
(points, start_x, start_y, image_height, image_width, scale): points = list(points) ps = sorted(points, key=lambda x: x[0]) if ps[1][1] > ps[0][1]: px1 = ps[0][0] * scale + start_x py1 = ps[0][1] * scale + start_y px4 = ps[1][0] * scale + start_x py4 = ps[1][1] * scale + sta...
Python
1
# Examples /// /// ``` /// use velvet_core::prelude::*; /// /// // orthorhombic cell /// let cell = Cell::triclinic(1.0, 2.0, 3.0, 90.0, 90.0, 90.0); /// assert_eq!(cell.a(), 1.0); /// assert_eq!(cell.b(), 2.0); /// assert_eq!(cell.c(), 3.0); /// ``` pub fn triclinic( ...
Rust
0
finalize_wait_cert(&mut eid, &mut wait_cert_info, &prev_cert, &prev_block_id, &prev_wait_cert_sig, &block_summary, &wait_time).unwrap(); assert_eq!(ret, "Success"); let wait_cert = ffi::create_string_from_char_ptr(wait_...
Rust
0
![]; let keys = loop { let page = RpcApi::<B>::get_keys_paged( self.as_online().rpc_client(), Some(prefix.clone()), PAGE, last_key.clone(), Some(at), ) .await .map_err(|e| { error!(target: LOG_TARGET, "Error = {:?}", e); "rpc get_keys failed" })?; let page_len = page.len(...
Rust
0
onfig.insert_use.prefix_kind); if proposed_imports.is_empty() { return None; } let range = match &syntax_under_caret { NodeOrToken::Node(node) => ctx.sema.original_range(node).range, NodeOrToken::Token(token) => token.text_range(), }; let group_label = group_label(import_ass...
Rust
0
insert("print_f32", Extern::Func(HostRef::new(func))); let ty = FuncType::new(Box::new([ValType::F64]), Box::new([])); let func = wrap(store, ty, |params, _results| { println!("{}: f64", params[0].unwrap_f64()); Ok(()) }); ret.insert("print_f64", Extern::Func(HostRef::new(func))); ...
Rust
0
import importlib import os from typing import List from ray.train.v2._internal.constants import RAY_TRAIN_CALLBACKS_ENV_VAR from ray.train.v2._internal.execution.callback import RayTrainCallback def _initialize_env_callbacks() -> List[RayTrainCallback]: """Initialize callbacks from environment variable. Ret...
Python
1
xecOrderField'] = CKSOTPInputExecOrderField #输入执行宣告操作 CKSOTPInputExecOrderActionField = {} #经纪公司代码 CKSOTPInputExecOrderActionField["BrokerID"] = "string" #投资者代码 CKSOTPInputExecOrderActionField["InvestorID"] = "string" #执行宣告操作引用 CKSOTPInputExecOrderActionField["ExecOrderActionRef"] = "int" #执行宣告引用 CKSOTPInputExecOrder...
Python
1
mdArgs::new(); let num_required = args.required("--num_required").parse::<usize>().unwrap(); let out = args.required("--out"); let mut rng = XorShiftRng::seed_from_u64(args.required("--rng_seed").parse::<u64>().unwrap()); let map = if let Some(path) = args.optional("--map") { Map::load_synchrono...
Rust
0
ile_path): print(f"Error: File '{file_path}' not found.") return try: with open(file_path, 'r', encoding='utf-8', errors='ignore') as f: text = f.read() except Exception as e: print(f"Error reading file: {e}") return extractor = HybridExtractor()...
Python
1
plt.figure(figsize=(15, 10)) # Plot control commands ax1 = plt.subplot(221) control_commands = np.array(control_commands) x = range(len(arm_states)) width = 0.35 ax1.bar(x, control_commands[:, -2], width, label='Joint 1 Torque') ax1.bar([i + width for i in x], control_commands[:, ...
Python
1
= " `console` can be any size, the active render will try to scale it to fit"] #[doc = " the screen."] #[doc = ""] #[doc = " The function will only work for the SDL2/OPENGL2 renderers."] #[doc = ""] #[doc = " Unlike :any:`TCOD_console_flush` this will not present the display."] #[doc = " Y...
Rust
0
"juniDhcpCompliance10": juniDhcpCompliance10, "juniDhcpCompliance11": juniDhcpCompliance11, "juniDhcpCompliance12": juniDhcpCompliance12, "juniDhcpMIBGroups": juniDhcpMIBGroups, "juniDhcpRelayGroup": juniDhcpRelayGroup, "juniDhcpProxyGroup": juniDhcpProxyGroup, "juniDhcpL...
Python
1
from django.conf.urls.i18n import i18n_patterns from django.urls import include, path from wagtail import urls as wagtail_urls from wagtail.admin import urls as wagtailadmin_urls urlpatterns = [ path("admin/", include(wagtailadmin_urls)), ] urlpatterns += i18n_patterns(path("", include(wagtail_urls)))
Python
1
}} } } impl<'a, F, B> ExactSizeIterator for BezIter<'a, F, B> where F: Float, B: BezCurve<F> + OrderStatic {} /// An iterator over a bezier curve's interpolated points pub struct InterpIter<'a, F, B> where F: Float, B: 'a + BezCurve<F> { curve: &'a B, ...
Rust
0
if table not in dumpFromTbls: continue conf.tbl = table colList = [_ for _ in columns if _] if conf.exclude: colList = [_ for _ in colList if re.search(conf.exclude, _, re.I) is None] conf.col = ',...
Python
1
file_tree yells when pillarenv is missing for a relative path """ with patch.dict(file_tree.__opts__, {"pillarenv": None}): mypillar = file_tree.ext_pillar(minion_id, None, ".") assert {} == mypillar for record in caplog.records: if record.levelname == "ERROR" and "pillaren...
Python
1
} } # [ doc = "Checks if the value of the field is `DISABLE_THE_DAI_`" ] # [ inline ( always ) ] pub fn is_disable_the_dai_(&self) -> bool { *self == RFDAIER::DISABLE_THE_DAI_ } # [ doc = "Checks if the value of the field is `ENABLE_THE_DAI_`" ] ...
Rust
0
jnp.roll( jnp.logical_not(OBSTACLE_MASK), (x, y, z), axis = (0, 1, 2)), OBSTACLE_MASK) MOMENTUM_EXCHANGE_MASK_IN = MOMENTUM_EXCHANGE_MASK_IN.at[location_in, i].set(True) ...
Python
1
n.net/Articles/658511/. // Portions Copyright 2017 The Chromium OS Authors, and Copyright 2018 // Amazon.com, Inc. extern crate bhyve_api; use bhyve_api::system::*; use bhyve_api::vm::*; use std::io::Write; use std::slice; use std::ptr::null_mut; const BSP: i32 = 0; const RTC_LMEM_LSB: i32 = 0x34; const RTC_LMEM_M...
Rust
0
a=int(input()) b=int(input()) s=list(range(1,a+1)) e=0 while len(s)>1: e=(e+b-1)%len(s) s.pop(e) print(s[0])
Python
1
ces_len[0]], 0, 1.0) buffer = tensor_model_parallel_all_reduce(buffer) # following S-LoRA, allows the fusing of all_gather and all_reduce # by adding the column partitioned lora output to a slice of output # tensor, which is a partial sum due to row parallel. All that # remains ...
Python
1
.prev_variant(), None); assert_eq!(Hasugami.prev_variant(), Some(Sakigami)); assert_eq!(Tsutagami.prev_variant(), Some(Hasugami)); # } ``` # Overview This crate provides macros to derive the following methods for unitary variant enums: - `EnumDisplay!` derives `Display`, which outputs the name of the variant. Note ...
Rust
0
anguage_model.DocumentingLanguageModel() else: generator_class = generator_lookup.GetGeneratorByLanguage(generator_name) generator_instance = generator_class(discovery_doc) api = generator_instance.api lang_model = generator_instance.language_model except ValueError: raise app.UsageEr...
Python
1
elem[3] = 0; } // fill pixel buffer let pixels: Vec<u8> = Vec::from(bitmap.buffer()); let mut offset = 0; match bitmap.pixel_mode().unwrap() { PixelMode::None => { panic!("Error while creating glyph"); ...
Rust
0
Debug)] /// Batch state. pub struct BatchState { /// Order that the request was performed in. pub order: FnvHashMap<RequestId, usize>, /// Oneshot send back. pub send_back: PendingBatchOneshot, } #[derive(Debug, Default)] /// Manages and monitors JSONRPC v2 method calls and subscriptions. pub struct RequestManager...
Rust
0
from os import environ as env LOG_HANDLER_LEVEL = env.get("LOG_HANDLER_LEVEL", "DEBUG") LOG_HANDLER_LEVEL_NULL = env.get("LOG_HANDLER_LEVEL_NULL", LOG_HANDLER_LEVEL) LOG_HANDLER_LEVEL_CONSOLE = env.get("LOG_HANDLER_LEVEL_CONSOLE", LOG_HANDLER_LEVEL) LOG_HANDLER_LEVEL_FILE = env.get("LOG_HANDLER_LEVEL_FILE", LOG_HANDLE...
Python
1
you don't need to send any PSN message. .add_refresh_token(refresh_token) // <- If refresh_token is provided then it's safe to ignore add_npsso and call auth directly. .add_npsso(npsso); // <- npsso is used only when refresh_token is not working or not provided. psn_inner = psn_inner .auth...
Rust
0
onse, secretkey: &SecretKey) -> Result<(), KyberError> { ake_shared_a( &mut self.shared_secret, &send_b, &self.temp_key, &self.eska, secretkey )?; Ok(()) } } // Unilaterally Authenticated Key Exchange initiation fn uake_init_a<R>( send: &mut[u8], tk: &mut[u8], sk: &mut[u8], ...
Rust
0
for vert in vertices: if vertexsemantic == "p": ilb.append(v[int(vert)-1]+color) idx.append(cnt) cnt = cnt + 1 elif vertexsemantic == "pt": #this means f 1/2 a = vert.split('/') ilb.append(v...
Python
1
# Copyright The OpenTelemetry Authors # # 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 ...
Python
1
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: mediapipe/tasks/cc/components/processors/proto/detector_options.proto # Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import des...
Python
1
.connect("tls.lvh.me", tcp_stream_c) .await .expect( "tls_connector .connect failed", ); println!("tls_stream_c {:?}", tls_stream_c); tls_stream_c.write(b...
Rust
0
16)>, ) -> Result<usize, &'static str> { let ap_startup_size_in_bytes = ap_start_realmode_end.value() - ap_start_realmode_begin.value(); let page_table_phys_addr: PhysicalAddress; let mut trampoline_mapped_pages: MappedPages; // must be held throughout APs being booted up let mut ap_startup_mapped_page...
Rust
0
a = m.group(1) try: signature = VIMEO_SCRAPE_SIG_RE.search(json_data).group(1) timestamp = VIMEO_SCRAPE_TIMESTAMP_RE.search(json_data).group(1) files_str = VIMEO_SCRAPE_FILES_RE.search(json_data).group(1) except AttributeError: # one of the RE's retured None logging.warn(...
Python
1
now = time.time() message = ( f"Polygon API error encountered: {type(e).__name__}\n" "This may be due to insufficient subscriptions or temporary server issues. " ) colored_message = colored(message, "yellow") l...
Python
1
skip("Failed to import required modules") with patch.object(vector_store_manager, 'load_vector_store', side_effect=Exception("Load failed")): result = vector_store_manager.validate_health() assert result is False def test_update_incrementally_load_failure(self,...
Python
1
item!(cx, #[path = $path] pub mod $ident; ).unwrap())) } #[plugin_registrar] pub fn plugin_registrar(reg: &mut Registry) { reg.register_syntax_extension(token::intern("mod_path"), IdentTT(Box::new(expand_mod_path), None, false)); } <gh_stars>1-10 use crate::pipeline_stage::PipelineStage; use ...
Rust
0
# -*- coding: utf-8 -*- """ Created on 2024/9/24 9:14 @file: redisConfig.py @author: Jerry """ is_localhost = False host = 'localhost' port = 6001
Python
1
=> { error!(log, "pcap error"; "err" => ?e); continue; } } } } use crate::nalgebra::{Isometry2, Point2}; use crate::{ nalgebra::Vector2, util, util::DespawnEntity, Player, PlayerDamaged, HALF_HEIGHT, HALF_WIDTH, PHYSICS_SCALE, }; use benimator::SpriteSheet...
Rust
0
. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If f...
Python
1
= new_br("<clinit>"); pub static ref S_CLINIT_SIG: BytesRef = new_br("()V"); pub static ref S_RUN_SIG: BytesRef = new_br("()Ljava/lang/Object;"); pub static ref S_NEW_STRING_SIG: BytesRef = new_br("([C)V"); pub static ref S_CLAZZ: BytesRef = new_br("clazz"); pub static ref S_FD: BytesRef = new_br("...
Rust
0
<VoxelImpact<RayIntersection<f32>>>, ray: Ray<f32>, max_toi: f32, predicate: F, } impl<F> VoxelRayCast<F> { fn new(ray: Ray<f32>, max_toi: f32, predicate: F) -> Self { Self { earliest_impact: None, ray, max_toi, predicate, } ...
Rust
0
p ); // new_xL = xR + (xL + Ci)^3 // new_xL = xR + tmp * (xL + Ci) // new_xL - xR = tmp * (xL + Ci) let new_xl_value = xl_value.map(|mut e| { e.add_assign(&self.constants[i]); e.mul_assign(&tmp_value.unwrap()); ...
Rust
0
".*_shin": 0.1, ".*_foot.*": 1.0, } indices_list, _, values_list = string_utils.resolve_matching_names_values(expected_damping, robot.joint_names) expected_damping = torch.zeros_like(expected_stiffness) expected_damping[:, indices_list] = torch.tensor(values_list, device=rob...
Python
1
from typing import List from pydantic import Field, BaseModel from app.schema import PageSchema from enums import ModuleEnum class InterfaceApiGroupFieldSchema(BaseModel): """ 接口步骤字段 """ id: int | None = None uid: str | None = None name: str | None = None description: str | None = None ...
Python
1
(p - pb).length() } fn _closest_point(ro: Vec3, rd: Vec3, p: Vec3) -> Vec3 { // returns the closest point on ray r to point p ro + (p - ro).dot(rd).max(0.0) * rd } fn _ray_ray_ts(ro1: Vec3, rd1: Vec3, ro2: Vec3, rd2: Vec3) -> Vec2 { // returns the two t's for the closest point between two rays // ro+r...
Rust
0
": "1.0.0", "custom": { "com.example.praxis": { "techne": true } } }"# .parse() .unwrap(); assert_that(&bun.custom).is_some(); let val: Option<&serde_json::Value> = bun .custom .as_ref() .unwrap() .get(&"com.example.pra...
Rust
0
class Solution: def minimumAverage(self, nums: List[int]) -> float: averages = [] nums.sort() l = 0 r = len(nums) - 1 while l < r: averages.append((nums[l] + nums[r]) / 2) l += 1 r -= 1 return min(averages)
Python
1
al kz2 = k0 * zerire + searchinterval / 2.0 - 1j * searchinterval Message("Found %d possible zeros." % len(zerire), 1).show(verbosity) Message("Possible zeros:\n%s" % zerire, 3).show(verbosity) Message("Refining zeros.", 1).show(verbosity) mk = 0 modi = [] for m in range(len(kz1)): i...
Python
1
""" def processed_topics(topic_list): processed_topics = [] colors = [ "#8A9B9B", "#7A9B8A", "#A1B3B2", "#8E9497", "#B3B8B6", "#7D8F8D", "#B5B8B4", "#A59A8B", "#B8B0A7", "#7A7A7A", "#A79BB2", "#8A9B9E", "#C1A59A", "#A89E8D", "#8F7B6C", "#B1A89D", "#7D8F8A", "#B8A8A8", "#A7A79C", "#7F8C8A", "#B1A...
Python
1
io::time::{interval, Duration, Interval}; #[derive(Debug, Error)] pub(super) enum BroadcastChanError { #[error(display = "Coord gone unexpectedly")] Coord(#[source] mpsc::SendError), #[error(display = "No one receiving")] NoReceivers, #[error(display = "error receiving from client")] ClientRecv...
Rust
0
let mut que = mt.msgq::<u32>(4); let (snd, rcv) = que.ch(); let v1 = Count(4); let v2 = Count(16); mt.register(0, 1, 256, || led_cnt(timer0, snd, &v1, &v2)); mt.register(1, 1, 256, || _led_tgl1(p0, rcv)); // blink and pause //mt.register(1, 1, 256, || _led_tgl2(p0, rcv)); // keep blinkin...
Rust
0
(42),[1;-1]) * Referenced by: '<S1>/kron(eye(42),[1;-1])' */ real_T kroneye4211_Gain[3528]; } ConstP_M2_POS_Control_T; /* External inputs (root inport signals with default storage) */ typedef struct { real_T M2_pos_cmd[42]; /* '<Root>/M2_pos_cmd' */ real_T M2_pos_FB[84]; /* '<R...
Rust
0
where Self: Sized { self.foo = self.stream.read_u1()?; match self.foo { 42 => { self.bar = self.stream.read_u2le()?; }, 43 => { self.bar = self.stream.read_u4le()?; }, } } } impl NonStandard { fn vi(&mut se...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import zipfile from generator import (download_to_file, get_abspath_source_file, get_version, write_to_file) def process(file, dst): with zipfile.ZipFile(get_abspath_source_file(file), 'r') as alexa_lists: for name in alexa_lists.name...
Python
1
Parameters ---------- ids : `str` or `list` A (comma-separated) list of the artist or user Spotify IDs. **Maximum**: Up to 50 IDs can be sent in one request. **Example**: :code:`"2CIMQHirSU0MQqyYHq0eOx, 57dN52uHvrHOxijzpIgu3E, 1vCWHaC5f2uS3yhpwWbIA6"`...
Python
1
type. /// The `control_value` can be any valid Rust expression. /// /// Example simple usage: /// ```rust /// fn func(v: i32, cb: impl FnOnce(i32, i32)->i32) { /// std::thread::sleep(std::time::Duration::from_secs(2)); /// let controlled_value = cb(v, v * 2); /// assert_eq!(controlled_value, 0i32); /// db...
Rust
0
from django.db import models # create class search by Text # class SearchQuery(models.Model): # query = models.TextField() # timestamp = models.DateTimeField(auto_now_add=True) # create class upload Image class UploadedImage(models.Model): image = models.ImageField(upload_to='uploads/') uploaded_at = ...
Python
1
_id_2 in leader_partners: teammates = leader_partners[final_score.third_place_user_id_2] third_place2 += "," + await get_teammate_mentions(teammates, guild_id) except Exception as e: # Might go in here in development since there is no member in the guild ...
Python
1
ad_setup.client.ls), str) assert isinstance(repr(nomad_setup.client.cat), str) assert isinstance(repr(nomad_setup.client.stat), str) def test_dunder_getattr(nomad_setup): with pytest.raises(AttributeError): d = nomad_setup.client.does_not_exist with pytest.raises(AttributeError): d =...
Python
1
collection_blocker_spinlock(&self) -> APSInclusiveGuard<'_> { loop { if let Some(inclusive_guard) = self.atomic_spinlock.lock_inclusive() { return inclusive_guard; } // block on the collector if we can't get the APS guard let collector_block = self...
Rust
0
# Copyright 2025 © BeeAI a Series of LF Projects, LLC # SPDX-License-Identifier: Apache-2.0 import mimetypes import re from collections.abc import AsyncGenerator from acp_sdk import Message from acp_sdk.models import MessagePart from acp_sdk.server import Context, Server from beeai_framework.backend import AssistantM...
Python
1
session_file = f"real_game_session_{datetime.now().strftime('%Y%m%d_%H%M%S')}.json" with open(session_file, 'w') as f: json.dump(session_data, f, indent=2) print(f"💾 Session saved: {session_file}") def play_real_game(target_image_path, device="CPU"): """Play with real ...
Python
1
from datetime import datetime, timezone from loguru import logger from src.modules.regulatory_pathway.model import AnalyzeRegulatoryPathwayProgress class AnalyzeProgress: def __init__(self): self.progress: AnalyzeRegulatoryPathwayProgress | None = None async def initialize(self, product_id: str, tot...
Python
1
nodes).count(); //println!("[approve] one: {}/1; approvers-dirty: {:?}; all: {:?}", approvers, approver_nodes, all_nodes); let clean: Vec<&ID> = clean_noise_approvers(all_nodes, approver_nodes) .take(1) .collect(); clean.first().is_some() } fn clean_noise_approvers<'a>(all_nodes: &'a HashSe...
Rust
0
from pwn import * import warnings def add(size,data): p.sendlineafter(">","1") p.sendlineafter(":",str(size)) p.sendafter(":",data) def edit(idx,data,cool = False): p.sendlineafter(">","2") p.sendlineafter(":",str(idx)) p.sendlineafter(":","0") if not cool: p.recvuntil("wrong gue...
Python
1
intId::of(methods::OPTION_FILTER_MAP), LintId::of(methods::OPTION_MAP_OR_NONE), LintId::of(methods::OR_FUN_CALL), LintId::of(methods::RESULT_MAP_OR_INTO_OPTION), LintId::of(methods::SEARCH_IS_SOME), LintId::of(methods::SHOULD_IMPLEMENT_TRAIT), LintId::of(methods::SINGLE_CHAR_ADD_STR), LintId...
Rust
0
java-lang-String" #[cfg(any(feature = "all", all(feature = "android-icu-text-TimeZoneNames_NameType", feature = "java-lang-String")))] pub fn valueOf<'env>(__jni_env: &'env __jni_bindgen::Env, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::lang::String...
Rust
0
#Задание_1 ''' passworld = input("Ведите пароль: ") if passworld == ("121212"): print("Пароль мовпал") else: print("Пароль не совпал") ''' ''' import re def check_password(password): # Условия min_length = 8 if len(password) < min_length: return "Пароль слишком короткий. Минимум 8 символов....
Python
1
fn remove_internal(&mut self, position: MediatorIndex) -> (TKey, TPriority) { // Borrow checker treats borrowing a field as borrowing whole structure // so we need to get references to fields to borrow them individually. let key_to_pos = &mut self.key_to_pos; let heap = &mut self.hea...
Rust
0
from .clean_server_url_hook import CleanServerUrlSDKInitHook from .logger_hook import LoggerHook from .split_pdf_hook import SplitPdfHook import logging
Python
1
import typing import datetime import dataclasses import pytz from .. import vdv class BravoException(Exception): pass @dataclasses.dataclass class BravoRecord: valid_from: typing.Optional[datetime.datetime] = None valid_to: typing.Optional[datetime.datetime] = None ticket_pnr: typing.Optional[str] = ...
Python
1
ra) ray = torch.sin(ra) rgx = rtx + rax rgy = rty + ray rg = torch.atan2(rgy, rgx) else: rg = torch.atan2(rty, rtx) else: rg = rt + ra if box_ndim > 7: # False if norm_velo: vxg = vxt * diagonal + vxa v...
Python
1
# Copyright (c) 2025, NVIDIA 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 # # Unless required by applicable law or agreed to i...
Python
1