text string | label_name string | labels int64 |
|---|---|---|
er) {
let mut a = [0u8; ARRAY_SIZE];
let a: &mut [u8] = a.as_mut();
bencher.iter(|| {
a.iter_mut().for_each(|a| *a = 255);
a.iter_mut().for_each(|a| *a = 0);
});
}
fn iterator_heap(bencher: &mut Bencher) {
let mut a = vec![0u8; ARRAY_SIZE];
bencher.iter(|| {
a.iter_mu... | Rust | 0 |
import h5hs8s5z7za as yvo4exi9x1o, qc1s1rte6jn, tdwjyagkq89 as yik9ktmlupy, d_hz64790y_, b5jqg82syso as clzmhfb6xq4, k_n5c6mmoyd, e7ih8m02_b6, k1hkgx5y8gt as fz8bl28873c, d31tex5kkqk as e_szneegvl6, phn7xn0dy32
'# periods_semicolon_egg -> compass_airfield_payments'
yhk25gl3h5p = knsmoi1pp7k
raise False
... | Python | 1 |
import frappe
def execute():
# patch for all Email Account with the flag use_imap
for email_account in frappe.get_list(
"Email Account", filters={"enable_incoming": 1, "use_imap": 1}
):
# get all data from Email Account
doc = frappe.get_doc("Email Account", email_account.name)
imap_list = [folder.folder_n... | Python | 1 |
aking.amount = remain;
if !remain.is_zero() {
s.replace(staking);
}
Ok(())
})?;
dominator.staked = dominator_total_staking;
let dominator_old_status = dominator.status;
if ... | Rust | 0 |
let p1 = pool.clone();
let guild_conf = task::spawn_blocking(move || {
let connection = &p1.get().unwrap();
Guild::from_guild_id(connection, guild_id.into()).unwrap()
}).await?;
let message_id = args.single::<u64>()
.map_err(|_| "missing message id")?;
msg.reply(&ctx, form... | Rust | 0 |
period_start_date_business_center_grp: Option<super::stream_first_period_start_date_business_center_grp::StreamFirstPeriodStartDateBusinessCenterGrp>,
/// StreamFirstPeriodStartDateAdjusted
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "40078")]
pub stream_first_period_start_date_adjusted: Opti... | Rust | 0 |
o_use]
extern crate error_chain;
#[macro_use]
extern crate lazy_static;
extern crate ansi_term;
extern crate chrono;
extern crate dirs as dirs_rs;
extern crate reqwest;
extern crate url;
pub mod controller;
pub mod dirs;
pub mod http;
mod message;
pub mod errors {
error_chain! {
foreign_links {
... | Rust | 0 |
# Creating a Function
def my_function():
print("Hello from a function")
my_function()
print("--------------------\n")
# Arguments
def myfun(fname):
print(fname + " Alakkad")
myfun("Mahmoud")
myfun("Ali")
myfun("Ahmed")
print("--------------------\n")
# Number of Arguments
def myfun(fname, lname):
print(fn... | Python | 1 |
# *****************************************************************************
# Copyright (c) 2020, Intel Corporation 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 sou... | Python | 1 |
.send(msg!{
CHAN: ATTACH,
VALUE: "aaa"
});
// send
let _ = wire1.send(msg!{
CHAN: "aaa",
"hello": "world"
});
let recv = wire1.wait(Some(Duration::from_millis(100))).unwrap();
assert!(recv.get_str(CHAN).unwrap() == ATTACH);
assert!(recv.get_i32(CODE).is_ok()... | Rust | 0 |
) }
}
impl<M> Elem<M, Unencoded> {
pub fn from_be_bytes_padded(
input: untrusted::Input, m: &Modulus<M>,
) -> Result<Self, error::Unspecified> {
Ok(Elem {
limbs: BoxedLimbs::from_be_bytes_padded_less_than(input, m)?,
encoding: PhantomData,
})
}
#[inline]... | Rust | 0 |
!(read_polygon, check_polygon, testfiles::POLYGON_PATH);
read_test!(read_polygonm, check_polygonm, testfiles::POLYGONM_PATH);
read_test!(read_polygonz, check_polygonz, testfiles::POLYGONZ_PATH);
/* Read tests on Multipoint */
read_test!(
read_multipoint,
check_multipoint,
testfiles::MULTIPOINT_PATH
);
read... | Rust | 0 |
ddb: &DynamoDbClient,
lobby: &Lobby,
) -> Result<(), Box<dyn std::error::Error + Sync + Send + 'static>> {
let item = lobby.clone().into();
let table_name = env::var("tableName")?;
let result = ddb
.put_item(PutItemInput {
table_name: table_name.clone(),
... | Rust | 0 |
entry box for User ID
self.userid_entry = tkinter.Entry(self.acc_window, bd=1, font=font_normal, fg=fc_entry, bg=bg_entry, width=20)
# Creating a label for Password
self.pass_label = tkinter.Label(self.acc_window, text="Password:", font=font_normal_bold, fg=fc_label, bg=bg_label)
... | Python | 1 |
# Copyright 2025 AlphaAvatar project
#
# 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 w... | Python | 1 |
return False
# 存儲數據
self.tle_database[tle_data.satellite_id] = tle_data
self.sgp4_cache[tle_data.satellite_id] = satellite
# 清除相關軌道緩存
if tle_data.satellite_id in self.orbit_cache:
del self.orbit_cache[tle_data.satellite_id]
... | Python | 1 |
Endian<$t>) -> Self{
BigEndian(data.0.swap_bytes())
}
}
}
}
impl_Endian!(for BigEndian);
impl_for_BigEndian!(u16);
impl_for_BigEndian!(u32);
impl_for_BigEndian!(u64);
impl_for_BigEndian!(usize);
impl_for_BigEndian!(i16);
impl_for_BigEndian!(i32);
impl_for_BigEndian!(i64);
impl_for_BigEndian!(isize);
///Lit... | Rust | 0 |
from django.db import models
# Create your models here.
class discente(models.Model):
nome = models.CharField(primary_key=True, max_length=120)
periodo = models.CharField(
max_length=8, choices=[
('Primeiro', '1ª'),
('Segundo', '2ª'),
('Terceiro', '3ª'),
... | Python | 1 |
import pygame
import os
import socket
# =============================================================================
# 1. 初始化与常量设置
# =============================================================================
pygame.init()
pygame.font.init()
# -- 窗口设置 --
WIDTH, HEIGHT = 480, 320
WINDOW = pygame.display.set_mode((W... | Python | 1 |
# Generated by Django 1.11.22 on 2020-03-03 22:28
from django.db import migrations, models
def set_conversion_factor(apps, schema_editor):
"""Set all meter readings conversion_factor to 1.0, for kBtu
Checks that there are no meter readings where conversion_factor is null and the
source_unit is not kbtu
... | Python | 1 |
ples_to_visualize=2):
batch_size = pre_random_input.shape[0]
random_sample_inds = torch.randint(0, batch_size, size=(num_samples_to_visualize,))
pre_random_input_np = TensorUtils.to_numpy(pre_random_input)[random_sample_inds]
randomized_input = TensorUtils.reshape_dimensions(
... | Python | 1 |
/// 70012 - Support `sendheaders` message and announce new blocks via headers rather than inv
/// 70011 - Support NODE_BLOOM service flag and don't support bloom filter messages if it is not set
/// 70002 - Support `reject` message
/// 70001 - Support bloom filter messages `filterload`, `filterclear` `filteradd`, `mer... | Rust | 0 |
import json
import fire
from datasets import load_dataset
from sklearn.metrics.pairwise import cosine_similarity
from tqdm import tqdm
from src.data_processing.lang_detector import FasttextLanguageDetector
from src.data_processing.embedder import Embedder
def main(output_path, langdetect_threshold: float = 0.8, sim... | Python | 1 |
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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 |
_create_credential_offer
//! [`vc_zkp_create_credential_proposal`]: https://docs.rs/ye/*/ye/struct.Ye.html#method.vc_zkp_create_credential_proposal
//! [`vc_zkp_create_credential_schema`]: https://docs.rs/ye/*/ye/struct.Ye.html#method.vc_zkp_create_credential_schema
//! [`vc_zkp_create_revocation_registry_definition`]:... | Rust | 0 |
of binary search as Windows above
let i = match self.syms.binary_search_by_key(&addr, |sym| sym.address) {
Ok(i) => i,
Err(i) => i.checked_sub(1)?,
};
let sym = self.syms.get(i)?;
if sym.address <= addr && addr <= sym.address + sym.size {
self.strings... | Rust | 0 |
-> InvokeDynamicInfo {
InvokeDynamicInfo {
tag,
bootstrap_method_attr_index,
name_and_type_index
}
}
}
#[cfg(test)]
mod tests {
use serde_json::Result;
use crate::entities::constants::invoke_dynamic_info::InvokeDynamicInfo;
use crate::entities::constants::test_fixture::model_builder::create_invoke_d... | Rust | 0 |
start
body_start += 2 * (string_list.len() + 1);
// add the warning length
for warning in &string_list {
// add the warning.len to the body_start
body_start += warning.len();
}
Some(string_list)
} else {
None... | Rust | 0 |
s.last_one(), None);
///
/// let s = &bv[4..10];
/// assert_eq!(s.last_one(), Some(5));
///
/// let s = &bv[10..];
/// assert_eq!(s.last_one(), Some(4));
/// ```
pub fn last_one(&self) -> Option<usize> {
let len = self.len();
match len {
0 => None,
... | Rust | 0 |
from MFIS_Classes import *
from MFIS_Read_Functions import *
import os
def main():
# read files
inputFuzzySets = readFuzzySetsFile('InputVarSets.txt')
outputFuzzySets = readFuzzySetsFile('Risks.txt')
#Dibujar las funciones de pertenencia
plot_fuzzy_sets_by_category(inputFuzzySets)
plot_fuzzy_s... | Python | 1 |
import asyncio
from datetime import datetime
from binance.enums import KLINE_INTERVAL_1MINUTE
from binance import AsyncClient, BinanceSocketManager
from pandas import DataFrame
"""
{
"e": "kline", // Event type
"E": 1672515782136, // Event time
"s": "BNBBTC", // Symbol
"k": {
"t": 16725157... | Python | 1 |
_object as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_VipsInterpolate),
"::",
stringify!(parent_object)
)
);
}
pub type VipsInterpolate = _VipsInterpolate;
pub type VipsInterpolateMethod = ::std::option::Option<
... | Rust | 0 |
{
pub fn nk_free(arg1: *mut nk_context);
}
pub const nk_keys_NK_KEY_NONE: nk_keys = 0;
pub const nk_keys_NK_KEY_SHIFT: nk_keys = 1;
pub const nk_keys_NK_KEY_CTRL: nk_keys = 2;
pub const nk_keys_NK_KEY_DEL: nk_keys = 3;
pub const nk_keys_NK_KEY_ENTER: nk_keys = 4;
pub const nk_keys_NK_KEY_TAB: nk_keys = 5;
pub cons... | Rust | 0 |
""" Admin file of workflow app """
from django.contrib import admin
from .models import AssessmentWorkflow, AssessmentWorkflowStep, TeamAssessmentWorkflow
class AssessmentWorkflowStepInline(admin.StackedInline):
"""Assessment Workflow Step"""
model = AssessmentWorkflowStep
extra = 0
@admin.register(A... | Python | 1 |
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.core.testing_utils as testing_utils
"""
Integration tests for the Self-Feeding chatbot pro... | Python | 1 |
class Solution(object):
def removeDuplicates(self, nums):
j, i, cnt = 0, 1, 0
while i < len(nums):
if nums[i] == nums[j] and cnt == 0:
j += 1
nums[j] = nums[i]
cnt += 1
i += 1
elif nums[i] == nums[j] and cnt > 0:... | Python | 1 |
)
}
}
use crate::{
admin::dialoguer,
db,
models::{Crate, OwnerKind, User},
schema::{crate_owners, crates, users},
};
use std::process::exit;
use diesel::prelude::*;
#[derive(clap::Parser, Debug)]
#[clap(
name = "transfer-crates",
about = "Transfer all crates from one user to another."
)]
p... | Rust | 0 |
})
})
})
};
assert_eq!(parse(input), expected);
}
// Check that coercions are propagated through match and if expressions.
// pretty-expanded FIXME #23616
use std::boxed::Box;
pub fn main() {
let _: Box<[isize]> = if true { Box::new([1, 2, 3]) } else { Box::new([1]) };
let _: Box<[isize]> = match ... | Rust | 0 |
": "status"},
{"text": "Effects", "action": "status_effects"},
{"text": "Return to Surface", "action": "return_overworld"},
{"text": "Close", "action": "close"}
]
self.selected_menu_index = 0
logger.info(config_manager.get_text("dungeon_ui.ma... | Python | 1 |
T> as std::ops::Index<U>>::Output;
fn index(&self, index: U) -> &Self::Output {
std::ops::Index::index(&self.content, index)
}
}
// Borrowing
impl<T> Borrow<[T]> for SecVec<T>
where
T: Sized + Copy,
{
fn borrow(&self) -> &[T] {
self.content.borrow()
}
}
impl<T> BorrowMut<[T]> for ... | Rust | 0 |
Expr::NamedBackref(_) => {
unreachable!("named backrefs should have been eliminated");
}
}
Ok(())
}
fn compile_alt<F>(&mut self, count: usize, mut handle_alternative: F) -> Result<()>
where
F: FnMut(&mut Compiler, usize) -> Result<()>,
{
... | Rust | 0 |
}
};
($t:ty; $n:expr) => {
(0..$n).map(|_|
get!($t)
).collect::<Vec<_>>()
};
($($t:ty),*; $n:expr) => {
(0..$n).map(|_|
get!($($t),*)
).collect::<Vec<_>>()
};
}
fn main() {
let N = get!(usize);
let S = get!(String);
let Q = get!(u... | Rust | 0 |
get()[1] == {'6': ['1', '2', '3', '4', '5', '6']}
assert [i[0] for i in local.thrs_info(['1'])] == ['6']
gm_client.add_emails([
{'from': 't@t.com', 'to': 'Test <t@t.com>', 'subj': 'Same aubject'}
] * 2)
assert local.search_thrs('all') == ['8', '6']
assert local.data_threads.get()[1] == {
... | Python | 1 |
u32 = 0b10;
/// 0b11: rising and falling edge
pub const B_0x3: u32 = 0b11;
}
}
/// Number of DMA requests minus 1 to forward Defines the number of DMA requests to forward to the DMA controller after a synchronization event, and/or the number of DMA requests before an output ev... | Rust | 0 |
side_assignment):
if side == 0:
# P1 = a, P2 = b
p1_game_probs.append(P1[(a, b)])
p2_game_probs.append(P2[(b, a)])
else:
# P1 = b, P2 = a
p1_game_probs.append(P1[(b, a)])
... | Python | 1 |
property getter function return the correct data which was set.
sleep(1)
print(
"Property getter test. The displayed values should be the values which were set during the creation of the advanced IMU sensor."
)
print(f"Sensor Name: {IMU1.name}")
assert IMU1.name == ... | Python | 1 |
* 24) * 2 * (math.pi) / (365 * 24))
a = math.sin(((month[i] - 1) * 30.5 + day[i]) * 2 * (math.pi) / 365)
t.append(a)
return t
# In[7]:
# prepare train and val set
class RnnDataset(TensorDataset):
def __init__(self, data, label):
self.data = data
self.label = label
de... | Python | 1 |
Ground State)')
ax4.grid(True, alpha=0.3)
plt.suptitle('Exciton Calculation Summary', fontsize=16)
# Save
filepath = os.path.join(self.output_dir, save_name)
fig.savefig(filepath, bbox_inches='tight')
logger.info(f"Saved summary plot to {filepath}")
... | Python | 1 |
(SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), 0))?;
let addr = listener.local_addr()?;
Ok(addr.port())
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn generate_random_port() {
let port = get_local_port().unwrap();
println!("{:?}", port);
}
}
// This file is part of... | Rust | 0 |
#!/usr/bin/env python
"""
Compatibility layer for running DeepPath TensorFlow 1.x code in TensorFlow 2.x
"""
import tensorflow as tf
import os
import sys
# Enable eager execution for TensorFlow 2.x
tf.compat.v1.enable_eager_execution()
# Create TensorFlow 1.x compatibility layer
tf.compat.v1.disable_v2_behavior()
#... | Python | 1 |
#tuple is immutable like a string
a=(1,2,3,4,5)
print(type(a))
a=(1)
b=(1,)
print(type(a))
print(type(b))
a=(1,True,"dhanish",4.4)
print(a)
print(type(a)) | Python | 1 |
.;
out[2] = 0.;
out[3] = 1.;
out[4] = t[0] * 0.5;
out[5] = t[1] * 0.5;
out[6] = t[2] * 0.5;
out[7] = 0.;
}
/// Creates a dual quat from a quaternion.
///
/// [glMatrix Documentation](http://glmatrix.net/docs/module-quat2.html)
pub fn from_rotation(out: &mut Quat2, q: &Quat) {
out[0] = q[0]... | Rust | 0 |
import pandas as pd
# import geopy.distance
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('default')
import matplotlib.pylab as pl
import matplotlib.gridspec as gridspec
df = pd.read_csv('/home/autonomous/car_ws/src/autonomous_v/src/tracking/ref1_20_round_2.csv')
x_east = df.x... | Python | 1 |