text string | label_name string | labels int64 |
|---|---|---|
import heapq
def restricted_sorting(stacks, costs):
# Create a dictionary to store the blocks and their counts
blocks_counts = {}
for i, stack in enumerate(stacks):
for block in stack:
if block not in blocks_counts:
blocks_counts[block] = [0]*8
blocks_counts... | Python | 1 |
import torch
import torch.nn as nn
import os
from torchvision.utils import save_image
import imageio
from model import DiffusionModel
import glob
# Set device
device = (
"mps" if torch.backends.mps.is_available() else
"cuda" if torch.cuda.is_available() else "cpu"
)
print(f"Using device: {device}")
def find_l... | Python | 1 |
# <<<< Exercice 2 : >>>>
# Créer un fichier :
f = open("C:\\Users\\aa\\Desktop\\myfile.txt","x",encoding="utf8")
f.close()
f = open("C:\\Users\\aa\\Desktop\\myfile.txt","w",encoding="utf8")
f.writelines(['Ligne numéro 1\n','Ligne numéro 2\n','Ligne numéro 3\n','Ligne numéro 4\n','Ligne n... | Python | 1 |
# run from chemnlp
# tasks with n_shot recorded in open_llm_leaderboard and gpt-4 technical report
import json
import subprocess
from lm_eval import config
EVAL_SCRIPT = "experiments/scripts/run_eval.sh"
CONDA_ENV = "beth"
CHEMNLP_FOLDER = "beth"
DEFAULT_EVAL_CONFIG = (
f"/fsx/proj-chemnlp/{CHEMNLP_FOLDER}"
"... | Python | 1 |
else:
# 全部失败
# 使用webhook专用task_polling_manager
from utils.task_polling import webhook_task_polling_manager
await webhook_task_polling_manager.send_callback_notification('import', media_info, 'failed', f"所有集数导入失败", task_ids=task_ids_pa... | Python | 1 |
s(packed_files);
// And return success.
Ok((packed_files_to_remove, tree_path))
}
use std::{fs, thread};
use std::fs::File;
use std::io::Write;
use eframe::egui::{Button, CentralPanel, Color32, CtxRef, RichText, ScrollArea, Visuals};
use eframe::egui::Label;
use eframe::epi::Frame;
use reqwest::StatusCode;
u... | Rust | 0 |
nodes[len - 1] = Node::Atom(prev.to_owned() + cur);
return;
}
}
}
}
nodes.push(node);
}
/*
examples:
node!(my_atom)
node!((atom1 atom2 atom-3))
node!((atom1 (10 20 30) atom-3))
let x = node!((10 20 30));
node!((atom1 [x] atom-3))
There's s... | Rust | 0 |
# Copyright 2020 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | Python | 1 |
e,
DoNotIncrease = b'E' as isize,
DoNotReduce = b'F' as isize,
AllOrNone = b'G' as isize,
InstitutionsOnly = b'I' as isize,
LastPeg = b'L' as isize,
MidPricePeg = b'M' as isize,
NonNegotiable = b'N' as isize,
OpeningPeg = b'O' as isize,
MarketPeg = b'P' as isize,
PrimaryPeg = b'R... | Rust | 0 |
a pre-order traversal algorithm. It includes `branch_id` as well.
pub fn traverse_downwards_branches(&'a self, branch_id: &'a TreeId) -> DownwardsBranchesIter {
DownwardsBranchesIter {
tree: &self.tree,
iter: self.traverse_downwards_branches_ids(&branch_id),
}
}
///... | Rust | 0 |
SegmentCount => "The segment count in the character mapping is invalid",
OddSegsX2 => "The doubled segment count in the character mapping is not an even number",
CmapMissingGuard => "The character mapping is missing a guard value",
NoCmap => "No character mapping found",
UnknownTableVersion => "The font uses a ... | Rust | 0 |
(u8),
/// Security is enabled on the frame, and `try_read` is called. [`Frame::try_read_and_unsecure`] should be called instead.
SecurityEnabled,
/// The frame's address mode is invalid
InvalidAddressMode(u8),
/// The frame's version is invalid or not supported
InvalidFrameVersion(u8),
/... | Rust | 0 |
([iii for iii in v if iii==0])
c_1 = len([iii for iii in v if iii==1])
c_2 = len([iii for iii in v if iii==2])
assert c_0 + c_1 + c_2 == 17, err_str
for sk in sks:
if USE_VISIBILITY_FOR_PLOTS and v[sk[0]] * v[sk[1]] == 0:
#... | Python | 1 |
a
/// good place to start. To me, `Or` effectively feels like "using these
/// keywords, find a record I might want" which works well if there aren't
/// too many records. It's also worth noting that this conjuction uses more
/// CPU resources because the results must be tallied and sorted in order of
... | Rust | 0 |
import socket
import time
import subprocess
import platform
import re
import sys
import random
def get_rssi():
"""Get the Wi-Fi RSSI from Windows using netsh"""
try:
print("[DEBUG] Running Windows netsh command")
output = subprocess.check_output("netsh wlan show interfaces", shell=True).decode(... | Python | 1 |
Attr2: BaseAttribute,
Next: HasConstraint<Attr2, STAG2, RTAG2> {}
/// Prove ConstraintChain<_, _, _, HasEntity<ETAG>> => HasEntity<ETAG>
impl<
Next,
Attr,
const STAG: EntityTag,
const RTAG: EntityTag,
const ETAG: EntityTag
> HasEntity<ETAG> for ConstraintChain<STAG, RTAG, Attr, Next>
wh... | Rust | 0 |
= model.to(device)
criterion = nn.CrossEntropyLoss()
optimizer = optim.Adam(model.parameters(), lr=0.0001)
scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=10, gamma=0.1)
# optimizer = optim.Adam(model.parameters(), lr=0.000001)
for epoch in range(30): # loop over the dataset multi... | Python | 1 |
import numpy as np
from gym import utils
from gym.envs.mujoco import mujoco_env
class StrikerEnv(mujoco_env.MujocoEnv, utils.EzPickle):
def __init__(self):
utils.EzPickle.__init__(self)
self._striked = False
self._min_strike_dist = np.inf
self.strike_threshold = 0.1
mujoco_... | Python | 1 |
de la época
pass
losses.append(loss.item())
probs_all.append(probs.cpu())
ys_all.append(ys.cpu())
probs_all = torch.cat(probs_all).numpy()
ys_all = torch.cat(ys_all).numpy()
mean_loss = float(sum(losses) / max(len(losses), 1))
ret... | Python | 1 |
destuff, finalstuff, initstuff)
object = MyObjectDefinition(OBJECTNAME, OBJECTPREFIX, OBJECTTYPE)
module.addobject(object)
ThemeDrawingState = OpaqueByValueType("ThemeDrawingState", "ThemeDrawingStateObj")
Method = WeakLinkMethodGenerator
# Create the generator classes used to populate the lists
Function = OSErrWeak... | Python | 1 |
#
# This is the Robotics Language compiler
#
# Manifesto.py: Definition of the parameters for this package
#
# Created on: 11 July, 2018
# Author: Gabriel A. D. Lopes
# Licence: Apache 2.0
# Copyright: 2014-2017 Robot Care Systems BV, The Hague, The Netherlands. All rights reserved.
#
# Licensed u... | Python | 1 |
S_WP7),
14 => ::std::option::Option::Some(Os::OS_ONKYO),
15 => ::std::option::Option::Some(Os::OS_PHILIPS),
16 => ::std::option::Option::Some(Os::OS_WD),
17 => ::std::option::Option::Some(Os::OS_VOLVO),
18 => ::std::option::Option::Some(Os::OS_TIVO),
... | Rust | 0 |
- inlining the condition
/// - producing all offsprings at once by counting first and delaying struct creation
/// - not relying on vector's own resizing for capacity increase
///
/// Turns out, this is actually _slower_ than advance1! Try `cargo bench` to see the results.
pub fn advance2(mut lanternfish: Vec<Lanternf... | Rust | 0 |
imilarities[0]}")
print(f" Range: {similarities[0].min():.3f} to {similarities[0].max():.3f}")
if all(s < 0.01 for s in similarities[0]):
print("❌ All similarities near 0 - no semantic match found!")
return True
else:
print("✅ Found semantic matches... | Python | 1 |
if::{HumanDuration, ProgressBar};
use scene::Scene;
mod bvh;
pub mod camera;
pub mod material;
mod ray;
pub mod scene;
pub mod shapes;
pub mod utils;
/// Configuration of the output image
///
/// output_path must be a valid path with the name of the file to create. The extension of the file should be either png or jp... | Rust | 0 |
M_XCHG_GPRv_OrAX = 6003,
XED_IFORM_XCHG_MEMb_GPR8 = 6004,
XED_IFORM_XCHG_MEMv_GPRv = 6005,
XED_IFORM_XEND = 6006,
XED_IFORM_XGETBV = 6007,
XED_IFORM_XLAT = 6008,
XED_IFORM_XOR_AL_IMMb = 6009,
XED_IFORM_XOR_GPR8_GPR8_30 = 6010,
XED_IFORM_XOR_GPR8_GPR8_32 = 6011,
XED_IFORM_XOR_GPR8_IMM... | Rust | 0 |
print("\n" + "="*80)
# Institutional Trade Execution Log
print("\n--- INSTITUTIONAL EXECUTION LOG ---")
print("Ticker Quarter Count Quantile Return% Pos Mult Max Fav% Max Adv%")
print("-" * 80)
for _, trade in trades_df.iterrows():
run_count = trade.get('final_running_count'... | Python | 1 |
u7684\u8bf7\u6c42\u94fe\u63a5',
verbose_name='\u9009\u9879',
),
),
('related_fields', jsonfield.fields.JSONField(default=[], verbose_name='\u7ea7\u8054\u5b57\u6bb5')),
(
'state_id',
models... | Python | 1 |
// if g = 1
// pub_key = (1 ^ p_key) % p = 1
// Oscars cracks the key.
let cracked_key = crate::sha1::sha1(&[1], None, None, None, None, None, None);
// Oscars decrypts the msg from alice.
let alice_msg_to_bob = crate::aes_cbc::decrypt_aes_128_cbc(
&alice_request[..alice_request.len(... | Rust | 0 |
# The file is adapted from the Flax library (https://github.com/google/flax).
# The credit should go to the Flax authors.
#
# Copyright 2024 The Flax Authors & 2024 BrainX Ecosystem.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | Python | 1 |
(EXPECTED_ROW_LEN);
for chunk in path {
let chunk_str = std::str::from_utf8(&chunk[..]).unwrap();
if response.len() > 1 {
response.push(',');
}
response.push_str(chunk_str);
}
response
}
/// Calculate the distribution of remaining secret words count for
/// all c... | Rust | 0 |
.matahari.com/customer/account/create/","accept-encoding":"gzip, deflate, br","accept-language":"id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7"},data=json.dumps({"otp_request":{"mobile_number":nomor,"mobile_country_code":"+62"}})).text
tod = requests.post("https://api.tokko.io/graphql",headers={"Host":"api.tokko.io","content... | Python | 1 |
sion_state.get('capacity_config'):
absence_types = st.session_state.capacity_config.get('absence_types', {})
# Get original weekly data to extract individual absence values
if st.session_state.get('weekly_source_df') is not None:
weekly_df = st.session_state.weekly_source_df... | Python | 1 |
as u16;
let n_tasks = min(profile.input_rows, rest_len as u64);
let mut tail = iter::repeat(profile.task_id)
.take(n_tasks as usize)
.collect::<Vec<_>>();
series.append(&mut tail);
}
}
series
}
}
im... | Rust | 0 |
# Copyright (c) 2025 Samsung Electronics Co. LTD
# 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.
from executorch.exir.dialects._ops import ops as exir_ops
from executorch.exir.pass_base import ExportPass, PassResu... | Python | 1 |
"""Test the GUI components module"""
from tkinter import Canvas, Tk
import os
import pytest
from dronevis.ui.gui_components import CircularProgressbar, MainButton, DataFrame
from dronevis.config.gui import BUTTON_COLOR, WHITE_COLOR, FONT_COLOR
@pytest.fixture
def canvas(mocker):
"""Fixture for creating a canvas... | Python | 1 |
s[tuple_index][0]:
score = max(score, list_max_difference(artists[list_index], artists[tuple_index][0]) * 0.6)
return max(score * 100, 0)
TITLE_TAG_PATTERN = re.compile(
r"|".join( # noqa: FLY002
[
r"[-<(\[~]([~\]^)>-]*)[~\]^)>-]",
r"(\w+ ?(?:(?:solo |size )?ver(?... | Python | 1 |
errors += 1
print ("Error Invalid data size. Expected ", size3, " and got ", size)
else:
print ("Found size ", size, " for server 3 after update")
# Make sure the size is not 0
if ( size == 0 or size1 == 0 or size1 == 0 or size1 == 0):
errors += 1
print ("Error Invalid data size. None of them should be... | Python | 1 |
/ckb-zkp
pub mod multieq;
pub mod rangeproof;
pub struct FrequencySweep {
pub frequency: u16,
period: i8,
period_load: u8,
period_counter: u8,
negate: u8,
shift: u8,
enabled: bool,
}
pub enum FrequencySweepResult {
None,
Overflowed,
Sweeped(u16),
}
impl FrequencySweep {
pub... | Rust | 0 |
AC0LOCKED_R {
DAC0LOCKED_R::new(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 8 - Indicates If IDAC0 Powered Down During EM23"]
#[inline(always)]
pub fn idac0locked(&self) -> IDAC0LOCKED_R {
IDAC0LOCKED_R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bit 9 - Indicates If ADC0 ... | Rust | 0 |
# mongodb_excel/urls.py
from django.urls import path
from . import views
urlpatterns = [
path('download_skillgap_excel/', views.download_skillgap_excel, name='download_skillgap_excel'),
path('download_youthaspiration_excel/', views.download_youthaspiration_excel, name='download_youthaspiration_excel'),
]
| Python | 1 |
efault=(-1),
help="Set Data [default=%(default)r]")
parser.add_argument(
"--fixed", dest="fixed", type=intx, default=1234567890,
help="Set Fixed code [default=%(default)r]")
parser.add_argument(
"-f", "--freq", dest="freq", type=intx, default=315000000,
help="Set Frequenc... | Python | 1 |
./tests/testcase/p1.4ml");
// let dag = engine.env.get_domain_by_name("DAGs");
// println!("domain DAGs is {:?}", dag);
// let iso_dag = engine.env.get_domain_by_name("IsoDAGs");
// println!("domain IsoDAGs is {:#?}", iso_dag);
// let little_cycle = engine.env.get_model_by_name("LittleCycle").unw... | Rust | 0 |
"""Utilities"""
import os
import sys
import hashlib
import requests
from .constants import BUFFER_SIZE
def readable_size(num, suffix='B'):
""" Convert bytes to readable values """
for unit in ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi']:
if abs(num) < 1024.0:
return "%3.1f %s%s" % (num, ... | Python | 1 |
#!/usr/bin/env python3
"""
Mac Task Manager - A simple task manager for macOS
Similar to the Task Manager on Windows, but for Mac
This application allows you to:
- View all running processes
- Kill processes
- Block processes (requires sudo privileges)
"""
import os
import sys
import subprocess
from src.main import T... | Python | 1 |
oken_ids, _ in output_token_logprobs], strict=True
)
else:
token_ids = output["output_ids"]
log_probs = None
return TokenOutput(token_ids=token_ids, log_probs=log_probs)
_rollout_worker_actor_cls = ray.remote(ServerAdapter)
class SGLangReplica(RolloutReplica):
... | Python | 1 |
r velocity
angle_difference = angle_to_leader - follower_pose.theta
if angle_difference > math.pi:
angle_difference -= 2 * math.pi
elif angle_difference < -math.pi:
angle_difference += 2 * math.pi
twi... | Python | 1 |
partition_key(stream_slice.partition)].get_request_headers(
stream_state=stream_state, stream_slice=stream_slice.cursor_slice, next_page_token=next_page_token
)
def get_request_body_data(
self,
*,
stream_state: Optional[StreamState] = None,
stream_slice: Optional... | Python | 1 |
import torch
import torch.nn as nn
from torch.nn import init
import torchvision
from torch.optim import lr_scheduler
import torch.nn.functional as F
def get_scheduler(optimizer, opt):
if opt.lr_policy == 'lambda':
lambda_rule = lambda epoch: opt.lr_gamma ** ((epoch+1) // opt.lr_decay_epochs)
schedu... | Python | 1 |
(play_btn)
controls_layout.addWidget(pause_btn)
#controls_layout.addWidget(stop_btn)
controls_layout.addWidget(default_player_btn)
layout.addLayout(controls_layout)
play_btn.clicked.connect(player.play)
pause_btn.clicked.connect(player.pause)
... | Python | 1 |
Normal operation."]
_0,
#[doc = "Use the state of SY_VCO_AUTOTUNE_EN_OVRD to override the signal \"sy_vco_autotune_en\"."]
_1,
}
impl SY_VCO_AUTOTUNE_EN_OVRD_ENW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> bool {
match *self {
SY_VCO_AUTOTUNE_... | Rust | 0 |
import torch
import beignet.polynomials
def test_multiply_legendre_polynomial_by_x(float64):
torch.testing.assert_close(
beignet.polynomials.trim_legendre_polynomial_coefficients(
beignet.polynomials.multiply_legendre_polynomial_by_x(
torch.tensor([0.0]),
),
... | Python | 1 |
ueByIndex, 0x3),
Expr.Return,
),
(0x00000000, 'loc_A09'),
(0x00000002, 'loc_A1B'),
(0x00000001, 'loc_A2B'),
(-1, 'loc_A2E'),
)
def _loc_A09(): pass
label('loc_A09')
SetScenaFlags(ScenaFlag(0x02A4, 7, 0x1527))
OP_6F(0x000F, 60)
Sleep(500)
... | Python | 1 |
() {
use crossterm::style::Colorize;
let mut prompt = Prompt::from("My prompt".green());
assert_eq!(
prompt.prompt.take().unwrap().len(),
format!("{}", "My prompt".green()).len()
);
}
#[test]
fn last_hook_is_used() {
use super::{
... | Rust | 0 |
= 131072;
pub const AOM_EFLAG_NO_REF_LAST3: u32 = 262144;
pub const AOM_EFLAG_NO_REF_GF: u32 = 524288;
pub const AOM_EFLAG_NO_REF_ARF: u32 = 1048576;
pub const AOM_EFLAG_NO_REF_BWD: u32 = 2097152;
pub const AOM_EFLAG_NO_REF_ARF2: u32 = 4194304;
pub const AOM_EFLAG_NO_UPD_LAST: u32 = 8388608;
pub const AOM_EFLAG_NO_UPD... | Rust | 0 |
from time import sleep
from pynput.mouse import Controller, Button
def clickAt(Mouse, x, y):
Mouse.position = (x, y)
Mouse.press(Button.right)
Mouse.release(Button.right)
Mouse = Controller()
while True:
clickAt(Mouse, 100, 100)
# import win32gui, win32ui, win32con, win32api
# import time
#
#
# # 获取... | Python | 1 |
", value),
Skill::AddHpGain(value) => format!("+{} HP Gain", value),
Skill::AddAmmoGain(value) => format!("+{} Ammo Gain", value),
Skill::AddBoostGain(value) => format!("+{} Boost Gain", value),
Skill::PickupAction(action) => format!(
"{} on {} pickup",
... | Rust | 0 |
import base64
chunk_size = 738
sub_size = 1024
def generate_sub(filename: str, name: str) -> str:
with open(filename, "rb") as f:
data = f.read()
chunks = [
base64.b64encode(data[i:i + chunk_size]).decode("utf-8")
for i in range(0, len(data), chunk_size)
]
... | Python | 1 |
RDY_A::_1)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
... | Rust | 0 |
unsafe {
ptr::write(addr as *mut usize, 42);
assert_eq!(ptr::read(addr as *mut usize), 42);
}
assert!(addr as usize > 0);
}
#[test]
fn mmap_file() {
let file_name = "test.mmap_to_file.bin";
fs::remove_file(file_name);
let addr = mmap_to_fi... | Rust | 0 |
from django.db import models
class AuthorizedRetailUser(models.Model):
domain = models.CharField(max_length=255)
ipaddress = models.CharField(max_length=255)
class Meta:
app_label = 'airadio'
db_table = 'authorizedretailuser'
verbose_name = 'Authorized Retail User'
verbose... | Python | 1 |
eak'] = max(0, codey['streak'] - streak_loss)
# Brutal leveling
codey['total_commits'] += daily_activity['commits']
base_requirement = 25
tier_requirement = base_requirement * multipliers['requirements']
codey['level'] = min(10, 1 + int(codey['total_commits'] / tier_requirement))
# Sto... | Python | 1 |
elf {
Self::new(Iterable::Tuple(tuple))
}
pub fn with_map(map: ValueMap) -> Self {
Self::new(Iterable::Map(map))
}
pub fn with_vm(vm: Vm) -> Self {
Self::new(Iterable::Generator(Box::new(vm)))
}
pub fn make_external(
external: impl FnMut() -> Option<ValueIterat... | Rust | 0 |
import logging
from referrals.choices import PromoterCommissionStatusChoices
from referrals.models import Promoter, Referral, PromoterCommission
from referrals.repositories.base_repository import BaseRepository
logger = logging.getLogger(__name__)
class PromoterCommissionRepository(BaseRepository):
def mark_co... | Python | 1 |
rvice(
/// web::resource("/index.html")
/// .route(web::post().to(|| async {
/// HttpResponse::Ok().body("welcome!")
/// })))
/// ).await;
///
/// let req = test::TestRequest::post()
/// .uri("/index.html")
/// .header(header::CONTE... | Rust | 0 |
].as_ref()),
Shape::new(Type::i16, [1920_usize].as_ref()),
];
let (a, b, c) =
<(Tensor<f32>, Tensor<u8>, Tensor<i16>)>::new_tensors(&shapes);
let got = [a.shape(), b.shape(), c.shape()];
assert_eq!(got, shapes);
}
#[test]
#[should_panic = "Expected ... | Rust | 0 |
dl::core::prelude::*;
use rust_hdl::hls::prelude::*;
use rust_hdl::widgets::prelude::*;
mod test_common;
use crate::test_common::fifo_tester::bursty_vec;
use test_common::fifo_tester::{LazyFIFOFeeder, LazyFIFOReader};
#[derive(LogicBlock)]
struct ReducerTestFixture {
feeder: LazyFIFOFeeder<Bits<16>, 10>,
wide... | Rust | 0 |
def total_energy(self):
total_energy = 0.0
for m in self.measurers:
e = self.measurers[m].total_energy()
if e is not None:
total_energy += e
return total_energy
| Python | 1 |
uFractalTexture: image_unit,
},
fract_texture.width(),
fract_texture.height(),
1,
);
let fract_unit = fract_texture
.image_unit(glium::uniforms::ImageUnitFormat::RGBA8UI)
.unwrap()
.set_access(glium::uniforms::Image... | Rust | 0 |
#[inline(always)]
pub fn disable(self) -> &'a mut W {
self.variant(FIFO_CPUREQ_INT_EN_A::DISABLE)
}
#[doc = "`1`"]
#[inline(always)]
pub fn enable(self) -> &'a mut W {
self.variant(FIFO_CPUREQ_INT_EN_A::ENABLE)
}
}
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug... | Rust | 0 |
from re import X
import numpy as np
import torch
from torch import nn
from torch.autograd import Function, Variable
import torch.nn.functional as F
class VectorQuantizerEMA(nn.Module):
def __init__(
self,
num_embeddings,
embedding_dim,
decay=0.99
):
... | Python | 1 |
os,\nlistas include/exclude)"];
G1 [label="INCLUIR", shape=box, color=green];
G2 [label="REVISAR", shape=box, color=orange];
G3 [label="EXCLUIR", shape=box, color=red];
A -> B -> C -> D -> E -> F;
F -> G1 [label="positivos ≥ min_positivos\n e negativos < min_negativos"... | Python | 1 |
rB c sn e Zd ZdZdZeZddejddddddddddddddfddZ dd Z
d
d Zdd
Z fddZ
ZS )HTTPSConnectionPoola
Same as :class:`.HTTPConnectionPool`, but HTTPS.
When Python is compiled with the :mod:`ssl` module, then
:class:`.VerifiedHTTPSConnection... | Python | 1 |
rix(instr)
if output is None:
raise Exception('UniDeepFsmn format error for parsing matrix')
instr, mat = output
self.project = nn.Linear(self.hidden_size, self.output_dim, bias=False)
self.linear = nn.Linear(self.input_dim, self.hidden_size)
self.project.weight = t... | Python | 1 |
# Define the loggers themselves
"loggers": {
"django": { # Django core logs
"handlers": ["sentry", "cloudwatch", "console"],
"level": "INFO",
"propagate": True,
},
"chat_connect": {
"handlers": ["sentry", "cloudwatch", "console"],
... | Python | 1 |
handle) in &self.join_handles {
if handle.clone().now_or_never().is_none() {
warn!(
worker_name = worker_name.as_str(),
"IngestHandlerImpl dropped without waiting for worker termination",
);
}
}
// `self.dat... | Rust | 0 |
year = int(input("Enter the year "))
def leap_year(year):
"""Check given year is leap year or not"""
if year%4 == 0:
if year%100 == 0:
if year%400 == 0:
print("leap year!")
else:
print("Not a leap year")
else:
print("leap year!")
else:
print("Not a leap year!") ... | Python | 1 |
buffer)?;
buffer.push(')');
Ok(())
}
}
pub(in crate::str) struct AnyOperator<'a>(pub &'a Vec<Node>);
impl SqlBuilder for AnyOperator<'_> {
fn build(&self, buffer: &mut String) -> core::result::Result<(), SqlError> {
let list = node_vec_to_string_vec(self.0);
if list.is_empty() ... | Rust | 0 |
#[asn(type = "SEQUENCE", extensible = true, optional_fields = 1)]
pub struct CancelledCellsInTAI_EUTRA_Item {
pub eutra_cgi: EUTRA_CGI,
pub number_of_broadcasts: NumberOfBroadcasts,
#[asn(optional_idx = 0)]
pub ie_extensions: Option<CancelledCellsInTAI_EUTRA_ItemIE_Extensions>,
}
#[derive(Debug, AperC... | Rust | 0 |
from itertools import product
ans = 0
for i in product(sorted('ДГИАШЭ'), repeat=5):
i = ''.join(i)
if i[0] not in 'ИАЭ' and i[-1] not in 'ДГШ':
ans += 1
print(ans)
| Python | 1 |
se
P = (n / (nb_classes - 1)) * P
if n > 0.0:
# 0 -> 1
P[0, 0] = 1. - n
for i in range(1, nb_classes-1):
P[i, i] = 1. - n
P[nb_classes-1, nb_classes-1] = 1. - n
y_train_noisy = multiclass_noisify(y_train, P=P,
rando... | Python | 1 |
lockingConnection(pika.ConnectionParameters(host=args.rabbitmq_server))
else:
print("Must provide command line parameters, run 'python ACE_RabbitMQ.py -h' for help")
return
channel = connection.channel()
except:
print("Issue connecting to RabbitMQ,")
channel.exch... | Python | 1 |
("362326", "江西省弋阳县"),
("362327", "江西省贵溪县"),
("362328", "江西省余江县"),
("362329", "江西省余干县"),
("362330", "江西省波阳县"),
("362331", "江西省万年县"),
("362332", "江西省乐平县"),
("362333", "江西省德兴县"),
("362334", "江西省婺源县"),
("362400"... | Rust | 0 |
3.83 1.51 6.27 1.36L8.8 20.16l-1.33 1.33z"/></svg>
</svg>
}
}
}
// This file is part of dpdk. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/dpdk/master/COPYRIGHT. No part of dpd... | Rust | 0 |
very fast routine for moving data around.
cfg_if::cfg_if! {
if #[cfg(target_os = "none")] {
/// Copies words (type `u32`) from `source` to `dest` -- really, really
/// quickly.
///
/// This uses an optimized assembly language copy routine that
/// asymptotically approaches ... | Rust | 0 |
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.utils import timezone
class User(AbstractUser):
employee_id = models.CharField(max_length=32, unique=True)
department = models.CharField(max_length=120, blank=True)
position = models.CharField(max_length=120, blank... | Python | 1 |
Bool`, `Int` or `String`)."
.to_string(),
span: ty_sym.span().into(),
})
}
};
Ok(Field {
name,
ty: Spanned::new(ty_sym.span(), ty),
_a: PhantomData,
})
}
}
impl fmt::Display for Fiel... | Rust | 0 |
from enum import Enum
from typing import List
from datetime import datetime
class FullName(Enum):
ChemistryandCameraComplex = "Chemistry and Camera Complex"
FrontHazardAvoidanceCamera = "Front Hazard Avoidance Camera"
MarsDescentImager = "Mars Descent Imager"
MarsHandLensImager = "Mars Hand Lens Image... | Python | 1 |
render_pass(
&[RafxColorRenderTargetBinding {
texture: &swapchain_texture,
load_op: RafxLoadOp::Clear,
store_op: RafxStoreOp::Store,
array_slice: None,
mip_slice: None,
clear_value: Ra... | Rust | 0 |
, 0, 0, 1, 1, 1],
vec![0, 0, 1, 0, -1, 0, 0, 0, 1, 1, 0],
vec![0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0],
vec![1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1],
vec![1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1],
vec![0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0],
];
let float_vertices = convert_to_float_vecs(i... | Rust | 0 |
.rs<gh_stars>0
use chrono::{NaiveDate, NaiveDateTime};
use lexical_core::ToLexical;
use std::io::Write;
use streaming_iterator::StreamingIterator;
use crate::bitmap::utils::zip_validity;
use crate::datatypes::TimeUnit;
use crate::io::iterator::BufStreamingIterator;
use crate::temporal_conversions::{
date32_to_date... | Rust | 0 |
import asyncio
from loader import dp, bot
import start
async def main() -> None:
await dp.start_polling(bot, skip_updates=True)
if __name__ == "__main__":
asyncio.run(main()) | Python | 1 |
voltages.
#[inline]
pub const fn denominator(self) -> u16 {
1024
}
#[inline]
const fn from_raw(value: u16, accuracy: Accuracy) -> Self {
let accuracy_bits = accuracy as u16; // ten bits == 0, three bits == 7
Self((value >> accuracy_bits << accuracy_bits) | (accuracy_bits <<... | Rust | 0 |
art: Union[
Unset, ProjectFunctionItemgetRequestSchemaUsageperiodStartScheduleIsStart
] = UNSET
_usageperiod_start_schedule_is_start = d.pop("usageperiod_start_schedule_is_start", UNSET)
if not isinstance(_usageperiod_start_schedule_is_start, Unset):
usageperiod_start_sch... | Python | 1 |
args[i] = f"${{{arg_key}}}" # ${KEY}
replacement = True
i += 1
continue
i += 1
installation["args"] = args
# handle env
if "env" in installation and installation["env"]:
env = {}
for key, value in installation["env"].i... | Python | 1 |
': 3, 'Z': 3, ' ': 3, '!': 3, '"': 3, '#': 3, '$': 3, '%': 3, '&': 3, "'": 3, '(': 3, ')': 3, '*': 3, '+': 3, ',': 3, '-': 3, '.': 3, '/': 3, ':': 3, ';': 3, '<': 3, '=': 3, '>': 3, '?': 3, '@': 3, '[': 3, '\\': 3, ']': 3, '^': 3, '_': 3, '`': 3, '{': 3, '|': 3, '}': 3, '~': 3},
6: {'0': 4, '1': 4, '2': 4, '3': 4, '4':... | Python | 1 |
', None)
except errors.FileError as e:
module.fail_json(msg='%s' % e)
except Exception as e:
module.fail_json(msg="Cannot obtain CA certificate\n%s" % e)
# Now join the domain
result = run(
join_args, raiseonerr=False, env=env, nolog=nolog,
... | Python | 1 |
list for wslcmd2_list
// - test progress: bin1 -> t2, bin2 -> t
unit_test_link_wslcmd(
&tmpdir,
&mut wslcmd2_list,
&[("t", false), ("t", true), ("t", true)],
);
unit_test_cmdlist(&mut wslcmd_list, &["t2"]); // only list for wslcmd_list
unit_... | Rust | 0 |
ile {} => {}", file_name, e)))?;
let buffered_reader = BufReader::new(file);
let config: config::Config = serde_yaml::from_reader(buffered_reader)?;
let config = tremor_runtime::incarnate(config)?;
for o in config.offramps {
let id = TremorURL::parse(&format!("/offramp/{}", o.id))?;
inf... | Rust | 0 |
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import test_hr_employee_calendar_planning
| Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.