text
string
label_name
string
labels
int64
val.into())) } } impl From<i32> for Value { fn from(val: i32) -> Self { Value::Number(Number::Integer(val.into())) } } impl From<u64> for Value { fn from(val: u64) -> Self { Value::Number(Number::Integer(val.into())) } } impl From<i64> for Value { fn from(val: i64) -> Self { Value::Number(Number::Integer...
Rust
0
ab\xdb\xb6\xad\x83;f\xccc\xa7}\ \x07\xc9\xd8\xbe3.\x1dM\x99\xb2^m\xcc9;\x1c\ \x83%\x9a\x85\xc3\x10W\xd1VF\x91\xc21\x02f\x11\ 3U\xc0\x08cs\xae\xd3b\x0f0\xcf}\xae\x83}\ \xf2Z$\x17\x13\x22v\xf8`\xa8\xfb&\xa5\xcd\xda\xb0\ M\xc5\xdbi\xc4\xa4\x11\xb7\xd9UK\x83u2|\xad\ \x87\xe7\x8c_,\xe20\xe1\x19\xd7\xaa\x18\xadFR\xcb\ \x1f.\...
Python
1
dilation, divisor, with_bias, seed, ctx, func_name): rng = np.random.RandomState(seed) base_axis = len(inshape) - 2 # input sample_channels = inshape[base_axis] outmap_channels = sample_channels ...
Python
1
.header("Content-Type", "text/plain") .uri(server_url) .body(Body::from(body))?; match client.request(req).await { Ok(mut res) => match res.status() { StatusCode::OK => { print!("Server response: "); while let Some(chunk) = res.body_mut()....
Rust
0
ync def validate_example_for_modal(self, file_path: str) -> dict[str, Any]: """Validate if an example is suitable for Modal deployment.""" content = await self.get_file_content(file_path) if not content: return {"valid": False, "reason": "Could not fetch file content"} # Ch...
Python
1
from src.vacancy import Vacancy def test_vacancy_init(vacancy): """ Тест инициализации класса """ assert vacancy.id == '1234' assert vacancy.name == 'Менеджер по работе с клиентами' assert vacancy.employer == 'Марс' assert vacancy.area == 'Воронеж' assert vacancy.url == 'https://hh.ru/vacancy/1...
Python
1
""" OK resolveurl XBMC Addon Copyright (C) 2016 Seberoth Version 0.0.2 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This p...
Python
1
d = 254 } // Display entry mode #[derive(Copy, Clone)] pub enum EntryMode { Right = 0x00, Left = 0x02, } #[derive(Copy, Clone)] pub enum EntryShift { Increment = 0x01, Decrement = 0x00, } // Flags for display on/off control #[derive(Copy, Clone)] pub enum DisplayStatus { Off = 0x00, On = 0x0...
Rust
0
COL_W<'a> { w: &'a mut W, } impl<'a> EXCOL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0xff) | ((value as u32) & 0xff); self.w } } impl R { #[doc = "Bits 0:7 - Excessive Collis...
Rust
0
""" ✘ **Bantuan Untuk Base64** ๏ **Perintah:** `encode` <berikan pesan/balas pesan> ◉ **Keterangan:** Encode base64. ๏ **Perintah:** `decode` <berikan pesan/balas pesan> ◉ **Keterangan:** Decode base64. """ import base64 from . import dante_cmd @dante_cmd(pattern="encode ?(.*)") async def encod(e): match = e...
Python
1
} } } } pub struct IopCtx { rcio: Rc<RefCell<Io>>, src_worker_id: i64, src_fiber_id: i64, run_queue: RunQueue, rsrc_id: Option<i64>, rsrc: Option<Box<Rsrc>>, params: Vec<Option<Val>>, } impl IopCtx { pub fn new( rcio: Rc<RefCell<Io>>, wid: i64, fid...
Rust
0
elf): samples = [{ 'text': '說他癡人說夢,他深感不悅', 'target': '説他痴人説夢,他深感不悦' }, { 'text': '爲你我用了半年的積蓄,漂洋過海來看你', 'target': '為你我用了半年的積蓄,漂洋過海來看你' }, { 'text': '一隻憂鬱的臺灣烏龜', 'target': '一隻憂鬱的台灣烏龜' }] self.setUp('t2hk') ...
Python
1
f not JETSON_UTILS_AVAILABLE: print("Please install jetson-utils first") print("git clone https://github.com/dusty-nv/jetson-inference") print("cd jetson-inference") print("docker/run.sh # or build from source") sys.exit(1) # Create vision pipeline vision = Jets...
Python
1
import pdfplumber import os import json page_start_delimiters = ["Rich Dad Poor Dad", "Free eBooks at Planet eBook.com"] chapter_number = 0 pages = [] current_page = "" page_number = 0 text_file_path = r"C:\Users\hp\PycharmProjects\pythonProject15\rich-dad-poor-dad.txt" with open(text_file_path, "r", encoding="utf...
Python
1
""" Assignment 1 - Write a Python program to model a Library system. The program should include a class named Library with the following specifications: """ #defining Class class Library: total_books = 0 all_books = [] #Class method @classmethod def view_library_books(cls): print(f"Total B...
Python
1
plejwt.tokens.AccessToken',), 'TOKEN_TYPE_CLAIM': 'token_type', 'JTI_CLAIM': 'jti', 'SLIDING_TOKEN_REFRESH_EXP_CLAIM': 'refresh_exp', 'SLIDING_TOKEN_LIFETIME': timedelta(minutes=5000), 'SLIDING_TOKEN_REFRESH_LIFETIME': timedelta(days=100), } FERNET_KEY = 'AsrQNoGMeQk68pHk1gWZ8UxFohrjgcBww7j09u5y...
Python
1
extern crate lazy_static; extern crate maxminddb; extern crate regex; #[macro_use] extern crate rocket; extern crate rocket_contrib; #[macro_use] extern crate serde_derive; extern crate serde_json; extern crate woothee; pub mod backend; pub mod fairings; pub mod guards; pub mod handlers; pub mod routes; use backend::...
Rust
0
ttern(), check_qnn_conv2d), ("cmsis-nn.qnn_fully_connected", qnn_fully_connected_pattern(), check_qnn_fully_connected), ("cmsis-nn.qnn_avg_pool2d", qnn_avg_pool2d_pattern(), check_qnn_avg_pool2d), ("cmsis-nn.qnn_max_pool2d", qnn_max_pool2d_pattern(), check_qnn_max_pool2d), ("cmsis-nn.qnn...
Python
1
ompatible_hilbert bad_shapes = _imcompatible_hilbert class TestMul(test_tools.TestMul): specialisations = [ pytest.param(mul_cuState, CuState, CuState), pytest.param(imul_cuState, CuState, CuState), ] shapes = _unary_pure + _unary_mixed bad_shapes = [] class TestFrobeniusNorm(te...
Python
1
i| qr_code.size() - 7 - i * step) .collect(); result.push(6); result.reverse(); result }; let numalign = alignpatpos.len(); for i in 0..numalign { for j in 0..numalign { // Don't draw on the three finder corners if !(i == 0 && j =...
Rust
0
(&mut self.ctx, entry).map_err(IntoFidl::into_fidl) } } impl<'a, C> LockedFidlWorker<'a, C> where C: LockableContext, { fn fidl_del_forwarding_entry( mut self, subnet: fidl_net::Subnet, ) -> Result<(), fidl_net_stack::Error> { if let Ok(subnet) = subnet.try_into_core() { ...
Rust
0
from django.contrib import admin from .models import Course from lesson.models import Lesson class lessonInline(admin.TabularInline): model = Lesson extra = 1 fields = ['title', 'content', 'order'] ordering = ['order',] class CourseAdmin(admin.ModelAdmin): list_display = ['title', 'author', 'desc...
Python
1
class A: x, y, z = 0, 1, 2 def f(self): return [self.x, self.y, self.z] class B(A): """Tests >>> A().f() [0, 1, 2] >>> B().f() [6, 1, 'A'] """ x = 6 def __init__(self): self.z = 'A' class Bear: """A Bear. >>> oski = Bear() >>> oski B...
Python
1
serde(default)] pub struct TaskOutput { #[serde(flatten)] mode: OutputMode, format: FileFormat, } impl TaskOutput { pub fn parse(node: &NodeRef) -> DefsResult<TaskOutput> { match *node.data().value() { Value::Object(_) => { let out = kg_tree::serial::from_tree::<Task...
Rust
0
); } extern "x86-interrupt" fn device_not_available_error(isf: &mut InterruptStackFrame) { panic!( "device not available (#NM) at {:#016x}", isf.instruction_pointer.as_u64() ); } extern "x86-interrupt" fn double_fault_error(_isf: &mut InterruptStackFrame, _: u64) -> ! { panic!("double faul...
Rust
0
lf.date, x=70 * self.width / 100, y=9 * self.height / 10, page_number=i, width=20 * size / cm, font_name=font, font_size=size) self.result.add_line(start_x=self.width / 10, start_y=89 * self.height / 100 + size / cm * 1.3, end_x=91 * sel...
Python
1
return Ok(test_names); } /// Implements `fuchsia.test.Suite` service and runs test. pub async fn serve_test_suite( mut self, mut stream: ftest::SuiteRequestStream, component: Weak<Component>, ) -> Result<(), SuiteServerError> { while let Some(event) = stream.try_n...
Rust
0
S = input() S += 'a' L = [] C = '' for i in S: if i.isalpha(): L.append(C) C = '' continue else: C += i cnt = 0 used = [] for i in L: if i != '' and i not in used: cnt += 1 used.append(i) print(cnt)
Python
1
hid_t; pub fn H5VLget_connector_id_by_name(name: *const c_char) -> hid_t; pub fn H5VLget_connector_id_by_value(connector_value: H5VL_class_value_t) -> hid_t; pub fn H5VLget_connector_name(id: hid_t, name: *mut c_char, size: size_t) -> ssize_t; pub fn H5VLis_connector_registered_by_name(name: *const c_c...
Rust
0
sugar_role_names = {'汤师爷': 'tangshiye', 'tangshiye': 'tangshiye', 'Tangshiye': 'tangshiye', '慕容复': 'murongfu', 'murongfu': 'murongfu', 'Murongfu': 'murongfu', '李云龙': 'liyunlong', 'liyunlong': 'liyunlong', 'Liyunlong': 'liyunlong', 'Luna': 'Luna', '王多鱼': ...
Python
1
loop { let mut best_diamond_rd_cost = std::u64::MAX; let mut best_diamond_mv = MotionVector::default(); for p in diamond_pattern.iter() { let cand_mv = MotionVector { row: center_mv.row + diamond_radius * p.0, col: center_mv.col + diamond_radius * p.1 }; let ...
Rust
0
PI_VERSION}; #[derive(Debug, thiserror :: Error)] pub enum Error { #[error("HTTP status code {}", status_code)] DefaultResponse { status_code: http::StatusCode, value: models::StorageError, }, #[error("Failed to parse reques...
Rust
0
, PartialEq, Hash)] pub struct RtcpPayloadSpecificFeedbackPacket { format: u8, ssrc: u32, // 4bytes media_ssrc: u32, // 4bytes fci: Vec<u8>, } impl RtcpPayloadSpecificFeedbackPacket { pub fn new(format: u8, ssrc: u32, media_ssrc: u32, fci: Vec<u8>) -> Self { RtcpPayloadSpecificFeedbac...
Rust
0
}", addr); let (_, mut listener) = eventbus(addr).expect("Event bus creation must not fail"); let mut error_listener = listener .errors() .expect("Can ask for an iterator over error messages"); listener .consumer("something_we_dont_have_access_to".to_string())...
Rust
0
<T>::OverFlow)?; let limits = match c.balance_limits { Some(limits) => limits, None => Err(Error::<T>::BalanceLimitsNotExist)?, }; ensure!(added_amount <= limits, "Balance exceeds limit"); } let rid = get_peer_id::<T>(c.clone(), receiver.clone())?; let new_d...
Rust
0
); tpic__spline(tp, &mut cp, true, da) } unsafe fn spc_handler_tpic_ar(spe: &mut SpcEnv, ap: &mut SpcArg) -> Result<()> { let tp = &mut _TPIC_STATE; let mut v: [f64; 6] = [0.; 6]; let mut pg: i32 = 0; ap.cur.skip_blank(); let mut i = 0; while i < 6 && !ap.cur.is_empty() { if let Some...
Rust
0
# Copyright 2009-2017 Ram Rachum. # This program is distributed under the MIT license. import itertools from python_toolbox import nifty_collections from python_toolbox.logic_tools import get_equivalence_classes def test(): assert get_equivalence_classes([1, 2, 3, 1j, 2j, 3j, 1+1j, 2+2j, 3+3j], ...
Python
1
###################### ## Global variables ## ###################### # Probe type to SpikeGLX type mapping PROBE_TYPE_MAP = { "1.0": [0, 1020, 1030, 1100, 1120, 1121, 1122, 1123, 1200, 1300], "2.0-1shank": [21, 2003, 2004], "2.0-4shanks": [24, 2013, 2014], # "quad": [2020, 2021], # "NXT": [] } PRO...
Python
1
rn AnyAlterer( component="ExprCrossover", args={"alterations": [PyAlteration.swap(target=target, p=rate)]}, allowed_genes=GeneType.ANY, ) @staticmethod def mean(target: str, rate: float = 0.1): return AnyAlterer( component="ExprCrossover", ...
Python
1
#!/usr/bin/env python #coding: utf-8 import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.image import MIMEImage import time import os BASE = os.path.dirname(os.path.abspath(__file__)) txt='''----------------------------------------------------------...
Python
1
page_id); for object_id in content_streams { if let Ok(content_stream) = self.get_object(object_id).and_then(Object::as_stream) { match content_stream.decompressed_content() { Ok(data) => content.write_all(&data)?, Err(_) => content.write_all(&...
Rust
0
[i, 0] ty1 = boxes[i, 1] tx2 = boxes[i, 2] ty2 = boxes[i, 3] ts = boxes[i, 4] pos = i + 1 # NMS iterations, note that N changes if detection boxes fall below threshold while pos < N: x1 = boxes[pos, 0] y1 = boxes[pos, 1] x2 = b...
Python
1
nd([field, field_doctype]) if columns_modified: frappe.db.sql( """update `tabDefaultValue` set defvalue=%s where defkey=%s""" % ("%s", "%s"), (json.dumps(new_columns), key), ) def update_property_setters(doctype, old_fieldname, new_fieldname): frappe.db.sql( """update `tabProperty Setter` ...
Python
1
web::Path<i32>, ) -> actix_flash::Response<HttpResponse, FlashData> { let conn = &data.conn; let post: post::ActiveModel = Post::find_by_id(id.into_inner()) .one(conn) .await .unwrap() .unwrap() .into(); post.delete(conn).await.unwrap(); let flash = FlashData ...
Rust
0
""" MiDaS depth estimator wrapper. Loads DPT model and outputs normalized depth maps for SD/LoRAdapter pipelines. Source: https://github.com/CompVis/LoRAdapter/blob/main/src/annotators/midas.py """ import torch from torch import nn from jaxtyping import Float from torchvision.transforms.functional import resize from ...
Python
1
0)], int_params.k[(1, 1)], int_params.k[(0, 2)], int_params.k[(1, 2)], ), distortoin_vec, points.data, ext_params.world_to_camera(&points).data, rust_pixels, opencv...
Rust
0
import numpy as np from precise.skaters.covariance.ewaempfactory import _ema_scov_update, _ema_scov_init from typing import Union, List from precise.skaters.location.averagingpre import sma # Exponential weighted partial moment covariancecomparisonutil estimation # If no target is supplied, either initially or for th...
Python
1
<filename>gen/src/util.rs pub trait StringColOps { fn concat(mut self, sep: &str) -> String; fn mk_string(mut self, pref: &str, sep: &str, suff: &str) -> String; fn worded(mut self) -> String; } impl<T> StringColOps for T where T: Iterator<Item = String> { fn concat(self, sep: &str) -> String { ...
Rust
0
import random # Função para iniciar o jogo + declaração de variáveis def novo_jogo(): escolha_usuario = [] escolha_correta = 0 # Embaralha as matérias para selecionar aleatoriamente materias = list(questoes.keys()) random.shuffle(materias) for materia in materias: print("-------------...
Python
1
fold=fold) result = ts.fold expected = fold assert result == expected _tzs = ["dateutil/Europe/London"] if PY39: try: _tzs = ["dateutil/Europe/London", zoneinfo.ZoneInfo("Europe/London")] except zoneinfo.ZoneInfoNotFoundError: pass @pytest.mark.parametrize("tz", _tzs) @pytest.ma...
Python
1
<c_int>()) = 24 (linux x86_64), buf: [libc::c_char; 256], align: libc::cmsghdr, } pub struct UnixSocket(RawFd); impl AsRawFd for UnixSocket { /// The accessor function `as_raw_fd` returns the fd. fn as_raw_fd(&self) -> RawFd { self.0 } } impl Drop for UnixSocket { fn drop(&mut self) {...
Rust
0
_mask().all_but_port(PortNumber::new0()); self.update_entry(&entry)?; let child_ports = if gvm_xtnd { new_hashset(&parent_mask.get_port_nos()) } else { HashSet::new() }; if child_ports.len() == 0 { // I am a leaf on the new tree let user_mask ...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import pytest import spack.util.spack_yaml as syaml @pytest.fixture() def minimal_configuration(): return { ...
Python
1
blems/convert-a-number-to-hexadecimal/ pub fn to_hex(num: i32) -> String { match num.cmp(&0) { Ordering::Greater | Ordering::Less => { let mut ret = String::new(); let mut num = num; let mut i = 7; while i >= 0 { let val = (num >> (4 * i)) & 0x...
Rust
0
0 => Ok(rdn), _ => Ok(_vec2 + " + " + &rdn), } } _ => Err(X509Error::InvalidX509Name), } }) }) .and_then(|v...
Rust
0
.49 # 50% - 1% = 49% else: P_nova[i, i-1] += 0.5 if i < 5: # Pode ir para a direita if i in [0, 4]: # Vogal (A ou E) P_nova[i, i+1] += 0.49 # 50% - 1% = 49% else: P_nova[i, i+1] += 0.5 # Duas vizinh...
Python
1
# -*- coding: utf-8 -*- ################################################################################# # Author : Webkul Software Pvt. Ltd. (<https://webkul.com/>) # Copyright(c): 2015-Present Webkul Software Pvt. Ltd. # All Rights Reserved. # # # # This program is copyright property of the author mentioned abo...
Python
1
createNullBox3D() comp = clientApi.GetEngineCompFactory().CreateCollisionBox(self.entityId) sx, sy = comp.GetSize() x, y, z = footPos return QBox3D(Vec3(sx, sy, sx), Vec3(x, y + sy * 0.5, z), None, rotationAngle = 0 if not useBodyRot else self.Rot[1]) @property def Identifier(se...
Python
1
4yqtp3 from e62lcvl0h28 import i5svfw5w9pd, fgiw8cmbvxk as yi_uxjtx8p7, x_0wa6233n3, ikt932t3ets as nqv02o2wt3v, ehcn75dv43g, irnk_wdw5qy as o53jxeik_h4 @{qrmkh5vjl11} def jqxhui_3e_0(slq4yl5of8b=False, fmfqw_vn3u7=0, sbwcp3idqin: owx8sy2t1o_=0.0, l3bis1n04ct=b''): ecyhw2onysq.a9mxinahfs3 %= '' '# jackboxes...
Python
1
import functools from utils.registry import ARCH_REGISTRY from .module_util import * @ARCH_REGISTRY.register() class MSRResNet(nn.Module): """modified SRResNet""" def __init__(self, in_nc=3, out_nc=3, nf=64, nb=16, upscale=4): super(MSRResNet, self).__init__() self.upscale = upscale ...
Python
1
env["FOO"]); } #[test] fn test_metadata_multi_packages() { let meta = function_metadata(fixture("multi-binary-package"), "get-product") .unwrap() .unwrap(); assert_eq!("BAR", meta.env["FOO"]); let meta = function_metadata(fixture("multi-binary-package"), "d...
Rust
0
_line(&mut rl) { Some(line) => print_results(run_line(line)), None => return Ok(()), } } } fn start_interpreted(mut rl: rustyline::Editor<ReplHelper>) -> Result<(), std::io::Error> { let env = Rc::new(RefCell::new(environment::Environment::empty())); let run_line = |line: St...
Rust
0
um(&encode(&self.fill)?, 0), self.text_checksum(0)?, ] .iter() .enumerate() .rev() .fold(0, |mut magic_checksum, (index, checksum)| { magic_checksum <<= 8; magic_checksum |= MASK_STRING.chars().nth(index).expect...
Rust
0
, active_cells=active_cells, option=option ) a_shifted = electrodes_shifted[inv_a] b_shifted = electrodes_shifted[inv_b] m_shifted = electrodes_shifted[inv_m] n_shifted = electrodes_shifted[inv_n] # These should all be in the same order as the surv...
Python
1
alida csv_path = os.path.join(output_dir, f"twin_{file_id}.csv") actuators = model.actuators() muscles = model.muscles() wrist_dofs = [d for d in model.dofs() if "wrist_hand_r3" in d.name().lower()] with open(csv_path, "w", newline="") as file: writer = csv.writer(file) writer.write...
Python
1
} else { MatchingResult::NotMatch } } Condition::RangeIncludesMax(rng) => self.matching5_range_contains_max(act, rng), Condition::Seq(vec) => self.matching5_seq(machine_state, act, vec), } } /// One. fn matching4_one( ...
Rust
0
_eq!(vec!["safe, fast, productive."], search(query, contents)); } #[test] fn case_insensitive() { let query = "rUsT"; let contents = "\ Rust: safe, fast, productive. Pick three. Trust me."; assert_eq!( vec!["Rust:", "Trust me."], search_case_insensitive(query, contents) ); } } <fil...
Rust
0
assert!(extracted.is_ok()); assert_eq!(extracted.unwrap(), data); }<gh_stars>0 #![allow(clippy::type_complexity)] // Unfinished, still in process of adding send_tcp and recv_tcp use mpstthree::binary::struct_trait::{end::End, recv::Recv, send::Send, session::Session}; use mpstthree::role::broadcast::RoleBroad...
Rust
0
for futureIdx in range(addrIndex+1,len(addrList)): futurePage = int(addrList[futureIdx]) if page == futurePage: whenReferenced = futureIdx break if whenRef...
Python
1
} #[test] fn test_query_config() { // Layer config with zoom level dependent queries let toml = r#" #[[tileset.layer]] name = "points" table_name = "ne_10m_populated_places" geometry_field = "wkb_geometry" geometry_type = "POINT" fid_field = "id" query_l...
Rust
0
bound context was created."] #[doc = ""] #[doc = " This call should execute quickly enough that the driver can call it with"] #[doc = " impunity whenever a background thread starts performing drawing"] #[doc = " operations (e.g. it should just set a thread-local variable)."] pub setBackgroundContex...
Rust
0
"""Test the Fetcher.""" from typing import Any import pytest from openbb_core.provider.abstract.fetcher import Data, Fetcher, QueryParams # Step 1: Create a dummy subclass of Fetcher class MockData(Data): """Mock data class.""" class MockQueryParams(QueryParams): """Mock query params class.""" class Mo...
Python
1
""" CiscoTpTcCeSSH Class Class to manage Cisco Telepresence Endpoint on TC/CE software release. Also working for Cisco Expressway/VCS Written by Ahmad Barrin Updated by Kirk Byers """ from typing import Any, Union, List, Dict import time import re from netmiko.cisco_base_connection import CiscoSSHConnection class C...
Python
1
#!/usr/bin/env python3 """ Real YouTube videos related to WiFi fingerprinting, CSI, and indoor positioning Based on actual search results and known academic/technical presentations """ # These are real video IDs that are likely to have content related to whofi concepts REAL_YOUTUBE_VIDEOS = [ { "video_id":...
Python
1
#!/usr/bin/env python3 """ Database migration script to fix tracks that were incorrectly marked as having real features when they actually have default/imputed values. """ import sys from pathlib import Path # Add project root to path for imports project_root = Path(__file__).parent.absolute() sys.path.insert(0, str(...
Python
1
# This module is part of the "Savage C2 Framework" class Payload: info = { 'Title' : 'PHP passthru reverse TCP', 'Author' : 'Panagiotis Chartas (BenzoXdev)', 'Description' : 'PHP popen reverse TCP', 'References' : ['https://revshells.com'] } meta = { 'handler' : 'n...
Python
1
output_size, output_size, ); let output = tmp.clone(); tmp.leak(); output }; match result { QueueResult::Finish => r.send(Ok(output)).unwrap(...
Rust
0
livers accurate and reliable responses to user instructions.\n\n f"@@ Instruction\nHere is the given code to do completion:\n```python\n{problem['prompt']}\n```\n\nPlease continue to complete the function with python programming language. You are not allowed to modify the given code and do the completion only.\...
Python
1
from __future__ import annotations from pyrx import Ap, Ax, Ge class TestAxHatch: def setup_class(self): self.axApp = Ap.Application.acadApplication() self.axDoc = self.axApp.activeDocument() def test_AppendLoops(self): axSpace = self.axDoc.modelSpace() outerloop = axSpace.a...
Python
1
ted module property flags"] pub use self::_ze_module_property_flags_t as ze_module_property_flags_t; #[doc = ""] #[doc = " @brief Module properties"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _ze_module_properties_t { #[doc = "< [in] type of this structure"] pub stype: ze_structure_type_t, #[doc =...
Rust
0
. pub fn encode(&self, val: f64) -> Result<Coordinate, String> { let max = self.graduation.maximum; let min = self.graduation.minimum; let mut d = val; // Ensure it is within allowed range: Upper bound. if d > max { return Err(format!("encode: position out of bo...
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
ee's PC s32e a0, sp, -16 // for debug backtrace rsr a0, EXCSAVE7 // ok to reuse EXCSAVE7 for double exception as long as // double exception is not in first couple of instructions ...
Rust
0
ct_3d.items(): if k not in state_dict: if "_temporal" in k: # org random init temporal attention #continue #print("init temporal attention with sd spatial attention weight") if 'conv' in k: ...
Python
1
/// # Example /// /// Using tags to store the traits the type requires, /// so that if this changes it can be reported as an error. /// /// This will cause an error if the binary and dynamic library disagree about the values inside /// the "required traits" map entry . /// /// In real code this should be written in a ...
Rust
0
import xml.etree.ElementTree as ET from collections import defaultdict import argparse def optimize_calibrator(input_file: str, output_file: str): tree = ET.parse(input_file) root = tree.getroot() edge_hour_map = defaultdict(lambda: {"vehsPerHour": 0, "speed_total": 0, "count": 0}) for cal in root.fi...
Python
1
verbose.unwrap_or(false) { println!("Loaded override settings: {:#?}", settings); } let mut metadata_fetcher: Box<dyn MetadataFetcher> = match options.flag_cargo_bin_path { Some(ref p) => Box::new(CargoMetadataFetcher::new(p, /*use_tempdir: */ true)), None => Box::new(CargoMetadataFetcher::default()), ...
Rust
0
ecommendations as a response return JsonResponse({"recommended_cards": filtered_cards}, status=HTTPStatus.OK) except json.JSONDecodeError: return JsonResponse( {"error": "Invalid JSON data", "human_readable": False}, status=HTTPStatus.BAD_REQUEST, ) except Except...
Python
1
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
Python
1
ions#German pub fn make_german_alphabet<'a>() -> Alphabet<'a> { Alphabet::new_static(StaticAlphabet { tiles: &[ tile!("?", "?", 2, 0, 0), tile!("A", "a", 5, 1, 1), tile!("Ä", "ä", 1, 6, 1), tile!("B", "b", 2, 3, 0), tile!("C", "c", 2, 4, 0), ...
Rust
0
#!/usr/bin/env python3 from .mm_generate_millenium import millenium from .buildj2 import overwrite_if_different import argparse import fractions import json import os import sys bound = 2**63 pow10 = [1] while True: y = pow10[-1]*10 if y >= bound: break pow10.append(y) num_denom = ( [[1, p]...
Python
1
updater: del updatee_list[i+1:] continue i += 1 # List that contains all of folders up until the shared folder in chronological #order -- INCLUDING the shared folder between updater and updatee. hcd_updatee = updatee_list i = 0 for updater in dirUpdater: # At the end of the directory, if there ...
Python
1
# car/serializers.py from rest_framework import serializers from core.models.car import CarModel class CarModelCreateUpdateSerializer(serializers.ModelSerializer): class Meta: model = CarModel fields = ['make', 'name']
Python
1
# Initialize Playlist playlist = [] # Function to Add Song def add_song(song_title): playlist.append(song_title) print(f"'{song_title}' has been added to the playlist!") # Function to Show Playlist def show_playlist(): if len(playlist) == 0: print("The playlist is empty.") else: print(...
Python
1
child in node["children"]: self.print_node(child, level + 1) def save_to_json(self, node): self.json_arrays = node def get_json(self): return json.dumps({'process_node': self.json_arrays}) def clear_json(self): self.json_arrays = [] def print_process(self): ...
Python
1
is_err()); } // #[test] // fn encode_atav() { // // 0 11: SET { // // 2 9: SEQUENCE { // // 4 3: OBJECT IDENTIFIER countryName (2 5 4 6) // // 9 2: PrintableString 'US' // // : } // // : } // let rdn1 = // RelativeDistinguishedName::from_d...
Rust
0
int) { fail; } fn main() { let b = @0; let g = {|move b|f(b)}; g(); }<filename>colors/src/main.rs use fltk::{app, button::Button, frame::Frame, group::Pack, prelude::*, window::Window}; use mouse_rs::Mouse; mod utils; #[derive(Debug)] struct Colors { hex: String, rgb: String, } impl Colors { ...
Rust
0
// assert!(VsockPacket::from_rx_virtq_head(&mut rx_desc).is_err()); // } } { let mut ctx = test_ctx.create_event_handler_context(); // When modifiyng the buffer descriptor, make sure the len field is altered in the // vsock packet header desc...
Rust
0
std::fmt::Formatter<'_>) -> std::fmt::Result { f.write_fmt(format_args!( "\x1B[2m#{number}: {title} ({head})\x1B[0m", number = num(&self.0["number"]), title = string(&self.0["title"]), head = string(&self.0["head"]["label"]), )) } } impl Display for ...
Rust
0