text
string
label_name
string
labels
int64
from sklearn.manifold import TSNE from sklearn.decomposition import PCA import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import numpy as np from sklearn.cluster import KMeans, AgglomerativeClustering, MiniBatchKMeans from sklearn.metrics import silhouette_score, calinski_harabasz_score, davies_...
Python
1
highest_y(values: &[Xy]) -> (usize, f64) { let mut max = (0, std::f64::MIN); values.iter().enumerate().for_each(|(i, &v)| { if v.1 > max.1 { max = (i, v.1); } }); max } /// Get lowest y-value in XY-list /// Returns index and value pub fn lowest_y(values: &[Xy]) -> (usize, f6...
Rust
0
/// fn main() -> std::io::Result<()> { /// let sock = UdpSocket::bind("[::1]:34254")?; /// sock.connect("[::1]:41203")?; /// let buf1 = [1; 8]; /// let buf2 = [2; 16]; /// let buf3 = [3; 8]; /// let bufs = &[ /// IoSlice::new(&buf1), /// IoSlic...
Rust
0
from server.apps import apps as server_apps from server.contrib.sitemaps import Sitemap from server.core.exceptions import ImproperlyConfigured class FlatPageSitemap(Sitemap): def items(self): if not server_apps.is_installed('server.contrib.sites'): raise ImproperlyConfigured("FlatPageSitemap ...
Python
1
i::CStr::from_ptr(ptr); println!("{}", s.to_string_lossy()); } } } use nom::number::complete::{le_f32, le_i32, le_i64, le_u32, le_u64, le_u8}; use nom::IResult; use crate::parsers::nom_utils::NomCustomError; #[inline] pub fn parse_bin_i64(i: &[u8]) -> IResult<&[u8], i64, NomCustomError<&[u8]>>...
Rust
0
PACKET_KIND_T_STORAGE_ESTIMATE_COUNT, 0)?; } Packet::RStorageEstimateCount(ref v) => { let b = serde_bare::to_vec(v)?; send_hdr(w, PACKET_KIND_R_STORAGE_ESTIMATE_COUNT, b.len().try_into()?)?; write_to_remote(w, &b)?; } Packet::StorageBeginSweep(ref v)...
Rust
0
} } } impl fmt::Display for DecompressionCommand { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{} {}", self.cmd, self.args.join(" ")) } } lazy_static! { static ref DECOMPRESSION_COMMANDS: HashMap< &'static str, DecompressionCommand, > = { l...
Rust
0
tion(error_exc) else: sys.stderr.write("{0}\n".format(error_exc)) # Once the analysis is completed or terminated for any reason, we report # back to the agent, notifying that it can report back to the host. finally: try: # old agent server = xmlrpclib.Ser...
Python
1
writer, " usage: kira [+-][percent] percent must be a number between 0 and 100. A prefix of either - oder + is allowed. Without a prefix, the brightness gets set to the given percentage. With the + prefix, the given percentage gets added to current brightness. With the - prefix, the given percentage ge...
Rust
0
torch.nn.LeakyReLU): da = derive_leakyrelu(x_, slope=module.negative_slope) elif isinstance(module, torch.nn.Identity): da = derive_identity(x_) else: ValueError(f"Please implement the derivative function of {module}") ...
Python
1
uckDB gateway duckdb_resource = SQLMeshResource( project_dir="tests/fixtures/sqlmesh_project", gateway="duckdb" ) assert duckdb_resource.gateway == "duckdb" # Test that we can get models with DuckDB models = duckdb_resource.get_models() assert len(models) > 0...
Python
1
#[inline] pub fn rw2<'a, T, U>( &'a mut self, tc1: &'a TCell<Q, T>, tc2: &'a TCell<Q, U>, ) -> (&'a mut T, &'a mut U) { assert!( tc1 as *const _ as usize != tc2 as *const _ as usize, "Illegal to borrow same TCell twice with rw2()" ); unsafe...
Rust
0
# pankaj developer account # PATH_TO_PRIVATE_KEY_FILE = "private.key" # Anil admin demo account PATH_TO_PRIVATE_KEY_FILE = "private-admin-demo.key" with open(PATH_TO_PRIVATE_KEY_FILE) as private_key_file: private_key = private_key_file.read() PRIVATE_KEY = private_key
Python
1
#!/opt/vfw-web/bin/python # Eduardo S. Scarpellini <scarpellini@gmail.com> # Jun 25 2011 # from bottle import run, route, get, post, request, response, static_file, abort, template, debug from datetime import datetime from hashlib import md5 from simplejson import loads, dumps from re...
Python
1
inps = [] # make a deepcopy since we are changing arguments request_args = copy.deepcopy(request_args) self._max_gen_toks = request_args.pop("max_gen_toks", self.max_gen_toks) for context, _ in chunk: # add context (prompts) to the list ...
Python
1
ops::orbits_sort(&mut cycles); assert_eq!(starting_orbit, results.0); assert_eq!(cycles, results.1); } } #[test] fn test_mapping() { type ParamType1 = String; type ReturnType = (mapping_ops::VertexMapping, mapping_ops::BoundaryEdges); let test_data: V...
Rust
0
JObject<'a>, pub object_klass: JClass<'a>, pub size: jlong, } pub struct VmStartEvent<'a> { pub jvmti: &'a JVMTIFacadeEnv<'a>, pub jni: &'a JNIEnv<'a>, } use std::io; fn main(){ let mut input=String::new(); io::stdin().read_line(&mut input).unwrap(); let mut s=input.trim().split(' ')...
Rust
0
pClient::with_config(Config::default()); /// ``` pub fn with_config(config: Config) -> SntpClient { SntpClient { config } } /// Synchronize with the server /// /// Sends a request to the server, waits for the reply and processes it. This is a blocking call /// and can block for quit...
Rust
0
rors. # TODO(b/127523126): Add more principled tests that this actually computes # what we expect it to (manual experimentation and testing has been done and # convincing results observed, but no clear strategy for automated tests # jumps out as terribly obvious). vgp.surrogate_posterior_expected_lo...
Python
1
s json_file = OUTPUT_DIR / "all_devices_enhanced.json" ndjson_file = OUTPUT_DIR / "all_devices_enhanced.ndjson" if json_file.exists() and ndjson_file.exists(): json_size = f"{json_file.stat().st_size // 1024}KB" ndjson_size = f"{ndjson_file.stat().st_size // 1024...
Python
1
try: region = message.split()[1].lower() except IndexError: region = def_region.lower() if region not in region_list: bot.whisper( source, f"Region is not valid. Please enter a valid region. Region...
Python
1
0")] /// override default proxy timeout pub timeout: Option<f64>, #[argh(subcommand)] pub subcommand: Option<Subcommand>, } /// Extract the base cmd from a path fn cmd<'a>(default: &'a String, path: &'a String) -> &'a str { std::path::Path::new(path).file_name().map(|s| s.to_str()).flatten().unwra...
Rust
0
rruptLabel, 21), (I::Unop(token![sin], ScalarType::Float), 61), (I::Unop(token![cos], ScalarType::Float), 62), // (I::Unop(Un::Tan, ScalarType::Float), 63), // (I::Unop(Un::Acos, ScalarType::Float), 64), // (I::Unop(Un::...
Rust
0
d-ok (Generated) pub fn gen_unbind_ok<'a, W: Write + BackToTheBuffer + 'a>( _: &'a UnbindOk, ) -> impl SerializeFn<W> + 'a { move |mut input| { input = gen_id(51)(input)?; Ok(input) } } } /// tx (generated) pub mod tx { use super::*; /// Parse tx (Gen...
Rust
0
Self: Sized, { 29 } fn version(&self) -> u32 { Self::version_static() } type Options = (); type State = MeshAdvGltfImporterStateStable; /// Reads the given bytes and produces assets. fn import( &self, op: &mut ImportOp, source: &mut dyn Read, ...
Rust
0
assert_eq!("YTw/JyJmeAAle1/7zuZkPP0C73BQ+6XrFEt2/Wy++2o", key.fingerprint()); } #[test] fn rsa_fingerprint_string() { let key = PublicKey::parse(TEST_RSA_KEY).unwrap(); assert_eq!("2048 SHA256:YTw/JyJmeAAle1/7zuZkPP0C73BQ+6XrFEt2/Wy++2o demos@siril (RSA)", key.to_fingerprint_string(...
Rust
0
rait::parent(*node), TsUnionOrIntersectionType::TsIntersectionType(node) => NodeTrait::parent(*node), } } fn children(&self) -> Vec<Node<'a>> { match self { TsUnionOrIntersectionType::TsUnionType(node) => node.children(), TsUnionOrIntersectionType::TsIntersectionType(node) => node.childre...
Rust
0
} impl From<Hash> for models::hash::Hash { fn from(other: Hash) -> Self { Self { alg: models::hash::HashAlgorithm::new_unchecked(other.alg), content: other.content.into(), } } } const HASH_TAG: &str = "hash"; const ALG_ATTR: &str = "alg"; impl ToXml for Hash { fn ...
Rust
0
return WaitEntryWeak(c); } pub fn New() -> Self { let internal = EntryInternal { next: None, prev: None, mask: 0, context: WaitContext::None, }; return Self(Arc::new(QMutex::new(internal))); } pub fn Timeout(&self) { ...
Rust
0
flags_readonly.push_back(true); } } assert_eq!(flags_readonly.len(), count as usize); let mut count_false = 0; for f in &flags_readonly { if !f { count_false += 1; } } assert_eq!(count_false, 1); flags_readonly ...
Rust
0
# this python file will take in a csv file of scraped reviews and clean it so it can be used for modeling import csv import string import nltk # pip install --user -U nltk [used for removing stop words and filtering stem words] nltk.download('stopwords') from nltk.corpus import stopwords from nltk.stem.porter import ...
Python
1
rust `bool` is undefined behavior. /// /// We require `Copy` to also rule out anything that implements `Drop`. /// /// References are inherently non-Pod, so we can require a 'static lifetime. pub unsafe trait Pod: Copy + 'static {} /// Convert to a slice of raw bytes. pub fn to_u8_slice<T>(slice: &[T]) -> &[u8] where...
Rust
0
from collections import deque # Time: O(n) # Space: O(n) # Step 1: Define the TreeNode class class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right # Step 2: Define the function def largest_node_binary_tree(root): # Initial...
Python
1
, 13 ]; TABLE[s as usize] } #[macro_export] macro_rules! println_err { ($($arg:tt)*) => { match writeln!(&mut ::std::io::stderr(), $($arg)*) { Ok(_) => (), Err(e) => panic!("Unable to write to stderr: {}", e), } } } #[macro_export] macro_rules! print_err { ...
Rust
0
, Err(e) => { log::error!("[udp]failed to recvfrom remote: {}", e); continue; } }; log::debug!("[udp]recvfrom remote {}", &raddr); if let Err(e) = lis.send_to(&buf[..n], &laddr).await { log::error!("[udp]failed to sendto clien...
Rust
0
(this => Tristate::Error); (&**this).last().into() } #[no_mangle] pub unsafe extern "C" fn rs_bitvec_bs_b32_last(this: *const *const BitSlice<BigEndian, u32>) -> Tristate { nullck!(this => Tristate::Error); (&**this).last().into() } #[no_mangle] pub unsafe extern "C" fn rs_bitvec_bs_l32_last(this: *const *const BitS...
Rust
0
*self == FULL_IE_A::FULL_IE_0 } #[doc = "Checks if the value of the field is `FULL_IE_1`"] #[inline(always)] pub fn is_full_ie_1(&self) -> bool { *self == FULL_IE_A::FULL_IE_1 } } #[doc = "Write proxy for field `FULL_IE`"] pub struct FULL_IE_W<'a> { w: &'a mut W, } impl<'a> FULL_IE_W<'a> { #[doc = r"W...
Rust
0
[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6); self.w } } #[doc = "Lock bit set by the TZ software for the CSI\n\nValue on reset: 0"] #[derive(Clone, Copy, Deb...
Rust
0
must be scipy or sklearn compatible lower: only fetch lower case tokens Returns: An list of ([Embedding][whatlies.embedding.Embedding], score) tuples. """ if isinstance(emb, str): emb = self[emb] queries = self._prepare_queries(lower=lower) d...
Python
1
: 2.0, converged: true, }; let an3 = Analyzed::<f64> { mean: 3.0, error: (0.1 * 0.1 + 0.2 * 0.2).sqrt(), correlation_time: 2.0, number_of_inputs: 1000, converged: true, }; let an4 = Analyzed::<f64> { mean: 2.0, error: (2.0 * 0.1 * 2.0 * 0.1...
Rust
0
rary(0.0, PARTICLE_SPEED_LIMIT), }, ParticlePosition::RightBoundary => Particle { x: canvas_width, y: random_arbitrary(0.0, canvas_height), size: random_arbitrary(1.0, PARTICLE_SIZE_LIMIT), speed_x: random_arbitrary(-PARTICLE_SPEED_...
Rust
0
a string") } // moves s in _s, but doesn't bind the value to _s if let Some(_s) = s { println!("Found another string") } // ignore values with .. in destructuring struct Point { x: i32, y: i32, z: i32, } ...
Rust
0
#!/usr/bin/env python3 import rclpy from rclpy.node import Node from geometry_msgs.msg import Twist from rclpy.duration import Duration class KachakaFeedforwardControl(Node): def __init__(self): super().__init__('kachaka_feedforward_control') # Create a Publisher that sends Twist type messages to ...
Python
1
# coding=utf-8 import threading from flask_babel import lazy_gettext from mycodo.actions.base_action import AbstractFunctionAction from mycodo.config import MYCODO_DB_PATH from mycodo.config_translations import TRANSLATIONS from mycodo.databases.models import Actions from mycodo.databases.models import PID from mycod...
Python
1
// Guess the script, language and direction from the buffer hb_buffer_guess_segment_properties(hb_buffer); } Self { words, hb_buffer } } } impl<'a> Drop for HbBuffer<'a> { fn drop(&mut self) { unsafe { hb_buffer_destroy(self.hb_buffer) }; } } // The glyph infos are all...
Rust
0
let day = cap.get(3).unwrap().as_str(); Ok(Utc.ymd( year.parse::<i32>().unwrap(), month.parse::<u32>().unwrap(), day.parse::<u32>().unwrap(), )) } /// Picks the correct "rustdoc.css" static file depending on which rustdoc version was used to /// generate this version of this crate....
Rust
0
jit; use jit::*; #[test] fn test_sqrt() { let mut ctx = Context::<()>::new(); assert_eq!(ctx.functions().count(), 0); jit_func!(&mut ctx, func, fn(num: usize) -> usize { let num = func.insn_convert(num, &get::<f64>(), false); let val = func.insn_sqrt(num); func.insn_return(val); ...
Rust
0
request_proxy_index]["count"] < self.invalid_proxy_threshold: self.invalid_proxy(request_proxy_index) elif request_proxy_index == self.proxy_index: # 虽然超时,但是如果之前一直很好用,也不设为invalid self.inc_proxy_index() else: # 简单的切换而不禁用 i...
Python
1
"); let yaml_objs = filter_map_file_objs( list_files( &client, repo_config, fetch_last_tag(&client, repo_config).await?, ) .await?, ) .collect_vec(); progress.finish_with_message("done"); Ok(yam...
Rust
0
average_volume_%03d.hdf" % rviper_iter ) master_var = os.path.join( masterdir, "variance_volume_%03d.hdf" % rviper_iter ) sp_global_def.sxprint( "Copying average and variance from iteration %03d to output directory %...
Python
1
, recent_7k_scores, best_7k_scores) = match tokio::try_join!( async { api::get_user_stats(user_id) .await .map_err(Into::into) .and_then(|opt| opt.ok_or(UpdateUserError::NotFound)) }, async { api::get_user_recent_scores(user...
Rust
0
# Code generated by lark_sdk_gen. DO NOT EDIT. from pylark.lark_request import RawRequestReq, _new_method_option import attr import typing import io @attr.s class CreateTaskReminderReq(object): task_id: str = attr.ib( default="", metadata={"req_type": "path", "key": "task_id"} ) # 任务 ID, 示例值:"839126...
Python
1
"""Enum representing captured send status of outbound messages.""" from enum import Enum OUTBOUND_STATUS_PREFIX = "acapy::outbound-message::" class OutboundSendStatus(Enum): """Send status of outbound messages.""" # Could directly send the message to the connection over active session SENT_TO_SESSION =...
Python
1
n".join(msg_parts) raise WaiterTimeoutError(msg) def until(self, predicate: Callable[[T], bool] | None = None) -> T: return self._poll(predicate=predicate or operator.truth) def until_not(self) -> T: return self._poll(predicate=operator.not_) def until_equal_to(self, value: T) -> ...
Python
1
, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _reent__bindgen_ty_1__bindgen_ty_1 { pub _unused_rand: libc::c_uint, pub _strtok_last: *mut libc::c_char, pub _asctime_buf: [libc::c_char; 26usize], pub _localtime_buf: __tm, pub _gamma_signgam: libc::c_int, pub __bindgen_padding_...
Rust
0
""" Creates a redshift-dependent cooling box such that it always has the same _physical_ density at the given redshift. """ from swiftsimio import Writer from swiftsimio.units import cosmo_units from unyt import mh, cm, s, K, Mpc, kb import numpy as np import h5py # Physics parameters. boxsize = 1.0 * Mpc physical_...
Python
1
个样本") if stats["format_errors"]: print("\n⚠️ 格式错误样本数: {}".format(len(stats['format_errors']))) self.print_sample_list(stats["format_errors"][:3]) if stats["invalid_role_sequence"]: print("\n⚠️ 角色序列异常样本数: {}".format(len...
Python
1
vides space for data items to read /// - bufr: provides more data to read /// - n_pos: how many items to read /// postconditions fn split_step( posa: &mut Vec<MPosDTM>, posb: &mut Vec<MPosDTM>, unsorted: &str, c_name: &str, bufr: &mut BufReader<File>, n_pos: usize, ) -> Result<(usize, bool), Str...
Rust
0
class Solution: def rob(self, nums: List[int]) -> int: current, highest = 0,0 for n in nums: temp = max(n + current, highest) current = highest highest = temp return highest
Python
1
) -> BoxStream<'static, crate::Result<(Self::Shard, crate::store::Store)>> { Box::pin(stream::iter(1..=3).map(|_| Err(Error::Unimplemented))) .map_ok(|_: u8| (42, mock_store())) .boxed() } fn apply_shard(&mut self, _: Self::Shard, _: &crate::store::Store) -> ...
Rust
0
#[derive(Debug, AperCodec)] #[asn(type = "ENUMERATED", extensible = true, lb = "0", ub = "0")] pub struct DL_Forwarding(pub u8); impl DL_Forwarding { pub const D_L_FORWARDING_PROPOSED: u8 = 0u8; } #[derive(Debug, AperCodec)] #[asn(type = "BITSTRING", sz_extensible = false, sz_lb = "16", sz_ub = "16")] pub struct D...
Rust
0
", **result) # Copy temporary file to destination if necessary backup_file = None if result['checksum_src'] != result['checksum_dest']: try: if backup: if os.path.exists(dest): backup_file = module.backup_local(dest) module.atomic_move(tmp...
Python
1
# -*- coding: utf-8 -*- # # Copyright (C) 2019 CERN. # # invenio-app-ils is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Resolve documents and patron for order lines.""" import jsonresolver from werkzeug.routing import Rule from i...
Python
1
ptr_meta::from_raw_parts(data_address, metadata)) } } } use symbol_sdk::{Client, Retry}; #[tokio::main] async fn main() { let client = Client::from_url( "http://ngl-dual-101.testnet.symboldev.network:3000", Retry::default(), ) .await .unwrap(); println!("Network_type: {...
Rust
0
g.rule.push(right_side.iter().rev().map(|x| *x).collect::<Vec<u32>>()); stack.push(var); var += 1; right_side = Vec::new(); } else { stack.push(self.label[i]); i += 1; ...
Rust
0
Triple(Box<Self>, Box<Self>, Box<Self>), Subject(Box<Self>), Predicate(Box<Self>), Object(Box<Self>), IsTriple(Box<Self>), BooleanCast(Box<Self>), DoubleCast(Box<Self>), FloatCast(Box<Self>), DecimalCast(Box<Self>), IntegerCast(Box<Self>), DateCast(Box<Self>), TimeCast(Bo...
Rust
0
t, result.as_slice(), )); result.set_to_zero(); } map.add_generators_from_matrix_rows(t, output_matrix.as_slice_mut()); #[cfg(feature = "concurrent")] { ...
Rust
0
ommon::ErrorReported; use syntax::ast::{self, DUMMY_NODE_ID}; use syntax::codemap::Spanned; use syntax::ptr::P; use syntax_pos::{Span, DUMMY_SP}; use arena::TypedArena; use std::cmp::Ordering; use std::fmt; use std::iter::{FromIterator, IntoIterator, repeat}; pub fn expand_pattern<'a, 'tcx>(cx: &MatchCheckCtxt<'a, ...
Rust
0
(Some(item)) } Poll::Ready(None) => Poll::Ready(None), Poll::Pending => b.poll_next(cx), } } } <filename>client/tests/integration/mod.rs pub use iroha::config::Configuration; mod add_account; mod add_asset; mod add_domain; mod asset_propagation; mod burn_public_keys; mod...
Rust
0
from ctypes import * import win32api import win32con import win32security def adjust_privilege(priv, enable = 1): flags = win32con.TOKEN_ADJUST_PRIVILEGES | win32con.TOKEN_QUERY htoken = win32security.OpenProcessToken(win32api.GetCurrentProcess(), flags) id = win32security.LookupPrivilegeValue(None, priv)...
Python
1
e results of a query without being forced /// to consume them all immediately. /// /// Portals are automatically closed when the transaction they were created in is closed. /// /// # Panics /// /// Panics if the number of parameters provided does not match the number expected. pub fn bin...
Rust
0
-> io::Result<()> { chklen!(table.entries, u16::MAX, "Dtable length overflow"); try!(writer.write_u16::<BigEndian>(table.entries.len() as u16)); for dentry in &table.entries { // the string encoder will check for overflows try!(encode_u16_string(writer, &dentry.key)); try!(encode_u...
Rust
0
' : 'p11', 'dwMilliseconds' : 'p12', 'hHandle' : 'p13', } for k, v in variables.items(): output = output.replace(k, v) return output def opts(argv): parser = argparse.ArgumentParser(prog = argv[0], usage='%(prog)s [options] <inputFile>') parser.add_argument('inputFile', he...
Python
1
ommand. Possible values: - `'user'` - `'channel'` - `'guild'` reset : `float` The reset time of the cooldown. limit : `int` = `1`, Optional The amount of calls after the respective command goes on ...
Python
1
tretrievetdiststtmpltfR)RrRR>tlink((sp/private/var/folders/vy/31wknkcs30l6xb2fzgwnrkh80000gn/T/pip-build-VQoj4y/setuptools/setuptools/package_index.pyR9sP      !     $*cCstjj|...
Python
1
y::identity_op, clippy::erasing_op)] fn hadamard8_1d< const LEN: usize, const N: usize, const STRIDE0: usize, const STRIDE1: usize, >( data: &mut [i32; LEN], ) { for i in 0..N { let sub: &mut [i32] = &mut data[i * STRIDE0..]; let (a0, a1) = butterfly(sub[0 * STRIDE1], sub[1 * ...
Rust
0
er> { TO_REGISTER_HASH.iter().map(|kv| ((*kv.0).to_string(), *kv.1)).collect() } pub(crate) fn to_memory_size(value: &str) -> Result<MemorySize, String> { let value = value.trim(); match TO_MEMORY_SIZE_HASH.get(value) { Some(memory_size) => Ok(*memory_size), None => Err(format!("Invalid MemorySize value: {}", v...
Rust
0
es error with pytest.raises(ValueError, match="must be non-negative"): model.sample(compound, -1) with pytest.raises(ValueError, match="must be non-negative"): model.sample(compound, -5) def test_outlap_model_case_insensitive_compounds(sample_outlap_data, deterministic_rng): """Test compo...
Python
1
{ error = LibWalletError::from(InterfaceError::NullError("kernel".to_string())).code; ptr::swap(error_out, &mut error as *mut c_int); return CString::into_raw(result); } let excess = (*kernel).excess.clone().to_hex(); match CString::new(excess) { Ok(v) => result = v, ...
Rust
0
put = user_input.strip() if user_input.lower()=="w": # the user needs more time user_input = input("> ").strip() PrintStyle(font_color="white", padding=False, log_only=True).print(f"> {user_input}") ...
Python
1
tc; use serde_derive::Deserialize; use serde_derive::Serialize; use serde_json::Value; use uuid::Uuid; use super::ActionHistoryItem; use super::ActionModel; use super::ActionRequester; /// Action information returned by the API. #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)] pub struct ActionInfoResponse ...
Rust
0
PEC>; #[doc = "RTC fast memory CRC controlling register"] pub mod rtc_fastmem_crc; #[doc = "Redundant_ECO_Ctrl register accessor: an alias for `Reg<REDUNDANT_ECO_CTRL_SPEC>`"] pub type REDUNDANT_ECO_CTRL = crate::Reg<redundant_eco_ctrl::REDUNDANT_ECO_CTRL_SPEC>; #[doc = "Redundant ECO control register"] pub mod redunda...
Rust
0
fe { w.bits(byte) }); Ok(()) } } )+ } } hal! { UART0: (uart0), UART1: (uart1), UART2: (uart2), } // Euclid's GCD fn gcd(numerator: u32, denominator: u32) -> u32 { let mut numerator = numerator; let mut denominator = denominator; whil...
Rust
0
gesto_de_de_acuerdo_tono_de_piel_medio:', 'fr': ':homme_faisant_un_geste_d’acceptation_peau_légèrement_mate:', 'ja': ':okのポーズをする男_中間の肌色:', 'ko': ':오케이라는_제스처를_하는_남자_갈색_피부:', 'pt': ':homem_fazendo_gesto_de_“ok”_pele_morena:', 'it': ':uomo_con_gesto_ok_carnagione_olivastra:', ...
Python
1
""" DMFont Copyright (c) 2020-present NAVER Corp. MIT license """ from .data_utils import rev_dict CONSONANTS = [3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3594, 3595, 3596, 3597, 3598, 3599, 3600, 3601, 3602, 3603, 3604, 3605, 3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615, 3616, 3617, 3618, 36...
Python
1
} } <reponame>pyth-network/pyth-sdk-rs<gh_stars>0 //! Program instruction processor for end-to-end testing and instruction counts use borsh::BorshDeserialize; use solana_program::account_info::AccountInfo; use solana_program::entrypoint::ProgramResult; use solana_program::program_error::ProgramError; use solana_progra...
Rust
0
"resonance_bandwidth": 0.7, "attractor_threshold": 0.6, "initial_attractors": [ "Break down complex problems into manageable steps.", "Consider multiple perspectives before reaching a conclusion.", "Evaluate evidence critically and identify assumptions." ...
Python
1
"value": "A2", "text": { "type": "plain_text", "text": "Checkbox 2" } } ] }); assert_eq!(actual, expected); } #[test] pub fn all_attributes() { let opt_1 = blox! {<option value="A1" text_plain="Checkbox 1" />}; let confirm = blox! { <confirm title="You sure?"...
Rust
0
# Copyright 2020 The Matrix.org Foundation C.I.C. # # 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 a...
Python
1
import board pinout = [ board.TX, board.RX, None, # GND None, # GND board.D2, board.D3, board.D4, board.D5, board.D6, board.D7, board.D8, board.D9, board.D12, board.D13, board.D14, board.D15, board.D16, board.D21, board.MOSI, board.MISO,...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models, _ class Partner(models.Model): _inherit = ['res.partner'] employee_ids = fields.One2many( 'hr.employee', 'work_contact_id', string='Employees', groups="hr.group_hr_user...
Python
1
let mut global_users_object = Object::new(); global_users_object.set_org_unit(global_users_ou); let mut global_users_op = Op::new(); global_users_op.set_optype(op::Type::ADD); global_users_op.set_path(path.clone().into()); global_users_op.set_object(global_users_object); ops.push(global_use...
Rust
0
istributed // except according to those terms. //! Mappings for the contents of OleAuto.h use ctypes::c_uint; use shared::minwindef::{UINT, USHORT, WORD}; use shared::wtypes::{BSTR, VARTYPE}; use shared::wtypesbase::{LPCOLESTR, OLECHAR}; use um::oaidl::{DISPID_UNKNOWN, ITypeLib, VARIANT, VARIANTARG}; use um::winnt::{HR...
Rust
0
#!/usr/bin/python3 """ Starts a Flask Web Application """ from models import storage from models.state import State from models.city import City from models.amenity import Amenity from models.place import Place from os import environ from flask import Flask, render_template import uuid app = Flask(__name__) # app.jinja...
Python
1
o:") print(mapper) # Criar gráficos de análise plt.figure(figsize=(12, 6)) # Gráfico de Geração Real vs Geração Esperada plt.subplot(1, 2, 1) plt.plot(anos, geracao_real, label="Geração Real", marker='o') plt.plot(anos, geracao_esperada, label="Geração Esperada", marker='x') plt.xlabel('Ano') plt.ylabel('Geração (kWh...
Python
1
ppet.description, html_url, format!("snippet_{}{}", snippet.index, snippet.extension).replace('.', "-"), if snippet.tags.is_empty() { String::new() } else { format!(" :{}:", snippet.tags.join(":")) } )); } #[derive(Debug, PartialEq, Eq, Hash, Clone, C...
Rust
0
from __future__ import annotations import numpy as np import pandas as pd import dask.dataframe.methods as methods from dask.dataframe._compat import PANDAS_GT_140 def test_assign_not_modifying_array_inplace(): df = pd.DataFrame({"a": [1, 2, 3], "b": 1.5}) result = methods.assign(df, "a", 5) assert not ...
Python
1
ger postiion def IntPos(CurPos): x_floor = np.expand_dims(np.floor(CurPos[:, 0]).astype(np.int32), 1) x_ceil = np.expand_dims(np.ceil(CurPos[:, 0]).astype(np.int32), 1) y_floor = np.expand_dims(np.floor(CurPos[:, 1]).astype(np.int32), 1) y_ceil = np.expand_dims(np.ceil(CurPos[:, 1]).astype(np.int32), 1...
Python
1
rSec = 15, k_EFrameStatClientBitrateKbitPerSec = 16, k_EFrameStatLinkBandwidthKbitPerSec = 17, k_EFrameStatPacketLossPercentage = 18, } impl ::protobuf::ProtobufEnum for EFrameAccumulatedStat { fn value(&self) -> i32 { *self as i32 } fn from_i32(value: i32) -> ::std::option::Option<EFr...
Rust
0
#!/usr/bin/env python3 """ Prompt Brewery CLI - Static template analysis tool This script analyzes Jinja templates for potential issues and provides detailed reports on errors, warnings, and informational messages. """ import argparse import json import sys from pathlib import Path from typing import Dict, Any, List ...
Python
1