text
string
label_name
string
labels
int64
import random as r def bestK(cost, neighbors, k, p): if p < 0.2: a = 0 b = 0.2 elif p < 0.4: a = 0.2 b = 0.4 elif p < 0.6: a = 0.4 b = 0.6 elif p < 0.8: a = 0.6 b = 0.8 else: a = 0.8 b = 1 a *= sum(cost) / len(cost)...
Python
1
"""task_queue base_result not null and check lowercase Revision ID: 88182596f844 Revises: 79604526d271 Create Date: 2021-05-05 09:30:04.702155 """ from alembic import op import sqlalchemy as sa from sqlalchemy.sql import func, column # revision identifiers, used by Alembic. revision = "88182596f844" down_revision ...
Python
1
import yaml slerp_yaml_config = """ slices: - sources: - model: /nas-wulanchabu/shitianyuan.sty/alignment-handbook/outputs_self_improving/1001/1001-dpo-iter-2-temp-0.8-sampling-5-lr-7.0e-7-bs-128-beta-0.01-FsfairX-save_datasets_with_len_control_for_chosen_by_avg_rm_score-2w/FsfairX-iter-1/last_checkpoint ...
Python
1
Output = Double; /// Negates this `Double`, producing a new `Double`. /// /// This implements the unary `-` operator for `Double`s. /// /// # Examples /// ``` /// # use qd::{dd, Double}; /// let x = -Double::PI; /// let expected = dd!("-3.1415926535897932384626433832795"); /// ...
Rust
0
# Examples ``` let mgrs = Mgrs::from("31U DQ 448251 11932"); let utm = mgrs.as_utm(); assert_eq!(&*utm.as_string(6), "31 N 448251 541193"); ``` */ // get easting specified by e100k let e100k_num = mgrs.gsid_100k.col.as_meters_from_zone(mgrs.gzd.zon...
Rust
0
use syntax::rowan::{TextRange, TextSize}; use syntax::{token::Token, SyntaxKind as SK}; /// A lexed input. #[derive(Debug)] pub struct Lex<'input> { /// The tokens of the input. /// /// Concatenated in sequence, they form the original input. pub tokens: Vec<Token<'input, SK>>, /// The errors encountered. ...
Rust
0
URRUlURRUlURRUlURR UlURR UlURRUl...
Python
1
self.assertEqual( self.packet_handler.packet_stats_tx, PacketStatsTx( icmp4__pre_assemble=1, icmp4__echo_reply__send=1, ip4__pre_assemble=1, ip4__mtu_ok__send=1, ether__pre_assemble=1, ether__src_unsp...
Python
1
); } #[test] fn runs_multiple_actions() { let mut pool = Static::new(2); let result = Arc::new(Mutex::new(String::new())); let action_result = Arc::clone(&result); let action = move || { let mut str_result = action_result.lock().unwrap(); *str_result ...
Rust
0
an_edit_organization(self): self.client.force_login(user=self.manager) data = OrganizationSerializer(instance=self.organization).data data['name'] = "Changed_Name" data = {k: v for k, v in data.items() if v} resp = self.client.put(self.url_organizations, data=dumps(data), content...
Python
1
from datetime import datetime, timedelta import sqlite3 import os import random from faker import Faker # Ensure database directory exists os.makedirs('database', exist_ok=True) # Create test_logs directory os.makedirs('test_logs', exist_ok=True) # Initialize Faker fake = Faker() # Database connection conn = sqlite...
Python
1
import sys print ('Name : Aditi') print ('Course : MCA') print ('Python Version : ', sys.version)
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ spawn_frequencyの単位と1秒あたりの出現数を詳細分析するスクリプト """ import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from core.enemy_spawn_manager import EnemySpawnManager def analyze_spawn_frequency_unit(): """spawn_frequencyの単位と出現数を詳細分析""" prin...
Python
1
eft = &node.left; let right = &node.right; if min.is_none() { *min = Some(node.val); } if min.unwrap() == node.val { let min_left = Self::find_second_minimum_value(&left, min); let min_right = Self::find_second_minimum_value...
Rust
0
AME")) .version(env!("CARGO_PKG_VERSION")) .author(env!("CARGO_PKG_AUTHORS")) .about(env!("CARGO_PKG_DESCRIPTION")) .arg( clap::Arg::with_name("conf") .short("c") .value_name("FILE") .help("Config file") .default...
Rust
0
200: collection_id = upload_result.get("data", {}).get("collectionId") if collection_id: # 更新数据库中的FastGPT知识库ID await feishu_service.db.execute( ...
Python
1
xkb::XIFeature::IndicatorMaps` enum variant. /// /// This is a variant of [`xcb_xkb_xi_feature_t`]. pub const XCB_XKB_XI_FEATURE_INDICATOR_MAPS: xcb_xkb_xi_feature_t = 8; /// The `xkb::XIFeature::IndicatorState` enum variant. /// /// This is a variant of [`xcb_xkb_xi_feature_t`]. pub const XCB_XKB_XI_FEATURE_INDICATOR_...
Rust
0
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)] /// An RGB color. Each component may only go up to 63 pub struct RgbColor { r: u8, g: u8, b: u8, } impl RgbColor { /// Create a new RgbColor from the individual component values pub fn new(r: u8, g: u8, b: u8) -> Self { let self_ = Self { ...
Rust
0
NVIC_ICER {} #[doc = "`write(|w| ..)` method takes [nvic_icer::W](nvic_icer::W) writer structure"] impl crate::Writable for NVIC_ICER {} #[doc = "IInterrupt Clear-enable Register"] pub mod nvic_icer; #[doc = "Interrupt Set-pending Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::g...
Rust
0
# DATAMIMIC # Copyright (c) 2023-2025 Rapiddweller Asia Co., Ltd. # This software is licensed under the MIT License. # See LICENSE file for the full text of the license. # For questions and support, contact: info@rapiddweller.com from xml.etree.ElementTree import Element from datamimic_ce.constants.element_constants ...
Python
1
} } if at_least_one == false { panic!("No match for \"{}\"", current_text); } } return matched_tokens; } use fxhash::FxHashMap; use msfs::legacy::NamedVariable; use systems::failures::FailureType; pub(super) struct Failures { activate_sim_var: NamedVariable, ...
Rust
0
s[-1]) else: parent = model fields.append(parent._meta.get_field(piece)) return fields def remove_trailing_data_field(fields): """ Discard trailing non-relation field if extant. """ try: get_model_from_relation(fields[-1]) except NotRelationField: fields = f...
Python
1
from odoo import models, api class ResLang(models.Model): _name = 'res.lang' _inherit = ['res.lang', 'pos.load.mixin'] @api.model def _load_pos_data_fields(self, config_id): return ['id', 'name', 'code', 'flag_image_url', 'display_name']
Python
1
author=query.author, ) log(result, use_pprint=True, level=LogLevel.DEBUG) results.append(result) return results def run_query_for_instance(instance: Instance, query: Query) -> Profile | None: retriever_getter = get_retriever_getter(instance.number_of_examples) llm = OpenAILan...
Python
1
option, the version determined from the symbols * dynamically loaded. * */ pub fn OCI_GetOCIRuntimeVersion() -> ::std::os::raw::c_uint; } extern "C" { /** * @brief * Return the Oracle shared library import mode * * @note * Possible values are: * - OCI_IMPORT_MODE_LINKAGE * - OCI_IMPORT_MODE_RUNTIME...
Rust
0
og_gc_threshold: RAFT_LOG_GC_THRESHOLD, raft_log_gc_count_limit: RAFT_LOG_GC_COUNT_LIMIT, raft_log_gc_size_limit: RAFT_LOG_GC_SIZE_LIMIT, split_region_check_tick_interval: SPLIT_REGION_CHECK_TICK_INTERVAL, region_max_size: REGION_MAX_SIZE, region_split_size: R...
Rust
0
} impl ::std::fmt::Debug for cs_x86_op { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { write ! ( f , "cs_x86_op {{ type: {:?}, __bindgen_anon_1: {:?}, size: {:?}, avx_bcast: {:?}, avx_zero_opmask: {:?} }}" , self . type_ , self . __bindgen_anon_1 , self . size , self . avx_bcast , sel...
Rust
0
# -*- coding: utf-8 -*- # $Id: ru.py 7123 2011-09-12 08:28:31Z milde $ # Author: Roman Suzi <rnd@onego.ru> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be...
Python
1
below_three_characters() { for name in Names::new() { assert!(name.len() < 3); } } } // Generate getters and setters that manipulate the right range of bits // corresponding to each field. // // // ║ first byte ║ second byte ║ third byte ║ fourth byte ║ // ╟────────────...
Rust
0
std_call("GDALComputeRasterStatistics"), [ c_void_p, c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double), POINTER(c_double), c_void_p, c_void_p, ], ) # Reprojection routine reproject_image = void_output( std_call("GDALReprojectImage...
Python
1
# -*- coding: utf-8 -*- ''' Checks the computation of the interaction diagram. Home made test.''' from __future__ import division from __future__ import print_function __author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)" __copyright__= "Copyright 2015, LCPT and AOO" __license__= "GPL" __version__= "3.0" __e...
Python
1
// Just try to update the timestamp. if util::touch(&path, UnixTime::now()).is_ok() { return Ok(newhash); } } let text = prometheus(&*PEER_STATS.read()); write_file(&path, text).await?; } Ok(newhash) } // Write temporary file and rename into pl...
Rust
0
''' The MIT License(MIT) Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com) 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 right...
Python
1
= rearrange(out, 'b h n d -> b n (h d)') return self.to_out(out) class Transformer(nn.Module): def __init__(self, dim, depth, heads, dim_head, mlp_dim, dropout = 0.): super().__init__() self.norm = nn.LayerNorm(dim) self.layers = nn.ModuleList([]) for _ in range(depth): ...
Python
1
usive, RangeTo, RangeToInclusive, }, rc::Rc, }; /// This trait is used to describe constraints with different types. pub trait InsideFunc<T> { /// Returns constraint as a function. fn contains_func(self) -> Rc<dyn Fn(&T) -> bool>; } impl<T: PartialEq + 'static> InsideFunc<T> for Vec<T> { fn contai...
Rust
0
from DATABASE import db # De apelat la start import time from datetime import datetime now_epoch = time.time() now_human = datetime.now() now_from_epoch = datetime.fromtimestamp(now_epoch) print("Timp din time.time():", now_epoch) print("Timp sistem (datetime.now()):", now_human) print("Timp convertit din time.time...
Python
1
} /// The neuron that acts as the input of this connection pub fn in_neuron_id(&self) -> usize { self.in_neuron_id } /// The neuron that acts as the output of this connection pub fn out_neuron_id(&self) -> usize { self.out_neuron_id } } impl Gene for ConnectionGene { type Id ...
Rust
0
} 0xDF => { self.setb_r8(3, R8::A); } 0xE0 => { self.setb_r8(4, R8::B); } 0xE1 => { self.setb_r8(4, R8::C); } 0xE2 => { self.setb_r8(4, R8::D); } 0xE3 => { self.setb_r8(4, R8::E); } 0xE4 => { self.setb_r8(4, R8::H); } 0xE5 => { se...
Rust
0
import os.path from .problemBase import problemBase import numpy as np class TipCantilever_30_20_20_push(problemBase): problemName = 'TipCantilever_30_20_20_push' def __init__(self): super().__init__() self.name = 'TipCantilever_30_20_20_push' self.mesh, self.boundaryCondition, self...
Python
1
=0.5) plt.ylim(-30, 650) plt.xlim(-30, 650) plt.scatter(grid_x, grid_y) plt.scatter(point_h * 32, point_w * 32, c='black') plt.gca().invert_yaxis() anchor_left = grid_x - anchor_w / 2 anchor_top = grid_y - anchor_h / 2 rect1 = plt.Rectangle([anc...
Python
1
from typing import Tuple from Bio.PDB import PDBParser from Bio.PDB.Polypeptide import is_aa def verify(input_file: str, solution_file: str) -> Tuple[bool, str]: """ Verifies if the generated sequence in solution_file consists only of 'H' and 'P' characters and matches the expected length from the input P...
Python
1
# Copyright (C) 2022 - Today: camptocamp (https://www.camptocamp.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "PoS Hide Cost and Margin", "summary": "Hide Cost and Margin on PoS", "version": "17.0.1.0.0", "category": "Point Of Sale", "author": "CampToCamp, Odo...
Python
1
00u8, 0x98u8, 0xe8u8, 0x79u8, 0x77u8, 0x79u8, 0x40u8, 0xc7u8, 0x8cu8, 0x73u8, 0xfeu8, 0x6fu8, 0x2bu8, 0xeeu8, 0x6cu8, 0x03u8, 0x52u8 ] )); fn is_negative(x: Ed25519FieldElement) -> U8 { if x.bit(0) { U8(1u8) } else { U8(0u8) } } fn compress(p: EdPoint) -> CompressedE...
Rust
0
State { ssrc, replay_detector: Some((self.new_srtp_replay_detector)()), ..Default::default() }; self.srtp_ssrc_states.entry(ssrc).or_insert(s); self.srtp_ssrc_states.get_mut(&ssrc) } fn get_srtcp_ssrc_state(&mut self, ssrc: u32) -> Option<&mut SrtcpS...
Rust
0
= test::TestRequest::default() .method(method) .uri(path.unwrap_or("/wms/df756642-c5a3-4d72-8ad7-629d312ae993?request=GetMap&service=WMS&version=1.3.0&layers=df756642-c5a3-4d72-8ad7-629d312ae993&bbox=1,2,3,4&width=100&height=100&crs=EPSG:4326&styles=ssss&format=image/png")) .append_...
Rust
0
from email_validator import ( validate_email, EmailNotValidError, ) from app.utils import convert_to_id # allow also + and @ that are present in a reply address _ALLOWED_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.+@" def is_valid_email(email_address: str) -> bool: """ ...
Python
1
etrics::{ model::{Config, Db, Dependencies}, MetricsRequest, }; use serde::Deserialize; use std::{ net::{IpAddr, SocketAddr}, sync::{ mpsc::{sync_channel, SyncSender}, Arc, Mutex, }, thread, }; use tokio::runtime::Runtime; use tokio::time; use tracing::{error, info}; use warp::Fi...
Rust
0
} } } /// Mixes the states, which should improve the quality of the random numbers. /// /// Should be called when having (re-)seeded the generator with a fixed value of low randomness. pub fn mix(&mut self) { (0..10).into_iter().for_each(|_| { self.next(); ...
Rust
0
o the screen pub struct Context { vertices: Vec<UIVert>, indices: Vec<u32>, } impl Context { fn new() -> Self { Self { vertices: Vec::new(), indices: Vec::new(), } } fn flush(self, device: Arc<Device>) -> (Arc<CpuAccessibleBuffer<[UIVert]>>, Arc<CpuAccessibl...
Rust
0
p(); batch.add_command(7, Command::Clean); batch.put(7, b"key".to_vec(), b"value".to_vec()); batch.delete(7, b"key2".to_vec()); batch .add_entries::<Entry>(7, &generate_entries(1, 11, Some(&entry_data))) .unwrap(); batches.push((batch, entry_data)); ...
Rust
0
pub config: Value, } #[cfg(feature = "file")] impl<'de> de::Deserialize<'de> for FilterConfig { fn deserialize<D>(d: D) -> Result<FilterConfig, D::Error> where D: de::Deserializer<'de>, { let mut map = BTreeMap::<Value, Value>::deserialize(d)?; let kind = match map.remove(&Value::S...
Rust
0
import logging.config import pytest from src.auth.utils import get_config, get_secrets from src.tests.config_test import client logging.basicConfig(level=logging.DEBUG) config = get_config() secrets = get_secrets() @pytest.mark.asyncio async def test_playground(client): token = secrets['api_tokens']['token'] ...
Python
1
} pub(crate) fn get_get_json_method() -> errors::Result<jmethodID> { get_cached!( GET_JSON_METHOD, { let env = get_thread_local_env()?; let get_json_method_signature = "()Ljava/lang/String;"; let cstr1 = utils::to_c_string("getJson"); let cstr2 = ut...
Rust
0
from_address(addr: &Address) -> Option<PointerAddress> { match &addr.variant { AddrType::Ptr(ptr) => Some(ptr.clone()), _ => None, } } } #[cfg(test)] mod tests { use super::*; use crypto::*; #[test] fn variable_nat_encoding() { let cases = [ ...
Rust
0
} #[test] fn z_for_aa_returns_expected_value() { assert_eq!(z_algorithm("aa"), vec![2, 1]); } #[test] fn z_for_aaa_returns_expected_value() { assert_eq!(z_algorithm("aaa"), vec![3, 2, 1]); } #[test] fn z_for_aaaa_returns_expected_value() { assert_eq!(z_algorithm("aaab"), vec![4, 2, 1, 0...
Rust
0
and not employee in task.project.members.all() ): raise ValidationError(_("Employee not included in this task")) elif self.project_id: if ( not employee in self.project_id.managers.all() and not employee in...
Python
1
attack_worker.classifier = None attack_worker.optimizer = None attack_worker.criterion = nn.BCELoss() self._workers[self.attack_party].apply(init_worker, self.origin_target_idx) def on_epoch_begin(self, epoch=None, logs=None): def reset_target_hiddens(attack_worker...
Python
1
from .accumulator import Acc from .atomic.atomic_fetch_op import ( atomic_fetch_add, atomic_fetch_and, atomic_fetch_div, atomic_fetch_lshift, atomic_fetch_max, atomic_fetch_min, atomic_fetch_mod, atomic_fetch_mul, atomic_fetch_or, atomic_fetch_rshift, atomic_fetch_sub, atomic_fetch_xor, atomic_compa...
Python
1
None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[242, 15, 124, 215], OperandSize::Dword) } fn haddps_2() { run_test(&Instruction { mnemonic: Mnemonic::HADDPS, operand1: Some(Direct(XMM3)), operand2: Some(IndirectDisplaced(EBX, 1126657778, Some(OperandSize::Xmm...
Rust
0
# ************************************************************************* # 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 require...
Python
1
num1 = int(input("Insira um valor inteiro ")) num2 = int(input("Insira um segundo valor inteiro ")) if num1 == num2: print("Os dois número são iguais") elif num1 > num2: print(f"O número {num1} é maior que o {num2}") else: print(f'O número {num2} é maior que {num1}')
Python
1
class Solution: def mostBooked(self, n: int, meetings: List[List[int]]) -> int: count = [0] * n meetings.sort() occupied = [] # (endTime, roomId) availableRoomIds = [i for i in range(n)] heapq.heapify(availableRoomIds) for start, end in meetings: # Push meetings ending before this `m...
Python
1
eSummary>> { let input = match input.stages { None => return None, Some(t) => t, }; Some(input) } <filename>rust-examples/split-sourcecode/src/main.rs use split_sourcecode::{foo, qux}; fn main() { let s = foo::get(); println!("{}", s); let s = qux::get(); println!("{}", s);...
Rust
0
x11] : "call_indirect", // tail-call proposal ReturnCall(ast::IndexOrRef<'a, kw::func>) : [0x12] : "return_call", ReturnCallIndirect(CallIndirect<'a>) : [0x13] : "return_call_indirect", // function-references proposal CallRef : [0x14] : "call_ref", ReturnCallRef : [0x15...
Rust
0
ber of frame transmission failures due to abort error."] #[doc = "** Format: `L` (Read-only) */"] pub const SPINEL_PROP_CNTR_TX_ERR_ABORT: ::std::os::raw::c_uint = 1294; #[doc = " The total number of received packets."] #[doc = "** Format: `L` (Read-only) */"] pub const SPINEL_PROP_CNTR_RX_PKT_TOTAL: ::std::os::raw::c_...
Rust
0
# # Copyright 2016 Keunhong Lee # # 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 applicable law or agreed to in ...
Python
1
from peewee import * from app.modules.db.db_model import connect, MultiCheck # Get the migrator for the current database migrator = connect(get_migrator=True) def upgrade(): # Add multi_check_id column to smon table field = ForeignKeyField(MultiCheck, field=MultiCheck.id, null=True, on_delete='CASCADE') ...
Python
1
*realloc = Some(vec![buffer]); } else { *realloc = Some(vec![self.box_clone(), other]); } Ok(()) } fn pop( &mut self, interp: &Artichoke, realloc: &mut Option<Vec<Box<dyn ArrayType>>>, ) -> Result<Value, Exception> { let _ = interp; ...
Rust
0
/// How deep in the demangling are we? pub recursion_level: u32, } /// An RAII type to automatically check the recursion level against the /// maximum. If the maximum has been crossed, return an error. Otherwise, /// increment the level upon construction, and decrement it upon destruction. struct AutoParseDem...
Rust
0
rmse_per_node=rmse_per_node, meta=np.array(meta, dtype=object), ) print(f"Saved: {OUT_PATH}") print(f"Shapes -> y_hat_test: {y_hat_test.shape}, uncert_test: {uncert_test.shape}, y_future_test: {y_future_test.shape}") print(f"MAE/RMSE per step shape: {mae_per_step.shape}, MAE/RMSE per nod...
Python
1
''' Created on May 28, 2013 @author: tnguyen7 ''' class Furnishing: def __init__(self, room): self.room = room class Sofa(Furnishing): pass class Bookshelf(Furnishing): pass class Bed(Furnishing): pass class Table(Furnishing): pass def map_the_home(home): """ Convert a furn...
Python
1
# -*- coding: utf-8 -*- """ @Create on 2025/1/21 19:13 @file: init_redis.py @author: Jerry """ from algoBroker.brokerMgr import BrokerMgr from algoUtils.loggerUtil import generate_logger logger = generate_logger() redis_host = BrokerMgr.get_wsl_ip() # u could set ur redis host here! config_port = 6001 # config por...
Python
1
mework_files.add((str(dest_path.parent.parent / "Current"), str(dest_path.parent.name), "SYMLINK")) dest_framework_path = dest_path.parent.parent.parent # Top-level .framework directory path. # Symlink the binary in the `Current` directory to the top-level .framework directory. framework_file...
Python
1
pairwise corresponding masks. Args: masks1: A tensor of size [num_masks, num_points] with values ranging between 0 and 1. masks2: A tensor of size [num_masks, num_points] with values ranging between 0 and 1. Returns: A tensor of size [num_masks]. """ masks1 = tf.cast(masks1, dtype=tf....
Python
1
bits, assignments: vec![], } } use lucet_runtime_tests::{guest_fault_common_defs, guest_fault_tests}; guest_fault_common_defs!(); guest_fault_tests!(lucet_runtime::MmapRegion); use std::io::{self, BufRead}; const INPUT: &'static str = include_str!("../inputs/day2.txt"); // todos: comparing `char` with `...
Rust
0
:StaticRcRef; /// /// type Full<'a> = StaticRcRef<'a, i32, 1, 1>; /// /// let mut value = 42; /// let rc = Full::new(&mut value); /// let inner: &mut i32 = Full::into_inner(rc); /// assert_eq!(42, *inner); /// ``` #[inline(always)] pub fn into_inner(this: Self) -> &'a mut T { ...
Rust
0
0) }; assert_eq!(unsafe { storage.remove_unchecked(&b) }, Some(32)); assert_eq!(unsafe { storage.remove_unchecked(&a) }, Some(20)); assert_eq!(unsafe { storage.remove_unchecked::<i64>(&a) }, None); } #[test] fn zero_size_types() { struct ZeroSize; let mut storage ...
Rust
0
from typing import List, Tuple, Union import numpy as np IMG_FPS = 120 # an FPS placeholder for images def process_mask_strategies( mask_strategies: List[Union[str, None]] ) -> List[Union[List[List[Union[int, float]]], None]]: default_strategy = [1, 0, 0, 0, 1, 0.0] processed = [] for mst in mask_s...
Python
1
e with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expre...
Rust
0
pstubmsg: *mut MIDL_STUB_MESSAGE, pstubdescriptor: *mut MIDL_STUB_DESC) -> *mut u8; #[doc = "*Required features: `\"Win32_System_Rpc\"`, `\"Win32_System_Com\"`*"] #[cfg(feature = "Win32_System_Com")] pub fn NdrServerInitializeMarshall(prpcmsg: *mut RPC_MESSAGE, pstubmsg: *mut MIDL_STUB_MESSAGE); #[doc =...
Rust
0
se) def _generate_xml(self): node = ElementTree.Element(self.tag) node.set("process", self.process) node.set("args", self.arguments) node.set("line_per_arg", str(self.args_per_line)) node.set("exec_on_release", str(self.exec_on_release)) return node ...
Python
1
ceduralContinuousAssignmentDeassign { nodes: (a, b) }, )), )) } #[tracable_parser] #[packrat_parser] pub(crate) fn procedural_continuous_assignment_force_variable( s: Span, ) -> IResult<Span, ProceduralContinuousAssignment> { let (s, a) = keyword("force")(s)?; let (s, b) = variable_assignment(s...
Rust
0
3*8/trSize80000-160') assert rootPath.exists() for eval_res_path in rootPath.glob("**/evaluation-temp*"): print(eval_res_path) # # 1. extract the loss and perplexity values of the checkpoitn model (stored in the parent directory) over the clean test set # if (eval_res_path.parent / 'pe...
Python
1
import os ROS_VERSION = int(os.environ.get('ROS_VERSION', 0)) if ROS_VERSION == 1: from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( packages=['ros_compatibility'], package_dir={'': 'src'} ) setup(**d) eli...
Python
1
; Ok(()) } use std::convert::TryFrom; use proc_macro::{Spacing, TokenStream, TokenTree}; use litrs::{Literal, IntegerLit, StringLit}; /// Concatinates all input string and char literals into a single output string /// literal. #[proc_macro] pub fn concat(input: TokenStream) -> TokenStream { let mut out = Stri...
Rust
0
utlives` chain reaching a live origin at a specific point. #[test] fn send_is_not_static_std_sync() { // Reduced from rustc test: ui/span/send-is-not-static-std-sync.rs // (in the functions: `mutex` and `rwlock`) let program = r" placeholders { } block B0 { loan_issued_at('a, L0...
Rust
0
}, up: {}", next_row, up ); continue; } else if line.is_empty() { trace!( "extract_docs: ignoring empty line, next_row: {:?}, up: {}", next_row, up ); continue; } e...
Rust
0
pub trait AsGhostActor: 'static + Send + Sync { /// Raw type-erased invoke function. /// You probably want to use a higher-level function /// with better type safety. fn __invoke( &self, invoke: RawInvokeClosure, ) -> GhostFuture<Box<dyn std::any::Any +...
Rust
0
nt(By.TAG_NAME, 'a') link = link_element.get_attribute('href') # Prepend base URL if link is relative if link and not link.startswith("http"): link = "https://www.ajio.com" + link except NoSuchElemen...
Python
1
s_conditional( line: &str, cfn_resources: &HashMap<String, Value>, ) -> Result<ConditionalRule, String> { let caps = CONDITIONAL_RULE_REG.captures(line).unwrap(); trace!("ConditionalRule regex captures are {:#?}", &caps); if RULE_REG.is_match(&caps["condition"]) || RULE_WITH_OPTIONAL_MESSAG...
Rust
0
nt::<7>::new(0) ^ uint::<7>::new(42), uint::<7>::new(42)); assert_eq!(uint::<7>::new(0x10) ^ &uint::<7>::new(0x1), uint::<7>::new(0x11)); assert_eq!(&uint::<7>::new(11) ^ &uint::<7>::new(1), uint::<7>::new(10)); } #[test] fn test_bitxor_assign() { let mut x = uint::<12>::new(4); ...
Rust
0
} }use crate::fs::OpenOptions; use io_lifetimes::AsHandle; use std::{fs, io}; use winapi::shared::minwindef::DWORD; use winapi::shared::winerror::ERROR_INVALID_PARAMETER; use winapi::um::winbase::{ FILE_FLAG_DELETE_ON_CLOSE, FILE_FLAG_OPEN_REPARSE_POINT, FILE_FLAG_WRITE_THROUGH, SECURITY_CONTEXT_TRACKING, ...
Rust
0
, default=None Target names used for plotting. By default, `labels` will be used if it is defined, otherwise the unique labels of `y_true` and `y_pred` will be used. include_values : bool, default=True Includes values in confusion matrix. xticks_rotation...
Python
1
ap(); PublicKey::from_slice(secp, &pk_bytes) .unwrap() } /// Deserialize a pedersen commitment from a hex encoded string /// /// # Arguments /// /// * `com` commitment encoded as hex string pub fn deserialize_commitment(com: &String) -> Commitment { Commitment::from_vec(hex::decode(com).expect("Failed ...
Rust
0
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from cleo.commands.command import Command class CommandLoader: @property def names(self) -> list[str]: """ All registered command names. """ raise NotImplementedError def get(self,...
Python
1
#!/usr/bin/env python3 # import json # import os.path as osp # cf. http://tinyurl.com/yd7mbzp3 from solc import compile_standard from cpc_fusion import Web3, HTTPProvider from cpc_fusion.contract import ImplicitContract # solidity source code contract_source_code = ''' pragma solidity ^0.4.0; contract Greeter { ...
Python
1
+ old_counter) { return Err(DSAGenError::TooManyGenAttempts); } // 21. t = t + 1 t = &t + &one; // 22. Go to step 11. } } fn validate_provable_primes<G: Rng>(rng: &mut G, p: &BigUint, q: &BigUint, e...
Rust
0
com/InCallService$VideoCall", java.flags == PUBLIC | ABSTRACT, .name == "setPauseImage", .descriptor == "(Landroid/net/Uri;)V" unsafe { let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into())]; let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env); ...
Rust
0
.iter()); acc }, ) .reduce(|| 0f32, |a, b| a + b) / num_snps as f32; let yy = sum_of_squares(normalized_pheno_arr.iter()); b[0] = yky as f64; b[num_gxg_components + 1] = yy; println!("yky: {}\nyy: {}", yky, yy); println!("\n=> estimating traces re...
Rust
0
| GcTimer(ref value) | MulticastMembershipInterval(ref value) | MulticastQuerierInterval(ref value) | MulticastQueryInterval(ref value) | MulticastQueryResponseInterval(ref value) | MulticastLastMemberInterval(ref value) ...
Rust
0