text
string
label_name
string
labels
int64
opped } } #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum FlagRegisterValue { C = 1 << 4, H = 1 << 5, N = 1 << 6, Z = 1 << 7, } impl Into<u8> for FlagRegisterValue { fn into(self) -> u8 { self as u8 } } use crate::ast::{BinaryOperator, IfElseBlock, LiteralValue, SourceLanguage...
Rust
0
import os from groq import Groq def make_chat(query): # Create the Groq client client = Groq(api_key=os.environ.get("GROQ_API_KEY"), ) # Set the system prompt system_prompt = { "role": "system", "content": "Reply with unique search content/fun facts, 25 words or less, 1-2 ...
Python
1
brotli_min_size_t(*available_in, block_size_limit)); let mut command_buf = <Alloc as Allocator<u32>>::AllocatedMemory::default(); let mut literal_buf = <Alloc as Allocator<u8>>::AllocatedMemory::default(); if (*s).params.quality != 0i32 && ((*s).params.quality != 1i32) { return 0i32; } if (*s).para...
Rust
0
from datetime import datetime import io import boto3 from tqdm import tqdm class ProgressBytesIO(io.BytesIO): def __init__(self, bytes_io, progress_bar): self._bytes_io = bytes_io self._progress_bar = progress_bar super().__init__(bytes_io) def read(self, size=-1): chunk = sup...
Python
1
sync_device_mut(&mut self) -> &mut SyncDevice { &mut self.dmo_gfx.sync.device } pub fn get_track_names(&self) -> &Vec<String> { &self.track_names } pub fn get_window_resolution(&self) -> (f64, f64) { self.dmo_gfx.context.get_window_resolution() } pub fn set_window_reso...
Rust
0
#!/usr/bin/env python3 """ Launcher console interactif pour FoodOps Pro. Ouvre vraiment les jeux dans de nouvelles consoles ! """ import subprocess import sys import os from pathlib import Path def clear_screen(): """Efface l'écran.""" os.system("cls" if os.name == "nt" else "clear") def print_header(): ...
Python
1
.attach(AdHoc::config::<Config>()) .mount("/metrics", prometheus) .mount("/static", StaticFiles::from("./static")) .mount("/", routes![index, commands, about, help, hello, invite]) .register(catchers![catchers::not_found]) } <filename>src/main.rs<gh_stars>0 mod cli_args; mod errors; mod...
Rust
0
et_init { ($config:expr) => {{ let mut container = librustlet::macros::RUSTLET_CONTAINER.write(); match container { Ok(mut container) => { let res = container.set_config($config); match res { Ok(_) => { let res = container.start(); match res { Ok(_) => {} Err(e) => { ...
Rust
0
(seconds=MAX_TIME)) self.assertLess(duration, datetime.timedelta(seconds=1.5 * MAX_TIME)) start = datetime.datetime.now() model.generate(input_ids, do_sample=True, num_beams=2, max_time=MAX_TIME, max_length=256) duration = datetime.datetime.now() - start self.assertGreater(durat...
Python
1
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from pathlib import Path from ultralytics.engine.model import Model from .predict import FastSAMPredictor from .val import FastSAMValidator class FastSAM(Model): """ FastSAM model interface for segment anything tasks. This class exten...
Python
1
lict_body(query: ConflictData, state: AppState) -> HttpResult<String> { let body = if let Some(datetime) = query.datetime { if let DiaryAppOutput::Lines(lines) = DiaryAppRequests::RemoveConflict(datetime) .handle(&state.db) .await? { lines.join("\n") } els...
Rust
0
ated. pub fn all() -> FlagSet<Self> { FlagSet::full() } pub(super) fn encode<'a, 'b: 'a>( &self, encoder: &'a mut GenericDataEncoder<'b>, ) -> Result<(), DataEncodingError> { match self { Self::Ascii => ascii::encode(encoder), Self::C40 => c40::en...
Rust
0
as f32 / m3d::NORMALIZER, quad.flat_normal[2] as f32 / m3d::NORMALIZER, ]; let cur_samples = tess.tessellate(&corners[..], quad.middle); if with_sample_buf { let mut nlen = 16.0; sample_data.push(DebugPos { pos: [middle[0], middle[1], middle[...
Rust
0
= Box<dyn std::error::Error + Send + Sync + 'static>; fn req_span<A>(req: &Request<A>) -> tracing::Span { let span = tracing::info_span!( "request", req.method = ?req.method(), req.uri = ?req.uri(), req.version = ?req.version(), headers = ?req.headers() ); { ...
Rust
0
without syntax errors in notebooks repo=Repository( owner="zanieb", name="huggingface-notebooks", ref="zb/fix-syntax", ), check_options=CheckOptions(select=JUPYTER_NOTEBOOK_SELECT), config_overrides={"include": ["*.ipynb"]}, ), Project( ...
Python
1
else: if event.button == 4: self.tile_group = (self.tile_group - 1) % len(self.tile_list) self.tile_variant = 0 if event.button == 5: self.tile_group = (self.tile_group + 1) %...
Python
1
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import faiss import numpy as np d = 64 # dimension nb = 100000 # database size nq = 10000 ...
Python
1
In the latter case, any elements *completely* spanned by the slice handle are known to not have any other write-capable views to them, and in the case of an `&mut BitSlice` handle specifically, no other views at all. As such, the domain view of this memory is able to remove the aliasing marker type and permit direct me...
Rust
0
er.next(), Some(&9)); /// } /// /// let world = World::new(); /// /// world.run( /// |mut entities: EntitiesViewMut, mut usizes: ViewMut<usize>, mut u32s: ViewMut<u32>| { /// entities.add_entity((&mut usizes, &mut u32s), (0, 1)); /// entities.add_entity((&mut usizes, ...
Rust
0
ws(): text = "" if full: for col in ["code", "partie", "livre", "titre", "chapitre", "section", "sous-section"]: if (row[col] is not None) and (row[col] is not np.nan): text += row[col] + ", " text += row["article"] + "...
Python
1
# dicomtree.py """Show a dicom file using a hierarchical tree in a graphical window""" from __future__ import print_function # Copyright (c) 2008-2012 Darcy Mason # This file is part of pydicom, relased under an MIT license. # See the file license.txt included with this distribution, also # available at https://g...
Python
1
)` is experimental and subject to change fn bar() -> bool { false } #[cfg(version("0"))] //~^ ERROR `cfg(version)` is experimental and subject to change fn bar() -> bool { true } #[cfg(version("1.65536.2"))] //~^ ERROR `cfg(version)` is experimental and subject to change fn version_check_bug() {} fn main() { // ...
Rust
0
pointer::PointerExt; /// General matrix multiplication (f32) /// /// C ← α A B + β C /// /// + m, k, n: dimensions /// + a, b, c: pointer to the first element in the matrix /// + A: m by k matrix /// + B: k by n matrix /// + C: m by n matrix /// + rs<em>x</em>: row stride of *x* /// + cs<em>x</em>: col stride of *x* /...
Rust
0
_p.0.get() }.is_some() } #[doc(hidden)] pub unsafe fn glIsTexture_load_with(f: &dyn Fn(*const u8) -> *const c_void) { *glIsTexture_p.0.get() = core::mem::transmute::<Option<core::ptr::NonNull<c_void>>, Option<glIsTexture_t>>(gl_ptr_filter(f(b"glIsTexture\0".as_ptr()))); } /// glIsVertexArray /// * `array` class: vert...
Rust
0
private_exponent = IntegerAsn1::from(encoded[107..171].to_vec()); let prime_1 = IntegerAsn1::from(encoded[173..206].to_vec()); let prime_2 = IntegerAsn1::from(encoded[208..241].to_vec()); let exponent_1 = IntegerAsn1::from(encoded[243..276].to_vec()); let exponent_2 = IntegerAsn1::from(...
Rust
0
# Copyright 2022 The JAX 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
Python
1
; fn build_request_url(&self) -> String; } macro_rules! paper_struct { ($i:ident $($value:ident => $t:ty),+ $(,)?) => ( #[derive(Serialize, Deserialize, Debug)] pub struct $i { $(pub $value: $t,)+ } ); ($i:ident $($value:ident => $t:ty = $ext:ty),+ $(,)?) => ( #[derive(Serializ...
Rust
0
from fastapi import APIRouter, Depends, status from fastapi.responses import JSONResponse from tf_idf_bow.controller.request_form.tf_idf_bow_request_form import TfIdfBowRequestForm from tf_idf_bow.service.tf_idf_bow_service_impl import TfIdfBowServiceImpl tfIdfBowRouter = APIRouter() async def injectTfIdfBowService(...
Python
1
存在") video_stream = await video_service.get_video_stream(video_id=video_id) return StreamingResponse( content=video_stream, media_type=f"video/{video.codec.lower()}", ) except HTTPException: raise except Exception as e: logger.exception(f"...
Python
1
""" ---> Model Signals <--- Args: sender (Model): The model class. instance (Model instance): The instance being saved. created (in post_save only)(bool): True if a new instance was created, False if updated. kwargs: Additional keyword arguments. @receiver(pre_save, sender ...
Python
1
ntsize = 17) plt.xlabel("x [m]", fontname = "serif", fontsize = 12) plt.ylabel("y [m]", fontname = "serif", fontsize = 12) Q = plt.quiver(X[::4, ::4], Y[::4, ::4], U[::4, ::4], V[::4, ::4], units = "xy", scale = 0.002, scale_units = "inches") qk = plt.quiverkey(Q, 0.9, 0.9, 0.001, "0.1 m/s", ...
Python
1
rror, }; #[cfg(feature="formats-geojson")] use serde_json::{json, Value, Map}; #[cfg(feature="formats-geojson")] use geojson; #[cfg(feature="formats-gdal")] use gdal; #[derive(Debug)] pub struct Edge<T: CoordinateType> { pub way_osmid: WayId, pub start_node_id: NodeId, pub end_node_id: NodeId, pub grap...
Rust
0
register_widget( element_id, on_change_handler=on_dismiss if callable(on_dismiss) else None, deserializer=lambda x: x, # Simple passthrough for trigger values serializer=lambda x: x, # Simple passthrough for trigger values ctx=ctx, ...
Python
1
w() # plt.savefig(f'result/{title_name}.jpg') # plt.clf() if __name__ == '__main__': n = 400 stop_loss_rate = 0.1 commision = 0.0005 trade_first = True period = 120 roll_mean_period = 200 if_trend = True if not if_trend: period = 0 roll_mean_period = 0 sym...
Python
1
ll() def safe_margin( self, low: Union[numpy.ndarray, float] = None, high: Optional[Union[numpy.ndarray, float]] = None, scale: float = 1.0, ) -> "Bounds": """ Initialize a new :class:`Bounds` with its bounds increased o decreased \ by an scale factor. ...
Python
1
_info.current_sample, &exec_info.command); match failed_list { Ok(_) => Ok(true), Err(text) => Err(text), } } "bye" | "b" => Ok(false), _ => Err("invalid command".to_string()), } } //fn interactive_mode<R: BufRead>(read: &mut R) { fn ...
Rust
0
s are predicted uncertain in the 3rd image') small_text = [ '{}'.format(save_name), 'Start: {}, end: {}, fixed frame: {}'.format(test_set.start, test_set.end, test_set.middle_image) ] plot = make_matching_and_warping_plot_fast(source_img, target_img, ...
Python
1
linear_hs_proj_av1 = self.projav2(F.dropout(F.relu(self.projav1(feats)), p=self.out_dropout, training=self.training)) output = self.out_layer(linear_hs_proj_av1) return output class MLP_reconst_a(nn.Module): def __init__(self, model_args): super(MLP_reconst_a, self).__init__() #...
Python
1
+1) .mul_add(s, 0.265_094_900_1_e+1); let x = df(2.3025851249694824219, -3.1705172516493593157e-08).add_checked(u * s); u = (1.).add_checked(x * s).normalize().0; if d > 38.531_839_419_103_623_894_138_7 { f32::INFINITY // log10(FLT_MAX) } else if d < -50. { 0. } else { ...
Rust
0
, catalog_cache.time_provider())); let query_execution_semaphore = Arc::new(Semaphore::new(max_concurrent_queries)); Self { backoff_config: BackoffConfig::default(), catalog_cache, chunk_adapter, metric_registry, exec, ingester_con...
Rust
0
serialize=False ), ), ( "channel", models.TextField( help_text="An arbitrary string defining the channel name. For example, it can be a node name or a reserved LangGraph's enum." ), ...
Python
1
l"), IORegister::AudioData => write!(f, "audioData"), IORegister::VgaData => write!(f, "vgaData"), } } } #[derive(Debug, Clone, Copy, PartialEq, Eq)] enum Instruction { Nop, Mov(LoadSource, StoreTarget), MovWord(LoadWordSource, StoreWordTarget), IncWord(CountTarget),...
Rust
0
# Overlapper: Prepare and evaluate wavefunctions for quantum # algorithms using computational chemistry techniques # Copyright 2024 Xanadu Quantum Technologies Inc. # # Author: Stepan Fomichev <stepan.fomichev@xanadu.ai> # Joana Fraxanet <joana.fraxanet@icfo.eu> # # This file is part of Overlapper. # # Overlapp...
Python
1
_metrics.values(): metric_fn.record(target, gen) # only increment n_batches if we actually recorded a batch self._n_batches += 1 def get_logs(self, label: str): logs = dict() for metric_name in self._derived_metrics: values = self._derived_metrics[metric_nam...
Python
1
import argparse import pandas as pd from wordcloud import WordCloud from joppy.client_api import ClientApi import matplotlib.pyplot as plt import squarify from io import StringIO import os # Function to parse duration into seconds def parse_duration(duration): if pd.isna(duration): return 0 h, m, s = m...
Python
1
= {{set_i.radius}}; let center_{{loop.index}}: Option<&[f64]> = {% if set_i.center is not none %}Some(&[{{set_i.center | join(', ')}}]){% else %}None{% endif %}; let set_{{loop.index}} = Ball1::new(center_{{loop.index}}, radius_{{loop.index}}); let set_c = set_c.add_constraint(idx_{...
Rust
0
split, f"{img_name}{IMG_EXT}") # 复制图片 if os.path.exists(src_img): os.makedirs(os.path.dirname(dst_img), exist_ok=True) try: shutil.copy(src_img, dst_img) except Exception as e: print(f"复制失败 {src_...
Python
1
"closed", "writelines", "isatty", "writable", ] ) fs = MotorGridFSBucket(self.cx.test) motor_gridout = await fs.open_download_stream(1) self.assertEqual( attrs(self.sync_fs.open_download_stream(1)) - gr...
Python
1
>, IJ: Iterator<Item = Matrix<N, P, J, JS>>, DefaultAllocator: Allocator<N, J, P>, DefaultAllocator: Allocator<N, P, P>, DefaultAllocator: Allocator<N, P, Buffer = PS>, ShapeConstraint: DimEq<DimMinimum<P, P>, P>, { let mut lambda = config.initial_lambda; let mut guess = init; let mut re...
Rust
0
def cleanRes(str): a = str.split("resource/") if len(a)<2: return "" name = a[1] name =name.split("(")[0] return name.replace("_"," ").replace(">","").strip() def printIR(fullname, disamb): lab="n" print fullname+"\t"+fullname+"\t"+lab exp = fullname.split() lname = exp[-1] ...
Python
1
import bpy op = bpy.context.active_operator op.ant_terrain_name = 'Landscape' op.land_material = '' op.water_material = '' op.texture_block = '' op.at_cursor = True op.smooth_mesh = True op.tri_face = False op.sphere_mesh = False op.subdivision_x = 128 op.subdivision_y = 128 op.mesh_size = 2.0 op.mesh_size_x = 2.0 op....
Python
1
m: usize) -> Bot { let mut seeds_old = std::mem::replace(&mut self.seeds, BTreeSet::new()).into_iter(); let bid = seeds_old.next().unwrap(); // let seeds = seeds_old.take(m).collect(); let mut seeds = BTreeSet::new(); for _ in 0..m { seeds.insert(seeds_old.next().unw...
Rust
0
input_file1 = "merge_two_sorted_lists/in1.txt" input_file2 = "merge_two_sorted_lists/in2.txt" output_file = "merge_two_sorted_lists/out.txt" with open(input_file1, "r", encoding="utf-8") as f1, open(input_file2, "r", encoding="utf-8") as f2, open(output_file, "w", encoding="utf-8") as o: n1 = f1.readline().strip("\...
Python
1
elf) -> AvahiPair { let mut key: *mut c_char = ptr::null_mut(); let mut value: *mut c_char = ptr::null_mut(); let mut value_size: usize = 0; unsafe { avahi_string_list_get_pair(self.list, &mut key, &mut value, &mut value_size); } AvahiPair::new(key.into(), v...
Rust
0
misations avancées gradient_checkpointing=True, optim="adamw_torch", adam_beta1=0.9, adam_beta2=0.999, # Plus stable que 0.95 adam_epsilon=1e-8, max_grad_norm=0.5, # Gradient clipping plus strict # Désactivation des rapports externes push_to_hub...
Python
1
professional. " "However, this tool cannot replace a professional diagnosis and is for informational purposes " "only. If you are concerned about stroke symptoms, please consult a healthcare professional.") elif xgb_class == 1 or cnn_class == 1: ...
Python
1
import matplotlib.pyplot as plt import numpy as np # import umap.umap_ as umap from sklearn.manifold import TSNE from sklearn.decomposition import PCA import pandas as pd def plot_training(train_losses, val_losses, metrics, title='The twin prediction result: train and test Loss/metrics'): def plot_metric(name, metr...
Python
1
import tensorflow as tf import pandas as pd import numpy as np def create_tf_example(row): features = { 'label':tf.train.Feature(int64_list=tf.train.Int64List(value = [int(row['label'])])), 'user_age':tf.train.Feature(float_list = tf.train.FloatList(value = [row['user_age']])), 'item_id':...
Python
1
f64 } macro_rules! float_impls { ($mod_name:ident, $ty:ty, $mantissa_bits:expr, $method_name:ident) => { mod $mod_name { use super::{Rand, Rng}; const SCALE: $ty = (1u64 << $mantissa_bits) as $ty; impl Rand for $ty { #[inline] fn rand<R:...
Rust
0
Drawable, } impl DrawPedestrian { pub fn new( input: DrawPedestrianInput, step_count: usize, map: &Map, prerender: &Prerender, cs: &ColorScheme, ) -> DrawPedestrian { let mut draw_default = GeomBatch::new(); DrawPedestrian::geometry(&mut draw_default, cs...
Rust
0
let _ = query!(r#"DELETE FROM todos WHERE id = $1"#, test_id) .execute(&pool) .await?; explicit_rollback_example(&pool, test_id).await?; // check that inserted todo is not visible outside the transaction after explicit rollback let inserted_todo = query!(r#"SELECT FROM todos WHERE id = $1"...
Rust
0
// to set default output filenames only if they are not provided. if output_selection.contains(&NextcladeOutputSelection::Fasta) { output_fasta.get_or_insert(default_output_file_path.with_extension("aligned.fasta")); } if output_selection.contains(&NextcladeOutputSelection::Insertions) { ...
Rust
0
ss_loss) # pylint: disable=E1130 & ~tf.math.is_inf(robustness_loss) # pylint: disable=E1130 & (tf.abs(robustness_loss) <= self.gamma) ) out0, out1 = out0[indices], out1[indices] icdf_out1 = tf.math.erfinv(2 * o...
Python
1
(APBPrescaler::Div2); let flash = stm32::FLASH(); flash.enable_prefetch(); flash.set_latency(flash::FlashLatency::TwoWait); rcc.enable_pll(); while !rcc.get_pll_ready() {} rcc.set_system_clock(SystemClockSwitch::PLLOutput); } fn enable_led() { use stm32::gpio; use stm32::clock::Periph...
Rust
0
use pretty_assertions::assert_eq; #[test] fn utils_parse_email() { assert_eq!( parse_email("<EMAIL>").unwrap(), Email::new("christian.visintin", "gmail.com") ); assert!(parse_email("pippo.pluto").is_none()); } #[test] fn utils_parse_phone() { ...
Rust
0
MF_E_INVALIDNAME 0xc00d_36bc MF_E_INVALIDTYPE 0xc00d_36bd MF_E_INVALID_FILE_FORMAT 0xc00d_36be MF_E_INVALIDINDEX 0xc00d_36bf MF_E_INVALID_TIMESTAMP 0xc00d_36c0 MF_E_UNSUPPORTED_SCHEME 0xc00d_36c3 MF_E_UNSUPPORTED_BYTESTREAM_TYPE 0xc00d_36c4 MF_E_UNSUPPORTED_TIME_FORMAT 0xc00d_36c5 MF_E_NO_SAMPLE_TIMEST...
Rust
0
Rather than create a Triangulation object, can simply pass x, y and triangles # arrays to tripcolor directly. It would be better to use a Triangulation # object if the same triangulation was to be used more than once to save # duplicated calculations. # Can specify one color value per face rather than one per point b...
Python
1
use crate::pipeline::shader::shaderc::vulkan::VulkanShadercOptions; use crate::error::{ VkResult, VkError }; pub struct GsShaderCompiler { compiler: shaderc::Compiler, options : GsShadercOptions, } pub enum ShaderCompilePrefab { Vulkan, } pub enum ShadercConfiguration { Vulkan(VulkanShadercOptions),...
Rust
0
long_description=readme_content, author="Mike Dirolf", author_email="mongodb-user@googlegroups.com", maintainer="Bernie Hackett", maintainer_email="bernie@10gen.com", url="http://github.com/mongodb/mongo-python-driver", keywords=["mongo", "mongodb", "pymongo", "gridfs", "bson"], install_requ...
Python
1
W-min")] KWMin, /// therms #[serde(rename = "thm")] Thm, /// gigajoules #[serde(rename = "GJ")] Gj, /// liters #[serde(rename = "L")] L, /// kiloliters #[serde(rename = "kL")] KL, /// Gross Tons(Elaboration: long tons or imperial tons, equal to 2240 lbs) #[serde(rename = "GT")] Gt, /// Kilograms #[ser...
Rust
0
import networkx as nx import math from typing import List, Tuple, Optional from app.models import Pool, Token class PathFinder: def __init__(self): self.graph = nx.DiGraph() self.pools: List[Pool] = [] def update_pools(self, pools: List[Pool]): """Update the graph with new pool...
Python
1
# from UserLogin import userlogin from staticINF import * import ddddocr import requests import json import time def show_class(class_loop: dict, cnt: int) -> None: """ Show the class :param class_loop: a class. :param cnt: index of class. :return: None """ class_name = class_loop['kcm'] c...
Python
1
iv_est = num_yz / deno_xz else: # More than 1 instrument. Use 2sls. est_treatment = data[self._target_estimand.treatment_variable].astype(np.float32) est_outcome = data[self._target_estimand.outcome_variable[0]].astype(np.float32) ivmodel = IV2SLS(est_outcome, e...
Python
1
(job_index, job_completion_time)| { // Compile batch completion times - 50 batches of 2 jobs each // batch_completion_times.1 is the global time of the last batch completion if (job_index + 1) % 2 == 0 { batch_completion_times ...
Rust
0
import sys import ctypes import subprocess import os def run(cmd: str, hide_stderr: bool = True, stdout_mode: str = "print"): libc_search_dirs = ["/lib", "/lib/x86_64-linux-gnu", "/lib/powerpc64le-linux-gnu"] if sys.platform == "linux" : found = None for d in libc_search_dirs: fil...
Python
1
# Copyright (C) 2018-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from openvino.tools.mo.ops.split import AttributedVariadicSplit, AttributedSplit from openvino.tools.mo.front.common.partial_infer.utils import int64_array from openvino.tools.mo.front.extractor import FrontExtractorO...
Python
1
Temporary cl_mem scratch buffer object of minimum size N"] #[doc = " @param[in] numCommandQueues Number of OpenCL command queues in which the"] #[doc = " task is to be performed."] #[doc = " @param[in] commandQueues OpenCL command queues."] #[doc = " @param[in] nu...
Rust
0
ield to camera transformation frame_id: (M,) Frame id. If None, warp for all frames inst_id: (M,) Instance id. If None, warp for the average instance Returns: xy: (M,N,2) Points in image plane """ # TODO: make the format consistent # print("proj xyz.s...
Python
1
// Subkey is derived from the master key using HKDF method. See crypto/hkdf.rs for more details. // SHA1 is deemed insecure in modern computing. SHA256 is recommended instead. pub fn derive_subkey( master_key: &[u8], salt: &[u8], key_size: usize, compatible_mode: bool, ) -> Vec<u8> { derive_subkey_w...
Rust
0
#! /usr/bin/env python # -*- coding: utf-8 -*- ############################################################################# ## ## ## This file is part of DPAPIck ## ## Windows DPAPI decryption & forensic...
Python
1
::new().month(12).day(31).year(2022).build()?; assert_eq!(dt.date(), &Date::new(2022, 12, 31).unwrap()); assert_eq!(dt.time(), &Time::MIDNIGHT); Ok(()) } #[test] fn test_ordinal_construction() -> Result<(), Error> { let dt = Builder::new().year(2020).ordinal(60).build()?; ...
Rust
0
bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 7); self.w.bits |= ((value as u32) & 1) << 7; self.w } } impl R { #[doc = r"Value of the register as raw bits"] #[inline(always)] pub fn bits(&self) -> u32 { self.bits } #[doc = "Bit 0 - 16/32-Bit Genera...
Rust
0
#!/usr/bin/python # coding: utf-8 import subprocess import MySQLdb def ExecCmd(cmd): child = subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE) retno = child.wait() return retno # mysql host = '数据库地址' db = '库名' user = '用户' pw = '密码' port = 端口 saltcmd = 'ps -ef|grep salt-master|grep -v grep' apicmd ...
Python
1
) -> Option<String> where I: Iterator<Item = (&'i String, &'i String)>, { let (k0, v0) = labels_iter.next()?; let mut out = format!("{}_{}=\"{}\"", prefix, k0, v0); for (k, v) in labels_iter { write!(out, ",{}_{}=\"{}\"", prefix, k, v).expect("label concat must succeed"); } Some(out) } ...
Rust
0
# Copyright 2020 Dirk Klimpel # # 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 agreed to in writing,...
Python
1
n, lang_model): """ To be executed if the run SQL query returns a valid results. Will provide the full output of the original question, final sql query, and answer. """ analyze_prompt = PromptTemplate( input_variables=[], template = f""" You are an expert data analyst. Given an o...
Python
1
: &str, module_name: &str, deps: &[String], pyo3_version: &str, ) -> Result<()> { let mut dependencies = HashMap::new(); let (version, git, branch) = if pyo3_version == "github" { ( "*".into(), Some("https://github.com/PyO3/pyo3".into()), Some("main".into()), ) } else { (pyo3_v...
Rust
0
d_claimed_rewards, reward_currency: BSX, }), mock::Event::LiquidityMining(Event::SharesWithdrawn { farm_id: GC_FARM, liq_pool_farm_id: BSX_TKN2_LIQ_POOL_ID, who: ALICE, lp_token: BSX_TKN2_SHARE_ID, amount: 87, }), mock::Event::Uniques(pallet_uniques::Event::Burned { owner: ALICE,...
Rust
0
(), history: Vec::with_capacity(HISTORY_SIZE), } } } impl Board { pub fn reset(&mut self) { self.state = Default::default(); self.history.clear(); } pub fn reset_with_seeds(&mut self, first_seeds: [isize; PIT_NUM], second_seeds: [isize; PIT_NUM]) { let mut f...
Rust
0
from .._tier0 import create_like from .._tier1 import copy from .._tier0 import execute from .._tier0 import Image from ._set import set def execute_separable_kernel(src, dst, anchor, opencl_kernel_filename, kernel_name, kernel_size_x, kernel_size_y, kernel_size_z, sigma_x, sigma_y, sigma_z, dimensions) -> Image: ...
Python
1
import torch import torch.nn.functional as F from .....kernels.range_fill import range_fill def select_and_do_r_proj(self, rel_indices): """ :param rel_indices: relation list of real_part dict :return: """ r_embed_list = [] r_modified_indices = [] for rel_idx, one_rel_indices in enumerat...
Python
1
e, True): # for swap_xy in (False, True): # view = ViewPort( # lens_size_x, # lens_size_y, # native_scale_x=units_per_galvo_x, # native_scale_y=units_per_galvo_y, # ...
Python
1
Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // Open Ethereum is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Pub...
Rust
0
eSpecBuilder.DebugMode.JSON) hook.add(test_data.mock_node, test_data.tosa_op, test_data.op_id) debug_events = hook._debug_events assert len(debug_events) == test_data.expected_events assert len(debug_events[0].torch_info.node_trace) == test_data.num_nodes_traced _compare_tosa_and_schema(debug_even...
Python
1
// p.end_task()?; // p.begin_task()?; // p.set_task_progress(0, 1)?; // p.set_task_progress(1, 1)?; // p.end_task()?; // p.begin_task()?; // p.set_task_progress(0, 2)?; // p.set_task_progress(1, 2)?; // p.set_task_progress(2, 2)?; // p.end_task()?; // p.begin_task()?; // p...
Rust
0
# average_percent_bins = np.mean(np.array(percent_histos), axis=0) / self.n # average_count_bins = np.mean(np.array(count_histos), axis=0) average_group_count = np.mean(group_count) if self.verbose: print(np.max(loss_matrix, axis=1)) self.record.resolutions.append(resolu...
Python
1
""" Write a function to find the n'th star number. assert find_star_num(3) == 37 """ def find_star_num(n): """ Find the n'th star number. """ star_num = 0 for i in range(1, n+1): star_num += i*(i+1)//2 return star_num if __name__ == "__main__": import unittest class TestFindStar...
Python
1
) ori_check = err_checks[controller_mode][action_name]["ori"] if ori_check is not None: is_valid_ori = ori_check(target_quat, curr_quat, init_quat) assert is_valid_ori, ( ...
Python
1
"shigjetë", "telefonatë", ], }, #[cfg(feature = "sr")] crate::Annotation { lang: "sr", tts: Some("мобилни телефон са стрелицом"), keywords: &[ "дoлaзни пoзив", "мoбилни", ...
Rust
0
'#0050221296V#051F要一起行动的话\n', '人数似乎太多了啊。', TxtCtl.Enter, TxtCtl.Clear, '#0050221297V在这里决定一下行动队员\n', '再决定比较好呢。', TxtCtl.Enter, ), ) CloseMessageWindow() Jump('loc_7745') def _loc_76B0(): pass label('loc_76B0...
Python
1