text
string
label_name
string
labels
int64
t_name("SunriseOS System"); // Set the start of the partition at the first LBA availaible. main_partition.first_lba = 34; // Set the last LBA just before the backup GPT main_partition.last_lba = sector_count - 34; partition_table.push(main_partition); // By standard, ...
Rust
0
#!/usr/bin/env python3 """ Badminton Booker - Entry point for the badminton court booking application. """ import asyncio import sys from badminton_booker.cli.commands import parse_args from badminton_booker.booking.courts import check_available_courts from badminton_booker.notification.telegram import notify_about_re...
Python
1
eg, dp3_out_seg, dp4_out_seg class UNet_DS(nn.Module): def __init__(self, in_chns, class_num): super(UNet_DS, self).__init__() params = {'in_chns': in_chns, 'feature_chns': [16, 32, 64, 128, 256], 'dropout': [0.05, 0.1, 0.2, 0.3, 0.5], 'class_...
Python
1
info.planes[0]; let mut mapping = mmap(&fd, plane.mem_offset, plane.length).expect("Failed to map output buffer"); frame_gen .next_frame(&mut mapping) .expect("Failed to generate frame"); let out_qbuf = QBuffer...
Rust
0
import mysql.connector conexao = mysql.connector.connect(user='root', password='ceub123456', host='127.0.0.1', database='db_loja') print('Conexão estabelecida:', conexao) cursor = conexao.cursor() prod_name = inp...
Python
1
import heapq def dijkstra(graph, start, end): queue = [(0, start, [])] seen = set() while queue: (cost, node, path) = heapq.heappop(queue) if node not in seen: seen.add(node) path = path + [node] if node == end: return (cost, path) ...
Python
1
al-net.onnx").unwrap()).unwrap(), naive_bayes: NaiveBayes::new(File::open("model/naive-bayes.npz").unwrap()).unwrap(), general_tags: read_list("model/general-tags.txt").unwrap(), character_tags: read_list("model/character-tags.txt").unwrap(), topk: 20, }; let classifier = Classif...
Rust
0
if not agrupamento_temporario.adicionar_carta(carta): return False # Se todas as cartas podem ser adicionadas, aplica as mudanças for carta in self.selecionadas: self.agrupamento_selecionado.adicionar_carta(carta) if carta in self.mao: se...
Python
1
COUNT: usize = 101; pub const INITIALIZED_BYTES: usize = 1; pub const NONCE_BYTES: usize = 1; pub const SLOT_BYTES: usize = 8; pub const EPOCH_BYTES: usize = 8; pub const DIFFICULTY_BYTES: usize = 1; pub const LAMPORTS_BYTES:usize = 8; pub const PRICE_BYTES:usize = 8; pub const REMAIN_BYTES:usize = 8; pub const COUNT_...
Rust
0
utput(id="test-resource") ) yield mock_command finally: for p in patches.values(): p.stop() for f in reset_cache or []: f.cache_clear() if mock_command.manageable_users: mock_command.manageable_users.cache_clear() @contextlib.context...
Python
1
class Estudiante: def __init__(self, nombre, edad, grado): self.nombre = nombre self.edad = edad self.grado = grado def estudiar(self): print('estudiando...') nombre = input('Ingrese el nombre: ') edad = input('Ingrese la edad: ') grado = input('Ingrese el grado...
Python
1
: print("❌ 未找到封面图片文件") return False # 修复封面图片项的属性 cover_item.set('properties', 'cover-image') print(f"✅ 设置封面图片属性: {cover_item.get('href')}") # 查找metadata元素 metadata = root.find('.//opf:metadata', namespaces) if metadata is ...
Python
1
racted.is_ok()); let extracted = extracted.unwrap(); assert_eq!("Haha ", &extracted.body) } #[test] fn test_extract8() { let content = "<div><b>Haha</b> <i>Wololo</k>Again</div>"; let extractor = ContentExtractor::new(); let extracted = extractor.extract(content); assert!(extracted.is_ok()); ...
Rust
0
ata/1004916019.dat") .with_stdout_empty() .run()?; CommandBuilder::new("filter") .arg("003@.0 != '1004916019'") .arg("tests/data/119232022.dat") .with_stdout(SAMPLE2) .run()?; Ok(()) } #[test] fn filter_regex() -> MatchResult { CommandBuilder::new("filter")...
Rust
0
[`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/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [doep0_ctl](doep0_ctl) module"] p...
Rust
0
sion", }, ] return http_options @staticmethod def _get_transcoded_request(http_options, request): pb_request = permission_service.UpdatePermissionRequest.pb(request) transcoded_request = path_template.transcode(http_options, pb_request) ...
Python
1
n[1] / (node_density - 1))) node_coords.append(coord) f.write("v %.4f %.4f %.4f\n" % coord) for tri in faces: f.write("f %d %d %d\n" % tri) f.close() if gen_fixed_anchors: # pinned nodes are from (1, 1) to (node_density-1, 1) node_y = np.ar...
Python
1
''' https://leetcode.com/problems/subsets/description/?envType=study-plan-v2&envId=top-100-liked 78. Subsets Given an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order. Example 1: Input: nums ...
Python
1
push(token.clone()); false } else { true } }); } } } pub fn tokenize( context: ParserContextRef, matcher: MatcherRef, ) -> Result<TokenRef, MatcherFailure> { //context.borrow().capture_matcher_references(matcher.clone()); let scope =...
Rust
0
import torch class DodgeAndBurn: def __init__(self): pass @classmethod def INPUT_TYPES(s): return { "required": { "image": ("IMAGE",), "mask": ("IMAGE",), "intensity": ("FLOAT", { "default": 0.5, ...
Python
1
import mysql.connector #Conectar con la BD en MySQL try: conexion=mysql.connector.connect( host='localhost', user='root', password='', database='bd_notas' ) #Crear un objeto de tipo cursor que permita reutilizar el objeto cursor=conexion.cursor(buffered=True) except Exception as e: print("O...
Python
1
on. - running updates in a tight loop (without the bevy runtime) yields much better performance than calling update once in Sims::update (~ 14 ns per cell vs 22 ns). this could be related to cache eviction, as running multiple iterations in Sims::update approaches the lower bound ...
Rust
0
r() { sum = sum.wrapping_add(*val) } if sum != 0 { return Err("ACPI table checksum mismatch"); } Ok((header, &payload[core::mem::size_of::<AcpiStandardHeader>()..])) } /// Attempts to allocate physical `size` bytes with `align` alignment on /// `node_id` /// /// This is not thread safe. pub unsaf...
Rust
0
) -> Result<(), Error> { let ServerConfig { addr, root_dir, num_file_threads, .. } = config; // Create HTTP service, passing the document root directory and the // thread pool used for executing the file reading I/O on. let server = Http::new().bind(&addr, move || { Ok(HttpService {...
Rust
0
import cv2 input_video = r"C:\Users\LENOVO\Desktop\spermchannelvid.mp4" # Correct path, raw string output_video = "cropped_video_3min.avi" # Used .avi for XVID codec was having challenges with .mp4 # Crop coords (x, y, w, h) x, y, w, h = 2558, 1466, 1240, 446 cap = cv2.VideoCapture(input_video) fps = cap.g...
Python
1
= b'Z'; fn encode(&self, dst: &mut BytesMut) { dst.put_u8(b'I'); } } #[derive(Debug)] pub struct ParseComplete; impl BackendMessage for ParseComplete { const TAG: u8 = b'1'; fn encode(&self, _dst: &mut BytesMut) {} } #[derive(Debug)] pub struct BindComplete; impl BackendMessage for BindCo...
Rust
0
Eq, ::prost::Message)] pub struct GetProjectDatasetsResponse { #[prost(message, repeated, tag = "1")] pub dataset: ::prost::alloc::vec::Vec<super::super::models::v1::Dataset>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetUserProjectsRequest {} #[derive(Clone, PartialEq, ::prost::Message)] pub s...
Rust
0
_rebate_eligible) self.modify_parameters(modify_parameters) return reform def create_american_worker_rebate_act_reform( parameters, period, bypass: bool = False ): if bypass: return create_american_worker_rebate_act() p = parameters.gov.contrib.congress.hawley.awra reform_ac...
Python
1
Df[longMaNames], diffLong=True) if not DyST_AbnormalVolatility.longMaDays[0] <= longDayNbr <= DyST_AbnormalVolatility.longMaDays[1]: progress.update() continue if (df['close'][-longDayNbr:] < maDf[centralMaName][-longDayNbr:]).sum() > 0: progress....
Python
1
SrSSKJr SSKrSSKJrJrJrJr SSK J r J r SSK J r /SQr\"S 5r\"S 5r\"S 5r\ "S 5r\"S 5r\"S5r\"S5r\ "S5r\SSj5r\SSj5r\ "\R....
Python
1
/// /// // Print whenever a CTRL-C event is received. /// for countdown in (0..3).rev() { /// stream.recv().await; /// println!("got CTRL-C. {} more to exit", countdown); /// } /// /// Ok(()) /// } /// ``` pub fn ctrl_c() -> io::Result<CtrlC> { Event::new(CTRL_C_EVENT).map(|inner| Ct...
Rust
0
"cur_epoch": epoch, "accuracy": accuracy, # "scheduler": scheduler.state_dict() } cm = confusion_matrix(all_labels, all_predictions) plot_confusion_matrix(class_names=["Airplane", "Automobile", "Bird", "Cat", "Deer", "Dog", "Frog", "Horse", "Ship", "Truck"], writ...
Python
1
20 => Self::GenericParamConstraint(db.generic_param_constraint().row(code.1)), 21 => Self::MethodSpec(db.method_spec().row(code.1)), _ => return Err(ParseError::InvalidData("Invalid HasCustomAttribute code")), }) } pub fn encode(&self) -> u32 { match &self { ...
Rust
0
xy_pair in tqdm(total_dataloader["train"]): x = xy_pair[0]; x=x.cuda(non_blocking=True).float() y = xy_pair[1]; y=y.cuda(non_blocking=True).float() mask = xy_pair[2]; mask=mask.cuda(non_blocking=True).float() ssl = ssl_model(x, attention_mask=mask).last_hidden_state # (B, T, 10...
Python
1
char, l: usize); } extern "C" { /// <https://www.lua.org/manual/5.1/manual.html#lua_pushstring> pub fn lua_pushstring(L: *mut lua_State, s: *const libc::c_char); } extern "C" { /// <https://www.lua.org/manual/5.1/manual.html#lua_pushvfstring> pub fn lua_pushvfstring( L: *mut lua_State, f...
Rust
0
j = ExpOnlyJacobian() self.assertAllClose( -np.log(x), self.evaluate(bij.inverse_log_det_jacobian(x, event_ndims=0))) self.assertAllClose( np.sum(-np.log(x), axis=-1), self.evaluate(bij.inverse_log_det_jacobian(x, event_ndims=1))) self.assertAllClose( np.sum(-np.log(x...
Python
1
import os import subprocess import threading import keyboard from dotenv import load_dotenv # Tải biến môi trường từ file .env load_dotenv() # Lấy các đường dẫn RTSP từ biến môi trường rtsp_urls = [ os.getenv('RTSP_URL_CAMERA_1'), os.getenv('RTSP_URL_CAMERA_2'), os.getenv('RTSP_URL_CAMERA_3'), os.gete...
Python
1
.or_insert({ let mut load = Load::new(); load.update(reading.packet_count, reading.byte_count); load }); } } } } } #[async_trait] impl<E, C> P4app<E, C> for Stati...
Rust
0
("PSLINK_EMPTY_FORWARD_URL") .default_value("https://github.com/enaut/pslink") .global(true), ) .arg( Arg::with_name("brand_name") .long("brand-name") .short("b") .help("The brand name that will appear in various...
Rust
0
while True: # Request user inputs days after invoice due date #days_after_due_date=input("\nPlease insert payment days after invoice due date:\n ") # Logical error! # Please use int(input("")) to convert a variable to an integer [whole number] try: days_after_due_date=int(input("\nPlease insert payment days ...
Python
1
), 1); } // println!("WriteToSocket, shutdown socket"); *sockInfo.status.lock() = SockStatus::FIN_READ_FROM_BUFFER; } } break; } let cnt = unsafe { libc::w...
Rust
0
Operator{}); } let mut _rewardPoolDistributed = rewardPoolDistributed.load(deps.storage)?; if _rewardPoolDistributed { return Err(ContractError::DoubleDistrubute{}) } _rewardPoolDistributed = true; rewardPoolDistributed.save(deps.storage, &_rewardPoolDistributed); let config_storage...
Rust
0
{ ensure, Fallible, }; use std::mem; use super::{ unwrap::*, Context, }; use crate::{ command::Absorb, io, types::{ AbsorbFallback, Fallback, NTrytes, Size, Trint3, Trytes, }, }; use iota_streams_core::{ sponge::prp::PRP, tbits::{ ...
Rust
0
import pygame import random def main(): try: pygame.init() # You can draw the mole with this snippet: screen = pygame.display.set_mode((640, 512)) clock = pygame.time.Clock() mole_image = pygame.image.load("mole.png") x, y = 0,0 running = Tr...
Python
1
from .mano import MANO_HANDS_REORDER_KEYPOINTS # mediapipe pose convention defined in # https://google.github.io/mediapipe/solutions/pose.html MP_BODY_KEYPOINTS = [ 'nose', 'left_eye_4', 'left_eye', 'left_eye_1', 'right_eye_4', 'right_eye', 'right_eye_1', 'left_ear', 'right_ear', ...
Python
1
self.cls_loss_ignore_index] = self.category_name_to_id['freespace_yes'] if gt_lidardet_veh_mask is not None: freespace_veh_bdry_mask = get_boundary_mask( gt_lidardet_veh_mask, padding=self.boundary_winsize_half // 2, boundary_type="fre...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.construct import init class CombinedCreateTalentResponseBody(object): _types = { "talent_id": str, "creator_id": str, "creator_account_type": int, } ...
Python
1
_rgb = np.zeros((local_pred_mask.shape[0], local_pred_mask.shape[1], 3)) for class_id, color in color_map.items(): mask = (masks.squeeze(0).cpu().numpy() == class_id) for c in range(3): label_rgb[..., c][mask] = color[c] axes[0, 2].imshow(labe...
Python
1
eToIndex = (); type AccountData = pallet_balances::AccountData<u64>; type OnNewAccount = (); type OnKilledAccount = (); type SystemWeightInfo = (); } parameter_types! { pub const ExistentialDeposit: u64 = 1; } impl pallet_balances::Trait for Test { type Balance = u64; type Event = (); type DustRemov...
Rust
0
#coding : utf-8 from lib.core.common import url_handle # import re class POCBase(object): def __init__(self,target,proxy = None): self.target = target[:-1] if target.endswith("/") else target if "://" in self.target and self.target.count(":") == 2: pass elif "://" not in self...
Python
1
74e-1, -1.96438025e-3], [7.60183957e-1, -3.19555773e-4], [1.14394814e+0, -2.59465092e-5], [1.52771232e+0, -7.64460007e-7], [1.91147650e+0, -5.14623201e-9], [2.29524069e+0, -6.34525765e-12], [2.67900487e+0, -2.38919995e-12], [3.06276905e+0, -2.43594034e-12], ]}, CDF {coeff: 1.77965504e+0, power: 1.0/3.0,...
Rust
0
]; 3] { // 'token-tanistry' prefix ensures uniqueness of the PDA // Note: Only the current token account owner can create an account with this PDA using CreateTokenTanistry instruction [ b"token-tanistry", bc_token.as_ref(), tanistry_token.as_ref(), ] } /// Returns Token Tanistr...
Rust
0
import wireframe import pygame import os import numpy as np class EnvironmentViewer: #displays 3D objects on a 2D Pygame screen def __init__(self, width, height): self.width = width self.height = height self.screen = pygame.display.set_mode((width, height)) pygame.display.set_c...
Python
1
know the cycle, we can skip looping and just get the answer at // "limit" let cycle_len = loop_no - cycle_beginning; let remaining = (limit - loop_no - 1) % cycle_len; let target_index = cycle_beginning + remaining; let (k, _) = known.ite...
Rust
0
st.objects.create( code=history_record.code, branch=history_record.branch, product_name=history_record.product_name, unit_price=history_record.unit_price, apply_unit_price=history_record.apply_unit_price, delivery_lot=histor...
Python
1
from django.urls import path from . import views app_name = 'ecom_app' urlpatterns = [ path('',views.allProdCat,name="allProdCat"), path('slug/<slug:c_slug>/',views.allProdCat,name="products_by_category"), path('<slug:c_slug>/<slug:product_slug>/',views.proDetail,name="prodCatDetail") ]
Python
1
!("{}{:?}{}", ERROR_STDERR_COULD_NOT_DECODE_RESPONSE, &r, e); } } }; let stream_to_manage = get_stream_to_manage(&msg_str, &opts, &mut channels); let must_exit = match stream_to_manage.request { None => None, Some...
Rust
0
import pytest import torch from diffusion_for_multi_scale_molecular_dynamics.utils.tensor_utils import ( broadcast_batch_matrix_tensor_to_all_dimensions, broadcast_batch_tensor_to_all_dimensions) @pytest.fixture(scope="module", autouse=True) def set_random_seed(): torch.manual_seed(2345234) @pytest.fix...
Python
1
data can be sent Txe, } /// Serial error #[derive(Debug)] pub enum Error { /// Framing error Framing, /// Noise error Noise, /// RX buffer overrun Overrun, /// Parity check error Parity, #[doc(hidden)] _Extensible, } pub trait Pins<USART> {} // The pin combinations are mi...
Rust
0
le packet buffer. /// /// `LabelTooLong` refers to there being too long of a label byte when parsing. /// /// `DomainTooLong` refers to overrunning the maximum size of a domain /// (255 bytes) when parsing. #[derive(Debug, PartialEq)] pub enum ParseError { RDataLen(Type, u16), Malformed, UnexpectedZeroChara...
Rust
0
""" title: Llama Index Ollama Github Pipeline author: open-webui date: 2024-05-30 version: 1.0 license: MIT description: A pipeline for retrieving relevant information from a knowledge base using the Llama Index library with Ollama embeddings from a GitHub repository. requirements: llama-index, llama-index-llms-ollama,...
Python
1
cert_path(&self) -> PathBuf { PathBuf::from(&self.config.secrets.path).join("ca.crt") } pub fn key(&self) -> Key { Key::new("ca.key", &self.config.secrets.path) } pub fn cert(&self) -> Result<X509, PKIError> { let mut file = File::open(self.cert_path())?; let mut conte...
Rust
0
# ------------------------------------------------------------------ # Copyright (c) 2024 PyInstaller Development Team. # # This file is distributed under the terms of the GNU General Public # License (version 2.0 or later). # # The full license is available in LICENSE, distributed with # this software. # # SPDX-Licens...
Python
1
tswith("3"): return read_obsFile_v3(observationFile) def read_obsFile_v2(observationFile): """ 读取2代版本观测数据 :param observationFile: 文件路径 :return: Observation's object """ start = time.time() f = open(observationFile, errors='ignore') obsLines = f.readlines() line = 0 ver...
Python
1
try::query::{self, Proximity}; use nalgebra::{Isometry2, Vector2}; use std::rc::Rc; use engine::util::{self, HashMap}; use engine::entity::component::PhysicsData; use engine::physics::{Collision, PhysicsEngine}; use nalgebra as na; pub type Shape = ShapeHandle2<f32>; pub struct DanmakuPhysics { scaler: f32, p...
Rust
0
json!({ "status": "error", "reason": "Resource was not found." }) } fn print_usage(program: &str, opts: Options) { let brief = format!("Usage: {} [options]", program); print!("{}", opts.usage(&brief)); } #[launch] async fn rocket() -> _ { println!("{} v{}", PKG_NAME, VERSION); let...
Rust
0
, } pub trait LeiterAnzeige: ToSave + Sized { type Fahrtrichtung; type Message: Debug + Clone + Send; fn anzeige_status_neu() -> AnzeigeStatus<Self>; fn anzeige_neu<'t, R>( name: &'t Name, geschwindigkeit: &'t Geschwindigkeit<Self>, status: &'t mut AnzeigeStatus<Self>, ) -...
Rust
0
rc="https://localhost:8080/chunk1.hash.js" />\n' '<script src="/static/chunk2.hash.js" />\n' '<script src="http://localhost:8080/chunk3.hash.js" />' ) APP_SETTINGS.update({'manifest_file': 'manifest.json'}) class AppConfigTests(SimpleTestCase): def test_the_django_app(self)...
Python
1
py"), project_name) if(not testing): return game_folder def load_scenes(project_path: str): scenes_file = os.path.join(project_path, "data", "build_data.json") with open(scenes_file, 'r') as file: scenes = json.load(file) return scenes @router.get("") async def build_page(request: Requ...
Python
1
nt::KeyDown { keycode: Some(Keycode::Escape), .. } => break 'running, Event::KeyDown { keycode: Some(keycode), .. } => event_tx .send(ControllerEvent::ButtonDown { button: controller1_keymap(keycode), }) .unwrap(),...
Rust
0
OUTPUT: a polynomial `f(x)` in `K[x]` such that `f(\zeta_m) = \alpha`, where we view alpha as living in `M`. (Note that `\zeta_m` generates `M`, not `L`.) EXAMPLES:: sage: L = CyclotomicField(12) ; N = CyclotomicField(33) ; M = CyclotomicField(132) sage: z, n = sage.modular.modform...
Python
1
from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired, Email, ValidationError from app.models import User def user_exists(form, field): # Checking if user exists email = field.data user = User.query.filter(User.email == email).first() if user: ...
Python
1
_bool(b: bool) -> Self { Self::new(b) } } //////////////////////////////////////////////////////////////////////////////// #[derive(Debug, Clone)] pub struct BoolArrayIter<T> { count: usize, bits: u64, _marker: PhantomData<T>, } impl<T> BoolArrayIter<T> where T: BooleanEnum, { #[inlin...
Rust
0
"departmentId": new_deps_id, }) else: if users_org[alias] != 1: logger.info(f'Try to change department of {alias} user from _ {deps[users_org[alias]]} _ to _ All _') ...
Python
1
e kzg_bench::benches::das::bench_das_extension; use zkcrypto::fftsettings::ZkFFTSettings; use zkcrypto::zkfr::blsScalar; fn bench_das_extension_(c: &mut Criterion) { bench_das_extension::<blsScalar, ZkFFTSettings>(c); } criterion_group!(benches, bench_das_extension_); criterion_main!(benches);<filename>src/exprs/...
Rust
0
e_", "_do", "_ace", "una", "u_s", "tul", "tot", "tor", "tin", "t_c", "sin", "si_c", "s_", "rm", "ri_", "res", "rea", "ran", "pri", "pl", "pin", "nta", "nde", "n_ca", "mp", "min", "lt", "j", "iv", "ina", "in_c", "ilo", "i_u", "i_i", "i_de", "far", "esc", "e_o_"...
Rust
0
to_menu_on_esc(mut commands: Commands, kbd: Res<Input<KeyCode>>) { if kbd.just_pressed(KeyCode::Escape) { commands.insert_resource(NextState(GameState::MainMenu)); } } /// We can just access the `CurrentState`, and even use change detection! fn debug_current_state(state: Res<CurrentState<GameState>>) {...
Rust
0
3.addWidget(self.place) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") spacerItem5 = QtWidgets.QSpacerItem( 40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum ) self.horizontalLayout.addItem(...
Python
1
e>src/datetime.rs use super::WMIError; use chrono::prelude::*; use serde::{de, ser}; use std::fmt; use std::str::FromStr; /// A wrapper type around chrono's DateTime, which supports parsing from WMI-format strings. /// #[derive(Debug)] pub struct WMIDateTime(pub DateTime<FixedOffset>); impl FromStr for WMIDateTime { ...
Rust
0
from dbt.adapters.postgres.relation_configs.constants import ( # noqa: F401 MAX_CHARACTERS_IN_IDENTIFIER, ) from dbt.adapters.postgres.relation_configs.index import ( # noqa: F401 PostgresIndexConfig, PostgresIndexConfigChange, ) from dbt.adapters.postgres.relation_configs.materialized_view import ( # no...
Python
1
out accessing the network"))] offline: bool, #[structopt( long, value_name("OUTPUT"), default_value("human"), possible_values(OutputKind::VARIANTS), help("Output format")) ] output: OutputKind, #[structopt( long, value_name("BACKEND"), default_value("save-analysis"), possible_values(Backend::VARI...
Rust
0
&NodeID) -> Result<(), GradientError> { Ok(()) } } #[cfg(test)] mod tests { use super::sign; use alumina_core::graph::Node; use alumina_test::{grad_numeric_test::GradNumericTest, relatively_close::RelClose}; use indexmap::indexset; use ndarray::arr0; #[test] fn forward_test() { let input = Node::new(&[1...
Rust
0
import librosa import soundfile as sf from view import DialogWindow import numpy as np from scipy.signal import butter, lfilter def estimate_bpm(song_object): try: if song_object is not None: # Load the song using the SongModel song_name = song_object.name song_path = ...
Python
1
AlbumArtist, Arranger, Artist, Bpm, Comment, Compilation, Composer, Conductor, ContentGroup, Copyright, Date, Description, DiscNumber, DiscSubtitle, DiscTotal, EncodedBy, Encoder, EncoderSettings, EncodingDate, Engineer, Ensemble, ...
Rust
0
unter} field: {check_name}: {value_}\n" for check, value in files_check_list.items(): if not value: e_msg += f"{check}: {value}\n" try: _assert_db_fields(db_check_list) _assert_files_recovered(files_check_list) except AssertionError: pytest.fail(e_msg) @pytest....
Python
1
correct_for_loop6, correct_for_multi_loops, correct_for_comprehension1, correct_for_comprehension2, correct_for_comprehension3, correct_for_comprehension4, correct_except1, correct_except2, correct_except3, correct_except4, correct_exc...
Python
1
ROFLSWAP_ADDRESS")) parser.add_argument("--interval", type=int, help="Polling interval in seconds", default=30) parser.add_argument("--provider", type=str, help="Web3 provider URL", default=os.environ.get("WEB3_PROVIDER", "https://testnet.sapphire.oasis.io")) parser.add_argument("--...
Python
1
ecision = len(hits) / len(recs) recall = len(hits) / len(test_titles) dcg = sum([1 / np.log2(idx + 2) for idx, movie in enumerate(recs) if movie in hits]) ideal_dcg = sum([1 / np.log2(i + 2) for i in range(min(len(test_titles), 5))]) ndcg = dcg / ideal_dcg if ideal_dcg > 0 else 0 evaluation_results...
Python
1
self.extras[4]; let a_9 = self.extras[5]; // Assign and copy d_lo, d_hi d.0.copy_advice(|| "d_lo", region, a_7, row)?; d.1.copy_advice(|| "d_hi", region, a_7, row + 1)?; // Assign e_new, e_new_carry let (e_new, e_new_carry) = sum_with_carry(vec![ (h_prime.0...
Rust
0
; if block.is_none() { return Err(BadderError::at(src.up_to_next_line()).describe( Stage::Parser, "Expected line after `if,else` with exactly +1 indent", )); } // else will be in unused_lines as they would mark the end of an if block ...
Rust
0
] pub iopad_ds1_0: IOPAD_DS1_0, #[doc = "0xf4 - "] pub iopad_ds1_1: IOPAD_DS1_1, #[doc = "0xf8 - "] pub iopad_pe_0: IOPAD_PE_0, #[doc = "0xfc - "] pub iopad_pe_1: IOPAD_PE_1, #[doc = "0x100 - "] pub iopad_ps_0: IOPAD_PS_0, #[doc = "0x104 - "] pub iopad_ps_1: IOPAD_PS_1, #...
Rust
0
rtY) > radius: # continue distance = (i - startX) * (i - startX) + (j - startY) * (j - startY) if distance < ddradius: # 计算出(i,j)坐标的原坐标 # 计算公式中右边平方号里的部分 ratio = (ddradius - distance) / (ddradius - distance + ...
Python
1
e::Deserialize; use serde::Serialize; use std::marker::PhantomData; #[derive(Clone,Deserialize,Eq,Hash,PartialEq,Serialize)] pub struct Point<T> { pub x: T, pub y: T, } impl<T> Point<T> { pub fn new(x: T, y: T) -> Point<T> { Point { x: x, y: y, } } } pub type Int1 = i64; #[derive(Clone,...
Rust
0
NULL" => Ok(Null), op_neq_string: "'abc' != 'xyz'" => Ok(Boolean(true)), op_neq_string_not: "'abc' != 'abc'" => Ok(Boolean(false)), op_neq_string_case: "'abc' != 'ABC'" => Ok(Boolean(true)), op_neq_string_unicode: "'😀' != '🙁'" => Ok(Boolean(true)), op_neq_string_unicode_not: "'😀' != '😀'" => Ok(...
Rust
0
import os import requests import re import argparse def extract_timestamp_and_original_url(wayback_url): """ Extract the timestamp and original URL from a Wayback Machine URL. Parameters: wayback_url (str): The Wayback Machine URL. Returns: tuple: The timestamp and the origina...
Python
1
tect their privacy from AI systems? for word in message: if word in required_words_fact15: response( fact15, [ "protect", "privacy", ], user_response=True, ) # 16.Can AI have ...
Python
1
factory.get_props(_period) } fn get_social_props(&self, _period: &dyn IPeriod) -> BoxSocialProps { self.social_factory.get_props(_period) } fn get_taxing_props(&self, _period: &dyn IPeriod) -> BoxTaxingProps { self.taxing_factory.get_props(_period) } fn is_salary_null_or_empty(...
Rust
0
ent}; /// SVG namespace string used for creating svg elements pub const SVG_NAMESPACE: &str = "http://www.w3.org/2000/svg"; /// Default namespace for html elements pub const HTML_NAMESPACE: &str = "http://www.w3.org/1999/xhtml"; // Value field corresponding to an [Element]'s `value` property #[derive(Clone, Debug, E...
Rust
0
e::utils; #[test] fn returns_nil_when_was_called_with_zero_arguments() { let mut interpreter = Interpreter::new(); let pairs = vec![("(list:new)", interpreter.intern_nil_symbol_value())]; utils::assert_results_are_correct(&mut interpreter, pairs); } #[test] fn returns_a_l...
Rust
0
} #[derive(new)] pub struct GraphSurgeResult { pub result: String, } // Copyright 2021 Parallel Finance Developer. // This file is part of Parallel Finance. // 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 co...
Rust
0