text
string
label_name
string
labels
int64
isplay() # COMMAND ---------- ( df_estoque_receita .groupBy('CdSku', 'CdFilial') .agg( F.round(F.sum('Media90_Receita_venda_estq'), 2).alias('Soma_media_receita'), F.round(F.mean('DDE'), 2).alias('DDE_medio'), F.round(F.sum('ReceitaPerdidaRuptura'), 2).alias('Re...
Python
1
} else if let Some(body) = self.body.take() { seed.deserialize(body.into_deserializer()) } else { Err(de::Error::custom("invalid HCL block")) } } } pub struct BlockLabelDeserializer { value: BlockLabel, } impl<'de> IntoDeserializer<'de, Error> for BlockLabel { typ...
Rust
0
nel, 4, in_channel // 4) x = x[:, [0, 2, 1, 3], :].transpose(1, 2).reshape(out_channel, in_channel) return x def correct_unfold_norm_order(x): in_channel = x.shape[0] x = x.reshape(4, in_channel // 4) x = x[[0, 2, 1, 3], :].transpo...
Python
1
rx_by_core: Receiver<ToCore>, timers: HashSet<TimerHandle>, websockets: HashMap<WSHandle, Sender<WSControl>>, tx_welcome_to_app: Sender<Value>, tx_messages_to_app: Sender<Vec<u8>>, tx_code_to_app: Sender<String>, tx_verifier_to_app: Sender<Vec<u8>>, tx_versions_to_app: Sender<Value>, ...
Rust
0
let mut m = Matrix::uninitialized(); ffi::graphene_quaternion_to_matrix(self.to_glib_none().0, m.to_glib_none_mut().0); m } } #[doc(alias = "graphene_quaternion_to_radians")] pub fn to_radians(&self) -> (f32, f32, f32) { unsafe { let mut rad_x = mem::Mayb...
Rust
0
# SPDX-FileCopyrightText: (c) UIUC PurpCode Team # # SPDX-License-Identifier: Apache-2.0 import os import tempfile import uuid from typing import List from eval.oracles.secure_code_oracles import run_analyzers_in_batch PURPCODE_CODE_ANALYZER = os.getenv("PURPCODE_CODE_ANALYZER", "codeguru") # or "codeql" def anal...
Python
1
od self.figures = figures self.startX = startX self.startY = startY self.width = width self.height = height def apply_ui_panel_control(info: list): ''' 控制主图界面展示 用法: apply_ui_panel_control(info:list[UIPanel]) 参数: info,list[UIPanel]类型,每个UIPanel为一个行情页面,cod...
Python
1
symbols.push(s); } else if let Some(s) = helpers::is_at_sign(&mut pointer) { symbols.push(s); } else if let Some(s) = helpers::is_add_sign(&mut pointer) { symbols.push(s); } else if let Some(s) = helpers::is_minus_sign(&mut pointer) { symbols.pu...
Rust
0
$($st:tt),+,},)=>{ flags!($($st),+,) }; } #[macro_export] /// Returns alias for Command Construction macro_rules! alias { () => { $crate::vector!(;:String) }; (None) => { $crate::vector!(;:String) }; (=[$($at:tt)*],,$($t:tt)*)=>{ alias!(=[$($at)*],$($t)*) }; (=[$($at:tt)*],)=>{ $crate::vector!($($at)...
Rust
0
0.5); // Hue, Saturation, Brightness, Alpha /// assert_eq!(c.channels(), [204, 0, 61, 128]); /// ``` #[macro_export] macro_rules! hsb { ($gray:expr) => { hsb!(0.0, 0.0, $gray) }; ($gray:expr, $a:expr$(,)?) => { hsb!(0.0, 0.0, $gray, $a) }; ($h:expr, $s:expr, $b:expr$(,)?) => { ...
Rust
0
..eax }; let ecx = Register { uc_reg: unicorn::RegisterX86::ECX, text: String::from("ECX"), ..eax }; let edx = Register { uc_reg: unicorn::RegisterX86::EDX, ...
Rust
0
"m": [16, 0], "n": [17, 0], "o": [18, 0], "p": [19, 0], "q": [20, 0], "r": [21, 0], "s": [22, 0], "t": [23, 0], "u": [24, 0], "v": [25, 0], "w": [26, 0], "x": [27, 0], "y": [28, 0], "z": [29, 0], "{": [47, 66], "|": [30, 64], "}": [48, 66], "~": [33...
Python
1
from __future__ import annotations from trame.decorators import TrameApp, change from trame_client.widgets.core import Template from trame_server import Server from trame_vuetify.widgets.vuetify3 import VCard, VCardText, VMenu, VRadio, VRadioGroup from trame_slicer.core import LayoutManager, SlicerApp from .control_...
Python
1
).unsqueeze(1) * uniform_step + x_sorted[0] - margin ) grid = self.grid_eps * grid_uniform + (1 - self.grid_eps) * grid_adaptive grid = torch.concatenate( [ grid[:1] - uniform_step * torch.ar...
Python
1
4 SCROLLBAR_LOWERTRACKHORZ_HOVER, 4, 5 SCROLLBAR_UPPERTRACKHORZ_NORMAL, 5, 1 SCROLLBAR_UPPERTRACKHORZ_HOT, 5, 2 SCROLLBAR_UPPERTRACKHORZ_PRESSED, 5, 3 SCROLLBAR_UPPERTRACKHORZ_DISABLED, 5, 4 SCROLLBAR_UPPERTRACKHORZ_HOVER, 5, 5 SCROLLBAR_LOWERTRACKVERT_NORMAL, 6, 1 SCROLLBAR_LOWERTRACKVERT_HOT, 6, 2...
Rust
0
in enumerate(data_loader): end = time.time() if isinstance(input_data,dict): X, targets = self.get_input(input_data) else: X,targets=input_data[0],input_data[1] # measure data loading time X=X.view(1,X.shape[0],X.shape[1],X.sha...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayCommerceEcDepartmentUpgradeCancelModel(object): def __init__(self): self._enterprise_id = None self._process_id = None @property def enterprise_id(self): re...
Python
1
) else: print( f"ℹ️ {agent_name}: Skipping item: {new_item.__class__.__name__}" ) input_items = result.to_input_list() current_agent = result...
Python
1
_ in progress_bar: # Находим наиболее частотную пару токенов для склеивания в один токен cnt = count_pairs(<YOUR CODE HERE>) pair = <YOUR CODE HERE> freq = cnt[pair] progress_bar.set_description(f'pair={pair}, freq={freq}') if freq == 1: ...
Python
1
#Day1 # Time Complexities of Array Ops # Initial List arr = [4, 6, 9, 3, 7, 2] # Access & Update print(f"First element is: {arr[0]}") # Access by index → O(1) arr[3] = 88 # Update value at index → O(1) print(f"Modified list (insert 88 at index 3): {arr}") # Adding / Removing Elements ...
Python
1
# -*- coding: utf-8 -*- # Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is # holder of all proprietary rights on this computer program. # You can only use this computer program if you have closed # a license agreement with MPG or you get the right to use the computer # program from someone who is...
Python
1
0; } with_table(font, table_tag, |table| { let script_by_tag = |tag| table.scripts().position(|s| s.tag() == tag); for script in scripts { if let Some(idx) = script_by_tag(*script) { unsafe { *script_index = idx as u32; *chose...
Rust
0
#[strum(serialize = "gzip", serialize = "gzip-6")] Gzip = 10u64, #[strum(serialize = "gzip-1")] Gzip1 = 5u64, #[strum(serialize = "gzip-2")] Gzip2 = 6u64, #[strum(serialize = "gzip-3")] Gzip3 = 7u64, #[strum(serialize = "gzip-4")] Gzip4 = ...
Rust
0
have 8 nozzles per well, and a 96 channel with a rectangle config from A1 to D12 would have 4 nozzles per well. """ _, target_column_index = row_col_ordinals_from_column_major_map( target_well, target_wells_by_column ) # labware as or more dense than a 96 plate will only ever have 1 nozzle ...
Python
1
(i64), SchemaKind::Type(openapiv3::Type::Boolean{}) => quote!(bool), SchemaKind::Type(openapiv3::Type::Object(o)) => { quote!(serde_json::Value) } SchemaKind::Type(openapiv3::Type::Array(a)) => { let inside = a.items .as...
Rust
0
tened_job); } } Ok(jobs) } // TODO: does this really need to return an option? fn make_job( pr: PullRequest, job_config: JobConfig, make_definition: &MakeDefinition, ) -> Option<HydraJobset> { let job_config_clone = job_config.clone(); Some(HydraJobset { enabled: true, ...
Rust
0
# encoding:utf-8 """ wechaty channel Python Wechaty - https://github.com/wechaty/python-wechaty """ import asyncio import base64 import os import time from wechaty import Contact, Wechaty from wechaty.user import Message from wechaty_puppet import FileBox from bridge.context import * from bridge.context import Conte...
Python
1
ines_after: Vec<String> = Vec::new(); let result = SearchResult::new( pattern, Some(file.clone()), linenum, match_start_index, match_end_index, line.clone(), lines_before, lines_after, ); let expected...
Rust
0
s1 = {1,45,6,78} s2 ={7,8,1,78} print(s1.union(s2)) print(s1.intersection(s2))
Python
1
cation cannot be moved outside # this loop, because var_values might range over a # dimension in the output. # If C is +inf here (because Z was 0), then this will # result in nan, because term will be 0 and 0 * inf is nan. ...
Python
1
T_SIGNAL_ERR_SPEC>); impl core::ops::Deref for W { type Target = crate::W<EN_INT_SIGNAL_ERR_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl core::ops::DerefMut for W { #[inline(always)] fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } ...
Rust
0
DEFENDANT = "Defendant" PROSECUTOR = "Prosecutor" ROUNDS = 6
Python
1
ialize, Deserialize, Clone, Copy, Debug, PartialEq)] pub enum OrderRestrictions { /// Program Trade #[serde(rename = "1")] ProgramTrade, /// Index Arbitrage #[serde(rename = "2")] IndexArbitrage, /// Non-Index Arbitrage #[serde(rename = "3")] NonIndexArbitrage, /// Competing Market Maker #[serde(rename = "4"...
Rust
0
aLoader( TensorDataset(tensors['X_test'], tensors['Y_test']), shuffle=False, batch_size=num_test, pin_memory=True) num_calib = len(tensors['X_calib']) calib_loader = DataLoader( TensorDataset(tensors['X_calib'], tensors['Y_calib']), shuffle=False, batch_size=num_calib, pin_memor...
Python
1
with_balance(&coins(2, "token")); // insert order and lexicographical order are different let acct1 = String::from("acct01"); let acct2 = String::from("zebra"); let acct3 = String::from("nice"); let acct4 = String::from("aaaardvark"); let expected_order = [acct4.clone(),...
Rust
0
@plt_settings() def plot_mc_curve(px, py, save_dir=Path('mc_curve.png'), names=(), xlabel= 'Confidence', ylabel='Metric', on_plot=None): """Plots a metric-confidence curve.""" fig, ax = plt.subplots(1, 1, figsize=(9, 6), tight_layout=True) if 0 < len(names) < 21: for i, y in enumerate(py): ...
Python
1
def reorder(self, tokens: torch.Tensor, centers: torch.Tensor) -> torch.Tensor: """Reorders the tokens based on the sorted indices. Args: tokens: The tokens. Shape: (B, N, E) centers: The center points. Shape: (B, N, C) Returns: reordered_t...
Python
1
Value::from(&mka_cak_flags).to_glib_none().0, ); } } #[cfg(any(feature = "v1_6", feature = "dox"))] fn set_property_mka_ckn(&self, mka_ckn: Option<&str>) { unsafe { gobject_sys::g_object_set_property( self.to_glib_none().0 as *mut gobject_...
Rust
0
def get_device_names(self): device_names = [] for i in range(pynvml.nvmlDeviceGetCount()): handle = pynvml.nvmlDeviceGetHandleByIndex(i) device_name = pynvml.nvmlDeviceGetName(handle).decode('utf-8') device_names.append(device_name) return device_names
Python
1
nvml_available = False try: try: pynvml.nvmlInit() nvml_available = True except Exception: # On Jetson, NVML is not supported. nvml_available = False finally: if nvml_available: pynvml.nvmlShutdown() CudaPlatform = NvmlCudaPlatform if nvml_available else NonNvmlCudaP...
Python
1
= -2; pub const HTS_IDX_START: i32 = -3; pub const HTS_IDX_REST: i32 = -4; pub const HTS_IDX_NONE: i32 = -5; pub const HTS_FMT_CSI: u32 = 0; pub const HTS_FMT_BAI: u32 = 1; pub const HTS_FMT_TBI: u32 = 2; pub const HTS_FMT_CRAI: u32 = 3; pub const HTS_IDX_SAVE_REMOTE: u32 = 1; pub const HTS_IDX_SILENT_FAIL: u32 = 2; p...
Rust
0
ff00; text-decoration-color: #00ff00} .r2 {font-weight: bold} .r3 {color: #000080; text-decoration-color: #000080} .r4 {color: #f8f8f2; text-decoration-color: #f8f8f2; background-color: #272822} .r5 {background-color: #272822} body { color: #000000; background-color: #ffffff; } </style> </head> <html> <body> ...
Python
1
# # Copyright 2015 IBM Corp. # # 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 require...
Python
1
pub fn rtc_cntl_glitch_det_int_ena(&mut self) -> RTC_CNTL_GLITCH_DET_INT_ENA_W { RTC_CNTL_GLITCH_DET_INT_ENA_W { w: self } } #[doc = "Bit 16"] #[inline(always)] pub fn rtc_cntl_xtal32k_dead_int_ena(&mut self) -> RTC_CNTL_XTAL32K_DEAD_INT_ENA_W { RTC_CNTL_XTAL32K_DEAD_INT_ENA_W { w: self ...
Rust
0
class Ed25519ProviderError(Exception): """Base exception for Ed25519Provider errors.""" pass
Python
1
from sqlalchemy import BigInteger, Column, PrimaryKeyConstraint from sqlmodel import Field, Index, SQLModel class AddressLineage(SQLModel, table=True): __tablename__ = "address_lineage" id: int | None = Field( sa_column=Column(BigInteger, default=None, primary_key=True, nullable=False) ) pipe...
Python
1
lf.micro_batch_times_data_parallel_size = self.micro_batch_size * data_parallel_size self.last_batch_size = self.total_samples % self.micro_batch_times_data_parallel_size # Sanity checks. assert self.total_samples > 0, "no sample to consume: {}".format(self.total_samples) assert self.mi...
Python
1
dtype="float64") # out = paddle.index_add(x, index, axis, add_value) # self.assertRaises(ValueError, test_index_shape) # def test_axis_value(): # axis = 3 # x = paddle.static.data(name='X3', # ...
Python
1
ɪ̝"); let str257 = &str256.replace("sky", "s̺kɐɪ̝"); let str258 = &str257.replace("try", "trɐɪ̝"); let str259 = &str258.replace("why", "wɐɪ̝"); let str260 = &str259.replace("iche", "iːʃ"); let str261 = &str260.replace("uel", "ʲʉːᵊl"); let str262 = &str261.replace("oa", "əʉ"); let str263 = &str262.r...
Rust
0
gered(DeliveryMode::Fixed, vector) as u16; pcid_handle.set_feature_info(SetFeatureInfo::Msi(MsiSetFeatureInfo { message_address: Some(msg_addr), message_upper_address: Some(0), message_data: Some(msg_data), multi_message_enable: Some(0), // en...
Rust
0
core averaged across {} task(s)\n'.format(self.num_tasks) elif self.eval_metric == 'acc': desc += '{\'acc\': acc}\n' desc += '- acc (float): Accuracy score averaged across {} task(s)\n'.format(self.num_tasks) else: raise ValueError('Undefined eval metric %s ' % (self....
Python
1
ead.next.take(); } } ref_head.next = if l1.is_some() { l1 } else { l2 }; head.next } } #[cfg(test)] mod test { use super::Solution; use crate::prelude::ListNode; #[test] fn example_1() { let input = vec![linked_list![1, 2, 3], linked_list![2, 3]]; ...
Rust
0
e data to run through SHA-256."] pub random: ::core::option::Option< unsafe extern "C" fn( vault: *mut ockam_vault_t, buffer: *mut u8, buffer_size: usize, ) -> ockam_error_t, >, #[doc = " @brief Compute a SHA-256 hash based on input data."] #[doc = "...
Rust
0
Both((p, actual), (_, expect)) => { Self::diff(Some(actual), Some(expect), &location.push_prop(p), out); } } } } (Some(Value::Array(actual)), Some(Value::Array(expect))) => { for (inde...
Rust
0
u128) -> u64 { if n <= SINGLE_BYTE_MAX as u128 { 1 } else if n <= u16::max_value() as u128 { (1 + size_of::<u16>()) as u64 } else if n <= u32::max_value() as u128 { (1 + size_of::<u32>()) as u64 } else if n <= u64::max_value...
Rust
0
ew( minimum.x, maximum.x, minimum.y, maximum.y, minimum.z, material, true, ), XYRect::new( minimum.x, maximum.x, minimum.y, maximum.y, maximum.z, material, false, ), XZRect::new( minimum.x, maximum.x, minimum.z, maximum.z, m...
Rust
0
ame) # 计算损失 loss = model.compute_loss(pred_features, target_features) total_loss += loss.item() # 打印验证进度 if (batch_idx + 1) % config.log_interval == 0: print(f"Validation Batch {batch_idx+1}/{len(val_loade...
Python
1
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies the use of the environment during regeneration when the gyp file changes, specifically via build of an executable with C prepro...
Python
1
s in `__init__` are without leading and trailing underscores. """ class C(object): __attrs_attrs__ = [simple_attr("_private")] C = _add_init(C, False) i = C(private=42) assert 42 == i._private class TestNothing(object): """ Tests for `_Nothing`. ...
Python
1
matches::assert_matches; use log::{error, info}; use oak::grpc; use oak::OakStatus; use oak_tests::proto::manager::{ ApplicationConfiguration, Channel, Channel_Endpoint, GrpcServerNode, LogNode, Node, WebAssemblyNode, }; use serial_test_derive::serial; use std::collections::HashMap; // Constants for node and p...
Rust
0
, -32.878848578, 137.580292922}, {0x77f45a4cd5cee45b, "fzu5nm6ptvk5", 89.151249063, -50.347342816}, {0x13a9d29a8994ce27, "2fnx56n9km72", -32.508302055, -136.957439484}, {0x39a27df66be4f566, "76j7vxmcwmuq", -33.050705409, -26.117317833}, {0x60a4b9ab914c4bb9, "d2kcmbwj9j5v", 1.62969501, -7...
Rust
0
y the given parent node. The path is converted into the absolute path of the OS before comparison. :param path: The name of the group that has to be returned :param parent: A PBXGroup object where the object has to be retrieved from. If None all matching groups are returned :return: An l...
Python
1
atch a1 { Term::ListCell(_, tl) => NativeReturn::Return { term: tl.clone() }, _ => NativeReturn::Throw { typ: Term::new_atom("error").into(), reason: Term::new_atom("badarg").into(), }, } } fn map_size(_vm: &VMState, _proc: &mut ProcessContext, args: &[Rc<Term>]) -> ...
Rust
0
> Tuple[Proof, ProofSize]: def _build_proof(node: ProofTheoremNode) -> Tuple[Proof, ProofSize]: assert self.is_solved_node(node) tacs = node.get_tactics() solving = [t for t in tacs if self.is_solving_tactic(t)] assert len(solving) >= 1 selected_tac = ...
Python
1
2, &['\u{0073}']), (0x2000, &['\u{0020}']), (0xfdb7, &['\u{0643}', '\u{0645}', '\u{064A}']), (0x1d7e6, &['\u{0034}']), (0x1d634, &['\u{0073}']), (0x1d579, &['\u{004E}']), (0x1eea5, &['\u{0648}']), (0x1d4f1, &['\u{0068}']), (0xffb4, &['\u{1121}']), (0x1d6a8, &['\u{0391}']), (0xfd3...
Rust
0
input[j] == 2020 { return input[i] * input[j]; } } } panic!("No solution?"); } #[aoc(day1, part2)] pub fn solve_part2(input: &[i64]) -> i64 { for i in 0..input.len() { let v_i = input[i]; for j in (i + 1)..input.len() { let v_j = input[j]; ...
Rust
0
']['magmom']).reshape((-1, 3)) entry = self.get_entry(entry_jd, {'properties.magmom': 1}) magmom_j = np.array(entry['properties']['magmom']).reshape((-1, 3)) magmom_inew = np.zeros((self.structure.natom, 3)) magmom_jnew = np.zeros((self.structure.natom, 3)) for i in range(self.st...
Python
1
+ file_name + feature + "_" + str(n) + ".pkl", 'wb') as handle: print("write data into: " + file_name + feature + "_" + str(n) + ".pkl") pickle.dump(idata, handle, protocol=pickle.HIGHEST_PROTOCOL) # plot rhat nc_rhat = az.rhat(idata) ax = (nc_rhat.max() .t...
Python
1
# This file was auto-generated by Fern from our API Definition. import typing import pydantic from ..core.pydantic_utilities import IS_PYDANTIC_V2 from ..core.unchecked_base_model import UncheckedBaseModel from .catalog_object_reference import CatalogObjectReference class LoyaltyProgramRewardTier(UncheckedBaseModel...
Python
1
/// See <https://docs.aws.amazon.com/cli/latest/topic/s3-config.html#max-concurrent-requests> fn default_max_connections() -> usize { 10 } } impl ConfigImpl for S3SourceConfig {} #[derive(Debug, Default)] pub(crate) struct Builder {} #[async_trait::async_trait] impl ConnectorBuilder for Builder { ...
Rust
0
sert('\u{304}', r#"\bar"#); map.insert('\u{305}', r#"\overline"#); map.insert('\u{306}', r#"\breve"#); map.insert('\u{307}', r#"\dot"#); map.insert('\u{308}', r#"\ddot"#); map.insert('\u{30a}', r#"\mathring"#); map.insert('\u{30c}', r#"\check"#); // map.insert('\u{330}', r#"\utilde"#); ...
Rust
0
mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01); self.w } } impl R { #[doc = "Bit 0 - Shortcut between ENDKSGEN event and CRYPT ...
Rust
0
import time from selenium.webdriver.common.by import By from selenium import webdriver driver = webdriver.Edge() driver.implicitly_wait(10) # 隐式等待10秒 driver.get(r'https://1.tongji.edu.cn/') print('1') while True: zhuangtai=1 cuowu=0 button=driver.find_elements_by_xpath("//*[contains(text(),' 评教')]")...
Python
1
higher address. Here we reverse the vector to make sure that // the older created device will appear in front of the newer created device in FDT. ordered_virtio_device.reverse(); for ordered_device_info in ordered_virtio_device.drain(..) { create_virtio_node(fdt, ordered_device_info)?; } O...
Rust
0
rivers = { "nile": "egypt", "amazon": "brazil", "pasig": "philippines", } for river, country in rivers.items(): print(f"{river.title()} runs through {country.title()}.")
Python
1
::new(), } } pub fn with_live_bundle<B>(mut self, bundle: B) -> amethyst::Result<Self> where B: SystemBundle<'a, 'b>, { bundle .build(&mut self.live) .map_err(|err| amethyst::Error::Core(err))?; Ok(self) } pub fn with_tick_bundle<B>(mut s...
Rust
0
MDD::new(config); mdd.is_exact= false; assert_eq!(0, mdd.current); assert_eq!(2, mdd.lel); mdd.remember_lel(); assert_eq!(0, mdd.current); assert_eq!(2, mdd.lel); } #[test] fn remember_lel_remembers_the_last_exact_layer() { let config = M...
Rust
0
#!/usr/bin/env python3 # Script to generate icons.h header file for esp32-weather-epd. # Copyright (C) 2025 Luke Marzen # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the...
Python
1
tscheduler'): os.sched_setscheduler(thread_id, os.SCHED_FIFO, os.sched_param(99)) self.logger.info(f"关键线程 {thread_id} 优化完成") except Exception as e: self.logger.error(f"关键线程优化失败: {e}") def _select_optimal_cpus(self) -> List[in...
Python
1
impl<K, V: GcManaged, S> GcManaged for HashMap<K, V, S> { fn mark(&self) { for v in self.values() { v.mark(); } } fn blacken(&self) { for v in self.values() { v.blacken(); } } } impl<T: GcManaged> GcManaged for &[T] { fn mark(&self) { ...
Rust
0
![deny(missing_docs)] //! # ACPI Support for the Mythril Hypervisor //! //! This module contains implementations for structures and functions //! described in the ACPI specification. For all ACPI specification //! references found in the code and documentation reffer to [ACPI 6.3]. //! //! [ACPI 6.3]: https://uefi.org...
Rust
0
""" N170 run experiment =============================== This example demonstrates the initiation of an EEG stream with eeg-expy, and how to run an experiment. """ ################################################################################################### # Setup # --------------------- # # Imports fr...
Python
1
_orders] tablespace_sql = schema_editor._get_index_tablespace_sql(model, fields) quote_name = schema_editor.quote_name columns = [ ('%s %s' % (quote_name(field.column), order)).strip() for field, (field_name, order) in zip(fields, self.fields_orders) ] par...
Python
1
top-slow-scripts", "--debug-javascript"] cmd += ["--javascript-delay", str(kwargs.get("javascript_delay", 200))] # Ignore default parameters that are not relevant for image output and pass the rest to wkhtmltoimage kwargs_ignore_list = [ "header_block", "header_spacing",...
Python
1
.CL", "TPGH", "TPGH.WS", "CDRpC", "AGNCN", "KCAPL", "SYBX", "AHTpH", "ULBR", "YESR", "HCAPZ", "AIB.CL", "DWDP", "MFGP", "RLJpA", "ZKIN", "FLMB", "FLMI", "MFDX", "MFEM", "MFUS", "SECT", "ATACR", "GHYB", "MAGA", "FSAC", "FSACW", "OBOR", "OSPR", "ALPpO.CL", "XNTK...
Rust
0
list): distance_matrix = np.array(distance_matrix) n = distance_matrix.shape[0] D_squared = distance_matrix ** 2 H = np.eye(n) - np.ones((n, n)) / n B = -0.5 * H @ D_squared @ H eigvals, eigvecs = np.linalg.eigh(B) idx = np.argsort(eigvals)[::-1] eigvals = eigvals[idx] eigvecs = ...
Python
1
ction == "same": z_diff_action = torch.randn(1, self.latent_dim, device=self.device).repeat(nats, 1) else: raise NotImplementedError("Noise diff action must be random or same.") interpolation_factors = torch.linspace(-1, 1, nspa, device=self.device) z ...
Python
1
modals = modal_extractor(images) images_norm = TF.normalize(images, mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) inp = [images_norm] + modals anomaly, confidence, detection = model(inp) loss = criterion(anomaly, masks, confidence, detection, labels) /...
Python
1
warn(missing_docs, clippy::dbg_macro, clippy::unimplemented)] #![deny( rust_2018_idioms, future_incompatible, missing_debug_implementations, clippy::doc_markdown, clippy::default_trait_access, clippy::enum_glob_use, clippy::needless_borrow, clippy::large_digit_groups, clippy::explici...
Rust
0
e) # ========================================================================= @unittest.skipIf(hasattr(scipy.signal, 'coherence'), 'Applies only for old ' 'scipy versions (<0.16)') class sfc_TestCase_old_scipy(unittest.TestCase): def setUp(self): # sta...
Python
1
# Ultralytics YOLO 🚀, AGPL-3.0 license from pathlib import Path from ultralytics.engine.model import Model from .predict import FastSAMPredictor from .val import FastSAMValidator class FastSAM(Model): """ FastSAM model interface. Example: ```python from ultralytics import FastSAM ...
Python
1
t_info; 104] (aruid) => ()) } fn set_npad_joy_assignment_mode_single(&mut self, aruid: sf::ProcessId, controller: ControllerId, joy_type: NpadJoyDeviceType) -> Result<()> { ipc_cmif_client_send_request_command!([self.session.object_info; 123] (controller, aruid, joy_type) => ()) } fn set_npad_...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models class IrUiMenu(models.Model): _inherit = 'ir.ui.menu' def _load_menus_blacklist(self): res = super()._load_menus_blacklist() is_interviewer = self.env.user.has_group('hr...
Python
1
# Databricks notebook source # MAGIC %run "../includes/configuration" # COMMAND ---------- races_df = spark.read.parquet(f"{processed_folder_path}/races") # COMMAND ---------- races_filtered_df = races_df.filter("race_year = 2019 and round <=5 " ) # COMMAND ---------- races_filtered_df = races_df.filter((races_df...
Python
1
} COW_RPC_RESULT_MSG_ID => { let msg = CowRpcResultMsg::read_from(&mut reader)?; let mut v = vec![0u8; (header.size - u32::from(header.offset)) as usize]; reader.read_exact(&mut v)?; Ok(CowRpcMessage::Result(header, msg, v)) ...
Rust
0
# Question 9- Write a program to calculate the area of triangle using Heron's Formula where a, b, c are the sides of the triangle. # Hint :- s=(a+b+c)/2 and Area = sqrt( s(s-a)(s-b)(s-c) ) import math a = float(input("Enter 1st side of triangle: ")) b = float(input("Enter 2nd side of triangle: ")) c = float(input("En...
Python
1
81,881 ns/iter (+/- 1,708) // test atoi_u16_simple_lexical ... bench: 62,819 ns/iter (+/- 1,707) // test atoi_u16_simple_parse ... bench: 60,916 ns/iter (+/- 8,340) // test atoi_u32_lexical ... bench: 139,264 ns/iter (+/- 3,945) // test atoi_u32_parse ... bench: 139,649 ns...
Rust
0
gionThrottle, 8 => WinsysFeature::SwapRegionSynchronized, 9 => WinsysFeature::BufferAge, 10 => WinsysFeature::SyncAndCompleteEvent, 11 => WinsysFeature::NFeatures, value => WinsysFeature::__Unknown(value), } } } impl StaticType for WinsysFeature {...
Rust
0
(1, 2, 0)) if img_mode == 'L': output_img = cv2.cvtColor(output_img, cv2.COLOR_BGR2GRAY) print('finished process image (without the alpha channel)') # ------------------- process the alpha channel if necessary ------------------- # if img_mode == 'RGBA': print("i...
Python
1
{ FmtKind, 2; default Debug, Display, } enum_prim! { NumberFmt, 2; default Decimal, Binary, Hexadecimal, } use crate::shape::point::Point; /// https://en.wikipedia.org/wiki/Xiaolin_Wu%27s_line_algorithm pub(crate) fn xiaolin_wu_line(x0: f32, y0: f32, x1: f32, y1: f32) -> Vec<Point> { ...
Rust
0