text
string
label_name
string
labels
int64
, KeyByRunnable, MapRunnable, ReduceRunnable, Runnable, RunnableContext, SinkRunnable, SourceRunnable, WatermarkAssignerRunnable, WindowAssignerRunnable, }; use crate::runtime::{JobDescriptor, TaskDescriptor, TaskManagerStatus}; use crate::storage::metadata::MetadataLoader; use crate::utils::timer::WindowTimer; use...
Rust
0
id.hash_stable(hcx, hasher); }); path.hash_stable(hcx, hasher); } } } } impl<'a> HashStable<StableHashingContext<'a>> for hir::Defaultness { fn hash_stable<W: StableHasherResult>(&self, hcx: &mut StableHas...
Rust
0
use crate::simulation::Conf; use crate::simulation::Event; use crate::simulation::Time; use crate::simulation::Process; use crate::simulation::ProcessId; use crate::simulation::EventKind; use crate::simulation::ChurnKind; use crate::simulation::EventQueue; use crate::simulation::Appl...
Rust
0
import cv2 import numpy as np import matplotlib.pyplot as plt IMAGE_NAME = "basketball" IMAGE_EXTENSION = "png" # Image download image_path = f"{IMAGE_NAME}.{IMAGE_EXTENSION}" image = cv2.imread(image_path, cv2.IMREAD_COLOR) # Transition into shades of gray gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # Gauss Blu...
Python
1
17.0:', when='+cuda ^cuda@:8.0.60') conflicts('%intel@18.0:', when='+cuda ^cuda@:9.9') conflicts('%intel@19.0:', when='+cuda ^cuda@:10.0') conflicts('%intel@19.1:', when='+cuda ^cuda@:10.1') conflicts('%intel@19.2:', when='+cuda ^cuda@:11.1.0') # XL is mostly relevant for ppc64l...
Python
1
there exist a subgraph H' // of H such that G is isomorphic to H'? How does your program perform on // such special cases of subgraph isomorphism as Hamiltonian cycle, clique, // independent set, and graph isomorphism? } // TODO pub fn fn_06() { // [8] In the turnpike reconstruction problem, you are gi...
Rust
0
})" avg_upload_formula = f"=AVERAGE(C2:C{last_row})" sheet.cell(row=last_row + 1, column=4, value=avg_download_formula) sheet.cell(row=last_row + 1, column=5, value=avg_upload_formula) for col in range(4, 6): # Apply bold formatting to average cells cell = sheet.cell(row=las...
Python
1
r, vec![&text[..width]]); } #[test] fn line_composer_zero_width() { let width = 0; let text = "abcd efghij klmnopabcd efgh ijklmnopabcdefg hijkl mnopab "; let (word_wrapper, _) = run_composer( Composer::WordWrapper { trim: true }, text, width, ...
Rust
0
# Lembre-se de alterar o caminho do arquivo, para o caminho completo da sua máquina! arquivo = open( "/home/guilherme/Projetos/dio/codigo-fonte/trilha-python-dio/05 - Manipulação de arquivos/lorem.txt", "r" ) print(arquivo.read()) arquivo.close() arquivo = open( "/home/guilherme/Projetos/dio/codigo-fonte/tril...
Python
1
"""Test RevokeHandler.""" from typing import Generator import pytest import pytest_asyncio from ......core.event_bus import EventBus, MockEventBus from ......core.profile import Profile from ......messaging.request_context import RequestContext from ......messaging.responder import BaseResponder, MockResponder from ...
Python
1
\x8f\xe7^\xdb\xff]\xd4KXeD\ \xc7\x8bB\x91\xf28\x94\x14\x0a%#i\x82\xe2\xde\xa9\ ]K(v\xf2\xba\x0e.\xb3B\xe7\xa0\xa0\x98\xcc\xa8\ \xe3\x94L\x9fS\xb2\xe6\xe8\xf6\x1b\x8e\xf2\x9c\x9bqN\ \xa9\xa1=\xfc\x18\xad5\xe5E\x86\xaa\xae\xf8\xf3g\x17\ ,kM\xbb\x98SQ\xa1\xd31GgG\xf8\xae\xe0\ \xeb\xfa\x0a\x95>\x92\xd2T\x7f*JT\xe9^b\xb5\ %...
Python
1
.variant(CS_A::SPI_CS_SRC_DIO_1) } #[doc = "Select DIO\\[2\\] as source"] #[inline(always)] pub fn spi_cs_src_dio_2(self) -> &'a mut W { self.variant(CS_A::SPI_CS_SRC_DIO_2) } #[doc = "Select DIO\\[3\\] as source"] #[inline(always)] pub fn spi_cs_src_dio_3(self) -> &'a mut W { ...
Rust
0
}), http_requests_duration: meter.build_value_recorder(|m| { m.f64_value_recorder("http_request_duration_seconds") .with_description("Total number of HTTP requests made.") .init() }), } } } #[derive(Clone, Default)] pub(cra...
Rust
0
87, 0xB9, 0xD6, 0xA8, 0x00][..]), (-2_000_000_000_i32, &[0xC7, 0xB9, 0xD6, 0xA8, 0x00][..]), ] { let deserialization = from_bytes(value); assert!(deserialization.is_ok()); let deserialization = deserialization.unwrap(); assert_eq!(*expected, deserializ...
Rust
0
self.reg.set_flag(Flag::Zero); } else { self.reg.unset_flag(Flag::Zero); } if u16::from(v1) + u16::from(v2) + u16::from(carry) > 0xFF { self.reg.set_flag(Flag::Carry); } else { self.reg.unset_flag(Flag::Carry); } if (v1 & ...
Rust
0
import math class soilcalculator: def __init__(self, sand, silt, clay): self.sand = sand self.silt = silt self.clay = clay super().__init__() def soilcalculator(self): pctsand = self.sand pctclay = self.clay acoef_app = ( -4.396 ...
Python
1
buf[i * 4..i * 4 + 4].copy_from_slice(&a.to_le_bytes()); } let mut index = (state_buf.pread_with::<u32>(0x34, LE)? & 0xF) as usize; index = index.wrapping_add(index); index = index.wrapping_add(index); index = index.wrapping_add(index); let mut mm7 = state_buf[0x18..0x18 + 8].try_into()?; s...
Rust
0
from typing import Dict from multimedeval.overrides_ import overrides import numpy from multimedeval.radgraph.allennlp.common.util import JsonDict from multimedeval.radgraph.allennlp.data import Instance, Token from multimedeval.radgraph.allennlp.data.fields import TextField from multimedeval.radgraph.allennlp.predic...
Python
1
assert_eq!(data_arc.get_num(), arc_from_data.get_num()) } #[actix_rt::test] async fn test_get_ref_from_dyn_data() { trait TestTrait { fn get_num(&self) -> i32; } struct A {} impl TestTrait for A { fn get_num(&self) -> i32 { 42 ...
Rust
0
"""cli 子包暂时不对外提供可导入的名字。""" __all__ = []
Python
1
ize, caps.height as usize, caps.frame_rate as usize, device_index, ) .with_context(|| { format!("Failed to acquire device with ID `{device_id}`") })?; Ok(Self { inner, device_id }) } /// Starts screen capturing and creates a new [...
Rust
0
AnnotationSetRefItem::read(data)); } items } pub fn read(data: &mut Cursor<&Vec<u8>>) -> AnnotationSetRefItem { AnnotationSetRefItem { annotations_off: data.u32(), } } } extern crate keyvalueextractor; use std::path::Path; fn print(t: &keyvalueextractor::KeyVal...
Rust
0
C>`"] pub type FLEXFRGXCTRL2 = crate::Reg<flexfrgxctrl2::FLEXFRGXCTRL2_SPEC>; #[doc = "Peripheral reset control register"] pub mod flexfrgxctrl2; #[doc = "FLEXFRG3CTRL register accessor: an alias for `Reg<FLEXFRG3CTRL_SPEC>`"] pub type FLEXFRG3CTRL = crate::Reg<flexfrg3ctrl::FLEXFRG3CTRL_SPEC>; #[doc = "Fractional rate...
Rust
0
b}.. {b}::::: {c} .::::: {b}.::: {b}::::: {c} .::::: {b}::::: {b}''''' {c}..... ::::: {b}':::::. {c}......:::::::::::::' ::: {b}::::::. {c}':::::::::::::::::' {b} .:::::::: {c}':::::::::: {b} .::::''::::. {c}'::::. {b} .::::' ...
Rust
0
that is the innermost binder that /// captures nothing. But for a type `&'D u32`, where `'D` is a /// late-bound region with De Bruijn index `D`, this would be `D + 1` /// -- the binder itself does not capture `D`, but `D` is captured /// by an inner binder. /// /// We call this concept an "exc...
Rust
0
ould the stall be saved if an error occurs above? if stall_data.modified() && stall_data.write_to_load_path()? { event!(Level::INFO, "Stall saved."); } res } pub(crate) const SESSIONS_KEY: &str = "gateway_sessions"; pub(crate) const SHARDS_KEY: &str = "gateway_shards"; pub(crate) const BOT_USER_KEY: &str = "bot...
Rust
0
"""extra pipeline data linked to message in a new table Revision ID: e4becadb4bcc Revises: a12a99fd0c79 Create Date: 2025-05-06 21:43:16.345851 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = 'e4becadb4bcc' down_revision...
Python
1
trie_op_ptr as size_t, fmt_out, ); do_dump( &mut *hyf_num.as_mut_ptr().offset(1) as *mut small_number as *mut i8, ::std::mem::size_of::<small_number>() as u64, trie_op_ptr as size_t, fmt_out, ); do_dump( &mut *hyf_next.as_mut_ptr().offset(1) as *m...
Rust
0
# a = int(input("a la: ")) # b = int(input("b la: ")) # print(f"Tổng hai số nguyên a và b là {a + b}") # print(f"Hiệu hai số nguyên a và b là {a - b}") # a = float(input("Nhap a = ")) # a += 10 # print(f"Sau khi cong a, gia tri la: {a}") # a -= 5 # print(f"Sau khi tru a, gia tri la: {a}") # a *= 8 # print(f"Sau khi nh...
Python
1
usted /// 4. `n` - number of domains /// 5. `domain_len` - is a closure that take usize and return size of /// the domain at given usize #[inline(always)] fn _cartesian_next_core<'a>( i : &mut usize, c : &mut Vec<usize>, exhausted : &mut bool, n : usize, domain_len : impl Fn(usize) -> usize, ...
Rust
0
32) ;; Load a storage value into contract memory. (call $assert (i32.eq (call $seal_get_storage (i32.const 0) ;; The pointer to the storage key to fetch (i32.const 36) ;; Pointer to the output buffer (i32.const 32) ;; Pointer to the size of the buffer ) ;; Return value 0 means tha...
Rust
0
# Copyright 2017-2023 Posit Software, PBC # # 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 ...
Python
1
import pytest @pytest.fixture def sample_regex(): return (r"((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.){3}" r"(25[0-5]|(2[0-4]|1\d|[1-9]|)\d)") @pytest.fixture def sample_json_schema(): return { "type": "object", "properties": { "name": { "type": "string" ...
Python
1
if qnt=='': print('-------------') print("Invalid Quantity!") continue else: pass ch=str(input("Are you Sure to Update (Y/N): ")) ch=ch.upper() ...
Python
1
there is exactly a single leap second ever**. /// /// Returns `None` when it will result in overflow. /// /// # Example /// /// ``` /// # extern crate chrono; fn main() { /// use chrono::{Duration, NaiveDate}; /// /// let from_ymd = NaiveDate::from_ymd; /// /// let d = fr...
Rust
0
from __future__ import annotations extensions = [ 'sphinx.ext.autodoc', 'jaraco.packaging.sphinx', ] master_doc = "index" html_theme = "furo" # Link dates and other references in the changelog extensions += ['rst.linker'] link_files = { '../NEWS.rst': dict( using=dict(GH='https://github.com'), ...
Python
1
subtitle embedding</li> <li>Modern user interface</li> </ul> <p>Copyright © 2023-2025</p>""" ) def closeEvent(self, event): """Clean up resources before closing""" # Save settings self.save_settings() # Clean up temporary...
Python
1
] ) ], style={'width': '48%', 'display': 'inline-block', 'verticalAlign': 'top', 'marginLeft': '4%'}) ]) ], style={'marginBottom': '30px'}) ]) # Configure the app to enable callback exceptions app.config.suppress_callback_e...
Python
1
,figsize=(7,5)) plt.plot(xc,train_loss) plt.plot(xc,val_loss) plt.xlabel('num of Epochs') plt.ylabel('loss') plt.title('train_loss vs val_loss') plt.grid(True) plt.legend(['train','val']) #print plt.style.available # use bmh, classic,ggplot for big pictures plt.style.use(['classic']) plt.figure(2,figsize=(7,5)) plt.pl...
Python
1
CHANGE_NETINTERFACE_V2 = 4i32; #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] pub const CLUSTER_CHANGE_NETINTERFACE_STATE_V2: CLUSTER_CHANGE_NETINTERFACE_V2 = 8i32; #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] pub const CLUSTER_CHANGE_NETINTERFACE_HANDLE_CLOSE_V2: CLUSTER_CHANGE_...
Rust
0
# backend/auth/router.py from fastapi import APIRouter, Depends, HTTPException, status from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm from sqlalchemy.orm import Session from typing import Annotated from jose import JWTError, jwt from typing import List from . import security import models...
Python
1
Parameter, ) -> impl Future<Output = Result<TransmitPowerLevel, impl Display + Debug>> + 'a where T: HostControllerInterface, { ReturnedFuture(hci.send_command(parameter, events::Events::CommandComplete)) } } <filename>src/colony.rs extern crate chrono; extern crate rustc_serialize; u...
Rust
0
01(\x08R\tvariationB\0\"\x1a\n\tSoundType\x12\x0b\n\x07UN\ KNOWN\x10\0\x1a\0:\0B\0b\x06proto3\ "; static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { ...
Rust
0
set_active_block_number(1); enable_nomination(); assert_ok!(OraclePallet::_set_exchange_rate(currency_id, FixedU128::one())); issue_with_relayer_and_vault(currency_id, ISSUE_RELAYER, VAULT_1, wrapped(10000)); assert_nomination_opt_in(VAULT_1); assert_nominate_collateral(VAULT_1...
Rust
0
setup!(Vfs::stdfs(), "stdfs_method_mkdir_m"); /// let dir1 = tmpdir.mash("dir1"); /// assert!(vfs.mkdir_m(&dir1, 0o555).is_ok()); /// assert_eq!(vfs.mode(&dir1).unwrap(), 0o40555); /// assert_vfs_remove_all!(vfs, &tmpdir); /// ``` fn mkdir_m<T: AsRef<Path>>(&self, path: T, mode: u32) -> RvResult...
Rust
0
import os,sys,time os.system("clear") def jalan(z): for e in z + '\n': sys.stdout.write(e) sys.stdout.flush() time.sleep(0.08) jalan ("\033[1;91m===10%") os.system("clear") jalan ("\033[1;92m======40%") os.system("clear") jalan ("\033[1;93m===========60%") os.system("clear") jalan ("\033[1;94m================...
Python
1
DestinationHeader { flags: PerrDestinationFlags(0).with_addr_ext(true), dest_addr: [1, 2, 3, 4, 5, 6], hwmp_seqno: 0x0a090807, }; let ext_addr = [0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10]; write_perr_destination(&mut buf, &header, Some(&ext_addr), ReasonCode(0x1211)...
Rust
0
//"SmallPacket" assert!( !Vp9PartitionHeadChecker::is_partition_head(&Bytes::new()), "Small packet should not be the head of a new partition" ); //"NormalPacket" assert!( Vp9PartitionHeadChecker::is_partition_head(&Bytes::from_static(&[0x18, 0x00, 0x00])), "VP9 RTP ...
Rust
0
''' Stanley Bak Python GCAS F - 16 dldr function ''' import numpy as np from aerobench.util import sign, fix def dldr(alpha, beta): 'dldr function' a = np.array([[.005, .017, .014, .010, -.005, .009, .019, .005, -.000, -.005, -.011, .008], \ [.007, .016, .014, .014, .013, .009, .012, .005, .000, .004, .0...
Python
1
# coding: utf-8 """ Graphiant APIs **To use the APIs:** 1) Login using `/api/v1/auth/login` 2) Copy the value of \"token\" in the response 3) Click the \"Authorize\" button 4) In the \"Value\" text field enter: `Bearer <your token>` 5) Click \"Authorize\" 6) All requests are now authorized. **Toke...
Python
1
iring. pub max_voting_period: Duration, /// If set to true only members may execute passed /// proposals. Otherwise, any address may execute a passed /// proposal. pub only_members_execute: bool, /// Allows changing votes before the proposal expires. If this is /// enabled proposals will not...
Rust
0
out available fields see [int_st](index.html) module"] pub struct INT_ST_SPEC; impl crate::RegisterSpec for INT_ST_SPEC { type Ux = u32; } #[doc = "`read()` method returns [int_st::R](R) reader structure"] impl crate::Readable for INT_ST_SPEC { type Reader = R; } #[doc = "`reset()` method sets INT_ST to value 0...
Rust
0
from app.models.bet import Bet from app.models.game import Game from app.models.user import User from sqlalchemy import select, update from ..db.database import AsyncSessionLocal from typing import Type def calculate_bet_points(bet: Bet, game: Game) -> int: if bet.team1_score == game.team1_score and bet.team2_sco...
Python
1
VarCyFromDec(pdecin: *const super::super::Foundation::DECIMAL, pcyout: *mut super::Com::CY) -> ::windows_sys::core::HRESULT; #[doc = "*Required features: `\"Win32_System_Ole\"`, `\"Win32_System_Com\"`*"] #[cfg(feature = "Win32_System_Com")] pub fn VarCyFromDisp(pdispin: super::Com::IDispatch, lcid: u32, pc...
Rust
0
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import torchvision.transforms as transforms from sslime.data.ssl_transforms.ssl_rotate import SSL...
Python
1
from topaz.module import ClassDef from topaz.objects.objectobject import W_BaseObject as WR_BaseObject class WR_FrameObject(WR_BaseObject): _attrs_ = ['frame_object'] _immutable_fields_ = ['frame_object'] classdef = ClassDef('FrameObject', WR_BaseObject.classdef) def __init__(self, frame_object): ...
Python
1
g.CreatedResource(sink_ref) self._epilog_result_destination = result.destination self._epilog_writer_identity = result.writerIdentity return result def Run(self, args): """This is what gets called when the user runs this command. Args: args: an argparse namespace. All the arguments that we...
Python
1
c, d)': (i32, &str) [75; 76) 'c': i32 [78; 79) 'd': &str [83; 95) '(1, "hello")': (i32, &str) [84; 85) '1': i32 [87; 94) '"hello"': &str [102; 152) 'for (e... }': () [106; 112) '(e, f)': ({unknown}, {unknown}) [107; 108) 'e': {unknown} [110; 111) 'f': {unknown} [116; 125) 'so...
Rust
0
using [degs_to_rads](degs_to_rads) pub lat: f64, // The longitude of the coordinate, typcially this should be specified using // radians but it is easy to convert using [degs_to_rads](degs_to_rads) pub lon: f64, } impl GeoCoord { /// Create a new GeoCoord representing a coordinate /// /// ...
Rust
0
"floor{}", expr), Function::Ceil(expr) => write!(f, "ceil{}", expr), Function::Ln(expr) => write!(f, "ln{}", expr), Function::Round(expr) => write!(f, "round{}", expr), Function::Sin(expr) => write!(f, "sin{}", expr), Function::Sqrt(expr) => write!(f, "sqrt{}"...
Rust
0
= serde_json::to_string(&arg)?; let file_info = self.dropbox.download(&uri, &body, file_path)?; let file_info: FileMetadata = match serde_json::from_str::<FileMetadata>(&file_info) { Err(_) => return Err(match serde_json::from_str::<Error<PreviewError>>(&file_info) { Err(_) => DropboxError::Other, ...
Rust
0
class LogUtils(): def __init__(self, fname, filemode): self.logf = open(fname, filemode) def write(self, text, need_display=True): if need_display is True: print(text) self.logf.write(text + '\n') self.logf.flush() def close(self): self.logf.close() ...
Python
1
et(col, '') for col in columns} writer.writerow(filtered_row) logger.info(f"Successfully saved {len(data)} rows to {filepath}") except Exception as e: raise CSVProcessingError(f"Error saving CSV file {filepath}: {str(e)}") def load_csv_file(filepath: str, ...
Python
1
let stake_pool_owners = [ thor::Wallet::default(), thor::Wallet::default(), thor::Wallet::default(), thor::Wallet::default(), thor::Wallet::default(), thor::Wallet::default(), thor::Wallet::default(), thor::Wallet::default(), ]; let (jormungand...
Rust
0
#!/usr/bin/env python3 # Software License Agreement (BSD License) # # Copyright (c) 2121, UFACTORY, Inc. # All rights reserved. # # Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com> """ Description: joint velocity control """ import os import sys import time sys.path.append(os.path.join(os.path.dirname(...
Python
1
import json import numpy as np def main(temperature_functions, control_functions, logical_functions, t): def mu_temp(id, t): for x in temperature_functions['температура']: if x['id'] == id: if t <= x['points'][0][0]: return x['points'][0][1] ...
Python
1
=> Expr::Sub(Box::new(expr1), Box::new(expr2)), '*' => Expr::Mul(Box::new(expr1), Box::new(expr2)), '/' => Expr::Div(Box::new(expr1), Box::new(expr2)), '%' => Expr::Rem(Box::new(expr1), Box::new(expr2)), '^' => Expr::Exp(Box::new(expr1), Box::new(expr2)), _ => unreachable!(), ...
Rust
0
::<T, PrefabWasmModule<T>>::run_instantiate( origin, executable, &mut gas_meter, &schedule, endowment, data, &salt, debug_message.as_mut(), ) .and_then(|(account_id, result)| { let rent_projection = if compute_projection { Some( Rent::<T, PrefabWasmModule<T>>::compute_projection(...
Rust
0
ba(f) }) }; use ChapterOutcome::*; match self { Fight(fd, co) => Fight(fd.map_proba(f), convert(co)), OneRound(fd, cl, ce, cw) => OneRound(fd.map_proba(f), convert(cl), convert(ce), convert(cw)), Randomly(lst) => Randomly( lst .into_iter() .map(|(p, co2)| ...
Rust
0
; SESSION_KEY_LENGTH as _], //! client_proof: [u8; PROOF_LENGTH as _], //! client_seed: u32) { //! let seed = ProofSeed::new(); //! // Send seed to client //! seed.seed(); //! // Get username from client, fetch session key from login server //! let enc...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2022 Google LLC. All Rights Reserved. # # 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 requir...
Python
1
7720633, 52078352171243855), (78008331957098324, 04847613123220218, 06550838806837986), (62755680515396509, 49165433608990700, 39041897671300539), (93297154866561429, 52373802822465027, 67310807938230681), (89973844644540399, 75975762025877533, 66789448009436096), ...
Rust
0
from pathlib import Path from .MuckSeg_FCMAE import MuckSeg_FCMAE __all__ = ['build_model'] def build_model(node): node.defrost() cwd = Path.cwd() node.FILE_PATHS = [(cwd / path).as_posix() for path in node.FILE_PATHS] node.freeze() hparams = { 'image-size': node.IMAGE_SIZE, 'in...
Python
1
the field is `DEEP_SLEEP_CORR_EN_0`"] #[inline(always)] pub fn is_deep_sleep_corr_en_0(&self) -> bool { *self == DEEP_SLEEP_CORR_EN_A::DEEP_SLEEP_CORR_EN_0 } #[doc = "Checks if the value of the field is `DEEP_SLEEP_CORR_EN_1`"] #[inline(always)] pub fn is_deep_sleep_corr_en_1(&self) -> ...
Rust
0
datetime(&matches, "lockup_date").unwrap_or(0); let custodian = pubkey_of(matches, "custodian").unwrap_or_default(); let staker = pubkey_of(matches, STAKE_AUTHORITY_ARG.name); let withdrawer = pubkey_of(matches, WITHDRAW_AUTHORITY_ARG.name); let lamports = required_lamports_from(matches, "amount", "unit...
Rust
0
import argparse import os import warnings import cv2 import torch import torch.nn.parallel import torch.utils.data from loguru import logger import utils.config as config from engine.engine import inference from model import build_segmenter from utils.dataset import RefDataset from utils.misc import setup_logger war...
Python
1
map_err(Error::config_err)?; info!("config: {:?}", config); let (rudder, workers) = build_rudder(&config).await?; bootstrap_rudder(&config, rudder, workers).await } //! zombiesplit's notion of times. use serde_with::{DeserializeFromStr, SerializeDisplay}; use std::{ convert::TryFrom, fmt::{self, Di...
Rust
0
idx = find_nearest(freqIdxPoints, 10.) freqIdxPoints = freqIdxPoints[1:idx] powerSpectrumPoints = powerSpectrumPoints[1:idx] # Heart Rate Plot (ax3) gt_timeIdxPoints, gt_bpmPoints = getBPM_from_GT(signalDict) peak_timeIdx...
Python
1
NoiseFn<T>, C: NoiseFn<T>> NoiseFn<T> for Blend<A, B, C> { fn get(&self, point: T) -> f64 { let lower = self.source1.get(point); let upper = self.source2.get(point); let control = self.control.get(point); interp::linear(lower, upper, control) } } #[derive(Serialize, Deserialize...
Rust
0
.verbose() && (category.is_none() || module.category != category.unwrap()) { category = Some(module.category); if i != 0 { println!(); } println!("{}:", category_style.apply_to(module.category.to_string())); } print_module(&module, "", 0, ...
Rust
0
_cbc() -> Result<HString> { <Self as RtActivatable<ISymmetricAlgorithmNamesStatics>>::get_activation_factory().get_rc2_cbc() } #[inline] pub fn get_rc2_ecb() -> Result<HString> { <Self as RtActivatable<ISymmetricAlgorithmNamesStatics>>::get_activation_factory().get_rc2_ecb() } #[inline] ...
Rust
0
_candidate_list<'a>(&mut self, candidates: &'a [&'a Neighbor]) -> Option<&'a Peer> { if candidates.is_empty() { None } else if let Some(furthest) = self.find_furthest_if_full() { for candidate in candidates { if *candidate < furthest { return S...
Rust
0
"mrbgems/mruby-pack/include", // Array#pack and String#unpack "mrbgems/mruby-proc-ext/include", // NOTE(GH-32): This gem is required by `mruby-method`. "mrbgems/mruby-sprintf/include", // Kernel#sprintf, Kernel#format, String#% ] .into_iter() .map(|dir| path...
Rust
0
m, Self::Error> { let (peer, item) = { let t = self.0.as_mut().expect("Cannot poll WaitRecv twice"); match track!(t.poll_recv())? { Async::NotReady => return Ok(Async::NotReady), Async::Ready(None) => { track_panic!(ErrorKind::Other, "T...
Rust
0
(f) print_master(f"Loaded {len(cached_data)} cached hard negatives") return cached_data # Set model to evaluation mode self.model.eval() if isinstance(self.train_dataset, (IterativeCIRRDataset, IterativeFashionIQDataset)): # Determine sample ...
Python
1
from abc import abstractmethod from app.domain.lowcode_model.model_ctx.model import ModelContext, ModelNameContext from app.domain.project_ctx.project import ProjectContext, DatabaseInfo from app.repo.interface import ModelRepo, DatabaseInstanceRepo class ContextHolder: @abstractmethod def get_model_context...
Python
1
#[derive(Clone, Debug, PartialEq)] pub struct NimMove { pub heap: usize, pub amount: usize, } impl NimState { pub fn get_largest_heap(&self) -> Option<(usize, usize)> { self.heaps .iter() .enumerate() .max_by_key(|(_i, &c)| c) .map(|(i, &c)| (i, c))...
Rust
0
path: Vec::new(), operator: None, pos, //comment: (None, None), tag: Attribute::new(), }], operators: Vec::new(), }, pos, } } } /*#[derive(Clone, PartialEq, Debug)] ...
Rust
0
simple_time_difference::solve; use test::{black_box, Bencher}; #[bench] fn bench(bencher: &mut Bencher) { let arr = black_box(&["21:14", "15:34", "14:51", "06:25", "15:30"]); bencher.iter(|| solve(arr)); } // Copyright 2015 The Delix Project Authors. See the AUTHORS file at the top level directory. // // Lice...
Rust
0
 cCs\t|tr!tj|}nt|tsTtjdt|tdddS||S(s] Implementation of - operator when left operand is not a C{L{ParserElement}} s4Cannot combine element of type %s with ParserElementRiN( RrRR"Ri...
Python
1
IG }, duration); bitbox02::commander::Error::COMMANDER_OK } /// # Safety /// request must be not NULL. #[no_mangle] pub unsafe extern "C" fn commander_bitboxbase( request: *const bitbox02::BitBoxBaseRequest, ) -> bitbox02::commander_error_t { // Accessing raw pointers are unsafe let request = match req...
Rust
0
c.push_input(value)? } } OptMatch::UnknownKey(key) => { log::warn!(r#"unrecognized option "{}""#, key); } OptMatch::UnknownKeyValue(key, value) => { log::warn!(r#"unrecognized opt...
Rust
0
#!/usr/bin/env python # Copyright (c) 2014 Katsuya Noguchi # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
Python
1
to_rgb=False)) # 现在处理 prev 的时刻 results['filename_prev'] = prev_file_name_list results['img_prev'] = prev_img_list results['img_shape_prev'] = prev_img_shape_list results['ori_shape_prev'] = prev_ori_shape_list results['pad_shape_prev'] = prev_pad_shape_list ...
Python
1
use crate::task::waker::InlineWaker; use crate::threadpool::Handle; impl Handle { pub fn block_on<F, T>(&self, future: F) -> T where F: Future<Output = T> + Send + 'static, T: Send + 'static, { let future = self.spawn(future); pin_mut!(future); let inline_waker = I...
Rust
0
"""Simulation of a gyroscope hanging from a spring""" # (adapted by M. Musy from Bruce Sherwood, 2009) from vedo import * # ############################################################ parameters dt = 0.005 # time step ks = 15 # spring stiffness Lrest = 1 # unstretched length of spring Ls = 1 # length of g...
Python
1
irst') else: A1a = finder('ID',int(call.from_user.id)) A1b = get((A1a),'Peer') print('Test value:'+str(A1b)) if A1b == 0: tout1 ...
Python
1
ing_character) .fold(0, |score, ch| score * 5 + score_map[&ch]); scores.push(score); }); let middle = scores.len() as f32 / 2.0; let middle = middle.ceil() as usize - 1; scores.sort_unstable(); scores[middle] } fn illegal_character(input: &str) -> (Option<u8>, Vec...
Rust
0
essage generaation is done logon_msg.set_field(Field::String(8, session.begin_string.to_string())); logon_msg.set_field(Field::String(35, "A".to_string())); if self.send(session, logon_msg).is_ok() { self.session_state.insert(session.clone(), State::LoginSent); // todo Login Sent ...
Rust
0
import pytest from dataclass_wizard.environ.lookups import * @pytest.mark.parametrize( 'string,expected', [ ('device_type', 'devicetype'), ('isACamelCasedWORD', 'isacamelcasedword'), ('ATitledWordToTESTWith', 'atitledwordtotestwith'), ('not-a-tester', 'notatester'), ('...
Python
1