text
string
label_name
string
labels
int64
Self::EmptyPw => "supply a password!", Self::PwMismatch => "passwords don't match!", Self::PwWeak => "weak password!", Self::UnknownFirebase => "firebase error!", Self::Technical => "technical error!", } } } <gh_stars>0 //! AWS Import/Export //! //...
Rust
0
t Value Clear 17"] #[inline(always)] pub fn outclr17(&mut self) -> OUTCLR17_W { OUTCLR17_W { w: self } } #[doc = "Bit 18 - Port Data Output Value Clear 18"] #[inline(always)] pub fn outclr18(&mut self) -> OUTCLR18_W { OUTCLR18_W { w: self } } #[doc = "Bit 19 - Port Data O...
Rust
0
ffer[4 + level_buffer_length..], ) } else { (&[] as &[u8], buffer) }; let (def, buffer) = if has_def { let level_buffer_length = get_length(buffer) as usize; ( &buffer[4..4 + level_buffer_length], &buffer[4 + level_buffer_length..], ) } el...
Rust
0
import jax from jax.experimental import mesh_utils from jax.sharding import PartitionSpec as P import jax.numpy as jnp from jax.sharding import Mesh import numpy as np from transformers import AutoTokenizer from jaxml.hf_utils import load_llama_from_hf, load_neox_from_hf from jaxml.inference_engine.engine import Engine...
Python
1
import pytest from test_data import (TEST_DATA_CREATE_ACCOUNT, NEGATIVE_DATA_CREATE_ACCOUNT) import allure @allure.title('Create account') @pytest.mark.smoke def test_create_account_success_message(create_account_page): create_account_page.open_page() create_account_page.fill_info_create_account( TEST...
Python
1
r-r.r0r1s rr3z6EncryptedLoraLoaderModelOnlyManualPathNode.INPUT_TYPESs_ !=$)1!!&u3( $+"  < -#  r)r)r+load_encrypted_lora_model_onlyr6uG仅加载加密Lora到模型,不涉及CLIP处理,支持手动路径c |r|j...
Python
1
n } } _ => return None, }; let href = if href.starts_with('/') || href.starts_with('.') || href.starts_with('#') { parent_url.join(&href) } else { ...
Rust
0
from django.shortcuts import render from phoneBook.models import Category, Phone from django.views.generic import ListView, UpdateView, CreateView, DeleteView, DetailView from phoneBook.forms import PhoneForm, CategoryForm from django.urls import reverse_lazy # Create your views here. class IndexView(ListView): m...
Python
1
archsorted requires array to be sorted, which is impossible with NAs present.)rVrX)rrdr]r9rrrM searchsorted)rerrVrXrWrWrXr[s  zBaseMaskedArray.searchsorteduse_na_sentinel!tuple[np.ndarray, ExtensionArray]c Cs|j}|j}t...
Python
1
# Example problem 2 # Write a program to test your arithmetic skills. Each # trial will ask the set to answer an addition question. # Provide feedback regarding correct vs. incorrect. Use the # number set 1-100. Additionally, calculate a total score # and a total time for 10 trials. import random import time ...
Python
1
crate::Result; use wapc_guest::host_call; use wascc_codec::{deserialize, http::*, serialize}; const CAPID_HTTPCLIENT: &str = "wascc:http_client"; /// An abstraction around a host runtime capability for an HTTP client pub struct HttpClientHostBinding { binding: String, } impl Default for HttpClientHostBinding { ...
Rust
0
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
Python
1
=mdp.reset_joints_by_scale, mode="reset", params={ "position_range": (0.5, 1.5), "velocity_range": (0.0, 0.0), }, ) push_robot = EventTerm( func=mdp.push_by_setting_velocity, mode="interval", interval_range_s=(10.0, 15.0), params={"...
Python
1
import grok class Mammoth(grok.Model): pass class Index(grok.View): pass
Python
1
info.nonce } else { 0 as Index } } pub fn account_data(account: &AccountId) -> Option<AccountData> { if let Some(info) = get_account_info(account) { Some(info.data) } else { None } } pub fn root() -> AccountId { get_storage_value("Sudo", "Key").unwrap() } // FIXME: Use Option<ParentchainHeader:Hash> as ...
Rust
0
( self.buffer[self.offset..(self.offset + 2)] .try_into() .expect("slice with incorrect length"), ); self.offset += 2; let category = u16::from_be_bytes( self.buffer[self.offset..(self.offset + 2)] .try_into() ...
Rust
0
import hail as hl GNOMAD_CHR22_FIRST_1000 = "gs://hail-us-central1-vep/vep_examplars/gnomad3_chr22_first_1000.mt" for path, csq in [(GNOMAD_CHR22_FIRST_1000, False)]: print(f"Checking 'hl.vep' replicates on '{path}'") expected = hl.read_matrix_table(path) actual = hl.vep( expected.rows().select(),...
Python
1
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 [otg_hs_doepint2](otg_hs_doepint2) module"] pub type OTG_HS_DOEPINT2 = crate::Reg<u...
Rust
0
(ids.cur_image_id, 60.0) .align_middle_x_of(ids.canvas) .font_size(SUBTITLE_SIZE) .set(ids.button_title, ui); let ball_x_range = ui.kid_area_of(ids.canvas).unwrap().w(); let ball_y_range = ui.h_of(ui.window).unwrap() * 0.5; let min_x = -ball_x_range / 3.0; let max_x = ball_x_ran...
Rust
0
# 1. Simple Addition a = 5 b = 3 sum = a + b print("Sum:", sum) #************************************************ # 2. Area of a Circle import math radius = float(input("Enter the radius of the circle: ")) area = math.pi * radius ** 2 print("Area of the circle:", area) #*******************************************...
Python
1
CH => { handle_res = state_ech_handle(i, s, &mut token); } DfaState::ECHO => { handle_res = state_echo_handle(i, s, &mut token); } DfaState::If2 => { handle_res = state_if2_handle(i, s, &mut token); } ...
Rust
0
} } <filename>src/dma/out_dscr_ch0.rs #[doc = "Register `OUT_DSCR_CH0` reader"] pub struct R(crate::R<OUT_DSCR_CH0_SPEC>); impl core::ops::Deref for R { type Target = crate::R<OUT_DSCR_CH0_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<OUT_DSCR_CH...
Rust
0
from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from ide.tasks.archive import export_user_projects from utils.td_helper import send_td_event from utils.jsonview import json_view from ide.utils.whatsnew import get_new_things __author__ = 'katharine' @log...
Python
1
/* Write output file header */ Some((*dest_mgr).start_output.expect("non-null function pointer")) .expect("non-null function pointer")(&mut cinfo, dest_mgr); /* Process data */ while cinfo.output_scanline < cinfo.output_height { num_scanlines = crate::jpeglib_h::...
Rust
0
from L1Trigger.L1THGCal.l1tHGCalVFEProducer_cfi import vfe_proc def custom_hgcroc_oot(process, oot_coefficients=vfe_proc.linearizationCfg_si.oot_coefficients ): parameters = vfe_proc.clone( linearizationCfg_si = vfe_proc.linearizationCfg_si.clone(oot_coeffici...
Python
1
import yaml import os import time import shutil import urllib.parse import asyncio from fastapi import FastAPI, HTTPException from fastapi.responses import RedirectResponse, FileResponse from .cloud_api import ( complete_multipart_upload, download_url_cache, get_file_download_url, upload_file_v2_creat...
Python
1
error("Failed to build request: {0}")] BuildRequestError(http::Error), #[error("Failed to execute request: {0}")] ExecuteRequestError(azure_core::HttpError), #[error("Failed to serialize request body: {0}")] SerializeError(serde_json::Error), #[err...
Rust
0
se}, "symbol": {"display": "代码", "cell": BaseCell, "update": False}, "exchange": {"display": "交易所", "cell": EnumCell, "update": False}, "direction": {"display": "方向", "cell": DirectionCell, "update": False}, "offset": {"display": "开平", "cell": EnumCell, "update": False}, "price":...
Python
1
MANAGER.lock().unwrap().labeling_on { let data = "label,type=reset,ingress=999,egress=999 data=\"reset\"".to_string(); send_label(data); } } pub fn label_reset_ingress_egress(ingress: u32, egress: u32) { if MANAGER.lock().unwrap().labeling_on { let data = fo...
Rust
0
ewport_coords.y, v.z) } /// A buffer to store the inverse depth, i.e., 1/z, at each pixel position of the canvas. Its width /// and height are set to `CANVAS_WIDTH` and `CANVAS_HEIGHT`. struct DepthBuffer { buffer: [[f64; CANVAS_WIDTH]; CANVAS_HEIGHT], } impl DepthBuffer { /// Creates a new DepthBuffer and i...
Rust
0
}\'.", match_field, ); return -1i32; } else { /* if we're provisioning a rule right now, flush it */ flush_rule(state, opts, &mut rule); return 0i32; }; } /* if we're in a correct state, then add the rule to the * ruleset in the list of options */ pub unsafe...
Rust
0
::Result<f32> { Ok(half(self.read_u16(cmd::TEMP1)?)) } /// Temperature reading in Celsius. /// /// I do not know what this is a temperature reading of. /// /// # Example /// /// ```no_run /// use corsairmi::PowerSupply; /// /// let mut psu: PowerSupply = PowerSupply:...
Rust
0
err) = call_result { dbg!(err); } }); bot.polling().start().await.unwrap(); } <reponame>ibabushkin/goblin use scroll::{Pread}; use alloc::string::ToString; use error; use super::section_table; use std::cmp; pub fn is_in_range (rva: usize, r1: usize, r2: usize) -> bool { r1 <= rva && ...
Rust
0
#"Betrag am 1. Gültigkeitstag"#, M::HH300_title => r#"Ereignisse"#, M::HH300_ereignisse => r#"_Ereignisse"#, M::HH300_ereignisse_tt => r#"Ereignisse"#, M::HH300_ereignisse_columns => { r#"Nr.;Bezeichnung;Buchungstext;Sollkonto;Habenkonto;Geändert am;Geände...
Rust
0
recording.get_num_channels(), "'{}'".format(dtype), p["threshold_strong_std_factor"], p["threshold_weak_std_factor"], "'" + detect_sign + "'", p["extract_s_before"], p["extract_s_after"], p["n_features_per_channel"], ...
Python
1
, Text, TextAttribute, TextLayoutBuilder}, Target, }; use lapce_core::{ buffer::{rope_diff, Buffer, DiffLines}, style::line_styles, syntax::Syntax, }; use lapce_rpc::{ buffer::BufferHeadResponse, style::{LineStyle, LineStyles, Style}, }; use xi_rope::{spans::Spans, Rope}; use crate::{ comma...
Rust
0
------------------------------------------------------- class Platform(XilinxSpartan6Platform): default_clk_name = "clk32" default_clk_period = 1e9/32e6 def __init__(self, toolchain="ise"): XilinxSpartan6Platform.__init__(self, "xc6slx9-tqg144-2", _io, _connectors, toolchain=toolchain) def cr...
Python
1
impl Player, mut o: impl Player) -> Game { let mut board = Board::new(); while board.get_game_result() == GameResult::InProgress { let whose_turn = board.whose_turn().unwrap(); println!("It is {}'s turn", whose_turn); let their_move = if whose_turn == Token::X { ...
Rust
0
mod future; pub mod battery; pub mod buttons; pub mod device_info; pub mod lights; use byteorder::{BigEndian, ByteOrder}; use failure::Error; use future::Future; use std::collections::HashMap; use std::fs::{File, OpenOptions}; use std::path::Path; use std::str; use std::sync::mpsc::{self, Sender}; use std::sync::{Arc...
Rust
0
from rest_framework import serializers from report.models import CellClimateData, Cell class CellClimateDataSerializer(serializers.ModelSerializer): cell_id = serializers.IntegerField(source='cell.id', read_only=True) cell_name = serializers.CharField(source='cell.name', read_only=True) latitude = serializ...
Python
1
return whatever the function produced. /// /// # Example /// /// ``` /// use yap::{ Tokens, IntoTokens }; /// /// let mut s = "foobar".into_tokens(); /// /// let res = s.optional(|s| { /// let a = s.next(); /// let b = s.next(); /// if a == b { /// ...
Rust
0
'a mut W, } impl<'a> _TIMER_TAMR_TCACTW<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: TIMER_TAMR_TCACTW) -> &'a mut W { { self.bits(variant._bits()) } } #[doc = "Disable compare operations"] #[inline(always)] pub f...
Rust
0
: &mut PulsedModel, mapping: &HashMap<OutletId, OutletId>, _pulse: usize, ) -> TractResult<TVec<OutletId>> { if node.inputs.len() > 1 { bail!("Pulsification not implemented for more than one input to Concat") } let input = mapping[&node.inputs[0]]; let fact = target.outlet_fact(input)?;...
Rust
0
operationError::CkbVM)?; Ok(VMResp { exit_code: vm.run().map_err(InteroperationError::CkbVM)?, cycles: vm.machine.cycles(), }) } } } pub fn init_dispatcher(program_map: HashMap<H160, Bytes>) -> ProtocolResult<()> { DISPATCHER.swap(Arc::new(Pro...
Rust
0
commend_keywords_list.append(recommend_keyword) button_ele = page.ele('tag:button@class=fy23-icbu-search-bar-inner-button') button_ele.hover() time.sleep(0.1) button_ele.click(by_js=True) # 点击搜索 time.sleep(1) # 产品列表排序 sortBy_ele = page...
Python
1
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # This implementation of the immutable decorator requires python >= # 3.7, and is significantly more storage efficient when making classes # with slots immutable. It's also faster. import contextvars import inspect _in__init__ = contextvars...
Python
1
''' Copyright (C) 2021 Gitcoin Core This program 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. This progra...
Python
1
parent_index = app_state.entity_indices.get(&parent_name).unwrap(); let parent = app_state.entities[*parent_index]; entry.add_component(Parent(parent)); let mut parent_entry = world.entry(parent).unwrap(); if let Ok(children) = parent_entry.get_component_mut::<Children>(...
Rust
0
, wat).unwrap(); let import_object = imports! {}; let instance = Instance::new(&module, &import_object)?; let f: TypedFunction<(i32, i32), i32> = instance.exports.get_native_function("add")?; let result = f.call(4, 6)?; assert_eq!(result, 25); Ok(()) } #[compiler_test(middlewares)] fn middle...
Rust
0
)] pub fn stm(&mut self) -> STM_W { STM_W { w: self } } } <reponame>zishon/leetcode-in-rust<gh_stars>1-10 struct Solution; impl Solution { pub fn find_median_sorted_arrays(num1: Vec<i32>, num2: Vec<i32>) -> f64 { let mut i = 0; let mut j = 0; let len = num1.len() + num2.len(...
Rust
0
nges X num_max_detections self.eval["recall"] = np.array(self.eval["recall"]).reshape( self.eval["counts"][:1] + self.eval["counts"][2:] ) # precision and scores are num_iou_thresholds X num_recall_thresholds X num_categories X # num_area_ranges X num_max_detections ...
Python
1
() { let (w, r) = div_wide(rem, *d, b); *d = w; rem = r; } normalize_digits(&mut digits); (digits, rem) } // // Interoperability with primitive types // impl_float_primitive_interop!($name, f32,...
Rust
0
documentation for more information about this endpoint](https://devcenter.heroku.com/articles/platform-api-reference#pipeline-promotion-target-list) /// /// # Example: /// /// PipelinePromotionTargetList takes one required parameter, promotion_id, and returns a list of [`PipelinePromotionTarget`][response]. /// ```ru...
Rust
0
g).unwrap(); s.step().unwrap(); assert_eq!(s.load(Src::PC).unwrap(), 0x205); s.step().unwrap(); assert_eq!(s.load(Src::Register(3)).unwrap(), 0xFF); s.step().unwrap(); assert_eq!(s.load(Src::I).unwrap(), 0x202); s.step().unwrap(); assert_eq!(s.load(Src::Register(0)).unwrap(), 0x55); ...
Rust
0
# Sort the data from lowest to highest value distances_traveled = [120, 150, 180, 90, 200, 175, 160] distances_traveled.sort() print(distances_traveled) # Sort the data in descending order, from highest to lowest value daily_temperatures = [16, 17, 15, 14, 18, 19, 17, 15, 16, 18] daily_temperatures.sort(reverse=True) p...
Python
1
import singer from singer import metadata from mage_integrations.sources.sftp.tap_sftp import client from mage_integrations.sources.sftp.tap_sftp.singer_encodings import json_schema LOGGER = singer.get_logger() def discover_streams(config): streams = [] conn = client.connection(config) tables = config...
Python
1
&events_loop).unwrap(); let mut imgui = ImGui::init(); imgui.set_ini_filename(None); let mut renderer = Renderer::init(&mut imgui, &display).expect("Failed to initialize renderer"); configure_keys(&mut imgui); let mut last_frame = Instant::now(); let mut mouse_state = MouseState::default(); ...
Rust
0
import unittest from api.apiutils import Relation from api.reporting import Report from ddapi import API from modelstore.elasticstore import StoreHandler from knowledgerepr.fieldnetwork import deserialize_network class TestReporting(unittest.TestCase): # create store handler store_client = StoreHandler() ...
Python
1
dump(favorites_dict, sf, indent=2, ensure_ascii=False) except Exception: pass # Rotate keep last 10 try: candidates = [f for f in os.listdir(mirror_dir) if f.startswith("favorites_status-") and f.endswith(".json")] ...
Python
1
"" lag_plus, num_nodes = adj_matrix.shape[0], adj_matrix.shape[1] static_temporal_graph = convert_temporal_to_static_adjacency_matrix( adj_matrix, conversion_type="auto_regressive" ) # shape[(lag+1) *nodes, (lag+1)*nodes] all_static_temp_dags = cpdag2dags( static...
Python
1
# This file was auto-generated by Fern from our API Definition. from __future__ import annotations from ..core.unchecked_base_model import UncheckedBaseModel import typing from ..core.pydantic_utilities import IS_PYDANTIC_V2 import pydantic import typing_extensions from ..core.unchecked_base_model import UnionMetadata...
Python
1
from locust import HttpUser, task, between import random class QuizTestUser(HttpUser): wait_time = between(1, 5) # Tiempo entre solicitudes (1-5 segundos) @task def submit_quiz(self): # Datos aleatorios para simular respuestas user_name = f"TestUser{random.randint(1, 100)}" age = ...
Python
1
is_none()); assert!(builder.reference_id_encoding.is_none()); assert!(builder.read_lengths_encoding.is_none()); assert!(builder.in_seq_positions_encoding.is_none()); assert!(builder.read_groups_encoding.is_none()); assert!(builder.read_names_encoding.is_none()); assert!(b...
Rust
0
-dry-run" in sys.argv or "-n" in sys.argv limite = 100 if "--test" in sys.argv else 10000000 print("🔄 Sistema de Atualização de Status NFe") print("=" * 50) # Executa atualização sucesso = executar_atualizacao_status_nfe_sync(dry_run=dry_run, limite_notas=limite) if sucesso: ...
Python
1
import random def hangman(): word_list = ["cat","dog","bear","lion","seal"] random_number = random.randint(0,4) word = word_list[random_number] wrong = 0 stages = ["\n", "___________ ", "| ", "| | ", "| O ...
Python
1
TICK_HZ, DMA_HALF_BYTES, SPI_MHZ, I2C_KHZ, SYS_CLK_HZ, }, notification::NotificationManager, }; #[cfg(feature = "itm")] const LOG_LEVEL: log::LevelFilter = log::LevelFilter::Info; #[cfg(not(feature = "itm"))] const LOG_LEVEL: log::LevelFilter = log::LevelFilter::Off; #[app(dev...
Rust
0
= np.unravel_index(arg_sorted_amps_inds[ind_0], A.shape) flag = False for true_ind_1 in reconstruct_inds: if inner_prod[*true_ind_1, *true_ind_0] > orthoganality_threshold: flag = True if flag: continue reconstruct_inds.append(true_ind...
Python
1
self.FAKE_LIST_USER_EC2_CREDENTIALS, bytes_body, user_id="1") def test_create_user_with_string_body(self): self._test_create_user() def test_create_user_with_bytes_body(self): self._test_create_user(bytes_body=True) def test_show_user_with_string_body(self)...
Python
1
t) * (i + 1); sum_r += red(first) * (i + 1); sum_g += green(first) * (i + 1); sum_b += blue(first) * (i + 1); } let mut sum_out_a = alpha(first) * (radius + 1); let mut sum_out_r = red(first) * (radius + 1); let mut sum_out_g = green(first) * (radius +...
Rust
0
size_of::<rte_logs>(), 32usize, concat!("Size of: ", stringify!(rte_logs)) ); assert_eq!( ::std::mem::align_of::<rte_logs>(), 8usize, concat!("Alignment of ", stringify!(rte_logs)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<rte_logs>())).type_ as *cons...
Rust
0
solution_uniform = unsafe { get_uniform_location(program, "resolution") }; let message_position_uniform = unsafe { get_uniform_location(program, "message_position") }; let message_scale_uniform = unsafe { get_uniform_location(program, "message_scale") }; let _font_texture = unsafe { load_texture_fr...
Rust
0
<< 1; pub const D3DCOLORWRITEENABLE_BLUE: ::DWORD = 1 << 2; pub const D3DCOLORWRITEENABLE_ALPHA: ::DWORD = 1 << 3; ENUM!{enum D3DTEXTURESTAGESTATETYPE { D3DTSS_COLOROP = 1, D3DTSS_COLORARG1 = 2, D3DTSS_COLORARG2 = 3, D3DTSS_ALPHAOP = 4, D3DTSS_ALPHAARG1 = 5, D3DTSS_ALPHAARG2 = 6, D3DTSS_BUM...
Rust
0
the camera. SCENE_INTERACTIVE = 2, /// draw coordinate system crosses for debugging SCENE_SHOW_CS_CROSS = 4, /// Apply anti-aliasing. The first window determines the setting for all windows. SCENE_AA = 8, } opencv_type_enum! { crate::ovis::SceneSettings } /// Add an additional resource location that is search fo...
Rust
0
import noodles_py import matplotlib.pyplot as plt import numpy as np def main(): heart = "(x^2 + y^2 - 1.)^3 - x^2 * y^3" origin = [-2.5, -2.5] sizes = [5.0, 5.0] gridsize = [32, 32] #quadrifolium = "(x^2 + y^2)^3 - (x^2 - y^2) ^2" #origin = [-1.5, -1.5] #sizes = [3.0, 3.0] #gridsize =...
Python
1
{ #[serde(rename = "availableResource", skip_serializing_if = "Option::is_none")] pub available_resource: Option<crate::models::ResourceDescription>, #[serde(rename = "resourceId", skip_serializing_if = "Option::is_none")] pub resource_id: Option<String>, } impl ResourceUnit { pub fn new() -> Reso...
Rust
0
c.len()) as u64); for rec in rec_file.into_iter() { assert_eq!("THE_RECORD".as_bytes(), rec.as_slice()); } } } //! Load balancing for a single server use super::{CallInfo, LoadBalance, ServerId, ServerEndPort}; /// Provide load balancing for a single server #[derive(Debug)] pub struct...
Rust
0
ngul_YA: c_int = 3777; pub const GDK_KEY_Hangul_YAE: c_int = 3778; pub const GDK_KEY_Hangul_YE: c_int = 3782; pub const GDK_KEY_Hangul_YEO: c_int = 3781; pub const GDK_KEY_Hangul_YI: c_int = 3794; pub const GDK_KEY_Hangul_YO: c_int = 3787; pub const GDK_KEY_Hangul_YU: c_int = 3792; pub const GDK_KEY_Hangul_YeorinHieuh:...
Rust
0
"""Converting last_used_otp to string Revision ID: 103c5bb766a1 Revises: 18d14440c61c Create Date: 2025-01-29 04:02:10.470503 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision: str = '103c5bb7...
Python
1
) == inner_target { continue; } let inner_target_done = matches!( burrow.get(inner_target.0, inner_target.1), Some(Cell::Amphipod(a)) if a == amphipod, ); if inner_target_done && (x, y) == outer_target { con...
Rust
0
#!/usr/bin/env python2 # vim: expandtab:tabstop=4:shiftwidth=4 # # Copyright 2015 Red Hat Inc. # # 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/license...
Python
1
#!/usr/bin/python3 def safe_print_integer(value): """Print an integer with "{:d}".format(). Args: value (int): The integer to print. Returns: If a TypeError or ValueError occurs - False. Otherwise - True. """ try: print("{:d}".format(value)) return (True) ...
Python
1
from __future__ import annotations import json import base64 import hashlib import random from Crypto.Cipher import AES def pad(data: str) -> bytes: # Convert the string to bytes and calculate the number of bytes to pad data_bytes = data.encode() padding = 16 - (len(data_bytes) % 16) # Append the padd...
Python
1
=> Ok(Self::Mipsel), "SCMP_ARCH_MIPSEL64" => Ok(Self::Mipsel64), "SCMP_ARCH_MIPSEL64N32" => Ok(Self::Mipsel64N32), "SCMP_ARCH_PPC" => Ok(Self::Ppc), "SCMP_ARCH_PPC64" => Ok(Self::Ppc64), "SCMP_ARCH_PPC64LE" => Ok(Self::Ppc64Le), "SCMP_ARCH_S390" =...
Rust
0
list.append_child(&li)?; } let li = document.create_element("li")?; add_action_to_div(sub_action, document, &li)?; list.append_child(&li)?; } } } ...
Rust
0
Number: SQLUSMALLINT, columnName: *mut SQLWCHAR, bufferLength: SQLSMALLINT, nameLength: *mut SQLSMALLINT, dataType: *mut SQLSMALLINT, columnSize: *mut SQLULEN, decimalDigits: *mut SQLSMALLINT, nullable: *mut SQLSMALLINT, ) -> SQLRETURN; pub fn SQLDisconnect(connectionHandle: SQLHDBC) -> SQLRETUR...
Rust
0
our memory_map_tag."); for memarea in memory_map_tag.memory_areas() { if memarea.start_address() > u32::max_value() as u64 || memarea.end_address() > u32::max_value() as u64 { continue; } if memarea.memory_type() == 1 { FrameAllocator::mark_are...
Rust
0
eDeploySchema( target_capacity=None, applications=[create_app_config(name="app1")], ) assert ( calculate_target_capacity_direction( None, new_config, None, ) is None ) @pytest.mark.pa...
Python
1
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import codecs import glob conll18_dir = 'data/CoNLL18/' unilang_dir = 'data/CoNLL18/UD_Unilang-1000' os.makedirs(unilang_dir, exist_ok=True) with codecs.open(os.path.join(unilang_dir, 'uni_1000-ud-t...
Python
1
ontext(current_ctx["read"])["name"] == "A" assert unify.get_context(current_ctx["write"])["name"] == "A" with unify.Context("B"): current_ctx = unify.get_active_context() assert current_ctx["read"] == "A/B" assert current_ctx["write"] == "A/B" assert unif...
Python
1
.DCB; let dwt = cx.core.DWT; let systick = cx.core.SYST; let mono = DwtSystick::new(&mut dcb, dwt, systick, MONO_HZ); // Ensure the ARM clock is configured for the default speed seeing as we use this speed to // determine a 1 second `PERIOD`. cx.device .ccm ...
Rust
0
asserstein(C1, C2, p, q, "square_loss", epsilon=10) np.testing.assert_allclose(G, res, atol=1e-02) w0, log0 = ot.partial.partial_gromov_wasserstein2(C1, C2, p, q, m=m, log=True) w0_val = ot.partial.partial_gromov_wasserstein2(C1, C2, p, q, m=m, log=False) G = log0["T"] np.testing.assert_allclose(w0...
Python
1
# -*- coding: utf-8 -*- # Copyright 2024 Google LLC # # 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
MMC Receive Alignment Error Frame Counter Interrupt Mask"] #[inline(always)] pub fn rxalgnerfim(&mut self) -> RXALGNERFIM_W { RXALGNERFIM_W { w: self } } #[doc = "Bit 7 - MMC Receive Runt Frame Counter Interrupt Mask"] #[inline(always)] pub fn rxruntfim(&mut self) -> RXRUNTFIM_W { ...
Rust
0
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # Download and build the data if it does not exist. import parlai.core.build_data as build_data import os import json V...
Python
1
.get(1); if let Some(region) = super::memory::verify_memory_region(state, offset, size) .map_err(|_| StatusCode::OutOfGas)? { state.output_data = state.memory[region.offset..region.offset + region.size.get()] .to_vec() .into(); } Ok(()) } pub(crate) fn op_jump(...
Rust
0
#! /usr/bin/env python import argparse as ap from bs4 import BeautifulSoup from datetime import datetime import urllib2 current_time = datetime.now().time() def format_time(time): return "{0:02d}{1:02d}".format(time.hour, time.minute) def has_no_changes(columns): return columns[5] == "0" def pretty_print(colum...
Python
1
out.cwriteln(error_style(), "Lexing failed:")?; out.cwriteln(clear_style(), &format!("{}", e))?; return Ok(false); }, Incomplete(n) => { out.cwrite(error_style(), "Lexing needed more: ")?; out.cwriteln(clear_style(), &format!("{:?}", n))?; retu...
Rust
0
"""Utilities for console I/O.""" from colorama import ( Fore, Style) from functools import ( partial) def red(s: str) -> str: """Add escape sequences to print a string red.""" return Fore.RED + s + Style.RESET_ALL def purple(s: str) -> str: """Add escape sequences to print a string purple."...
Python
1
LogEntryLevel { Trace, Debug, Info, Warning, Error, } impl<'de> Deserialize<'de> for PolicyLogEntryLevel { fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: serde::de::Deserializer<'de>, { let s = String::deserialize(deserializer)?; match s.to...
Rust
0
hw = "HELLO FROM RUST"; // This unwrap() stuff is from the stdweb examples - // https://github.com/koute/stdweb/blob/52cf01616a1a32ecf63af9858437d37be743b7dd/examples/echo/src/main.rs#L36 let div: HtmlElement = document().query_selector("#container") .unwrap().unwrap().try_into().unwrap(); let...
Rust
0