text
string
label_name
string
labels
int64
Display1in54 { fn clear_buffer(&mut self,color:Color) { let color=self.get_color_bits(color); if color.0 { self.buffer.0.fill(0xff); } else { self.buffer.0.fill(0); } if color.1 { self.buffer.1.fill(0xff); } else { self....
Rust
0
# Copyright 2018 D-Wave Systems Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
1
from rest_framework import serializers from .models import Comment, Person, Todo class TodoSerializer(serializers.ModelSerializer): comments = serializers.PrimaryKeyRelatedField( many=True, queryset=Comment.objects.all(), ) assignee = serializers.PrimaryKeyRelatedField( queryset...
Python
1
def acertar_capitais(capitais): acertos = 0 for keys, values in capitais.items(): respostas = input(f'Digite a capital do estado {keys}: ').lower() print('-' * 90) if values != respostas: print(f'Errado! A resposta é {values}. Tente de novo!') break ...
Python
1
ion(self) -> str: return re.sub(r"(\[/?[^\]]+\])|(https?://\S+)", "", self.r_details["file_description"]) class SteamGroup(Group): def __init__(self, bot: CustomBot) -> None: super().__init__(name="steam", description="Comandos relacionados ao Steam.") self.bot = bot @command() @...
Python
1
[`u8`] /// * [`set_pktlen(v: u8)`][`crate::RegAddrs::PKTLEN`] /// * [`pktctrl1()`][`crate::RegAddrs::PKTCTRL1`] `->` [`PKTCTRL1`][`crate::regs::PKTCTRL1`] /// * [`set_pktctrl1(v: PKTCTRL1)`][`crate::RegAddrs::PKTCTRL1`] /// * [`pktctrl0()`...
Rust
0
xmm15", "$st0", "$st1", "$st2", "$st3", "$st4", "$st5", "$st6", "$st7", "$mm0", "$mm1", "$mm2", "$mm3", "$mm4", "$mm5", "$mm6", "$mm7", "$rflags", "$es", "$cs", "$ss", "$ds", "$fs", "$gs", "$unused1", "$unused2", "$fs.base", "$gs.base", "$unused3", "$unused4", "$tr", "$ldtr", "$mxcsr", "$fcw", "$fsw", ]...
Rust
0
, "value": [10, 20, 30, 40, 50, 60], }, repartition=repartition_nparts, ) daft_df = daft_df.pivot(group_by=["group1", "group2"], pivot_col="pivot", value_col="value", agg_fn="sum") expected = { "group1": ["A", "A", "B", "B"], "group2": ["X", "Y", "X", "Y"], ...
Python
1
None, :2], boxes2[:, :2]) # [N,M,2] rb = torch.min(boxes1[:, None, 2:], boxes2[:, 2:]) # [N,M,2] wh = (rb - lt).clamp(min=0) # [N,M,2] inter = wh[:, :, 0] * wh[:, :, 1] # [N,M] union = area1[:, None] + area2 - inter iou = inter / union return iou, union def generalized_box_iou(boxes1, ...
Python
1
, { let boxed: Box<dyn Future<Output = T> + Send> = Box::new(future); let boxed = Box::into_raw(boxed); // SAFETY: Box::into_raw does not return null pointers. let boxed = unsafe { NonNull::new_unchecked(boxed) }; Self { boxed } } /// Replace the future currently ...
Rust
0
ook for 'black' spots elif polarity == -1: totalEnergy += -f - np.sqrt(hAmp2) # Automatically determine noise threshold # Assuming the noise is Gaussian the response of the filters to noise will # form Rayleigh distribution. We use the filter responses at the smallest # scale as a ...
Python
1
= "full_encoding")] { multi_byte_decoder(EUC_JP.new_decoder(), bytes) } #[cfg(not(feature = "full_encoding"))] { String::from_utf8_lossy(bytes).into_owned() } } pub fn decoder_euc_kr(bytes: &[u8]) -> String { #[cfg(feature = "full_encoding")] { multi_byte_decoder(E...
Rust
0
rs.log" with open(log_file, "a") as f: f.write(f"{datetime.now().isoformat()} SUGGESTION_MANAGER_ERROR: {error_message}\n") # CLI interface for manual suggestion management def main(): """CLI interface for suggestion management.""" if len(sys.argv) < 2: print("Usage: suggestion_mana...
Python
1
bs").unwrap(), 1.0); assert_eq!(*stats.stats.get("total_malloced").unwrap(), 1048576.0); assert_eq!( *stats.slabs.get("1").unwrap().get("free_chunks").unwrap(), 10921.0 ); assert_eq!( *stats.slabs.get("1").unwrap().get("chunk_size").unwrap(), ...
Rust
0
# Generated by Django 3.2.12 on 2022-03-06 03:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bldcontrol', '0007_brlayers_optional_gitinfo'), ] operations = [ migrations.AlterField( model_name='brbitbake', nam...
Python
1
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
Python
1
exp_avg_sq.mul_(beta2).addcmul_(grad, grad.conj(), value=1 - beta2) denom_correction = (1 - beta2**step) ** 0.5 # Originally: # shift.addcdiv_( # exp_avg, # exp_avg_sq.sqrt().add_(eps, alpha=1), # value=-lr * denom_correction, # ) addcdiv_stochastic_( shift, ...
Python
1
H as u16 + 1, y: pos.y }) .red, 0 ); } #[test] fn serialize_deserialize_returns_same_state() { let mut game = GameState::new(); for _ in 0..100 { game.make_move(*game.moves().first().unwrap()) } let se...
Rust
0
from bpy.types import Operator from bpy.utils import register_class, unregister_class from bpy.ops import object from mathutils import Matrix from ...utility import PluginError, raisePluginError from ..utility import getOOTScale from ..exporter.collision import CollisionHeader from .properties import OOTCollisionExpor...
Python
1
# The MIT License (MIT) # Copyright © 2023 Yuma Rao # Copyright © 2023 Opentensor 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 #...
Python
1
TokenKind::LeftParen)?; let mut params = vec![]; loop { match px.next() { TokenKind::Eof | TokenKind::RightParen | TokenKind::RightBrace => break, TokenKind::Ident | TokenKind::Underscore => { let param_event = px.start_element(); let name = parse...
Rust
0
socket setting /// Note: This is similar to `setsockopt` in POSIX for SO_REUSEADDR /// /// ## Parameters /// /// * `fd` - Socket descriptor /// * `sockopt` - Socket option to be set /// * `flag` - Value to set the option to pub fn sock_set_opt_flag( env: &WasiEnv, sock: __wasi_fd_t, opt: __wasi_sockoption_t...
Rust
0
""" Uvažuj program, který čte knížku ze seznamu na základě indexu. Ošetři s použitím výjimky možnou chybu, že program skončí chybou. """ try: knihy = ["Problém tří těles", "Temný les", "Vzpomínka na Zemi"] index = int(input("Zadej index knihy: ")) print(knihy[index]) except IndexError: print("Taková kni...
Python
1
# coding=utf-8 # Copyright 2024 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
Python
1
n_assignment) .repeated(), ) .then_ignore(just(Token::Ctrl(',')).or_not()) .delimited_by(just(Token::Ctrl('<')), just(Token::Ctrl('>'))) .or_not() .map_with_span(|x, span| { ( match x { Some(list) => DomainAssignment...
Rust
0
't actually delete a value Some(val) => { /* len -= 1; */ Value(val) } } } // delete but the tree is empty Delete { .. } => { assert!(tree.is_empty()); Empty } } } const INITI...
Rust
0
response> pub type UploadResponse = SingleResourceResponse<UploadResponseData, UploadResponseLinks>; /// WorkDayRulesData is not represented as a named schema in the ShotGrid OpenAPI Spec. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct WorkDayRulesData { pub date: Option<String>, pub working: Optio...
Rust
0
from __future__ import annotations import json from pathlib import Path from typing import Any import pexpect def run_sherpa_keyword_spotter( encoder_model: str, decoder_model: str, joiner_model: str, tokens_file: str, keywords_file: str, audio_files: list[str], executable: str = "sherpa...
Python
1
from typing import Any import pytest from .embed_utils import EmbedModelInfo, correctness_test_embed_models from .mteb_utils import mteb_test_embed_models MODELS = [ ########## BertModel EmbedModelInfo("thenlper/gte-large", architecture="BertModel", enable_test=True), ...
Python
1
m_zmmmt 0x4612_0066,// MVEX_Vpcmpgtd_kr_k1_zmm_zmmmt 0x4612_006F,// MVEX_Vmovdqa32_zmm_k1_zmmmt 0x4652_006F,// MVEX_Vmovdqa64_zmm_k1_zmmmt 0x4612_0070,// MVEX_Vpshufd_zmm_k1_zmmmt_imm8 0xD612_0072,// MVEX_Vpsrld_zmm_k1_zmmmt_imm8 0xE612_0072,// MVEX_Vpsrad_zmm_k1_zmmmt_imm8 0xF612_0072,// MVEX_Vpslld_zmm_k1_zmmm...
Rust
0
import tempfile import datetime import unittest from unittest.mock import Mock from unittest.mock import patch import os import serles class AppFactoryTester(unittest.TestCase): def test_createapp(self): with tempfile.NamedTemporaryFile() as f: f.write(b"[serles]\n") f.write(b"bac...
Python
1
pub mod lexer; //pub mod parser; pub use lexer::*; pub fn parse<'a, 'b, Symbol, Lexer>(_lexer: Lexer) where Lexer: Iterator<Item = Result<lexer::Token<'a, 'b, Symbol>, ()>>, { unimplemented!(); } #[cfg(test)] mod tests { #[test] fn it_works() { assert_eq!(2 + 2, 4); } } <reponame>kaviraj...
Rust
0
from functools import lru_cache from sentence_transformers import SentenceTransformer, util from tqdm import tqdm class Model: def __init__(self, model_name): self._model = Model.get_model(model_name) @staticmethod @lru_cache(maxsize=None) def get_model(model_name): """ Loa...
Python
1
from abc import ABC, abstractmethod import torch from utils.utils import maybe_cuda class Prior(ABC): def __init__(self, params): self.params = params @abstractmethod def add_expert(self): pass @abstractmethod def record_usage(self, usage, index=None): pass @abstrac...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # SPDX-License-Identifier: LGPL-3.0-or-later # Copyright 2023 Inria """Active set: indices of inequality constraints saturated at the optimum.""" from dataclasses import dataclass from typing import Optional, Sequence @dataclass class ActiveSet: """Indices of acti...
Python
1
MessageBuilder::new().error("Failed to clear the whole queue! Blame Joshi :c"); let _ = command.create_message(&ctx, builder).await; return Err(e.into()); } } } Ok(()) } <filename>laythe_lib/src/global/primitives/map.rs use super::{class_inheritance, error:...
Rust
0
class Solution: def findMissingAndRepeatedValues(self, grid: List[List[int]]) -> List[int]: n = len(grid) size = n * n # Expected sums expected_sum = size * (size + 1) // 2 expected_sum_sq = size * (size + 1) * (2 * size + 1) // 6 # Actual sums actual_sum = ...
Python
1
self.taskID.itemID, self.reminderMode, self.timeOffset, self.specificTime ) class PomodoroHistoryDB(MyDB): class Status(models.TextChoices): COMPLETED = "Completed" RUNNING = "Running" PAUSED = "Paused" CANCELED = "Canceled" po...
Python
1
#[macro_use] extern crate error_chain; // Tokio/Futures Crates extern crate futures; extern crate tokio_core; // Hyper Crates extern crate hyper; #[cfg(feature = "rustls")] extern crate hyper_rustls; #[cfg(feature = "native-tls")] extern crate hyper_tls; #[cfg(feature = "native-tls")] extern crate native_tls; // Web...
Rust
0
s.items())) return f"{name}{{{label_str}}}" def reset_metrics(self) -> None: """Reseta todas as métricas.""" self._metrics.clear() self._counters.clear() self._gauges.clear() self._histograms.clear() self._start_time = time.time() def exp...
Python
1
print("regenerating README") from subprocess import run def read_file(filename): with open(filename, 'r') as f: return f.read() # transpile the test code mainPath = 'addons/gdscript2all/converter/main.py' run(['python', mainPath]) run(['python', mainPath, '-t', 'Cpp']) template = read_file('README_TEMPLATE.md') ...
Python
1
_TABLE_ONE = """ select * from {{ ref('seed') }} """ _TABLE_ONE_DOT_MODEL_SCHEMA = "first_schema" _TABLE_ONE_DOT_MODEL_NAME = f"{_TABLE_ONE_DOT_MODEL_SCHEMA}.view_1" _TABLE_ONE_DOT_MODEL = """ select * from {{ target.schema }}.seed """ _TABLE_TWO_SCHEMA = "custom" _TABLE_TWO = ( """ {{ config(schema='""" + _TA...
Python
1
def count_up_to(n): """Implement a function that takes an non-negative integer and returns an array of the first n integers that are prime numbers and less than n. for example: count_up_to(5) => [2,3] count_up_to(11) => [2,3,5,7] count_up_to(0) => [] count_up_to(20) => [2,3,5,7,11,13,17,19] ...
Python
1
= Decimal::new_raw(i128::MAX, 2); let y = Decimal::new_raw(i128::MAX / 5, 1); let r = x % y; assert_eq!(r.coefficient(), x.coefficient()); assert_eq!(r.n_frac_digits(), x.n_frac_digits()); } #[test] fn test_rem_lhs_shift_ovfl() { let x = Decimal::new_raw(i128::MAX / ...
Rust
0
e(&mut self) { self.board.update(&self.world); for c in self.balls.iter_mut() { c.update(&self.world) } } fn process_render(&mut self, stdout: &mut impl Write) -> io::Result<()> { self.board.draw_to(&mut self.frame_buffer); for c in self.balls.iter() { ...
Rust
0
; } let res = out.write(block.as_slice()); match res { Err(rustaudio::RaOutputUnderflowed) => { println!("Oops! The output buffer underflowed. Latency too low?"); } Err(x) => return Err(x), _ => () } } try!(out.stop()); ...
Rust
0
sion, for example. - nested: bool: Set this to true to convert nested parallel loops. This is rarely a good idea, and is disabled by default. Note that setting it to true mimics MLIR's convert-scf-to-openmp. - schedule: {"static", "dynamic", "auto"}: Set the schedule used by the OMP loop. By defau...
Python
1
, &Message) -> Continue + Send + 'static>> = transmute(func); (&mut *func.borrow_mut())(&from_glib_borrow(bus), &Message::from_glib_borrow(msg)).to_glib() } unsafe extern "C" fn destroy_closure_watch(ptr: gpointer) { Box::<RefCell<Box<FnMut(&Bus, &Message) -> Continue + Send + 'static>>>::from_raw( ptr...
Rust
0
::fmt(&self.report, f) } } impl std::ops::Deref for WrapEyre { type Target = eyre::Report; fn deref(&self) -> &Self::Target { &self.report } } impl ResponseError for WrapEyre { fn status_code(&self) -> StatusCode { self.status_code } fn error_response(&self) -> HttpRespon...
Rust
0
0): "y", (29, 0): "z", (36, 64): "{", (39, 64): "}", (48, 64): "~", (42, 0): "BACKSPACE", } HID_MAP["us"] = { (44, 0): " ", (30, 2): "!", (52, 2): '"', (32, 2): "#", (33, 2): "$", (34, 2): "%", (36, 2): "&", (52, 0): "'", (38, 2): "(", (39, 2): ")", (37, ...
Python
1
); /// ``` pub fn packed_id(&self, f: &Path) -> String { match *self { IncludeDirectory::Named { ref name, .. } => format!("{}--{}", name, xhtml_path_id(f)), IncludeDirectory::Unnamed { .. } => xhtml_path_id(f), } } /// Resolve the path of the specified file in t...
Rust
0
self.resolver { DnsResolver::System => { trace!("DNS resolved {}:{} with tokio", self.addr, self.port); } #[cfg(feature = "trust-dns")] DnsResolver::TrustDnsSystem { .. } | DnsResolver::TrustDns(....
Rust
0
import typing import re from emoji import EMOJI_CHARACTER def tokenize_slowly(text: str): special_tokens = list(enumerate(set(re.findall( r'(а-ля|тет-а-тет|ва-банк|рок-н-рол\w*|Нью-Йорк\w*|Улан-Удэ|давным-давно|кое у кого|кое о чем|кое о чём|кое о ком|кое на что|кое на кого|кое с чем|кое с кем|кое в кого...
Python
1
qual to count, then split let res = i == count; // if splitting, then reset the counter if res { i = 0; } res } else { false } }); let value = match node_type { StandardType::NodeStart | StandardType::...
Rust
0
footile; pub use footile::PathOp; mod direction; use direction::Direction; /// Text alignment. pub enum TextAlign { /// Align text to the left. Left, /// Align text to the center. Center, /// Align text to the right. Right, /// Justify text. Justified, /// Vertical text. Vert...
Rust
0
global_step) / decay_steps) cosine_decay = 0.5 * ( 1 + cos(pi * 2 * num_periods * global_step / decay_steps)) decayed = (alpha + linear_decay + eps_t) * cosine_decay + beta decayed_learning_rate = learning_rate * decayed ``` where eps_t is 0-centered gaussian noise with variance initial_variance / (1 ...
Python
1
// Arrange // This starts up a standalone server in the background running on port 5000 simulate_standalone_server(); // Instead of creating a new MockServer using connect_from_env(), we connect by reading the // host and port from the environment (HTTPMOCK_HOST / HTTPMOCK_PORT) or falling back to def...
Rust
0
""" ================================== Input and output (:mod:`scipy.io`) ================================== .. currentmodule:: scipy.io SciPy has many modules, classes, and functions available to read data from and write data to a variety of file formats. .. seealso:: `NumPy IO routines <https://www.numpy.org/devdo...
Python
1
ews(html) # 주간 뉴스 딕셔너리 변환 weekly_dict = weekly_news.to_dict() # 캐시 저장 self.cache_manager.save_weekly_news_cache(weekly_dict, weekly_id) logger.info(f"주간 뉴스 캐시 갱신 완료 (ID: {weekly_dict.get('id', 'latest')})") re...
Python
1
screenshot, mask=screenshot.split()[3] ) # 使用alpha通道作为mask screenshot = background elif screenshot.mode not in ["RGB", "L"]: # 确保图片格式兼容JPEG screenshot = screenshot.convert("RGB") # 转换为JPEG格式的字节数据 byte_io = i...
Python
1
} Err(v) => seed.deserialize(v), } } None => Err(de::Error::invalid_type(Unexpected::UnitVariant, &"newtype variant")), } } fn tuple_variant<V>(self, _len: usize, visitor: V) -> Result<V::Value, Error> where V: Visitor<'de> { ...
Rust
0
), Range::new(54, 56), Range::exactly(999), ]); test_roots(vec![ Range::new(-9, -7), Range::new(54, 56), Range::new(950, 1050), Range::new(-90, -80), ]); test_roots(vec![ Range::new(-9, -7), Range::new(54, 56), Range::new(950, 1050), Range::new...
Rust
0
PLANE" } acl_loader.load_rules_from_file(os.path.join(test_path, 'acl_input/incremental_1.json')) acl_loader.rules_db_info = acl_loader.rules_info assert acl_loader.rules_info[(('NTP_ACL', 'RULE_1'))]["PACKET_ACTION"] == "ACCEPT" acl_loader.per_npu_configdb = None acl_loa...
Python
1
ock} </head> <body> <div id="root_{params.dashboard_id}"> </div> <script>var global = globalThis</script> {lib_block} {js_files_block} <script> window.drawDashboard({params.dashboard_id}, new Map(Object.entries(additional_graphs_{params.dashboard_id})), "root_{params....
Python
1
// NuttX Constants }; /// I2C Address of BME280 const BME280_ADDR: u16 = 0x77; /// I2C Frequency in Hz const BME280_FREQ: u32 = 400000; /// I2C Register that contains the BME280 Device ID const BME280_REG_ID: u8 = 0xD0; /// I2C Register that configures the BME280 Standby Interval const BME280_REG_CONFIG: u8 = 0x...
Rust
0
import pytest import drjit as dr import mitsuba as mi import numpy as np import os def test01_numpy_conversion(variants_all_scalar, np_rng): a = np_rng.random((4, 8, 16, 3)) grid = mi.VolumeGrid(a) assert dr.allclose(a, np.array(grid), atol=1e-3, rtol=1e-5) assert dr.allclose(np.max(a), grid.max()) ...
Python
1
lections_user_has_any_permission_for( request.user, ["add", "change"] ) # Add collection filter only if there are multiple collections if collections_qs.count() > 1: self.filters["collection_id"] = CollectionFilter( field_name="collection_id", ...
Python
1
""" Протокол менеджера контекста состоит из двух методов: `__enter__()` и `__exit__()`. Первый метод `__enter__(self)` не имеет входных параметров. Он вызывается после вычисления выражения `expression`, и его результат присваивается переменной `target`, если имя переменной выбрано после ключевого слова `as`. Метод `_...
Python
1
from Crypto.Cipher import AES, PKCS1_OAEP, PKCS1_v1_5 from Crypto.PublicKey import RSA from Crypto.Util.number import inverse, long_to_bytes, bytes_to_long, isPrime, getPrime, GCD from tqdm import tqdm from pwn import * from sage.all import * import itertools, sys, json, hashlib, os, math, time, base64, binascii, strin...
Python
1
TITLE_ALREADY_EXIST = 'User tried to create new post but title was already taken' NEW_POST_CREATED = 'User created a new post' # delete DELETE_INEXISTANT_POST = 'User tried to delete a Post but Post not exist' DELETE_NOT_OWNER = 'User not authorized to delete this Post because not owner' DELETE_POST_SUCCESS = 'User ...
Python
1
} use core::fmt::{Debug, Formatter, Result}; use super::addr::{align_down, virt_to_phys}; use super::{AlignedPage, MemFlags, MemoryRegion, PhysAddr}; static EMPTY_PAGE: AlignedPage = AlignedPage::new(); #[derive(Clone)] pub(super) struct Mapper { phys_virt_offset: Option<usize>, } impl Mapper { pub fn map_...
Rust
0
ist snapshot result not match", ); // Test list snapshot by snapshot ID list_snap_req.clear_source_volume_id(); list_snap_req.set_snapshot_id(snapshot1.get_snapshot_id().to_owned()); let list_snap_resp3 = list_snapshots(client, &list_snap_req) .add_context("failed to...
Rust
0
, Hash)] pub struct AudioStreamAlign(Boxed<ffi::GstAudioStreamAlign>); match fn { copy => |ptr| ffi::gst_audio_stream_align_copy(ptr), free => |ptr| ffi::gst_audio_stream_align_free(ptr), type_ => || ffi::gst_audio_stream_align_get_type(), } } impl AudioStreamAlign { #[doc(alia...
Rust
0
from flask import Flask from user_controller import user_blueprint app = Flask(__name__) @app.route("/") def welcome(): return "Henlo" @app.route("/home") def home(): return "This is home page" # Register the Blueprint app.register_blueprint(user_blueprint, url_prefix='/user') if __name__ == '__main__': ...
Python
1
action.txt" description: "{defs.CLAIM_DESCRIPTION}" max_gleanings: {defs.CLAIM_MAX_GLEANINGS} community_report: ## llm: override the global llm settings for this task ## parallelization: override the global parallelization settings for this task ## async_mode: override the global async_mode settings for this...
Python
1
_('Enter a valid JSON.'), } widget = Textarea def __init__(self, encoder=None, decoder=None, **kwargs): self.encoder = encoder self.decoder = decoder super().__init__(**kwargs) def to_python(self, value): if self.disabled: return value if value in se...
Python
1
# Copyright 2022 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
1
img a pointer to image to manipulate (the image data will be free() )"] pub fn imageDestroy(img: *mut sImage); } extern "C" { #[doc = " \\brief Tiles 8-bit image data into a sequence of 8x8 tiles"] #[doc = "\\param img a pointer to image to manipulate"] pub fn imageTileData(img: *mut sImage); } ...
Rust
0
import numpy as np import xgboost as xgb import cudf from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, roc_auc_score from tensorflow.keras.models import Model def calculate_results(model, X_test, y_test_encoded): # Prepare X_test and predictions based on the model type if isi...
Python
1
MapIter: Iterator<Item = ExtractInput> + FusedIterator, ExtractFn: Fn(ExtractInput) -> (K, ValIter), { loop { // attempt to consume a (K, V) from front_entry if let Some((key, iter)) = front_entry { if let Some(value) = iter.next() { let item = (key.clone(), value); ...
Rust
0
32; #[doc = "*Required features: `\"Win32_NetworkManagement_NetManagement\"`*"] pub const NERR_ACFTooManyLists: u32 = 2230u32; #[doc = "*Required features: `\"Win32_NetworkManagement_NetManagement\"`*"] pub const NERR_AccountExpired: u32 = 2239u32; #[doc = "*Required features: `\"Win32_NetworkManagement_NetManagement\"...
Rust
0
game.arena_number; let title = Spans::from(vec![ Span::raw("Arena "), Span::styled(number.to_string(), Style::default().add_modifier(Modifier::BOLD)), Span::raw(" · Points to win: "), Span::styled(points.to_string(), Style::default().add_modifier(Modifier::BOLD))...
Rust
0
ref(&self) -> &str { self.as_str() } } #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive( std::clone::Clone, std::cmp::Eq, std::cmp::Ord, std::cmp::PartialEq, std::cmp::PartialOrd, std::fmt::Debug, std::hash::Hash, )] pub enum ConflictType { ...
Rust
0
# globals.py # # Copyright (c) 2025 Naufan Rusyda Faikar # # 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 use, copy, modify,...
Python
1
he thread will call the callback function with an empty"] #[doc = " notification \"\" and terminate itself."] #[doc = ""] #[doc = " @param client the NP client"] #[doc = " @param notify_cb pointer to a callback function or NULL to de-register a"] #[doc = " previously set callback function."] ...
Rust
0
tag_t, ) -> u32 { let mut rval = 0; let face: *mut hb_face_t = hb_font_get_face(font.get_hb_font()); for i in 0..2 { let mut scriptIndex = 0; let mut langIndex = 0; let tableTag: hb_tag_t = if i == 0 { u32::from_be_bytes([b'G', b'S', b'U', b'B']) } else { ...
Rust
0
(()); }; result }).spawn(proc() { }); rx.recv(); } #[test] fn test_future_result() { let mut builder = TaskBuilder::new(); let result = builder.future_result(); builder.spawn(proc() {}); assert!(result.recv().is_ok()); let mut builder = TaskBuilder::new(); let result = ...
Rust
0
import subprocess def get_networks(): # Run iwlist to get a list of networks output = subprocess.check_output(['iwlist', 'wlan0', 'scan']) networks = [] for line in output.decode().split('\n'): if 'ESSID' in line: networks.append(line.split(':')[1].strip()) return networks def ...
Python
1
res.shape[0]): fn = path + '{}.png'.format(i) save_image_saliancy(features[i][None, ...].permute(1, 0, 2, 3).cpu(), fn, normalize=True) # # concat everything # features = features.reshape([-1, H, W]) # # save_image(features[None,...].permute(1,0,2,3).cpu(), fn, **kwargs)...
Python
1
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.hr_timesheet.tests.test_timesheet import TestCommonTimesheet class TestHelpdeskTimesheetCommon(TestCommonTimesheet): @classmethod def setUpClass(cls): super().setUpClass() group_helpdesk_user = cls.en...
Python
1
_i32(), f) } } impl std::ops::Add<i32> for Precedence { type Output = Precedence; fn add(self, rhs: i32) -> Self::Output { Precedence::try_from(self.as_i32() + rhs).unwrap() } } /// Associativity is the precedence tie-breaker. #[allow(dead_code)] #[derive(Debug, PartialEq, Eq, Clone, Copy)] e...
Rust
0
ody = df_info + df_body # Generamos la entrada de datos al email newmail.To = ';santos-sanchez@eipsa.es;' + str(df3[0][0]) newmail.CC = ';jesus-martinez@eipsa.es;ernesto-carrillo@eipsa.es;' + str(df2[0][0]) newmail.HTMLBody = ('<html><body>' '<p>Buenos días,<...
Python
1
} /// Implementation to create an `Error` from a `Vec<FluentError>`. Because for fluent, single errors are hard. impl From<Vec<FluentError>> for Error { fn from(_: Vec<FluentError>) -> Self { Self::from(ErrorKind::FluentResourceLoadingError) } } /// Implementation to create an `Error` from a `ParseFlo...
Rust
0
from copy import deepcopy from omegaconf import OmegaConf import torch from tqdm import tqdm import numpy as np import warnings warnings.filterwarnings("ignore") import json import sys sys.path.append(".") from models.ecg_encoder.cmelt import M3AEModel from types import SimpleNamespace def get_model(checkpoint_path="...
Python
1
6maccc2 tcqoguofu77 def gfjkiig15lv(m4mgqux4m43: jx2xu2ua16l=None, fua_z0fvlvr=0j, iep4mhesk49: zh6lrx807oz='', e1wba1ykzmc=b'', yhqfkqf4qo2=0, zzquxez8hbo: gczmz97cnk3=False, jf6inqm2745: q7f6gocgc1_=0j, xcu9p98ur9c=''): None[0.0]: b'' = f2ss3eep0jw return ic6qrr02su6 '# partner_scores_cares -> communi...
Python
1
:param refresh_token: """ if "save_token" in kwargs: warnings.warn("`save_token` has been deprecated, it was not called internally." "If you do, call `request_validator.save_token()` instead.", DeprecationWarning) if calla...
Python
1
+= 1 logger.info(f"Stopped tracking finished game {tracker.game_id}") else: error_msg = f"Failed to stop tracking game {tracker.game_id}" results["errors"].append(error_msg) logger.error(error_msg) ...
Python
1
itle, inline_help: DESCRIBE_AND_YAML_HINT.into(), resource: &mut app.data.replica_sets, table_headers: vec!["Namespace", "Name", "Desired", "Current", "Ready", "Age"], column_widths: vec![ Constraint::Percentage(25), Constraint::Percentage(35), Constraint::Percentage(10),...
Rust
0
be a union // type that accommodates *all* types used across any property. // See: https://basarat.gitbook.io/typescript/type-system/index-signatures let mut merged = Shape { type_: types::INVALID, ..Shape::default() }; let mu...
Rust
0
minph_ymm_k1z_ymm_ymmm256b16 = 4517, /// `VMINPH zmm1 {k1}{z}, zmm2, zmm3/m512/m16bcst{sae}` /// /// `EVEX.512.MAP5.W0 5D /r` /// /// `AVX512-FP16` /// /// `16/32/64-bit` EVEX_Vminph_zmm_k1z_zmm_zmmm512b16_sae = 4518, /// `VMINSH xmm1 {k1}{z}, xmm2, xmm3/m16{sae}` /// /// `EVEX.LIG.F3.MAP5.W0 5D /r` /// //...
Rust
0