text
string
label_name
string
labels
int64
()?; } // rm git artifacts std::fs::remove_dir_all(libs.join(&target_dir).join(".git"))?; Ok(()) } /// installs the dependency as new submodule fn install_as_submodule(dep: &Dependency, libs: &Path, no_commit: bool) -> eyre::Result<()> { // install the dep let target_dir = if let Some(alias) ...
Rust
0
"""Boggle word check. Given a 5x5 boggle board, see if you can find a given word in it. In Boggle, you can start with any letter, then move in any NEWS direction. You can continue to change directions, but you cannot use the exact same tile twice. So, for example:: N C A N E O U I O P Z Q Z O N F A ...
Python
1
# # # Copyright (C) 2006, 2007, 2010, 2011, 2012 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright notice, # this...
Python
1
}) and ({x2},{y2})") # Crop the person from the original frame person_crop = im0[y1:y2, x1:x2] # Save the cropped image filename = os.path.join(cropped_dir, f"person_{obj_id}_frame_{frame_number}.jpg") ...
Python
1
; crate::image_ops::generate_images(&original, ImageKind::Sticker) }) .await?; s3.upload_png_images(MediaLibrary::Web, id, original, resized, thumbnail) .await?; } } Ok(CreatedJson(UrlCreatedResponse { id, kind: kind.t...
Rust
0
ost path :returns: filename of vhost :rtype: str """ # Strip off /files avail_fp = vhost_path[6:] # This can be optimized... while True: # Cast both to lowercase to be case insensitive find_if = avail_fp.lower().find("/ifmodule") if find_if != -1: avail_...
Python
1
, 0xae, 0xa7, 0xe4, 0xba, 0xea, 0xda, 0xe5, 0xba} DEFINE_GUID! {MF_MT_H264_MAX_CODEC_CONFIG_DELAY, 0xf5929986, 0x4c45, 0x4fbb, 0xbb, 0x49, 0x6c, 0xc5, 0x34, 0xd0, 0x5b, 0x9b} DEFINE_GUID! {MF_MT_H264_SUPPORTED_SLICE_MODES, 0xc8be1937, 0x4d64, 0x4549, 0x83, 0x43, 0xa8, 0x8, 0x6c, 0xb, 0xfd, 0xa5} DEFINE_GUID! {MF_MT_H26...
Rust
0
_2:u64 = 2; let salt_2: [u8; 32] = [2u8;32]; let mut current_block:u64 = 100; // start from block 100 run_to_block(current_block); // Create game assert_ok!(RockPaperScissor::new_game(Origin::signed(player_1), player_2)); let game_id = RockPaperScissor::player_game(player_1); let game = RockPaperScis...
Rust
0
::std::os::raw::c_uint, /** \brief Valid when VAConfigAttribRateControl != VA_RC_CQP, then the encoder's * rate control will determine actual delta QPs. Specifies the max/min allowed delta * QPs. */ pub max_delta_qp: ::std::os::raw::c_char, pub min_delta_qp: ::std::os::raw::c_char, /** \br...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- # ************************************************************************** # Copyright © 2016 jianglin # File Name: response.py # Author: jianglin # Email: xiyang0807@gmail.com # Created: 2016-10-25 21:07:00 (CST) # Last Update: Wednesday 2018-07-25 18:54:54 (CST) # ...
Python
1
, "berkeley.edu", "cmu.edu", "ycombinator.com", "eventbrite.com", "meetup.com", "huodongxing.com", "活动行.com", ] ): related_urls.append( ...
Python
1
(&self) -> Byte { 0xC9 } fn execute(&self, _cpu: &mut dyn VirtualCpu) -> std::io::Result<()> { panic!("opcode CMP (Cmp) not implemented!"); // Ok(()) } } /// CmpAbs: CMP absolute pub struct CmpAbs { } impl Instruction for CmpAbs { fn opcode (&self) -> &'static str { "CMP"} fn hexcode(&...
Rust
0
C" { #[doc = " Resumes scheduler activity after it was suspended by a call to"] #[doc = " vTaskSuspendAll()."] #[doc = ""] #[doc = " xTaskResumeAll() only resumes the scheduler. It does not unsuspend tasks"] #[doc = " that were previously suspended by a call to vTaskSuspend()."] #[doc = ""] ...
Rust
0
#!/usr/bin/python import polib import sys class PotFile: def __init__(self): self.msgids = [] self.po = polib.pofile("po/keys.pot") for entry in self.po: self.msgids.append(entry.msgid) self.msgids.sort() po = polib.POFile() po.metadata = { "Project-Id-Version":...
Python
1
on in a .txt file self.export_button = CTkButton(self.main_frame, fg_color=self.backg_color,hover_color='#161206', corner_radius=5 , text='',image=self.export, command=self.export_query) self.export_button.place(relx=0.91, rely=0.05, relwid...
Python
1
"""Test for issue #72 - notes with wikilinks staying in modified status.""" from pathlib import Path import pytest from basic_memory.sync.sync_service import SyncService async def create_test_file(path: Path, content: str) -> None: """Create a test file with given content.""" path.parent.mkdir(parents=True...
Python
1
def tutorial1(): script = """ ## (Enter,datasets) << host = chemml << function = load_cep_homo << return_X_y = True >> smiles 0 ## (Store,file) << host = chemml <<...
Python
1
ld", data.as_ref()); } else { panic!("unexpected: {:?}", res); } } extern crate fbas_analyzer; use fbas_analyzer::*; extern crate csv; extern crate serde; use quicli::prelude::*; use structopt::StructOpt; use csv::{Reader, Writer}; use std::io; use std::error::Error; use std::path::{Path, PathBuf}; ...
Rust
0
# Drakkar-Software OctoBot-Trading # Copyright (c) Drakkar-Software, All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 3.0 of the License, or (...
Python
1
} } // println!("{}", output); let mut grid: Vec<Vec<char>> = output .trim() .lines() .map(|x| x.trim().to_string().chars().collect()) .collect(); let mut part1 = 0; let (mut sx, mut sy) = (0, 0); for x in 1..grid.len() - 1 { for y in 1..grid[0]....
Rust
0
from setuptools import setup, find_packages setup( name="modulens", version="0.1.0", packages=find_packages(), install_requires=[ "openai>=1.3.0", "python-dotenv>=1.0.0", "transformers>=4.36.0", "anthropic>=0.3.11", "colorama>=0.4.6", "prompt-toolkit>=3.0...
Python
1
error here is not serious and can be ignored. conn.batch_execute("select pg_stat_statements_reset()").ok(); } Ok(()) } <filename>src/util/window.rs //! Windowing functions, useful in conjuction with [`StftHelper`][super::StftHelper]. use std::f32; /// A Hann window function. /// /// <https://en.wiki...
Rust
0
let acc = Accountant::new(&mint); let rsp_addr: SocketAddr = "0.0.0.0:0".parse().expect("socket address"); let historian = Historian::new(&mint.last_id(), None); let mut skel = AccountantSkel::new(acc, mint.last_id(), sink(), historian); // Process a batch that includes a transact...
Rust
0
reuse the stores that do not have /// any accounts in it /// status corresponding to the storage, lets us know that /// the append_vec, once maxed out, then emptied, can be reclaimed count_and_status: RwLock<(usize, AccountStorageStatus)>, } impl AccountStorageEntry { pub fn new(path: &str, fork...
Rust
0
ion is needed for ASN.1 functions that rely on system time in // SGX builds (`NO_ASN_TIME` is normally defined for SGX, but we can undefine it if we have // time support). if user_time.is_some() { sgx_defines.push(" #undef NO_ASN_TIME"); } } if features.intersects...
Rust
0
torchvision.models.shufflenetv2.ShuffleNetV2`` base class. Please refer to the `source code <https://github.com/pytorch/vision/blob/main/torchvision/models/shufflenetv2.py>`_ for more details about this class. .. autoclass:: torchvision.models.ShuffleNet_V2_X1_5_Weights ...
Python
1
.ndim == 1 and name.startswith('y_'): df.columns = ['target'] path = os.path.join(data_splits_dir, f"{dataset_name_prefix}_{name}.csv") df.to_csv(path, index=False, encoding='utf-8') console.print(f" [green]✓ Saved {name}[/green] ({dataset_name_prefix}) to [dim]{path}[/dim]") if label_encod...
Python
1
} else { Err(ConversionError::wanted(T::type_name())) } } } impl<T, O> IntoUnchecked<T> for O where T: FromUnchecked<O>, { unsafe fn into_unchecked(self) -> T { T::from_unchecked(self) } } impl<T, O> MaybeInto<T> for O where T: MaybeFrom<O>, { fn maybe_into...
Rust
0
ING_ENABLED: bool = env::var_os("PROFILE_DIR").is_some(); static ref OUTPUT: Mutex<Option<OutputState>> = { let out_directory = if let Some(v) = env::var_os("PROFILE_DIR") { PathBuf::from(v) } else { return Mutex::new(None) }; match fs::create_dir(&out_direc...
Rust
0
name(&self) -> &'static str; /// The identifier of the exceptions. fn id(&self) -> &'static str; /// The exception text. fn text(&self) -> &'static str; /// Says if the exception is deprecated. fn is_deprecated(&self) -> bool; /// The exception comments. fn comments(&self) -> Option...
Rust
0
Result, bail, ErrorKind}, /// graphql_utils::get_auth_data_from_ctx, /// async_graphql::{Object as GQLObject}, /// is_authed, /// }; /// /// #[derive(Default, Clone)] /// pub struct PublishMutation; /// #[GQLObject] /// impl PublishMutation { /// async fn publish( /// &self, /// raw_ctx:...
Rust
0
ished() commit_futures = [[] for _ in range(len(tensorstore_specs))] async def _run_serializer(): future_writer = jax.tree_util.tree_map( async_serialize, arrays, tensorstore_specs, commit_futures) return await asyncio.gather(*future_writer) asyncio.run(_run_serializer()) self....
Python
1
> Vector3D { Vector3D(AiVector3D { x: x, y: y, z: z }) } } impl From<[f32; 3]> for Vector3D { fn from(v: [f32; 3]) -> Vector3D { Vector3D::new(v[0], v[1], v[2]) } } impl Into<[f32; 3]> for Vector3D { fn into(self) -> [f32; 3] { [self.x, self.y, self.z] } } impl From<Point3...
Rust
0
RW { /// 0b0: the module is functional in Stop mode pub const LPUART6_IPG_STOP_MODE_0: u32 = 0b0; /// 0b1: the module is NOT functional in Stop mode, when this bit is equal to 1 and ipg_stop is asserted pub const LPUART6_IPG_STOP_MODE_1: u32 = 0b1; } } ...
Rust
0
::{AlgorithmIdentifier, DigestInfo, SHAVariant}; use pkcs11::errors::Error; use pkcs11::types::*; use pkcs11::types::{CKF_RW_SESSION, CKF_SERIAL_SESSION, CKU_USER}; use std::convert::{TryFrom, TryInto}; use std::pin::Pin; use zeroize::Zeroize; // Public exponent value for all RSA keys. const PUBLIC_EXPONENT: [u8; 3] =...
Rust
0
, help and then try again ... self.map.participate_in_migration(); if let Some(new_cell) = self.map.find(&key, self.hash) { self.cell = new_cell; } else { // Migration caused removal of cell: return None; ...
Rust
0
# Flowshutter # Copyright (C) 2021 Hugo Chiang # Flowshutter 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, either version 3 of the License, or # (at your option) any later version. # Flowshutter is...
Python
1
}; } /// Create a [`String`] array argument. /// # Example /// ``` /// # let ctx = nsi::Context::new(&[]).unwrap(); /// // One of these is not an actor: /// ctx.set_attribute( /// "dummy", /// &[nsi::strings!( /// "actors", /// &["<NAME>", "<NAME>", "R<NAME>"] /// )], /// ); /// ``` #[...
Rust
0
# ————— SERIAL CONFIGURATION ————— PORT = "COM4" #serial port BAUD = 9600 TIMEOUT = 1 # ————— VISUALIZATION SETTINGS ————— REFRESH_RATE = 60 #Hz WINDOW_WIDTH = 1000 WINDOW_HEIGHT = 700 # ————— IMU BOX DIMENSIONS ————— BOX_LENGTH = 2 BOX_HEIGHT = 0.3 BOX_WIDTH = 1 # ————— PARTICLE SYSTEM SETTINGS ————— MAX_PA...
Python
1
() { return -1; } // If we need more good peers, only allow good peers unless allowBadPeers is true. if self.needs_good_peers() && (!self.is_good_peer(peer_address) && !allow_bad_peers) { return -1; } ...
Rust
0
u3_3 = self.relu3_3(relu3_2) relu4_1 = self.relu4_1(relu3_3) relu4_2 = self.relu4_2(relu4_1) relu4_3 = self.relu4_3(relu4_2) relu5_1 = self.relu5_1(relu4_3) relu5_2 = self.relu5_2(relu5_1) relu5_3 = self.relu5_3(relu5_2) out = { 'relu1_1': relu1_1, ...
Python
1
del") assert isinstance(evaluator, BaseEvaluator) assert evaluator.metric_config == eval_manager.metric_config def test_save_and_load_model(self, eval_manager, rf_regressor, tmpdir): filename = tmpdir.join("saved_model") eval_manager.output_dir = tmpdir with ( p...
Python
1
ict reduce(merge, [column_dict] + logs) if len(editable_columns)>0: _dict = expand_dict([editable_columns], connector='-')[0] merge(column_dict, _dict, use_b=False) remove_exclude(column_dict, exclude_columns) column_keys = [key for key in column_dict.keys()] first_column_keys = [] ...
Python
1
2::new(rot.clone()) * *t } #[inline] fn prepend_rotation(&mut self, rot: &Vec1<N>) { *self = Rotation::prepend_rotation_cpy(self, rot) } #[inline] fn prepend_rotation_cpy(t: &Rot2<N>, rot: &Vec1<N>) -> Rot2<N> { *t * Rot2::new(rot.clone()) } #[inline] fn set_rotati...
Rust
0
Error> + From<<STATE::Revealed as StrictEncode>::Error> + From<<STATE::Revealed as StrictDecode>::Error>, { type Error = Error; fn strict_decode<D: io::Read>(mut d: D) -> Result<Self, Self::Error> { let format = u8::strict_decode(&mut d)?; Ok(match fo...
Rust
0
unwrap(), ); let expects = ["こんにちは世界、", "こんにちは世界"]; for (i, line) in line_breaker.lines.iter().enumerate() { if expects[i] != &text[line.clone()] { panic!("expect '{}', but got '{}'", expects[i], &text[line.clone()]); } } } } <filename>game_p...
Rust
0
x69,0x6e,0x76,0x61,0x6c, 0x69,0x64,0x20,0x73,0x74,0x61,0x72,0x74,0x75,0x70,0x20,0x70,0x61,0x63,0x6b,0x65, 0x74,0x20,0x6c,0x61,0x79,0x6f,0x75,0x74,0x3a,0x20,0x65,0x78,0x70,0x65,0x63,0x74, 0x65,0x64,0x20,0x74,0x65,0x72,0x6d,0x69,0x6e,0x61,0x74,0x6f,0x72,0x20,0x61,0x73, 0x20...
Rust
0
parse the input. If an unexpected end of file error occurs, continue /// the input in a new line. Otherwise, accept and end the input. //TODO: the validator throws away the result of parsing, or the parse error, when accepting an //input, meaning that the work is done a second time by the REPL. Validator's work coul...
Rust
0
from allauth.socialaccount import app_settings from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class SpotifyAccount(ProviderAccount): def get_profile_url(self): return self.account.extra_data.get("external_urls").g...
Python
1
None, super::from_libusb(device_descriptor!(iSerialNumber: 0)).serial_number_string_index() ); } #[test] fn it_has_class_code() { assert_eq!( 42, super::from_libusb(device_descriptor!(bDeviceClass: 42)).class_code() ); } #[test]...
Rust
0
match a { 10 => println!("It is ten"), _ => {} //println!("It is not ten") } } <reponame>natsukagami/flume use std::time::{Instant, Duration}; use flume::*; #[test] fn send_recv() { let (tx, rx) = unbounded(); for i in 0..1000 { tx.send(i).unwrap(); } for i in 0..1000 { assert_eq!(rx.try_recv().unw...
Rust
0
=> RetryState::WaitingDelay { delay: policy.force_retry_after(), policy: Some(policy), }, }, None => return this.running_futs.poll(cx), }, }; self.as_mut().pro...
Rust
0
Sim1 = numpy.reshape(Sim, (Sim.shape[0]*Sim.shape[1], 1)) plt.hist(Sim1) plt.show() fo = open(csvFile + "_simMatrix", "wb") pickle.dump(fileNames, fo, protocol = pickle.HIGHEST_PROTOCOL) pickle.dump(f, fo, protocol = pickle.HIGHEST_PROTOCOL) pickle.dump(Sim, fo, protocol = pickle.HIGHEST_P...
Python
1
{2AF7}\u{2207}")); (" " => Whitespace); // Sk ("\u{005E}\u{02E5}\u{FBB2}\u{1F612}\u{1F3FB}" => Identifier("\u{005E}\u{02E5}\u{FBB2}\u{1F612}\u{1F3FB}")); (" " => Whitespace); // So ("\u{00A9}\u{06DE}\u{0BF5}\u{0F16}" => Identifier("\u{00A9}\u{06DE}\u{0BF5}\u{0F16}")); ...
Rust
0
chain.at(1).into()); pool.insert_verified(chain.at(2).into()); pool.insert_verified(chain.at(3).into()); assert_eq!(pool.information().transactions_count, 4); assert_eq!(pool.remove_by_prevout(&OutPoint { hash: chain.hash(0), index: 0 }), Some(vec![chain.at(1).into(), chain.at(2).into()])); assert_eq!(pool.i...
Rust
0
WebSvcLimitsEntry, "cfprApCommWebSvcLimitsInstanceId": cfprApCommWebSvcLimitsInstanceId, "cfprApCommWebSvcLimitsDn": cfprApCommWebSvcLimitsDn, "cfprApCommWebSvcLimitsRn": cfprApCommWebSvcLimitsRn, "cfprApCommWebSvcLimitsDescr": cfprApCommWebSvcLimitsDescr, "cfprApCommWebSvcLimitsIntId...
Python
1
al| decode_header::<Connection>(val)) .and_then(|conn| some(conn.contains("upgrade"))) .and_then(|_| hdrs.get(header::UPGRADE)) .and_then(|val| val.to_str().ok()) .and_then(|val| some(val == "websocket")) .and_then(|_| hdrs.get(header::SEC_WEBSOCKET_VERSION)) .and_then(|v...
Rust
0
ope:tensorboard.FunctionDef) )) _sym_db.RegisterMessage(FunctionDef) _sym_db.RegisterMessage(FunctionDef.AttrEntry) _sym_db.RegisterMessage(FunctionDef.RetEntry) _sym_db.RegisterMessage(FunctionDef.ControlRetEntry) GradientDef = _reflection.GeneratedProtocolMessageType('GradientDef', (_message.Message,), dict( DES...
Python
1
er.error(f" ❌ {garbage_type} 分拣失败") # 短暂休息 time.sleep(1) # 归位 logger.info("🏠 最终归位...") arm.home() logger.info("✅ uArm 机械臂垃圾分拣测试完成!") return True except Exception as e: logger.error(f"❌ 测试过程中发生错误: {e}") ...
Python
1
::Color; use crate::probe::Log; use crate::probe::Probe; use crate::utils::de_from_str; /// Drone OS command line utility. #[derive(Debug, StructOpt)] pub struct Cli { /// Pass many times for more log output #[structopt(long, short, parse(from_occurrences))] pub verbosity: u64, /// Coloring: auto, alwa...
Rust
0
(&cx)?; let expr = params.get_external::<Expr>(&cx, "_expr")?; let pat = params.get_as::<String>("pat")?; let function = move |s: Series| { let ca = s.utf8()?; match ca.contains(&pat) { Ok(ca) => Ok(ca.into_series()), Err(e) => Err(PolarsError::ComputeError(format!("...
Rust
0
Measurement> = format.read(file).unwrap(); assert_eq!(measurements.len(), 9); } use std::collections::HashSet; use super::Coordinate; use super::Solver; use super::Status; // (row, column, value) #[derive(Clone, Debug, Copy, Hash, PartialEq, Eq)] pub struct Triple (usize, usize, u8); // Solver methods based on ma...
Rust
0
Ok((domain, hostv)) } pub fn set_fd_close_exec(fd: RawFd) -> Result<RawFd> { if let Err(e) = fcntl(fd, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC)) { return Err(Error::Others(format!( "failed to set fd: {} as close-on-exec: {}", fd, e ))); } Ok(fd) } // SOCK_CLOEXEC flag...
Rust
0
for (a, b, d) in a.iter_mut() { let a = unsafe { a.as_mut() }; let b = unsafe { b.as_mut() }; func(a, b, d) } } } } impl<'a, T: Send + Sync, D: Send + Sync> BotCollisionPar<'a, T, D> { pub fn for_every_pair_mut_par<'b, A: Axis, N: Num>( ...
Rust
0
#!/usr/bin/env python3 """ 성광교회 샘플 데이터 생성 스크립트 """ import os import sys from datetime import datetime, timedelta, date import random from pathlib import Path # 프로젝트 루트 디렉토리를 Python 경로에 추가 sys.path.insert(0, str(Path(__file__).parent)) from sqlalchemy.orm import Session from app.db.session import SessionLocal, engine...
Python
1
import numpy as np import pytest from sklearn.model_selection import train_test_split from sklearn.utils.estimator_checks import parametrize_with_checks from sklego.preprocessing import RandomAdder @parametrize_with_checks([RandomAdder()]) def test_sklearn_compatible_estimator(estimator, check): if check.func.__...
Python
1
in the [`StatisticsLogger`] and //! an instance of your structure, and it will be logged according to the Logger's associated Drain //! as usual. //! Structure parameters will be added as key-value pairs, but with the bonus that you get //! type checking. //! //! You can continue to make developer logs simply using `s...
Rust
0
# Importing required modules: import sys from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtWebEngineWidgets import* #Functions definition and creation of classes: class MainWindow(QMainWindow): def __init__(self): super(MainWindow,self).__init__() self.browser = QWebEngineView() ...
Python
1
ONITOR_P: u8 = 20; const CTRL_TYPE_MONITOR_P_EXIT: u8 = 21; const TAG_PASS_THROUGH: u8 = 112; /// Message. /// /// This provides various message construction functions. #[allow(missing_docs)] #[derive(Debug, Clone, PartialEq)] pub enum Message { Link(Link), Send(Send), Exit(Exit), Unlink(Unlink), ...
Rust
0
placement).unwrap(); write_csv(&modified_data, &output_filename).unwrap(); } <reponame>mxj4/deno_lint // Copyright 2020-2021 the Deno authors. All rights reserved. MIT license. use super::{Context, LintRule, ProgramRef, DUMMY_NODE}; use derive_more::Display; use swc_ecmascript::ast::TsInterfaceDecl; use swc_ecmascr...
Rust
0
to a media group. pub async fn purge_media_group( conn: &sqlx::Pool<sqlx::Postgres>, media_group_id: &str, ) -> anyhow::Result<()> { sqlx::query!( "DELETE FROM media_group WHERE media_group_id = $1", media_group_id ) .execute(conn) .await?;...
Rust
0
().dest(graphics::mint::Point2 { x: self.pos.x, y: self.pos.y}).color(color)).expect("Failed to draw text"); Ok(()) } } // Copyright 2021 Contributors to the Parsec project. // SPDX-License-Identifier: Apache-2.0 //! Object management functions use crate::error::{Result, Rv, RvError}; use crate::object::{...
Rust
0
""" 八字命理分析工具模块。 """ from .manager import get_bazi_manager __all__ = ["get_bazi_manager"]
Python
1
string") # First make sure that none of the IDs are numbers: for n in self.graph.nodes(): if isinstance(n, (int, float)): raise ValueError( "DotMotif does not support haystack graphs with numerical IDs. " + "Not all executors can opera...
Python
1
otice not the same" ); assert_eq!( a.game_name_domestic, b.game_name_domestic, "Game Name Domestic not the same" ); assert_eq!( a.game_name_overseas, b.game_name_overseas, "Game Name overseas not the same" ); assert_eq!( ...
Rust
0
eline), \ f'Expected PyTorch score to be equal to MATLAB prediction. Got {score} and {score_baseline}' assert torch.isclose(score_chromatic, score_baseline_chromatic, atol=1e-4), \ 'Expected PyTorch chromatic score to be equal to MATLAB prediction.' \ f'Got {score_chromatic} and {score_basel...
Python
1
_string(); // Check if AWS access keys are set in environment if matches.is_present(arg::DRY_RUN) { AwsSesClient::get_credentials(&provider).context( "Missing environment variable 'AWS_ACCESS_KEY_ID' and/or 'AWS_SECRET_ACCESS_KEY'", )?; } let cli...
Rust
0
//! stable and may subject to changes. //! An alternative approach is to use _defunctionalization_ to encode //! regular Rust types to have kinds other than `Type`. [TypeApp] //! is one such trait for encoding types of kind `Type -> Type`. //! //! To promote a type constructor such as [Vec] to HKT, we define a //! prox...
Rust
0
engine == 'BLENDER_EEVEE_NEXT': # Cycles and Eevee uses the same nodes engine = 'CYCLES' elif engine == 'octane': engine = engine.upper() else: print("Material Utilities - Add image Textures: Unsupported render engine: ", bpy.data.scenes['Scene'].render.engine) ...
Python
1
quantidade = int(input('Quantos números você deseja calcular? ')) lim = 1 cont = 0 listaPar = [] listaImpar = [] while lim <=quantidade: num = int(input(f'[{cont}/{quantidade}] Insira um número: ')) lim += 1 cont += 1 if num % 2 != 0: listaImpar.append(num) else: listaPar.append(num...
Python
1
, handle: *mut rocksdb_column_family_handle_t, key: *const c_char, expected: *const c_char, ) { let mut err: *mut c_char = ptr::null_mut(); let mut val_len: size_t = 0; let mut val: *mut c_char = rocksdb_get_cf( db, options, handle, key, strlen(key), ...
Rust
0
} else if ia < ib || (ia == ib && jb > ja) { self.current_b = self.matrix_b.next(); Some((ib, jb, F::zero())) // rhs is ahed => advance lhs // } else if ja > jb || (ja==jb && ia > ib) { } else if ia > ib || (ia == ib...
Rust
0
import torch import torch.nn as nn from torch.utils.model_zoo import tqdm from data import TrainDataset, ValidDataset, get_train_transforms, get_valid_transforms import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn.metrics import roc_curve, precision_recall_curve, auc def test_anomaly_det...
Python
1
let res = Self(counter * (total_buckets as u64) + (desired_bucket as u64)); assert_eq!(desired_bucket, res.get_bucket(total_buckets)); res } } pub struct ZobristHasher { square: [[[ZobristHash; 64]; NUM_PIECES]; 2], black_to_move: ZobristHash, castle_kside: [ZobristHash; 2], castle_qside: [ZobristHas...
Rust
0
x00\xE1".into(), "Validation Authority Country"), (b"\x42\x00\xE2".into(), "Validation Authority URI"), (b"\x42\x00\xE3".into(), "Validation Version Major"), (b"\x42\x00\xE4".into(), "Validation Version Minor"), (b"\x42\x00\xE5".into(), "Validation Type"), (b"\x42\x00\xE6".into()...
Rust
0
@TryExcept() @plt_settings() def plot_labels(boxes, cls, names=(), save_dir=Path(''), on_plot=None): """Plot training labels including class histograms and box statistics.""" import pandas import seaborn warnings.filterwarnings('ignore', category=UserWarning, message= 'The figure layout has chan...
Python
1
# -*- coding: utf-8 -*- """ VASデータリポジトリモジュール VAS健康・パフォーマンスデータのデータアクセスを提供します。 """ from typing import List, Dict, Any, Optional, Tuple, Union from datetime import datetime, date, timedelta from sqlalchemy.orm import Session from sqlalchemy import func, and_, or_, desc, extract from ..models_sql import VASHealthPerformanc...
Python
1
Some(s) => { check_single_artist_given(s); }, None => { check_single_artist_least_recent(); } } } print_missing_releases(); } fn print_usage(program: &str, opts: Options) { let brief = format!("Usage: {} [options]", ...
Rust
0
"Week 1 2 Events", "Week 2 1 Events", "Week 3 1 Events", "Week 4 1 Events", ] @freeze_time("2019-03-09") def test_district_details_render_active_teams( web_client: Client, ndb_stub, setup_full_event ) -> None: helpers.preseed_district("2019ne") setup_full_event("2019ctwat...
Python
1
------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'django-oscar-invoices', 'django-oscar-invoices Documentation', [author], 1) ] # -- Options for Texinfo output ---------------------------------------------- # G...
Python
1
import uuid from typing import Callable from redis.asyncio import Redis from src.auth import utils, exceptions from src.auth.schemas import RefreshToken from src.config import settings async def login( user_id: int | str | uuid.UUID, client: Redis, name_generator: Callable, ): _id = str(user_id) ...
Python
1
from llama_index.core.multi_modal_llms.generic_utils import load_image_urls from llama_index.multi_modal_llms.openai import OpenAIMultiModal from llama_index.multi_modal_llms.openai.utils import ( generate_openai_multi_modal_chat_message, ) from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanE...
Python
1
; #[doc = "EXTICR4 register accessor: an alias for `Reg<EXTICR4_SPEC>`"] pub type EXTICR4 = crate::Reg<exticr4::EXTICR4_SPEC>; #[doc = "external interrupt configuration register 4"] pub mod exticr4; #[doc = "CMPCR register accessor: an alias for `Reg<CMPCR_SPEC>`"] pub type CMPCR = crate::Reg<cmpcr::CMPCR_SPEC>; #[doc ...
Rust
0
([3, 0, 999, 2, 6, 10], dtype=np.int64)) stops = ak.index.Index64(np.array([7, 3, 999, 4, 6, 12], dtype=np.int64)) one = ak.highlevel.Array(ak.contents.ListArray(starts, stops, content)) two = ak.highlevel.Array( [[100, 100, 100, 100], [200, 200, 200], [], [300, 300], [], [400, 400]] ) asser...
Python
1
# Copyright (c) OpenMMLab. All rights reserved. from .bbox import (bbox_cs2xywh, bbox_cs2xyxy, bbox_xywh2cs, bbox_xywh2xyxy, bbox_xyxy2cs, bbox_xyxy2xywh, flip_bbox, get_udp_warp_matrix, get_warp_matrix) from .keypoint import flip_keypoints from .multilevel_pixel_data import Multil...
Python
1
msd(coor_lig1, coor_lig2), atomnum def main(): import argparse parser = argparse.ArgumentParser( description="Calculate the RMSD between two ligands.") parser.add_argument("-l1", "--ligfile1", required=True, help="the pdb file of the first ligand") parser.add_argument("-l2", "--ligfile...
Python
1
BooleanNetwork::try_from_sbml(model.as_str()).unwrap(); assert_eq!(actual.graph.num_vars(), 41); assert_eq!(layout.len(), 0); } // cargo test --package biodivine-lib-param-bn --lib sbml::import::tests::diff_test -- --nocapture #[test] fn diff_test() { let benchmarks = std::fs::...
Rust
0
import tkinter as tk # Function to handle button click def button_click(event): global expression text = event.widget.cget("text") # Get the text of the clicked button if text == "=": try: result = eval(expression) # Evaluate the expression input_var.set(result) # Disp...
Python
1
import os import shutil import subprocess from pathlib import Path from subprocess import PIPE, Popen from cli.src.Config import Config from cli.src.helpers.data_loader import BASE_DIR from cli.src.Log import Log, LogPipe SPEC_TESTS_PATH = Path(BASE_DIR).resolve() / 'tests' / 'spec' class SpecCommand: def __init...
Python
1
# Copyright (c) 2023, NVIDIA CORPORATION. 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 appli...
Python
1