text
string
label_name
string
labels
int64
const GL_CLIP_PLANE1: GLenum = GLenum(0x3001); pub const GL_CLIP_PLANE1_IMG: GLenum = GLenum(0x3001); pub const GL_CLIP_PLANE2: GLenum = GLenum(0x3002); pub const GL_CLIP_PLANE2_IMG: GLenum = GLenum(0x3002); pub const GL_CLIP_PLANE3: GLenum = GLenum(0x3003); pub const GL_CLIP_PLANE3_IMG: GLenum = GLenum(0x3003); ...
Rust
0
(get_message); ///// // app.run("127.0.0.1:8000").unwrap(); ///// } ///// ``` #[allow(missing_debug_implementations)] pub struct Server<State> { router: Arc<Router<State>>, state: Arc<State>, middleware: Arc<Vec<Arc<dyn Middleware<State>>>>, } impl Server<()> { /// Create a new Tide server. ///...
Rust
0
", // "applam-inline", ], false, out_dir.to_string(), egraph); // save(&egraph, "4_propagate", &out_dir); // todo i just put an inline in here apply_everywhere_once(&["applam-inline"], &mut egraph); println!("After inline:\n\t{}\n", egraph_info(&egraph)); ...
Rust
0
[. (0.0)]", "[Hay(0.1)][ (0.1)][un(0.1)][ (0.1)][perro(0.1)][.(0.1)]", "[Tengo/ /un(1.3)][ (1.3)][perro(1.3)][.(1.3)]", ] assert actual == expected assert_sql_result(sql, ["perro", "tengo/ /un", "un/ /gato"], "No new terms") def test_smoke_rendered(spanish, app_context): """ Smoke...
Python
1
tream(cfg.grpc_concurrent_stream) .max_receive_message_len(MAX_GRPC_RECV_MSG_LEN) .max_send_message_len(cmp::max(region_split_size * 4, i32::MAX as usize) as i32) .build_args(); let grpc_server = { let mut sb = ServerBuilder::new(Arc::clone(&env)) ...
Rust
0
} #[test] #[ignore] fn test_get_shop() { let client = crate::client::get_test_client(); let shop = client.get().unwrap(); println!("{:#?}", shop); } } #[cfg(test)] mod unit_tests; pub struct Motor {}<reponame>wilhg/actix-web2<gh_stars>0 use std::marker::PhantomData; use actix_service::{NewTrans...
Rust
0
++", Operator::Postfix, false), // Operator::eft-associative make_entry!("+", Operator::Add, false), make_entry!("-", Operator::Add, false), make_entry!("*", Operator::Multiply, false), make_entry!("/", Operator::Multiply, false), make_entry!("%", Operator::Multiply, false), make_entry!("**"...
Rust
0
import datetime import html import textwrap import bs4 import jikanpy import requests from telegram import ( InlineKeyboardButton, InlineKeyboardMarkup, Message, ParseMode, Update, ) from telegram.ext import CallbackContext, run_async from MukeshRobot import dispatcher,OWNER_ID from MukeshRobot.mo...
Python
1
# -*- coding: utf-8 -*- """ Created on Tue Sep 17 20:00:23 2024 @author: haddadchia """ #%% calculate fall velocity def fallvelocity (di): # function to calculate fall velocity using # input is sediment diameter in meter [m] Rrho=1.65 # R=((rohs/rho)-1),rhos=2650, rho=1000 - no unit nu=0.00...
Python
1
static MS_BIND: c_ulong = 4096; /* Bind directory at different place. */ static MS_MOVE: c_ulong = 8192; static MS_REC: c_ulong = 16384; static MS_SILENT: c_ulong = 32768; static MS_POSIXACL: c_ulong = 1 << 16; /* VFS does not apply the umask. */ static MS_UNBINDABLE: c_ulong = 1 << 17; /* ...
Rust
0
ule l'erreur en rotation vectorielle (axis-angle) entre une consigne quaternion q_ref et une mesure quaternion q_mes. Args: q_ref (numpy.array): Quaternion de consigne [x, y, z, w] q_mes (numpy.array): Quaternion mesuré [x, y, z, w] Returns: ...
Python
1
pub type FCCOB5 = crate::Reg<u8, _FCCOB5>; #[allow(missing_docs)] #[doc(hidden)] pub struct _FCCOB5; #[doc = "`read()` method returns [fccob5::R](fccob5::R) reader structure"] impl crate::Readable for FCCOB5 {} #[doc = "`write(|w| ..)` method takes [fccob5::W](fccob5::W) writer structure"] impl crate::Writable for FCCO...
Rust
0
#[doc = "Bit 1 - SSI Synchronous Serial Port Enable"] #[inline(always)] pub fn ssi_cr1_sse(&self) -> SSI_CR1_SSER { let bits = ((self.bits >> 1) & 1) != 0; SSI_CR1_SSER { bits } } #[doc = "Bit 2 - SSI Master/Slave Select"] #[inline(always)] pub fn ssi_cr1_ms(&self) -> SSI_CR...
Rust
0
from django.shortcuts import render, redirect, get_object_or_404 from django.views.decorators.http import require_POST from shop.models import Product from .cart import Cart from .forms import CartAddProductForm @require_POST def cart_add(request, product_id): cart = Cart(request) product = get_object_or_404(...
Python
1
from app.exceptions.exceptions_classes import EntityNotFoundError
Python
1
import requests import os usd_file_name = "DefaultOfficialInstance.usd" usd_absolute_path = os.path.abspath(usd_file_name) print(usd_absolute_path) url = 'http://127.0.0.1:10246/A2F/USD/Load' headers = { 'accept': 'application/json', 'Content-Type': 'application/json' } data = { 'file_name': usd_absolute_...
Python
1
Err(as_err) => Err(backoff::Error::Permanent(Err(as_err))), } } RetryCheck::Retry => { match x.error_for_status().with_context(|| { format!("request attempt {} failed", attem...
Rust
0
InitAudioBackend error: {}", soundio::Error::InitAudioBackend ); let mut ctx = soundio::Context::new(); ctx.set_app_name("Sine Wave"); println!("Available backends: {:?}", ctx.available_backends()); ctx.connect()?; println!("Current backend: {:?}", ctx.current_backend()); // We...
Rust
0
art_time, end_time) print(f'Epoch: {epoch + 1:02} | Epoch Time: {epoch_mins}m {epoch_secs}s') print(f'\tTrain Loss: {train_loss:.3f} | Train Acc @1: {train_acc_1 * 100:6.2f}% | ' \ f'Train Acc @5: {train_acc_5 * 100:6.2f}%') print(f'\tValid Loss: {valid_loss:.3f} |...
Python
1
d) if card_image: card_x, card_y = card_positions[j] # 若為目前出牌玩家且該牌被選中,則稍作偏移 if i == player.current_player and card in player.selected_cards: if pos == "bottom": card_y -= 20 elif pos == "top": ...
Python
1
import hetu as ht import hetu.layers as htl from .base import CTRModel_Head class WDL_Head(CTRModel_Head): def __init__( self, embed_dim=16, sparse_slot=26, dense_slot=13, ) -> None: super().__init__(embed_dim, sparse_slot, dense_slot) input_dim = embed_dim * sp...
Python
1
print("My name is Kush") greeting ="Hello" name = "John" location = "Juja" pet = "cat" #string age = 80 #integer print(greeting) print (name) print (location) #this is a comment height =2.3 print (height) #datatypes inc strings,intergers,floats,dictionaries #variables are data containers...can contain any data type #p...
Python
1
x7fb\x82\ \x91\x91\x11\x1a\xf5:W/\xbf\xc1\xab\xef\xdf\xe4\xd9\x0b\ 7xsz\x89\xff\xecSOP\xea* I<\x89\ \xd0\xc9L\x9b\xef\xafg'\xa4E\xf8\x01\x89\xaf\xd0w\ \x86$JK\x0a\xc5<A\x10a\xb3$,\xd1\x09%\ \x11\x9d$\xb2|!Ow\xb5J\xa5\xa7\x07plo\ m\xb003M\xad\xdeN\x88\xb3d\xb8\xef\xd9\xe1Y\ [\xc0\xb6Cz\x84\xe8\x10\xa2J\x81\xe6\xd3\x8f?\...
Python
1
end(DayPlan(day=day.day, blocks=new_blocks)) prelim = PlanDTO( objective=prev.objective, level=prev.level, frequency=prev.frequency, session_minutes=prev.session_minutes, days=progressed_days, meta={**(prev.meta or {})}, ) # Actualiza meta con la semana ...
Python
1
#!/usr/bin/env python3 ##### # findsym2.py # Translated from findsym.pl # # This script scans through multiple C++ source files to find all occurrences # of the SYM(symbol_name) macro. It collects these unique symbol names and # generates a header file containing declarations for these symbols. The purpose # is to ensu...
Python
1
self.w } } impl R { #[doc = "Bits 0:31 - Bits 63:32 of the imperfect filter hash table for receive filtering."] #[inline(always)] pub fn hfh(&self) -> HFH_R { HFH_R::new((self.bits & 0xffff_ffff) as u32) } } impl W { #[doc = "Bits 0:31 - Bits 63:32 of the imperfect filter hash table for ...
Rust
0
Some(len) => { let (result, rest) = self.str.split_at(len); self.str = rest; Some(StringElement::Characters(result)) } } } } } } } fn cm...
Rust
0
e([*a, *b, c]) }) } fn extrude_triangle_to_convex_quad(triangle: &Triangle2d<f64>, t1: f64, t3: f64) -> Quad2d<f64> { // In order to generate a convex quad, we first generate one triangle, // then we "extrude" a vertex from one of the sides of the triangle, in such a way // that the vertex is contained...
Rust
0
InvalidShutdownScriptZ { CResult_ShutdownScriptInvalidShutdownScriptZ { contents: CResult_ShutdownScriptInvalidShutdownScriptZPtr { err: Box::into_raw(Box::new(e)), }, result_ok: false, } } #[no_mangle] /// Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ. pub extern "C" fn CResul...
Rust
0
# Introduction # Day 1 - 30DaysOfPython Challenge print(3 + 2) # addition(+) print(3 - 2) # subtraction(-) print(3 * 2) # multiplication(*) print(3 / 2) # division(/) print(3 ** 2) # exponential(**) print(3 % 2) # modulus(%) print(3 // 2) # Floor division operator(//) # Checking data types print(type(10)...
Python
1
from django.urls import path, include from . import views from .views import login_view, logout_view urlpatterns = [ path('', views.home, name='home'), # URLs for Company path('company/', views.company_list_view, name='company-list'), path('company/<int:pk>/', views.company_detail_view, name='company-...
Python
1
load_rules() # 确保规则是最新的 return len(self._rules) def get_rules(self) -> List[Dict[str, Any]]: """获取当前的规则列表(只读)""" self.load_rules() # 确保规则是最新的 # 返回副本,避免外部修改 return [rule.copy() for rule in self._rules if 'regex' not in rule] def force_reload(self): """强...
Python
1
import json import boto3 import time with open('generator_llms/aws_access.key', 'r') as f: AWS_ACCESS_KEY_ID = f.read().strip() with open('generator_llms/claude_api_aws.key', 'r') as f: AWS_SECRET_ACCESS_KEY = f.read().strip() AWS_DEFAULT_REGION = "us-west-2" boto3_client = boto3.client("bedrock-runtime", ...
Python
1
#coding=utf-8 import numpy as np import cv2 def undistortPoints(points, intrinsic, distortion): n = points.shape[0] cc_x = intrinsic[0,2] cc_y = intrinsic[1,2] fc_x = intrinsic[0,0] fc_y = intrinsic[1,1] k1 = distortion[0] k2 = distortion[1] k3 = distortion[4] p1 = distortion[2] ...
Python
1
let command = values[0].try_as_str().unwrap(); for v in &values { if let Value::EcmaArray { entries } = v { log::info!("[peer={}] C->S, [{}] part Array: ", ctx.peer_addr, command); for item in entries { lo...
Rust
0
'resnet34_blcok': [3, 4, 6, 3], } if cfg['model_name'] == 'resnet18': cfg['max_module_num'] = 9 elif cfg['model_name'] == 'resnet34': cfg['max_module_num'] = 17 else: cfg['max_module_num'] = 9 # cfg['resnet'] = {'hidden_size': [16, 16, 32, 64]...
Python
1
-> Result<Array_u64_2d, Error> { let u64s = frs_to_u64s(frs); let d2 = 4; let d1 = u64s.len() as i64 / d2; let dim = [d1, d2]; Array_u64_2d::from_vec(*ctx, u64s.as_slice(), &dim) .map_err(|e| Error::Other(format!("error converting Frs: {:?}", e).to_string())) } fn array_u64_3d_from_frs_2...
Rust
0
from PyQt5.QtWidgets import (QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, QListWidget, QLabel, QPushButton) from PyQt5.QtGui import QImage, QPixmap from PyQt5.QtCore import Qt import cv2 class BoxListWindow(QMainWindow): def __init__(self, storage_service): super().__init__() ...
Python
1
from typing import Dict import pandas as pd from helpers.data_parsing.table_import import consolidated_2016, consolidated_2021 incomes = ["very low income", "low income", "moderate income", "median income", "high income", "total by income"] def get_table5(geo_code: int) -> pd.DataFrame: df = pd.DataFrame( ...
Python
1
cute let mut sim_chip = SimChip::new(prog_name, &args); sim_chip.r#loop(); // print some information about the simulation println!(""); for _ in 0..64 { print!("-"); } println!(""); println!("Simulation Stats for file: {}", prog_name); } e...
Rust
0
clearBtn.clicked.connect(self.clearItems) btnLayout.addWidget(clearBtn) return btnLayout for itemType in CI.ADD_ITEM_TYPES: self.addItemBtn(btnLayout, itemType) solveBtn = MainBtn('求解') solveBtn.clicked.connect(self.solve) btnLayout.addWidget(solv...
Python
1
# Examples of functions that return values def square(n): return n * n # Store result from square in a variable result = square(4) print(result) # Send the result from square immediately to another function print(square(5)) # Use the result returned form square in a conditional expression if square(3) < 15: ...
Python
1
(), Some(nft_index))) } pub fn owner_of(nft_index: T::NFTIndex) -> Option<T::AccountId> { Self::index_to_owner(nft_index) } fn random_value(sender: &T::AccountId) -> NFTokenId { let payload = ( <system::Module<T>>::random_seed(), sender.clone(), <sys...
Rust
0
""" URL configuration for example project. The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/5.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home...
Python
1
let all_modules = state.get_all_modules()?; let code_cache = Modules::new(&all_modules); let dep_graph = code_cache.compute_dependency_graph(); if verbose { println!( "Inferring read/write set for {:?} module(s)", all_modules.len(), ) } let modules = dep_g...
Rust
0
self, cookie: /*Ignored*/&mut soup::Cookie, cancellable: Option<&impl IsA<gio::Cancellable>>, callback: P); // //#[cfg(any(feature = "v2_20", feature = "dox"))] //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_20")))] //fn add_cookie_future(&self, cookie: /*Ignored*/&mut soup::Cookie) -> Pin<Box_<dy...
Rust
0
); //! hasher.update(input_b); //! hasher.finalize(&mut output); //! # } //! ``` //! //! # Credits //! //! - [`coruus/keccak-tiny`] for C implementation of keccak function //! - [`@quininer`] for `no-std` support and rust implementation [`SP800-185`] //! - [`mimoo/GoKangarooTwelve`] for GO implementation of `KangarooTw...
Rust
0
6 }; println!("The value of number is: {}, if/else conditio", number); let mut another_number = 3; while another_number != 0 { println!("{}!", another_number); another_number -= 1; } println!("LIFTOFF!!!, while loop"); //Exists loop, while, and for! //While VS ...
Rust
0
push(triangle.z.0 as u32); }); } let mut part: ParsedModelPart = index_group.into(); let material = group.material.and_then(|m| match m { ObjMaterial::Mtl(mtl) => Some(mtl), ObjMaterial::Ref(name) => material_libs ....
Rust
0
#!/usr/bin/env python3 # Copyright (C) 2020 The Android Open Source Project # # 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 requ...
Python
1
elif not found_peak and temp_mag > min_mag: # Check if we still need to add the last point peak_loc[c_ind] = temp_loc peak_mag[c_ind] = temp_mag c_ind += 1 # Create output peak_inds = ind[peak_loc[:c_ind]] peak_mags = peak_mag[:c_ind] else:...
Python
1
t<PipeWatcher, UvError> { let pipe = PipeWatcher::new(io, false); match unsafe { uvll::uv_pipe_open(pipe.handle(), file) } { 0 => Ok(pipe), n => Err(UvError(n)) } } pub fn connect(io: &mut UvIoFactory, name: &CString, timeout: Option<u64>) -> Result<P...
Rust
0
def conv_attn_to_linear(checkpoint): keys = list(checkpoint.keys()) attn_keys = ['to_q.weight', 'to_k.weight', 'to_v.weight'] proj_key = 'to_out.0.weight' for key in keys: if '.'.join(key.split('.')[-2:]) in attn_keys or '.'.join(key.split ('.')[-3:]) == proj_key: if chec...
Python
1
Framebuffer<Flat, Dim2, (), ()>, camera: &Camera); /* fn draw(&self, device: &mut GLFWDevice, render_target: &Framebuffer<Flat, Dim2, (), ()>, shader: &Program<Self::Vertex, (), Self::Uniform>, camera: &Camera); */ } use geom::GPSBounds; use struct...
Rust
0
5, 5]; test.filename = vec!['f', 'i', 'l', 'e']; test.filename_len = test.filename.len() as u16; test.filesize = 12345; test.chmod = 0o755; test.features |= TeleportFeatures::Overwrite as u32; let mut t = TeleportInit::new(TeleportFeatures::NewFile); t.deseriali...
Rust
0
dyn Future<Item=String, Error=IndyError>> { let (receiver, command_handle, cb) = ClosureHandler::cb_ec_string(); let err = _prover_create_proof(command_handle, wallet_handle, proof_req_json, requested_credentials_json, master_secret_id, schemas_json, credential_defs_json, rev_states_json, cb); ResultHandl...
Rust
0
use crate::utils::CounterObserver; use gtk::WindowBuilder; #[test] fn test_insert_overwrite_renamer_callback() { gtk::init().unwrap(); let counter_observer = Rc::new(CounterObserver::new()); let remove_characters_renamer = RemoveCharactersRenamer::new(); let remove_from...
Rust
0
one() /> }); html! { <div class="cascade"> { for children } </div> } } } <reponame>MoAlyousef/erco-fltk-examples use fltk::{ app, browser::{Browser, BrowserType}, prelude::{BrowserExt, GroupExt, WidgetBase, WidgetExt}, window::Window, }; fn ma...
Rust
0
import bpy from bpy.props import IntProperty, FloatVectorProperty, BoolProperty, FloatProperty from bpy.types import Node from mathutils import Vector from .._base.node_base import ScNode from .._base.node_operator import ScEditOperatorNode class ScSpin(Node, ScEditOperatorNode): bl_idname = "ScSpin" bl_label...
Python
1
import pandas as pd data = 'C:\\Users\\anddr\\Downloads\\planilha_modificada.xlsx' path_xport = 'C:/Users/anddr/Downloads/planilha_formatada.xlsx' path_json = 'C:/Users/anddr/Downloads/planilha_formatada.json' def limpa_organiza(): planilha = pd.read_excel(data, header=[0, 2], skiprows=12) planilha.drop(in...
Python
1
D: &str = "\u{1B}[0m"; #[derive(Debug)] pub struct EnvConf { pub color_seq_start: String, pub color_seq_end: String, } impl EnvConf { pub fn new() -> Self { // let a_color_seq_start = match env::var("AKI_MLINE_COLOR_SEQ_ST") { Ok(v) => v, Err(_) => String::from(COLOR...
Rust
0
# coding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals from typing import List import attr from feishu.dt_code import SimpleUser from feishu.dt_help import to_json_decorator @to_json_decorator @attr.s class EventMessageMergeForward(object): root_id = attr.ib(type=st...
Python
1
""" Fix for rgthree Reroute node - creates a Python implementation for the frontend-only node. This file is injected into containers to provide backend support for rgthree reroute nodes. """ RGTHREE_REROUTE_PY = ''' """Reroute node implementation for rgthree - provides backend support for frontend-only node.""" class...
Python
1
def mess_word(word): # 对不同长度的单词进行处理 if len(word) <= 3: return word elif 3 < len(word) <= 5: return word[0] + word[2] + word[1] + word[3:] elif 5 < len(word) < 8: return word[0:2] + word[3] + word[2] + word[4:] elif len(word) >= 8: return word[0:2] + word[3] + word[2] ...
Python
1
:binary_tree::Tree; #[test] fn should_be_a_subtree() { let mut tree = Tree::new(); tree.insert(2); tree.insert(1); tree.insert(4); tree.insert(3); tree.insert(5); let mut sub_tree = Tree::new(); sub_tree.insert(4); sub_tree.insert(3); ...
Rust
0
rgs: price_data: DataFrame containing price data news_data: List of news items Returns: Tuple of (is_valid, dict_of_issues_by_type) """ if self.debug: print("\n=== Starting Complete Data Validation ===") all_issues = {...
Python
1
el is able to classify ham messages with high accuracy, but may not be as accurate for spam messages.") st.write("6. This model is for educational purposes only and should not be used as a definitive spam detection system.") st.write("7. Please use the model as a reference and exercise caution when classifying ...
Python
1
(73) ibnho (16) vsbfmt (25) zwake (64) swpvgrn (36) vlsyqg (93) -> lrauqzk, gdhekde zawbrvg (10) wqgczyl (200) -> ilgue, bwdfntd, zlgst qhyan (391) -> obxyz, ahutsc vrppl (78) rqebmc (176) -> snnxhgn, anucwoj hhpib (98) iqdjcwm (57) xpmpulq (66) afckhxn (16) uynmvcu (304) -> imxraee, rmfwij cybhcko (256) -> pgfomf, dac...
Rust
0
mit. This will have no effect if it is greater than the total /// router capacity (as configured by `ENV_OUTBOUND_ROUTER_CAPACITY`). pub const ENV_DESTINATION_CLIENT_CONCURRENCY_LIMIT: &str = "LINKERD2_PROXY_DESTINATION_CLIENT_CONCURRENCY_LIMIT"; // These *disable* our protocol detection for connections whose SO_O...
Rust
0
from __future__ import annotations from dataclasses import dataclass from typing import Sequence, Tuple from typing_extensions import override from metricflow_semantics.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath from metricflow_semantics.query.issues.issues_base import ( MetricFlowQ...
Python
1
self.samples[index] as f64 * self.multiplier } } use crate::{Error, mock::*}; use frame_support::{assert_ok, assert_noop}; use super::*; #[test] fn create_claim_succeeds() { new_test_ext().execute_with(|| { let claim = vec![0, 1]; assert_ok!(PoeModule::create_claim(Origin::signed(1), claim.clone())...
Rust
0
e(output_file) if output_dir and not os.path.exists(output_dir): os.makedirs(output_dir, exist_ok=True); logging.info(f"出力ディレクトリ作成: {output_dir}") with open(output_file, 'w', newline='', encoding='utf-8-sig') as f: fieldnames = ['title', 'image_url', 'price', 'product_url']; writ...
Python
1
."); false } }; if !shutdown_requested_succesfully || !shutdown_succesfully { Err(ShutdownError { shutdown_succesfully, shutdown_requested_succesfully, }) } else { Ok(()) } } /// Attem...
Rust
0
(Vec::from(cur_text[..result.end()].as_bytes())); pos = Some(i); }, _ => {} } } if tkn_name.is_some() { let tkn_name = tkn_name.unwrap(); let tkn_value = tkn_value.unwrap(); let mut tkn_name_changed: Option<usize> = None; ...
Rust
0
captures.len() == 4); call_graph_test_config = serde_json::from_str(&captures[2].to_owned()) .expect("Failed to deserialize test config"); } else { unrecoverable!("Could not find a call graph config in test file"); } let datalog_path = match call_graph_test_config.datalog_config....
Rust
0
layer_results['dissimilarity_matrix'], layer_results['labels'], layer_results['superordinates'], layer_name, base_model_name, dissimilarity_metric, output_dir ) # Plot superordinate dissimilarity analysis ...
Python
1
in a [blocking poll] call of the first /// of the provided `event_sources` for readiness events. This call will block /// the current thread until a readiness event is ready or the timeout has /// elapsed. After the blocking poll the other event sources will be [polled] /// for readiness events, without blocking the t...
Rust
0
i = value![1]; let s = value!("String"); let l = value![[1, 2, 3]]; let d = value![["a" => 1, "b" => 2, "c" => 3]]; ``` */ #[macro_export] macro_rules! value { ( [ $($key:literal => $value:tt),* ] ) => { { let mut dict = Dict::new(); $( dict.insert($key.to_string(), value!($value).i...
Rust
0
::AArch64(AArch64InlineAsmRegClass::vreg_low16), Abi::Vector { element, count }, ) if layout.size.bytes() == 8 => { let elem_ty = llvm_asm_scalar_type(bx.cx, element); let vec_ty = bx.cx.type_vector(elem_ty, count); let indices: Vec<_> = (0..count * 2).map(|x| bx....
Rust
0
_bank(num_bones: int, poses_desc: list, transforms: list): P = len(poses_desc) q = np.tile(_q_identity(num_bones), (P, 1, 1)) t = np.zeros((P, num_bones, 3), dtype=np.float32) s = np.tile(_s_identity(num_bones), (P, 1, 1)) for p_idx, pose in enumerate(poses_desc): sta...
Python
1
) { if s_bytes.get(i).is_none() || s_bytes[i] != byte { owned.extend(&s_bytes[0..i]); owned.extend(other); break; } } let other_len = index.next().unwrap(); if !owned.is_empty() { Cow::Owned(String::from_utf8(own...
Rust
0
annot cast value to number") } }}; (str $val:expr) => {{ let bind = $val; match bind.get_type() { crate::interpreter::value::ValueType::Str => bind.to_str(SourcePos::new(0, 0)).unwrap(), _ => panic!("Cannot cast value to string") } }}; (vec $val:expr) => {{ let bind = $val; match bind.get_type() {...
Rust
0
<Webhook>> { let response = request!( Route::ChannelsIdWebhooks(channel_id), get, "/channels/{}/webhooks", channel_id ); serde_json::from_reader::<HyperResponse, Vec<Webhook>>(response) .map_err(From::from) } /// Gets channel information. pub fn get_channel(channel_...
Rust
0
a-seperated list of sensitivities for detecting keywords. Each value should be a number within [0, 1]. A higher sensitivity results in fewer misses at the cost of increasing the false alarm rate. If not set 0.5 will be used.") .takes_value(true) ) .get_matches(); let input_audio_path = ...
Rust
0
::Error(_e)) | Err(Err::Failure(_e)) => Ok((Span::new(""), Span::new(""))), Err(Err::Incomplete(_)) => Ok((Span::new(""), Span::new(""))), } } fn all_comments<'a, E: ParseError<Span<'a>>>(s: Span<'a>) -> IResult<Span<'a>, Span<'a>, E> { alt((comment_single_line, comment_delimited))(s) } pub fn comment...
Rust
0
import torch import torch.nn as nn import torch.nn.init as init import random import numpy as np def logsumexp(x, dim=None, keepdim=False): if dim is None: x, dim = x.view(-1), 0 xm, _ = torch.max(x, dim, keepdim=True) x = torch.where( (xm == float('inf')) | (xm == float('-inf')), x...
Python
1
r.add_option("-g", dest="gtf", help="genome annotation" ) parser.add_option("-f", dest="fasta", help="genome fasta" ) parser.add_option("-o", dest="outbase", default="plots", help="output directory [%default]" ) parser.add_option("-s", dest="...
Python
1
str = "type"; const PARAM_TIME_TO_LIVE: &'static str = "time-to-live"; const SUBCOMMAND_ADD_ZONE: &'static str = "add-zone"; const SUBCOMMAND_REMOVE_ZONE: &'static str = "remove-zone"; const SUBCOMMAND_LIST_ZONES: &'static str = "list-zones"; const SUBCOMMAND_QUERY_ZONE: &'static str = "query-zone"; const SUBCOMMAND_A...
Rust
0
; if config_dir.join(config::CONFIG_BASENAME).exists() && !matches.is_present("force") { return Err(anyhow!( "refusing to overwrite your current config without --force" )); } config::initialize(&config_dir, !matches.is_present("insecure-not-wrapped")) } /// Implements the `kbs...
Rust
0
IssueLabelDetail = ctx .env .from_js_value(array.get_element_unchecked::<JsUnknown>(i)?)?; if i != 0 { plain.push_str(", "); html.push_str(" "); } plain.push_str(&label.name); // HTML html.push_str("<span"); match label.c...
Rust
0
k_bank( bank::PPU_1K::Ox2C00, 5 * 1024 ); mapper.memory[ 1 * 1024 + 0 ] = 1; mapper.memory[ 1 * 1024 + 1 ] = 2; mapper.memory[ 2 * 1024 + 0 ] = 3; mapper.memory[ 2 * 1024 + 1 ] = 4; mapper.memory[ 3 * 1024 + 0 ] = 5; mapper.memory[ 3 * 1024 + 1 ] = 6; mapper.memory[ 4 * 1024 + 0 ] = 7; ...
Rust
0
ANSI_ESCAPE_BACKGROUND_COLOR: &'static str = "48"; pub fn to_escape_code(self) -> Cow<'static, str> { match self.0 { Color::Black => "40".into(), Color::Red => "41".into(), Color::Green ...
Rust
0
{ trees += incrementer; }; counter += x as u16; }; trees as u128 } fn main() { let res = readlines(); println!("Step 3,1: {}",tree_counter(&res,3,1)); let fres: u128 = tree_counter(&res,3,1) * tree_counter(&res,1,1) * tree_counter(&res,5,1) * tree_counter(&res,7,1) * tree_counter(&res,1,2); ...
Rust
0
TupleCombinator; /// let left = (Some("foo"), Some(123)); /// assert_eq!(left.transpose(), Some(("foo", 123))); /// ``` fn transpose(self) -> Option<Self::Tuple>; /// See [`Option::map`]. /// /// # Examples /// /// ``` /// # use tuple_combinator::TupleCombinator; /// let tup...
Rust
0
the internal representation exceeds the maximum value for G2Poly. /// /// # Example /// ```rust /// # use g2poly::G2Poly; /// /// let a = G2Poly(0x40_00_00_00_00_00_00_00) * G2Poly(2); /// assert_eq!(G2Poly(0x80_00_00_00_00_00_00_00), a.to_poly()); /// /// // Next line would panics!...
Rust
0
t") with open(full_path, mode="r+", encoding="utf-8", errors="strict") as f: txt = f.read() if "sequence_batching {" in txt: txt, post_match = txt.split("sequence_batching {") if sequence_batching_str != "": txt += "sequence_batching {\n" txt +...
Python
1
", stapel); println!("{}", str); let json_str = serde_json::to_string_pretty(&stapel).unwrap(); println!("{}", json_str); }<reponame>bofh69/crater use errors::*; use std::path::Path; use winapi::um::handleapi::CloseHandle; use winapi::um::processthreadsapi::{OpenProcess, TerminateProcess}; use winapi::um::w...
Rust
0
if use_checkpoint and checkpoint_blk_ids is None: checkpoint_blk_ids = [ blk_id for blk_id in range(len(self.blocks)) if blk_id % checkpoint_every_n == 0 ] if checkpoint_blk_ids: checkpoint_blk_ids = set(checkpoint_blk_...
Python
1
= argparse.ArgumentParser( prog=PROG_NAME, description="Utilities for Pybricks developers.", epilog="Run `%(prog)s <tool> --help` for tool-specific arguments.", ) parser.add_argument( "-v", "--version", action="version", version=f"{MODULE_NAME} v{MODULE_VERSION}" ) parse...
Python
1
import torch.nn as nn from .common import ResBlock, default_conv def encoder(in_channels, n_feats): """RGB / IR feature encoder """ # in_channels == 1 or 3 or 4 or .... # After 1st conv, B x n_feats x H x W # After 2nd conv, B x 2n_feats x H/2 x W/2 # After 3rd conv, B x 3n_feats x H/4 x W/4 ...
Python
1