text
string
label_name
string
labels
int64
""" Template/Options file for altering the structure of the .csv flatfile output. """ import collections headermeasurements = [ ('observation', "OBS"), ('data_marking', "DATAMARKER"), ('statistical_unit_eng', "STATUNIT"), 'statistical_unit_cym', ('measure_type_eng', ...
Python
1
o_base(who, supply.0, supply.1, target.1)?; } else if supply.0 == base_currency_id { Self::swap_base_to_other(who, target.0, supply.1, target.1)?; } else { Self::swap_other_to_other(who, supply.0, supply.1, target.0, target.1)?; } } fn add_liquidity(origin, other_currency_id: CurrencyIdOf<T>, max_...
Rust
0
, }, clip_rect, ); } Layout::UsageGraph(used, reclaimable, free) => { // Calculate pixel sizes of the parts of the graph let total = used + reclaimable + free; let used_pixels = ((*used as u64 * (rect.w - 2) as u64) / total as u64) as i32; let reclaimable_pixels = ((*reclaimable...
Rust
0
e been better to always add an implicit # slash (even when using a prefix), but we can't do that now because it # would make file systems created without trailing slash inaccessible. if re.match(r'^(s3|gs)://[^/]+$', s) or re.match( r'^(s3c|s3c4|swift(ks)?|rackspace)://[^/]+/[^/]+$', s ): ...
Python
1
from agent import agent_executor import sys # Get the argument from the user test_type = sys.argv[1] # Testing update_cell_from_idx, get_cell_from_idx, and get_cell_from_id if test_type == "cell": agent_executor.invoke( { "input": "In the Smartsheet called 'Sample Sheet', update the cell in th...
Python
1
on.get_read_names.<locals>.<genexpr>rrr)rs rrOperation.get_read_namesrrc6UR5R$)Nrn)rs rrOperation.get_readsrqrc[e)Nr)rs r get_outputsO...
Python
1
<u8>, pub gw4: Vec<u8>, pub gw6: Vec<u8>, pub domain: Vec<u8>, } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, Default, Debug)] pub struct Gateway<AccountId> { pub version: u32, pub id: u32, pub farm_id: u32, pub location: Location, pub country_id: u32, pub city_id...
Rust
0
(res: Result<(Vec<u8>, Inf), E>) -> Self { Self{ request: Request::GetReceived, response: res.map_or_else(Response::Err, |(d, i)| Response::Received(d, i)), } } /// Fetch radio IRQs pub fn get_irq(clear: bool, res: Result<Irq, E>) -> Self { Self { ...
Rust
0
(freq).apply(rule).reset_index(level=0) data.__setattr__('frequency', freq) return data # etf 데이터 불러오기 def load_etf_data(self, ticker_list: List, freq: str, delay: float = 1): ticker_data_list = [] for ticker in ticker_list: ticker_data = stock.get_etf_ohlcv_by_date(...
Python
1
const mjtNum); } extern "C" { pub fn mju_sub3(res: *mut mjtNum, vec1: *const mjtNum, vec2: *const mjtNum); } extern "C" { pub fn mju_addTo3(res: *mut mjtNum, vec: *const mjtNum); } extern "C" { pub fn mju_subFrom3(res: *mut mjtNum, vec: *const mjtNum); } extern "C" { pub fn mju_addToScl3(res: *mut mjtNu...
Rust
0
from aiogram import Router from aiogram.types import Message from tg_bot.filters.filters import IsPrivatChat from config_data.config import ConfigTgBot, load_config_tg_bot config: ConfigTgBot = load_config_tg_bot() chat_id: int = config.config_tg_bot.chat_ids[0] router = Router() # Этот хэндлер будет реагировать на ...
Python
1
from enum import IntFlag, auto from Physics import Power, Energy class Battery: class Status(IntFlag): EMPTY = auto() CHARGING = auto() FULL = auto() capacity = Energy(0) efficiency = 0.85 def __init__(self, capacity: Energy): self.battery_level = Energy(0) s...
Python
1
import base64 import binascii from pathlib import Path from pytest_html.basereport import BaseReport # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. class Report(Bas...
Python
1
pend on the hex [Orientation] (see the //! example diagrams, below). //! //! It is typically more convenient to use alpha-numeric coordinates, which //! identify each map hex with a string of the form `[A-Z]+[0-9]+`. //! The [Coordinates] type defines how the relationship between these strings //! and the map hexes. //...
Rust
0
UiFlow2 Code Block: |reset.png| MicroPython Code Block: .. code-block:: python base_stepmotor.reset() """ if self.rst_pin: self.rst_pin.value(0) time.sleep_ms(10) self.rst_pin.value(1) def get_voltage(self) ...
Python
1
e.requires_grad) # print('y_predicted', y_predicted.shape, y_predicted.device, y_predicted.requires_grad) res = loss.masked_mse_torch(y_predicted, y_true) return res def predict(self, batch): # 多步预测 x = batch['X'] # (batch_size, input_window, len_row, len_column, feature_di...
Python
1
from rest_framework import serializers from .models import material class MaterialSerializer(serializers.ModelSerializer): class Meta: model = material fields = ('material_id', 'material_name', 'material_unit', 'material_weight',)
Python
1
PRG_ROM_BYTES => (&mut prg_rom).copy_from_slice(prg_rom_raw), HALF_PRG_ROM_BYTES => { // copy the prg data into each half of prg_rom (&mut prg_rom[0..HALF_PRG_ROM_BYTES]).copy_from_slice(prg_rom_raw); (&mut prg_rom[HALF_PRG_ROM_BYTES..]).copy_from_...
Rust
0
DMA0TSEL_A::DMA0TRIG28, 29 => DMA0TSEL_A::DMA0TRIG29, 30 => DMA0TSEL_A::DMA0TRIG30, 31 => DMA0TSEL_A::DMA0TRIG31, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `DMA0TRIG0`"] #[inline(always)] pub fn is_dma0trig0(&self) -> b...
Rust
0
# %% Robot class Robot: manufacture = 'BnL' def move(self, x, y): print(f'{self} moving to {x}/{y}') walle = Robot() walle.move(100, 200) # %% What "class" keyword does from textwrap import dedent class_body = ''' manufacture = 'BnL' def move(self, x, y): print(f'{self} moving to ...
Python
1
# Import necessary libraries import time from dataclasses import dataclass # Define a Job class @dataclass class Job: name: str arrival_time: int burst_time: int priority: int turnaround_time: int = 0 # A tick for sleep function TICK = 0.1 # Define the time slices (and number of queues) time_slic...
Python
1
rc>STS3$)N{tensor_split expected tensor_indices_or_sections to be a zero-dimensional or one-dimensional tensor, but got a tensor with  dimsr0) split_dimsr;rAtensor_split_tensor_indices_or_sections_py_impl.<locals>.<lambda><<E;eMr: r typer$...
Python
1
import json import sys import singer from mage_integrations.sources.github.tap_github.client import GithubClient from mage_integrations.sources.github.tap_github.discover import discover as _discover from mage_integrations.sources.github.tap_github.sync import sync as _sync LOGGER = singer.get_logger() REQUIRED_CON...
Python
1
# Paths data_path = "./data" scene_graphs_path = f"{data_path}/scene_graphs" model_checkpoints_path = f"{data_path}/model_checkpoints" cell_graphs_file_name = "osm_cell_graphs_2052.pkl" train_text_graphs_file_name = "osm_train_text_graphs_6578.pkl" val_text_graphs_file_name = "osm_val_text_graphs_1519.pkl" test_text_g...
Python
1
import os SECRET_KEY = os.getenv("SECRET_KEY")
Python
1
tialEq, BoundPattern)] pub enum Pattern { /// Patterns annotated with types Ann(RcPattern, Embed<RcTerm>), /// Patterns that bind variables Binder(ByteSpan, Binder<String>), /// Patterns to be compared structurally with a variable in scope Var(ByteSpan, Embed<Var<String>>, LevelShift), /// L...
Rust
0
man: {question} AI: """ # Prepare the context from the retrieved documents context = "\n".join([doc.page_content for doc in docs]) # Create the prompt prompt = prompt_template.format(context=context, question=query) # Load the QA chain ...
Python
1
; /// A release's track. #[repr(u8)] #[derive(PartialEq, Eq, Clone, Copy, Debug)] pub enum ReleaseTrack { /// Stable track. Stable = 1, /// Nightly track. Nightly = 2, /// No known track, also "current executable's track" when it's not yet known. Unknown = 0, } impl fmt::Display for ReleaseTrack { fn fmt(&self...
Rust
0
nts3D, inlier_mask, camera) pycolmap_camera = pycolmap.Camera(model=camera_dict['model'], width=camera_dict['width'], height=camera_dict['height'], params=camera_dict['params']) cam_from_world = np.eye(4) cam_fro...
Python
1
impl Inspectable for MassProperties { type Attributes = (); fn ui( &mut self, ui: &mut bevy_egui::egui::Ui, _options: Self::Attributes, context: &mut Context, ) -> bool { let mut changed = false; ui.label("Mass"); let mut mass = 1. / self.inv_mass;...
Rust
0
ontext(OLD_CONTEXT, bytes, &mut [], value).unwrap(); assert_eq!(*value, conformance::MyUint16 { value: 0u16 }); } #[test] fn test_uint16_max_decode() { let value = &mut conformance::MyUint16::new_empty(); let bytes = &mut [0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]; Decoder::decode_with_context(OL...
Rust
0
nst SIGNATURE: &str = "Array>>#at:"; expect_args!(SIGNATURE, interpreter, [ Value::Array(values) => values, Value::Integer(index) => index, ]); let index = match usize::try_from(index - 1) { Ok(index) => index, Err(err) => panic!("'{}': {}", SIGNATURE, err), }; let ...
Rust
0
byte2 = input_buffer[(metablock_start.wrapping_sub(2usize) as (usize))]; memcpy(saved_dist_cache.as_mut_ptr(), dist_cache.as_mut_ptr(), (4usize).wrapping_mul(::std::mem::size_of::<i32>())); { let out_size: usize = storage_ix >> 3i32; total_out_size = total_out_size.wrapping_add...
Rust
0
if decoded_line.startswith("data: "): try: json_data = json.loads(decoded_line[6:]) if json_data.get("choices"): delta = json_data["choices"][0]["delta"] ...
Python
1
= BoundaryNorm([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], len(colors)) cmap = ListedColormap(colors) # plt.imsave(os.path.join(dir, 'dynamic_world.png'), img_, cmap=cmap) save_img(os.path.join(dir, 'dynamic_world.png'), img_, cmap=cmap, norm=norm) elif key == 'canopy_height_eth': # write the...
Python
1
.is_none() { // Update the counter only for the first insertion. self.vertices_count += 1; } self.vertices_mapping .right .insert(vertex_index, internal_index); vert...
Rust
0
_ => self.default_file_icon, } } } }; format!("{}{}", icon, self.icon_separator) } fn get_default_icons_by_name() -> HashMap<&'static str, &'static str> { // Note: filenames must be lower-case HashMap::from([ (".trash...
Rust
0
#!/usr/bin/python # Copyright 2025 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
Python
1
# coding: utf-8 from __future__ import unicode_literals import itertools import re from .common import InfoExtractor from ..utils import ( clean_html, determine_ext, ExtractorError, get_element_by_attribute, orderedSet, ) class TVPIE(InfoExtractor): IE_NAME = 'tvp' IE_DESC = 'Telewizja P...
Python
1
import os import random import numpy as np import tweepy import pandas as pd from datetime import datetime, timedelta from dotenv import load_dotenv import time import requests # .envファイルから環境変数を読み込む load_dotenv() # Twitter APIのキーを設定 API_KEY = os.getenv('TWITTER_API_KEY') API_KEY_SECRET = os.getenv('TWITTER_API_KEY_SE...
Python
1
rently_pressed: HashSet::new(), previously_pressed: HashSet::new(), curr_position: Point2::new(0.0, 0.0), delta: Vector2::new(0.0, 0.0), mode: MouseMode::Free, } } } impl MouseState { pub fn update(&mut self, ctx: &mut Context) { self.previously_p...
Rust
0
import zipfile import os import pandas as pd # 1. Path to your ZIP file (Windows full path) zip_path = r"C:\Users\srira\Downloads\archive (1).zip" extract_dir = r"C:\Users\srira\Downloads\extracted_data" # 2. Extract ZIP if not already extracted if not os.path.exists(extract_dir): with zipfile.ZipFile(zip_path, '...
Python
1
ojects SET proj_notes = %s WHERE proj_id = %s AND user_id = %s;""", (response, proj_id, session.get('user_id'), )) # Give the API a break for one second. time.sleep(1) # return "Completed test for project" # Get the updated project notes updated_project = sql("""SELECT * FROM projects...
Python
1
e mean landmark locations S=sorted(glob.glob(globspec)) S=S[::subsample] for ipath in S: print("Processing file: {}".format(ipath)) img=(skimage.transform.resize(skimage.io.imread(ipath)/255.0,tuple(image_dims)+(3,),order=2,mode='nearest')*255).clip(0,255).astype(numpy.ubyte) if not center_crop is Non...
Python
1
tring_or_u64")] #[serde(skip_serializing_if = "u64_is_blank")] #[serde(default = "default_u64_0")] pub ttl: u64, // Structs always required /// Participant data, each participant in the transaction will /// insert their public data here. For now, 0 is sender and 1 /// is receiver, though this will change for mul...
Rust
0
ee_ids.insert(id); } /// # Panics /// When some `id` from the `ids` is greater than the last allocated id. pub fn free_ids(&mut self, ids: impl IntoIterator<Item=Id>) { let ids = ids.into_iter(); let last_id = self.data.len(); self.free_ids.extend(ids.inspect(|&id| { ...
Rust
0
Some((#ident)(&*__rctx__.borrow(), #(#event_arg_idents),*)) } else { None } } } else { quote! { (#ident)(&*__rctx__.borrow(), #(#event_arg_idents),*) } }; quote! { ...
Rust
0
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 writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express o...
Rust
0
MultiRowRecord { data_list: Vec<std::rc::Rc<TestMultiRowRecord>>, data_map: std::collections::HashMap<i32, std::rc::Rc<TestMultiRowRecord>>, } impl TestTbMultiRowRecord{ pub fn new(__js: &json::JsonValue) -> Result<TestTbMultiRowRecord, LoadError> { if !__js.is_array() { return Err(Load...
Rust
0
controller with patch.object(panel, '_load_character_data') as mock_load: CharacterListPanel.refresh(panel) mock_load.assert_called_once() class TestCharacterListPanelUIUpdates: """CharacterListPanelのUI更新テスト""" def test_update_character_list(self, sample_character...
Python
1
ex::new(Self { // // n: 1, // // items, // // slots: Default::default() // // },j),j)) // // } // // #[inline] // // fn empty(j: &Journal<P>) -> PmemObj<Self> { // // Some(Parc::new(Mutex::new(Self { // // n: 0, // // items: Defaul...
Rust
0
phy: op.phy.to_fidl(), cbw: cbw, } } #[cfg(test)] mod tests { use { super::*, crate::{test_utils::*, MlmeStream, Station}, fidl_fuchsia_wlan_mlme as fidl_mlme, wlan_common::{ assert_variant, channel::{Cbw, Phy}, ie::*, ...
Rust
0
""" Base Connector Package ===================== Base classes and utilities for KMRL data source connectors. This package provides: - BaseConnector: Abstract base class for all connectors - Document: Unified document model - Common utilities and patterns Usage: from kmrl_connectors.base import BaseConnector, Doc...
Python
1
from google_auth_oauthlib.flow import InstalledAppFlow import googleapiclient.discovery import json # OAuth 2.0 credentials flow flow = InstalledAppFlow.from_client_secrets_file( 'client_secrets.json', scopes=['https://www.googleapis.com/auth/youtube.readonly'] ) credentials = flow.run_local_server(port=8080) ...
Python
1
"""Tests for Redis connection management.""" import pytest from unittest.mock import MagicMock, patch from redis import Redis from configs.redis.RedisConnection import ( get_redis_connection, check_redis_health, RedisConnectionError, ) @pytest.fixture(autouse=True) def clear_lru_cache(): """Clear LRU...
Python
1
, ref_expander, baseline_fallback, ) # Should achieve invariance or safely fallback assert decision.result in [ GateResult.INVARIANT_ACHIEVED, GateResult.FALLBACK_TO_BASELINE, ] # Should have attempted expansion assert dec...
Python
1
/// convert string-like objects into a Strings object. fn from(value: T) -> Self { Strings::from_values([value.as_ref()]) } } #![feature(crate_visibility_modifier)] use std::cell::RefCell; #[macro_use] extern crate lazy_static; #[macro_use] mod index; lazy_static! { pub static ref DEBUG_ENABL...
Rust
0
7D26: "㈯", 0x7D27: "㈰", 0x7D28: "㈷", 0x7D29: "㍾", 0x7D2A: "㍽", 0x7D2B: "㍼", 0x7D2C: "㍻", 0x7D2D: "№", 0x7D2E: "℡", 0x7D2F: "〶", 0x7D30: "○", 0x7D31: "〔本〕", 0x7D32: "〔三〕", 0x7D33: "〔二〕", 0x7D34: "〔安〕", 0x7D35: "〔点〕", 0x7D36: "〔打〕", 0x7D37: "〔盗〕", 0x...
Python
1
import uvicorn from fastapi.middleware.cors import CORSMiddleware from middleware.exception_handler import EnhancedTracebackMiddleware from init import app from controller.auth import auth_router from controller.movie import movie_router app = app # ミドルウェア登録 app.add_middleware(EnhancedTracebackMiddleware) origins = ...
Python
1
s.path.exists(state_path): os.remove(state_path) self.bruteforce_log.append(f"[+] Removed state file: {state_path}") except Exception as e: self.bruteforce_log.append(f"[-] Could not remove state file: {e}") try: ...
Python
1
_sbp_buffer(buf); self.corner_nw_lat.append_to_sbp_buffer(buf); self.corner_nw_lon.append_to_sbp_buffer(buf); self.spacing_lat.append_to_sbp_buffer(buf); self.spacing_lon.append_to_sbp_buffer(buf); self.rows.append_to_sbp_buffer(buf); self.cols.append_to_sbp_buffer(buf); ...
Rust
0
ention.attention.query.bias"] # [768] k_b = vivit_ckpt_dict[f"encoder.layer.{i}.attention.attention.key.bias"] # [768] v_b = vivit_ckpt_dict[f"encoder.layer.{i}.attention.attention.value.bias"] # [768] # VideoMAE typically uses a bias-less qkv linear plus separate q_bias and v_bias, ...
Python
1
pub fn popcount(&self) -> usize { let x = self.m.as_u64x2(); let low: u64 = x.extract(0); let high: u64 = x.extract(1); (low.count_ones() + high.count_ones()) as usize } pub fn expand(&self, mask: &FieldBit) -> FieldBit { let mut seed = self.m; loop { ...
Rust
0
0x3355136617a1df33, 0x8b0ef74c0aedaff9, 0x62f92468ad2ca12, 0xe1469770738fd584, 0x12c3c3dd84bca26d, ]), }; assert_eq!(a + b, c); } #[test] fn test_subtraction() { let a = Fp2 { c0: Fp::from_raw_unchecked([ 0xc9a2183163e...
Rust
0
ScriptHashType, st: ScriptType) -> packed::CellOutput { let cob = packed::CellOutput::new_builder(); match ct { CT::In | CT::No => cob, CT::Ot => { let new_script = &self.deps.default_script; match (ht, st) { (HT::Data, ST::Loc...
Rust
0
(2.0))))) .lineplot(&Shape::Continuous(Box::new(|x| (x.powf(2.0))))) .display(); // https://github.com/loony-bean/textplots-rs/issues/15 let (mut l1, mut l2, mut l3) = (vec![], vec![], vec![]); for n in -2..=2 { l1.push((n as f32, n as f32)); l2.push((n as f32, n as f32 - 1....
Rust
0
], [ { "tagStatus": "untagged", "countType": "sinceImagePushed", "countUnit": "unknown", "countNumber": 30, }, ( "instance value (unknown) not found in enum " ':(possible val...
Python
1
from pyinfra import config, host, inventory from pyinfra.facts.hardware import Ipv4Addresses from pyinfra.operations import files, server config.SUDO = True # update the /etc/hosts file def update_hosts_file(name, ip): name = name.replace("@vagrant/", "") files.line( name="Add hosts to /etc/hosts", ...
Python
1
import os import pytest import json from xbox.nano.channel import Channel from xbox.nano.enum import ChannelClass @pytest.fixture(scope='session') def packets(): # Who cares about RAM anyway? data = {} data_path = os.path.join(os.path.dirname(__file__), 'data', 'packets') for f in os.listdir(data_pat...
Python
1
0lo ) ) ) # print( pixsz ) map += numpy.log( prior ) if max is None : max = numpy.max( map ) map = numpy.exp( map - max ) if plot : plt.figure( str( errdis ) ) # More colormaps in matplotlib: docs->Matplotlib examples->color Examples plt.imshow( map, aspect=None,...
Python
1
let text = read_stdin()?; let (analysis, file_id) = Analysis::from_single_file(text); let structure = analysis.file_structure(file_id).unwrap(); for s in structure { println!("{:?}", s); } Ok(()) } pub fn highlight(rainbow: bool) -> Result<()> { let (analysis, file_id) = Analysis::...
Rust
0
responds to the one used for the LM!! asr_brain.tokenizer = label_encoder ind2lab = label_encoder.ind2lab vocab_list = [ind2lab[x] for x in range(len(ind2lab))] from speechbrain.decoders.ctc import CTCBeamSearcher test_searcher = CTCBeamSearcher( **hparams["test_beam_search"], voc...
Python
1
""" 聊天管理模块 负责聊天会话的管理和消息处理 """ from .manager import ChatManager __all__ = ["ChatManager"]
Python
1
e = data["test"]["X"] y_te = data["test"]["y"] random_state = 1 X_train, _, y_train, _ = train_test_split( X, y, test_size=0.20, random_state=random_state ) ebm1 = ExplainableBoostingClassifier( random_state=random_state, interactions=0, max_bins=10, ) ebm1.f...
Python
1
} Uniform::VectorFloat(vec) => { match vec { UniformVector::TwoDimensions(x, y) => { raw::Uniform2f(loc, x, y); } UniformVector::ThreeDimensions(x, y, z) => { raw::Uniform...
Rust
0
# Copyright (c) OpenMMLab. All rights reserved. from .collect_env import collect_env from .misc import is_metainfo_lower, switch_to_deploy from .setup_env import register_all_modules __all__ = [ 'register_all_modules', 'collect_env', 'switch_to_deploy', 'is_metainfo_lower' ]
Python
1
copy() group1_double.to(torch.float64) def local_func(group0, group1): return Group(tensor=group0).local(Group(tensor=group1)) jac_raw = torch.autograd.functional.jacobian( local_func, (group0_double.tensor, group1_double.tensor) ) if is_projected: expected = [ ...
Python
1
pub fn botan_privkey_load_x25519( key: *mut botan_privkey_t, privkey: *const u8, ) -> c_int; pub fn botan_pubkey_load_x25519( key: *mut botan_pubkey_t, pubkey: *const u8, ) -> c_int; pub fn botan_privkey_x25519_get_privkey( key: botan_privkey_t, output: *...
Rust
0
''' The MIT License(MIT) Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com) 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 ...
Python
1
ve] pub enum TargetFeatures<'a> { /// The target features are unknown. Unknown, /// Only match the specified features. Features(HashSet<&'a str>), /// Match all features. All, } impl<'a> TargetFeatures<'a> { /// Creates a new `TargetFeatures` which matches some features. pub fn features...
Rust
0
r""" Cassini cylindrical projection ============================== This cylindrical projection was developed in 1745 by César-François Cassini de Thury for the survey of France. It is occasionally called Cassini-Soldner since the latter provided the more accurate mathematical analysis that led to the development of th...
Python
1
LevelFilter, } #[derive(Debug, Error)] enum Error { #[error(display = "{}", _0)] Clap(#[error(no_from, source)] clap::Error), #[error(display = "{}", _0)] ClapDisplayed(#[error(no_from, source)] clap::Error), #[error(display = "I/O error: {}", _0)] Io(#[error(source)] io::Error), #[error(di...
Rust
0
))] ); match s.get_inner() { MemberState::Delaying(state) => { assert!(state.get_protocol_specific().v1_router_present); } _ => panic!("Wrong State!"), } s.v1_router_present_timer_expired(); ...
Rust
0
.my_wcsdup.argtypes = POINTER(c_wchar), dll.my_free.restype = None res = dll.my_wcsdup(s[:-1]) self.assertEqual(res[:len(s)], s) self.assertEqual(res[:len(s):], s) self.assertEqual(res[len(s)-1:-1:-1], s[::-1]) self.assertEqual(res[len(s)-1:5:-7], s[:5:-7]) with ...
Python
1
xceptionTable { start_pc: u16, end_pc: u16, handler_pc: u16, catch_type: u16, } #[derive(Debug)] pub enum Constant { Class { name_index: u16, }, Fieldref { class_index: u16, name_and_type_index: u16, }, Methodref { class_index: u16, name_and_t...
Rust
0
amN, Direction, Generator, Height, SliceIndex, }; use ultraviolet::Vec4; use crate::clay::geom::{ cubical::{CubicalMesh, CurveData}, Boundary, Carries, Mesh, Vert, WithBoundaryAndGenerator, WithGenerator, }; impl Boundary { /// Calculate the boundary of a given location in a diagram. fn at_coord(mut c...
Rust
0
Result<(), Report> { let blossom_height = Blossom.activation_height(network).unwrap(); let first_halving_height = match network { Network::Mainnet => Canopy.activation_height(network).unwrap(), // Based on "7.8 Calculation of Block Subsidy and Founders' Reward" Netwo...
Rust
0
C >= 0.5] = 1 valid_HWC = torch.from_numpy(valid_HWC).bool() if init_type == "std": # accurate but not stable pred_HWC = torch.from_numpy(heights / heights.max() * (real_height_pix / heights.shape[0]) * scale * 2).float()[..., None] elif init_type == "thin": heights = heights - heig...
Python
1
# Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html import os import sys sys.path.insert(0, os.path.abspath('../../notata')) # -- Project information ------------------...
Python
1
_to_round<T: Config>(annual: Perbill) -> Perbill { let rounds = rounds_per_year::<T>(); annual / rounds } /// Compute round issuance range from round inflation range and current total issuance pub fn round_issuance_range<T: Config>(config: MiningResourceRateInfo) -> MiningRange<Balance> { // Get total round per yea...
Rust
0
partial_transaction(parts, &keychain).context(ErrorKind::Keychain)?; Ok((tx, blind, coins, change_key, amount_with_fee)) } fn coins_proof_count(coins: &Vec<OutputData>) -> usize { coins.iter().filter(|c| c.merkle_proof.is_some()).count() } pub fn issue_burn_tx( config: &WalletConfig, keychain: &Keychain, amount...
Rust
0
li =[1,2,3,4,5,6,7,8,9] x =iter(li) print(x) print(next(x)) print(next(x)) print(next(x)) print(next(x)) print(next(x)) print("another way of iter ") x2 =li.__iter__() print(x2) print(x2.__next__()) print(x2.__next__()) print(x2.__next__()) print(x2.__next__()) print(x2.__next__()) print(x2.__next__()) pri...
Python
1
r) weightsPath = 'weigts_%s.h5' % model_name lr = 0.1 if os.path.exists(weightsPath): model.load_weights(weightsPath) lr /= 10 for i in range(20): print i img_gray = np.expand_dims(np.mean(X[0], axis=-1).astype(np.int), axis=-1) gt_dep = Y[0]*255. pred_...
Python
1
![allow(non_snake_case)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] #![allow(unused_imports)] use crate::*; pub use crate::cppmmabi::*; use std::os::raw::*; #[repr(C)] pub struct optr__PubCtor_t { _unused: [u8; 0], } #[repr(C)] pub struct optr__PrvCtor_t { _unused: [u8; 0], } #[repr(C)] ...
Rust
0
import ax import matplotlib import numpy as np from mpl_toolkits.mplot3d import Axes3D from matplotlib import pyplot, cm def plot2D(x,y,p): fig = pyplot.figure() ax = fig.add_subplot(projection="3d") X,Y = np.meshgrid(x,y) surf = ax.plot_surface(X,Y,p[:], rstride=1, cstride=1, cmap=cm.viridis, ...
Python
1
from setuptools import find_packages, setup with open('requirements.txt', 'r') as f: install_requires = [line for line in f] def readme(): with open('README.md') as f: content = f.read() return content def get_version(): version_file = 'torchpack/version.py' with open(version_file, 'r')...
Python
1
config.output_hidden_states = True self.check_hidden_states_output(inputs_dict, config, model_class, (padded_height, padded_width)) @slow def test_model_from_pretrained(self): for model_name in DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]: model = DonutSwinModel.from_pre...
Python
1
{ if let RemoteKeystoreResponse::Sr25519VrfSign(resp) = resp { resp } else { //unreachable!() Err(Error::Unavailable) } }), } } } mod cryptostore; mod synccry...
Rust
0
assert_eq!(200, res.status()); let d: Dino = res.body_json().await?; assert_json_eq!(dino, d); Ok(()) } #[async_std::test] async fn get_dino_non_existing_key() -> tide::Result<()> { dotenv::dotenv().ok(); // clear_dinos() // .await // ...
Rust
0
= Int32Array::from_slice(&[5, 6, 7, 8, 9]); let b = cast( &array, &DataType::Float64, CastOptions { wrapped: true, ..Default::default() }, ) .unwrap(); let c = b.as_any().downcast_ref::<Float64Array>().unwrap(); assert!((5.0 - c.value(0)).abs(...
Rust
0