text
string
label_name
string
labels
int64
# flake8: noqa: E501 from .editblock_prompts import EditBlockPrompts class EditorEditBlockPrompts(EditBlockPrompts): main_system = """Act as an expert software developer who edits source code. {lazy_prompt} Describe each change with a *SEARCH/REPLACE block* per the examples below. All changes to files must use t...
Python
1
* (self.friction / speed + self.ground_drag * speed) } else { Vec3f::zero() } } else { Vec3f::zero() }; slowdown = slowdown - self.velocity * self.air_drag * speed; let slowdown_norm = slowdown.norm(); ...
Rust
0
from config import OWNER_USERNAME, SUPPORT_GRP from Venom import VenomX START = f""" **๏ ʜᴇʏ, ɪ ᴀᴍ [{VenomX.name}](t.me/{VenomX.username})** **➻ ᴀɴ ᴀɪ ʙᴀsᴇᴅ ᴄʜᴀᴛʙᴏᴛ** **──────────────** **➻ ᴜsᴀɢᴇ /chatbot [ᴏɴ/ᴏғғ]** <b>||๏ ʜɪᴛ ʜᴇʟᴘ ʙᴜᴛᴛᴏɴ ғᴏʀ ʜᴇʟᴘ.||</b> """ HELP_READ = f""" <u>**ᴄᴏᴍᴍᴀɴᴅs ғᴏʀ {VenomX.name}**</u> <u>*...
Python
1
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; let alphabet = Alphabet::new(alphabet.to_string()); let cipher = Vigenere::new(alphabet, ForeignGraphemesPolicy::Include); let key = "secret"; let ciphertext = cipher.encrypt(&plaintext, key).unwrap(); let decrypted = cipher.decryp...
Rust
0
class Company: def __init__(self, name, area, balance, max_num_of_employees): self.__name = name self.__area = area self.__employees = () self.__balance = balance self.__max_num_of_employees = max_num_of_employees def get_name(self): return self.__name ...
Python
1
{ unsafe { sys::cv_optflow_RLOFOpticalFlowParameter_getPropMinEigenValue_const(self.as_raw_RLOFOpticalFlowParameter()) }.into_result().expect("Infallible function failed: min_eigen_value") } fn set_min_eigen_value(&mut self, val: f32) -> () { unsafe { sys::cv_optflow_RLOFOpticalFlowParameter_setPropMinEigenValu...
Rust
0
rent_tags and "BT" not in add_tags: # 种子的tracker地址 tracker_url = self.__parse_tracker_for_transmission(torrent=torrent) if tracker_url: # 获取标签建议 site_tag, delete_suggest = self.__consult_site_tag_by_tracker(tracker_url=tracker_url) # 移除...
Python
1
o recall it for you.", app=qAppName())) dlg.okButton.setText(_("Recall")) yield from self.flowDialog(dlg) dlg.deleteLater() needle = dlg.lineEdit.text() yield from self.flowEnterWorkerThread() self.effects |= TaskEffects.Refs obj = self.repo[needle] comm...
Python
1
from aiogram import Dispatcher, types, F from aiogram.filters import Command, CommandStart from aiogram.fsm.context import FSMContext from aiogram.types import Message from aiogram.utils.markdown import hbold # Этот хэндлер срабатывает на команду /start async def cmd_start(message: types.Message, state: FSMContext) -...
Python
1
@T.prim_func def exp(A: T.handle, B: T.handle): T.evaluate(0) @R.function def main(x: R.Tensor((10,), dtype="float32")) -> R.Tensor((10,), dtype="float32"): cls = Before with R.dataflow(): alloc: R.Tensor((10,), dtype="float32") = R.bu...
Python
1
r_3145) = &input.pool_ids { let mut list_3147 = scope_3144.start_list(true, Some("item")); for item_3146 in var_3145 { #[allow(unused_mut)] let mut entry_3148 = list_3147.entry(); entry_3148.string(item_3146); } list_3147.finish(); } #[allow(un...
Rust
0
import sys from collections import deque drdc = [[-1,0], [0,1], [1,0], [0,-1]] def check_max(matrix): max_value = 0 for i in range(N): for j in range(N): if max_value < matrix[i][j]: max_value = matrix[i][j] max_list = [] for i in range(N): for j in r...
Python
1
self.moveKeys=('Home','End','Page Up','Page Down','Left Arrow', 'Right Arrow','Up Arrow','Down Arrow') #make a tuple of most of the useful common 'final' keys keys=(self.alphanumKeys+self.punctuationKeys+self.functionKeys+ self.whitespaceKeys+self.editKeys+self.moveKey...
Python
1
0/spec/core/model.html# #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum SmithyType { // primitive-shapes Boolean, Byte, Short, Integer, Long, Float, Double, BigInteger, BigDecimal, // basic-shapes Blob, String, Timestamp, Document, // aggregate-shape...
Rust
0
3); } #[no_mangle] fn app_main() -> anyhow::Result<()> { println!("Initializing..."); let peripherals: esp_idf_hal::peripherals::Peripherals = esp_idf_hal::peripherals::Peripherals::take().unwrap(); let gpios: esp_idf_hal::gpio::Pins = peripherals.pins; let pin_btn_a = gpios.gpio39.into_input(...
Rust
0
=> { // bit is both acc.into_iter().map(|v| vec![v<<1|0, v<<1|1]).flatten().collect() } } }) { memory.insert(k,v); } } } } return memory.v...
Rust
0
or", f"No se pudo enviar el mensaje: {e}") def recibir_mensajes(self): while self.conectado: try: datos = self.cliente.recv(1024) if datos: mensaje = descifrar_mensaje(datos) self.mostrar_mensaje(f"Servidor: {mensaje}") ...
Python
1
import lazyllm import platform import asyncio # Before running, set the environment variable: # # 1. `export LAZYLLM_DEEPSEEK_API_KEY=xxxx`: the API key of DeepSeek. # You can apply for the API key at https://platform.deepseek.com/ # Also supports other API keys: # - LAZYLLM_OPENAI_API_KEY: the API key o...
Python
1
def fact(n): res=1 for i in range(2,n+1): res=res*i return res if __name__=='__main__': number=5 print("factorial is",fact(number))
Python
1
# 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
ange_labels_copy == non_normalized_range_labels def test_get_labels_at_frame_index(self, fxt_mongo_id) -> None: range_labels = [ RangeLabels(start_frame=1, end_frame=4, label_ids=[ID("A")]), RangeLabels(start_frame=7, end_frame=7, label_ids=[ID("B")]), RangeLabels(start_...
Python
1
# -*- coding: utf-8 -*- """ Модуль для определения пользовательских команд Flask CLI. """ import click from flask.cli import with_appcontext from .data_loader.loader import DataLoader # Создаем группу команд 'data' @click.group('data') def data_cli(): """Команды для управления данными реестра.""" pass # Опре...
Python
1
import sys import win32evtlog def main(): path = "System" num_events = 5 if len(sys.argv) > 2: path = sys.argv[1] num_events = int(sys.argv[2]) elif len(sys.argv) > 1: path = sys.argv[1] query = win32evtlog.EvtQuery(path, win32evtlog.EvtQueryForwardDirection) events =...
Python
1
ionsCell {}: Can't create ports exception for invalid cell {}; number of cells is {}", func_name, cell_no, num_cells)] CellPortsExceptionsCell { func_name: &'static str, cell_no: usize, num_cells: usize}, #[fail(display = "BlueprintError::CellPortsExceptionsPorts {}: Ports exception {} is greater than maximum...
Rust
0
{ unsafe { &(*PORT::ptr()).outset2 } } #[cfg(any(feature = "same54"))] fn outclr2(&mut self) -> &OUTCLR { unsafe { &(*PORT::ptr()).outclr2 } } #[cfg(any(feature = "same54"))] fn pmux2(&mut self) -> &[PMUX2_; 16] { unsafe { &(*PORT::ptr()).pmux2_ } } #[cfg(any(fe...
Rust
0
grid = next_grid; next_grid = grid.round_part1(); } grid } fn round_part2(&self) -> Grid { let mut new_cells = self.cells.clone(); for x in 0..self.width { for y in 0..self.height { let cell = self.cell(x, y).unwrap(); if...
Rust
0
s() init_seeds(2023) if args.export: run_export(args.weight, args.save, args.size, args.dynamic, args.noanchor, args.noqadd) elif args.finetune: print(args) run_qat( args.weight, args.cocodir, args.device, args.ignore_policy, args.ptq, args.qat, args.supervi...
Python
1
""" # Strong Sort operator `Strong sort` uses deep learning to uniquely identify bounding boxes in order to track them trough an image stream. ## Inputs - image: HEIGHTxWIDTHxBGR array. - bbox: N_BBOX, X_MIN, X_MAX, Y_MIN, Y_MAX, CONDIDENCE, CLASS, array ## Outputs - obstacles_id: x1, x2, y1, y2 track_id, class_...
Python
1
::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; descriptor.get(|| { ::protobuf::reflect::EnumDescriptor::new_pb_name::<TokenEndpointAuthSigningAlg>("TokenEndpointAuthSigningAlg", file_descriptor_proto()) }) } } impl ::std::marker::Copy for TokenEndpointAuthSigningAlg { } imp...
Rust
0
ER", *b"OMBUS", *b"OMENS", *b"OMERS", *b"OMITS", *b"OMLAH", *b"OMOVS", *b"OMRAH", *b"ONCER", *b"ONCES", *b"ONCET", *b"ONCUS", *b"ONELY", *b"ONERS", *b"ONERY", *b"ONIUM", *b"ONKUS", *b"ONLAY", *b"ONNED", *b"ONTIC", *b"OOBIT", *b"OOHED", *b"OOMPH", *b"OONTS", *b"OOPED", *...
Rust
0
n_and_completion(&mut ring, &mem_region, OpCode::Write, NUM_BYTES); // Verify the result. let mut buf = [0u8; NUM_BYTES]; file.read_exact_at(&mut buf, 0).unwrap(); assert_eq!(buf, &expected_result[..]); } #[test] fn test_read() { skip_if_io_uring_unsupported!(); // Test that reading the sorte...
Rust
0
B36 { const SIZE : i32 = 6; const CELLS : i32 = B36::SIZE * B36::SIZE; const MASK : u64 = 0x0000000FFFFFFFFF; const INITIAL_BP : u64 = 1081344; const INITIAL_WP : u64 = 2113536; const INITIAL_MOVE : i32 = 22; const RV_MASK0 : u64 = 0x000000079E79E79E; const RV_MASK1 : u64 = 0x000000003FFFFFC0; con...
Rust
0
, x_max, chart_width, &x_axis_grid_line_interval); let mut found_overlap = false; for grid_line_index in 0..x_axis_grid_line_info.num_grid_lines { let grid_line_value = x_axis_grid_line_info.start + grid_line_index.to_f64().unwrap() * x_axis_grid_line_info.interval; let label = number_formatter.format(gri...
Rust
0
()) } } #[cfg(test)] mod tests { use super::*; use std::fs::File; use std::io::prelude::*; #[test] fn decrypt_initial() { decrypt_initial_helper("test_data/initial_ngtcp2.txt"); decrypt_initial_helper("test_data/initial_quicly.txt"); } fn decrypt_initial_helper(file_...
Rust
0
# Copyright (c) 2022, Nirali and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class CombineJobCardDetail(Document): pass
Python
1
if start == 0 && end == 0 { return false; } if nums[start] == nums[mid] && nums[mid] == nums[end] { start += 1; end -= 1; } else if nums[start] <= nums[mid] { if nums[start] <= target && nums[mid] > target { ...
Rust
0
from app.extensions import db from datetime import datetime from . import link # class Influencer(db.Model): # __tablename__ = 'influencer' # influencer_id = db.Column(db.Integer, primary_key=True) # name = db.Column(db.String(255)) # url = db.Column(db.String(255)) # created_at = db.Column(db.DateT...
Python
1
while len(impression_data.chat_history) > 1000 and _times < 100: # 随机删除一些对话历史行 impression_data.chat_history.pop(random.randint(0, len(impression_data.chat_history) - 1)) _times += 1 prev_summarized = f"Last impression:{impression_data.chat_impressi...
Python
1
_base_ = [ 'mmsegext::_base_/datasets/ade20k_640_tta_without_ratio.py', 'mmseg::_base_/default_runtime.py', 'mmseg::_base_/schedules/schedule_160k.py' ] data_preprocessor = dict( type='SegDataPreProcessor', size=(640, 640), mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], bgr...
Python
1
############') def demo(): from nltk.corpus import udhr langs = [ "Kurdish-UTF8", "Abkhaz-UTF8", "Farsi_Persian-UTF8", "Hindi-UTF8", "Hawaiian-UTF8", "Russian-UTF8", "Vietnamese-UTF8", "Serbian_Srpski-UTF8", "Esperanto-UTF8", ] ...
Python
1
""" Solution for part 1, template for part 2 Using substitution ciphers to encrypt and decrypt plain text """ # Part 1 - Use a dictionary that represents a substition cipher to # encrypt a phrase # Example of a cipher dictionary 26 lower case letters plus the blank CIPHER_DICT = {'e': 'u', 'b': 's', 'k': 'x', 'u': ...
Python
1
temporary orientation of the View3D. The new orientation is not saved in the document. newViewOrientation3D: The new orientation to set. """ pass def SetRenderingSettings(self,settings): """ SetRenderingSettings(self: View3D,settings: RenderingSettings) Changes the rendering settings for...
Python
1
)) .into(), vec![raydir.into(), zero.into()], ); let view = ast::ExprData::variable("view"); let iview = ast::ExprData::FunCall( ast::FunIdentifierData::ident("inverse").into(), vec![view.into()], ); let mul = ast::ExprData::Binary(...
Rust
0
_file = tmp_path / "test.xhtml" xhtml_content = """<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test XHTML Page</title> </head> <body> <h1>Hel...
Python
1
} if last_cid as u32 >= 0xffffu32 { _tt_abort(b"CID count > 65535\x00" as *const u8 as *const i8); } cidtogidmap = 0 as *mut u8; /* !NO_GHOSTSCRIPT_BUG */ /* * Map CIDs to GIDs. * Horizontal and vertical used_chars are merged. */ /* * Horizontal */ if !h_us...
Rust
0
}; } <gh_stars>0 use crate::transform::CrateRng; use crate::model::{Expr, ExprData}; use rvs_parser::ast; use std::fmt::{self, Write}; use std::num::Wrapping; #[derive(Clone)] pub struct Binary { data: ExprData, operation: ast::BinaryOpcode, operands: (Box<dyn Expr>, Box<dyn Expr>), done: (bool, ...
Rust
0
e(Debug)] pub enum Error { Program(program::Error), } impl From<program::Error> for Error { fn from(other: program::Error) -> Self { Error::Program(other) } }<reponame>l1048576/fbx-binary-reader //! Contains interface for a pull-based (StAX-like) FBX parser. use std::io::Read; use error::Result; u...
Rust
0
#!/usr/bin/env python # coding:utf-8 import largeXMLDealer import sys fileName = sys.argv[1] elemTag = sys.argv[2] @largeXMLDealer.largeXMLDealer(fileName,elemTag) def dealwithElement(elem): """""" if isinstance(elem, object): print(elem.text) if __name__ == "__main__": # if len(sys.argv) == 2:...
Python
1
ld PCB lock p.acquire_inner_lock().is_zombie() && (pid == -1 || pid as usize == p.getpid()) // ++++ release child PCB lock }); if let Some((idx, _)) = pair { let child = inner.children.remove(idx); // confirm that child will be deallocated after removing from children...
Rust
0
, sql, &[&username]).await?) } async fn fetch_by_email_optional( &self, conn: &mut PgConnection, email: &str, ) -> Result<Option<AuthAccountModel>, LightSpeedError> { let sql = r#" select id, version, data from LS_AUTH_ACCOUNT where DATA ->> 'email' =...
Rust
0
405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20 # Key::Withdraw /// dictionary-0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20 # Key::Dictionary /// The Key::SystemContractRegistry variant is unique and can only take the following value: /// system-contract-registry-000000000000000000...
Rust
0
5e9ce9cad4du64, 0x0a43bcef24b8982fu64, 0x7400d24bc4228f11u64, 0xc02df9a29f6304a5u64 ] )); #[rustfmt::skip] const G1_XDEN_K_6: ArrFp = ArrFp(secret_array!( U64, [ 0x0772caacf1693619u64, 0x0f3e0c63e0596721u64, 0x570f5799af53a189u64, 0x4e2e073062aede9cu64, 0xea73b3538f0de06cu64, 0xec257...
Rust
0
from skimage.filters import frangi, sato, hessian ,meijering from sciapp.action import Filter, Simple class Frangi(Simple): title = 'Frangi 3D' note = ['float', 'auto_msk', 'auto_snap', 'stack3d'] para = {'start':1, 'end':10, 'step':2, 'alpha':0.5, 'beta':0.5, 'gamma':15, 'bridges':False} view = [(int, 'start', (...
Python
1
ChainEpoch = 51000; /// V3 network upgrade pub const UPGRADE_IGNITION_HEIGHT: ChainEpoch = 94000; /// V4 network upgrade pub const UPGRADE_ACTORS_V2_HEIGHT: ChainEpoch = 138720; /// V5 network upgrade pub const UPGRADE_TAPE_HEIGHT: ChainEpoch = 140760; /// Switching to mainnet network name pub const UPGRADE_LIFTOFF_HE...
Rust
0
print("Primo valore:", image_current_face_encoding[0]) print("Vettore: ", image_current_face_encoding)#stampo il vettore print("") for j in range(0, 129): if (j != 128): AddSheet.cell(row=riga, column=j + 1).value = image_current_face_encoding[j]#scrivo ogni val...
Python
1
his distribution and at https://raw.githubusercontent.com/lemonrock/linux-epoll/master/COPYRIGHT. No part of linux-epoll, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file. // Copyright © 2019 The developers of linux-epoll. See the COP...
Rust
0
def is_fibonacci(n): a, b = 0, 1 while b < n: a, b = b, a + b return b == n or n == 0 numero = int(input("Informe um número: ")) if is_fibonacci(numero): print(f"O número {numero} pertence à sequência de Fibonacci.") else: print(f"O número {numero} não pertence à sequência de Fibonacci.")
Python
1
the ensemble learner. Returns ------- numpy.ndarray An array of shape (n_samples, n_features), in which each outer entry is associated with the X entry of the same index. And where the list in index [i] contains len(self.target_values) elements, each of whic...
Python
1
amount: Balance) { ensure_root(origin)?; match max_members { GroupMaxMembers::Ten => CreatePayment::mutate(|h| h.Ten = amount), GroupMaxMembers::Hundred => CreatePayment::mutate(|h| h.Hundred = amount), GroupMaxMembers::FiveHundred => CreatePayment::mutate(|h| h.FiveHundred = amount), GroupMaxMem...
Rust
0
let mut reader = reader_with_schema(&reader_schema, buf); assert!(reader.next().unwrap().is_ok()); } #[test] fn both_are_unions_but_different() { let writer_schema = Schema::from_str(r##"["null", "int"]"##).unwrap(); let mut writer = writer_from_schema(&writer_schema, Codec::Null); writer.serialize...
Rust
0
w()); let sc_condition = Notify::new(); Self{ stop_flag, task, last_change, sc_condition } } /// Notify the task that there is new work to do async fn wake_up(&self) { let mut last_change = self.last_change.lock().await; *last_change = Instant::now(); self.sc_condit...
Rust
0
.unwrap_or("6144") .parse::<u64>() .expect("Was expecting number of megabytes [u64]") * 1024 * 1024, disk: args .value_of("ocaml-alert-threshold-disk") .unwrap_or("95") .parse::<u64>() ...
Rust
0
.get() .map(|cb| cb.callback(humidity as usize)); match self.on_deck.get() { OnDeck::Temperature => { self.on_deck.set(OnDeck::Nothing); buffer[0] = Registers::MeasTemperatureNoHoldMode as u8; ...
Rust
0
ri<'static>> { None } fn matches<T>(&self, t: &T) -> bool where T: TTerm + ?Sized, { (self[0])(t.as_dyn()) } } #[cfg(test)] mod test { use super::*; #[test] fn test_any_as_matcher() { let m = ANY; // comparing to a term using a differently cut, ...
Rust
0
# -*- coding: utf-8 -*- """ Bare Laser Diode Power Analysis v1.0 Lukas Kostal, 19.1.2024, ICL """ import numpy as np import matplotlib.pyplot as plt import scipy.optimize as so def lin(x, m, c): y = m * x + c return y def ana(filename, Ifit, n): I, P = np.loadtxt(f'Data/{filename}.csv', delimiter=','...
Python
1
`'stdout'` prints to console, `'dicts'` returns a dictionary of the configuration. Returns ------- out : {`dict`, `None`} If mode is `'dicts'`, a dict is returned, else None See Also -------- get_include : Returns the directory containing NumPy C header file...
Python
1
s.iter().skip(3)) .filter(|(a, b)| a < b) .count() .try_into() .expect("Failed to convert to u32") } #![deny(unsafe_code)] #![deny(warnings)] #![feature(const_fn)] #![no_std] extern crate cortex_m_rtfm as rtfm; extern crate stm32f103xx; use rtfm::{app, Resource, Threshold}; app! { ...
Rust
0
(11, ValidatorPrefs::default()) // ] // ); // // assert_eq!( // Staking::ledger(100), // Some(StakingLedger { // stash: 101, // active_ring: 500, // active_deposit_ring: 0, // active_kton: 0, // deposit_items: vec![], // ring_staking_lock: StakingLock { // staking_amount: 5...
Rust
0
umer """ if synset1._pos != synset2._pos: raise WordNetError( "Computing the least common subsumer requires " "%s and %s to have the same part of speech." % (synset1, synset2) ) ic1 = information_content(synset1, ic) ic2 = information_content(synset2, ic) sub...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################## # __ __ __ __ _____ # # \ \/ /__ \ \/ /__ _/ ___/__ ___ # # \ / _ `/\ / _ `/ (_ / -_) _ \ ...
Python
1
, Err(err) => { debug!("{}", err); return err.into(); } }; let mut map = HashMap::new(); // TODO (SA): This needs to be refactored to all get done in a single transaction // For each row, store its id in our map, keyed on visibility for ...
Rust
0
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
Python
1
"--help" => { print!("{}", MAN_PAGE); } // This argument is unknown. _ => fail("unknown argument.", &mut stderr), } } loop { // We read one byte at a time from stdin. let mut input = [0]; let _ = stdin.read(&mut input); ...
Rust
0
# coding: utf-8 # Copyright (c) 2025 OceanBase. # # 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 agr...
Python
1
from bionumpy.streams import MultiStream from bionumpy.arithmetics.similarity_measures import forbes, jaccard, get_contingency_table from bionumpy.datatypes import Interval from bionumpy.genomic_data.geometry import Geometry from numpy.testing import assert_array_equal import pytest @pytest.fixture def interval_a(): ...
Python
1
push_escaped_str(*ESCAPED.get_unchecked(c), buffer); start_ptr = ptr2.add(1); } } } if end_ptr > start_ptr { let slc = slice::from_raw_parts(start_ptr, end_ptr as usize - start_ptr as usize); buffer.push_str(cor...
Rust
0
""" This is an example of a file that will be used to deploy Aquiles-RAG to providers like Render using Qdrant as the RAG, you have to create a requirements.txt with "aquiles-rag" as the only module to install, and in the command to launch the service you have to use "quiles-rag deploy --host "0.0.0.0" --port 5500 -...
Python
1
with open(tex_file_path, 'w') as f: f.write(document) # Run pdflatex process = subprocess.run( ['pdflatex', '-interaction=nonstopmode', tex_file_path], cwd=temp_dir, capture_output=True, text=True, ...
Python
1
import random def sorting_hat (): gryffindor = 0 hufflepuff = 0 ravenclaw = 0 slytherin = 0 winner =[] questions = ["\n¿Que cualidad te describe mejor?:\n1.Valor\n2.Lealtad\n3.Erudición\n4.Ambición\nRespuesta:", "\n¿Que cualidad te discribe mejor?:\n1.Paciencia\n2.Fuerza\...
Python
1
sketches( body: Bytes, api_key: Option<Arc<str>>, schema_definition: &Arc<schema::Definition>, ) -> Result<Vec<Event>, ErrorMessage> { if body.is_empty() { // The datadog agent may send an empty payload as a keep alive debug!( message = "Empty payload ignored.", i...
Rust
0
\nFor information about available fields see [wake_fl](index.html) module"] pub struct WAKE_FL_SPEC; impl crate::RegisterSpec for WAKE_FL_SPEC { type Ux = u32; } #[doc = "`read()` method returns [wake_fl::R](R) reader structure"] impl crate::Readable for WAKE_FL_SPEC { type Reader = R; } #[doc = "`write(|w| ..)...
Rust
0
rn)] let res = SHIELDING_PAWN_MISSING[shields_missing] + SHIELDING_PAWN_MISSING_ON_OPEN_FILE[shields_on_open_missing]; #[cfg(feature = "display-eval")] { println!("\nKing for {}:", if white { "White" } else { "Black" }); println!( "\tShield pawn missing: {} -> {}", ...
Rust
0
.ring_buffer .write(MSG_TYPE_ID, &context.src_ab, src_index, length)); assert_eq!( context.ab.get::<i32>(RecordDescriptor::type_offset(tail)), RecordDescriptor::PADDING_MSG_TYPE_ID ); assert_eq!( context.ab.get::<i32>(RecordDescriptor::length_offs...
Rust
0
CAST_TYPES = ["CAST", "UCAST"] CAST_DEFAULT = "CAST" CAST_NET_AE_PATH = "latest_net_AE.pth" CAST_NET_DEC_B_PATH = "latest_net_Dec_B.pth" CAST_VGG_PATH = "models/vgg_normalised.pth" EFDM_STYLE_TYPES = ["adain", "adamean", "adastd", "efdm", "hm"] EFDM_DEFAULT = "efdm" EFDM_PATH = "models/hm_decoder_iter_160000.pth" MI...
Python
1
' & " !+3(H<AH(>H -H( H% !H(( H6cnUR(a5[R"U[RS9nUR SS9nX#4$UR S5nUR upVpxURXVU[R...
Python
1
property_data: structs::SclyProperty::SpecialFunction( structs::SpecialFunction { name: b"Enable Sun Tower Layer Change Trigger\0".as_cstr(), position: [0., 0., 0.].into(), rotation: [0., 0., 0.].into(), type_: 16, unknown0: b"\...
Rust
0
g, face_index=face_num) if target_face is not None: result = face_swapper.get(result, target_face, source_face) else: logger.info(f"No target face found for {face_num}") result_image = Image.fromarray(cv2.cvtColor(result, cv2.COLOR_BGR...
Python
1
n = int(input("Nhập kích thước danh sách: ")) list = [] def nhap(list, n): for i in range(n): print("Nhập phần tử thứ", i + 1) list.append(int(input())) return list print(f"Chương trình có mảng là: {nhap(list, n)}") def kiem_tra_hoan_hao(list, n): print("Các số hoàn hảo trong danh sách là:"...
Python
1
# Capacity and assignment constraints for i in graph.nodes: model.addCons(quicksum(assign_vars[i, j] for j in graph.nodes if i != j) <= node_capacity[i], name=f"capacity_{i}") for j in graph.nodes: model.addCons(quicksum(assign_vars[i, j] for i in graph.nodes if i != j) <...
Python
1
from django.urls import path from habits.apps import HabitsConfig from rest_framework.routers import DefaultRouter from habits.views import HabitViewSet, PublicHabitsListAPIView app_name = HabitsConfig.name router = DefaultRouter() router.register(r'habits', HabitViewSet, basename='habits') urlpatterns = [ pat...
Python
1
ds(division, calls) .iter() .filter(|m| (is_triplet(m) || is_quadruplet(m)) && m[0].is_colour()) .count() == 2 && division.pair.len() >= 1 && division.pair[0].is_colour() } fn has_ryanpeikou(division: &Division, calls: &Vec<Call>, _context: &HandContext) -> bool { le...
Rust
0
_shield_scale: Vec2, left_shield_rot: f32, right_shield_pos: Vec2, right_shield_scale: Vec2, right_shield_rot: f32, left_weapon_pos: Vec2, left_weapon_scale: Vec2, right_weapon_pos: Vec2, right_weapon_scale: Vec2, } impl Default for EnemyParams { fn default() -> Self { Self { speed: 80.0, rot_offset: ...
Rust
0
"""Utilities for securely loading model checkpoints.""" from __future__ import annotations from pathlib import Path from typing import Any, Dict, Tuple, Union import torch class InvalidCheckpointError(RuntimeError): """Raised when a checkpoint file contains unexpected objects.""" pass def safe_load_checkp...
Python
1
help="Generate preview showing detected edges") args = parser.parse_args() scanner = DocumentScanner() if args.preview: print("📋 Generating preview...") scanner.preview_detection(args.input, "detection_preview.png") print("🚀 Starting document scanning process..."...
Python
1
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # 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 requ...
Python
1
in = stdin.lock(); stdin.read_line(&mut line)?; if line.trim() != ME_HEADER { return Err(Error::from("malformed ticket headers")); } line.clear(); stdin.read_line(&mut line)?; let ticket = parse_ticket(line.trim())?; line.clear(); stdin.read_li...
Rust
0
name_value(attrs, "serde", key) } /// Search for a `Serde` attribute, provided that it's a single word. pub fn has_serde_word(attrs: &[Attribute], key: &str) -> Result<bool> { has_meta_word(attrs, "serde", key) } /// Extracts a boolean value from an attribute value. /// Returns `Err` if the value is not a `LitBoo...
Rust
0
_assertion_entry; mod unknown_member; mod unknown_named_import_specifier; mod unknown_parameter; mod unknown_statement; <filename>src/commons/grids/mod.rs pub mod cellgrid; pub mod scanner; pub use cellgrid::CellGrid; pub use scanner::GridScanner; /// A type alias for a cell on the grid and its position in that grid ...
Rust
0
# Examples from: # "CarHackersHandbook" by Craig Smith (UDS scan) (page 55) # "Adventures in Automotive Networks and Control Units" by Charlie Miller and Chris Valasek # # Load needed modules modules = { 'io/hw_USBtin': {'port': 'auto', 'debug': 1, 'speed': 500}, # IO hardware modu...
Python
1
g the dot product through a sigmoid function. This soft score is differentiable and suitable for use in learning pipelines. Args: c2w (torch.Tensor): Camera-to-world transformation matrix of shape (4, 4). vertices (torch.Tensor): 3D vertices of shape (N, 3). faces (torch.Tensor): Face i...
Python
1