text
string
label_name
string
labels
int64
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
Python
1
ature from Hyperbolic space to Euclidean space with curvature of c, taking the origin as a reference point. Args: ``p`` (``np.ndarray``): The feature matrix. Size :math:`(N, C)`. ``c`` (``int``): Curvature ofHyperbolic space. """ sqrt_c = c ** 0.5 p_norm = np.clip(LA.norm(p, axis=-1, kee...
Python
1
for i in start..end { let v = f(i); if v < best { best = v; result = i; } } (result, best) } else { // Try to find minimum faster by recursively checking multiple points. // Good value: 9. const NUM...
Rust
0
const u8, msgsz: uint_t, tmout: TMO) -> ER; pub fn rcv_mbf(mbfid: ID, msg: *mut u8) -> super::ER_UINT; pub fn prcv_mbf(mbfid: ID, msg: *mut u8) -> super::ER_UINT; pub fn trcv_mbf(mbfid: ID, msg: *mut u8, tmout: TMO) -> super::ER_UINT; pub fn ini_mbf(mbfid: ID) -> ER; pub fn ref_mbf(mbfid: ID, p...
Rust
0
} /// See [`recursive()`]. pub struct Recursive<'a, I, O, E: Error<I>>(Rc<OnceCell<Box<ParserFn<'a, I, O, E>>>>); impl<'a, I, O, E: Error<I>> Clone for Recursive<'a, I, O, E> { fn clone(&self) -> Self { Self(self.0.clone()) } } impl<'a, I, O, E: Error<I>> Parser<I, O> for Recursive<'a, I, O, E> { ...
Rust
0
use super::serial_radix2_fft; use crate::{domain::utils::parallel_fft, Vec}; use algebra::bls12_381::Bls12_381; use algebra_core::{test_rng, PairingEngine, UniformRand}; use core::cmp::min; fn test_consistency<E: PairingEngine, R: Rng>(rng: &mut R, max_coeffs: u32) { ...
Rust
0
Rs((sRemoteDebugger.pytclose_remote_debuggerjs cCs|jddtfidS(NRqtstop_the_debugger(RRM(Rs((sRemoteDebugger.pyRxvscCs|jddtfi}dS(NRqRr(RR(...
Python
1
#[inline(always)] pub fn flash_ace1_attr(&mut self) -> FLASH_ACE1_ATTR_W { FLASH_ACE1_ATTR_W { w: self } } #[doc = "Writes raw bits to the register."] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.0.bits(bits); self } } #[doc = "APB_CT...
Rust
0
Hasher; use pairing::Engine; use storage_proofs_core::{ compound_proof::CircuitComponent, error::Result, gadgets::{constraint, encode, por::PoRCircuit, uint64::UInt64, variables::Root}, merkle::BinaryMerkleTree, util::reverse_bit_numbering, }; /// DRG based Proof of Replication. /// /// # Fields //...
Rust
0
patch_size=14, vision_use_head=False, ).to_dict() else: vision_config = None config = LlavaConfig( text_config=text_config, vision_config=vision_config, ) # llms-lab interleeave models do not use any selection startegy except for last hidden stat...
Python
1
import os from Codexes2Gemini.classes.Codexes.Metadata.Metadatas import Metadatas from Codexes2Gemini.classes.Codexes.Distributors.LSI.create_LSI_ACS_spreadsheet import create_LSI_ACS_spreadsheet def create_test_metadata(): """Creates a complete and valid Metadatas object for testing.""" metadata = Metadatas(...
Python
1
::macros::phantomdata::ClosureTypes { param: $expr, closure: $closure, returns: $crate::std_::marker::PhantomData, }.returns ) } #[doc(hidden)] #[repr(transparent)] pub struct ClosureTypes<P, C: FnOnce(P) -> R, R> { pub param: PhantomData<P>, pub ret...
Rust
0
_to_boolean(); self.context.avm2.push(!value); Ok(FrameControl::Continue) } fn op_has_next(&mut self) -> Result<FrameControl<'gc>, Error> { let cur_index = self.context.avm2.pop().coerce_to_u32(self)?; let object = self.context.avm2.pop().coerce_to_object(self)?; let ...
Rust
0
nd an event only if this was not a scroll event if event.detail not in self._SCROLL_BUTTONS: self.on_click(px, py, self._button(event.detail), False) else: self.on_move(px, py) def _suppress_start(self, display): display.screen().root.grab_pointer( ...
Python
1
tree: TlsVecU32<Option<Node>>, } impl RatchetTreeExtension { /// Build a new extension from a vector of [`Node`]s. pub fn new(tree: Vec<Option<Node>>) -> Self { RatchetTreeExtension { tree: tree.into() } } /// Get a slice of the nodes in tis tree. pub(crate) fn as_slice(&self) -> &[Optio...
Rust
0
let res = p.declaration_node().unwrap(); assert_debug_snapshot!(res); } } use core::convert::identity; use std::env; use std::ffi::OsStr; use std::path::Path; use std::time::{SystemTime, UNIX_EPOCH}; const CARGO_NAME: &'static str = env!("CARGO_PKG_NAME"); const CARGO_VERSION: &'static str = env!(...
Rust
0
::FieldReader<bool, bool>); impl ADPLL_SDM_DITHER_EN_2454_R { pub(crate) fn new(bits: bool) -> Self { ADPLL_SDM_DITHER_EN_2454_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for ADPLL_SDM_DITHER_EN_2454_R { type Target = crate::FieldReader<bool, bool>; #[inline(always)] fn deref(...
Rust
0
t; #[cfg(feature="gte_clang_8_0")] pub fn clang_Type_getObjCTypeArg(type_: CXType, index: c_uint) -> CXType; #[cfg(feature="gte_clang_3_9")] pub fn clang_Type_getObjCEncoding(type_: CXType) -> CXString; pub fn clang_Type_getOffsetOf(type_: CXType, field: *const c_char) -> c_longlong; #[cfg(featu...
Rust
0
for tc in range(int(input())): N = int(input()) if N <= 1399: print("Division 4") elif N <= 1599: print("Division 3") elif N <= 1899: print("Division 2") else: print("Division 1")
Python
1
); if let Some(app_state) = request.take() { if let Some(sample) = detexify::StrokeSample::new(app_state.strokes) { let start = Instant::now(); match classifier.classify(sample) { Some(results) => { ...
Rust
0
use crate::Automaton; use test::Bencher; fn get_random_auto(size: usize, states: u8) -> Automaton { let states = test::black_box(states); let rule = Rule::random(1, states); let mut a = Automaton::new(states, size, rule); a.random_init(); a } #[test] fn upda...
Rust
0
try: a = 10 b = 0 result = a / b print(result) except: print("error: denominator can't be 0")
Python
1
example()); /// ``` pub async fn backup_certificate( &mut self, name: &'a str, ) -> Result<CertificateBackupResult, Error> { let mut uri = self.vault_url.clone(); uri.set_path(&format!("certificates/{}/backup", name)); uri.set_query(Some(API_VERSION_PARAM)); ...
Rust
0
#https://github.com/HamzaG737/data-engineering-project/blob/main/airflow_resources/dags/dag_kafka_spark.py from datetime import timedelta from airflow import DAG from airflow.operators.python import PythonOperator from airflow.providers.docker.operators.docker import DockerOperator from datetime import datetime from ...
Python
1
import torch import node_helpers NODE_NAME = 'SD3NegativeConditioning' class SD3NegativeConditioning: @classmethod def INPUT_TYPES(self): return {"required": {"conditioning": ("CONDITIONING", ), "zero_out_start": ("FLOAT", {"default": 0.1, "min": 0.0, "max": 1.0, "step": ...
Python
1
ion: // * Torus inner radius = 1 // * Torus outer radius = 2 // * Torus Z position = 10 // * Y-up, X-right, Z-forward fn main() { let pixels = b".,-~:;=!*#$@"; // gets darker as surface normal vector gets longer // Calculate K1 based on screen size: the maximum x-distance occurs // roughly at the edge of t...
Rust
0
int::Waypoint, transaction::helpers::*, chain_id::ChainId }; use libra_types::transaction::{ Script, TransactionPayload, authenticator::AuthenticationKey }; use reqwest::Url; use std::{fs, io::{stdout, Write}, path::{Path, PathBuf}, thread, time}; /// All the parameters needed for a client transaction. #[deri...
Rust
0
:new_mmio_range(a, 0)) .nth_back(0), } } // Return the Device mapped `addr` and the base address. fn get_device(&self, addr: IoAddress) -> Option<(&Arc<dyn DeviceIo>, IoAddress)> { if let Some((range, dev)) = self.get_entry(addr) { if (addr.raw_value() - range.ba...
Rust
0
from datetime import date SEMESTER_PATTERNS = { 'Spring': {'start_month': 1, 'start_day': 10, 'end_month': 5, 'end_day': 10}, 'Summer': {'start_month': 5, 'start_day': 11, 'end_month': 8, 'end_day': 15}, 'Fall': {'start_month': 8, 'start_day': 16, 'end_month': 12, 'end_day': 15}, 'Winter': {'start_mont...
Python
1
, "AdafruitPureIOLibrary.tex", "AdafruitPureIO Library Documentation", author, "manual", ), ] # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). m...
Python
1
()) } /// 移除文件 pub fn file_remove(s: &Session, config: &Config) { println!("开始删除文件{}{}......", &config.path.remote_path, &config.path.file_name); let mut c = s.channel_session().unwrap(); c.exec(&format!("rm -rf {}{}", &config.path.remote_path, &config.path.file_name)) .unwrap(); c.close()...
Rust
0
X_original, Y_original) assert (Y.shape == (1, example_num)) assert (X.shape == (2, example_num)) parameters = initialize_parameters() for i in range(epoch_num): mini_batches = random_mini_batches(X, Y) for j in range(mini_batches.shape[0]): x_mini_batch, y_mini_batch = mi...
Python
1
0.0), City::new(1833, "Cambodia", "Batdambang", 13.1000000, 103.1999969, 40.0), City::new(1834, "Cambodia", "Siemreab", 13.3666667, 103.8499985, 15.0), City::new(1835, "Cambodia", "Kampong Chhnang", 12.2500000, 104.6666641, 17.0), City::new(1836, "Cambodia", "Kampong Cham", 12.0000000, 105.4499969, 21.0), City::ne...
Rust
0
)); } // Comparing a measure with its half, if it is large, // with its double if it is small. // Omit test if it is near zero or larger than a turn. if (abs(val1) >= MIN_THRESHOLD && abs(val1) <= 360) { if (abs(val1) > 2) m3 = UnsignedDirection<degrees,TypeParam>(val1 / static_cast...
Rust
0
" Creates an entitlement for a customer."] #[doc = ""] #[doc = " Possible error codes:"] #[doc = ""] #[doc = " * PERMISSION_DENIED: The customer doesn't belong to the reseller."] #[doc = " * INVALID_ARGUMENT:"] #[doc = " * Required request parameters are missing or in...
Rust
0
# futval_graph3.py from graphics import GraphWin, Text, Point, Rectangle def createLabeledWindow(): window = GraphWin("Investment Growth Chart", 320, 240) window.setBackground("white") window.setCoords(-1.75, -200, 11.5, 10400) Text(Point(-1, 0), ' 0.0K').draw(window) Text(Point(-1, 2500), ' 2.5K...
Python
1
from caffe2.python import core, workspace from caffe2.python import dyndep dyndep.InitOpsLibrary('@/caffe2/caffe2/distributed:file_store_handler_ops') # rendezvous should NOT be unique for each operator. It should have # the same run_id on different operators. say we have two shards, # both shards created rend...
Python
1
cOstS(N(R((Rtargstkwds((sD:\Python27_64\lib\_abcoll.pyt__call__|scCs&|tkr"t|dr"tSntS(NR1(RRRR!(R"R((sD:\Python27_64\lib\_abcoll.pyR#s (R...
Python
1
owka_kierujaca_inne', 'karta': 'Niebieska_karta', 'kartainicjator': 'Niebieska_karta_inicjator', 'gruparobocza': 'Grupa_robocza', 'skladgrupy': 'Grupa_robocza_sklad', 'planpomocy': 'Plan_pomocy', 'opisplanupomocy': 'Plan_pomocy_opis', 'narzedziaprawne': 'Narze...
Python
1
# Copyright 2024 The TensorFlow Authors. 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 required by applica...
Python
1
if res.status_code != 200: print(res.text) res.raise_for_status() for i, m in enumerate(res.json()): print("Process message (%d of %d) %s" % (i + 1, len(res.json()), m)) chat_id = m['message'...
Python
1
'.join(analysis_data.get('key_entities', []))} 사용자 질문: {query} 검색된 뉴스 기사들: {articles_text} **중요 지침:** 1. 사용자의 구체적인 시간적 맥락을 고려하여 답변 2. 질문과 관련성이 높은 기사만 선별하여 인용 3. 날짜가 맞지 않는 기사는 제외하고 설명 4. 각주는 [1], [2], [3], [4], [5] 순서로만 사용 **각주 규칙:** - 첫 번째로 인용하는 기사: [1] - 두 번째로 인용하는 기사: [2] - 세 번째로 인용하는 기사: [3] - 네 번째로 인용하는 기사: [4...
Python
1
from django.urls import reverse from ..utils import UnpublishMixin class TestVisualizerMixin(UnpublishMixin): def test_list(self): response = self.client.get(reverse('topology_list')) self.assertContains(response, 'TestNetwork') def test_detail(self): t = self.topology_model.objects....
Python
1
ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2, ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3, ACPI_DMAR_SCOPE_TYPE_HPET = 4, ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5, ACPI_DMAR_SCOPE_TYPE_RESERVED = 6, } #[repr(C, packed)] #[derive(Copy)] pub struct Struct_acpi_dmar_pci_path { pub Device: UINT8, pub Function: UINT8, } impl ::cor...
Rust
0
(output_buffer_thread), uart_input_chan: input_chans.uart_input, uart_output_chan: output_chans.uart_output, device_output_chan: output_chans.device_output, user_reader_task: None, user_writer_task: None, } } } /// UART device implementing all beh...
Rust
0
kind )); match kind { Kind::Navigator => { if config.navigators.is_empty() { return Ok(Vec::new()); } for nav in &config.navigators { ms.item_checked(&*nav.alias, pre_select.contains(&nav.alias)); } } Kind::D...
Rust
0
5")] InvalidFrameLength(u16), #[error("Invalid CRC, calculated {calculated:#X}, received {received:#X}")] InvalidCRC { calculated: u16, received: u16 }, } #[cfg(test)] mod tests { use super::*; use crate::mock_data::*; #[test] fn frame_header_ok() { let frame = FrameParser::new();...
Rust
0
'''from tkinter import * from tkinter import messagebox import csv import pandas as pd import matplotlib.pyplot as plt # Create CSV file with header if not exists header = ['Batsman', 2017, 2018, 2019, 2020] try: with open('cricket.csv', 'x', newline='') as f: writer = csv.writer(f) writer.writerow(header) except FileE...
Python
1
(std, axis=0) / (np.max(mean, axis=0) - np.min(mean, axis=0))) converged = ratio < thresh if verbose: print('Ratio = {:.4f}'.format(ratio)) return mean def MeanWhenIncluded(game, p=0.5, batch_size=None, thresh=0.05, verbose=False): '''Calculate feature attributions through the me...
Python
1
#!/usr/bin/env python3 # # SPDX-License-Identifier: GPL-2.0 # # Copyright (c) 2022-2023 Ricardo Pardini <ricardo@pardini.net> # # This file is a part of the Armbian Build Framework # https://github.com/armbian/build/ # import logging import re log: logging.Logger = logging.getLogger("bash_declare_parser") REGEX_BASH_...
Python
1
baEPV3) print("ratioE7= ",ratioE7) print("cpPruebaEPV4= ",cpPruebaEPV4) print("ratioE8= ",ratioE8) ''' import os from misc_utils import log_messages as lmsg fname= os.path.basename(__file__) if (abs(ratio1)<1e-12) & (abs(ratio2)<1e-12) & (abs(ratio3)<1e-12) & (abs(ratioA4)<1e-12) & (abs(ratioA5)<1e-12) & (abs(ratioA...
Python
1
'last10_consecutive_wins': 'LTeam_last10_consecutive_wins', 'WinPct': 'LTeam_WinPct', 'FG_ratio' : 'LTeam_FG_ratio', '3PT_ratio': 'LTea...
Python
1
<Term> { super::atom() } pub fn anonymous(arc_process: Arc<Process>) -> BoxedStrategy<Term> { prop_oneof![ anonymous::with_native(arc_process.clone()), anonymous::without_native(arc_process) ] .boxed() } pub fn arity(arc_process: Arc<Process>) -> BoxedStrategy<Term> { arity_u8().pr...
Rust
0
# -*- coding: utf-8 -*- from .default import DefaultConfig import os class ProductionConfig(DefaultConfig): DEBUG = False LOG_LEVEL = 'WARNING' # 生产环境使用环境变量 SECRET_KEY = os.environ.get('SECRET_KEY') DATABASE_PATH = os.environ.get('DATABASE_PATH') or '/data/reviews.db' USER_CONFIG_DIR = os.env...
Python
1
), }, // The file was opened successfully therefore it must exist, Ok(_) => Ok(true), } } mod builder; pub use builder::Builder; use std::io; use noodles_sam as sam; use crate::container::ReferenceSequenceId; #[derive(Clone, Debug, Eq, PartialEq)] pub struct Header { reference_seque...
Rust
0
macro_use] extern crate serde_derive; #[macro_use] extern crate serde_json; extern crate actix_rt; extern crate actix_cors; extern crate env_logger; extern crate serde; extern crate dotenv; extern crate futures; extern crate failure; extern crate derive_more; extern crate jsonwebtoken; extern crate uuid; ...
Rust
0
except: script_id = "" script_output = "" if script_id != "" and script_output != "": info_str += "%s: %s\n" % (script_id, script_output) myprint("\t------------------------------------------------") ...
Python
1
_parse_ty(*inp, arena), arena.text("->").nest(2), pp_parse_ty(*out, arena).nest(2), ], arena.softline(), ) .parens(), Ty::Forall(name, body) => arena .intersperse( [ ar...
Rust
0
R b Q - 2 12", "5N2/2k5/8/8/3PQ3/2P5/PP1BPP2/3RKB w - - 7 40", "r2qkbnr/4pppp/p2p4/3Q1bP1/3P4/2P2N2/PP2PP1P/R1B1K2R w KQkq - 0 13", "r2k1r2/p1pbn1pQ/1n6/1p6/4P3/1P4P1/P2N1P1P/R3KR b Q - 0 25", "r2qkb1r/ppp1np1p/4b1p1/8/2N5/1P3N2/R3PPPP/4KB1R w Kkq - 0 13", "r1b1kb1r/p2ppppp/1p2q3/2p5/5P2/P1QP4/3NNBP...
Rust
0
= if value == 0 { 1 } else { value }; self.rom_bank = self.rom_bank & 0b0110_0000 | value as u16 } 0x4000..=0x5FFF => { match self.mode { MBC1Mode::ROM => { let offset = if value == 0 { 1 } else { value } as u16; ...
Rust
0
WHERE SCHEMA_NAME(schema_id) = '{0}' EXEC SP_EXECUTESQL @stmt "#, schema_name ); conn.raw_cmd(&drop_procedures).await?; conn.raw_cmd(&drop_views).await?; conn.raw_cmd(&drop_fks).await?; conn.raw_cmd(&drop_tables).await?; conn.raw_cmd(&drop_shared_defaults).awai...
Rust
0
""" reader, data = read_data(stock_code) data = add_MA(data, day_list=(60,)) # 获取该股票历史上的大阳线数据 curr_data = data[data['pct_chg'] <= pct_chg] # 筛选“开盘价==最高价” curr_data = curr_data[curr_data['open'] == curr_data['high']] # 筛选“收盘价==最低价” curr_data = curr_data[curr_data['close'] == curr_data['l...
Python
1
Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pe_dout](pe_dout) module"] pub type PE_DOUT = crate::Reg<u32, _PE_DOUT>; #[allow(missing_docs)] #[...
Rust
0
tern & Pacific Coast states", "1KBBWC" => "Colorado", "1KBBWD" => "Idaho", "1KBBWF" => "California", "1KBBWK" => "Alaska", "1KBBWM" => "Montana", "1KBBWN" => "Nevada", "1KBBWR" => "Oregon", "1KBBWS" => "Washington state", "1KBBWU" => "Utah", "1KBBWX" => "New Mexico", "1KBBWY"...
Rust
0
); // Here consensus.rs->handle_majority_precommits()->//Commit is achieved sandbox.recv(&precommit_3); let new_height = current_height.next(); sandbox.assert_state(new_height, Round(1)); sandbox.check_broadcast_status(new_height, &block.hash()); let propose = ProposeBuilder::new(&sandbox).bui...
Rust
0
impl TableScanTestWrapper { fn get_point_range(&self, handle: i64) -> KeyRange { get_point_range(TABLE_ID, handle) } } impl Default for TableScanTestWrapper { fn default() -> TableScanTestWrapper { let test_data = prepare_table_data(KEY_NUMBER, TABLE_ID); ...
Rust
0
class Restaurant: def __init__(self, name, rent, menu = []) -> None: self.name = name self.orders = [] self.chef = None self.server = None self.manager = None self.rent = rent self.menu = menu self.revenue = 0 self.expense = 0 self.bala...
Python
1
''' Object - User will input (3ages).Find the oldest one ''' import sys age1 = input("enter first age : ") age2 = input("enter second age : ") age3 = input("enter third age : ") if age1==age2 and age2==age3: print("Same age for all") sys.exit() if age1>=age2 and age1>=age3: print("the oldest age is", age1)...
Python
1
pub const NCLOGLEVEL_WARNING: NcLogLevel_i32 = ffi::ncloglevel_e_NCLOGLEVEL_WARNING; /// [`NcLogLevel_i32`] "detailed information. pub const NCLOGLEVEL_INFO: NcLogLevel_i32 = ffi::ncloglevel_e_NCLOGLEVEL_INFO; /// [`NcLogLevel_i32`] "detailed information. pub const NCLOGLEVEL_VERBOSE: NcLogLevel_i32 ...
Rust
0
self.nOrientation == self.nRotation \ else f'[{self.nOrientation}-{self.nRotation}]' s = ('{name}({arf_config} {in_channels}, ' '{out_channels}, kernel_size={kernel_size}' ', stride={stride}') if self.padding != (0, ) * len(self.padding): s += ', paddin...
Python
1
#!/usr/bin/env python # Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation (FSF), e...
Python
1
name.as_str()) { return None; } Some(name) } #[cfg(test)] mod tests { use ide_db::base_db::{fixture::WithFixture, FileRange}; use super::*; #[track_caller] fn check(ra_fixture: &str, expected: &str) { let (db, file_id, range_or_offset) = RootDatabase::with_range_or_offset(ra_f...
Rust
0
{ #[inline(always)] fn from(variant: CAP0RE_A) -> Self { match variant { CAP0RE_A::ENABLED => true, CAP0RE_A::DISABLED => false, } } } #[doc = "Reader of field `CAP0RE`"] pub type CAP0RE_R = crate::R<bool, CAP0RE_A>; impl CAP0RE_R { #[doc = r"Get enumerated value...
Rust
0
except Exception as e: return jsonify({'error': 'Internal server error'}), 500 @app.route('/remove_sell_car_data', methods=['POST']) def remove_sell_car_data(): try: data = request.get_json() price = data.get('price') car_model = data.get('car_model') cursor = mysql.cur...
Python
1
i32; #[doc = "*Required features: `\"Win32_Graphics_OpenGL\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] pub fn wglShareLists(param0: HGLRC, param1: HGLRC) -> super::super::Foundation::BOOL; #[doc = "*Required features: `\"Win32_Graphics_OpenGL\"`, `\"Win32_Foundation\"`, `\"Win32_G...
Rust
0
egments_eq!(path[3], {(4, 0), (0, 0)}); } macro_rules! route_vec { (@route R $num:expr) => { Route::Right($num) }; (@route L $num:expr) => { Route::Left($num) }; (@route U $num:expr) => { Route::Up($num) }; (@route D $n...
Rust
0
{ecs::prelude::*, input::prelude::*}; use feldspar::prelude::ChunkMesh; pub fn show_mesh_count( keyboard: Res<Input<KeyCode>>, meshes: Query<&ChunkMesh>, ) { if keyboard.just_pressed(KeyCode::P) { println!("Meshes: {}", meshes.iter().len()); } } <reponame>harry0731/Advent-of-Code use std::fs; u...
Rust
0
"""Pre-processor that normalizes data to have zero mean and unit variance.""" import polars as pl from .preprocessor import Preprocessor class StandardScaler(Preprocessor): """Normalizes data to have zero mean and unit variance. This is a concrete implementation of the Preprocessor abstract class. It is a ...
Python
1
#!/usr/bin/python3 """Module with a function to append a string text to a file""" def append_write(filename="", text=""): """Appends a string text to a file. Args: filename (str): Name of the file to append to. text (str): Text to append to the file. """ with open(filename, 'a', enco...
Python
1
_searchable_fields(searchable_fields); let filterable_fields = ["_geo", "population", "elevation"].iter().map(|s| s.to_string()).collect(); builder.set_filterable_fields(filterable_fields); let sortable_fields = ["_geo", "populati...
Rust
0
def outerFun(): def innerFun(): print('Hello World') innerFun() outerFun()
Python
1
let crate_name = crate_name.into(); let crate_version = crate_version.into(); let _ = self .conn .execute( "INSERT OR IGNORE INTO crates (name) VALUES ($1)", params![crate_name], ) .unwrap(); let crate_id = self....
Rust
0
import asyncio import json from dataclasses import dataclass from typing import List, Optional import streamlit as st from langchain_openai import ChatOpenAI from agents.cmr_agent import CMRAgent from agents.events import MessageEvent, ToolEvent from config import settings @dataclass class Message: role: str ...
Python
1
# This function check if a list of numbers is monotonic increasing or decreasing def mysterious_method(nums: [float]) -> bool: a = [] # to store increasing flags b = [] # to store decreasing flags # iterate over the list, starting from first element for i in range(len(nums) - 1): # monotone ...
Python
1
m: true, text: None, text_color: None, min_decimals: 0, max_decimals: None, } } pub fn f32(value: &'a mut f32, range: RangeInclusive<f32>) -> Self { Self::from_get_set(to_f64_range(range), move |v: Option<f64>| { if let Some(v) = v { ...
Rust
0
from django.contrib.auth import get_user_model from django.core.exceptions import ObjectDoesNotExist from .models import UserStatus from .settings import graphql_auth_settings as app_settings UserModel = get_user_model() def get_user_by_email(email): """ get user by email or by secondary email raise Ob...
Python
1
!(v, b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10somestring\x00\x05bytes\x20\x00\x20"); } } // SPDX-License-Identifier: MIT OR Apache-2.0 use std::{ fmt::{self, Display}, mem::MaybeUninit, }; use windows::{ core::PWSTR, Win32::{ Foundation::{GetLastError, WIN32_ERROR}, System::{ ...
Rust
0
= _buf; res?; // clear buf.clear(); } } <filename>compiler/src/swc_helpers.rs<gh_stars>1-10 use swc_common::DUMMY_SP; use swc_ecmascript::ast::*; use swc_ecmascript::utils::quote_ident; pub fn rename_var_decl(new_name: &str, old: &str) -> ModuleItem { ModuleItem::Stmt(Stmt::Decl(Decl::V...
Rust
0
) -> u64 { let mut h = h as u32; let mut t = (h ^ (h >> 1)) & 0x22222222u32; h = h ^ t ^ (t << 1); t = (h ^ (h >> 2)) & 0x0C0C0C0Cu32; h = h ^ t ^ (t << 2); t = (h ^ (h >> 4)) & 0x00F000F0u32; h = h ^ t ^ (t << 4); t = (h ^ (h >> 8)) & 0x0000FF00u32; h = h ^ t ^ (t << 8); h as u64 } fn...
Rust
0
); for entry in readdirs { let dir_file = entry.expect("Not found files in directory"); dir_file.path(); } } } /// Returns the number of elements in an array pub fn take_file_vec_len(&self) -> usize { self.files.len() }...
Rust
0
Some((name, "false")) => context.set_variable(name, false), Some((_, val)) => panic!("Unknown boolean value '{}'", val), None => panic!("boolean argument '{}' is malformed", boolean), } } for number in arguments.opt_strs("number") { match argument_name_value(&numb...
Rust
0
"As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg", "Tl", "Pb"...
Rust
0
# "styling": styling, # }, # } # ) # ] def _validate( self, metrics: Dict, runtime_configuration: dict = None, execution_engine: ExecutionEngine = None, ): return self._validate_metric_value_bet...
Python
1
, cmd) process_extra_options(config) s = "" with open(os.path.join(sdk_base, "scripts", "ide", "segger", PROJECT_TEMPLATE), "r") as f: s = f.read() t = jinja2.Template(s) s = t.render(config) return s def generate_ses_session(out_dir): session_file_contents = ['<!DOCTYPE CrossStu...
Python
1
fn rank5(bench: &mut Bencher) { bench.iter(|| W0.rank(&5, thread_rng().gen_range(0, W0.size()))); } #[bench] fn rank5_all(bench: &mut Bencher) { bench.iter(|| W0.view(0..thread_rng().gen_range(0, W0.size())).counts(&5)); } #[bench] fn rank7(bench: &mut Bencher) { be...
Rust
0
.add(entity, PreviousPosition(info.position)).unwrap(); world.add(entity, info.uuid).unwrap(); world.add(entity, info.uuid).unwrap(); world .add( entity, Network { tx: info.sender, rx: info.receiver, }, ) .unwrap(); ...
Rust
0
ds = np.r_[thresholds[0] + 1, thresholds] if fps[-1] <= 0: warnings.warn("No negative samples in y_true, " "false positive value should be meaningless", UndefinedMetricWarning) fpr = np.repeat(np.nan, fps.shape) else: fpr = fps / fps[-1] ...
Python
1
from time import sleep from selenium.webdriver.common.by import By from pages.base_page import BasePage class ProductPage(BasePage): #SELECTORS PRODUCT_NAME = (By.XPATH, '//h1[@data-test="product-name"]') ADD_TO_CART_BUTTON = (By.XPATH, '//button[@data-test="add-to-cart"]') ALERT_MESSAGE = (By.XPAT...
Python
1
#[allow(unused_mut)] let mut entry_2768 = list_2767.entry(); crate::query_ser::serialize_structure_filter(entry_2768, item_2766); } list_2767.finish(); } #[allow(unused_mut)] let mut scope_2769 = writer.prefix("ReservedInstancesModificationId"); if let...
Rust
0
E: 0x3A, 6 TETRA_GOSSIP_STONE_TEXT_AFTER_BOMBS: 0x3B, 1 TALKED_TO_KOMALI_AFTER_SHOWING_THE_LETTER: 0x3B, 2 TALKED_TO_KOMALI_WITHOUT_THE_LETTER: 0x3B, 3 WATCHED_LIGHT_BRIDGE_IN_TOTG_DISAPPEAR: 0x3B, 6 KORL_UNLOCKED_AND_SPAWN_ON_WINDFALL: 0x3B, 7 WATCHED_FIRE_AND_ICE_ARROWS_CUTSCENE: 0x3C, 0 G...
Rust
0