text string | label_name string | labels int64 |
|---|---|---|
n_loc(
origin: OriginFor<T>,
#[pallet::compact] loc_id: T::LocId,
requester_loc_id: T::LocId,
) -> DispatchResultWithPostInfo {
T::CreateOrigin::ensure_origin(origin.clone())?;
let who = ensure_signed(origin)?;
if <LocMap<T>>::contains_key(&loc_id) {
Err(Error::<T>::AlreadyExists)?
} else {
... | Rust | 0 |
AD}\u{200B}\u{2060}\u{3000}()\u{FF08}\u{FF09}\u{FF3B}\u{FF3D}.[]/~\u{2053}\u{223C}\u{FF5E}"));
named!(pub alpha(CompleteStr) -> char,
one_of!("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"));
// TODO: Extend with Unicode digits.
named!(pub digit(CompleteStr) -> char,
one_of!("0123456789"));
named!(pub plus... | Rust | 0 |
tag = StringUtils.generate_random_str(10)
state = self.qb.add_torrent(content=content,
download_dir=save_path,
is_paused=True,
tag=self._torrent_tags + [tag])
if not state:
... | Python | 1 |
metrics = model.train(tag="transfer_value_baseline")
# print(f"Base model metrics: {metrics['test_r2']:.4f} R², {metrics['test_rmse']:.2f} RMSE")
# 2. Train trajectory model
# trajectory_metrics = model.train_value_trajectory_model()
# print(f"Trajectory model metrics: {trajectory_metrics['test_r2... | Python | 1 |
"""
Write a python function to find the sum of common divisors of two given numbers.
assert sum(10,15) == 6
"""
def sum(a, b):
"""
:param a: int
:param b: int
:return: int
"""
if a < b:
a, b = b, a
result = 0
for i in range(1, a + 1):
if a % i == 0 and b % i == 0:
... | Python | 1 |
or 'FreeBSD' license", Some("https://opensource.org/licenses/BSD-2-Clause")),
OpenSourceLicenses::GPL => License::new("GNU General Public License (GPL)", Some("https://opensource.org/licenses/gpl-license")),
OpenSourceLicenses::LGPL => License::new("GNU Library or 'Lesser' General Public Licens... | Rust | 0 |
from pydantic_settings import BaseSettings
from typing import List
import os
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
class Settings(BaseSettings):
# Environment
ENVIRONMENT: str = "development"
# Server settings
HOST: str = "0.0.0.0"
PORT: int = 8000
... | Python | 1 |
mac);
MacResult::new_from_owned(mac)
}
/**
* Obtain the result of a Mac computation as [u8]. This method should be used very carefully
* since incorrect use of the Mac code could result in permitting a timing attack which defeats
* the security provided by a Mac function.
*/
fn... | Rust | 0 |
'''
Compass example
===============
This example is a demonstration of Hardware class usage.
But it has severals drawbacks, like using only the magnetic sensor, and
extrapolating values to get the orientation. The compass is absolutely not
accurate.
The right way would be to get the accelerometer + magnetic, and comp... | Python | 1 |