text string | label_name string | labels int64 |
|---|---|---|
oo::crd()))
.await?;
wait_for_crd_ready(&crds).await?; // wait for k8s to deal with it
// Start applying foos
let foos: Api<Foo> = Api::namespaced(client.clone(), &namespace);
// 1. Apply from a full struct (e.g. equivalent to replace w/o resource_version)
let foo = Foo::new("baz", FooSpec... | Rust | 0 |
self.fc = nn.Linear(5, 1)
# def forward(self, x):
# x = self.conv(x)
# x = self.bn(x)
# x = self.avg_pool(x)
# x = self.flat(x)
# x = self.fc(x)
# return x
# if __name__=="__main__":
# strategy = FSDPStrategy(
# auto_wrap_policy={Sim... | Python | 1 |
. **
** **
** http://www.gnu.org/licenses/ **
** **
** Do note that, while the whole of rsp2 ... | Rust | 0 |
atures: `\"Win32_System_EventLog\"`*"]
pub fn EvtOpenPublisherEnum(session: isize, flags: u32) -> isize;
#[doc = "*Required features: `\"Win32_System_EventLog\"`*"]
pub fn EvtOpenPublisherMetadata(session: isize, publisherid: ::windows_sys::core::PCWSTR, logfilepath: ::windows_sys::core::PCWSTR, locale: u32... | Rust | 0 |
_TYPE[index]
}
#[allow(non_camel_case_types)]
#[repr(i8)]
#[derive(Clone, Copy, PartialEq, Debug)]
pub enum TextureFormat {
UNKNOWN = 0,
R4G4_UNORM = 1,
R4G4B4A4_UNORM = 2,
R5G6B5_UNORM = 3,
R5G5B5A1_UNORM = 4,
R8_UNORM = 5,
R8_SNORM = 6,
R8_SRGB = 7,
R8_UINT = 8,
R8_SINT = 9,
R8G8_UNORM = 10,
... | Rust | 0 |
# Conceitos de Herança e Polimorfismo
"Herança: Herança permite criar uma nova classe (classe filha) baseada em uma classe existente (classe pai), herdando seus atributos e métodos. Isso promove reutilização de código e facilita a manutenção, mas perceba que não somos obrigados a implementar todos os métodos herdados,... | Python | 1 |
import os
import requests
import json
from bottle import request
# Load config from config.json
script_dir = os.path.dirname(os.path.realpath(__file__))
config_path = os.path.join(script_dir, 'config.json')
with open(config_path) as config_file:
config = json.load(config_file)
token = config['token']
def me... | Python | 1 |
failed - expected '{:#?}', found: '{:#?}'", expected, actual))
.into())
}
}
macro_rules! expect_eq {
($expected:expr, $actual:expr) => {
expect_eq(&$expected, &$actual)
};
}
macro_rules! expect_true {
($condition:expr) => {
if $condition{
Ok(())
} else {... | Rust | 0 |
_conversion)]
aws_smithy_types::Number::NegInt((*var_4214).into()),
);
}
#[allow(unused_mut)]
let mut scope_4215 = writer.prefix("EndDate");
if let Some(var_4216) = &input.end_date {
scope_4215.instant(var_4216, aws_smithy_types::instant::Format::DateTime);
}
#[allow(... | Rust | 0 |
);
assert_eq!(compute_sha256("\
She had the jitters
She had the flu
She showed up late
She missed her cue
She kicked the director
She screamed at the crew
And tripped on a prop
And fell in some goo
And ripped her costume
A place or two
Then she forgot
A line she knew
And went “Meow”
Instead of “Moo”
S... | Rust | 0 |
//! ch::BATTERY_LEVEL,
//! "",
//! CharacteristicProperties::NOTIFY,
//! );
//!
//! registration
//! }
//!
//! #[tokio::main(flavor = "current_thread")]
//! async fn main() -> anyhow::Result<()> {
//! use std::io::stdin;
//! use tokio::task::spawn_blocking;
//! use tokio::io:... | Rust | 0 |
if !grid[x][y].can_be_occupied {
// skip
continue;
}
let manhattan_distance = (point.x - x as i32).abs() + (point.y - y as i32).abs();
if grid[x][y].point.name == "unoccupied" || grid[x][y].distance_from_point > manhatta... | Rust | 0 |
"""
# Copyright (c) 2025 PaddlePaddle Authors. 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 ap... | Python | 1 |
Debug, Copy, Clone, Default)]
pub struct Pr(pub f32);
impl Pr {
pub fn even() -> Pr {
Pr(0.5)
}
}
impl PartialEq for Pr {
fn eq(&self, other: &Self) -> bool {
self.0 == other.0
}
}
impl PartialOrd for Pr {
fn partial_cmp(&self, other: &Pr) -> Option<Ordering> {
self.0.part... | Rust | 0 |
s) > i:
values.append(defender_observations[t].machines[i].host_metrics.num_failed_login_attempts)
else:
values.append(null_value)
labels.append(f"{t}_node_{i}_defender_num_open_connections")
if len(defender_observations) > t and le... | Python | 1 |
_ensure_value_metadata(ctx, input_shape_val)
target_shape = ctx.builder.Concat(
ones_vec,
input_shape_val,
axis=0,
_outputs=[ctx.fresh_name("tile_target_shape")],
)
target_shape.type = ir.TensorType(ir.DataType.INT64)... | Python | 1 |
c_no = 12345678
name="dharmishtha"
subject = ['python','software testing','se']
day_shift=True
print(type(c_no))
print(type(subject))
print(type(23.6789)) | Python | 1 |
# -*- coding: utf-8 -*-
import os
import torch
import triton
from flash_attn import flash_attn_func
from fla.ops.retention import chunk_retention, parallel_retention
@triton.testing.perf_report(
triton.testing.Benchmark(
# argument names to use as an x-axis for the plot
x_names=['T'],
#... | Python | 1 |
logger.warning(
f"{self.codename}: Partial purchase: Expected {expected_crypto_amount}, received {bought_amount}")
else:
result_dict["action_result"] = "success"
logger.info(
f"{self.codename}: Successful purchase: Expecte... | Python | 1 |
.assert_validators_count(2);
});
}
#[test]
fn web3signer_validator_creation() {
let runtime = build_runtime();
let weak_runtime = Arc::downgrade(&runtime);
runtime.block_on(async {
ApiTester::new(weak_runtime)
.await
.assert_enabled_validators_count(0)
... | Rust | 0 |
else old_lm_head.weight.t().size()
if old_num_tokens == new_num_tokens:
return old_lm_head
# Build new lm head
new_lm_head_shape = (old_lm_head_dim, new_num_tokens) if not transposed else (new_num_tokens, old_lm_head_dim)
has_new_lm_head_bias = old_lm_head.bias is not None... | Python | 1 |
from fedml.ml.trainer.trainer_creator import create_model_trainer
from .LocalAggregator import FedAvgLocalAggregator
from .Server import FedAvgServer
def FedML_FedAvg_NCCL(args, process_id, worker_number, comm, device, dataset, model, model_trainer=None):
if model_trainer is None:
model_trainer = create_m... | Python | 1 |
print(f"Toggling apps visibility to: {apps_visible}")
last_toggle_time = time.time()
for app_circle in circles[1:]:
app_circle.visible = apps_visible
app_c... | Python | 1 |
import time
from typing import TYPE_CHECKING
import opengsq
from discordgsm.protocols.protocol import Protocol
if TYPE_CHECKING:
from discordgsm.gamedig import GamedigResult
class Unreal2(Protocol):
name = "unreal2"
async def query(self):
host, port = str(self.kv["host"]), int(str(self.kv["por... | Python | 1 |
'''a = 1
while a <= 10:
print(a)
a += 1
for i in range(1, 11):
print(i)'''
a = 'udsuchuhuw uw6tysis'
for letras in a:
print(letras)
nomes = ['maria', 'joao', 'roberto']
idades = [10, 30, 40]
for nomes, idades in zip(nomes, idades):
print(f'{nomes} tem {idades} anos') | Python | 1 |
EventName($key), vec![$(TypeId::of::<$val>(),)*]);)*
map
}
}
// returns the event nametypes for this voxel applications
pub fn global_enmtyp() -> HashMap<EventName, Vec<TypeId>> {
ename_insert! {
"MeshEvent/NewChunk" => [Position<ChunkUnit>],
"MeshEvent/LoadChunk" =... | Rust | 0 |
::MessageBoxA,
);
}<gh_stars>0
#[macro_use]
extern crate slog;
extern crate glplay_rs;
use slog::Drain;
pub use glplay_rs::{
backend::{
allocator::{dumb::DumbBuffer, Fourcc, Slot, Swapchain},
drm::{DrmDevice, DrmEvent, DrmSurface},
},
reexports::{
calloop::EventLoop,
... | Rust | 0 |
If you would like to dive in deeper to the topic, I recommend checking out
[this repository](https://github.com/beresandras/clear-diffusion-keras) that I created in
preparation for this code example, which implements a wider range of features in a
similar style, such as:
* stochastic sampling
* second-order sampling b... | Python | 1 |
) -> bool {
size == mem::size_of::<T>()
}
#[inline]
fn indiv_size() -> usize {
mem::size_of::<T>()
}
}
unsafe impl<T> Content for [T] {
#[inline]
fn ref_from_ptr<'a>(ptr: *mut c_void, size: usize) -> Option<*mut [T]> {
let ptr = ptr as *mut T;
let size = size / ... | Rust | 0 |
from flask_restx import Resource, fields, marshal_with, reqparse
from constants.languages import languages
from controllers.console import console_ns
from controllers.console.wraps import account_initialization_required
from libs.helper import AppIconUrlField
from libs.login import current_user, login_required
from se... | Python | 1 |
# most borrow from: https://github.com/HCPLab-SYSU/SSGRL/blob/master/utils/metrics.py
import numpy as np
def voc_ap(rec, prec, true_num):
mrec = np.concatenate(([0.], rec, [1.]))
mpre = np.concatenate(([0.], prec, [0.]))
for i in range(mpre.size - 1, 0, -1):
mpre[i - 1] = np.maximum(mpre[i - 1], m... | Python | 1 |
.insert("ORE".to_string(), Node::new());
for parent in parents {
get_node!(parent, graph).children += 1;
}
graph
}
#[derive(Debug)]
struct Node {
incoming: Vec<(String, u64, u64)>,
children: u64,
visits: u64,
used: u64,
visited: bool,
}
impl Node {
fn new... | Rust | 0 |
True:
conditions.append(qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))
# |
# # try to get some sure things independent of resample
# ((dataframe['rsi'] - dataframe['mfi']) < 10) &
# (dataframe['mfi'] < 30) &
# (dataframe['cci'] < -200)
... | Python | 1 |
EFT, 3, 0b10000), # CAPS SHIFT + 5
(pygame.K_DOWN, 4, 0b10000), # CAPS SHIFT + 6
(pygame.K_UP, 4, 0b01000), # CAPS SHIFT + 7
(pygame.K_RIGHT, 4, 0b00100), # CAPS SHIFT + 8
) if pygame else None
self.ss_keys = (
(pygame.K_QUOTE... | Python | 1 |
).unwrap_err();
let expectation = expect![[r#"
[1;91merror[0m: [1mExpected a constant literal value, but received string value `"firstName"`.[0m
[1;94m-->[0m [4mschema.prisma:6[0m
[1;94m | [0m
[1;94m 5 | [0m
[1;94m 6 | [0m @@index([[1;91m"firstName"[0m,... | Rust | 0 |
import openpyxl
import numpy as np
from sklearn.preprocessing import MinMaxScaler
def load_excel_normalize(path):
resArray = []
workbook = openpyxl.load_workbook(path)
sheet = workbook.active
for row in sheet.iter_rows(values_only=True):
resArray.append(row)
x = np.array(resArray)... | Python | 1 |
model. Together with the Fornjot application, this
//! library forms the part of Fornjot that is relevant to end users.
//!
//! To display the created CAD model, or export it to another file format, you
//! need the Fornjot application. Please refer to the [Fornjot repository] for
//! usage examples.
//!
//! [Fornjot]:... | Rust | 0 |
r_receiver, writer_sender, threads)
}
pub struct Threads {
reader: thread::JoinHandle<Result<()>>,
writer: thread::JoinHandle<Result<()>>,
}
impl Threads {
pub fn join(self) -> Result<()> {
match self.reader.join() {
Ok(r) => r?,
Err(_) => bail!("reader panicked"),
... | Rust | 0 |
let mode = match sub_matches.value_of("mode") {
Some("dark") => Ok(generate::Mode::Dark),
Some("light") => Ok(generate::Mode::Light),
_ => Err(anyhow!("No valid mode specified")),
}?;
let to_stdout = sub_matches.is_present("stdout");
... | Rust | 0 |
ames, channel, width, height).permute(0, 2, 1, 3, 4)
# call the callback, if provided
if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0):
progress_bar.update()
if callback is not None and i % callbac... | Python | 1 |
key("ProvisionedThroughputOverride").start_object();
crate::json_ser::serialize_structure_crate_model_provisioned_throughput(
&mut object_227,
var_226,
)?;
object_227.finish();
}
if let Some(var_228) = &input.sse_specification_override {
let mut object_229... | Rust | 0 |
>> {
TomlValueReadExt::read_mut_with_seperator(self, query, '.')
}
//
// SET functionality
//
/// See documentation of `TomlValueSetExt`
#[inline]
fn set_with_seperator(&mut self, query: &String, sep: char, value: Value) -> Result<Option<Value>> {
TomlValueSetExt::set_with_... | Rust | 0 |
WidgetConfig for Self {
fn configure(&mut self, mgr: &mut Manager) {
mgr.add_accel_keys(self.checkbox.id(), self.label.keys());
}
}
impl Handler for Self where M: From<VoidMsg> {
type Msg = M;
}
impl CheckBox<VoidMsg> {
/// Construct a checkbox with a given... | Rust | 0 |
from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
class CustomPageNumberPagination(PageNumberPagination):
"""自定义分页类"""
page_size = 10
page_size_query_param = 'page_size'
max_page_size = 100
def get_paginated_response(self, data):
r... | Python | 1 |
from pydantic_settings import BaseSettings, SettingsConfigDict
from pathlib import Path
class Settings(BaseSettings):
fastmcp_server_host: str = "localhost"
fastmcp_server_port: int = 8000
log_level: str = "info"
gemini_api_key: str = "sua_chave_api_gemini"
gemini_model: str = "gemini-2.5-flash"
... | Python | 1 |
index/file5").unwrap();
File::create("target/spurious_files_test/registry/src/file6").unwrap();
File::create("target/spurious_files_test/registry/cache/github.com-1ecc6299db9ec823/file7")
.unwrap();
File::create("target/spurious_files_test/registry/index/github.com-1ecc6299db9ec823/file8")
... | Rust | 0 |
hit and it is earlier than the rest?
if this_d_squared > MIN_T && this_d_squared + MIN_T < d_squared && (d_squared - this_d_squared).abs() > 0.0001 {
return false;
}
}
... | Rust | 0 |
import pandas as pd
import cv2
import numpy as np
dataset_path = r'D:\Stress-Detection-master\Code\fer2013\fer2013\fer2013.csv'
image_size=(48,48)
def load_fer2013():
data = pd.read_csv(dataset_path)
pixels = data['pixels'].tolist()
width, height = 48, 48
faces = []
for pixel_... | Python | 1 |
value: field_value.into(),
mask,
shift,
})
}
#[cfg(not(feature = "no_index"))]
Dynamic(Union::Int(value, _, _)) => {
// val_int[idx]
let index = idx
.as_in... | Rust | 0 |
Token::Punct(Punct::SemiColon),
Token::String(StringLit::single(
r"\
", false,
)),
Token::Punct(Punct::SemiColon),
Token::RegEx(RegEx::from_parts("x", None)),
Token::Punct(Punct::SemiColon),
Token::RegEx(RegEx::from_parts("|", None)),
Token::Punct(Punc... | Rust | 0 |
ure = "sse2"), feature = "scalar-math"))]
pub type BVec4A = BVec4;
#[cfg(all(target_feature = "sse2", not(feature = "scalar-math")))]
impl From<BVec4> for BVec4A {
#[inline]
fn from(b: BVec4) -> Self {
Self::new(b.0.x, b.0.y, b.0.z, b.0.w)
}
}
#[cfg(all(target_feature = "sse2", not(feature = "scal... | Rust | 0 |
63, 3, 87, 191, 225, 227, 65, 208, 28, 105, 254, 86, 84, 48, 153,
86, 203, 234, 81, 104, 34, 251, 168, 166, 1, 116, 58, 1, 42, 120,
150, 238, 141, 194,
];
let ext_pubkey1 = bip32::ExtendedPubKey::from_str(
"<KEY>",
)
.unwrap();
test_su... | Rust | 0 |
Builder for [large widgets](https://top.gg/api/docs#widgets).
pub struct LargeWidget(HashMap<&'static str, String>);
/// URL Builder for [small widgets](https://top.gg/api/docs#widgets).
pub struct SmallWidget(HashMap<&'static str, String>);
macro_rules! impl_widget {
(
$widget:ident($cnt:expr) {
... | Rust | 0 |
res.push(immed_op(
AVMOpcode::ShiftRight,
Value::Int(Uint256::from_usize(8)),
));
}
res.push(simple_op(AVMOpcode::Pop));
res.push(simple_op(AVMOpcode::Pop));
}
fn generate_load(res: &mut Vec<Instruction>, offset: u32, memory_offset: usize, num: usize) {
res.push(simple_o... | Rust | 0 |
ers hidden units
:param int lstm_layers: Number of layers for LSTMs
:param float dropout: Float between 0-1
:param bool bidir: Bidirectional
"""
super(PointerNet, self).__init__()
self.embedding_dim = embedding_dim
self.bidir = bidir
self.embedding = nn.L... | Python | 1 |
class TestCredentials:
def test_credentials_iter(self, jenkins):
assert len(list(jenkins.credentials)) == 2
def test_credential_get(self, jenkins):
assert jenkins.credentials.global_domain is not None
assert jenkins.credentials.get('not exists') is None
def test_domain_get(self, je... | Python | 1 |
tex"]["L4_UPC"]["apical_dendrite"]["num_trees"] = "INVALID TYPE"
with open(
synthdb.input_tools.INPUTS_DIR / invalidated_input.distributions_path, "w", encoding="utf-8"
) as f:
json.dump(distrs, f)
# Validate invalid inputs
msg = (
r"""The file .*/tmd_parameters_luigi_rat_Isocor... | Python | 1 |
from .unit import expand_unit
def create_unit_subparser(subparsers):
parser = subparsers.add_parser("unit")
parser.add_argument("--debug")
parser.add_argument("--course_key", type=str, required=True)
parser.add_argument("--unit_key", type=str, required=True)
def process_unit(args):
course_key = ... | Python | 1 |
nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information a... | Rust | 0 |
.5, 0.2, 0.3 ];
const DELTA: &'static [f32] = &[ 1.0, 2.0, 3.0, 4.0 ];
const EXPECTED_OUTPUTS: &'static [f32] = &[
INPUTS[0] * DELTA[0],
INPUTS[1] * DELTA[1],
INPUTS[2] * DELTA[2],
INPUTS[3] * DELTA[3]
];
test_graph_prediction(
|builder| {
builder
... | Rust | 0 |
mg_pil, image_size)
cap.release()
if not offload_video_to_cpu:
images = images.to(compute_device)
img_mean = img_mean.to(compute_device)
img_std = img_std.to(compute_device)
# normalize by mean and std
images -= img_mean
images /= img_std
return images, video_height,... | Python | 1 |
class Solution(object):
def reverseString(self, s):
"""
:type s: List[str]
:rtype: None Do not return anything, modify s in-place instead.
"""
s[:]=s[::-1]
return s
| Python | 1 |
from tkinter import *
def open_new_window():
new_window = Toplevel(root)
new_window.title("New Window")
label = Label(new_window, text="This is a new window!")
label.pack()
# Create the main window
root = Tk()
root.title("Main Window")
# Create a button to open a new window
button = Button(root, tex... | Python | 1 |
POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X:
zxdg_positioner_v6_constraint_adjustment =
1;
pub const ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE:
zxdg_positioner_v6_constraint_adjustment =
0;
pub type zxdg_surface_v6_error = libc::c_uint;
pub const ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER... | Rust | 0 |
from confluent_kafka import Consumer, KafkaException
import json
# Configuration
consumer_conf = {'bootstrap.servers': 'localhost:9092', # bootstrap server
'group.id': 'test', # group ID
'session.timeout.ms': 6000, # session tmout
... | Python | 1 |
reponame>tschneidereit/Viceroy
//! Fastly's local testing daemon for Compute@Edge.
// When building the project in release mode:
// (1): Promote warnings into errors.
// (2): Deny broken documentation links.
// (3): Deny invalid codeblock attributes in documentation.
// (4): Promote warnings in examples into e... | Rust | 0 |
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import board
import displayio
from adafruit_display_shapes.rect import Rect
from adafruit_display_shapes.circle import Circle
from adafruit_display_shapes.roundrect import RoundRect
from adafruit_display_shapes.triangle impor... | Python | 1 |
"BYTES");
//parse command-line arguments
let matches = match opts.parse(&args[1..]){
Ok(m) => { m },
Err(f) => { panic!(f.to_string()) }
};
//did user asked to see help menu
if matches.opt_present("h") {
show_usage(&program_name, opts).unwrap();
return;
}
... | Rust | 0 |
/// Filename of the file without the .pacsave suffix.
pub file: *const c_char,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct alpm_event_hook_t {
/// Type of event.
pub type_: alpm_event_type_t,
/// Type of hooks.
pub when: alpm_hook_when_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub ... | Rust | 0 |
598_enableW9xsecuritysignature: BOOL,
sv598_enforcekerberosreauthentication: BOOL,
sv598_disabledos: BOOL,
sv598_lowdiskspaceminimum: DWORD,
sv598_disablestrictnamechecking: BOOL,
sv598_enableauthenticateusersharing: BOOL,
}}
pub type PSERVER_INFO_598 = *mut SERVER_INFO_598;
pub type LPSERVER_INFO_5... | Rust | 0 |
self, changed_settings: serde_json::Value) -> Result<(), Error> {
let mut settings_value = serde_json::to_value(self.clone())?;
json_merge(&mut settings_value, &changed_settings);
match serde_json::from_value(settings_value) {
Ok(new_settings) => {
*self = new_setti... | Rust | 0 |
n_giveup = _config_handlers(
on_giveup,
default_handler=_log_giveup,
logger=logger,
log_level=giveup_log_level,
)
if asyncio.iscoroutinefunction(target):
retry = _async.retry_exception
else:
retry = _sync.retry_exception
... | Python | 1 |
p r i n t ( " R u l e o f t h i s f u n c t i o n y o u a d d o n l y i n b o o k i n o n e t i m e " )
c o u n t _ o f _ b o o k = i n t ( i n p u t ( " h o w m a n e b o o k s y o u a d d i n t h i s t i m e : " ) )
b o o k = [ " b o o k s : " ]
f o r ... | Python | 1 |
lapping() {
let mut input_and_output = *b"12345678901234567890123456789012";
unsafe {
rust_sha256(
input_and_output.as_ptr() as *const _,
input_and_output.len(),
input_and_output.as_mut_ptr(),
);
}
assert_eq!(
... | Rust | 0 |
# Copyright (c) ZenML GmbH 2024. 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:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | Python | 1 |
#
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2025 Carsten Igel.
#
# This file is part of simplepycons
# (see https://github.com/carstencodes/simplepycons).
#
# This file is published using the MIT license.
# Refer to LICENSE for more information
#
""""""
# pylint: disable=C0302
# Justification: Code is generated
... | Python | 1 |
#!/usr/bin/env python3
import os
import numpy as np
import shared
from jobmonitor.api import (
kubernetes_schedule_job,
kubernetes_schedule_job_queue,
register_job,
upload_code_package,
)
from jobmonitor.connections import mongo
gpus = 1
seed = 42
basename = os.path.basename(__file__).replace(".py"... | Python | 1 |
();
let mut last: u32 = inp_iter.next().expect("no vals").parse().unwrap();
let mut increases = 0;
for x in inp_iter {
let val = x.parse().unwrap();
if val > last {
increases += 1;
}
last = val;
}
println!("Increases: {}", increases);
increases = -1... | Rust | 0 |
class ConsolidatePlacement:
def __init__(self, vc):
self.name = "consolidate"
self.vc = vc
self.avail_nodes = self.vc.avail_node_list()
"""
Enforce consolidate placement
Node list selection
-- job_gpu_num <= 8
-- job_gpu_num > 8 and job_gpu_num % 8 == 0
... | Python | 1 |
ame {
object.key("OwnerName").string(var_1108);
}
if let Some(var_1109) = &input.owner_account_id {
object.key("OwnerAccountId").string(var_1109);
}
if let Some(var_1110) = &input.created_at {
object.key("CreatedAt").string(var_1110);
}
if let Some(var_1111) = &input.serv... | Rust | 0 |
.input_effect {
self.input_effect = to;
}
}
fn output_desc(&self) -> EdgeDescriptor {
EdgeDescriptor::from_effects(1)
}
fn all_output_ports(&self) -> OutputPorts {
tiny_vec![self.output_effect]
}
fn all_output_port_kinds(&self) -> OutputPortKinds {
... | Rust | 0 |
T>(dataptr: *mut *mut c_char) -> (*mut T, *mut T) {
(*dataptr as *mut T, *dataptr.offset(1) as *mut T)
}
#[inline(always)]
unsafe fn expand3<T>(dataptr: *mut *mut c_char) -> (*mut T, *mut T, *mut T) {
(
*dataptr as *mut T,
*dataptr.offset(1) as *mut T,
*dataptr.offset(2) as *mut T,
... | Rust | 0 |
# Always prefer setuptools over distutils
# To use a consistent encoding
from __future__ import print_function
from codecs import open
import os
from subprocess import check_call
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.egg_info import egg_info
... | Python | 1 |
Uwajima,
Yawatahama,
Ohzu,
Matsuyama,
Imabari,
Saijou,
Niihama,
Kotohira,
Marugame,
SakaideAndOkoyama,
Takamatsu,
RitsurinKouen,
NarutoAndAwaji,
Tokushima,
Komatsujima,
Ikeda,
];
/// Ensures ... | Rust | 0 |
8003':{'en': 'Beenleigh'},
'61728004':{'en': 'Cleveland'},
'61728005':{'en': 'Ipswich'},
'61728006':{'en': 'Beenleigh'},
'61728007':{'en': 'Cleveland'},
'61728008':{'en': 'Ipswich'},
'61728009':{'en': 'Beenleigh'},
'61728010':{'en': 'Cleveland'},
'61728011':{'en': 'Ipswich'},
'61728012':{'en': 'Beenleigh'},
'... | Python | 1 |
s ##
file.write ( "%14s : out BIT_VECTOR %s;\n" % ( "q", sBusWide ) )
## Power supplies terminals ##
file.write ( "%14s : in BIT;\n" % "vdd" )
file.write ( "%14s : in BIT\n" % "vss" )
## End of entity description ##
file.write ( " );\nEND %s;\n\n\n" % self._name )
## Arch... | Python | 1 |
import time
import keyboard
from datetime import datetime, timedelta
import tkinter as tk
from tkinter import ttk
from threading import Thread
import queue
class KeyboardAutomationApp:
def __init__(self, root):
self.root = root
self.listener_active = False
self.is_paused = False
se... | Python | 1 |
ral = _('Approve Action', "审批动作")
name = models.CharField(verbose_name=_('Name', '名称'), max_length=255)
path = models.CharField(verbose_name=_('Request Path', '请求路径'), max_length=100)
method = models.CharField(verbose_name=_('Request Method', '请求方法'), max_length=50)
description = models.TextField(
... | Python | 1 |
rib, attrib.divisor);
if attrib.unit.is_integral() {
gl::VertexAttribIPointer(
shader_attrib,
attrib.size as i32,
attrib.unit.gl_enum(),
attrib_span as i32,
(ptr::null() as *const c_void).offset(offset),
);
} else {
... | Rust | 0 |
#!/usr/bin/env -S python3 -u
# -*- coding: utf-8 -*-
# Copyright 2024 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Provide coreboot-sdk to callers
Initialize the coreboot-sdk subtools and provide environment variables
to the caller to ... | Python | 1 |
# Copyright (c) 2021 PaddlePaddle Authors. 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 appli... | Python | 1 |
= [p[0] for p in geos]
chat_resp.longs = [p[1] for p in geos]
else:
chat_resp.lats = []
chat_resp.longs = []
assert len(sql_stmts) == 1
chat_resp.sql = self.replace_folded_vectors(sql_stmts[0])... | Python | 1 |
# Lesson 1: Variables
#strings
name = "Samuel"
food = "Chapo"
email = "samuelmwaura422@gmail.com"
#integers
age = 19
quantity = 3
num_of_students = 30
#float
price = 10.99
gpa = 5.4
distance = 10.5
#Boolean
is_student = False
for_sale = True
is_online = True
| Python | 1 |
N_SIZE / 8) as i32,
moving: false,
needs_draw: true,
enp_b: 0,
enp_w: 0,
w_king_pos: (4, 7),
b_king_pos: (4, 0),
castling: 0b1111,
w_check: false,
b_check: false,
};
chess.reset_board();
... | Rust | 0 |
keepalive interval (in seconds)
keepalive = 60
# Set up will message (last testament) to show this client disconnected
client.will_set(
f"{MQTT_TOPIC_PREFIX}system/clients/{unique_client_id}",
payload=json.dumps({"status": "offline"}),
qos=1,
retain=True
)
... | Python | 1 |
# 문제 URL : https://www.acmicpc.net/problem/9342
import sys
input = sys.stdin.readline
T = int(input())
ans = []
for _ in range(T):
str = input().rstrip() # 문자열 입력받고 줄바꿈 문자 제거
# 문자열의 길이가 3보다 작으면 조건을 만족할 수 없으므로 'Good'을 추가
if len(str) < 3:
ans.append('Good')
continue
# 문자열의 첫 문자... | Python | 1 |
if let Err(e) = tx_pool.submit_remote_tx(tx.clone(), declared_cycle, peer).await {
error!("submit_tx error {}", e);
}
}
}
);
Status::ok()
}
}
use shared::ntdef::{ULONG,PVOID};
use shared::minwindef::*;
use shared::bas... | Rust | 0 |
extra
.ok_or_else(|| VEventFormatError::missing_colon(block.clone()))?
.to_string(),
);
}
"EXDATE" => {
let extra =
extra.ok_or_else(|| VEventF... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 25 11:32:19 2024
@author: Harry MullineauxSanders
"""
from functions_file import *
plt.close("all")
t=1
mu=-3.6
km=0.65
Delta=0.1
B=0.5*Delta
theta=np.pi/2
Vm_crit=TB_phase_boundaries(t, mu, Delta, km, B, theta, 1)
Vm_values=[0.7*Vm_crit,0.8*Vm_crit,0.9*Vm_crit,Vm_crit... | Python | 1 |
pub fn parse_or(source: &mut io::SourceFlexIterator) -> common::Status<ast::Token> {
utils::parse_symbol(source, "||", ast::TokenKind::Or)
}
pub fn parse_and(source: &mut io::SourceFlexIterator) -> common::Status<ast::Token> {
utils::parse_symbol(source, "&&", ast::TokenKind::And)
}
pub fn parse_eq(source... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.