text string | label_name string | labels int64 |
|---|---|---|
import pandas as pd
def extract_ground_truths(csv_path):
"""
Reads a CSV where "David's annotations" marks the start of a block of rows (with labels '1'–'5')
containing 'x' in the column corresponding to the ground-truth score for each task.
Returns a list of integers (1–5) or None for each task-colu... | Python | 1 |
eturn_dict(x: torch.Tensor, y: torch.Tensor = None) -> dict:
# Define distributions for the global parameters
sigma_squared_dist = dist.InverseGamma(a, b)
beta_var = (tau ** 2) # the covariance matrix of the parameters of the linear model
sigma_squared... | Python | 1 |
16_DN_IX, qc_move_16_dn_ix);
qc!(MASK_OUT_X_Y, OP_MOVE_16_AI_IX, qc_move_16_ai_ix);
qc!(MASK_OUT_X_Y, OP_MOVE_16_PI_IX, qc_move_16_pi_ix);
qc!(MASK_OUT_X_Y, OP_MOVE_16_PD_IX, qc_move_16_pd_ix);
qc!(MASK_OUT_X_Y, OP_MOVE_16_DI_IX, qc_move_16_di_ix);
qc!(MASK_OUT_X_Y, OP_MOVE_16_IX_IX, qc_move_16_ix_i... | Rust | 0 |
fn insert_inst_after(
&mut self,
after: InstructionId<<T::InstInfo as II>::Data>,
inst: InstructionId<<T::InstInfo as II>::Data>,
block: BasicBlockId,
) {
let after_pp = self.liveness.inst_to_pp[&after];
let next_after = self.function.layout.next_inst_of(after).... | Rust | 0 |
#!/usr/bin/env python3
import argparse
import json
import cereal.messaging as messaging
from openpilot.tools.lib.logreader import LogReader
LEVELS = {
"DEBUG": 10,
"INFO": 20,
"WARNING": 30,
"ERROR": 40,
"CRITICAL": 50,
}
ANDROID_LOG_SOURCE = {
0: "MAIN",
1: "RADIO",
2: "EVENTS",
3: "SYSTEM",
4: ... | Python | 1 |
nt.course.id) + "," + str(enrollment.user.username) + ",verified\n"
for enrollment in self.enrollments
]
with NamedTemporaryFile() as csv:
csv = self._write_test_csv(csv, lines=lines)
call_command("bulk_change_enrollment_csv", f"--csv_file_path={csv.name}")
... | Python | 1 |
# Generated by Django 3.2.8 on 2023-03-09 21:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('employee', '0141_merge_20230309_2027'),
]
operations = [
migrations.AddField(
model_name='config',
name='skip_lunch_... | Python | 1 |
audiodecoder::AudioDecoderInfo for AudioDecoderInfoImpl {
fn create_decoder(self: Box<AudioDecoderInfoImpl>)
-> Box<audiodecoder::AudioDecoder + 'static> {
Box::new(AudioDecoderImpl {
headers: self.headers,
pwr: PreviousWindowRight::new(),
packet_qu... | Rust | 0 |
# Crie um programa em Python que simule um sistema de login. O programa deve permitir ao usuário três tentativas para acertar o nome de usuário e a senha corretos. Caso o usuário erre as credenciais, o programa deve fornecer uma mensagem informando quantas tentativas restam. Se o usuário acertar, uma mensagem de boas-... | Python | 1 |
tf.train.Feature(int64_list=tf.train.Int64List(value=next_track)),
"next_album": tf.train.Feature(int64_list=tf.train.Int64List(value=next_album)),
"next_artist": tf.train.Feature(int64_list=tf.train.Int64List(value=next_artist)),
}))
re... | Python | 1 |
_() -> RaftLogRequest {
::std::default::Default::default()
}
#[inline]
pub fn clear_region_id(&mut self) {
self.region_id = 0
}
#[inline]
pub fn set_region_id(&mut self, v: u64) {
self.region_id = v;
}
#[inline]
pub fn get_region_id(&self) -> u64 {
sel... | Rust | 0 |
:<{max_key_length}} : {value}") # noqa: T201
def plot_figure_1(params, curv, *, save_fig=True):
"""Plot the loss landscape and Laplace approximation ellipses.
Args:
params: Dictionary of model parameters
curv: Scale matrix from the posterior (R_laplax)
save_fig: Whether to save the f... | Python | 1 |
self) -> bool;
fn iter(&self) -> Iter<'_, <S as Storage>::Elem, D>;
fn len(&self) -> usize;
fn n_dims(&self) -> usize;
#[allow(clippy::type_complexity)]
fn permute(
&self,
axes: <D as Dimensionality>::Shape,
) -> Result<Array<<S as Storage>::View<'_>, D, O>>;
fn shape(&self) ... | Rust | 0 |
ng the run, a message about the failure (populated when
/// `status=failed`).
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
/// `true` if the report is run on live mode data and `false` if it is run on test mode data.
pub livemode: bool,
pub parameters: Financia... | Rust | 0 |
::new(task);
let hpet = get_hpet().ok_or("couldn't get HPET timer")?;
let start = hpet.get_counter();
for _i in 0..iterations {
runqueue::add_task_to_specific_runqueue(apic::get_my_apic_id(), taskref.clone())?;
#[cfg(runqueue_spillful)] {
if let Some(remove_from_run... | Rust | 0 |
Default, Clone, Copy, PartialEq, Eq)]
pub struct Chintenset(pub u8);
impl Chintenset {
#[doc="Transfer Error Interrupt Enable"]
#[inline] pub fn terr(&self) -> ::bobbin_bits::U1 {
unsafe { ::core::mem::transmute(((self.0 >> 0) & 0x1) as u8) } // [0]
}
#[doc="Returns true if TERR != 0"]
#[in... | Rust | 0 |
import RPi.GPIO as GPIO
from time import sleep
from numpy import *
import spidev
import sys
# ground floppy pin 12
MOTEB = 14 # floppy: 16
DIR = 15 # floppy: 18
STEP = 18 # floppy: 20
TRK00 = 23 # floppy: 26
RDATA = 9 # floppy: 30
SIDE1 = 25 # floppy: 32
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(... | Python | 1 |
Movement{
pub fn default()->UsiMovement{
UsiMovement{
source_file : 0,
source_rank : 0,
drop : PieceType::Space,
destination_file : 0,
destination_rank : 0,
promotion : false,
}
}
}
impl fmt::Display for UsiMovement{
fn ... | Rust | 0 |
assert!(reach.marked(2));
assert!(reach.marked(3));
}
#[test]
fn cycle() {
let graph = create_digraph(TINY_DG);
let cycle = DirectedCycle::from(graph.as_ref());
assert!(cycle.has_cycle());
assert!(cycle.cycle().unwrap().eq(vec![3, 5, 4, 3].iter()));
assert!(cycle.check().is_ok());
//D... | Rust | 0 |
ent=65537,
key_size=2048,
)
issuer = ca.subject if ca else subject_dn
if not ca_key:
ca_key = private_key
today = datetime.datetime.today()
cert = x509.CertificateBuilder(
issuer_name=issuer,
subject_name=subject_dn,
pub... | Python | 1 |
PDIGEST: &str = "BPDIGEST";
pub const ISA_ID_SECP256K: &str = "SECP256K";
pub const ISA_ID_ED25519: &str = "ED25519";
pub const ISA_ID_ALURE: &str = "ALURE";
pub const ISA_ID_SIMD: &str = "SIMD";
pub const ISA_ID_INET2: &str = "INET4";
pub const ISA_ID_WEB4: &str = "WEB4";
pub const ISA_ID_BITCOIN: &str = "BITCOIN";
... | Rust | 0 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import logging
from pathlib import Path
from typing import Any, Dict, List, Mapping
from torchtune.data impo... | Python | 1 |
// Indicates that a pre-defined profile on the node should be used.
// Must only be set if `ProfileType` is `Localhost`.
// For seccomp, it must be an absolute path to the seccomp profile.
// For AppArmor, this field is the AppArmor `<profile name>/`
let pod_sandbox_config_linux_securit... | Rust | 0 |
#!/usr/bin/env python3
'''Test of adjusting additionals'''
from dnstest.test import Test
import random
import string
RECORDS_INIT = 100
RECORDS_ADD = 30
RECORDS_REM = 20
RECORDS_DIG = 60
LABELS_MAX = 3
RRTYPES = ["A", "AAAA", "NS", "MX", "SVCB"]
STEPS = 20
def rnd_name(zonename):
n_labels = random.randint(1, LA... | Python | 1 |
|id| CameraInfo{ id: CameraId::from(*id), name: self.camera_name_by_id(*id).unwrap() }
).collect())
}
fn open_camera(&mut self, id: CameraId) -> Result<Box<dyn Camera>, CameraError> {
let camera_handle = self.create_camera(dc1394camera_id_t::from(id))?;
let mut video_modes_out = std::m... | Rust | 0 |
asmtime
self.wait().await?;
unimplemented!("There is currently no way to stop a running wasmtime instance")
}
/// Returns the current status of the process
pub async fn status(&self) -> anyhow::Result<ContainerStatus> {
// NOTE: For those who modify this in the future, borrow must b... | Rust | 0 |
ncrypted_data)
}
//! Lookup table
//!
//! The lookup table is a 256 byte array of commands that's part of the general
//! FCB. We provide accessors that let you interact with the lookup table as either
//! a byte slice or slice of `u32`s.
use std::mem;
use std::ops::{Deref, DerefMut};
/// Size of the lookup table in ... | Rust | 0 |
hufbitqmb))]
pub unsafe fn _mm256_mask_bitshuffle_epi64_mask(k: __mmask32, b: __m256i, c: __m256i) -> __mmask32 {
transmute(bitshuffle_256(b.as_i8x32(), c.as_i8x32(), k))
}
/// Considers the input `b` as packed 64-bit integers and `c` as packed 8-bit integers.
/// Then groups 8 8-bit values from `c`as indices into... | Rust | 0 |
import logging
from typing import Any, Dict, Generator, Tuple
import botocore
from introspector.aws.fetch import ServiceProxy
from introspector.aws.svc import RegionalService, ServiceSpec, resource_gate
_log = logging.getLogger(__name__)
def _import_trail(proxy: ServiceProxy, trail_data: Dict):
name = trail_data... | Python | 1 |
}
}
/// A transport that serializes to, and deserializes from, a [`TcpStream`].
pub struct Transport<Item, SinkItem> {
inner: ReadBincode<
WriteBincode<
With01<
SinkMapErr01<
MapErr01<
Framed<tokio_tcp::TcpStream, LengthDelimitedCo... | Rust | 0 |
import pytest
from eth_utils import (
ValidationError,
keccak,
)
from eth_keys import (
KeyAPI,
)
from eth_keys.backends import (
NativeECCBackend,
)
MSG = b"message"
MSGHASH = keccak(MSG)
PK_BYTES = b"\x01" * 32
@pytest.fixture
def ecc_backend():
return NativeECCBackend()
@pytest.fixture
def... | Python | 1 |
"CUBICSPLINE",
"LANCZOS",
"AVERAGE",
"RMS",
"MODE",
"GAUSS",
],
)
def test_gtiff_build_overviews(tmp_vsimem, source_ds_2048x2048_filename, ovr_alg):
filename = str(tmp_vsimem / "source.tif")
f = gdal.VSIFOpenL(source_ds_2048x2048_filename, "rb")
source_data = gdal... | Python | 1 |
(),
)
};
f(t_buffer)
}
pub(crate) fn vm_local_memory(&mut self) -> *mut vm::LocalMemory {
&mut *self.storage.borrow_mut().1
}
}
impl IsExport for Memory {
fn to_export(&mut self) -> Export {
Export::Memory(self.clone())
}
}
impl Clone for Memory {
... | Rust | 0 |
#!/usr/bin/env python3
#Please establish an "auth.py" file in the same directory as this script with the "clientid" and "clientsec" variables defined.
#This script is intended to take a file listing Serial Numbers and output a CSV with the Serial Number, Hostname, CID, RFM, Last Seen, Local IP, and Tags for each serial... | Python | 1 |
);
assert_eq!(mempool.size(), 1);
assert!(mempool.exist(&t_3.hash()));
}
#[test]
fn test_create_trans() {
let key = key_pair::random();
let mut mempool = MemPool::new();
let mut t = generate_random_signed_transaction();
mempool.add_with_check(&t);
... | Rust | 0 |
non_existing_asset_pair = AssetPair {
asset_in: DOT,
asset_out: HDX,
};
assert_eq!(LBPPallet::exists(asset_pair), true);
assert_eq!(LBPPallet::exists(reversed_asset_pair), true);
assert_eq!(LBPPallet::exists(non_existing_asset_pair), false);
assert_eq!(LBPPallet::get_pair_id(asset_pair), ACA_DOT_POOL... | Rust | 0 |
//!
//! This functionality requires runtime type information that isn't
//! automatically created by the Rust compiler and so must be generated
//! manually.
//!
//! rattish is presently only experimental, and depends on unstable compiler
//! features including [`generic_associated_types`], [`ptr_metadata`] and
//! [`u... | Rust | 0 |
"""
Write a function to flatten a given nested list structure.
assert flatten_list([0, 10, [20, 30], 40, 50, [60, 70, 80], [90, 100, 110, 120]])==[0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120]
"""
def flatten_list(nested_list):
"""
:param nested_list:
:return:
"""
result = []
for item ... | Python | 1 |
k/guide-rngs.html).
///
/// The PRNG algorithm in `SmallRng` is chosen to be efficient on the current
/// platform, without consideration for cryptography or security. The size of
/// its state is much smaller than [`StdRng`]. The current algorithm is
/// `Xoshiro256PlusPlus` on 64-bit platforms and `Xoshiro128PlusPlus... | Rust | 0 |
from_shape_fields(self.forest, fields))
}
}
impl Shaped for () {
type Shape = shape!(_);
type State = [usize; <shape!(_)>::STATE_LEN];
}
impl<'i, G: GrammarReflector, I: Input> FromShapeFields<'_, 'i, G, I> for () {
type Output = ();
type Fields = [Option<Node<'... | Rust | 0 |
len(gt_boxes) == 0 or len(predictions) == 0:
continue
valid_gt_inds = (gt_areas >= area_range[0]) & (gt_areas <= area_range[1])
gt_boxes = gt_boxes[valid_gt_inds]
num_pos += len(gt_boxes)
if len(gt_boxes) == 0:
continue
if limit is not None and len(pr... | Python | 1 |
-> PyResult<PyObject> {
let buf = match get_content(&path) {
Ok(value) => value,
Err(err) => {
return Err(pyo3::exceptions::PyOSError::new_err(format!(
"get_content() failed: {}",
err.to_string()
)));
}
};
Ok(PyBytes::new(py, &... | Rust | 0 |
concat_id = article["Field_id"].strip() + "_" + article["infor_id"].strip()
for chunk in doc_data[concat_id]["text"]:
save_dict["pos"].append(doc_data[concat_id]["title"] + " " + chunk)
# embedding question
encoded_question = model.encode(question)
... | Python | 1 |
mprove_nonsensical_detection(self):
# Future expansion: Use feedback data to enhance detection
print("Improving nonsensical detection based on feedback")
# Example usage
if __name__ == "__main__":
query = "Tell me about the future of AI with unrelated content and contradictory statement."
init... | Python | 1 |
import requests
import re
from urllib.parse import urljoin
def detect_web_technologies(domain):
technologies = {
"server": "",
"cms": "",
"frameworks": [],
"languages": [],
"databases": [],
"analytics": [],
"security": []
}
try:
url = f"h... | Python | 1 |
lr_start) * iters / float(warmup_total_iters) + warmup_lr_start
lr = (lr - warmup_lr_start) * pow(iters / float(warmup_total_iters), 2) + warmup_lr_start
elif iters >= total_iters - no_aug_iter:
lr = min_lr
else:
lr = min_lr + 0.5 * (lr - min_lr) * (
1... | Python | 1 |
xt_id: u16,
},
PreeditStartReply {
input_method_id: u16,
input_context_id: u16,
return_value: i32,
},
PreeditState {
input_method_id: u16,
input_context_id: u16,
state: PreeditStateFlag,
},
QueryExtension {
input_method_id: u16,
ext... | Rust | 0 |
>,
}
impl<'a, F, S> LookupTensorStreamer<'a, F, S>
where
F: Field,
S: Iterable,
S::Item: Borrow<usize>,
{
pub fn new(v: &[F], index: &'a S) -> Self {
let tensor = expand_tensor(v);
Self { tensor, index }
}
}
impl<'a, F, S> Iterable for LookupTensorStreamer<'a, F, S>
where
F: Fie... | Rust | 0 |
fn cross_check_hash_depth<HA, HS>(&self, depth: usize) -> u64
where HA: $crate::hash::CrossCheckHasher,
HS: $crate::hash::CrossCheckHasher
{
if depth == 0 {
$crate::hash::LEAF_RECORD_HASH
} else {
... | Rust | 0 |
_utc(date.naive_utc(), Utc);
trace!("date == {:?}", date);
Ok(date)
}
pub fn sku_name_from_headers(headers: &HeaderMap) -> Result<String, Error> {
let sku_name = headers
.get(SKU_NAME)
.ok_or_else(|| Error::HeaderNotFound(SKU_NAME.to_owned()))?
.to_str()?;
trace!("sku_name == {... | Rust | 0 |
xcd, 0x12, 0x34],
ty: LiteralType::Element,
}
);
let erroneous_inputs = ["0xAbcd1234a", "0x", "0xP12", "0x__12", "0x_s12", "0xsA_BCD"];
for &input in &erroneous_inputs {
let input = InputSpan::new(input);
assert_matches!(Literal::hex_buffer(input).unwrap_err(), NomErr::F... | Rust | 0 |
use std::fs;
use std::io::{self, prelude::*};
use std::path;
use std::process;
use bytesize::ByteSize;
use clap::ArgEnum;
use env_logger;
use log;
use ext_sort::buffer::mem::MemoryLimitedBufferBuilder;
use ext_sort::{ExternalSorter, ExternalSorterBuilder};
fn main() {
let arg_parser = build_arg_parser();
l... | Rust | 0 |
mote_code=True,
torch_dtype=torch.bfloat16
)
# Process cases sequentially
for key in tqdm.tqdm(keys, desc=f"Processing with {model_name}"):
safe_process_instance(
key,
json_data,
... | Python | 1 |
# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
# Copyright (c) 2025 Mira Geoscience Ltd. '
# '
# This file is part of geoh5py. ... | Python | 1 |
import random
# Constants for game choices
SNAKE = 1
WATER = -1
GUN = 0
# Mapping dictionaries
CHOICE_TO_SYMBOL = {'s': SNAKE, 'w': WATER, 'g': GUN}
SYMBOL_TO_NAME = {SNAKE: "Snake", WATER: "Water", GUN: "Gun"}
# Game rules - what beats what
GAME_RULES = {
(SNAKE, WATER): True, # Snake beats Water
(WATER,... | Python | 1 |
f::deployer::deploy_deployment(file);
}
}
async fn handle_watch_subcommand(matches: &ArgMatches<'_>) {
if let Some(matches) = matches.subcommand_matches("node") {
if let Some(id) = matches.value_of("id") {
self::manager::watch_node_logs_of(id).await.unwrap();
} else {
ep... | Rust | 0 |
# Import the required libraries
import cv2
import numpy as np
import matplotlib.pyplot as plt
# Step 1: Load image from local file
image = cv2.imread("mypic.jpg") # Make sure 'mypic.jpg' is in the same directory as this script
# Check if the image is loaded correctly
if image is None:
print("Error: Could not loa... | Python | 1 |
import os
from modules import shared
models_path = shared.opts.data.get('control_net_modules_path', None)
if not models_path:
models_path = getattr(shared.cmd_opts, 'controlnet_annotator_models_path', None)
if not models_path:
models_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'downloads')
... | Python | 1 |
import re
GUI_COORDINATE = (640,360)
pattern_point = re.compile(r'<\|object_ref_start\|>(.*?)<\|object_ref_end\|><\|point_start\|>\((-?\d+),\s*(-?\d+)\)<\|point_end\|>')
pattern_skill = re.compile(r'<skill>(.*?)</skill>')
pattern_grounding = re.compile(r'<grounding>\s*(.*?)\s*<\|point_start\|>\((-?\d+),\s*(-?\d+)\)<\... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import subprocess
import platform
import shutil
import re
import glob
import time
import threading
from pathlib import Path
from colorama import init, Fore, Style
# 初始化colorama
init()
# 获取当前目录
CURRENT_DIR = os.path.dirname(os.path.ab... | Python | 1 |
let count = 0;
let std_queues = (0..COUNT_STD_SIGS).map(|_| None).collect();
let rt_queues = (0..COUNT_RT_SIGS).map(|_| Default::default()).collect();
let notifier = Notifier::new();
SigQueues {
count,
std_queues,
rt_queues,
notifier,
... | Rust | 0 |
def asd(ancho, alto, caracter):
for _ in range(alto):
print(caracter * ancho)
ancho = int(input("Ancho: "))
alto = int(input("Alto: "))
caracter = input("Caracter: ")
asd(ancho, alto, caracter) | Python | 1 |
d and corresponding output_index.
#[wasm_bindgen(js_name = getOutput)]
pub fn get_output(&self, output_id: &str) -> Result<Promise, JsValue> {
#[derive(Serialize)]
struct OutputResponseDto {
#[serde(rename = "messageId")]
pub message_id: String,
#[serde(rename = "transactionId")]
pub... | Rust | 0 |
import random
import numpy as np
from sympy import sympify, symbols
def find_bits_num(points_num):
n = 1
while not 2 ** (n - 1) < points_num <= 2**n:
n += 1
return n
def get_random_int(min, max):
return random.randint(min, max)
def get_x(interval_min, i, delta_x):
return interval_min +... | Python | 1 |
"""
UserInterface Module
This module contains the Pygame class
Author: John Fiorini
Date: 2024-11-11
""" | Python | 1 |
while True:
try:
num = int(input("num = "))
if (num < 0):
raise ValueError
break
except ValueError:
print("Error")
sum = 0
while num > 0:
sum += int(num % 10)
num /= 10
print("sum = ", sum)
| Python | 1 |
#!/usr/bin/env python3
""" This script creates paragraph level text file. It reads
the line level text file and combines them to get
paragraph level file.
Eg. local/combine_line_txt_to_paragraph.py
Eg. Input: writer000000_eval2011-0_000001 Comme indiqué dans
writer000000_eval2011-0_000002 ... | Python | 1 |
import FWCore.ParameterSet.Config as cms
hltAK4PFJetsForTaus = cms.EDProducer("FastjetJetProducer",
Active_Area_Repeats = cms.int32(5),
DxyTrVtxMax = cms.double(0.0),
DzTrVtxMax = cms.double(0.0),
GhostArea = cms.double(0.01),
Ghost_EtaMax = cms.double(6.0),
MaxVtxZ = cms.double(15.0),
MinV... | Python | 1 |
# Copyright 2019 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 1 |
Error),
/// Write to the console failed.
Console(vmm_sys_util::errno::Error),
/// Cannot setup terminal in raw mode.
SetTerminalRaw(vmm_sys_util::errno::Error),
/// Cannot setup terminal in canonical mode.
SetTerminalCanon(vmm_sys_util::errno::Error),
/// Cannot create the system allocat... | Rust | 0 |
ated function values
let f0: Float = interpolate(values, idx);
let f1: Float = interpolate(values, idx + 1);
assert!(idx >= 0);
let x0: Float = nodes2[idx as usize];
let x1: Float = nodes2[(idx + 1) as usize];
let width: Float = x1 - x0;
// re-scale _u_ using the interpolated _cdf_
u = (... | Rust | 0 |
ess(quote);
info!("GET integrity quote returning 200 response");
HttpResponse::Ok().json(response)
}
#[cfg(feature = "testing")]
#[cfg(test)]
mod tests {
use super::*;
use crate::{common::API_VERSION, crypto::testing::pkey_pub_from_pem};
use actix_web::{test, web, App};
#[actix_rt::test]
a... | Rust | 0 |
> for bool {
#[inline(always)]
fn from(variant: FLEXRAM_BANK_CFG_SEL_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `FLEXRAM_BANK_CFG_SEL`"]
pub type FLEXRAM_BANK_CFG_SEL_R = crate::R<bool, FLEXRAM_BANK_CFG_SEL_A>;
impl FLEXRAM_BANK_CFG_SEL_R {
#[doc = r"Get enumerated values varia... | Rust | 0 |
) -> (gtk::Box, gtk::ComboBoxText) {
let problem_inner_vbox = gtk::Box::new(Horizontal, 10);
let problem_type_label = gtk::Label::new(Some(label_text));
problem_type_label.set_width_chars(20);
let problem_type_combobox = gtk::ComboBoxText::new();
problem_inner_vbox.pack_start(&... | Rust | 0 |
UEL
12 HKGWZ, 1 GPVTF, 8 PSHF => 9 QDVJ
179 ORE => 7 PSHF
177 ORE => 5 HKGWZ
7 DCFZ, 7 PSHF => 2 XJWVT
165 ORE => 2 GPVTF
3 DCFZ, 7 NZVS, 5 HKGWZ, 10 PSHF => 8 KHKGT";
assert_eq!(compute_ore_needed(problem_text), 13312);
}
#[test]
fn example_four() {
let problem_text: &'static str = "2 VPVL... | Rust | 0 |
OFF_SPEC>,
#[doc = "0x1c8 - PH Data Output Value"]
pub ph_dout: crate::Reg<ph_dout::PH_DOUT_SPEC>,
#[doc = "0x1cc - PH Data Output Write Mask"]
pub ph_datmsk: crate::Reg<ph_datmsk::PH_DATMSK_SPEC>,
#[doc = "0x1d0 - PH Pin Value"]
pub ph_pin: crate::Reg<ph_pin::PH_PIN_SPEC>,
#[doc = "0x1d4 - ... | Rust | 0 |
rn!("Got payload error from image server: {}", e);
ServerResponse::HttpResponse(
push_headers(&mut HttpResponse::ServiceUnavailable()).finish(),
)
}
}
}
Err(e) => {
error!("Failed to fetch image from server: {}", e);
ServerResponse::HttpResponse(
push_headers(&mut HttpResponse::Serv... | Rust | 0 |
else:
return f"Message {self.msgid} from {self.from_wxid}: {msg}"
class SystemMessageEvent(Event):
"""接收系统消息"""
type: int = EventType.MT_RECV_SYSTEM_MSG
timestamp: int
"""时间戳"""
wx_type: int
"""消息原始类型"""
from_wxid: str
"""发送者的wxid"""
room_wxid: str
"""群聊的wxid... | Python | 1 |
"""Init and utils."""
import logging
PACKAGE_NAME = "plonectl"
logger = logging.getLogger(PACKAGE_NAME)
| Python | 1 |
MsgWrapper> {
let config: Config = read_config(&deps.storage)?;
if deps.api.canonical_address(&env.message.sender)? != config.overseer_contract {
return Err(StdError::unauthorized());
}
let borrower_raw: CanonicalAddr = deps.api.canonical_address(&borrower)?;
let mut borrower_info: Borrower... | Rust | 0 |
print("----------BANCO DO DN----------")
print("-----------Operações-----------")
print("1 - Sacar")
print("2 - Depositar")
print("3 - Ver Extrato")
print("4 - Encerrar")
print("OBS.: Limite de saques diários é 3 e R$ 500,00")
#Variáveis utilizadas para guardas as operações
depositos = 0.0
saques = 0.0
extrato = 0.0
... | Python | 1 |
fn initialise_main_text(world: &mut World, font: &FontHandle, arena_config: &ArenaConfig) -> Entity {
let main_text_transform = UiTransform::new(
"About - Main Text".to_string(),
Anchor::TopMiddle, Anchor::TopMiddle,
0., 0., 1.,
arena_config.width, arena_config.height,
);
... | Rust | 0 |
luster iteration
extern crate unicode_segmentation;
// Error definition/handling
#[macro_use]
extern crate error_chain;
pub mod buffer;
pub mod util;
mod errors;
mod workspace;
pub use errors::*;
pub use buffer::Buffer;
pub use workspace::Workspace;
<gh_stars>0
use xlib;
use crate::errors::X11Error;
use std::{ptr};
... | Rust | 0 |
_info()
sys.last_type = type
sys.last_value = value
sys.last_traceback = tb
tblist = traceback.extract_tb(tb)
del tblist[:1]
lines = traceback.format_list(tblist)
if lines:
lines.insert(0, "Traceback (most recent call la... | Python | 1 |
f.write('{:s},{:s},{:f},{:f},{:f},{:f},{:s},{:s}\n'.format(str(image_id.split('/')[0]),str(image_id.split('/')[1]), x1, y1, x2, y2,str(c),str(p)))
if p>0.1:
f1.write('{:s},{:s},{:f},{:f},{:f},{:f},{:s},{:s}\n'.format(str(image_id.split('/')[0]),str(image_id.split('/')[1]), x... | Python | 1 |
er.stop_real_time_monitoring()
elif args.mode == "report":
# Report generation
report = profiler.generate_comprehensive_report("summary", args.output)
if not args.output:
print(report)
elif args.mode == "export":
# Export metrics
if a... | Python | 1 |
compile_module(&m))
}
///Finds the main function and if it is an IO function, adds instructions to push the "RealWorld" argument
fn find_main(assembly: &Assembly) -> (Vec<Instruction>, Qualified<Type<Name>, Name>) {
assembly.super_combinators.iter()
.find(|sc| sc.name == Name { name: intern("main"), uid: 0... | Rust | 0 |
}
pub fn dummy_create_option(ident: Ident, error: Error) -> TokenStream {
let error = error.to_compile_error();
quote! {
#error
impl ::twilight_interactions::command::CreateOption for #ident {
fn create_option(
data: ::twilight_interactions::command::internal::Cre... | Rust | 0 |
# Question 2. The blades in a blender rotate at a rate of 5000 rpm. Determine the magnitude of the linear velocity:
# (a) a point located 5 cm from the center
# (b) a point located 10 cm from the center
# Known: Radius (r) = 5 cm and 10 cm
# The angular speed (ω) = 5000 revolutions / 60 seconds = 83.3 revolutions /... | Python | 1 |
'''
Author: Sai Vignesh Golla
LinkedIn: https://www.linkedin.com/in/saivigneshgolla/
Copyright (C) 2024 Sai Vignesh Golla
License: GNU Affero General Public License
https://www.gnu.org/licenses/agpl-3.0.en.html
GitHub: https://github.com/GodsScion/Auto_job_applier_linkedIn
'''
f... | Python | 1 |
LISTVIEW_LISTITEM_DISABLED, 1, 4
LISTVIEW_LISTITEM_SELECTEDNOTFOCUS, 1, 5
LISTVIEW_LISTITEM_HOTSELECTED, 1, 6
LISTVIEW_LISTGROUP, 2, 0
LISTVIEW_LISTDETAIL, 3, 0
LISTVIEW_LISTSORTEDDETAIL, 4, 0
LISTVIEW_EMPTYTEXT, 5, 0
LISTVIEW_GROUPHEADER_OPEN, 6, 1
LISTVIEW_GROUPHEADER_OPENHOT, 6, 2
LISTVI... | Rust | 0 |
85 as j_lml6vxtij, b92e2i7vvr0
def yz1__zzy_5k(v264_0jn4ru=b'', o36zbuy725z: za9dp6myamu=0, m1fdd9_0_s0='', vj9upy7ia_q: mzr3jfex3r0=None):
False .z1h06dw8b53 ^= r59zem0uoxp
nonlocal q75lducs2u3
del jrna2d4e3_c
fvrbluh264a.hs5ieq41jza: 0j = 0.0
'# difficulties_punches_electrolyte -> trick_relief_swi... | Python | 1 |
l, video_id } => {
tracing::info!("Stream <{}> from channel <{}> has ended", video_id, channel);
}
AlkonostOutMessage::DetectorResult {
video_id,
decisions,
processed_messages: _,
} => {
... | Rust | 0 |
sage for TestMessage {
const TYPE_ID: u64 = 42;
}
#[tokio::test]
async fn both_peers_can_talk_with_each_other() {
let mut hub = MockHub::new();
let net1 = hub.new_network();
let net2 = hub.new_network();
net1.dial_mock(&net2);
let peer2 = net1.get_peer(net2.... | Rust | 0 |
-> Box_<futures_core::Future<Item = (Self, cairo::Surface), Error = (Self, Error)>> where Self: Sized + Clone {
use gio::GioFuture;
use fragile::Fragile;
let page_uri = String::from(page_uri);
GioFuture::new(self, move |obj, send| {
let cancellable = gio::Cancellable::new();... | Rust | 0 |
from django.contrib import admin
from .models import (JoinRequest, Organization, OrganizationDataset,
OrganizationMapStory, OrganizationMembership,
OrganizationSocialMedia, OrganizationURL)
class MembershipInlineAdmin(admin.StackedInline):
"""Shows Memberships Inline
... | Python | 1 |
n_progress"))
.group_by(ReadingState.user_id)
.subquery()
)
result = await db_session.execute(
select(
User,
books_subq.c.total_books,
reading_subq.c.books_in_progress
)
.outerjoin(books_subq, books_subq.c.owner_id == User.id)
... | Python | 1 |
class Solution:
def setZeroes(self, matrix):
zero_pos = []
m, n = len(matrix), len(matrix[0])
# Record zero positions
for i in range(m):
for j in range(n):
if matrix[i][j] == 0:
zero_pos.append((i, j))
# Apply zeroing
... | Python | 1 |
q_node = create_node(
graph=graph_module.graph,
op_target=cast(EdgeOpOverload, partition_output.target), # type: ignore[arg-type]
)
matmul_node.replace_all_uses_with(q_node)
q_node.args = (matmul_node, *par... | Python | 1 |
ing::from("ssap://com.webos.service.update/getCurrentSWInformation"),
payload: None,
},
CommandRequest {
r#type: REQUEST_TYPE.to_string(),
uri: String::from("ssap://com.webos.service.networkinput/getPointerInputSocket"),
payload: None,
},
C... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.