text
string
label_name
string
labels
int64
rename_all = "PascalCase")] struct MyData { first_data: u32, second_data: String, third_data: f32, } fn main() { let json = r#"{ "FirstData": 56, "SecondData": "hello, world", "ThirdData": -1.23 }"#; let in_rust: MyData = serde_json::from_str(json).expect("JSON parsing ...
Rust
0
&[u8; libsodium_sys::crypto_box_curve25519xchacha20poly1305_NONCEBYTES as usize], message: &[u8], dest_pub_key: &[u8; libsodium_sys::crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES as usize], src_sec_key: &[u8; libsodium_sys::crypto_box_curve25519x...
Rust
0
se*. See `"paper" <https://arxiv.org/pdf/1707.06990.pdf>`_. """ return _densenet("densenet169", 32, (6, 12, 32, 32), 64, pretrained, progress, **kwargs) def densenet201(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet: r"""Densenet-201 model from `"Densely Connected Convolut...
Python
1
math_ops.range(0, math_ops.cast(outerdim, dtypes.int64) * in_lastdim, in_lastdim), -1), dtypes.int32), [-1]) # Substitute grad to appropriate locations and fill the rest with zeros, # finally reshaping it to the original input shape. return [ ...
Python
1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os from pathlib import Path from unittest.mock import patch import pytest # Import functions to test from local application files from pyrit.common.download_hf_model import download_specific_files # Define constants for testing MODEL_ID...
Python
1
#WAP that demonstrate the use of the 'the type()' function to display different basic data types. integer_var=10 print("Type of integer_var:",type(integer_var)) float_var=3.14 print("Type of float_var:",type(float_var)) string_var="Hello, world!" print("Type of string_var:",type(string_var)) bool_var=True print("Type o...
Python
1
dd( 0.015_854_344_243_815_501_891_425_9, -1.046_932_722_806_315_219_088_45_e-18, ) } else { dd( -0.080_745_512_188_280_785_248_473_1, 3.618_524_750_670_371_048_499_87_e-18, ) }); x = s2 * x ...
Rust
0
), } }; let id_str = match bson_doc.find(~"id_str") { None => None, Some(d) => match d { &UString(ref i) => Some(i.clone()), _ => return Err(~"not Person struct (id_str field not UString)"), } }; let val = ...
Rust
0
room_id = get_room_id(); let mut response = EventBuilder::default() .add_state_event(EventsJson::Alias) .build_sync_response(); client.receive_sync_response(&mut response).await.unwrap(); let room = client.get_joined_room(&room_id).await.unwrap(); let room = r...
Rust
0
54b1c29718841e219b7e4db7a409769d3badf10664e4710be353b414912bc5e5ed887cf61c8b27a809655fbd6ec64a9a644ba", "edc4ee4ccefc0a621131c994afceba4bfb81d86c9fa0a2f45d8cc572ca3e19fa" ), ]; impl_short_msg_kat!(blake2, Blake2s, SHORT_MSG_KAT, Blake2s::default()); <gh_stars>1-10 fn factorial(n: u64) -> u64 { if n == 0 { ...
Rust
0
CheckExpensePermissionTool(), GenerateBillByExpenseIdTool(), # 报销单相关工具 GetMyRectificationBillListTool(), GetUnfinishedDebtBillTool(), GetAreaFieldByBillDefineIdTool(), GetBillDataAndTemplateTool(), CollectExpenseRecordInfoTool(), QueryTravel...
Python
1
allowed parameters def test_heat_hcl_allowed_kwargs_unnamed(): # Test settings settings = {"h1": 11, "h2": 12, "c1": 13, "c2": 14, "l1": 15, "l2": 16, "p1": 17, "p2": 18} # Ensure I test all allowed parameters for k in heat_hcl._allowed_parameters: # Skipping 'cmax', only testin...
Python
1
#!/usr/bin/env python3 # Software License Agreement (BSD License) # # Copyright (c) 2019, UFACTORY, Inc. # All rights reserved. # # Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com> """ Description: Move Joint """ import os import sys import time import math sys.path.append(os.path.join(os.path.dirname(...
Python
1
import os, json, torch from datasets import load_dataset from transformers import ( AutoTokenizer, AutoModelForCausalLM, TrainingArguments, DataCollatorForLanguageModeling, BitsAndBytesConfig, Trainer, ) from peft import ( LoraConfig, PeftModel, prepare_model_for_kbit_training, ) MO...
Python
1
back to the mini-batch y.contiguous().view(raw_int_fs) offsets = torch.cat(offsets, dim=0) offsets = offsets.view([int_bs[0]] + [2] + int_bs[2:]) # case1: visualize optical flow: minus current position h_add = Variable(torch.arange(0,float(bs[2]))).cuda().view([1, 1, bs[2], 1])...
Python
1
y_status: bool = false; let (wait_cert, wait_cert_sign) = poet2_util::get_cert_and_sig_from(&block); debug!("Serialized wait_cert : {:?}", &wait_cert); let deser_wait_cert: WaitCertificate = serde_json::from_str(&wait_cert).unwrap(); debug!("Deserialized wait cert : {:?}", deser_wait_ce...
Rust
0
)."] pub n: *mut ncplane, #[doc = " the scaling is ignored if no ncplane is provided (it ought be NCSCALE_NONE"] #[doc = " in this case). otherwise, the source is stretched/scaled relative to the"] #[doc = " provided ncplane."] pub scaling: ncscale_e, #[doc = " if an ncplane is provided, y and x...
Rust
0
def scroll_to_address(self, address): line_num = address // self.bytes_per_line visible_lines = self.height new_start_line = max(0, line_num - visible_lines // 2) self.start_address = new_start_line * self.bytes_per_line self.update_view() def highlight_range(self, start...
Python
1
#!/usr/bin/env python from distutils.log import warn as printf from os.path import dirname from random import randrange as rand from sqlobject import * from ushuffle_dbU import DBNAME, NAMELEN, randName, FIELDS, tformat, cformat, setup DSNs = { 'mysql': 'mysql://root@localhost/%s' % DBNAME, 'sqlite': 'sqlite...
Python
1
# from LIPM import func_LIPM_3D as func import LIPM.func_LIPM_3D as func import numpy as np from ikine import ikineLeft, ikineRight # from ikine import ikineLeft # from ikine import ikineRight def Calculate(time=6): total_time = time ( COM_pos_x, COM_pos_y, left_foot_pos_x, left_foot_pos_y, ...
Python
1
let app = App::new().service(test_app().await); let mut app = test::init_service(app).await; let creator = Soa::from(&basic_user(1, true)).creator().aal_medium(); let res = post( &mut app, "/groups/api/v1/groups", json!({ "name": "some", "description": "some group" }), ...
Rust
0
s are between 0.5 and 5.0, with increments of 0.5. rating: f32, /// Set to true if the member likes the film (via the ‘heart’ icon). like: bool, } #[derive(Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] struct LogEntryCreationRequestDiaryDetails { /// The date the film was watched, if s...
Rust
0
wMessage(status_text) # 使用 self.status_bar except Exception as e: QMessageBox.critical(self, "错误", f"加载目标目录失败: {str(e)}") def save_changes(self): """保存更改""" if not self.current_file_path: return try: tree = ET.parse(self.current_file_path) ...
Python
1
measure_name) } } } } fn add_value_by_name(&mut self, name: String, value: u32) { let measure_handle; { match self.measures_by_name.get(&name) { Some(handle) => measure_handle = *handle, None => { ...
Rust
0
) - inters) overlaps = inters / uni ovmax = np.max(overlaps) jmax = np.argmax(overlaps) if ovmax > ovthresh: if not R['difficult'][jmax]: if not R['det'][jmax]: tp[d] = 1. R['det'][jmax] = 1 ...
Python
1
"""Admin texts""" STATS = ''' 📊 Статистика: · Всего - <code>%s</code> · Живы - <code>%s</code> · Мертвы - <code>%s</code> · Подписались на ОП - <code>%s</code> · Чаты - <code>%s</code> · Диалоги - <code>%s</code> 👤 Статистика по времени: · За сегодня - <code>%s</code> · За неделю - <code>%s</code> · За месяц - <c...
Python
1
static values: &'static [ChecksumTypeProto] = &[ ChecksumTypeProto::CHECKSUM_NULL, ChecksumTypeProto::CHECKSUM_CRC32, ChecksumTypeProto::CHECKSUM_CRC32C, ]; values } fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { ...
Rust
0
="Define at least one molecule", icon='ERROR') def draw_panel ( self, context, panel ): """ Create a layout from the panel and draw into it """ layout = panel.layout self.draw_layout ( context, layout ) classes = ( MCELL_OT_update_data_layout, MCELL_OT_read_viz_d...
Python
1
from sqlmodel import Field, SQLModel from arista.db.repositories import BaseRepository class FundingRate(SQLModel, table=True): """Database model for OHLC funding rate history of multiple symbols, mutiple exchanges.""" __tablename__ = "funding_rate" id: int = Field(default=None, primary_key=True) ...
Python
1
t(src) == ['`', 'ls "', '$php', '" ls ', '$sdf->fsdf', '`'] def test_backtick_8(self): r = self.lex('`ls "$php" ls \'asdasd\' \'asdasd\'`') assert r == ['`', 'T_ENCAPSED_AND_WHITESPACE', 'T_VARIABLE', 'T_ENCAPSED_AND_WHITESPACE', '`'] ...
Python
1
# Generated by Ollama Llama 3 # Task: queue_mda_conversion_rich # Attempt: 5 # Success: False # Overall Score: 0.538 # Import pyverilog and other libraries import sys import re from pyverilog.ast import * # Define classes for visitors class FixedArrayToQueueVisitor(ASTVisitor): def __init__(self, signal_name): ...
Python
1
# n!=n X n X n X # 5!=5*4*3*2*1 num=int(input("Enter a number : ")) fact=1 # yaha +1 iske liye use kiya he quki hue main value tak cahiye for i in range(1,num+1): fact=fact*i print(f"Factorial of {num} is {fact} ")
Python
1
""" Tests for msvc support module (msvc14 unit tests). """ import os from distutils.errors import DistutilsPlatformError import pytest import sys @pytest.mark.skipif(sys.platform != "win32", reason="These tests are only for win32") class TestMSVC14: """Python 3.8 "distutils/tests/test_msvccompiler.py" backport""...
Python
1
.0, 28.0, /// 35.0, 36.0, 37.0, 38.0, /// 45.0, 46.0, 47.0, 48.0, /// ); /// let b = Mat4::new( /// vec4!(15.0, 16.0, 17.0, 18.0), /// vec4!(25.0, 26.0, 27.0, 28.0), /// vec4!(35.0, 36.0, 37.0, 38.0), /// vec4!(45.0, 46.0, 47.0, 48.0), /// ); /// assert_eq!(a, b); /// # } /// ``` #[macro_export]...
Rust
0
ycle) .map_err(|err| format!("Verify script error: {:?}", err)) } } #[cfg(test)] mod test { use super::*; use ckb_crypto::secp::SECP256K1; use ckb_hash::blake2b_256; use ckb_jsonrpc_types as json_types; use ckb_types::{ core::{capacity_bytes, BlockView, Capacity, HeaderView}...
Rust
0
MediumDepth::new(value) } } impl fmt::Display for MediumDepth { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.value()) } } /// Small depth (0~7). #[derive(Debug, Clone, Copy)] pub struct SmallDepth(u8); impl SmallDepth { fn range() -> Wrapper<u8> { ...
Rust
0
ks if the accelerator has performed an optimization step behind the scenes if accelerator.sync_gradients: progress_bar.update(1) global_step += 1 if global_step % args.save_steps == 0: if accelerator.is_main_process: ...
Python
1
let mut object_746 = object.key("AwsApiGatewayStage").start_object(); crate::json_ser::serialize_structure_crate_model_aws_api_gateway_stage_details( &mut object_746, var_745, ); object_746.finish(); } if let Some(var_747) = &input.aws_api_gateway_rest_api { ...
Rust
0
#!/usr/bin/env python # ckwg +28 # Copyright 2012-2020 by Kitware, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice...
Python
1
_from_call(ok_html_input_element_or_error)?; Process::call_code(arc_process) } Err(exception) => result_from_exception(arc_process, exception), } } fn frame() -> Frame { Frame::new(module_function_arity(), code) } fn function() -> Atom { Atom::try_from_str("element").unwrap() ...
Rust
0
g << 8) | b } <reponame>hug-dev/rust-spiffe<filename>spiffe/tests/uri_test.rs extern crate spiffe; use spiffe::uri::URI; #[test] fn valid_spiffe_id() { "spiffe://example.org/path".parse::<URI>().unwrap(); } #[test] fn valid_spiffe_id_no_domain() { "spiffe://example/path".parse::<URI>().unwrap(); } #[test] f...
Rust
0
""" Words with Functions ==================== Collect article text data and metadata, using a function oriented approach. """ ################################################################################################### # Function Approach: collect_words # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # The function for c...
Python
1
min, f0_max): f0, t = pyworld.harvest( x.astype(np.double), fs=self.sr, f0_ceil=f0_max, f0_floor=f0_min, frame_period=10, ) f0 = pyworld.stonemask(x.astype(np.double), f0, t, self.sr) f0 = signal.medfilt(f0, 3) return f0...
Python
1
Null, run_query, ConnectorCapability}; use query_tests_setup::Runner; #[connector_test(schema(json_opt))] async fn basic(runner: Runner) -> TestResult<()> { create_row(&runner, r#"{ id: 1, json: "{}" }"#).await?; create_row(&runner, r#"{ id: 2, json: "{\"a\":\"b\"}" }"#).await?; cre...
Rust
0
# # This file is part of pysnmp software. # # Copyright (c) 2005-2016, Ilya Etingof <ilya@glas.net> # License: http://pysnmp.sf.net/license.html # import socket from pysnmp.carrier.base import AbstractTransportAddress from pysnmp.carrier.asyncio.dgram.base import DgramAsyncioProtocol try: import asyncio except Impo...
Python
1
import sys from get_html_website_with_playwright import get_html_website_with_playwright from get_website_url import * from scrape_ads import scrape_ads from save_ads_to_excel import save_ads_to_excel from scrape_whitepapers import scrape_whitepapers from save_whitepapers_to_excel import save_whitepapers_to_excel def ...
Python
1
/// /// # Arguments /// /// * `instructions` - a list of Instructions to execute /// * `store` - the Collection's store to operate on /// * `indices` - mapping of the collection's Index structs to their field name. /// /// # Example /// /// ```rust /// let ops = vec![ /// Instructions::Equal( /// String::fro...
Rust
0
many Option<Cow> values /// which are a bit tricky to handle. We never turn them into Option<Cow::Owned> so we can safely /// use these. pub(crate) trait UnwrapBorrowedExt<'a> { /// Does not default but requires there to be an borrowed inner value. fn unwrap_borrowed(self) -> &'a [u8]; /// Unwraps the Cow...
Rust
0
vec![vec![1, 3], vec![1, 4], vec![2, 3], vec![2, 4], vec![4, 3]] ), 3 ); } use std::error::Error; use std::fs; use std::path::Path; use heed::types::*; use heed::{Database, EnvOpenOptions}; // In this test we are checking that we can append ordered entries in one // database even if there i...
Rust
0
x20to\x20an\x20RPC\x20error.\n\n\x0b\ \n\x03\x04\x08\x01\x12\x04\xbf\x01\x08\x18\n\x9e\x01\n\x04\x04\x08\x02\0\ \x12\x04\xc3\x01\x02\x14\x1a\x8f\x01\x20The\x20locale\x20used\x20followi\ ng\x20the\x20specification\x20defined\x20at\n\x20http://www.rfc-editor.o\ rg/rfc/bcp/bcp47.txt.\n\x20Examples\x20are:\...
Rust
0
import pdb from typing import List, Tuple import numpy as np import re import tensorflow as tf from t5x.examples.unified_io.data.data_utils import load_class_name, denormalize_boxes, \ OTHER_INSTANCE_COLORS, BK_COLORS, FIRST_OBJ_COLOR, get_default_vocabulary VOCAB = get_default_vocabulary() bbox_regex = re.compi...
Python
1
stpair_pre() { assert_eq!(Instruction::LDPSW_64_ldstpair_pre { imm7: 127, Rt2: 31, Rn: 31, Rt: 31, }.encode().decode(), Instruction::LDPSW_64_ldstpair_pre { imm7: 127, Rt2: 31, Rn: 31, Rt: 31, }) } #[test] fn roundtrip_STNP_D_ldstnapair_offs() { assert_eq!(Instruction::STNP_D_ldstnapair_offs { ...
Rust
0
select_utxo_list: vec![], utxo_fee_amount: 0, } } } /// A container that stores transaction fee. #[derive(Debug, PartialEq, Eq, Clone)] pub struct FeeData { /// tx outputs and tx base fee. pub txout_fee: i64, /// utxo (tx inputs) fee. pub utxo_fee: i64, } impl FeeData { pub fn new(txout_fee: i6...
Rust
0
orm_layer(dim) mlp_hidden_dim = int(dim * mlp_ratio) self.mlp = Mlp(in_features=dim, hidden_features=mlp_hidden_dim, act_layer=act_layer) def forward(self, feats, xyz, batch): # feats: [N, c] # xyz: [N, 3] # batch: [N] short_cut = feats feats = self.norm1(fe...
Python
1
_step(&mut self, step: StepType) -> Result<()> { writeln!(&mut self.writer, "{}", step)?; let mut r = self.recorder.lock().await; r.add_content(DOCTOR_OUTPUT_FILENAME, format!("{}\n", step)); Ok(()) } // This represents the result of a `step`. async fn result(&mut self, resu...
Rust
0
s.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } else: DATABASES = { 'default': dj_database_url.parse(os.environ.get("DATABASE_URL")) } # Password validation # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ {...
Python
1
out vec4 color; void main() { color = v_color; } " }).unwrap(), cache_tex: Texture2d::with_format( display, RawImage2d { data: Cow::Owned(...
Rust
0
f.patch_embed.DW) if self.use_abs_pos_embed: x = x + self.absolute_pos_embed x = self.drop_after_pos(x) outs = [] for i, stage in enumerate(self.stages): x, hw_shape, out, out_hw_shape = stage(x, hw_shape) if i == 0 and self.return_stereo_feat: ...
Python
1
em', models.CharField(blank=True, max_length=32, null=True, verbose_name='系统版本')), ('kernel', models.CharField(blank=True, max_length=32, null=True, verbose_name='系统内核')), ('status', models.CharField(choices=[('1', '在线'), ('2', '下线')], default='1', max_length=32, verbose_name='状态')), ...
Python
1
1 _F",K@IF",KCDDTD]D]C^_F) 0 ?K. .  ) 4 4 6 "4SVH<OP] _ "M599 s$B)B,, C,5+C' C,&C''C,N)rT)rsrtrurvrwr&rxryrzr{r|r}rr:r~rrr#rrrrsm:  &.L?L0H(HKGKP^?C'#'#'8<...
Python
1
import json import os import subprocess from collections import defaultdict from typing import List from matplotlib.pyplot import step import numpy as np import torch import tyro def main(results_dir: str, scenes: List[str], num_frame: int): print("scenes:", scenes) stage = "compress" summary = defaultd...
Python
1
, pub columns: Vec<Ident>, /// Whether the number of aliased columns must exactly match the number of /// columns in the underlying table. /// /// TODO(benesch): this shouldn't really live in the AST (it's a HIR /// concern), but it will have to do for now. pub strict: bool, } impl AstDispl...
Rust
0
mitive(pdb::PrimitiveType { kind: pdb::PrimitiveKind::I64, indirection: None, }) => Ok(8), pdb::TypeData::Primitive(pdb::PrimitiveType { kind: pdb::PrimitiveKind::U64, indirection: None, }) => Ok(8), pdb::TypeData::Primitive(pdb::Primitiv...
Rust
0
buf_rhs: &mut Vec<i32>, scanlines: &mut Vec<Scanline>, w: u32, h: u32, ymin: i32, ) { /* plot any quadratic Bezier curve */ let mut x: i32 = x0 - x1; let mut y: i32 = y0 - y1; let mut t: f64 = (x0 - 2 as i32 * x1 + x2) as f64; let mut r: f64 = 0.; if x * (x2 - x1) > 0 { ...
Rust
0
} frames to {out_path}") def _set_status(self, msg: str): self.statusBar().showMessage(msg) def _handle_offset_drag(self, dx, dy): if not self.frames: return fr = self.frames[self.current_index] fr.offset += QtCore.QPoint(dx, dy) self._sync_offset_spins() ...
Python
1
'[' => Ok(('[', ']')), '{' => Ok(('{', '}')), '<' => Ok(('<', '>')), _ => Err(anyhow!("Incorrect input for delimiter")), } } fn find_faulty_delimiter(delimiters: &str) -> Result<char, Error> { let mut checks: Vec<(char, char)> = Vec::new(); for c in delimiters.chars() { ...
Rust
0
lsos Positivos FN = confusion_matrix[1, 0] # Falsos Negativos # Calculando as métricas acuracia = (VP + VN) / (VP + VN + FP + FN) sensibilidade = VP / (VP + FN) # Também conhecido como Recall especificidade = VN / (VN + FP) precisao = VP / (VP + FP) f1_score = 2 * (precisao * sensibilidade) / (precisao + sensibilida...
Python
1
# Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Türkiye - Accounting', 'icon': '/account/static/description/l10n.png', 'countries': ['tr'], 'version': '1.2', 'category': 'Accounting/Localizations/Account Charts', 'description': """ This is the base module to...
Python
1
"""Tests for the Abode camera device.""" from unittest.mock import patch from homeassistant.components.abode.const import DOMAIN as ABODE_DOMAIN from homeassistant.components.camera import DOMAIN as CAMERA_DOMAIN from homeassistant.const import ATTR_ENTITY_ID, STATE_IDLE from homeassistant.core import HomeAssistant fr...
Python
1
etter def OrderId(self, OrderId): self._OrderId = OrderId @property def CertificateExtra(self): r"""证书扩展信息。 :rtype: :class:`tencentcloud.ssl.v20191205.models.CertificateExtra` """ return self._CertificateExtra @CertificateExtra.setter def CertificateExtra(se...
Python
1
etPosition(self, ghostState): if not self.showGhosts and not ghostState.isPacman and ghostState.getPosition()[1] > 1: return (-1000, -1000) else: return PacmanGraphics.getPosition(self, ghostState) def add(x, y): return (x[0] + y[0], x[1] + y[1]) # Saving graphical output ...
Python
1
in that line for pixel in line[..(4 * width)].chunks_exact_mut(4) { pixel[0] = b; pixel[1] = g; pixel[2] = r; pixel[3] = 0; } } ...
Rust
0
EGEX_NS}/nut", spawn=NUT_USD, init_state=ArticulationCfg.InitialStateCfg( pos=(-0.88, 0.55, 0.548), rot=(0, 0, 0.7071, 0.7071), ), ) Robot = ROBOT_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot") camera = CameraCfg( prim_path="{ENV_REGEX_NS}/Robot/rsd45...
Python
1
import os import numpy as np from collections import Counter np.set_printoptions(threshold=np.inf) rootPath = './' tempPath = './' mdatPath = rootPath + '/data_mid/' foutPath = tempPath + '/logs/' def main(): cal_func_calls(mdatPath + '/positives/', 'func_call_pos', 0) cal_func_calls(mdatPath + '/negatives/',...
Python
1
mut struct_ptr = self .bottom .as_mut() .unwrap() .crocol(codegen)? .into_pointer(codegen, &self.code_pos)?; struct_ptr = auto_deref(struct_ptr, codegen); match struct_ptr.symbol_type { SymbolType::Struct(struct_name) => { ...
Rust
0
// 南西方向 // 南東方向 }, S => { if match_ph(&Phase::First, &phase_atk) { // 北方向 } else { // 南方向 } }, PK => { // 北方向 // 西方向 // 南方向 // 東方向 }, PZ =...
Rust
0
Result<Feature,failure::Error> { Ok(Feature::from_bytes_le(buf)?.1) } impl FromBytesLE for Feature { fn from_bytes_le(buf: &[u8]) -> Result<(usize,Self),failure::Error> { if buf.is_empty() { failure::bail!["not enough bytes to decode feature"] } Ok(match buf[0] { 0x01 => { ...
Rust
0
int total_windows = 0 total_det_dist = 0 max_det_dist = 0 min_det_dist = sys.maxint total_segments = 0 # Do the real work if outfile != sys.stdout: with open(outfile, 'w') as outf: if segfile: with open(segfile, 'w') as segf: detect_ch...
Python
1
: Option<String>, /// Details about the error. pub detail: Option<String>, } <filename>base_layer/core/src/consensus/network.rs // Copyright 2019. The Tari Project // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the // following conditions are ...
Rust
0
ld not achieve consensus. Consider:") print(f" - Increasing --attempts (currently {num_attempts})") print(f" - Increasing --max-iterations (currently {max_iterations})") print(f" - Using simpler, more factual questions") print(f" - Or using caching for perfect determi...
Python
1
malize(quat_slerp(quat_normalize(q0.numpy()), quat_normalize(q1.numpy()), w))) for w in interp_ws], axis=0) if outrep == 'aa': res = quaternion_to_axis_angle(torch.from_numpy(inter)) el...
Python
1
import os os.environ["TQDM_DISABLE"] = "True" import time from mv_utils import Detectors, Video_utils, VOD_utils, Eval_utils, Config from vod_methods import sort, bot_sort, byte_track, oc_sort from datasets.urchin_videos import urchin_gt_generator, only_matched_tracklets if __name__ == "__main__": urchin_bot = ...
Python
1
ate_12_10() { let forecast = ::WindsAloftForecast { forecast_time: 1200u32, time_retrieved: 1200u32, forecasts: Vec::new(), }; assert!(forecast.needs_refresh_time_given(1000u32)); assert!(forecast.needs_refresh_time_given(1050u32)); } #[test] fn need_update_12_0() { let for...
Rust
0
import pandas as pd import datetime record_file = "driver_record.csv" def init_database(): try: df = pd.read_csv(record_file) except FileNotFoundError: df = pd.DataFrame(columns=["Name", "Date_time", "Status", "Accuracy"]) df.to_csv(record_file, index=False) def save_driver_record(nam...
Python
1
* understand and accept it fully. * */ /* ************************************************************************* * * @section: * system_interface * * @title: * System Interface * * @abstract: * How FreeType manages memory and i/o. * * @description: * This section contains various definitions rela...
Rust
0
output::Builder::default() } } #[macro_use] extern crate log; extern crate env_logger; extern crate winit; extern crate glutin; extern crate gfx; extern crate gfx_core; #[cfg(feature = "gl")] extern crate gfx_device_gl; #[cfg(feature = "gl")] extern crate gfx_window_glutin; #[cfg(feature = "dx11")] extern crate g...
Rust
0
# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # # 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 limita...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2024 Google LLC. 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 requir...
Python
1
Expr::Wildcard => Ok(protobuf::LogicalExprNode { expr_type: Some(protobuf::logical_expr_node::ExprType::Wildcard(true)), }), // _ => Err(BallistaError::General(format!( // "logical expr to_proto {:?}", // self // ))), } } } ...
Rust
0
from actstream.models import Follow from django import template from django.contrib.contenttypes.models import ContentType from grandchallenge.notifications.forms import FollowForm register = template.Library() @register.simple_tag def get_follow_object_pk(user, follow_object): object_follows_for_user = Follow....
Python
1
break else: v = train_state.opt_state.hyperparams v = calculate_means(v) ext_log.append(v) train_metrics.append(tm) for h in hooks: h(step) ###################### LOG TRAIN SUMMARY ######################## if (step % config.get('log_summary_steps') == 1) ...
Python
1
paths[..i] .iter() .filter(|it| it.starts_with(path)) .map(|it| it.clone()) .collect::<Vec<_>>(); let config = Arc::new(RootConfig::new(path.clone(), nested_roots)); roots.alloc(config.clone()); } Roots { roots } ...
Rust
0
ime before checking for hosts availability: {} seconds", config.wait_before); println!(" - Sleeping time once all hosts are available: {} seconds", config.wait_after); println!("------------------------------------------------"); if config.wait_before > 0 { println!("Waiting {} seconds before check...
Rust
0
code::LoopHead || self == Opcode::AfterYield } pub fn is_jump(self) -> bool { self == Opcode::Goto || self == Opcode::JumpIfFalse || self == Opcode::JumpIfTrue || self == Opcode::Or || self == Opcode::And || self == Opcode::Coalesce } } i...
Rust
0
.0, 0.0), radius: 10.0, mat_ptr: checker_material.clone(), })); world.add(Arc::new(Sphere { center: Vec3::new(0.0, 10.0, 0.0), radius: 10.0, mat_ptr: checker_material, })); world } pub fn one_ball() -> HitTableList { let mut world = HitTableList::default(); ...
Rust
0
, 4, 0x234C)), Expr.Ez, Expr.Return, ), 'loc_CBC', ) PlaySE(43, 0x00, 0x64) OP_70(0x0007, 60) Sleep(500) If( ( (Expr.Eval, "AddItem(ItemTable['全回复药'], 1)"), Expr.Return, ), 'loc_C53', ) FadeOut(300, 0,...
Python
1
ew(), event: MapEvent::Clear }) ); } #[test] fn typed_view_with_event_take() { let raw = ViewWithEvent { view: make_raw(), event: MapEvent::Take(1), }; let typed: Result<TypedViewWithEvent<i32, i32>, ReadError> = raw.try_into(); assert_eq!( typed, ...
Rust
0
# -*- coding: utf-8 -* ''' Function Arguments --Arguments VS Parameters -default arguments -arbitary arguments (args) -keyword arguments (kwargs) -default parameters: parameters that have some default values. They are optional parameters ''' def intro(name, nationality = "Indian"): print("Hello", name) print("I...
Python
1
import requests import sys from urllib import quote def exploit(url): res = requests.get(url, timeout=10) if res.status_code == 200: print "[+] Response: {}".format(str(res.text)) print "\n[+] Exploit Finished!" else: print "\n[!] Exploit Failed!" if __name__ == "__main__": if ...
Python
1
fn bad_endian() { // Only little endian is supported let gm = create_guest_mem(); let kernel_addr = GuestAddress(0x0); let mut bad_image = make_elf_bin(); bad_image[0x5] = 2; assert_eq!( Err(Error::BigEndianElfOnLittle), Elf::load(&gm, Some(kern...
Rust
0