text
string
label_name
string
labels
int64
UUID}; fn generate_key(session: &mut Session) -> Result<(Vec<u8>, Vec<u8>)> { // Pass in the prime and base let p0 = ParamValue::new(23, 5, ParamType::ValueInput); // Save public and private key size let p1 = ParamValue::new(0, 0, ParamType::ValueOutput); // Vector for generated keys let mut p...
Rust
0
f"n ({n}) rows cannot be greater than the batch size ({batch_size})" ) users = user_item_batch[:, 0] # Shape [bs] items = user_item_batch[:, 1] # Shape [bs] users = users[:n].numpy() items = items[:n].numpy() # Squeeze the rat...
Python
1
ing.replace(font30[cout], normal[cout]) string = string.replace(font1L[cout], normalL[cout]) string = string.replace(font2L[cout], normalL[cout]) string = string.replace(font3L[cout], normalL[cout]) string = string.replace(font4L[cout], normalL[cout]) string = string.replace(font...
Python
1
.join(if minify { "test262-min" } else { "test262" }); let file_name = entry .file_name() .unwrap() .to_str() .expect("to_str() failed") .to_string(); let input = read_to_string(&entry).unwrap(); let ignore = IGNORED_PASS_TESTS.contains(&&*file_name); if igno...
Rust
0
of the transaction to update. /// * `update` - The updated transaction fields. async fn update_transaction( &self, transaction_id: Uuid, update: NewTransaction, ) -> Result<Transaction, UpdateTransactionError>; } #[derive(Debug)] pub enum UpdateTransactionError { TransactionNotF...
Rust
0
kano (and via that vk-sys) already handles that and we just need // to call the convenient creation function, whose destructor will also call the // corresponding destroy function. // // Unfortunately, vulkano doesn't support setting a value for pNext in // vkInstanceCreateInfo so we can't get debug...
Rust
0
package .targets .iter() .filter(|target| target.kind.contains(&static_lib) && target.kind.contains(&cdylib)) .nth(0) { return Ok(Some(lib_target.name.clone())); } } Ok(None) } fn compile_se...
Rust
0
inish(); Ok(smithy_http::body::SdkBody::from(out)) } pub fn serialize_operation_delete_spot_datafeed_subscription( input: &crate::input::DeleteSpotDatafeedSubscriptionInput, ) -> Result<smithy_http::body::SdkBody, std::convert::Infallible> { let mut out = String::new(); #[allow(unused_mut)] let mut...
Rust
0
oc = "90% of the frame interval."] #[inline(always)] pub fn _90pcnt(self) -> &'a mut W { self.variant(PERFRINT_A::_90PCNT) } #[doc = "95% of the frame interval."] #[inline(always)] pub fn _95pcnt(self) -> &'a mut W { self.variant(PERFRINT_A::_95PCNT) } #[doc = r"Writes ra...
Rust
0
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.construct import init class EcoExamResultReport(object): _types = { "name": str, "url": str, "answer_time": str, } def __init__(self, d=None): ...
Python
1
sı', 'ug': 'ئوتتۇرا ئەسىر ئىرېلاندچە', 'uk': 'середньоірландська', 'vi': 'Tiếng Ai-len Trung cổ', 'yrl': 'irãdei médiu', 'yue': '中古愛爾蘭文', 'yue-Hans': '中古爱尔兰文', 'yue-Hant': '中古愛爾蘭文', 'zh': '中古爱尔兰语', 'zh-Hans': '中古爱尔兰语', 'zh-Hant': '中古愛爾蘭文'}, 'mgb': {'en': 'Mararit'}, 'mgc': {'en': 'Morokodo'}, 'mgd': {'en': ...
Python
1
# brute will be converting the number to binary and then changing the ith bit # using xor n = 13 bit = 2 val = 1 << bit print(n ^ val) # using ans n = 13 bit = 2 val = 1 << bit print(n & ~(val))
Python
1
based on /// the arguments provided to `Mock::call`. This function will only be /// invoked if the arguments match the specified `args`. /// /// Arguments of `Mock::call` are still tracked. /// /// # Examples /// /// ``` /// use double::Mock; /// /// fn add_two(x: i64) -> i6...
Rust
0
Controls_Dialogs\"`*"] pub const OFN_NODEREFERENCELINKS: OPEN_FILENAME_FLAGS = 1048576u32; #[doc = "*Required features: `\"Win32_UI_Controls_Dialogs\"`*"] pub const OFN_LONGNAMES: OPEN_FILENAME_FLAGS = 2097152u32; #[doc = "*Required features: `\"Win32_UI_Controls_Dialogs\"`*"] pub const OFN_ENABLEINCLUDENOTIFY: OPEN_FI...
Rust
0
# 1초 = 1억 # 예를 들어 N의 최대값이 10만이라고 문제에서 주어진다면 # 1. O(N) 의 시간복잡도일 경우에 값이 10만 정도이니, 1/1000초 정도가 걸릴 것이라고 예상할 수 있다. # 2. O(N^2)의 시간복잡도의 경우에 값은 100억이므로, 100초 정도가 걸릴 것이라고 예상할 수 있다. # 제한 시간은 1초, N의 크기는 최대 100이니까, 러프하게 100^3해도, 1억이 넘지 않음으로 for룹을 3중으로 사용해여, 모든 경우에 수를 찾아보자. def blackJack(target, numList): tempNum = -1 for...
Python
1
let endpoint = String::from(format!("/chats/{}/users?page={}", id, page)); match BeamRequest::request(endpoint, HttpMethod::Get) { Ok(ref raw_body) => { let decoded: Vec<BeamChatUser> = match json::decode(raw_body) { Ok(data) => data, E...
Rust
0
#encoding:utf-8 #By:Eastmount CSDN 2021-02-01 import cv2 import numpy as np import matplotlib.pyplot as plt #读取图片 img = cv2.imread('test.bmp') image = cv2.cvtColor(img,cv2.COLOR_BGR2RGB) #图像平移矩阵 M = np.float32([[1, 0, 100], [0, 1, 80]]) rows, cols = image.shape[:2] img1 = cv2.warpAffine(image, M, (cols, rows)) #图...
Python
1
t_tt_|jatttgt_dt_|jatttQgt_tQt_|jatttQtgt_tt_|jatttQttgt_tt_|jatttQttgt_tt_|jagt_ttt_|jattgt_tt_|jattgt_tt_|jattgt_tt_|jattgt_tt_|jattgt_tt_|jattt}ttttgt_tt_|jattt}tt...
Python
1
import warnings warnings.filterwarnings('ignore') import os import tyro import imageio import numpy as np import tqdm import cv2 import torch import torch.nn.functional as F from torchvision import transforms as T import torchvision.transforms.functional as TF from safetensors.torch import load_file import kiui from k...
Python
1
Disable, "false" => Toggle::Disable, "f" => Toggle::Disable, "0" => Toggle::Disable, // anything else _ => Toggle::Invalid, }) } } impl From<bool> for Toggle { fn from(b: bool) -> Self { match b { true => Toggle::Enable, ...
Rust
0
'.\n' '\n' '// Latest published version of this file: https://raw.githubusercontent.com/boostorg/leaf/gh-pages/leaf.hpp.\n' '\n' '// Copyright 2018-2024 Emil Dotchevski and Reverge Studios, Inc.\n' '// Distributed under the Boost Software License, Versi...
Python
1
rget_arch = "aarch64", link_name = "llvm.aarch64.neon.uqrshl.v8i8")] fn vqrshl_u8_(a: uint8x8_t, b: int8x8_t) -> uint8x8_t; } vqrshl_u8_(a, b) } /// Unsigned signed saturating rounding shift left #[inline] #[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))] #[...
Rust
0
"ช่วงเวลาที่นายหลี่ เติงฮุย เป็นประธานาธิบดี การเมืองของไต้หวัน", "เกิดการแตกแยกออกเป็น 3 ฝ่ายคือ 1) พวกก๊กมินตั๋ง ที่ต้องการกลับ", "ไปรวมประเทศกับจีนแผ่นดินใหญ่ (รวมจีนแผ่นดินใหญ่ภายใต้การปกครอง", "ของสาธารณรัฐจีน) 2) พวกที่ต้องการให้ไต้หวันเป็นประเทศอิสระไม่", "เกี่ยวข้องกับจีน...
Rust
0
.split()) read_to_chr_map[m[0]]=m[1] nodes_seen=set([x.split("_")[0] for x in g.nodes()]) for node in nodes_seen: read_to_chr_map.setdefault(int(node),-1) #print nx.info(g) print "Num reads read : "+str(len(read_to_chr_map)) for node in g.nodes(): nodei...
Python
1
#!/usr/bin/env python3 import os from glob import glob from os.path import expanduser from platform import system from sqlite3 import OperationalError, connect from instaloader import Instaloader, ConnectionException from dotenv import load_dotenv load_dotenv() # 🔍 获取 Firefox cookies.sqlite 文件路径 def get_cookiefile()...
Python
1
1)) ) (memory 1) (export "memory" (memory 0)) (export "_start" (func $_start)) (data (i32.const 0) "Hello, world!\0a") )"#; #[test] fn workload_run_return_1() { let bytes = wat::parse_str(RETURN_1_WAT).expect("error parsing wat"); let results: Vec<i32> = Load...
Rust
0
super::GadgetCaller; use crate::object::{Array, Object}; use crate::{Environment, Evaluator}; use acvm::acir::circuit::gate::{GadgetCall, GadgetInput, Gate}; use acvm::acir::OPCODE; use noirc_frontend::hir_def::expr::HirCallExpression; use super::RuntimeErrorKind; pub struct EcdsaSecp256k1Gadget; impl GadgetCaller f...
Rust
0
'dims' from image 'slide' contained within 'mask'. @param {Openslide Slide obj} slide: image object @param {numpy matrix} mask: where 0 is outside region of interest and 1 indicates within @param {int} numPatches @param {tuple} dims: (w,h) dimensions of patches @param {string} dirPath: directory in...
Python
1
let paths = &PATHS[..500]; b.iter(|| { ( get_scores("x", paths), get_scores("xt", paths), get_scores("xtc", paths), get_scores("xtco", paths), get_scores("xtcon", paths), get_scores("xtconf", paths), ) }) } #[bench] fn...
Rust
0
print(" - connectome_%s.graphml" % parkey) g2 = nx.Graph() # Create graph nodes for u_gml, d_gml in G.nodes(data=True): g2.add_node(u_gml) g2.nodes[u_gml]["dn_multiscaleID"] = d_gml["dn_multiscaleID"] ...
Python
1
77, 0x65, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x31...
Rust
0
""" Classifies: CHEBI:47908 alkanethiol """ from rdkit import Chem def is_alkanethiol(smiles: str): """ Determines if a molecule is an alkanethiol based on its SMILES string. An alkanethiol is a compound in which a sulfanyl group (-SH) is attached to an alkyl group. Args: smiles (str): SMILES ...
Python
1
s, stride, pad, dilation): downsample = None if stride != 1 or self.inplanes != planes * block.expansion: downsample = nn.Sequential( nn.Conv2d(self.inplanes, planes * block.expansion, kernel_size=1, stride=stride, bias=False), nn.Bat...
Python
1
cy metrics if latency_samples: latency_metrics = LatencyMetrics( avg_ms=statistics.mean(latency_samples), min_ms=min(latency_samples), max_ms=max(latency_samples), p95_ms=self._calculate_percentile(latency_samples, 95), ...
Python
1
), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dthrctl](index.html) module"] ...
Rust
0
rite global", WATCHPOINT_CREATED, substrs=[ 'Watchpoint created', 'size = 4', 'type = w', '%s:%d' % (self.source, self.decl)]) cmd_script_file = os.path.join(self.getSourceDir(), ...
Python
1
m("foo")); // let strs: Arena<&String> = Arena::new(); // let str1 = strs.gc_alloc(&*gced); // drop(strings); // let _str3 = &*str1; // } // #[test] // fn hidden_lifetime_test() { // struct Bar<'b> { // _b: &'b str, // } // struct Foo2<'a, 'b> { // _bar: Option<Gc<'a, Bar<'b...
Rust
0
z); for inside_point in inside_points { self.grid_positions.insert(*inside_point); } } pub fn vertices_indices(&self) -> (Vec<[T; 3]>, Vec<usize>) { let mut meshes = Vec::new(); let set: HashSet<_> = self.grid_positions.iter().collect(); for voxel_pos in self....
Rust
0
def masks2segments(masks, strategy='largest'): segments = [] for x in masks.int().cpu().numpy().astype('uint8'): c = cv2.findContours(x, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)[0] if c: if strategy == 'concat': c = np.concatenate([x.reshape(-1, 2) for x in c]) ...
Python
1
Builder`](crate::array::BufferBuilder) capable //! of creating a [`Buffer`](crate::buffer::Buffer) which can be used //! as an internal buffer in an [`ArrayData`](crate::array::ArrayData) //! object. mod boolean_buffer_builder; mod boolean_builder; mod buffer_builder; mod decimal_builder; mod fixed_size_list_builder; ...
Rust
0
000]; pub const GREEN_YELLOW: [f32; 4] = [0.678, 1.000, 0.184, 1.000]; pub const CHARTREUSE: [f32; 4] = [0.498, 1.000, 0.000, 1.000]; pub const LAWN_GREEN: [f32; 4] = [0.486, 0.988, 0.000, 1.000]; pub const LIME: [f32; 4] = [0.000, 1.000, 0.000, 1.000]; pub const LIME_GREEN: [f32; 4] = [0.196, 0.804, 0.196, 1.000]; pub...
Rust
0
ing.info("Qoder 已成功启动") return True time.sleep(0.5) logging.warning(f"启动超时,但进程可能仍在初始化中") return False except Exception as e: logging.error(f"启动 Qoder 时发生错误: {str(e)}") return False def StartQoder(wait_...
Python
1
rightAJC_label: str = "RAJC", side: str = "both") -> None: """ Positions ankle joint centers from virtual AJC marker trajectories computed from another process. Args: acq (btk.btkAcquisition): An acquisition with virtual AJC marker trajectories. leftAJC_l...
Python
1
_BELOW_PUBLISH_THRESHOLD_PER_CLIENT: Result<GaugeVec> = try_create_float_gauge_vec( "gossipsub_scores_below_publish_threshold_per_client", "Relative number of scores below publish threshold per client", &["Client"] ); pub static ref SCORES_BELOW_GREYLIST_THRESHOLD_PER_CLIENT: Result<Gaug...
Rust
0
cb_window_t, pub window: xcb_window_t, pub parent: xcb_window_t, pub x: i16, pub y: i16, pub override_redirect: u8, pub pad1: [u8; 3], } impl Default for xcb_reparent_notify_event_t { fn default() -> Self { unsafe { std::mem::MaybeUninit::zeroed().assume_init() } } } /// The op...
Rust
0
regex = regex[1:] if regex.endswith('$'): dollar = '$' regex = regex[:-1] regex = "%s(%s)%s" % (carot, regex, dollar) return sed( filename, before=regex, after=r'%s\1' % char, use_sudo=use_sudo, backup=backup ) def contains(filename, text, exa...
Python
1
#!/usr/bin/env python3 """ Note: Keep in sync with spark-*/query.py (see README-accelerators.md for details) Highlights: - memory is split between heap (for Spark) and off-heap (for Comet) - Comet configuration is added to `SparkSession` - debug mode is added """ from pyspark.sql import SparkSession import pyspark.s...
Python
1
( "ARABIC LIGATURE SHADDA WITH SUPERSCRIPT ALEF", ( "(?:\u{0651}\u{0670}|\u{0670}\u{0651})", ["\u{FC63}", "", "", ""], ), ), // There is a special case when they are with Tatweel ( "ARABIC LIGATURE SHADDA WITH FATHA MEDIAL FORM", ( ...
Rust
0
high" => tag.red().to_string(), "#medium" => tag.yellow().to_string(), "#low" => tag.green().to_string(), _ => tag.magenta().to_string(), } } fn dump_line(i: usize, line: &str) { let caps = match TASK_LINE.captures(line) { None => return, Some(c) => c, }; let x ...
Rust
0
362_000 as Weight).saturating_mul(r as Weight)) } fn instr_i64rotr(r: u32) -> Weight { (26_535_000 as Weight).saturating_add((7_330_000 as Weight).saturating_mul(r as Weight)) } } use ic_types::NodeId; use std::collections::BTreeMap; pub(crate) fn crypto_for<T>(node_id: NodeId, crypto_components: &...
Rust
0
import os from pathlib import Path from crispy_forms.utils import render_crispy_form from django.test.html import Element, parse_html TEST_DIR = os.path.dirname(os.path.abspath(__file__)) def contains_partial(haystack, needle, ignore_needle_children=False): """Search for a html element with at least the corresp...
Python
1
* q.y) cosy_cosp = 1.0 - 2.0 * (q.y * q.y + q.z * q.z) return math.atan2(siny_cosp, cosy_cosp) @staticmethod def normalize_angle(angle): while angle > math.pi: angle -= 2.0 * math.pi while angle < -math.pi: angle += 2.0 * math.pi return angle def...
Python
1
futures::channel::mpsc::channel(input_device::INPUT_MESSAGE_BUFFER_SIZE); Ok(KeyboardBinding { message_sender, message_receiver, descriptor: KeyboardDescriptor {}, }) } descriptor => { Er...
Rust
0
Err(err) => { let def = ds.get(n).unwrap(); println!("✕ {}: {}", n, def.typ_.pretty(Some(&n.to_string()), false)); if let Pos::Some(pos) = err.pos() { if let Some(Ipld::String(input)) = store.get(pos.input) { println!("{}", pos.range(input)) } ...
Rust
0
atrous=False): """Convolution.""" padding = 'SAME' if not is_atrous and strides > 1: pad = kernel_size - 1 pad_beg = pad // 2 pad_end = pad - pad_beg if self._data_format == 'channels_first': x = tf.pad(x, [[0, 0], [0, 0], [pad_beg, pad_end], [pad_beg, pad_end]]) else:...
Python
1
# -*- coding: utf-8 -*- import sqlite3 as sqlite def listBarNormalStressesLaTeX(nmbDBase, nmbTabla, nmbArchivoListadoTex): '''Result of normal stresses in linear elements to include in a LaTeX file.''' archTex= open(nmbArchivoListadoTex) con= sqlite.connect(nmbDBase) con.row_factory= sqlite.Ro...
Python
1
HD$$A~uH3Lu'I*Lm$H|$HD$YHD$HЉHI9uHĠHL[]A\A]A^USHHH HEH{HXHC6XHC7[HE HC HE(HC(E0HHXHCpXC0X[]HHHEUSH@H HH@87XHHiHuH{HXHCXHC8XZHHXZH[]HHHH߾@LHĈLIztUSHHHHHEHCXHH@HUHX[]ÐSHG87XHHXHCXHC8X[USH@HHHHCXHW HHHLIz뱐XuH HHGX8uHAH...
Python
1
str { fn to_mask(&self) -> ImageMask { let mut mask = ImageMask::new(); mask.0 .iter_mut() .zip(self.split_whitespace()) .for_each(|(m_row, c_row)| { m_row .iter_mut() .zi...
Rust
0
/// Compute `exp(x / y)` with continued fraction method pub fn exp2(x: Fixed, y: Fixed) -> Fixed { continued_fraction(exp2_series(x, y), 25) } /// Continued fraction series for `ln(1 + x / y)` /// https://en.wikipedia.org/wiki/Natural_logarithm#Continued_fractions /// /// ```plain /// series_a: 0, 2y+x, 3(2y+x), 5...
Rust
0
_link)) => unsafe { let Dat { bod: a_bod, .. } = *a_link.as_ptr(); let Dat { bod: b_bod, .. } = *b_link.as_ptr(); triples.push((a_bod, b_bod, dep)); }, (DAGPtr::All(a_link), DAGPtr::All(b_link)) => unsafe { let All { uses: a_uses, dom: a_dom, img: a_img, .. } = *a...
Rust
0
cked(0) } { PLAYER_IS_FOUND => { log::debug!("Native command: PLAYER_IS_FOUND"); call_server_method(env, class, "runClientPlayerIsFoundState"); call_server_method(env, class, "runSendRolesState") } ...
Rust
0
= (stop_short - self.prev_stop_short) + (stop_long - self.prev_stop_long); let is_s2 = (stop_short < stop_long) as i8; // s2 should appear only when `STOP LONG` is above `STOP SHORT` let cross: i8 = self.cross_above.next((stop_long, stop_short)).into(); // also s2 should appear only when `STOP LONG` actually cross...
Rust
0
Style { fg: TB_DEFAULT, bg: TB_DEFAULT, }, user_msg: Style { fg: 0, bg: TB_DEFAULT, }, err_msg: Style { fg: TB_BOLD, bg: 1 }, topic: Style { fg: 14 | TB_BOLD, bg: T...
Rust
0
fn get_parent_shell(&self) -> Option<Widget> { unsafe { from_glib_none(gtk_sys::gtk_menu_shell_get_parent_shell( self.as_ref().to_glib_none().0, )) } } fn get_selected_item(&self) -> Option<Widget> { unsafe { from_glib_none(gtk_sys::gt...
Rust
0
# >>>>>>>>>> TELA DE LOGIN # BIBLIOTECAS PYTHON & GUI import sys import os # Adiciona o caminho do diretório pai ao PythonPath sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import tkinter as tk from tkinter import * from funcoes.exit import Exit from funcoes.funcionario import fazer...
Python
1
-> Result<Token, TokenError> { match self.tokens.pop() { Some((pos, t)) => { self.curr_pos = Some(pos); trace!("@{:?}", t); Ok(t) } _ => { trace!("@{:?}", self.err); Err(self.err.clone()) ...
Rust
0
""" This document is for testing the funtionality of NestNinja on a large dataset """ from test_utils import get_test_data from NestNinja import Navigator test_data = get_test_data() nav = ( Navigator(test_data) .nav("hits") .nav("hits") .nav("_source") .nav("Vrvirksomhed", index_name="cvrNummer") ...
Python
1
ep from running off the edges pad_width = [(p, p) for p in offset] image = np.pad(image, pad_width, mode='constant') mask = np.pad(mask, pad_width, mode='constant').ravel() output = np.pad(markers, pad_width, mode='constant') flat_neighborhood = _offsets_to_raveled_neighbors( image.shape, c...
Python
1
_id: NodeId, _hir_id: HirId) { // Don't check use statements } fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> { NestedVisitorMap::All(&self.cx.tcx.hir) } } use common::bytesrepr::{deserialize, ToBytes}; use common::key::Key; use common::value::Value; use error:...
Rust
0
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' hr_referral_background = fields.Image(related='company_id.hr_referral_background', readonly=False) def restore_defa...
Python
1
arange(num_qubit) np.random.shuffle(target) target = target[:num_traceout] target_cor = [num_qubit - 1 - i for i in target] target_cor.sort() dmt = mat.reshape([2, 2] * num_qubit) for cnt, val in enumerate(target_cor): ofs = num_qubit - cnt dmt = ...
Python
1
import random # Define the parameter ranges and types param_space = { "max-num-batched-tokens": {"type": "Integer", "range": [4000, 8192]}, "max-num-seqs": {"type": "Integer", "range": [64, 2048]}, "swap-space": {"type": "Integer", "range": [1, 8]}, "block-size": {"type": "Enumeration", "values": [8, 1...
Python
1
import os from griptape.chunkers import TextChunker from griptape.drivers.embedding.openai import OpenAiEmbeddingDriver from griptape.drivers.vector.astradb import AstraDbVectorStoreDriver from griptape.loaders import WebLoader # Astra DB secrets and connection parameters api_endpoint = os.environ["ASTRA_DB_API_ENDPO...
Python
1
for RSTCTL_SOFTRESET_CLR_SPEC { type Writer = W; } #[doc = "`reset()` method sets RSTCTL_SOFTRESET_CLR to value 0"] impl crate::Resettable for RSTCTL_SOFTRESET_CLR_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } } <filename>build/classes/visao/jasperreports-6.15.0/src/net/sf/jasperr...
Rust
0
#[doc = "Bits 8:15"] #[inline(always)] pub fn div_cnt_ch0(&mut self) -> DIV_CNT_CH0_W { DIV_CNT_CH0_W { w: self } } #[doc = "Bit 7"] #[inline(always)] pub fn tx_stop_ch0(&mut self) -> TX_STOP_CH0_W { TX_STOP_CH0_W { w: self } } #[doc = "Bit 6"] #[inline(always)] p...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
Bytes::from_static( "<!DOCTYPE html>\ <html>\ <head><meta charset=\"utf-8\" /><title>Actix web</title></head><body>\ <h1 id=\"welcome\" class=\"welcome\">Welcome!</h1><div>\ <h3>What is your name?</h3>\ <fo...
Rust
0
from __future__ import annotations from dataclasses import dataclass from datetime import date YEAR = 360 HALF_YEAR = YEAR // 2 @dataclass class Order: """Represents and order in an e-commerce system.""" customer: Customer def get_discount(self) -> float: """Returns the discount for the order....
Python
1
:START //.with(samotop::service::echo::EchoService) .with(samotop::service::mail::MailService::new("wooohoo")) .on_all(opt.ports) .as_task(), ); } #[derive(StructOpt, Debug)] #[structopt(name = "samotop")] struct Opt { /// SMTP server address:port #[structop...
Rust
0
s) let arg_tys = substs.types().filter(|ty| match ty.kind { TyKind::Closure(..) => false, _ => true, }); self.base.extract_tys(arg_tys, &self.txtcx, span) } fn extract_panic(&mut self, args: &Vec<ExprRef<'tcx>>, span: Span, is_fmt: bool) -> st::Expr<'l> { let f = self.factory(); let...
Rust
0
import asyncio import pydantic from autopr.actions.base import Action # The action's inputs class BashInputs(pydantic.BaseModel): command: str # The action's outputs class BashOutputs(pydantic.BaseModel): stdout: str stderr: str class Bash(Action[BashInputs, BashOutputs]): """ Run a bash com...
Python
1
::new([-s, -s, -s].into(), [ 0., 0., -1.].into()), CubeVertex::new([ s, s, -s].into(), [ 0., 0., -1.].into()), CubeVertex::new([-s, s, -s].into(), [ 0., 0., -1.].into()), // third face CubeVertex::new([ s, -s, s].into(), [ 1., 0., 0.].into()), CubeVertex::new([ s, -s, -s].into(), [ 1., 0., ...
Rust
0
np.testing.assert_allclose( x1.numpy(), x4.numpy(), rtol=1e-20, atol=1e-20 ) np.testing.assert_allclose( y1.numpy(), y2.numpy(), rtol=1e-20, atol=1e-20 ) np.testing.assert_allclose( y1.numpy(), y3.numpy(), rtol=1e-20, atol=1e-20 ) np.t...
Python
1
def reverse_delete(s,c): """Task We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c then check if the result string is palindrome. A string is called palindrome if it reads the same backward as forward. You should return a tuple contain...
Python
1
ne::Clone for Struct_tdTPM_COUNTER_VALUE { fn clone(&self) -> Struct_tdTPM_COUNTER_VALUE { *self } } impl ::std::default::Default for Struct_tdTPM_COUNTER_VALUE { fn default() -> Struct_tdTPM_COUNTER_VALUE { unsafe { ::std::mem::zeroed() } } } pub type TPM_COUNTER_VALUE = Struct_tdTPM_COUNTER_VALUE;...
Rust
0
import os import csv def load_careers(file_path): careers = [] print(f"Loading careers from: {file_path}") try: with open(file_path, newline='', encoding='utf-8') as csvfile: reader = csv.DictReader(csvfile) for row in reader: skills = [skill.strip().lower() ...
Python
1
ettoPoint>, } impl KeyImageGen<Vec<Scalar>, Vec<RistrettoPoint>> for MLSAG { /// Some signature schemes require the key images to be signed as well. /// Use this method to generate them fn generate_key_image<Hash: Digest<OutputSize = U64> + Clone + Default>( ks: Vec<Scalar>, ) -> Vec<RistrettoP...
Rust
0
Adapter for MemoryAdapter { /// currently this function only supports equality matching — we'd probably want to add more /// kinds of matching and querying in the future, maybe by building into query object fn list(&self, params: &JsonObject) -> BoxFuture<JsonObject, (ErrorKind, JsonValue)> { let inside = se...
Rust
0
`sexual_orientation` text COLLATE utf8mb4_general_ci, `gender_identity` text COLLATE utf8mb4_general_ci, `birth_fname` text COLLATE utf8mb4_general_ci, `birth_lname` text COLLATE utf8mb4_general_ci, `birth_mname` text COLLATE utf8mb4_general_ci, `dupscore` int NOT NULL DEFAULT '-9', `name_history` tinytext...
Python
1
n open(path: String, with: Option<String>) -> crate::api::Result<()> { { let exit_status = if let Some(with) = with { open::with(&path, &with) } else { open::that(&path) }; exit_status .map_err(|err| crate::api::Error::Shell(format!("failed to open: {}", err.to_string()))) } } use ...
Rust
0
use_negative_enhance"] else params["negative_prompt"] if args["use_enhance"]: prompt = enhance_prompt(prompt, params["seed"]) if mlcn_tile is None: mlcn_tile = load_controlnet("tile") mlcn_tile[1].controlnet = mlcn_tile[1].controlnet.to(mlcn_tile[1]...
Python
1
import discord from grief.core.bot import Grief from grief.core.config import Config async def is_allowed_by_hierarchy( bot: Grief, config: Config, guild: discord.Guild, mod: discord.Member, user: discord.Member, ): if not await config.guild(guild).respect_hierarchy(): return True ...
Python
1
pub fn tolower(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { pub fn toupper(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { pub fn isblank(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { pub fn isascii(__c: ::std::os::raw::c_int) -> ::std::...
Rust
0
# -*- coding: utf-8 -*- # # co_co_input_port_not_assigned_to.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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...
Python
1
[ocs,ocs,255]], ]; ret } fn main() { let mut args = env::args(); if args.len() == 1 { println!("scanlines v1 - <NAME> - 2016"); println!("Convert an image as if it was displayed on a CRT display."); println!("usage: scanlines INFILE [OUTFILE]"); println!("If OUTFILE is missing, a suffix is appended to INF...
Rust
0
# ========= Copyright 2023-2024 @ CAMEL-AI.org. 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 requ...
Python
1
dirty.push(buf_idx); } idx += 1; } } } else if let Some(st) = cons_any.downcast_ref::<SparseConsole>() { for t in st.tiles.iter() { let x = t.idx as u32 % st.width; let y = t.idx as u32 / st.width; ...
Rust
0
import discord from discord.ext import commands import asyncio import time from utils import random_cooldown import config_selfbot import langs class FakeItCommands(commands.Cog): def __init__(self, bot): self.bot: commands.Bot = bot self.sniped_messages: dict = {} @commands.command() a...
Python
1
import pytest from passpie.process import Proc, call, DEVNULL, PIPE @pytest.fixture def mock_popen(mocker): return mocker.patch('passpie.process.Popen') def test_call_uses_proc_communicate_with_input(mocker, mock_popen): MockProc = mocker.patch('passpie.process.Proc') MockProc().__enter__.return_value.c...
Python
1
performed /// # </weight> #[pallet::weight((call.get_dispatch_info().weight + 195_000_000, call.get_dispatch_info().class, Pays::Yes))] pub fn execute_proposal( origin: OriginFor<T>, nonce: T::ProposalNonce, src_id: T::ChainId, r_id: ResourceId, call: Box<<T as Config<I>>::Proposal>, signature: ...
Rust
0