text string | label_name string | labels int64 |
|---|---|---|
# -*- coding: utf-8 -*- #
# Copyright 2024 Google LLC. 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 requir... | Python | 1 |
import sys
import os
# バリデーション
## パス
def validate_path(path):
abs_path = os.path.abspath(path)
if not os.path.exists(abs_path):
print(f"error: {abs_path} does not exist.")
sys.exit(1)
return abs_path
## 文字列
def validate_string(string):
if not isinstance(string, str):
print(f"e... | Python | 1 |
import numpy as np
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import precision_score, recall_score
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
def predict(y_... | Python | 1 |
raw bytes for the value field
/// * `_complete` - true if this is the data is complete, false if not
fn data(&mut self, _attribute: &Attribute, _data: &[u8], _complete: bool) {}
/// Invoked after attribute() for Sequences Attributes instead of data().
/// A corresponding call to end_sequence() will be... | Rust | 0 |
.is_null() {
return false;
}
user.buf = new_buf as *mut u8;
user.capacity = new_capacity;
}
ptr::copy_nonoverlapping(
buf as *const u8,
user.buf.offset(user.size as isize),
len a... | Rust | 0 |
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring("file:stat_sender_first.root"))
process.b = cms.EDProducer("SecondaryProducer",
seq = cms.untracked.bool(True),
input = cms.SecSource("EmbeddedRootSource",
... | Python | 1 |
10).collect();
assert!(v.is_empty());
}
#[test]
fn check_once() {
// drive_unindexed
let mut v: Vec<i32> = once(42).filter(|_| true).collect();
assert_eq!(v, &[42]);
// drive (indexed)
once(42).collect_into_vec(&mut v);
assert_eq!(v, &[42]);
// with_producer
let v: Vec<(i32, i32)>... | Rust | 0 |
from django.urls import path, include
from rest_framework import routers
from .views import GameModelViewSet
app_name = "games"
router = routers.DefaultRouter()
router.register(r'games', GameModelViewSet, basename='game')
urlpatterns = [
path("", include(router.urls)),
] | Python | 1 |
urn res
@classmethod
def _check_model_name_is_valid(cls, model_name, also_need_pretrained_weights=False):
""" Validates model name. None that pretrained weights are only available for
the first four models (efficientnet-b{i} for i in 0,1,2,3) at the moment. """
num_models = 4 if also_need_pretrained_we... | Python | 1 |
t.insert(5, 0);
let original = 0;
let image = t.get(&original).unwrap();
println!("{} -> {}", original, image);
}
<reponame>lillo/contract_analyzer
extern crate ethereum_types;
pub mod contract_analyzer;
pub mod contract_data;
pub mod contract_utils;
//pub mod evm_execution;
pub mod cycle_resolution;
pub... | Rust | 0 |
import math
from io import BytesIO
from pathlib import Path
from typing import Union, Tuple
from PIL import Image, ImageDraw, ImageFont
def draw_xyz_coordinate_system(
draw: ImageDraw,
center_x: int,
center_y: int,
radius: int,
line_color="rgba(0, 0, 0, 100)",
line_width=1,
):
"""
Dra... | Python | 1 |
"For sum kernel it is the sum of all sensitivities, "
"TODO: product kernel? Other kernels?, also "
"TODO: shall we return all the sensitivities here in the combination "
"kernel? ... | Python | 1 |
(),
"r_attp.value <p_attr"
);
assert_eq!(
escape_assertion("r.attp.value +p.attr").as_str(),
"r_attp.value +p_attr"
);
assert_eq!(
escape_assertion("r.attp.value -p.attr").as_str(),
"r_attp.value -p_attr"
);
assert_eq!(
escape_assertion("r.attp.val... | Rust | 0 |
"""
This file is part of SSE Auto Translator
by Cutleast and falls under the license
Attribution-NonCommercial-NoDerivatives 4.0 International.
"""
# Vanilla Plugins
BASE_GAME_PLUGINS = [
"skyrim.esm",
"update.esm",
"dawnguard.esm",
"hearthfires.esm",
"dragonborn.esm",
"skyrimvr.esm",
]
AE_CC_P... | Python | 1 |
from collections import Counter
def solution(topping):
answer = 0
# 각 토핑별 개수 = 철수
DICT = Counter(topping)
# 동생
SET = set()
for top in topping:
# 토핑을 순서대로 하나씩 뺌
DICT[top] -= 1
# 토핑이 0개가 되면 제거
if DICT[top] == 0:
del DICT[top]
# 뺀 토핑은 동생에게
... | Python | 1 |
_base_ = './gcnet_r50-d8_512x512_160k_ade20k.py'
model = dict(pretrained='open-mmlab://resnet101_v1c', backbone=dict(depth=101))
| Python | 1 |
end_accrual_fixed_rate: Option<f32>,
/// UnderlyingDividendAccrualPaymentDate
#[serde(flatten)]
pub underlying_dividend_accrual_payment_date: Option<super::underlying_dividend_accrual_payment_date::UnderlyingDividendAccrualPaymentDate>,
/// UnderlyingDividendCompoundingMethod
#[serde(skip_serializing_if = "Option:... | Rust | 0 |
) fn from_llvm(pred: LLVMRealPredicate) -> Self {
match pred {
LLVMRealPredicate::LLVMRealPredicateFalse => FPPredicate::False,
LLVMRealPredicate::LLVMRealOEQ => FPPredicate::OEQ,
LLVMRealPredicate::LLVMRealOGT => FPPredicate::OGT,
LLVMRealPredicate::LLVMRealOGE =... | Rust | 0 |
v.save_word2vec_format(user_data + "dataset/deepwalk_underexpose.bin", binary=True)
# model = KeyedVectors.load_word2vec_format(deepwalk + "deep_model_whoclick_model.bin", binary=True)
def model_deep_node_recom():
"""训练用于model1的deepwalk和node2vec
"""
global now_phase
novalid_click = pd.Da... | Python | 1 |
#ofnction remplir et afficher et calculer la somme et produit du tableaux#
def lir (T,n):
for i in range(1,n+1):
print("donner le élément",i,"dans le tableaux")
c=int(input())
T.append(c)
def afficher (T, n):
for i in range(n):
print(T[i])
R=[]
b=int(input("donner ind... | Python | 1 |
import asyncio
from adkg.field import GF
from adkg.elliptic_curve import Subgroup
from adkg.progs.mimc import mimc_mpc, mimc_plain
field = GF(Subgroup.BLS12_381)
def mimc_encrypt(key, ms):
"""
ms - blocks of plaintext, that is, plaintext -> {m1, m2,...,ml}
Each plaintext is a field element.
ciph... | Python | 1 |
import asyncio
from concurrent.futures import Future
from typing import Dict
from lsprotocol.types import (
PROGRESS, WINDOW_WORK_DONE_PROGRESS_CANCEL,
WINDOW_WORK_DONE_PROGRESS_CREATE,
ProgressParams, ProgressToken, WorkDoneProgressBegin,
WorkDoneProgressEnd, WorkDoneProgressReport,
WorkDoneProgre... | Python | 1 |
"""
A sparse model vector generator
=================================
Demonstrates how to create sparse model vectors with small number of non-zero entries sampled from Gaussian distribution
"""
# %%
# Let's import necessary libraries
import matplotlib as mpl
import matplotlib.pyplot as plt
from jax import random
i... | Python | 1 |
message = _("Are you sure you want to delete this group?")
class GroupViewSet(ModelViewSet):
icon = "group"
model = Group
ordering = ["name"]
add_to_reference_index = False
menu_name = "groups"
menu_label = _("Groups")
menu_order = 601
add_to_settings_menu = True
index_view_class ... | Python | 1 |
=> "Deactivated",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl ToGlib for ActiveConnectionState {
type GlibType = nm_sys::NMActiveConnectionState;
fn to_glib(&self) -> nm_sys::NMActiveConnectionState {
match *self {
ActiveConnectionState::Unknown => ... | Rust | 0 |
alError> {
let mut rec = rec;
match self.mode {
FieldMode::Only => {
rec.data.retain(|k, _| self.columns.contains(k));
}
FieldMode::Except => {
rec.data.retain(|k, _| !self.columns.contains(k));
}
}
if rec.da... | Rust | 0 |
from module_0326 import *
from resnet_18_34 import *
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def get_k_fold_data(k, i, X, y):
assert k > 1
fold_size = X.shape[0] // k
X_train, y_train = None, None
for j in range(k):
idx = slice(j * fold_size, (j + 1) * fold_size... | Python | 1 |
# DB - Database
# Databases are used to store structured information (data)
# RDB - Relational Databases
# In RDB, data is stored in tables (also called relations)
# The data is structured in rows and columns
# also called records and fields
# A record represents one item/entity
# And fields of the record represent i... | Python | 1 |
bol(ref e) => Some(e),
_ => None,
}
}
}
#[derive(Debug)]
enum ErrorKind {
Library(libloading::Error),
Symbol(libloading::Error),
NoCompatibleApi,
LaunchReplayUi,
}
<reponame>Rinsightproject/RINSIGHT
//! provide [CountStruct]
//! impl visitor
//! provide [get_span_lines] function... | Rust | 0 |
_26() {
run_test(&Instruction { mnemonic: Mnemonic::VFNMSUB132PS, operand1: Some(Direct(ZMM23)), operand2: Some(Direct(ZMM7)), operand3: Some(IndirectDisplaced(RDI, 212576405, Some(OperandSize::Dword), None)), operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Som... | Rust | 0 |
"""UK Environment Agency Flood Monitoring Integration."""
import asyncio
from datetime import timedelta
import logging
from typing import Any
from aioeafm import get_station
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from... | Python | 1 |
import requests
from langdetect import detect
def translate(text, mode="ZH_CN2JA"):
try:
URL = f"https://api.pearktrue.cn/api/translate/?text={text}&type={mode}"
r=requests.get(url=URL,timeout=10)
#print(r.json()["data"]["translate"])
return r.json()["data"]["translate"]
except... | Python | 1 |
rimary")
batch_presets = gr.Checkbox(value=False,label="Save for ALL presets")
enable_overwrite = gr.Checkbox(value=False,label="Enable overwrite")
with gr.Row():
save_result = gr.Textbox(label="Log", lines=10)
... | Python | 1 |
FIRST = 0
# We want to process order events before bar feed events.
BROKER = 1000
BAR_FEED = 2000
LAST = None
| Python | 1 |
c64(Instruction::with_declare_byte_10(0x77, 0xA9, 0xCE, 0x9D, 0x55, 0x05, 0x42, 0x6C, 0x86, 0x32))),
("77 A9 CE 9D 55 05 42 6C 86 32 FE", c64(Instruction::with_declare_byte_11(0x77, 0xA9, 0xCE, 0x9D, 0x55, 0x05, 0x42, 0x6C, 0x86, 0x32, 0xFE))),
("77 A9 CE 9D 55 05 42 6C 86 32 FE 4F", c64(Instruction::with_declare... | Rust | 0 |
execute():
directory = MaxPlus.Core.EvalMAXScript('getSavePath caption:"Select MMDBridge\'s out directory"')
if directory.Type == 44:
return
abc = os.path.normpath(directory.Get())
if not os.path.isdir(abc):
return
files = os.listdir(abc)
if len(files) <= 0:
return
... | Python | 1 |
unsafe {
sys::Imf_FlatUIntChannel_row(self.0, &mut ptr, r);
if ptr.is_null() {
None
} else {
Some(std::slice::from_raw_parts_mut(
ptr as *mut u32,
self.pixels_per_row() as usize,... | Rust | 0 |
})
.await;
}
#[tokio::test]
async fn anonymous_inline_fragment_skip_true() {
run_query("{ a, ... @skip(if: true) { b } }", |result| {
assert_eq!(result.get_field_value("a"), Some(&graphql_value!("a")));
assert_eq!(result.get_field_value("b"), None);
})
.await;
}
#[tokio::test]
asy... | Rust | 0 |
foo_event_2,
benchmark_event_2,
bar_event_2,
]
grouped_events = itertools.groupby(
events, operator.attrgetter('dt'))
messages = {}
for date, group in grouped_events:
tracker.set_date(date)
... | Python | 1 |
unexpected time drift")
.as_nanos() as u64;
Anchor {
unix_time_ns,
cycle,
nanos_per_cycle: *NANOS_PER_CYCLE,
}
}
}
#[inline]
pub fn tsc_available() -> bool {
#[cfg(all(target_os = "linux", any(target_arch = "x86", target_arch = "x86_64")))]
if... | Rust | 0 |
_test_args(Gamma(5))
def test_sympy__integrals__rubi__utility_function__Util_Part():
from sympy.integrals.rubi.utility_function import Util_Part
a, b = symbols('a b')
assert _test_args(Util_Part(a + b, 0))
def test_sympy__integrals__rubi__utility_function__PolyGamma():
from sympy.integrals.rubi.utilit... | Python | 1 |
if set.is_empty() {
reg.insert(*dest, HashSet::new());
} else if set.len() > 1 {
return Err(SolveError::QueryForMultiplePages);
} else {
let mut result_set: HashSet<Title> = HashSet::new();
fo... | Rust | 0 |
{
let peek_len = match self.peeked {
Some(None) => return (0, Some(0)),
Some(Some(_)) => 1,
None => 0,
};
let (lo, hi) = self.inner.size_hint();
let lo = lo.saturating_add(peek_len);
let hi = match hi {
Some(x) => x.checked_add(pee... | Rust | 0 |
ructOpt` constraints")
}
}
fn print_chips() {
let registry = probe_rs::config::families().expect("Could not retrieve chip family registry");
for chip_family in registry {
println!("{}\n Variants:", chip_family.name);
for variant in chip_family.variants.iter() {
println!(" ... | Rust | 0 |
D$_{{tr}}$$\downarrow$ & FID$_{{test}}$$\downarrow$ & Acc.$\uparrow$ & Div.$\rightarrow$ & Multimod.$\rightarrow$ & FID$_{{tr}}$$\downarrow$ & Acc.$\uparrow$ & Div.$\rightarrow$ & Multimod.$\rightarrow$ \\
\midrule
{gtrow}
\midrule
{rows}
\bottomrule
\end{{tabular}}
\end{{doc... | Python | 1 |
expected_output = {
"Port-channel241":{
"tx":239,
"rx":235,
"tx_drop":0,
"rx_drop":0
},
"Port-channel242":{
"tx":230,
"rx":226,
"tx_drop":0,
"rx_drop":0
},
"timestamp_now":"May 27 07:53:47.049",
"interface":{
"Port-channel241":{
"is... | Python | 1 |
def rotate(matrix)
matrix.replace(matrix.reverse.transpose)
end | Python | 1 |
ariant,
) {
owner.set_position(position.to_vector2());
unsafe {
self.get_animation(owner)
.play(current_anim.to_string(), -1.0, 1.0, false);
}
}
/// Remote function (You need to call the function like a `remotesync` mode.
///
/// Example:
/// ... | Rust | 0 |
The maximum number of UTF-16 code points that can be in a footer's text.
pub const TEXT_LENGTH_LIMIT: usize = 2048;
/// Create a new default embed footer builder.
///
/// Refer to [`TEXT_LENGTH_LIMIT`] for the maximum number of UTF-16 code
/// points that can be in a footer's text.
///
///... | Rust | 0 |
e\x807\xfd\x808\x03\x808\x03\x808\x03\x808\x03\x808\x03\x808\x03\x808\x03\x808\x03\x808\x03\x800\x01\x80/\xfe\x80\x1f\xff\x00/\xfe\x800\x01\x808\x03\x808\x03\x808\x03\x808\x03\x808\x03\x808\x03\x808\x03\x808\x03\x808\x03\x807\xfd\x80/\xfe\x80\x1f\xff\x00\x13',
57:b'\x1f\xff\x00/\xfe\x807\xfd\x808\x03\x808\x03\x808\x0... | Python | 1 |
from pydantic import BaseModel, Field
class ActivityItineraryOutput(BaseModel):
titulo: str = Field(..., description="El titulo o nombre de la actividad propuesta")
descripcion: str = Field(..., description="La descripcion de la actividad (breve)")
horarios: str = Field(description="Los horarios de la acti... | Python | 1 |
ing [0 – 255] value range into [0.0 – 1.0].
pub fn from_base_255(r: impl Into<f32>, g: impl Into<f32>, b: impl Into<f32>) -> Self {
Self::new(r.into() / 255.0, g.into() / 255.0, b.into() / 255.0)
}
/// Converts the color to `LinearRgb` representation.
pub fn into_linear(self) -> LinearRgb {
... | Rust | 0 |
"""Test Subaru device tracker."""
from copy import deepcopy
from unittest.mock import patch
from subarulink.const import LATITUDE, LONGITUDE, TIMESTAMP, VEHICLE_STATUS
from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_re... | Python | 1 |
> {
if let Some(var_255) = &input.user_pool_id {
object.key("UserPoolId").string(var_255);
}
if let Some(var_256) = &input.client_name {
object.key("ClientName").string(var_256);
}
if input.generate_secret {
object.key("GenerateSecret").boolean(input.generate_secret);
}
... | Rust | 0 |
msgbody2 = msgbody2 + element + ","
self.TriggerEvent(xpltype+":"+msgschema+":"+xplsource+":"+xpltarget+":"+msgbody2)
class Text:
name = "send xPL Message"
description = "sends an xPL message"
textBoxLabel = "xPL Msg Type"
textBoxLabel0 = "xPL Schema"
textBoxLabel1... | Python | 1 |
def test_get(session, team_contact):
from dispatch.team.service import get
t_team = get(db_session=session, team_contact_id=team_contact.id)
assert t_team.id == team_contact.id
def test_create(session, project):
from dispatch.team.service import create
from dispatch.team.models import TeamContact... | Python | 1 |
e(&lock, module),
sema::resolve_module(&lock, module, SourceId(0), &resolver),
)
};
Compiler::compile(BufWriter::new(stdout()), ctx, ast, Rc::new(sem));
Ok(())
}
fn main() {
if let Err(e) = run() {
eprintln!("{:#}", e);
exit(1);
}
}
<reponame>rust-av/ffms2-rs<gh_... | Rust | 0 |
![];
let ambient_facts = vec![
fact(resource, &[&ambient, &string("/folder/file1")]),
fact(operation, &[&ambient, &read]),
fact(time, &[&ambient, &date(&SystemTime::now())]),
fact(source, &[&ambient, &string("192.168.1.3")]),
];
let ambient_rules = vec![];
bench.iter(move || {
... | Rust | 0 |
2] # type: ignore # 左臂
full_torque_cmd[kuavo_robot._arm_idx[2]] = joint_cmd.tau[13] # type: ignore # 左臂
full_torque_cmd[kuavo_robot._arm_idx[4]] = joint_cmd.tau[14] # type: ignore # 左臂
full_torque_cmd[kuavo_robot._arm_idx[6]] = joint_cmd.tau[15] # type: ignore # 左臂
... | Python | 1 |
pub use moddata::{mod_info::ModInfo,mod_pack::ModPack,mod_pack::ModStatus,mod_pack::ModToken};
use std::path::{PathBuf,Path};
use std::fs::{self,File};
use std::io::{BufReader};
use std::collections::HashMap;
use lazy_static::lazy_static;
use regex::Regex;
use zip::read::ZipArchive;
use merge_diff::diff_single_conf... | Rust | 0 |
el_reserve_satoshis(this_ptr: &AcceptChannel) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.channel_reserve_satoshis;
(*inner_val)
}
/// The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
#[no_mangle]
pub extern "C" fn AcceptChannel_set_channel_reserve_satoshis(thi... | Rust | 0 |
lane or float(torch.max(depth))
depth = (depth - near_plane) / (far_plane - near_plane + 1e-10)
depth = torch.clip(depth, 0, 1)
# depth = torch.nan_to_num(depth, nan=0.0) # TODO(ethan): remove this
colored_image = apply_colormap(depth, colormap_options=colormap_options)
if accumulation is not Non... | Python | 1 |
import pyttsx3
print('\t\tRobot Speaker 2.0\n\t'
'If you want to Quit then type q\n'
)
var_py = pyttsx3.init()
while True:
text = input('Enter text that what you want me speak: ')
if text.lower() == 'q':
break
var_py.say(text)
var_py.runAndWait()
# ---------------------------------... | Python | 1 |
#!/usr/bin/python3
multiply_by_2 = __import__('9-multiply_by_2').multiply_by_2
print_sorted_dictionary = \
__import__('6-print_sorted_dictionary').print_sorted_dictionary
a_dictionary = {'John': 12, 'Alex': 8, 'Bob': 14, 'Mike': 14, 'Molly': 16}
new_dict = multiply_by_2(a_dictionary)
print_sorted_dictionary(a_dict... | Python | 1 |
ret.inv_elements[elem!(2, 0)] = rad.sin();
ret.elements[elem!(2, 0)] = -rad.sin();
ret.inv_elements[elem!(0, 2)] = -rad.sin();
ret.elements[elem!(2, 2)] = rad.cos();
ret.inv_elements[elem!(2, 2)] = rad.cos();
ret
}
/// Creates a new [`Transform`] that rotates coun... | Rust | 0 |
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
#
# 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 applic... | Python | 1 |
Args:
affine: The affines for each residue (translations in angstroms).
representations_list: A list of activations to predict side chains from.
aatype: Amino acid types.
Returns:
Dict containing atom positions and frames (in angstroms).
"""
act = [
common_modules.Linear(... | Python | 1 |
fn into_finfo(self) -> FileInfo {
self.0
}
fn get_md5(&self) -> Option<Md5Sum> {
self.0.md5sum.clone()
}
fn get_sha1(&self) -> Option<Sha1Sum> {
self.0.sha1sum.clone()
}
fn get_stat(&self) -> FileStat {
self.0.filestat
}
}
#[cfg(test)]
mod tests {
... | Rust | 0 |
0xC7
0x0A,// MandatoryPrefix2_1
0x0E,// VectorLength
0x09,// W
0x36,// VW_2
0x4D,// XMM0
0xC0, 0x20,// XOP_Vphaddwq_xmm_xmmm128
0x00,// Invalid
0x00,// Invalid
// 200 = 0xC8
0x02,// Dup
0x03,// 3
0x00,// Invalid
// 203 = 0xCB
0x0A,// MandatoryPrefix2_1
0x0E,// VectorLength
0x09... | Rust | 0 |
_addr) -> Ipv6Addr {
Ipv6Addr::from(addr.s6_addr)
}
/// Unix only API.
impl crate::Socket {
/// Returns `true` if `listen(2)` was called on this socket by checking the
/// `SO_ACCEPTCONN` option on this socket.
#[cfg(all(feature = "all"))]
#[cfg_attr(docsrs, doc(cfg(all(feature = "all"))))]
pub... | Rust | 0 |
|i| -> Result<f32, Box<Error>> {
input_tensor[0] = (i & 1) as f32;
input_tensor[1] = ((i >> 1) & 1) as f32;
label_tensor[0] = ((i & 1) ^ ((i >> 1) & 1)) as f32;
let mut run_args = SessionRunArgs::new();
run_args.add_target(&minimize);
let error_squared_fetch = run_args.r... | Rust | 0 |
radix(&s[..x], 16) {
Ok(start) => match u32::from_str_radix(&s[(x+1)..], 16) {
Ok(end) => {
println!("${:06X} - ${:06X}:", start, end);
let mems = (start..end).map(|n| format!("{:02X}", snes.get_mem_at(n)))
... | Rust | 0 |
from collections import OrderedDict
from .. import Provider as PersonProvider
class Provider(PersonProvider):
formats = ["{{last_name}}{{first_name}}"]
first_names_male = [
"伟",
"强",
"磊",
"洋",
"勇",
"军",
"杰",
"涛",
"超",
"明",
... | Python | 1 |
from tkinter import *
window = Tk()
window.title("GUI")
window.minsize(width=500, height=300)
# padding
window.config(padx=200, pady=200)
# Label
my_label = Label(text="Hello, I am new here!", font=("Arial", 26, "bold"))
my_label.grid(column=0, row=0)
# Changing thr label property(here text)
my_label["text"] = "New ... | Python | 1 |
password_store_path: &Path, password: &Password) -> anyhow::Result<()> {
let repo = Repository::open(password_store_path)?;
add_commit_password(&repo, &password)?;
let commit = String::from(get_head_commit(&repo).unwrap().message().unwrap());
let path_file = get_relative_path(&repo, pas... | Rust | 0 |
tch_size = len(test_labels)
# model.hidden = model.init_hidden()
output = model(test_code, test_code_versions, test_calling, test_called, test_number_of_days, test_number_of_versions, test_code_versions_all)
# test_labels = test_labels.squeeze()
log_prediction = torch.softmax(output, di... | Python | 1 |
`n``-th derivative of ``self``.
INPUT:
- ``n`` -- integer (default: `1`); how many times
to apply `T` to this element
OUTPUT:
`T^n a` where `a` is this element. Notice that we use the
*divided powers* notation `T^{(j)} = \frac{T^j}{j!}`.
... | Python | 1 |
Env_::BindConts(_, ref parent) =>
parent.lookup_var(var),
}
}
pub fn lookup_cont<'r>(&'r self, cont: &spine::ContName) -> Option<&'r C> {
match *self.0 {
Env_::Empty => None,
Env_::BindConts(ref binds, ref parent) =>
binds.get(cont).or_else(|| parent.lookup_cont(cont)),
... | Rust | 0 |
transfer eligibility validation."]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct ValidateSubscriptionTransferEligibilityResult {
#[doc = "Specifies whether the transfer is eligible or not."]
#[serde(rename = "isTransferEligible", default, skip_serializing_if = "Option::is_none"... | Rust | 0 |
else:
print("[Vowel Plotter] Running in standalone mode (Audio Analysis module not found or not ready).")
return True
def teardown(self):
"""插件卸载清理。"""
# 从音频分析模块中解钩
if hasattr(self, 'audio_analysis_page') and self.audio_analysis_page and hasattr(self.audio_analysis_pa... | Python | 1 |
[Box<dyn RAReader + 'a>], desc: &Description, oprops: &Vec<&IDObject>) -> (Vec<Box<dyn SAlignmentFunc + 'a>>, Vec<Vec<Index>>) {
let oprop_aligns = oprops.iter()
.map(|a| build_align_func(&readers, desc, &a.alignments).into_single())
.collect::<Vec<_>>();
let oprop_indices = oprops.iter()
.map(|p| p.at... | Rust | 0 |
renderer.on_bounds_change(&julia.bounds);
}
if window.is_key_down(Key::Key1) {
renderer = Box::new(CpuRenderer::new());
}
if window.is_key_down(Key::Key2) {
renderer = Box::new(OpenClRenderer::new(WIDTH, HEIGHT, &julia, max... | Rust | 0 |
pub fn is_finite(&self) -> bool {
match self {
&Finite(_) => true,
_ => false,
}
}
/// Converts from an `Infinitable<T>` to an `Option<T>`.
///
/// Converts `self` into an `Option<T>` possibly containing a finite value,
/// consuming `self`.
///
/// # Examples
///
/// ```
/// use infinitable::*;
... | Rust | 0 |
from dataclasses import dataclass
import tetgs_spatial
from tetgs_spatial.models.geometry.base import BaseImplicitGeometry
from tetgs_spatial.utils.base import BaseObject
from tetgs_spatial.utils.typing import *
@dataclass
class ExporterOutput:
save_name: str
save_type: str
params: Dict[str, Any]
class ... | Python | 1 |
_min_max(10, Slice::new(-8, Some(8), -3)), Some((4, 7)));
assert_eq!(slice_min_max(10, Slice::new(1, Some(-2), -3)), Some((1, 7)));
assert_eq!(slice_min_max(10, Slice::new(2, Some(-2), -3)), Some((4, 7)));
assert_eq!(
slice_min_max(10, Slice::new(-9, Some(-2), -3)),
Some(... | Rust | 0 |
from tkinter import *
pro = Tk()
pro.geometry('800x500')
fr1 = Frame(width='390', height='499',background='red')
fr1.place(x=1,y=1)
fr2 = Frame(width='390', height='499',background='blue')
fr2.place(x=393,y=1)
################################
## variable = tool(master,option) :
# 1) master >> مكان وضع الزر
# 2) opti... | Python | 1 |
d_then(OsStr::to_str)
.unwrap()
.to_string(),
);
if texture_file_name.is_some() {
file_name = Some(texture_file_name.unwrap());
}
}
... | Rust | 0 |
import pygame
class Renderable:
def __init__(self, surface: pygame.Surface):
self.surface = surface | Python | 1 |
Box<[LispVal]>),
/// A heap assertion `l |-> (v: T)`.
Heap(LispVal, LispVal),
/// An explicit typing assertion `[v : T]`.
HasTy(LispVal, LispVal),
/// The input token.
Input,
/// The output token.
Output,
/// A moved-away type.
Moved(LispVal),
/// A hole `_`, an inferred type.
Infer,
/// A ty... | Rust | 0 |
: ident = ident { repr: 7u };
pub const clownshoes_extensions : ident = ident { repr: 8u };
pub const self_ : ident = ident { repr: 9u }; // 'self'
/* for matcher NTs */
pub const item : ident = ident { repr: 10u };
pub const block : ident = ident { repr: 11u };
pub const stmt : ident = ident... | Rust | 0 |
from django.db import models
from django.contrib.auth.models import User
from django.utils import timezone
class Account(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
balance = models.DecimalField(max_digits=10, decimal_places=2, default=0)
asof = models.DateTimeField(null=True, ... | Python | 1 |
"""
@file: math_helper.py
@breif: Contains common/commonly used math function
@author: Yang Haodong, Wu Maojia
@update: 2024.5.20
"""
import math
class MathHelper:
@staticmethod
def circleSegmentIntersection(p1: tuple, p2: tuple, r: float) -> list:
x1, x2 = p1[0], p2[0]
y1, y2 = p1[1], p2[1]
... | Python | 1 |
m_verts,
flatness_in_pixels / scale,
((&mut winding_lengths) as *mut *mut i32),
((&mut winding_count) as *mut i32),
userdata,
);
if (windings) != std::ptr::null_mut() {
stbtt__rasterize(
result,
windings,
winding_lengths,
wi... | Rust | 0 |
samples - 1, device=y.device)
_y = (yT[:, None, None] - y) * (y < yT[:, None, None]) * (k < n_marks)
intensity = baselines[None, None, :].expand(B, n_samples - 1, -1).clone()
for i in range(n_marks):
for j in range(n_marks):
if adj[i, j] == 0:
co... | Python | 1 |
#b'5b1k/p3r2P/1p1r3q/4p3/2PBB3/4P3/P3K3/6R1 w - - 0 40 2 Limit(time=30, depth=50, nodes=25000000)'
[{'string': 'NNUE evaluation using nn-37f18f62d772.nnue (6MiB, (22528, 128, 15, 32, 1))', 'depth': 25, 'seldepth': 2, 'multipv': 1, 'score': PovScore(Mate(+1), WHITE), 'nodes': 25003133, 'nps': 3599126, 'hashfull': 999, '... | Python | 1 |
ctly detected."""
object = factory.getobject(self.testdir)
assert isinstance(object, Directory)
class TestPOFactory(BaseTestFactory):
from translate.storage import po
expected_instance = po.pofile
filename = "dummy.po"
file_content = b"""#: test.c\nmsgid "test"\nmsgstr "rest"\n"""
c... | Python | 1 |
import agentql
from playwright.sync_api import sync_playwright
import json
URL = "https://www.youtube.com/watch?v=8Zi_8-9f7xk"
# Define the queries to interact with the page
QUERY = """
{
video_title
video_channel
comments[] {
comment_text
author
}
}
"""
def get_comments():
with ... | Python | 1 |
# Copyright 2020 Google Inc.
#
# 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 or agreed to in writing, soft... | Python | 1 |
# bubblesub - ASS subtitle editor
# Copyright (C) 2018 Marcin Kurczewski
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versio... | Python | 1 |
logger.info('Waiting for sign-up link appears...')
signup_link = self.helper.sleepy_find_element(By.XPATH, self.xpath_sign_up_link)
signup_link.click()
self.logger.info('Sign-up link clicked.')
def generate_account_information(self, email_postfix):
# 生成不重复的账号与密码
while (em... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.