text
string
label_name
string
labels
int64
aise PropertyNotFound user = request.user if property.user != user: return Response( {"error": "You can't delete a property that doesn't belong to you"}, status=status.HTTP_403_FORBIDDEN, ) if request.method == "DELETE": delete_operation = property.delete() ...
Python
1
(()), Err(e) => Err(e), } } println!("`mkdir a`"); match fs::create_dir("a") { Err(why) => println!("! {:?}", why.kind()), Ok(_) => {} } println!("`echo hello > a/b.txt`"); echo("hello", &Path::new("a/b.txt")).unwrap_or_else(|why| { println!("! {:?}"...
Rust
0
idget::ModalHost; use crate::{CurrentAction, EditorState}; pub fn make_unsaved_changes_alert() -> impl Widget<EditorState> { let close = Button::new("Close without saving").on_click(|ctx, data: &mut EditorState, _env| { data.action = CurrentAction::WaitingToExit; ctx.submit_command...
Rust
0
import streamlit as st import pandas as pd st.set_page_config(page_title="Manage Customers", page_icon= "💼", layout="wide") st.markdown(""" <style> [data-testid="stSidebarNav"], [data-testid="stSidebarHeader"] { display: none; } </style> """, unsafe_allow_html=True) st.markdown("...
Python
1
# -*- coding: utf-8 -*- import pyfits import numpy as np import pylab as py import scipy from scipy import ndimage from scipy import fftpack def Calib(xmag,ymag,xrotation,yrotation,exmag,eymag,exrotation,eyrotation,dxpix,dypix,edxpix,edypix,f1,f2,ef1,ef2): b = xmag * np.cos(xrotation) c = ymag * np.sin(yrot...
Python
1
punct: list[str] = [] w_p_len = [] for i in sep_phonemes: phone_w_punct += i w_p_len.append(len(i)) phone_w_punct = phone_w_punct[:-1] # punctuation無しのアクセント情報を使って、punctuationを含めたアクセント情報を作る # print("phone_w_punct: ", phone_w_punct) # print("phone_to...
Python
1
# API Métier Docs MCP - Sylvie v3 # Implémentation concrète (exemple avec google-api-python-client) from googleapiclient.discovery import build from app.services.scopes import SCOPES from app.services.token_manager_storage import TokenManagerStorage class DocsAPI: def __init__(self, account_email): self...
Python
1
d) } else { let bit = 1 << state.rand_mut().choose(0..8); let byte = state.rand_mut().choose(input.bytes_mut()); *byte ^= bit; Ok(MutationResult::Mutated) } } } impl Named for BitFlipMutator { fn name(&self) -> &str { "BitFlipMutator" ...
Rust
0
(gt_bboxes[i]) tmp_box.stop_gradient = True tmp_box[:, 0] = gt_bboxes[i][:, 0] / ins_shape[i][1] * W tmp_box[:, 2] = gt_bboxes[i][:, 2] / ins_shape[i][1] * W tmp_box[:, 1] = gt_bboxes[i][:, 1] / ins_shape[i][0] * H tmp_box[:, 3] = gt_bboxes[i][:, 3] / ins_shap...
Python
1
ecuteMsg, ) -> Result<Response, ContractError> { let api = deps.api; match msg { ExecuteMsg::UpdateAdmin { admin } => ADMIN .execute_update_admin(deps, info, maybe_addr(api, admin)?) .map_err(Into::into), ExecuteMsg::AddHook { addr } => execute_add_hook(deps, info, addr),...
Rust
0
# SPDX-License-Identifier: Apache-2.0 from ...common._registration import register_shape_calculator from ...common.data_types import FloatTensorType, StringTensorType from ...common.shape_calculator import check_input_and_output_numbers def calculate_one_hot_encoder_output_shapes(operator): """ Allowed input...
Python
1
_P(zv)); return Z_PTR_P(zv); } else { return NULL; } } static zend_always_inline void *zend_hash_add_new_ptr(ht: *mut HashTable, key: *mut zend_string, pData: *mut c_void) { zval tmp, *zv; ZVAL_PTR(&tmp, pData); zv = zend_hash_add_new(ht, key, &tmp); if (zv) { ZEND_ASSUME(Z_PTR_P(zv)); return Z_PTR_P(zv...
Rust
0
start_page..end_page { st.aa.fill_page_with_random(page_idx); } st.wpage_pos.store(end_page, Ordering::Relaxed); debt_tracker.pay((nr_pages * *PAGE_SIZE) as f64 / wbps as f64); total_bytes += (nr_pages * *PAGE_SIZE) as u64; status.update_bytes(total_bytes, end_page ...
Rust
0
; return Ok(true); } info!("{}", &self.last_query); *lyrics = None; let response = self .client .get("https://lyrics-api.lujjjh.com/") .query(&[("name", name), ("artist", artist)]) .send() ...
Rust
0
import os import json import chromadb import torch from transformers import AutoModel, AutoTokenizer # 데이터 경로 설정 JSON_PATH = os.path.abspath("../dataset/판례목록.json") # GPU 설정 device = "cuda" if torch.cuda.is_available() else "cpu" # ChromaDB 설정 CHROMA_DB_PATH = "../dataset/chroma_db" chroma_client = chromadb.Persiste...
Python
1
from datetime import datetime, date, time from django.utils.timezone import localtime from medications.models import MedicationLog, Medication from dashboard.models import FeltOffLog def get_medication_questions(user): today = date.today() # 🧪 Check if the user already logged any medication today if Medi...
Python
1
LCD_GINT1_REG = crate::Reg<lcd_gint1_reg::LCD_GINT1_REG_SPEC>; #[doc = "LCD Global Interrupt Register1"] pub mod lcd_gint1_reg; #[doc = "LCD_FRM_CTL_REG register accessor: an alias for `Reg<LCD_FRM_CTL_REG_SPEC>`"] pub type LCD_FRM_CTL_REG = crate::Reg<lcd_frm_ctl_reg::LCD_FRM_CTL_REG_SPEC>; #[doc = "LCD FRM Control R...
Rust
0
relations[dependent, head]`). /// * `sentence`: the sentence in which to store the dependency relations. pub fn decode_greedy( &self, pairwise_head_scores: ArrayView2<f32>, best_pairwise_relations: ArrayView2<i32>, sentence: &mut Sentence, ) { let heads = pairwise_hea...
Rust
0
def reverse(temp): count = 0 result = 0 cycle = temp while cycle > 0: cycle //= 10 count += 1 for i in range(count, 0, -1): result += temp % 10 * 10 ** (i - 1) temp //= 10 return result def func(N,K): sum = 0 temp = N output = reverse(temp) sum += output print("Первое число наобо...
Python
1
from collections import defaultdict from itertools import product from typing import Callable, DefaultDict, Tuple from prompt_toolkit.mouse_events import MouseEvent __all__ = [ "MouseHandlers", ] class MouseHandlers: """ Two dimensional raster of callbacks for mouse events. """ def __init__(sel...
Python
1
() sys.exit(0) else: rpc = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) try: ...
Rust
0
padding we have, and what padding we don't. * We don't pad here, but rather tell the filter_block call what it * needs to do, then let it handle the specifics (following dav1d's * lead). We make one assumption that's not obvious: Because the * cdef clipping area is rounded up to an even 8x8 luma block, we...
Rust
0
import cv2 from ultralytics import YOLO import numpy as np from collections import deque import os # YOLO 모델 로드 model = YOLO(r"D:\yolo11l-obb.pt") names = {9: "large vehicle", 10: "small vehicle"} # 입력 비디오 파일 설정 input_video_path = r"C:\Users\dromii\20240401-송도\M3C\300m\DJI_0082.MP4" cap = cv2.VideoCapture(input_video...
Python
1
mt("" src/alloc-override-win.c:462:89) • ImplicitCastExpr!("" src/alloc-override-win.c:462:96) +Bool<"_Bool"> • IntegerLiteral("" src/alloc-override-win.c:462:96) +Int<"int"> • IfStmt("" src/alloc-override-win.c:463:3) • BinaryOperator("" src/alloc-override-win.c:463:7)...
Rust
0
""" API Models """ from typing import List, Literal from pydantic import BaseModel class Geometry(BaseModel): """Geometry type for OSRM route""" type: Literal["LineString"] coordinates: List[List[float]] # [[lon, lat], ...] class Route(BaseModel): """Route mapped by OSRM""" distance: float ...
Python
1
from datetime import date, datetime, time from itertools import zip_longest from django.test import SimpleTestCase from corehq.util.test_utils import make_make_path from corehq.util.workbook_reading import Workbook, Worksheet, make_worksheet from corehq.util.workbook_reading.tests.utils import ( get_file, run...
Python
1
_id': I.id, 'vdi_type': 1, 'port': I.vdi_port } d['host'] = I.node.ip if I.node else '' self.write_success( **d ) class MyInstanceList(ApiRequestHandler): @authenticated def post(self): page_size = self.get_argument_int('sepa', 50) cur_page = sel...
Python
1
import os class NodeGroups(object): def __init__(self): if os.path.isfile('/etc/salt/master.d/nodegroups.conf') == True: print "" else: nodegroups = file("/etc/salt/master.d/nodegroups.conf","w+") add = ["nodegroups:\n"] nodegroups.writelines(add) ...
Python
1
sign_command_base + [fpath] subprocess.check_call(sign_command) @cli.command() @click.option('--clean', is_flag=True) @click.option('--static', is_flag=True) @click.option('--shared', is_flag=True) @click.option('--skip_formatter', is_flag=True) @click.option('--just_release', is_flag=True) def libs(clea...
Python
1
"""Functions for computing the Voronoi cells of a graph.""" import networkx as nx from networkx.utils import groups __all__ = ["voronoi_cells"] @nx._dispatch(edge_attrs="weight") def voronoi_cells(G, center_nodes, weight="weight"): """Returns the Voronoi cells centered at `center_nodes` with respect to the s...
Python
1
from typing import Any from torch import fx class TensorProp(fx.Interpreter): """ This is basically a variant of shape prop in https://github.com/pytorch/pytorch/blob/74849d9188de30d93f7c523d4eeceeef044147a9/torch/fx/passes/shape_prop.py#L65. Instead of propagating just the shape, we record all the i...
Python
1
# coding: utf-8 """ Copyright 2018 OSIsoft, 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 agreed t...
Python
1
config: Default::default(), capabilities: Capabilities { serve_headers: true, serve_chain_since: None, serve_state_since: None, tx_relay: true, }, sample_store: None, }; let proto = LightProtocol::new(chain.clone(), params); Peer { proto: proto, queue: RwLock::new(VecDeque::new...
Rust
0
} impl<'de> Deserialize<'de> for ParsedApiError { fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer<'de>, { let value = Map::deserialize(deserializer)?; Ok(value.into()) } } impl From<Map<String, Value>> for ParsedApiError { fn from(mut va...
Rust
0
""" 文件名: test/test_BertCLS.py 创建时间: 2023/2/28 8:59 上午 """ import sys sys.path.append("../") from utils import logger_init from model import BertConfig from model import BertModel from transformers import BertTokenizer import os import torch import logging # class ModelConfig: def __init__(self): self....
Python
1
] x_accepted = x[sort_idx][:num_top_samples] else: raise ValueError("One of epsilon or quantile has to be passed.") # Maybe adjust theta with LRA. if lra: self.logger.info("Running Linear regression adjustment.") final_theta = super()._run_lra( ...
Python
1
nemonic): '''saves key to disk, sets global KEY variable''' # FIXME: make sure secrets are never overwritten with different keys global KEY password = '' derivation_path = b'm' KEY = HDPrivateKey.from_mnemonic(mnemonic, password, path=derivation_path, testnet=True) with open('/sd/key.txt', '...
Python
1
print("🔌 Connecting to OpenSearch...") if not initialize_opensearch(): print("❌ Failed to connect to OpenSearch") print(" Make sure OpenSearch is running on localhost:9200") return print("✅ OpenSearch connected successfully") print("🤖 Gemini 2.0 Flash configured") print...
Python
1
, 'bgn': 'موهاکی', 'bn': 'মোহাওক', 'br': 'mohawk', 'brx': 'महाउक', 'bs': 'mohavk', 'bs-Cyrl': 'махавски', 'bs-Latn': 'mohavk', 'ca': 'mohawk', 'ca-ES-valencia': 'mohawk', 'ccp': '𑄟𑄮𑄦𑄃𑄮𑄇𑄴', 'ce': 'мохаук', 'chr': 'ᎼᎭᎩ', 'ckb': 'مۆهاوک', 'cs': 'mohawkština', 'cy': 'Mohoceg', 'da': 'mohawk', 'de': 'Mohawk', 'dsb': ...
Python
1
ontrol_socket_dir, WIFI_INTERFACE)) else: control_socket_not_exists = True dev_socket_exists = os.path.exists('/dev/socket/wpa_%s' % WIFI_INTERFACE) if dev_socket_exists and control_socket_not_exists: return WIFI_INTERFACE # any valid dir will cause wpa_cli fail return control_socket_dir...
Python
1
", "c"]), ("a\\\nb\\\nc", &["abc"]), ("foo bar baz", &["foo", "bar", "baz"]), (r#"\🦉"#, &[r"🦉"]), ]); } #[test] fn split_trailing_backslash() { split_ok(&[("\\", &["\\"]), (" \\", &["\\"]), ("a\\", &["a\\"])]); } #[test] fn split_errors() {...
Rust
0
""" Image processing utilities """ from PIL import Image import io from rembg import remove class ImageProcessor: """Handles basic image processing operations""" @staticmethod def remove_background(image_bytes, session): """ Remove background from image using rembg A...
Python
1
ded{ Ok(data) => { let mut buffer = JsBuffer::new(&mut cx, data.len() as u32).unwrap(); cx.borrow_mut(&mut buffer, |buf_data| { buf_data.as_mut_slice().copy_from_slice(&data); }); vec![ cx.string("ok").upcast::<JsValue>(), buffer.upcast...
Rust
0
import pytest from .sim_qdac2_fixtures import qdac # noqa def test_various_operations_have_common_functions(qdac): # noqa operations = [ qdac.ch01.square_wave(), qdac.ch02.sine_wave(), qdac.ch03.triangle_wave(), qdac.ch04.dc_sweep(start_V=-1, stop_V=1, points=11), qdac.ch...
Python
1
Slice(a!(a), a!(i), a!(l)), ExprKind::Proj(a, i) => ExprKind::Proj(a!(a), *i), ExprKind::UpdateIndex(a, i, v) => ExprKind::UpdateIndex(a!(a), a!(i), a!(v)), ExprKind::UpdateSlice(a, i, l, v) => ExprKind::UpdateSlice(a!(a), a!(i), a!(l), a!(v)), ExprKind::UpdateProj(a, i, v) => ExprKind::UpdatePr...
Rust
0
import unittest from unittest.mock import MagicMock, patch from sweepai.agents.complete_code import ExtractLeftoverComments class TestExtractLeftoverCommentsExtractLeftoverComments(unittest.TestCase): @patch("sweepai.agents.complete_code.check_comments_presence") @patch("sweepai.agents.complete_code.ExtractL...
Python
1
) -> Result<V::Value, Self::Error> where V: Visitor<'de>, { if self.items.len() < len { Err(ValueError::custom( format!( "wrong number of parameters: {} expected {}", self.items.len(), len ) ...
Rust
0
data = vec![Some(true), None, Some(false)]; let array = BooleanArray::from_iter(data); assert_eq!(array.value(0), true); assert_eq!(array.value(1), false); assert_eq!(array.value(2), false); assert_eq!(array.values(), &Bitmap::from((&[0b00000001], 3))); assert_eq!(arra...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2022 Google LLC. 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 requir...
Python
1
to clone keypair let b = self.key.pubkey(); let rpc_url = self.rpc_url.clone(); // we need to spawn an extra thread because tokio does not allow nested runtimes std::thread::spawn(move || { let rpc = RpcClient::new(rpc_url); let balance = match rpc.get_balance(...
Rust
0
um_deriv_llzz = ( coords.Rz_to_lambdanu(R, z + dz, ac=ac, Delta=Delta)[0] - 2.0 * coords.Rz_to_lambdanu(R, z, ac=ac, Delta=Delta)[0] + coords.Rz_to_lambdanu(R, z - dz, ac=ac, Delta=Delta)[0] ) / dz**2.0 num_deriv_nnzz = ( coords.Rz_to_lambdanu(R, z + dz, ac=ac, Delta=Delta)[1] ...
Python
1
{ 'name': 'Romania - E-Transport Batch Pickings', 'version': '1.0', 'category': 'Accounting/Localizations/EDI', 'description': """ E-Transport implementation for Batch Pickings in Romania """, 'depends': ['l10n_ro_edi_stock', 'stock_picking_batch'], 'auto_install': True, 'data': [ ...
Python
1
th_list.append(depth) is_wave_list.append(is_wave) max_temp_list.append(max_temp) d_targets = { 'boxes': boxes_to_consider, 'centers': centers_to_consider, 'is_wave': is_wave_list, 'max_temp': max_temp_list, 'depth': depth_list } # depth - contro...
Python
1
. FailedToReadMaps, /// Failed to a parse line from the `/proc/self/maps` file. /// Captures line that failed to parse. ParseMapEntryError(String), /// No `[vdso]` segment found in `/proc/self/maps`. VdsoSegmentNotFound, /// Failed to parse bytes as ELF file. FailedToParseAsElf, /// ...
Rust
0
_integers::*; /// A `FieldElement64` represents an element of the field /// \\( \mathbb Z / (2\^{255} - 19)\\). /// /// In the 64-bit implementation, a `FieldElement` is represented in /// radix \\(2\^{51}\\) as five `u64`s; the coefficients are allowed to /// grow up to \\(2\^{54}\\) between reductions modulo \\(p\\)...
Rust
0
th pd.ExcelWriter(output_path) as writer: PVSystem_hourly_series_angra = pd.DataFrame(PVSystem_hourly_series_angra) PVSystem_hourly_series_buzios = pd.DataFrame(PVSystem_hourly_series_buzios) PVSystem_hourly_series_iguaba = pd.DataFrame(PVSystem_hourly_series_iguaba) PVSystem_hourly_ser...
Python
1
r requests on a /// port and wrapping the calls pub fn foreign_listener<T: ?Sized, C, K>( wallet: Arc<Mutex<T>>, addr: &str, tls_config: Option<TLSConfig>, relay_rx_as_payee: Option<Receiver<(String, Slate)>>, grinrelay_listener: Option<Box<dyn Listener>>, grinrelay_key_path: Option<u64>, account: &str, ) -> Res...
Rust
0
_str(Everything_GetResultPathW(i)).to_string_lossy(); println!("{} {}", path, filename); } } } } pub fn main() { search("notepad*") } <reponame>dlunch/FFXIVTools use alloc::vec::Vec; use core::mem::size_of; use sqpack::{Package, Result}; use util::{cast, cast_array}; #[rep...
Rust
0
from rest_framework import serializers from .models import CalendarEvent class CalendarSerializer(serializers.ModelSerializer): class Meta: model = CalendarEvent fields = ('id','title', 'date', 'isFinished')
Python
1
recovery::{nested_delimiters, skip_then_retry_until, skip_until}, recursive::{recursive, Recursive}, select, span::Span as _, text, text::TextParser as _, BoxedParser, Parser, }; } // TODO: Replace with `std::ops::ControlFlow` when stable enum ControlFlow<C, B> ...
Rust
0
"); include!("types/br_rsa_public.rs"); include!("types/br_sha256_context.rs"); include!("types/br_sha512_context.rs"); include!("types/br_ssl_client_certificate_class.rs"); include!("types/br_ssl_client_context.rs"); include!("types/br_ssl_server_context.rs"); include!("types/br_ssl_server_policy_class.rs"); include!(...
Rust
0
# Copyright (C) 2018-2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # # share_data paddle model generator # import numpy as np import sys from save_model import saveModel def share_data(name : str, x, axis=None, keepdim=False): import paddle paddle.enable_static() with paddle.static.progr...
Python
1
pool_with_transactions(n: usize) -> (Mempool, Vec<Transaction>) { let mempool = Mempool::new(Default::default(), Arc::new(MockValidator::new(true))); let transactions = create_transactions(n); for txn in &transactions { mempool.insert(Arc::new(txn.clone())).unwrap(); } (mempool, transactio...
Rust
0
len() == *pep_length && peptide.protein() == protein { let binding_rank = binding_info.rank(); if binding_rank < weak_threshold { n_weak_bound += 1; } if binding_rank < strong_threshold { ...
Rust
0
о&cjk=真正&private=%F4%8F%BF%BD" ); } #[test] fn iri_encode_query() { let encoder = IriReserved::Query; let pct_string = PctString::encode( "?test=традиционное польское блюдо&cjk=真正&private=\u{10FFFD}".chars(), encoder, ); assert_eq!( &pct_string, &"?test=традиционное польское блюдо&cjk=真正&priva...
Rust
0
rage and unlock the fund if bounded_schedules.len().is_zero() { <VestingSchedules<T>>::remove(who, asset); T::Currency::remove_lock(VESTING_LOCK_ID, asset, who)?; return Ok(()) } let total_amount = bounded_schedules.iter().try_fold::<_, _, Result<BalanceOf<T>, DispatchError>>( Zero::zero(), |...
Rust
0
(-z,-x,y), (-z,x,-y), (y,z,x), (-y,z,-x), (y,-z,-x), (-y,-z,x), (y+1/2,x+1/2,z+1/2), (-y+1/2,-x+1/2,z+1/2), (y+1/2,-x+1/2,-z+1/2), (-y+1/2,x+1/2,-z+1/2), (x+1/2,z+1/2,y+1/2), (-x+1/2,z+1/2,-y+1/2), (-x+1/2,-z+1/2,y+1/2), (x+1/2,-z+1/2,-y+1/2), (z+1/2,y+1/2,x+1/2), (z+1/2,-y+1/2,-x+1/2), ...
Rust
0
lude::*; use super::tags::Tag; use super::query::Query; use super::file::TaggedFile; use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] /// Representation of the Tag-Database at runtime. pub struct DB { file : String, db : HashMap<String, TaggedFile>, } impl DB { ...
Rust
0
*/ Some((Instruction::RTI, AddressingMode::Implied)), /*0x41*/ Some((Instruction::EOR, AddressingMode::IndexedIndirectX)), /*0x42*/ None, /*0x43*/ None, /*0x44*/ None, /*0x45*/ Some((Instruction::EOR, AddressingMode::ZeroPage)), /*0x46*/ Some((Instruction::LSR, Addres...
Rust
0
Op claimClaimableBalanceOp; // case BEGIN_SPONSORING_FUTURE_RESERVES: // BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; // case END_SPONSORING_FUTURE_RESERVES: // void; // case REVOKE_SPONSORSHIP: // RevokeSponsorshipOp revokeSponsorshipOp; // ...
Rust
0
let mut explore_queue = MinHeap::new(); let mut distance_map: HashMap<(usize, usize), u32> = HashMap::new(); let mut smallest: u32 = u32::MAX; distance_map.insert(start, 0); explore_queue.push(start, 0); while !explore_queue.is_empty() { let (current_pos, _) = explore_queue.pop().unwrap(...
Rust
0
TryFromPrimitive, Clone, Copy)] #[repr(u8)] pub enum Opcode { Brk = 0x00, OraIndX = 0x01, OraZp = 0x05, AslZp = 0x06, Php = 0x08, OraImm = 0x09, AslAcc = 0x0a, OraAbs = 0x0d, AslAbs = 0x0e, Bpl = 0x10, OraIndY = 0x11, OraZpX = 0x15, AslZpX = 0x16, Clc = 0x18, ...
Rust
0
quest::precondition_well_formed(request_line, &request_line_items)?; let method = request_line_items[0]; let uri = request_line_items[1]; let version = request_line_items[2]; HttpConnectRequest::check_method(method)?; HttpConnectRequest::check_version(version)?; Ok((me...
Rust
0
syntax_pos; extern crate rustc_plugin; /// Prelude for compiler plugin. pub mod prelude; /// Builders. pub mod builder; /// Compiler plugin utils. pub mod utils; //! Pure Rust implementation of //! [BIP-0032: Hierarchical Deterministic Wallets][bip32]. //! //! [bip32]: https://github.com/bitcoin/bips/blob/master/bip-0...
Rust
0
enum TraversalEvent { /// Entering traversal of an AST node. /// /// Processing an AST node upon this event corresponds to a pre-order /// DFS traversal. Enter, /// Exiting traversal of an AST node. /// /// Processing an AST node upon this event corresponds to a post-order DFS /// ...
Rust
0
st.markdown(f""" <div class='profile-container'> <div class='profile-photo'></div> <h1 style='font-size: 1.8rem; margin-bottom: 0.5rem; font-weight: 700;'> Abdolamir Karbalaie </h1> <div style='margin-bottom: 1.5rem;'> <span class='skill-tag'>AI Engineer<...
Python
1
} impl<B: Backend> StdIoBackend<B> { /// Creates a new `StdIoBackend` based on `inner` object. /// /// # Arguments /// * `inner` - The block device backend. /// * `features` - The features that were negotiated between driver and device. pub fn new(mut inner: B, features: u64) -> Result<Self> {...
Rust
0
rsor.fetchall()] if not collection_ids or not post_ids: print("No collections or posts available to associate.") return try: for collection_id in collection_ids: # Randomly assign posts to the collection assigned_posts = random.sample...
Python
1
testinput = """190: 10 19 3267: 81 40 27 83: 17 5 156: 15 6 7290: 6 8 6 15 161011: 16 10 13 192: 17 8 14 21037: 9 7 18 13 292: 11 6 16 20""" def get_input(test=False): answers = [] operands = [] if test: inputlines = testinput.split("\n") else: inputlines = open("input.txt", "r").read...
Python
1
biquadratic; pub use self::analytical::quartic_depressed::find_roots_quartic_depressed; pub use self::analytical::quartic::find_roots_quartic; pub use self::numerical::Convergency; pub use self::numerical::simple_convergency::SimpleConvergency; pub use self::numerical::debug_convergency::DebugConvergency; pub use sel...
Rust
0
# 나의 풀이 # 시간 초과 코드 def solution(X, Y): ans = [] max_ans = "" Y = list(Y) for c in X: if c in Y: ans.append(c) Y.remove(c) ans = list(map(int, ans)) if not ans: return "-1" while ans: max_ans += str(max(ans)) ans.remove...
Python
1
mut res = winres::WindowsResource::new(); res.set_icon("data/icon/pich8.ico"); res.compile().expect("compiling windows resource failed"); } #[cfg(not(windows))] fn main() {} <reponame>edin-m/rs-google-photos-sync<gh_stars>0 use crate::util; use crate::error::CustomResult; #[derive(Deserialize, Debug)] pub st...
Rust
0
xplicit = 0x63, DW_AT_object_pointer = 0x64, DW_AT_endianity = 0x65, DW_AT_elemental = 0x66, DW_AT_pure = 0x67, DW_AT_recursive = 0x68, DW_AT_signature = 0x69, DW_AT_main_subprogram = 0x6a, DW_AT_data_bit_offset = 0x6b, DW_AT_const_expr = 0x6c, DW_AT_enum_class = 0x6d, DW_AT_...
Rust
0
artition from FederatedDataset.""" batch["img"] = [test_data_transform(img) for img in batch["img"]] if use_fine_label: batch["label"] = batch["fine_label"] return batch # pylint: disable=E1101 def client_fn(cid: str) -> Client: """Create a Flower client representing...
Python
1
_string, path::PathBuf}; pub struct AssetPipelineInput<T> { pub source: PathBuf, pub destination: PathBuf, pub params: T, } impl<T> AssetPipelineInput<T> { pub fn consume() -> Self where T: for<'de> Deserialize<'de>, { let mut args = std::env::args(); args.next(); ...
Rust
0
end length ({route['dead_end_length']:.2f}m) exceeds maximum (15m)") violations['nighttime'].append(f"Dead-end length ({route['dead_end_length']:.2f}m) exceeds maximum (15m)") # Check stairway distance (if available) if 'stairway_distance' in route: if route['stairway_distance'] < 10: ...
Python
1
Convex, 7 => Type::Concave, 8 => Type::Heightmap, _ => return Err(TypeError::InvalidType), }) } } pub struct Shape { r#type: Type, shape: SharedShape, index: Option<ShapeIndex>, } #[derive(Debug)] enum ShapeError { InvalidData, IncompleteTriangle, ConvexNotManifold, } impl Shape { fn new(r#type: T...
Rust
0
\x08\ \x0f\n\x84\x01\n\x04\x04\0\x02\0\x12\x03\x1f\x02\x19\x1aw\x20The\x20serv\ ice\x20control\x20environment\x20to\x20use.\x20If\x20empty,\x20no\x20con\ trol\x20plane\n\x20feature\x20(like\x20quota\x20and\x20billing)\x20will\ \x20be\x20enabled.\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x1f\x02\x08\n\ \...
Rust
0
d07eaea459410a2cafb234")), // AccountId::from(hex_literal::hex!("<KEY>")), // AccountId::from(hex_literal::hex!("64b7e29dbcff4ac1ed3bee06c0307560b9b9eb628c514f14fd9126abe35e7f1f")), // AccountId::from(hex_literal::hex!("<KEY>")), // AccountId::from(hex_literal::hex!("7c7ee24ed2e33cd44c4550883b8828ef9ef87f2a...
Rust
0
address: 7860, size: 5024, }, ], } ) } } // Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 //! This module lays out the basic abstract costing schedule for bytecode instruction...
Rust
0
write data to. * @param p_j2k J2K codec. * @param p_manager the user event manager. */ unsafe extern "C" fn opj_j2k_write_regions( mut p_j2k: *mut opj_j2k_t, mut p_stream: *mut opj_stream_private, mut p_manager: *mut opj_event_mgr, ) -> OPJ_BOOL { let mut compno: O...
Rust
0
unk2 { index_mask &= !(1 << 7); } } let index_size = (index_mask.count_ones() + (!index_mask).count_ones() * header.index_entries) * std::mem::size_of::<u32>() as u32; let (header_area, rest) = dest.split_at_mut(96); let (index_area, file_area) = rest.split_at...
Rust
0
} pub fn send_to_owner<T: github::CommitLike>( &self, msg: &str, attachments: &Vec<SlackAttachment>, item_owner: &github::User, repo: &github::Repo, branch: &str, commits: &Vec<T>, ) { self.send_to_channel(msg, attachments, repo, branch, commi...
Rust
0
Lexical { comment: Span::DUMMY, ..lex.clone() }; assert_eq!(lex.instruction, relex.instruction); assert_eq!(lex.args.len(), relex.args.len()); for (a, b) in lex.args.i...
Rust
0
; for it in (_i . attrs).iter() { _visitor.visit_attribute(&it) }; _visitor.visit_foreign_item_kind(&_i . node); _visitor.visit_visibility(&_i . vis); // Skipped field _i . semi_token; } # [ cfg ( feature = "full" ) ] pub fn visit_foreign_item_fn<V: Visitor + ?Sized>(_visitor: &mut V, _i: &ForeignItemFn...
Rust
0
print("Ingresar los datos de la venta") cliente = input("Ingrese el nombre del cliente: ") precio1 = int(input("Ingrese el precio del producto1: ")) cantidad1 = int(input('La cantidad de "producto1": ')) precio2 = int(input("Ingrese el precio del producto2: ")) cantidad2 = int(input('La cantidad del "producto2": ')) pr...
Python
1
ut_multi_edges_removes_multiple_edges(self): multigraph = DecodingHyperMultiGraph([(0, 1), (0, 2), (0, 1)]) assert multigraph.with_multi_edges_merged().edges == [ DecodingHyperEdge({0, 1}), DecodingHyperEdge({0, 2}), ] def test_multigraph_without_multi_edges_preserve...
Python
1
# -*- 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
&self.cell_id.agent_pubkey() } /// Accessor for DnaHash pub fn dna_hash(&self) -> &DnaHash { &self.cell_id.dna_hash() } /// Get a SweetZome with the given name pub fn zome<Z: Into<ZomeName>>(&self, zome_name: Z) -> SweetZome { SweetZome::new(self.cell_id.clone(), zome_nam...
Rust
0
cx_err_t; } extern "C" { #[doc = " @brief Export a point."] #[doc = ""] #[doc = " @details Fill two distinct buffers with the x-coordinate and the y-coordinate"] #[doc = " of the point. If the point is not in affine representation, it will"] #[doc = " be normalized first."] ...
Rust
0