text
string
label_name
string
labels
int64
+ Unpin> Deref for OwnedHandle<'s, W> { type Target = WriteEndWithCachedId<'s, W>; fn deref(&self) -> &Self::Target { &self.write_end } } impl<W: AsyncWrite + Unpin> DerefMut for OwnedHandle<'_, W> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.write_end } } <filename>...
Rust
0
aduora::new`] instead to force encryption. /// /// # Errors /// This method returns an error if /// - the provided credentials are invalid. /// - the host url fails to parse. /// - the underlying [`reqwest::blocking::Client`] cannot be initialized. /// /// # Examples /// ``` /// ...
Rust
0
//! Operations on byte slices. use core::{mem, slice}; /// Converts a type to a mutable byte slice. This is used within the crate to fill /// secret values with the RNG output. /// /// This trait is implemented for numeric types (`u8`, `i8`, ..., `u128`, `i128`), slices /// of these types, and arrays of small sizes (...
Rust
0
close() { let mut rx = tokio::net::tcp::TcpListener::bind("127.0.0.1:0") .await .unwrap(); let addr = rx.local_addr().unwrap(); // connect let tx = tokio::net::tcp::TcpStream::connect(&addr).await.unwrap(); let tx = AsyncBincodeStream::from(tx).for_async(); let mut tx: Client<_,...
Rust
0
arma_model = ARIMA(data_X, order=order) model_fit = arma_model.fit() # 拟合结果 fit_result = model_fit.fittedvalues # 使用模型进行滚动预测 history = list(data_X) test_result = [] for t in range(len(data_Y)): model = ARIMA(history, order=order) mod...
Python
1
oring); println!("\tprg rom size: {:?} chr rom size: {:?}", ines_c.prg_rom_size, ines_c.chr_rom_size); println!("\tprg rom crc: {:X} chr rom crc: {:X}", ines_c.prg_crc, ines_c.chr_crc); // Nes 2.0 allows more detailed handling of ram types match ines_c.ram { ...
Rust
0
st.markdown(f"**Recommendation for {symbol}:** 🟢 **Buy** - Predicted price (${next_predicted_price:.2f}) is higher than the current price (${last_actual_price:.2f}).") else: st.markdown(f"**Recommendation for {symbol}:** 🔴 **Sell** - Predicted price (${next_p...
Python
1
from muestramenu import muestraMenu from insertarlibro import insertarLibro from listarlibros import listarLibros from actualizarlibro import actualizarLibro from eliminarlibro import eliminarLibro from guardardatos import guardarDatos from cargardatos import cargarDatos # Programa biblioteca v0.1 ''' Programa bibl...
Python
1
insert(key.clone(), value).is_some()", table_var)); let dup_key_error_key = match key_type { RustType::Primitive(Primitive::U32) | RustType::Primitive(Primitive::U64) => "Key::Uint(key.into())", RustType::Primitive(Primitive::Str) => "Key::Str(key)", // TODO: make a generic one then ...
Rust
0
uilder, partitioner, batcher_settings); Ok(VectorSink::from_event_streamsink(sink)) } pub fn build_gcs_sink( &self, client: HttpClient, base_url: String, creds: Option<GcpCredentials>, cx: SinkContext, ) -> crate::Result<VectorSink> { let request = s...
Rust
0
papers_by_source['arxiv'].append(paper) else: papers_by_source['others'].append(paper) # 2. 计算分数的通用函数 def calculate_paper_score(paper): score = 0 title = (getattr(paper, 'title', '') or '').lower() abstract = (getattr(paper, 'abstract', '...
Python
1
ctionBodyTranslator<'a, 'b> { /// Translates a Wasm reinterpret operator. pub(super) fn translate_reinterpret<FromType, ToType>( &mut self, from_type: FromType, to_type: ToType, ) -> Result<(), Error> where FromType: Into<runwell::Type>, ToType: Into<runwell::Type...
Rust
0
dazeus.subscribe_command("karmafight", |evt, dazeus| { reply_to_karmafight_command(&evt, dazeus); }); dazeus.listen().unwrap(); } pub use ntapi::ntdbg::DbgPrintEx; pub const DPFLTR_IHVDRIVER_ID: u32 = 77; pub const DPFLTR_ERROR_LEVEL: u32 = 0; /// DbgPrintExのラッパーマクロ #[macro_export] macro_rules! lo...
Rust
0
touchold = transpose_touch(GT_Old, eink_display.xres) touchx,touchy,touchs = touchnew.X[0], touchnew.Y[0], touchnew.S[0] # print(f"touch ev touchx {touchx}, touchy {touchy}, touchs {touchs}") # Buttons for the UI # bottom-left corner, 3...
Python
1
, there may be one \"missing\" satoshi, and either party may have /// chosen to forgo their output as dust. #[must_use] pub sign_closing_transaction: extern "C" fn (this_arg: *const c_void, closing_tx: crate::c_types::Transaction) -> crate::c_types::derived::CResult_SignatureNoneZ, /// Signs a channel announcement ...
Rust
0
from textwrap import dedent import pytest from pandas import ( DataFrame, Series, ) pytest.importorskip("jinja2") from pandas.io.formats.style import Styler @pytest.fixture def df(): return DataFrame( {"A": [0, 1], "B": [-0.61, -1.22], "C": Series(["ab", "cd"], dtype=object)} ) @pytest.fi...
Python
1
isy_wavs.append(noisy_wav) else: train_noisy_wavs.append(noisy_wav) noisy_wavs = train_noisy_wavs train_clean_wavs = [] for clean_wav in clean_wavs: if any(ID in clean_wav for ID in valid_speaker_ids): valid_cle...
Python
1
modality = 'b' graph = 'coco_new' work_dir = f'./work_dirs/k400/b' model = dict( type='RecognizerGCN', backbone=dict( type='ProtoGCN', num_prototype=100, tcn_ms_cfg=[(3, 1), (3, 2), (3, 3), (3, 4), ('max', 3), '1x1'], graph_cfg=dict(layout=graph, mode='random', num_filter=8, ini...
Python
1
Sysno}; // Re-export flags that used by syscalls from the `nix` crate so downstream // projects don't need to add another dependency on it. pub use nix::{ fcntl::{AtFlags, OFlag}, sched::CloneFlags, sys::{ epoll::EpollCreateFlags, eventfd::EfdFlags, inotify::InitFlags, mman...
Rust
0
-> ::windows::core::HRESULT, pub unsafe extern "system" fn( this: *mut ::core::ffi::c_void, value: *mut *mut ::core::ffi::c_void, ) -> ::windows::core::HRESULT, pub unsafe extern "system" fn( this: *mut ::core::ffi::c_void, value: *mut i32, ) -> ::windows::core...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import lilv NS_PRESETS = "http://lv2plug.in/ns/ext/presets#" def print_presets(uri): """Print all presets of an LV2 plugin to stdout.""" world = lilv.World() world.load_all() world.ns.presets = lilv.Namespace(world, NS_PRESETS) plugins =...
Python
1
e.g. this one." >>> proc.split_to_words(text) ['splitting', 'sentence', ',', 'e.g', '.', 'this', 'one', '.'] >>> proc.split_to_tokens(text) ['splitting', ' ', 'sentence', ',', ' ', 'e', '.', 'g', '.', ' ', 'this', ' ', 'one', '.'] """ return split_to_tokens(text, punct_r...
Python
1
return out def distance(arr, mu_a, mu_b): dist_arr2a = np.sqrt(((arr - mu_a) ** 2)).reshape((-1, 1)) dist_arr2b = np.sqrt(((arr - mu_b) ** 2)).reshape((-1, 1)) return np.concatenate((dist_arr2a, dist_arr2b), axis=1) def init_dummy(bs, noise_type, img_dims, ch_n, var=0.1): if noise_type == '...
Python
1
break; } } // Now we have a list of all rels that appeared anywhere in the history. Filter // out relations that were dropped. // // FIXME: We should pass the LSN argument to the calls above, and avoid scanning // dropped relations in the first place. ...
Rust
0
tions, returns, next_states, nonterminals, weights def update_priorities(self, idxs, priorities): priorities = np.power(priorities, self.priority_exponent) self.transitions.update(idxs, priorities) # Set up internal state for iterator def __iter__(self): self.current_idx = 0 return self # Ret...
Python
1
alibrationValue = 0x5204, SetTemperatureOffset = 0x5403, SetAltitude = 0x5102, ReadFirmwareVersion = 0xd100, SoftReset = 0xd304, } const EXPECT_MSG: &str = "Vec was not large enough"; const ADDRESS: u8 = 0x61 << 1; pub struct Scd30<T> { comm: ...
Rust
0
iox_notification_info_does_originate_from_subscriber( self_: iox_notification_info_t, subscriber: iox_sub_t, ) -> bool; } extern "C" { #[link_name = "\u{1}_Z54iox_notification_info_does_originate_from_user_triggerPK16NotificationInfoP11UserTrigger"] pub fn iox_notification_info_does_origina...
Rust
0
ng its RGB value to `(114, 137, 218)`. BLURPLE, blurple, 0x7289DA; /// Creates a new `Colour`, setting its RGB value to `(32, 102, 148)`. DARK_BLUE, dark_blue, 0x206694; /// Creates a new `Colour`, setting its RGB value to `(194, 124, 14)`. DARK_GOLD, dark_gold, 0xC27C0E; /// Creates a new `Colo...
Rust
0
# app/dashboard/__init__.py from flask import Blueprint dashboard_bp = Blueprint('dashboard', __name__) from . import routes
Python
1
umerate(group): if flip_group_endianess and idx == group_width - 1: hexline.append(H.highlight_group_lsb(color_scheme[char])) else: hexline.append(color_scheme[char]) hexline.append(config_byte_separator_str) ...
Python
1
# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from UM import i18nCatalog from UM.Message import Message I18N_CATALOG = i18nCatalog("cura") class PrintJobUploadBlockedMessage(Message): """Message shown when uploading a print job to a cluster is blocked because an...
Python
1
# coding: utf-8 # flake8: noqa """ FX Historical REST API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: v1 Contact: support@apibricks.io Generated by OpenAPI Generator (https://openapi-generator.tech...
Python
1
from yandex_music import LyricsMajor class TestLyricsMajor: id = 560 name = 'MUSIXMATCH' pretty_name = 'Musixmatch' def test_expected_values(self, lyrics_major): assert lyrics_major.id == self.id assert lyrics_major.name == self.name assert lyrics_major.pretty_name == self.pre...
Python
1
} return CborNoError; } #[no_mangle] pub unsafe extern "C" fn cbor_value_calculate_string_length( mut value: *const CborValue_0, mut len: *mut size_t, ) -> CborError_0 { *len = 18446744073709551615u64; return _cbor_value_copy_string(value, 0 as *mut libc::c_void, len, 0 as *mut CborValue_0); } ...
Rust
0
mut iter = distr.sample_iter(&mut rng); b.iter(|| { let mut accum = 0.0; for _ in 0..RAND_BENCH_N { accum += iter.next().unwrap(); } accum }); b.bytes = size_of::<f64>() as u64 * RAND_BENCH_N; } macro_rules! sample_binomial { ($name:ident, $n:expr, $p:expr)...
Rust
0
# -*- coding: utf-8 -*- # # This file is part of SENAITE.CORE. # # SENAITE.CORE 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, version 2. # # This program is distributed in the hope that it will be useful, bu...
Python
1
from django.contrib import admin # Register your models here. from .models import Book admin.site.register(Book) class BookAdmin(admin.ModelAdmin): list_filter = ('title', 'author', 'publication_year') search_fields = ('title', 'author') admin.site.register(Book, BookAdmin)
Python
1
import gamebase as gb from enum import auto class UserEvent(gb.UserEventEnum): INTRO_BEEP_TIMER = auto() END_OF_INTRO = auto() GAME_TIMEOUT = auto()
Python
1
er_spacing is not None: if isinstance(after_spacing, (int, float)): paragraph.paragraph_format.space_after = Pt(after_spacing) app_logger.debug(f"设置段后间距: {after_spacing}磅") else: app_logger.warning(f"段后间距值类型错...
Python
1
''' Copyright (C) 2013 Sean Poyser (seanpoyser@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 later version. ...
Python
1
y DecomposeOpsForInference in that case # and it's unclear when in the build it should happen call_pure_packed( "vm.builtin.tensor_to_shape", output_shape, sinfo_args=ShapeStructInfo(ndim=ndim) ) ) output_shape_vars = [tir.Var("s", "int64") for i in range(ndim)] bb.match_...
Python
1
import os import RPi.GPIO as GPIO import time def bicara(text): bahasa = "id+m1" speed = 130 pitch = 55 volume = 200 command = f'espeak-ng -v {bahasa} -s {speed} -p {pitch} -a {volume} "{text}"' os.system(command) GPIO.setmode(GPIO.BOARD) TRIG = 16 ECHO = 18 GPIO.setup(TRIG, GPIO.OUT) GPIO....
Python
1
_MODE = args.efs_throughput_mode EFS_GID = args.efs_gid EFS_UID = args.efs_uid DIRECTORY_PATH = args.directory SKIP_DRIVER_INSTALLATION = args.skip_driver_installation AWS_ACCOUNT_ID = boto3.client("sts").get_caller_identity()["Account"] EFS_IAM_POLICY_NAME = "AmazonEKS_EFS_CSI_Driver_Policy" +...
Python
1
.stopping_instances .ok_or_else(|| Error::from_kind(ErrorKind::AwsApiResultError("stop failed".to_string())))?; let state_changes: Vec<StateChange> = stopping_instances.into_iter().map(|x| x.into()).collect(); Ok(state_changes) } impl TerminateInstances for Aws { fn terminate_instances( ...
Rust
0
.line { Position { line: 0, character: position.character - to.character, } } else { Position { line: position.line - to.line, character: position.character, } } } /// Ranges are relative start to start, not end to start. #[must_us...
Rust
0
import streamlit as st import requests from agentic.events import SSEDecoder BASE_URL = "http://localhost:8086" st.title("Agentic") #====================== # Define Agent # #====================== def format_endpoint(endpoint: str) -> str: "Format endpoint for markdown display in UI" endpoint = endpo...
Python
1
>, ) -> Result<(), CliError> { let res: Box<dyn Iterator<Item = Result<PurchaseOrder, ClientError>>> = client.list_purchase_orders(filter, service_id.as_deref())?; let mut po_list: Box<dyn Iterator<Item = Result<PurchaseOrderCli, CliError>>> = Box::new(res.map(|po_res: Result<PurchaseOrder, _>| ...
Rust
0
ch results - replace with actual service search_results = [ {"id": "doc1", "title": f"Result 1 for {q}", "score": 0.9}, {"id": "doc2", "title": f"Result 2 for {q}", "score": 0.8}, {"id": "doc3", "title": f"Result 3 for {q}", "score": 0.7} ...
Python
1
import os import requests import json from .base import BaseProvider class LlamaProvider(BaseProvider): def __init__(self, api_key=None, model=None, api_url=None): self.api_key = api_key or os.getenv('LLAMA_API_KEY') if not self.api_key: raise ValueError("LLAMA_API_KEY not found in envi...
Python
1
import tensorflow as tf import matplotlib.pyplot as plt import numpy as np import utils.kt_utils as kt ''' 使用卷积神经网络识别微笑笑脸 ''' train_set_x_orig, train_set_y_orig, test_set_x_orig, test_set_y_orig, classes = kt.load_dataset() X_train = train_set_x_orig / 255 X_test = test_set_x_orig / 255 Y_train = train_set_y_o...
Python
1
translation_mut() = *new_cam_tfm.translation(); *cam_tfm.rotation_mut() = *new_cam_tfm.rotation(); self.cache_flusher.flush(local_cache); } } } pub struct CameraControlSystem<B> where B: BindingTypes, { reader_id: ReaderId<InputEvent<B>>, } #[derive(Default)] pub struct Ca...
Rust
0
from os.path import join from pyobjus import autoclass from pyobjus.dylib_manager import INCLUDE, load_framework from plyer.facades import Audio from plyer.platforms.macosx.storagepath import OSXStoragePath load_framework(INCLUDE.Foundation) load_framework(INCLUDE.AVFoundation) AVAudioPlayer = autoclass("AVAudioPla...
Python
1
_main_code: str) -> str: """Returns a unique hash for the given SVG main code. Args: svg_main_code (str): The content we're going to inject in the SVG envelope. Returns: str: a hash of the given content """ return str(zlib.adler32(svg_main_code.encode())) if __name__ == "__main__...
Python
1
from dash import Dash, dcc, html, Output, Input import dash_bootstrap_components as dbc import plotly.express as px import pandas as pd # https://www.kaggle.com/datasets/tsarina/mexico-city-airbnb?select=listings1.csv df = pd.read_csv("https://raw.githubusercontent.com/Coding-with-Adam/Dash-by-Plotly/master/Other/Mont...
Python
1
tests_multiple_times=1, use_report_coverage_feature_flag=False, log_db_path="", ) mock_parse_args.return_value = args # Mock os.path.isfile to return True for both source and test file paths mock_isfile.side_effect = lambda path: path in [ args.source_...
Python
1
00:00", ); let range: Option<DateRange> = Some(DateRange( utils::datetime_from_str("2021-12-10T00:00:00-05:00"), utils::datetime_from_str("2021-12-10T23:59:59-05:00"), )); let times = Times::new(&content, &range); assert_eq!(times.session_times.len(), 3...
Rust
0
"""FAQ graph tests package"""
Python
1
t W { self.w.bits = (self.w.bits & !(0x01 << 25)) | (((value as u32) & 0x01) << 25); self.w } } #[doc = "ADC COCO Clear Disable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum ADC_COCO_CLEAR_DISABLE_A { #[doc = "0: Allow TSC hardware generates ADC COCO clear"] ADC_CO...
Rust
0
%"]) except Exception as e: print(f"Error creating DataFrames: {e}") driver.quit() exit() # Filter players with more than 90 minutes df['Minutes'] = df['Minutes'].str.replace(',', '').astype(float) df_filtered = df[df['Minutes'] > 90] # Merge with other DataFrames dfs = [keepers_df, shooting_df, passing_d...
Python
1
{ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "({}, {}, {})", self.latitude, self.longitude, self.elevation) } } impl<'r, R: Spheroid> Coordinate<'r, R> { /// Create a Coordinate pub fn new(reference: &'r R, latitude: f64, longitude: f64, elevation: f64) -> Self { ...
Rust
0
} } pub fn f16b(&self) -> Option<bf16> { match self { Revealed::F16B(val) => Some(*val), _ => None, } } pub fn f16(&self) -> Option<ieee::Half> { match self { Revealed::F16(val) => Some(*val), _ => None, } } pub f...
Rust
0
# Databricks notebook source from pyspark.sql import SparkSession spark=SparkSession.builder.appName('PysparkonDatabricks').getOrCreate() # COMMAND ---------- df_properties=spark.read.csv('dbfs:/FileStore/ar_properties.csv', header=True, inferSchema=True) # COMMAND ---------- df_properties.show(5) # COMMAND ------...
Python
1
print("[+] SVG payload written to tenant-takeover.svg") except FileNotFoundError: print("[!] boilerplate.svg file not found") except Exception as e: print(f"[!] Error processing SVG: {e}") else: print("[-] U...
Python
1
(parse_ty(s), false) } }) .collect(), } } fn parse_ty(s: &str) -> Type { let suffix = " const *"; if s.ends_with(suffix) { Type::ConstPtr(parse_ty_base(&s[..s.len() - suffix.len()])) } else if s.ends_with(" *") { Type::MutPtr(...
Rust
0
of the parent region. :param extent: The size of the usable area on the page - excludes margins and headers/footers. :return: a private coordinate space for correctly positioning all our elements on a page. - region.origin = the offset into the target extent to set the coordinate origin ...
Python
1
realized. // TODO: there's got to be a better pattern for this... if let Some(_cell_dweller) = cell_dwellers.get(fighter_entity) { // Create basic third-person following camera. client_state.camera_entity = Some(pk::simple::create_simple_chase_cam...
Rust
0
BitOr<ibv_qp_create_send_ops_flags> for ibv_qp_create_send_ops_flags { type Output = Self; #[inline] fn bitor(self, other: Self) -> Self { ibv_qp_create_send_ops_flags(self.0 | other.0) } } impl ::std::ops::BitOrAssign for ibv_qp_create_send_ops_flags { #[inline] fn bitor_assign(&mut sel...
Rust
0
self.SimplePlugin() # self.assertEqual(simple_plugin.routes(), []) return self.logic_random(function) return source, target def split(self, tokens): assert isinstance(tokens, torch.LongTensor) logic_fn = getattr(self, f"logic_{self.logic}") function =...
Python
1
# pylint: disable=invalid-name, unused-argument """Reduction ops""" from __future__ import absolute_import import tvm import topi import topi.cuda from . import registry as reg from .registry import OpPattern def _schedule_reduce(_, outs, target): """Generic schedule for reduce""" with tvm.target.create(targe...
Python
1
ResourceState = 16384; pub const ResourceState_RESOURCE_STATE_SHADING_RATE_SOURCE: ResourceState = 32768; pub type ResourceState = ::std::os::raw::c_int; #[doc = " No intended memory usage specified."] pub const ResourceMemoryUsage_RESOURCE_MEMORY_USAGE_UNKNOWN: ResourceMemoryUsage = 0; #[doc = " Memory will be used o...
Rust
0
from uer.targets import * from uer.utils.misc import * class BilmTarget(LmTarget): """ Bi-directional Language Model Target """ def __init__(self, args, vocab_size): args.hidden_size = args.hidden_size // 2 super(BilmTarget, self).__init__(args, vocab_size) def forward(self, memor...
Python
1
import os import os.path as osp from glob import glob import random def modify_config_file(source_file, target_file, old_str, new_str): """ 将替换的字符串写到一个新的文件中,然后将原文件删除,新文件改为原来文件的名字 :param file: 文件路径 :param old_str: 需要替换的字符串 :param new_str: 替换的字符串 :return: None """ with open( ...
Python
1
M11 = (28, "xmm11"), XMM12 = (29, "xmm12"), XMM13 = (30, "xmm13"), XMM14 = (31, "xmm14"), XMM15 = (32, "xmm15"), ST0 = (33, "st0"), ST1 = (34, "st1"), ST2 = (35, "st2"), ST3 = (36, "st3"), ST4 = (37, "st4"), ST5 = (38, "st5"), ST6 = (39, "st6"), ST7 = (40, "st7"), M...
Rust
0
def find_min_durability(n, coordinates, durabilities): # Step 3: Find the weakest point weakest_point = min(durabilities) weakest_index = durabilities.index(weakest_point) # Step 4: Determine the best position to add the new ordinary point # For simplicity, let's assume the new point is added just ...
Python
1
datos={} import heapq while True: print("1. Agregar Estudiantes") print("2. Ver Lista De Estudiantes") print("3. Ver Mejor Estudiante") op=int(input("Ingrese una op: ")) match op: case 1: nombre=input("Ingrese nombre de estudiante: ").title() edad=int(input("Ingrese e...
Python
1
OVRE10`"] pub type OVRE10_R = crate::R<bool, bool>; #[doc = "Reader of field `OVRE11`"] pub type OVRE11_R = crate::R<bool, bool>; #[doc = "Reader of field `OVRE12`"] pub type OVRE12_R = crate::R<bool, bool>; #[doc = "Reader of field `OVRE13`"] pub type OVRE13_R = crate::R<bool, bool>; #[doc = "Reader of field `OVRE14`"...
Rust
0
)); let (partition_checkpoint, database_checkpoint) = create_partition_and_database_checkpoint( Arc::clone(&table_name), Arc::clone(&partition_key), ); let metadata = IoxMetadata { creation_timestamp: Time::from_timestamp_nanos(0), table_name: Arc:...
Rust
0
lt< (), Error > { into_result( unsafe { libusb1_sys::libusb_set_configuration( self.0.raw_handle.as_ptr(), config as _ ) })?; Ok(()) } pub fn claim_interface( &mut self, interface: u8 ) -> Result< (), Error > { into_result( unsafe { libusb1_sys::libusb_cl...
Rust
0
from __future__ import annotations import copy from typing import TYPE_CHECKING import outcome from .. import _core if TYPE_CHECKING: from ._io_epoll import EpollWaiters from ._io_windows import AFDWaiters # Utility function shared between _io_epoll and _io_windows def wake_all(waiters: EpollWaiters | AFD...
Python
1
def get_span(label): start, end = 0, 0 flag = False span = [] for k, l in enumerate(label): if l == 'I' and not flag: start = k flag = True if l != 'I' and flag: flag = False en = k span.append((start, en)) start, en...
Python
1
.\n") % (ROWS_LIMIT, " " * pre_indent))) u.log_message(message, log_file=None, console=command_args.verbosity) # Partial console message. Limited number of rows segment = delete_list[0: ROWS_LI...
Python
1
from typing import List class Solution: def change(self, amount: int, coins: List[int]) -> int: dp = [[0] * (amount+1) for _ in range(len(coins))] for k in range(len(coins)): dp[k][0] = 1 for x in range(1, amount+1): if x-coins[k] < 0: res ...
Python
1
_str()).unwrap(); // assert_eq!(response.status(), Status::Ok); // assert_eq!(deleted_body.id, updated_body.id); // assert_eq!(deleted_body.username, updated_body.username); // assert_eq!(deleted_body.is_active, updated_body.is_active); // }<gh_stars>0 //! Defines REST API endpoints for the Discord REST...
Rust
0
import argparse from pathlib import Path import torch from optimum.onnxruntime import ORTModelForCausalLM from optimum.onnxruntime.configuration import AutoQuantizationConfig from optimum.onnxruntime import ORTQuantizer from optimum.exporters.onnx.model_configs import MistralOnnxConfig from optimum.exporters.onnx imp...
Python
1
pub fn define(&mut self, name: &str) -> Symbol { let index = self.num_definitions; self.num_definitions += 1; let symbol = Symbol { name: String::from(name), scope: match self.outer { Some(_) => Scope::Local, None => Scope::Global, ...
Rust
0
import bm3d from skimage.filters import median import numpy as np from scipy.ndimage import convolve def denoise_BM3D(img, sigma=0.1): """ Apply BM3D denoising to the input image. """ denoised_image = bm3d.bm3d(img, sigma_psd=sigma, stage_arg=bm3d.BM3DStages.ALL_STAGES) return denoised_image def ...
Python
1
if text_channel.permissions_for(guild.me).send_messages: channel = text_channel break if channel: # Create introduction embed embed = discord.Embed( title="🤖 **مرحباً everybody! Hello!** 🤖", ...
Python
1
a5049ee350ec6fb1397f37087b"), }, TestVector { key: &hex!("56690798978c154ff250ba78e463765f2f0ce69709a4551bd8cb3addeda087b6"), nonce: &hex!("cf37c286c18ad4ea3d0ba6a0"), plaintext: &hex!("2d328124a8d58d56d0775eed93de1a88"), aad: b"", ciphertext: &hex!("3b0a0267f6ecde3a78b30...
Rust
0
traits-same-method #![feature(rustc_attrs)] #![allow(dead_code)] #![allow(unused_imports)] fn main() { } pub trait Foo: Sized { fn method(self) { } } pub trait Bar: Sized { fn method(self) { } } mod x { use {Foo, Bar}; #[rustc_if_this_changed] impl Foo for u32 { } impl Bar for char { } } ...
Rust
0
sets", "upset"), ("upsetting", "upset"), ("vex", "vexed"), ("vexed", "vexed"), ("vexes", "vexed"), ("vexing", "vexed"), ("wait", "waited"), ("waited", "waited"), ("waiting", "waited"), ("waits", "waited"), ("wake", "woken"), ("wakes...
Rust
0
elapsed, created_at, running_at, finished_at, ) table.add_row(*formatted_row) return table def _to_json(run_list: list[_RunListType]) -> str: """Format run status list to a JSON formatted string.""" runs_list = [] for row in run_list: ( ...
Python
1
::_mm_ucomile_sd(a, b)); } #[simd_test = "sse2"] unsafe fn _mm_ucomigt_sd() { let (a, b) = (f64x2::new(1.0, 2.0), f64x2::new(1.0, 3.0)); assert!(!sse2::_mm_ucomigt_sd(a, b)); } #[simd_test = "sse2"] unsafe fn _mm_ucomige_sd() { let (a, b) = (f64x2::new(1.0, 2.0), f64x2:...
Rust
0
#!/usr/bin/env python3 """简单的Agent测试 - 不使用MCP工具,只测试基础Agent响应""" import asyncio from datetime import datetime from langgraph.prebuilt import create_react_agent from langchain_anthropic import ChatAnthropic # 自然的系统提示 MOA_SYSTEM_PROMPT = """你是Moa,一位专业的AI行政助理。 当收到消息时,你应该: - 理解用户的需求和意图 - 提供合适的、有帮助的回复 - 保持简洁和专业 请始终以一位专业行...
Python
1
async-std-runtime", async_std::test)] #[function_name::named] async fn transaction_ids_included() { let _guard: RwLockReadGuard<()> = LOCK.run_concurrently().await; let client = EventClient::new().await; if !(client.is_replica_set() || client.is_sharded()) { return; } let coll = client.in...
Rust
0
ypes. pub fn get_acquires_global_resources(&'env self) -> Vec<StructId> { let function_definition = self .module_env .data .module .function_def_at(self.get_def_idx()); function_definition .acquires_global_resources .iter() ...
Rust
0
1de5998, 0x24a14224]), "c4636115ec489e463ad0059150ad28f37e719f88f09a8c867d9280606cce342f" ), ( // Len = 216 "68a4377f1dbde0fa0cf37eb518c1733f4c3d5251835d55bcbd6c33", (32, 6, [0x3e1baded, 0xda2097b4], [0xaf627d02, 0xe38af198]), "<KEY>" ), ( // Len = 224 "a9b6d3f1f422427380933039ff5fd9c31769ec6c3594dfba...
Rust
0
import os import pandas as pd from sqlalchemy import create_engine from kaggle.api.kaggle_api_extended import KaggleApi import streamlit as st import json secrets = st.secrets["postgres"] # Set up Kaggle API credentials from Streamlit secrets kaggle_secrets = st.secrets["kaggle"] os.environ["KAGGLE_USERNAME"] = kaggl...
Python
1
# Copyright 2020 Google LLC # # 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, s...
Python
1
0.497); roundtrip(162.4, 0.779, 0.447); for degree in 0..360 { roundtrip(Scalar::from(degree), 0.5, 0.8); } } #[test] fn to_u32() { assert_eq!(0, Color::black().to_u32()); assert_eq!(0xff0000, Color::red().to_u32()); assert_eq!(0xffffff, Color::...
Rust
0
} } } } fn compute_nongrouped_joint_constraints( _params: &IntegrationParameters, bodies: &RigidBodySet, joints_all: &[JointGraphEdge], joint_indices: &[JointIndex], output: &mut Vec<AnyJointPositionConstraint>, ) { for joint_i in joint_indices { let joint = &jo...
Rust
0