text
string
label_name
string
labels
int64
sense="max", objective=eobj, ) protein.solve( solver="CONOPT", options=Options(time_limit=60000, iteration_limit=80000), ) print("Objective Function Value: ", round(protein.objective_value, 4), "\n") # REPORTING PARAMETER # rep = Parameter(m, name="rep", domain=...
Python
1
} pub fn chdir(interpreter: &Interpreter, params: &[Expression]) { panic!("TODO") } pub fn mkdir(interpreter: &Interpreter, params: &[Expression]) { panic!("TODO") } pub fn redir(interpreter: &Interpreter, params: &[Expression]) { panic!("TODO") } pub fn fdowraka(interpreter: &Interpreter, params: &[Express...
Rust
0
map.items()}, **{f"recall_at_{k.split('@')[1]}": v for (k, v) in recall.items()}, **{f"precision_at_{k.split('@')[1]}": v for (k, v) in precision.items()}, **{f"mrr_at_{k.split('@')[1]}": v for (k, v) in mrr.items()}, } print(scores) """ { 'ndcg_at_1': 0.32788, 'ndcg_at_3': 0.47534, 'ndcg_at_5...
Python
1
# Generated by Django 2.1.11 on 2019-08-23 21:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("experiments", "0065_results_section")] operations = [ migrations.AlterField( model_name="experiment", name="status", ...
Python
1
deb/usr/lib/rustdesk/') system2('cp libsciter-gtk.so tmpdeb/usr/lib/rustdesk/') md5_file('usr/share/rustdesk/files/systemd/rustdesk.service') md5_file('etc/rustdesk/startwm.sh') md5_file('etc/X11/rustdesk/xorg.conf') md5_file('etc/pam.d/rus...
Python
1
w_manifest = StubifyInstantRun(MANIFEST_WITH_APPLICATION) manifest = ElementTree.fromstring(new_manifest) application = manifest.find("application") self.assertEqual(INSTANT_RUN_BOOTSTRAP_APPLICATION, application.get("{%s}name" % ANDROID)) self.assertEqual("old.application", applica...
Python
1
ne } } pub fn with_max(&self, max: T) -> Option<Self> { Interval::new(self.min, max) } pub fn overlap_with(&self, other: &Interval<T>) -> Option<Self> { let min = if self.min > other.min { self.min } else { other.min }; let max = if self.max < other.max { self.max }...
Rust
0
model, valid, msg = test_case if model.startswith("vllm:") and not cuda_available: continue try: proc = None proc, _ = photon_run_local_server(name=random_name(), model=model) except Exception as e: self.assertFalse(va...
Python
1
let cmp = compare_const_vals(self.tcx, lo, hi, self.param_env, ty); match (end, cmp) { // `x..y` where `x < y`. // Non-empty because the range includes at least `x`. (RangeEnd::Excluded, Some(Ordering::Less)) => PatKind::Range(PatRange { lo, hi, end }), //...
Rust
0
\xcc\xae\x9f\xb6\x01\xc9E\xc4X\x88\x06\x8c\xa9\ \x03-Q\xa3B\xbe\x8a~\xd2*\x8a\x1f\xd1(Pn\ \xbd-\x8b\x96-3\x8a\x12\xbf\xb0t!\x19pq\xbd\ \xc8\x92\x1av5\xde\xd1\xc6W\xd61=\x81\x0d\x01\x00\ \x9e\xa3Q\x14$fGl\x22\x9dZ\xf8\xea\xc5\xccc\ 2\x12,H\xe3\xe4\x90!Q\x17\xa6\x02\xafJ\xa4\x01\ \x0ck\xd1G\xca\xbb\xaa\x98\x03\x8b\xe2\xb...
Python
1
r::*; use rand::thread_rng; #[test] fn secret_key_generate() { let mut rng = thread_rng(); let params = SystemParameters::generate(&mut rng, 2).unwrap(); let sk = SecretKey::generate(&mut rng, &params); assert!(sk.w != Scalar::zero()); } #[test] fn secret_key_...
Rust
0
PostTagJunction { /// The post id represented by this relation. pub post_id: uuid::Uuid, /// The tag id represented by this relation. pub tag_id: uuid::Uuid, /// The user id of the creator of this relation. pub created_by: uuid::Uuid, } // Copyright 2018 The Fuchsia Authors. All rights reserved....
Rust
0
get_power_series(b, n); /// assert_eq!(expected, actual); /// ``` pub fn get_power_series<E>(b: E, n: usize) -> Vec<E> where E: FieldElement, { let mut result = unsafe { uninit_vector(n) }; batch_iter_mut!(&mut result, 1024, |batch: &mut [E], batch_offset: usize| { let start = b.exp((batch_offset a...
Rust
0
"(cr0) ::: "intel"); cr0 |= 1 << 16; asm!("mov cr0, $0" :: "r"(cr0) :: "intel", "volatile"); } } fn test_cpuid() { unsafe { let mut flags: u32; let test_flags: u32; asm!("pushfd; pop $0" : "=r"(flags) ::: "intel"); test_flags = flags; flags ^= 1 << 21;...
Rust
0
Balance, }, /// Active auction cancelled. CancelAuction { auction_id: AuctionId }, /// Collateral auction dealt. CollateralAuctionDealt { auction_id: AuctionId, collateral_type: CurrencyId, collateral_amount: Balance, winner: T::AccountId, payment_amount: Balance, }, /// Dex take collatera...
Rust
0
); deps.transforms.attach_identity(entity); entity })); let mut builder = Builder { materials: deps.game_shaders.level_materials(), lights: Lights::new(), start_pos: Pnt3f::origin(), start_yaw: Rad(0.0f32), static_ver...
Rust
0
time.time() # 记录开始训练时间 # training routine for epoch in range(1, opt.epochs + 1): # adjust_learning_rate_sup(opt, optimizer, epoch) # train for one epoch time1 = time.time() loss = train(train_loader, model, criterion, optimizer, epoch) time2 = time.time() print(...
Python
1
import marimo __generated_with = "0.15.1" app = marimo.App(width="medium") @app.cell def _(): import jax import jax.numpy as jnp import marimo as mo import matplotlib.pyplot as plt from solver import Solver return jax, jnp, mo, plt @app.cell(hide_code=True) def _(mo): mo.md( r"...
Python
1
<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PWM_2_GENB_ACTLOADW) -> &'a mut W { { self.bits(variant._bits()) } } #[doc = "Do nothing"] #[inline(always)] pub fn pwm_2_genb_actload_none(self) -> &'a mut W { ...
Rust
0
), (4, 7), (12, 20)]); let expected = RangeVec::from([(2, 4), (7, 12), (20, 24)]); assert_eq!(rv.inverse(25), expected); let rv = RangeVec::from([(0, 2), (4, 7), (12, 20)]); let expected = RangeVec::from([(2, 4), (7, 12), (20, 24)]); assert_eq!(rv.inverse(25), expected);...
Rust
0
# Quick Sort Algorithm # This function sorts an array using the quick sort method, which is a divide-and-conquer algorithm. def quick_sort(arr): if len(arr) <= 1: # Base case: if the list has one or no elements, it's already sorted return arr else: pivot = arr[len(arr) // 2] # Selecting the mi...
Python
1
# -*- coding: utf-8 -*- # Copyright 2020 Google 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 ...
Python
1
# # Copyright (c) Lightly AG and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from __future__ import annotations import os from pytorch_lightning.loggers import TensorBoardLogger as LightningTensorBoardLo...
Python
1
#!/usr/bin/env python # Copyright (C) 2019, Wazuh Inc. # # Ova2Ovf.py Helper script to convert VBox .ova export # for import to VMWare ESXi # # Original author: eshizhan https://github.com/eshizhan # Author: Neova Health # forked from : https://gist.github.com/eshizhan/6650285 # Modified by Waz...
Python
1
lowercase(&self), fn to_uppercase(&self), fn repeat(&self, n: usize) } macro_rules! impl_wrap_returning_str { (pub > $(fn $name:ident(&self$(, $param:ident: $tp:ty)*)),*) => ( impl SoftAsciiStr {$( #[inline] pub fn $name(&self $(, $param: $tp)*) -> &SoftAsciiStr { ...
Rust
0
_retry( statuses: VecDeque<(StatusCode, &'static str)>, ) -> Result<String, SequencerError> { use http::response::Builder; use std::{ cell::RefCell, sync::{Arc, Mutex}, }; use warp::Filter; let statuses = Ar...
Rust
0
from rest_framework.permissions import BasePermission class IsOwnComment(BasePermission): @classmethod def has_object_permission(cls, request, view, obj): if request.user.is_superuser: return True return obj.user.id == request.user.id
Python
1
) { let rope = Rope::from_str("Hello everyone!\u{000D}\u{000A}How are you doing, eh?"); // 39 chars, 38 graphemes assert_eq!(rope.char_index_to_grapheme_index(0), 0); assert_eq!(rope.char_index_to_grapheme_index(15), 15); assert_eq!(rope.char_index_to_grapheme_index(16), 15); assert_eq!(rope.ch...
Rust
0
import random title_prompts = [ "Choose a title for your note ✏️ :\n> ", "Now you may enter the title 😊 :\n> ", "Enter the title, please 👀 :\n> ", "How would you like to name your note? 🤔 \n> ", "Wrtie the title here ⬇️ :\n> " ] text_prompt = [ "Write your text 🖋️ :\n> ", "You can share your s...
Python
1
NO055Calibration = bno055::BNO055Calibration { acc_offset_x_lsb: 2, acc_offset_x_msb: 0, acc_offset_y_lsb: 252, acc_offset_y_msb: 255, acc_offset_z_lsb: 231, acc_offset_z_msb: 255, mag_offset_x_lsb: 215, mag_offset_x_msb: 254, mag_offset_y_lsb: 174, mag_offset_y_msb: 1, mag_o...
Rust
0
, AcpiRsAccess = 0xC0140018, AcpiInvalidTable = 0xC0140019, AcpiRegHandlerFailed = 0xC0140020, AcpiPowerRequestFailed = 0xC0140021, SxsSectionNotFound = 0xC0150001, SxsCantGenActCtx = 0xC0150002, SxsInvalidActCtxDataFormat = 0xC0150003, SxsAssemblyNotFound = 0xC0150004, SxsManifestFo...
Rust
0
tern crate fnv; extern crate htmlescape; extern crate rand; extern crate shred; extern crate shrev; extern crate simple_logger; extern crate specs; use airmash_server as server; mod component; mod config; mod gamemode; mod systems; use std::env; use gamemode::{CTFGameMode, BLUE_TEAM, RED_TEAM}; use server::AirmashS...
Rust
0
).cuda() batch_vp_pos_fts = pad_tensors(batch_vp_pos_fts).cuda() batch_traj_lens = torch.LongTensor(batch_traj_lens) batch_traj_masks = gen_seq_masks(batch_traj_lens).cuda() batch_traj_step_ids = pad_sequence(batch_traj_step_ids, batch_first=True).cuda() batch...
Python
1
rite_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [apb_saradc_thres_ctrl](apb_saradc_thres_ctrl) module"] pub type APB_SARADC_THRES_CTRL = crate::Reg<u32, _APB_SARADC_THRES_CTRL>; #[allow(missing_docs)] #...
Rust
0
*.??.txt | count | echo $it "# )); assert_eq!(actual, "3"); }) } extern crate pyo3; extern crate ndarray; use pyo3::prelude::*; use pyo3::wrap_pyfunction; use numpy::{PyReadonlyArray1, PyReadonlyArray2, PyArray3, IntoPyArray}; use ndarray::{Axis, Slice,...
Rust
0
1985, "overtaking restriction lifted"); r.insert(1986, "Low Emission Zone restriction in force"); r.insert(1990, "car park closed (until Q)"); r.insert(1991, "danger of waiting vehicles on roadway"); r.insert(1993, "number of parking spaces decreasing"); r.insert(1994, "number of parking spaces constant"); r.inse...
Rust
0
fields::{FieldOpsBounds, FieldVar}; use ark_r1cs_std::groups::curves::short_weierstrass::{ AffineVar as SWAffineVar, ProjectiveVar as SWProjectiveVar, }; use ark_r1cs_std::groups::curves::twisted_edwards::AffineVar as TEAffineVar; use ark_r1cs_std::{ToBytesGadget, ToConstraintFieldGadget}; use ark_relations::r1cs::...
Rust
0
wrap().borrow(); let mut groups = self.groups.borrow_mut(); let group_id = GroupId::from_slice(&groups.len().to_string().into_bytes()); group_creator.create_group(group_id.clone(), self.default_mgc.clone(), ciphersuite)?; let creator_groups = group_creator.groups.borrow(); let g...
Rust
0
# Copyright 2016 Google Inc. 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 required by applicable law or ag...
Python
1
ew(bytes); let l = CInt::from_cursor(&mut cursor) .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?; let mut map = Vec::with_capacity(l as usize); for _ in 0..l { let n = CBytes::from_cursor(&mut cursor) .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models class ResPartner(models.Model): _inherit = 'res.partner' def _compute_im_status(self): super(ResPartner, self)._compute_im_status() absent_now = self._get_on_leave_...
Python
1
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
Python
1
fn create_game( players: [T::AccountId; 2] ) -> T::Hash { // get a random hash as board id let game_id = Self::generate_random_hash(b"create", players[0].clone()); // create a new empty game let game = Game { id: game_id, players: players.clone(), choices: [Choice::None, Choice::None], state...
Rust
0
n) -> bool { // unsafe { TODO: call gst_rtsp_server_sys:gst_rtsp_client_set_connection() } //} #[cfg(any(feature = "v1_18", feature = "dox"))] fn set_content_length_limit(&self, limit: u32) { unsafe { gst_rtsp_server_sys::gst_rtsp_client_set_content_length_limit( ...
Rust
0
# Author: Alex Gezerlis # Numerical Methods in Physics with Python (2nd ed., CUP, 2023) # Solution to chapter 6, problem 46 # NOTE TO INSTRUCTORS: this solution is made available to all readers (i.e., not locked) from gauleg import gauleg_params import numpy as np from scipy.stats import chi2 # The only subtlety in...
Python
1
modes for an output pub modes: Vec<Mode>, /// Has this output been unadvertized by the registry /// /// If this is the case, it has become inert, you might want to /// call its `release()` method if you don't plan to use it any /// longer. pub obsolete: bool, } impl OutputInfo { fn new...
Rust
0
ameters sorted by distance biquadratic_list = [] written_keys = set() for key, bval in cls.biquadratic_Jdict.items(): R, i, j = key # Skip if this is the symmetric counterpart of an already written pair symmetric_key = (tuple(-np.arra...
Python
1
, _ => panic!("bad index to match_at"), } } } impl ContextReference { /// find the pointed to context, panics if ref is not linked pub fn resolve(&self) -> ContextPtr { match *self { ContextReference::Inline(ref ptr) => ptr.clone(), ContextReference::Dire...
Rust
0
import re SPLIT_RE = re.compile(r'[\.\[\]]+') class JsonSchemaException(ValueError): """ Base exception of ``fastjsonschema`` library. """ class JsonSchemaValueException(JsonSchemaException): """ Exception raised by validation function. Available properties: * ``message`` containing huma...
Python
1
from django.db import models from django.utils.timezone import now class Merek(models.Model): nama = models.CharField(max_length=100) deskripsi = models.TextField() def __str__(self): return self.nama class Motor(models.Model): STATUS_CHOICES = [ ('Tersedia', 'Tersedia'), ('...
Python
1
the //! validated pool, create a signature share for `req` and add it to the //! validated pool. //! //! ## validate signature shares //! for every unvalidated signature share s, do the following: if `s.config_id` //! is an element of `finalized_tip.ecdsa.configs`, and there is no signature //! share by `s.signer` for...
Rust
0
//! //! This prints `1000.000000025V`, not `1250V`. //! //! You would actually need to write: //! //! ``` //! let check_voltage = Volt::from_parts::<Kilo>(1, 250_000_000_000); //! ``` //! //! ## Adding pieces to make something more intuitive //! Alternatively, you could create a value by summing its parts: //! //! ```...
Rust
0
[api_endpoint(path = "/count", auth = "required")] pub fn feed_count(state: &AppState, query: ()) -> ApiResult<i64> { let conn = state.db(); let dao = FeedDao::new(&conn); dao.count().map(ApiResult::success).map_err(From::from) } /// Mendapatkan data feed berdasarkan ID. #[api_...
Rust
0
CATION_ID) ) # Should only be picking up county all_df for now. May need additional logic if states # are included as well assert levels == {AggregationLevel.COUNTY} # Duplicating DC County results as state results because of a downstream # use of how dc state data is used to override DC count...
Python
1
], feed_dict={net['X']: X, net['initial_state']: state}) synthesis.append(np.argmax(next)) return synthesis def train_tiny_imagenet(): """Summary """ net = build_pixel_rnn_basic_model() # build the optimizer (this will take a while!) optimizer = tf.t...
Python
1
from .plotter import plot_prediction __all__ = ["plot_prediction"]
Python
1
Business Source License, use of this software will be governed // by the Apache License, Version 2.0. use std::fmt; use chrono::{NaiveDateTime, NaiveTime, Offset, TimeZone, Timelike}; use mz_repr::adt::datetime::DateTimeField; use proptest_derive::Arbitrary; use serde::{Deserialize, Serialize}; use mz_lowertest::MzR...
Rust
0
# Ayra - UserBot # Copyright (C) 2021-2022 senpai80 # # This file is a part of < https://github.com/senpai80/Ayra/ > # PLease read the GNU Affero General Public License in # <https://www.github.com/senpai80/Ayra/blob/main/LICENSE/>. from telethon import Button from telethon.tl.types import InputWebDocument as wb fro...
Python
1
at an x-coordinate. pub fn sample(&self, t: f64) -> f64 { assert!( !self.spline.is_empty(), "Spline graph is empty, nothing to sample from!" ); if let Some(value) = self.spline.sample(t) { return value; } if t < self.min { re...
Rust
0
"""Mortier_2B9_Vasilek_Para_POL depiction edits.""" from typing import Dict, Tuple, Union # fmt: off mortier_2b9_vasilek_para_pol: Dict[str, Dict[Union[str, Tuple[str, str]], dict]] = { "unit_name": "Mortier_2B9_Vasilek_Para_POL", "valid_files": ["DepictionVehicles.ndf"], "DepictionVehicles_ndf": { ...
Python
1
import sys class rom: def __init__(self, fname): with open(fname, 'rb') as f: self.data = f.read() def writedata(self, f): code = ''' /* * Otaku-flash * Simulate a 32k Atari 2600 ROM chip with F6 bankswitching on a * Raspberry Pi Pico. * Karri Kaksonen, 2024 * based on work by * Ni...
Python
1
Color::Green, short, message) } /// Emit a warning. Note that this function **will** reset the existing /// color of the internal buffer. The emitted text will have a newline. /// /// # Forms /// /// Angle brackets (`<>`) indicate a string provided to the function. /// /// ## Witho...
Rust
0
o::{ format::{parse, Parsed, StrftimeItems}, FixedOffset, NaiveDate, NaiveDateTime, NaiveTime, }; use crate::datatypes::{DataType, TimeUnit}; use crate::error::Result; use crate::{ array::{Offset, PrimitiveArray, Utf8Array}, error::ArrowError, }; /// Number of seconds in a day pub const SECONDS_IN_DAY...
Rust
0
fn new(sender: mpsc::Sender<RpcServerRequest>) -> Self { Self { sender } } pub async fn get_num_active_sessions(&mut self) -> Result<usize, RpcServerError> { let (req, resp) = oneshot::channel(); self.sender .send(RpcServerRequest::GetNumActiveSessions(req)) .aw...
Rust
0
std::option::Option<unsafe extern "C" fn(arg1: *mut submit_worker)>; pub type workqueue_init_worker_fn = ::std::option::Option< unsafe extern "C" fn(arg1: *mut submit_worker) -> libc::c_int, >; pub type workqueue_exit_worker_fn = ::std::option::Option< unsafe extern "C" fn(arg1: *mut submit_worker, arg2: *mut l...
Rust
0
}}; } macro_rules! regex { ($re:expr) => { regex_new!($re).unwrap() }; } macro_rules! regex_set { ($res:expr) => { regex_set_new!($res).unwrap() }; } // Must come before other module definitions. include!("macros_bytes.rs"); include!("macros.rs"); // A silly wrapper to make it possib...
Rust
0
#[serde(default)] pub array_filler: Vec<Node>, pub field: Option<Decl>, } #[derive(Deserialize, Debug)] #[serde(deny_unknown_fields)] #[non_exhaustive] pub struct InjectedClassNameType { pub r#type: Type, #[serde(rename = "isDependent", default)] pub is_dependent: bool, #[serde(rename = "isInst...
Rust
0
{ let mut style = serialize(&(BinRuleStyle::Output as u8)) .map_err(Err::serial)?; let mut appendant_len = serialize(&((appendant.len() * boundary) as u16)) .map_err(Err::serial)?; // // Hea...
Rust
0
from aiogram.types import Message from loader import dp, bot from aiogram.filters import Command @dp.message(Command("music")) async def music_function(message: Message): await message.answer(text = f"{message.from_user.first_name} what music do you want listen")
Python
1
ntent::EndOfContent => write!(f, "EndOfContent"), BerObjectContent::Boolean(b) => write!(f, "Boolean({:?})", b), BerObjectContent::Integer(i) => write!(f, "Integer({:?})", HexSlice(i)), BerObjectContent::Enum(i) => write!(f, "Enum({})"...
Rust
0
part] def example_test_func(request): return True def get_proper_language(): """ Return the proper language by get_language() """ config = get_config() lang = config['summernote'].get('lang') if not lang: return config['lang_matches'].get(get_language(), 'en-US') return lan...
Python
1
ans = [] for n in range(1, 10000): r = bin(n)[2:] if n%3==0: r += r[-3:] else: r += bin((n%3)*3)[2:] r = int(r, 2) if r <= 170: ans.append(r) print(max(ans))
Python
1
ttr.simple_flag, span: proc_macro2::Span::call_site(), }; let string_val = LitStr::new(&attr.string, Span::call_site()); let integer_val = LitInt::new(&attr.integer.to_string(), Span::call_site()); let float_val = LitFloat::new(&attr.float.to_string(), Span::call_site()); let array_of_intege...
Rust
0
RD_ID: ShardId = 0; #[derive(Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Command { rifl: Rifl, shard_to_ops: HashMap<ShardId, HashMap<Key, Arc<Vec<KVOp>>>>, // mapping from shard to the keys on that shard; this will be used by // `Tempo` to exchange `MStable` messages between shards s...
Rust
0
llect()) } } <filename>src/lib.rs #![deny(warnings)] mod parser; mod plugins; pub use parser::{ parse, parse_with_base_dir, parse_with_settings, Html, Settings, }; mod errors { use crate::parser::ParseError; use crate::plugins::PluginError; use thiserror::Error; #[derive(Error, Debug)] p...
Rust
0
# coding=utf-8 """ Main Calistir """ import sys reload(sys) sys.setdefaultencoding('utf-8') import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from ciz import dagilim_grafigi, hipotez_grafigi from k_en_yakin_komsu import KEnYakinKomsu u""" 1. Veri Setinin Yuklenmesi """ print...
Python
1
ts.pixel_values.shape[0], inputs.input_ids.shape[0])), ) self.assertEqual( logits_per_text.shape, torch.Size((inputs.input_ids.shape[0], inputs.pixel_values.shape[0])), ) expected_logits = torch.tensor([[-0.7567, -10.3354]], device=torch_device) self.ass...
Python
1
unks.1: Vec<Arc<MetaOpData>>, }, } } struct NodeInfo { last_touch: std::time::Instant, was_err: bool, } pub(crate) enum HowToConnect { Con(Tx2ConHnd<wire::Wire>), Url(TxUrl), } pub(crate) struct SimpleBloomModInner { tuning_params: KitsuneP2pTuningParams, space: Arc<KitsuneSpace>,...
Rust
0
``` //! //! ### Set output pin //! //! ```no_run //! extern crate linux_embedded_hal as hal; //! extern crate mcp794xx; //! use mcp794xx::{Mcp794xx, OutputPinLevel}; //! //! # fn main() { //! let dev = hal::I2cdev::new("/dev/i2c-1").unwrap(); //! let mut rtc = Mcp794xx::new_mcp7940n(dev); //! rtc.set_output_pin(Output...
Rust
0
line1 = ["⬜️","️⬜️","️⬜️"] line2 = ["⬜️","⬜️","️⬜️"] line3 = ["⬜️️","⬜️️","⬜️️"] map = [line1, line2, line3] print("Hiding your treasure! X marks the spot.") position = "B3" # Where do you want to put the treasure? # 🚨 Don't change the code above 👆 # Write your code below this row 👇 letter = position[0].lower() # m...
Python
1
0002,// EVEX_Vpdpwssd_xmm_k1z_xmm_xmmm128b32 0x2000_00B6, 0x2700_0002,// EVEX_Vpdpwssd_ymm_k1z_ymm_ymmm256b32 0x2000_00B9, 0x1800_0002,// EVEX_Vpdpwssd_zmm_k1z_zmm_zmmm512b32 0x2000_00B6, 0x2200_0002,// EVEX_Vdpbf16ps_xmm_k1z_xmm_xmmm128b32 0x2000_00B6, 0x2200_0002,// EVEX_Vdpbf16ps_ymm_k1z_ymm_ymmm256b32 0x2000_0...
Rust
0
webapp['bot_app'] = application webapp.on_startup.append(on_startup) webapp.on_shutdown.append(on_shutdown) async def telegram_webhook(request): try: update = Update.de_json(await request.json(), application.bot) await application.process_upda...
Python
1
""" Used to plot loss curves, precision, recall, and mAP curves. By default, yolo generates these curves, but this file can be used to create these with a custom style. Author: Lisa Groen Date: May 9, 2025 """ import pandas as pd import os import matplotlib.pyplot as plt import seaborn as sns def plot_loss_curve(t...
Python
1
""" getTerminalSize() - get width and height of console - works on linux,os x,windows,cygwin(windows) """ __all__=['getTerminalSize'] def getTerminalSize(): import platform current_os = platform.system() tuple_xy=None if current_os == 'Windows': tuple_xy = _getTerminalSize_windows() if tu...
Python
1
lementedError() def cas(self, key, value, cas, time=0, compress_level=-1): raise NotImplementedError() def set_multi(self, mappings, time=0, compress_level=-1): raise NotImplementedError() def add(self, key, value, time=0, compress_level=-1): raise NotImplementedError() def r...
Python
1
from mylib.logic import helloworld def test_helloWorld(): assert "hello" in helloworld()
Python
1
With<ProgressBar>>, /// ) { /// if let Ok(boot) = boot_query.get_single() { /// // Update the progress bar based on the fraction of assets already loaded, smoothed /// // with a snappy animation to be visually pleasant without too much artifically /// // delaying the...
Rust
0
er_p.0.get() }.is_some() } #[doc(hidden)] pub unsafe fn glReadBuffer_load_with(f: &dyn Fn(*const u8) -> *const c_void) { *glReadBuffer_p.0.get() = core::mem::transmute::<Option<core::ptr::NonNull<c_void>>, Option<glReadBuffer_t>>(gl_ptr_filter(f(b"glReadBuffer\0".as_ptr()))); } /// glReadPixels /// * `x` group: WinCo...
Rust
0
; /*#[derive(PartialEq, Eq, Debug, Hash)] pub struct DeviceName(pub String); #[derive(Debug)] pub struct DeviceSetup(pub Fn(impl Syscall) -> impl Dispatch);*/ pub type Setup = FnOnce(Box<dyn Syscall>) -> Box<dyn Dispatch>; #[derive(Default)] pub struct Config { pub(crate) vats: HashMap<VatName, Box<Setup>>, /...
Rust
0
```rust #![feature(c_variadic)] pub unsafe extern "C" fn add(n: usize, mut args: ...) -> usize { let mut sum = 0; for _ in 0..n { sum += args.arg::<usize>(); } sum } ``` "##, }, Lint { label: "c_variadic", description: r##"# `c_variadic` The tracking issue for this fe...
Rust
0
import winup from winup import ui, profiler # A simple, repeatable component to test memoization @winup.memo def ColorBlock(color): return ui.Frame(props={"background-color": color, "min-width": "20px", "min-height": "20px"}) # A function to build a large grid of these components def build_grid(size=30): rows...
Python
1
", "--on-disk"])?; let stdout = remove_rebase_lines(stdout); insta::assert_snapshot!(stdout, @r###" branchless: running command: <git-executable> diff --quiet Calling Git for on-disk rebase... branchless: running command: <git-executable> rebase --continue Finished resta...
Rust
0
eferred. :raises: StopIteration if no further page :return: The current page list :rtype: list """ if self.next_link is None: raise StopIteration("End of paging") self._current_page_iter_index = 0 self._response = self._get_next(self.next_link) ...
Python
1
#!/usr/bin/env python3 """ Test script to verify Python support matches JavaScript capabilities """ def test_sample_python_code(): """Test function with docstring""" pass @property def sample_property(self): """Sample property with decorator""" return "test" @staticmethod async def async_static_metho...
Python
1
ter a inflação. O Banco Central deve aumentar a taxa Selic na próxima reunião do Copom.", "Artigo Técnico": "Machine Learning é um subcampo da inteligência artificial que permite que sistemas aprendam automaticamente sem serem explicitamente programados. Algoritmos como Random Forest e Neural Networks são ampla...
Python
1
() .with_status(StatusCode::Ok) .with_body(self.response.clone()); Box::new(future::ok(response)) } "/timeout" => Box::new(future::empty()), "/myaddr" => { let response = server::Resp...
Rust
0
size) as *const crate::Reg<event_cnt_value::EVENT_CNT_VALUE_SPEC>) } } } #[doc = "SPT_CFG register accessor: an alias for `Reg<SPT_CFG_SPEC>`"] pub type SPT_CFG = crate::Reg<spt_cfg::SPT_CFG_SPEC>; #[doc = "Configuration register for the simple periodic timer"] pub mod spt_cfg; #[doc = "SLEE...
Rust
0
# (c) 2014 James Cammarata, <jcammarata@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
Python
1
lygon = Polygon::new(Surface::xy_plane()) .with_exterior(PolyChain::from([a, b, c, d, e]).close()); assert_contains_point(polygon, [1., 1.]); } fn assert_contains_point(polygon: Polygon, point: impl Into<Point<2>>) { let point = point.into(); assert!(polygon.contains_point(...
Rust
0
__, opts=opts, typ=GetPipelineResult).value return AwaitableGetPipelineResult( description=pulumi.get(__ret__, 'description'), id=pulumi.get(__ret__, 'id'), name=pulumi.get(__ret__, 'name'), pipeline_id=pulumi.get(__ret__, 'pipeline_id'), region=pulumi.get(__ret__, 'region')...
Python
1