text
string
label_name
string
labels
int64
alculation_dbs/", ), fertility_interval=FertilityInterval(start=18, end=40), ), redis_queue=RedisQueueConfig(host="localhost", port="6379", db=0, queue_name="default"), logging=LoggingConfig(level="INFO"), urban_api=ApiConfig( ...
Python
1
", 0, 1000, ).unwrap().unwrap(); let incremented_epoch = epoch_changes .viable_epoch(&genesis_epoch_x_descriptor, &make_genesis) .unwrap() .increment(next_descriptor.clone()); epoch_changes.import( &is_descendent_of, *b"X", 1, *b"0", incremented_epoch, ).unwrap(); ...
Rust
0
ntln!("error: {}", why), } //lightning close position match client.lightning_close("btc-usd".to_string(), 1, "sell".to_string(), None, None) { Ok(lightning_close) => println!( "lightning_close:\n {:?}", lightning_close ), Err(why) => println!("error: {}",...
Rust
0
#!/usr/bin/env python3 import os # Specify the root directory root_directory = "/mnt/NAS/Anime/" def colored(r, g, b, text): return "\033[38;2;{};{};{}m{}\033[38;2;255;255;255m".format(r, g, b, text) def get_dir_info(root_directory): _, subdirectories, subfiles = next(os.walk(root_directory)) return su...
Python
1
op_k=top_k, repetition_penalty=repetition_penalty, length_penalty=length_penalty, **kwargs ) e2e_inference_time = (time.perf_counter()-start)*1000 print(f"the inference time is {e2e_inference_time} ms") output_text = tokenizer.decode(outputs[0], skip_special_token...
Python
1
let Err(_) = self //! .flag //! .compare_exchange_weak(false, true, Ordering::Acquire, Ordering::Relaxed) //! { //! hint::spin_loop() //! } //! //! let out = self.data.with_mut(move |t| unsafe { f(&mut *t) }); //! self.flag.store(false, Ordering::Rele...
Rust
0
rom `rpn_head` or last stage `bbox_head`, has shape (num_proposals, 4). label (Tensor): Only used when `self.reg_class_agnostic` is False, has shape (num_proposals, ). bbox_pred (Tensor): Regression prediction of current stage `bbox_head`. When `se...
Python
1
from openfisca_france.model.base import Individu, Variable, MONTH, \ set_input_dispatch_by_period, round_, where class chomage_cotisation_retraite_complementaire_journaliere(Variable): value_type = float entity = Individu label = 'Cotisation de retraite complémentaire journalière sur allocation chômag...
Python
1
_construction_self(id, &others, true)) .unwrap_or(Ok(()))?; } self.drop_items_index = build_index(&self.drop_items); Ok(()) } } pub mod tpkt; pub mod x224; pub mod client; pub mod mcs; pub mod gcc; pub mod per; pub mod sec; pub mod license; pub mod global; pub mod capabilit...
Rust
0
import json from tkinter import * from assist import * # 사업 분야(대)와 중분류 목록 categories = { "건강": ["전체 - B01", "식의약품안전 - B0101", "의료지원 - B0102", "질병치료 - B0103", "환경위생 - B0104", "기타 - B0105"], "공공안전": ["전체 - B02", "공공기능 - B0201", "국방 - B0202", "사업안전 - B0203", "시설안전 - B0204", "기타 - B0205"], "교육연구": ["전체 - B03",...
Python
1
es, 'position': preview.position, } for preview in obj.current_previews ] data['promoted'] = [ { 'group_id': promotion.group_id, # store the app approvals because .approved_applications needs it. 'approv...
Python
1
assert!(result.is_ok()); assert_eq!(interpreter.stack.top().values, vec![Val::Float(6.75)]); } #[test] fn mul_float_and_int_yields_float() { let cb = CodeBox::load_from_string("92, 5 *;"); let mut interpreter = Interpreter::new(empty(), sink()); let result = interpreter.run(&cb); assert!(result....
Rust
0
= 0, #[doc = "1: Fast Standby mode. LPM deasserted for read operations, but asserted while FLASH IDLE."] STANDBY = 1, #[doc = "2: Low Power mode. LPM always asserted for reads. LPM_RD_WAIT must be programmed to accommodate longer read access times."] ALWAYS = 2, } impl From<LPMMODE2_A> for u8 { #[i...
Rust
0
# -*- coding: utf-8 -*- def SOUNDEX(TERM: str): # Step 0: Covert the TERM to UpperCase TERM = TERM.upper() TERM_LETTERS = [char for char in TERM if char.isalpha()] # List the Remove occurrences of A, E, I, O, U, Y, H, W. Remove_List = ("A", "E", "I", "O", "U", "Y", "H", "W") # Save the first...
Python
1
READ_REGISTER = 0, ACPI_ERST_READ_REGISTER_VALUE = 1, ACPI_ERST_WRITE_REGISTER = 2, ACPI_ERST_WRITE_REGISTER_VALUE = 3, ACPI_ERST_NOOP = 4, ACPI_ERST_LOAD_VAR1 = 5, ACPI_ERST_LOAD_VAR2 = 6, ACPI_ERST_STORE_VAR1 = 7, ACPI_ERST_ADD = 8, ACPI_ERST_SUBTRACT = 9, ACPI_ERST_ADD_VALUE =...
Rust
0
latform, no input frog.vx = 0 frog.on_conveyor = False simulate_input_handling(frog, 0) print(f" 1 | Normal | 0 | {frog.vx:.1f} | Should stay still") # Phase 2: On normal platform, move right simulate_input_handling(frog, 1) print(f" 2 | Normal | 1 | {frog.vx:.1f} | Sh...
Python
1
ending), terminated(space1, eof), // Must consume something or many0 errors to prevent infinite loop ))(input) } fn parse_line_comment(input: &str) -> LedgerParseResult<&str> { let (input, _) = delimited( space0, alt((char(';'), char('#'), char('%'), char('|'), char('*'))), spac...
Rust
0
t = int(input()) for tc in range(1, t+1): n = int(input()) arr = [list(input()) for _ in range(n)] result = 'no' for k in range(2, n+1): for i in range(n-k+1): for j in range(n-k+1): cnt = 0 nemo = 0 for p in range(i, i+k): ...
Python
1
; use core_foundation::string::{CFString, CFStringRef}; use security_framework_sys::authorization as sys; use security_framework_sys::base::errSecConversionError; use std::mem::MaybeUninit; use std::os::raw::c_void; use std::{ convert::TryFrom, ffi::{CStr, CString}, }; use std::{convert::TryInto, marker::Phanto...
Rust
0
kmarks': 2992, 'is_bookmarked': False, 'visible': True, 'is_muted': False, 'total_comments': 47}, {'id': 75933779, 'title': 'ミコニャン', 'type': 'illust', 'image_urls': {'square_medium': 'https://i.pximg.net/c/540x540_10_webp/img-master/img/2019/07/27/16/34/45/75933779_p0_square1200.jpg', 'medium': 'https://i.pximg.net/c/5...
Python
1
from .._tier0 import create_none from .._tier0 import plugin_function from .._tier0 import Image import numpy as np @plugin_function(output_creator=create_none) def generate_touch_portion_matrix(label_map:Image, touch_portion_matrix_destination:Image = None) -> Image: """Take a label image and measure how often l...
Python
1
ction = 'left' else: x_direction = 'centered' y_offset = ball_y - target_center_y if abs(y_offset) <= y_tolerance: y_direction = 'centered' elif y_offset > y_tolerance + hysteresis: y_direction = 'backward' elif y_offset < -(y_toleranc...
Python
1
status: ResponseStatus::Error, reason, } } } // #[serde_as] #[derive(Serialize)] pub struct PingResponse { #[serde_as(as = "DisplayFromStr")] pub status: ResponseStatus, #[serde(with = "ts_milliseconds")] pub timestamp: DateTime<Utc>, } // #[derive(Deserialize)] pub struct ...
Rust
0
ics fn parse_def_generics<'a>( inner: &'a mut Pairs<Rule>, file: &File, ) -> (Option<Generics>, Option<Pair<'a, Rule>>) { let (generics, next) = parse_maybe_rule(inner, Rule::def_generics); ( generics.map(|x| { let inner = x.into_inner(); let mut generics = Vec::new(); for pair in inner { generics.pu...
Rust
0
# Copyright 2023-2024 Vlad Krupinskii <mrvladus@yandex.ru> # SPDX-License-Identifier: MIT import os from subprocess import getoutput import subprocess from time import sleep from gi.repository import Adw, Gio, GLib, Xdp # type:ignore from errands.lib.data import UserData from errands.lib.gsettings import GSettings ...
Python
1
JS_EMPTY_STATEMENT => JsAnyStatement::JsEmptyStatement(JsEmptyStatement { syntax }), JS_EXPRESSION_STATEMENT => { JsAnyStatement::JsExpressionStatement(JsExpressionStatement { syntax }) } JS_IF_STATEMENT => JsAnyStatement::JsIfStatement(JsIfStatement { syntax }), DO_WHILE_STMT => JsAnyStatement::DoWhil...
Rust
0
ub fn set_special_light_damaged(&mut self, special_light_id: u8, state: bool) { unsafe { alt_IVehicle_SetSpecialLightDamaged( self.0.load(Ordering::Relaxed), special_light_id, state, ) } } pub fn has_armored_windows(&self) ...
Rust
0
or key in state_dict_.keys(): if '.attention.' in key: state_dict_self_attention[key.replace( '.attention.', '.self_attention.')] = state_dict_[key] else: state_dict_self_attention[key] = state_dict_[key] state_d...
Python
1
import os import time from filterpy.memory import FadingMemoryFilter # https://filterpy.readthedocs.io/en/latest/memory/FadingMemoryFilter.html #pip3 install git+https://github.com/ricardodeazambuja/vl53l1x-python import VL53L1X NODE_STR = "[TOF NODE]" class ToF(): def __init__(self, pipe_write, pipe_read, tim...
Python
1
import re import requests import execjs import urllib from json import loads File = '.my.js' # cookie 开发者工具中获取 必须带上 否则报错 headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36', 'Cookie': 'BAIDUID=761A155CABDEEA77604C91E9...
Python
1
from __future__ import annotations __all__ = ["HIT_MTRL_PARAM_ST"] from soulstruct.base.params.param_row import * from soulstruct.bloodborne.game_types import * from soulstruct.bloodborne.params.enums import * from soulstruct.utilities.binary import * class HIT_MTRL_PARAM_ST(ParamRow): SoundRadiusMultiplier: fl...
Python
1
value of the field is `AON_RTC_CH2_DLY`"] #[inline] pub fn is_aon_rtc_ch2_dly(&self) -> bool { *self == VEC_EVR::AON_RTC_CH2_DLY } #[doc = "Checks if the value of the field is `SW_WU3`"] #[inline] pub fn is_sw_wu3(&self) -> bool { *self == VEC_EVR::SW_WU3 } #[doc = "Chec...
Rust
0
f"How many total points (Deafault = 3)?: {str(total_points)}", True, WHITE) screen.blit(question_how_meany_points, (SCREEN_WIDTH/2 - 297/2, 100)) if questionsLvl >= 4: question_gravity = retroFont.render( f"Gravity in Meters/Sec (Earth = 9.8)?: {str(g)}", True, WHITE)...
Python
1
ight, std=0.001) if m.bias is not None: nn.init.constant_(m.bias, 0) class DLASeg(nn.Module): def __init__(self, base_name='dla34', pretrained=False, down_ratio=4, head_conv=256): super(DLASeg, self).__init__(...
Python
1
ronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceTimelineSemaphorePropertiesKHR.html) · Alias"] #[doc(alias = "VkPhysicalDeviceTimelineSemaphorePropertiesKHR")] #[allow(non_camel_case_types)] pub type PhysicalDeviceTimelineSemaphorePropertiesKHRBuilder<'a> = crate::vk1_2::PhysicalDeviceTimelineSe...
Rust
0
.saturating_add(T::DbWeight::get().writes(1 as Weight)) } fn update_pre_prices(p: u32) -> Weight { (11_478_000 as Weight) // Standard Error: 27_000 .saturating_add((206_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get(...
Rust
0
import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestRegressor import os from config import result_path_strategy1 category_path = os.path.join(result_path_strategy1, "RWA") target_pair = "RSR_LTO" pair_path = os.path.join(category_path, target_pair) target_p...
Python
1
from generatorPreProcessor import GeneratorPreProcessor import sys # Validating: # --- # zen_access_control: # - project: cpd # openshift_cluster_name: "{{ env_id }}" # keycloak_name: cp-keycloak # demo_openldap_names: # - demo-openldap-1 # - demo-openldap-2 # ldap_names: # - ldap-1 # - ldap-2 # user...
Python
1
adocument"; } impl HasMeta for ADocument { fn meta(&self) -> &DocMeta<Self> { &self.meta } fn meta_mut(&mut self) -> &mut DocMeta<Self> { &mut self.meta } } #[test] fn load_missing_document_should_return_none() -> Result<(), Error> { e...
Rust
0
f = data_df.groupby(['miner_num', 'difficulty'])['mb_times'].agg(['mean', 'std']).reset_index() # Create the subplots axMeans = fig.add_subplot(grid[0:2, 0]) # ax_a will span two rows. axTimesM1 = fig.add_subplot(grid[0, 1:3]) axTimesM3 = fig.add_subplot(grid[1, 1:3]) axGrowth = fig.add_subplot...
Python
1
self.multiple_types() class TestWithDB(CorpusIndexMeta): def setUp(self) -> None: self.corpus = reload_corpus_in_db_mode(get_basic_corpus()) def test_basic_functions(self): self.basic_functions() def test_key_insertion_deletion(self): self.key_insertion_deletion() def t...
Python
1
uery string parameter"] pub const e_fiftyone_degrees_evidence_prefix_FIFTYONE_DEGREES_EVIDENCE_QUERY: e_fiftyone_degrees_evidence_prefix = 8; #[doc = "< A cookie value"] pub const e_fiftyone_degrees_evidence_prefix_FIFTYONE_DEGREES_EVIDENCE_COOKIE: e_fiftyone_degrees_evidence_prefix = 16; #[doc = "< The evidenc...
Rust
0
""" (*)~--------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) Pupil Labs Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0). See COPYING and COPYING.LESSER for license details. ----------------------------------------------...
Python
1
} _ => (None, None), } } fn blocks_boundaries<L: Clone + Debug>(blocks: &[TBLBlock<L>]) -> Option<Bound> { let intervals: Vec<&TBLInterval<L>> = blocks .iter() .map(|b| match b { TBLBlock::Space(interval) => interval, TBLBlock::Segment(interval) => interval, ...
Rust
0
) # trashed field FieldHandler().delete_field(user, linked_table_text_field) trashed_field_linked_table_reference = ( f"?{quote(link_row_field.name)}__join={quote(linked_table_text_field.name)}" ) request = rf.get( reverse("api:database:rows:list", kwargs={"table_id": table.id...
Python
1
::change_count(250, &(1..250).collect())); } } <reponame>mayah/rust-puyoai<filename>puyoai-core/src/field_bit.rs<gh_stars>1-10 use sseext; use std; use x86intrin::*; #[derive(Clone, Copy, Debug)] pub struct FieldBit { m: m128i, } impl FieldBit { pub fn new(m: m128i) -> FieldBit { Fiel...
Rust
0
import matplotlib.pyplot as plt import scipy.stats as stats import numpy as np from scipy.stats import norm from tqdm import tqdm # Target Distribution: double gamma distribution dg = stats.dgamma(a=1) # 定义双伽马分布 qx = stats.norm(loc=0, scale=2) # Generate samples for PDF x = np.linspace(min(dg.ppf(0.001), norm.ppf(0....
Python
1
# 특정 indices가 지정된 경우 해당 데이터만 로드 if self.data_indices: if self.verbose: cprint(f"Loading data indices: {self.data_indices}", "cyan") for data_idx in self.data_indices: if '@' in data_idx: seq_id, frame_idx = data_idx.split('@') ...
Python
1
from matplotlib import pyplot as plt import numpy as np import scipy from tqdm import tqdm from gol.pure.automata import Automata from gol.main_pure import init_gol_board_neighborhood_rule import torch def life_update(x,y): ''' Credits to Raymond Baranski (Alex) `x` is the cell-state (dead=0, alive=1), and...
Python
1
import torch from torch.utils.data import Dataset, DataLoader import os import pandas as pd import json import pickle import lmdb import random import numpy as np from io import BytesIO from torchaudio.compliance.kaldi import fbank import lilcom import torchaudio import re from transformers import DistilBertTokenizer i...
Python
1
GetDataNodeAtValue("0") self.assertTrue(index_0_display_node.GetColorNodeID() == mrHead.GetDisplayNode().GetColorNodeID()) self.assertTrue(index_0_display_node.GetWindowLevelMin() == mrHead.GetDisplayNode().GetWindowLevelMin()) self.assertTrue(index_0_display_node.GetWindowLevelMax() == mrHead.G...
Python
1
# Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com> # Copyright (C) 2022 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause from __future__ import annotations from PySide6.QtWebChannel import QWebChanne...
Python
1
rgv, argc as usize), }; (*boxed_aggr).inverse(&mut ctx, &mut **pac) }); let r = match r { Err(_) => { report_error(ctx, &Error::UnwindingPanic); return; } Ok(r) => r, }; match r { Ok(_) => {} Err(err) => report_error(ctx, &e...
Rust
0
year: String, isbn: String, } impl Reference { fn new( name: String, authors: String, pages: String, title: String, publisher: String, year: String, isbn: String, ) -> Reference { Reference { name, authors, ...
Rust
0
[derive(Debug)] pub(super) struct SourceWorkerThread; impl WorkerThread for SourceWorkerThread { const THREAD_NAME: &'static str = "SourceWorker"; type ThreadArg = TaskWorkerThreadArg; type LoopState = TaskWorkerLoopState<SourceScheduler>; fn setup_ready(worker_setup_coordinator: Arc<WorkerSetupCoor...
Rust
0
GLZ { fn encode_all_with_prog<U: Sym, T>( &self, slices: &[&[U]], mut prog: (impl IntoIterator<Item=T>, impl FnMut(T), impl FnMut(usize)), ) -> Result<(BitVec, Vec<(usize, usize)>)> { let mut history: HashMap<&[U], usize> = HashMap::new(); let mut off = 0; // compressed ...
Rust
0
from abc import ABC, abstractmethod from typing import Optional class VADProviderBase(ABC): @abstractmethod def is_vad(self, conn, data) -> bool: """检测音频数据中的语音活动""" pass
Python
1
tion<E>, LB: FnOnce(LinearCombination<E>) -> LinearCombination<E>, LC: FnOnce(LinearCombination<E>) -> LinearCombination<E> { self.constraints += 1; let a = a(LinearCombination::zero()); let b = b(LinearCombination::zero()); let c = c(LinearCombination::z...
Rust
0
from django.conf.urls import include, url import YaraGuardian.API.urls from django.contrib import admin from django.contrib.auth import views as auth_views from YaraGuardian.views import Index, Login, Logout, RecoverPassword, RegisterAccount, Healthz urlpatterns = [url(r'^$', Index.as_view(), ...
Python
1
#!/usr/bin/env python """ Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/) See the file 'LICENSE' for copying permission """ from __future__ import division import time from lib.core.common import dataToStdout from lib.core.convert import getUnicode from lib.core.data import conf from lib.core.data i...
Python
1
) .await } pub fn add_symbols(&mut self, name: String, symbols: String) { self.symbols.insert(name, symbols); } } #[tokio::test] async fn test_simple() { let mut f = TestFixture::new(); let stack = Section::new(); stack.start().set_const(0x80000000); // There should...
Rust
0
############################################################################ # $Id: 16c622.py 70 2004-08-23 01:34:19Z estyler $ # # Description: PIC 16C622 definition. Pyastra project. # Author: Alex Ziranov <estyler _at_ users _dot_ sourceforge _dot_ net> # # Copyright (c) 2004 Alex Ziranov. All rights reserved. ...
Python
1
o,piào,shān"), ('髠', "kūn"), ('髡', "kūn"), ('髢', "dí"), ('髣', "fǎng"), ('髤', "xiū"), ('髥', "rán"), ('髦', "máo"), ('髧', "dàn"), ('髨', "kūn"), ('髩', "bìn"), ('髪', "fà,fǎ"), ('髫', "tiáo"), ('髬', "pī"), ('髭', "zī"), ('髮', "fà,fǎ"), ('髯', "rán"), ('髰', "tì"...
Rust
0
MODERN_STYLE = """ /* 全局样式 */ QWidget { font-family: "Microsoft YaHei", "Segoe UI", "Arial"; font-size: 12px; color: #333333; } /* 主窗口 */ QMainWindow { background-color: #ffffff; } /* 分组框样式 */ QWidget#groupBox { background-color: #fafafa; border: 1px solid #e8e8e8; border-radius: 4px; } /...
Python
1
).unwrap(); let response = ResponseTemplate::new(200).set_body_json(charizard_as_json); Mock::given(method("GET")) .and(path(&mock_path)) .respond_with(response) .mount(&mock_server) .await; let pokemon_url = format!("{}{}", &mock_server.uri(), &...
Rust
0
PREFIX, checksummed_hex::encode(addr.as_bytes()) ) } Key::EraInfo(era_id) => { format!("{}{}", ERA_INFO_PREFIX, era_id.value()) } Key::Balance(uref_addr) => { format!("{}{}", BALANCE_PREFIX, checksummed_h...
Rust
0
ch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0) optimizer.step() total_loss += loss.item() avg_loss = total_loss / len(train_loader) val_rmse, val_mae, val_r2 = evaluate_model(model, val_loader, device) print(f"Epoch [{epoch+1}/{epochs}] - Train Loss: {avg_...
Python
1
#MyState/RotEncoders.py #------------------------------------------------------------------------------- #=EncoderSensorIF #=============================================================================== class EncoderSensorIF: #@abstractmethod def read_delta(self): #Some interrupt-assisted encoders might read mult...
Python
1
def test_sv_tokenizer_handles_long_text(sv_tokenizer): text = """Det var så härligt ute på landet. Det var sommar, majsen var gul, havren grön, höet var uppställt i stackar nere vid den gröna ängen, och där gick storken på sina långa, röda ben och snackade engelska, för det språket hade han lärt sig av sin mor. Ru...
Python
1
nwrap(), r#"#[cfg(test)] mod tests { #[test] fn it_works() { let result = 2 + 2; assert_eq!(result, 4); } } "# ); } #[cargo_test] fn creates_binary_when_instructed_and_has_lib_file_no_warning() { let path = paths::root().join("foo"); fs::create_dir(&path).unwrap(); f...
Rust
0
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import unittest import torch from executorch.backends.xnnpack.test.tester import Tester from executorch.backen...
Python
1
(&mut expr.attrs), Expr::Type(expr) => Some(&mut expr.attrs), Expr::Unary(expr) => Some(&mut expr.attrs), Expr::Unsafe(expr) => Some(&mut expr.attrs), Expr::While(expr) => Some(&mut expr.attrs), Expr::Yield(expr) => Some(&mut expr.attrs), _ => None...
Rust
0
.get_uri(); let http_request = Request::post(&uri) .header(CONTENT_TYPE, "application/json") .header("Api-Key", request.credentials.license_key.clone()); let http_request = if let Some(ce) = request.compression.content_encoding() { http_request.header(CONTENT_ENCODI...
Rust
0
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html # For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE # Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt from __future__ import annotations from astroid import arguments, nodes from ast...
Python
1
Ok(_) = input.parse::<Token![=]>() { Some(input.parse::<Literal>()?) } else { None }; Ok(Self { ident, name }) } } #[proc_macro_derive(Encode, attributes(solid))] pub fn encode(input: TokenStream) -> TokenStream { let ast = parse_macro_input!(input as DeriveInp...
Rust
0
# ============================ [01] imports & cfg — START ============================ from __future__ import annotations import argparse from pathlib import Path ASCII_READY = "ready" # ============================= [01] imports & cfg — END ============================= # ================================ [02] logi...
Python
1
""" # Intuition - # Approach index가 모두 다를것, 합 = 0 -> -a = b+c 중복 X -> set : dic와 다르게 가변객체 삽입 X Two Pointer -> 정렬된 배열을 활용 # Complexity - Time complexity - Brute-force : O(N^3) - Set : O(N^2) - Time Limit Exceeded (memory??) - Two Pointer : O(N^2) - Space complexity - Brute-force : O(N) - Set : O(N) - Two ...
Python
1
# 分组列使用颜色 group_format = group_colors.get(group_key, normal_format) worksheet.write(row_idx, 0, group_key, group_format) # 原词列(如果变化则标黄) if orig_text != norm_text: worksheet.write(row_idx, 1, orig_text, yellow_format) ...
Python
1
from django.contrib.admin import ModelAdmin from django.contrib.admin.options import StackedInline from django.forms import ModelForm from django.urls import reverse_lazy from judge.models import TicketMessage from judge.widgets import AdminHeavySelect2MultipleWidget, AdminHeavySelect2Widget, AdminMartorWidget class...
Python
1
Frame(300), helper::Condition::Equals(0x000a, 0x00), ); } #[test] fn nmi_and_irq() { helper::run( format!("{}3-nmi_and_irq.nes", DIR), helper::RunUntil::Frame(300), helper::Condition::Equals(0x000a, 0x00), ); } #[test] fn irq_and_dma() { helper::run( format!("{}...
Rust
0
*(rs_allocation*)buf3246 = rsgMeshGetVertexAllocation(*(rs_mesh*)buf3247, *(uint32_t*)buf3248); #endif #ifndef __LP64__ *(uint32_t*)buf3249 = rsgMeshGetVertexAllocationCount(*(rs_mesh*)buf3250); #endif #ifndef __LP64__ rsgProgramFragmentConstantColor(*(rs_program_fragment*)buf3251, *(float*)buf3252, *(floa...
Rust
0
ch_weights: if self.model_lowvram: for m in self.model.modules(): if hasattr(m, "prev_comfy_cast_weights"): m.comfy_cast_weights = m.prev_comfy_cast_weights del m.prev_comfy_cast_weights m.weight_function...
Python
1
slice().iter(), r.dir.as_slice().iter(), self.min.as_slice().iter(), self.max.as_slice().iter() ) { let t0 = (((minc - ro) / rd) as f32).min((maxc - ro) / rd); let t1 = (((minc - ro) / rd) as f32).max((maxc - ro) / rd); let t_min = TMIN.max...
Rust
0
stack.len(), 0); } } #[allow(unused_variables)] fn main() { let mut x = 5; println!("The value of x is: {}", x); x = 6; println!("The value of x is: {}", x); // shadowing let x = 5; let x = x + 1; let x = x * 2; println!("The value of x is: {}", x); let spaces = " "; ...
Rust
0
import torch.nn as nn class SNRWDNN(nn.Module): def __init__(self, channels, num_of_layers=8): super(SNRWDNN, self).__init__() features = 32 layers = [] kernel_size = 3 padding = 1 groups = 32 layers.append(nn.Conv2d(in_channels=channels, out_channel...
Python
1
t for step in reasoning_steps] + [target_step] embeddings = self.filter_impl.embedding_model.encode(all_contents) # Compute similarities target_embedding = embeddings[-1].reshape(1, -1) step_embeddings = embeddings[:-1] similarities = cosine_similarity(target_embedding, step_em...
Python
1
idx_type: H5_index_t, order: H5_iter_order_t, n: hsize_t, name: *mut c_char, size: size_t, lapl_id: hid_t) -> ssize_t; pub fn H5Literate(grp_id: hid_t, idx_type: H5_index_t, order: H5_iter_order_t, idx: *mut hsize_t, op: H5L_iterate_...
Rust
0
osen_rewards - rejected_rewards).cpu() metrics[f"{prefix}rewards/chosen"] = chosen_rewards.cpu() metrics[f"{prefix}rewards/rejected"] = rejected_rewards.cpu() metrics[f"{prefix}logps/margins"] = (policy_chosen_logps - policy_rejected_logps).detach().cpu() metrics[f"{prefix}logps/chosen"]...
Python
1
] #[inline(always)] pub fn gpio_0_intr_en_ap(&mut self) -> GPIO_0_INTR_EN_AP_W { GPIO_0_INTR_EN_AP_W { w: self } } #[doc = "Bit 1 - GPIO_1 interrupt enable for AP"] #[inline(always)] pub fn gpio_1_intr_en_ap(&mut self) -> GPIO_1_INTR_EN_AP_W { GPIO_1_INTR_EN_AP_W { w: self } ...
Rust
0
in three.rs //!/// Creates a lockbox. ///For creating JSON Shema which will be used with CosmJS use schemars::JsonSchema; ///Necessaryimports use serde::{Deserialize, Serialize}; use cosmwasm_std::{Addr, Uint128, Uint64}; use cw_storage_plus::{Item, Map}; use cw_utils::Scheduled; /// Item stores one typed item at t...
Rust
0
datos={} while True: print("1. Agregar Libro: ") print("2. Ver Libros") print("3. Pedir Libros") print("4. Ver Libros Prestados") op=int(input("Ingrese una opcion: ")) match op: case 1: nombre=input("Ingres enombre de el libro: ") año=input("Ingrese año de el libr...
Python
1
stopRecording = True else: silentCount = silentCount + 1 elif status == 0: #voice found silentCount = 0 if stopRecording == True: fname = self.saveMessage() audio_rec...
Python
1
re, }; use gw_traits::CodeStore; use gw_types::{ bytes::Bytes, core::{ScriptHashType, Status}, offchain::RollupContext, packed::{ AccountMerkleState, BlockMerkleState, GlobalState, L2Block, L2BlockCommittedInfo, RawL2Block, Script, SubmitTransactions, }, prelude::*, }; /// Build...
Rust
0
from django.contrib import admin # Register your models here. from .models import Beer, BeerImage, Whiskey, WhiskeyImage, Wine, WineImage, NonAlcohol, NonAlcoholImage @admin.register(Beer) class BeerAdmin(admin.ModelAdmin): list_display = ('subtype', 'description') @admin.register(BeerImage) class BeerImageAdmin...
Python
1
the vulnerable versions for this # particular product allvulnerableversions = map(lambda x: x[1], filter(lambda x: x[0] == product, vulnpackageversions)) for vulpack in allvulnerableversions: ...
Python
1
def find_pattern_match(filename): pattern_list = model_location_patterns() return any(re.search(pattern, filename) for pattern in pattern_list)
Python
1
del.module.state_dict(), os.path.join(self.opt.SAVE_PATH, 'saved_model', 'best_val_dist_R_T_T')) torch.save(self.VoxelMorph_net.module.state_dict(), os.path.join(self.opt.SAVE_PATH, 'saved_model', 'best_val_dist_R_T_R')) else: torch.save(self.model.state_dict(), os.path.join...
Python
1
(self, d, s0); } I::V_SQRT_F32 => { v_sqrt_f32_e32(self, d, s0); } I::V_FFBH_U32 => { v_ffbh_u32_e32(self, d, s0); } I::V_CVT_F32_U32 => { v_cvt_f32_u32_e32(self, d, s0); } I::...
Rust
0
m8` /// /// `o64 C1 /0 ib` /// /// `X64` /// /// `64-bit` Rol_rm64_imm8 = 369, /// `ROR r/m16, imm8` /// /// `o16 C1 /1 ib` /// /// `186+` /// /// `16/32/64-bit` Ror_rm16_imm8 = 370, /// `ROR r/m32, imm8` /// /// `o32 C1 /1 ib` /// /// `386+` /// /// `16/32/64-bit` Ror_rm32_imm8 = 371, /// `ROR ...
Rust
0
those within [BG_THRESH_LO, BG_THRESH_HI) bg_inds = np.where((overlaps < cfg.TRAIN.BG_THRESH_HI) & (overlaps >= cfg.TRAIN.BG_THRESH_LO))[0] # image is only valid if such boxes exist valid = len(fg_inds) > 0 or len(bg_inds) > 0 if cfg.MODEL.KEYPOINTS_ON: ...
Python
1