text string | label_name string | labels int64 |
|---|---|---|
self.include_no_data:
universe = target.universe.loc[target.now, list(holding_list)].dropna()
if self.include_negative:
holding_list = list(universe.index)
else:
holding_list = list(universe[universe > 0].index)
select_by_s... | Python | 1 |
DUMPABLE => return Ok(SUID_DUMP_USER as i64),
ROOT_DUMPABLE => return Ok(SUID_DUMP_ROOT as i64),
_ => {
panic!("Unknown dumpability {}", d)
}
}
}
PR_SET_DUMPABLE => {
let d;
let typ = args.arg1 as i32... | Rust | 0 |
import sys
def main():
# Read the number of rows (n), columns (m), and the minimum required value (x)
n, m, x = map(int, sys.stdin.readline().split())
# Initialize a 2D array to store the input values
a = [[0] * (m + 1) for _ in range(n)]
# Read the values into the 2D array
for i in range(n):... | Python | 1 |
from datetime import datetime, timedelta
import flet as ft
from app.base import BasePage
class TimePickerPage(BasePage):
"""时间选择器示例页面"""
def __init__(self, **kwargs):
super().__init__(title="时间选择", **kwargs)
def handle_change(self, e):
self.content.controls.append(ft.Text(f"T... | Python | 1 |
import sympy as sp
import matplotlib.pyplot as plt
def plot_matrix(matrix, title=None, label=""):
fig, ax = plt.subplots()
ax.axis('off')
# Adjust title position and pad to give more space
if title:
ax.set_title(title, pad=20) # Increase pad to move the title up
# Use SymPy to genera... | Python | 1 |
# <Copyright 2019, Argo AI, LLC. Released under the MIT license.>
"""Unit tests for JSON utility functions."""
import json
import os
import pathlib
from argoverse.utils.json_utils import read_json_file, save_json_dict
_TEST_DIR = pathlib.Path(__file__).parent
def test_read_json_file() -> None:
"""Test reading f... | Python | 1 |
())
}
#[cfg(not(target_os = "linux"))]
pub fn current_exe() -> Result<std::path::PathBuf> {
Ok(std::env::current_exe()?)
}
// the time crate is currently unable to get the local offset on unix due to
// soundness concerns, so we have to do it manually/:
//
// https://github.com/time-rs/time/issues/380
pub fn get_... | Rust | 0 |
"""
题目:
字符串 S 由小写字母组成。我们要把这个字符串划分为尽可能多的片段,
同一个字母只会出现在其中的一个片段。返回一个表示每个字符串片段的长度的列表。
示例:
输入: S = "ababcbacadefegdehijhklij"
输出形式1: [9,7,8]
输出形式2: ["ababcbaca", "defegde", "hijhklij"]
解释:
划分结果为 "ababcbaca", "defegde", "hijhklij"。
每个字母最多出现在一个片段中。
像 "ababcbacadefegde", "hijhklij" 的划分是错误的... | Python | 1 |
import tweepy
import pandas as pd
# Initialize the Tweepy client
client = tweepy.Client(
consumer_key="3hCyuZpdOq143mcs7lWclZMRz",
consumer_secret="bONpuxARUFVRuFpiXYfp9zTTz5Yqu4b2fmLJh7v372jdVTWaZP",
access_token="1765110121313755136-90P4qDrW7J5Vb6nVR5pvipBLkZStpz",
access_token_secret="tcaf5BEMMWLKR7... | Python | 1 |
import matplotlib.pyplot as plt
import numpy as np
# Parameters
angle_start = -43.2
angle_end = 43.2
angle_step = 4.8
radius = 2
# Generate angles and coordinates
angles = np.arange(
np.radians(angle_start), np.radians(angle_end), np.radians(angle_step)
) # Adjust to exclude the extra angle
x = np.sin(angles) * ... | Python | 1 |
# -*- coding: utf-8 -*-
from robot.libraries import BuiltIn
from .keywordgroup import KeywordGroup
BUILTIN = BuiltIn.BuiltIn()
class _RunOnFailureKeywords(KeywordGroup):
def __init__(self):
self._run_on_failure_keyword = None
self._running_on_failure_routine = False
# Public
def regis... | Python | 1 |
.thing;\
\n background: blue;\
\n}"
)
.unwrap_err(),
"Error: The target selector was not found.\
\nUse \"@extend .thing !optional\" to avoid this error.\
\n ,\
\n6 | @extend .thing;\
\n | ^^^^^^^^^^^^^^\
\n \'\... | Rust | 0 |
np.max(acc_tensor[out_c]), details['max_acc'])
# details['acc_before'] = acc_tensor.copy()
acc_tensor = apply_multiplicative_bias(qrec,
params, acc_tensor, 0, ktype="symmetric")
# details['acc_after'] = acc_tensor.co... | Python | 1 |
{
Self(Windfall::new())
}
}
impl SpecialAbility for FavoniusCodexR5 {
fn update(&mut self, time: f32, event: &AttackEvent, data: &CharacterData, attack: &[*const Attack], particles: &[FieldEnergy], enemy: &Enemy) -> () {
self.0.update(time, event, data, attack, particles, enemy);
}
fn... | Rust | 0 |
_bytes(bytes.try_into().unwrap()))
}
pub fn read_f64(&mut self) -> Result<f64, AppMessagesError> {
let bytes = self.take(8)?;
Ok(f64::from_le_bytes(bytes.try_into().unwrap()))
}
}
pub enum Message {
Vector3Message(Vector3Message),
NewCharacterMessage(NewCharacterMessage),
Chara... | Rust | 0 |
older': u'标题', 'required': ''})
)
type = forms.IntegerField()
is_show = forms.CharField(required=False, max_length=100, label=u'加密', widget=forms.TextInput(
attrs={'class': 'form-control', 'placeholder': u'密码'})
)
content = forms.CharField(label=u'内容',widget=MarkDownInput(
attrs={'cl... | Python | 1 |
entence_lengths) - 512
if overshoot <= 0:
break
# don't cut more than min_cut
new_len = max(self.min_cut, len(par_tokens[sent]) - overshoot)
new_sentence_lengths[sent] = new_len
# given the calculated new lengths, iterate ... | Python | 1 |
le = false, sz_lb = "12", sz_ub = "12")]
pub struct NB_IoT_UEIdentityIndexValue(BitVec<Msb0, u8>);
#[derive(Debug, AperCodec)]
#[asn(type = "SEQUENCE", extensible = true, optional_fields = 1)]
pub struct NG_eNB {
pub global_ng_e_nb_id: Global_ENB_ID,
#[asn(optional_idx = 0)]
pub ie_extensions: Option<NG_eN... | Rust | 0 |
copy_single_t::<u64>(idx, str_val, radix, output)?;
}
SizedScalarType::S8 => {
Self::parse_and_copy_single_t::<i8>(idx, str_val, radix, output)?;
}
SizedScalarType::S16 => {
Self::parse_and_copy_single_t::<i16>(idx, str_val, radix, output)?... | Rust | 0 |
duration);
}<gh_stars>10-100
use {
super::{Component, Entireness},
crate::fh::{Component as FHComponent, FileHierarchy},
std::sync::Arc,
};
/// Options for the Register.
pub struct RegisterOptions {}
impl RegisterOptions {
/// Creates a new RegisterOptions instance.
pub fn new() -> Self {
... | Rust | 0 |
Case("telco", "telco", [f"--doc_root={TELCO_DATA}"]),
Case("sqlite_synth", "sqlite_synth", []),
Case("regex_v8", "regex_v8", []),
Case("regex_effbot", "regex_effbot", []),
Case("regex_effbot_bytes", "regex_effbot", ["--force_bytes"]),
]
@dataclasses.dataclass
class BenchmarkResult:
name: str
... | Python | 1 |
feerate: f32,
size: i32,
fee: i64,
tags: Vec<String>,
}
ctx.insert(
"data",
&Data {
block_count: missing_transaction.blocks.len(),
txid: hex::encode(missing_transaction.transaction.txid),
feerate: ((missing_transaction.transac... | Rust | 0 |
display_lhs_line_num.clone()
} else {
let mut s = format_missing_line_num(
lhs_line_num.unwrap_or_else(|| prev_lhs_line_num.unwrap_or(10.into())),
widths.lhs_line_nums,
);
... | Rust | 0 |
from typing import List
import itertools
class Solution:
def judgePoint24(self, cards: List[int]) -> bool:
def dfs(nums):
if len(nums) == 1:
return abs(nums[0] - 24) < 1e-6
for i in range(len(nums)):
for j in range(len(nums)):
... | Python | 1 |
import matplotlib.pyplot as plt
import numpy as np
import torch
import setting
def plot_curves(train_loss, epoch, root):
x_axis=np.linspace(1, epoch, epoch)
plt.title('Training Loss')
plt.plot(x_axis, train_loss)
plt.xlabel('epoch')
plt.ylabel('loss')
plt.savefig(root+'training_loss.png')
def plot_checkpoint()... | Python | 1 |
ta,
_ => return Some(Err(Error::NonOptionFieldTy)),
};
let ty = match angle_bracket_data.args.len() {
1 => angle_bracket_data.args.first().unwrap(),
_ => return Some(Err(Error::NonOptionFieldTy)),
};
... | Rust | 0 |
, path),
);
}
} else {
result.error(
ErrorCode::E099,
format!("Inventory fixity block '{}' contains a path containing an illegal path part. Foun... | Rust | 0 |
shu_caozuo = []
miaoshu_xianxiang = []
for jvzi in miaoshu_jvzi:
# 把句子进一步拆分
miaoshu_list = re.split(pattern2, jvzi)
miaoshu_list = list(filter(None, miaoshu_list))
# 判断类型,把相同的类型放到一起
for miaoshu in miaoshu_list:
miaoshu_type = cnnModel.predict(miaoshu)
... | Python | 1 |
from raypier.api import RayTraceModel, GeneralLens, ParallelRaySource, SphericalFace, CircleShape, OpticalMaterial
### Build a couple of lenses ###
shape = CircleShape(radius=12.5)
f1 = SphericalFace(curvature=-50.0, z_height=0.0)
f2 = SphericalFace(curvature=50.0, z_height=5.0)
m = OpticalMaterial(glass_name="N-BK7")... | Python | 1 |
t_created FROM ticket WHERE ticket_channel=?", (ticket_id,))
ticket_data = cur.fetchone()
id, ticket_creator_id, ticket_created = ticket_data
ticket_creator = guild.get_member(ticket_creator_id)
ticket_created_unix = self.convert_to_unix_timestamp(ticket_created)
timezone = pytz... | Python | 1 |
;
#[cfg(feature = "metadata")]
pub fn is_metadata(key: &str) -> bool {
key == crate::METADATA_KEY
}
#[cfg(not(feature = "metadata"))]
pub fn is_metadata(_: &str) -> bool {
false
}
pub unsafe trait InnerUnwrap<T> {
unsafe fn inner_unwrap(self) -> T;
}
#[cfg(not(has_unwrap_unchecked))]
unsafe impl<T> InnerUnwrap<T... | Rust | 0 |
x47);
let x49: u64 = (x7 + x48);
let x50: u64 = (x6 + x49);
let x51: u64 = (x4 + (x5 as u64));
let x52: u64 = (x3 + x51);
let x53: u64 = (x2 + x52);
let x54: u64 = (x1 + x53);
out1[0] = x36;
out1[1] = x43;
out1[2] = x50;
out1[3] = x54;
}
/// The function fiat_p224k1_scalar_set_... | Rust | 0 |
// vector with paths we want to write
let def_paths_vec = create_default_path_vec();
let fp_str = tmp_dir.as_path().to_str().unwrap();
parser::config::create_default_config(&fp_str, &def_paths_vec);
shell.load_paths(Some(&fp_str), &def_paths_vec);
assert!(shell.paths.len(... | Rust | 0 |
---
Project environment for '%(project_name)s' created.
You may now configure the environment by editing the file:
%(config_path)s
If you'd like to take this new project environment for a test drive,
try running the Trac standalone web server `tracd`:
tracd --port 8000 %(project_path)s
Then point your browser ... | Python | 1 |
arg5: ::core::option::Option<
unsafe extern "C" fn(
arg1: *mut ::libc::c_void,
arg2: *const mad_stream,
arg3: *mut mad_frame,
) -> mad_flow,
>,
arg6: ::core::option::Option<
unsafe extern "C" fn(
ar... | Rust | 0 |
in: [f64; 3], orientation: [f64; 3]) -> AxialSystem {
AxialSystem {
objects: HashMap::new(),
origin,
orientation,
}
}
/// Returns the default AxialSystem
///
/// This has the shared symmetry axis located at the global origin (0,0,0)
/// with its sy... | Rust | 0 |
DOMAIN = "gofile"
TEST_CASES = [
(
"https://gofile.io/d/2ORt9N",
[
{
"url": "re:download/web/f1f28c6a-d02b-44a3-80ec-d9ef6b23913e",
"filename": "[5ahw24au]chance-01.mp4",
"original_filename": "[5ahw24au]chance-01.mp4",
"down... | Python | 1 |
validator_list_id: UInt256,
validators: Vec<CatchainNode>
) {
let mut is_first_search = true;
const SLEEP_TIME: u64 = 1; //secs
tokio::spawn(async move {
let mut current_validators = validators;
loop {
match Self::search_validator_keys_ro... | Rust | 0 |
ict
def get_namedict():
if os.path.exists(NAMECACHE_PATH):
with open(NAMECACHE_PATH, "rb") as pickle_file:
name_dict = pickle.load(pickle_file)
else:
name_dict = {}
return name_dict
def text_normalize(text):
# todo: eng text normalize
# 适配中文及 g2p_en 标点
rep_map = ... | Python | 1 |
from base64 import b64decode
from random import choice, randint
from json_utils import *
from image_utils import *
DB_URL = fetch_json("config")["DB_URL"]
def gen(json_file, game, crop_data, regions=None):
# choose char
all_characters = fetch_json(json_file)
temp_choose = list(all_characters)[:-1]
if regions:... | Python | 1 |
# The following comments couldn't be translated into the new config version:
import FWCore.ParameterSet.Config as cms
# AlCaReco for muon alignment using straight (zero-field) cosmic ray tracks
OutALCARECOMuAlStandAloneCosmics_noDrop = cms.PSet(
SelectEvents = cms.untracked.PSet(
SelectEvents = cms.vstrin... | Python | 1 |
(1,0);
let pl_pos = (3i8,1i8);
let mut gw = GameWorld::new_w_screen(sc);
let pl = Player::new_img(GameImages::Player.value(),pl_pos);
let gpl : GameObjectClass = GameObjectClass::Player(pl);
gw.add_object(GameObjectClass::Alien( AliensClass::Alien( Alien::new_img(GameImages::Alien.value(), al_pos )... | Rust | 0 |
)[0][0]]
)
# Loop same as above, only to add axes labels
for i in range(2):
if specific_plot is not None:
if ["E", "H"][i] != specific_plot[0]:
continue
plt.figure(i)
for dimension in range(len(detector_dict[detector][0][0])):
if speci... | Python | 1 |
# Hydrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2023 Dan <https://github.com/delivrance>
# Copyright (C) 2023-present Hydrogram <https://hydrogram.org>
#
# This file is part of Hydrogram.
#
# Hydrogram is free software: you can redistribute it and/or modify
# it under the terms o... | Python | 1 |
Type::DIGIT | ByteType::NAME | ByteType::MINUS => {
ptr = ptr.offset(self.MINBPC())
}
_ => {
return ptr.wrapping_offset_from(start) as libc::c_long as
libc::c_int
}
}
}
}
un... | Rust | 0 |
###
# #%L
# aiSSEMBLE Foundation::aiSSEMBLE Core (Python)
# %%
# Copyright (C) 2021 Booz Allen
# %%
# 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/LICEN... | Python | 1 |
from django.urls import path, re_path
from . import views
urlpatterns = [
# http://127.0.0.1:8000/StarfieldOutpostPlanner/
path(r"", views.index, name="StarfieldOutpostPlanner"), # <root>/StarfieldOutpostPlanner/
path(r"index", views.index, name="index"),
re_path("home$", views.home, name="home"),
... | Python | 1 |
_, _, ngroups, dstate = B.shape
assert B.shape == (batch, seqlen, ngroups, dstate)
assert dt.shape == (batch, nheads, nchunks, chunk_size)
assert dA_cumsum.shape == (batch, nheads, nchunks, chunk_size)
if B.stride(-1) != 1:
B = B.contiguous()
if x.stride(-1) != ... | Python | 1 |
s not None else None
if sam is not None:
sam.device = device
samd_config = SamdConfig(
n_predicts=args.samd_n_predicts,
tree_method=args.tree_method,
tree_model_path=args.tree_model_path,
len_threshold=args.samd_len_threshold,
len_bias=args.samd_len_bias,
... | Python | 1 |
.unwrap();
let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080);
let endpoint = Endpoint::from_address(addr);
assert!(filter
.read(ReadContext::new(
Endpoints::new(vec![Endpoint::from_address(
"127.0.0.1:8080".parse(... | Rust | 0 |
)]
pub(crate) fn clear_storage_cache(&self) {
self.store.storage_cache.lock().unwrap().clear();
}
}
impl StoreTrait for NetworkStore {
fn block_ptr(
&self,
subgraph_id: graph::prelude::SubgraphDeploymentId,
) -> Result<Option<EthereumBlockPointer>, failure::Error> {
self... | Rust | 0 |
ialOrd, Ord, Eq, Debug)]
pub enum RedirectFlowFooter {
V4 {
src: SocketAddrV4,
dst: SocketAddrV4,
},
V6 {
src: (Ipv6Addr, u16),
dst: (Ipv6Addr, u16),
flow: u32,
},
}
impl RedirectFlowFooter {
pub fn flip(self) -> Self {
match self {
Redire... | Rust | 0 |
(
"lifetime specifiers are not supported".into(),
self.span(),
));
}
if self.mutability.is_some() {
f.write_str("&mut ")?;
} else {
f.write_str("&")?;
}
self.elem.conv_to_key_str(f)
}
}
impl ToKeyStr for sy... | Rust | 0 |
PMT_KDF_SCHEME() {
assert_eq!(::std::mem::size_of::<TPMT_KDF_SCHEME>() , 4usize , concat ! (
"Size of: " , stringify ! ( TPMT_KDF_SCHEME ) ));
assert_eq! (::std::mem::align_of::<TPMT_KDF_SCHEME>() , 2usize , concat !
( "Alignment of " , stringify ! ( TPMT_KDF_SCHEME ) ));
asse... | Rust | 0 |
(from: &dyn core::ToInputArray, to: &dyn core::ToInputArray, flow: &mut dyn core::ToOutputArray, layers: i32, averaging_block_size: i32, max_flow: i32, sigma_dist: f64, sigma_color: f64, postprocess_window: i32, sigma_dist_fix: f64, sigma_color_fix: f64, occ_thr: f64, upscale_averaging_radius: i32, upscale_sigma_dist: ... | Rust | 0 |
9o\xa4\xd9\xda\xdd_\xf8~\xebr\xdd\
Z\xdf\xb2\xbbK\x9e\xe0\x10H\x03\xb0\xaf\x5c\xf0\xc7\xec\
\xe7aa\xf6{]I\xae5H\x95\xbf\xe5\xbc\xc5[\
\xeb\xf2\xe0}k\xb9\xf0g\xc0/\x0eh7s]Z\
\xe8\xd6\x11Ko\x11ef\x8c;\xaf\xa0\x04\xf3\xd7\x1e\
\xb4P\xe4\x85\xf9\xb5\x1dYQWkS\xc5\xbcG\xfb\
ih\xdaTV\xfe\x1f\xf0\x97\x82\xda\xc2[\x85\xf2\x16\
... | Python | 1 |
3,
/// Prefixable internal commands (yes \the, yes \global). Last is
/// MAX_INTERNAL.
Group4 = 4,
/// Prefixable non-internal commands (no \the, yes \global). Last is
/// MAX_COMMAND.
Group5 = 5,
/// Special commands: cannot make it to big_switch
Group6 = 6,
}
/// A TeX primitive a... | Rust | 0 |
let mut global_buckets = SymmMem::<i64>::new((npes * slot_size) as usize);
barrier_all();
let mut send_cnt: isize = procnum_updates;
let mut rng = rand::thread_rng();
let mut ran: isize = rng.gen();
let mut pe_check_done = SymmMem::<isize>::new(npes as usize);
for i in 0..npes {
... | Rust | 0 |
unexpected errors: {errors}"
assert tracker.used_usd <= tracker.limit_usd, f"Budget exceeded! Used: ${tracker.used_usd:.2f}, Limit: ${tracker.limit_usd:.2f}"
# Should have exactly 6 successful reservations (6 * $15 = $90 <= $100)
# and 4 failed reservations
expected_successful =... | Python | 1 |
---------------------------------------
Image.register_open(SpiderImageFile.format, SpiderImageFile)
Image.register_save(SpiderImageFile.format, _save_spider)
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Syntax: python3 SpiderImagePlugin.py [infile] [outfile]")
sys.exit()
filename... | Python | 1 |
d integer."]
pub type int8 = i8;
#[doc = "! 16 bit signed integer."]
pub type int16 = i16;
#[doc = "! 32 bit signed integer."]
pub type int32 = i32;
#[doc = "! 64 bit signed integer."]
pub type int64 = i64;
#[doc = "! 32 bit signed floating point number."]
pub type float32 = f32;
#[doc = "! 64 bit signed floa... | Rust | 0 |
RenderWorld>,
query: Query<(Entity, &ComputedVisibility, &Mesh2dHandle, &GlobalTransform), With<Handle<Svg>>>,
) {
debug!("Extracting `Svg`s from `World`.");
let mut extracted_svgs = render_world.get_resource_mut::<ExtractedSvgs2d>().unwrap();
extracted_svgs.svgs.clear();
for (entity, computed_visib... | Rust | 0 |
"""
Sparse Eigenvalue Solvers
-------------------------
The submodules of sparse.linalg.eigen:
1. lobpcg: Locally Optimal Block Preconditioned Conjugate Gradient Method
"""
from .arpack import *
from .lobpcg import *
__all__ = [s for s in dir() if not s.startswith('_')]
from scipy._lib._testutils import PytestT... | Python | 1 |
.push_str("C".repeat(((x - 500) / 100) as usize).as_str());
}
90 => result.push_str("XC"),
1..=3 => result.push_str("I".repeat((x / 100) as usize).as_str()),
4 => result.push_str("IV"),
5 => result.push_str("V"),
6..=8 => {
... | Rust | 0 |
def bbox_postprocess(result, input_size, img_size, output_height, output_width
):
"""
result: [xc,yc,w,h] range [0,1] to [x1,y1,x2,y2] range [0,w], [0,h]
"""
if result is None:
return None
scale = torch.tensor([input_size[1], input_size[0], input_size[1],
input_size[0]])[None, :]... | Python | 1 |
//! and 128KiB variants, which can thankfully be distinguished using a chip ID.
//!
//! As these various types of save media cannot be easily distinguished at
//! runtime, the kind of media in use should be set manually.
//!
//! ## Setting save media type
//!
//! To use save media in your game, you must set which typ... | Rust | 0 |
"""GUI 界面文件"""
import functions
import basic
import rules
import error
import tkinter.filedialog as filedialog
from tkinter import *
import tkinter.messagebox as msgbox
from tkinter.ttk import *
root = Tk()
# 常量定义
lastselect = StringVar() # rulePanel中上一次选择
selectdir = StringVar() # 当前文件夹路径
strarting = True # 程序未初始化... | Python | 1 |
me.month(), 1);
//! assert_eq!(utc_date_time.month_day(), 1);
//! assert_eq!(utc_date_time.hour(), 0);
//! assert_eq!(utc_date_time.minute(), 0);
//! assert_eq!(utc_date_time.second(), 0);
//! assert_eq!(utc_date_time.week_day(), 6);
//! assert_eq!(utc_date_time.year_day(), 0);
//! assert_eq!(utc_date_time.unix_time(),... | Rust | 0 |
#! usr/bin/python3.9
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript function... | Python | 1 |
ubplot(1, 4, 2)
gt_cmap = 'gray' if len(np.unique(label_true)) <= 2 else 'tab20'
ax.imshow(continuous_renumber(label_true), cmap=gt_cmap)
ax.set_axis_off()
ax = fig2.add_subplot(1, 4, 3)
ax.imshow(seg_kmeans, cmap='gray')
ax.set_title('Spectral K-means')
ax.set_ax... | Python | 1 |
# *****************************************************************************
# * Copyright (c) 2023 Xilinx, Inc.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
... | Python | 1 |
ause<'a>>,
pub limit: Option<LimitClause>,
}
/// `with <identifier> as <expr>`
#[derive(Debug, Clone, Constructor)]
pub struct WithClause<'a> {
pub cte_list: Vec<QueryCTE<'a>>,
}
/// `distinct [on <columns>]`
#[derive(Debug, Clone, Constructor)]
pub struct DistinctClause<'a> {
pub columns: Option<Vec<Quer... | Rust | 0 |
7be6de991c1b4dc269e",
(32, 6, [0x2ee6b499, 0xc445e3d8], [0x14a13eb7, 0x303c7f96]),
"9dee0bf33e2b73e7de351437121b3025f6a1414c3a8c0b33d4ad5286708e9909"
),
(
// Len = 1376
"<KEY>",
(32, 1, [0x6295cea2, 0xacbdd1aa], [0x2154b998, 0x39796721]),
"08cba7402c07f222f851a2b93919246d5f5d3dd3fa655295cce94782abec961f"
... | Rust | 0 |
from typing import List
from gando.schemas import AbstractBaseSchema
class Messenger(AbstractBaseSchema):
type: str | None = None
code: int | None = None
message: str | None = None
class Data(AbstractBaseSchema):
result: dict = dict()
class ListData(AbstractBaseSchema):
count: int = 0
next... | Python | 1 |
let mut partial_config = PartialConfig::new(ConfigSource::Default);
// Populate the PartialConfig fields by separately applying the builder methods.
partial_config = partial_config.with_storage(Some(EXAMPLE_STORAGE.to_string()));
partial_config = partial_config.with_transport(Some(EXAMPLE_TRAN... | Rust | 0 |
SCON.freeze(Config::fro12m());
let gpio = dp.GPIO.split(&mut syscon, &mut iocon);
let rx_pin = gpio.pio0_29;
let tx_pin = gpio.pio0_30;
let conf = serial::Config {
baudrate: 115200.Bd(),
wordlength: serial::WordLength::DataBits8,
parity: serial::Parity::ParityNone,
sto... | Rust | 0 |
XorShiftRng::from_seed([0x3dbe6259, 0x8d313d76, 0x3237db17, 0xe5bc0654]);
for i in 2..5 {
let x: Vec<u8> = (0..i * 32).map(|_| rng.gen()).collect();
let hashed = pedersen_md_no_padding(x.as_slice());
assert_ne!(hashed, Fr::zero());
}
}
}
//! Functional Reactive P... | Rust | 0 |
from aiogram import Router, F, Bot
from aiogram.fsm.context import FSMContext
from aiogram.types import Message, LabeledPrice, PreCheckoutQuery
from config import admins_id, YOUKASSA
from keyboards.buy.reply import get_buy_menu_markup
from keyboards.menu_reply import get_menu_markup
from loader import db_connection
fr... | Python | 1 |
import random
from pathlib import Path
from typing import Optional, Tuple, List
from PIL import Image, UnidentifiedImageError
# --- Поддерживаемые форматы Telegram ---
SUPPORTED_IMAGE_EXTS = {".jpg", ".jpeg", ".png", ".gif", ".webp"}
SUPPORTED_VIDEO_EXTS = {".mp4", ".mov", ".mkv"}
SUPPORTED_DOC_EXTS = {".pdf", ".do... | Python | 1 |
config["pointnet_config"] # to define pointnet
# global diffusion_config
# diffusion_config = config["diffusion_config"] # basic hyperparameters
global trainset_config
if train_config['dataset'] == 'mvp_dataset':
trainset_config = config["mvp_dataset_config"]
elif train_config['d... | Python | 1 |
let mut sigma_1: Vec<_> = (1..=num_gates).collect();
let mut sigma_2: Vec<_> = ((num_gates+1)..=(2*num_gates)).collect();
let mut sigma_3: Vec<_> = ((2*num_gates + 1)..=(3*num_gates)).collect();
let mut permutations = vec![vec![]; num_partitions + 1];
fn rotate(mut vec: Vec<u... | Rust | 0 |
d = int(input())
r = 5
res = 0
for _ in range(d):
like = r // 2
res += like
r = like * 3
print(res)
| Python | 1 |
;
use crate::services::person;
use rocket::http::RawStr;
use rocket_contrib::json::Json;
#[get("/person")]
pub fn find_all(token: JsonWebToken, conn: CrmDbConn) -> CustomJsonResponse {
if let Err(e) = token {
return e;
}
let response = person::find_all(&conn);
rocket_status_from_response(respon... | Rust | 0 |
&& (stm.switching_device.load(Ordering::SeqCst)
|| stm.frames_read.load(Ordering::SeqCst) == 0)
{
// The silent frames will be inserted in `get_linear_data` below.
let silent_frames_to_push = input_frames_needed - buffered_input_frames;
cubeb_log!... | Rust | 0 |
in 0..8 {
let mut y_axis = Vec::new();
for y in 0..8 {
y_axis.push(mxcfb_rect {
left: ((DISPLAYWIDTH as u32 - square_size * 8) / 2) + square_size * x,
top: ((DISPLAYHEIGHT as u32 - square_size * 8) / 2) + square_size * (7 - y),
... | Rust | 0 |
(&self) -> Self {
*self
}
}
impl ::std::default::Default for Xsave {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Copy)]
pub struct Xcr {
pub xcr: u32,
pub reserved: u32,
pub value: u64,
}
impl ::std::clone::Clone for Xcr {
fn clone(&self) ->... | Rust | 0 |
e_path_resolver,
);
let package_configuration_reader = app::PackageConfigurationReader::new(
&file_system,
&file_path_displayer,
&static_file_path_manager,
);
let ffi_package_initializer =
infra::FfiPackageInitializer::new(&command_runner, &file_path_converter);
let ... | Rust | 0 |
, Default, PartialEq, Eq)]
pub struct BitVec {
nbits: usize,
vec: Vec<u8>
}
fn bytes_in_bits(nbits: usize) -> usize {
// #bytes = #ceil(nbits / 8)
(nbits + 7) / 8
}
fn byte_from_bool(bit: bool) -> u8 {
if bit { !0u8 } else { 0u8 }
}
impl BitVec {
////////////////////////////////////////
/... | Rust | 0 |
ock=20274992,
)
txn_batch = eth_job.get_data_buff()[ArbitrumTransactionBatch.type()][0]
txn_batch = asdict(txn_batch)
assert txn_batch["batch_index"] == 643250
assert txn_batch["l1_block_number"] == 20274992
assert txn_batch["l1_block_timestamp"] == 1720601171
assert txn_batch["l1_block_has... | Python | 1 |
().position(|r| r.name.as_str() == name) {
Some(iindex) => v.get(iindex),
None => None,
}
}
//the name must exist, else abort
pub fn get_by_name_req<'a>(v: &'a [CtrlFormat], name: &str) -> &'a CtrlFormat {
required(get_by_name(v, name))
}
//the name must exist, else abort
pub fn get_mut_by_nam... | Rust | 0 |
self.assertRaises(tf.errors.InvalidArgumentError):
patch_ops.get_patch_mask(
0, 0, patch_size=patch_size, image_shape=image_shape)
def testDynamicNonPositivePatchSizeRaisesError(self):
def graph_fn():
image_shape = [6, 7]
patch_size = -1 * tf.random_uniform([], minval=0, maxval=3,
... | Python | 1 |
import logging
import os
import pickle
import gym
import matplotlib.pyplot as plt
import numpy as np
from optical_rl_gym.envs.deeprmsa_env import (
shortest_available_path_first_fit,
shortest_path_first_fit,
)
from optical_rl_gym.utils import evaluate_heuristic, random_policy
logging.getLogger("rmsaenv").set... | Python | 1 |
AL),
_ => r.get_class_name().map(get_error_code).unwrap_or(EINTERNAL),
},
fs::FsError::Path(_) => libc::EINVAL,
},
LibError::NulString(_) => libc::EINVAL,
LibError::Oom => libc::ENOMEM,
};
errno::set_errno(errno::Errno(the_errno));
}
#![feature(pro... | Rust | 0 |
# !/usr/bin/python
# coding=utf-8
from itertools import product
initials = ['', 'b', 'p', 'm', 'f', 'd', 't', 'n', 'l', 'g', 'k', 'ng', 'h', 'gw', 'kw', 'w', 'z', 'c', 's', 'j']
finals = ['aa', 'aai', 'aau', 'aam', 'aan', 'aang', 'aap', 'aat', 'aak', 'a', 'ai', 'au', 'am', 'an', 'ang', 'ap', 'at', 'ak', 'e', 'ei', 'e... | Python | 1 |
frame_default_open_update_column2, text="开启服务:", width=8
)
self.open_service_label.pack(side=tk.LEFT, padx=4, pady=8)
self.open_service_var = tk.BooleanVar(value=config.open_service)
self.open_service_checkbutton = ttk.Checkbutton(
frame_default_open_update_column2,
... | Python | 1 |
# Copyright (c) 2008 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | Python | 1 |
- Alternate function selection for port x pin y (y = 0..7)"]
#[inline]
pub fn afsel2(&mut self) -> _AFSEL2W {
_AFSEL2W { w: self }
}
#[doc = "Bits 4:7 - Alternate function selection for port x pin y (y = 0..7)"]
#[inline]
pub fn afsel1(&mut self) -> _AFSEL1W {
_AFSEL1W { w: self... | Rust | 0 |
r ",
text_type_text,
)
new_nodes = split_nodes_image([node])
self.assertListEqual(
[
TextNode("This is text with an ", text_type_text),
TextNode("image", text_type_image, "https://i.imgur.com/... | Python | 1 |
!(source_len = source.len(), "started parsing '{}'", file);
let event = PerfEvent::new("parsing");
// Parse the program's source code into tokens
let Parsed {
tokens,
source_len,
total_tokens,
deepest_nesting,
} = parse::parse(source);
let elapsed = event.finish();
... | Rust | 0 |
f exclude_file(file_path):
logger.info("Ignoring file.")
return None
guess = use_regex and custom_regex(file_path) or use_guessit(guessit_path)
logger.debug(f"Guess: {guess}")
guess = cleanup_guess(guess)
if guess:
guess = apply_remap_rules(file_path, guess)
return guess
de... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.