text
string
label_name
string
labels
int64
from .lib import ANY import json import re class StringMatcher: """ A node that matches a string against a list of conditions and returns the matched value. Each condition in the list should be in the format "condition:value". The condition can be a regular expression pattern. """ def __in...
Python
1
to 1 along the specified axis. If `x` is a scalar, a scalar is returned. Notes ----- `log_softmax` is more accurate than ``np.log(softmax(x))`` with inputs that make `softmax` saturate (see examples below). .. versionadded:: 1.5.0 Examples -------- >>> import numpy as np ...
Python
1
if final_gap > 0: gap_card = { 'type': 'gap', 'start_port': last_port + 1, 'end_port': end_port, 'available_count': final_gap } ...
Python
1
&& mwe < MAXIMUM_CAL_ERROR_NS && mean_error / mean <= 1.0 { break; } } } } fn adjust_cal_ratio(&mut self, reference: &Monotonic, source: &Counter) { // Overall algorithm: measure the delta be...
Rust
0
time.sleep(1) return tag def Delete_Work_Frame(self, name, block=True): """ Delete_Work_Frame 删除指定工作坐标系 :param name: 要删除的工具坐标系名称 :param block: RM_NONBLOCK-非阻塞,发送后立即返回;RM_BLOCK-阻塞,等待控制器返回设置成功指令 :return:0-成功,失败返回:错误码, rm_define.h查询. """ self.pDl...
Python
1
, pub url: Option<String>, pub stack_trace: Option<StackTrace>, pub exception: Option<RemoteObject>, pub execution_context_id: Option<ExecutionContextId>, pub exception_meta_data: Option<serde_json::Map<String, Value>>, } /// https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#type-StackTrace #[d...
Rust
0
EE5: LATIN SMALL LETTER U WITH DOT BELOW "ủ", // U+1EE7: LATIN SMALL LETTER U WITH HOOK ABOVE "ứ", // U+1EE9: LATIN SMALL LETTER U WITH HORN AND ACUTE "ừ", // U+1EEB: LATIN SMALL LETTER U WITH HORN AND GRAVE "ử", // U+1EED: LATIN SMALL LETT...
Rust
0
"""Representation of a OpenSurplusManager Device.""" import asyncio from pyosmanager import APIError, OSMClient class OSMDevice: """Base representation of a OpenSurplusManager Device.""" def __init__(self, client: OSMClient, device_name: str): """Initialize the device.""" self.client = clie...
Python
1
header: Header, /// Record quoting details. pub quote: Quote, /// Whether or not the number of fields in a record is allowed to change. pub flexible: bool, /// Whether the file is utf-8 encoded. pub is_utf8: bool, } impl PartialEq for Dialect { fn eq(&self, other: &Dialect) -> bool { ...
Rust
0
e) { attribute.0 = value; attribute.2 = true; return true; } else { return false;} } } // println!("555"); false } pub fn get_data_item(&self) -> Data_item{ let mut attrib...
Rust
0
depth_uniform_bgl, ); graph_data.directional_light_manager.add_to_bg(&mut bgb); let forward_uniform_bg = bgb.build( &renderer.device, Some("forward uniform bg"), &interfaces.forward_uniform_bgl, ); graph_data.set_data(shadow_handle, Some(sha...
Rust
0
p(), "we just pushed a component"); } link_destination.extend(components); path_backing = link_destination; components = path_backing.components(); } } } } Ok(r...
Rust
0
shared BroadcastChannel that is cloned for each OutboundStream. Any message that a connected clients sends is broadcast to every other connected client. Importantly, this means that the dispatch and fanout of messages is managed entirely by your implementation. For an opinionated layer on top of this, see the trillium...
Rust
0
#!/usr/bin/python3 """ class Square that inherits from Rectangle (9-rectangle.py) """ Rectangle = __import__('10-square').Rectangle class Square(Rectangle): """ class Square that inherits from Rectangle """ def __init__(self, size): """ __init__ is used for initialization Par...
Python
1
e are three available options: default, auto_scheduler and meta_schedule." ) m = graph_executor.GraphModule(lib["default"](dev)) def to_torch_tensor(nd_tensor): """A helper function to transfer a NDArray to torch.tensor.""" if nd_tensor.dtype == "bool": # DLPack does not sup...
Python
1
l.append(int(labels[ind])) pr.append(int(predicted[ind])) po.append(list(numpy.array(posteriors[ind], dtype=numpy.float64))) a.append(list(numpy.array(attentions[ind], dtype=numpy.float64))) i.append("sample_{}".format(index)) json_list = [] for index in range(0, len(X_test)): data_json_dict = {...
Python
1
.0.0"], whitespace_1 => [">= 1.0.0", ">=1.0.0"], whitespace_2 => [">= 1.0.0", ">=1.0.0"], whitespace_3 => [">= 1.0.0", ">=1.0.0"], whitespace_4 => ["> 1.0.0", ">1.0.0"], whitespace_5 => ["> 1.0.0", ">1.0.0"], whitespace_6 => ["<= 2.0.0", "<=2.0.0"], whitespa...
Rust
0
# Python generator object for variable names F = FreeGroup([next(name_itr) for x in perm_rep.gens()]) ret_rls = tuple([F(rel_word.TietzeWordAbstractWord(image_gens).sage()) for rel_word in GAP_fp_rep.RelatorsOfFpGroup()]) return FinitelyPresentedGroup(F, ret_rls) def KleinFourPresen...
Python
1
*, Types::*, VecTypes::*, }; use gpgpu::dim::{Dim::*, DimDir::*}; use gpgpu::functions::Function; use gpgpu::integrators::{create_euler_pde, *}; use gpgpu::pde_parser::pde_ir::ir_helper::*; use gpgpu::Handler; fn main() -> gpgpu::Result<()> { println!("\n------------------------------------------------------\n"); ...
Rust
0
fibers.append(gruvi.spawn(get_queue, count)) for fib in fibers: fib.join() gruvi.get_hub().close() queue = gruvi.Queue() threads = [] # 5 procuders and 5 consumers, each with 20 fibers for i in range(5): thread = threading.Th...
Python
1
a', 'el': 'Ραπανούι', 'el-polyton': 'Ραπανούι', 'en': 'Rapanui', 'es': 'rapanui', 'et': 'rapanui', 'eu': 'rapanuia', 'fa': 'راپانویی', 'ff-Adlm': '𞤈𞤢𞤨𞤢𞤲𞤵𞤭𞥅𞤪𞤫', 'fi': 'rapanui', 'fil': 'Rapanui', 'fo': 'rapanui', 'fr': 'rapanui', 'fy': 'Rapanui', 'ga': 'Rapanúis', 'gd': 'Rapa Nui', 'gl': 'rapanui', 'gsw': 'Osc...
Python
1
import pandas as pd import glob import os # merging the files joined_files = os.path.join("D:\Offensive Language Detector\Data", "k*.csv") # A list of all joined files is returned joined_list = glob.glob(joined_files) #files are joined using pandas df = pd.concat(map(pd.read_csv, joined_list), ignore_index=Tr...
Python
1
# Copyright (c) 2021 Emanuele Bellocchia # # 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, modify, merge, publish,...
Python
1
512 to 1023 Octet Good Bad Frame Counter Interrupt Status"] #[inline(always)] pub fn rx512t1023octgbfis(&self) -> RX512T1023OCTGBFIS_R { RX512T1023OCTGBFIS_R::new(((self.bits >> 15) & 0x01) != 0) } #[doc = "Bit 16 - MMC Receive 1024 to Maximum Octet Good Bad Frame Counter Interrupt Status"] ...
Rust
0
from sqlalchemy import Column, Integer, String, DateTime, Float, Text, ForeignKey, Boolean, Enum from sqlalchemy.orm import relationship from sqlalchemy.sql import func import enum from .database import Base class EngagementType(enum.Enum): PARTICIPATION = "participation" FEEDBACK = "feedback" INTERACTION...
Python
1
"""Complementary tests for FeatureSqueezing score.""" import re import pytest import torch from torch import nn from scio.recorder import Recorder from scio.scores import FeatureSqueezing @pytest.mark.parametrize("squeezers", [0, ("bits:1", 0)]) def test_sanitizes_custom_squeezers(squeezers): """Check raise on...
Python
1
::Swap2 => write!(f, "swap2"), UserOps::Swap4 => write!(f, "swap4"), UserOps::Roll4 => write!(f, "roll4"), UserOps::Roll8 => write!(f, "roll8"), UserOps::Choose => write!(f, "choose"), UserOps::Choose2 => write!(f, "choose2...
Rust
0
(&conn)?; conn.execute("BEGIN;", NO_PARAMS)?; Ok((path, conn)) } fn create_table(conn: &Connection) -> AppResultU { conn.execute("CREATE TABLE IF NOT EXISTS h (key TEXT PRIMARY KEY, value TEXT, created_at TEXT NOT NULL, updated_at TEXT NOT NULL, expired_at INTEGER);", NO_PARAMS).unwrap(); Ok(()) } <gh_...
Rust
0
from lumibot.strategies import Strategy class MarketMakingStrategy(Strategy): parameters = { "symbol": "BTC/USD", "spread_percentage": 0.002, "order_size_percentage": 0.05, "update_interval": "1m", } def initialize(self, symbol=None): self.sleeptime = self.paramete...
Python
1
mg_siz, test_img_paths, test_label_paths) model.compile(optimizer='adam', loss = 'sparse_categorical_crossentropy', metrics=['accuracy']) cb = [keras.callbacks.ModelCheckpoint('oxford_seg.h5', save_best_only = True)] # Automatically save best weights model.fit(train_gen, epochs = 30, validation_data = test_gen, call...
Python
1
V>>), FieldSpecifier(Box<FieldSpecifierChildren<T, V>>), FieldInitializer(Box<FieldInitializerChildren<T, V>>), ShapeTypeSpecifier(Box<ShapeTypeSpecifierChildren<T, V>>), ShapeExpression(Box<ShapeExpressionChildren<T, V>>), TupleExpression(Box<TupleExpressionChildren<T, V>>), GenericTypeSpecifi...
Rust
0
), suffix.map(Term)) } } impl Quote for LiteralKind { fn quote(self) -> TokenStream { match self { $(LiteralKind::$i => quote! { ::__internal::LiteralKind::$i },)* $(LiteralKind::...
Rust
0
# -*- coding: utf-8 -*- """ This file contains a more advanced QDockWidget subclass. Copyright (c) 2021, the qudi developers. See the AUTHORS.md file at the top-level directory of this distribution and on <https://github.com/Ulm-IQO/qudi-core/> This file is part of qudi. Qudi is free software: you can redistribute ...
Python
1
# Atividade 07: # Tabuada com Condicional: # Faça um programa que solicite um número ao usuário e use # um laço while para exibir a tabuada desse número (de 1 a 10), # mas apenas para os resultados que forem múltiplos de 3. r = 0 c = 0 n = int(input('Faça a tabuada do ')) while c != 10: c += 1 r = n * c if r % ...
Python
1
P降维 umap_model = UMAP(n_components=2, random_state=42) embeddings_2d = umap_model.fit_transform(np.array(embeddings)) # 使用ClusteringService进行聚类 from Search.clustering import ClusteringService,SearchResult service = ClusteringService() ...
Python
1
ox::leak(node_box).into(); if let Some(mut position) = insert_position { unsafe { let mut brother = position.position.unwrap(); if position.is_right { node.as_mut().next = brother.as_ref().next; node.as_mut().prev = Some(brother...
Rust
0
/// ``` /// # use crypt2web_core::encrypt; /// encrypt("🍉", b"Hello!", "text/plain"); pub fn encrypt(password: &str, content: &[u8], mime_type: &str) -> Vec<u8> { let salt: [u8; SALT_SIZE] = rand::thread_rng().gen(); let nonce: [u8; NONCE_SIZE] = rand::thread_rng().gen(); let key = derive_key(&salt, passw...
Rust
0
dir : Path Temporary directory skip_mmd : bool Skip mermaid diagram generation skip_timeline : bool Skip timeline generation """ # Cleanup subprocess runners self._cleanup_subprocess_runners() @classmethod def create_with_callbacks( ...
Python
1
read_text(b"allergenName", buffer)?; if protein.name.allergen.replace(value).is_some() { return Err(Error::DuplicateElement("allergen", "protein")); } }, b"biotechName" => { let value = reader.read_text(b"biotechName", buffer)?;...
Rust
0
_superset_of(&stack_range)); debug_assert!(process_range.range().is_superset_of(&mmap_range)); let mmap_manager = SgxMutex::new(mmap_manager); Ok(ProcessVM { process_range, elf_ranges, heap_range, stack_range, brk, mmap_ma...
Rust
0
from(other: u32) -> Self { Sdtr1(other) } } impl ::core::fmt::Display for Sdtr1 { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { self.0.fmt(f) } } impl ::core::fmt::Debug for Sdtr1 { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { ...
Rust
0
#!/usr/bin/env python3 import numpy as np NN = __import__('11-neural_network').NeuralNetwork lib_train = np.load('../data/Binary_Train.npz') X_3D, Y = lib_train['X'], lib_train['Y'] X = X_3D.reshape((X_3D.shape[0], -1)).T np.random.seed(0) nn = NN(X.shape[0], 3) _, A = nn.forward_prop(X) cost = nn.cost(Y, A) print(...
Python
1
vec![], } } fn build_tree(&mut self, columns: &ArrayView2<'_, D>, target: &ArrayView1<'_, D>, indices: Option<&Vec<usize>>, inv_depth: u8) -> i64 { if inv_depth == 0 || target.dim() == 0 { return -1; } if let Some(ind) = indices { if ind...
Rust
0
CANRESUME: u32 = 32u32; #[doc = "*Required features: `\"Win32_Media_DeviceManager\"`*"] pub const WMDM_DEVICECAP_CANSEEK: u32 = 128u32; #[doc = "*Required features: `\"Win32_Media_DeviceManager\"`*"] pub const WMDM_DEVICECAP_CANSTOP: u32 = 64u32; #[doc = "*Required features: `\"Win32_Media_DeviceManager\"`*"] pub const...
Rust
0
from __future__ import (absolute_import, division, print_function, unicode_literals) from nose.tools import assert_equal import six import os import tempfile import warnings from matplotlib.font_manager import ( findfont, FontProperties, fontManager, json_dump, json_load, get_font) from m...
Python
1
category: *mut c_char, msg: *mut c_char) { let cs: &mut CommandServer = &mut *(cs_ptr as *mut CommandServer); let cat_cstring = ptr_to_cstring(category); let cat_str = cat_cstring.to_str().expect(CSTRING_CONV_ERR); let msg_cstring = ptr_to_cstring(msg); let msg_str = msg_cstring.to_str().expect(CST...
Rust
0
pythoncom.CLSCTX_ALL, axdebug.IID_IProcessDebugManager, ) self.app, self.root = interfaceMaker.MakeInterfaces(self.pdm) self.app.SetName(processName) self.interfaceMaker = interfaceMaker expressionProvider = _wrap( expressions.ProvideExpress...
Python
1
def Max(l): m=l[0] for val in l[1:]: if val>m: m=val return m l=[] n=int(input("enter the no.of elements:")) for i in range(n): ele=int(input("enter the element:")) l.append(ele) print(l) print(Max(l))
Python
1
format!("GtkPlugPrivate @ {:?}", self as *const _)) .finish() } } #[repr(C)] #[derive(Copy, Clone)] pub struct GtkPopoverAccessibleClass { pub parent_class: GtkContainerAccessibleClass, } impl ::std::fmt::Debug for GtkPopoverAccessibleClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std:...
Rust
0
; WIDTH * HEIGHT]; let mut window = match Window::new("Buffer test", WIDTH, HEIGHT, WindowOptions { resize: false, ...
Rust
0
(Vec<_>, Vec<_>) = (0..100_000).map(|_| mpsc::channel()).unzip(); if txs_tx.send(txs).is_err() { break; } if rxs_tx.send(rxs).is_err() { break; } }); let _ = thread::spawn(move || { while let Ok(mut txs) = txs_rx.recv() { while let Som...
Rust
0
sqrt() } pub fn calculate_annual(ratio_per_trade: f64, trades_per_day: f64, trading_days: u32) -> f64 { calculate_daily(ratio_per_trade, trades_per_day) * (trading_days as f64).sqrt() } #[cfg(test)] mod tests { use super::*; use crate::statistic::summary::pnl::PnLReturnSummary; fn sharpe_ratio_input(...
Rust
0
= 0x00020001; pub const ICONIFIED: c_int = 0x00020002; pub const RESIZABLE: c_int = 0x00020003; pub const VISIBLE: c_int = 0x00020004; pub const DECORATED: c_int = 0x00020005; pub const AUTO_ICONIFY: c_int = 0x00020006; pub const FLOATING: c_int = 0x00020007; pub const MAXIMIZED: c_int = 0x00020008; pub const CENTER_C...
Rust
0
/// let mut reader = ReaderBuilder::new() /// .skip_invalid(true) /// .from_path("tests/data/dump.dat.gz")?; /// assert_eq!(reader.byte_records().count(), 7); /// /// Ok(()) /// } /// ``` pub fn byte_records(&mut self) -> ByteRecordsIter<R> { ByteRecor...
Rust
0
s f32 * step).sin() * outer_radius); temp_vec.push(((i + 1) as f32 * step).cos() * outer_radius); temp_vec.push(-0.5 ); temp_vec.push(((i + 1) as f32 * step).sin() * outer_radius); } return temp_vec; }<filename>lumen_runtime/src/otp/erlang/is_equa...
Rust
0
MILES: Oc1cc(O)c2c(c1)oc(-c1cc(O)c(O)cc1)c(O)c2=O - 5,7,3',4',5'-dohexacontahydroxyflavone: SMILES: Oc1cc(O)c2c(c1)oc(-c1cc(O)c(O)cc1)c(O)c2=O - 5,7,3',4',5'-trihexacontahydroxyflavone: SMILES: Oc1cc(O)c2c(c1)oc(-c1cc(O)c(O)cc1)c(O)c2=O - 5,7,3',4',5'-tetrahexacontahydroxyflavone: SMILES: Oc1cc(O)c2c(c1)oc(-c1cc(O)c...
Python
1
_u64() as usize + 4; let length = U256::from(data.get(index..(index + 32)).expect("no enough data")).low_u64() as usize; let index = index + 32; let value = String::from_utf8(Vec::from( data.get(index..index + length).expect("no enough data"), )) .unwrap()...
Rust
0
5fb3b0ee7ce7da1bc52e30840cc04a77f7fd046261f"); M_account[157] = parse_hex("3a7c4ad920e4857e93b7fba9030eea06ce88813bbb684b8239b283163101210d"); M_account[158] = parse_hex("<KEY>"); M_account[159] = parse_hex("4c4ad559b2de70ae6c20b35451f7fbe5586638c750d67babda6f14cf12ab7ee2"); let _test_v...
Rust
0
""" 01_manual_mixer_calibration.py: Calibration for mixer imperfections """ from qm import QuantumMachinesManager from qm.qua import * from configuration import * ################### # The QUA program # ################### with program() as cw_output: with infinite_loop_(): play("cw" * amp(0), "Yb") ###...
Python
1
import pandas as pd import os # Paths to the metadata files nyu_csv = "training/nyu_depth_v2/unlabelled_patches/metadata.csv" void_csv = "training/void_1500/random_patches/metadata.csv" output_csv = "training/unlabeled_metadata.csv" nyu_base = "training/nyu_depth_v2/unlabelled_patches" void_base = "training/void_1500...
Python
1
; type Error = Error; type Future = ResponseFuture; fn poll_ready(&mut self) -> Poll<(), Self::Error> { self.client.poll_ready() .map_err(Into::into) } fn call(&mut self, request: Self::Request) -> Self::Future { trace!("request: {} {}", request.method(), request.uri())...
Rust
0
} #[no_mangle] pub unsafe extern "C" fn lodepng_chunk_check_crc(chunk: *const u8) -> c_uint { ChunkRef::from_ptr(chunk).unwrap().check_crc() as c_uint } #[no_mangle] pub unsafe extern "C" fn lodepng_chunk_generate_crc(chunk: *mut u8) { rustimpl::lodepng_chunk_generate_crc(slice::from_raw_parts_mut(chunk, 0x7F...
Rust
0
zero_power_of_two_alignment: NonZeroUsize, current_memory: NonNull<u8>) { unsafe { self.reference().deallocate(current_memory, Self::layout(non_zero_size, non_zero_power_of_two_alignment)) } } #[inline(always)] fn growing_reallocate(&self, non_zero_new_size: NonZeroUsize, non_zero_power_of_two_new_alignment: Non...
Rust
0
RSION}, PID: {os.getpid()} ---") if os.name == 'nt': bring_console_to_front() # Tell Qt to use the system's dark theme if available app = QApplication(sys.argv) app.setAttribute(Qt.ApplicationAttribute.AA_UseStyleSheetPropagationInWidgetStyles, True) # Set up Windows dark title bar if possibl...
Python
1
mt.line("RegBank {"); fmt.indent(|fmt| { fmt.line(&format!(r#"name: "{}","#, reg_bank.name)); fmt.line(&format!("first_unit: {},", reg_bank.first_unit)); fmt.line(&format!("units: {},", reg_bank.units)); fmt.line(&format!("names: &[{}],", names)); fmt.line(&format!(r#"prefix:...
Rust
0
import urllib2, json, urllib import configuration import ssl CONFIG = configuration.Configuration() try: API_USER_KEY = CONFIG.get("OPENPHACTS_API_KEY") # change this value with custom API key API_APP_ID = CONFIG.get("OPENPHACTS_APP_ID") except: print "Warning: OPENPHACTS API key not found!" API_USER...
Python
1
|st d|qd|vr|dd dd}nd|vr|dr|dd}d|d}nd|vr|dr|dd}d|d}nd|vr|dr|ddd d}d!|d}nd"|vr>|d#r>td$|}|r0|d n|dd}d%|d&}n\d'|vrW|d#rW|dd}d(|d&}nCd)|vr}d*|vspd+|vspd,|vspd-|vr}|...
Python
1
import numpy as np N = 1000 m = (2**31)-1 a = 7**5 c = 0 x = np.zeros(N+1,dtype='float') #### x[i] belongs to the set {0,1,....,m-1} u = np.zeros(N,dtype='float') #### 0<=u[i]<1 Z = [] #### z[i] = 0,1,2,....,r,..... T = [0] #### indexs of u[i] such that alpha...
Python
1
from __future__ import annotations from .async_api import RcApi as AsyncRcApi from .sync_api import RcApi as SyncRcApi __all__ = ["AsyncRcApi", "SyncRcApi"]
Python
1
f type proc", m.source, m.destination ))); } } if m.destination.starts_with(PROC_PATH) { return Err(anyhow!(format!( "{} cannot be mounted because it is inside /proc", m.destination ))); } Ok(()) } fn mount_cgroups_v2(cfd_log...
Rust
0
// Write the result of our drawing to the window's OpenGL frame. draw.to_frame(app, &frame).unwrap(); // Return the drawn frame. frame } use super::setup; use crate::common::{ jcli::JCli, jormungandr::ConfigurationBuilder, startup, transaction_utils::TransactionHash, }; use chain_core::property::...
Rust
0
def strongly_connected_components_tree(vertices, edges): """ Find the strongly connected components of a directed graph. Uses a recursive linear-time algorithm described by Tarjan [2]_ to find all strongly connected components of a directed graph. Parameters ---------- vertices : iterable...
Python
1
_udp_socket(udp_socket_id: u64) -> u64 //% //% Clones a UDP socket returning the ID of the clone. //% //% Traps: //% * If the stream ID doesn't exist. fn clone_udp_socket(mut caller: Caller<ProcessState>, udp_socket_id: u64) -> Result<u64, Trap> { let stream = caller .data() .resources .udp_...
Rust
0
# coding=utf-8 """ Öğrenci ekle/sil/ara/listele Öncelikle pymongo modülünü kurmanız gerekiyor Bunun için " sudo pip install pymongo " diye yazın terminale gerisi halleder zaten. db_ogrenciler adında bir database miz var ogrenci adında bir collectionumuz var. Table dememin sebebi SQL de table d...
Python
1
HWND, hRadio: HANDLE, pbtbi: *mut BLUETOOTH_DEVICE_INFO, pszPasskey: PWSTR, ulPasskeyLength: ULONG, ) -> DWORD; } STRUCT! {struct BLUETOOTH_PIN_INFO { pin: [UCHAR; BTH_MAX_PIN_SIZE], pinLength: UCHAR, }} pub type PBLUETOOTH_PIN_INFO = *mut BLUETOOTH_PIN_INFO; STRUCT! {struct...
Rust
0
tasks[task_name].append((model, revision, score)) for task_name, task_results in tasks.items(): task_results.sort(key=lambda x: x[2]) # scores to assign to each candidate scores = list(range(0, n_candidates, 1)) prev_result = None tied_group = [] score = 0 ...
Python
1
if clock.unix_timestamp <= ido_account.ido_times.end_ido { return err!(ErrorCode::IdoNotOver); } Ok(()) } fn escrow_over(ido_account: &IdoAccount) -> Result<()> { let clock = Clock::get()?; if clock.unix_timestamp <= ido_account.ido_times.end_escrow { return err!(ErrorCode::EscrowNotOve...
Rust
0
(test3); [&*test1, &*test2, &*test3] } <reponame>soheiloo/shadows //! EXCHANGE module benchmarking. #![cfg(feature = "runtime-benchmarks")] use super::*; use crate::Module as Exchange; use frame_benchmarking::{account, benchmarks}; use frame_system::RawOrigin; use sp_runtime::traits::UniqueSaturatedInto; ...
Rust
0
rinsics::atomic_xadd(&mut system_base_info.sctpstat.sctps_inpackets, 1u32); if n as libc::c_uint <= iovlen { (**udprecvmbuf6.offset(0isize)).m_hdr.mh_len = n; to_fill += 1 } else { let mut i = 0; i = 0i32; (**udprecv...
Rust
0
# Generated by Django 3.1.8 on 2021-04-19 19:43 import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("homework", "0005_GodAnswe...
Python
1
from app import app from models import db, Company, Keyword, CoKeyAssoc # from k_lists.alzheimers import keyword as kw, companies as cos # from k_lists.diabetes import keyword as kw, companies as cos # from k_lists.weight_loss_obesity import keyword as kw, companies as cos # from k_lists.hypoglycemia import keyword as ...
Python
1
lace("module.", ""): value for key, value in sd.items()} elif "state_dict" in sd: print("Load from normal model!") if "gen_model" in sd["state_dict"]: sd = sd["state_dict"]["gen_model"] else: sd = sd["state_dict"] keys = list(sd.keys()...
Python
1
ipt'), (_appsect, bygroups(Generic.Heading, Whitespace), 'script'), (_headers, bygroups(Whitespace, Keyword, Text)), (r'\s*#.*?\n', Comment), (r'\b(([0-9]+\.?[0-9]*)|(\.[0-9]+))\b', Number), (r'[ \t]+', Whitespace), (r'(?!^\s*%).', Text), ]...
Python
1
'犬'); assert_eq!(UNIHAN_RADICALS.get(&95).unwrap().point, '玄'); assert_eq!(UNIHAN_RADICALS.get(&96).unwrap().point, '玉'); assert_eq!(UNIHAN_RADICALS.get(&97).unwrap().point, '瓜'); assert_eq!(UNIHAN_RADICALS.get(&98).unwrap().point, '瓦'); assert_eq!(UNIHAN_RADICALS.get(&99).unwrap().point, '甘'); ...
Rust
0
(settings) })() .expect("couldn't build config"); Ok(settings.try_into()?) } async fn inner_main() -> Result<()> { let args: Vec<String> = std::env::args().collect(); let conf: Config = read_config("Yuribot")?; env_logger::Builder::new().parse_filters(&conf.log).init(); debug!("version {}"...
Rust
0
} impl RpcObject { /// Returns the 'id' of the underlying object, if present. pub fn get_id(&self) -> Option<RequestId> { self.0.get("id").and_then(Value::as_u64) } /// Returns the 'method' field of the underlying object, if present. pub fn get_method<'a>(&'a self) -> Option<&'a str> { ...
Rust
0
Num = { 1: '①', 2: '②', 3: '③', 4: '④', 5: '⑤', 6: '⑥', 7: '⑦', 8: '⑧', 9: '⑨', 10: '⑩', 11: '⑪', 12: '⑫', 13: '⑬', 14: '⑭', 15: '⑮', 16: '⑯', 17: '⑰', 18: '⑱', 19: '⑲', 20: '⑳', 21: '㉑', 22: '㉒', 23: '㉓', 24: '㉔', 25: '㉕', 26: '㉖', 27: '㉗', 28: '㉘...
Python
1
Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7); self.w } } #[doc = "Trigger Input Source Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum ...
Rust
0
tuple("Sha256dChecksum") .field(&hex::encode(&self.0)) .finish() } } #[cfg(test)] mod tests { use super::*; #[test] fn sha256d_checksum() { // https://en.bitcoin.it/wiki/Protocol_documentation#Hashes let input = b"hello"; let checksum = Checksum::from(&i...
Rust
0
""" 1. Напишите программу, которая запрашивает у пользователя строку и преобразует ее, удаляя все гласные буквы из строки. Используйте метод replace() для замены гласных букв на пустую строку. Выведите преобразованную строку на экран с помощью команды print. """ def remove_vowels(s): vowels = "aeiouy" s = s.l...
Python
1
adata("radar_beam_width_h") dic["data"] = dset.variables["Beamwidth"][:] instrument_parameters["radar_beam_width_h"] = dic dset.close() return Radar( time, _range, fields, metadata, scan_type, latitude, longitude, altitude, ...
Python
1
"""Utility modules for the Excel Agent backend."""
Python
1
`ServiceWorker`*"] pub fn onerror(this: &ServiceWorker) -> Option<::js_sys::Function>; # [wasm_bindgen (structural , method , setter , js_class = "ServiceWorker" , js_name = onerror)] #[doc = "Setter for the `onerror` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer...
Rust
0
pub MATCH_AS_REF, complexity, "a `match` on an Option value instead of using `as_ref()` or `as_mut`" } declare_clippy_lint! { /// ### What it does /// Checks for wildcard enum matches using `_`. /// /// ### Why is this bad? /// New enum variants added by library updates can be missed. ...
Rust
0
(2, 2))); model.add(Dropout(0.4)) model.add(Conv2D(filters=64, kernel_size=3, activation='relu', padding='same')); model.add(MaxPooling2D(pool_size=(2, 2))); model.add(Dropout(0.4)) model.add(Reshape((16, 16 * 64))) model.add(LSTM(64)); model.add(Dropout(0.5)) model.add(Dense(128, activation='relu')) ...
Python
1
actions(now, 3, false).count(); let _ = buffer .add_to_loss_list([SeqNumber(1)].iter().collect()) .count(); // three packets received, one of them was lost but recovered assert_eq!( buffer.update_largest_acked_seq_number(SeqNumber(3), None, None), ...
Rust
0
# Copyright 2024 Google LLC # 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, sof...
Python
1
, /// First epoch at which a fault declaration is rejected (< Open). pub fault_cutoff: ChainEpoch, } impl DeadlineInfo { pub fn new(period_start: ChainEpoch, deadline_idx: u64, current_epoch: ChainEpoch) -> Self { if deadline_idx < WPOST_PERIOD_DEADLINES as u64 { let deadline_open = per...
Rust
0
tiser. def get_tracking_tag_delta(advertiser_ids: list[str], change_tracking_version: int) -> Any: query = """ query GetTrackingTagDeltas($changeTrackingVersion: Long!, $advertiserIds: [ID!]!) { trackingTagDelta( input: { advertiser: { changeTrackingVersion: $changeTrackingVersion ...
Python
1
result_zip=b"" ) elif status == "FAILED": # 失敗的任務也可能有部分結果 if result_zip: # 失敗的任務結果也需要清理 self.task_manager.file_storage.mark_for_cleanup(task_id) self.task_manager.file_stor...
Python
1