text
string
label_name
string
labels
int64
D) -> Result<Self, D::Error> where D: serde::Deserializer<'de>, { let data = <&str>::deserialize(deserializer)?; Ok(Self::from(data)) } } /// <p>Specifies when an object transitions to a specified storage class. For more information /// about Amazon S3 lifecycle configuration rules...
Rust
0
MAX; #[repr(u32)] #[non_exhaustive] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum _bindgen_ty_52 { TCA_UNSPEC = 0, TCA_KIND = 1, TCA_OPTIONS = 2, TCA_STATS = 3, TCA_XSTATS = 4, TCA_RATE = 5, TCA_FCNT = 6, TCA_STATS2 = 7, TCA_STAB = 8, TCA_PAD = 9, TCA_DUMP_INVISIBLE = 10, TCA_CHAIN = 11, TCA_HW_OFFLOAD = ...
Rust
0
ccording to `file_name` argument. /// /// # Arguments /// /// * `file_name` - The name of file to find. fn find_matched_file(&self, file_name: &str) -> Option<&TableLoaderFileEntry> { for file_entry in &self.files { if file_entry.file_name == file_name { return So...
Rust
0
n]; if total_ranks != 0 && total_trust != 0 { for uid_i in uids.iter() { // Get exponentiated trust score. let trust_i: I65F63 = trust[ *uid_i as usize ]; let shifted_trust: I65F63 = trust_i - kappa; // Range( -kappa, 1 - kappa ) ...
Rust
0
new(HEAP); { let _ = alloc.allocate(Increment(&mut i)).unwrap(); } assert_eq!(i, 1); } } <reponame>EarthenSky/pomme-synth //#[macro_use] // use all macros from vst //extern crate vst; extern crate priority_queue; mod params; // daw visisble params? mod widget; // custo...
Rust
0
assert_eq!(r.data(), &[0.0, 1.0, 2.0]); let gradients = r.mean().backward(); assert_eq!(gradients.ref_gradient(&a), &[1.0 / 3.0; 3]); assert_eq!(gradients.ref_gradient(&b), &-1.0); } #[test] fn test_broadcast_sub_2d() { let a: Tensor2D<2, 3> = Tensor2D::new([[1.0, 2.0, 3.0]...
Rust
0
WM_NAME, xcb::ATOM_STRING, 8, title.as_bytes()); let protocols = [wm_delete_window]; xcb::change_property(&conn, xcb::PROP_MODE_REPLACE as u8, win, wm_protocols, xcb::ATOM_ATOM, 32, &protocols); ...
Rust
0
_fn!(source_in, |s, _, _, da| s * da); blend_fn!(destination_in, |_, d, sa, _| d * sa); blend_fn!(source_out, |s, _, _, da| s * inv(da)); blend_fn!(destination_out, |_, d, sa, _| d * inv(sa)); blend_fn!(source_over, |s, d, sa, _| mad(d, inv(sa), s)); blend_fn!(destination_over, |s, d, _, da| ...
Rust
0
#!/usr/bin/env python3 import warnings warnings.filterwarnings("ignore", category=UserWarning, module='requests') import requests from tplinkrouterc6u import TplinkRouterProvider # --- Configuration --- ROUTER_URL = 'http://192.168.1.1 or your rtr ip' ROUTER_PASSWORD = 'ROUTERPASSWORD' # Replace with your router adm...
Python
1
total_num += 1 if match1: total_correct += 1 if match2: total_correct_eliminate += 1 correct_ratio = float(total_correct / total_num) if total_num > 0 else 0 correct_eliminate_ratio = float(total_correct_eliminate / total_num) if tota...
Python
1
epsilon=1.0e-2); /// assert_relative_eq!(result.y, 1141263.01f64, epsilon=1.0e-2); /// ``` impl<T: crate::proj::CoordinateType> crate::Coord<T> for geo_types::Coordinate<T> { fn x(&self) -> T { self.x } fn y(&self) -> T { self.y } fn from_xy(x: T, y: T) -> Self { Self { x, y...
Rust
0
reparse will result in a full /// recalculation, so it is always safe but different settings will be /// faster for different tasks. pub incremental: bool, /// Number of jobs to run in parallel at any given time. pub jobs: usize, } /// Wraps a heap-allocated closure with a difficulty score which c...
Rust
0
output.split(b'\n'): if b'brand_string' in line or b'features' in line: print(line.strip()) elif sys.platform.startswith('linux'): subprocess.call(['lscpu']) elif sys.platform.startswith('win32'): subprocess.call(['wmic', 'cpu', 'get', 'name']) def check_network(args...
Python
1
or_handler), ..self } } fn empty_error_handler( _err: Box<dyn std::error::Error + Send + Sync>, _client: Arc<SlackClient>, ) { } } <gh_stars>1-10 use std::io::ErrorKind; use bytes::Bytes; use futures::io::Error; use futures::SinkExt; use tokio::net::tcp::ReadHalf; u...
Rust
0
bits, *v), InnerUnsignedValue::U128(v) => writer.write(*bits, *v), InnerUnsignedValue::I8(v) => writer.write(*bits, *v), InnerUnsignedValue::I16(v) => writer.write(*bits, *v), InnerUnsignedValue::I32(v) => writer.write(*bits, *v), InnerUnsi...
Rust
0
e in the 257 reply.''' if resp[:3] != '257': raise error_reply(resp) if resp[3:5] != ' "': return '' # Not compliant to RFC 959, but UNIX ftpd does this dirname = '' i = 5 n = len(resp) while i < n: c = resp[i] i = i+1 if c == '"': if i >= n or...
Python
1
}, } } None } /// Clears the [`TreeIndex`]. /// /// # Examples /// /// ``` /// use scc::TreeIndex; /// /// let treeindex: TreeIndex<u64, u32> = TreeIndex::new(); /// /// for key in 0..16_u64 { /// assert!(treeindex.insert(...
Rust
0
session.write_line("No LogService available.") def _debug(self, session: ShellSession, *message: str) -> None: """ Logs a trace """ self._trace(session, logging.DEBUG, message) def _info(self, session: ShellSession, *message: str) -> None: """ Logs a...
Python
1
#2609 n,m = map(int,input().split()) #์œ ํด๋ฆฌ๋“œ ํ•จ์ˆ˜ ๊ผญ๊ผญ ๊ธฐ์–ต์ž˜ํ•˜๊ธฐ def euclid(x,y): while y!=0: x,y = y,x%y return x print(euclid(n,m)) a = (n/euclid(n,m))*(m/euclid(n,m)) print(int(a*euclid(n,m)))
Python
1
# -*- coding: utf-8 -*- # # Copyright 2020 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
import asyncio from pathlib import Path from typing import Literal, Mapping from red_commons.logging import getLogger from grief.core import commands from grief.core.i18n import Translator from ..abc import MixinMeta from ..cog_utils import CompositeMetaClass log = getLogger("red.cogs.Audio.cog.Events.red") _ = Tra...
Python
1
: { 'GRU4Rec': 'saved/GRU4Rec-Jul-16-2023_13-54-20.pth', 'NARM': 'saved/NARM-Jul-16-2023_13-57-10.pth', 'Caser': 'saved/Caser-Jul-16-2023_14-00-14.pth', 'BERT4Rec': 'saved/BERT4Rec-Jul-16-2023_14-02-43.pth', 'SASRec': 'saved/SASRec-Jul-16-2023_14-16-37.pth', 'STAMP': 'sav...
Python
1
le; #[derive(Clone, Copy, Debug, PartialEq)] struct Obstacle; #[derive(Clone, Copy, Debug, PartialEq)] struct Player; #[derive(Clone, Copy, Debug, PartialEq)] struct SpriteIndex(usize); fn main() { let mut audio = Audio::new(); audio.add("bounce", "sound/bounce.wav"); audio.add("death", "sound/death.wav");...
Rust
0
# /views/form_views/edit_company_view.py from PyQt5.QtWidgets import QDialog from PyQt5 import uic from utils.message_service import MessageService import logging # Import the controller from controllers.company_controller import CompanyController class EditCompanyWindow(QDialog): def __init__(self, company_id)...
Python
1
import uvicorn from fastapi import APIRouter, FastAPI from fastapi.middleware.cors import CORSMiddleware from api.user.user_handler import user_router from api.auth.auth_handler import auth_router from api.message.message_handler import message_router from db.redis import get_redis_auth_pool, get_redis_messages_pool ...
Python
1
Result<Vec<u8>, String> { let len = self.len() * sizes::F32_LEN; let mut buffer: Vec<u8> = vec![]; for val in self.iter() { buffer.append(&mut val.to_le_bytes().to_vec()); } get_value_buffer(id, ESize::U64(len as u64), buffer.to_vec()) } } impl Encode for Vec<f6...
Rust
0
Parameters /// /// - `a` is the Array whose element will be replaced with element from `b` if corresponding element in `cond` Array is `True` /// - `cond` is the Array with conditional values /// - `b` is the Array whose element will replace the element in output if corresponding element in `cond` Array is /// `False`...
Rust
0
, shift as u8), low, "Shift by {0} == Rotation {0}", shift ); assert_eq!( cz_caesar_encode(uppercase_string, shift as u8), upp, "Shift by {0} == Rotation {0}", shift ); } } #[test] fn rot_test() { let ca...
Rust
0
{ return false; } let result: bool = files .iter() .all(|file| compare_file_headers(file, &templates)); result } fn compare_file_headers(file: &Path, templates: &[&Path]) -> bool { for template in templates { let template_lines = get_lines(&template); let file...
Rust
0
or_parallel_size): # chunk() creates a view of a bigger tensor. clone() is used here to avoid excessive storage. new_state_dicts[i]["model"][new_name] = new_tensors[i].clone() # TE sets _extra_state (for FP8 purposes), so set an empty one here for compatibility. extra_st...
Python
1
set_name("transform crates"); progress.set(3); let crates = convert::into_crates( crates, keywords, crates_keywords, categories, crates_categories, actors_by_id, crate_owners, versions_by_crate_id, progress.add_child("crates"), ); ...
Rust
0
{ let input = include_str!("input/d09.txt"); let heights = input .lines() .map(|line| { line.trim() .chars() .map(|c| c.to_digit(10).unwrap()) .collect::<Vec<_>>() }) .collect::<Vec<_>>(); let out1 = part1(&heights)...
Rust
0
8i32 }; if *rowbytes_ptr as libc::c_ulong != ((bps as libc::c_uint).wrapping_mul(width) as libc::c_ulong) .wrapping_mul(::std::mem::size_of::<png_byte>() as libc::c_ulong) { /* Something wrong */ dpx_warning( b"%s: Inc...
Rust
0
DeviceAuthorizationCancelRequest, ERemoteClientBroadcastMsg::k_ERemoteDeviceStreamingCancelRequest, ]; values } fn enum_descriptor_static(_: Option<ERemoteClientBroadcastMsg>) -> &'static ::protobuf::reflect::EnumDescriptor { static mut descriptor: ::protobuf::lazy::Lazy<::p...
Rust
0
_url), Err(_) => return Ok(Response::with((status::UnprocessableEntity, "rg:pu:1"))), } (body.github.organization, body.github.repo) } _ => return Ok(Response::with(status::UnprocessableEntity)), }; let mut conn = Broker::connect().unwrap(); match gith...
Rust
0
{:?}): {}", sh, &data, signature.unwrap_err() ); let signature = signature.unwrap(); let res = ctx.verify_init(sh, &mechanism, pubOh); assert!( res.is_ok(), "failed to call C_VerifyInit({}, {:?}, {}) with parameter: {}", sh, &mechanism, p...
Rust
0
test_accuracy = np.mean(y_test == y_pred) print(f"Testing Accuracy: {test_accuracy:.4f}") # Get probability predictions for ROC curves and TPR analysis try: y_proba = get_egr_probas(egr, X_test_preprocessed) except Exception as e: print(f"Could not get probability predictions: {e...
Python
1
from sniff.sniffer import run_sniffer if __name__ == '__main__': run_sniffer()
Python
1
data was" " produced with a version of SpECTRE prior to this Pull Request:" " https://github.com/sxs-collaboration/spectre/pull/5985." ), ) # Plotting options @click.option( "--x-bounds", type=float, nargs=2, help="The lower and upper bounds of the x-axis.", ) @click.option( "--...
Python
1
t2: v8::Global::new(), magic_number: 0xDEAD_BEEF, }; isolate1.state_add(state2); Isolate2(isolate1) } fn setup(&mut self) { self.0.setup(); let mut hs = v8::HandleScope::new(&mut self.0); let scope = hs.enter(); let context = scope.get_current_context().unwrap(); let global ...
Rust
0
import rospy from nav_msgs.msg import Path from geometry_msgs.msg import PoseStamped, Point import casadi as ca from visualization_msgs.msg import Marker, MarkerArray import numpy as np from geometry_msgs.msg import WrenchStamped import mr_casadi as mc # from hmqr5_dh import RobFki from ur5_dh import RobFki from z1_dh...
Python
1
current_val, )); } else { editor_state.insert_animation = Some(( current_clip, schema, group_index, prop_index, current_val, editor_state.current_frame(), ...
Rust
0
t-based Legal Q&A") # Upload documents uploaded_files = st.file_uploader( "Upload legal documents (TXT files only)", accept_multiple_files=True, type=["txt"] ) if uploaded_files: documents = [file.read().decode("utf-8") for file in uploaded_files] st.session_state.rag_chain...
Python
1
-> Result<DmlMeta, WriteBufferError>; /// Sends line protocol to the write buffer - primarily intended for testing async fn store_lp( &self, sequencer_id: u32, lp: &str, default_time: i64, ) -> Result<DmlMeta, WriteBufferError> { let tables = mutable_batch_lp::lines...
Rust
0
light skin tone, medium-light skin tone", group: "People & Body", subgroup: "family", is_variant: true, variants: &[], annotations: &[], }], annotations: &[], }; #[doc = "๐Ÿ‘ฉ๐Ÿป\u{200d}โค\u{fe0f}\u{200d}๐Ÿ’‹\u{200d}๐Ÿ‘ฉ๐Ÿฝ"] pub const KISS_WOMAN_WOMAN_LIGHT_SKIN_TONE_MEDIUM_SKIN...
Rust
0
_relative_path(&peer.git_url)?; let peer_submodule_path = paths.peers_directory.join(&submodule_relative_path); let repo = git2::Repository::open(&peer_submodule_path)?; // TODO: Add git2 credentials handling. // repo.find_remote("origin")?.fetch(&["master"], None, None)?; crate::common::fs::git(ve...
Rust
0
dctx.parent_coord.row as u16 + dctx.wgt.coord.row as u16 + 1); ctx.write_char_n('โ–€', shadow_len); } } } else if prp.style == ButtonStyle::Solid1p5 { // dctx.strbuff.clear(); let _fm = FontMemento::new(&dctx.ctx); dctx.strbuff.push_str("...
Rust
0
Ok(v) => v, Err(e) => { warn!("side: pkg-config failed ({:?})", &e); sr_failed.insert(SysReq::Dependencies); continue; } }; if !st.success() { warn!("side: devel library dependency {:?} is missing", lib); ...
Rust
0
el: self.face_mesh_model.close() self.face_mesh_model = None except Exception as e: self.logger.error("Erreur lors de la fermeture des modรจles: %s", e) def cmd_terminal_local(self, cmd): try: subprocess.run(cmd, shell=True, check=True) ...
Python
1
SharpCoder/teensycore //! Box provides a possibly unecessary level of abstraction #[derive(Copy, Clone)] pub struct Box { item: *const u32, } impl Box { pub fn new<T>(item: T) -> Self { // Get a reference to the thing let ptr = &item as *const T; return Box { item: ptr as *...
Rust
0
""" Performance Optimization and Caching Package Advanced caching and optimization strategies for the mental health chat system to minimize latency in model selection and improve overall performance. """ from .smart_cache import SmartModelCache, CachedSelection, CacheStatistics from .performance_monitor import Perfor...
Python
1
), '\n' => { match default { Some(default) => return Ok(default), None => continue, } } _ => continue, } } } fn prompt_ask(question: &str, default: Option<...
Rust
0
ce_holder(); let ans: syn::Type = syn::parse_str("::ruststep::place_holder::PlaceHolder<THolder>").unwrap(); assert_eq!(<FieldType as Into<syn::Type>>::into(place_holder), ans); let ty: syn::Type = syn::parse_str("Option<T>").unwrap(); let f: FieldType = ty.try_into().unwrap...
Rust
0
: Borrow<[u8]>, { self.adjacent_node(Adjacency::Predecessor, key) } /// Look up in the consistent hashing ring and return the first successor [`VirtualNode`] to /// the one that the given `key` should be assigned on, but which also belongs to a different /// distinct [`Node`] than the latte...
Rust
0
: Mutex::new(GeneratorStreamInternal::new(log2_size_minus_6)), } } pub(super) async fn missing_seq_numbers(&self, skip_last_n: u16) -> Vec<u16> { let internal = self.internal.lock().await; internal.missing_seq_numbers(skip_last_n) } pub(super) async fn add(&self, seq: u16) { ...
Rust
0
takrorlansa, bot egasiga murojaat qiling.</i>", reply_markup=get_user_main_keyboard(), protect_content=True ) else: await callback_query.message.answer("Tanlangan film topilmadi. Ma'lumotlar o'chirilgan bo'lishi mumkin.") await callback_query.answer() # Alwa...
Python
1
=> Ok(source), _ => Err(self.code), } } fn state_keys(&self) -> Iter<i32> { self.keys.iter() } fn get_constraints(&self) -> Iter<ConstraintVariant> { self.constraints.iter() } } struct GroupHardRouteConstraint { total_jobs: usize, code: i32, state_...
Rust
0
HostapdCLI(config='ft-sae-1.conf'), HostapdCLI(config='ft-sae-2.conf'), HostapdCLI(config='ft-psk-3.conf') ] cls.bss_hostapd[0].set_address('12:00:00:00:00:01') cls.bss_hostapd[1].set_address('12:00:00:00:00:02') cls.bss_hostapd[2].set_ad...
Python
1
_string() + &hex_string(input.as_reader().raw_data()).unwrap() } /// Parse u64 in JSON /// /// Support both **number** and **string** format. fn parse_json_u64(field_name: &str, field: &Value) -> u64 { if let Some(val) = field.as_u64() { val } else if let Some(val) = field.as_str() { val.replac...
Rust
0
UR5n[URU-S5up#X1-UlU=RX!-- sl UR (dgUR (dVUR(dEUR(d4URc'...
Python
1
atcher(&self) -> R::Dispatcher { self.window.dispatcher.clone() } /// Runs the given closure on the main thread. pub fn run_on_main_thread<F: FnOnce() + Send + 'static>(&self, f: F) -> crate::Result<()> { self .window .dispatcher .run_on_main_thread(f) .map_err(Into::into) } ...
Rust
0
DialDevicePicker = *mut ::core::ffi::c_void; pub type DialDevicePickerFilter = *mut ::core::ffi::c_void; pub type DialDeviceSelectedEventArgs = *mut ::core::ffi::c_void; pub type DialDisconnectButtonClickedEventArgs = *mut ::core::ffi::c_void; pub type DialReceiverApp = *mut ::core::ffi::c_void; <reponame>huangjiahua/...
Rust
0
untrans, (time.time() - start), ) start = time.time() logger.debug("Updating checks - this may take some time...") trans = self.update_translated() logger.debug( "Updated checks for %s units in %s seconds", trans, (time.time() - start) ...
Python
1
air::ast::Typ::Bool, } } pub fn stm_to_air(params: &Params, stm: &Stm) -> Commands { let local = box_slice_map(params, |param| { Rc::new(DeclarationX::Const(suffixed_id(&param.x.name), typ_to_air(&param.x.typ))) }); let assertion = stm_to_stmt(&stm); let query = Rc::new(QueryX { local: Rc:...
Rust
0
BufReader, Read, Seek, SeekFrom}; use std::sync::Arc; use crate::array::*; use crate::buffer::Buffer; use crate::compute::cast; use crate::datatypes::{DataType, Field, IntervalUnit, Schema, SchemaRef}; use crate::error::{ArrowError, Result}; use crate::ipc; use crate::record_batch::{RecordBatch, RecordBatchReader}; us...
Rust
0
import sys import pygame import requests def get_coordinates(): toponym = geocode() toponym_coodrinates = toponym["Point"]["pos"] def geocode(address): # ะกะพะฑะธั€ะฐะตะผ ะทะฐะฟั€ะพั ะดะปั ะณะตะพะบะพะดะตั€ะฐ. geocoder_request = f"http://geocode-maps.yandex.ru/1.x/" geocoder_params = { "apikey": 'dda3ddba-c9ea-...
Python
1
args.start_epoch = checkpoint['epoch'] model.load_state_dict(checkpoint['state_dict']) optimizer.load_state_dict(checkpoint['optimizer']) scheduler.load_state_dict(checkpoint['scheduler']) print("=> loaded checkpoint '{}' (epoch {})".format(args.resume, checkpoint['epoch'])) ...
Python
1
type FloatRect = Rect<f32, NonNegativeFloat>; <reponame>FrictionlessPortals/resec //! # resec //! //! A library dedicated to reverse engineering techniques for the [SEC](https://examinations.ie). //! //! **Note**: This library can stop working at any time if a website change occurs! mod consts; pub mod error; pub mod...
Rust
0
# Copyright 2020 Yablon Ding # 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, soft...
Python
1
_id) # recalculate hulls scope_meta_file = os.path.join(DATA_DIR, dataset_id, "scopes", scope_id + ".json") with open(scope_meta_file) as f: scope_meta = json.load(f) clusters = scope_meta["cluster_labels_lookup"] for c in clusters: indices = df[df['cluster'] == c["cluster"]]["ls_index"].tolist() ...
Python
1
from taleweave.models.entity import Character def expire_events(character: Character, current_turn: int): """ Expire events that have already happened. """ events = character.planner.calendar.events expired_events = [event for event in events if event.turn < current_turn] character.planner.ca...
Python
1
# code14-13.py # [์ŠˆํŒ…๊ฒŒ์ž„ ํ”„๋กœ์ ํŠธ] ์šฐ์ฃผ์„ ์—์„œ ๋ฏธ์‚ฌ์ผ ๋ฐœ์‚ฌํ•˜๊ธฐ import pygame import random import sys ## ํ•จ์ˆ˜ ์„ ์–ธ ๋ถ€๋ถ„ ## # @๊ธฐ๋Šฅ 2-5 : ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ๋ฐ›์€ ๊ฐ์ฒด๋ฅผ ํ™”๋ฉด์— ๊ทธ๋ฆฌ๋Š” ํ•จ์ˆ˜ ์„ ์–ธ def paintEntity(entity, x, y): monitor.blit(entity, (int(x), int(y))) # @๊ธฐ๋Šฅ 5-4 : ์ ์ˆ˜๋ฅผ ํ™”๋ฉด์— ์“ฐ๋Š” ํ•จ์ˆ˜ ์„ ์–ธ def playGame(): global monitor, ship, monster r = random.randra...
Python
1
from scipy.optimize import minimize from utils import * class MPCController: def __init__(self, parameters, steps_ahead=10, dt=0.1): self.steps_ahead = steps_ahead self.dt = dt print(parameters["mass"]) self.bounds = [(parameters["max_deceleration"], parameters["max_acceleration"])]...
Python
1
import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.action_chains import ActionChains # Initialize WebDriver def initialize_driver(): options...
Python
1
temp file"); } } Ok(DoubleMappedTempFile { addr: buff, size }) } pub fn addr(&self) -> *mut libc::c_void { self.addr } } impl Drop for DoubleMappedTempFile { fn drop(&mut self) { unsafe { libc::munmap(self.addr, self.size * 2); } } ...
Rust
0
import torch from copy import deepcopy import dgl from .base_explainer import BaseExplainer from ..utils.torch import torch_to_numpy class GraphLRPExplainer(BaseExplainer): """ Layerwise-Relevance Propagation. This module will only work if the model was built with the ml library provided. """ de...
Python
1
necting using next resolved address. If there aren't any left, continue with next Parameters config. """ try: addr_record = next(self._addrinfo_iter) except StopIteration: _LOG.debug( '_try_next_resolved_address: continuing with next config.') ...
Python
1
; let key2 = CompoundKey{from: 1, to: 2}; let key3 = CompoundKey{from: 2, to: 1}; assert_eq!(key1, key2); assert_ne!(key1, key3); } } use std::ffi::CString; use std::mem; use std::os::raw::{c_char, c_int}; #[allow(dead_code)] #[allow(non_snake_case)] #[allow(non_camel_case_types)] ...
Rust
0
let mut ctx = ctx.clone(); let mut first = true; for expr in args { let input = eval_input(&ctx, expr)?; if first { ctx.sample_rate_hint = Some(input.info.sample_rate); first = false; ...
Rust
0
e_result_t; } extern "C" { #[doc = ""] #[doc = " @brief Set memory access attributes for a virtual address range."] #[doc = ""] #[doc = " @details"] #[doc = " - This function may be called from simultaneous threads with the same"] #[doc = " function handle."] #[doc = " - The im...
Rust
0
# Tutorial 9: Groups # Attributes of players, such as degree or scale, can also be changed by directly assigning values to it such that p1 >> pads([0,2,4,2], scale=Scale.majorPentatonic) # is equivalent to p1 >> pads() p1.degree = [0,2,4,2] p1.scale = Scale.majorPentatonic # This is useful if you want to assign the...
Python
1
if the current distribution has any data to. install.""" return self.distribution.has_data_files() # 'sub_commands': a list of commands this command might have to run to # get its work done. See cmd.py for more info. sub_commands = [('install_lib', has_lib), ('inst...
Python
1
import numpy as np import pandas as pd import os import pickle ex_time = [150,150,150,250,250,250,250,250] # typical exposure time ex_num = [1,2,4,1,2,4,8,10] magCon = [['z_sn','y_sn'],['i_sn','y_sn'],['i_sn','z_sn'],['r_sn','y_sn'],['r_sn','z_sn'], ['r_sn','i_sn'],['g_sn','z_sn']] limitCon_l = [[25.2...
Python
1
thout_is_empty)] impl PubAllowed { pub fn len(self: &Self) -> isize { 1 } } // No `allow` attribute on this impl block, but that doesn't matter -- we only require one on the // impl containing `len`. impl PubAllowed { pub fn irrelevant(self: &Self) -> bool { false } } pub trait PubTrai...
Rust
0
import boto3 import json Prompt_data = """ Act as a Shakesphere and write a poem on machine learning """ bedrock=boto3.client(service_name = "bedrock-runtime") payload={ "prompt": Prompt_data, "max_gen_len":512, "temperature":0.5, "top_p":0.9 } body = json.dumps(payload) model_id = "meta.llama3-70b-...
Python
1
ityType::categorize(&a.amenity_type) { at == AmenityType::Bar || at == AmenityType::ConvenienceStore || at == AmenityType::Food || at == AmenityType::Supermarket } else { false ...
Rust
0
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd # Copyright 2007 Google Inc. All Rights Reserved...
Python
1
# Test with logical connectives from qiana.qianaExtension.signature import Signature signature = Signature() signature.extendFromTptp("p(X1) & q(X2) => r(f(X1), g(X2))") assert "p" in signature.basePredicates assert signature.basePredicates["p"] == 1 assert "q" in signature.basePredicates ...
Python
1
ead to use for http service. pub threads: Option<usize>, #[serde(skip_serializing_if = "Option::is_none")] #[structopt(name = "http-ip-headers", long, use_delimiter = true)] /// list of http header which identify a ip, Default: X-Real-IP,X-Forwarded-For pub ip_headers: Option<Vec<String>>, #[s...
Rust
0
from django.urls import path from apps.estudiantes.views.regular import ( registrar_estudiante_regular, credenciales_generadas_estudiante_regular, listar_regulares, editar_estudiante_regular, eliminar_estudiante_regular, listar_regulares_inactivos, reactivar_estudiante_regular, ) urlpatter...
Python
1
# Copyright 2021 ETH Zurich and University of Bologna. # # SPDX-License-Identifier: Apache-2.0 # # 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....
Python
1
test] fn deserialize_custom_state_sync_event() { let json_data = custom_state_event(); assert_matches!(from_json_value::<AnySyncStateEvent>(json_data), Ok(_)); } #[test] fn deserialize_custom_message_sync_event() { let json_data = json!({ "content": { "body": "๐Ÿ‘" }, "ev...
Rust
0
#โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” #โ”ƒ๏ผฐ๏ผถ ๅ‹•็”ปใƒ•ใ‚กใ‚คใƒซ ใƒ—ใƒฌใ‚คใƒคใƒผ #โ”ƒโ€ปๅ‹•็”ปใ‚’ใ€Ž๏ผง๏ผต๏ผฉ็‰ˆใ€ใงๅ†็”Ÿ๏ผˆ๏ผต๏ผฉไป˜ใ๏ผ‰ #โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” # [ใ‚ขใƒ—ใƒชๅ…ฑ้€š] import ๅ‹•็”ปใƒกใƒ‹ใƒฅใƒผๅฎŸ่ฃ… as VLC #โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” #โ”ƒใƒ•ใ‚กใ‚คใƒซไธ€่ฆง #โ”ƒใƒปใƒ•ใ‚กใ‚คใƒซใƒ‘ใ‚น๏ผš๏ผถ๏ผฌ๏ผฃใงๅ†็”Ÿใ™ใ‚‹ #โ”ƒใƒป๏ผต๏ผฒ๏ผฌใ€€ใ€€ใ€€๏ผšๆ—ขๅฎšใƒ–ใƒฉใ‚ฆใ‚ถใง้–‹ใ #โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” ๅ‹•็”ปไธ€่ฆง = { "02-Story" : { "...
Python
1
examples=[ ["assets/demo1_video.mp4", "assets/demo1_audio.wav"], ["assets/demo2_video.mp4", "assets/demo2_audio.wav"], ["assets/demo3_video.mp4", "assets/demo3_audio.wav"], ], inputs=[video_input, audio_input], ...
Python
1
_type"; const KEY_POLLER_TYPE: &str = "poller_type"; const KEY_SVC_METHOD: &str = "operation"; pub(crate) fn workflow_poller() -> KeyValue { KeyValue::new(KEY_POLLER_TYPE, "workflow_task") } pub(crate) fn workflow_sticky_poller() -> KeyValue { KeyValue::new(KEY_POLLER_TYPE, "sticky_workflow_task") } pub(crate)...
Rust
0
if ciphertext.len() < 32 { panic!("invalid message"); } let mut ciphertext = ciphertext; let iv = ciphertext.split_off(ciphertext.len() - 16); encoding::ascii_encode(&aes128::cbc::decrypt(&ciphertext, &self.private_key, &iv).unwrap()) } } pub mod mitm { use su...
Rust
0
import os import requests api_address = '172.17.0.1' api_port = 8000 positive_sentence = 'life is beautiful' negative_sentence = 'that sucks' api_port = 8000 def perform_test(endpoint): r = requests.get( url=f'http://{api_address}:{api_port}/{endpoint}', params={ 'username': 'alice...
Python
1
== model_id).first() if not model: raise HTTPException(status_code=404, detail="Model not found") # ๆž„ๅปบๅŸบ็ก€ๆŸฅ่ฏข query = db.query( ModelReview, User.username ).join(User, ModelReview.user_id == User.id)\ .filter(ModelReview.model_id == model_id) ...
Python
1
Manager, for conciseness. See their documentation for more details, but /// essentially you should default to using a SimpleRefPeerManager, and use a /// SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when /// you're using lightning-net-tokio. /// /// [`read_event`]: PeerManager::re...
Rust
0
ath.dirname(os.path.abspath(__file__))) # Set permissions on executables print("[setup.py] Set execute permissions on executables") for executable in get_executables(): executable = os.path.join(installed_package_dir, executable) if not os.path.exists(executable): continue ...
Python
1