text
string
label_name
string
labels
int64
# 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
import pytest import pyteal as pt avm6Options = pt.CompileOptions(version=6) avm7Options = pt.CompileOptions(version=7) def test_json_string(): args = [pt.Bytes('{"foo":"bar"}'), pt.Bytes("foo")] expr = pt.JsonRef.as_string(*args) assert expr.type_of() == pt.TealType.bytes expected = pt.TealSimpleB...
Python
1
able & r##"SUBCI ci cj n \newline Subtract immediate value from a clear register ci=cj-n."## & "" SUBSI & 0x2A & (dest: sw, left: s, right: i) & vectorizable & r##"SUBSI si sj n \newline Subtract immediate value from a secret re...
Rust
0
in_dim.1, self.cfg.in_dim.2, out_w, out_h, self.mask.as_ptr(), self.out.grad.as_ref().unwrap().borrow().as_ptr(), in_grad.borrow_mut().as_mut_ptr(), self.cfg.pool_w, self.cfg.pool_h, self.cfg.st...
Rust
0
from pandas import read_csv as pd_read_csv from argparse import ArgumentParser from numpy import array_split as np_array_split from os import makedirs as os_makedirs from os.path import join as os_path_join, basename as os_path_basename, splitext as os_path_splitext def split_chrom_tsv(chrom_tsv, output_folder, split_...
Python
1
#!/usr/bin/env python # coding: utf-8 # In[1]: import logging import os from autogen import UserProxyAgent, config_list_from_json from autogen.agentchat.contrib.gpt_assistant_agent import GPTAssistantAgent # In[3]: logger = logging.getLogger(__name__) logger.setLevel(logging.WARNING) assistant_id = "asst_FXwDLk...
Python
1
#coding:utf-8 __author__ = "ila" import base64, copy, logging, os, sys, time, xlrd, json, datetime from django.http import JsonResponse from django.apps import apps from django.db.models.aggregates import Count,Sum from .models import xinwenleixing from util.codes import * from util.auth import Auth from util.common im...
Python
1
for line in svg_list: print(line) #line = '/home/xinyangjiang/Datasets/SESYD/FloorPlans/floorplans16-01/file_56.svg' p = SVGParser(line) builder.buildGraph(p.get_all_shape()) #train_dataset = SESYDFloorPlan(opt.data_dir, pre_transform=T.NormalizeScale()) #train_loader = DataLoad...
Python
1
print(f"[EmProps] Waiting for Azure blob to be available... attempt {attempt + 1}/{max_attempts}") time.sleep(delay) else: print(f"[EmProps] Warning: Could not verify Azure upload") return False except Exception as e: ...
Python
1
derive(Encode, MaxEncodedLen)] struct Generic<T> { one: T, two: T, } #[test] fn generic_max_length() { assert_eq!(Generic::<u8>::max_encoded_len(), u8::max_encoded_len() * 2); assert_eq!(Generic::<u32>::max_encoded_len(), u32::max_encoded_len() * 2); } #[derive(Encode, MaxEncodedLen)] struct TwoGenerics<T, U> { ...
Rust
0
""" Methods to annotate queries with TagMe API. @author: Faegheh Hasibi (faegheh.hasibi@idi.ntnu.no) """ import argparse import requests from nordlys.config import OUTPUT_DIR from nordlys.tagme import config from nordlys.tagme.test_coll import read_erd_queries, read_yerd_queries, read_tagme_queries from nordlys.wikip...
Python
1
r[sec_col]).lower() if r[sec_col] is not None else "", reverse=sec_desc ) else: sorted_array = sorted( array, key=lambda r: float(r[sec_col]) if r[sec_col] is not None else float("-inf"), reverse=sec_desc ...
Python
1
= "0: RGB"] RGB = 0, #[doc = "1: RBG"] RBG = 1, #[doc = "2: GBR"] GBR = 2, #[doc = "3: GRB"] GRB = 3, #[doc = "4: BRG"] BRG = 4, #[doc = "5: BGR"] BGR = 5, } impl From<ODD_LINE_PATTERN_A> for u8 { #[inline(always)] fn from(variant: ODD_LINE_PATTERN_A) -> Self { ...
Rust
0
#!/usr/bin/env python3 """ Data cleaning utilities for the Bias and Fairness Module. """ import pandas as pd import numpy as np from pathlib import Path from typing import Optional def clean_predictions(csv_path: str, output_path: Optional[str] = None) -> str: """ Clean up model predictions to extract binary ...
Python
1
s, Bytes, ByteArray); list_complex_accessor!(get_group, Group, Row); list_complex_accessor!(get_list, ListInternal, List); list_complex_accessor!(get_map, MapInternal, Map); } impl MapAccessor for Map { fn get_keys<'a>(&'a self) -> Box<ListAccessor + 'a> { let map_list = MapList { ...
Rust
0
; use regex::Regex; use std::{collections::HashMap, str::FromStr}; static INPUT: &str = include_str!("data/q04.data"); #[derive(Clone, Debug)] enum Record { // [1518-07-26 23:52] Guard #1597 begins shift Started { date: String, guard: String, }, // [1518-02-09 00:56] falls asleep /...
Rust
0
h sampler num_workers=4, pin_memory=True, sampler=train_sampler, generator=g, ) ### generator is used for random seed test_dataset = torchvision.datasets.MNIST( root="./data", train=False, transform=transforms.ToTensor(), download=True ) test_sampler = torch.util...
Python
1
is_action_pressed("ui_up".into()) { new_acceleration_vec.x -= acceleration; } self.player.direction = rotation.positive(); let rota = Rotation2D::new(rotation); let acceleration = rota.transform_vector(new_acceleration_vec); let mut player = unsafe { owner.get_node("s...
Rust
0
ion::new(x, y, z)); assert_eq!(expect, actual); } } #[test] fn parse_debian() { let tests = vec![ ("Linux version 4.19.0-6-amd64 (<EMAIL>) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.67-2 (2019-08-28)", Some((4, 19, 67))), ]; for (str, expect) in tests { let actual ...
Rust
0
0..ctx.num_inputs(insn)) .map(|i| InsnInput { insn, input: i }) .collect(); let outputs: SmallVec<[InsnOutput; 2]> = (0..ctx.num_outputs(insn)) .map(|i| InsnOutput { insn, output: i }) .collect(); let ty = if outputs.len() > 0 { Some(ctx.output_ty(insn, 0)) } else { ...
Rust
0
has no effect return np.stack(self.frames, axis=0) def wrap_deepmind( env: Env, episode_life=True, clip_rewards=True, frame_stack=4, scale=False, warp_frame=True, ): """Configure environment for DeepMind-style Atari. The observation is channel-first: (c, h, w) instead of (h, ...
Python
1
self.error(f'Index not found: "{index}"') continue index_name = BaseIndex.INDEX_NAMES.get(index, index) index_cls = BaseIndex.REGISTERED_INDEXES[index_name] if not confirm: self.question( f"Are you sure you want to perform the ...
Python
1
t" name="cliente" value="{venda[1]}" required><br><br> PRODUTO: <input type="text" name="produto" value="{venda[2]}" required><br><br> DATA_VENDA: <input type="date" name="data_venda" value="{venda[3]}" required><br><br> PRECO: <input type="number" step="0.01" name="preco" value="{venda[4]}" req...
Python
1
le_id: &T::TableId) -> Vec<T::TargetType> { let table = Scores::<T>::get(table_id); table .scores .iter() .map(|record| record.target.clone()) .take(table.head_count as usize) .collect() } } #[cfg(test)] mod tests { use crate::mock...
Rust
0
_nam: Cn<'a>, #[default(Cn(b""))] pub log_nam: Cn<'a>, #[default(U1::from(1))] pub head_num: U1, #[default(U1::from(1))] pub site_num: U1, } #[derive(Debug, Eq, PartialEq, STDFRecord)] pub struct PGR<'a> { pub grp_indx: U2, pub grp_nam: Cn<'a>, pub indx_cnt: U2, #[array_length(i...
Rust
0
# Copyright (c) 2009-2012 testtools developers. See LICENSE for details. """ContentType - a MIME Content Type.""" class ContentType(object): """A content type from http://www.iana.org/assignments/media-types/ :ivar type: The primary type, e.g. "text" or "application" :ivar subtype: The subtype, e.g. "pl...
Python
1
"""FrankenUI Auth Example built with MonsterUI (original design by ShadCN)""" from fasthtml.common import * from monsterui.all import * from fasthtml.svg import * app, rt = fast_app(hdrs=Theme.blue.headers()) @rt def index(): left = Div(cls="col-span-1 hidden flex-col justify-between bg-zinc-900 p-8 text-whi...
Python
1
test_client.post_note(openreview.Note(invitation='eswc-conferences.org/ESWC/2021/Conference/Paper5/-/Withdraw', forum = submissions[0].forum, replyto = submissions[0].forum, readers = [ 'everyone'], writers = [conference.get_id(), conference.get_p...
Python
1
ews_gloves' @-kz288l6g012 def grizqz1t797(nap7e_muhu4: r3cp22gvmrh, th5t238y91q, uvluvriemxi: l2nx5b7tpt0, bxf8sg8ce46: tqm0_ywv91o, ubn_ay2zev1): """# jackboxes_alkalinity_pyramid -> manpower_reviews_gloves""" ibc17ygtfqk del fm7uvfqzkmz nonlocal xo4ikkdc5zj raise False pass mg56bde2lp1 += ...
Python
1
import pytest from zoo.services.models import Service from zoo.utils import model_instance_to_json_object pytestmark = pytest.mark.django_db def test_model_instance_serialization(): service = Service.objects.create(id=123123, owner="zoo", name="jungle") expected_result = { "model": "services.servic...
Python
1
*self == SETCLR14R::H_COUNTER } } #[doc = "Possible values of the field `SETCLR15`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum SETCLR15R { #[doc = "Independent. Set and clear do not depend on any counter."] INDEPENDENT, #[doc = "L counter. Set and clear are reversed when counter L or the...
Rust
0
#!/usr/bin/python3 -B # Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com # # 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 # # Un...
Python
1
#[cfg(feature = "typed-routing")] fn typed_put<H, T, P>(self, handler: H) -> Self where H: Handler<T, B>, T: FirstElementIs<P> + 'static, P: TypedPath, { self.route(P::PATH, axum::routing::put(handler)) } #[cfg(feature = "typed-routing")] fn typed_trace<H, T, P>(...
Rust
0
# Copyright 2018 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, ...
Python
1
odel max_feat_num = config.data.max_feat_num max_sample_feat_num = config.data.max_sample_feat_num if 'GMH' in config_m.x: params_x = {'model_type': config_m.x, 'max_feat_num': max_feat_num, 'depth': config_m.depth, 'nhid': config_m.nhid, 'num_linears': config_m.num_linears, ...
Python
1
({}, {})", self.kind, self.value) } } // This file is part of sv_check and subject to the terms of MIT Licence // Copyright (c) 2019, <EMAIL> #[allow(unused_imports)] use crate::reporter::{REPORTER, MsgID}; use crate::error::{SvError}; use crate::lex::token::{TokenKind}; use crate::lex::token_stream::TokenStream; ...
Rust
0
from typing import List from fastapi.responses import JSONResponse from fastapi import APIRouter, Depends, HTTPException, status from app import dto from app.api import schems from app.api.dependencies import dao_provider from app.infrastructure.database.dao import HolderDao router = APIRouter(prefix="/dishes", tags...
Python
1
lse, progress=True, **kwargs): return _efficientnet('efficientnet_b1', pretrained, progress, **kwargs) @mlconfig.register def efficientnet_b2(pretrained=False, progress=True, **kwargs): return _efficientnet('efficientnet_b2', pretrained, progress, **kwargs) @mlconfig.register def efficientnet_b3(pretrained=...
Python
1
import argparse from q_learning import train_q_learning from gradient_ascent import train_gradient_ascent if __name__ == "__main__": parser = argparse.ArgumentParser(description="Обучение с подкреплением на примере задачи CartPole.") parser.add_argument("--method", type=str, choices=["q_learning", "gradient_as...
Python
1
, ISSUE_AMOUNT}; fn init_testkit() -> (TestKit, MockTimeProvider) { let mock_provider = MockTimeProvider::default(); let mut testkit = TestKitBuilder::validator() .with_service(CryptoOwlsService) .with_service(TimeService::with_provider(mock_provider.clone())) .create(); // TimeSer...
Rust
0
import torch import torch.nn as nn import torch.utils.data import torch.nn.functional as F import torch import bitsandbytes as bnb import numpy as np import matplotlib.pyplot as plt import tokenizers from torch.utils.tensorboard import SummaryWriter from tqdm import tqdm import random import gc import json from datacl...
Python
1
marker: PhantomData<fn(K,V)>, manifest: Arc<Manifest>, params: Arc<Params>, memtable: RwLock<MemtableRef>, imm_memtables: Mutex<VecDeque<(u64, ImmMemtableRef)>>, imm_cond: Notify, levels: Vec<Level>, wal: Mutex<WriteAheadLog>, #[ cfg(feature="wisckey") ] value_log: Arc<ValueLog>, }...
Rust
0
opdown.css') def dynamic_dropdown_css(): light_color = session.get("lightcolor", "white") outer_margin = session.get("outer_margin", "12px") return Response(render_template("dynamic/styles/team_dropdown.css.jinja", outer_margin=outer_margin,light_color=light_color), mimetype="text/css") @app.route('/title_...
Python
1
aziot_key_common::EncryptMechanism::RsaPkcs1 => { aziot_key_common_http::encrypt::Parameters::RsaPkcs1 } aziot_key_common::EncryptMechanism::RsaNoPadding => { aziot_key_common_http::encrypt::Parameters::RsaNoPadding } ...
Rust
0
restart.data.len().into()); if self.verbose { value.insert("data", restart.data.clone().into()); } self.add(value); } fn handle_comment(&mut self, data: &[u8]) { let mut value = Object::new(); value.insert("marker", "COM".into()); if let Ok(commen...
Rust
0
ak; } set!(array, &mut cx, cx.number(i as f64), cx.number(field as f64)); i += 1; } Ok(array) } fn runtime_invoke_convert_args(mut cx: FunctionContext) -> JsResult<JsNumber> { Ok(unsafe { let method_info_handle: Handle<JsNumber> = cx.argument(0)?; let method_info = ...
Rust
0
the default page is the first page. </p> /// <p>Default value: <code>null</code> /// </p> pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self { self.inner = self.inner.next_token(input); self } pub fn set_next_token(mut self, input:...
Rust
0
e = 45, village_code = 10 are random values # url = "https://testapi.haqdarshak.com/api/get_location_details" # payload = json.dumps(data) token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25faWQiOjE5LCJzdGF0ZSI6Ik1haGFyYXNodHJhIiwidXNlcl9pZCI6Mjg5NjAsImlkIjoyODk2MCwiZXhwIjoxNzE0MTQ1NjI5fQ.5...
Python
1
, 'ride', 'pimp my ride', 'automobile, yours is fast', 'I love the movie The Notebook', 'My new notebook is slow' ] @pytest.fixture def qrx_synonym_bag_expected_queries(): return [ '', 'a', 'machine human', '(car OR automobile OR ride)...
Python
1
""" Crear un programa llamado print_preguntas.py, el cual permitirá mostrar en la app las preguntas de acuerdo a un formato: El programa debe contener la función print_pregunta() que tome como argumentos un enunciado y sus alternativas, y que les aplique formato. Esta función no debe retornar ningún objeto, sólo impr...
Python
1
all be equal assert_eq!(s_lo, p_lo); assert_eq!(s_hi, Some(s_lo)); assert_eq!(p_hi, Some(p_lo)); // Now we know there's a single size. // Use this as the hint to decide which algorithm to use. let size = s_lo; if size < 190 { scalar_mul::straus::Str...
Rust
0
) for measurement in measurements: should_sample_exemplar = ( self._sdk_config.exemplar_filter.should_sample( measurement.value, measurement.time_unix_nano, measurement.at...
Python
1
ppingCriteria(max_steps=100, patience=5), device=device) # Define the model lop_model = EdgeGNNModel(decoder='edge', node_in_dim=1, edge_in_dim=2, edge_out_dim=1, aux_node=False, logit_clipping=10.0).to(device) # Define the RL training algorithm lop_trainer = ImprovementTrainer(...
Python
1
"error".to_string() }; let res = update_eth_to_ckb_status(&data.db, &record).await; if res.is_err() { log::error!( "save error msg for record {:?} failed, err: {}", record, res.un...
Rust
0
''' This module provides some helpers functions and constants related to 802.15.4 physical layer. ''' from whad.phy import OQPSKModulationScheme, PhysicalLayer, Endianness def frequency_to_channel(frequency): ''' Converts a frequency (in Hz) to the corresponding 802.15.4 channel. ''' return int((((freq...
Python
1
tr { LOG_STYLE_SYSTEMD => { env_logger::builder().format(|buf, record| { writeln!( buf, "<{}>{}: {}", match record.level() { log::Level::Error => 3, log::Level::Warn => 4, ...
Rust
0
# -*- coding: utf-8 -*- """ Created on Wed Sep 18 16:36:12 2024 @author: haddadchia """ def cfl (fromArrayList, Dispersion_dict,depthinterp_dict,reach_distance_dict,xpoints_dict, dt ): #The Courant-Friedrichs-Lewy (CFL) condition provides a stability criterion # for numerical solutions of partial differentia...
Python
1
ameAccumulatedStat::k_EFrameStatRoundTripLatencyMS), 14 => ::std::option::Option::Some(EFrameAccumulatedStat::k_EFrameStatPingTimeMS), 15 => ::std::option::Option::Some(EFrameAccumulatedStat::k_EFrameStatServerBitrateKbitPerSec), 16 => ::std::option::Option::Some(EFrameAccumulatedSta...
Rust
0
an(mean_iou_per_class[1:]) # Skip class 0 # b = 1 # else: # mean_iou = np.nanmean(mean_iou_per_class) # Include all classes # b = 0 # mean_iou = np.nanmean(mean_iou_per_class) print(f"Mean IoU per class: {mean_iou_per_class}") print(f"Mean IoU across all classes: {mean_iou}") # ...
Python
1
L", "RDI", "AIVpU", "CUTR", "CXN", "DKSw", "HJK", "KEYW", "KFED", "MCHX", "ORCHD", "PLREP", "PSApA", "SONSE", "SUA.CL", "AAIIE", "ELU", "FFSw", "GJG", "MEDQE", "SNTS", "NABC", "NY", "NYC", "POTP", "STA", "ADSXD", "BACpA", "CIVpD.CL", "FNINE", "GYA", "JBK", ...
Rust
0
import asyncio from f2.apps.tiktok.handler import TiktokHandler from f2.apps.tiktok.utils import format_file_name kwargs = { "headers": { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0", "Referer": "https:...
Python
1
, } impl QueryParams { fn flags(&self) -> QueryFlags { let mut flags = QueryFlags::empty(); if self.values.is_some() { flags.insert(QueryFlags::VALUE); } if self.with_names { flags.insert(QueryFlags::WITH_NAMES_FOR_VALUES); } if self.page_s...
Rust
0
, other.z_start, other.z_end) { Some(c) => { if DEBUG { println!("subtract case added cuboid: edge 9"); } v.push(c); } None => {} } match self.foobar(i32::MIN, other.x_start-1, other.y_end+1, i32::MAX, other....
Rust
0
"failed request"; "user" => name_local_err, "method" => req.method.0.clone(), "error_code" => error.code, ...
Rust
0
from fastapi import HTTPException, status from uselevers.core.exceptions import HTTPExceptionExtra, HTTPSimpleError class ReferenceValueConflict(HTTPException, HTTPExceptionExtra): def __init__(self) -> None: super().__init__( status_code=self.status_code, detail=HTTPSimpleError( ...
Python
1
let mut tree = BVHLinearTree { bounds, linear_nodes: Vec::with_capacity(total_nodes), primitives: self.primitives, }; let mut offset = 0; tree.flatten_from(node, &mut offset); tree } } #[derive(Debug)] pub struct BVHLinearTree { pub b...
Rust
0
tate=tk.NORMAL) self.output_browse_btn.config(state=tk.DISABLED) self.save_info_label.config(text="💡 txt文件将统一保存在指定的输出目录中") def load_config(self): """加载配置文件""" try: if os.path.exists(self.config_file): with open(self.config_file, 'r', encoding='ut...
Python
1
ignore! { //! let wrapper: reflect::Type = reflect::new_struct_type(); //! //! wrapper.instantiate(vec![input.get_field("x").reference()]) //! # } //! ``` //! //! # Remaining work //! //! In its current state the proof of concept generates just barely working code for //! our simple `Debug` derive. The `reflect` libra...
Rust
0
import pyproj import pytest import xarray as xr import xproj from xproj.accessor import GeoAccessorRegistry @xproj.register_accessor @xr.register_dataset_accessor("test_3rdparty") @xr.register_dataarray_accessor("test_3rdparty") class Test3rdPartyAccessor(xproj.ProjAccessorMixin): __test__ = False def __ini...
Python
1
レスをリターン <2> let stream0 = stream.try_clone().unwrap(); Poll::Ready(( AsyncReader::new(stream0, self.listener.selector.clone()), BufWriter::new(stream), addr, )) } Err(err) => { ...
Rust
0
mage.handle()) .subresource_range( vk::ImageSubresourceRangeBuilder::from( subresource_range ).build() ) .old_layout(old_layout) .new_layout(new_layout.into()) .src_access_mask(source_access) .dst_access_mask(destination_access) .src_queue_family_index(vk::QUEUE_FAM...
Rust
0
import os import unittest from unittest.mock import call, patch, mock_open import sys sys.path.append('c:/Users/44746/Desktop/Project') from DecisionLevelFusion.WeightedAverage import save_fused_predictions class TestSaveFusedPredictions(unittest.TestCase): def test_save_empty_predictions(self): filen...
Python
1
parser.add_argument( '--demo-data', action='store_true', help='Load demo data for testing' ) args = parser.parse_args() # Print banner unless disabled if not args.no_banner: print_banner() print_quick_start() # Setup logging logger =...
Python
1
class UserAlreadyExistsError(ValueError): pass
Python
1
ематикалык маани', 'lo': 'ເຄື່ອງໝາຍທາງຄະນິດສາດ', 'lt': 'matematiniai simboliai', 'lv': 'matemātiskais pieraksts', 'mai': 'गणितीय संकेतन', 'mi': 'Reo Tohu Pāngarau', 'mk': 'математичка нотација', 'ml': 'ഗണിത രൂപം', 'mn': 'математик тооллын систем', 'mr': 'गणितीय संकेतलिपी', 'ms': 'Tatatanda matematik', 'my': 'ဂဏန်းသင်္ခ...
Python
1
图像的sift特征描述符:"+image_path) # # 读取图片文件 # img = cv2.imread(image_path) # # 将图像转换为灰度图 # gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) # # 检测关键点并计算描述符 # kp, des = sift_det.detectAndCompute(gray, None) # des_list.append((image_path, des)) # # # # 将所有描述符垂直堆叠在...
Python
1
# -*- coding: utf-8 -*- # @Author : relakkes@gmail.com # @Time : 2023/12/23 15:40 # @Desc : from .client import WeiboClient from .core import WeiboCrawler from .login import WeiboLogin
Python
1
_to_even_32: (-113., -1, -110.), half_to_even_33: (-115., -1, -120.), half_to_even_34: (-117., -1, -120.), half_to_even_35: (-123., -1, -120.), half_to_even_36: (-125., -1, -120.), half_to_even_37: (-127., -1, -130.), half_to_even_38: (-133., -1, -130.), half_to_even_39: (-135., -1, -140.), half_to_even...
Rust
0
(Path("images") / f"{new_image_path.name}") split_filepaths.append(file_path) meta["frames"].append( { "file_path": file_path, "fl_x": metadata["intrinsics"][0].item(), "fl_y": metadata["intrinsic...
Python
1
y node id """ degrees = {} for node, degree in graph.degree(): degrees[node] = degree degree_df = pd.DataFrame.from_dict(degrees, orient="index", columns=["degree"]) return degree_df def get_average_node_degree(graph, joined_nodes, prefix=None): """ Return the average node deg...
Python
1
_id.try_into()?)) } }) .collect::<Result<Vec<Entity>, Error>>()? }) } } pub struct QueryGetByKey { key: PublicKey } impl QueryGetByKey { pub fn new(client: &Client, key: PublicKey) -> Query<QueryGetByKeyResponse> { Query::new(client, Self...
Rust
0
Array, caller_id: &str| { (*last_caller_id.lock().expect(MUTEX_LOCK_FAIL)) = Some(caller_id.into()); manager .lock() .expect(MUTEX_LOCK_FAIL) .update_statuses(&message); } }; let on_result = { ...
Rust
0
ent_appliance.update_advanced_settings({'log': log_yaml}) attempts = 0 detected = False while (not detected and attempts < 60): logger.debug(f'Attempting to detect log level_rails change: {attempts}') for line in evm_tail: if ui_worker_pid in line: ...
Python
1
setup_build_kani_prelude(kani_dir: &Path, toolchain_version: String) -> Result<()> { println!("[5/6] Building Kani library prelude..."); // We need a workspace to build them in, otherwise repeated builds generate different hashes and `kani` can't find `kani_macros` let contents = "[workspace]\nmembers = [\"...
Rust
0
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Receivers for use in tests. """ from twisted.positioning import base, ipositioning class MockPositioningReceiver(base.BasePositioningReceiver): """ A mock positioning receiver. Mocks all the L{IPositioningReceiver} methods with...
Python
1
rker) DNS resolution failed"); DeliveryResult::Deferred(IGNORED_ATTEMPTS, "DNS resolution failed".to_owned()) }, Err(LettreSmtpError::ResponseParsing(s)) => { info!("(worker) Delivery Failed (response parsing error): {}", s); DeliveryResult::Failed(format!("response p...
Rust
0
borrowed as immutable [E0502] (**tmp1).number; }; #[envs(cls)] bar::<'t0>(tmp0, cls); } fn main() {} <reponame>MikuroXina/rich-sdl2-ttf-rust //! Glyph metrics. use rich_sdl2_rust::geo::{Point, Rect, Size}; use std::marker::PhantomData; use super::Font; use crate::bind; /// A glyph in a font. pub st...
Rust
0
-net-SocketImpl" // #[cfg(any(feature = "all", all(feature = "java-net-SocketImpl")))] // fn accept<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::net::SocketImpl>>) -> __jni_bindgen::std::result::Result<(), __jni_bindgen::Local<'env,...
Rust
0
String::new() }; }<reponame>nlordell/ethcontract<filename>ethcontract/src/transaction/gas_price.rs //! Implementation of gas price estimation. use primitive_types::U256; use web3::types::U64; #[derive(Debug, Default, Eq, PartialEq)] /// Data related to gas price, prepared for populating the transaction object. pu...
Rust
0
do. Goodbye!"), 0) # Finally, we ensure our local version has a patch available before continuing. patches = get_version_list()["patches"] if local_version in patches: if gui.message_yes_no(_("An update is available for TF2 Classic. Do you want to install it?"), None, True): if gui.mes...
Python
1
NAME>, <NAME>, <NAME>, <NAME> // SPDX-License-Identifier: MIT OR Apache-2.0 use paperclip::actix::Apiv2Schema; use serde::Deserialize; #[derive(Deserialize, Apiv2Schema)] pub struct ConfigQueryDto { #[serde(default, deserialize_with = "comma_seperated")] pub keys: Vec<String>, } fn comma_seperated<'de, D>(de...
Rust
0
# 以下は、**Python (CPython 3.11.4)** を用いて、**型注釈を明示**し、**Pylanceの型検査に準拠**しつつ、**処理時間とメモリ効率を意識**したクイズ大会の正解数計算プログラムです。 # --- # ## ✅ 解法のポイント # * `M` 問全てに対して、各生徒の **誤答数** を `O(1)` で記録。 # * 最終的に、各生徒の **正解数 = M - 誤答数** を出力。 # --- # ## ✅ Python コード(型注釈 + Pylance対応) # ```python from typing import List import sys # 高速入力用(制約対策...
Python
1
v7/finance/quote?=& use serde::{Deserialize, Serialize}; use async_trait::async_trait; const YAHOO_URL: &str = "https://query1.finance.yahoo.com/v7/finance/quote?=&"; #[derive(Debug, Deserialize, Serialize, Copy, Clone)] pub enum QuoteType { #[serde(rename = "CRYPTOCURRENCY")] CryptoCurrency, #[serde(rena...
Rust
0
ured = open_dat(save_dir + 'measured_3x2pt_bps/shear_bp/Cl_EE/bin_{}_{}.txt'.format(i, j)) bp_err = open_dat(save_dir + 'measured_3x2pt_bps/shear_bp/Cl_EE/bin_{}_{}_err.txt'.format(i, j)) yerr = (bp_err / bp) yerr[yerr == np.Inf] = np.NaN # rect = ((i * sz) + (0.08 * i) ...
Python
1
ddress": "ул.Ломоносова, д.9, лит. М",\n') file = r("<classroom>Ауд. Актовый зал (1216/0 (усл))</classroom>", '\t\t\t\t\t\t\t "classroom": "Ауд. Актовый зал (1216/0 (усл))"\n') file = r("</place>", '\t\t\t\t\t\t},\n') file = r("<teacher>Клименков Сергей Викторович</teacher>", '\t\t\t\t\t\t"teach...
Python
1
cat = language_model[self._last_order][order] else: lm_cat = language_model[order][self._last_order] self._seq_counters[lm_cat] += 1 self._last_order = order charset_name = self._model.charset_name if self.state == ProbingState...
Python
1
ne(channel_id, timeout); (updates, users, chats) } } } } <gh_stars>1-10 fn main() { // Line comments are anything after ‘//’ and extend to the end of the line. let x = 5; // this is also a line comment. // If you have a long explanation for something, you c...
Rust
0
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from enum import Enum class FeedbackType(Enum): PERFECT = "perfect" CORRECT_SEARCH_QUERY = "better_search_query...
Python
1
, "Expected checksum: D6 but got {:X?}", record.0.checksum() ) } } } pub mod query { //! Query messages that are sent to obtain information from the sign. //! //! It is not known if it is necessary to make these queries to start the flashing //! p...
Rust
0
into(); let audio_model = Audio { rng: SmallRng::seed_from_u64(0), hrtf_data: HrtfData::new(), hrtf_processor, source_position, prev_source_position: [0.0; 3].into(), }; let stream = audio_host .new_output_stream(audio_model) .render(audio) .c...
Rust
0