text
string
label_name
string
labels
int64
sult.map(|a| ColumnarValue::Array(a)); } // if both arrays or both literals - extract arrays and continue execution let (left, right) = ( left_value.into_array(batch.num_rows()), right_value.into_array(batch.num_rows()), ); self.evaluate_with_resolved_arg...
Rust
0
sult = './output_pre_module.mp4|1080|1920|10.0|MOV,MP4,M4A,3GP,3G2,MJ2|1918874|2400512|h264|{"fps": "29.97"}' self.remove_result_data(output_path) task = command + "premoduleMode" os.system(task) self.check_video_diff(output_path, expect_result) @timeout_decorator.timeout(seconds=12...
Python
1
import traceback from django.db import transaction from rental.models import House from rental import enums from scrapy_twrh.spiders.rental591 import Rental591Spider, util from .persist_queue import PersistQueue class Detail591Spider(Rental591Spider): name = "detail591" def __init__(self, **kwargs): s...
Python
1
) # Search all content results = indexer.search_images("clothing products", top=5) print(f"Found {len(results)} results for 'clothing products'") # Search only images image_results = indexer.search_images_only("shoes", top=5) print(f"Found {len(image_results)} image results for 'shoes'...
Python
1
// vector lengths let n = C_vec.len(); let s = self.I_vec.len(); let t = s*n + 2*n + s + 3; let p_len = 2*n+3+s; let N = t.next_power_of_two(); let res = N-t; // transcript initialization let mut transcript: Vec<u8> = Vec::with_capacity(1000); ...
Rust
0
['baseScore'], metric_data['baseSeverity'], metric_data['userInteraction'] if 'userInteraction' in metric_data else '', metric_data['scope'] if 'scope' in metric_data else '', metric_data['privilegesRequired'...
Python
1
from multiversx_sdk import ( Address,ProxyNetworkProvider, QueryRunnerAdapter, SmartContractQueriesController) from multiversx_sdk.abi import Abi from pathlib import Path from const import * import requests import time import csv ### 12 December #Fetch all WINTER-xx tokens #return: tokens ...
Python
1
(client: APIClient, view: str) -> None: client.request("GET", "/stock", params={"view": view}) @stock.command("add") @click.argument("payload", callback=_parse_json) @click.pass_obj def stock_add(client: APIClient, payload: Any) -> None: """Add stock units from a JSON object: {"items": [...]}""" client.re...
Python
1
} } }<filename>src/code_wizards/model/mod.rs #[macro_use] mod circular_unit; #[macro_use] mod living_unit; #[macro_use] mod unit; mod action_type; mod bonus; mod building; mod faction; mod game; mod lane_type; mod message; mod minion; mod move_; mod player; mod player_context; mod projectile; mod skill_typ...
Rust
0
current_val_index[i] += 1; if current_val_index[i] == max_val_index[i] { current_val_index[i] = 0; values.remove(&(i + n_offset)); if i == 0 { // no more values, terminate return; } ...
Rust
0
# Given a time in -hour AM/PM format, convert it to military (24-hour) time. # Note: - 12:00:00AM on a 12-hour clock is 00:00:00 on a 24-hour clock. # - 12:00:00PM on a 12-hour clock is 12:00:00 on a 24-hour clock. # Example # Return '12:01:00'. # Return '00:01:00'. # Function Description # Complete the timeCon...
Python
1
seCmd::GetDataBitsLowbyte as u8,]); }; (($passthru:tt, $read_len:tt) {const $idx_id:ident = gpio_lower(); $($tail:tt)*} -> [$($out:tt)*]) => { const $idx_id: usize = $read_len; mpsse!(($passthru, $read_len) {gpio_lower(); $($tail)*} -> [$($out)*]); }; (($passthru:tt, $read_len:tt) {gpio_...
Rust
0
choice == '3': create_branch(repo) elif choice == '4': switch_branch(repo) elif choice == '5': show_pending_files(repo) elif choice == '6': make_commit(repo) elif choice == '7': show_commit_history(repo) elif choice == '...
Python
1
E2PACKAGE, ( f'{scope} not in {MODULE2PACKAGE}!, please make pass a valid ' 'scope.') root_or_mim_dir = BaseInferencer._get_repo_or_mim_dir(scope) for model_cfg in BaseInferencer._get_models_from_metafile( root_or_mim_dir): model_name = [model_cfg['Nam...
Python
1
}; use env::Env; pub fn eval_begin(cdr: Expr, mut env: Env) -> EvalResult { match cdr { List(items) => { let mut ctr = 1; let total_len = items.len(); for e in items.move_iter() { if ctr == total_len { return Ok((Some(*e), env)) ...
Rust
0
rk together to provide optimal RAG responses using advanced reranking.", "Initial Retriever: First perform broad comprehensive retrieval.", "Reranking Specialist: Apply advanced reranking for result optimization.", "Context Analyzer: Analyze and validate the reranked results.", "Final Sy...
Python
1
::{local_test_with_config_e, Canister, Project, Runtime}; use dfn_candid::CandidOne; use futures::future::join_all; use ic_config::subnet_config::SubnetConfig; use ic_config::Config; use ic_sns_governance::init::GovernanceCanisterInitPayloadBuilder; use ic_sns_governance::pb::v1::Governance; use ledger_canister as ledg...
Rust
0
to)| { (*from, *to, { // TODO: Init actual curves, between intersections let (x_from, y_from) = nodes[from]; let (x_to, y_to) = nodes[to]; LaneData::new( (*from, *to), None, None, ...
Rust
0
from flask import Blueprint, request, jsonify, session, current_app from app.auth.auth_manager import AuthManager auth_bp = Blueprint('auth', __name__) @auth_bp.route('/register', methods=['POST']) def register(): """用户注册(基于手机号)""" try: data = request.json phone_number = data.get('phone_number...
Python
1
, otherwise assume the compiler supports Unix traditional ``-I`` and ``-o``. Return the list of values of the ``expressions``. """ if include_path is None: include_path = [] c_name = None exe_name = None obj_name = None try: c_file, c_name, exe_name = create_c_file(file_...
Python
1
error is not fatal, then keep going. }, } } Err(Error::UnknownIssuer) } <filename>crates/aptos-crypto/src/compat.rs // Copyright (c) Aptos // SPDX-License-Identifier: Apache-2.0 //! Wrapper structs for types that need [RustCrypto](https://github.com/RustCrypto) //! traits implemented. use...
Rust
0
denominator: f32 = b2_dot(this.m_normals[i], d); if denominator == 0.0 { if numerator < 0.0 { return false; } } else { // Note: we want this predicate without division: // lower < numerator / denominator, where denominator < 0 // Since denominator < 0, we have to flip the inequality: // lowe...
Rust
0
ing: 20px 30px; border-radius: 15px; display: none; }} .zoom-hint {{ position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.7); padding: 8px 16px; border-...
Python
1
(rename = "sentMessageRequests")] pub sent_message_requests: u64, #[serde(rename = "sentMilestoneRequests")] pub sent_milestone_requests: u64, #[serde(rename = "sentHeartbeats")] pub sent_heartbeats: u64, #[serde(rename = "droppedPackets")] pub dropped_packets: u64, } /// Describes a receip...
Rust
0
rocket::http::Method::*; /// /// fn hi<'r>(req: &'r Request, _: Data) -> HandlerFuture<'r> { /// Outcome::from(req, "Hello!").pin() /// } /// /// # let _ = async { // We don't actually want to launch the server in an example. /// rocket::ignite().mount("/hello", vec![Route::new(Get, "/w...
Rust
0
import argparse import pickle """ Problem Statement Convention: W: Weight given to the previous output, y_(i-1) W_xy: Weight given to current input, x_i V_xy: Weight given to previous input, v_i = x_(i-1) θ: Bias/Threshold term Implementation Convention: W: Weights for the previous input as well a...
Python
1
= MutableCharacterGrid.read_character_grid('input16.txt') # 94444 print(f'Loading Grid: {time.perf_counter()-tick:.6f} s') # print(grid) # fill in the areas that are an unbranching path leading to a dead end tick: float = time.perf_counter() fill_dead_ends(grid) print(f'Fill Dead Ends:...
Python
1
this program // were accepted, then the closure passed to `s.f` could escape its // argument. struct S; impl S { fn f<B, F>(&self, _: F) where F: FnOnce(&i32) -> B { } } fn main() { let s = S; s.f(|p| p) //~ ERROR cannot infer } <reponame>m-rutter/nushell<gh_stars>0 use lazy_static::lazy_static; use ...
Rust
0
, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ use pyo3::prelude::*; use rayon::prelude::*; use geojson::quick_collection; use geo_types::{Geometry, Coordinate, Point}; use geojson::GeoJson; use geo::algorithm::contains::Contains; use num...
Rust
0
from enum import Enum, auto import giant.image_processing.edge_detection.edge_detector_base as edge_detector_base import giant.image_processing.edge_detection.pixel_edge_detector as pixel_edge_detector import giant.image_processing.edge_detection.pae_subpixel_edge_detector as pae_subpixel_edge_detector import giant.im...
Python
1
rted")); fs::write(sanitized_path, original_str)?; println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-changed=src/getting-started-build-a-simple-app.md"); Ok(()) } use std::io::{self, Write}; mod ast; mod evaluator; mod lexer; mod object; mod parser; mod token; use evaluator::*; us...
Rust
0
) octal_whole = oct(whole).replace("0o", "") octal_frac = [] while frac: frac *= 8 bit = int(frac) octal_frac.append(str(bit)) frac -= bit if len(octal_frac) > 10: # Limit to 10 digits after the decimal break ...
Python
1
} #[test] fn scale_2d_from() { let scale_2d_def = Scale2D::from(120, 74); let scale_2d_fdef = Scale2D::from(120.0, 74.0); let scale_2d_u8 = Scale2D::from(120u8, 74u8); let scale_2d_u16 = Scale2D::from(120u16, 74u16); let scale_2d_u32 = Scale2D::from(120u32, 74u32); ...
Rust
0
acao: transacao['tipo_negocio'] = "" if 'dc' not in transacao: transacao['dc'] = "" if 'preco_ajuste' not in transacao: transacao['preco_ajuste'] = transacao.get('preco', 0) if 'ticker' not in transacao: transacao['ticke...
Python
1
naam = input("Wat is jouw naam? ") titel = input("Wat is jouw favoriete game? ") print(f"{naam} speelt graag {titel}!")
Python
1
0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ); } pub fn make_rotation_axis(&mut self, axis: &Vector3, angle: f32) { let c = angle.cos(); let s = angle.sin(); let t = 1.0 - c; let x = axis.get_x(); let y = axis.get_y(); let z = axis.get_z(); let tx = t * x; let ty = t * y; self.set( tx * x + c, tx...
Rust
0
rt_index option_tupler~r explicit_argmatch_argument action_tuples arg_countrcharnew_explicit_arg optionals_maprPstoprbrselected_patterns)r)arg_strings_patternextrasoption_string_indicesr'rr.r/consume_optionalsN     ...
Python
1
# Copyright 2012 James McCauley # # This file is part of POX. # # POX 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 3 of the License, or # (at your option) any later version. # # POX is distri...
Python
1
precision"] .as_i64() .map(TryInto::try_into) .transpose()?, // Target version no longer used by sass-spec, // and no other reasons to skip implemented here. should_skip: None, ...
Rust
0
E_MONTH_SECONDS < dissolve_delay_a); assert!(dissolve_delay_a < (n + 1) * ONE_MONTH_SECONDS); assert!(n * ONE_MONTH_SECONDS < dissolve_delay_b); assert!(dissolve_delay_b < (n + 1) * ONE_MONTH_SECONDS); assert_ne!(dissolve_delay_a, dissolve_delay_b); if diss...
Rust
0
from code_1 import * print(bar) print(baz) # The following will trigger an exception, as "waz" is not exported by the module # A linha seguinte dispara uma exception. "waz" não é exportado como môdulo # print(waz) # error
Python
1
# prompts.py """ Módulo de Prompts Centraliza a construção dos prompts enviados aos modelos de linguagem. """ from typing import Dict, Any, List def build_agent_prompt(config: Dict, question: str, history: List[Dict], context: str) -> str: """Constrói o prompt final para o LLM, integrando todos os elementos."""...
Python
1
ar_background(Color::DARKGRAY); let render_start = std::time::Instant::now(); let mut render_voxels = 0; let mut render_triangles = 0; { let mut d2 = d.begin_mode_3D(cam.raw()); // Projection and ModelView matrices corresponding to the ma...
Rust
0
: "south_lat",\n "WEST_LON": "west_lon",\n "EAST_LON": "east_lon",\n "TOTAL_SIZE": "total_size",\n "BASE_URL": "base_url"\n}', "REORDER_HEADERS_LIST": '[\n "scene_id",\n "product_id",\n "spacecraft_id",\n "sensor_id",\n "date_acquired",\n "sensing_time",\n "collection_number",\n "collection_cate...
Python
1
ith_inner( Control::with_inner( ScintillaGtk { base: GtkControlBase::with_gtk_widget(sc.upcast::<Widget>()), }, (), ), MemberFunctions::new(_as_any, _as_any_mut, _as_member, _as_member_mut), )); { ...
Rust
0
w(); for data in test_vec { if let Some(x) = parser.parse(data) { result = x; } } let test_asic = AsicEeg { delta: 0x94, theta: 0x42, low_alpha: 0x0b, high_alpha: 0x64, low_beta: 0x4d, ...
Rust
0
sholdVALVE>())).type_ as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(XrInteractionProfileAnalogThresholdVALVE), "::", stringify!(type_) ) ); assert_eq!( unsafe { &(*(::st...
Rust
0
#Loan Eligibility prediction import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sb from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder, StandardScaler from sklearn import metrics from sklearn.svm import SVC from imblearn.over...
Python
1
# 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 u...
Python
1
h.from_numpy(mouth).permute(0, 3, 1, 2) speech = torch.from_numpy(audio) melspec = self.melspec_g(speech).squeeze(0) mouth = self.face_resize(mouth) face_indices = (torch.rand(2) * len(faces)).int() face_crop = torch.cat([self.face_recog_resize(faces[f_id]).unsqu...
Python
1
ing_outer_radius, ROAD_MARKING_ELEVATION, lane_marking_color, 64) def draw_all(cars: list[CarDrawInfo], pedestrians: list[PedestrianDrawInfo], crosswalks: list[CrosswalkDrawInfo], road: RoadDrawInfo): draw_road(road.x, road.y, road.inner_lane_radius, road.outer_lane_radius) for car in cars: draw_car(ca...
Python
1
ne 2"); } fn print_light_help() { println!("Please define a valid light command and zone, like the following: "); println!("light off office"); println!("light on 2"); } fn print_shadow_help() { println!("Please define a valid shadow command and zone, like the following: "); println!("shadow open ...
Rust
0
to_verilog(&self, _: &VerilogState) -> String { // panic!("Not implemented. Use TypeCollector."); // } //} //impl ToVerilog for ast::Code { // fn to_verilog(&self, v: &VerilogState) -> String { // self.0.iter().map(|x| x.to_verilog(v)).collect::<Vec<_>>().join("") // } //} impl ToVerilog for T...
Rust
0
FXER = 754, PPC_INS_MODSD = 755, PPC_INS_MODSW = 756, PPC_INS_MODUD = 757, PPC_INS_MODUW = 758, PPC_INS_MR = 759, PPC_INS_MSGSYNC = 760, PPC_INS_MSYNC = 761, PPC_INS_MTAMR = 762, PPC_INS_MTASR = 763, PPC_INS_MTBR0 = 764, PPC_INS_MTBR1 = 765, PPC_INS_MTBR2 = 766, PPC_I...
Rust
0
={"font": "Consolas"}, box_config={"color": YELLOW_B}) if i: nb.next_to(box_list[i-1], RIGHT*2) box_list.append(nb) box_group = VGroup(*box_list) rect = Rectangle(color=PURE_GREEN, width=box_group.width+_box_buf, height=b...
Python
1
, AValue: *const c_char); pub fn Control_GetTag(AObj: usize) -> isize; pub fn Control_SetTag(AObj: usize, AValue: isize); pub fn Control_GetAnchorSideLeft(AObj: usize) -> usize; pub fn Control_SetAnchorSideLeft(AObj: usize, AValue: usize); pub fn Control_GetAnchorSideTop(AObj: usize) -> usize; pub fn Contro...
Rust
0
Fun gt(num1:.U128, num2:.U128):(res:Bool.Bool); 3 => just_gas_and_mem(13, 0,OpCode::Gt(Kind::U128,params[0], params[1])), //public extFun gte(num1:.U128, num2:.U128):(res:Bool.Bool); 4 => just_gas_and_mem(13, 0,OpCode::Gte(Kind::U128,params[0], params[1])), //public e...
Rust
0
{ let tx_bytes_1 = vec![0xFF; 32]; let tx_bytes_2 = vec![0xAA; 32]; let tx_hash_1 = blake2b(32, &[], &tx_bytes_1); //hash(&tx_bytes_1, 32); let tx_hash_2 = blake2b(32, &[], &tx_bytes_2); //= hash(&tx_bytes_2, 32); let tx_hashes = vec![tx_hash_1.clone(), tx_hash_2.clone()]; ...
Rust
0
v.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr()) } } /// **get** public static final [MONDAY](https://developer.android.com/reference/java/time/DayOfWeek.html#MONDAY) /// /// Required feature: java-time-DayOfWeek #[cfg(any(feature = "all", fea...
Rust
0
=0: #rnd1是0的话,按下4号按钮死 if buttons[4].state==1: s_5=1 p_9=1 if buttons[5].state==1: s_6=1 p_9 = 1 elif rnd1==1 and p_9==0: if buttons[4].state==1: s_6=1 p_9 = 1 if buttons[5].state==1: s_5=1 ...
Python
1
which the type /// has been defined. The last /// /// Rust prelude type may have an empty namespace definition. #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Serialize, Deserialize, Encode, Decode)] #[serde(transparent)] #[serde(bound( serialize = "T::TypeId: Serialize, T::String: Serialize", deserialize = ...
Rust
0
# -*- coding: utf-8 -*- """ Task 12.2 The ping_ip_addresses function from task 12.1 only accepts a list of addresses, but it would be convenient to be able to specify addresses using a range, for example 192.168.100.1-10. In this task, you need to create a function convert_ranges_to_ip_list that converts a list of IP...
Python
1
Position, N_POS, N_POS_VEL}; // Since component linking is not used in this bench, // it has a custom Velocity component struct Velocity { pub dx: f32, pub dy: f32, } struct Entity { pos: Pointer<Position>, vel: Option<Pointer<Velocity>>, } struct World { pos: Storage<Position>, vel: Storage<...
Rust
0
# print string using operator s1="Hello World" s2="Hello India" print(s1+" "+s2) # print(s2[6:]*5) a=s2[6:] for i in range(5): print(a) print(s1[6:])
Python
1
ive(Debug, PartialEq, Eq)] pub struct Style { /// Use joins ("INNER", "CROSS") instead of selecting from multiple tables. pub join: bool, /// Use semijoins ("WHERE EXISTS") where possible. pub semijoin: bool, /// Use "SELECT DISTINCT" and "UNION" rather than "SELECT" and "UNION ALL". pub distinc...
Rust
0
from os.path import join as pjoin import os class Config: def __init__(self): # setting CNN (graphic elements) model self.image_shape = (64, 64, 3) # self.MODEL_PATH = 'E:\\Mulong\\Model\\UI2CODE\\cnn6_icon.h5' # self.class_map = ['button', 'input', 'icon', 'img', 'text'] ...
Python
1
from model.curso import Curso from model.aluno import Aluno class Inscricao: def __init__(self, curso: Curso, aluno: Aluno, data_hora: int, id: int): self.__curso = curso self.__aluno = aluno self.__data_hora = data_hora self.__id = id @property def curso(self): ret...
Python
1
def actual_main(args): from deepview_profile.analysis.session import AnalysisSession from deepview_profile.exceptions import AnalysisError if os.path.exists(args.output): print('ERROR: The specified output file already exists.', file=sys. stderr) sys.exit(1) try: with...
Python
1
import os from app import create_app, db from app.models import Usuario, Categoria DB_PATH = "petshop.db" def reset_db(): # Apaga o banco antigo se existir if os.path.exists(DB_PATH): os.remove(DB_PATH) print("🗑️ Banco antigo removido.") app = create_app() with app.app_context(): ...
Python
1
raise ValueError("Either model or model_file must be provided") self.batch_size = batch_size self.min_batch_size = min_batch_size self.min_batch_timeout = min_batch_timeout self.tag = tag self.inputs, self.outputs = self._check_tensor_args(inputs, outputs) @property d...
Python
1
from argparse import Namespace from typing import Union, Optional from torch import Tensor, BoolTensor from torch.nn import Module, Linear, Sequential def get_pooler(pooler_name: str): from torch_geometric.nn import global_mean_pool, global_add_pool, global_max_pool pooler_map = { 'mean': globa...
Python
1
r_Q = -offset[1] # Determine angular travel center_P = currentPos[alpha_axis] - r_P center_Q = currentPos[beta_axis] - r_Q rt_Alpha = targetPos[alpha_axis] - center_P rt_Beta = targetPos[beta_axis] - center_Q angular_travel = math.atan2(r_P * rt_Beta - r_Q * rt_Alp...
Python
1
'' block3 = create_block(self.tip, create_coinbase_h(chainHeight+1), self.block_time, get_nBits(chainHeight)) chainHeight += 1 self.block_time += 1 block3.vtx[0].vout[0].nValue = 100*100000000 # Too high! block3.vtx[0].sha256=None block3.vtx[0].calc_sha256() block...
Python
1
X scroll /// ||| || +++++-------- coarse Y scroll /// ||| ++-------------- nametable select /// +++----------------- fine Y scroll /// v: u16, /// "Current" Fine X Scroll value x: u8, /// "Temporary" V-RAM address (15 bits) /// This internal register is effectively used for _nothi...
Rust
0
esponse_code() { Ok(200) => { let network: Network = serde_json::from_str(&easy.get_ref().body()).unwrap(); Ok(network) } Ok(404) => Err(NetworkNotFoundError(network_id_or_name.to_string())), _ => Err(InspectNetworkError), } } #[derive(Serialize, Deserialize,...
Rust
0
marker::PhantomData, }; use super::{types::*, utils::*}; //------------------------------------------------------------------------------ /// Iterator to incrementally load a .xyz file pub struct XyzIterator<P, R> where P: IsBuildable3D, R: BufRead, { read: R, is_done: bool, i_line: usize, ...
Rust
0
0, 0, 1]] self.assertEqual(one_hot(seq), expected) def test_sequence_with_only_n(self): seq = "NNNN" expected = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]] self.assertEqual(one_hot(seq), expected) class TestConvertFunction(unittest.TestCase): def test_valid_inputs...
Python
1
import io import os import re import subprocess from datetime import datetime, timedelta from django.conf import settings from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'kills processes (other commandS) that have been running for 24h or longer' def add_arguments(self...
Python
1
aybeUninit::<Self>::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] pub struct AnotherInterface__bindgen_vtable { pub AnotherInterface_Baz: unsafe extern "C" fn(this: &mut AnotherInterface), } #[repr(C)] #[derive(Debug, C...
Rust
0
mes, reddit, image_types, limit=10) if not image_urls: print("No images found in the subreddits.") return for i, url in enumerate(image_urls): image_path = os.path.join(output_dir, f'image_{i}.jpg') download_image(url, image_path) # Resize and save the resized image ...
Python
1
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch import torch.distributed as dist from sgg_benchmark.utils.comm import get_world_size def reduce_loss_dict(loss_dict): """ Reduce the loss dictionary from all processes so that process with rank 0 has the averaged results...
Python
1
# -*- coding: utf-8 -*- import os needs_sphinx = '1.3' extensions = ['sphinx.ext.mathjax'] templates_path = ['_templates'] source_suffix = '.rst' source_encoding = 'utf-8' master_doc = 'index' project = u'Debyer' version = '0.4' release = version language = 'en' exclude_patterns = ['_build'] default_role = 'math' pygm...
Python
1
}, /// Compressed curve point Compressed { /// x-coordinate x: &'a FieldBytes<C>, /// Is the y-coordinate odd? y_is_odd: bool, }, /// Uncompressed curve point Uncompressed { /// x-coordinate x: &'a FieldBytes<C>, /// y-coordinate y:...
Rust
0
andidate, /// Accept current input method sequence without /// conversion in IMEs. NonConvert, PreviousCandidate, Process, SingleCandidate, /// Toggle between Hangul and English modes. HangulMode, HanjaMode, JunjaMode, /// The Eisu key. This key may close the IME, but its purpose is defined by the...
Rust
0
finding["contract"] = m[1] continue found = False for indicator,name in MAP_FINDINGS: if line.startswith(indicator): finding["name"] = name found = True break if found: continue found = False...
Python
1
he buoy was resting quietly assert np.mean(ds.w_z) == approx(9.8, abs=0.3) assert np.mean(ds.w_x) == approx(0.0, abs=0.2) assert np.mean(ds.w_y) == approx(0.0, abs=0.2) if plot: import matplotlib.pyplot as plt (ds.w_z / axl.SENSORS_GRAVITY_STANDARD).plot() ww_z = signal.bandpas...
Python
1
label="1m", step="month", stepmode="backward"), dict(count=6, label="6m", step="month", stepmode="backward"), dict(count=1, label="YTD", ...
Python
1
id: c.id.get(), column_type: c.column_type as i32, }, ) }) .collect(), }, ) ...
Rust
0
ield"] #[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 = "Sets the AES key size\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum AESKEYSZ_A { #[d...
Rust
0
= app.get_window_actual_size(); // TODO: Add other camera types other than perspective. // We can't render anything without a camera. Add one here. // Thankfully we have a method to help that makes it easy! let mut camera_data = CameraData::new_perspective( 70.0, ...
Rust
0
dead0020 >>> print(hexdump(bytearray(range(256)))) 00000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f │····│····│····│····│ 00000010 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f │····│····│····│····│ 00000020 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f │ !"#...
Python
1
plt.title('Normalized skeleton') X_nor = sample_norm x_max = max(X_nor[0::2]) + pad_nor x_min = min(X_nor[0::2]) - pad_nor y_max = max(X_nor[1::2]) + pad_nor y_min = min(X_nor[1::2]) - pad_nor plt.xlim(x_min,x_max) plt.ylim(y_max, y_min) plot_skeleto...
Python
1
n new(t: f32, u: f32, v: f32) -> Self { Self { t, u, v } } } pub fn intersect(ray: &Ray, v0: &Vertex, v1: &Vertex, v2: &Vertex) -> Option<HitInfo> { moller_trumbore::intersect_late_out(ray, v0, v1, v2) } mod moller_trumbore { use super::HitInfo; use crate::scene::{Ray, Vertex}; use crate:...
Rust
0
); let result = ThresholdSigVerifierInternal::combine_threshold_sig_shares( &threshold_sig_data_store, &csp, shares, DkgId::IDkgId(I_DKG_ID), ); assert!(result.unwrap_err().is_malformed_signature()); } #[test] fn should_return_error_...
Rust
0
let mut world = World::new(3, 3); for r in 0..world.rows { for c in 0..world.cols { world.present[[r, c]] = ALIVE; } } let n = world.count_alive_neighbors(1, 1); assert_eq!(n, 8); } #[test] fn test_count_alive_neighbors_diagonal_cent...
Rust
0
res_f1.append(f1) return np.array(res_em), np.array(res_f1) def get_em_f1_oracle(dataset, choices): res_em = [] res_f1 = [] for i, item in enumerate(dataset): q = Question(item['question'], item['answers']) em, f1 = 0, 0 for _, choice in enumerate(choices[i]): ...
Python
1
from __future__ import annotations from typing import List from dataclasses import dataclass from fuzzywuzzy import fuzz @dataclass class PredictedWord: __slots__ = 'confidence', 'text' confidence: int text: str class PredictedFrame: index: int # 0-based index of the frame words: List[Predicted...
Python
1
import os from fastapi import APIRouter, File, HTTPException, UploadFile, status, Depends from sqlalchemy.ext.asyncio import AsyncSession from core.config import UPLOAD_DIR, STATIC_MOUNT_PATH from core.models import db_helper from .crud import item_crud from .schemas import ItemCreate, ItemResponse, ItemUpdate, ItemPos...
Python
1
n, and thus ambiguity in the bins of hashtable. Too large values would lead to no discrimination over the feature vectors and different point pair features would be assigned to the same bin. This argument defaults to the value of RelativeSamplingStep. For noisy scenes, the value can be increased to improve the robustne...
Rust
0
minor } #[inline] pub fn HTTPAPI_GREATER_VERSION(version: HTTPAPI_VERSION, major: USHORT, minor: USHORT) -> bool { version.HttpApiMajorVersion > major || (version.HttpApiMajorVersion == major && version.HttpApiMinorVersion > minor) } #[inline] pub fn HTTPAPI_LESS_VERSION(version: HTTPAPI_VERSION, major: USHORT...
Rust
0