text
string
label_name
string
labels
int64
random_global_init=args.random_global_init, global_positional_stride=args.global_positional_stride, keep_first_global_token=args.keep_first_global_token, resize_lsg=args.resize_lsg, model_kwargs=args.model_kwargs, use_token_ids=args.use_token_ids, ...
Python
1
// Other BMP assert_eq!(is_emoji_modifier_base('\u{061b}'), false); assert_eq!(is_emoji_modifier_base('\u{061c}'), false); assert_eq!(is_emoji_modifier_base('\u{061d}'), false); assert_eq!(is_emoji_modifier_base('\u{200d}'), false); assert_eq!(is_emoji_modifier_base('\u{...
Rust
0
import heapq from typing import List class Solution: def minimumCost(self, start: List[int], target: List[int], specialRoads: List[List[int]]) -> int: def manhattan(x1, y1, x2, y2): return abs(x2 - x1) + abs(y2 - y1) nodes = [(start[0], start[1]), (target[0], target[1])] for x1...
Python
1
n euclid_transform2d_f32_load_identity(transform: &mut Transform2D) { transform.clone_from(&Transform2D::identity()); } #[no_mangle] pub fn euclid_transform2d_f32_post_transform(transform: &mut Transform2D, matrix: &mut Transform2D) { transform.clone_from(&transform.post_transform(matrix)); } #[no_mangle] pub...
Rust
0
.unwrap(), &Name::from_str("localhost").unwrap().append_domain(domain), "{}", path.path().display(), ); let mut accounted = vec!["islay.localdomain", "islay"] .into_iter() .map(|s| Name::from_str(s)...
Rust
0
{self.unicode_filename(): {}}, prefix=self.site_dir, ) list(distributions()) class PackagesDistributionsPrebuiltTest(fixtures.ZipFixtures, unittest.TestCase): def test_packages_distributions_example(self): self._fixture_on_path('example-21.12-py3-none-any.whl') as...
Python
1
8593, 0x039624d5, 0x24c816ac, 0xda2c9183, 0xbd917cb9, ], [0xa3944b95, 0xca0b5204, 0x3584ef02, 0x151926a8], ), ( [ 0x797f8b3d, 0x176dac5b, 0x7e34a2d5, 0x39c4ef36, 0x7a16f863, 0x5f626473, 0x7591c5c0, 0x7bf57a3e, ], [0xa74289fe, 0x73a4c123...
Rust
0
import curses import math from lismi import struct, util def report_printer( stdscr: curses.window, cc: int, ic: int, minutes: float, layout: struct.SupportedLayout, ) -> None: stdscr.clear() curses.curs_set(0) y, x = stdscr.getmaxyx() outp = [] gwpm = math.ceil((cc / 5) / min...
Python
1
// https://github.com/mstange/msvc-demangler-rust/issues/21 let var_sc = if self.consume(b"?") { self.read_storage_class() } else { StorageClass::empty() }; let return_type = self.read_var_type(var_sc)?; let params = self.read_func_params()?; ...
Rust
0
await page.wait_for_timeout(15000) except Exception as e: print(f"\n[ERROR] {str(e)}") import traceback traceback.print_exc() finally: await browser.close() print("\n[COMPLETE] Test finished") if __name__ == "_...
Python
1
io::piped()) .spawn() .expect("Couldn't run `mpc -f`"); BufReader::new(mpc.stdout.unwrap()) .lines() .next() .and_then(|result| result.ok()) } fn get_playback_info() -> Option<PlaybackInfo> { let mpc = Command::new("mpc") .stdout(Stdio::piped()) .spawn()...
Rust
0
s::BPREFIXSTRLEN; // Does not include a '\0' (xxxx.xxU) pub const IPREFIXSTRLEN: u32 = crate::bindings::IPREFIXSTRLEN; // TODO:? // WCHAR_MAX_UTF8BYTES use std::cmp::Ordering; use std::ops::{Add, Mul}; use serde::{Deserialize, Serialize}; #[derive(Copy, Clone, Serialize, Deserialize)] #[must_use] pub struct Confide...
Rust
0
# Copyright 2021-2025 Avaiga Private Limited # # 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 agree...
Python
1
8] edition:2018 //[e2021] edition:2021 //[e2018] check-pass #![crate_type = "lib"] #![stable(feature = "foo", since = "1.0.0")] #![feature(staged_api)] #[stable(feature = "foo", since = "1.0.0")] #[rustc_const_stable(feature = "foo", since = "1.0.0")] const fn foo() { assert!(false); assert!(false, "foo"); ...
Rust
0
# Code generated by Lark OpenAPI. import lark_oapi as lark from lark_oapi.api.calendar.v4 import * def main(): # 创建client client = lark.Client.builder() \ .app_id(lark.APP_ID) \ .app_secret(lark.APP_SECRET) \ .log_level(lark.LogLevel.DEBUG) \ .build() # 构造请求对象 request...
Python
1
, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e,...
Rust
0
produces a strategy that generates values /// that are all out of bounds. /// /// More precisely, generates values (r, c) such that r >= rows || c >= cols. fn out_of_bounds_strategy(rows: usize, cols: usize) -> impl Strategy<Value = (usize, usize)> { let max_row_idx = 3 * rows + 1; let max_col_idx = 3 * cols +...
Rust
0
::new(|h| { h.invalidate(); }); (&*scan_ptr).scan(&mut scanner); } // We know this method can only be called if `scan_ptr` doesn't alias // And we know `finalize_ptr` ~= `scan_ptr` // So we c...
Rust
0
for verbose in 0..(verbose_max + 1) { get_frequency(&mut port, chans + 1, verbose).unwrap_err(); } } #[test] pub fn get_frequency_hertz_ok() { let mut port = SerialPortType::new("", true, 0).unwrap(); let verbose_max = 1; let chans = 2; for verbose in 0..(verbose_max + 1) { for chan in 1..(chans + 1) { g...
Rust
0
ndPacket> { Ok(ServerboundPacket::PlayerDigging(PlayerDigging { status: read_varint(r)?, location: read_position(r)?, face: read_u8(r)?, })) } fn to_u8(&self) -> Result<Vec<u8>> { let mut ret = Vec::new(); write_varint(&Self::PACKET_ID, &mut r...
Rust
0
', 'never', 'notrace', 'proctype', 'show', 'trace', 'typedef', 'xr', 'xs'), suffix=r'\b'), Keyword.Declaration), # Declarators (suffixes) (words(( 'priority', 'provided'), suffix=r'\b'), Keyword), # MetaTerms (declarators) ...
Python
1
import socket class MalformedResponse(Exception): pass class API: def __init__(self, url: str, port: int = 80, token: str = ""): self.url = url self.port = port self.token = token def get(self, data_type: int) -> bytes: token = self.token.encode() s = socket.socket...
Python
1
fn get_height(&self) -> usize { return self.props.height as usize; } } unsafe extern "system" fn win32_handle_proc( window: HWND, message: UINT, wparam: WPARAM, lparam: LPARAM, ) -> LRESULT { match message { WM_CLOSE => { 0 } _ => { return...
Rust
0
ised_nodes": [[], [], [], [], [], [], ["n2"], ["n2"], ["n2", "n12"], ["n2", "n12"], ["n2", "n12", "n4"], ["n2", "n12", "n4"], ["n2", "n12", "n4", "n17"], ["n2", "n12", "n4", "n17"...
Python
1
sbc.set_brightness(max(sbc.get_brightness(display=0)[0] - 10, 0), display=0) elif handedness.classification[0].label == "Left": if is_index_middle_fingers_together(hand_landmarks): if is_two_fingers_up(hand_landmarks): mouse.scroll(0, 0.5...
Python
1
= "I2S0_S"] pub I2S0_S: I2S0_S, #[doc = "IPC_NS"] pub IPC_NS: IPC_NS, #[doc = "IPC_S"] pub IPC_S: IPC_S, #[doc = "QSPI_NS"] pub QSPI_NS: QSPI_NS, #[doc = "QSPI_S"] pub QSPI_S: QSPI_S, #[doc = "NFCT_NS"] pub NFCT_NS: NFCT_NS, #[doc = "NFCT_S"] pub NFCT_S: NFCT_S, ...
Rust
0
fn readFourIntsAndLong(requestBody: &[u8]) -> (u32, u32, u32, u32, u64) { let mut requestDataReader = Cursor::new(requestBody); return ( requestDataReader.read_u32::<BigEndian>().unwrap(), requestDataReader.read_u32::<BigEndian>().unwrap(), requestDataReader.read_u32::<BigEndian>().unwr...
Rust
0
w(src: &VkSurfaceProtectedCapabilities, dst: &mut RawVkSurfaceProtectedCapabilities) { dst.s_type = vk_to_raw_value(&VkStructureType::SurfaceProtectedCapabilitiesKhr); dst.next = ptr::null_mut(); dst.supports_protected = vk_to_raw_value(&src.supports_protected); } } impl VkRawType<VkSurface...
Rust
0
import math import torch import torch.nn as nn from torch.nn import functional as F class KLRegression(nn.Module): """KL-divergence loss for probabilistic regression. It is computed using Monte Carlo (MC) samples from an arbitrary distribution.""" def __init__(self, eps=0.0): super().__init__() ...
Python
1
, }, ) else: model = tf.keras.models.load_model( filepath, custom_objects={main_layer_class.__name__: main_layer_class} ) assert isinstance(model, tf.keras.Model) a...
Python
1
from select import select from selenium import webdriver #from selenium.webdriver.common.by import By import time from selenium.webdriver.common.by import By from selenium.webdriver.support.select import Select driver= webdriver.Chrome() #driver.get("https://rahulshettyacademy.com/client") #driver.maximize_window() #...
Python
1
header = expected_delim.join(expected_header) + '\n' with io.open(path + expected_suffix, 'r', encoding='utf-8-sig') as f: header = f.readline() assert header == expected_header def test_output_csv_and_semicolon(self): _, path = mkstemp(dir=self.temp_dir, suffix='.csv') ...
Python
1
?\n\n#datascience #dsa...", "RT @charlyingsparks: This is so spot on. \n@DataCamp @hugobowne #DataFramedchallenge @hmason #empathy\n#datascience #datacamp ...", "RT @gastronomy: [DataCamp] Naive Bayes Classification using Scikit-learn --> Learn how to build and evaluate a Naive Bayes Classifier using...", ...
Python
1
""" Module for custom admin configurations for the ArchitectSpeciality model. This module contains the ArchitectSpecialityAdmin class for customizing the Django admin interface for the ArchitectSpeciality model. """ from django.contrib import admin from app.core.models.ArchitectSpeciality import ArchitectSpeciality ...
Python
1
.push(toks[0].clone()); toks = self.push_while(&toks[1..], TK::Whitespace, params); if toks[0].kind == TK::LBracket { let (vtoks, next_toks) = Self::token_split_balanced_parens(toks, TK::LBracket, TK::RBracket).unwrap(); self.push_tokens(vtoks, params); ...
Rust
0
ange(9)] range_cond = [And(rs[i] >= 0, rs[i] <= 2) for i in range(9)] # Exactly one room contains a lady one_lady = Sum([If(rs[i] == 1, 1, 0) for i in range(9)]) == 1 # Define the signs # Note: Sign3 and Sign5 use other signs which are defined later. Use placeholder variables for now. sign1 = ...
Python
1
{ let core = Core::new().unwrap(); let datasource = system_datasource(); let connector = JsonHttpConnector::new(datasource, &core.handle()).unwrap(); let arango = ArangoSession::new(connector, core); let database = arango.use_database_with_name("the_social_network"); assert_that!(&database....
Rust
0
ve_listeners`. port (int): The port to listen on. Use 0 to let the kernel pick an open port. Ultimately passed to :func:`open_tcp_listeners`. ssl_context (~ssl.SSLContext): The SSL context to use for all incoming connections. Passed to :func:`open_ssl_over_tcp_listeners`. host (...
Python
1
= Matrix::new(2, 2, vec![1.0, -3.0, 1.0, 1.0]); // characteristic polynomial is λ² − λ + 4 = 0 // Decomposition will fail assert!(a.eigenvalues().is_err()); } #[test] fn test_2_by_2_matrix_eigendecomp() { let a = Matrix::new(2, 2, vec![20., 4., 20., 16.]); let (eig...
Rust
0
.map(|x| { let mut number = 0; for (code, n) in &display_data { // println!(" data {} {}", x, code); if contains(code, x) && code.len() == x.len() ...
Rust
0
Suite { id, name } in test_helper::get_valid_mangas() { for page in test_helper::get_pages() { let mock = server.mock(|when, then| { when.path(Reviews::get_url_path(id, page)); then .status(200) .body(utils_test_helper::file_to_string(&format!( "sr...
Rust
0
# -*- coding: utf-8 -*- import os import codecs import sys from shutil import rmtree from setuptools import setup, find_packages, Command here = os.path.abspath(os.path.dirname(__file__)) with open("README.md", "r") as fh: long_description = fh.read() class UploadCommand(Command): """Support setup.py publ...
Python
1
import pandas as pd from rdflib import Graph, Literal, Namespace, RDF, URIRef from rdflib.namespace import XSD import sys def main(inputpath): g = Graph() ex = Namespace("http://schema.org/eicu") eicu = Namespace("http://www.eicu.org/ontologies#") g.bind("ex", ex) g.bind("eicu", eicu) # carePla...
Python
1
log::debug!("Selected locale: '{}'", &locale.0); log::debug!("Files: {:#?}", &locale.1); let mut modes = crate::models::Modes::default(); let xml_map: Vec<Keyboard> = locale .1 .into_iter() .map(|(key, mut v)| { v.sort(); let last = v.last().unwrap(); ...
Rust
0
String>() ) } fn get_client(http_port: u16) -> Client { let s3_config = Config::builder() .credentials_provider(Credentials::new( "KEY_NOT_REQD", "KEY_NOT_REQD", None, None, "Environment", )) .region(Region::new("ap-south-1")) ...
Rust
0
import matplotlib matplotlib.use('Agg') # or 'PS', 'PDF', 'SVG' import matplotlib.pyplot as plt import numpy as np import seaborn as sns def plot_five_number_summary(data, title, ylabel="Values", xlabel="Epochs", export_pdf=False, show=False): n_series = len(data) sns.set_style("white") sns.set_palett...
Python
1
import antlr3 import testbase import unittest class t035ruleLabelPropertyRef(testbase.ANTLRTest): def setUp(self): self.compileGrammar() def lexerClass(self, base): class TLexer(base): def recover(self, input, re): # no error recovery yet, just crash! ...
Python
1
r.") (options, args) = parser.parse_args() #check to see if the pdbstr.exe exists if options.srcsrv: pdbstr = os.environ.get("PDBSTR_PATH") if not os.path.exists(pdbstr): print("Invalid path to pdbstr.exe - please set/check PDBSTR_PATH.\n", file=sys.stderr) sys.exit(...
Python
1
name": "University of Bristol Jiu Jitsu Club", "weekday": "Wed" }, { "link": "https://www.facebook.com/groups/2204517862/", "name": "University of Bristol Jiu Jitsu Club", "weekday": "Fri" }, { "link": "https://www.facebook.com/groups/UniversitiesBrightonJitsu/", "name": "Uni...
Rust
0
/! actually has no idea that more than one thread is involved (hidden in the C library’s //! implementation), you can safely get away with using `Rc`. //! //! [standard mainloop]: mod@standard //! [threaded mainloop]: mod@self::threaded //! [`lock()`]: self::threaded::Mainloop::lock //! [`in_thread()`]: self::threaded:...
Rust
0
!(other "Unexpected s/e Packet/{:?}", ev)) / goto S::End(bwt.decons())), (S::ResponseWait(bws, _), ev) => pfsm!(return error(app_error!(other "Unexpected s/e ResponseWait/{:?}", ev)) / goto S::End(bws)), (S::End(bws), ev) => pfsm!(return error(app_error!(other "Un...
Rust
0
connection_id=connection_id, stream_id=stream_id, error=str(e), exc_info=True ) finally: logger.info( "Preview stream ended", connection_id=connection_id, stream_id=stream_id, ...
Python
1
46373437263, -2.83025703359666192; -3.30895752093770579, -0.04979044289857298, 3.03248594516832792, 3.85962479743330977]; let (b, u, v) = mat.clone().svd().unwrap(); let expected_values = vec![8.0, 6.0, 4.0, 2.0]; validate_svd(&mat, &b, &u, &v); // Assert the singular values a...
Rust
0
"""対局結果の補正処理。 """ # -*- coding:utf-8 -*- from concurrent.futures import ThreadPoolExecutor import glob import os import math import multiprocessing import subprocess from typing import List import click WORKER_THREAD = multiprocessing.cpu_count() def get_gnugo_judgment(filename: str, is_japanese_rule: bool) -> str: ...
Python
1
""" Debug lists and forms for all models """ from __future__ import annotations from typing import TYPE_CHECKING from django.apps import apps from django.conf import settings from django.contrib import admin from treebeard.admin import TreeAdmin from treebeard.forms import movenodeform_factory from treebeard.ns_tree...
Python
1
from file_encryptor import encrypt_file key = b'@\x11\xe6\x9c\xe5!\xa0\xf5\x03\xb4sK\x91\xaf\x95\xd6' # Replace with your generated key encrypt_file('test.txt', key)
Python
1
ytes.splice(26..27 + seg_count, seg_table); p_bytes.splice(22..26, ogg_pager::crc32(&*p_bytes).to_le_bytes().to_vec()); writer.write_all(&*p_bytes)?; if let Some(mut page) = page { page.serial = ser; page.gen_crc(); writer.write_all(&*page.as_bytes())?; } break; } p.gen_crc(); writ...
Rust
0
[Enclave] rsgx_verify_report failed. {:?}", x); return Err(x); } } // Check if the qe_report is produced on the same platform if ti.mr_enclave.m != qe_report.body.mr_enclave.m || ti.attributes.flags != qe_report.body.attributes.flags || ti.attributes.xfrm != qe_repor...
Rust
0
# create a grid of samples and save it reses = [str(int(np.power(2, dep))) + "_x_" + str(int(np.power(2, dep))) for dep in range(2, self.depth + 2)] gen_img_files = [os.path.join(sample_dir, res, "gen_" ...
Python
1
choices=['absent', 'present', 'latest']), no_dependencies=dict(type='bool', default=False), executable=dict(type='path', default='flatpak') ), supports_check_mode=True, ) name = module.params['name'] state = module.params['state'] remote = ...
Python
1
"""Tests for LLM client context size handling.""" import pytest from app.llm.client import Client, chunk_prompt @pytest.mark.parametrize("value", [0, -1]) def test_ctx_must_be_positive(value): """Client should reject non-positive context values.""" with pytest.raises(ValueError): Client(ctx=value) ...
Python
1
import requests import json class GrafanaScraper: def __init__(self, grafana_url, api_key): self.grafana_url = grafana_url self.headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" } def get_dashboards(self): """Fetch all...
Python
1
"), Scalar::Null => out.extend_from_slice(b"\\0"), Scalar::Decimal(c) => { for b in c.escape_unicode() { if b != 'u' { out.push(b as u8); } } } } } } #[derive(Debug)] pub stru...
Rust
0
(&mut self, data: Pointer) { unsafe { ffi::wrenSetUserData(self.raw, data) } } } impl Drop for VM { fn drop(&mut self) { if self.owned { unsafe { ffi::wrenFreeVM(self.raw) } } } } use thiserror::Error; #[derive(Debug, Error)] pub enum Sram22Error { #[error("io error...
Rust
0
from fastapi import APIRouter, Depends, HTTPException from starlette import status from pydantic import BaseModel router = APIRouter() class PingResponse(BaseModel): message: str = "PROOOOOOOOOOOOOOOOOD" status: str = "ok" @router.get("/ping", status_code=status.HTTP_200_OK) async def ping(): """ ...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import hashlib import base64 import urllib import re import time from Library import toolClass from Library import errMsgClass class ChaseYouku : def __init__ (self) : self.videoLink = '' self.infoUrl = 'https://ups.youku.com/ups/get.json?&ccode...
Python
1
ermark_borders( 100, 100, 10, 10, &Point { x: HorizontalPosition::Left(95), y: VerticalPosition::Top(95) } ), (90, 90, 0, 0) ); } #[test] f...
Rust
0
await bot.edit_message_media(chat_id=call.message.chat.id, message_id=call.message.message_id, media=InputMediaPhoto(info[6], caption=text), reply_m...
Python
1
.sum(dim=1) / mask.sum(dim=1)[..., None] return sentence_embeddings def calculate_score(query, passages): # calculate the score between query and passages query_text = llama_tokenizer.decode(query) query = contriever_tokenizer(query_text, return_tensors="pt", max_length=512, truncat...
Python
1
ppend("发行日期: " + song_data[i]["time"] + "\n\n") self.song_playlist.append( str(song_data[i]["id"]) + "." + song_data[i]["name"] + "-" + song_data[i]["singer"]) else: QMessageBox.critical(self, f"错误", "音乐未找到,请到酷我音乐搜索试试!!!") ...
Python
1
""" Django's support for templates. The django.template namespace contains two independent subsystems: 1. Multiple Template Engines: support for pluggable template backends, built-in backends and backend-independent APIs 2. Django Template Language: Django's own template engine, including its built-in loaders, ...
Python
1
j|GHq3WWntk r^PqX||j7}d}x1|dkrt|}|dkrud}ququW|dkrPqqdS(Ns0Hit Return for more, or q (and Return) to quit: ittq(RR(RtrangeRRt IndexErrorRt raw_input(Rrtprompttlinenotit...
Python
1
.await; to_download.extend(download_for_this_type); } Err(err) => println!("Error getting images: {}", err), } } } Ok(to_download) } pub fn get_image_extension(mime_type: &steamgriddb_api::images::MimeTypes) -> &'static st...
Rust
0
x = [1,2,3] arr1 = [[1], x, [3,4]] x[2] = 42 print(arr1[1][2])
Python
1
("Reserved", "<H=0x00"), ("Length", "<I"), ("CurrentPasswordOffset", "<H"), ("PreviousPasswordOffset", "<H"), ("QueryPasswordIntervalOffset", "<H"), ("UnchangedPasswordIntervalOffset", "<H"), ("CurrentPassword", "u"), ("PreviousPassword", "u"), # ('...
Python
1
if config.get("proxy", False): proxies = blu.load_proxies() blu.log(" === D4rkCipherX === ", Fore.YELLOW) blu.log(f"📂 Loaded {len(all_accounts)} accounts from query list.", Fore.YELLOW) while True: # Buat queue baru dan masukkan semua akun (dengan index asli) queu...
Python
1
f" UMAP with {metric} distance metric") ds.ca.UMAP = UMAP(n_components=2, metric=metric_f, n_neighbors=self.config.params.k // 2, learning_rate=0.3, min_dist=0.25).fit_transform(transformed) ds.ca.UMAP3D = UMAP(n_components=3, metric=metric_f, n_neighbors=self.config.params.k // 2, learning_rate=0.3, min_dist=...
Python
1
esult { write!(f, "{} -> {}", self.start, self.end) } } impl Span { pub fn to(self, other: Span) -> Self { use std::cmp; Span { start: cmp::min(self.start, other.end), end: cmp::max(self.end, other.end), } } } impl<T> Spanned<T> { pub fn new(valu...
Rust
0
his register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information abo...
Rust
0
def calculate_sketch_distance(self, image_path1, image_path2): # load and preprocess the images img1 = Image.open(image_path1).resize((256, 256), Image.BILINEAR) img1 = self.to_tensor(img1) img1 = img1 * 2 - 1 img1 = torch.unsqueeze(img1, 0).cuda() img2 = Image....
Python
1
print(f"Auto {auto.marca}, {auto.modelo} agregado a la compra exitosamente.") print(" ") def mostrar_reporte_compras(): print("***************Reporte de Compras***************") total_general = 0 for compra in compras: compra.mostrar_compra() # Mostrar detalles de la compra ...
Python
1
code_prelude::vec2; let mut obj = Solution::new(vec2![[1, 1, 5, 5]]); let res1 = obj.pick(); let res2 = obj.pick(); let res3 = obj.pick(); println!("{:?}", res1); println!("{:?}", res2); println!("{:?}", res3); println!(); let mut obj = Solution::new(vec2![[-2, -2, -1, -1], [1, 0, 3,...
Rust
0
# conditional statements are those statements which are executed when the condition sets to be true ''' for example if i say if the day is sunny i am going to order an icecream so this task is possible only if conditio is true similarly in python programming there are some statements which will only execute of conditio...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' name: TRS wcm系统默认账户漏洞 referer: unknown author: Lucifer description: TRS wcm系统中存在"依申请公开"这个默认用户,默认密码是trsadmin,可直接登录。 ''' import sys import json import requests class trs_wcm_default_user_BaseVerify: def __init__(self, url): self.url = url def run(self)...
Python
1
Context, Tool}; pub struct MoveTool<E> { mask: ElementKind, clone: bool, ray: Ray, center: Vector3<f32>, plane: Plane, elements: Vec<(usize, E)>, start: Vector3<f32>, delta: Vector3<i32>, snap: MoveSnap, line_mesh: Option<LineMesh>, } impl<E> MoveTool<E> where E: Movable...
Rust
0
cdd_claim/cdd_claim_data.rs<gh_stars>0 use super::pedersen_commitments::{generate_blinding_factor, generate_pedersen_commit}; use super::{RISTRETTO_POINT_SIZE, SCALAR_SIZE}; use codec::{Decode, Encode, Error as CodecError, Input, Output}; use curve25519_dalek::{ ristretto::{CompressedRistretto, RistrettoPoint}, ...
Rust
0
}; pub fn none(r: Res<()>) -> Res<Option<Media>> { r.map(|_| None) }; let res = match &command { InsertStart(ref n, ref m) => none(chain.insert_start(n.clone(), m.clone())), DeleteStart => some(chain.delete_start()), InsertEnd(ref n, ref m) => none...
Rust
0
# LOOPS #strings are arrays, we can loop through the characters in a string, with a for loop. for x in "banana": print (x) # STRING LENGTH #To get the length of a string, use the len() f...
Python
1
False def test_life_advice(): """测试生活建议""" print("🔍 测试生活建议...") try: payload = { "situation": "我最近学习压力很大,感觉很累", "category": "心理健康" } response = requests.post(f"{API_BASE_URL}/qa/life-advice", json=payload) if response.status_code == 200: ...
Python
1
te.last_ts.elapsed(); if elapsed.ge(&expected_delay) { break; } std::thread::sleep((expected_delay - elapsed).min(Duration::from_millis(5))); } state.last_ts += expected_delay; ...
Rust
0
c; use std::time::Instant; use graph::{components::store::EntityType, data::graphql::*}; use graph::{ data::graphql::ext::DirectiveFinder, prelude::{ s, ApiSchema, AttributeNames, BlockNumber, ChildMultiplicity, EntityCollection, EntityFilter, EntityLink, EntityOrder, EntityWindow, Logger, Pare...
Rust
0
def example_convert_to_torch_training(example, dtype=torch.float32, device=None ) ->dict: device = device or torch.device('cuda:0') example_torch1 = {} float_names = ['voxels', 'anchors', 'reg_targets', 'reg_weights', 'bev_map', 'rect', 'Trv2c', 'P2'] for k, v in example[0].items(): ...
Python
1
self.click_n(0, 0, MouseButton::Right, 1); // Now inject the appropriate left click events self.mouse(MouseEvent { kind: MouseEventKind::Press, x: start_x, y: start_y, button: MouseButton::Left, modifiers: KeyModifiers::default(), }) ...
Rust
0
nicode_same_case { args: func_args![value: "𛋙ၺ㚺𛋙Zonkکᤊᰙ𛋙Ꮺ믚㋫𐠘𒃪𖾛𞺘ᰙꢝⶺ觨⨙ઉzook", substring: "𛋙ၺ㚺𛋙Zonkکᤊᰙ𛋙", case_sensitive: true ], want: Ok(true), tdef: TypeDef::boolean().infallible(), } uni...
Rust
0
false; } fn get_random_aabb(&self) -> B2AABB { let mut aabb = B2AABB::default(); let w = B2vec2::new(2.0 * self.m_proxy_extent, 2.0 * self.m_proxy_extent); //aabb->lower_bound.x = -m_proxy_extent; //aabb->lower_bound.y = -m_proxy_extent + m_world_extent; aabb.lower_bound.x = random_float_range(-self.m_wor...
Rust
0
0, 0xa9, 0x11, 0x67, 0x75, 0xe3, 0x32, 0x1b} DEFINE_GUID! {MF_MT_COMPRESSED, 0x3afd0cee, 0x18f2, 0x4ba5, 0xa1, 0x10, 0x8b, 0xea, 0x50, 0x2e, 0x1f, 0x92} DEFINE_GUID! {MF_MT_SAMPLE_SIZE, 0xdad3ab78, 0x1990, 0x408b, 0xbc, 0xe2, 0xeb, 0xa6, 0x73, 0xda, 0xcc, 0x10} DEFINE_GUID! {MF_MT_WRAPPED_TYPE, 0x4d3f7b23, 0xd02f, 0x4e...
Rust
0
16, minor: u16) -> Self { IgniteClientCfg { nodes:vec![IgniteNodeAddress::default()], username: "".to_string(), password: "".to_string(), major, minor, patch: 0, } } } pub struct IgniteNodeAddress { pub host: String, pu...
Rust
0
from vyper.utils import OrderedSet from vyper.venom.analysis.analysis import IRAnalysis from vyper.venom.basicblock import CFG_ALTERING_INSTRUCTIONS class CFGAnalysis(IRAnalysis): """ Compute control flow graph information for each basic block in the function. """ def analyze(self) -> None: f...
Python
1
{:?}", rd); println!("fitness: {:?}", fit[rd.idx]); println!("genome: {:?}", pop[rd.idx]); if fit[rd.idx].objectives[0] < 1.0 { draw_graph(&pop[rd.idx].to_graph(), &format!("line_{}x{}_nsga2_n{}_f{}_i{}.svg", ...
Rust
0
wNonZeroPid = core::num::NonZeroU32; /// A group identifier as a raw integer. pub type RawGid = u32; /// A user identifier as a raw integer. pub type RawUid = u32; /// A CPU identifier as a raw integer. pub type RawCpuid = u32; pub(crate) type RawUname = linux_raw_sys::general::new_utsname; #[repr(C)] #[derive(Clone,...
Rust
0