text
string
label_name
string
labels
int64
pub fn make_initial_state_constraint<'ctx>(initial_state: &HashSet<usize>, initial_state_variables: &Vec<Ast<'ctx>>, packages: &Vec<Package>) -> Option<Ast<'ctx>> { (0..packages.len()).map(|package_id| { if initial_state....
Rust
0
f8 = "./simulation8/grammar/results/Whole_h_dist_t.txt" f9 = "./simulation9/grammar/results/Whole_h_dist_t.txt" f10 = "./simulation10/grammar/results/Whole_h_dist_t.txt" ft = 'Whole_h_dist_tt.txt' with open(ft, 'w') as outfile0: with open(f1, 'r') as infile1: for line in infile1: outfile0.wri...
Python
1
""" Services for Alpaca trading analytics. """ from .api_client import SecureAlpacaClient, Environment, AlpacaAPIError from .analytics import FinancialAnalytics, PerformanceMetrics from .chart_generator import ChartGenerator __all__ = [ 'SecureAlpacaClient', 'Environment', 'AlpacaAPIError', 'Financia...
Python
1
return dict[n]; } if n == 0 { return 0; } if n < 0 { return -1; } let res: i32 = i32::MAX; for coin in coins { let subproblem = dp(n - coin); if subproblem == -1 { continue; ...
Rust
0
ets AC_ADC_DAP_CTR to value 0"] impl crate::Resettable for AC_ADC_DAP_CTR_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } } fn main() { match tere_server::services::sessions::run() { Ok(()) => {} Err(error) => { eprintln!("{}", error); std::pro...
Rust
0
_1(UNDEFINED, self.fn_logger, TYPE_STRING, to_js_string(m)); } pub fn render(&mut self, v:View){ self.current = Some(v); self.log("rendering"); self.flush_changes(); } pub fn flush_changes(&mut self){ // send changes to native side for c in self.changes.iter() {...
Rust
0
quest! { #[derive(Eq, Copy)] struct DeleteAlbum for ["audio.deleteAlbum"](v => 5.44) -> Bool [Audio] { group_id: Option<Id> = () => {Option}, album_id: Id = () => {}, } } request_ref! { #[derive(Eq, Copy)] struct MoveToAlbum for ["audio.moveToAlbum"](v => 5.44) -> Bool [Audio] { ...
Rust
0
from typing import List from fastapi.responses import JSONResponse from fastapi import APIRouter, Depends, HTTPException, status from app import dto from app.api import schems from app.api.dependencies import dao_provider from app.infrastructure.database.dao import HolderDao router = APIRouter(prefix="/discounts", ta...
Python
1
X_SOUP_ID`") .parse::<u64>() .unwrap(); // spawn bot client tokio::spawn(async move { let mut client = bot_client(token, application_id).await.expect("client"); if let Err(why) = client.start().await { println!("{why}"); } }); // lock receiver if...
Rust
0
hidden)] #[inline] pub fn _panic(msg: Janet) -> ! { unsafe { evil_janet::janet_panicv(msg.inner) } #[allow(clippy::empty_loop)] loop {} } <reponame>gregtatum/garden-rs<filename>src/bin/cat.rs<gh_stars>1-10 //! This file contains an experimental game client. It needs to be hooked up to //! everything still. ...
Rust
0
USY); memlcd_csr.rmwf(utra::memlcd::BUSY_BUSY, bar); let mut baz = memlcd_csr.zf(utra::memlcd::BUSY_BUSY, bar); baz |= memlcd_csr.ms(utra::memlcd::BUSY_BUSY, 1); memlcd_csr.wfo(utra::memlcd::BUSY_BUSY, baz); let foo = memlcd_csr.r(utra::memlcd::PRESCALER); memlcd_csr.wo(...
Rust
0
(@subcommand term => (about: "Gracefully terminate the Habitat Supervisor and all of it's running services") (@arg NAME: --("override-name") +takes_value "The name of the Supervisor if more than one is running [default: default]") ) ) } fn sub_bash(m: &ArgMat...
Rust
0
lt_env()) .pretty() .finish(); tracing::subscriber::set_global_default(logger)?; let cmd = Cmd::from_args(); let start = Instant::now(); match cmd { Cmd::Plugin(cmd) => { cmd.run()?; } } info!("Done in {:?}", start.elapsed()); Ok(()) } <reponam...
Rust
0
docs.is_empty(), "Expected ZERO document"); } } <reponame>outmove/omv // Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 //! Binary format for transactions and modules. //! //! This module provides a simple Rust abstraction over the binary format. That is the format of //! modules s...
Rust
0
mn(scale=1, ): prompt = gr.Textbox(label = '提示词(prompt)') image_in = gr.Image(label = '输入图像(image)') tag = gr.State('img2img') with gr.Column(scale=0.5 ): height = gr.Slider(256, 768, ...
Python
1
from __future__ import annotations import os import re import shutil from pathlib import Path from typing import Optional def remove_shinylive_local( shinylive_dir: Optional[Path] = None, version: Optional[str] = None, ) -> None: """Removes local copy of shinylive. Parameters ---------- shin...
Python
1
.. a pyspark dataframe constsiting of two columns: id of each cell and polygon object representing each cell ''' # retrieve the SparkSession instance spark = SedonaRegistration._get_sedona_context() min_x, min_y, max_x, max_y = boundary[0][0], boundary[0][1], boundary[1][0], boundary[1][1] interval_x = (m...
Python
1
_new_adapter": { "en": { "label": "Create new adapter", "info": "Whether to create a new adapter with randomly initialized weight or not." }, "zh": { "label": "新建适配器", "info": "是否创建一个经过随机初始化的新适配器。" } }, "rlhf_tab": { "en": {...
Python
1
# assigning a list to a new variable name doesn't create a copy. Both variables point to the exact same list object in memory. # Changes made through one variable are visible through the other. import copy original_list = [1, 2, [10, 20]] assigned_list = original_list assigned_list[2].append(30) print("Original Li...
Python
1
truncated_outputs.shape, (2, 1, 95280)) # force pad to max length truncated_outputs = feature_extractor( input_audio, padding="max_length", max_length=100000, return_tensors="pt" ).input_values self.assertEquals(truncated_outputs.shape, (2, 1, 100000)) # force no pa...
Python
1
Type").string(var_121.as_str()); } if let Some(var_122) = &input.next_token { object.key("NextToken").string(var_122.as_str()); } if let Some(var_123) = &input.max_results { object.key("MaxResults").number( #[allow(clippy::useless_conversion)] aws_smithy_types::Nu...
Rust
0
} }, _ => { println!("Cannot get the information of the file!"); } }; } } if let Some(matches) = matcher.subcommand_matches("save") { if matches.is_present("file") { let file_name = m...
Rust
0
T_SERVER Self::ACTIVATE_X86_SERVER.0 /// Activate or connect to a 64 bit version of the server; fail if one is not /// registered. ACTIVATE_64_BIT_SERVER 0x8_0000 /// Specify this flag for Interactive User activation behavior for /// As-Activator servers. ACTIVATE_AAA_AS_IU 0x80_0000 /// (No official docs...
Rust
0
lize, serde::Deserialize)] #[serde(deny_unknown_fields)] #[serde(rename_all = "kebab-case")] pub enum SassOutputStyle { Nested, Expanded, Compact, Compressed, } impl Default for SassOutputStyle { fn default() -> Self { SassOutputStyle::Nested } } //! FRP utilities for defining applicati...
Rust
0
ctive_date.uid}/{study_selection_breadcrumb}/{study_selection_uid_study_standard_test}", ) res = response.json() assert_response_status_code(response, 200) assert ( res[study_selection_ctterm_keys]["queried_effective_date"][:10] == ct_package_effective_date ) assert res[study_se...
Python
1
#! /usr/bin/env python3 # # synctool-launch WJ113 # # synctool Copyright 2024 Walter de Jong <walter@heiho.net> # # synctool COMES WITH NO WARRANTY. synctool IS FREE SOFTWARE. # synctool is distributed under terms described in the GNU General Public # License. # '''launch sets the correct PYTHONPATH and l...
Python
1
# coding=utf-8 # author=uliontse """ Copyright 2020 UlionTse 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 agr...
Python
1
> { let value = cursor.get_u8(); match value { 0 => Ok(ResultStatus::Invalid), 1 => Ok(ResultStatus::Inactive), 2 => Ok(ResultStatus::Active), 3 => Ok(ResultStatus::Finished), 4 => Ok(ResultStatus::Disqualified), 5 => Ok(ResultStatus::NotClassified), 6 =>...
Rust
0
import os import shutil from openhands.core.logger import openhands_logger as logger from openhands.storage.files import FileStore class LocalFileStore(FileStore): root: str def __init__(self, root: str): self.root = root os.makedirs(self.root, exist_ok=True) def get_full_path(self, pat...
Python
1
let now_ascent = glyph.bearing.y; if now_ascent > ascent { ascent = now_ascent } let now_descent = -(glyph.bounding.y - now_ascent); if now_descent < descent { descent = now_descent } } let glyph_height = ascent - descent; let padding = style.padding; let auto_width = s...
Rust
0
#!/usr/bin/env python3 # DESCRIPTION: Verilator: Verilog Test driver/expect definition # # Copyright 2024 by Wilson Snyder. This program is free software; you # can redistribute it and/or modify it under the terms of either the GNU # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. # ...
Python
1
"gtk-orientation-reverse-landscape", ), ( "GTK_STOCK_ORIENTATION_REVERSE_PORTRAIT", "gtk-orientation-reverse-portrait", ), ("GTK_STOCK_PAGE_SETUP", "gtk-page-setup"), ("GTK_STOCK_PASTE", "gtk-paste"), ("GTK_STOCK_PREFERENCES", "gtk-preferences"), ("GTK_STOCK_PRINT", "gtk-p...
Rust
0
for (i, mut row) in outputs.axis_iter_mut(Axis(1)).enumerate() { let sub_x = x.index_axis(Axis(1), i); h = self.grucell(&sub_x, &h, &self.enc_w_ih, &self.enc_w_hh, &self.enc_b_ih, &self.enc_b_hh); row.assign(&h); } outputs // (1, N, 256) } /// x: (1, 256) /// h: (1, 256) pub (crate) ...
Rust
0
= signer.action_sign(data) self.assertEqual(signer.request_id.state, "signed") self.assertEqual(res["type"], "ir.actions.act_url") self.assertEqual(res["url"], signer.access_url) def test_auto_sign_template_cancel(self): self.configure_template() self.assertEqual(0, self.te...
Python
1
ture = "sqlite" ))] Metadata { offline: false, database_url: Some(db_url), .. } => expand_from_db(input, &db_url), #[cfg(feature = "offline")] _ => { let data_file_path = METADATA.manifest_dir.join("sqlx-data.json"); i...
Rust
0
mcu::irq::IrqMain, Irq47); ::bobbin_mcu::irq!(::dma::Dma1Stream7, IrqDma, Irq47); ::bobbin_mcu::irq!(::dma::Dma2Stream0, ::bobbin_mcu::irq::IrqMain, Irq56); ::bobbin_mcu::irq!(::dma::Dma2Stream0, IrqDma, Irq56); ::bobbin_mcu::irq!(::dma::Dma2Stream1, ::bobbin_mcu::irq::IrqMain, Irq57); ::bobbin_mcu::irq!(::dma::Dma2Str...
Rust
0
"""Transliteration of https://open.gl/feedback into Python""" from __future__ import print_function import pygamegltest from OpenGL._bytes import as_8_bit from OpenGL.GL import * from OpenGL.GL import shaders vertex_shader = """#version 150 core in float inValue; out float geoValue; uniform float junk; // J...
Python
1
pressed(button); } false } /// Gets joystick value assuming first gamepad, defaulting to (0.0, 0.0). #[inline] #[cfg(feature = "gamepads")] pub fn joystick(&mut self, joystick: Joystick) -> (f32, f32) { if let Some(gamepad) = self.gamepads.get(0) { return gamepa...
Rust
0
import sympy from varsassign import varsassign from sympyassign2 import sympyassign2 def hdggencodebou(filename, f, xdg, udg, odg, wdg, uhg, nlg, tau, uinf, param, time): cpufile = "Hdg" + filename tmp = "(dstype* f, dstype* f_udg, dstype* f_wdg, dstype* f_uhg, const dstype* xdg, const dstype* udg, const dsty...
Python
1
de::{Deserialize, Serialize}; mod commitment; mod compressed_commitment; mod error; pub use commitment::Commitment; pub use compressed_commitment::CompressedCommitment; pub use error::AmountError; /// An amount of some token, in the "base" (u64) denomination. #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub struct A...
Rust
0
2\xcfe\xb5\x9a\x8c10:\ *\x89\xa3\x08\xc1c0i\xbf\x17\xe2\xba\xd1Ga\xbf\ \x0bY\xeeg_\xddj\xc7\x87\x85\x18\xd5\xe3\xb6V\xd9\ \xb6\x85\xfc\x12\xb9\xd6\xb4nk\xe5\x84\x0e\xcb\xb2\xd0\x18\ x?\xf3\x10\xfbP\x96\xe1\x99\x14\x176\x06\x97m\x05\ c\xf9\xf4)\xf1\x94\x1ant\xde=hC\xe3\x10\x07\ a[\x1d\xf1\xe1C\xf6\xe3\xc4U\xad\xd5F\x95#...
Python
1
<'a> { let radix = suffix_type.radix(); let number = if suffix_length == 0 { Number::DynamicWidth(DynamicWidthNumber::new(radix)) } else { Number::FixedWidth(FixedWidthNumber::new(radix, suffix_length)) }; FilenameIterator { prefix, ...
Rust
0
s, '{}'.format(args.color_space[0]):{ # lab-L/hed-H 'avg':{ 'mean': round(l_avg_mean,3) , 'std': round(l_avg_std,3) , 'distribution': distribution[0] }, 'std': { 'mean': round(l_std_mean,3), '...
Python
1
float), rng.rand(30*30, 2)] for j, func in enumerate(funcs): self._check_accuracy(func, x=grid, tol=1e-9, atol=5e-3, rtol=1e-2, err_msg="Function %d" % j) self._check_accuracy(func, x=grid, tol=1e-9, atol=5e-3, rtol=1e-2, ...
Python
1
mation try: import psutil memory_gb = psutil.virtual_memory().total / (1024**3) info["memory_gb"] = round(memory_gb, 1) # Memory-based worker recommendations if memory_gb < 8: info["memory_based_workers"] = 1 elif memory_gb < 16: info["memory...
Python
1
as i32), 4), (Some(RegisterMIPS::RA as i32), 4), (None, 4), // status (Some(RegisterMIPS::LO as i32), 4), (Some(RegisterMIPS::HI as i32), 4), (None, 4), // badvaddr (None, 4), // cause (Some(RegisterMIPS::PC as i32), 4), (Some(RegisterMIPS::F0 as i32), 4)...
Rust
0
== &1 { target as usize } else { codes[target as usize] as usize }; } else { *index += 3; } } 7 => { // Less than let left ...
Rust
0
from django.db import models class Thing(models.Model): num = models.IntegerField()
Python
1
ernReference(hatch_pattern): """Verifies that a hatch pattern is from a reference file Parameters: hatch_pattern (str): name of an existing hatch pattern Returns: bool: True or False None: on error Example: import rhinoscriptsyntax as rs hatch = rs.GetString("Hatch pattern ...
Python
1
---------------------------------[[1_967_872]] nn.conv1d # proj_gnn ------------------------------------[[65_792]] nn.conv1d # proj_score -------------------------------------[[257]] ================================================================== DECODER ---------------------------------...
Python
1
from typing import List, Optional, Set from one_dragon.base.conditional_operation.atomic_op import AtomicOp from one_dragon.base.conditional_operation.operation_task import OperationTask from one_dragon.base.conditional_operation.state_cal_tree import ( StateCalNode, StateCalNodeType, StateCalOpType ) from one_dra...
Python
1
.unchecked_into(), //5CPd3zoV9Aaah4xWucuDivMHJ2nEEmpdi864nPTiyRZp4t87 hex!["0e6d7d1afbcc6547b92995a394ba0daed07a2420be08220a5a1336c6731f0bfa"] .unchecked_into(), //5F7BEa1LGFksUihyatf3dCDYneB8pWzVyavnByCsm5nBgezi hex!["86975a37211f8704e947a365b720f7a3e2757988eaa7d0f197e83dba355ef743"] .unchecked_...
Rust
0
n) * model_dt chr_kp = num / den # CHR Ki ti = 1.2 * model_tc chr_ki = chr_kp / ti # CHR Kd chr_kd = 0 # IMC Kp lmda = 2.1 * model_dt num = model_tc + 0.5 * model_dt den = abs(model_gain) * (lmda) imc_kp = num / den # IMC Ki ti = model_tc + 0.5 * model_dt imc_ki ...
Python
1
import numpy as np class SimpleOG: def __init__(self, B=10, M=5, α=0.5, β=0.9): """ Set up R, Q and β, the three elements that define an instance of the DiscreteDP class. """ self.B, self.M, self.α, self.β = B, M, α, β self.n = B + M + 1 self.m = M + 1 ...
Python
1
; crypto_decrypt.apply_keystream(&mut buffer); assert_eq!(buffer, openssl_plaintext); let mut hmac_sha256 = HmacSha256::new_from_slice(symmetric_key.as_slice()).expect("hmac use symmetric key"); hmac_sha256.update(&layer_data); let crypto_hmac = hmac_sha256.finaliz...
Rust
0
-3) npt.assert_allclose(true_vars, sample_vars, atol=1e-3, rtol=1e-3) else: npt.assert_allclose(true_means, sample_means, atol=1e-2, rtol=1e-2) npt.assert_allclose(true_vars, sample_vars, atol=1e-2, rtol=1e-2) @pytest.mark.parametrize( "model_type", ("linear", "nonlinear"), ) def t...
Python
1
00004826, GuestSysenterCS = 0x0000482a, VMXPreemptionTimerValue = 0x0000482e, HostIA32SysenterCS = 0x00004c00, CR0GuestHostMask = 0x00006000, CR4GuestHostMask = 0x00006002, CR0ReadShadow = 0x00006004, CR4ReadShadow = 0x00006006, CR3TargetValue0 = 0x00006008, CR3TargetValue1 = 0x00006...
Rust
0
(RangeInfo { start: Closed(1), end: Open(2) },(1..2).to_rangeinfo() ); assert_eq!(RangeInfo { start: Inf, end: Open(2) },( ..2).to_rangeinfo() ); assert_eq!(RangeInfo { start: Closed(1), end: Inf },(1.. ).to_rangeinfo() ); assert_eq!(RangeInfo::<i64> { start: Inf, end: Inf },( .. ).to_rangeinfo() ); ass...
Rust
0
from rope.base import ast def get_name_levels(node): """Return a list of ``(name, level)`` tuples for assigned names The `level` is `None` for simple assignments and is a list of numbers for tuple assignments for example in:: a, (b, c) = x The levels for for `a` is ``[0]``, for `b` is ``[1, 0...
Python
1
Unknown'), 'features_count': 14, 'target_classes': ['No Diabetes', 'Diabetes'], 'preprocessing': { 'education_grouping': 'Values < 3 grouped to 3', 'feature_scaling': { 'BMI': 'StandardScaler', 'GenHlth': 'Standa...
Python
1
# -*- coding: utf-8 -*- from app.const import * from app.base.logger import log from app.base.db import get_db, SQL from app.model import syslog from app.model import policy from app.base.utils import AttrDict, tp_timestamp_sec def get_by_id(pid): s = SQL(get_db()) s.select_from('audit_policy', ['id', 'name'...
Python
1
features=[ ColumnDefinition( name='feature1', type=SupportedTypes.string, field_type=FieldType.categorical, drift=[DriftMethod(name=DriftAlgorithmType.CHI2)], ) ], ) assert f'{...
Python
1
/// /// ``` /// # use spinoso_env::System; /// const ENV: System = System::new(); /// assert!(matches!(ENV.get(b"PATH"), Ok(Some(_)))); /// ``` /// /// Setting an environment variable: /// /// ``` /// # use spinoso_env::System; /// const ENV: System = System::new(); /// # fn example() -> Result<(), spinoso_env::Error> ...
Rust
0
validate, ): assert CheckPointHarmonyEndpoint.get_pagination_args(args) == expected mock_validate.assert_called() def test_validate_filter_arguments(): """Test validate_filter_arguments function and ensure that ValueError is raised.""" with pytest.raises(ValueError) as exc_info: Ch...
Python
1
, "ins_list": symbol, "duration": int(self._dur_nano), "view_width": 2000, "focus_datetime": int(start_dt), "focus_position": 0, } # 还没有发送过任何请求, 先请求定位左端点 self._api._send_chan.send_nowait(chart_info) chart = _get_obj(self._api._d...
Python
1
)?; /// /// println!("The first line was {} bytes long", after - before); /// Ok(()) /// } /// ``` #[unstable(feature = "seek_convenience", issue = "59359")] fn stream_position(&mut self) -> Result<u64> { self.seek(SeekFrom::Current(0)) } } /// Enumeration of possible me...
Rust
0
} #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum Obstruent { P, T, K, F, S, H, } impl Obstruent { pub fn orthography(self) -> &'static str { use Obstruent::*; match self { P => "p", T => "t", K => "k", ...
Rust
0
] * lor_f2[2]) - (u_tmp[0] * lor_f2[0] + u_tmp[1] * lor_f2[1] + u_tmp[2] * lor_f2[2]).powi(2); chi = (1.0 / q_coef) * f64::sqrt(frr2); let mut r = range.ind_sample(&mut rng); let w = W_new(g_tmp, r, chi, omega); /*if chi < 0.13333 { r = r * chi / 0.13333; ...
Rust
0
is stored in the order of: `[batch_size, input_channels, input_height, input_width]`. Default: "NCHW". name(str|None, optional): For detailed information, please refer to :ref:`api_guide_Name`. Usually name is no need to set and ...
Python
1
`"] #[inline(always)] pub fn is_batmon_combined(&self) -> bool { *self == AON_PROG0_EV_A::BATMON_COMBINED } #[doc = "Checks if the value of the field is `BATMON_TEMP_LL`"] #[inline(always)] pub fn is_batmon_temp_ll(&self) -> bool { *self == AON_PROG0_EV_A::BATMON_TEMP_LL } ...
Rust
0
0 .. num_objects { query_result1.push(true); query_result2.push(true); } let frustum_query: FrustumQuery = FrustumQuery::new(objects); frustum_query.execute(&frustum, &mut query_result1); assert!(query_result1 == query_result2); } /// This compair...
Rust
0
::sessions::dsl::id as session_id; use schema::sessions::dsl::sessions; use schema::users::dsl::id; use schema::users::dsl::users; let split = token.split("::").collect::<Vec<&str>>(); if split.len() != 2 { return None; } let user_id = split[0]; let token = split[1]; let i_...
Rust
0
!tags.contains(MapsetTags::Old), !tags.contains(MapsetTags::Meme), !tags.contains(MapsetTags::HardName), !tags.contains(MapsetTags::Easy), !tags.contains(MapsetTags::Hard), !tags.contains(MapsetTags::Tech), !tags.contains(MapsetTags::Weeb),...
Rust
0
"""Parity""" def main(num, evod): """two bit""" nub = 0 for i in num: if i == "1": nub+=1 if evod == "Even": if not nub % 2: print(num + "0") else: print(num + "1") elif evod == "Odd": if not nub % 2: print(num + "1") ...
Python
1
; #[doc = "Trigger one or more channels simultaneously\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs...
Rust
0
求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self._TotalCount = None self._DashboardInfos = None self._RequestId = None @property def TotalCount(self): return self._TotalCount @TotalCount.setter def TotalCount(self, TotalCount): ...
Python
1
one. since 0 should return the first event in the db }; Some(number.to_be_bytes().to_vec()) } pub fn generate_keypair() -> Vec<u8> { let mut value = random_string(8).as_bytes().to_vec(); value.push(0xff); value.extend_from_slice( &ruma::signatures::Ed25519KeyPair::generate() ....
Rust
0
from disco.core import result_iterator from discomll import dataset from discomll.classification import naivebayes from discomll.utils import model_view from discomll.utils import accuracy # define training dataset train = dataset.Data(data_tag=["test:breast_cancer_disc"], data_type="chunk", ...
Python
1
random data let data = Array2::random_using((300, 50), Uniform::new(-1.0f64, 1.), &mut rng); let dataset = Dataset::from(data); let model = Pca::params(10).whiten(true).fit(&dataset).unwrap(); let proj = model.predict(&dataset); // check that the covariance is unit diagonal ...
Rust
0
// We force the decoded value into a serde_json::Value because we don't care if Kubernetes returns a // malformed body. We just want the response code validated by APIClient. let res: Result<serde_json::Value, failure::Error> = self.client.request(req); if res.is_err() { return Err(r...
Rust
0
pkg_config_type.check_package = staticmethod( mod_config_type.check_module) pkg_config_type.modules = [mod_config_type()] pkg_config = pkg_config_type() try: _main(sys.argv, pkg_config) except SystemExit: raise except: if pkg_config.support_email_addr...
Python
1
"""Tests for testing.python.absl_uint128.""" from absl.testing import absltest from clif.testing.python import absl_uint128 MAX128 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MAX64 = 0xFFFFFFFFFFFFFFFF HIGH_LSB = 1 << 64 class AbslUint128Test(absltest.TestCase): def testZero(self): self.assertEqual(absl_uint128.Ze...
Python
1
from .hcs_file_chunk_message import HcsFileChunkMessage from .hcs_file_service import HcsFileService from .utils import build_file_from_chunk_messages, get_file_chunk_messages __all__ = ["HcsFileService", "HcsFileChunkMessage", "get_file_chunk_messages", "build_file_from_chunk_messages"]
Python
1
)) } else { Box::new(MatMatMulImpl::<arm64simd::MatMatMulF32x8x8, f32, f32>::new(m, k, n)) } }) } ops.qmmm_i8_i8 = Box::new(|m, k, n| { Box::new(MatMatMulImpl::<arm64simd::MatMatMulI8x8x8, i8, i32>::new(m, k, n)) }); ops.qmmm_i8_i32 = Box::new(|m, ...
Rust
0
ing a saved recipe saved_recipe = st.session_state.current_recipe recipe_text = saved_recipe["recipe"] parsed = generator.parse_recipe_from_json(recipe_text) ings_used = saved_recipe["ingredients_used"] recipe_to_display = { "text": recipe_text, "parsed": parsed, "ingredients...
Python
1
applies learnable scale/shift parameters. ''' assert len(inputs.shape.as_list()) == 4, "Applies only to conv2D layers" if data_format == 'channels_first': inputs = tf.transpose(inputs, [0,2,3,1]) elif data_format == 'channels_last': pass else: raise ValueError("data_format m...
Python
1
let (left, left_lca) = postorder(&node.borrow().left); let (right, right_lca) = postorder(&node.borrow().right); match left.cmp(&right) { Equal => (left + 1, root.clone()), Greater => (left + 1, left_lca), Less => (right + 1, right_lca), } } else {...
Rust
0
# coding=utf-8 from sqlalchemy.dialects.mysql import LONGTEXT from mycodo.databases import CRUDMixin from mycodo.databases import set_uuid from mycodo.mycodo_flask.extensions import db from mycodo.mycodo_flask.extensions import ma class CustomController(CRUDMixin, db.Model): __tablename__ = "custom_controller" ...
Python
1
; fn _is_send<T: Send>(_: T) {} fn _is_sync<T: Sync>(_: T) {} #[tokio::test] async fn is_send() { let api = Api::new(true, "", "", Url::parse("").unwrap()).await; _is_send(api); } #[tokio::test] async fn is_sync() { let api = Api::new(true, "", "", Url::parse("").unwrap()).await; _is_sync(api); } #[t...
Rust
0
#!/usr/bin/env python3 # # Copyright 2018 Red Hat, Inc. # # Authors: # Paolo Bonzini <pbonzini@redhat.com> # # This work is licensed under the MIT License. Please see the LICENSE file or # http://opensource.org/licenses/MIT. from .patchewtest import PatchewTestCase, main class DiffTest(PatchewTestCase): def...
Python
1
self) -> Self { *self } } #[repr(C)] #[doc = "*Required features: 'Win32_Networking_WinInet', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] pub struct INTERNET_PER_CONN_OPTION_LISTW { pub dwSize: u32, pub pszConnection: super::super::Foundation::PWSTR, pub dwOptionCount: u32, pu...
Rust
0
4ff84ebdc0de59809a97cda2f64c84fda19b")?; let nonce = PasetoNonce::<V2, Local>::from(&nonce); let payload = json!({"data": "this is a signed message", "exp":"2019-01-01T00:00:00+00:00"}).to_string(); let payload = payload.as_str(); let payload = Payload::from(payload); let footer = json!({"kid":"zV...
Rust
0
map_comparison(self, expr: p.Comparison) -> ast.expr: raise NotImplementedError @override def map_wildcard(self, expr) -> ast.expr: raise NotImplementedError @override def map_dot_wildcard(self, expr) -> ast.expr: raise NotImplementedError @override def map_star_wildca...
Python
1
ct _ExifLog { _unused: [u8; 0], } pub type ExifLog = _ExifLog; extern "C" { pub fn exif_log_new() -> *mut ExifLog; } extern "C" { pub fn exif_log_new_mem(arg1: *mut ExifMem) -> *mut ExifLog; } extern "C" { pub fn exif_log_ref(log: *mut ExifLog); } extern "C" { pub fn exif_log_unref(log: *mut ExifLog...
Rust
0
ata key.</p> /// </li> /// <li> /// <p>Use the plaintext data key to decrypt data outside of AWS KMS, then erase the plaintext /// data key from memory.</p> /// </li> /// </ol> /// <p> /// <b>Cross-account use</b>: Yes. To perform this operation with a CMK in a different AWS account, specify /// the key ARN or alias AR...
Rust
0
matches.value_of("target") { Some(value) => Some(value.to_string()), None => None, }; let system = RealSystem::new(); match build::get_nodes( &system, rulefiles, target) { Ok(nodes) => { ...
Rust
0
(0) well_data.bvo = False well_data.old_version = False well_data.image_list = [] well_data.problemWithEk = False well_data.problemWithEk_depth = well_data.current_bottom well_data.problemWithEk_diametr = 220 # path = f"{well_data.path_...
Python
1
"::", stringify!(initCheck) ) ); } extern "C" { pub fn iox_sub_options_init(options: *mut iox_sub_options_t); } extern "C" { pub fn iox_sub_options_is_initialized(options: *const iox_sub_options_t) -> bool; } extern "C" { pub fn iox_sub_init( self_: *mut iox_sub_...
Rust
0
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
Python
1
from sklearn.ensemble import RandomForestClassifier from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import KFold from sklearn.model_selection import cross_val_score import pandas as pd import numpy as np seed = 20 def rfClf(feature_csv, seed=seed): ''' Takes path to csv containing the tr...
Python
1