text string | label_name string | labels int64 |
|---|---|---|
_len)) = self
.environment
.drivers_buffer_len(FetchOrientation::Next)
.map(|res| res.into_result(&self.environment))
.transpose()?
{
server_name_len = max(candidate_name_len, server_name_len);
driver_len = max(c... | Rust | 0 |
dmenu(win, id):
return win._menuitems[id]
def maketoolbar(win, alist, toollist):
setattr(win.__class__, 'OnExecuteMenuCommand', _OnExecuteMenuCommand)
win.toolbar = toolbar = win.CreateToolBar(wx.TB_HORIZONTAL | wx.NO_BORDER | wx.TB_FLAT | wx.TB_TEXT)
#judge image size by the first item of the toolba... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.addons.account.models.chart_template import template
class AccountChartTemplate(models.AbstractModel):
_inherit = 'account.chart.template'
@template('pa')
def _get_pa_template_data(self):
... | Python | 1 |
s: [u8; 16], // 0xF is Flag Register
address_reg: u16, // Technically 12-bits
stack: [usize; 12], // 12 levels of nesting
delay_timer: u8, // Ticks down at 60 hz
sound_timer: u8, // Ticks down at 60 hz
input: u8, // Only one butto... | Rust | 0 |
bytes_of(nonce)]
}
pub fn gen_signer_key(
nonce: u64,
acc_pk: &Pubkey,
program_id: &Pubkey,
) -> Result<Pubkey> {
let seeds = gen_signer_seeds(&nonce, acc_pk);
Ok(Pubkey::create_program_address(&seeds, program_id)?)
}
pub fn create_signer_key_and_nonce(program_id: &Pubkey, acc_pk: &Pubkey) -> (... | Rust | 0 |
start,
end: Some(end),
})
}
ParseError::UnrecognizedToken { token, .. } => {
let start = get_line_and_column_for_pos(token.0, &offsets);
let end = get_line_and_column_for_pos(token.2 - 1, &offsets);
Some(LineColumnRange {
... | Rust | 0 |
this macro.
///
/// # Safety
/// `unsafe_abomonate` is unsafe because if you fail to specify a field it will not be properly
/// re-initialized from binary data. This can leave you with a dangling pointer, or worse.
///
/// # Examples
/// ```
/// #[macro_use]
/// extern crate abomonation;
/// use abomonation::{encode, ... | Rust | 0 |
return Err(SparseMatrixDataError::NonMonotoneColumns);
}
}
if needs_explicit_diagonal {
if i == j {
have_placed_diagonal = true;
// TODO: Can remove the i < j comparison here!
} else if i < j... | Rust | 0 |
14_003D,// MVEX_Vpmaxsd_zmm_k1_zmm_zmmmt
0x4614_003F,// MVEX_Vpmaxud_zmm_k1_zmm_zmmmt
0x4614_0040,// MVEX_Vpmulld_zmm_k1_zmm_zmmmt
0x4614_0042,// MVEX_Vgetexpps_zmm_k1_zmmmt
0x4654_0042,// MVEX_Vgetexppd_zmm_k1_zmmmt
0x4614_0045,// MVEX_Vpsrlvd_zmm_k1_zmm_zmmmt
0x4614_0046,// MVEX_Vpsravd_zmm_k1_zmm_zmmmt
0x4614... | Rust | 0 |
a4a4a;
# }
# hr {
# border-color: #2a2a2a;
# margin: 1rem 0;
# }
# /* Hide default streamlit elements */
# #MainMenu {visibility: hidden;}
# footer {visibility: hidden;}
# header {visibility: hidden;}
# </style>
# """, unsafe_allow_html=True)
# class En... | Python | 1 |
. Success
6. Success
7. Success
8. Success
9. Fail
10. Success
11. Success
12. Success
13. Success
14. Success
15. Fail
16. Success
17. Success
18. Success
"""
config = Config(topo.standalone)
# Adding ad... | Python | 1 |
'#0210380499V#241F那么各位,请多保重了。',
TxtCtl.Enter,
),
)
CloseMessageWindow()
Sleep(200)
ChrSetChipByIndex(0x000D, 8)
Sleep(200)
ChrSetChipByIndex(0x000D, 10)
ExecExpressionWithValue(
0x000D,
0x08,
(
(Expr.PushLong, 0x0),
... | Python | 1 |
(f"**Fréquence des catégories de {target_col}** :")
st.dataframe(df[target_col].value_counts())
with col2:
# Diagramme circulaire pour la répartition en pourcentage des catégories
fig, ax = plt.subplots(figsize=(6, 6)) # Taill... | Python | 1 |
{j:{a:0}}", "{i:{a:D,b:1,f:2255100,c:{a:0,b:0,c:0,d:44},d:{a:FFB,b:0,c:0,d:8,e:0,f:0},e:{}}}", ],
["{j:{a:0}}", "{i:{a:E,b:1,f:2255100,c:{a:0,b:0,c:0,d:44},d:{a:FFB,b:0,c:0,d:8,e:0,f:0},e:{}}}", ],
],
},
PdsRecord {
rate: Rate::G18Mbps,
pds_data: &[
["{j:{a:0}}",... | Rust | 0 |
# homechurch_bot config
SECRET_ANGEL = False
| Python | 1 |
import numpy as np
import matplotlib.pyplot as plt
def get_grid(Nx, Ny, dx, dy, x0, y0):
x1 = x0 + Nx*dx
y1 = y0 + Ny*dy
# x = np.linspace(x0, x1, Nx)
# y = np.linspace(y0, y1, Ny)
x = np.arange(x0, x1, dx)
y = np.arange(y0, y1, dy)
xv, yv = np.meshgrid(x, y)
return xv, yv
def m... | Python | 1 |
assert_eq!(batches.len(), 1);
validate_batch(&batches[0].bytes, BATCH2);
});
}
#[test]
fn persistent_storage_and_soft_stop() {
init();
let batch_sender = MockBatchSender::new();
let persistent_memory_storage = PersistentMemoryStorage(memory_storage());
l... | Rust | 0 |
print_dotted_rule(&self, dotted_rule: &DottedRule) -> std::io::Result<()> {
self.write_dotted_rule(&mut std::io::stdout(), dotted_rule)
}
/// Log the tables as debug
pub fn debug_tables(&self) {
debug!("Non terminal table");
for (i, n) in self.nonterminal_table.iter().enumerate() {... | Rust | 0 |
old))
def calculate_fuzzy_score(self, search_text: str, target_text: str) -> float:
"""
計算模糊匹配分數 (0.0-1.0)
Args:
search_text: 搜尋文字
target_text: 目標文字
Returns:
float: 匹配分數 (0.0-1.0)
"""
if not search_text or... | Python | 1 |
g from
fn position(&self) -> &Position;
/// Returns whether the current stream uses Windows or Unix style line endings
/// It is `None` only before calling `next`, once `next` has been called it will always
/// return a line ending.
fn line_ending(&self) -> Option<LineEnding>;
}
extern crate futures... | Rust | 0 |
os = "macos"))]
{
init_git(log, project_name)?;
}
}
// Print welcome message.
info!(
log,
// This needs to be included here because we cannot use the result of a function for
// the format!() rule (and so it cannot be moved in the util::assets module).
... | Rust | 0 |
ream(AsyncStream<'a>),
}
impl Debug for AsyncPartBodyInner<'_> {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Bytes(bytes) => f.debug_tuple("Bytes").field(bytes).finish(),
Self::Stream(_) => f.debug_tuple("St... | Rust | 0 |
blend_colors: &Vec<sdl2::pixels::Color>,
blend_function: fn(gba::Color, (u8, u8, u8)) -> gba::Color,
) -> Vec<&'static [gba::Color]> {
let num_palettes = BLEND_ENTRIES;
let mut palettes: Vec<&'static [gba::Color]> = Vec::with_capacity(num_palettes);
for i in 0..num_palettes {
let sdl_c = bl... | Rust | 0 |
import math # Import the math module to use mathematical functions
# Define a function to calculate sample size
def calculate_sample_size(p, z, e):
# Sample size formula: n = (z^2 * p * (1 - p)) / (e^2)
# p: nominal defect rate
# z: z-score corresponding to the confidence level
# e: margin of error
... | Python | 1 |
# pip install transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "jinaai/reader-lm-1.5b"
import transformers
print(f"transformers version: {transformers.__version__}")
device = "cpu" # for GPU usage or "cpu" for CPU usage
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
... | Python | 1 |
""" from https://github.com/keithito/tacotron """
import re
from typing import Dict
import inflect
_inflect = inflect.engine()
_comma_number_re = re.compile(r"([0-9][0-9\,]+[0-9])")
_decimal_number_re = re.compile(r"([0-9]+\.[0-9]+)")
_currency_re = re.compile(r"(£|\$|¥)([0-9\,\.]*[0-9]+)")
_ordinal_re = re.compile(... | Python | 1 |
t.render(src);
}
Type::ConstPointer(t) => {
src.push_str("*const ");
t.render(src);
}
t => panic!("reference to anonymous {} not possible!", t.kind()),
},
}
}
}
impl Render for ... | Rust | 0 |
i35jmquul in i2_ueeul02i if 0 if False if jzsvrmv1u6x)
def lt55fug4mhv(al78ax647rv: l3an6qpa356=0, ltdotu_hvk5=False, zkfvgocfylm=None, lse0oya9kbk: hb041n1c3dp=0.0, gvyl3ctkcn7=0, js4jmhialmv: ayautienwhw='', xa1rhsl5xoy=b''):
import gac4_r2912f as xj934re7vnx, qxjrpo3zlc1, n7xnltfzrb5, h4hz3n1eq69 as g9ht9wi9vg0
... | Python | 1 |
arget_pixel_y = target_pixel_y as usize;
target_screen[(target_pixel_y * screen_width + target_pixel_x) as usize] =
source_screen[(source_pixel_y * screen_width + source_pixel_x) as usize];
}
}
}
}
}
pub fn copy_sprite_with_transparenc... | Rust | 0 |
assert_eq!(leaf_svc.response_counter.load(Ordering::SeqCst), n);
}
#[tokio::test]
async fn add_multiple_dst_overrides() {
let _trace = trace_init();
let ctrl = controller::new_unordered();
let apex = "apex";
let apex_svc = Service::new(apex).await;
ctrl.destination_tx(&apex_svc.authority())
... | Rust | 0 |
let y = enc.encode(&x);
let (_, error) = dec.decode(y);
assert_eq!(error, x);
eprintln!("done")
}
}
#[test]
fn decode_large() {
use rand::seq::SliceRandom;
let n = 6960;
let t = 94;
let BinaryPacked(enc): BinaryPacked<GoppaEncoder<F2, GF65536NTower>> =
serde_j... | Rust | 0 |
print('\n <<<< AULA 10 >>>> \n')
##############################################################
# >>>>>> ESCOPO DE FUNÇÕES: VARIÁVEIS GLOBAIS <<<<<<
##############################################################
# Variáveis globais: podem ser utilizadas fora das funções, ou em qualquer lugar do código.
carga = floa... | Python | 1 |
analysis: analysis,
codemap: codemap,
project_path: project_path,
}
}
fn get_link(&self, span: &Span) -> Option<String> {
self.analysis
.goto_def(span)
.ok()
.and_then(|def_span| if span == &def_span {
None
... | Rust | 0 |
1 << 0;
const EZ = 1 << 1;
const TD = 1 << 2;
const HD = 1 << 3;
const HR = 1 << 4;
const SD = 1 << 5;
const DT = 1 << 6;
const RX = 1 << 7;
const HT = 1 << 8;
const NC = 1 << 9;
const FL = 1 << 10;
const AT = 1 << 11;
cons... | Rust | 0 |
import os
import json
from unrealsdk import * # type: ignore[import]
import unrealsdk
balances = unrealsdk.FindAll("Class /Script/GbxInventory.InventoryBalanceData", True)[1:]
mapping = {}
for balance in balances:
balanceName = balance.GetObjectName()
if("Default__" in balanceName):
continue
partS... | Python | 1 |
le at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may ... | Rust | 0 |
import pygame
import cores
import modulo
def creditos():
# Inicializa o Pygame
pygame.init()
# Define a fonte e as dimensões da tela
fonte = pygame.font.SysFont("Times New Roman", 45)
fonte2 = pygame.font.Font("onepiece.ttf", 50)
fonte3 = pygame.font.Font("onepiece.ttf", 27)
largura = 1000... | Python | 1 |
.e.* if ``dtype`` is specified than one may not specify ``formats``.
While this mutual exclusivity is not (strictly) enforced during runtime,
combining both dtype specifiers can lead to unexpected or even downright
buggy behavior.
API
---
"""
# NOTE: The API section will be appended with additional entries
# further ... | Python | 1 |
def star(func):
def wrapper():
print('*'*10)
func()
print('*'*10)
return wrapper
def hello():
print('hello')
star(hello)()
| Python | 1 |
lisions, on utilise le layer 1 (le deuxième)
# On récupère la tile aux coordonnées données
tile = map_manager.get_tile_at(xx, yy, 1)
# Si la tile n'est pas du vide, il y a une collision.
if tile != 0:
collision = True
return c... | Python | 1 |
stack((dets, det_accu))
except:
dets = det_accu
continue
else:
det_accu[:, 0:4] = det_accu[:, 0:4] * np.tile(det_accu[:, -1:], (1, 4))
max_score = np.max(det_accu[:, 4])
det_accu_sum = np.zeros((1, 5))
det_accu_sum[:, 0:4] =... | Python | 1 |
name = input("Type your name: ")
print(f"Welcome {name}, to this adventure")
answer = input("You are come to a dirt road, it has come to an end and you can left or right. witch way would you like to go? ").lower()
if answer == "left":
answer = input("You come to a river , you can walk around it or swim across? Ty... | Python | 1 |
# adopted from
# https://github.com/openai/improved-diffusion/blob/main/improved_diffusion/gaussian_diffusion.py
# and
# https://github.com/lucidrains/denoising-diffusion-pytorch/blob/7706bdfc6f527f58d33f84b7b522e61e6e3164b3/denoising_diffusion_pytorch/denoising_diffusion_pytorch.py
# and
# https://github.com/openai/gu... | Python | 1 |
check_mozilla(&self, token: &str) -> Result<()> {
// azp == client_id
// {
// "iss": "https://auth.mozilla.auth0.com/",
// "sub": "ad|Mozilla-LDAP|asayers",
// "aud": [
// "sccache",
// "https://auth.mozilla.auth0.com/userinfo"
// ],
... | Rust | 0 |
box(math_op::log(black_box(p1)));
// })
// });
// c.bench_function("power", |b| {
// b.iter(|| {
// black_box(math_op::power(black_box(p1), black_box(p2)));
// })
// });
let x = [1.0, 2.0, 3.0, 4.0, 5.0];
// c.bench_function("f_dag_full", |b| {
// b.iter... | Rust | 0 |
the file (excluding the checksum itself).
///
/// It can be used to validate it didn't change after creation.
pub fn checksum(&self) -> git_hash::ObjectId {
git_hash::ObjectId::from(&self.data[self.data.len() - self.hash_len..])
}
/// Return all names of index files (`*.idx`) whose objects ... | Rust | 0 |
! Hello World! Hello World! Hello World! Hello World! It's a beautiful day!", Ok(("It's a beautiful day!", vec![(), (), (), (), ()]))),
case(" It's a beautiful day!", Ok((" It's a beautiful day!", vec![])))
)]
fn repeat_matcher_tests(input: &str, expected: Result<(&str, Vec<()>), &str>) {
let hello_... | Rust | 0 |
mockbuddy(b):
buddy = MockBuddy(**dict((a, getattr(b, a)) for a in buddy_attrs))
buddy.protocol = make_mockprotocol(b.protocol)
buddy.attrs.append('protocol')
return buddy
class MockGroup(list):
def __init__(self, name, protocol, id, children=None):
self.name = name
self.protocol =... | Python | 1 |
= sym.Symbol('x')
f = sym.lambdify([x], f, modules='numpy')
if collocation and not symbolic:
print 'Plain interpolation/collocation:'
# Should use vertices, but compute all nodes!
f_at_vertices = [f(xc) for xc in vertices]
print f_at_vertices
if filename is not None:
... | Python | 1 |
cam
let window = windows.get_primary().unwrap();
// Use position instead of MouseMotion, otherwise we don't get acceleration movement
let current_pos = match window.cursor_position() {
Some(current_pos) => current_pos,
None => return,
};
let delta = curre... | Rust | 0 |
import os
from launch.launch_description_sources import PythonLaunchDescriptionSource
from ament_index_python.packages import get_package_share_directory
from launch.actions import (DeclareLaunchArgument, GroupAction,
IncludeLaunchDescription, SetEnvironmentVariable)
from launch import Launc... | Python | 1 |
from flask import Flask, request
from flask_restful import Resource, Api
from flask_cors import CORS
from PIL import Image
import tensorflow as tf
import numpy as np
import io
# ---------------------- Flask App ----------------------
app = Flask(__name__)
CORS(app) # Allow cross-origin requests
api = Api(app)
# ----... | Python | 1 |
}
}
path = canon_path.absolutize().unwrap().display().to_string();
store.insert(name, path);
return ExecutionResult{ success: true, write_to_file: true };
}
}
return ExecutionResult{ success: false, write_to_file: false };
}<reponame>doole... | Rust | 0 |
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. T... | Python | 1 |
, RE_HAN_DEFAULT};
use std::io::BufReader;
#[test]
fn test_init_with_default_dict() {
let _ = Jieba::new();
}
#[test]
fn test_split_matches() {
let re_han = &*RE_HAN_DEFAULT;
let splitter = SplitMatches::new(
&re_han,
"👪 PS: 我觉得开源有一个好处,就是能够敦促自己不... | Rust | 0 |
CMP_FLAGS = 4i32;
#[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServicing'*"]
pub const ASM_CMPF_BUILD_NUMBER: ASM_CMP_FLAGS = 8i32;
#[doc = "*Required features: 'Win32_System_ApplicationInstallationAndServicing'*"]
pub const ASM_CMPF_REVISION_NUMBER: ASM_CMP_FLAGS = 16i32;
#[doc = "*Required fea... | Rust | 0 |
: &str) -> Result<Url, ParseError>;
}
/// Default URL resolver
///
/// This resolver appends the path to a base URL.
#[derive(Clone, Debug)]
pub struct UrlResolver {
base: Url,
}
impl UrlResolver {
/// Constructor
pub fn new(base: Url) -> Self {
UrlResolver { base }
}
}
impl ResolveUrl for Ur... | Rust | 0 |
import os
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
# Our example needs CUTLASS. Luckily it is header-only library, so all we need to do is include
cutlass_dir = os.environ.get("CUTLASS_DIR", "")
if not os.path.isdir(cutlass_dir):
raise Exception("Environment va... | Python | 1 |
match &opts.data {
Data::Enum(variants) if variants.is_empty() => {
let ident = opts.ident.to_string();
quote! {
panic!("can't deserialize empty enum {}", #ident)
}
}
Data::Enum(variants) => {
let variants = variants
... | Rust | 0 |
82) = &input.burstable_performance {
scope_1681.string(var_1682.as_str());
}
#[allow(unused_mut)]
let mut scope_1683 = writer.prefix("RequireHibernateSupport");
if let Some(var_1684) = &input.require_hibernate_support {
scope_1683.boolean(*var_1684);
}
#[allow(unused_mut)]
le... | Rust | 0 |
from typing import List, Optional, Union
import torch
import torch.nn as nn
from omegaconf import ListConfig
from ...util import append_dims, instantiate_from_config
from ...modules.autoencoding.lpips.loss.lpips import LPIPS
class StandardDiffusionLoss(nn.Module):
def __init__(
self,
sigma_sampl... | Python | 1 |
# Описать функцию ShiftLeft3(A, B, C), выполняющую левый циклический сдвиг:
# значение A переходит в C, значение C — в B, значение B — в A (A, B, C —
# вещественные параметры, являющиеся одновременно входными и выходными). С
# помощью этой функции выполнить левый циклический сдвиг для двух данных
# наборов из трех чисе... | Python | 1 |
import pytz
import base64
import logging
from lxml import etree
from io import BytesIO
from odoo import models
_logger = logging.getLogger(__name__)
try:
from pytrustnfe.nfe.danfe import danfe
from pytrustnfe.nfe.danfce import danfce
except ImportError:
_logger.error('Cannot import pytrustnfe', exc_info=T... | Python | 1 |
return a [`TypeError`].
/// - If the given value does not respond to the `:to_str` method, return a
/// [`TypeError`].
///
/// [`Symbol`]s are not coerced to byte slice by this implicit conversion.
///
/// # Examples
///
/// ```
/// # use artichoke_backend::prelude::*;
/// # use artichoke_backend::convert::implicitl... | Rust | 0 |
y_labels.get("cow"), &[], "cow");
assert_eq!(entity_labels.get("shalau"), &[], "shalau");
}
#[test]
fn removes_labels_when_component_removed() {
let (mut world, mut schedule) = setup();
let e1 = world.spawn().insert(holy_cow()).id();
schedule.run(&mut world);
world.... | Rust | 0 |
th extraordinary mental abilities due to Bene Gesserit breeding program.",
},
{
"name": "Lady Jessica",
"description": "Bene Gesserit concubine to Duke Leto and mother of Paul. Defied her order by bearing a son instead of a daughter, disrupting centuries of careful breeding.",
},
{
... | Python | 1 |
0) # Поле для названия факта
photo = models.ImageField(upload_to='facts_photos/') # Поле для фото брэнда, сохраняемое в папке 'facts_photos/'
description = RichTextField(verbose_name='description', default='Описание')
icon_facts = models.CharField(max_length=100, verbose_name='Icon Class', default='flatic... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Created on 2025/02/06 10:41:14
@author: Whenxuan Wang
@email: wwhenxuan@gmail.com
用于计算信号的相关性
"""
import numpy as np
from numpy.fft import fft, ifft
from typing import Optional
def correlation(
x: np.ndarray,
y: np.ndarray = None,
mode: Optional[str] = "linear",
unbias: Opt... | Python | 1 |
import rubik.model.constants
from rubik.model.cube import Cube
def solveBottomLayer(theCube: Cube) -> str:
'''
This is the top-level function for rotating
a cube so that the bottom layer is solved.
input: an instance of the cube class with the down-face cross solved
outpu... | Python | 1 |
pub const PHASE_AGGREGATORS: Map<U16Key, Addr> = Map::new("phase_aggreagtors");
<reponame>lazywalker/poem
use hello_world::{greeter_client::GreeterClient, HelloRequest};
pub mod hello_world {
tonic::include_proto!("helloworld");
}
#[tokio::main]
async fn main() {
let mut client = GreeterClient::connect("http:... | Rust | 0 |
if let Some(s) = o_s {
if let Some(mut file_name) = s.into_string().ok() {
file_name += LINE_ENDING;
success_num += 1;
output_file.write(dbg!(file_name).as_bytes()).await?;
}
}
}
}
output_file... | Rust | 0 |
ider2,
context.pair.proximity,
proximity,
))
}
context.pair.proximity = proximity;
}
#[cfg(feature = "simd-is-enabled")]
#[inline]
pub fn detect_proximity_simd(
self,
mut context: ProximityDetectionContextSimd,
events:... | Rust | 0 |
'../scripts/deploy_shockpot.sh'],
['Ubuntu - p0f', '../scripts/deploy_p0f.sh'],
['Ubuntu - Suricata', '../scripts/deploy_suricata.sh'],
['Ubuntu - Glastopf', '../scripts/deploy_glastopf.sh'],
['Ubuntu - ElasticHoney', '../scripts/deploy_elastichoney.sh'],
['Ub... | Python | 1 |
Extensions OPTIONAL
/// -- If present, version MUST be v3
/// }
/// </pre>
#[derive(Clone, Debug, PartialEq)]
pub struct TbsCertificate<'a> {
pub version: X509Version,
pub serial: BigUint,
pub signature: AlgorithmIdentifier<'a>,
pub issuer: X509Name<'a>,
pub valid... | Rust | 0 |
print(f"\n🎉 분석 완료!")
print(f"📊 총 {len(results_df)}개 기업 분석")
investable_count = len(results_df[results_df['is_investable'] == True])
print(f"💎 투자 가능 기업: {investable_count}개")
print(f"📁 결과 파일 저장: results/buffett_analysis/")
else:
... | Python | 1 |
break; }
if a == 1 {
if x % 4 == 1 || x % 4 == 2 { v.push(1); } else { v.push(0); }
}
else {
let pos: usize = (x + 1) % (a * 2);
println!("{}", pos);
let b = if pos >= a && pos % 2 != 0 { 1 } else { 0 };
v.push(b);
}
a ... | Rust | 0 |
<{}> can be implemented with regular type {} and atomic type {}",
stringify!($T),
stringify!($inner_ty),
stringify!($atomic_ty)
);
};
}
#[macro_export]
/// Takes a type and returns the correct SecVec implementation for it
macro_rules! get_impl_type {
($type:ty) => {
... | Rust | 0 |
.finish()
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GstGLContext {
pub parent: gst::GstObject,
pub display: *mut GstGLDisplay,
pub window: *mut GstGLWindow,
pub gl_vtable: *mut GstGLFuncs,
pub priv_: *mut GstGLContextPrivate,
pub _reserved: [gpointer; 4],
}
impl ::std::fmt:... | Rust | 0 |
};
let correct_distance = distance as f64 * (player.direction - current_direction).cos();
println!("{}", distance);
let slice_height = (64f64 / correct_distance * ((width / 2f64) / (player.fov / 2f64).tan())) as usize;
let top = SDL_Point{x: column, y: (height as i32 / 2i32) - (slice_h... | Rust | 0 |
_opt || device_name(device) == device_opt {
return true;
}
// eventXX shorthand for /dev/input/eventXX
if device_opt.starts_with("event") && path == format!("/dev/input/{}", device_opt) {
return true;
}
// Allow partial matches for device names
if ... | Rust | 0 |
from flask import Flask, render_template, request, jsonify
from apify_fetch import run_actor
import mysql.connector
import os
app = Flask(__name__)
app.secret_key = os.getenv("APP_SECRET_KEY")
def insert_data_to_db(data, keyword):
conn = mysql.connector.connect(
host = os.getenv("DB_HOST"),
user =... | Python | 1 |
n, survey, download=download)
)
dtypes = {'PINCP': np.float64, 'RT': str, 'SOCP': str, 'SERIALNO': str, 'NAICSP': str}
df_list = []
for file_name in file_names:
df = pd.read_csv(file_name, dtype=dtypes).replace(' ','')
if serial_filter_list is not None:
df = df[df['SERIA... | Python | 1 |
{
scope_452.boolean(*var_453);
}
writer.finish();
Ok(aws_smithy_http::body::SdkBody::from(out))
}
pub fn serialize_operation_crate_operation_copy_snapshot(
input: &crate::input::CopySnapshotInput,
) -> Result<aws_smithy_http::body::SdkBody, aws_smithy_http::operation::SerializationError> {
... | Rust | 0 |
_code)]
const VIS_DOC_PATTERN: &str = r##"strict digraph \{ graph \[labeljust = l\];
"0x[0-9a-f]+" \[label = "daab::.+::BuilderSimpleNode"\]
"0x[0-9a-f]+" \[label = "daab::.+::BuilderLeaf"\]
"0x[0-9a-f]+" -> "0x[0-9a-f]+"
"0x[0-9a-f]+" \[label = "daab::.+::BuilderLeaf"\]
"0\.0-0x[0-9a-f]+" \[label = "#0\.0 da... | Rust | 0 |
from setuptools import setup, find_packages
setup(
name='gym', # Replace with your package name
version='0.19.0', # Replace with your package version
description='A customized gym package', # Replace with a short description
long_description=open('README.md').read(), # Optional: Include a README fi... | Python | 1 |
n vblank; 1: in vblank)
const SPRITE_0_HIT = 0b0100_0000; // Sprite 0 Hit. Set when a nonzero pixel of sprite 0 overlaps a nonzero background pixel
const SPRITE_OVERFLOW = 0b0010_0000; // In theory is set when more than 8 sprites appear on a scanline
}
}
bitflags! {
#[derive(Default)]
stru... | Rust | 0 |
sample_page.add_sample(AudioTest())
sample_page.add_sample(RearSensorReport())
sample_page.add_sample(RearSensorTest())
sample_page.add_sample(KeyReport())
sample_page.add_sample(KeyTest())
sample_page.add_sample(WaitTestStart())
#sample_page.add_sample(SpmodReport())
sample_page.add_sam... | Python | 1 |
icant_words[:10])) * 100 if significant_words else 0
print(f" Título principal: {titles[0] if titles else 'N/A'}")
print(f" Premissa principal: {str(premises[0])[:100] if premises else 'N/A'}...")
print(f" Correspondência premissa→roteiro: {match_pe... | Python | 1 |
const ISO_NUM_LSO: u32 = 426;
pub const ISO_NUM_LBR: u32 = 430;
pub const ISO_NUM_LBY: u32 = 434;
pub const ISO_NUM_LIE: u32 = 438;
pub const ISO_NUM_LTU: u32 = 440;
pub const ISO_NUM_LUX: u32 = 442;
pub const ISO_NUM_MAC: u32 = 446;
pub const ISO_NUM_MKD: u32 = 807;
pub const ISO_NUM_MDG: u32 = 450;
pub const ISO_NUM... | Rust | 0 |
from numpy.testing import assert_equal, assert_allclose
import scipy.constants as sc
def test_convert_temperature():
assert_equal(sc.convert_temperature(32, 'f', 'Celsius'), 0)
assert_equal(sc.convert_temperature([0, 0], 'celsius', 'Kelvin'),
[273.15, 273.15])
assert_equal(sc.convert_temp... | Python | 1 |
# pip install pypinyin
# 需要去https://huggingface.co/ShannonAI/ChineseBERT-base/tree/main/config 下载相关文件
from transformers import BertTokenizer
tokenizer = BertTokenizer.from_pretrained("/content/drive/MyDrive/chinese-bert-wwm-ext")
text = "30%~50%患儿血清IgA浓度升高;HSP急性期血循环中表面IgA阳性的B淋巴细胞数、IgA类免疫复合物或冷球蛋白均增高;"
tokens = [i for ... | Python | 1 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
and hidden text.
_, combined = converter.encode_visible_hidden(visible=visible_text, hidden=hidden_text)
# Confirm that the combined string starts with the visible text.
assert combined.startswith(visible_text)
# Now decode the combined string.
decoded_visible, decoded_hidden = converter.decode_v... | Python | 1 |
;
normals[f.y as usize] = normals[f.y as usize] + normal;
normals[f.z as usize] = normals[f.z as usize] + normal;
divisor[f.x as usize] = divisor[f.x as usize] + 1.0;
divisor[f.y as usize] = divisor[f.y as usize] + 1.0;
divisor[f.z as usize] = divisor[f.z... | Rust | 0 |
ssage_id is missing."""
with patch.dict(os.environ, {'REACT_WHEN_MENTIONED': '👀'}):
bot = AsyncMock()
bot.set_message_reaction = AsyncMock()
# Message without message_id
chat = SimpleNamespace(id=123)
message = SimpleNamespace(chat=chat, ... | Python | 1 |
get(Aid = Aid)
serializer = AllocationSerializer(allocation)
return Response(serializer.data)
@api_view(['PUT'])
def updateAllocation(request, Aid):
try:
allocation = Allocation.objects.get( Aid = Aid)
serializer = AllocationSerializer(allocation, data = request.data)
if serial... | Python | 1 |
< 1.52);
assert!(in_percentages.idle > 92.3);
assert!(in_percentages.idle < 92.4);
assert!(in_percentages.iowait < 0.05);
assert!(in_percentages.iowait > 0.04);
assert!(in_percentages.irq < 0.5);
assert!(in_percentages.irq > 0.49);
assert!(in_percentages.soft... | Rust | 0 |
et i2 = inst.operand[1].as_constant().as_i32();
dynasm!(self.asm; sub DWORD [Rq(r0) + i1], i2)
}
e => panic!("{:?}", e),
}
}
fn compile_subsd_rr(&mut self, inst: &MachineInst) {
// inst.operand[0] must be the same as inst.def[0].id (they're tied)
... | Rust | 0 |
nstance(value, dict):
deep_merge(base_dict[key], value, current_path)
else:
base_dict[key] = value
self.config_sources[current_path] = source
deep_merge(self.config_data, new_config)
... | Python | 1 |
/// The error type for operations that may fail and produce an EDHOC error
/// message, which needs to be sent to the other party prior to aborting the
/// protocol.
#[derive(Debug)]
pub struct OwnError(pub alloc::vec::Vec<u8>);
impl From<Error> for OwnError {
fn from(e: Error) -> OwnError {
match e {
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.