text
string
label_name
string
labels
int64
n this test suite and update if necessary. Reads the test suite /// and returns. /// /// Returns the updated public config, its unique ID, and the lock guard for modification /// to the caller. /// /// The lock guard is returned in order to prevent modification between suite update /// and running. #[instrument(skip(cf...
Rust
0
Data: WbemErrorEnum = -2147217340i32; #[doc = "*Required features: 'Win32_System_Wmi'*"] pub const wbemErrServerTooBusy: WbemErrorEnum = -2147217339i32; #[doc = "*Required features: 'Win32_System_Wmi'*"] pub const wbemErrInvalidFlavor: WbemErrorEnum = -2147217338i32; #[doc = "*Required features: 'Win32_System_Wmi'*"] p...
Rust
0
free_var, RcTerm::from(Term::Proj(expr.clone(), current_label)), )); } } } Err(TypeError::NoFieldInType { label_span, expected_label: label.clone(), found: B...
Rust
0
]["uncompressed"]["derivations"][-1]["fingerprint"] assert hdwallet.parent_fingerprint() == data["hdwallet"]["BIP86"]["uncompressed"]["derivations"][-1]["parent_fingerprint"] assert hdwallet.address( address="P2TR", hrp=cryptocurrency.NETWORKS.MAINNET.HRP, witness_version=cryptocurrency...
Python
1
""" This module contains database dialect specific changeset implementations. """ __all__ = [ 'postgres', 'sqlite', 'mysql', 'oracle', 'ibmdb2', ]
Python
1
HTML, like Gecko) Version/4.0 Chrome/88.0.4324.181 Mobile Safari/537.36[FBAN/EMA;FBLC/it_IT;FBAV/239.0.0.10.109;]' open("data/ua.txt","w").write(ua_) except: pass # LOGO (LO GOBLOK) IP = requests.get("https://api.ipify.org/").text def banner(): print (''' %s © Group%s \n __________ _____.__ \n \____ ...
Python
1
_pair2 : expr, $s1_lo : expr, $s2_lo : expr, $s1_as_64 : expr, $s2_as_64 : expr, $vec_len: expr) => { $split_pair1 = $s1.split_at($vec_len); $s1_lo[..$vec_len].clone_from_slice($split_pair1.0); $s1 = $split_pair1.1; $split_pair2 = $s2.split_at($vec_len); $s2_lo[..$vec_len].clone_...
Rust
0
); fn report_peer(&self, peer_id: PeerId, cost_benefit: ReputationChange); } pub trait NetworkActor: ActorService + EventHandler<Self, PeerMessage> + EventHandler<Self, NotificationMessage> + EventHandler<Self, ReportReputation> + ServiceHandler<Self, GetPeerSet> + ServiceHandler<Self, Get...
Rust
0
5f64); let b = Sphere::init(&[0f64, 5f64, 0f64], 5f64); let ret = query_intersect(&a, &b); assert!(ret.expect("gjk return unexpected")); } //todo // { // let a = Point3::init( &[ -9.9, 9.9, 9.9 ] ); // let b = RecBox::init( &[ 0.,0.,0. ], 10. ); // let ret = intersect_gjk::query_intersect( &a, ...
Rust
0
ty)) => ty.span, Some(EntryTraitRef(_, tr)) => tr.path.span, Some(EntryLocal(_, pat)) => pat.span, Some(EntryPat(_, pat)) => pat.span, Some(EntryBlock(_, block)) => block.span, Some(EntryStructCtor(_, _)) => self.expect_item(self.get_parent(id)).span, ...
Rust
0
Package(s) to check --all Alias for --workspace --workspace Perform command for all packages in the workspace --exclude <SPEC>... Exclude packages from the check --manifest-path <PATH> Path to C...
Rust
0
import requests import os import json import re from datetime import datetime # Configuración para IBM Cloud # Es recomendable usar variables de entorno en producción APIKEY = "" PROJECT_ID = "" MODEL_ID = "ibm/granite-3-8b-instruct" # Cambio al modelo de código que es mejor para generar JSON API_VERSION = "2023-05-29...
Python
1
import os from aphrodite import LLM, SamplingParams # creates XLA hlo graphs for all the context length buckets. os.environ['NEURON_CONTEXT_LENGTH_BUCKETS'] = "128,512,1024,2048" # creates XLA hlo graphs for all the token gen buckets. os.environ['NEURON_TOKEN_GEN_BUCKETS'] = "128,512,1024,2048" # Sample prompts. pro...
Python
1
3012 cz14.67g_L @z0.13 AUz 15.6 daysg z%@zEPIC 249893012 dz10.18g @z0.22 AUz 35.7 daysg[?@zEpsilon Coronae Borealis bz228.0gQ@z 417.9 daysgW0Q`@g "$u@zEpsilon Eridani bz11.0g@5^In@z3.39 AUz 7.4 yearsg!'r=)@gJ1a@zEpsilon Indi A bz12.0ggffff#@z11.55 AUz 45.2 yearsgt%M@gS@zEpsilon Tauri bz1.93...
Python
1
pub fn foo(input: TokenStream) -> TokenStream { //! let mut input = input.into_iter().collect::<Vec<_>>(); //! if input.len() != 1 { //! // Please do proper error handling in your real code! //! panic!("expected exactly one token as input"); //! } //! let token = input.remove(0); ...
Rust
0
#!/usr/bin/env python # # License: BSD # https://raw.github.com/yujinrobot/kobuki/hydro-devel/kobuki_testsuite/LICENSE # ############################################################################## # Imports ############################################################################## import threading impo...
Python
1
import unittest import numpy as np from sharc.propagation.propagation_clutter_loss import PropagationClutterLoss from sharc.support.enumerations import StationType class TestPropagationClutterLoss(unittest.TestCase): def setUp(self): self.clutter_loss = PropagationClutterLoss(np.random.RandomState(42)) ...
Python
1
00008067 ret let golden = vec![ 183, 21, 0, 0, 147, 133, 69, 35, 59, 5, 181, 0, 103, 128, 0, 0, ]; assert_eq!(code, &golden[..]); } } <reponame>macron-lang/macron-rs #![cfg(test)] macro_rules! t { ($(#[$($meta:meta)*])* $n:ident) => { #[test] $(#[$($meta)*])...
Rust
0
(data=df_val) log_all['validation_data'] = wandb_table_val if config["dataset"].startswith('niah'): niah_table_val = wandb.Table(data=df_niah) log_all['niah_val'] = niah_table_val if config["dataset"].start...
Python
1
yaml2); Ok(()) } fn toml2yaml(content: &str) -> Result<String> { let value: Value = toml::from_str(content)?; Ok(serde_yaml::to_string(&value)?) } pub struct Credential { pub username: String, pub secret: String, } //! Tests auto-converted from "sass-spec/spec/core_functions/meta/module_variables...
Rust
0
""" Integration tests for the scanner """ import os import tempfile import pytest from unittest.mock import patch, MagicMock from eth_vuln_scanner.scanner import Scanner from eth_vuln_scanner.analyzers.dummy_analyzer import DummyAnalyzer class TestScanner: """Test the scanner""" @pytest.fixture def ...
Python
1
import time import allure import pytest from selenium.webdriver.common.by import By from utils.utilities import capture_screenshot from config.constants import URLs, Selectors, Buttons @allure.feature("예외 케이스") @allure.story("잘못된 ID,PW 입력") @allure.title("잘못된 ID,PW 입력 시 로그인이 실패하는지 확인") def test_login(driver): driv...
Python
1
if isinstance(difficulty_levels, list): console.print(f"[bold]Difficulty Levels:[/bold] {', '.join(difficulty_levels)}") else: console.print(f"[bold]Difficulty Levels:[/bold] {difficulty_levels}") value_range ...
Python
1
5' range [-pi/4, 3pi/4]. Returns: angle (Tensor): the normalized angles [0, 1]. ''' if isinstance(angle, torch.Tensor): if angle_version == 'oc': return (angle + math.pi / 2) / (math.pi / 2) elif angle_version == 'le90': return (angle + math.pi / 2) / math.pi...
Python
1
put = "\ ..##.........##.........##.........##.........##.........##....... --->\n\ #..O#...#..#...#...#..#...#...#..#...#...#..#...#...#..#...#...#..\n\ .#....X..#..#....#..#..#....#..#..#....#..#..#....#..#..#....#..#.\n\ ..#.#...#O#..#.#...#.#..#.#...#.#..#.#...#.#..#...
Rust
0
assert (formatted.longitude.diff("longitude") == 2).all() def test_stats(): """Special handling for statistical aggregations.""" dx_source = 1 source = xarray_regrid.Grid( north=90 - dx_source / 2, east=360 - dx_source / 2, south=-90 + dx_source / 2, west=0 + dx_source ...
Python
1
import socket import pyaudio # 服务器的 IP 地址和端口号 SERVER_IP = '0.0.0.0' SERVER_PORT = 8888 # 创建 UDP 套接字 server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # 绑定 IP 地址和端口号 server_socket.bind((SERVER_IP, SERVER_PORT)) print(f"UDP 服务器正在监听 {SERVER_IP}:{SERVER_PORT}...") # 初始化 PyAudio p = pyaudio.PyAudio() # ...
Python
1
werFrame.GetPropertyStr(self.wxTree,wxNode) self.display.SetLabel(txt) def OnMenu(self, event): wxNode = event.GetItem() self.PopupMenu(HdfTreePopupMenu((self.wxTree,wxNode)), event.GetPoint()) if __name__ == '__main__': def GetArgs(): import sys,argparse #since python 2.7 exampleCmd='/...
Python
1
import matplotlib.pyplot as plt import numpy as np input = np.logspace(-1, 10, 100000) p = 0.7 white = 1 L_A = 0.2 * white k = 1.0 / (5 * L_A + 1) F_L = 0.2 * k**4 * (5 * L_A) + 0.1 * (1 - k**4) ** 2 * (5 * L_A) ** (1 / 3) R_a = 400 * (F_L * input / white) ** p / (27.13 + (F_L * input / white) ** p) + 0.1 fig, axs ...
Python
1
import json import os import random import shutil with open("datasets/data/shapenet/meta/shapenet.json") as fp: labels_map = json.load(fp) with open("datasets/data/shapenet/meta/test_tf.txt") as fp: lines = [line.strip() for line in fp.readlines()] for entry in labels_map.values(): file_list = list(filte...
Python
1
import subprocess from lib.constants import Const # HOST_KEY_DIR_TEMP = f"{Const.HOME_DIR}/proje/src/.desit/hostkey/" class Transfer: def send(self, file, devices): filePath = file.getPath() for device in devices: username = device.getUsername() add...
Python
1
from os import path import re from setuptools import setup def get_version(): text = open(path.join(path.dirname(__file__), "sphinx_tabs", "__init__.py")).read() match = re.compile(r"^__version__\s*\=\s*[\"\']([^\s\'\"]+)", re.M).search(text) return match.group(1) with open("README.md") as readme: l...
Python
1
html#GUID-90BA159E-79AE-47C6-844C-41BB5ADFEBD3 // fn OCIIntervalCheck( // hndl: *const c_void, // err: *const OCIError, // interval: *const OCIInterval, // valid: *const u32, // ) -> i32; // https://docs.oracle.com/en/database/oracle/oracle-database/19/ln...
Rust
0
] fn test() { let nums = vec![1, 2, 3, 3, 4, 5]; let res = true; assert_eq!(Solution::is_possible(nums), res); let nums = vec![1, 2, 3, 3, 4, 4, 5, 5]; let res = true; assert_eq!(Solution::is_possible(nums), res); let nums = vec![1, 2, 3, 4, 4, 5]; let res = false; assert_eq!(Solutio...
Rust
0
# G⁻¹ = R D R^T where D is diagonal eigenvalues G_inv = rotation @ torch.diag(eigenvals) @ rotation.T inverse_metrics.append(G_inv) print(f"Centroid {i}: {centroid.tolist()}") print(f" G⁻¹ eigenvalues: {eigenvals.tolist()}") print(f" det(G⁻¹): {torch.det(G_inv...
Python
1
} } impl FromStr for Abilities { type Err = ParseAbilitiesError; fn from_str(s: &str) -> Result<Self, Self::Err> { let terms : Result<Vec<u32>, ParseAbilitiesError> = s.split('/') .map(|s| s.parse::<u32>().map_err(|e| e.into())) .collect(); terms.and_then(|v| { ...
Rust
0
#!/usr/bin/env python import os import sys from cmusphinx import lattice import sphinxbase if __name__ == '__main__': if len(sys.argv) != 11: sys.stderr.write( "Usage: %s ABEAM NBEAM LMWEIGHT LMFILE DENLATDIR " "PRUNED_DENLATDIR FILELIST TRANSFILE FILECOUNT FILEOFFSET\n" ...
Python
1
this dependency. Note // that this is a bit lossy because not all dependencies are // always compiled for all platforms, but it should be // "close enough" for now. build_config .requested_kinds ...
Rust
0
25.0, 726.0, 727.0, 728.0, 729.0, 730.0, 731.0, 732.0, 733.0, 734.0, 735.0, 736.0, 737.0, 738.0, 739.0, 740.0, 741.0, 742.0, 743.0, 744.0, 745.0, 746.0, 747.0, 748.0, 749.0, 750.0, 751.0, 752.0, 753.0, 754.0, 755.0, 756.0, 757.0, 758.0, 759.0, 760.0, 761.0, 762.0, 763.0, 764.0, 765.0, 766.0, 767.0, 768.0, 7...
Rust
0
from html.parser import HTMLParser from django.core.exceptions import ValidationError from django.utils.translation import gettext as _ class HtmlValidator(HTMLParser): ALLOWED_TAGS = { 'a', 'b', 'bdo', 'br', 'div', 'em', 'i', 'img', 'li', 'ol', 'p', 'span', 'strong', 'table', 'td', 'th', 'tr', '...
Python
1
depot, dist) if new_route: improved_routes[r_idx] = new_route inserted = True break if not inserted: leftover_nodes.append(node) # Step 3: 남은 노드로 새 route 생성 (단, 차량 수 제한 내에서만 추가) remaining_vehicle_slots = instance["num_vehicles"] - ...
Python
1
assert_eq!( server_handle.get_balance("deadbeef", VALID_PURSE_UREF), Err(Error::CryptoError { context: "state_root_hash", error: CryptoError::FromHex(FromHexError::InvalidStringLength) } .into()) ); } } mod get_state_root_hash ...
Rust
0
lowed_labels=["maintainer", "version"], strict_labels=True) @pytest.fixture def superfluous_label_non_strict(): return STX0045(allowed_labels=["maintainer", "version"], strict_labels=False) def test_superfluous_label_detects_unallowed_label_strict(superfluous_label_strict): parsed_content = [ {"line...
Python
1
(-20.0, 70.0), Size::new(15.0, 50.0)); epsilon_rect( &GraphicsDisplayItem::Rectangle { rect: RECT, paint: GraphicsDisplayPaint::Fill(StyleColor::Color(Color::default())), } .bounds(), &RECT, ); } #[test] fn test...
Rust
0
ControlInputMouseDown = 56, k_EStreamControlInputMouseUp = 57, k_EStreamControlInputKeyDown = 58, k_EStreamControlInputKeyUp = 59, k_EStreamControlInputGamepadAttached_OBSOLETE = 60, k_EStreamControlInputGamepadEvent_OBSOLETE = 61, k_EStreamControlInputGamepadDetached_OBSOLETE = 62, k_EStrea...
Rust
0
import torch as torch import numpy as np from evals.metrics.mia.min_k import MinKProbAttack from evals.metrics.utils import tokenwise_vocab_logprobs, tokenwise_logprobs class MinKPlusPlusAttack(MinKProbAttack): def compute_batch_values(self, batch): """Get both token-wise and vocab-wise log probabilities ...
Python
1
32; #[doc = "*Required features: `\"Win32_UI_Shell\"`*"] pub const CPFS_DISPLAY_IN_BOTH: CREDENTIAL_PROVIDER_FIELD_STATE = 3i32; #[doc = "*Required features: `\"Win32_UI_Shell\"`*"] pub type CREDENTIAL_PROVIDER_FIELD_TYPE = i32; #[doc = "*Required features: `\"Win32_UI_Shell\"`*"] pub const CPFT_INVALID: CREDENTIAL_PRO...
Rust
0
: RangeBounds<usize>>( &self, obj: O, range: R, heads: &[ChangeHash], ) -> ListRangeAt<'_, R> { if let Ok(obj) = self.exid_to_obj(obj.as_ref()) { if let Ok(clock) = self.clock_at(heads) { let iter_range = self.ops.list_range_at(obj, range, clock); ...
Rust
0
from setuptools import setup, find_packages APP = ['gmaildigest.py'] DATA_FILES = [] OPTIONS = { 'argv_emulation': True, 'packages': ['gmaildigest', 'nltk', 'sumy', 'cryptography', 'telegram', 'googleapiclient', 'dateparser', 'pytz', 'dotenv'], 'includes': ['tkinter'], 'plist': { 'CFBundleName'...
Python
1
import numpy as np from matplotlib import pyplot as plt import time import cv2 import os from vo import VisualOdometry np.set_printoptions(formatter={"float": lambda x: "{0:0.3f}".format(x)}) def main(): capLeft = cv2.VideoCapture("KITTI_sequence_1/image_l/%6d.png") gt_poses = [] with open(os.path.join...
Python
1
let mut v = self; for i in 0..3 { v[i] = -v[i]; } v } } impl AddAssign<Vec3> for Vec3 { fn add_assign(&mut self, rhs: Vec3) { *self = *self + rhs; } } impl MulAssign<f32> for Vec3 { fn mul_assign(&mut self, rhs: f32) { *self = *self * rhs; ...
Rust
0
d_imm_u8(memory)), 0xf0 => format!( "ldh A, ({:#06x})", 0xff00 + u16::from(self.load_imm_u8(memory)) ), 0xf3 => "di".to_string(), 0xfb => "ei".to_string(), 0x1f => "rra".to_string(), 0xe9 => format!("jp (HL({:#06x}))...
Rust
0
OFlag::O_RDWR, Mode::empty()) { Ok(fd) => fd, Err(_) => -1, }; Ok((csocketfd, consolefd)) } fn do_fork(userns: bool, _spec: &Spec, linux: &Linux) -> Result<(i32, RawFd), Error> { let (rfd, wfd) = pipe2(OFlag::O_CLOEXEC)?; match fork()? { ForkResult::Child => { ...
Rust
0
atomic_arc.clone(Relaxed, &barrier); /// let ptr = atomic_arc_cloned.load(Relaxed, &barrier); /// assert_eq!(*ptr.as_ref().unwrap(), 59); /// ``` #[inline] pub fn clone(&self, order: Ordering, _barrier: &Barrier) -> AtomicArc<T> { unsafe { let ptr = self.instance_ptr.load(order);...
Rust
0
mes: if not tf.gfile.Exists(f): raise ValueError('Failed to find file: ' + f) # Create a queue that produces the filenames to read. filename_queue = tf.train.string_input_producer(filenames) # Read examples from files in the filename queue. read_input = read_cifar10(filename_queue)...
Python
1
pub mod transaction_argument; #[cfg(test)] mod unit_tests; pub mod value; <gh_stars>0 /// A raw `ATAG` as laid out in memory. #[repr(C)] pub struct Atag { pub size: u32, pub tag: Values, pub kind: AtagKind, } #[repr(u32)] #[derive(Debug, Copy, Clone)] pub enum Values { NONE = 0x0, CORE = 0x5441000...
Rust
0
on 2.0 <LICENSE-APACHE or * // https://www.apache.org/licenses/LICENSE-2.0> or the MIT license * // <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your * // option. This file may not be copied, modified, or distributed * // except according to those terms. */ use crate::Order; /// Defines the params us...
Rust
0
erator.remember(file, moduleDocument, basename) if (noempty or file.endswith('__init__.py')) \ and moduleDocument.isEmpty(): continue # generate output try: out = open(f, "wb") ...
Python
1
the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the spec...
Rust
0
to be //! checked or explicitly ignored: //! ```rust //! # use std::convert::TryFrom; //! # use andex::*; //! # enum MyIdxMarker {} //! # type MyIdx = Andex<MyIdxMarker, 12>; //! if let Ok(first) = MyIdx::try_from(0) { //! // ... //! } //! ``` //! //! - Via `FIRST` and `LAST`: //! ```rust //!...
Rust
0
() { for (col, word) in line.split(' ') .filter(|s| s.len() > 0) .enumerate() { let has_edge = word.parse::<i32>().unwrap(); assert!(has_edge == 0 || has_edge == 1); if has_edge == 0 { con...
Rust
0
import numpy as np import cv2 def align_source(src_points, size=224): REFERENCE_FACIAL_POINTS = [ [30.29459953, 51.69630051], [65.53179932, 51.50139999], [48.02519989, 71.73660278], [33.54930115, 92.3655014], [62.72990036, 92.20410156] ] REFERENCE_FACIAL_POINT...
Python
1
from pathlib import Path import h5py import numpy as np import pandas import pytest import zarr from ..adapters.zarr import ZARR_LIB_V2 from ..catalog import in_memory from ..client import Context, from_context, tree from ..client.register import register from ..server.app import build_app @pytest.mark.asyncio asyn...
Python
1
scrolly.pack(side="right", fill="y") # make the scrollbar fill the y axis of the Treeview widget # late_frame treev_late = tkinter.ttk.Treeview(late_frame, selectmode ='browse')#extended helps to select multiple and none to none treev_late.place(relheight=1, relwidth=1) treescrolly = tkinter.Scrollbar(late_f...
Python
1
], ) } fn inv_g(p: &Point<Self>) -> InvTwoForm<Self> { let r = p[1]; let x = p[2]; let y = p[3]; let m = P::mass(); let a = P::ang_momentum(); let xy1 = 1.0 + x * x + y * y; let negxy1 = 1.0 - x * x - y * y; let rho2 = r * r + a * a...
Rust
0
/* 0, 0, 0, 0 */)), ); } } // p0: (e0, e1, e2, e3) // p3: (e123, e032, e013, e021) // p1: (1, e12, e31, e23) // p2: (e0123, e01, e02, e03) #[inline] pub fn gp03_flip(a: __m128, b: __m128, p1: &mut __m128, p2: &mut __m128) { // a1 b0 e23 + // a2 b0 e31 + // a3 b0 e12 + // (a0 b0 + a1 b1 + a...
Rust
0
import numpy as np def relu(input): output = max(0, input) return output def predict_with_network(input_data): node_0_0_input = (weights['node_0_0'] * input_data).sum() node_0_0_output = relu(node_0_0_input) node_0_1_input = (weights['node_0_1'] * input_data).sum() node_0_1_output = relu(node_...
Python
1
arent output_name = Path(args.input_path.name).name for i, group in enumerate(groups, start=1): output_path = output_parent / (output_name + "_" + str(i).zfill(min_len)) with open(output_path, "w") as output_fd: output_fd.writelines(group[...
Python
1
__: *const sockaddr_ipx, pub __sockaddr_iso__: *const sockaddr_iso, pub __sockaddr_ns__: *const sockaddr_ns, pub __sockaddr_un__: *const sockaddr_un, pub __sockaddr_x25__: *const sockaddr_x25, } pub type uint64_t = __uint64_t; #[repr(C)] #[derive(Copy, Clone)] pub struct in_pktinfo { pub ipi_ifinde...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2025 Google LLC # # 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...
Python
1
tion you would be using sensor data from the system dt = 0.01 # Time step (s) print_freq = 50 # Print every print_freq'th iteration x = m.initialize() u = m.InputContainer({}) # No input for this model for i in range(500): # Get simulated output (would be measured in a real application) ...
Python
1
############################################################################### # Copyright (c) Lawrence Livermore National Security, LLC and other Ascent # Project developers. See top-level LICENSE AND COPYRIGHT files for dates and # other details. No copyright assignment is required to contribute to Ascent. #########...
Python
1
es # processed_seq_len = seq_len + 2([CLS] and [SEP] # embedding matrix contain [CLS] and [SEP] vector if matrix_add_special_token: embeddings["representations"] = embedding[0, 0: processed_seq_len, :].to(device="cpu").clone().numpy() else: embeddings["representat...
Python
1
def pytest_sessionstart(session): print("\n!!!!!!!!!!!!!!!Начало сессии тестирования - ЭТО ПРИМЕР ХУКА ДЛЯ СЕССИИ!!!!!!!!!!!! это хук pytest_sessionstart!!!!!!!!!!!!!!!!!!!!он лежит в conftest") def pytest_sessionfinish(session, exitstatus): print("\n!!!!!!!!!!!!!!!!!!!!!!Завершение сессии тестирования - ЭТ...
Python
1
import db, time def menu(): print("*"*40,"\n") print("\n🎯 Perfume Inventory App") print("1. Add new perfume") print("2. View all perfumes") print("3. Search by name") print("4. Update perfume (by name)") print("5. Delete perfume (by ID)") print("6. Exit\n") print("*"*40,"\n") def...
Python
1
from collections.abc import Mapping from typing import Any, TypeVar, Union, cast from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset T = TypeVar("T", bound="MetricUpdateArgsIcon") @_attrs_define class MetricUpdateArgsIcon: """ Attributes: ...
Python
1
bug)] pub struct ElasticModelMatrixStorage { pub mass_matrix: CsrMatrix<f64>, // TODO: Better solution than a separate bool. Something like an Option // that keeps it's value when going from Some -> None -> Some. pub has_damping_matrix: bool, pub damping_matrix: CsrMatrix<f64>, pub stiffness_ma...
Rust
0
struct InMemoryChannelKeys { /// Private key of anchor tx pub funding_key: SecretKey, /// Local secret key for blinded revocation pubkey pub revocation_base_key: SecretKey, /// Local secret key used in commitment tx htlc outputs pub payment_base_key: SecretKey, /// Local secret key used in HTLC tx pub delayed_...
Rust
0
codec::ByteCount { self.inner.requiring_bytes() } } impl ::protobuf_codec::message::MessageEncode for $encoder {} }; } macro_rules! impl_sized_message_encode { ($encoder:ty, $item:ty, $map:expr) => { impl_message_encode!($encoder, $item, $map); impl :...
Rust
0
eature Importance Scores') plt.show() # Generate predictions for multiple cities and plot results cities = ['Mumbai', 'Delhi', 'Bangalore', 'Hyderabad', 'Chennai', 'Kolkata', 'Pune', 'Ahmedabad', 'Jaipur', 'Lucknow'] def future_aqi_ml(model, city, days=3650): city_data = data[data['city'] == c...
Python
1
# -*- coding:utf-8 -*- import urllib2,re repo="https://github.com/Saferman/password-dictionary/" def GetHtmlList(url=repo): req=urllib2.Request(url) f=urllib2.urlopen(req) return f.readlines() def CheckUpdate(): flag = 0 updateinfo=[] for line in GetHtmlList(repo+"blob/master/README.md"):...
Python
1
"Zone", "Zoo", "Zoologist", "Zoology", "Zoot-suit", "Zucchini", ]; /// A set of upper-case-first adverbs for random string gen. pub static ADVERBS: &[&str] = &[ "About", "Above", "Abroad", "Absolutely", "Across", "Actually", "Again", "Ago", "Ahead", "All", "Almost", ...
Rust
0
import smart_imports smart_imports.all() class SendMailTests(utils_testcase.TestCase): SEND_ARGS = dict(subject='subject', text_content='text_content', html_content='html_content') def setUp(self): super(SendMailTests, self).setUp() game_logic.cre...
Python
1
from dnnv.properties import * from dnnv.properties.transformers import CanonicalTransformer def test_NotEqual_symbols(): transformer = CanonicalTransformer() a, b = Symbol("a"), Symbol("b") expr = NotEqual(a, b) new_expr = transformer.visit(expr) assert new_expr is not expr assert new_expr.is...
Python
1
al_docs = sorted(all_docs, key=lambda x: relevance_scores[x], reverse=True) ideal_dcg = dcg_at_k(ideal_docs, relevance_scores, k) # 归一化 return actual_dcg / ideal_dcg if ideal_dcg > 0 else 0.0 def calculate_mrr(self, query_results: List[Dict[str, Any]]) -> float: """ ...
Python
1
rO persistent_id#_legacy_save.<locals>.persistent_id c4 ZRYY%?%?00.2 &s +#' 'K /H/M, .c7 7 c5==55 6 6%:J:J3:O:O#u}}99::.. # #&#;#;#= &u.>?   # C!5!566 % 5d3i@   ' 0 "7S { CDD !Q&##%7$w7G7G7I(JJ...
Python
1
import pinns import torch def spatial_temporal_grad(model, t, Lat, Lon): torch.set_grad_enabled(True) Lat.requires_grad_(True) Lon.requires_grad_(True) t.requires_grad_(True) u = model(t, Lat, Lon) du_dLat = pinns.gradient(u, Lat) du_dLon = pinns.gradient(u, Lon) du_dt = pinns.gradient...
Python
1
"eighteenth", "nineteenth", "twentieth", "twenty-first", "twenty-second", "twenty-third", "twenty-fourth", "twenty-fifth", "twenty-sixth", "twenty-seventh", "...
Rust
0
.and_then(|v| visitor.visit_u64(v)) }) } fn deserialize_f32<V>(mut self, visitor: V) -> Result<V::Value, Self::Err> where V: Asn1Visitor<'de> { self.override_tag(info::TAG_REAL, |d, tag| { d.decode_primitive(tag, |r, len| read::read_f32(r, len).map_err(|e| e.into())) ...
Rust
0
_csv( f, header=None, names=_COLUMN_NAMES, on_bad_lines='warn' ) _convert_df_to_tfrecord(df, output_dir, split_ratio, num_shard) def convert_jsonl_to_tfrecord( input_jsonl: str, output_dir: str, split_ratio: Sequence[float] = (0.8, 0.1, 0.1), num_shard: Sequence[int] = (10, 10, 10), ) -...
Python
1
def recommend_role(keywords): role_map = { 'python': 'Data Scientist', 'machine learning': 'ML Engineer', 'deep learning': 'ML Engineer', 'sql': 'Data Analyst', 'excel': 'Business Analyst', 'communication': 'HR Executive', 'java': 'Software Developer', ...
Python
1
# logger.info("DEBUG: setting laststart to {} and yielding {}".format(intvl[0], intvl)) yield intvl elif intvl[0] == laststart: # logger.info("DEBUG: yielding {}".format(intvl)) yield intvl else: # logger.info("DEBU...
Python
1
from app.bot.messages.enviromnent import environment VIEW_MSG = environment.from_string( """ Список юзерів: {% for index, user in enumerate(users) %} {{ index + 1 }}. {{ user.surname }} {{ user.name }} {% endfor %} """ )
Python
1
# Python program to display all the prime numbers within an interval lower = 1 upper = 100 print("Prime numbers between", lower, "and", upper, "are:") for num in range(lower, upper + 1): # all prime numbers are greater than 1 if num > 1: for i in range(2, num): if (num % i) == 0: ...
Python
1
""" if not self._plex: return "" # 返回结果 poster_urls = {} # 页码计数 container_start = 0 # 需要的总条数/每页的条数 total_size = 4 # 如果总数不足,接续获取下一页 while len(poster_urls) < total_size: items = self._plex.fetchItems(f"/hubs/home/recentlyA...
Python
1
"socket connected" ); let socket = socket.into_std()?; init_socket(&socket)?; Ok(UdpSocket { io: AsyncFd::new(socket)?, }) } #[instrument(level = "trace", skip(self, buf), fields( local_addr = debug(self.as_ref().local_addr().unwrap()), pee...
Rust
0
# # SPDX-License-Identifier: MIT # # Copyright (c) 2025 Carsten Igel. # # This file is part of simplepycons # (see https://github.com/carstencodes/simplepycons). # # This file is published using the MIT license. # Refer to LICENSE for more information # """""" # pylint: disable=C0302 # Justification: Code is generated ...
Python
1
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025) # # 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...
Python
1
# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION & AFFILIATES and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distributio...
Python
1
def even_odd_count(num): """Given an integer. return a tuple that has the number of even and odd digits respectively. Example: even_odd_count(-12) ==> (1, 1) even_odd_count(123) ==> (1, 2) """ def is_prime(num): """Given a number return True if it is a prime number and False if it is ...
Python
1