text
string
label_name
string
labels
int64
d(&cpu.memory, pc); instructions::decode_opcode(cpu, opcode); } } fn read_mem_byte(memory: &[u8], addr: u16) -> u8 { let byte = memory.get(addr as usize); match byte { Some(x) => *x, None => std::process::exit(0), } } fn read_mem_word(memory: &[u8], pc: u16) -> u16 { return (...
Rust
0
ct_cell_references(-1, c, cell, {SoAItemType.STUDY_VISIT.value}) # collect_footnote_references(0, c, cell) # collect referenced items from table data for r, row in enumerate(table.rows[table.num_header_rows :]): # collect row references collect_cell_references( ...
Python
1
_uvarint()?; match packet { protocols::CLIENT_PING => Ok(Packet::Ping), protocols::CLIENT_CANCEL => Ok(Packet::Cancel), protocols::CLIENT_DATA | protocols::CLIENT_SCALAR => { Ok(self.parse_data(packet == protocols::CLIENT_SCALAR, compress)?) } ...
Rust
0
std::cmp::min(i, discovered[head]); }, ) { let node = topocore.order.node(rank); if (node == to || dijk_run.queue().peek().map(|e| e.key).unwrap_or(INFINITY) >= *dijk_run.tentative_distance(topocore.order.rank(to))) && i < done_at { eprintln!("{}", i); done_at = i; ...
Rust
0
mean(dim=0) / 2 def mi_est(self, x_samples, y_samples): # x_samples: (bs, x_dim); y_samples: (bs, T, y_dim) mu, logvar = self.get_mu_logvar(x_samples) sample_size = x_samples.shape[0] #random_index = torch.randint(sample_size, (sample_size,)).long() random_index = torch.ra...
Python
1
def nested_lists_maker(nested_lists_len: int, original_list: list): new_list = [] final_sub_list = [] if len(original_list) > nested_lists_len: while len(original_list) >= nested_lists_len: sub_list = original_list[:nested_lists_len] for i in sub_list: origina...
Python
1
if unknown_devices: print("\n未能识别的设备:") for device in unknown_devices: print(f"- {device}") def get_device_type(model: str, mapping: Dict[str, str]) -> str: """Obtain the device type in Netmiko based on the device model""" for key, value in mapping.items(): if model.st...
Python
1
#!/usr/bin/python3 """ State Module for HBNB project """ from models.base_model import BaseModel, Base from os import getenv from sqlalchemy import Column, String class Amenity(BaseModel, Base): """Rep of Amenity """ if getenv('HBNB_TYPE_STORAGE') == 'db': __tablename__ = 'amenities' name = Co...
Python
1
w. Note: The PC.15/PF.12~13/PG.0~1,5~8/PH.0~3,12~15 pin is ignored."] #[inline(always)] pub fn pin6(&self) -> PIN6_R { PIN6_R::new(((self.bits >> 6) & 0x01) != 0) } #[doc = "Bit 7 - Port A-H Pin\\[n\\] Pin Value Each bit of the register reflects the actual status of the respective Px.n pin. If t...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2017 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
lf._on_order_status) self.connected = True logger.info(f"已連接到富途證券 API,市場: {self.market}") return True except Exception as e: logger.exception(f"連接富途證券 API 失敗: {e}") return False def disconnect(self) -> bool: """ 斷開富途證券 API 連接 ...
Python
1
match self.value { SettingValueEnum::Float(ref mut value, change) => { if change < 0.0 { *value *= (-change + 1.0).powf(dt); } else { *value += dt * change; } } SettingValueEnum::Vec3(ref ...
Rust
0
l_velocities", EvalVelocities(surfaces=surfaces, num_eval_points=num_force_points, eval_name="force_pts"), promotes_inputs=["*"], promotes_outputs=["*"], ) # Get sectional panel forces self.add_subsystem( "panel_forces", PanelForces(surfaces=surfa...
Python
1
Message::BlockAlbatross(_) => MessageType::BlockAlbatross, Message::HeaderAlbatross(_) => MessageType::HeaderAlbatross, Message::ViewChange(_) => MessageType::ViewChange, Message::ViewChangeProof(_) => MessageType::ViewChangeProof, Message::ValidatorInfo(_) => Message...
Rust
0
ve_strategy="epoch", logging_dir="./logs", logging_steps=50, num_train_epochs=2, group_by_length=True, fp16=False, push_to_hub=False, adam_beta2=0.999, do_train=True, ) # [6] Setup SFT trainer using model, tokenizer, training data and tokenizer trainer = SFTTrainer( model=model, ...
Python
1
pub fn set_batch(&mut self, v: WriteBatch) { self.chunk = Some(write_engine_request::Chunk::Batch(v)); } pub fn get_batch(&self) -> &WriteBatch { match &self.chunk { Some(write_engine_request::Chunk::Batch(v)) => v, _ => <WriteBatch as ::proto...
Rust
0
(true, Ordering::Relaxed); } let current_best_seen = self.best_seen_block(); let current_state = self.state(&current_best_seen); // We removed a peer, let's see if this put us in idle state and is_major_syncing should be updated. match (previous_state, current_state) { (SyncState::Downloading, SyncState::I...
Rust
0
gpu surfaces) get released. // // This is definitely broken, since it can be thwarted by e.g. creating a // wgpu surface at some point after build() (which will mean the NSView // never gets dealloced) or dropping a wgpu surface at some point before // drop() (which will mean the WindowState gets dr...
Rust
0
&[u8]), } { self.0.error.write = Some(e); break; } } } } Ok(()) } } //! Statically allocated stacks //! //! These stacks are referenced in the TSS. //! //! It should be noted that `ks...
Rust
0
() -> u8 { let value = unsafe { core::ptr::read_volatile(0xFEE00020 as *const u32) }; (value >> 24) as u8 } use digest::Digest; use sha2::Sha256; use sha3::Sha3_256; use std::{fs, io}; use serde::{Serialize, Deserialize}; use serde_json::Result; use std::fs::File; // This example demonstrates clap's full 'cust...
Rust
0
:Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doep0_dmaaddr](doep0_dmaaddr) module"] pub type DOEP0_DMAADDR = crate::Reg<u32, _DOEP0_DMAADDR>; #[allow(missing_docs)] #[doc(hidden)] pub struct _DOEP0_DMAADDR; #[doc = "`read()` method returns [...
Rust
0
UserFactory.create() projectOwner = UserFactory.create(admin=False) ProjectFactory.create(owner=projectOwner) today = datetime.datetime.today() old_date = today + relativedelta(months=-1) date_str = old_date.strftime('%Y-%m-%dT%H:%M:%S.%f') # substract six months ...
Python
1
Encoding::Rle, descriptor.max_def_level()), is_nullable, nested, values, validity, ) } _ => { return Err(utils::not_implemented( &page.encoding(), ...
Rust
0
called_once() mock_response.raise_for_status.assert_called_once() mock_response.json.assert_called_once() @patch('musictranslator.musicprocessing.volume.requests.post') def test_rms_missing_data(self, mock_post): """Test the service gracefully fails when no data is submitted""" ...
Python
1
ntext_builder, token_encoder=token_encoder, llm_params=local_llm_params, context_builder_params=local_context_params, response_type="multiple paragraphs", ) # 设置全局搜索引擎 global_context_builder = GlobalCommunityContext( community_reports=reports, entities=entiti...
Python
1
k the result of groupby aggregation on the need of resetting index name. Parameters ---------- result : DataFrame Group by aggregation result. Returns ------- DataFrame """ # TODO: SNOW-1063349: Modin upgrade - modin.pandas.groupby.DataFrameGroupBy functions if self._by is ...
Python
1
,4,1), max_residual=2.0, use_valid_gate=True, groups=8): super().__init__() self.max_residual = float(max_residual) self.use_valid_gate = use_valid_gate in_ch = 3 + 3 + 1 + 1 + 1 + 1 + 1 + 1 # L(3), Rw(3), d0(1), err_abs(1), err_sgn(1)...
Python
1
< ::std::boxed::Box<#provider_ty>, ::std::boxed::Box<dyn ::std::error::Error> > { ::shaku::HasProvider::provide(::std::sync::Arc::as_ref(&self.#submodule_name)) } } } } /// Get the interface type of a component via projection fn interf...
Rust
0
te epochs counter. let family_index = self.families_indices[fence_epoch.queue.family.index]; let mut lock = self.epochs[family_index].write(); let epoch = &mut lock[fence_epoch.queue.index]; *epoch = max(*epoch, fence_epoch.epoch); Ok(true) } else { ...
Rust
0
import math def atkin(nmax): """ Returns a list of prime numbers below the number "nmax" """ is_prime = dict([(i, False) for i in range(5, nmax+1)]) for x in range(1, int(math.sqrt(nmax))+1): for y in range(1, int(math.sqrt(nmax))+1): n = 4*x**2 + y**2 if (n <= nmax) ...
Python
1
#!/usr/bin/env python3 import sys, re pattern = re.compile('''\ (?P<wpos>r[0-9])\.xyzw = (?P<FViewUniformShaderParameters>cb[0-9])\[37\]\.xyzw \* (?P<v>v[0-9])\.yyyy; (?P=wpos)\.xyzw = (?P=v)\.xxxx \* (?P=FViewUniformShaderParameters)\[36\]\.xyzw \+ (?P=wpos)\.xyzw; (?P=wpos)\.xyzw = (?P=v)\.zzzz \* (?P=FViewUn...
Python
1
::Unexpected::Other( format!("Failed to parse unit: {}", v).as_str(), )) })?; Ok(Self::Value { quantity, unit }) } } // This is the trait that informs Serde how to deserialize MyMap. impl<'de> serde::Deserialize<'de> for Frequency { fn deserialize<D>(deserializer: D...
Rust
0
from __future__ import annotations from dataclasses import dataclass, field from ..._base_connection import _TYPE_BODY @dataclass class EmscriptenRequest: method: str url: str params: dict[str, str] | None = None body: _TYPE_BODY | None = None headers: dict[str, str] = field(default_factory=dict...
Python
1
sh::vk; use std::sync::Arc; /// Hold a partially loaded resource. /// /// The main usecase is to create resource that don't /// required submitting work through a queue and to bake /// commands for actions that do required the use of a queue. /// It means you can pre-load data on a seperate thread and /// finish loadi...
Rust
0
#[repr(C)] #[derive(Debug, Clone)] pub struct ENetListNode { pub next: *mut ENetListNode, pub previous: *mut ENetListNode, } pub type ENetListIterator = *mut ENetListNode; #[repr(C)] #[derive(Debug, Clone)] pub struct ENetList { pub sentinel: ENetListNode, } extern "C" { pub fn enet_list_clear(list:...
Rust
0
Eq, PartialEq)] pub enum BoardPieceType { EMPTY, BLACK, WHITE } impl fmt::Display for BoardPieceType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { BoardPieceType::EMPTY => write!(f, "{}", "Empty"), BoardPieceType::BLACK => write!(f, "{}", "Black"), ...
Rust
0
0.,1.,0.5) for i in range(len(d)): d[i] *= w d[i] = np.dot(V, d[i]) d[i] += mean glVertex3f(d[i, 0], d[i, 1], 0) glEnd() def mouseMove(self, event): global lastPosX, lastPosY, zoomScale, xRot, yRot, zRot; if event.type == pygame.MOUSE...
Python
1
RoamingAppData "3eb685db-65f9-4cf6-a03a-e3ef65729f3d" LocalAppData "f1b32785-6fba-4fcf-9d55-7b8e7f157091" LocalAppDataLow "a520a1a4-1780-4ff6-bd18-167343c5af16" InternetCache "352481e8-33be-4251-ba85-6007caedcf9d" Cookies "2b0f765d-c0e9-4171-908e-08a611b84ff6" History "d9dc8a3b-b784-432e-a781-5a1130a75963" ...
Rust
0
of amplitude or in units of amplitude/distance (i.e. proper gradient). (2011v2) The chantype and chanunit have been added for MEG. (2011v1) To facilitate determining the position of channels (e.g. for plotting) in case of balanced MEG or bipolar EEG, an exp...
Python
1
default=list) created_at = models.DateTimeField(verbose_name="作成日時", auto_now_add=True) updated_at = models.DateTimeField(verbose_name="更新日時", auto_now=True) is_active = models.BooleanField(verbose_name="有効", default=True) class Meta: verbose_name = "ルールパターン" verbose_name_plural = ...
Python
1
:Display for StencilAccess { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", match *self { StencilAccess::Read => "read", StencilAccess::Write => "write", }) } } fn map_stencil_mask<F>(dsi: &pso::DepthStencilInfo, access: StencilAccess, accessor: ...
Rust
0
import asyncio import pytest from async_service import background_asyncio_service from lahja import BroadcastConfig from p2p.tools.factories import NodeFactory from trinity.constants import ( NETWORKING_EVENTBUS_ENDPOINT, ) from trinity.components.builtin.network_db.connection.events import GetBlacklistedPeersRe...
Python
1
)) // .collect::<Vec<String>>(); // vec.reverse(); // vec.join("") // 2.5th solution (not sure what i expected) // input.rsplit("").collect() // final solution checking for the community for answers. The input string is a grapheme // cluster so in order to parse it correctly we use the...
Rust
0
et_config_for_gnn() print(f" Edge types: {list(config['edge_types'].keys())}") print(f" Causal edges: {len(config['causal_edges'])}") print(f" Temporal edges: {len(config['temporal_edges'])}") print(f" ✅ GNN integration ready!") def demo_comparison(): """Compare learned vs fixed weights.""...
Python
1
::Bronze, 15), (Amphipod::Copper, 13), (Amphipod::Copper, 16), (Amphipod::Desert, 14), (Amphipod::Desert, 17), ] .into_iter() .collect() ); } #[test] fn parse_example_1() { let example = "############# #.........A.# ###.#B#C#D### #A#B#C#D# #########"; assert_eq!( parse(example), [ (Amp...
Rust
0
, LookupTable, const PRECISION: usize> IterableEntropyModel<'m, PRECISION> for LookupDecoderModel< Symbol, Probability, NonContiguousSymbolTable<Table>, LookupTable, PRECISION, > where Symbol: Clone + 'm, Probability: BitArray + Into<usize>, usize: AsPrimi...
Rust
0
sor::new(self) { Err(err) => Err(err)?, Ok(accessor) => return Ok(_GlyphAccessor::Ttf(accessor).into()), } } } #[derive(Debug)] pub struct TableData<Container, Table, Context> { container: Container, _marker: std::marker::PhantomData<Table>, context: Context, } impl<Con...
Rust
0
as在加噪测试集中的分类准确度:" + str(accuracy_score(y_test, y_test_pred))) """Precision/Recall/F1指标""" print("*" * 100) # average='micro': 全局计算 F1 分数,适用于处理类别不平衡的情况。 # average='macro': 类别 F1 分数的简单平均,适用于需要均衡考虑每个类别的情况。 # average='weighted': 加权 F1 分数,适用于类别不平衡的情况,考虑了每个类别的样本量。 # average=None: 返回每个类别的 F1 分数,适用于详细分析每个类别的表现。 print("Rovas...
Python
1
("192.168.0.1".to_string()); c.remove("192.168.0.3".to_string()); assert!(c.count() == 0, "TEST: Removing from empty fail"); } <reponame>randomicon00/rust // `Call` terminators can write to a local which has existing loans // and those need to be killed like a regular assignment to a local. // This is a simpl...
Rust
0
ceiver_soft, modem.num_bits_symbol, modem.constellation, modem.Es, decoder_soft, code_rate) # Test BERs_hard = model_hard.link_performance(SNRs, 10000, 600, 5000, code_rate) BERs_soft = model_soft.link_performance(SNRs, 10000, 600, 5000, code_rate) plt.semilogy(SNRs,...
Python
1
ck: events.pop(0) def get_break_events(self, stock_code: str, limit: int = 10) -> List[LimitUpBreakEvent]: """获取股票的炸板事件 Args: stock_code: 股票代码 limit: 返回数量限制 Returns: List[LimitUpBreakEvent]: 炸板事件列表 """ events = self.break_eve...
Python
1
son=json_data, stream=True) as response: if response.status_code != 200: print_error(f"API 请求失败,状态码: {response.status_code}") return for line in response.iter_lines(decode_unicode=True): if line: try: e...
Python
1
econds is not None and retry_after_seconds > 0 should_retry = hard_throttled or has_delay if should_retry: if not retry_after_seconds or retry_after_seconds <= 0: retry_after_seconds = min( ...
Python
1
_len): (usize, usize) = 'target: loop { match (opt.off, opt.len, &opt.file, size) { (Some(off), Some(len), _, _) => { break 'target (off, len); }, (_, _, Some(file), _) => { for ((poff, plen), (off, len)) in archive_files { ...
Rust
0
Nop { len: u8 }, /// (add sub and or xor mul adc? sbb?) (32 64) (reg addr imm) reg Alu_RMI_R { is64: bool, op: RMI_R_Op, src: RMI, dst: Reg, }, /// (imm32 imm64) reg. /// Either: movl $imm32, %reg32 or movabsq $imm64, %reg32 Imm_R { dstIs64: bool, ...
Rust
0
necessary_unwrap)] fn run(self: Box<Self>, settings: Settings) -> TestResult { let timeout = settings.get_or_default::<Timeout>(); let duration = Arc::new(Mutex::new(Duration::default())); let update_duration = Arc::clone(&duration); let cond = Arc::new((Mutex::new(false), Condvar::n...
Rust
0
from pyscope import tietz import time # one of these classes should work tietzclasses = [ tietz.TietzPXL, tietz.TietzPVCam, tietz.TietzSCX, tietz.TietzFC415, tietz.TietzF416, tietz.TietzF816, ] successful = [] for cls in tietzclasses: print 'Killing any CAMC4 procs' tietz.killCamcProcs() print 'Trying to in...
Python
1
kun2w = j0jwqazf37p = w26pbd_wqy6 = w4mg6fuqx8d = 0.0 del vkscwnpvq8f def l5p3lg5qnkk(chhj29v706z: ukqyqb7g58a=None, cz4tp4pr90g=False, neppk9s428d=0j, vwapqssn5r0: ppztzv4rfck='', jd0pcgvuhc3=b'', ll2gbx7n3wq: mt83x_sb0nt=0): g2vyxfnxdm3[False] %= u1u09nexa5h raise 0j '# periods_semicolon_egg -> compas...
Python
1
import flet as ft def help_page(page: ft.Page): page.title = "Vectras Desktop - Help" page.vertical_alignment = ft.MainAxisAlignment.CENTER page.horizontal_alignment = ft.CrossAxisAlignment.CENTER page.update() page_container = ft.Container( content=ft.Column( controls=[ ...
Python
1
import random import string def get_password_length(): while True: try: length = int(input("Enter the desired password length: ")) if length <= 0: print("Please enter a positive integer.") else: return length except ValueError: ...
Python
1
''' En una cafetería, los pedidos de los clientes deben gestionarse de dos maneras: Pilas (Last-In-First-Out): Para los pedidos que son bebidas calientes (se procesan en el orden inverso al que se reciben, por practicidad). Colas (First-In-First-Out): Para los pedidos que son comida (se procesan en el orden en que lle...
Python
1
""" MeteorMetric class: ------------------------------------------------------- Class for calculating METEOR score on AttackResults """ import nltk from textattack.attack_results import FailedAttackResult, SkippedAttackResult from textattack.metrics import Metric class MeteorMetric(Metric): def __init__(self,...
Python
1
inventario = [] def agregar(): producto = input("\nIngrese el nombre del producto a agregar: ").lower() cantidad = int(input("Ingrese las existencias del producto: ")) precio = float(input("Ingrese el precio del producto: ")) inventario.append([producto,cantidad,precio]) def eliminar(): ae...
Python
1
, 23.00), // 4.35 1.83 134.32 (10.00, -23.00), // (23.50, 23.00)]), // result: (0.50, 2, vec![(10.00, 0.00), // 0.00 10.00 0.00 (500.00, 3.00)]), // result: (2.70, 3, vec![(5.00, 10.00), // 0.80 4.91 18.42 ...
Rust
0
from kivy.lang import Builder from kivymd.app import MDApp KV = """ MDScreenManager: MDScreen: name: "screen A" md_bg_color: "lightblue" MDHeroFrom: id: hero_from tag: "hero" size_hint: None, None size: "120dp", "120dp" pos_hint...
Python
1
.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z", At::from("stroke-linecap") => "round", At::from("stroke-linejoin") =>...
Rust
0
ineBuilder::new().build().unwrap(); let (k, mut v) = (b"k", b"v".to_vec()); // Key not exist; should succeed. fail_to_write_pessimistic_lock(&engine, k, 10, 10); must_pessimistic_prewrite_put(&engine, k, &v, k, 10, 10, true); must_commit(&engine, k, 10, 20); must_get(&en...
Rust
0
3a0e66e6e86e3812dcb672a272", knot_hash.get_dense_hash(), ); } #[test] fn test_part_two_aoc_2017() { let input = "AoC 2017"; let mut knot_hash = KnotHash::new(0, 255); knot_hash.generate_sparse_hash(&get_ascii_lengths(&input)); knot_hash.get_dense_hash();...
Rust
0
std::mem::align_of::<hv_x64_vp_execution_state>(), 2usize, concat!("Alignment of ", stringify!(hv_x64_vp_execution_state)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<hv_x64_vp_execution_state>())).as_uint16 as *const _ as usize }, 0usize, concat!( ...
Rust
0
,cd,efg"); tc.compilef("\\w+(?<=$)", "m").run_global_match("ab\ncd\nefg").test_eq("ab,cd,efg"); tc.compilef("(?<=^)\\w+(?<=$)", "m").run_global_match("ab\ncd\nefg").test_eq("ab,cd,efg"); tc.compilef("^foo(?<=^fo+)$", "").match1f("foo").test_eq("foo"); tc.compilef("^foooo(?<=^fo*)", "").match1f("foooo")....
Rust
0
[reg+reg] is supported Write-back is supported except for one instruction: 32 bit signed load with [reg+imm] addressing mode on 64 bit. mips: [reg+imm], -65536 <= imm <= 65535 sparc: [reg+imm], -4096 <= imm <= 4095 [reg+reg] is supported s390x: ...
Rust
0
VNode; use yew::{html, Callback, Properties}; use yew::Classes; use yewtil::{Emissive, Pure, PureComponent}; pub type Button = Pure<PureButton>; #[derive(PartialEq, Properties, Emissive, Debug)] pub struct PureButton { #[props(required)] pub callback: Callback<()>, pub text: String, pub classes: Class...
Rust
0
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2021 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + """ DNS script generator for TOF powder data...
Python
1
import os import numpy as np from pandas import read_csv from shutil import copyfile class batcher: def __init__(self, csv, load_dir, save_dir): self.load_dir = load_dir self.save_dir = save_dir self.img_list = read_csv(csv) self.sets = self.img_list['set'].unique() ...
Python
1
b: String::from("may peace be upon Israel.") }, ] }] }; } <reponame>Kampfkarren/rbx-tree use std::io::{Read, Write}; use rbx_dom_weak::RbxValue; use crate::{ core::XmlType, deserializer::{DecodeError, XmlEventReader}, serializer::{EncodeError, XmlWriteEv...
Rust
0
from encoders.Encoder import Encoder from engine.component.CallComponent import CallComponent from engine.component.CodeComponent import CodeComponent from engine.modules.EncoderModule import EncoderModule from enums.Language import Language class RleEncoder(Encoder): def __init__(self): super().__init__...
Python
1
"""Unit tests for the :mod:`networkx.algorithms.efficiency` module.""" import networkx as nx class TestEfficiency: def setup_method(self): # G1 is a disconnected graph self.G1 = nx.Graph() self.G1.add_nodes_from([1, 2, 3]) # G2 is a cycle graph self.G2 = nx.cycle_graph(4) ...
Python
1
C", "CP D", "CP E", "CP H", "CP L", "CP (HL)", "CP A", "RET NZ", "POP BC", "JP NZ,a16", "JP a16", "CALL NZ,a16", "PUSH BC", "ADD A,d8", "RST 00H", "RET Z", "RET", "JP Z,a16", "PREFIX CB", "CALL Z,a16", "CALL a16", "ADC A,d8", "RST 08H", "RET NC", "POP DE", "JP NC,a16", "UNKNOWN", "CALL NC,a16", "PUSH DE", "SUB...
Rust
0
g_content_list[0].get('Rule_Setting')['Rule_Expression']) rule_content_pattern = r'\[(.*?)\]' rule_content_list = [] for item in rule_column: rule_content_list.extend(re.findall(rule_content_pattern, item)) # 檢查excel所有欄位是否都存在於DB定義中 undefine_columns = None ...
Python
1
import sys, os parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(parent_dir) from core.base_classes import NodeEnvironment, Node, NodeType from core.print_node_info import print_node_info from core.looper_node import * # Create nodes text1 = Node.create_node(NodeType.TEXT, node...
Python
1
0, **deband_args), core.placebo.Deband(plane(clip, 2), grain=0, **deband_args) ]) def masked_placebo(clip: vs.VideoNode, rad: int = 12, thr: Union[int, List[int]] = 4, itr: int = 2, grain: int = 2, mask_args: Dict[str, Any] = {}, ...
Python
1
models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name="Пользователь", ), ), ], options={ "verbose_name...
Python
1
_manager::GenericShader; use crate::d3d_error::{D3DError, D3DResult}; use path_abs::{PathDir, PathFile}; use std::collections::HashSet; use std::ffi::{c_void, CStr, CString}; use std::{io, mem, ptr}; use winapi::shared::minwindef::{LPCVOID, UINT}; use winapi::shared::winerror::{E_FAIL, S_OK}; use winapi::um::d3d11::{ ...
Rust
0
ocks # NOTE should align with basebev backbone rather than resnet backbone x_concat = torch.cat([x, historical_x], dim=0) batch_node_features = self.regroup(x_concat, record_len) ## Semantic Information Aggregated from Spatial Dimension based on Multi-scale T...
Python
1
_neighbors20 = self.interferer_neighbors10 self.interferer_neighbors10 = self.interferer_neighbors self.interfered_neighbors20 = self.interfered_neighbors10 self.interfered_neighbors10 = self.interfered_neighbors def update(self, ir_change): self._save_csi_...
Python
1
ied. See the License for the specific language governing permissions and limitations under the License. */ //! A library to implement custom runtime v2 shims for containerd. //! //! # Runtime //! Runtime v2 introduces a first class shim API for runtime authors to integrate with containerd. //! The shim API is mi...
Rust
0
prev = prf(salt + loop.to_bytes(4, 'big')) # endianness doesn't matter here as long to / from use the same rkey = int.from_bytes(prev, 'big') for i in range(iterations - 1): prev = prf(prev) # rkey = rkey ^ prev rkey ^= from_by...
Python
1
str.trim_end_matches("/").to_string(); } Ok(path_str) } /// Mutably borrow the node with the given id. pub fn get_mut_node_by_id(&mut self, id: usize) -> Option<&mut Node> { self.nodes.get_mut(&id) } /// Mutably borrow the node (and its components) with the given id. pub fn get_mut_node_with_comps_by...
Rust
0
shuihuazhu" => 167, 33, 38; "胭脂虫", "yanzhichong" => 171, 29, 34; "朱樱", "zhuying" => 143, 29, 34; "大繎", "daran" => 130, 35, 39; "顺圣", "shunsheng" => 124, 25, 30; "爵头", "juetou" => 99, 18, 22; "麒麟竭", "qilinjie" => 76, 30, 26; ...
Rust
0
separator. //! K: '3.0e7__1' // Exponent consecutive digit separator. //! L: 'In_f' // Special (non-finite) digit separator. //! M: '010' // No integer leading zeros. //! N: '010.0' // No float leading zeros. //! O: '1.0' // No required exponent notation. //! P: '3.0E7' // Case-insensit...
Rust
0
from fastapi import FastAPI import uvicorn from app.api import routers app = FastAPI( title="Sales API", description=( "Sales API — это FastAPI приложение для управления продажами " "в сети магазинов бытовой техники" ), ) [app.include_router(router) for router in routers] if __name__ ==...
Python
1
= "Checks if the value of the field is `POS8DBM`"] #[inline] pub fn is_pos8d_bm(&self) -> bool { *self == TXPOWERR::POS8DBM } #[doc = "Checks if the value of the field is `POS7DBM`"] #[inline] pub fn is_pos7d_bm(&self) -> bool { *self == TXPOWERR::POS7DBM } #[doc = "Chec...
Rust
0
64) // --> [RexOp1jt_base#808d] and stop 0x0217, 0x808d, // end of jump_table_base.i64 (I64) // 0000c7: jump_table_entry.i64 (I64) // --> [RexOp1jt_entry#8063] and stop 0x0213, 0x8063, // end of jump_table_entry.i64 (I64) // 0000c9: load.i64 (I64) // --> [RexOp1ld#808b] // 0000c9...
Rust
0
= [-1 * final_fear_cc_acq, -1 * final_fear_cc_cc, -1 * final_fear_cc_nov, -1 * final_fear_cc_cc_SR] # Plotting the bar graph plt.figure(figsize=(10, 6)) bar_positions = range(len(contexts)) # Positions for the bars on the x-axis colors = ['red', 'green', 'orange', 'pink'] # Colors corresponding to the original scat...
Python
1
from odoo import models, fields, api class CustomStockLocation(models.Model): _inherit = 'stock.location' # fleet_ids = fields.One2many('fleet.vehicle', 'Warehouse_id') is_van_location = fields.Boolean(string='Is VAN Location', default=False) is_salesman_location = fields.Boolean( string='Is ...
Python
1
from flask import Flask, escape, request from ravyn import Ravyn, Gateway, Include, Request, get from ravyn.middleware.wsgi import WSGIMiddleware flask_app = Flask(__name__) second_flask_app = Flask(__name__) @flask_app.route("/") def flask_main(): name = request.args.get("name", "Ravyn") return f"Hello, {e...
Python
1
t) if weight else 'ثبت نشد'} • نوع غذا: {food_type or 'نامشخص'} • حالت: {mood or 'نامشخص'} • مدفوع: {stool or 'نامشخص'} • علائم: {symptoms or 'ندارد'} • خواب: {english_to_persian_numbers(str(sleep_hours)) + ' ساعت' if sleep_hours else 'نامشخص'} • دارو: {'مصرف شد' if medication else 'مصرف نشد'} • فعالیت: {activity or 'ن...
Python
1
# Copyright 2017 Square, Inc. # # 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 writing,...
Python
1
# website = "http://www.sadikturan.com" # course = "Python Kursu: Baştan Sona Python Programlama Rehberiniz (40 saat)" # # result = len(course) # # result = website[7:10] # # result = website[22:25] # # result = course[:15] # # result = course[-15:] # # result = course[::-1] # # name = "Bora" # # surname = "Yılmaz" #...
Python
1
to the manager }, } tx.send(client).ok().expect("Failed to send client to manager"); // Send the client back to the manager } fn process_request(request: IoResult<WebSocketInboundRequest>, tx: Sender<WebSocketRemoteClient>) { let request = request.ok().expect("Failed to read WebSocket request"); request.validat...
Rust
0