text
string
label_name
string
labels
int64
elf) -> Result<bool> { Ok(self.db.is_some()) } /// Connect to the backend fn connect(&mut self) -> Result<()> { if !self.has_seed()? { return Err(ErrorKind::WalletNoSeed.into()); } if self.connected()? { return Err(ErrorKind::WalletConnected.into()); } let root_path = Path::new(&self.config.data_...
Rust
0
import click import lxml.etree as ET import logging import re from . import run_command try: # Python 3 from urllib.parse import urlparse, parse_qs except ImportError: # Python 2 from urlparse import urlparse, parse_qs from . import roles_assertion_extractor from .helpers import trace_http_request ...
Python
1
#name = "Bro" #age = 21 #attractive = True name, age, attractive = "Bro", 21, True '''print(name) print(age) print(attractive) ''' #Spongbob = 30 #Patrick = 30 #Sandy = 30 #Squidward = 30 Spongbob = Patrick = Sandy = Squidward = 30 print(Spongbob) print(Patrick) print(Sandy) print(Squidward)
Python
1
", "BOCT", "CMSC", "DSXN.CL", "FTDR", "GTX", "PLAG", "POCT", "RCA", "RCP", "SPAQ.WS", "UOCT", "LSAF", "RAMP", "SPAQ", "CNPpB", "UPWK", "GH", "KOD", "KPFS", "PNRL", "WBND", "ARYAU", "CCH.U", "CTACU", "EDTXU", "ESTC", "FPXE", "OCCI", "BCpA", "BSAE", "IHYD", ...
Rust
0
nalyze_feature_related_errors(correlations) if feature_related_errors: patterns["feature_related_errors"] = feature_related_errors return patterns def _generate_recommendations( self, patterns: Dict[str, Any], error_stats: Dict[str, Any] ) -> List[Dict[...
Python
1
size() == &0 { return Err("can't read response when buff_size is 0") } let packet = MspPacket { cmd: MspCommandCode::MSP_SERVO_MIX_RULES as u16, direction: MspPacketDirection::ToFlightController, data: vec![], }; let payload = select! { ...
Rust
0
if len(t) != len(self.t): # Adaptive solver, need new t and u arrays self.t = t self._allocate_u(t) with self.solver.open_store() as events: if self.neq == 1: self.u[:] = events[0] else: for i in range(self.neq): ...
Python
1
#! /usr/bin/env python import openturns as ot import openturns.testing as ott from openturns.usecases import ishigami_function ot.TESTPREAMBLE() ot.RandomGenerator.SetSeed(0) # Ishigami use-case ishigami = ishigami_function.IshigamiModel() distX = ishigami.inputDistribution # Get a sample of it size = 100 X = distX...
Python
1
(rename = "Amount")] amount: i64, } #[derive(Serialize, Deserialize, )] struct IcoInfo { supercontract_id: Cid, mosaic_id: u64, } pub fn create_ico() -> i64 { let res = create_mosaic(); if res.is_err() { return FUNCTION_ERROR; } let mosaic_id = res.unwrap(); let res = mosaic_supply_change(&MosaicSupplyCha...
Rust
0
Msg, SplitCheckRunner, SplitCheckTask}; use storage::mvcc::{Write, WriteType}; use storage::{Key, ALL_CFS, CF_DEFAULT, CF_WRITE}; use util::properties::RangePropertiesCollectorFactory; use util::rocksdb::{new_engine_opt, CFOptions}; use util::transport::RetryableSendCh; use util::worker::Runnab...
Rust
0
#----------------------------------------------------------------------------- # Copyright (c) 2015-2020, PyInstaller Development Team. # # This file is distributed under the terms of the Apache License 2.0 # # The full license is available in LICENSE, distributed with # this software. # # SPDX-License-Identifier: Apac...
Python
1
from selenium.webdriver.common.by import By from selenium.webdriver.remote.webdriver import WebDriver from selenium.webdriver.support.select import Select as WebSelect from crawlipt.annotation import check, alias class Select: @staticmethod @check(exclude="driver") @alias("select.text") def selectByTe...
Python
1
n<filename>src/main.rs use urlshortener::{client::UrlShortener, providers::Provider}; use clipboard::{ClipboardProvider, ClipboardContext}; use std::error::Error; use std::thread::sleep; use std::time::Duration; use url::Url; use urlshortener::providers::ProviderError; fn main() { let bitly_token = String::from("4107...
Rust
0
new_builder() .tx_hash( Byte32::from_slice(&hex::decode(outpoint_conf.tx_hash).map_err(|e| anyhow!(e))?) .map_err(|e| anyhow!(e))?, ) .index(outpoint_conf.index.pack()) .build(); Ok(outpoint) } pub fn parse_cell(cell: &str) -> Result<Script> { let cel...
Rust
0
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
Python
1
Command::None, positive: Command::None, sensibility: DEFAULT_SENSIBILITY } } } fn serialize_buttons<S: Serializer>( buttons: &HashMap<u8, Command>, serializer: S, ) -> Result<S::Ok, S::Error> { let mut map = serializer.serialize_map(None)?; for (k, v) in buttons.iter() { if v != &Command::None { map.seriali...
Rust
0
import os import sys from config.env_config import setup_env def main(): run_env_setup() print( f"ETL pipeline run successfully in " f'{os.getenv("ENV", "error")} environment!' ) def run_env_setup(): print("Setting up environment...") setup_env(sys.argv) print("Environment s...
Python
1
Deploy> { let path = format!( "/organizations/{}/releases/{}/deploys/", PathArg(org), PathArg(version) ); self.post(&path, deploy)? .convert_rnf(ApiErrorKind::ReleaseNotFound) } /// Lists all deploys for a release pub fn list_deploys(...
Rust
0
t)] mod tests { use super::*; #[test] fn test_predict_the_winner() { assert!(!Solution::predict_the_winner(vec![1, 5, 2])); assert!(Solution::predict_the_winner(vec![1, 5, 233, 7])); } } <reponame>r4gus/sugar-ray /// Represents a specific intersection between a ray and an object. #[deri...
Rust
0
----- # wxWindowDestroyEvent c = module.find('wxWindowDestroyEvent') c.addProperty('Window GetWindow') #--------------------------------------- # wxContextMenuEvent c = module.find('wxContextMenuEvent') c.addProperty('Position GetPosition SetPosition') #-------------------------------...
Python
1
//! FDT's are a compact binary format; node names, and other information all in a single //! datastructure. Utilites which parse this device tree on the fly will run slower than those //! which operate on an optimized index. Some operations such as finding a node's parent may //! require `O(n^2)` time. To avoid this is...
Rust
0
hread number {}",i); }) ); } for j in c { j.join(); } } pub fn handle_join(){ let mut v = vec![2,4,6,8]; //move closure is often used when threads are involved. let handle = thread::spawn(move || { println!("Vector {:?}",v); })...
Rust
0
#!/usr/bin/env python3 """ Test script for the new read-tags endpoint """ import requests import json def test_read_tags_endpoint(): """Test the new read-tags endpoint""" # API base URL base_url = "http://localhost:8000" # Test data test_request = { "ip": "192.168.1.10", ...
Python
1
eption("RESEND_M1 failed") time.sleep(0.1) if "OK" not in hapd.request("RESEND_M3 " + addr + " plaintext"): raise Exception("RESEND_M3 failed") time.sleep(0.1) def test_ap_wpa2_plaintext_m3(dev, apdev): """Plaintext M3 during PTK rekey""" params = hostapd.wpa2_params(ssid="test-wpa2-psk", p...
Python
1
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
Python
1
def f(x, y, s): if x + y >= 30: return s % 2 == 0 if s == 0: return False h = [ f(x + 1, y, s - 1), f(x * 2, y, s - 1), f(x, y + 1, s - 1), f(x, y * 2, s - 1) ] return any(h) if (s - 1) % 2 == 0 else all(h) # u19 = [] # for s in range(1, 30): # for k in range(1, ...
Python
1
.subcommand(SubCommand::with_name("authenticate") .about("generate a TOTP from a previously registered secret") .arg(Arg::with_name("TIMESTAMP") .short("t") .long("timestamp") .help("timestamp to use to generate the OTP, as seconds since...
Rust
0
: payload_data, "captcha_token": captcha_token, "rtc_token": rtc_token }) headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36", "Accept": "text/html,application/xhtml+xm...
Python
1
> { let store = KEY_STORE.lock().unwrap(); store.keys.get(handle).map(|key_ref|(*key_ref).clone()) } pub fn remove(handle: &KeyPairHandle) { let mut store = KEY_STORE.lock().unwrap(); store.keys.remove(handle); } pub fn clear() { let mut store = KEY_STORE.lock()...
Rust
0
(1, 1024, 14, 14, 1024, 1024, 3, 3, 1, 2, 1, 1, 1), # conv22 13 (1, 1024, 7, 7, 1024, 1024, 3, 3, 1, 1, 1, 1, 1), # conv23 14 # (1, 1024, 7, 7, 1024, 1024, 3, 3, 1, 1, 1, 1, 1), # conv24 ] res18_shapes_b1 = [ # resnet-18 (1, 3, 224, 224, 64, 3, 7, 7, 1, 2, 3, 1, 1), # conv1 0 (1, 6...
Python
1
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 沉默の金 <cmzj@cmzj.org> # SPDX-License-Identifier: MIT import json import os import shutil from datetime import datetime, timedelta, timezone from actions_toolkit.github import Context from .utils.logger import logger from .utils.network import request_get from .utils.op...
Python
1
nyhow::bail; use cm::{ dcb::{dcrsr, demcr, dhcsr, DCRDR, DCRSR, DEMCR, DHCSR}, scb::{aircr, AIRCR}, }; use log::info; use crate::{adiv5, util}; /// Cortex-M register that the DAP can read #[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)] #[repr(u8)] pub enum Register { /// R0 R0 = 0b00000,...
Rust
0
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2020 Tomas Mudrunka <harvie@github> ## ## 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 2 of the Lice...
Python
1
from plugin import plugin, require from colorama import Fore import akinator import subprocess import sys """ Simple akinator text based game: think up a character, answer questions and akinator will find it ! https://pypi.org/project/akinator.py/ """ @require(network=True) @plugin("akinator") def akinator_main(jar...
Python
1
span_contents.column(), span_contents.line_count(), ))); } } } Err(miette::MietteError::OutOfBounds) } } #[cfg(test)] mod engine_state_tests { use super::*; #[test] fn add_file_gives_id() {...
Rust
0
CPU name. name = { let mut to_return = None; let mut skip = false; for line in cpu_info_lines.iter() { if !skip { if line.starts_with("model name") || line.starts_with("Hardware") || line.starts_with("Processor") || line.starts_with("cpu model") ...
Rust
0
_byte = self.get_reg_u8(reg, RegHalf::High); let new_value = (low_byte + (high_byte * base)) as u16; self.set_reg_u16(reg, new_value); } Inst::AsciiAdjustAfter(reg, mode) => { if self.get_reg_u8(reg, RegHalf::Low) & 0x0f > 9 || self.get_flag(Flag::Adjust) { match mode { AdjustMode::Addition...
Rust
0
test_vceq_p8() { let a: i8x8 = i8x8::new(-128, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07); let b: i8x8 = i8x8::new(-128, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07); let e: u8x8 = u8x8::new(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF); let r: u8x8 = transmute(vceq_p8(transmute(a), trans...
Rust
0
ctx.document .translate_no_template(&body, "Conditinal extension"), ); } } None } } fn supports_block(&self) -> bool { true } fn supports_inline(&self) -> bool { true } fn inter...
Rust
0
# From https://github.com/taki0112/ResNet-Tensorflow. import time from ResNets.ops import * import glob import numpy as np import pandas as pd from PIL import Image import random import time def network(x, res_n=18, is_training=True, reuse=False): with tf.variable_scope("network", reuse=reuse): if res_...
Python
1
own: return self.unknown_idx elif not strict: return None else: raise Exception(f'Chararcter: {char} not in dict,' ' please check gt_label and use' ' custom dict file,' ...
Python
1
'bid': bid, 'ask': ask, 'bid_volume': bid_volume, 'ask_volume': ask_volume, 'timestamp': datetime.now().strftime('%Y-%m-%d %H:%M:%S') } return result except Exception as e: st.error(f"خطا در دریافت اطلاعات خلاصه بازار: {str(e)}") ...
Python
1
"""empty message Revision ID: a58bbf4ab70e Revises: Create Date: 2024-02-28 18:28:50.096398 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = 'a58bbf4ab70e' down_revision: Union[str, None] = None branch_labels: Union[str,...
Python
1
s.CharBlock(label="Phone", max_length=30, required=False)), ( "new_window", wagtail.blocks.BooleanBlock(label="Open in new window", required=False), ), ] ...
Python
1
ta._experiment_tracker.experiment ) display_name = self._make_display_name("custom-job") custom_job = aiplatform.CustomJob.from_local_script( display_name=display_name, script_path=_LOCAL_TRAINING_SCRIPT_PATH, container_uri=_PREBUILT_CONTAINER_IMAGE, ...
Python
1
n name = 'core'\n", encoding="utf-8") def patch_project_urls(project_path: Path, project_name: str): """Adds `include('core.urls')` to the main urls.py.""" urls_path = project_path / project_name / "urls.py" if not urls_path.exists(): return False txt = urls_path.read_text(encoding="utf-8") if ...
Python
1
), _ => unreachable!(), }; let native_dt = NaiveDate::from_ymd_opt(y as i32, m as u32, d as u32) .ok_or_else(|| RubyError::argument("Out of range."))? .and_hms_micro_opt(h as u32, min as u32, sec as u32, usec as u32) .ok_or_else(|| RubyError::argument("Out of range."))?; ...
Rust
0
sine_sample } else { 0.0 }; // We'll do an equal power fade let original_t_squared = if self.morse_fadeout_samples_current < self.morse_fadeout_samples_start { 0.0 ...
Rust
0
#: **contourType** = BANDED or ISOSURFACE. The default value is "Grey60". contourEdgeColor: str = "" #: A String specifying the color to be used to plot the tick mark curve. The default value #: is "Cyan". tickmarkCurveColor: str = "" #: A tuple of tuples of SymbolicConstants specifying the line s...
Python
1
import requests # Enter your own api key Key = "43cbb6412b75cc8573b77b03ebb6f4b5" def Response(city): url = f"https://api.weatherstack.com/current?access_key={Key}" a = {"query":city} response = requests.get(url,params=a) return response try: city = input("Enter the city : ").title() response ...
Python
1
import os import xml.etree.ElementTree as ET from pathlib import Path from datetime import datetime def processar_var(): data = datetime.now() dia = data.strftime('%d') print(f'Rodando VAR para o dia: {dia}') pasta_ancora = Path(__file__).parent pasta_xml = pasta_ancora / dia namespace = {'nfe...
Python
1
let res1prev1 = _mm256_alignr_epi8(res1, *prev1, 15); let res = _mm256_and_si256(_mm256_and_si256(res0prev0, res1prev1), res2); *prev0 = res0; *prev1 = res1; res } } /// A 128-bit mask for the low and high nybbles in a set of patterns. Each /// lane `j` correspo...
Rust
0
ter() .try_fold((0, None), |(i, mut prev), attr| { if attr.path.is_ident(ident) { if prev.replace(i).is_some() { return Err(error!(attr, "duplicate #[{}] attribute", ident)); } parse_as_empty(&attr.tokens)?; ...
Rust
0
onNull<u8>> { self.lock().allocate(layout) } unsafe fn deallocate(&self, ptr: *mut u8, layout: Layout) { self.lock().deallocate(ptr, layout) } unsafe fn reallocate( &self, ptr: *mut u8, old_size: usize, layout: Layout, ) -> Option<NonNull<u8>> { self.lock().rea...
Rust
0
st => Direction::East, Direction::East => Direction::West, } } } #[derive(Debug, PartialEq)] enum DroidResult { Blocked, Progress, Final, } impl DroidResult { pub fn from_value(value: i64) -> DroidResult { match value { 0 => DroidResult::Blocked, ...
Rust
0
80663314],[-117.89154052734375,34.522398580663314],[-117.89154052734375,34.649025753526985],[-118.27880859375001,34.649025753526985],[-118.27880859375001,34.522398580663314]]]} "#; Assert::main_binary() .with_args(&["filter", "intersects", "9q5"]) .stdin(input) .stdout() .is(output)...
Rust
0
match self.build_extract_value_from_struct(&if_result, StructIndex::Type) { Some(type_num) => { if !type_num.is_int_value() { return Err("Struct Type element is not int value") } if_result_type = type_num.into_int_value(); ...
Rust
0
g<reg_key_slot_7_w1::REG_KEY_SLOT_7_W1_SPEC>, #[doc = "0x98 - reg_key_slot_7_w2."] pub reg_key_slot_7_w2: crate::Reg<reg_key_slot_7_w2::REG_KEY_SLOT_7_W2_SPEC>, #[doc = "0x9c - reg_key_slot_7_w3."] pub reg_key_slot_7_w3: crate::Reg<reg_key_slot_7_w3::REG_KEY_SLOT_7_W3_SPEC>, #[doc = "0xa0 - reg_key_...
Rust
0
-> SPXHR; } extern "C" { pub fn connection_from_conversation_translator( convTransHandle: SPXCONVERSATIONTRANSLATORHANDLE, connectionHandle: *mut SPXCONNECTIONHANDLE, ) -> SPXHR; } extern "C" { pub fn connection_from_dialog_service_connector( convTransHandle: SPXRECOHANDLE, c...
Rust
0
om papers cluster_ids = np.unique([p.cluster_id for p in papers if p.cluster_id is not None]) # Filter clusters if specified if included_clusters is not None: cluster_ids = [c for c in cluster_ids if c in included_clusters] print(f"\nMatching {len(cluster_ids)} clusters to {len(pubs)} ...
Python
1
#!/bin/python3 """ ________ ______ ______ __ | \ / \ / \ | \ \$$$$$$$$______ ______ ______ ______ | $$$$$$\ ______ ______ | $$$$$$\ _| $$_ | $$ / \ /...
Python
1
n} # The PUT answer does not let us know if the resource has actually been # modified if resp.status < 300: async with session.get( _url, json=payload, **session_timeout(params) ) as resp_get: after = await resp_get.json() ...
Python
1
as_mut().unwrap() { ConnStream::Plain(ref mut stream) => { stream .as_mut() .write_packet(data, seq_id, max_allowed_packet)? } ConnStream::Compressed(ref mut compressed) => { compressed.write_compressed_packet(da...
Rust
0
moment_estimator = ShrinkageMomentEstimator(rho_fn=lambda _: rho) prng_key = random.PRNGKey(np.random.randint(1000)) init_state = random.normal(prng_key, (global_objective.dim,)) for obj in client_objectives: prng_key, subkey = random.split(prng_key) post_avg_delta = com...
Python
1
def main(): affirmation = "I am capable of doing anything I put my mind to." print(f"Please type the following affirmation: {affirmation}") while True: user_input = input("\033[34m") # This makes user input appear in blue print("\033[0m", end="") # Resets color back to normal if ...
Python
1
raw()); defmt::info!("INIT :: PCLK1 : {}", clocks.pclk1().raw()); defmt::info!("INIT :: PCLK2 : {}", clocks.pclk2().raw()); defmt::info!("INIT :: USB (pll48clk): {}", clocks.pll48clk().map(|h| h.raw())); defmt::info!("INIT :: I2S : {}", clocks.i2s_apb1_c...
Rust
0
uint, pub ifs_ifsu: if_settings__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union if_settings__bindgen_ty_1 { pub raw_hdlc: *mut raw_hdlc_proto, pub cisco: *mut cisco_proto, pub fr: *mut fr_proto, pub fr_pvc: *mut fr_proto_pvc, pub fr_pvc_info: *mut fr_proto_pvc_info, pub sync: *m...
Rust
0
ss = bincode::deserialize_from(&mut buf) .map_err(|err| InvalidIngressPayload::DeserializationError(id.into(), err))?; if id != &IngressMessageId::from(&ingress) { return Err(InvalidIngressPayload::MismatchedMessageId( id.into(), ingres...
Rust
0
weightedmean_int() { let hist = simple_filled_int_weightedmean_hist_with_unit_weights(); assert_float_eq(hist.value(&0.0).unwrap().get(), 2.0) } #[test] fn test_weightedmean_int_value_stddev_samples() { let hist = simple_filled_int_weightedmean_hist_with_unit_weights(); let binvalue = hist.value(&0.0).u...
Rust
0
X_SIZE_TO_BLOCK_SIZE[self as usize] } pub fn sqr(self) -> TxSize { #[cfg_attr(rustfmt, rustfmt_skip)] const TX_SIZE_SQR: [TxSize; TxSize::TX_SIZES_ALL] = [ TX_4X4, TX_8X8, TX_16X16, TX_32X32, TX_64X64, TX_4X4, TX_4X4, ...
Rust
0
) except json.JSONDecodeError as e: output.update({"error": e}) error_logs = [] for err_log in std_err: if err_log.startswith("__EXCEPTION__"): err_log = err_log.removeprefix("__EXCEPTION__") # NOTE(frank): I'm just copy/pasting fr...
Python
1
n; } let mut iter = windows.iter_mut(); //maximize primary window { if let Some(monowin) = iter.next() { monowin.set_height(workspace.height()); monowin.set_width(workspace.width()); monowin.set_x(workspace.x()); monowin.set_y(workspace.y()); ...
Rust
0
de/de/seq.rs use serde::de::{DeserializeSeed, SeqAccess}; use crate::{Element, Value}; use crate::error::TychoError; use crate::serde::de::TychoDeserializer; pub struct SeqArrayDeserializer { array: Vec<Value>, } impl SeqArrayDeserializer { pub fn new(x: Vec<Value>) -> Self { Self { array: x } } ...
Rust
0
[ GuessChar::White, GuessChar::White, GuessChar::Yellow, GuessChar::White, GuessChar::Yellow ], [ GuessChar::White, GuessChar::Yellow, GuessChar::White, GuessChar::Yellow, GuessChar::White ], [ GuessChar::Green, GuessChar:...
Rust
0
# Copyright Materialize, Inc. and contributors. All rights reserved. # # Use of this software is governed by the Business Source License # included in the LICENSE file at the root of this repository. # # As of the Change Date specified in that file, in accordance with # the Business Source License, use of this software...
Python
1
line_no}") def trace_calls(frame, event, arg): if event != "call": return co = frame.f_code func_name = co.co_name if func_name in ("write", "__getattribute__"): return func_line_no = frame.f_lineno func_filename = co.co_filename caller = frame.f_back if caller is not N...
Python
1
::PathBuf; let path = PathBuf::from("./keys_real.json"); let creds = PoloniexCreds::new_from_file("account_poloniex", path).unwrap(); let mut api = PoloniexApi::new(creds).unwrap(); let result = api.return_balances(); assert!(result.unwrap().contains_key("BTC")); } } <gh_sta...
Rust
0
niformBlock for UnlitUniformData { const SET: u32 = 1; const BINDING: u32 = 0; } #[derive(Copy, Clone, Debug)] #[repr(C, packed)] pub struct PackedLight { pub pos: [f32; 4], // position for point/spot light pub dir_cutoff: [f32; 4], // direction for spot/directional light. .w is the cos(cutoff_...
Rust
0
_is_global() { let client = "192.168.0.1"; let server = "8.8.8.8"; assert!(!should_client_be_propagated(client, server)); } #[test] fn should_return_true_when_client_is_global_and_server_is_localhost() { let client = "8.8.8.8"; let server = "127.0.0.1"; asser...
Rust
0
_k, cached_v = info['caches'] cached_k = [ reorder_(L.concat([pk, k[:, :1, :]], 1), output.beam_parent_ids) for pk, k in zip(past_cached_k, cached_k) ] # concat cached cached_v = [ reorder_(L.concat([pv, v[:, :1, :]], 1), output.beam_parent_ids) for pv, v in zip(past_cac...
Python
1
datetime(&local_datetime) .single() .unwrap_or_else(|| unreachable!("Should never fail")); Ok(Self::new(datetime, is_second_omitted, secfrac)) } } impl From<As2DateTime> for DateTime<As2TimeNumOffset> { fn from(o: As2DateTime) -> Self { use chrono::TimeZone; o.o...
Rust
0
.max_by_key(|&(_, a)| Param(*a)) .expect("empty"); let u = uts[k]; let nu = crv.locate_nu(u); let cpts = crv.control_points(); let t = ts; let mut newcpts = cpts.clone(); let mut l = cpts[nu - 1].to_vector() * (t[nu + 1] - t[nu - 3]) - cp...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @project: PROJECT_NAME @file: setup.py @created: DDD, DD Mon YYYY @author: AUTHOR_NAME @site: SITE_URL @license: MIT - Please refer to <https://opensource.org/licenses/MIT> Copyright (c) 2024, COPYRIGHT Reference: https://setuptools.py...
Python
1
}) .bind("0.0.0.0:8080") .unwrap() .start(); } }; println!("Started http server: 0.0.0.0:8080"); let _ = sys.run(); } fn jsonapi_index(_req: &HttpRequest<AppState>) -> HttpResponse { HttpResponse::Found() .header("LOCATION", format!(...
Rust
0
.unknown_fields.clear(); } } impl ::std::fmt::Debug for QueryAllRelationsResponse { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } impl ::protobuf::reflect::ProtobufValue for QueryAllRelationsResponse { fn as_ref(&self) -> ::p...
Rust
0
timestamp = datetime.now().strftime('%Y-%m-%d %H:%M:%S') results.append({ "Epoch": epoch_count, "Timestamp": timestamp, "MVL Absolute Value": mvl_abs, }) update_ti...
Python
1
self.bits(variant._bits()) } } #[doc = "Input 0. Selects pin interrupt input 0 as the source to bit slice 5."] #[inline] pub fn input_0_selects_pin(self) -> &'a mut W { self.variant(SRC5W::INPUT_0_SELECTS_PIN) } #[doc = "Input 1. Selects pin interrupt input 1 as the sourc...
Rust
0
m. Chính sách thực dân của Pháp trong Đông Dương chủ yếu nhằm bù đắp thiệt hại do khủng hoảng này gây ra.<SEP>Đời sống nhân dân vào những năm 30 gặp nhiều khó khăn do sự áp bức và khai thác của thực dân Pháp. Nhiều người lao động, đặc biệt là công nhân và nông dân, chịu cảnh thất nghiệp và bóc lột, từ đó dẫn đến sự phẫ...
Python
1
field.decode_field(TrivialDecoder)?; } } } let mysql_any = pos.is_some() || row.is_some() || has_file; let pg_any = lsn.is_some(); let mssql_any = change_lsn.is_some() || event_serial_no.is_some(); if (mysql_any as usize) + (pg_any...
Rust
0
}; use libfuzzer_sys::fuzz_target; fuzz_target!(|input: ([FreeCoordinate; 3], [FreeCoordinate; 3], Space)| { let (position, velocity, space) = input; let interesting_bounds_aab = Aab::from(space.grid()).expand(10.0); // TODO: write a proper Arbitrary impl on a wrapper let position: Point3<FreeCoordi...
Rust
0
import os, sys import numpy as np import paddle # paddle.enable_static() import paddle.fluid as fluid from paddle import ParamAttr import paddle.nn as nn import paddle.nn.functional as F import torch SEED = 666 # INPUT_SIZE = 89 KERNEL_SIZE = 1 STRIDES = (1,1) PADDING = 0 def paddle_fc(): np.random.seed(SEED) ...
Python
1
Karfreitag, Ostermontag, ErsterMai, ChristiHimmelfahrt, Pfingstmontag, TagDerDeutschenEinheit, ErsterWeihnachtsfeiertag, ZweiterWeihnachtsfeiertag, ]; #[cfg(test)] mod tests { use crate::regions::GermanHoliday::*; use crate::regions::GermanRegion; use crate::regions::GermanRegio...
Rust
0
= crate::initializer::Module<Test>; /// Mocked configuration. pub type Configuration = crate::configuration::Module<Test>; /// Mocked paras. pub type Paras = crate::paras::Module<Test>; /// Mocked router. // TODO: Will be used in the follow ups. #[allow(dead_code)] pub type Router = crate::router::Module<Test>; //...
Rust
0
of deleting a user more /// thought. This includes thinking about being able to mark themselves as compromised and indicate to /// collaborators that certain files are potentially compromised. This could also involve us reaching out /// to services like Stripe / Apple / Google and terminating open subscript...
Rust
0
Ok( fs.clone() ) } else { bail!("No manifest loaded!"); } } pub fn get_version( &self ) -> anyhow::Result<Version> { let fs = self.get_formatted_version()?; // dbg!(&fs); let v = fs.value(); let version = Version::parse(&v).unwrap(); // dbg!(&version); return Ok( version ); } pub fn get_pretty_v...
Rust
0
r() .map(|i| 1-i%2) .collect(); let mut ret = n*n*4; piece.push(read_board(n)); read_line(); piece.push(read_board(n)); read_line(); piece.push(read_board(n)); read_line(); piece.push(read_board(n)); for i in 0..16{ let flags = (0..4) .into_iter(...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- import ctypes import io import json from random import random, seed import shutil from vtkmodules.vtkCommonArchive import vtkBufferedArchiver from vtkmodules.vtkFiltersSources import vtkConeSource from vtkmodules.vtkIOExport import vtkJSONRenderWindowExporter from vtkmod...
Python
1
{ 'name': '2FA by mail', 'description': """ 2FA by mail =============== Two-Factor authentication by sending a code to the user email inbox when the 2FA using an authenticator app is not configured. To enforce users to use a two-factor authentication by default, and encourage users to configure their 2FA using ...
Python
1
"Checks if the value of the field is `DIGEXTCLK`"] #[inline] pub fn is_digextclk(&self) -> bool { *self == LFXOMODER::DIGEXTCLK } } #[doc = r" Value of the field"] pub struct LFXOBOOSTR { bits: bool, } impl LFXOBOOSTR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit...
Rust
0
medias = [] classifica = [] times = [ (['Jeff'],[10, 12]), (['Rodr'], [9, 9]), (['Ferr'], [11, 8]), (['Leoo'], [13, 10]) ] for i, j in times: media = sum(j) / len(j) medias.append((j, media)) medias = sorted(medias) for n in midias: if n in medias: continue classifica.append(n) print(times[0][...
Python
1