text string | label_name string | labels int64 |
|---|---|---|
"""
Template/Options file for altering the structure of the .csv flatfile output.
"""
import collections
headermeasurements = [
('observation', "OBS"),
('data_marking', "DATAMARKER"),
('statistical_unit_eng', "STATUNIT"), 'statistical_unit_cym',
('measure_type_eng', ... | Python | 1 |
o_base(who, supply.0, supply.1, target.1)?;
} else if supply.0 == base_currency_id {
Self::swap_base_to_other(who, target.0, supply.1, target.1)?;
} else {
Self::swap_other_to_other(who, supply.0, supply.1, target.0, target.1)?;
}
}
fn add_liquidity(origin, other_currency_id: CurrencyIdOf<T>, max_... | Rust | 0 |
,
},
clip_rect,
);
}
Layout::UsageGraph(used, reclaimable, free) => {
// Calculate pixel sizes of the parts of the graph
let total = used + reclaimable + free;
let used_pixels = ((*used as u64 * (rect.w - 2) as u64) / total as u64) as i32;
let reclaimable_pixels =
((*reclaimable... | Rust | 0 |
e been better to always add an implicit
# slash (even when using a prefix), but we can't do that now because it
# would make file systems created without trailing slash inaccessible.
if re.match(r'^(s3|gs)://[^/]+$', s) or re.match(
r'^(s3c|s3c4|swift(ks)?|rackspace)://[^/]+/[^/]+$', s
):
... | Python | 1 |
from agent import agent_executor
import sys
# Get the argument from the user
test_type = sys.argv[1]
# Testing update_cell_from_idx, get_cell_from_idx, and get_cell_from_id
if test_type == "cell":
agent_executor.invoke(
{
"input": "In the Smartsheet called 'Sample Sheet', update the cell in th... | Python | 1 |
on.get_read_names.<locals>.<genexpr> r r r )r s r r Operation.get_read_names r r c 6 U R 5 R $ )Nrn )r s r r Operation.get_reads rq r c [ e)Nr )r s r get_outputsO... | Python | 1 |
<u8>,
pub gw4: Vec<u8>,
pub gw6: Vec<u8>,
pub domain: Vec<u8>,
}
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, Default, Debug)]
pub struct Gateway<AccountId> {
pub version: u32,
pub id: u32,
pub farm_id: u32,
pub location: Location,
pub country_id: u32,
pub city_id... | Rust | 0 |
(res: Result<(Vec<u8>, Inf), E>) -> Self {
Self{
request: Request::GetReceived,
response: res.map_or_else(Response::Err, |(d, i)| Response::Received(d, i)),
}
}
/// Fetch radio IRQs
pub fn get_irq(clear: bool, res: Result<Irq, E>) -> Self {
Self {
... | Rust | 0 |
(freq).apply(rule).reset_index(level=0)
data.__setattr__('frequency', freq)
return data
# etf 데이터 불러오기
def load_etf_data(self, ticker_list: List, freq: str, delay: float = 1):
ticker_data_list = []
for ticker in ticker_list:
ticker_data = stock.get_etf_ohlcv_by_date(... | Python | 1 |
const mjtNum);
}
extern "C" {
pub fn mju_sub3(res: *mut mjtNum, vec1: *const mjtNum, vec2: *const mjtNum);
}
extern "C" {
pub fn mju_addTo3(res: *mut mjtNum, vec: *const mjtNum);
}
extern "C" {
pub fn mju_subFrom3(res: *mut mjtNum, vec: *const mjtNum);
}
extern "C" {
pub fn mju_addToScl3(res: *mut mjtNu... | Rust | 0 |
from aiogram import Router
from aiogram.types import Message
from tg_bot.filters.filters import IsPrivatChat
from config_data.config import ConfigTgBot, load_config_tg_bot
config: ConfigTgBot = load_config_tg_bot()
chat_id: int = config.config_tg_bot.chat_ids[0]
router = Router()
# Этот хэндлер будет реагировать на ... | Python | 1 |
from enum import IntFlag, auto
from Physics import Power, Energy
class Battery:
class Status(IntFlag):
EMPTY = auto()
CHARGING = auto()
FULL = auto()
capacity = Energy(0)
efficiency = 0.85
def __init__(self, capacity: Energy):
self.battery_level = Energy(0)
s... | Python | 1 |
import base64
import binascii
from pathlib import Path
from pytest_html.basereport import BaseReport
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
class Report(Bas... | Python | 1 |
pend on the hex [Orientation] (see the
//! example diagrams, below).
//!
//! It is typically more convenient to use alpha-numeric coordinates, which
//! identify each map hex with a string of the form `[A-Z]+[0-9]+`.
//! The [Coordinates] type defines how the relationship between these strings
//! and the map hexes.
//... | Rust | 0 |
UiFlow2 Code Block:
|reset.png|
MicroPython Code Block:
.. code-block:: python
base_stepmotor.reset()
"""
if self.rst_pin:
self.rst_pin.value(0)
time.sleep_ms(10)
self.rst_pin.value(1)
def get_voltage(self) ... | Python | 1 |
e.requires_grad)
# print('y_predicted', y_predicted.shape, y_predicted.device, y_predicted.requires_grad)
res = loss.masked_mse_torch(y_predicted, y_true)
return res
def predict(self, batch):
# 多步预测
x = batch['X'] # (batch_size, input_window, len_row, len_column, feature_di... | Python | 1 |
from rest_framework import serializers
from .models import material
class MaterialSerializer(serializers.ModelSerializer):
class Meta:
model = material
fields = ('material_id', 'material_name', 'material_unit', 'material_weight',) | Python | 1 |
PRG_ROM_BYTES => (&mut prg_rom).copy_from_slice(prg_rom_raw),
HALF_PRG_ROM_BYTES => {
// copy the prg data into each half of prg_rom
(&mut prg_rom[0..HALF_PRG_ROM_BYTES]).copy_from_slice(prg_rom_raw);
(&mut prg_rom[HALF_PRG_ROM_BYTES..]).copy_from_... | Rust | 0 |
DMA0TSEL_A::DMA0TRIG28,
29 => DMA0TSEL_A::DMA0TRIG29,
30 => DMA0TSEL_A::DMA0TRIG30,
31 => DMA0TSEL_A::DMA0TRIG31,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `DMA0TRIG0`"]
#[inline(always)]
pub fn is_dma0trig0(&self) -> b... | Rust | 0 |
# %% Robot
class Robot:
manufacture = 'BnL'
def move(self, x, y):
print(f'{self} moving to {x}/{y}')
walle = Robot()
walle.move(100, 200)
# %% What "class" keyword does
from textwrap import dedent
class_body = '''
manufacture = 'BnL'
def move(self, x, y):
print(f'{self} moving to ... | Python | 1 |
# Import necessary libraries
import time
from dataclasses import dataclass
# Define a Job class
@dataclass
class Job:
name: str
arrival_time: int
burst_time: int
priority: int
turnaround_time: int = 0
# A tick for sleep function
TICK = 0.1
# Define the time slices (and number of queues)
time_slic... | Python | 1 |