text string | label_name string | labels int64 |
|---|---|---|
()
nameEntry = tk.Entry(master=input_frame, textvariable=self.nameEntry)
nameEntry.grid(row=0, column=1, padx=5, pady=5)
# Email input
emailLabel = tk.Label(master=input_frame, text="Email: ", font="Arial 12")
emailLabel.grid(row=1, column=0, padx=5, pady=5)
self.emailEn... | Python | 1 |
from django.contrib import admin
from friends.models import Contact
from friends.models import Friendship, FriendshipInvitation, FriendshipInvitationHistory
from friends.models import JoinInvitation
class ContactAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'email', 'user', 'added')
class FriendshipAd... | Python | 1 |
should!("parse thursday", {
let result = locale::french_fr::weekday(chrono::weekday::Thursday);
must!(result eq ~"jeudi")
})
should!("parse friday", {
let result = locale::french_fr::weekday(chrono::weekday::Friday);
must!(result eq ~"vendredi")
})
should!("parse saturday",... | Rust | 0 |
let reply = MergeReply {};
timer.observe_duration();
Ok(Response::new(reply))
}
Err(e) => {
timer.observe_duration();
Err(Status::new(
Code::Internal,
format!("failed to merge in... | Rust | 0 |
se repr::adt::numeric;
use repr::{Datum, Row};
use super::envelope_debezium::DebeziumSourceCoordinates;
use super::{AvroDebeziumDecoder, ConfluentAvroResolver, EnvelopeType, RowCoordinates};
/// Manages decoding of Avro-encoded bytes.
pub struct Decoder {
csr_avro: ConfluentAvroResolver,
envelope: EnvelopeTyp... | Rust | 0 |
code = """
MDCard:
size_hint_y: None
height: dp(50)
elevation: 10
padding: dp(0)
radius: [0, 0,25, 25]
md_bg_color: app.theme_cls.bg_dark
ScrollView:
do_scroll_x: True
do_scroll_y:... | Python | 1 |
tus.OK
source = await resp.json()
assert source == expected_replaced_source_dump
source = (await BaseService.get_service('data_svc').locate('sources', {'id': '123'}))[0]
assert source.display_schema.dump(source) == expected_replaced_source_dump
async def test_unautho... | Python | 1 |
());
substring_start_position = substring_end_position + token.len();
// println!("Start position at the end of for substring... {:?}", &substring_start_position);
}
remaining_substring = &string[substring_start_position..];
interm_res = ve... | Rust | 0 |
BufferLocation: location + ibv.offset,
SizeInBytes: ibv.buffer.size_in_bytes - ibv.offset as u32,
Format: format,
};
unsafe {
self.raw.IASetIndexBuffer(&mut ibv_raw);
}
}
fn bind_vertex_buffers(&mut self, vbs: pso::VertexBufferSet<Backend... | Rust | 0 |
fn for_each_mut<
F: FnMut(&TypeId, &mut Box<dyn $trait_name>) -> Result<(), Error>,
>(
&mut self,
func: &mut F,
) -> Result<(), Error> {
for (id, h) in self.map.iter_mut() {
for x in ... | Rust | 0 |
{ core::_InputArray::from_raw(ptr) } )
}
}
impl core::ToInputArray for &VectorOff64 {
#[inline]
fn input_array(&self) -> Result<core::_InputArray> {
(*self).input_array()
}
}
impl core::ToOutputArray for VectorOff64 {
#[inline]
fn output_array(&mut self) -> Result<core::_OutputArray> {
extern ... | Rust | 0 |
, Clone, Hash, Eq, PartialEq)]
pub struct ByondPath {
segments: Vec<String>,
rooted: bool,
}
impl ByondPath {
pub fn new<P: AsRef<str>>(segments: &[P], rooted: bool) -> ByondPath {
let mut vec = vec![];
for x in segments {
vec.push(x.as_ref().to_owned());
}
Byond... | Rust | 0 |
"""A collection of string constants.
Public module variables:
whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a ... | Python | 1 |
#[test]
fn output_within_normal_parameters_only_above_min_rpm() {
let mut test_bed = EmergencyGeneratorTestBed::new();
test_bed.command(|a| a.attempt_emer_gen_start());
test_bed.run_with_delta(Duration::from_secs(10));
assert!(test_bed.query(|a| a
.generator_output_wit... | Rust | 0 |
Dim = U3;
type NodalDim = U20;
#[rustfmt::skip]
#[replace_float_literals(T::from_f64(literal).expect("Literal must fit in T"))]
fn evaluate_basis(&self, xi: &Point3<T>) -> OMatrix<T, U1, U20> {
// We define the shape functions as N_{alpha, beta, gamma} evaluated at xi such that
// N_{a... | Rust | 0 |
"C" fn CMap_set_wmode(mut cmap: *mut CMap, mut wmode: i32) {
assert!(!cmap.is_null());
(*cmap).wmode = wmode;
}
#[no_mangle]
pub unsafe extern "C" fn CMap_set_CIDSysInfo(mut cmap: *mut CMap, mut csi: *const CIDSysInfo) {
assert!(!cmap.is_null());
if !(*cmap).CSI.is_null() {
free((*(*cmap).CSI).r... | Rust | 0 |
] credential 七牛认证信息
/// @retval qiniu_ng_client_t 获取创建的七牛 SDK 客户端实例
/// @warning 务必在使用完毕后调用 `qiniu_ng_client_free()` 方法释放 `qiniu_ng_client_t`
/// @warning 务必在 `credential` 被使用完毕后调用 `qiniu_ng_credential_free()` 方法释放 `qiniu_ng_credential_t`
#[no_mangle]
pub extern "C" fn qiniu_ng_client_new_default_from_credential(creden... | Rust | 0 |
our Coursera Hub.
# 2. Add your image to this Jupyter Notebook's directory, in the "images" folder
# 3. Write your image's name in the following code
# 4. Run the code and check if the algorithm is right!
# In[ ]:
import scipy
from PIL import Image
from scipy import ndimage
## START CODE HERE ## (PUT YOU... | Python | 1 |
dx].replace('\n', '') for idx in iter_dict[key]]
else:
example_input = [raw_data[idx] for idx in iter_dict[key]]
example_output = [categories[labels[idx].item()] for idx in map_dict[key]]
messages = create_chat_message(context=raw_content, version='icl', example_inpu... | Python | 1 |
(DLevel::In, iny * SIDE_LEN + inx)
});
ns.collect()
} else {
vec![(DLevel::Same, npos)]
}
} else {
let npos16 = mid + i16::from(*dy) * i16::from(SIDE_LEN) + ... | Rust | 0 |
erty="revenue_analytics_product.name", type="revenue_analytics")
],
),
),
# Comprehensive filter combination
EvalCase(
input="Show me my revenue in 2023 split by product for those in Austria",
expected=RevenueAnalyti... | Python | 1 |
gb::new(0xFA, 0x80, 0x72);
pub static SANDYBROWN: Rgb<u8, Srgb> = Rgb::new(0xFA, 0xA4, 0x60);
pub static SEAGREEN: Rgb<u8, Srgb> = Rgb::new(0x2E, 0x8B, 0x57);
pub static SEASHELL: Rgb<u8, Srgb> = Rgb::new(0xFF, 0xF5, 0xEE);
pub static SIENNA: R... | Rust | 0 |
# Import necessary libraries
import matplotlib.pyplot as plt # For creating visualizations
import pandas as pd # For data manipulation and processing
import matplotlib.patches as mpatches # For custom legend creation
# Step 1: Read the dataset
# Reads specific columns (0, 1, 2, and 3) from the CSV file at the given... | Python | 1 |
b struct ListOfPathInputs {
pub nodes: (List<Symbol, SpecifyInputTerminalDescriptor>,),
}
#[derive(Clone, Debug, PartialEq, Node)]
pub struct ListOfPathOutputs {
pub nodes: (List<Symbol, SpecifyOutputTerminalDescriptor>,),
}
<filename>src/days/day14/mod.rs
//! # Day 14: Docking Data
//!
//! As your ferry appro... | Rust | 0 |
import numpy as np
from qtpy.QtCore import Qt
from qtpy.QtWidgets import (
QWidget,
)
from superqt import QLabeledSlider
from napari._qt.layer_controls.widgets.qt_widget_controls_base import (
QtWidgetControlsBase,
QtWrappedLabel,
)
from napari._qt.utils import qt_signals_blocked
from napari.layers import ... | Python | 1 |
anno2plt(annos[0], color_dict, 2, frame_id=frame_id, xz=False)
for rec in rec_list:
ax.add_patch(rec)
# 1. draw lidar center points if exist
if pts is not None:
x = pts[:, 0]
y = pts[:, 1]
ax.scatter(x, y, c='black', s=0.1)
# 2. overlay centers
if centers is not ... | Python | 1 |
let confidentiality_tags = if has_top_privilege {
// Remove all the confidentiality tags if the node has the `top` privilege.
// TODO(#1631): When we have a separate top for each sub-lattice, this check should be
// done separately for each sub-lattice, removing only the tags belongi... | Rust | 0 |
WindowsAndMessaging'*"]
pub const OBJID_SIZEGRIP: OBJECT_IDENTIFIER = -7i32;
#[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"]
pub const OBJID_CARET: OBJECT_IDENTIFIER = -8i32;
#[doc = "*Required features: 'Win32_UI_WindowsAndMessaging'*"]
pub const OBJID_CURSOR: OBJECT_IDENTIFIER = -9i32;
#[doc = "*Requir... | Rust | 0 |
logger.info(f"🔄 INICIANDO MONITORAMENTO CONTÍNUO")
logger.info(f"⏰ Verificando a cada {check_interval_hours} horas")
self.telegram.send_monitoring_start(check_interval_hours)
while True:
try:
logger.info("🔍 Verificando... | Python | 1 |
is_sane = 0 as libc::c_int
} else {
*pcol_usage.offset(pcol as isize) = 1 as libc::c_int
}
i = i.wrapping_add(1)
}
/* verify that all components are targeted at least once */
i = 0 as libc::c_int as OPJ_UINT16;
while (i as libc::c_int) < nr_channels_0 as libc::c_int {
... | Rust | 0 |
@unittest.skipIf(torch_device != 'cuda', reason=
'CUDA and CPU are required to switch devices')
def test_to_device(self):
components = self.get_dummy_components()
pipe = self.pipeline_class(**components)
pipe.set_progress_bar_config(disable=None)
pipe.to('cpu')
model_devices = [component.device.... | Python | 1 |
x: &DiagnosticsContext<'_>,
d: &hir::MismatchedArgCount,
) -> Result<FileRange, FileRange> {
let full_range = ctx.sema.diagnostics_display_range(d.call_expr.clone().map(|it| it.into()));
let source_file = ctx.sema.db.parse(full_range.file_id);
let expr = find_node_at_range::<ast::Expr>(&source_file.syn... | Rust | 0 |
{
'name': "India ENet Batch Payment CSV Generator",
'summary': """Export batch payments as ENet files""",
'category': 'Accounting/Accounting',
'description': """
Generate csv files for vendor batch payments,which can be uploaded to the bank for ENet payments.
""",
'version': '1.0',
'depends'... | Python | 1 |
lename>definitions/src/instructions.rs
// For fast decoding and cache friendly, RISC-V instruction is decoded
// into 64 bit unsigned integer in the following format:
//
// +-----+-----+-----+-----+-----+-----+-----+-----+
// | | rs2 | rs1 | flg | op2 | rd | op | R-type
// +-----+-----+-----+-----+-----+---... | Rust | 0 |
# Copyright (c) 2024 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 |
ayers]
if initializer is not None:
initialize_from_cfg(self, initializer)
def get_outplanes(self):
"""
get dimension of the output tensor
"""
return self.out_planes
def forward(self, x):
x = x['image']
features = []
# stem
x ... | Python | 1 |
]),
y_minus_x: Fe([ 0x47ff83362127d, 0x8e39af82b1f4, 0x488322ef27dab, 0x1973738a2a1a4, 0xe645912219f7 ]),
xy2d: Fe([ 0x72f31d8394627, 0x7bd294a200f1, 0x665be00e274c6, 0x43de8f1b6368b, 0x318c8d9393a9a ]),
},
GePrecomp {
y_plus_x: Fe([ 0x69e29ab1dd398, 0x30685b3c76bac,... | Rust | 0 |
#Paper 2 Long Answer June 23/22 PYTHON
# THIS CODE WILL NOT RUN!!!
# This is the code they expect you to write in the exam, it assumes variables and arrays are all setup
AccID = int(input("Please enter your account number: "))
Valid = False
if AccID < 0 or AccID >= Size:
print("Invalid Account Number")
else:
N... | Python | 1 |
alternatives {
// ($gen: expr ; $($e: expr),*) => {
// alternatives!($gen, 0 ; $($e),*)
// };
// ($gen: expr, $n: expr $(, ($i: expr, $b: expr))* ; ) => {
// match $gen.next_u32() % $n {
// $($i => $b , )*
// _ => unreachable!()
// }
// };
// ... | Rust | 0 |
# create nodes by instantiation
LeftBracketcomfy3dRightBracketSpacetriplaneSpacegaussianSpacetransformers_1 = LeftBracketComfy3DRightBracketSpaceTriplaneSpaceGaussianSpaceTransformers(cam_dist=1.9000000000000001)
LeftBracketcomfy3dRightBracketSpaceloadSpacetriplaneSpacegaussianSpacetransformers_3 = LeftBracketComfy3DRi... | Python | 1 |
size limit, and some of them are necessary to preserve the
// intention of the original pattern. For example, the Unicode flag
// will impact how the WordMatcher functions, namely, whether its
// word boundaries are Unicode aware or not.
RegexBuilder::new(&pattern)
.nest_lim... | Rust | 0 |
let mut existing_values = existing_values.into_iter();
let mut new_values = new_values.into_iter();
let mut new_value = some_or_continue!(new_values.next());
let mut existing_value = some_or!(existing_values.next(), {
loop {
let new_new = some_or_continue!(new_values.next());
if new_new == new_... | Rust | 0 |
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("catalog", "0003_alter_product_category"),
]
operations = [
migrations.AlterField(
model_name="product",
name="category",
... | Python | 1 |
}
pdf_add_dict(
(*font).fontdict,
pdf_new_name(b"Encoding\x00" as *const u8 as *const i8),
pdf_new_name((*font).encoding),
);
__cache.count += 1;
font_id
}
/* This is dvipdfmx, an eXtended version of dvipdfm by <NAME>.
Copyright (C) 2002-2016 by <NAME> and <NAME>,
th... | Rust | 0 |
import ipyvuetify as v
import traitlets
from ...state_traitlets_helpers import GlueState
from ...vuetify_helpers import link_glue_choices
__all__ = ['ProfileViewerStateWidget']
class ProfileViewerStateWidget(v.VuetifyTemplate):
template_file = (__file__, 'viewer_profile.vue')
glue_state = GlueState().tag(sy... | Python | 1 |
is the
/// latest, and thus the one we want.
fn read_latest_version(versions: &Versions, flag_allow_prerelease: bool) -> Result<Dependency> {
let latest = versions
.versions
.iter()
.filter(|&v| flag_allow_prerelease || version_is_stable(v))
.find(|&v| !v.yanked)
.ok_or(Erro... | Rust | 0 |
_new!(Fr, "2"), field_new!(Fr, "3")];
// 3 x 1 (column) vector
let rhs: Matrix<G1Affine> = vec![
vec![g1gen.mul(field_new!(Fr, "4")).into_affine()],
vec![g1gen.mul(field_new!(Fr, "5")).into_affine()],
vec![g1gen.mul(field_new!(Fr, "6")).into_affine()]
];
... | Rust | 0 |
<{}>",
instr,
dbg.get_file()?.module().get_func(*index).unwrap().name()
),
_ => instr.to_string(),
};
Ok(result)
}
fn calc_start_indent(code: &[Instruction]) -> usize {
let mut indent: isize = 0;
let mut min_indent: isize = 0;
for instr in code {
mat... | Rust | 0 |
(*x);
}
result_increacing
}
fn main() {
let v = all_divisors(36);
for x in v {
println!("{}", x);
}
}
use std::ffi::{OsStr, OsString};
use kiruna::Priority;
use std::process::ExitStatus;
use crate::Error;
use std::os::windows::process::ExitStatusExt;
use winbindings::Windows::Win32::Syste... | Rust | 0 |
rs and decimal points, until 'E' or 'D' is found
if (not found_exp):
if b'0' <= c <= b'9':
mantissa *= 10
mantissa += ord(c) - ord(b'0')
if found_point:
exp10 -= 1
# keep track of precision digits
if ... | Python | 1 |
", "example", "app")
//! .with(|_| service)
//! .build()
//! .unwrap();
//!
//! println!("cache dir: {}", dirs.cache_dir());
//! println!("config dir: {}", dirs.config_dir());
//! println!("data dir: {}", dirs.data_dir());
//! ```
#![forbid(unsafe_code)]
#![deny(
missing_docs,
rust_2018_idioms,
... | Rust | 0 |
from pathlib import Path
from syndicate.core.generators import _mkdir, _write_content_to_file
from syndicate.core.generators.contents import PYTHON_TESTS_INIT_CONTENT, \
PYTHON_TESTS_INIT_LAMBDA_TEMPLATE, PYTHON_TESTS_BASIC_TEST_CASE_TEMPLATE
from syndicate.core.helper import string_to_capitalized_camel_case
PYTH... | Python | 1 |
pub slot: Box<WidgetNodePrefab>,
#[serde(default)]
pub renderer_effect: Option<AreaBoxRendererEffect>,
}
<filename>core/src/ledger_cleanup_service.rs
//! The `ledger_cleanup_service` drops older ledger data to limit disk space usage
use solana_ledger::blockstore::Blockstore;
use solana_ledger::blockstore_... | Rust | 0 |
== " MPa"
assert si_kn_m.stress_unit == " kPa"
assert si_n_mm.stress_scale == pytest.approx(1)
assert si_kn_m.stress_scale == pytest.approx(1e3)
si_n_mm.length = "um"
assert si_n_mm.stress_unit == " N/um^2"
si_n_mm.length = "mm"
assert si_n_mm.length_3_unit == " mm^3"
assert si_kn_m.len... | Python | 1 |
}
}
macro_rules! dict {
($fname:ident, $num_values:expr, $batch_size:expr, $ty:ident, $pty:expr,
$gen_data_fn:expr) => {
#[bench]
fn $fname(bench: &mut Bencher) {
let mem_tracker = Rc::new(MemTracker::new());
let mut encoder = DictEncoder::<$ty>::new(
Rc::new(col_desc(0, $pty)), mem_tr... | Rust | 0 |
["position"]["x"],
sticker_data["position"]["y"]
))
sticker = sticker.resize(width=sticker_data["size"]["width"])
sticker = sticker.set_duration(sticker_data["duration"])
return CompositeVideoClip([base_clip, sticker]) # 合成贴纸和视频
def apply_effect(clip, effect_data):
"""应用视频特效
Args:
... | Python | 1 |
es(_core.ClosedResourceError):
await a.recv(1)
async with _core.open_nursery() as nursery:
nursery.start_soon(sender)
nursery.start_soon(receiver)
await wait_all_tasks_blocked()
a.close()
async def test_many_sockets() -> None:
total = 5000 ... | Python | 1 |
def get_china_stocks():
"""Fix 50 nagyobb kínai részvénylista (név + yfinance ticker + TradingView ticker)"""
return [
("Alibaba (HK)", "9988.HK", "HKEX-9988"),
("Tencent", "0700.HK", "HKEX-0700"),
("Meituan", "3690.HK", "HKEX-3690"),
("Xiaomi", "1810.HK", "HKEX-1810"),
(... | Python | 1 |
from django.shortcuts import get_object_or_404, redirect, render
from django.contrib.auth.decorators import login_required
from .models import Note
from .forms import NoteForm
@login_required(login_url='login')
def home(request):
notes = Note.objects.filter(user=request.user).order_by('-created_at')
return ren... | Python | 1 |
import math
import torch
from torch import nn
# https://github.com/Lose-Code/UBRFC-Net
# https://www.sciencedirect.com/science/article/abs/pii/S0893608024002387
'''
用于图像去雾的无监督双向对比重建和自适应细粒度信道注意力网络 SCI 一区 2024 顶刊
捕捉全局和局部信息交互即插即用注意力模块:FCAttention
无监督算法在图像去雾领域取得了显著成果。此外,SE通道注意力机制仅利用全连接层捕捉全局信息,
缺乏与局部信息的互动,导致图像去雾时特征权重分... | Python | 1 |
r r r8 r r r6 r6 r6 r7 r s
r c @ s4 e Zd ZdZdZdd Zedd Zedd Zd S )
r z
Exclude blanks
r c K s d S r- r6 )r5 kwr6 r6 r7 r8 s zBlankFilter.__init__c C ... | Python | 1 |
from collections import defaultdict
import numpy as np
import matplotlib.pyplot as plt
def precision_recall(results, keywords):
per_label_stats = defaultdict(lambda: {"TP": 0, "FP": 0, "FN": 0})
for _, true, pred, _ in results:
if pred in keywords:
if pred == true:
per... | Python | 1 |
oader(), training_config['max_epochs'], viz_dir / f"phase1_epoch_{training_config['max_epochs']}.png")
# Save trained model
model_path = output_dir / "phase1_model.ckpt"
trainer.save_checkpoint(model_path)
print(f"\\n💾 Phase 1 model saved: {model_path}")
# Print summary
print("\\n" + ... | Python | 1 |
this can be faster using what is available between multithreading, GPU or SIMD instructions
fn add(&self, v: &Vector) -> Vector {
let size = cmp::max(self.len(), v.len());
let mut x: Vec<Complex64> = Vec::with_capacity(size);
for n in 0..size {
x.push(self.at(n) + v.at(n));
... | Rust | 0 |
omErrorFromVisitor,
labels: vec![
DiagnosticLabel::new(msg, enum_span, DiagnosticLabelPriority::Primary),
DiagnosticLabel::new(
"Variant selected here.",
key_span,
DiagnosticLabelPriority::Auxiliary,
),
],
});
Err(ErrorKind::Reported.into())
}
}
<reponame>Eric-Arellano/rust
// run-... | Rust | 0 |
'type': 'ValidationError',
}
],
)
def test_validate_sector_value_lengths(self):
row = {
'sector': [
('Agriculture AgricultureAgricultureAgricultureAgricultureAg'
'ricultureAgricultureAgricultureAgricultureAgricultureA... | Python | 1 |
fn connect_property_justify_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_max_width_cha... | Rust | 0 |
def operacionMatematica(operando1,operando2,operacion):
if operacion == "suma":
suma = operando1 + operando2;
return suma
elif operacion == "resta":
resta = operando1 - operando2
return resta
print(operacionMatematica(1,2,"suma"))
print(operacionMatematica(1,2))
| Python | 1 |
_public_key(self.key.as_ref())
.map(|key| key.as_hex())
.map_err(|e| Error::Signing(e))
}
pub fn sign(&self, message: &[u8]) -> Result<String> {
self.context
.sign(message, self.key.as_ref())
.map_err(|e| Error::Signing(e))
}
pub fn new() -> Resu... | Rust | 0 |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applica... | Python | 1 |
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def plot_age_group_survival():
df = pd.read_csv("../Cleaned_titanic_data.csv")
df["age_group"] = pd.cut(df["age"], bins=[0, 12, 25, 50, 100], labels=["Child", "Young Adult", "Middle-aged", "Senior"])
survival_data = df.groupby(["sur... | Python | 1 |
rect: Rect, radius: f64) -> D2D1_ROUNDED_RECT {
D2D1_ROUNDED_RECT {
rect: rect_to_rectf(rect),
radiusX: radius as f32,
radiusY: radius as f32,
}
}
pub(crate) fn circle_to_d2d(circle: Circle) -> D2D1_ELLIPSE {
D2D1_ELLIPSE {
point: to_point2f(circle.center),
radiusX: ... | Rust | 0 |
.mpMaxLatF = 52.0
mpres.mpCenterLatF = 49.
mpres.mpCenterLonF = 2.
mpres.mpPerimOn = True
mpres.mpFillOn = True
mpres.mpOutlineBoundarySets = "NoBoundaries"
mpres.mpDataBaseVersion = "MediumRes"
mpres.tiMainString = "Winds Of France"
mpres.tiMainFont = "Helvetica-Bold"
mpres.mp... | Python | 1 |
from pydantic import BaseModel
from enum import Enum
from datetime import datetime
class ProductCategory(Enum):
STREET_FOOD = 'Street Food'
NATIONAL_FOOD = 'NATIONAL FOOD'
KIDS_FOOD = 'Kids Food'
KOMBO_FOOD = 'Kombo Food'
class ProductResponse(BaseModel):
id: int
product_title: str
... | Python | 1 |
import numpy as np
from numba import njit
@njit
def cartoelt(pos, vit, GM):
pos = np.array(pos)
vit = np.array(vit)
ell = np.zeros(6)
rayon = np.sqrt(np.sum(pos ** 2))
v2 = np.sum(vit ** 2)
a = GM * rayon / (2 * GM - rayon * v2) # semi major axis
gx = pos[1] * vit[2] - pos[2] * vit[1]... | Python | 1 |
from django.urls import path
from rest_framework_simplejwt.views import TokenVerifyView
from main.views.download_file import FileDownloadAPIView
from main.views import (
UserSignInView,
UserSignUpView,
UserProfileRetrieveUpdateView,
RefreshTokenAPIView,
)
from NeuroDrive.views import (
DirectoryF... | Python | 1 |
import collections
from dataclasses import dataclass
import numpy as np
class ReplayBuffer:
def __init__(self, max_experiences):
self.max_experiences = max_experiences
self.count = 0
self.experiences = []
def add_experience(self, exp):
if len(self.experiences) == self.ma... | Python | 1 |
_null(i)?;
let (i, game_name) = parse_utf16_until_null(i)?;
let (i, game_name_j) = parse_utf16_until_null(i)?;
let (i, system_name) = parse_utf16_until_null(i)?;
let (i, system_name_j) = parse_utf16_until_null(i)?;
let (i, track_author) = parse_utf16_until_null(i)?;
let (i, track_author_j) = par... | Rust | 0 |
#-*- coding: utf-8 -*-
import search_dialog
from search_dialog.tfidf_model import TfidfModel
from search_dialog.bm25_model import BM25Model
from seq2seq_dialog.data_helpers import loadDataset
from utils.tools import log_print
SEARCH_MODEL = "bm25"
class SearchCore(object):
word2id, _ = loadDataset(vocab_size... | Python | 1 |
import subprocess
import fire
from UnlearnCanvas_resources.const import theme_available
def run_scripts_sequentially(
themes_to_unlearn, input_dir, output_dir, style_ckpt, class_ckpt, batch_size
):
base_command = (
"PYTHONPATH=. python scripts/accuracy_unlearncanvas_fast.py "
f"--input_dir '... | Python | 1 |
t_eq!(
find_anagrams("abab".to_string(), "ab".to_string()),
vec![0, 1, 2]
);
}
#[cfg(test)]
mod tests;
use codec::{Decode, Encode};
use fennel_lib::{
aes_decrypt, aes_encrypt, export_keypair_to_file, export_public_key_to_binary,
generate_keypair, get_session_public_key, get_session_secret, ... | Rust | 0 |
# Confederação Nacional de Natação precisa de um programa que leia
# o ano de nascimento de um atleta e mostre sua categoria, de acordo com a idade:
# – Até 9 anos: MIRIM – Até 14 anos: INFANTIL
# – Até 19 anos: JÚNIOR – Até 25 anos: SÊNIOR – Acima de 25 anos: MASTER
from datetime import date
print('======CATEGORIAS D... | Python | 1 |
definition")
}
fn add<I>() -> impl Parser<I, Output = Expression>
where
I: Stream<Token = char, Error = easy::ParseError<I>>,
I::Range: PartialEq,
I::Error: ParseError<I::Token, I::Range, I::Position, StreamError = Error<I::Token, I::Range>>,
{
mul()
.and(many(
lex(char('+')
... | Rust | 0 |
ad::spawn(|| cached_sync_writes("b".to_string()));
let c = std::thread::spawn(|| cached_sync_writes("c".to_string()));
let a = a.join().unwrap();
let b = b.join().unwrap();
let c = c.join().unwrap();
assert_eq!(a, b);
assert_eq!(a, c);
}
#[cfg(feature = "async")]
#[cached(time = 2, sync_writes ... | Rust | 0 |
lf.vertices.len(), self.tris.len())
}
}
impl prim::Prim for Mesh {
fn num_components(&self) -> usize {
self.tris.len()
}
fn display_color(&self) -> &core::Vec {
&self.mat.display_color()
}
fn material(&self) -> &material::Material {
&self.mat
}
fn bbox_world(&... | Rust | 0 |
from woningwaardering.vera.bvg.generated import Referentiedata
from woningwaardering.vera.referentiedatasoort import Referentiedatasoort
class BtwReferentiedata(Referentiedata):
pass
class Btw(Referentiedatasoort):
algemeen = BtwReferentiedata(
code="ALG",
naam="Algemeen",
)
"""
... | Python | 1 |
'PMI1',
'PMI2',
'PMI3',
'NPR1',
'NPR2',
'RadiusOfGyration',
'InertialShapeFactor',
... | Python | 1 |
}
};
}
}
let mut top_bottom = longest - 2;
loop {
match top_bottom > 0 {
false => break,
true => {
top.push(topc);
bottom.push(bottomc);
top_bottom -= 1;
}
}
}
result.insert(0,... | Rust | 0 |
e None,
'TEST_IMAGE': image})
# Mark the class with the driver module name
tc = getattr(pytest.mark, module)(tc)
# Look for any XFAILs and mark those test functions
for xfail in xfails:
if xfail['class'] == case._... | Python | 1 |
TIM17RST,
TIM17SMEN,
TIM17,
(,),
(CR2,, OIS1N, OIS1,,, CCUS, CCPC),
(),
(BIE,,,,,,, COMDE, COMIE,,),
(BIF,,,,,,, COMIF,),
(BG,,,, COMG,),
(,,,,,,,,),
(,),
(CC1NE,,,,,,,,,),
(,UIFCPY),
(RCR),
(,,),
(BDTR),
(OR1,,,,, TI1_RMP,),
(OR2, BKCMP1E, BKCMP1P... | Rust | 0 |
的变量类型,内部使用,外部请用type_of_var
parameter
---------
data: 数据,DataFrame格式
combine: 检测变量中是否有类似的变量,有的话则会合并。
return
------
var_list:[{'name':,'vtype':,'vlist':,'ordered':,'categories':,},]
'''
var_list=[]
for c in data.columns:
result,tmp=dtype_detection(data[c],fix=True)
... | Python | 1 |
u32(inp: u32) -> (u8, u8, u8, u8) {
let last = (inp & 0xFF) as u8;
let third = ((inp & 0xFF00) >> 8) as u8;
let second = ((inp & 0xFF0000) >> 16) as u8;
let head = ((inp & 0xFF000000) >> 24) as u8;
(head, second, third, last)
}
#[derive(Clone, Copy, Eq, PartialEq, Debug)]
pub struct ReadPrefix {
... | Rust | 0 |
ub fn mode(&self) -> MODER {
let bits = {
const MASK: u8 = 7;
const OFFSET: u8 = 3;
((self.bits >> OFFSET) & MASK as u32) as u8
};
MODER { bits }
}
#[doc = "Bits 0:2 - Internal. Only to be used through TI provided API."]
#[inline]
pub fn cmd(&s... | Rust | 0 |
# coding: utf-8
from typing import Tuple
def calculate_salary(
hours_worked: float,
hourly_rate: float,
social_security_rate: float = 30.0
) -> Tuple[float, float, float]:
"""
Рассчитывает зарплату с учетом социальных отчислений.
Args:
hours_worked: Количество отработанных часов
... | Python | 1 |
import django_filters
from django_filters import rest_framework as filters
from safe_eth.eth.django.filters import Keccak256Filter
from safe_transaction_service.utils.filters import filter_overrides
from .models import SafeOperation
class SafeOperationFilter(filters.FilterSet):
executed = django_filters.Boolean... | Python | 1 |
pattern, architecture, etc.
subcategory = Column(String(100), index=True) # Plus de granularité
tags = Column(JSONB) # Liste de tags pour recherche
source = Column(String(255), index=True) # Source du document
author = Column(String(255)) # Auteur/Agent créateur
language = Column(String(10), de... | Python | 1 |
results in the target ARN of <code>arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume</code>. The target name must be unique across all volumes on a gateway.</p>
/// <p>If you don't specify a value, Storage Gateway uses the value that was previously used f... | Rust | 0 |
0.4375", 10, 0x07, false);
// 15/32 = 7.5/16, to even 8/16
assert_ok::<U4F4>(
"0.46874999999999999999999999999999999999999999999999",
10,
0x07,
false,
);
assert_ok::<U4F4>("0.46875", 10, 0x08, false);
assert_ok::<U4F4>(
... | Rust | 0 |
except:
sents.append(0)
plt.rcParams['figure.figsize'] = (15, 10)
ax = sns.distplot(sents, kde=False, bins=3)
ax.set(xlabel='Negative Neutral Positive',
ylabel='#Tweets',
title="Tweets of @" + title)
return sents
def twitter_str... | Python | 1 |
comment: ::windows_sys::core::PCWSTR, flags: u32) -> u32;
#[doc = "*Required features: `\"Win32_Storage_DistributedFileSystem\"`*"]
pub fn NetDfsAddFtRoot(servername: ::windows_sys::core::PCWSTR, rootshare: ::windows_sys::core::PCWSTR, ftdfsname: ::windows_sys::core::PCWSTR, comment: ::windows_sys::core::PCWSTR... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.