text
string
label_name
string
labels
int64
ain // points[rightmost_idx] is the rightmost point // points[rightmost_idx..] is the upper chain let rightmost_idx = (n as f32 * ratio) as usize; let x_range = Range::new(10, 490); let y_range = Range::new(min_gap/2, 250); let endpoint_y_range = Range::new(0, min_gap);...
Rust
0
#!/usr/bin/env python """ This module is designed to used with _livereload to make it a little easier to write Sphinx documentation. Simply run the command:: python sphinx_server.py and browse to http://localhost:5500 livereload_: https://pypi.python.org/pypi/livereload """ import os from livereload import Ser...
Python
1
))); } })) } pub fn begin_text(&mut self, cx: &mut Cx) -> AlignedInstance { //let font_id = self.font.font_id.unwrap(); let inst = cx.new_instance(&self.shader, 0); let aligned = cx.align_instance(inst); let text_style = &self.text_style; ...
Rust
0
# ------------------------------------------------------------------------- # # Part of the CodeChecker project, under the Apache License v2.0 with # LLVM Exceptions. See LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ---------------------------------------------------...
Python
1
self.ui.calendar.setSelectedDate(date) DAY_BUTTON_STYLE = """QPushButton { background-color:transparent; } QPushButton:hover { background-color:rgba(0,0,255,50); } """ DAY_BUTTON_SELECTED_STYLE = """ QPushButton { border:2px solid red; color: rgb(0,64,64); border-radius:3px; backgr...
Python
1
# Copyright (C) 2018-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from openvino.tools.mo.front.common.partial_infer.eltwise import eltwise_infer from openvino.tools.mo.graph.graph import Graph from openvino.tools.mo.ops.op import Op class Eltwise(Op): op = 'Eltwise' def _...
Python
1
5, 2], which /// indicates that for base 10 numbers (the default base), the method may consider dividing /// bin sizes by 5 and/or 2. For example, for an initial step size of 10, the method can /// check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the /// given constrain...
Rust
0
nce(exception, duckdb.BinderException) and any( msg in str(exception) for msg in ( "not found in FROM clause", "this column cannot be referenced before it is defined", ) ): return ColumnNotFoundError.from_available_column_names( available_columns=f...
Python
1
import sqlite3 as sql import html import bcrypt from threading import Lock file_lock = Lock() def insertUser(username, password, DoB): username = html.escape(username, quote=True) password = html.escape(password, quote=True) con = sql.connect("database_files/database.db") cur = con.cursor() hash_p...
Python
1
import jax import numpy as np import jax.numpy as jnp from flax.training import checkpoints from diffusers import FlaxControlNetModel, FlaxUNet2DConditionModel, FlaxAutoencoderKL, FlaxDDIMScheduler from codi.controlnet_flax import FlaxControlNetModel from codi.pipeline_flax_controlnet import FlaxStableDiffusionControlN...
Python
1
let old = [buf[16], buf[17], buf[18], buf[19]]; (&mut buf[16..20]).copy_from_slice(&[127, 0, 0, 1]); let updated = Checksum::update(c.checksum(), &old, &[127, 0, 0, 1]); let from_scratch = { let mut c = Checksum::new(); c.add_bytes(&buf); ...
Rust
0
f"**Property:** siid:{siid} piid:{piid} = {value}\n\n" f"**Preview:** {message_preview}\n\n" f"[📝 Report this discovery on GitHub]({github_url})\n\n" f"✅ **Device IDs automatically anonymized in GitHub link**" ) return title, message def _create...
Python
1
// /// let token_1 = IsolationToken::new(); /// let token_2 = IsolationToken::new(); /// /// let mut prefs_1 = StreamPrefs::new(); /// prefs_1.set_isolation(token_1); /// /// let mut prefs_2 = StreamPrefs::new(); /// prefs_2.set_isolation(token_2); /// /// // These two connections will come from different source IP add...
Rust
0
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional from typing_extensions import Literal from ..._models import BaseModel __all__ = ["ResponseComputerToolCallOutputScreenshot"] class ResponseComputerToolCallOutputScreenshot(BaseModel): type: Litera...
Python
1
RAIN_WORLD_0_I2C_EXT0` writer - core_0_pif_pms_constrain_world_0_i2c_ext0"] pub struct CORE_0_PIF_PMS_CONSTRAIN_WORLD_0_I2C_EXT0_W<'a> { w: &'a mut W, } impl<'a> CORE_0_PIF_PMS_CONSTRAIN_WORLD_0_I2C_EXT0_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u...
Rust
0
) col_filter: IntProperty( name='Col Filter', description='Flags for bhkRigidBody(t)', default=0 ) max_linear_velocity: FloatProperty( name='Max Linear Velocity', description='Linear velocity limit for bhkRigidBody(t)', default=0 ) max_angular_ve...
Python
1
import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import griddata points = [ (10.501, 51.917, 293), (10.502, 51.918, 286), (10.503, 51.919, 285), (10.504, 51.920, 280), # Additional points (10.598, 52.014, 305), (10.599, 52.015, 304), (10.600, 52.016, 303), ...
Python
1
ast_value is not None: print(f" ✓ 最新値: {last_value:.2f} USD/MT") print(f" ✓ 日付: {last_date}") if pd.notna(name_field): print(f" ✓ 名称: {name_field}") # 価格レンジ情報 price_range_i...
Python
1
let next_op_token = entry.key(); // The addresses have already been validated, so unwrapping them will succeed. // validate their addresses before submitting. let iovecs = addrs.iter().map(|&mem_range| { *mem.get_volatile_slice(mem_range) .unwrap() ...
Rust
0
: REMAP, #[doc = "0x08 - Comparator 0"] pub comp0: COMP0, #[doc = "0x0c - Comparator 1"] pub comp1: COMP1, #[doc = "0x10 - Comparator 2"] pub comp2: COMP2, #[doc = "0x14 - Comparator 3"] pub comp3: COMP3, #[doc = "0x18 - Comparator 4"] pub comp4: COMP4, #[doc = "0x1c - Compar...
Rust
0
# Copyright 2021-2025 Avaiga Private Limited # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
Python
1
# SPDX-FileCopyrightText: 2024-present Plone Foundation <board@plone.org> # # SPDX-License-Identifier: MIT from pathlib import Path from git import Commit, Git, Repo from git.exc import GitCommandError, InvalidGitRepositoryError def repo_from_path(path: Path) -> Repo | None: """Return the repo for the given path...
Python
1
let z = &self.c.z; let (mut x3, mut y3, mut z3); let (mut t0, t1, mut t2, mut t3); t0 = x * x; // 1. t0 = X * X t1 = y * y; // 2. t1 = Y * Y t2 = z * z; // 3. t2 = Z * Z t3 = x * y; // 4. t3 = X * Y t3 = &t3 + &t3; // 5. t3 = ...
Rust
0
# -*- coding: utf-8 -*- import re import csv import time try: from PySide.QtGui import QApplication from PySide.QtCore import QUrl, QEventLoop, QTimer from PySide.QtWebKit import QWebView except ImportError: from PyQt4.QtGui import QApplication from PyQt4.QtCore import QUrl, QEventLoop, QTimer ...
Python
1
Operation::BRK => self.op_BRK(mem), Operation::BVC => self.op_BVC(value), Operation::BVS => self.op_BVS(value), Operation::CLC => self.op_CLC(), Operation::CLD => self.op_CLD(), Operation::CLI => self.op_CLI(), Operation::CLV => self.op_CLV(), ...
Rust
0
#!/usr/bin/python # -*- coding: utf-8 -*- #from http://www.jianshu.com/p/f4cabcb17e8e def GetLists(subdomain,start,end): ret = [] for i in xrange(int(start),int(end)+1): ret.append(subdomain+str(i)+'.dropbox.com') return ret def GetDlClientLists(): return GetLists('dl-client',1,999) def Get...
Python
1
mut ctx = vm.get_context(); ctx.log("Creating channel\n"); let mut channel = ctx.create_channel( synth_mix, synth_update, Synth { env: Envelop { attack: 0.02, decay: 0.01, release: 0.02, ...
Rust
0
owncast, Resource, Camera, CameraType, CameraData, Canvas, Dimensions}; use super::super::materials::{ CustomMaterial }; #[derive(Debug)] pub struct PerspectiveCamera { pub node:SceneNode, kind:CameraType, viewport:(f32,f32,f32,f32), color:(f32,f32,f32,f32), width:Dimensions, height:Dimensions, width_rel:f32, ...
Rust
0
That leaves a // maximum options size of 1 kind byte + 1 length byte + 38 data bytes. /// Data for an unrecognized option kind. /// /// Any unrecognized option kind will have its data parsed using this /// variant. This allows code to copy unrecognized options into packets ...
Rust
0
.insert(name.into(), (watchpoint, true)).is_some() } /// Remove the memory watchpoint with the given `name`. /// /// Returns `true` if the operation was successful, or `false` if no /// watchpoint with that name was found. pub fn remove(&mut self, name: &str) -> bool { self.0.remove(nam...
Rust
0
getters_and_setters_via_indices() { let mut tb = create_test_bed(); assert_eq!(tb.m1[0][0], 1.0); assert_eq!(tb.m1[2][1], 8.0); let v = Vector3::new(-1.0, -2.0, -3.0); tb.m1[2] = v; assert_eq!(tb.m1[2][0], -1.0); assert_eq!(tb.m1[2][1], -2.0); tb.m1[1][0] = -100.0; assert_eq!(tb.m1[1], Vector3::new(...
Rust
0
evaluator: &mut Evaluator, env: &mut Environment, call_expr: HirCallExpression, ) -> Result<Object, RuntimeErrorKind> { let inputs = FixedBaseScalarMulGadget::prepare_inputs(evaluator, env, call_expr)?; let witness_pubkey_x = evaluator.add_witness_to_cs(); let object...
Rust
0
pub fn putAndReverse(&mut self, i: u8, j: u8) { let put_position = coordinate_to_bitboard(i as u64, j as u64).unwrap(); self.current_board .put_and_reverse(&self.player_human, put_position); self.history.push(put_position); self.print_move(&self.player_human, put_position...
Rust
0
x", DtInt32) .attr("shrink_axis_mask", 1 as i64) .input("input") .input("begin") .input("end") .input("stride") .op("StridedSlice"), ); let graph = graph.write_to_bytes().unwrap(); let inputs = vec![("input",...
Rust
0
from django.shortcuts import render from .program.summarizer import generarResumen from .forms import ArticuloForm def ver_resumen(request): resumen = None has_resumen = False if request.method == "POST": form = ArticuloForm(request.POST) if form.is_valid(): resumen = gener...
Python
1
d_mode_var = strategy_vars["forward_mode_var"] # Widget Construction (after callbacks defined) optimized_preview = create_optimized_preview_widget( parent=inputs_frame, on_save_click=on_save_inputs, ) optimized_preview.frame.pack(fill="x", padx=10, pady=(5, 0)) load_cached_ui_state( parsed_strategy_input...
Python
1
) : "0" (addr), "1" (cnt), "{eax}" (data) : "memory", "cc": "volatile"); } pub unsafe extern "C" fn lgdt(p: *const Segdesc, size: u16) { let mut pd = [0u16; 3]; pd[0] = size - 1; pd[1] = p as usize as u16; pd[2] = (p as usize >> 16) as u16; asm!("lgdt ($0)" :: "r" (&pd) : "memory...
Rust
0
# -*- coding: utf-8 -*- """ jishaku.paginators (non-shim dependencies) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Paginator-related tools and interfaces for Jishaku. :copyright: (c) 2021 Devon (Gorialis) R :license: MIT, see LICENSE for more details. """ import typing import discord # emoji settings, this s...
Python
1
for sorting aggregated activities ''' raise ValueError('not implemented') class RecentRankMixin(object): ''' Most recently updated aggregated activities are ranked first. ''' def rank(self, aggregated_activities): ''' The ranking logic, for sorting aggregated activiti...
Python
1
}, additiveExpr[a] Equals additiveExpr[b] => Expr { span: span!(), node: Expr_::BinOp(BinOp::CmpEq, Box::new(a), Box::new(b)), }, additiveExpr[a] NotEquals additiveExpr[b] => Expr { span: span!(), node: Expr_::BinOp(BinOp::CmpNE, Box::new(a), B...
Rust
0
] => LittleEndian = KS_MODE_LITTLE_ENDIAN; => BigEndian = KS_MODE_BIG_ENDIAN; => Arm = KS_MODE_ARM; => Thumb = KS_MODE_THUMB; => V8 = KS_MODE_V8; => Mips3 = KS_MODE_MIPS3; => Mips32 = KS_MODE_MIPS32; => Mips64 = KS_MODE_MIPS64; => Bit16 = KS_MODE_16; ); use self::Mode::{Mips32,...
Rust
0
te.logo_url: logger.info(f"No logo set for website {website_id}") return Response(status_code=204) mongo_id = ObjectId(website.logo_url) logger.info(f"Mongo ID for logo: {mongo_id}") media_schema, file_stream = await media_service.get_public_media(mongo_id) if ...
Python
1
iter::once($segment).collect(), } }; [$first:expr, $($rest:expr),+] => { Path { leading_colon: Some(Default::default()), segments: iter::once($first) $(.chain(iter::once($rest)))* .collect(), } }; } fn mkseg(string: &str) -> Pa...
Rust
0
from transformers import AutoTokenizer, TrainingArguments, EarlyStoppingCallback import sys, os, torch sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from jola import JoLAConfig, JoLAModel, JoLATrainer, JoLADataset, make_data_collator ## if you have already install jola through pip, y...
Python
1
import streamlit as st from PyPDF2 import PdfReader from sumy.summarizers.lsa import LsaSummarizer from sumy.parsers.plaintext import PlaintextParser from sumy.nlp.tokenizers import Tokenizer import os import nltk nltk.download('punkt') def get_pdf_text(pdf_docs): text = "" for pdf in pdf_docs: pdf_rea...
Python
1
import datetime from src.reports import spending_by_category, spending_by_weekday, spending_by_workday from src.utils import get_currency_rate2, get_spx_index from src.views import cashback, get_transactions, greeting, search_tr_in_data, top5, total_expenses if __name__ == "__main__": tr = get_transactions("..\\d...
Python
1
th) path_to_goal = path_to_node.pop() util.raiseNotDefined() def uniformCostSearch(problem: SearchProblem): """Search the node of least total cost first.""" "*** YOUR CODE HERE ***" from util import PriorityQueue frontier = PriorityQueue() path_to_node = PriorityQueue() path_to_goa...
Python
1
atorCreateFlagBits = 2147483647; pub type VmaAllocatorCreateFlagBits = ::std::os::raw::c_uint; pub type VmaAllocatorCreateFlags = VkFlags; pub const VmaMemoryUsage_VMA_MEMORY_USAGE_UNKNOWN: VmaMemoryUsage = 0; pub const VmaMemoryUsage_VMA_MEMORY_USAGE_GPU_ONLY: VmaMemoryUsage = 1; pub const VmaMemoryUsage_VMA_MEMORY_US...
Rust
0
fn deserialize_body(input: &[u8]) -> IResult<&[u8], Self> where Self: Sized, { map( nom::sequence::pair(u32(Endianness::Native), u32(Endianness::Native)), |(num, denom)| Fraction { num, denom }, )(input) } } impl CanonicalFixedSizedPod for Id { const T...
Rust
0
a factor $k$ and a /// vertex with position $P$ and centroid $Q$, its position becomes /// $P+k(Q-P)$. pub fn smooth<T>(&mut self, factor: T) where T: Into<Scalar<VertexPosition<G>>>, G: VertexCentroid, G::Vertex: AsPositionMut, VertexPosition<G>: EuclideanSpace, { ...
Rust
0
(&db, &vrf, false) .await .unwrap(); akd.publish::<Blake3_256<BaseElement>>( vec![ (AkdLabel("hello".to_string()), AkdValue("world".to_string())), ( AkdLabel("hello2".to_string()), AkdValue("world2".to_st...
Rust
0
messages pub const AUDIT_FILTER_USER: u32 = 0; /// Apply rule at task creation (not syscall) pub const AUDIT_FILTER_TASK: u32 = 1; /// Apply rule at syscall entry pub const AUDIT_FILTER_ENTRY: u32 = 2; /// Apply rule to file system watches pub const AUDIT_FILTER_WATCH: u32 = 3; /// Apply rule at syscall exit pub const...
Rust
0
, false)?; self.cargo_exec(vec!["clippy", "--all"], vec!["-D", "warnings"], None, false)?; Ok(()) } pub(crate) fn update_deps(&self) -> Result<()> { self.cargo_exec(vec!["update"], vec![], None, false)?; self.cargo_exec(vec!["update"], vec![], None, false)?; Ok(()) ...
Rust
0
#!/usr/bin/env python3 # flake8: noqa from pre_award.fund_store.config.fund_loader_config.cof.cof_r2 import APPLICATION_BASE_PATH from pre_award.fund_store.config.fund_loader_config.cof.cof_r2 import ASSESSMENT_BASE_PATH from pre_award.fund_store.config.fund_loader_config.cof.cof_r2 import COF_ROUND_2_WINDOW_2_ID from ...
Python
1
fn test_full_range() { // Not much to test. let _ = RangeFull; } <reponame>elexeum/elexeum-node // Copyright 2017-2021 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as ...
Rust
0
# Pyrogram - Telegram MTProto API Client Library for Python # Copyright (C) 2017-present Dan <https://github.com/delivrance> # # This file is part of Pyrogram. # # Pyrogram is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the F...
Python
1
veloper.android.com/reference/android/provider/ContactsContract.CommonDataKinds.CommonColumns.html#TYPE) pub const TYPE : &'static str = "data2"; } } use std::fmt::Debug; use std::io; use std::path::Path; use std::sync::Arc; use crate::endpoint::MiddlewareEndpoint; use crate::fs::ServeDir; use crate::log; ...
Rust
0
put_shape, expected_slices ) def test_no_patching_mode(): """Test that SAM2Adapter handles no_patching mode correctly.""" img_height, img_width = 256, 256 adapter = get_mock_model(img_height, img_width) # Default mode assert adapter.no_patching is False assert adapter.patch_size == 256 ...
Python
1
Normal_1 0xDA, 0x05,// 730 = "vfmadd213ss" // VEX_Vfmadd213sd_xmm_xmm_xmmm64 0x81,// 'v', Normal_1 0xD9, 0x05,// 729 = "vfmadd213sd" // EVEX_Vfmadd213ss_xmm_k1z_xmm_xmmm32_er 0x81,// 'v', Normal_1 0xDA, 0x05,// 730 = "vfmadd213ss" // EVEX_Vfmadd213sd_xmm_k1z_xmm_xmmm64_er 0x81,// 'v', Normal_1 0xD9, 0x05,...
Rust
0
ations.to_csv_string()); info!("Server supported object types: {}", server_props.object_types.to_csv_string()); Ok(()) } fn load_binary_file(path: &std::path::PathBuf) -> Vec<u8> { use std::{fs::File, io::Read}; let mut bytes = Vec::new(); File::open(path) .expect(&format!("Failed to open...
Rust
0
""" Frontend API - 助手工作空间接口 提供助手管理、对话管理等功能(基于原项目实际业务模型) """ from fastapi import APIRouter, Depends, HTTPException, Query from typing import Dict, Any, Optional, List from pydantic import BaseModel, Field import logging from datetime import datetime from app.api.frontend.dependencies import ( FrontendServiceContai...
Python
1
t self) { self.mineral_contents = ::std::option::Option::None; } pub fn has_mineral_contents(&self) -> bool { self.mineral_contents.is_some() } // Param is passed by value, moved pub fn set_mineral_contents(&mut self, v: i32) { self.mineral_contents = ::std::option::Option:...
Rust
0
(Message)] #[rtype(result = "Result<AudioIOState, AudioIOStorageServiceError>")] pub struct FetchMessage; #[derive(Message)] #[rtype(result = "Result<(), AudioIOStorageServiceError>")] pub struct StoreMessage { pub state: AudioIOState, } impl Handler<FetchMessage> for AudioIOStorageService { type Result = Res...
Rust
0
{value[:30] if len(value) > 30 else value}") print(f" Meta tags: {len(page_state['metaTags'])}") print(f" Session storage: {len(page_state['sessionStorage'])}") print(f" Local storage: {len(page_state['localStorage'])}") print(f" Referrer: {page_state...
Python
1
the operator private key to file let (_, node_config_path) = load_node_config(&env.validator_swarm, 0); let key_file_path = node_config_path.with_file_name(OPERATOR_KEY); let _ = op_tool .extract_private_key(OPERATOR_KEY, key_file_path.to_str().unwrap(), &backend) .unwrap(); // Verify ...
Rust
0
"""Snakemake wrapper for Strelka""" __author__ = "Thibault Dayris" __copyright__ = "Copyright 2019, Dayris Thibault" __email__ = "thibault.dayris@gustaveroussy.fr" __license__ = "MIT" from pathlib import Path from snakemake.shell import shell from snakemake.utils import makedirs log = snakemake.log_fmt_shell(stdout=...
Python
1
print!("{}", col); } } println!(); } mod common; mod conv; mod pool; pub(crate) use conv::conv2d_im2col; pub(crate) use pool::{avg_pool2d, max_pool2d}; use half::f16; use imath_traits::Zero; use openexr_sys as sys; pub use sys::RgbaChannels; #[derive(Copy, Clone, Debug, PartialEq, Default...
Rust
0
#!/usr/bin/python3 # -*- coding: utf-8 -*- class Colors: reset = '\033[0m' fgBlack = '\033[30m' fgBrightBlack = '\033[30;1m' fgBlackLine = '\033[30;4m' bgBlack = '\033[40m' bgBrightBlack = '\033[40;1m' fgRed = '\033[31m' fgBrightRed = '\...
Python
1
D_Z: f32 = 0.25; pub const STATUS_Z: f32 = 0.125; pub struct State { vertex_count: usize, vertex_max: usize, program: u32, fs: u32, vs: u32, vbo: u32, vao: u32, glyph_texture: u32, } pub type Res<T> = Result<T, Box<std::error::Error>>; /// ```text /// [ /// left_top * 3, /// ri...
Rust
0
expr2 = self.visit(l[2]) return int(AritDICT[operador] ((int(expr1)),(int(expr2)))) def visitOpLogic(self, ctx): l = list(ctx.getChildren()) expr1 = self.visit(l[0]) cmp = l[1].getText() expr2 = self.visit(l[2]) return int(bool(LogicDICT[cmp] ((int(expr1)),(int(expr...
Python
1
new(self.data) } } /// PacketBuilder can be used to push a packet-frame into a mutable `Vec<u8>` /// /// For usage details see [FrameBuilderLike]. /// ``` /// use yatlv::PacketFrameBuilder; /// let mut data = Vec::with_capacity(100); /// { /// PacketFrameBuilder::new(&mut data); /// } /// assert_eq!(&[ /// ...
Rust
0
ruct>>) -> Result<()> where Self: Sized { self.one = self.stream.read_bits_int(6)?; self.stream.alignToByte(); self.byte1 = self.stream.read_u1()?; self.two = self.stream.read_bits_int(3)?; self.three = self.stream.read_bits_int(1)? != 0; ...
Rust
0
mestamp = time.strftime("%Y%m%d-%H%M%S") results_file = os.path.join(results_dir, f"eval_results_{timestamp}.txt") with open(results_file, "w") as f: f.write("Evaluation Results\n") f.write("=" * 50 + "\n") f.write(f"Checkpoint: {args.ckpt_path}\n") f.write(f"Number of episo...
Python
1
import pandas as pd class prompt_generator(): def __init__(self, restaurant_json): self.restaurant_json = restaurant_json self.restaurant_data = {row['restaurant_id']: row['name'] for index, row in self.restaurant_json.iterrows()} def recommend_places(self, data): user_a = data["us...
Python
1
ext( text=script.STATUS_TXT.format(total, users, chats, monsize, free), reply_markup=reply_markup, parse_mode=enums.ParseMode.HTML ) elif query.data.startswith("setgs"): ident, set_type, status, grp_id = query.data.split("#") grpid = await active_connectio...
Python
1
*"] pub const MD_CENTRAL_W3C_LOGGING_ENABLED: u32 = 2119u32; #[doc = "*Required features: `\"Win32_System_Iis\"`*"] pub const MD_CERT_CACHE_RETRIEVAL_ONLY: u32 = 2u32; #[doc = "*Required features: `\"Win32_System_Iis\"`*"] pub const MD_CERT_CHECK_REVOCATION_FRESHNESS_TIME: u32 = 4u32; #[doc = "*Required features: `\"Wi...
Rust
0
nships plt.figure(figsize=(12, 6)) # Compute AADC results for the same range of target values as SciPy aadc_targets = np.linspace(5.0, 15.0, 50) # Evaluate AADC kernel for all targets at once inputs = {target_arg: aadc_targets} res_all_targets = aadc.evaluate(func, request, inputs) # Extract results for all target v...
Python
1
on::{PaginatedRequest, PaginationState, PaginationType, QueryPaginator}; use vila::{Client, Request, RequestData}; // Helpers fn extract_page_number(q: &PaginationType) -> Option<usize> { let PaginationType::Query(v) = q; v.first() .map(|(_, v)| str::parse::<usize>(v).ok()) .flatten() } fn get...
Rust
0
:{}", dest_port); let mut resp = client.get(&dest_url).send().unwrap(); assert_eq!(resp.text().unwrap(), "Hello"); }); assert!(result.is_err()); } #[test] fn test_username_password_auth_wrong_username() { let proxy_addr = start_proxy_server(); let dest_port = start_dest_server...
Rust
0
*mut MIDL_STUB_MESSAGE); #[doc = "*Required features: `\"Win32_System_Rpc\"`, `\"Win32_System_Com\"`*"] #[cfg(feature = "Win32_System_Com")] pub fn NdrCreateServerInterfaceFromStub(pstub: super::Com::IRpcStubBuffer, pserverif: *mut RPC_SERVER_INTERFACE) -> RPC_STATUS; #[doc = "*Required features: `\"Wi...
Rust
0
gTensorWatch| { &mut m.debug_ops }, )); fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( "debug_urls", |m: &DebugTensorWatch| { &m.debug_urls }, |m: &mut DebugTensorWatch| { &mut m...
Rust
0
# coding=utf-8 # project DATA_PATH = "/scratch/data" PROJECT_PATH = "/scratch/" #DATA = {"CLASSES":['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', # 'car', 'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', # 'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', # 'train', ...
Python
1
import numpy as np from scipy.signal import savgol_filter import os, sys, json, datetime import matplotlib.pyplot as plt sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import extractor #enable prnting of long numpy arrays np.set_printoptions(threshold=np.inf) mact = \ '0,1,472,652,1025;...
Python
1
fs::read_to_string(&path.join("url"))?; let name = fs::read_to_string(&path.join("name"))?; let child_components = visit_child_components(&path)?; Ok(Component { job_id: job_id.parse::<u32>()?, name, url, child_components }) } fn create_list( &self, layer: usize, ...
Rust
0
downcast_ref::<RenderPassVk>().unwrap(); assert_ne!(render_pass.render_pass, ash::vk::RenderPass::null()); let frame_binding = render_pass.frame_binding.read().unwrap(); let frame_binding = frame_binding .downcast_ref::<RenderFrameBindingSetVk>() .unwrap(); asser...
Rust
0
de_json::from_str(include_str!("./assets/schema.json")) .expect("invalid Holium selector schema"); JSONSchema::compile(&json_schema) .expect("invalid Holium selector schema") }; } #[derive(thiserror::Error, Debug)] enum Error { #[error("invalid string can not be parsed to json")...
Rust
0
props as u32; if pb >= 225 { return Err(error::Error::LZMAError(format!( "LZMA2 invalid properties: {} must be < 225", pb ))); } lc = pb % 9; pb /= 9; lp = pb % 5; pb /= 5; ...
Rust
0
.myWindow.title("WIFI破解工具") w, _ = self.myWindow.maxsize() sys = platform.system() width = 540 if sys == 'Linux': width = 600 self.myWindow.geometry(f'{width}x630+{(w - 550)//2}+0') # 如果是linux,宽度540应改为600 # ********* 顶部菜单栏 ********** myMenu = Menu(sel...
Python
1
#!/usr/bin/env python # # The MIT License (MIT) # # Copyright (c) <2022-Present> <Alex Huszagh> # # 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 limita...
Python
1
# -*- coding: utf-8 -*- from __future__ import absolute_import as _init T = {} T['TE_RESUME'] = 'int' #流重传方式 TERT_RESTART = 0 #从本交易日开始重传 TERT_RESUME = 1 #从上次收到的续传 TERT_QUICK = 2 #只传送登录后的流内容 T['TraderID'] = 'char[21]' #交易所交易员代码 T['InvestorID'] = 'char[13]' #投资者代码 T['BrokerID'] = 'char[11]' #经纪公司代码 T['BrokerAbbr'] = 'c...
Python
1
with open("input.txt") as f: data = f.read().split("\n") robots = [ [ list(map(int, i.split(" ")[0].split("=")[1].split(","))), list(map(int, i.split(" ")[1].split("=")[1].split(","))), ] for i in data ] R = 103 C = 101 MID_R = R // 2 MID_C = C // 2 robot_count = [0, 0, 0, 0] for ro...
Python
1
import csv, os, sys, pathlib, datetime from pathlib import Path TOPN = int(os.getenv("TOPN", "5")) CSV_PATH = Path("results/summary.csv") README = Path("README.md") B = "<!-- TOPN:BEGIN -->" E = "<!-- TOPN:END -->" TITLE = "## Latest experiments — Top N by ASR" def load_rows(): if not CSV_PATH.exists(): ...
Python
1
e.to_human_presentable(rack,Slot::Training,position.get_board_size(),&app))); app.comm.println( "info [かといって巻き戻したいし……☆(^~^)]", ); app.comm.println( ...
Rust
0
dry_run_stdout { writeln!( stdout, "Would transition currently selected issue to status {}", status )?; return Ok(RunType::DryRun { state, stdout }); } jira::transition_issue(jira_config, &issue.key, status)?; println!("{} transitioned to {}", &i...
Rust
0
import json import random import bisect import numpy from matplotlib import pyplot import datetime def parse_time(t): h, m, s = map(int, t.split(':')) return h*60*60 + m*60 + s # Need to map stop sequence to stop id for L and SI #seq2stop = {} #for i, line in enumerate(open('stop_times.txt')): # line = lin...
Python
1
// * `-f FIRST` - The first name of the user. /// * `-l LAST` - The last name of the user. /// * `[-r REGION]` - The region in which the table is created. /// If not supplied, uses the value of the **AWS_REGION** environment variable. /// If the environment variable is not set, defaults to **us-west-2**. /// * `[-v...
Rust
0
# 执行上传(适配不同平台) if request.platform == "douyin": # 抖音上传器需要特殊处理 success = await self._upload_douyin(account, request.video_info, request.publish_date) else: # 获取对应的上传器 uploader = await self._get_uploader(request.platform) ...
Python
1
') parser.add_argument('--batch-size', type=int, default=10, help='批处理大小') args = parser.parse_args() # 创建处理器 processor = LLMDataProcessor( parser=args.parser, accept_score=args.accept_score, batch_size=args.batch_size ) # 处理文件 re...
Python
1
counter.insert(buf.to_owned(), 1); } }; buf.clear(); } counter } fn sort_counts<S: Ord + Sync, T: Ord + Sync>( counts: &mut Vec<(&S, &T)>, sorting_order: &SortingOrder, ) { match sorting_order { SortingOrder::key => { counts.par_sort_unstabl...
Rust
0
stant, ) -> Result<Self> { let kvm_vcpu = fd.create_vcpu(id).map_err(Error::VcpuFd)?; // Initially the cpuid per vCPU is the one supported by this VM. Ok(Vcpu { fd: kvm_vcpu, id, io_bus, mmio_bus, ioapic, vm_ts: creation...
Rust
0