text string | label_name string | labels int64 |
|---|---|---|
fletsThreeClick"
def nextClick(self, event):
print "nextClick"
def petalColorMouseUp(self, event):
print "petalColorMouseUp"
def randomizePlantClick(self, event):
print "randomizePlantClick"
def sectionTdosDrawMouseMove(self, event):
pr... | Python | 1 |
# Этот код выводит число в диапазоне от a до b с максимальной суммой делителей
# <число с максимальной суммой делителей> <сумма делителей этого числа>
a, b = int(input()), int(input())
total1 = 0
count1 = 0
for i in range(a, b+1):
total = 0
count = 0
for j in range(1, i+1):
if i % j == 0:
... | Python | 1 |
PassId, rect: Quad, inner_radius: f32, col: Rgba);
/// Draw a circle or oval with two colours
fn circle_2col(&mut self, pass: PassId, rect: Quad, col1: Rgba, col2: Rgba);
/// Draw a frame with rounded corners and uniform colour
fn rounded_frame(&mut self, pass: PassId, outer: Quad, inner: Quad, r1: f3... | Rust | 0 |
from i3pystatus import IntervalModule
class Pianobar(IntervalModule):
"""
Shows the title and artist name of the current music
In pianobar config file must be setted the fifo and event_command options
(see man pianobar for more information)
For the event_cmd use:
https://github.com/jlucchese... | Python | 1 |
last_excluding_pattern = None
for match in matches:
if match.is_exclude:
last_excluding_pattern = match
if last_excluding_pattern and (
last_excluding_pattern.pattern.endswith(b"**")
or b"**" in last_excluding_pattern.pattern
):
... | Python | 1 |
self._HashType = None
self._HashValue = None
self._RequestId = None
@property
def DownloadUrl(self):
return self._DownloadUrl
@DownloadUrl.setter
def DownloadUrl(self, DownloadUrl):
self._DownloadUrl = DownloadUrl
@property
def HashType(self):
return s... | Python | 1 |
}
impl From<Block> for DataEle {
fn from(v: Block) -> Self {
Self::Block(Arc::new(v))
}
}
impl From<&Tx> for DataEle {
fn from(v: &Tx) -> Self {
Self::Tx(Arc::new(v.clone()))
}
}
impl From<Tx> for DataEle {
fn from(v: Tx) -> Self {
Self::Tx(Arc::new(v))
}
}
struct Sub... | Rust | 0 |
from statsmodels.compat.pandas import PD_LT_2
import pandas as pd
import patsy.util
def _safe_is_pandas_categorical_dtype(dt):
if PD_LT_2:
return pd.api.types.is_categorical_dtype(dt)
return isinstance(dt, pd.CategoricalDtype)
def monkey_patch_cat_dtype():
patsy.util.safe_is_pandas_categorical_... | Python | 1 |
# pyre-unsafe
import unittest
import torch
from reagent.models.sparse_dqn import SparseDQN
from torchrec import EmbeddingBagCollection, EmbeddingBagConfig
class TestSparseDQN(unittest.TestCase):
def test_single_step_sparse_dqn(self):
state_dense_dim = 10
action_dense_dim = 2
dense_sizes =... | Python | 1 |
# Import Selenium WebDriver
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time
# Specify the path to the ChromeDriver
# If ChromeDriver is not in your system PATH, provide the exact path to the driver
url = "https://www.google.com"
#... | Python | 1 |
();
obj = v.obj.clone();
insert_if_not_condensed = v.insert;
}
},
}
}
finish_multiset(
insert_if_not_condensed,
&key,
&obj,
&mut new_ops,
preds,
... | Rust | 0 |
mod rows;
pub const DB_VERSION: &str = "1";
pub struct RepoDatabaseRead {
uri: String,
pool: sqlx::SqlitePool,
}
impl RepoDatabaseRead {
pub async fn new(path: &str) -> RepoResult<Self> {
Ok(Self {
uri: path.to_string(),
pool: sqlx::SqlitePool::connect(path).await?,
... | Rust | 0 |
surf.R, surface rotation matrix (may be None)
surf.n(wvl) -> refractive index (wvl in um)
P : ndarray
shape (3,) or (N,3), any float dtype
position (X0,Y0,Z0) at the outset of the raytrace
S : ndarray
shape (3,) or (N,3), any float dtype
(k,l,m) starting directio... | Python | 1 |
en(unique_tokens)
print_success(
f"🎯 เจอ CSRF tokens ทั้งหมด {len(unique_tokens)} ตัว!")
# แสดงรายละเอียด tokens ที่เจอ
for i, token in enumerate(unique_tokens, 1):
token_preview = (token.token_value[:20] + "..."
if l... | Python | 1 |
2, Vector::new(2.0, 4.0, 6.0));
}
#[test]
fn point_to_vector() {
let point = Point::new(1.0, 2.0, 3.0);
let vector = Vector::new(1.0, 2.0, 3.0);
assert_eq!(point + vector, Point::new(2.0, 4.0, 6.0));
}
}
#[cfg(test)]
mod test_subtract {
use super::*;
#[test]
fn poi... | Rust | 0 |
r::*;
match (&a.0, &b.0) {
// Same type
(&Bool(x), &Bool(y)) => Ok(_compare(&x, &y, oper)),
(&I64(x), &I64(y)) => Ok(_compare(&x, &y, oper)),
(&U64(x), &U64(y)) => Ok(_compare(&x, &y, oper)),
(&F64(x), &F64(y)) => Ok(_compare(&x, &y, oper)),
(&Str(x), &Str(y)) => Ok... | Rust | 0 |
Macro => DefKind::Macro,
MatchType::Builtin(_) => DefKind::Macro,
MatchType::UseAlias(m) => match m.mtype {
MatchType::UseAlias(_) => unreachable!("Nested use aliases"),
_ => to_def_kind(&m.mtype),
},
}
}
let kind = to_def_kind(&m.mtype... | Rust | 0 |
>>> import urban_mapper as um
>>> mapper = um.UrbanMapper()
>>> streets = mapper.urban_layer.OSMNXStreets().from_place("London, UK")
>>> taxi_trips = mapper.loader.from_file("taxi_trips.csv")\
... .with_columns(longitude_column="pickup_lng", latitude_column="p... | Python | 1 |
ue::Integer(self.inner.generate_range::<i64>(lower, upper))
}
}
fn int() -> runestick::Result<Value> {
Ok(Value::Integer(nanorand::WyRand::new().generate::<i64>()))
}
fn int_range(lower: i64, upper: i64) -> runestick::Result<Value> {
Ok(Value::Integer(
nanorand::WyRand::new().generate_range::<i64>... | Rust | 0 |
)]
pub fn ceref1_6(self) -> &'a mut W {
self.variant(CEREF1_A::CEREF1_6)
}
#[doc = "Reference resistor tap for setting 7."]
#[inline(always)]
pub fn ceref1_7(self) -> &'a mut W {
self.variant(CEREF1_A::CEREF1_7)
}
#[doc = "Reference resistor tap for setting 8."]
#[inline(... | Rust | 0 |
))
}
}
impl core::ops::Deref for REVID_R {
type Target = crate::FieldReader<u8, u8>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Kinetis sub-family ID\n\nValue on reset: 2"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum SUBFAMID_A {
#[doc = "... | Rust | 0 |
pub fn register_irqfd_resample(
&self,
evt: &EventFd,
resample_evt: &EventFd,
gsi: u32,
) -> Result<()> {
panic!("Not Implemented")
}
/// Unregisters an event that was previously registered with
/// `register_irqfd`/`register_irqfd_resample`.
///
/// The ... | Rust | 0 |
# Copyright (c) 2015-2024 EPFL/Blue Brain Project
# All rights reserved. Do not distribute without permission.
#
# Responsible Author: adrien.fleury@epfl.ch
#
# This file is part of Brayns <https://github.com/BlueBrain/Brayns>
#
# This library is free software; you can redistribute it and/or modify it under
# the terms... | Python | 1 |
import boto3
import json
import logging
import os
import pandas as pa
from io import BytesIO
log = logging.getLogger()
def get_csv_data(bucket: str, key: str):
env = os.getenv("ENV", "S3")
if env == "LOCAL":
with open(os.path.join(bucket, key), "r") as f:
return pa.io.common.StringIO(f.r... | Python | 1 |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Andreas Korb <andreas.d.korb@gmail.com>
# Copyright (C) Nils Weiss <nils@we155.de>
# This program is published under a GPLv2 license
# scapy.contrib.description = On Board Diagnostic Protocol (OBD-II)
# scapy.c... | Python | 1 |
/// Alias for microsecond duration (`u64` backing storage)
pub type MicrosDurationU64 = Duration<u64, 1, 1_000_000>;
/// Alias for millisecond duration
pub type MillisDuration<T> = Duration<T, 1, 1_000>;
/// Alias for millisecond duration (`u32` backing storage)
pub type MillisDurationU32 = Duration<u32, 1, 1_000>;... | Rust | 0 |
_sk,
keep,
)} {
0 => (),
err => return Err(err.into()),
}
} else {
unimplemented!("generate_ecfp_keypair called in non-bolos");
}
}
Ok(())
}
//first item says if ... | Rust | 0 |
}
#[tokio::test]
async fn like_on_string_dictionaries() -> Result<()> {
let input = vec![Some("foo"), Some("bar"), None, Some("fazzz")]
.into_iter()
.collect::<DictionaryArray<Int32Type>>();
let batch = RecordBatch::try_from_iter(vec![("c1", Arc::new(input) as _)]).unwrap();
let table = M... | Rust | 0 |
ross_models_work_on_mysql(api: TestApi) {
let plain_dm = r#"
model User {
id Int @id
@@index([id], name: "MyName")
}
model Post {
id Int @id
@@index([id], name: "MyName")
}
"#;
api.schema_push_w_datasource(plain_dm).send().assert_green();
}
#... | Rust | 0 |
BAD_GATEWAY,
detail=f"Custom Marker endpoint returned success but no 'output' field found. Available fields: {available_fields}. Expected either 'request_check_url' for polling or 'output' field for direct response.",
)
if self.output_format.lower() == "json":
fu... | Python | 1 |
"]
#[cfg(feature = "Win32_Foundation")]
pub fn ReportIScsiSendTargetPortalsExA(portalcount: *mut u32, portalinfosize: *mut u32, portalinfo: *mut ISCSI_TARGET_PORTAL_INFO_EXA) -> u32;
#[doc = "*Required features: `\"Win32_Storage_IscsiDisc\"`*"]
pub fn ReportIScsiSendTargetPortalsExW(portalcount: *mut u3... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
from odoo.addons.website.tests.test_configurator import TestConfiguratorCommon
@odoo.tests.common.tagged('post_install', '-at_install')
class TestConfigurator(TestConfiguratorCommon):
def test_01... | Python | 1 |
package.additional_arguments
)?;
}
if package.priority != InnerPackagePriority::Normal {
writeln!(w, " * priority: {:?}", package.priority)?;
}
if !package.platforms.is_empty() {
writeln!(w, " * only for platforms: {:?}", package.platforms)?;
... | Rust | 0 |
///
/// assert_relative_eq!(result, expected, epsilon = 1e-8);
/// ```
#[rustfmt::skip]
#[inline]
pub fn from_axis_angle<A: Into<Radians<S>>>(
axis: &Unit<Vector3<S>>, angle: A) -> Self
{
let (sin_angle, cos_angle) = Radians::sin_cos(angle.into());
let one_minus_cos_a... | Rust | 0 |
::Builder {
crate::input::update_user_input::Builder::default()
}
/// Creates a new `UpdateUser` operation.
pub fn new() -> Self {
Self { _private: () }
}
}
impl aws_smithy_http::response::ParseStrictResponse for UpdateUser {
type Output =
std::result::Result<crate::output::U... | Rust | 0 |
res {
Ok(u) => {
let token = encode_token(&u)?;
let auth_msg = AuthMsg {
status: 200,
message: "Success".to_string(),
token: token,
exp: 5, // unit: day
user: u,
... | Rust | 0 |
"""
Cryptocurrency Asset Classes Module for the Intraday Statistical Arbitrage System.
This module provides support for trading cryptocurrency assets.
"""
from .crypto_asset import CryptoAsset, CryptoAssetClass
__all__ = ['CryptoAsset', 'CryptoAssetClass'] | Python | 1 |
* (1.0 - mix).sqrt()
} else {
panic!("Reverb should be initialized before the first process call")
}
}
fn on_clock_tick(&mut self, time: ClockTime) {
self.feedback.on_clock_tick(time);
self.damping.on_clock_tick(time);
self.stereo_width.on_clock_tick(time);
self.mix.on_clock_tick(time);
}
}
//! This... | Rust | 0 |
from typing import List, Union
from stone_age.game_board.arbitrary_building import ArbitraryBuilding
from stone_age.game_board.simple_building import SimpleBuilding
from stone_age.game_board.variable_building import VariableBuilding
from stone_age.simple_types import Effect
list_of_buildings: List[Union[SimpleBuildi... | Python | 1 |
"""ヘルプシステム用ウィンドウ
Window Systemのヘルプ管理ウィンドウクラス。
旧HelpUIシステムからWindow Systemアーキテクチャへの移行。
t-wada式TDD実装:
1. 最小限の実装でテストを通す(Green段階)
2. 段階的に機能を追加
3. Fowlerリファクタリングパターンで改善
"""
from typing import Optional, Dict, List, Any, Callable
from enum import Enum
try:
import pygame
except ImportError:
pygame = None # type: ig... | Python | 1 |
# -*- coding: utf-8 -*-
# Copyright (C) 2020 Rinigus
#
# 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 version.
#
# This program... | Python | 1 |
sonFilters::Sqrt, 0, FilterInput::Numeric)),
"round" => Some((PersonFilters::Round, 1, FilterInput::Numeric)),
"toupper" => Some((PersonFilters::ToUpper, 0, FilterInput::Stringified)),
_ => None,
}
}
}
impl Runner<PersonNums, PersonStrs, PersonFilters> for Person {
f... | Rust | 0 |
from .hello_handler import HelloHandler
from .start_handler import StartHandler
from .goodbye_handler import GoodbyeHandler
from .markdown_handler import MarkdownHandler
from .markdown_python_handler import MarkdownPythonHandler
from .html_handler import HtmlHandler | Python | 1 |
_table(self.start_);
flatbuffers::WIPOffset::new(o.value())
}
}
pub enum FBListValueOffset {}
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct FBListValue<'a> {
pub _tab: flatbuffers::Table<'a>,
}
impl<'a> flatbuffers::Follow<'a> for FBListValue<'a> {
ty... | Rust | 0 |
import multiprocessing
from concurrent.futures import ProcessPoolExecutor
from time import sleep
from hypothesis import given
from hypothesis import strategies as st
from atpbar import atpbar, find_reporter, flushing, register_reporter
from .utils import mock_presentations
multiprocessing.set_start_method('fork', f... | Python | 1 |
eip28_present(&mut self) -> EIP28_PRESENT_W {
EIP28_PRESENT_W { w: self }
}
#[doc = "Bits 4:7 - 7:4\\]
Ignore on read"]
#[inline(always)]
pub fn reserved4(&mut self) -> RESERVED4_W {
RESERVED4_W { w: self }
}
#[doc = "Bit 3 - 3:3\\]
When set to '1', indicates that the EIP150 is ... | Rust | 0 |
mut values = HashMap::<String, i64>::new();
values.insert("a".into(), 3);
values.insert("b".into(), 7);
values.insert("c".into(), 5);
assert_eq!(a.eval(&values), Ok(3));
assert_eq!(b.eval(&values), Ok(7));
assert_eq!(c.eval(&values), Ok(5));
assert_eq!(d.eval(&values), Err(("d".into(), "Val... | Rust | 0 |
input and output quite differently, perhaps because computer scientists
//! have not given sufficient attention to this problem. People have felt somehow
//! that input and output are not part of ``real'' programming. Well, it is true
//! that some kinds of programming are more fun than others. With existing
//! input... | Rust | 0 |
ad = html.Thead(
[
html.Th('Name'),
]
)
tbody = html.Tbody(
children=[
html.Tr(
[
html.Td(html.A(client.name, href=client.omni_url))
]
)
for client in clients_without_account_managers
... | Python | 1 |
from fastapi import APIRouter, Depends, HTTPException
from pydantic import BaseModel
from starlette.status import HTTP_201_CREATED, HTTP_204_NO_CONTENT, HTTP_409_CONFLICT
from tortoise.exceptions import IntegrityError
from meilisync_admin.models import Meilisearch
from meilisync_admin.schema.request import Query
rout... | Python | 1 |
aussians) < 2:
raise PixelFitError("Only one gaussian!")
y_obs = hist.slots().as_double()
x = hist.slot_centers()
y_calc = flex.double(y_obs.size(), 0)
for g in gaussians:
y_calc += g(x)
residual = y_obs - y_calc
# check the overall residual
if flex.max(residual)/flex.sum(hist.slots()) > 0.015:
... | Python | 1 |
i,
total_iter,
eta=eta_string,
meters=str(self),
time=str(iter_time),
data=str(data_time),
memory=torch.cuda.max_memory_allocated()... | Python | 1 |
"global_method_name": "SegLoc",
"minArea": 0,
"order": 2,
"pca": False,
},
"exp10_global_SegLoc_VLAD_PCA_o2": {
"results_pkl_suffix": "_results_exp10_global_SegLoc_VLAD_PCA_o2.pkl",
"global_method_name": "SegLoc",
"minArea": 0,
"order": 2,
... | Python | 1 |
gsize=(3, 3))
grouped_counts = {"Positive": 0, "Negative": 0, "Unknown": 0}
for emotion, count in emotion_counts.items():
group = emotions_map.get(emotion, "Unknown")
grouped_counts[group] += count
labels = list(grouped_counts.keys())
sizes = list(grouped_counts.values())
total = sum... | Python | 1 |
oin");
t_responder.join().expect("join");
t_window.join().expect("join");
Blocktree::destroy(&blocktree_path).expect("Expected successful database destruction");
let _ignored = remove_dir_all(&blocktree_path);
}
#[test]
#[ignore]
pub fn window_send_leader_test2() {
... | Rust | 0 |
lasses or np.arange(num_classes)
if colorbar:
fig.colorbar(im_, ax=ax)
ax.set(
xticks=np.arange(num_classes),
yticks=np.arange(num_classes),
xticklabels=display_labels,
yticklabels=display_labels,
ylabel='True label',
x... | Python | 1 |
self.db.rollback()
logger.error(f"批量标记通知为已读失败: {str(e)}")
raise DatabaseError(message="批量标记通知为已读失败")
return self._safe_query(_query, f"批量标记通知为已读失败: 通知数量 {len(notification_ids)}", (0, len(notification_ids)))
def mark_all_as_read(self, user_id: int, ... | Python | 1 |
64) as u64;
tmp as u64
}
const SIX_MODULUS: [u64; 6] = [
0xb9feffffffffaaab,
0x1eabfffeb153ffff,
0x6730d2a0f6b0f624,
0x64774b84f38512bf,
0x4b1ba7b6434bacd7,
0x1a0111ea397fe69a
];
const INV: u64 = 0x89f3fffcfffcfffd;
#[inline(always)]
fn mont_reduce<N: Magnitude, F: Form>(
r0: u64,
... | Rust | 0 |
"W1": np.array([[2.14274251, -1.93155541], [2.20268789, -2.1131799]]),
"b1": np.array([[-4.83079243], [6.2845223]]),
"W2": np.array([[-7.21370685, 7.0898022]]),
"b2": np.array([[-3.48755239]]),
},
},
"expected... | Python | 1 |
and time cutoff is met, keep record
if (not condition_i[0] or not condition_i[1]) and condition_i[2] and condition_i[3] and condition_i[4]:
#cnt += 1
proc_df = proc_df.append(csv_log_proc.iloc[[indx]])
chrono_age.append(time_between(birth_date.iloc[[indx]].values, photo_date.iloc[[indx]].val... | Python | 1 |
# comentarios en Python
## Son líneas que no se ejecutan, se usan para explicar el código, desactivarlo temporalmente o dar contexto.
## Comentario de una sola línea
## Se escribe usando el símbolo #
# Esto es un comentario de una línea
nombre = "Luis" # Guardamos el nombre del usuario
## Todo lo que esté después de... | Python | 1 |
8_u8, 0xff_u8, 0xff_u8, 0xff_u8, 0xff_u8, 0x01]),
(-9223372036854775808_i64, &[0x80_u8, 0x80_u8, 0x80_u8, 0x80_u8, 0x80_u8, 0x80_u8, 0x80_u8, 0x80_u8, 0x80_u8, 0x01]),
];
const STRING_DATA : (&'static str, &'static [u8]) = (
"hello world😆",
&[15, 104, 101, 108, 108, 111, 32, 119, 111, ... | Rust | 0 |
")]
#[diagnostic(code(watchexec::filter::tagged::globset_change))]
GlobsetChange(#[source] SendError<Option<Gitignore>>),
/// Error received about the internal ignore filterer.
#[error("ignore filterer: {0}")]
#[diagnostic(code(watchexec::filter::tagged::ignore))]
Ignore(#[source] RuntimeError),
/// Error rece... | Rust | 0 |
# Fill memory bank
print('Fill memory bank for kNN...')
fill_memory_bank(base_dataloader, model, memory_bank_base)
# Evaluate (To monitor progress - Not for validation)
print('Evaluate ...')
top1 = contrastive_evaluate(val_dataloader, model, memory_bank_base)
pri... | Python | 1 |
]
pub fn map(
variable_name: &str,
value: &mut Value,
mapping: &HashMap<String, String>,
default_value: &Option<String>,
) -> Result<(), MatcherError> {
if let Some(text) = value.get_text() {
if let Some(mapped_value) = mapping.get(text) {
*value = Value::Text(mapped_value.to_own... | Rust | 0 |
_owned();
unsafe { bind::SDL_ClearError() }
error
}
}
impl Default for Sdl {
fn default() -> Self {
Self::new()
}
}
impl Drop for Sdl {
fn drop(&mut self) {
unsafe { bind::SDL_Quit() }
}
}
use plugins_core::{Function, InvocationError, PluginRegistrar};
plugins_core... | Rust | 0 |
e of the field is `APORT2YCH28`"]
#[inline(always)]
pub fn is_aport2ych28(&self) -> bool {
*self == VASEL_A::APORT2YCH28
}
#[doc = "Checks if the value of the field is `APORT2YCH30`"]
#[inline(always)]
pub fn is_aport2ych30(&self) -> bool {
*self == VASEL_A::APORT2YCH30
}
... | Rust | 0 |
while queue.len() > 0 {
let current = queue.pop_front().unwrap();
if map[current.0][current.1].is_lowercase() && !keys.contains(&map[current.0][current.1]) {
continue;
}
let current_dst = *dsts.get(¤t).unwrap();
for dir in 0..4 {
let next = get_ne... | Rust | 0 |
import json
from datetime import datetime, UTC
from pathlib import Path
from dor.domain.events import PackageStored, RevisionCataloged
from dor.domain.models import Revision
from dor.service_layer.unit_of_work import AbstractUnitOfWork
def catalog_revision(event: PackageStored, uow: AbstractUnitOfWork) -> None:
... | Python | 1 |
ays "remote",
// even for the context manager itself.
Ok((
FlatBinderObject::Remote { handle: Handle::SpecialServiceManager },
self.get_context_manager()?,
))
}
handle => binder_proc.handles.lock().find_objec... | Rust | 0 |
"""
URL configuration for Question_4 project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='h... | Python | 1 |
String,
// where keeper submit the verify result
pub write_contract: String,
pub private_key: String,
}
#[derive(Clone, Debug)]
pub struct MoonbeamClient {
inner: Web3<Http>,
pub ip_address: String,
}
impl MoonbeamClient {
pub fn new(url: String) -> Result<Self> {
if url.starts_with("http") {
let web3 = W... | Rust | 0 |
self._scopes.insert(scope.as_ref().to_string(), ()),
None => None,
};
self
}
}
<filename>src/vga/vga_char.rs
use super::color_code::ColorCode;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(C)]
pub struct VGAChar {
ascii_char: u8,
color_code: ColorCode,
}
impl VGAChar {
... | Rust | 0 |
()).unwrap();
//assert_eq!(constr_1854, constr_1854_roundtrip);
}
#[test]
pub fn plutus_list_serialization_cli_compatibility() {
// mimic cardano-cli array encoding, see https://github.com/Emurgo/cardano-serialization-lib/issues/227
let datum_cli = "d8799f4100d8799fd8799fd8799f581cf... | Rust | 0 |
np.dtype("uint32"): np.uint32,
np.dtype("uint64"): np.uint64,
np.dtype("float32"): np.float32,
np.dtype("float64"): np.float64,
np.dtype("complex64"): np.complex64,
np.dtype("complex128"): np.complex128,
}
def generate_shared_aggregator(
func: Callable[..., Scalar],
dtype_mapping: dic... | Python | 1 |
url: String,
/// createdAt
created_at: DateTime<Utc>,
/// description
description: String,
/// name
name: String,
}
resource!(Asset, |&self| {
kind "asset";
id self.id;
attrs url, created_at, description, name;
});
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "keba... | Rust | 0 |
__author__ = "wasi0013"
import urllib2
from bs4 import BeautifulSoup
import re
from fractions import gcd
import random
def affine_encrypt(text, a, b, m=26):
"""
takes string as text and decrypts it with the key a,b
>>> affine_encrypt("AFFINE CIPHER",5,8)
'IHHWVC SWFRCP'
"""
if gcd(a, m) == 1:... | Python | 1 |
Event> for TimerResult {
fn from(ue: UnblockEvent) -> Self {
match ue {
UnblockEvent::Timer(_) => (),
_ => panic!("Invalid unblock event for timer"),
}
}
}
impl From<UnblockEvent> for ActivityResult {
fn from(ue: UnblockEvent) -> Self {
match ue {
... | Rust | 0 |
spo_contour(self, qids, subject_preds, po_preds, eval_file, answer_dict, use_bert=False):
for qid, subject, po_pred in zip(qids.data.cpu().numpy(), subject_preds.data.cpu().numpy(),
po_preds.data.cpu().numpy()):
if qid == -1:
continue
... | Python | 1 |
# IMU
self.ax_imu_vel.clear()
self.ax_imu_vel.set_title('Vel. Z IMU', va='bottom')
self.ax_imu_vel.set_ylim(-1, 1)
self.ax_imu_vel.plot(self.time_imu, self.vel_z_imu, marker='o')
# Odom
self.ax_odom_vel.clear()
self.ax_odom_vel.set_title('Vel. Z Odom', v... | Python | 1 |
en 1000px
move || {
p.clone()
.set_inner_html("You cannot see me if you are less then 1000px");
},
// the maxium width when the callback will be called
1000,
);
}
<filename>pnets_tina/src/parser.rs<gh_stars>1-10
use std::error::Error;
use pnets::timed::{N... | Rust | 0 |
1 = 166,
M68K_INS_FGETEXP = 167,
M68K_INS_FGETMAN = 168,
M68K_INS_FINT = 169,
M68K_INS_FINTRZ = 170,
M68K_INS_FLOG10 = 171,
M68K_INS_FLOG2 = 172,
M68K_INS_FLOGN = 173,
M68K_INS_FLOGNP1 = 174,
M68K_INS_FMOD = 175,
M68K_INS_FMOVE = 176,
M68K_INS_FSMOVE = 177,
M68K_INS_FDMOV... | Rust | 0 |
FFFFFFFFFFFFFFFFFFFEFFFFFC2F).base(16).comb().batch(8).map(*.join).join(" ")'
crate::hex::decode_array(
"0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798B7C52588D95C3B9AA25B0403F1EEF75702E84BB7597AABE663B82F6F04EF2777"
).unwrap(),
"-G.to_bytes_uncomp... | Rust | 0 |
'I', b'Y', b'J', b'0', b'J', b'1', b'J', b'2', b'J', b'3', b'J', b'4', b'J', b'5', b'J', b'6',
b'J', b'7', b'J', b'8', b'J', b'9', b'J', b'A', b'J', b'B', b'J', b'C', b'J', b'D', b'J', b'E',
b'J', b'F', b'J', b'G', b'J', b'H', b'J', b'I', b'J', b'J', b'J', b'K', b'J', b'L', b'J', b'M',
b'J', b'N', b'J', b'O... | Rust | 0 |
current
// one.
let dummy_directional_info = DummyDirectionalChannelInfo { // used for first_hops routes
cltv_expiry_delta: 0,
htlc_minimum_msat: 0,
htlc_maximum_msat: None,
fees: RoutingFees {
base_msat: 0,
proportional_millionths: 0,
}
};
let mut targets = BinaryHeap::new(); //TODO: Do we care ... | Rust | 0 |
es_2d_f32(
#[spirv(global_invocation_id)]
global_id: UVec3,
#[spirv(storage_buffer, descriptor_set = 0, binding = 0)] x: &[f32],
#[spirv(storage_buffer, descriptor_set = 0, binding = 1)] ix: &mut [u32],
#[spirv(storage_buffer, descriptor_set = 0, binding = 2)] y: &mut [f32],
#[spirv(push_constan... | Rust | 0 |
eckoOperation::RotateLeft,
08 => GeckoOperation::ArithmeticShiftRight,
10 => GeckoOperation::FloatAdd,
11 => GeckoOperation::FloatMul,
_ => GeckoOperation::Unknown(value),
}
}
}
<reponame>komaeda/rust
// Test method calls with self as an argument cannot subver... | Rust | 0 |
a = int(input("Enter the 1st elem:: "))
b = int(input("Enter the 2nd elem:: "))
f = int(input("Enter required digit in series:: "))
def fib(first,second):
res = [first,second]
for i in range(f-2): # range(2,n)
third = res[-1] + res[-2] # third = first + second
res.append(... | Python | 1 |
Chip,
nearfield_sys::NFC_EDEVNOTSUPP => Error::NotSupported,
nearfield_sys::NFC_EINVARG => Error::InvalidArgument,
nearfield_sys::NFC_EIO => Error::InputOutput,
nearfield_sys::NFC_EMFCAUTHFAIL => Error::MifareAuthFailure,
nearfield_sys::NFC_ENOTIMPL => Error::NotImplemented,
... | Rust | 0 |
md5",
vec![],
),
(
Encoding::Euc,
"https://skk-dev.github.io/dict/SKK-JISYO.propernoun.gz.md5",
vec![],
),
(
Encoding::Euc,
"https://skk-dev.github.io/dict/SKK-JISYO.station.gz... | Rust | 0 |
import numpy as np
from scipy import signal
# problem 1
A = [-4.0]
B = [2.0]
C = [1.0]
D = [0.0]
sys1 = signal.StateSpace(A,B,C,D)
t1,y1 = signal.step(sys1)
# problem 2
A = [[-3.0,0.0],[-2.0,-3.0]]
print(np.linalg.eig(A)[0])
B = [[4.0],[0.0]]
C = [0.5,0.5]
D = [0.0]
sys2 = signal.StateSpace(A,B,C,D)
t2,y2 = signal.st... | Python | 1 |
)
module.code = compile(
code_string,
module.file.as_posix(),
"exec",
dont_inherit=True,
optimize=finder.optimize,
)
def qt_qtwebenginecore(self, finder: ModuleFinder, module: Module) -> None:
"""Include module dependency an... | Python | 1 |
class Solution:
def numberOfWays(self, corridor: str) -> int:
kMod = 1_000_000_007
ans = 1
prevSeat = -1
numSeats = 0
for i, c in enumerate(corridor):
if c == 'S':
numSeats += 1
if numSeats > 2 and numSeats & 1:
ans = ans * (i - prevSeat) % kMod
prevSeat = ... | Python | 1 |
import numpy as np
import matplotlib.pyplot as plt
def total_thrust_to_individual_chamber_thrust(t_total, Isp_sl = 393.3471, Isp_vac = 447.9481, sea_level=8, total = 24):
"""Calculate the individual chamber thrusts based on total thrust and specific impulses.
Parameters:
t_total (float): Total thrust... | Python | 1 |
== 1:
item_y = tf.tile(view1_positive_y, [1, 1])
elif active_view == 2:
item_y = tf.tile(view2_positive_y, [1, 1])
else:
item_y = tf.tile(view3_positive_y, [1, 1])
item_y_temp = tf.tile(item_y, [1, 1])
# batch内随机负采样。
for i in range(NEG):
rand = int((random.random() +... | Python | 1 |
"""機械学習ソースコード"""
| Python | 1 |
state[compress1024::COLS - 1] = 8 * output_size as u64;
let blocks_len = 0;
Ok(Self { state, blocks_len })
}
#[inline]
fn finalize_variable_core(&mut self, buffer: &mut Buffer<Self>, out: &mut Output<Self>) {
let blocks_len = if buffer.remaining() <= 8 {
self.blocks_len ... | Rust | 0 |
Some(Self(rank, file))
} else {
None
}
}
}
impl Queen {
pub fn new(position: ChessPosition) -> Self {
Self(position.0, position.1)
}
pub fn can_attack(&self, other: &Queen) -> bool {
self.0 == other.0
|| self.1 == other.1
|... | Rust | 0 |
>>, Box<dyn Error>> {
log::debug!("Inserting local calendar {}", url);
#[cfg(feature = "local_calendar_mocks_remote_calendars")]
self.mock_behaviour.as_ref().map_or(Ok(()), |b| b.lock().unwrap().can_create_calendar())?;
let new_calendar = CachedCalendar::new(name, url.clone(), supported... | Rust | 0 |
return True
else:
return False
_listOfSubCommands = []
for mode in _latticeDowngrade._DowngradeModeList:
cmdName = 'Lattice2_Downgrade' + mode
if FreeCAD.GuiUp:
FreeCADGui.addCommand(cmdName, _CommandLatticeDowngrade(mode))
_listOfSubCommands.append(cmdName)
cl... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.