text
string
label_name
string
labels
int64
rn, object: *c_char, d: c_double) -> FcBool; pub fn FcPatternAddString(p: *FcPattern, object: *c_char, s: *FcChar8) -> FcBool; pub fn FcPatternAddMatrix(p: *FcPattern, object: *c_char, s: *FcMatrix) -> FcBool; pub fn FcPatternAddCharSet(p: *FcPattern, object: *c_char, c: *FcCharSet) -> FcBool; pub fn FcPatternAddBo...
Rust
0
# coding=utf-8 import requests, re from Exploits import printModule r = '\033[31m' g = '\033[32m' y = '\033[33m' b = '\033[34m' m = '\033[35m' c = '\033[36m' w = '\033[37m' Headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0'} Jce_Deface_image = 'files/pwn.gif' ShellPres...
Python
1
e_length; log.put_ordered::<i32>(frame_offset, aligned_frame_length); log.put::<u16>(frame_descriptor::type_offset(frame_offset), data_frame_header::HDR_TYPE_DATA); let scan_outcome = term_scan::scan_for_availability(&log, frame_offset, MTU_LENGTH); assert_eq!(aligned_frame_length, te...
Rust
0
.value_of("PATH").unwrap(); let ledger_file = File::open(ledger_path).unwrap(); let ledger_iter = serde_json::Deserializer::from_reader(ledger_file) .into_iter().map(|x| x.expect("Deserialise line")); // Step 2: Compute everyone's balances (starting from 0) let mut n = 0; let mut balances =...
Rust
0
f record.avg_temperature is not None else "N/A", f"{record.min_temperature:.2f}" if record.min_temperature is not None else "N/A", f"{record.max_temperature:.2f}" if record.max_temperature is not None else "N/A", f"{record.avg_wind_speed:.2f}" if record.avg_wind_speed is not None els...
Python
1
50.0, 50.0), (50.0, 0.0), (0.0, 50.0)]; let to = [p * from[0], p * from[1], p * from[2], p * from[3]]; let p_est = Projection::from_control_points(from, to); assert!(p_est.is_some()); let p_est = p_est.unwrap(); for i in 0..50 { for j in 0..50 { let ...
Rust
0
""" Security Audit Models This module contains models for security auditing and logging. """ from datetime import datetime from typing import Optional from sqlalchemy import Column, Integer, String, DateTime, JSON, ForeignKey from sqlalchemy.orm import relationship from app.models.physical_education.base.base_class ...
Python
1
import os from .textwrap_local import fw_fill, fw_wrap from .ocr_model import OCRModel from .layout_model import LayoutAnalyzer from .gui import GradioApp from PIL import Image, ImageDraw, ImageFont from loguru import logger import yaml __all__ = ["fw_fill", "fw_wrap", "OCRModel", "LayoutAnalyzer"] def load_config(b...
Python
1
.polyline[i - 1] } else { self.polyline[i + 1] - self.polyline[i] }; let (_, p0, p1) = double_projection( &self.surface0, None, &self.surface1, None, self.polyline.subs(t), n.normalize(), 100, ) .unwrap(); let d = self .surface0 .normal(p0.0, p0.1) .cross(se...
Rust
0
b type AudioTrackList; # [ wasm_bindgen ( structural , method , getter , js_class = "AudioTrackList" , js_name = length ) ] #[doc = "Getter for the `length` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioTrackList/length)"] #[do...
Rust
0
def longestPalindrome(s): """ :type s: str :rtype: str """ longest = "" longest_length = 0 for i in range(len(s)): l = i r = i while l >= 0 and r < len(s) and s[l] == s[r]: if (r - l + 1) > longest_length: longest = s[l:r+1] ...
Python
1
# # MIT License # # (C) Copyright [2024-2025] Hewlett Packard Enterprise Development LP # # 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 # t...
Python
1
( mm: &MemoryManager, user_vector: UserRef<UserCString>, buf: &mut [u8], ) -> Result<Vec<CString>, Errno> { let mut user_current = user_vector; let mut vector: Vec<CString> = vec![]; loop { let mut user_string = UserCString::default(); mm.read_object(user_current, &mut user_strin...
Rust
0
from utils.file_io.argparser import get_args from utils.evaluations.evaluator import get_evaluator from stereo_matchers.stereo_matcher import get_stereo_matcher from utils.visualizations.matplot_builder import get_matplotlib_builder from utils.visualizations.qubo_matrix_visualizer import get_qubo_matrix_visualizer if ...
Python
1
_type == 'side': output_path = process_side_squat_video(video_path) elif squat_type == 'front': output_path = process_front_squat_video(video_path) return send_file(output_path, as_attachment=True, download_name='output.mp4') @app.after_request def add_cors_headers(response): ...
Python
1
Increase(u32), /// Used when input on the X axis in the same direction has exceeded. [`RESET_TICK_COUNT`] /// (#enum.const.RESET_TICK_COUNT) ticks. Exceeded, /// Used in the `Stand`ing state, while there is no input on the X axis, where previously the /// character was `Walk`ing and reverted to ...
Rust
0
"""This script updates the vendored tabler icons package.""" import json import os import shutil import tempfile if __name__ == '__main__': MY_DIR = os.path.dirname(os.path.realpath(__file__)) STATIC_FOLDER = os.path.abspath( os.path.join(MY_DIR, '..', 'InvenTree', 'static', 'tabler-icons') ) ...
Python
1
# Justpy Tutorial demo model_demo2 from docs/tutorial/model_and_data.md import justpy as jp corner_classes = 'p-3 absolute bg-gray-200 ' class MyDiv(jp.Div): def model_update(self): # model has the form [wp, 'text'] for example if self.model[0].data[self.model[1]]: self.text = str(sel...
Python
1
ите номер комнаты: ") room=room_number max_guests = int(input("Введите максимальное количество гостей: ")) price = float(input("Введите цену за ночь: ")) if room_type == "люкс": balcony = input("Есть ли балкон? (да/нет): ").strip().lower() == "да" bar = input("Есть ли мини-бар? (да/нет):...
Python
1
fn test_surface_quad_factory() { let factory = SurfaceQuadFactory { size: vek::Vec2::new(1.0, 1.0), align: vek::Vec2::new(0.5, 0.5), color: vek::Vec4::new(1.0, 0.0, 0.0, 1.0), }; let factory = factory.factory::<SurfaceVertexP>().unwrap(); println!(...
Rust
0
, width: size_t, compar: Option<unsafe extern "C" fn(*const c_void, *const c_void) -> c_int>, ) -> *mut c_void { let mut start = base; let mut len = nel; let cmp_fn = compar.unwrap_or(void_cmp); while len > 0 { let med = (start as size_t + (len >> 1) * width) as *const c_void; le...
Rust
0
usize) * 2); { let pcm = test_signal.ensure_channel(CHANNEL_FL); for i in 0..pcm.len() { pcm[i] = (i as f64 / sample_rate * freq * 2.0 * PI).sin() as f32; } } { let pcm = test_signal.ensure_channel(CHANNEL_FR); for i in 0..pcm.len() { pcm[i] =...
Rust
0
# Generated by Django 5.0.6 on 2024-07-16 00:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('GestionDeUsuariosApp', '0013_alter_usuarios_groups'), ] operations = [ migrations.AlterField( model_name='usuarios', ...
Python
1
/ /// Either assert that the given value is in the value type's value set, or (in limited cases) /// coerce the given value into the value type's value set. fn to_typed_value(&self, value: &edn::ValueAndSpan, value_type: ValueType) -> Result<TypedValue>; } impl SchemaTypeChecking for Schema { fn to_typ...
Rust
0
#!/usr/bin/python # csort.py # Copyright (C) 2012 Liu Xinyu (liuxinyu95@gmail.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
Python
1
from django.contrib import admin from app_main.models import ( CompanyModel, EmployeeModel, DeviceModel, DeviceLogModel ) # Register your models here. admin.site.site_header = "Corporate Asset Tracking App" admin.site.register(CompanyModel) class EmployeeModelAdmin(admin.ModelAdmin): list_display...
Python
1
: "masc", "Rowan": "fem", "Saheeli": "fem", "Samut": "fem", "Sarkhan": "masc", "Serra": "fem", "Sivitri": "fem", "Sorin": "masc", "Szat": "masc", "Tamiyo": "fem", "Tasha": "fem", "Teferi": "masc", "Teyo": "masc", "Tezzeret": "masc", "Tibalt": "masc", "Tyvar": ...
Python
1
(args) => app::longfi_test(args), Send(args) => app::send(args), Serve(args) => app::serve(args), } } // -*- mode: rust; -*- // // This file is part of `scuttlebutt`. // Copyright © 2019 Galois, Inc. // See LICENSE for licensing information. #![allow(clippy::many_single_char_names)] #![cfg_attr(fea...
Rust
0
write_to_file(&result_file,res_str); } if outfile_pdb.len() > 0{ for cc in query_pdb.chains.iter_mut(){ for rr in cc.residues.iter_mut(){ for aa in rr.iter_mut_atoms(){ let mres = matrix_process::matrix_multi(&res.transform_matrix,&vec![vec![aa.ge...
Rust
0
from math import ceil def gen_password(n): result = '' for i in range(1, ceil(n / 2)): for j in range(i + 1, n): if n % (i + j) == 0: result += f'{i}{j}' return result num = int(input('Enter number from 3 to 20 inclusively: ')) password = gen_password(num) print(pas...
Python
1
_state.active_count.fetch_add(1); } Notify::Idle(counter) => { let threads_r = self.threads.read().unwrap(); let thread = threads_r.get(counter).unwrap(); match self.task_queue.pop() { ...
Rust
0
= carcar::config::parse_toml(model_file); // Parse the destination let dst = fire_matcher.value_of("destination").unwrap_or_else(|| { process::exit(1); }); carcar::bench::bench(concurrency, &conf, dst); } // Lists the existed models if let Some(_) = matches.subco...
Rust
0
} self.after_stages = pso::PipelineStage::empty(); self.after_image_access = image::Access::empty(); self.after_buffer_access = buffer::Access::empty(); self.after_image_transitions.clear(); } } pub mod download_manager; pub mod logged_in; pub mod preferences; pub mod pr...
Rust
0
ete, cv_PtrOfBEBLID_get_inner_ptr, cv_PtrOfBEBLID_get_inner_ptr_mut } ptr_extern_ctor! { crate::xfeatures2d::BEBLID, cv_PtrOfBEBLID_new } impl PtrOfBEBLID { #[inline] pub fn as_raw_PtrOfBEBLID(&self) -> *const c_void { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBEBLID(&mut self) -> *mut c_void { self.a...
Rust
0
try: answer = answer_elem.find_element(By.CLASS_NAME, 'tx').get_attribute('innerHTML') except: question_elem.find_element(By.TAG_NAME, 'button').click() answer = WebDriverWait(driver, 10).until( EC.presence_of_element_located((By.CLASS_NAME, 'tx')) ...
Python
1
#!/usr/bin/python # Copyright 2024 Aon Cyber Solutions # # 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 la...
Python
1
#[allow(clippy::enum_variant_names)] #[derive(Clone, PartialEq, Debug)] pub(crate) enum AlterPipelineCommand { CreateSourceStream(StreamModel), CreateSourceReader(SourceReaderModel), CreateStream(StreamModel), CreateSinkStream(StreamModel), CreateSinkWriter(SinkWriterModel), CreatePump(Box<Pump...
Rust
0
name("ar_default_keypair") .long("ar-default-keypair") .value_name("AR_DEFAULT_KEYPAIR") .takes_value(false) .requires("with_sol") .help("Uses the default AR keypair to sign data items if funding with SOL.") } fn ar_keypair_path_arg<'a, 'b>() -> Arg<'a, 'b> { Arg::with_name(...
Rust
0
ateral_oracle: HumanAddr::from("collateraloracle0000"), staking: HumanAddr::from("staking0000"), terraswap_factory: HumanAddr::from("terraswap_factory"), lock: HumanAddr::from("lock0000"), base_denom: base_denom.clone(), token_code_id: TOKEN_CODE_ID, ...
Rust
0
6, } } /// Is this IPv4? #[inline] pub fn is_v4(self) -> bool { self == IpVersion::V4 } /// Is this IPv6? #[inline] pub fn is_v6(self) -> bool { self == IpVersion::V6 } } /// A trait for IP protocol versions. /// /// `Ip` encapsulates the details of a versi...
Rust
0
if let ValOrFn::Value(cv) = self { write!(f, "ValOrFn {{ Value: {:?} }}", cv) } else { write!(f, "ValOrFn {{ Fn }}") } } } impl ValOrFn { #[inline] pub fn to_value(&mut self) -> AttValue { match self { ValOrFn::Value(cv) => cv.clone(), ...
Rust
0
let pos = memchr_both(b'\n', b'-', &b"test\n-this"[..]); assert_eq!(pos, Some(4)); let pos = memchr_both(b'\n', b'-', &b"te\nst\n-this"[..]); assert_eq!(pos, Some(5)); } <filename>examples/custom_router/src/lib.rs mod request; use seed::{prelude::*, *}; extern crate heck; use crate::models::user::{LoggedUs...
Rust
0
""" Constant tables and maps for various blight APIs and actions. """ from blight.enums import InputKind, OutputKind COMPILER_FLAG_INJECTION_VARIABLES = {"CL", "_CL_", "CCC_OVERRIDE_OPTIONS"} """ Environment variables that some compiler frontends use to do their own flag injection. """ OUTPUT_SUFFIX_KIND_MAP = { ...
Python
1
Nearby { &self.inner } } //-----------add by whr tdlib1.8.0-------------------------- #[derive(Debug, Clone, Default, Serialize, Deserialize)] pub struct UpdateChatTheme { // #[doc(hidden)] // #[serde(rename(serialize = "@type", deserialize = "@type"))] // td_name: String, #[doc(hidden)] ...
Rust
0
Addr::from_bytes([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); const TEST_DST_IPV6: Ipv6Addr = Ipv6Addr::from_bytes([17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]); #[test] fn test_parse_serialize_full_ipv4() { use crate::testdata::tls_client_hello_v4::*; ...
Rust
0
# add_command_run_MAA(directory=f"{RSLT_DIR}/{kernel}/allhit/{size_str}_{mode}", # checkpoint=f"{CPT_DIR}/{kernel}/allhit/{size_str}_{mode}", # checkpoint_id = checkpoint_id, # command=f"{GEM5_DIR}/tests/test-pr...
Python
1
self.branches.get_mut(&key) { Some(entry) => entry, None => { let entry = EmojitreeEntry::default(); self.branches.insert(key, entry); self.branches.get_mut(&key)? } } .insert(path, value) } /// Iterates over it...
Rust
0
content=ft.Text( "Personal Expense Tracker", size=28, weight=ft.FontWeight.BOLD, text_align=ft.TextAlign.CENTER ), padding=ft.padding.only(bottom=20) ), ...
Python
1
from unittest.mock import Mock, patch import pytest from swarms.structs.agent import Agent from swarms.structs.swarm_net import SwarmNetwork @pytest.fixture def swarm_network(): agents = [Agent(id=f"Agent_{i}") for i in range(5)] return SwarmNetwork(agents=agents) def test_swarm_network_init(swarm_network...
Python
1
InfDate: FILETIME, CompatIDsOffset: DWORD, CompatIDsLength: DWORD, Reserved: ULONG_PTR, SectionName: [WCHAR; LINE_LEN], InfFileName: [WCHAR; MAX_PATH], DrvDescription: [WCHAR; LINE_LEN], HardwareID: [WCHAR; ANYSIZE_ARRAY], }} pub type PSP_DRVINFO_DETAIL_DATA_W = *mut SP_DRVINFO_DETAIL_DATA_W...
Rust
0
group<T: Eq + Hash>(m: HashMap<T, usize>) -> HashMap<usize, HashSet<T>> { let mut m2 = HashMap::<usize, HashSet<T>>::new(); for (k, v) in m { m2.entry(v).or_insert(HashSet::<T>::new()).insert(k); } m2 } #[inline] fn group_by_count(result: &[u8]) -> HashMap<usize, HashSet<u8>> { group(count...
Rust
0
(request), b'<delete_note note_id="n1" ultimate="0"/>' ) def test_delete_note_missing_note_id(self): with self.assertRaises(RequiredArgument): Notes.delete_note(None) with self.assertRaises(RequiredArgument): Notes.delete_note("") def test_get_notes(self): ...
Python
1
map, &mut used_chars_copy[..], if is_cidfont { if let Some(cffont) = &cffont { Some(cffont) } else { None } } else { ...
Rust
0
Ensure scheduling time meets holiday bonus threshold for j in range(self.n_trucks): model.addCons(schedule_time >= holiday_bonus[j]) # New constraint to avoid overlapping truck schedules in probabilistically chosen routes due to traffic regulations overlapping_routes = np.random.cho...
Python
1
", Self::VT_FOO_TABLE, false)? .visit_field::<namespace_b::EnumInNestedNS>("foo_enum", Self::VT_FOO_ENUM, false)? .visit_union::<namespace_b::UnionInNestedNS, _>("foo_union_type", Self::VT_FOO_UNION_TYPE, "foo_union", Self::VT_FOO_UNION, false, |key, v, pos| { match key { namespace_b::UnionI...
Rust
0
_default.c, 0); assert_eq!(a_default.phantom, Default::default()); let a_2 = a_1.clone(); assert_eq!(a_2.a, 1); assert_eq!(a_2.b, 2); assert_eq!(a_2.c, 3); assert_eq!(a_2, a_1); assert_eq!( format!("{:?}", a_1), String::from("StructNamed { a: 1, b: 2, c: 3, phantom: PhantomData }") ); let b = StructNamed...
Rust
0
!(kind, 0); let attr = LLVMCreateEnumAttribute(context, kind, 0); // This function uses parameter numbers 1..N LLVMAddAttributeAtIndex(function, index, attr); } } /// Add attributes on an LLVM function parameter. /// /// `param` indicates the parameter index. pub fn LLVMExtAddAttrsOnParame...
Rust
0
""" Implementation of normalized nearest-centroid classifiers, as described in [this paper](https://arxiv.org/abs/1911.04623), sourced from [biobench/simpleshot.py](https://github.com/samuelstevens/biobench/blob/main/biobench/simpleshot.py). ``` @article{wang2019simpleshot, title={Simpleshot: Revisiting nearest-neig...
Python
1
from typing import List from helm.benchmark.metrics.metric import MetricSpec def get_functional_correctness_metric_specs() -> List[MetricSpec]: return [ MetricSpec( class_name="helm.benchmark.metrics.codeinsights_correct_code_metrics.CodeInsightsFunctionalCorrectnessMetric", # noqa: E501 ...
Python
1
let m = optimize( m, cm.clone(), None, None, &MinifyOptions { mangle: Some(MangleOptions { props: Some(ManglePropertiesOptions { reserved: Default::default(), undecla...
Rust
0
'''1. Faça um programa, utilizando while, que mostre na tela os números de 0 a 100.''' n = 0 while n <= 99: n = n + 1 print(n) print('fim')
Python
1
from enum import auto from backend.database.wrapper.chart.chart_data import ChartSubcatagory, ChartStatsMetadata, ChartType class TeamStatSubcategory(ChartSubcatagory): CenterOfMass = auto() Positioning = auto() SubCat = TeamStatSubcategory Metadata = ChartStatsMetadata team_stats_metadata = [ # Posi...
Python
1
4', b'Q', b'5', b'Q', b'6', b'Q', b'7', b'Q', b'8', b'Q', b'9', b'Q', b'A', b'Q', b'B', b'Q', b'C', b'Q', b'D', b'Q', b'E', b'Q', b'F', b'Q', b'G', b'Q', b'H', b'Q', b'I', b'Q', b'J', b'Q', b'K', b'Q', b'L', b'Q', b'M', b'Q', b'N', b'Q', b'O', b'Q', b'P', b'Q', b'Q', b'Q', b'R', b'Q', b'S', b'Q', b'T', b'R'...
Rust
0
) ] ) if method == "transform": trs.fit(X, y) trs.transform(X, sample_weight=sample_weight, metadata=metadata) else: getattr(trs, method)(X, y, sample_weight=sample_weight, metadata=metadata) assert len(registry) for _trs in registry: check_record...
Python
1
/// bound is inclusive; the upper bound is exclusive. Fails when /// the upper bound is not greater than the lower bound. fn gen_biguint_range(&mut self, lbound: &BigUint, ubound: &BigUint) -> BigUint; /// Generate a random `BigInt` within the given range. The lower /// bound is inclusive; the upp...
Rust
0
32, super::GMAC_TBFT127>; #[doc = "Reader of field `NFTX`"] pub type NFTX_R = crate::R<u32, u32>; impl R { #[doc = "Bits 0:31 - 65 to 127 Byte Frames Transmitted without Error"] #[inline(always)] pub fn nftx(&self) -> NFTX_R { NFTX_R::new((self.bits & 0xffff_ffff) as u32) } } use csfml_system_sy...
Rust
0
import streamlit as st from streamlit_extras.add_vertical_space import add_vertical_space from view.abstract_streamlit_view import AbstractStreamlitView from service.session_state_service import SessionStateService class SettingsView(AbstractStreamlitView): def __init__(self, session_state_service: SessionStateS...
Python
1
from enum import Enum from typing import Callable class Emitter: def __init__(self): self.__events__ = {} # subscribe event def on(self, type: Enum, fn: Callable) -> None: if type not in self.__events__: self.__events__[type] = [] if not self.has(type, fn): ...
Python
1
in_components)) return not diff_components def remove_unused_influences(skinCluster: str) -> None: """Remove the unused influences from the skinCluster node. Args: skinCluster (str): The skinCluster node. """ if not skinCluster: raise ValueError("No skinCluster node specified") ...
Python
1
from .connect_db import ConexionDB from .box import mensaje def crear_tabla(): conexion = ConexionDB() sql = ''' CREATE TABLE peliculas( id_pelicula INTEGER, nombre VARCHAR(100), duracion VARCHAR(10), genero VARCHAR(100), PRIMARY KEY(id_pelicula AUTOINCREMENT) )...
Python
1
db: db::Db, token: jwt::JwtToken, new: Json<NewPrefill>, ) -> Result<Json<ObservationId>, Status> { let group_id = token.claim.user_group.parse::<i64>().unwrap(); let user_id = token.claim.user_id.parse::<i64>().unwrap(); // competency permission let competency_id = new.competency_id.clone()...
Rust
0
pub const EM_PDSP: Machine = Machine(63); pub const EM_FX66: Machine = Machine(66); pub const EM_ST9PLUS: Machine = Machine(67); pub const EM_ST7: Machine = Machine(68); pub const EM_68HC16: Machine = Machine(69); pub const EM_68HC11: Machine = Machine(70); pub const EM_68HC08: Machine = Machine(71); pub const EM_68HC...
Rust
0
Key, start_height: Option<u32>, db: &State<Db>, config: &State<WalletConfig>) -> anyhow::Result<()> { let vk = fvk.fvk.vk.clone(); let ivk = vk.ivk(); let start_height = match start_height { Some(h) => h, None => db.get_synced_height()? + 1, }; db.truncate_height(start_height)?; ...
Rust
0
let z_rand = gen_random() * 2.0 - 1.0; v.push(Vec3::new(x_rand, y_rand, z_rand).get_unit()); } v } fn permute(p: &mut Vec<usize>, n: usize) { for i in (0..n).rev() { let target = gen_range(0.0, (i + 1) as f32); p.swap(i, target as usize); } } fn generate_perm() -> Vec<usize...
Rust
0
== LegendreSymbol::QuadraticNonResidue } pub fn is_qr(&self) -> bool { *self == LegendreSymbol::QuadraticResidue } } #[derive(Debug)] pub struct BitIterator<E> { t: E, n: usize, } impl<E: AsRef<[u64]>> BitIterator<E> { pub fn new(t: E) -> Self { let n = t.as_ref().len() * 64;...
Rust
0
## LISTS in PYTHON # Storing of Grouped peices of data each having connection with each other # example : states in India { storing the list of states in India } # They are a Data-Structre to store mixed{numbers or Strings} or same data # In Python List is intitialized using : variable name = [ "Val1" , "Val2" , "Va...
Python
1
deref().clone().into(); // #[cfg(feature = "python")] // let script_sig = pyo3::Py::new(py, script_sig).expect("Unable to allocate cell"); // TxIn { // previous_output, // script_sig, // sequence, // ...
Rust
0
dex(&k)) .flatten() .map(|(_, _, id)| id) .unwrap_or(constant::INVALID_ID) } fn recover_ranges(id: u64, db: &rocksdb::DB, channels: Vec<u64>) -> HashMap<u64, (u64, u64)> { let mut result = HashMap::new(); for channel_id in &channels { let first_id...
Rust
0
et if isinstance(method, property) else method return NotImplementedError( "{} must override method {}".format( getattr(cls, "__name__"), getattr(func, "__name__") ) ) def astnode_kind_set(context: CompileCtx, nodes: Iterable[ASTNodeType]) -> str: """ Turn a set of AST node...
Python
1
""" 市场环境检测器 - 自动识别牛熊市并调整策略偏向 """ from typing import Dict, List, Optional import numpy as np from utils.logger import get_logger class MarketEnvironmentDetector: """市场环境检测器""" def __init__(self): self.logger = get_logger(__name__) def detect_market_environment(self, selected_coins: Li...
Python
1
>Set-Cookie request was sent, update this page!</p> </body> </html> "#; const HTML_WHEN_COOKIE_RECEIVED: &str = r#" <html> <body> <p>If you see this text then cookie was received on server.</p> </body> </html> "#; use std::env::args; use std::io::{BufRead, Write}; fn main() { let mut args = ar...
Rust
0
def test_stable_diffusion_euler(self): sd_pipe = StableDiffusionPipeline.from_pretrained( 'CompVis/stable-diffusion-v1-4').to(torch_device) sd_pipe.scheduler = EulerDiscreteScheduler.from_config(sd_pipe. scheduler.config) sd_pipe.set_progress_bar_config(disable=None) inputs = self.get_in...
Python
1
'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bit...
Rust
0
(y0 + y1) / 2, (x1 - x0) / 2] ] assert coords_from_bbox == coords[geometry][True] cds_phys = [float(val) for val in sroi.get_physical_coords(obj)] assert cds_phys == coords[geometry][False] cds_ind = [int(val) for val in sroi.get_indices_coords(o...
Python
1
text_area`] //! //! # Example //! //! ``` //! # use pix_engine::prelude::*; //! # struct App { text_field: String, text_area: String}; //! # impl AppState for App { //! fn on_update(&mut self, s: &mut PixState) -> PixResult<()> { //! s.text_field("Text Field", &mut self.text_field)?; //! s.advanced_text_field( ...
Rust
0
self.out.write(text[start..].as_bytes())?; Ok(count) } else { self.out.write(text.as_bytes()) } } } pub struct JsonlWriter<T> { out: T, print_extra: bool, } impl<T> JsonlWriter<T> { pub fn new(out: T, print_extra: bool) -> Self { Self { out, print_extra ...
Rust
0
print("关键词不能为空") return False # 添加到数据库 if db_manager.add_keyword(keyword.strip()): print(f"成功添加关键词: {keyword}") # 添加到本地数据 self.keywords_data.append({"keyword": keyword.strip()}) self...
Python
1
4", "HA15_N": "C:56", "HA14_P": "C:60", "HA14_N": "C:62", "HA12_P": "C:72", "HA12_N": "C:74", "HA10_P": "C:78", "HA10_N": "C:80", "HA08_P": "C:82", "HA08_N": "C:84", "HA00_CC_P": "C:88", ...
Python
1
o_path), fps_out=fps, print_flag=True) total_frames = len(frames) self.output("len(frames): ", total_frames) result_generator = self.threeDimInferencer(frames, show=False, out_dir=None, return_vis=return_vis) results = next(result_generator) visualisations = [] preds ...
Python
1
import os import re import gpxpy from pathlib import Path from typing import List, Dict, Optional, Tuple from datetime import datetime, timezone from src.routes.route import Route, GeoPoint from src.ui.map_helpers import print_step from src.routes.track import Track, TrackPoint # Get the package root directory packag...
Python
1
r4 = self._create_ha_router(ha=False, az_hints=['az1']) self.plugin.schedule_router(self.adminContext, r1['id']) self.plugin.schedule_router(self.adminContext, r2['id']) self.plugin.schedule_router(self.adminContext, r3['id']) self.plugin.schedule_router(self.adminContext, r4['id']...
Python
1
_expansion(); let one = Ratio::new(BigUint::from(1usize), BigUint::from(1usize)); let mut last = Ratio::from_integer(BigUint::from(0usize)); for i in (0..ex.len()).rev() { let term = &one / (Ratio::new(BigUint::from(ex[i]), BigUint::from(1usize)) + last); ...
Rust
0
r General Purpose Control Register"] pub mgpcr1: MGPCR1, _reserved12: [u8; 252usize], #[doc = "0xa00 - Master General Purpose Control Register"] pub mgpcr2: MGPCR2, _reserved13: [u8; 508usize], #[doc = "0xc00 - Master General Purpose Control Register"] pub mgpcr4: MGPCR4, } #[doc = "Priority...
Rust
0
s in distributed training will download model & vocab tokenizer = RobertaTokenizer.from_pretrained('roberta-large') pretrained_model = PretrainedModel() adapter_model = AdapterModel(args, pretrained_model.config, num_labels) if args.meta_adapter_model: model_dict = adapter_model.state_dict() ...
Python
1
"""Handles sending today's menu to the slack channel. For more information on how to use this module, refer to the README.md file. """ import asyncio import datetime import logging import os from typing import Literal, cast import holidayskr import slack_sdk from slack_sdk.web.async_client import AsyncWebClient fro...
Python
1
= vec![]; for installed_mod in &self.mods { let mut installed = false; for m in installed_mods { if m.0 == installed_mod.mod_slug && m.1 == installed_mod.version_id { installed = true; } } if !installed { ...
Rust
0
gur.read(config_file) baseurl = configur.get('client', 'webservice') # # make sure baseurl does not end with /, if so remove: # if len(baseurl) < 16: print("**ERROR: baseurl '", baseurl, "' is not nearly long enough...") sys.exit(0) if baseurl == "https://YOUR_GATEWAY_API.amazonaws.com": print...
Python
1
ProcAddress vSetGetDllHandleProcAddress vSetTraceProcAddress vSetResetControllerProcAddress bGetProgramVersion vSetKeyPressed vSetGetMessageName vSetTimeNow vSetGetFirstCANdbName """ def ticker_ecus(db, dbcname): nodeList = {} zf = zipfile.ZipFile(dbcname + '_Simulation.zip', mode='w...
Python
1
Ok(()) } async fn run_cli(bus: CliBus, _connection: CliLifeline) -> anyhow::Result<()> { let mut shutdown = bus.rx::<CliShutdown>()?; // keep service alive until we get a shutdown signal let _service = CliService::spawn(&bus)?; let _subscription = CliSubscriptionService::spawn(...
Rust
0
(Ok(a), Ok(b), Ok(c), Ok(d)) => { let _ = T1::parse(&stream); let _ = T2::parse(&stream); let _ = T3::parse(&stream); let _ = T4::parse(&stream); Ok((a, b, c, d)) } (Err(e), _, _, _) => Err(e), (_, Err(e), _, _) => Err(e), (_, ...
Rust
0