text
string
label_name
string
labels
int64
>2020/src/y2021/d22/mod.rs use crate::support::*; const EXAMPLE_1: &str = include_str!("example_1.txt"); const EXAMPLE_2: &str = include_str!("example_2.txt"); const EXAMPLE_3: &str = include_str!("example_3.txt"); const INPUT: &str = include_str!("input.txt"); fn parse(input: &str) -> Vec<(bool, Cuboid)> { let m...
Rust
0
me: PROVERIF_COMMAND = args.pname if args.timeout: JOB_TIMEOUT = args.timeout # Map tools to their command TOOL_TO_COMMAND = { SPTHY: TAMARIN_COMMAND, PROVERIF: PROVERIF_COMMAND, DEEPSEC: DEEPSEC_COMMAND } # Extract the list of lemmas lemmas = args.lemma if ...
Python
1
rpc_port); let rpc_pubsub_port = find_available_port_in_range((1024, 65535)).unwrap(); let rpc_pubsub_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), rpc_pubsub_port); let broadcast = UdpSocket::bind("0.0.0.0:0").unwrap(); let retransmit = UdpSocket::bind("0....
Rust
0
. P(x)) & (!y. Q(y)))".parse().unwrap(); assert_debug_string!("(! x. ~P(x)) | (? y. ~Q(y))", nnf(&formula)); } } #[test] fn nnf_free_vars() { { let nnf = fof!('|').nnf(); assert_eq!(Vec::<&Var>::new(), nnf.free_vars()); } { let...
Rust
0
nail_pos < len(nails) and nails[nail_pos][HIT_POS] <= plank[END_POS]: nail_count = min(nail_count, nails[nail_pos][NAIL_COUNT_ADDRESS]) if nail_count <= count: break nail_pos += 1 count = max(count, nail_count) return count + 1 # testcase...
Python
1
import pytest import sacrebleu EPSILON = 1e-3 # Example taken from #98 REF = "producţia de zahăr brut se exprimă în zahăr alb;" SYS = "Producția de zahăr primă va fi exprimată în ceea ce privește zahărul alb;" test_cases = [ # change smoothing ('exp', None, False, '13a', 8.493), ('none', None, False, '1...
Python
1
# Import core components from langgraph.prebuilt import create_react_agent from langgraph.store.memory import InMemoryStore from langmem import create_manage_memory_tool, create_search_memory_tool from dotenv import load_dotenv load_dotenv() # Set up storage store = InMemoryStore( index={ "dims": 1536,...
Python
1
"v1/password/breached", m.UserPasswordBreachedResult, data=input.dict(exclude_none=True) ) async def password_breached_bulk( self, hash_type: m.HashType, hash_prefixes: List[str], verbose: Optional[bool] = None, raw: Optional[bool] = True, provider:...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.QueryObArtifactListDTO import QueryObArtifactListDTO class AnttechOceanbaseObglobalArtifactlistQueryResponse(AlipayResponse): def __init__(self): super(A...
Python
1
ine which tensor product basis should be used for pce(full_tensor, total_degree)") parser.add_argument('--plot', default=False, action='store_true', help='plot functions (2d)') parser.add_argument('--verbose', default=False, action='store_true', help='verbosity') parser.add_argument('--out', default=False, ...
Python
1
.borrow().clone()), vec![10, 20, 30]); }); } #[test] fn prime_member_works() { new_test_ext().execute_with(|| { assert_noop!(Membership::set_prime(Origin::signed(4), 20), BadOrigin); assert_noop!(Membership::set_prime(Origin::signed(5), 15), Error::<Test, _>::NotMember); assert_ok!(Membership::set_prim...
Rust
0
from solution import * import pytest def test_count_letters(): assert count_letters(100) == 11 assert count_letters(342) == 23 assert count_letters(115) == 20 assert count_letters(1000) == 11 assert count_letters(342) == 23 assert count_letters(115) == 20 assert count_letters(123) == 20 ...
Python
1
import cv2 import csv import time from base_camera import BaseCamera from picamera2 import Picamera2, Preview from faceid_cv2 import face_capture, face_detection, face_recognition # from faceid import analysis """ Parameters radius The radius used for building the Circular Local Binary Pattern. The greater the radius,...
Python
1
Dict, weather_data: Dict, decision_data: Dict, effectiveness_score: float = 0.8): """Cache quyết định mới""" try: pattern = self.create_context_pattern(economic_data, weather_data) decision_id = f"{pattern}_{int(datetime.now().timestamp())}" ...
Python
1
rsing and interval extraction ========================================== */ type TargetIntervals = Vec<(String, Lapper<usize, String>)>; // Parse an optional FASTA file into a optional HashMap // with sequence name (key) and sequence record (value) fn parse_fasta( fasta: Option<PathBuf>, ) -> Result<Option<HashMa...
Rust
0
nstantGateOperation { #(#constant_gate_operations_quote),* } /// Enum of all Operations implementing [OperateSingleQubitGate] #[derive(Debug, Clone, PartialEq, InvolveQubits, Operate, OperateTryFromEnum, Substitute, OperateGate, OperateSingleQubit, OperateSingleQubitGate)] #...
Rust
0
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish...
Python
1
/ Used by rust_ap_entry to create a new stack static AP_FREE_STACK: AtomicU64 = AtomicU64::new(0); /// New stack pointer from `AP_FREE_STACK` and resets it back to zero. /// # Safety /// Must not be called without setting AP_FREE_STACK. #[inline] pub unsafe fn ap_take_stack() -> u64 { let value = AP_FREE_STACK.swa...
Rust
0
# https://www.acmicpc.net/problem/5618 # 공약수 # 문제 # 자연수 n개가 주어진다. 이 자연수의 공약수를 모두 구하는 프로그램을 작성하시오. # 입력 # 첫째 줄에 n이 주어진다. n은 2 또는 3이다. 둘째 줄에는 공약수를 구해야 하는 자연수 n개가 주어진다. 모든 자연수는 108 이하이다. # 출력 # 입력으로 주어진 n개 수의 공약수를 한 줄에 하나씩 증가하는 순서대로 출력한다. def gcd(a, b): """유클리드 호제법을 사용하여 최대공약수를 구하는 함수""" while b != 0: a...
Python
1
ec<TestBuildImage>>, pub builds_error: RefCell<HashMap<String, bool>>, } impl ContainerHelper for TestContainerHelper { fn list_image(&self, image_name: &str) -> Vec<String> { self.images .borrow() .iter() .filter(|i| *i == image_name) .map(|i| i.to_strin...
Rust
0
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] #[serde(rename_all = "snake_case")] pub enum UserFlag { /// User wants notification messages for reviews with approvals. NotifyReviewApprovals, /// User wants notification messages for review comments without approvals. NotifyR...
Rust
0
").unwrap()), eval_input_defaults: Some(serde_json::from_str("{\"eval\":\"test\"}").unwrap()), created_by: Some(String::from("<EMAIL>")), }; let test = TestData::create(conn, new_test).expect("Failed inserting test test"); let new_run = NewRun { test_id: tes...
Rust
0
32 { self.0[3] } } impl Debug for ColorF { fn fmt(&self, formatter: &mut Formatter) -> fmt::Result { write!( formatter, "rgba({}, {}, {}, {})", self.r() * 255.0, self.g() * 255.0, self.b() * 255.0, self.a() ) } ...
Rust
0
=> { write!(buf, "\\x{:02x}", c as u32).unwrap(); } c => buf.push(c), } } buf.push('"'); return buf; } use std::io; use std::os::unix::io::AsRawFd; use mio::unix::EventedFd; use socket2::{Domain, Protocol, Socket as RawSocket, Type, SockAddr}; #[derive(...
Rust
0
""" AUTOR: Juanjo FECHA DE CREACIÓN: 24/05/2019 """ from flask import Blueprint public_bp = Blueprint('public', __name__, template_folder='templates') from . import routes
Python
1
# Copyright (c) 2025 PaddlePaddle 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 appli...
Python
1
() }) ); } } use proc_macro2::{Punct, Spacing, TokenStream}; use quote::{ToTokens, TokenStreamExt as _}; // Inspired by syn's `Punctuated` type. /// Comma-separated list of items. #[derive(Clone)] pub struct Punctuated<T> { /// Vec of items and commas. pub inner: Vec<(T, Punct)>, /...
Rust
0
e_key.pem -pubout -outform PEM -out public_key.pem let keygen_output = Command::new("openssl") .arg("rsa") .args(&["-in", private_key_path.to_str().unwrap()]) .arg("-pubout") .args(&["-outform", "PEM"]) .args(&["-out", public_key_path.to_str().unwrap()]) .stdout(Stdio...
Rust
0
import json from .common import InfoExtractor from ..utils import ( float_or_none, int_or_none, parse_codecs, traverse_obj, urljoin, ) class StreamCZIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?:stream|televizeseznam)\.cz/[^?#]+/(?P<display_id>[^?#]+)-(?P<id>[0-9]+)' _TESTS = [{...
Python
1
.message.stopped() { info!( "we received an item as itself {} or stopped: we don't copy cat", item.reception.source_uuid ); } else { info!( "we start to schedule {} from {}", item.reception.message.mobile_id(), ...
Rust
0
.or_insert_with(|| value); }); caches::OPCODE_VALUE_TABLE.with(|f| { (*f.borrow_mut()) .entry(value) .and_modify(|mnemonic_old| { panic!( ...
Rust
0
ndamental: VarArgs) -> crate::GString { // unsafe { TODO: call ffi:g_markup_printf_escaped() } //} //#[doc(alias = "g_markup_vprintf_escaped")] //pub fn markup_vprintf_escaped(format: &str, args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> crate::GString { // unsafe { TODO: call ffi:g_markup_vprintf_e...
Rust
0
print("Screensaver complete - returning to system") supervisor.set_next_code_file("/lib/system/loader.py") supervisor.reload() except Exception as e: print(f"Screensaver mode error: {e}") # Return to system supervisor.set_next_code_file("/lib/system/loader.py") ...
Python
1
""" Module containing ArchitectSerializer class. This module provides a serializer for the Architect model, including nested serialization for the ArchimatchUser model. Classes: ArchitectSerializer: Serializer for the Architect model with nested ArchimatchUser. """ from rest_framework import serializers from a...
Python
1
#!/usr/bin/env python3 """ Test runner for agent discovery E2E tests Helps validate the comprehensive test suite Created: 2025-07-19 Purpose: Quick test execution for EP-0044 validation """ import sys import subprocess from pathlib import Path def run_tests(): """Run all agent discovery E2E tests""" test_dir...
Python
1
nfo { VkGeneratedCommandsInfo { pipeline_bind_point: RawVkPipelineBindPoint::vk_to_wrapped(&src.pipeline_bind_point), pipeline: RawVkPipeline::vk_to_wrapped(&src.pipeline), indirect_commands_layout: RawVkIndirectCommandsLayout::vk_to_wrapped(&src.indirect_commands_layout), ...
Rust
0
ext_surface, weapon_text_pos) screen.blit(ammo_text_surface, ammo_text_pos) if auto_firing: auto_fire_text = font1.render("Auto-Fire: ON", True, constants['YELLOW']) auto_fire_text_pos = (player_pos[0], player_pos[1] - -100) screen.blit(auto_fire_text, auto_...
Python
1
d: Vector2, ball_position: &mut Vector2, delta_time: f32) { ball_position.x += speed.x * delta_time; rect.set_x(ball_position.x as i32); ball_position.y += speed.y * delta_time; rect.set_y(ball_position.y as i32); } fn check_for_victory_conditions(player_lives: i32, brick_count: i32) -> bool { let ...
Rust
0
nearest_to_point(graph_editor, mouse_position); aligned_if_close_to_node(graph_editor, mouse_position, nearest_node) } /// Return a position for a newly created node. The position is calculated by taking the mouse /// position and aligning it to the source node (the node at the source of the [`edge_id`] edge) if /...
Rust
0
; pub const OP_RVC_OR: InstructionOpcode = 98; pub const OP_RVC_SD: InstructionOpcode = 99; pub const OP_RVC_SDSP: InstructionOpcode = 100; pub const OP_RVC_SLLI: InstructionOpcode = 101; pub const OP_RVC_SLLI64: InstructionOpcode = 102; pub const OP_RVC_SRAI: InstructionOpcode = 103; pub const OP_RVC_SRAI64: Instructi...
Rust
0
fig = create_comparison_figure(gt_img_np, est_img_np) plt.savefig(os.path.join(plot_dir, "rendered_vs_gt_" + str(idx) + ".png")) plt.close(fig) if save_predictions: if has_gt_depth: if monocular: # Align depth with groundtrut...
Python
1
pub async fn delete_indexer() -> Result<(), reqwest::Error> { let api_key = get_from_env(SEARCH_API_ADMIN_KEY); let indexer_name = get_from_env(INDEXER_NAME); let search_service = get_from_env(SEARCH_SERVICE); let url = get_resource_url(&search_service, &indexer_name); azure_rest::make_delete_requ...
Rust
0
fuzzerstate.memstorestate.init_store_locations(fuzzerstate.num_store_locations, fuzzerstate.memview) while True: # print('len(fuzzerstate.instr_objs_seq)', len(fuzzerstate.instr_objs_seq)) gen_basicblock(fuzzerstate) if fuzzerstate.next_bb_addr is None: # Th...
Python
1
let mut next_position: Option<NonNull<Node<T, V>>> = None; match direct_right { /// 因score本身较小,往右遍历找到比自己小的节点,在该节点左侧插入 true => { if *score > n.as_ref().score { return Some(InsertPosition::new(c...
Rust
0
import streamlit as st import pandas as pd from docx import Document def load_page_config(): st.set_page_config( page_title="EPSON EDUSYNC", page_icon="📚", layout="wide", initial_sidebar_state="expanded", ) with st.sidebar: st.subheader("Teacher") @st.cache_data def load_data(dat...
Python
1
if not line: initial_coord[1] -= line_height continue offsets[:, :2] *= 1.5 strokes = drawing.offsets_to_coords(offsets) strokes = drawing.denoise(strokes) strokes[:, :2] = drawing.align(strokes[:, :2]) strokes[:, 1] *= -1...
Python
1
/1.1 200 OK\r\n\ Content-Type: application/json; charset=iso-8859-4\r\n\ \r\n\ OK"; let resp = s.parse::<Response>().unwrap(); assert_eq!("iso-8859-4", resp.charset()); } #[test] fn charset_default() { let s = "HTTP/1.1 200 OK\r\n\ ...
Rust
0
import os import pandas as pd import re from datetime import datetime from matplotlib import pyplot as plt def get_probability(release_date: datetime, relative_date: datetime) -> pd.DataFrame | None: df = pd.read_csv(f'data/federal_funds/historical_probabilities_3/{release_date.strftime("%m_%d_%Y")}.csv', parse_da...
Python
1
import os from dotenv import load_dotenv load_dotenv(override=True) from src.open_deep_research.workflow.workflow import workflow from rag_agent import rag_agent from graphrag_agent import graphrag_agent from langgraph_supervisor import create_supervisor from langchain.chat_models import init_chat_model SUPERVISOR_PR...
Python
1
# -*- coding: utf-8 -*- """ website.vpn.dial.forms ~~~~~~~~~~~~~~~~~~~~~~ vpn forms: /vpn/dial/add /vpn/dial/settings /vpn/dial/<int:id>/settings """ from flask_wtf import Form from wtforms import StringField, SubmitField, TextAreaField, SelectField from wtforms import ValidationE...
Python
1
empt linked doctypes from being automatically cancelled # # auto_cancel_exempted_doctypes = ["Auto Repeat"] # Ignore links to specified DocTypes when deleting documents # ----------------------------------------------------------- # ignore_links_on_delete = ["Communication", "ToDo"] # Request Events # --------------...
Python
1
indicator = "green" msgprint( msg, indicator=indicator, title=title, is_minimizable=True, ) @frappe.whitelist() def get_employees(self, advanced_filters: list) -> list: from_date, to_date = self.get_from_to_date() if to_date and (from_date or self.dates_based_on == "Joining Date"): if all_em...
Python
1
) parser.add_argument( "--target-lang", action="store", dest="targetLang", default=None, help="target/definition language", ) parser.add_argument( "--name", action="store", dest="name", default=None, help="glossary name/title", ) # _______________________________ parser.add_argument( "--...
Python
1
, 'zh': '韩国', 'zh-Hans': '韩国', 'zh-Hant': '南韓', 'zu': 'i-South Korea'}, 'KW': {'af': 'Koeweit', 'agq': 'Kùwɛ̂', 'ak': 'Kuwete', 'am': 'ክዌት', 'ar': 'الكويت', 'as': 'কুৱেইট', 'asa': 'Kuwaiti', 'ast': 'Kuwait', 'az': 'Küveyt', 'az-Cyrl': 'Күвејт', 'az-Latn': 'Küveyt', 'bas': 'Kòwêt', 'be': 'Кувейт', 'be-tarask': 'Куве...
Python
1
id}_ctr.sock" def _spawn_cmd(self): ro = ",ro" if self.readonly else "" args = [ "crosvm", "--log-level", "off", "devices", "--disable-sandbox", "--control-socket", self.ctr_socket_path, "--block", ...
Python
1
1.0, stencil: 0, }, gfx::Color | gfx::Depth, &frame ); data.u_model_view_proj = cam::model_view_projection( model, first_person.camera(args.ext_dt).orthogo...
Rust
0
(' ', file=f) tikz_place_children(c,f) if len(n.parents) > 0: print('}', file=f) def tikz_place_edge(from_node, to_node, label,control_string = ''): #\path[->] (S3) edge [bend left] node {a} (S1); return r'\path[->] ('+from_node+') edge ['+control_string+'] node {'+label+'} ('...
Python
1
e>](&root); [<bench_double_linear_histogram_ $array_size>](&root); [<bench_int_exponential_histogram_ $array_size>](&root); [<bench_uint_exponential_histogram_ $array_size>](&root); [<bench_double_exponential_histogram_ $array_size>](&root...
Rust
0
firebird",), )?; let val_exists: Option<(i16,)> = conn.query_first( "select 1 from pstrings where ref = 'a' and a = 'firebird'", (), )?; assert!(val_exists.is_some()); conn.execute( "insert into pstrings (ref, b) values ('b', ?)", ...
Rust
0
run() { let result = puzzle1(INPUT_FILE.to_string()); println!("D12P1: {}", result); let result = puzzle2(INPUT_FILE.to_string()); println!("D12P2: {}", result); } #[cfg(test)] mod tests { static TEST_INPUT_FILE_1: &str = "inputs/day12_test_1.txt"; static TEST_INPUT_FILE_2: &str = "inputs/day1...
Rust
0
dules identified</li> # <li>Continue routine health check-ups</li> # <li>Maintain regular screening schedule</li> # <li>Report any new symptoms to your healthcare provider</li> # <ul> # </div> # "...
Python
1
import heapq def a_star(): # Define the adjacency matrix as a dictionary of dictionaries, where the keys are the city names and the values are dictionaries representing the connections to other cities adjacency_matrix = { 'Q': {'D': 1}, 'O': {'F': 1}, 'P': {'D': 1, 'E': 1, 'F': 1, 'G'...
Python
1
to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn set_onchange(this: &ImageTrack, value: Option<&::js_sys::Function>); #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js...
Rust
0
= event.pattern_match.group(1) reply_to_id = event.message if event.reply_to_msg_id: reply_to_id = await event.get_reply_message() if not text: if event.is_reply: if not reply_to_id.media: text = reply_to_id.message else: await eor(eve...
Python
1
elf, format: StreamVolumeFormat, val: f64) { unsafe { ffi::gst_stream_volume_set_volume( self.as_ref().to_glib_none().0, format.into_glib(), val, ); } } fn connect_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f:...
Rust
0
e fifo. const FIFO_OVERFLOW_INT = 1 << 4; /// FSYNC interrupt occured const FSYNC_INT = 1 << 3; /// Sensor Register Raw Data sensors are updated and Ready to be /// read. The timing of the interrupt can vary depending on the setting in /// ...
Rust
0
ith_trait_2() { trait A { fn clone(&self) -> Self; } impl A for u8 { fn clone(&self) -> u8 { self + 100 } } #[derive(Educe)] #[educe(Clone)] enum Enum { Struct { #[educe(Clone(trait("A")))] f1: u8, }, Tuple...
Rust
0
from typing import Optional from pydantic import BaseModel, EmailStr class UserCreate(BaseModel): fullname: str email: EmailStr password: str class Config: schema_extra = { "example": { "fullname": "John Doe", "email": "johndoe@example.com", ...
Python
1
aspect_ratio( self.to_glib_none().0, &mut par_n, &mut par_d, ); (par_n as i32, par_d as i32).into() } } } <reponame>leElvyn/feather //! Query for all entities with a certain set of components. use std::{ marker::PhantomData, me...
Rust
0
''' This is an AI program focusing on NLP: Speech-to-text and speaker diarization ''' from audio_record import record_audio from extract_audio_segment import extract_audio_segment from speaker_diarization import speaker_diarization import whisper def transcribe_audio(audio_file): """ This function transcribe...
Python
1
str1.to_owned() } else { str0 }; if str.trim().is_empty() { continue; } vs.push(str); } Err(err) => { println!("{}", err); } } ...
Rust
0
const AWD3: u32 = 1 << 9; /// Analog watchdog 2 pub const AWD2: u32 = 1 << 8; /// Analog watchdog 1 pub const AWD1: u32 = 1 << 7; /// Overrun pub const OVR: u32 = 1 << 4; /// End of conversion sequence pub const EOS: u32 = 1 << 3; /// End of conversion pub const EOC: u32 = 1 << ...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. 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...
Python
1
names. if ( origin_host and origin_host.lower() != secure_host.lower() and secure_host != "*" ): continue else: # We have a valid address and network, so see if the address ...
Python
1
ompute activation encodings (weight encodings are frozen) sim.compute_encodings(onnx_data) # End of step 2 # Step 3 # Evaluate the adarounded model correct_predictions = 0 total_samples = 0 for inputs, labels in tqdm(dataloader): inputs, labels = inputs.numpy(), labels.numpy() input_name = sim.session.get_inpu...
Python
1
s >> 8) & 0x0f) as u8) } #[doc = "Bits 16:19 - Frame Size"] #[inline(always)] pub fn frame(&self) -> FRAME_R { FRAME_R::new(((self.bits >> 16) & 0x0f) as u8) } } <gh_stars>1000+ // from rfc2005 test suite #![feature(let_else)] // Verify the binding mode shifts - only when no `&` are auto-d...
Rust
0
ableFfiRef::Borrowed(unsafe { borrowed.as_mut() }.unwrap(), Rc::clone(&self.1)) } else { CoapLendableFfiRef::Owned(RefCell::borrow(&self.0)) } } /// Create a raw pointer to this cell, suitable for storage in a libcoap application data /// pointer. /// /// Internally, thi...
Rust
0
et_unknown_fields(&self) -> &::protobuf::UnknownFields { &self.unknown_fields } fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { &mut self.unknown_fields } fn type_id(&self) -> ::std::any::TypeId { ::std::any::TypeId::of::<StatsAttributes>() } fn as...
Rust
0
; } /* * * Finds the execution function related to the given box id. * * @param p_id the id of the handler to fetch. * * @return the given handler or NULL if it could not be found. */ unsafe extern "C" fn opj_jp2_find_handler(mut p_id: OPJ_UINT32) -> *const opj_jp2_header_handler_t { let mut i: OPJ_UINT32...
Rust
0
parts = parts self._distinct = distinct self._is_repeatable = is_repeatable def _element_constructor_(self, vecpar): """ Construct an element of ``self``. EXAMPLES:: sage: VP = VectorPartitions([2, 2]) sage: elt = VP([[1, 0], [1, 2]]); elt ...
Python
1
# devgagan # Note if you are trying to deploy on vps then directly fill values in ("") from os import getenv # VPS --- FILL COOKIES 🍪 in """ ... """ INST_COOKIES = """ # wtite up here insta cookies """ YTUB_COOKIES = """ # write here yt cookies """ API_ID = int(getenv("API_ID", "28748671")) API_HASH = getenv("AP...
Python
1
Fbas::from_json_str( r#"[ { "publicKey": "n0", "quorumSet": { "threshold": 2, "validators": ["n0", "n1"] } }, { "publicKey": "n1", "quorumSet": { "threshold": 2, "validators": ["n0", "n1"] } }, ...
Rust
0
inputHash = 'input-abc'; document.body.insertAdjacentHTML('beforeend', '<div data-djc-id-c12345> abc </div>'); manager.registerComponent(compName, (data, ctx) => { return Promise.resolve(123); }); // Should raise Error manager.callComponent(...
Python
1
.map_err(VcxError::from) } pub async fn libindy_build_get_revoc_reg_def_request(submitter_did: &str, rev_reg_id: &str) -> VcxResult<String> { ledger::build_get_revoc_reg_def_request(Some(submitter_did), rev_reg_id) .await .map_err(VcxError::from) } pub async fn libindy_parse_get_revoc_reg_de...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ JQ-QMT 项目初始化脚本 此脚本将引导您完成项目的初始化配置,包括: 1. 生成 config.py 配置文件 2. 生成 RSA 密钥对 3. 生成 jq_config.py 配置文件 4. 配置 API_URL """ import os import sys import subprocess import shutil from pathlib import Path # from urllib.parse import URL class ProjectInitializer: def __init__...
Python
1
from openai import OpenAI import logging logging.basicConfig(filename='log_llama.log', level=logging.INFO, encoding='UTF-8', format='%(asctime)s - %(levelname)s - %(message)s') def request_to_lamma(dialog_history, start_prompt=None, is_initiation=True): # Подключение к локально запущенному OpenAI API client...
Python
1
from dataclasses import dataclass from typing import Optional from chromadb.api.types import Embeddings, IDs, Include, IncludeEnum from chromadb.types import Collection, RequestVersionContext, Segment, Where, WhereDocument @dataclass class Scan: collection: Collection knn: Segment metadata: Segment r...
Python
1
u32; } /// Floating input (type state) indicating that a pin is floating pub struct Floating; impl PullMode for Floating { #[inline] fn modify_pupdr_bits(original: u32, offset: u32) -> u32 { original & !(0b11 << offset) } } /// Pulled down input (type state) indicating that the pin is configured ...
Rust
0
import random from scipy.io import loadmat import numpy as np from src.Configuration_01 import DIRECTORY_PREFIX def find_index(a, x): # 在数组a中寻找x for i in range(np.size(a, 0)): if a[i][0] == x[0]: # print(i) return i def cal_distance(node, centor): # 计算欧式距离 node = np.array(n...
Python
1
_runtime_us, runtime: i64, 500 * 1000 ); gen_getter!( cpu, "the length of period for realtime tasks (in microseconds)", rt_period_us: link, u64, parse ); gen_setter!( cpu, "the length of period for realtime tasks (in microseconds)"...
Rust
0
g when the function |make_string| is called. //! This function returns the identification number of the new string as its //! value. // // @p function make_string : str_number; {current string enters the pool} /// current string enters the pool pub(crate) fn make_string(globals: TeXGlobalsStringView<'_>) -> str_number ...
Rust
0
import os import stat import mock from uaclient import system from uaclient.files import MachineTokenFile, UAFile class TestUAFile: def test_read_write(self, tmpdir): file_name = "temp_file" file = UAFile(file_name, tmpdir.strpath, False) content = "dummy file words" file.write(c...
Python
1
allowed per' ' container instance. Leave concurrency unspecified to receive the' ' server default value. Only applicable when the `--gen2` flag is' ' provided.' ), ) def AddUpgradeFlags(parser): """Adds upgrade related function flags.""" upgrade_group = parser.add_group(mute...
Python
1
import os from glob import glob from setuptools import find_packages, setup package_name = 'shikanoko_markov_statemachine' data_files = [] data_files.append( ("share/ament_index/resource_index/packages", ["resource/" + package_name]) ) data_files.append(("share/" + package_name, ["package.xml"])) def package_fi...
Python
1
"""Escribe un programa que pida el precio de un producto y, si supera los 100€, aplique un descuento del 10%. Muestra el precio final.""" precio = int(input("Introduce el precio: ")) if precio > 100: precio *= 0.9 print(f"Precio final: {precio}") else: print(f"Precio final: {precio}")
Python
1
) -> DynamicState { St::STATE } #[inline] fn raw(&self) -> Vec3 { self.raw } } */ macro_rules! impl_op_color { ($op:ident, $op_func:ident) => { impl<Spc: LinearColorSpace, St> $op for Color<Spc, St> { type Output = Color<Spc, St>; fn $op_func(self, r...
Rust
0
.replace("as!", "əz̥!"); let str483 = &str482.replace("as-", "əz̥-"); let str484 = &str483.replace("as)", "əz̥)"); let str485 = &str484.replace("as:", "əz̥:"); let str486 = &str485.replace("ped ", "p̚t "); let str487 = &str486.replace("ped.", "p̚t."); let str488 = &str487.replace("ped,", "p̚t,"); l...
Rust
0
_string (), } } } <gh_stars>1-10 use std::error::Error; fn build_shader(path_to_create: &str) -> Result<(), Box<dyn Error>> { spirv_builder::SpirvBuilder::new(path_to_create, "spirv-unknown-vulkan1.1").build()?; Ok(()) } fn main() -> Result<(), Box<dyn Error>> { build_shader("../shaders/mesh_shader")?...
Rust
0
096) if reduceOnly: flags = self.sum(flags, 1024) if flags != 0: request['flags'] = flags if clientOrderId is not None: request['cid'] = clientOrderId leverage = self.safe_integer_2(params, 'leverage', 'lev') if leverage is not None: ...
Python
1
""" Задача №27. Пользователь вводит текст(строка). Словом считается последовательность непробельных символов идущих подряд, слова разделены одним или большим числом пробелов. Определите, сколько различных слов содержится в этом тексте. Input: She sells sea shells on the sea shore The shells that she sells are sea shel...
Python
1