text
string
label_name
string
labels
int64
te input lines } _ => {} } } Ok(out_string) => { editor.add_history_entry(line); println!("{}", out_string); break; } Err(e) => ...
Rust
0
= 0; loop { let mut mutator = match phase { 0 => Box::new(RemoveInst::new(&func)) as Box<dyn Mutator>, 1 => Box::new(ReplaceInstWithIconst::new(&func)) as Box<dyn Mutator>, 2 => Box::new(ReplaceInstWithTrap::new(&func)) as Box<dyn Mutator>, ...
Rust
0
self_: *mut PxVehicleSuspensionData, newSprungMass: f32, ) -> (); pub fn PxVehicleAntiRollBarData_new() -> PxVehicleAntiRollBarData; pub fn PxVehicleTireData_new() -> PxVehicleTireData; pub fn PxVehicleTireData_getRecipLongitudinalStiffnessPerUnitGravity(self_: *const PxVehicleTireData, ) -> f32; pub fn PxVehicleTireDa...
Rust
0
, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0x...
Rust
0
esult.success is True class TestProtocolTypeSafety: """Test that protocols provide proper type safety.""" def test_protocol_duck_typing(self): """Test that protocols work with duck typing.""" # Any object with the right attributes should work with protocols # Create a simple object t...
Python
1
."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssRule`*"] pub const STYLE_RULE: u16 = 1u64 as u16; #[doc = "The `CSSRule.CHARSET_RULE` const."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CssRule`*"] pub ...
Rust
0
erialize)] struct FixturePanic<'a>(#[serde(borrow)] &'a str); fn comment<'a, K: Ki<'a>>(i: Cursor<'a>) -> Result<&'a str, K::Error> { const E: Ascii = ascii!('!'); const B: &[Ascii] = asciis!("--"); const END_B: &[Ascii] = asciis!("--}}"); const END_A: &[Ascii] = asciis!("}}"); let (c, _) = tac(i,...
Rust
0
er, set the "name" column //! user_buffer.set(&["name"], "<NAME>")?; //! //! // assign nested internal values, sets the first tag element //! user_buffer.set(&["tags", "0"], "first tag")?; //! //! // get an internal value of the buffer from the "name" column //! let name = user_buffer.get::<&str>(&["name"])?; //! as...
Rust
0
(), key=lambda x: x["round"]) # Append assassination info at the end if it exists if assassination_info: game_events_list.append( { "round": "assassination", # Special key for template logic "assassination": assassination_info, } ) r...
Python
1
er/src/channel_handler.rs // Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { crate::{ channel::{CurrentChannelManager, TargetChannelManager}, rate_limiter::RateLimiterMonotonic, ...
Rust
0
from .env_wrappers import *
Python
1
*x_entry += x_delta; *x_entry }; if updated_value == 0 { x_deltas.remove(x); } } // And calculate our current accumulating extent. last_extent = 0; let mut last_x = 0; let mut overlap_count = 0; for (x...
Rust
0
# Copyright 2019 Google Inc. 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 applicable law or ...
Python
1
SELECT \ id, \ row_number() OVER (ORDER BY start_time) AS n \ FROM tasks WHERE working_date = ?1\ ) AS b \ WHERE a.id = b.id", params![working_date], )?; &tx.commit()?; Ok(()...
Rust
0
], /// APB1 peripheral reset register apb1rstr: ReadWrite<u32, APB1RSTR::Register>, /// APB2 peripheral reset register apb2rstr: ReadWrite<u32, APB2RSTR::Register>, _reserved1: [u8; 8], /// AHB1 peripheral clock register ahb1enr: ReadWrite<u32, AHB1ENR::Register>, /// AHB2 peripheral clo...
Rust
0
quote! { [stringify!(#ident)] => Some(#documentation), } } }) // XXX: Workaround //Decription of issue is here https://stackoverflow.com/a/65353489 .fold(quote! {}, |acc, new| quote! { #acc #new }); quote! { fn get_doc_recursive<'a>( inner_field: imp...
Rust
0
import random def number_guessing_game(): secret_number = random.randint(1, 100) attempts = 0 print("Welcome to the Number Guessing Game!") print("I'm thinking of a number between 1 and 100.") while True: try: guess = int(input("Your guess: ")) attempts += 1 ...
Python
1
pub grid: Grid, /// Diffusion coefficents map. pub coeffs: Array3<f64>, /// Initial concentration map. pub init: Array3<f64>, /// Source map. pub sources: Array3<f64>, } impl Parameters { /// Construct a new instance. #[allow(clippy::too_many_arguments)] #[must_use] #[inlin...
Rust
0
from config.configuracoes import time, pygame, tela, largura, altura from ..Rede_Neural import estrategia_evolutiva from ..Jogo.obstaculos import Obstaculos class Visualizador: def __init__(self): self.contador_frames = 0 self.tempo_inicial = 0 self.fonte = pygame.font.Font(None, 32) d...
Python
1
from pydantic import BaseModel from typing import List from enum import Enum class ModelTTS(str,Enum): tts="tts-1" ttsHd="tts-1-hd" class Transcription(BaseModel): model:ModelTTS text:str voice:str='alloy' chunk_size:int=65536 class Payload(BaseModel): lang:str target:List[str] m...
Python
1
# coding: utf-8 # Copyright (c) 2025 OceanBase. # # 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
on // regarding copyright ownership. The ASF licenses this file // to you 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 ap...
Rust
0
Copy<V>) -> Meta<VTableRef<'a, V>> { Meta { elem: vec.data.elem, vtable: VTableRef::Ref(vec.vtable.as_ref()), } } } extern crate backtrace; extern crate once_cell; // This module must be declared before the others because it exports a `log!` macro that everyone // else uses....
Rust
0
# app/config.py import os class Config: SECRET_KEY = os.environ.get('SECRET_KEY', 'your_secret_key') SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'postgresql://postgres:postgres@db:5432/postgres') SQLALCHEMY_TRACK_MODIFICATIONS = False CELERY_BROKER_URL = os.environ.get('CELERY_BROKER_URL'...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2015 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
, NorthEast, South, South])); assert_eq!(3, least_steps(&vec![SouthEast, SouthWest, SouthEast, SouthWest, SouthWest])); assert_eq!(0, least_steps(&vec![South, North])); assert_eq!(1, least_steps(&vec![NorthEast, South])); assert_eq!(0, least_steps(&vec![NorthEast, Sout...
Rust
0
common_procedure_code = f""" RETURNS STRING LANGUAGE PYTHON RUNTIME_VERSION = '{python_version}' PACKAGES = ('{packages}') {imports} HANDLER = 'main' EXECUTE AS CALLER AS $$ {snowpark_telemetry_snippet} {compiled_code} $$""" use_anonymous_sproc = parsed_model["config"].get("use_anonymous_sproc", Tru...
Python
1
stGene::new( PestGeneType::DmgToPotato, self.pest_genes.get(4).unwrap().value, ), PestGene::new( PestGeneType::DmgToLettuce, self.pest_genes.get(5).unwrap().value, ), ], ...
Rust
0
let light = Light { blink: true, color: LightType::YELLOW, }; con.set("light", serde_json::to_string(&light).unwrap())?; Ok(()) } fn initial_db_update( con: &mut redis::Connection, condition: &Option<Condition>, emergency: &Option<Emergency>, plans: &Option<Vec<Plan>>, )...
Rust
0
from numpy import sum from functools import partial from time import sleep from pypot.creatures import AbstractPoppyCreature from pypot.creatures.ik import IKChain from .primitives.dance import Dance from .primitives.face_tracking import FaceTracking from .primitives.tracking_feedback import TrackingFeedback from .pr...
Python
1
import sys from datetime import datetime, timedelta from airflow import DAG from airflow.operators.python import PythonOperator sys.path.append("../../opt/airflow/") from src.surebets import main as surebets # This are the only lines that need to be changed to run the DAG for another category # we declare the defa...
Python
1
import tkinter import sentences import time #definimos algunas funciones tiempo_inicial=0.0 tiempo_final=0.0 tiempo_total=0.0 def start_time(): global tiempo_inicial tiempo=time.time() tiempo_inicial=tiempo print(tiempo_inicial) def end_time(): global tiempo_final tiempo=time.time() ...
Python
1
izer) -> Result<(), SerializeError> { ser.serialize_f32(*self) } } impl Serialize for bool { fn serialize(&self, ser: &mut Serializer) -> Result<(), SerializeError> { ser.serialize_u8(if *self { 1 } else { 0 }) } } impl<'a, T> Serialize for &'a T where T: Serialize, { fn serialize(&self, ser: &mut Serializer...
Rust
0
sages_per_thread": self.config['max_messages'], "max_stories": self.config['max_stories'], "max_posts": self.config['max_posts'], "download_media": self.config['download_media'], "generate_pdf": self.config['generate_pdf'] }...
Python
1
::from_serde(&response.key_manager).unwrap(); let response = next_key(&km); let response = parse::<KeyManagerResponse>(&response).unwrap(); let keypair1 = response.keypair.clone().unwrap(); assert!(response.success); assert!(response.keypair.is_some()); assert_eq!(respon...
Rust
0
let start = info.offset as usize % 4; let end = start + data.len(); if end <= 4 { for i in start..end { data[i - start] = (value >> (i * 8)) as u8; } } else { for d in data { *d = 0xff; } } } ...
Rust
0
asmTypeList}; use super::{Call, Failure, Function, Outcome}; type Result<T> = std::result::Result<Outcome<T>, Failure>; /// Default `Runtime` implementation based on `Wasmer`. pub struct DefaultRuntime<T> where T: EnvTypes, { /// The runtime environment. Used mainly for managing app persistence. env: Env...
Rust
0
t f2 = &f[1]; let r1 = &r[0]; let r2 = &r[1]; let (step1, h1) = Self::calc_step(r1, r2); let (step2, h) = Self::calc_step(f1, f2); assert_eq!(h1, h); match Self::handle_pair_proper(cpt1, cpt2, y, step1, step2, h, |x1, x2, y| { self.draw_line(x1, x2...
Rust
0
code>.</p> pub fn chime_sdk_meeting_configuration( &self, ) -> std::option::Option<&crate::model::ChimeSdkMeetingConfiguration> { self.chime_sdk_meeting_configuration.as_ref() } /// <p>The list of tags.</p> pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> { sel...
Rust
0
Eq, PartialEq, Hash, Debug, Default)] pub struct DummyPowParams { // Delay offset (in milliseconds) delay: Distribution, } impl fmt::Display for DummyPowParams { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "(delay: {:?})", self.delay) } } impl DummyPowParams { fn gen_...
Rust
0
{putih}{user['first_name']}") token = self.get(id) if token is None: token = self.login(data, account_number, user_name) if token is None: continue self.save(id, token) if self.is_expired...
Python
1
import torch import numpy as np def test_model(model, conf, show_progress_interval=None): model.eval() ber = 0 ber_1 = 0 ber_2 = 0 bler = 0 bler_1 = 0 bler_2 = 0 xmit_pwr_1 = [] xmit_pwr_2 = [] with torch.no_grad(): for e in range(conf.num_test_epochs): ...
Python
1
x_t = x2ms_nn.ReLU()(self.conv_x_x[i](x_t) + self.conv_h_x[i](h_t)) x_concat = self.conv_x(x_t) h_concat = self.conv_h(h_t) m_concat = self.conv_m(m_t) c_concat = self.conv_c(c_t) i_x, f_x, g_x, i_x_prime, f_x_prime, g_x_prime, o_x = x2ms_adapter.split( x_concat...
Python
1
for more details). Additionally, for any type `F` that implements `Fn`, `&F` /// implements `Fn`, too. /// /// Since both [`FnMut`] and [`FnOnce`] are supertraits of `Fn`, any /// instance of `Fn` can be used as a parameter where a [`FnMut`] or [`FnOnce`] /// is expected. /// /// Use `Fn` as a bound when you want to a...
Rust
0
criptor.as_mut_ptr()) }; if likely!(result == 0) { return unsafe { descriptor.assume_init() } } unreachable!("Since libusb-1.0.16, libusb_get_device_descriptor() should never fail, but it has with {}", result) } use fern::Dispatch; use log::LevelFilter; fn apply( dispatch: Dispatch, module: Option<&str>, lev...
Rust
0
TrackCurve, pub x0: f64, pub x1: f64, pub clip: Option<(f64, f64)>, pub dit: Option<(TrackEnd, usize, DitShape)>, } impl Default for Track { fn default() -> Self { Self { face: HexFace::Bottom, curve: TrackCurve::Straight, x0: 0.0, x1: 1.0, ...
Rust
0
import requests import json def get_recommendations(user_id, n=5, mood=None): """ Get recommendations for a user through the API """ # Prepare URL with parameters url = f"http://localhost:8000/recommend?user_id={user_id}&n={n}" if mood: url += f"&mood={mood}" try: # Mak...
Python
1
best_hash, header)); } pub fn on_block_imported( &self, hash: <Block as BlockT>::Hash, header: &<Block as BlockT>::Header, ) { self.net_proto_channel.send_from_client(ProtocolMsg::BlockImported(hash, header.clone())); } // SyncOracle: are we connected to any peer? #[cfg(test)] fn is_offline(&self) -> b...
Rust
0
| RNW_READ)?; I2C1::borrow_unchecked(|i2c| { const I2CR_TXAK: u16 = 1 << 3; // switch to read mode & NAK the next incoming byte i2c.I2CR.rmw(|i2cr| (i2cr & !I2CR_MTX) | I2CR_TXAK); // dummy read to start the transfer i2c.I2DR.read(); // wait for the transfer to co...
Rust
0
} }); // Help Window let window = imgui::Window::new(im_str!("Help")); window .size([395.0, 160.0], Condition::FirstUseEver) .position([5.0, 660.0], Condition::Once) .build(&ui, || { ui.text(im_str!("Select ROM file, to control us...
Rust
0
# Generated by Django 5.2.3 on 2025-07-08 13:06 import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('government', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER_MO...
Python
1
for line in input.lines() { values_number += 1; for (pos, chr) in line.chars().enumerate() { if chr == '1' { histogram[pos] += 1; } } } let mut gamma = 0usize; for (pos, &value) in histogram.iter().rev().enumerate() { if value >= v...
Rust
0
a = input() print(a[0])
Python
1
.root().join("target/doc").is_dir()); assert!(p.root().join("target/doc/foo/index.html").is_file()); assert!(p.root().join("target/doc/bar/index.html").is_file()); // Verify that it emits rmeta for the bin and lib dependency. assert_eq!(p.glob("target/debug/artifact/*.rlib").count(), 0); assert_eq!...
Rust
0
new_tgt_sent = list(tgt_sent) for pos, word in zip(old_word_pos, new_words): new_tgt_sent[pos] = word bleu_score = sentence_bleu([tgt_ref_tokens], new_tgt_sent[1:-1]) bleu_scores.append(bleu_score) else: new_tgt_sent = lis...
Python
1
import os import numpy as np # --- 参数设置 --- # 请确保这些参数与生成文件的采集脚本中的参数完全一致 FILENAME = "2ch_iq_data.bin" SAMPLE_RATE = 4e6 NUM_CHANNELS = 2 DTYPE = np.complex64 # 数据类型为 complex64 (I/Q各为float32) def calculate_duration(): """ 计算并打印IQ数据文件的录制时长。 """ try: # 步骤 1: 获取文件总大小 (字节) file_size_bytes = ...
Python
1
ry.split(" ") if "the" in query: query_to_arr.remove("the") app_name = query_to_arr[query_to_arr.index("close") + 1] close(app_name, match_closest=True, output=False) speak("Closed the app") if 'keyboard' in query: keys_info = takeCommand().lower() while ...
Python
1
bool(self): for x in ['false', 'true']: output = self.run('$x = ""; echo isset($x[%s]);' % x) assert self.space.is_w(output[0], self.space.w_False) output = self.run('$x = "a"; echo isset($x[%s]);' % x) assert self.space.is_w(output[0], self.space.wrap(x == 'false...
Python
1
.flatten() .cloned() .collect::<Vec<_>>(); assert!(vec![0 as u16, 1, 2].into_iter().eq(results.into_iter())); } } //! Extents used for putting and getting data //! from a variable use std::convert::Infallible; use std::convert::TryFrom; use std::convert::TryInto; use std:...
Rust
0
sigterm.take(1) .for_each(|_| -> Result<(), io::Error> { info!("Received SIGTERM, exiting."); ...
Rust
0
n new( bot: &'a InnerBot, chat_id: impl ImplicitChatId, message_id: message::Id, ) -> Self { Self { bot, chat_id: chat_id.into(), message_id, reply_markup: None, } } /// Configures an inline keyboard for the message. ...
Rust
0
pub kind: CurveEventKind, } #[derive(Debug)] pub enum CurveEventKind { Created(Box<RawCurve<Weak>>), Modified { raw: Box<RawCurve<Weak>>, major_change: bool, }, Dropped, } <filename>tests/nested.rs<gh_stars>10-100 #![feature(custom_test_frameworks)] #![test_runner(datatest::runner)...
Rust
0
str, path: str ) -> None: """ Combines multiple plots into a single figure for comprehensive visualization. Args: neuron: Identifier for the neuron being analyzed. concept: Description of the concept being visualized. path: Directory path...
Python
1
#!/usr/bin/env python from vtkmodules.vtkCommonDataModel import ( vtkDataObject, vtkImageData, vtkSphere, ) from vtkmodules.vtkFiltersCore import vtkThreshold from vtkmodules.vtkFiltersExtraction import vtkExtractGeometry from vtkmodules.vtkFiltersGeometry import vtkMarkBoundaryFilter from vtkmodules.vtkRen...
Python
1
. CNN's Frederik Pleitgen, Pamela Boykoff," " Antonia Mortensen, Sandrine Amiel and Anna-Maja Rappard contributed to this report.", ], return_tensors="tf", padding="longest", truncation=True, ) features = self.xsum_1_1_model.get_encoder()(*...
Python
1
Update { update_order_id, .. }) => *update_order_id, } } /// Returns the block index to which the operation belongs. pub fn block_number(&self) -> i64 { *match self { StorageAccountDiff::BalanceUpdate(StorageAccountUpdate { block_numbe...
Rust
0
ficulty_adjustment_interval(); // uncle must be same difficulty epoch with tip if block.header().difficulty() != header.difficulty() || block_difficulty_epoch != tip_difficulty_epoch { bad_uncles.push(hash.clone()); continue; ...
Rust
0
#[packed(start_bit=7, end_bit=0, start_byte=0, end_byte=3)] pub signature: u32, /// Tag that matches this CSW back to the CBW that initiated it. /// Must be copied from CBW tag field. Host uses it to positively /// associate a CSW with the corresponding CBW #[packed(start_bit=7, end_bit=0, start_b...
Rust
0
.0 & other.0) } } }; } mod buffer; mod common; mod complex; mod ffi; mod font; mod map; mod tag; mod tag_table; mod text_parser; mod unicode; pub use ttf_parser::Tag; pub use crate::buffer::{ Buffer, GlyphBuffer, GlyphInfo, GlyphPosition, SerializeFlags, BufferClusterLevel, }; pub use cra...
Rust
0
debug', action='store_true', help='Debug mode') parser.add_argument('--start_point', type=int, nargs=3, default=start_point, help='Start point for the unrolling') parser.add_argument('--scale_factor', type=float, default=1.0, help='Scale factor for the mesh') parser.add_argument('--split_width', type=int, d...
Python
1
} } } impl DotPrinter for Vec<Stmt> { fn print(&self, ctx: &mut PrinterContext) -> String { ctx.indent_grow(); let attrs: Vec<String> = self.iter().map(|e| e.print(ctx)).collect(); ctx.indent_shrink(); attrs.join(ctx.l_s.as_str()) } } impl DotPrinter for Stmt { fn pr...
Rust
0
#!/usr/bin/env python3 """ Module contenant la fonction de mise à jour avec momentum """ import numpy as np def update_variables_momentum(alpha, beta1, var, grad, v): """ Met à jour une variable en utilisant l'algorithme de gradient descent avec momentum. Args: alpha: taux d'apprentissage (le...
Python
1
uded namespace (Note: excluded namespaces: {EXCLUDE_NAMESPACES})" ) return False return True # For layerwise mode, every layer becomes an output. if layerwise: output_nodes = list(graphdef.node) G_LOGGER.verbose(f"Running in layerwise mode. Marking {len(output_n...
Python
1
RESIZE_DIV = 4 # CLIP特徴量の取得時にcutoutを使うか:使う場合にはソースを書き換えてください NUM_CUTOUTS = 4 USE_CUTOUTS = False # region モジュール入れ替え部 """ 高速化のためのモジュール入れ替え """ def replace_unet_modules(unet: diffusers.models.unet_2d_condition.UNet2DConditionModel, mem_eff_attn, xformers, sdpa): if mem_eff_attn: print("Enable memory effici...
Python
1
10', 'Yesterday', 'Finals' @param **player_scope** (*str*): PlayerScope in the API. String \ indicating the type of players for which data is desired. \ Valid values include: - 'All Players', 'Rookies' @param **per_mode** (*str*): PerMode in the API. String \ ...
Python
1
exporter_compat(exporter)) .build(); let _uninstall = global::set_tracer_provider(tracer_provider); // Start a new prometheus metrics pipeline if --features metrics is used #[cfg(feature = "metrics")] let exporter = opentelemetry_prometheus::exporter().init(); #[cfg(feature = "metrics")] ...
Rust
0
Transport { inner: T::Incoming, map: Option<F>, } impl<T, F> Future for MapErrIncoming<T, F> where T: MuxedTransport, F: FnOnce(IoError) -> IoError, { type Item = MapErrIncomingUpgrade<T, F>; type Error = IoError; #[inline] fn poll(&mut self) -> Poll<Self::Item, Self::Error> { matc...
Rust
0
&& suji<SUJI_10) && ( DAN_0< dan && dan< DAN_10) , "(204)suji_dan_to_ms suji={},dan={}",suji, dan); (suji*10 + dan) as umasu } /** * ハッシュ値を作る */ pub fn push_ms_to_hash(hash:u64, ms:umasu) -> u64 { // 0筋とか 0段とか 使ってないが、そのまま足す。 // 0~100の101升と、ちょいなんで、128(=2^7) あれば十分 (hash<<7) + ms as ...
Rust
0
import streamlit as st def get_faq_prompts(): content = """# DaddyBets FAQ Welcome to the DaddyBets FAQ! Here, we'll cover how to interact with DaddyBets to get real-time sportsbook odds, understand different types of bets, and learn the dos and don'ts when asking for betting advice. ## How to Ask for Bets ### ...
Python
1
(self)?; fs::create_dir_all(config_path.parent().unwrap())?; fs::write(&config_path, toml)?; Ok(()) } fn get_config<S: AsRef<Path>>(&self, config_file: S) -> Option<Config<'static>> { match fs::read_to_string(config_file) { Ok(contents) => match Config::from_str(&con...
Rust
0
act = logits.argmax(-1) elif self.action_type == "continuous": act = logits[0] else: act = dist.sample() return Batch(logits=logits, act=act, state=h, dist=dist) def learn( # type: ignore self, batch: Batch, batch_size: int, repeat: int, **kwa...
Python
1
# Copyright (c) Facebook, Inc. and its affiliates. from .densepose_uniform import DensePoseUniformSampler from .densepose_confidence_based import DensePoseConfidenceBasedSampler from .densepose_cse_uniform import DensePoseCSEUniformSampler from .densepose_cse_confidence_based import DensePoseCSEConfidenceBasedSampler ...
Python
1
import matplotlib.pyplot as plt import numpy as np mde_5 = [12.86, 14.45, 15.24] mde_10 = [16.06, 16.01, 18.33] mde_15 = [16.67, 16.64, 17.95] pd_5 = [8.76, 5.86, 3.75] pd_10 = [14.75, 10.19, 6.34] pd_15 = [16.28, 12.90, 8.11] x = np.arange(3) x_l = [128, 256, 512] mde = [mde_5, mde_10, mde_15] pd = [pd_5, pd_10, pd_...
Python
1
(f"Pipeline completed in {elapsed_time:.2f} seconds") logger.info(f"Processed {results['samples_processed']} samples") logger.info(f"Accuracy: {results['metrics']['accuracy']:.4f}") logger.info(f"Precision: {results['metrics']['precision']:.4f}") logger.info(f"Recall: {results['metrics']...
Python
1
"""add conditional initialization column Revision ID: 07c7c8ebc195 Revises: 2c70a9e9e131 Create Date: 2022-08-06 12:51:56.767617 """ import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from alembic_db.alembic_post_utils import write_revision_post_alembic from alembic import...
Python
1
vent but got %s' % JythonBasicTests.flag) b1.actionPerformed.append(testAction) JythonBasicTests.flag = 0 b1.doClick() self.assertEquals(JythonBasicTests.flag, 2, 'two actions per event') b1.actionPerformed = testAction JythonBasicTests.flag = 0 b1.doClick() ...
Python
1
1.w; /// /// return Result; /// ``` /// /// Hermite splines are useful for controlling animation because the curve runs through all of the /// control points. Also, because the position and tangent are explicitly specified at the ends of /// each segment, it is easy to create a continuous curve, provided that the start...
Rust
0
close_service_handle(&sc_handle); Err(err) } } } Err(err) => { close_service_handle(&sc_handle); Err(err) } } } <filename>example/src/main.rs #[macro_use] extern crate py_sql; use py_sql::py_sql::PyRuntime; use py_sql::...
Rust
0
rnalState::Inflate(_) => "Decompressor", InternalState::Deflate(_) => "Compressor", }; write!(f, "{}", name) } } pub type MZResult = Result<MZStatus, MZError>; /// Enum to keep track of what type the internal state is when moving over the C API boundary. #[repr(C)] #[derive(Debug, Copy...
Rust
0
ize = Address::LENGTH + (ShortHash::LENGTH * 2) + Self::NONCE_LENGTH; fn nonce_mut(&mut self) -> &mut [u8] { &mut self.data[Self::LENGTH - Self::NONCE_LENGTH..Self::LENGTH] } /// Get an immutable reference to the expanded nonce (e.g. for submission) pub fn nonce(&mut self) -> &[u8] { s...
Rust
0
/// Symbol: SOL /// /// Coin: Solana [501], Solana, "Solana", "https://solana.com", SOL, , ), ( /// Coin type: 502 /// /// Symbol: THT /// /// Coin: ThoughtAI [502], ThoughtAI, "ThoughtAI", "https://github.com/thoughtnetwork/though...
Rust
0
i][i + 1] = bs[i] == bs[i + 1]; if dp[i][i+1] { ret += 1; } } for i in 3..=bs.len() { let limit_j = bs.len() - i; for j in 0..=limit_j { let k = j + i - 1; dp[j][k] = dp[j + 1][k - 1] && bs[j] == bs[k]; if dp[j][k] { ...
Rust
0
""" define generic base classes for pandas objects """ # define abstract base classes to enable isinstance type checking on our # objects def create_pandas_abc_type(name, attr, comp): # https://github.com/python/mypy/issues/1006 # error: 'classmethod' used with a non-method @classmethod # type: ignore ...
Python
1
#coding:utf-8 import requests import urllib3 import sys # ... urllib3.disable_warnings() # sys.path.append(root_path) from lib.core.common import url_handle,get_random_ua from lib.core.poc import POCBase class POC(POCBase): _info = { "version" : "1", "author" : "jijue", "CreateDate" : "2...
Python
1
__all__ = [ 'variavel', ] variavel = 'Alguma coisa' def soma_do_modulo(x,y): return x + y
Python
1
extended by setting SNIPER_SIM_LD_LIBRARY_PATH # - scripts being run inside the simulator (SNIPER_SCRIPT_LD_LIBRARY_PATH): original LD_LIBRARY_PATH # (e.g. mcpat when running powertrace.py) def setup_env(sim_root, pin_home, arch, standalone = False, xed_home = None, torch_home = None): env = dict(os.environ) ld...
Python
1
i32>> = my_slice.into(); let inner = <&SliceAtLeast2Items<i32> as Into<&[i32]>>::into(&*my_slice_arc); assert_eq!(ok_slice, inner); } #[test] fn into_box() { let ok_slice = &[0i32, 1]; let my_slice = SliceAtLeast2Items::new(ok_slice); ...
Rust
0
1.0); color_constant!(YELLOW, 1.0, 1.0, 0.0); color_constant!(MAGENTA, 1.0, 0.0, 1.0); color_constant!(CYAN, 0.0, 1.0, 1.0); color_constant!(WHITE, 1.0, 1.0, 1.0); } pub mod ai; mod checksum; mod collider; mod debug_window; mod dynamic; mod enemy; mod entity_type; mod fixed; mod health; mod hit; mod ke...
Rust
0
# 複製與快取配置定義 # Copy and Cache Configuration Definitions print("[DEBUG-STEP2.2] 載入複製與快取配置定義,配置項數量: 14") # 複製與快取相關的配置項 CACHE_CONFIG = [ # 基本快取設定 { 'key': 'USE_LOCAL_CACHE', 'label': '啟用本地快取', 'help': '讀取網路檔前先複製到本地快取,提高穩定性與速度。', 'type': 'bool', }, { 'key': 'STRICT_N...
Python
1
import sys import unittest from . import unittestsetup from .unittestsetup import environment as environment from oandapyV20 import API access_token = None accountID = None account_cur = None api = None class TestOandapyV20(unittest.TestCase): """Tests regarding the client.""" def setUp(self): """se...
Python
1