text
string
label_name
string
labels
int64
/ 1_u32 + distance.z, /// 1_u32 /// ); /// let result = matrix * vector; /// /// assert_eq!(result, expected); /// ``` #[rustfmt::skip] #[inline] pub fn from_affine_translation(distance: &Vector3<S>) -> Self { let one = S::one(); let zero = S::zero(); ...
Rust
0
# Generated by Django 5.0.6 on 2024-06-26 07:32 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Quote', fields=[ ('id', models.BigAutoField...
Python
1
# Copyright (c) 2021 - present / Neuralmagic, Inc. 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 b...
Python
1
self.close_timer.start(2000) # Adjust the delay if needed if __name__ == "__main__": app = QApplication(sys.argv) video_path = "C:\\Users\\julia\\Videos\\peharge-intro4.5.2.mp4" audio_path = "C:/Users/julia/PycharmProjects/peharge-chatpp-pro/aggressive-huge-hit-logo-139134.mp3" if not os.path.e...
Python
1
ols, names, request): # see gh-9755 s = """0,1,2014-01-01,09:00,4 0,1,2014-01-02,10:00,4""" parse_dates = [[1, 2]] parser = all_parsers if parser.engine == "pyarrow" and not (len(names) == 3 and usecols[0] == 0): mark = pytest.mark.xfail( reason="Length mismatch in some cases, U...
Python
1
unsafe extern "C" fn XeTeXFontMgr_getReqEngine( mut _self_0: *const XeTeXFontMgr, ) -> libc::c_char { // return the requested rendering technology for the most recent findFont // or 0 if no specific technology was requested return XeTeXFontMgr_sReqEngine; } #[no_mangle] pub unsafe extern "C" fn XeTeXFo...
Rust
0
/1", "bar/2", "3", "foo/bar/4"]; { let repository_dir = temp::Dir::new("pwm-test").unwrap(); let mut repository = Repository::new(repository_dir.path(), true, Some(str_secret("foobar"))).unwrap(); for path in &paths { let absolute_path = repository.path(path).unwrap(...
Rust
0
::os::raw::c_char; } extern "C" { pub fn xed_nonterminal_enum_t_last() -> xed_nonterminal_enum_t; } #[repr(u32)] #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum xed_operand_width_enum_t { XED_OPERAND_WIDTH_INVALID = 0, XED_OPERAND_WIDTH_ASZ = 1, XED_OPERAND_WIDTH_SSZ = 2, XED_OPERAND_WID...
Rust
0
"""Flax implementation of ResNet V1.""" # Copyright 2023 The Flax Authors. # # 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 requi...
Python
1
import json from paddleocr import PaddleOCR # Initialize PaddleOCR with language support (e.g., English) ocr = PaddleOCR(use_angle_cls=True, lang='en') # Image path for the document document_image_path = 'data/ht_case5.jpg' # Perform OCR on the document image document_result = ocr.ocr(document_image_path, cls=True) ...
Python
1
r; use std::time::{Duration, Instant}; use tract_itertools::Itertools; pub fn ruin_cache() { let _a = (0..1_000_000).collect::<Vec<i32>>(); } fn order_f<F: tract_num_traits::Float>(&a: &F, &b: &F) -> std::cmp::Ordering { if a < b { std::cmp::Ordering::Less } else { std::cmp::Ordering::Grea...
Rust
0
from kenzy import GenericSkill class KnockKnockSkill(GenericSkill): """ Skill to respond to knock knock jokes """ def __init__(self, **kwargs): """ Knock Knock Skill Initialization """ super().__init__(**kwargs) self.name = "KnockKnockSkill" ...
Python
1
"""AUTOGENERATED. DO NOT EDIT.""" from keras.api._v1.keras.__internal__.legacy import layers from keras.api._v1.keras.__internal__.legacy import rnn_cell
Python
1
import numpy as np from motpy.metrics import angular_similarity, calculate_iou from utils import assert_almost_equal, current_milli_time def test_ious(): b1 = [[10, 20]] b2 = [[10, 21], [30, 40]] iou_1d = calculate_iou(b1, b2, dim=1) assert_almost_equal(iou_1d, np.array([[0.9091, 0.]])) b1 = [[...
Python
1
as_bytes(points)?; self.compressor .compress_many(point_bytes) .map_err(into_py_err) } pub fn compress_chunks(&mut self, chunks: &PyList) -> PyResult<()> { let chunks = chunks .iter() .map(as_bytes) .collect::<PyResult<Vec<&[u8]>>>()...
Rust
0
Time!! }, ), # network-related parameters (see flow.core.params.NetParams and the # network's documentation or ADDITIONAL_NET_PARAMS component) net=NetParams( inflows=inflow, additional_params={ "speed_limit": TARGET_VELOCITY, "grid_array": { ...
Python
1
_position: usize, reader: &mut R, writer: &mut W, ) -> Result<HeadPositionUpdate, OpCodeExecutionError> where R: BufRead, W: Write, { use OpCode::*; match self { Add(param_modes) => self.execute_add(tape, head_position, param_modes.clone()), ...
Rust
0
n] makeJacobi from matrix") M = np.array([[4.0, 2.0, 1.0], [2.0, 3.0, 0.5], [1.0, 0.5, 1.0]]) j = nanoeigenpy.JacobiRotation() result = j.makeJacobi(M, 0, 1) assert isinstance(result, bool) norm_matrix = j.c**2 + j.s**2 assert isapprox(norm_matrix, 1.0, 1e-12) verbose and print("[JacobiRotation] makeGivens basic") j =...
Python
1
u32 = 32u32; #[doc = "*Required features: `\"Win32_Graphics_Direct3D11\"`*"] pub const D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_COUNT: u32 = 32u32; #[doc = "*Required features: `\"Win32_Graphics_Direct3D11\"`*"] pub const D3D11_DS_INPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST: u32 = 2u32; #[doc = "*Required features: `\"W...
Rust
0
erstional tone. \ If the passage is irrelevant to the answer, you may ignore it. QUESTION: '{query}' PASSAGE: '{relevant_passage}' ANSWER: """).format(query=query, relevant_passage=escaped) return prompt def generate_answers(prompt): genai.configure(api_key=os.getenv("GOOGLE_API_KEY")) ...
Python
1
flag_as_byte = mcu.get_flags().into(); assert_eq!(0x3, flag_as_byte, "Flags assertion failed: {:08b} != {:08b}", 0x3, flag_as_byte); } #[test] /// Tests substract immediate from word (SBIW) instruction /// /// SBIW opcode: 1001 0111 KKdd KKKK /// sbiw r25:24,1 -> 1001 0111 0000 0001...
Rust
0
mock_extract.side_effect = Exception("OCR failed") with pytest.raises(Exception, match="OCR failed"): await extractor.extract_bytes_async(b"image data") mock_unlink.assert_called_once() def test_image_edge_cases_supported_mime_types_constant() -> ...
Python
1
, #[doc = r" Reserved"] _Reserved(u8), } impl DBG_PAGER { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { DBG_PAGER::_0000 => 0, DBG_PAGER::_0001 => 1, DBG_PAGER::_0100 => 4, DBG_PAGER::_0111 => 7,...
Rust
0
struct SetVouchersResponse {} impl SetVouchersResponse { pub fn generate<W: Write>( &self, writer: &mut xml::EventWriter<W>, has_cwmp: bool, ) -> Result<(), GenerateError> { write_empty_tag(writer, &cwmp_prefix(has_cwmp, "SetVouchersResponse")[..])?; Ok(()) } } #[de...
Rust
0
ges, labels in valid_loader: images = images.to(device) labels = labels.to(device) outputs = model(images) _, predicted = torch.max(outputs.data, 1) total += labels.size(0) correct += (predicted == labels).sum().item() ...
Python
1
SocketAddrV4::new(ip, 0); let socket = try!(UdpSocket::bind(addr)); try!(socket.set_read_timeout(Some(timeout))); try!(socket.send_to(SEARCH_REQUEST.as_bytes(), "172.16.31.10:1900")); let mut buf = [0u8; 1024]; let (read, _) = try!(socket.recv_from(&mut buf)); let text = try!(str::from_utf8(&b...
Rust
0
usize { // number of 7 bit units + 1 if v == 0 { 1 } else { let max_one = 63 - v.leading_zeros(); (max_one / 7) as usize + 1 } } #[inline] pub fn zigzag(v: i64) -> u64 { let z = (v << 1) ^ (v >> 63); z as u64 } #[inline] pub fn unzigzag(v: u64) -> i64 { (v >> 1) as...
Rust
0
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2019 Kyoto University (Hirofumi Inaguma) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import io import os from setuptools import find_packages from setuptools import setup requirements = { 'install': [ 'configargparse>=1.0', ...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.model import BaseRequest from lark_oapi.core.enum import HttpMethod, AccessTokenType from .search_assigned_user_request_body import SearchAssignedUserRequestBody class SearchAssignedUser...
Python
1
ymbol(&self, other: &Self) -> bool { discriminant(self) == discriminant(other) } } <reponame>MaulingMonkey/kakistocracy use super::{on_hwnd_creating, on_hwnd_destroyed}; use winapi::ctypes::c_int; use winapi::shared::minwindef::*; use winapi::shared::windef::*; use winapi::um::winuser::*; use winapi::um::p...
Rust
0
t=None, algorithm='mpmath'): """ EXAMPLES:: sage: # needs mpmath sage: harmonic_number(20).n() # this goes from rational to float 3.59773965714368 sage: harmonic_number(20).n(200) 3.59773965714368191148376906... sage: harmonic_num...
Python
1
"((BTC|XBC|bitcoin|mBTC|CBC|MBC|millibitcoin|millibit|cBTC|bitcent|centibit|centibitcoin|USD|dollar|american|AUD|australian|CAD|canadian|GBP|pound|EUR|euro|JPY|yen)(s)?)" regex_all_string = "(\\bALL\\b)" #all keyword regex_flip_string = "(\\bFLIP\\b)" #flip keyword #these silly variations are to captur...
Python
1
# Code generated by Lark OpenAPI. import lark_oapi as lark from lark_oapi.api.compensation.v1 import * def main(): # 创建client client = lark.Client.builder() \ .app_id(lark.APP_ID) \ .app_secret(lark.APP_SECRET) \ .log_level(lark.LogLevel.DEBUG) \ .build() # 构造请求对象 req...
Python
1
from abc import ABC, abstractmethod from transformers import AutoModel, AutoTokenizer import torch class EmbeddingModel(ABC): def __init__(self, config): self.config = config self.model = None self.tokenizer = None @abstractmethod def load_model(self): pass @abstractm...
Python
1
e { headline: String, location: String, author: String, content: String, } impl Summary for NewsArticle { fn summarize(&self) -> String { format!("{} by {}, ({})", self.headline, self.author, self.location) } } #[derive(Debug)] struct Tweet { pub username: String, pub content: ...
Rust
0
ch & 0b0011_1111)) as u8; 6 } } } #[cfg(test)] mod tests { use super::*; #[test] pub fn valid_mutf8() { assert!(is_mutf8_valid(b"Hello World")); assert!(is_mutf8_valid("Ich grüße die Welt".as_bytes())); assert!(is_mutf8_valid("你好,世界".as_bytes())); //...
Rust
0
"""Tests for threshold component."""
Python
1
import random, pygame PANEL_width = 400 PANEL_highly = 500 FONT_PX = 15 pygame.init() # 创建一个窗口 winSur = pygame.display.set_mode((PANEL_width, PANEL_highly)) font = pygame.font.SysFont('123.ttf', 22) bg_suface = pygame.Surface((PANEL_width, PANEL_highly), flags=pygame.SRCALPHA) pygame.Surface.convert(bg_suface) bg_sufa...
Python
1
import bpy from bpy.types import Operator, Panel class BooleanUnionOperator(Operator): bl_idname = "object.boolean_union" bl_label = "布尔联合" def execute(self, context): """ 布尔联合操作将选中的多个对象合并成一个对象。 例如,选中两个立方体后执行此操作,将这两个立方体合并为一个。 """ objects = context.selected_objects ...
Python
1
def parse_ProtobufCFieldDescriptor(addr, index): entry_addr = addr+48*index name_addr = get_wide_dword(entry_addr) name = get_strlit_contents(name_addr, -1, STRTYPE_C) id = get_wide_dword(entry_addr+0x4) offset = get_wide_dword(entry_addr+0x14) descriptor = get_wide_dword(ent...
Python
1
l modelpacks to bring them up-to-date. global_fidpairs = None #find_sufficient_fiducial_pairs_per_germ_greedy(smq1Q_XZ.target_model('full TP'), _prep_fiducial_circuits, _meas_fiducial_circuits, germs_robust, inv_trace_tol=10, initial_seed_mode='greedy') _pergerm_fidpairsdict ={(('Gxpi2',0),): [(...
Python
1
ue': labels = self.request.json["labels"] else: labels = self.request.json["issue"]["labels"] label_sql_request = SQLRequest(self.Session, Labels) for lbl in labels: new_label = Labels( name = lbl["title"], labelId = lbl["id"] ...
Python
1
""" Fetch the Danish Company Registry (CVR) and store the records in a database. """ import sys import requests import json import time import sling import sling.flags as flags flags.define("--apikey", help="CVR API key file", default="local/keys/cvr.txt", metavar="FILE") flags...
Python
1
from dataclasses import dataclass from typing import Annotated, TYPE_CHECKING import strawberry import strawberry_django from strawberry import ID from core.graphql.filter_mixins import BaseFilterMixin if TYPE_CHECKING: from netbox.graphql.filter_lookups import TreeNodeFilter from .filters import ContactAssi...
Python
1
); create_twin(); create_farm(); assert_noop!( TfgridModule::delete_farm(Origin::signed(alice()), 1), Error::<TestRuntime>::CannotDeleteFarmWithPublicIPs ); }); } #[test] fn test_delete_farm_without_publicips_works() { ExternalityBuilder::build().execute_...
Rust
0
# This code is part of Qiskit. # # (C) Copyright IBM 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
Python
1
s auto-generated via `butcher` # Is needed only for type checking and IDE support without any additional plugins super().__init__( chat_id=chat_id, user_id=user_id, is_anonymous=is_anonymous, can_manage_chat=can_manage_chat, ...
Python
1
app.host_state.select(Some(0)); loop { terminal.draw(|frame| { let chunks = Layout::default() .direction(Direction::Vertical) .margin(1) .horizontal_margin(4) .constraints([Constraint::Length(3), Constraint::Percentage(90)].a...
Rust
0
# DO NOT EDIT! This file was generated by jschema_to_python version 0.0.1.dev29, # with extension for dataclasses and type annotation. from __future__ import annotations import dataclasses from typing import List, Optional from torch.onnx._internal.diagnostics.infra.sarif import ( _artifact_change, _message,...
Python
1
("export-address-labels", Some(subcommand_matches)) => { let filename = value_t_or_exit!(subcommand_matches, "filename", PathBuf); config.export_address_labels(&filename)?; println!("Address labels exported to {:?}", filename); } ...
Rust
0
let recent_blockhashes = create_test_recent_blockhashes(0); let authorized = nonce_account.unsigned_key(); nonce_account .initialize_nonce_account(&authorized, &recent_blockhashes, &Rent::free()) .unwrap(); assert!(!verify_nonce_account( ...
Rust
0
t..." output_filename = output_dir + "/" + "infer.html" outfile = open(output_filename, "w") begin_html(outfile, "Abstract Machine Generation Versions - Analysis of benchmark results") print >>outfile, "<div class='info'>This report was automatically generated on %s -- Jose F. Morales (jfran@clip.dia.fi...
Python
1
(train_root), *filename.parts[-2:]) for filename in train_root.glob(f"{scene_prefix}_*.avi")] train_samples = DataFrame(train_list, columns=["root", "folder", "image_path"]) train_samples["split"] = "train" # get paths to testing folders test_root = Path(root) / "testing/frames" test_folders = [fil...
Python
1
menu_item: ::std::option::Option< unsafe extern "C" fn( tree: *mut TreeViewO, parent: *mut TreeViewParentT, object: TtIdT, object_property: u32, id_base: u64, res: *const UiMenuResultT, ), >, pub set_empty_text: ::std::optio...
Rust
0
latest: "2.4.3".to_string(), release: "2.4.3".to_string(), versions: Versions { version: vec![ "2.0.0".to_string(), "2.1.0".to_string(), "2.2.0".to_string(), ], ...
Rust
0
_8009, 0x0000_059E,// EVEX_Vpgatherdd_xmm_k1_vm32x 0x0090_0002, 0x0502_8409, 0x0000_05DF,// EVEX_Vpgatherdd_ymm_k1_vm32y 0x0090_0002, 0x0502_8809, 0x0000_0620,// EVEX_Vpgatherdd_zmm_k1_vm32z 0x0090_0002, 0x0502_9009, 0x0000_059E,// EVEX_Vpgatherdq_xmm_k1_vm32x 0x0090_0002, 0x0502_9409, 0x0000_059F,// EVEX_Vpgatherd...
Rust
0
ain_acc, train_acc_top5)) test_acc, test_acc_top5, test_loss = validate(val_loader, model, criterion, opt) if not opt.multiprocessing_distributed or opt.rank % ngpus_per_node == 0: print(' ** Acc@1 {:.3f}, Acc@5 {:.3f}'.format(test_acc, test_acc_top5)) test_merics ...
Python
1
from logging import Logger, basicConfig, getLogger import facefusion.choices from facefusion.common_helper import get_first, get_last from facefusion.types import LogLevel def init(log_level : LogLevel) -> None: basicConfig(format = '%(message)s') get_package_logger().setLevel(facefusion.choices.log_level_set.get(...
Python
1
http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // ______________________________________________________________________ // Type combining // // There are three type combiners: sub, lub, and glb. Each implements // the...
Rust
0
DiagCoulombEvolutionJW(ucj_op.norb, diag_colomb_mat, -1.0), qubits, ) yield CircuitInstruction( OrbitalRotationJW(ucj_op.norb, orbital_rotation), qubits ) if ucj_op.final_orbital_rotation is not None: yield CircuitInstruction( OrbitalRotationJW(uc...
Python
1
e=img_shapes) # Use ONNX::NonMaxSuppression in deployment from mmdet.core.export import add_dummy_nms_for_onnx batch_mlvl_scores = batch_mlvl_scores.unsqueeze(2) score_threshold = cfg.nms.get('score_thr', 0.0) nms_pre = cfg.get('deploy_nms_pre', -1) dets, _ = add_dummy_n...
Python
1
from pathlib import Path from peft import PeftModel, PeftConfig from transformers import AutoModelForCausalLM, AutoTokenizer import os, psutil import torch try: from transformers import BitsAndBytesConfig _HAS_BNB = True except ImportError: # bitsandbytes not available on this machine _HAS_BNB = Fa...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2015 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
conj(e).T.dot(e) # bar.next() PRESSmin = np.min(PRESS, axis=0) m_sel = np.argmin(PRESS, axis=0) k_sel = np.argmin(PRESSmin) # 第 k_sel波段为初始波段时最佳,波段数目为 m_sel(k_sel) var_sel_phase2 = SEL[:m_sel[k_sel], k_sel].astype(np.int) # 最后消去变量 # 第 3.1 步 ...
Python
1
lenging...", ) self.challenge_task(task_id) elif ( task_state == TaskStateMap.CHALLENGED.value and start_block + RESOLVE_BLOCKS_DELAY * 2 < current_block ): # the task is challenged, but n...
Python
1
xcf\x0d\ \xe3\x86\xdc\xa1Y\x8eT&\x93}\xc6\xd0m\xf0\x81\xa6\ H,\x8dP\xfcN\xa3R\xc0@Gs\x09\x00\xack\ \xec\xf6X%\x12\xc7\xd7n'\x06\xf4\xea\x89\x9dO\xda\ \xa5\x16K\xad[\xdd\xfa+\x91\xc8^\xa1'\xea\x8fq\ +\xfcet^1\xfb\xb6\xb5\x99\xe1\xa4\xe1\xbd;9\ U?\xc3`\xfa\xc8>\x13v\x9d\xbd\xd5\xa39\xech\ \xac\xb2\x86\xbcD\x22-9r\xe1\xe6...
Python
1
>HTTP Status Code:</i> 404 Not Found</p> /// </li> /// <li> /// <p> /// <i>SOAP Fault Code Prefix:</i> Client</p> /// </li> /// </ul> /// </li> /// <li> /// <ul> /// <li> /// <p> /// <i>Code:</i> NotImplemented</p> /// </li> /// <li> /// <p> /// <i>Descrip...
Rust
0
s [status::R](R) reader structure"] impl crate::Readable for STATUS_SPEC { type Reader = R; } #[doc = "`reset()` method sets STATUS to value 0"] impl crate::Resettable for STATUS_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } } <reponame>xous-os/rust // Test the parse err...
Rust
0
let k = dir as usize; iter.next[1 - k] = EdgeIndex::end(); iter.skip_start = NodeIndex::end(); } iter } /// Return an iterator of all neighbors that have an edge between them and `a`, /// in either direction. /// If the graph's edges are undirected, ...
Rust
0
# Copyright (c) 2022, Andrey "Limych" Khrolenok <andrey@khrolenok.ru> # Creative Commons BY-NC-SA 4.0 International Public License # (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/) """Constants for backup_source.""" from typing import Final import voluptuous as vol from homeassistant.const i...
Python
1
empty() { html!{{for languages.iter().map(|p| self.render_language(p))}} } else { html! { <div class="notification is-warning is-light"> { EMPTY_LANGUAGES } </div> ...
Rust
0
et() video_frame = in_video.getCvFrame() # For debugging if self.trace & 4: pre_pd_manip = self.q_pre_pd_manip_out.tryGet() if pre_pd_manip: pre_pd_manip = pre_pd_manip.getCvFrame() cv2.imshow("pre_pd_manip", pre_pd_manip) ...
Python
1
__all__ = ["RetencionesRepositoryDependency", "RetencionesRepository"] from typing import Annotated from fastapi import Depends from ...config import BaseRepository from ..schemas import RetencionesReport class RetencionesRepository(BaseRepository[RetencionesReport]): collection_name = "icaro_retenciones" ...
Python
1
.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . <http://www.w3.org/2001/sw/RDFCore/ntriples/> rdf:type foaf:Document ; <http://purl.org/dc/terms/title> \"N-Triples\"@en-US ; ...
Rust
0
import tensorflow as tf from tensorflow.keras.layers import Input, GRU, Flatten, Dense, Dropout from tensorflow.keras.optimizers import Adam def create_model(input_shape, num_classes=3, gru_units=256, dropout_rate=0.2, learning_rate=0.001): """ Creates a GRU-based neural network model for classification. ...
Python
1
bh
Python
1
method performs the actual communication with the server and returns the respective result. //! //! # Usage //! //! ## Setting up your Project //! //! To use this library, you would put the following lines into your `Cargo.toml` file: //! //! ```toml //! [dependencies] //! google-firebasedynamiclinks1 = "*" //! # ...
Rust
0
} } impl<T, U> PartialEq<Array<U>> for SmallArray<T> where T: PartialEq<U>, { #[inline] fn eq(&self, other: &Array<U>) -> bool { self[..] == other[..] } } macro_rules! __smallarray_T_eq_primitive_array { ($len:expr) => { impl<T, U> PartialEq<[U; $len]> for SmallArray<T> wh...
Rust
0
3."] pub mod io3; <reponame>abigger87/starknet-rs<gh_stars>1-10 use flate2::{write::GzEncoder, Compression}; use rand::prelude::*; use starknet_core::types::{ AbiEntry, AddTransactionResult, ContractArtifact, ContractDefinition, DeployTransactionRequest, EntryPointsByType, FieldElement, TransactionRequest, }; u...
Rust
0
max_index_len = globals.len().to_string().len(); for (i, (val, global)) in globals.iter().zip(dbg.get_file()?.module().globals()).enumerate() { println!("Global {:>3$}: {:15} : {}", i, global.name(), val, max_index_len); } } Ok(()) } fn cmd_context(dbg: &mut Debugger, _args: &[CmdA...
Rust
0
for item in history) async for event, meta in agent.run(get_message_text(input)): if meta.name == "success" and event.state.steps: step = event.state.steps[-1] if not step.tool: continue tool_name = step.tool.name if tool_name == "final_ans...
Python
1
1 Global Office - GTIN-8")), ("9629", GS18Prefix(value="962", usage="GS1 Global Office - GTIN-8")), ], ) def test_gs1_8_prefix(value: str, expected: GS18Prefix | None) -> None: assert GS18Prefix.extract(value) == expected def test_gs1_8_prefix_is_hashable() -> None: prefix = GS18Prefix.extract("97...
Python
1
interpreters::InterpreterPtr; use crate::pipelines::new::executor::PipelinePullingExecutor; use crate::sessions::QueryContext; use crate::sql::Planner; /// Interpret SQL query with new SQL planner pub struct SelectInterpreterV2 { ctx: Arc<QueryContext>, query: String, } impl SelectInterpreterV2 { #[allow(...
Rust
0
"""/* * La última semana de 2021 comenzamos la actividad de retos de programación, * con la intención de resolver un ejercicio cada semana para mejorar * nuestra lógica... ¡Hemos llegado al EJERCICIO 100! Gracias 🙌 * * Crea un programa que calcule los puntos de una palabra. * - Cada letra tiene un valor asignado...
Python
1
# # SPDX-License-Identifier: MIT # # Copyright (c) 2025 Carsten Igel. # # This file is part of simplepycons # (see https://github.com/carstencodes/simplepycons). # # This file is published using the MIT license. # Refer to LICENSE for more information # """""" # pylint: disable=C0302 # Justification: Code is generated ...
Python
1
); )+ } } <reponame>logicai-io/rs-natural extern crate natural; use natural::tf_idf::TfIdf; #[test] fn test_basic_usage() { let mut tf_idf = TfIdf::new(); tf_idf.add("this document is about rust."); tf_idf.add("this document is about erlang."); tf_idf.add("this document is about erlang and...
Rust
0
// ...though we still need to pad between the text and button edge .padding_right(8.0) // Round the button's image's exterior corners so they don't protrude past the button's // corners. However, per design, we want the images interior corners to be // unround...
Rust
0
''' Websecweekly Module for Hackerone Hacktivity MIT License Using Kimonolabs API ''' import requests import sqlite3 import datetime import json i = datetime.datetime.now() timestamp = "%s%s%s%s" % (i.day, i.month, i.year, i.hour) conn = sqlite3.connect('../dbs/hackerone_hacktivity.db') c = conn.cursor() c.execute('''...
Python
1
return False def set_favorite(self, IsFavorite, KodiItemId, ImageUrl, EmbyItemId, isAudio): if isAudio: utils.FavoriteQueue.put(((common.set_Favorites_Artwork_Overlay("Playlist", "Audio", EmbyItemId, self.EmbyServer.ServerData['ServerId'], ImageUrl), IsFavorite, f"{utils.PlaylistPathMusic}{K...
Python
1
.git_refs.insert( (*added_git_ref_name).clone(), right.git_refs.get(*added_git_ref_name).unwrap().clone(), ); } for removed_git_ref_name in base_git_ref_names.difference(&right_git_ref_names) { // TODO: Handle modify/remove conflict (i.e. if left and base are different ...
Rust
0
ns=out['positions'], positions_raw=out['positions'], target_positions=out['target_positions'], velocities=out['velocities'], velocities_raw=out['velocities'], accelerations=out['accelerations'], torques=out['torques'], torques_raw=out['torques_raw'], b...
Python
1
.data_type.clone(), true, )]) } fn expressions(&self) -> Vec<Arc<dyn PhysicalExpr>> { vec![self.expr.clone()] } fn create_accumulator(&self) -> Result<Box<dyn Accumulator>> { Ok(Box::new(MaxAccumulator::try_new(&self.data_type)?)) } fn name(&self) -> &str {...
Rust
0
cessor"] = self.cli_args.skip_preprocessor if self.cli_args.template_strict_undefined: self.config["template_allow_undefined"] = False if self.cli_args.pp_strict_undefined: self.config["preprocessor_allow_undefined"] = False if self.cli_args.legacy_prince: se...
Python
1
unsafe { tgt.map_buffer(tinygl::gl::MAP_READ_BIT | tinygl::gl::MAP_WRITE_BIT)? }; Ok(Self { tgt, mapped_ptr }) } } impl Drop for MappedGpuImageMut<'_> { fn drop(&mut self) { unsafe { self.tgt.unmap_buffer(); } } } impl MappedImageData for MappedGpuImage<'_> { ...
Rust
0
def read(inp): lines=inp.split("\n") out=[] expecting_value=False current_record={} t="" for i in lines: if expecting_value: if i.startswith("|"): t+=i[1:]+"\n" continue else: current_record[directive]=t ...
Python
1
. """ return self.items[self.pos] def next(self) -> t.Any: """Return the current item, then advance :attr:`current` to the next item. """ rv = self.current self.pos = (self.pos + 1) % len(self.items) return rv __next__ = next class Joiner: ...
Python
1
print(f"[CameraThread] {error_msg}") self.error_occurred.emit(error_msg, self.camera_index) self.msleep(2000) continue print(f"[CameraThread] Successfully opened camera {source}") while self.running and cap.isOpened(): re...
Python
1
for future in concurrent.futures.as_completed(result_to_snr_index): snr_index = result_to_snr_index[future] bler, thp = future.result() results[snr_index] = bler blers = np.zeros_like(snrs_list) for snr_index in results: blers[snr_index] = results[snr_index] num_...
Python
1
(id, &http::client::Builder::default(), &defn) .await .err() .unwrap(); assert!(res.to_string().contains("Missing Configuration")); Ok(()) } use http_types::{Status, StatusCode}; use crate::Conn; use crate::schema::{comments, pages, posts}; use diesel::pg::Pg; use diesel::{RunQueryDsl...
Rust
0
(1200, min(2500, conclusion_max_words)) conclusion_word_count = f"{conclusion_min_words}-{conclusion_max_words}" conclusion_prompt = f"""请为主题为"{query}"的市场研究报告生成最终的"结论与建议"章节。 结论应总结报告的主要发现,建议应针对不同的利益相关者(如投资者、企业、政府等)提供具体的行动建议。 要求: 1. 总结3-5个最关键的研究发现,每个发现必须有数据支持 2. 提供有针对性的...
Python
1