text string | label_name string | labels int64 |
|---|---|---|
e module on slot 1. Replace \
on temperature module on slot 3 and remove plate seal when complete.')
# transfer triplicates
for set in triplicate_sets:
p300.pick_up_tip()
p300.mix(mix_reps, 50, set[0].bottom(3))
p300.transfer(50, set[0].bottom(3),
[well.bottom(3) f... | Python | 1 |
ser.add_argument(
'-n', '--lines',
nargs='?',
type=lambda x: int(x, 0),
const=0,
help="Show this many lines of history. 0 uses the terminal height. "
"Defaults to 5.")
parser.add_argument(
'-z', '--cat',
action='store_true',
help="Pipe dire... | Python | 1 |
st uint16_t, green: *const uint16_t, blue: *const uint16_t) -> c_int;
pub fn SDL_GetWindowGammaRamp(window: *const SDL_Window, red: *const uint16_t, green: *const uint16_t, blue: *const uint16_t) -> c_int;
pub fn SDL_DestroyWindow(window: *const SDL_Window);
pub fn SDL_IsScreenSaverEnabled() -> SDL_bool;
... | Rust | 0 |
0, -1)] {
let mut row = square_cords.0 as i8 + m.0;
let mut col = square_cords.1 as i8 + m.1;
let mut square = board.board[row as usize][col as usize];
while is_empty(square) {
row += m.0;
col += m.1;
square = board.board[row as usize][col as usize];
... | Rust | 0 |
<T>::OrgCreate(org)));
});
Ok(Some(0).into())
}
#[pallet::weight(10_000)]
pub fn transfer_ownership(
origin: OriginFor<T>,
transfer_to: T::AccountId,
key_source: InputKeySource<T::AccountId>,
)
-> Dispat... | Rust | 0 |
import torch
import torch.nn as nn
from torch import optim
from model import LightGCN
from config import config
from dataloader import Loader
from time import time
import numpy as np
from utils import BPRLoss, BPRTrain, NegLogLikelihoodLoss, Test, dimSearchTrain
if __name__ == '__main__':
# configuration
devi... | Python | 1 |
yourself, use [`profiler_ui`] instead.
///
/// Returns `false` if the user closed the profile window.
pub fn profiler_window(ctx: &egui::CtxRef) -> bool {
puffin::profile_function!();
let mut open = true;
egui::Window::new("Profiler")
.default_size([1024.0, 600.0])
.open(&mut open)
... | Rust | 0 |
on', 'off']:
raise ValueError(f"Invalid value '{state}'. Expected 0, 1, 'on', or 'off'.")
if state == 'on':
state = 1
if state == 'off':
state = 0
send_command( connection, command="usb_on+%s+" % state, verbose=True, is_silent=True )
def power_off(connection):
"""
Turn off the Instrument co... | Python | 1 |
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import sys
from os import path
from typing import Any, Dict
from sphinx.cmd.quickstart import QuickstartRenderer
from sphinx.ext.apidoc import get_parser, main, recurse_tree, write_file
from sphinx.locale import __
from sphinx.util import ensuredir
def wr... | Python | 1 |
import random
from bidict import bidict
def screen_to_game_coord(coord_mapping, pos):
x, y = pos
game_x = [coord_mapping[screen_pos] for screen_pos in coord_mapping if x in screen_pos][0]
game_y = [coord_mapping[screen_pos] for screen_pos in coord_mapping if y in screen_pos][0]
return game_x, game_y
... | Python | 1 |
# # # 可视化
# # plt.figure(figsize=(6, 6))
# # plt.imshow(rgba_image)
# # plt.axis('off') # 关闭坐标轴
# # plt.grid(True)
# # plt.savefig(f'./img/299_gt.png')
# for i in range(cav_num):
# o... | Python | 1 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType
class DeleteMailgroupRequest(BaseRequest):
def __init__(self) -> None:
super().__init__()... | Python | 1 |
e, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS I... | Rust | 0 |
bool {
(*self) == (*other)
}
}
impl ErlEq for Term {
fn erl_eq(&self, other: &Term) -> bool {
match (self, other) {
(Term::BoundLambda { .. }, _) => unreachable!(),
(_, Term::BoundLambda { .. }) => unreachable!(),
(Term::ValueList(_), _) => unimplemented!(),... | Rust | 0 |
'𞱴', '𑣂', '㎤', '㏧',
'ṝ', 'Ễ', '\u{1da22}', '𛰤', 'Პ', '𐾿', '🆍', 'ӟ', '𐜱', '\u{11d31}',
'𓀀', '梨', '✐', '𐧖', '𘫊', 'Ჾ', '⩭', '𝠏', 'ಪ', '🚇', 'ഈ', '𐤘',
'𘥇', '𝌎', '␂', 'ѯ', '𐎱', 'ꁪ', 'ᜟ', ';', '💾', '𓋎', 'ﱥ', '𒇄',
'ऻ', '🪧', 'घ', '𓀑', '𛰄', '𜽙', '𒓱', '𐼇', 'Я', '𝢸', 'ᖋ', '⦸',
'𑋁', '�... | Rust | 0 |
()));
assert_eq!(circuit.x(i+1), Ok(()));
}
assert!(circuit.is_stabilizer_circuit());
assert_eq!(circuit.measure(55, 0), Ok(()));
assert!(circuit.is_stabilizer_circuit());
assert_eq!(circuit.add_gate(CY::new(), &[99, 0]), Ok(()));
assert!(circuit.is_stabiliz... | Rust | 0 |
of the UUID structure.
///
/// This determines the interpretation of the structure of the UUID.
/// Currently only the RFC4122 variant is generated by this module.
/// Callers should only trust the value returned by this method if they
/// trust the UUID itself.
///
/// # Examples
///
... | Rust | 0 |
erers.get(&cid).cloned().unwrap_or_default();
if referers < 1 && pins < 1 {
self.blocks.remove(&cid);
let refs = self.refs.remove(&cid).unwrap();
for cid in &refs {
self.add_referer(cid, -1);
self.remove(cid);
}
}
}
}
/... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'SMS gateway',
'version': '3.0',
'category': 'Hidden/Tools',
'summary': 'SMS Text Messaging',
'description': """
This module gives a framework for SMS text messaging
------------------------... | Python | 1 |
# Atividade 08:
# Média de Notas:
# Desenvolva um programa que solicite as notas dos alunos até
# que o usuário digite -1. Calcule e exiba a média das notas
# inseridas.
c = 0
n = 0
m = 0
while n >= 0:
n = float(input('Insira a nota: '))
if n >= 0:
c += 1
n += n
else:
print('A média das notas é ') | Python | 1 |
se ndarray::{Array, arr1};
///
/// let array = Array::range(0., 5., 1.);
/// assert!(array == arr1(&[0., 1., 2., 3., 4.]))
/// ```
pub fn range(start: A, end: A, step: A) -> Self
where A: Float,
{
Self::from_vec(to_vec(linspace::range(start, end, step)))
}
}
/// ## Construct... | Rust | 0 |
her(blake2_128_concat) T::KittyIndex => Option<T::KittyIndex>;
// 记录某只猫的父母,因为猫可能没有父母,所以用 Option
pub KittyParents get(fn kitty_parents):map hasher(blake2_128_concat) T::KittyIndex => Option<(T::KittyIndex, T::KittyIndex)>;
// 记录某只猫的孩子们,第一个值是主猫,第二个是孩子,值也是孩子
pub KittyChildren get(fn kitty_children):double_map hash... | Rust | 0 |
dil_path(dil_dir)
#DIL.KANDIL = kandil_path('/var/dsource/scripts/kandil'
if options.data:
DIL.DATA = Path(options.data).normpath
DIL.KANDIL = DIL.DATA/"kandil"
DIL.KANDIL = kandil_path(DIL.KANDIL)
# The version of Tango we're dealing with.
VERSION = ""
# Root of the Tango source code (either svn or zi... | Python | 1 |
turns the antireverse of the motor
impl_operator!(<S: BaseFloat> Not for Motor4<S> {
fn not(q) -> Motor4<S> {
Motor4::new(
-q.rotor.v.x, -q.rotor.v.y, - q.rotor.v.z, -q.rotor.s,
-q.screw.v.x, -q.screw.v.y, -q.screw.v.z, q.screw.s
)
}
});
/// Returns the negation of the ... | Rust | 0 |
Found::Single(_) => Found::More,
Found::More => Found::More,
}
});
a
});
for (index, count) in options.iter().enumerate() {
let value = (index + 1) as u8;
if let Found::Single(cell) = ... | Rust | 0 |
nion<f32> {
(-lhs).into()
}
}
}
#[cfg(not(feature = "simd"))]
impl_operator!(<S: BaseFloat> Mul<S> for Quaternion<S> {
fn mul(lhs, rhs) -> Quaternion<S> {
Quaternion::from_sv(lhs.s * rhs, lhs.v * rhs)
}
});
#[cfg(feature = "simd")]
impl_operator_default!(<S: BaseFloat> Mul<S> f... | Rust | 0 |
losses+=loss.item()
total_loss.append(losses/len(train_loader))
if epoch%50==0:
print("Epoch:", str(epoch+1), "\tLoss:", total_loss[-1])
return model
def test_results(model, test_loader):
model.eval()
y_pred = []
y_obs = []
for idx, (x,y) in enumerate(test_loade... | Python | 1 |
pository.get_group(StudentAndCourse, student_id, course_id)
group.student_joins_course()
self.repository.save(group)
def leave_course(self, student_id: StudentID, course_id: CourseID) -> None:
group = self.repository.get_group(StudentAndCourse, student_id, course_id)
group.student_l... | Python | 1 |
ep is a percentage value where 0.0 is 0% and 1.0 is 100%. 0% would
/// return the `self` vector, 100% would return the `other` vector, and a
/// value in the middle would return a vector in the middle.
pub fn lerp(&self, other: Vector2, step: f64) -> Vector2 {
return *self + (other - *self) * step;
}
}
use serde_... | Rust | 0 |
gc())
pub enum GC {
/// Stops the garbage collector
Stop = raw::LUA_GCSTOP,
/// Restarts the garbage collector
Restart = raw::LUA_GCRESTART,
/// Performs a full garbage-collection cycle
Collect = raw::LUA_GCCOLLECT,
/// Returns the current amount of memory (in... | Rust | 0 |
EGRESS_MAP_CKSUMV4: u32 = 8;
pub const BPF_LD: u32 = 0;
pub const BPF_LDX: u32 = 1;
pub const BPF_ST: u32 = 2;
pub const BPF_STX: u32 = 3;
pub const BPF_ALU: u32 = 4;
pub const BPF_JMP: u32 = 5;
pub const BPF_RET: u32 = 6;
pub const BPF_MISC: u32 = 7;
pub const BPF_W: u32 = 0;
pub const BPF_H: u32 = 8;
pub const BPF_B:... | Rust | 0 |
n),
})
unique_speakers.add(cur_speaker)
return self._relabel_speakers(segments, unique_speakers)
def _relabel_speakers(
self,
segments: list[dict],
unique_speakers: set[int],
) -> list[dict]:
"""
Make speaker labels contiguous (e.g., 0,1,2 instea... | Python | 1 |
gtklogger.setWidgetName(button, label)
gtklogger.connect(button, 'clicked', self.buttonCB, label)
self.buttons[0].set_active(1)
def buttonCB(self, button, which):
if button.get_active():
for button, label in zip(self.buttons, self.labels):
if label... | Python | 1 |
/// #
/// # async fn new() -> Result<Self, Self::Error> {
/// # Ok(Self)
/// # }
/// # }
/// #
/// # #[tokio::main(flavor = "current_thread")]
/// # async fn main() {
/// MyWorld::cucumber()
/// .fail_on_skipped()
/// .run_and_exit("tests/features/read... | Rust | 0 |
}
}
}
#[test]
fn test_simple() {
let mut g: SimpleDigraph<(), ()> = SimpleDigraph::new();
let n1 = g.add_node();
let n2 = g.add_node();
let n3 = g.add_node();
let c1 = TriadicCensus::from(&g);
assert_eq!(&[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
c1.as_slic... | Rust | 0 |
_100,
#[doc = "96 us"]
_101,
#[doc = "128 us"]
_110,
#[doc = "256 us"]
_111,
}
impl CS_FWW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
CS_FWW::_000 => 0,
CS_FWW::_001 => 1,
CS_FWW::_010... | Rust | 0 |
: threshold as i64,
}
}
/// Reseed the internal PRNG.
fn reseed(&mut self) -> Result<(), Error> {
R::from_rng(&mut self.reseeder).map(|result| {
self.bytes_until_reseed = self.threshold;
self.inner = result
})
}
#[inline(never)]
fn reseed_and_gen... | Rust | 0 |
com/en-us/windows/win32/controls/lvm-getemptytext)
/// message parameters.
///
/// Return type: `WinResult<()>`.
#[cfg_attr(docsrs, doc(cfg(feature = "comctl")))]
pub struct GetEmptyText<'a> {
pub text: &'a mut WString,
}
unsafe impl<'a> MsgSend for GetEmptyText<'a> {
type RetType = WinResult<()>;
fn c... | Rust | 0 |
::CustomButton;
use crate::components::atoms::text_input::TextInput;
use crate::User;
use yew::prelude::*;
#[derive(Default, Clone)]
pub struct Data {
pub username: String,
pub favorite_language: String,
}
#[derive(Properties, PartialEq)]
pub struct Props {
pub onsubmit: Callback<Data>,
}
#[function_comp... | Rust | 0 |
letedObject>,
}
impl PwDatabase {
pub fn new() -> PwDatabase {
PwDatabase {
context: Box::new(Context::new()),
data_cipher_uuid: PwUUID::zero(),
compression_algorithm: PwCompressionAlgorithm::None,
kdf_parameters: KdfParameters::new(PwUUID::zero()),
... | Rust | 0 |
#
# Copyright (C) 2023, Inria
# GRAPHDECO research group, https://team.inria.fr/graphdeco
# All rights reserved.
#
# This software is free for non-commercial, research and evaluation use
# under the terms of the LICENSE.md file.
#
# For inquiries contact george.drettakis@inria.fr
#
from setuptools import setup
from ... | Python | 1 |