text
string
label_name
string
labels
int64
}); } } } Err(e) => { return Json(DeleteResult { success: false, e }); } } } Err(e) => { return Json(DeleteResult { success: fa...
Rust
0
lse) if item.has_rotoffs: layout.prop(item, 'offset', text='') def location(): row.prop(item, 'has_loccopy', icon='CON_LOCLIKE', icon_only=True) layout.label(text=item.selected_owner, translate=False) if item.has_loccopy: layout.ro...
Python
1
from sqlalchemy import create_engine, Column, Integer, String, Text, DateTime, Boolean, ForeignKey from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship from datetime import datetime Base = declarative_base() class Log(Base): __tablename__ = 'api_log' id = Column(Int...
Python
1
sdp_config.cpu_offload else None, ) fully_shard( self, mesh=self.fsdp_mesh if self.hsdp_mesh is None else self.hsdp_mesh, mp_policy=mp_policy, reshard_after_forward=self.fsdp_config.reshard_after_forward, offload_policy=CPUOffloadPolicy() if s...
Python
1
Instruction::decode_by(162), Instruction::decode_by(142), Instruction::decode_by(162), ]); let asm = cpu.disassemble(0x8000, 7); assert_eq!(old_pc, Ok(0x1000)); assert_eq!(asm, Some(expected_asm)); } #[test] fn test_handle_irq_correct() { ...
Rust
0
d103: std::string::String, #[prost(int32, tag = "29")] pub field29: i32, #[prost(bool, tag = "30")] pub field30: bool, #[prost(int32, tag = "60")] pub field60: i32, #[prost(int32, tag = "271")] pub field271: i32, #[prost(int32, tag = "272")] pub field272: i32, #[prost(int32, ...
Rust
0
class Solution: def maxDepthAfterSplit(self, seq: str) -> List[int]: ans = [] depth = 1 # Put all odd-depth parentheses in one group and even-depth parentheses in the other group. for c in seq: if c == '(': depth += 1 ans.append(depth % 2) else: ans.append(depth % ...
Python
1
# -*- coding: utf-8 -*- """ 实现股票池,条件是0 < PE <30, 按照PE正序排列,最多取100只票; 再平衡周期为7个交易日 主要的方法包括: stock_pool:找到两个日期之间所有出的票 find_out_stocks:找到当前被调出的股票 evaluate_stock_pool:对股票池的性能做初步验证,确保股票池能够带来Alpha """ from pymongo import ASCENDING import pandas as pd import matplotlib.pyplot as plt from database import DB_CONN from stock_ut...
Python
1
raining = inputs[5].toIValue() assert isinstance(training, bool), 'Signature of aten::batch_norm has changed!' if training: return norm_flop_counter(1)(inputs, outputs) # pyre-ignore has_affine = get_shape(inputs[1]) is not None input_shape = prod(get_shape(inputs[0])) # ...
Python
1
#[test] fn test_get_vec_of_fold_for_file_sample2_code() { let code_text = unwrap!(fs::read_to_string("samples/sample2_not_nested.txt")); let vec_of_fold = get_vec_of_fold(&code_text); let output = print_vec(vec_of_fold, &code_text); let result = " 220 260 : // region: 1 /...
Rust
0
#!/usr/bin/python # -*- coding: utf-8 -*- """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: contact@golismero-project.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General P...
Python
1
import os import pandas as pd from tqdm import tqdm import datasets from huggingface_hub import upload_file # --- Hugging Face Upload Settings: Repository Name --- OUTPUT_DATASET_ID = "neko-llm/HLE_SFT_PHYBench" def main(): """ HLE_SFT_PHYBench Dataset のデータクリーニングを行う Main Script。 NOTE: 関数の機能: 1. ...
Python
1
Deletes all repetition of the `rule` from the table/chain. /// Returns `true` if the rules are deleted. pub fn delete_all(&self, table: &str, chain: &str, rule: &str) -> IPTResult<bool> { while self.exists(table, chain, rule)? { self.delete(table, chain, rule)?; } Ok(true) ...
Rust
0
y_http::operation::BuildError::MissingField { field: "global_network_id", details: "cannot be empty or unset", }, )?; let global_network_id = aws_smithy_http::label::fmt_string(input_87, false); if global...
Rust
0
np.testing.assert_allclose(metrics["policy_log_prob"], -1.5, rtol=1e-5) np.testing.assert_allclose(metrics["learned_baseline"], 0.3, rtol=1e-5) np.testing.assert_allclose( metrics["baseline_penalty"], 0.001 * (0.75 * (0.7 * 0.7) + 0.25 * (0.3 * 0.3)), rtol=1e-5) np.testing.assert_all...
Python
1
headers = { 'Accept': 'application/json, text/plain, */*', 'Accept-Language': 'ru-RU,ru;q=0.9', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Origin': 'https://mini-app.tomarket.ai', 'Pragma': 'no-cache', 'Referer': 'https://mini-app.tomarket.ai/', 'Sec-Fetch-Dest': 'e...
Python
1
assert!(dim <= vec.len()); DVec { at: Vec::from_slice(vec.slice_to(dim)) } } } impl<N> DVec<N> { /// Builds a vector filled with the result of a function. #[inline(always)] pub fn from_fn(dim: uint, f: |uint| -> N) -> DVec<N> { DVec { at: Vec::from_fn(dim, |i|...
Rust
0
matches!(&self.gpu_index_buffer, GpuBuffer::InFlight(_)) } } use num_derive::FromPrimitive; use solana_program::{ decode_error::DecodeError, msg, program_error::{PrintProgramError, ProgramError}, }; use thiserror::Error; #[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)] pub enum CounterError...
Rust
0
![sc.reliability[0]; new_val]; sc.user_reputation_threshold = vec![sc.user_reputation_threshold[0]; new_val]; sc.user_default_reputation = vec![sc.user_default_reputation[0]; new_val]; sc.user_default_reputation = vec![sc.user_default_reputation[0]; new_val]; ...
Rust
0
name_pt" caption_set="pt" /> <Property name="Country ES" column="country_name_es" caption_set="es" /> </Level> </Hierarchy> </SharedDimension> <Cube name="Sales"> <Table name="tesseract_webshop_sales" /> <DimensionUsage foreign_key="country_id" name="Geography...
Rust
0
= unsafe { lib.get::<FnVersion>(b"genet_abi_version")? }; // In the initial development, minor version changes may break ABI. fn canonical(ver: u64) -> u64 { if ver >> 32 == 0 { ver } else { ver & (0xffff_ffff << 32) ...
Rust
0
class Solution: def waysToSplit(self, nums: List[int]) -> int: kMod = 1_000_000_007 n = len(nums) ans = 0 prefix = list(itertools.accumulate(nums)) # Find the first index j s.t. # Mid = prefix[j] - prefix[i] >= left = prefix[i] def firstGreaterEqual(i: int) -> int: l = i + 1 r...
Python
1
and_flush()?.wait(None)?; let sampler = Sampler::new(device, SamplerCreateInfo::simple_repeat_linear()).unwrap(); fonts.tex_id = TextureId::from(usize::MAX); Ok((ImageView::new_default(image)?, sampler)) } fn lookup_texture(&self, texture_id: TextureId) -> Result<&Texture, RendererErr...
Rust
0
3:, -3:, -1] assert frames[0].shape == (64, 64, 3) expected_slice = np.array([158.0, 160.0, 153.0, 125.0, 100.0, 121.0, 111.0, 93.0, 113.0]) assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2 def test_attention_slicing_forward_pass(self): self._test_attention_slici...
Python
1
E>, env_ptr: u32, msg_ptr: u32, ) -> u32 where E: ToString, { let res = _do_ibc_channel_open(contract_fn, env_ptr as *mut Region, msg_ptr as *mut Region); let v = to_vec(&res).unwrap(); release_buffer(v) as u32 } fn _do_ibc_channel_open<E>( contract_fn: &dyn Fn(DepsMut, Env, IbcChannel) ->...
Rust
0
) << 1), (((3 << 3) + 1) << 2) - 1, (((7 << 2) - 1) << 2), ((((3 << 2) + 1)) << 3) + 1, (7 << 4), (3 << 5) + (1 << 1), (7 << 4) - 1, (3 << 5) + 1, (7 << 4) + (1 << 1), (((3 << 3) + 1) << 2), (5 << 4) + (1 << 1), (((3 << 3) + 1) << 2) + 1, (3 << 5) + 1, (((3 << 3) + 1) << 2), (((1 << 4) + 1) << 1), (((3 << 3) - 1) << 2)...
Python
1
import _plotly_utils.basevalidators class TicktextsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="ticktextsrc", parent_name="parcats.dimension", **kwargs ): super(TicktextsrcValidator, self).__init__( plotly_name=plotly_name, pa...
Python
1
mages. Returns: feature_maps: a list of tensors where the ith tensor has shape [batch, height_i, width_i, depth_i] """ preprocessed_inputs = shape_utils.check_min_image_dim( 33, preprocessed_inputs) with tf.variable_scope('MobilenetV1', reuse=self._reus...
Python
1
.map(|(i, u)| { format!("{}. <@!{}> ({})", i + 1, u.user_id, u.xp) }) .collect::<Vec<String>>(); msg.channel_id .send_message(&ctx.http, |x| { x.allowed_mentions(|am| am.empty_parse()) ...
Rust
0
Configuration('point1_z', default='1.0 '), 'point2_x': LaunchConfiguration('point2_x', default='15.0 '), 'point2_y': LaunchConfiguration('point2_y', default='0.0 '), 'point2_z': LaunchConfiguration('point2_z', default='1.0 '), ...
Python
1
""" MAIC 관리자 패널 - 인덱싱 패널 관리자 모드에서 인덱싱 관련 기능을 제공합니다. """ from typing import Any, Dict, List, Optional class AdminIndexingPanel: """관리자 인덱싱 패널""" def __init__(self): self._st = None self._initialize_streamlit() def _initialize_streamlit(self): """Streamlit 초기화""" ...
Python
1
rks,self.mp.solutions.hands.HAND_CONNECTIONS) return myHands,handsType width=1280 height=720 cam=cv2.VideoCapture(1) cam.set(cv2.CAP_PROP_FRAME_WIDTH, width) cam.set(cv2.CAP_PROP_FRAME_HEIGHT,height) cam.set(cv2.CAP_PROP_FPS, 30) cam.set(cv2.CAP_PROP_FOURCC,cv2.VideoWriter_fourcc(*'MJPG')) findHands=mpHands...
Python
1
(c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 //! # Metrics //! //! ## Counters //! //! Used to measure values that are added to over time, rates //! can then be used to check how quickly it changes in graphs. //! An example would be to add every time an incoming message occurs. //! ``` //! use...
Rust
0
import torch def plane_grid_2d(xbound, ybound): xmin, xmax = xbound[0], xbound[1] num_x = int((xbound[1] - xbound[0]) / xbound[2]) ymin, ymax = ybound[0], ybound[1] num_y = int((ybound[1] - ybound[0]) / ybound[2]) y = torch.linspace(xmin, xmax, num_x).cuda() x = torch.linspace(ymin, ymax, num_...
Python
1
== 0 { return 0; } let mut memo: Vec<Vec<i32>> = vec![vec![-1; col]; row]; memo[0][0] = grid[0][0]; for r in 1..row { memo[r][0] = memo[r-1][0] + grid[r][0]; } for c in 1..col { memo[0][c] = memo[0][c-1] + grid[0][c]; } ...
Rust
0
() { let patches = PatchBank::load(&DOOM2_WAD).unwrap(); assert_eq!(patches.len(), 469); assert_eq!(patches[69].name, "RW12_2"); assert_eq!(patches[420].name, "RW25_3"); // Did we find the lowercased `w94_1` patch? assert_eq!(patches[417].name, "W94_1"); assert_...
Rust
0
hash::{BuildHasher, Hash}; use std::ops::Deref; fn set<'a, T: 'a, I>(iter: I) -> HashSet<T> where I: IntoIterator<Item = &'a T>, T: Copy + Hash + Eq, { iter.into_iter().cloned().collect() } #[quickcheck] fn contains(insert: Vec<u32>) -> bool { let (r, mut w) = evmap::new(); for &key in &insert { ...
Rust
0
from Crypto.Util.number import * from secret import flag real_flag = flag flag = getPrime(64) for i in range(16): a = int(input("a >").strip()) b = int(input("b >").strip()) if a == 0 or b == 0: print("yeah nice try ziadstr checked it this time") exit() print(GCD(a, flag - b)) x = int...
Python
1
# Questão 12(Questão 3 da parte 2): # Crie um programa que receba uma frase e a "criptografe" movendo cada letra 3 # posições para frente no alfabeto (por exemplo, 'a' se torna 'd', 'z' se torna 'c'). # Exemplo funcionamento algoritmo circular: Pegar 4 na frente, levando em consideração o algoritomo circular. # lista ...
Python
1
import json from flask import Flask, request from payments_db import init_db, find_matching_payment, is_subscription_active, mark_payment_paid, add_subscription app = Flask(__name__) init_db() @app.route("/payment", methods=["POST"]) def handle_payment(): try: data = request.get_json() print("Rece...
Python
1
if x < 2 || y < 2 || x >= chars[0].len() - 2 || y >= chars.len() - 2 { external = true; } // vertical down if temp_y + 2 < char_height as i64 && chars[y+1][x] >= 'A' && chars[y+1][x] <= 'Z' && chars[y+2][x] == '.' { (*maze).portal_positions.push(PortalPosition{symbol_a:chars[...
Rust
0
<https://invisible-island.net/ncurses/man/menu_pattern.3x.html> pub unsafe fn menu_pattern(menu: MENU) -> Option<String> { assert!(!menu.is_null(), "{}menu_pattern() : menu.is_null()", MODULE_PATH); (bindings::menu_pattern(menu) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr)) } /// <https://invisib...
Rust
0
r that time. /// /// # Panic /// /// if t_span.0 > t_span.1 pub fn solve<F>(self: &Self, prob: &F) -> Result<(Vec<T>, Vec<Vector<T>>), ()> where F: ImplicitODE<T> { let t_span: (T, T) = prob.time_span(); let t_start: T = t_span.0; let t_stop: T = t_span.1; ...
Rust
0
# Copyright 2020 The HuggingFace Team. All rights reserved. # # 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 applicabl...
Python
1
eval.shading.dndv = si.shading.dndv; if let Some(bsdf) = &si.bsdf { Arc::new(bsdf.clone()); } else { si_eval.bsdf = None } // if let Some(bssrdf) = &si.bssrdf { // Some(Arc::new(bssrdf.clone())); // } else { // si_eval.bssrdf = None...
Rust
0
ht": "bold", "color": "white", "padding": "10px", "font-size": "18px"}), # Card for displaying staff count for shift selected count = dbc.Card( [dbc.CardBody( [ html.H4(f"Total number of staff for this shift:", className="card-title"), html.P(len(...
Python
1
s) path = '/tmp/workspace' def prepare_paper(path): with plt.style.context(['seaborn-paper', 'mypaper']): path = Path(path)/'card251'/'salus' df = load_case(path/'card251.output') fifo = load_trace_fifo(path/'trace.csv') # FIXME: refine doesn't work yet # refine_data = loa...
Python
1
tionName::D256 as u8 == v => Ok(DurationName::D256), v if DurationName::D512 as u8 == v => Ok(DurationName::D512), v if DurationName::D1024 as u8 == v => Ok(DurationName::D1024), _ => crate::error::Other { site: site!() }.fail(), } } } impl TryFrom<u8> for DurationName {...
Rust
0
e!( #[derive( #frame_support::CloneNoBound, #frame_support::EqNoBound, #frame_support::PartialEqNoBound, #frame_support::RuntimeDebugNoBound, #frame_support::codec::Encode, #frame_support::codec::Decode, )] )); let deposit_event = if let Some((fn_vis, fn_span)) = &event.deposit_event { let ev...
Rust
0
bench.iter(|| { a.$op() }) } } ); macro_rules! bench_uniop_ref( ($name: ident, $op: ident, $gen: ident) => { fn $name(bench: &mut Bencher) { ...
Rust
0
self.time += self.et - self.st else: self.time = self.et - self.st def reset(self): self.time = 0. self.st = 0. self.et = 0. def value(self): return round(self.time, 4) def get_current_memory_mb(gpu_id=None): pid = os.getpid() p = psutil.Proces...
Python
1
import streamlit as st from openai import OpenAI # Show title and description. st.title("📄 Document question answering") st.write( "Upload a document below and ask a question about it – GPT will answer! " "To use this app, you need to provide an OpenAI API key, which you can get [here](https://platform.openai...
Python
1
} else if has_halves && q3.contains(&omega) { format_omega(" -", omega - neg_one) } else if has_quarters && q4.contains(&omega) { format_omega("-i", omega - neg_i) } else { format_omega("", omega) } } /// Formats the ith root of unity such that omega has a negative exponent, /// meaning that the angles...
Rust
0
an_presence(self, amplitude, phase): """Add simulated human presence effects to CSI data.""" # Simplified human presence simulation # In reality, human presence creates complex patterns of reflection and absorption # Simulate a person moving t = time.time() x_pos = 0.5 +...
Python
1
type Error = Infallible; type Future = impl Future<Output = Result<Self, Self::Error>> + 'a; #[inline] fn from_request(req: &'a &'r mut WebRequest<'s, S>) -> Self::Future { async move { let header_name = apply_header_names!(HEADER_NAME; match_header_name); Ok(HeaderRef(r...
Rust
0
# map(videoWriter.write, figs) for fig in figs: videoWriter.write(fig) videoWriter.release() else: print('error') print(save_dir) plt.close('all') # ============================ dynamic arrangement ============================ field = load_dict(os.path.join(data, 'field.pkl')) field_list =...
Python
1
().any(|rule_list| rule_list.type_matcher_defined()) } /// If there is a values matcher defined in the rules pub fn values_matcher_defined(&self) -> bool { self.rules.values().any(|rule_list| rule_list.values_matcher_defined()) } /// If there is a matcher defined for the path pub fn matcher_is_defined...
Rust
0
import os import cv2 import uvicorn import base64 from fastapi import FastAPI, HTTPException, Depends, File, UploadFile from fastapi.responses import StreamingResponse, JSONResponse from pydantic import BaseModel from sqlalchemy import create_engine, Column, Integer, String, LargeBinary from sqlalchemy.orm import decla...
Python
1
Ok((header, size)) } /// Write the processargs message to the provided channel. pub fn write(self, channel: &zx::Channel) -> Result<(), zx::Status> { let mut handles = self.handles; channel.write(self.bytes.as_slice(), &mut handles) } } #[cfg(test)] mod tests { use { ...
Rust
0
, given this example, you would clear `out` on every render. //! //! ```rust //! let font = badgen::notosans_font(); //! let mut font = badgen::font(&font); //! let mut scratch = String::with_capacity(4098); //! let mut out = String::with_capacity(4098); //! //! badgen::write_badge_with_font( //! &mut out, //! ...
Rust
0
, &PRE_HEADERS_PROPERTY_METHOD_DESC, &INPUTS_PROPERTY_METHOD_DESC, &OUTPUTS_PROPERTY_METHOD_DESC, &HEIGHT_PROPERTY_METHOD_DESC, &SELF_PROPERTY_METHOD_DESC, &SELF_BOX_INDEX_PROPERTY_METHOD_DESC, &LAST_BLOCK_UTXO_ROOT_HASH_PROPERTY_METHOD...
Rust
0
pth) if current_depth > previous_depth => increases_count + 1, _ => increases_count, }, Some(current_depth), ) }, ); println!("{}", increases_count); Ok(()) } use args::Args; use build; use failure::{Error, ResultExt}; use rayon::prel...
Rust
0
return elm$core$Maybe$Just(touch); } else { var e = _n0.a; return A2( author$project$SvgTouch$stDebugLog, elm$json$Json$Decode$errorToString(e), elm$core$Maybe$Nothing); } }; var author$project$SvgTouch$extractFirstTouchSE = function (msg) { switch (msg.$) { case 0: var v = msg.a; return author...
Rust
0
a limit of 2. So we can report 2 times before being //! // rate-limited //! let mut values_to_report: HashMap<String, String> = HashMap::new(); //! values_to_report.insert("req.method".to_string(), "GET".to_string()); //! values_to_report.insert("user_id".to_string(), "1".to_string()); //! //! // Check if we can repor...
Rust
0
, 1, "C") self.ln(10) self.set_font("DejaVu", "", 10) lines = [] grouped_info = groupby(self.info, lambda x: x[0].communication.foia.agency) tab = " " * 8 for agency, info in grouped_info: info = list(info) lines.append("\nAgency: {} - {} requests"...
Python
1
# Copyright (c) 2024 Cisco Systems, Inc. and its affiliates # # 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 to # use, copy, modi...
Python
1
.write(|w| w.events_error().not_generated()); self.twim .events_stopped .write(|w| w.events_stopped().not_generated()); ///// let tmp = self.twim.errorsrc.read().bits(); ///// self.twim.enable.write(|w| w.enable().disabled()); match...
Rust
0
tus(500) .with_body("hviqsuvnqsodjfsqjdgo java.lang.IllegalArgumentException: my error\nvzfjsd") .create(); let response = jenkins_client.post_with_body( &super::Path::Raw { path: "/error-IllegalArgumentException", }, "body", ...
Rust
0
=> { Ok(Request::AddIdentity {private_key: private_key}) }, Err(_) => Ok(Request::Unknown) } } MessageRequest::RemoveIdentity => { Ok(Request::Unknown) } MessageRequest::RemoveAllIdentities => { Ok(Request::Unknown) } MessageRequest::AddIdConstrained => { Ok(Request::U...
Rust
0
from __future__ import absolute_import, unicode_literals, print_function, division import os import sublime from . import GitWindowCommand, git_root class GitOpenConfigFileCommand(GitWindowCommand): def run(self): working_dir = git_root(self.get_working_dir()) config_file = os.path.join(working_...
Python
1
A>; impl TRIG_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> TRIG_A { match self.bits { false => TRIG_A::EDGE_TRIGGERED, true => TRIG_A::LEVEL_TRIGGERED, } } #[doc = "Checks if the value of the field is `EDGE_TRIGGERED...
Rust
0
,包含以下字段: - 股票代码: 股票代码 - 股票简称: 股票简称 - 发行价: 发行价 - 最新价: 最新价 - 网上发行中签率: 网上发行中签率(单位: %) - 网上有效申购股数: 网上有效申购股数 - 网上有效申购户数: 网上有效申购户数(单位: 户) - 网上超额认购倍数: 网上超额认购倍数 - 网下配售中签率: 网下配售中签率(单位: %) - 网下有效申购股数: 网下有效申购股数 - 网下有效申购户数: 网下有效申购户数(单位: 户) - 网下配售认购倍数: 网下配售认购倍数 - 总发行数量: 总发行数量 ...
Python
1
from djangocms_text_ckeditor.models import Text from djangocms_text_ckeditor.utils import plugin_tags_to_id_list, replace_plugin_tags from cms.api import add_plugin from cms.plugin_pool import plugin_pool from cmsplugin_cascade.models import CascadeElement def deserialize_to_placeholder(placeholder, data, language): ...
Python
1
.unwrap() .0[0] .to_regex_pattern() .unwrap(), "^(east\\-)(1|2|3)(a|b|c|d)$" ); assert_eq!( PathExpression::from_str("region-{ohio,virginia}.app.swap_free") .unwrap() .0[0] ...
Rust
0
q, page).await.is_ok()); assert_eq!( toql.take_unsafe_sqls(), [ "SELECT level1.id, level1.text, level1_level2.id, level1_level2.text \ FROM Level1 level1 \ LEFT JOIN (Level2 level1_level2) ON (level1.level2_id = level1_level2.id) \ WHERE level1.text = ...
Rust
0
(pcontainer.size_ == 0); let size = 5; for _ in 0..size { pcontainer.push(); } assert!(pcontainer.size_ == size); } #[test] fn add() { let mut pcontainer = PropertyContainer::<Vertex>::new(); let prop = pcontainer.add::<u32>("v:my_prop",17); ...
Rust
0
(); let mut d: Vec<node::element::path::Command> = vec![]; let &(first_x, first_y) = s.first().unwrap(); let first_x_pos = value_to_face_offset(first_x, x_axis, face_width); let first_y_pos = -value_to_face_offset(first_y, y_axis, face_height); d.push(node::element::path::Command::Move( nod...
Rust
0
_array()), tab4: align2d(tab4.to_owned_array()), tab5: align2d(tab5.to_owned_array()), tab: align2d(tab.to_owned_array()), } } fn do_not_call_me(&mut self) { let a1 = Array::from_elem((100, 100), 0.0); let a2 = Array::from_elem((100, 100), 0.0); let mut a3 = Array::f...
Rust
0
""" Shardformer Benchmark """ import torch import torch.distributed as dist import transformers import triton import colossalai from colossalai.shardformer import ShardConfig, ShardFormer def data_gen(batch_size, seq_length): input_ids = torch.randint(0, seq_length, (batch_size, seq_length), dtype=torch.long) ...
Python
1
urls": ["stun:stun.gmx.net:3478"]}] }, video_frame_callback=video_frame_callback ) st.sidebar.header("StarWars Day 2024") selected_mask = st.sidebar.radio("Mask", ("None", "Darth Vader", "Chewbacca", "Storm Trooper", "Yoda", "Mandalorian"), index = 0) mask_scale_factor = st.sidebar.slider("Mask scale f...
Python
1
d = Value::borrow_array(frame, slice, (3, 2))?; let jl_array = borrowed.cast::<Array>()?; let view: Result<ArrayView<isize, _>, _> = jl_array.array_view(frame); assert!(view.is_err()); Ok(()) }) .unwrap(); ...
Rust
0
in groups.iteritems(): for pt in pts: mit.addContactPoint(minimal_contact_urdf, foot_name, pt, group_name) minimal_contact_urdf.write(minimal_contact_urdf_path, pretty_print=True) # Create convex hull skeleton mit.addCollisionsFromVisuals(urdf) for foot_name, groups in contact_pts.iteritems(): ...
Python
1
maxLoss.margin_types self.margin_type = margin_type assert gamma >= 0 self.gamma = gamma assert m > 0 self.m = m assert s > 0 self.s = s self.cos_m = math.cos(m) self.sin_m = math.sin(m) self.th = math.cos(math.pi - m) assert t >= 1...
Python
1
(Color4::red()); } else { widget.set_text_color(Color4::black()); } } if quit_button.was_pressed() { // TODO! window.glfw_window().set_should_close(true); } if pause_button.was_pressed() { paused = !paused; if paused { pause_button.set_text("Unpause")...
Rust
0
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.module_loading import import_string from openwisp_controller.connection import settings as conn_settings CUSTOM_OPENWRT_IMAGES = getattr(settings, "OPENWISP_CUSTOM_OPENWRT_IMAGES", None) # fmt: off UPGRADERS_MAP...
Python
1
kup.radius = 0 path.photongi.indirect.lookup.normalangle = 10 path.photongi.indirect.usagethresholdscale = 8 path.photongi.indirect.filter.radiusscale = 3 path.photongi.caustic.enabled = 0 path.photongi.caustic.maxsize = 100000 path.photongi.caustic.updatespp = 8 path.photongi.caustic.updatespp.radiusreduction = 0.96 p...
Python
1
from rustfst_python_bench.utils import check_property_set class ArcSortAlgorithm: def __init__(self, sort_olabel=False): self.sort_olabel = sort_olabel @classmethod def openfst_cli(cls): return "fstarcsort" @classmethod def rustfst_subcommand(cls): return "arcsort" ...
Python
1
成功") except Exception as e: logger.error(f"Error updating chat session {session_id}: {str(e)}") return Fail(msg=f"更新会话失败: {str(e)}") @router.delete("/sessions/{session_id}", summary="删除聊天会话") async def delete_chat_session( session_id: str, db: Session = Depends(get_db), curren...
Python
1
e = gr.Interface( fn=predict_alzheimers_category, inputs=gr.Image(type="pil", label="Upload MRI Scan"), outputs=gr.Textbox(label="Alzheimer's Category Assessment"), title="Alzheimer's MRI Classification", description="Upload an MRI scan to determine the Alzheimer's category", ) # Launch the interfa...
Python
1
_COMPRESSED { let data = fs::read(self.make_absolute_path(shv_path))?; let mut compressed: Vec<u8> = Vec::new(); lz_fear::CompressionSettings::default() .compress(&data[..], &mut compressed)?; return Ok(Some(RpcValue::from(compressed))) } i...
Rust
0
#RETO 1 ''' Escribe un programa que reciba un texto y transforme lenguaje natural a "lenguaje hacker" (conocido realmente como "leet" o "1337"). Este lenguaje se caracteriza por sustituir caracteres alfanuméricos. - Utiliza esta tabla (https://www.gamehouse.com/blog/leet-speak-cheat-sheet/) con e...
Python
1
eld ℚ[√d] fn unit(d: T) -> Self { // REF: http://www.numbertheory.org/gnubc/unit // REF: https://people.reed.edu/~jerry/361/lectures/rqunits.pdf unimplemented!() } /// Convert `a + bω` to `(x + y√D)/2` #[inline] fn parts_doubled(&self) -> (T, T) { let QuadraticIn...
Rust
0
with mock.patch("psutil._psplatform.cext.winservice_query_config", side_effect=exc): self.assertRaises(psutil.NoSuchProcess, service.username) # test AccessDenied if PY3: args = (0, "msg", 0, ERROR_ACCESS_DENIED) else: args = (ER...
Python
1
# Exit second parent sys.exit(0) except OSError as e: logger.error(f"Second fork failed: {e}") sys.exit(1) # Update PID file with daemon PID with open(pid_file, 'w') as f: f.write(str(os.getpid())) # Redirect standard file descriptors sys.stdout.fl...
Python
1
# Test that computation completes in reasonable time start_time = time.time() stats = toolkit.stats.build_analysis_report( large_price_array, large_volume_array, timestamps ) computation_time = time.time() - start_time # Should complete within reasonabl...
Python
1
ss_fn(label_actual, label_predict) loss_test.update(loss.item()) # Concat them for computing IC later label_true = torch.cat([label_true, label_actual]) label_pred = torch.cat([label_pred, label_predict]) label_spec_true = torch.cat([label_...
Python
1
rl", default_value = "https://[::1]:10000")] url: String, #[structopt(long = "cert", parse(from_os_str))] cert: PathBuf, #[structopt(long = "key", parse(from_os_str))] key: PathBuf, #[structopt(long = "ca-certificate", parse(from_os_str))] server_ca: PathBuf, #[structopt(subcommand)] ...
Rust
0
import itertools import json import torch candidates = { 'ThreadblockM': [128, 256], 'ThreadblockN': [128, 256], 'ThreadblockK': [32, 64], 'WarpM': [64], 'WarpN': [64], 'WarpK': [32, 64], 'InstructionM': [16], 'InstructionN': [8], 'InstructionK': [16], 'NumStages': [3, 4, 5], ...
Python
1
Unsupported message format {}", msg ))) } } pub(crate) fn extract_timestamp(msg: &str) -> Result<Option<i64>, SimpleError> { if let Ok(ws_msg) = serde_json::from_str::<WebsocketMsg<HashMap<String, Value>>>(msg) { // websocket let topic = ws_msg.topic.as_str(); if ws_...
Rust
0
n/output-5/examinimd-B.out.rs 1 3.006830486111111e-05 0 2 8.115987222222222e-05 17 3 0.00027533068888888887 49 4 8.928596111111112e-05 19 5 0.00025965062222222226 51 6 0.0022424627555555554 101 7 5.261374444444444e-05 8 8 4.6238183388888887e-05 6 9 5.036479972222223e-05 5 10 0.004641492266666666 10 11 3.642315833333333...
Rust
0