text
string
label_name
string
labels
int64
atic_cache: past_key_values = None model_inputs.update( { "position_ids": position_ids, "cache_position": cache_position, "past_key_values": past_key_values, "use_cache": kwargs.get("use_cache"), "attention_...
Python
1
t_backend()) h.update(_to_bytes(input)) data = h.finalize() _write_bytes(output, data) return True @ffi.callback( "bool(void *, mongocrypt_binary_t *, mongocrypt_binary_t *, " " mongocrypt_binary_t *, mongocrypt_status_t *)", onerror=_callback_error_handler, ) def hmac_sha_512(ctx, key...
Python
1
mbol(atom.to_string())) } } fn parse_list(list: &mut VecDeque<String>, delimit: &str) -> Result<Vec<Value>, ParseError> { let mut tokens = Vec::new(); while let Some(item_str) = list.pop_front() { if &item_str[..] == delimit { return Ok(tokens); } // If not the end of ...
Rust
0
::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [apb_saradc_sar_patt_tab2](apb_saradc_sar_patt_tab2) module"] pub type APB_SARADC_SAR_PATT_TAB2 = crate::Reg<u32, _APB_SARADC_SAR_PATT_TAB2>; #[allow(missing_docs)] #[doc(hidden)] pub struct _APB_SARAD...
Rust
0
usize * CELLS_Y as usize; let mut ret = Vec::with_capacity(len); for _i in 0 .. len { ret.push(FluidCell{ flow_v: Vec2::new(rand::gen_range(-1., 1.), rand::gen_range(-1., 1.)), flow_updates: Vec2::new (0.,0.), particle_count: 0, ...
Rust
0
c_nhwf_1x1s_0x0p_1x1d_1g" in func_names ) @pytest.mark.skipif(not torch.cuda.is_available(), reason="Requires GPU to test.") def testCompileWithBackwardAMPGPU(self, boo_cache_dir: Path): x = torch.ones( [10, 3, 16, 16], device=self.device, dtype=t...
Python
1
(done_mark_file, downloaded_arches.join(" "))?; let dl = cache_dir.join("dl"); if dl.exists() { let _ = fs::remove_dir_all(dl); } let unpack = cache_dir.join("unpack"); if unpack.exists() { let _ = fs::remove_dir_all(unpack); } Ok(()) ...
Rust
0
'').replace('</p>', '')}</tg-spoiler>", parse_mode=ParseMode.HTML, reply_markup=btns.build_menu(1)) elif data[2] == "home": query.answer() msg, btns = character(update, context.bot, data[3], data[1]) message.edit_caption(caption=msg, parse_mode=ParseMode.HTML, reply_markup=btns) def manga(u...
Python
1
/ np.linalg.norm(average)).tolist() return embeddings def embed_documents( self, texts: List[str], chunk_size: Optional[int] = 0 ) -> List[List[float]]: """Call out to OpenAI's embedding endpoint for embedding search docs. Args: texts: The list of texts to embed. ...
Python
1
'%' => regex.push_str(".*"), '_' => regex.push('.'), '\\' => match chars.peek().cloned() { Some('%') => { regex.push('%'); chars.next(); } Some('_') => { regex.push('_'); ...
Rust
0
# ---------------------------------------------------- # Step 3a: Upload the video as private initial_tags = ["spiritual", "facts", "shorts","ytshorts"] video_id = upload_video( youtube_service=youtube_service, ...
Python
1
Type::I32, ValueType::I32], return_type: Some(ValueType::I32), }], data_segments: vec![ DataSegment { offset: 0, value: value_bytes, }, DataSegment { offset: value_len as u32, value: account_bytes, }, ], call_body: Some(body::repeated_dyn(r * API_BENCHMARK_BATCH_SIZE,...
Rust
0
n => SessionTrigger::UnknownValue(n as u64), } } else { panic!("can't convert SessionTrigger to {:?}", field); } } } mod my_rust_struct; mod my_rust_func; pub use my_rust_struct::MyRustStruct; pub use my_rust_struct::my_rust_struct_new; pub use my_rust_struct::my_rust_struct...
Rust
0
_6038, 0xFD35_3EBE), (r"meshes\r\wingedtwilight.nif", 0x7446_6133, 0x5F9A_5819), (r"meshes\o\misc_sack00.nif", 0x7446_7B54, 0x6566_2E78), (r"meshes\o\misc_chest11.nif", 0x7446_7B54, 0xF776_2C4B), (r"meshes\r\xancestorghost.nif", 0x744E_6E37, 0x0FF4_1BDD), (r"meshes\r\xancestorghost.kf", 0x744E_...
Rust
0
_v = textposition if textposition is not None else _v if _v is not None: self["textposition"] = _v _v = arg.pop("texttemplate", None) _v = texttemplate if texttemplate is not None else _v if _v is not None: self["texttemplate"] = _v _v = arg.pop("xanchor...
Python
1
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish...
Python
1
ds 2 numbers. /// /// # Example /// /// ``` /// use test_code::add; /// /// add(1, 2); /// ``` #[allow(dead_code)] pub fn add(x:i32, y:i32) -> i32 { return x + y; } /// This is a test function for add function. #[test] fn test_add() { assert_eq!(0, add(0, 0)); assert_eq!(1, add(0, 1)); assert_eq!(1,...
Rust
0
# # Complete the 'print_full_name' function below. # # The function is expected to return a STRING. # The function accepts following parameters: # 1. STRING first # 2. STRING last # def print_full_name(first, last): print(f'Hello {first} {last}! You just delved into python.') return f'Hello {first} {last}! Y...
Python
1
new().hoop(visitor_log).get(index), Router::new().path("index").hoop(visitor_log).get(index), // http {ip}/about Router::new().path("about").get(about), // http {ip}/list Router::new().path("list").get(list), // http {ip}/home Router::n...
Rust
0
import re from urllib.parse import urlparse from pathlib import Path from .m3u8_parser import validate_m3u8 from .downloader import download_with_ffmpeg from .sniffer import detect_m3u8 def process_video_url(driver, page_url: str): # 第一步:抓 m3u8 m3u8_url, _ = detect_m3u8(driver, page_url) if not m3u8_url: ...
Python
1
<span><i class="bi bi-box-arrow-in-right me-2"></i>账号登录</span> </div> <div class="card-body"> <div class="mb-3"> <label for="channelSelect" class="form-label">渠道选择:</label> <div class="d-flex align-i...
Python
1
// Read response .read(&[0, 0, 1, 1, 5, 0, 0, 0, 1, 0x89]) .build(); let notify = MockNotify::new(); let (mut client, mut h2) = client::handshake(mock).wait().unwrap(); // Poll h2 once to get notifications loop { // Run the connection until all work is done, this handles proces...
Rust
0
Hook { addr: contract1.clone(), }; let add_msg2 = ExecuteMsg::AddHook { addr: contract2.clone(), }; for msg in vec![add_msg, add_msg2] { let _ = execute(deps.as_mut(), mock_env(), admin_info.clone(), msg).unwrap(); } // make some chang...
Rust
0
iter() .map(Type::anonymise_borrows) .collect(), special_case_arguments: Vec::new(), } } /// Add a special-case argument. pub fn with_arg(mut self, arg: KnownValue) -> Self { self.special_case_arguments.push(arg); self } /// Add s...
Rust
0
file: ManuallyDrop<File>, // Canonical path for the tracked file. path: PathBuf, buffer: ReplicationBuffer, copier: Copier, replication_targets: ReplicationTargetList, // Counts the number of chunks (slightly more than that in fact, // to account for constant overhead) published by this ...
Rust
0
:version) """ ), values, ) async with di_container() as c: uow2 = await c.get(SQLAlchemyUoW) # In a second session, should not see the uncommitted data result = await uow2._session.execute( text( """ ...
Python
1
to_string()) } else { None } } async fn os_from(image_id: &str, docker: &Docker, file: &str) -> Result<Os> { let out = oneshot::run(&OneShotCtx::new( docker, &ContainerCreateOpts::builder(&image_id) .cmd(vec!["cat", file]) .build(), true, true...
Rust
0
::{decode_blob, decode_head_pointer, decode_index}; #[test] fn test_blob_decode_encode() { // 3b18e512dba79e4c8300dd08aeb37f8e728b8dad let content = decode_file("data/objects/3b/18e512dba79e4c8300dd08aeb37f8e728b8dad"); let content = content.as_bytes(); let r: IResult<_, _> = d...
Rust
0
he number of common neighbors and their centrality. Common neighbor refers to the common nodes between two nodes. Centrality refers to the prestige that a node enjoys in a network. .. seealso:: :func:`common_neighbors` Parameters ---------- G : graph NetworkX undirected graph. ebunch : iterable of node pair...
Python
1
import os class Config: SECRET_KEY = os.getenv('SECRET_KEY', 'your_secret_key') SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL', 'sqlite:///e_voting.db') SQLALCHEMY_TRACK_MODIFICATIONS = False JWT_SECRET_KEY = os.getenv('JWT_SECRET_KEY', 'your_jwt_secret_key')
Python
1
import torch.nn as nn import torch def intersection_over_union(boxes_preds, boxes_labels, box_format="midpoint"): if box_format == "midpoint": box1_x1 = boxes_preds[..., 0:1] - boxes_preds[..., 2:3] / 2 box1_y1 = boxes_preds[..., 1:2] - boxes_preds[..., 3:4] / 2 box1_x2 = boxes_preds[..., 0...
Python
1
arrayIndexScale), ), new_fn("addressSize", "()I", Box::new(jvm_addressSize)), new_fn( "objectFieldOffset", "(Ljava/lang/reflect/Field;)J", Box::new(jvm_objectFieldOffset), ), new_fn( "compareAndSwapObject", "(Ljava/lang/...
Rust
0
and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice appear in all copies. // // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WAR...
Rust
0
from itertools import combinations def solution(relation): num_cols = len(relation[0]) num_rows = len(relation) candidates = [] for i in range(1, num_cols + 1): for comb in combinations(range(num_cols), i): # 유일성 검사 projection = [tuple(item[c] for c in comb) for item i...
Python
1
#!/usr/bin/env python3 # -*-coding:utf8-*- from typing_extensions import ( Literal, ) class ArmMsgMasterSlaveModeConfig: ''' msg_v1_transmit 随动主从模式设置指令 CAN ID: 0x470 Args: linkage_config: 联动设置指令 feedback_offset: 反馈指令偏移值 ctrl_offset: 控制指令偏移值 ...
Python
1
(account, token_id, from_=operator) # Check events assert tx.events == [ ERC721Mock.Approval(owner, account, token_id), ] # Approve in Py model self._py_erc721.approve(account, token_id) #################### APPROVE...
Python
1
from fontTools import subset from fontTools.ttLib import TTFont INPUT_PATH = "/Library/Fonts/SF-Pro-Display-Semibold.otf" OUTPUT_PATH = "./ui/src/assets/fonts/Nuga-glyphs.otf" TARGET_GLYPHS = [ '2325', # ⌥ '2318', # ⌘ '21E7', # ⇧ '2303', # ⌃ '232B' # ⌫, '2191', # ↑ '2193', # ↓ '2192', #...
Python
1
0.00s // Doc-tests e6_should_panic // running 0 tests // test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s // 向代码引入 Bug,测试失败 // === Output === // running 1 test // test tests::greater_than_100 ... FAILED // failures: // ---- tests::greater_than_100 stdout ---- // th...
Rust
0
def test_lexical_filter_matplotlib(): import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 1) y = np.sin(x) fig, ax = plt.subplots(figsize(5, 5)) '''TEST ax.sca$ @. `scatter(x, y)` status: fail ''' def test_no_exact_match(): import pandas url = "http.c...
Python
1
# -*- coding: utf-8 -*- from gluon.scheduler import Scheduler import json #Task to update the stats on dashboard def scheduler_summary(): #this method work only for small files with 260mb file it can consume all the memory. Used system crontab instead """q = db(db.production).select(db.production.id_rand, db.p...
Python
1
_code(&config, &safe_output_dir); } /// Parser for the dynamic queries and upserts pub struct Parser<'a> { pub config: &'a Config, pub tables: &'a Metadata, pub line_writer: LineWriter, } impl<'a> Parser<'a> { pub fn new(config: &'a Config, tables: &'a Metadata) -> Parser<'a> { Self { ...
Rust
0
$tt)* }] false = [{ match_kernel! { $($rest)* } }] } }, } use amethyst::{ core::timing::Time, input::InputHandler, ecs::prelude::{Join, Read} }; struct StatsSystem; impl<'s> System for StatsSystem { type SystemData = ( Read<'s, Time>, ...
Rust
0
maybe support more hashes? let pass_hash = match query.len() { 32 => format!("{:x}", Md5::digest(pass.as_bytes())), 40 => format!("{:x}", Sha1::digest(pass.as_bytes())), 56 => format!("{:x}", Sha224::digest(pass.as_bytes())), 64 => format!("{:x}", Sha256::digest(...
Rust
0
s u64 * b_hi as u64; let b10 = a_hi as u64 * b_lo as u64; let b11 = a_hi as u64 * b_hi as u64; let b00_lo = b00 as u32; let b00_hi = (b00 >> 32) as u32; let mid1 = b10 + b00_hi as u64; let mid1_lo = mid1 as u32; let mid1_hi = (mid1 >> 32) as u32; let mid2 = b01 + mid1_lo as u64; l...
Rust
0
df.iloc[st.session_state.CURRENT_WINDOW_BENCHMARK * window_size: (st.session_state.CURRENT_WINDOW_BENCHMARK + 1) * window_size].index[-1]), unsafe_allow_html=True) pred_prob_flag = st.toggle('Display probabilities instead of status') pred_nilmcam = pred_one_window_ni...
Python
1
} @patch.dict(os.environ, {"AIRFLOW_CLI_ENVIRONMENT": "TEST_NO_CREDENTIALS"}) @patch.dict(os.environ, {"AIRFLOW_CLI_TOKEN": "TEST_TOKEN"}) @patch("airflowctl.api.client.keyring") def test_load_no_credentials(self, mock_keyring): if os.path.exists(self.default_config_dir): shutil.r...
Python
1
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import TestCase ndims = 2 size = 10 shape = tuple([size] * ndims) def _indices_for_nelems(nelems): """Returns slices of length nelems, from start onwards, in direction sign.""" if nelems == 0: ret...
Python
1
d be in data-generator folder) script_dir = Path(__file__).parent print("Image Embedding Processor for Product Data") print("=" * 50) print(f"Working directory: {script_dir}") # Verify we're in the right directory if not (script_dir / "product_data.json").exists(): print("Error...
Python
1
import os import aiohttp_jinja2 from const import VARIANT_GROUPS from lang import get_locale_ext from views import get_user_context from variants import VARIANTS, VARIANT_ICONS @aiohttp_jinja2.template("variants.html") async def variants(request): user, context = await get_user_context(request) variant = r...
Python
1
ry to invite from the client") dev[0].global_request("REMOVE_NETWORK all") invite(dev[1], dev[0]) ev = dev[1].wait_global_event(["P2P-INVITATION-RESULT"], timeout=10) if ev is None: raise Exception("No invitation result seen") if "status=8" not in ev: raise Exception("Unexpected invi...
Python
1
from tableHash import tableHash from linkedList import linkedList def main(): tabela_hash = tableHash.TabelaHash() print("Tabela Hash:") tabela_hash.imprimir_tabela() tabela_hash.inserir_estados() print("Tabela Hash:") tabela_hash.imprimir_tabela() tabela_hash.inserir_estado_ficticio('...
Python
1
import asyncio import logging import sys from aiogram import Bot, Dispatcher from aiogram.enums import ParseMode from aiogram.filters import CommandStart,Command from aiogram.types import Message,FSInputFile,InputMediaPhoto from aiogram import F from tik_tok import tiktok_save TOKEN = "6962596717:AAH6EuGxYtxyAidzaVqS...
Python
1
ions/man/html/VkPipelineRasterizationStateCreateInfo.html). #[derive(Debug, Clone)] pub struct VkPipelineRasterizationStateCreateInfo { pub flags: VkPipelineRasterizationStateCreateFlags, pub depth_clamp_enable: bool, pub rasterizer_discard_enable: bool, pub polygon_mode: VkPolygonMode, pub cull_mod...
Rust
0
_str.parse::<i32>() { Ok(i) => { if input_number < min_interface_index || input_number > max_interface_index { println!( "Please pick a number between {} and {}\n", min_interface_index, max_interface_index ...
Rust
0
::fmt::Formatter) -> std::fmt::Result { write!(f, "{{\n")?; for vreg in self.reftype_vregs() { write!(f, " REF: {}\n", vreg)?; } for (i, blockrange) in self.blocks.iter().enumerate() { let succs = self.block_succs[i] .iter() .map(|...
Rust
0
MVSelectOpts.COUNT, times=times, geom=geom, products=products, ), ) @override def extent( self, layer: OWSNamedLayer, times: Iterable[TimeSearchTerm] | None = None, geom: Geometry | None = None, prod...
Python
1
(base): _fields_ = [("b", c_byte), ("h", c_short), ("i", c_int), ("d", c_double)] s1 = S(0x12, 0x1234, 0x12345678, 3.14) s2 = struct.pack(fmt, 0x12, 0x1234, 0x12345678, 3.14) self.assertEqual(bin(s1), bin(s2)) ...
Python
1
::AsRawFd; use tempfile::tempfile; use linux_io_uring::{ opcode, IoUring }; #[test] fn test_fs() -> anyhow::Result<()> { let text = b"hello world!"; let io_uring = Arc::new(IoUring::new(2)?.concurrent()); let io_uring2 = io_uring.clone(); let io_uring3 = io_uring.clone(); let mut fd = tempfile()...
Rust
0
result = tool["function"](**content.input) tool_results.append({ "type": "tool_result", "tool_use_id": content.id, "content": str(result), }) if not tool_results: pr...
Python
1
*/ real_T RTout_Buffer0_cf; /* '<S192>/RTout' */ real_T RTout_Buffer0_i; /* '<S193>/RTout' */ real_T RTout_Buffer0_lx; /* '<S194>/RTout' */ real_T RTout_Buffer0_ju; /* '<S195>/RTout' */ real_T RTout_Buffer0_d3; /* '<S196>/RTout' */ real_T RTout_B...
Rust
0
class ArmPresets: def __init__(self, arm, table): self.arm = arm self.table = table # Define preset positions self.presets = { "L2": {"elevator": 40, "shoulder": 90, "wrist": 90}, "L3": {"elevator": 30, "shoulder": 80, "wrist": 30}, "L4": {"elevator": 20, "shoulder": 70, "wrist": 30}, "load": {"el...
Python
1
to_coord(game_y); let r = graphics::Rect::new(actual_x, actual_y, to_coord(width), to_coord(height)); let mesh_r = Mesh::new_rectangle(ctx, mode, r, color).expect("Error making rectangle mesh."); graphics::draw(ctx, &mesh_r, DrawParam::default()).expect("Error trying to draw rectangle mesh."); } pub fn ...
Rust
0
ax,N), jnp.linspace(y_min,y_max,N)) qs = jnp.column_stack((qx.ravel(),qy.ravel())) d = (qs[:,jnp.newaxis,:] - ps[jnp.newaxis,:,:]) distances = jnp.sqrt(jnp.sum(d**2,-1,keepdims=True)) K = Pt * Gt * Gr * lam**2 * rcs / (4*jnp.pi)**3 / L constant = jnp.sqrt(4 / (distances...
Python
1
ser.engine == "pyarrow": msg = "The 'chunksize' option is not supported with the 'pyarrow' engine" with pytest.raises(ValueError, match=msg): with parser.read_csv(path, chunksize=20) as result: for _ in result: pass return ...
Python
1
fn ts(&self) -> u64 { self.cache_infos.last().map_or(0, |ci| ci.ts) } fn lone_heap_item(&self) -> Option<CacheInfo> { if self.cache_infos.len() == 1 && self.cache_infos[0].pointer.is_heap_item() { Some(self.cache_infos[0]) } else { None ...
Rust
0
// range.end is exclusive, so we need to substract it by 1. self.check_bound(range.end - 1); // Returns new sub numeric vector SubVector { offset: range.start, size: range.end - range.start, source: self, } } } // vector.slice(start..) impl<'a,...
Rust
0
from flask_jwt_extended import jwt_required, get_jwt_identity from flask import Blueprint, request, jsonify from app.controllers import conta_controller conta_bp = Blueprint('conta', __name__, url_prefix='/api/conta') # buscar conta do usuario @conta_bp.route('/', methods=['GET']) @jwt_required() def get_conta(): ...
Python
1
import pytest def test_collections_sort(): # sort data (same for min max) data = [{"age": 16, "name": "John", "sex": "M"}, {"age": 34, "name": "Marry", "sex": "F"}, {"age": 25, "name": "Mathew", "sex": "M"}] sorted_list = sorted(data, key=lambda i: i["age"]) assert [i["age"] f...
Python
1
} #[doc = "Bit 3 - TX buffer over-read detected, and prevented"] #[inline(always)] pub fn overread(&mut self) -> OVERREAD_W { OVERREAD_W { w: self } } } use crate::{c32, c64}; use num_traits::{Float, Zero}; pub fn sign<T: Float>(a: &T, b: &T) -> T { if *b >= Zero::zero() { return ...
Rust
0
cef_sys::cef_base_ref_counted_t { size: 0, add_ref: None, release: None, has_one_ref: None, has_at_least_one_ref: None, } } // pub trait CefWithBase { // fn get_base(&self) -> &'static mut cef_sys::cef_base_ref_counted_t; // } #[repr(C)] pub struct CefRefCounted<T> {...
Rust
0
RCE_CLOCK_HZ: u32 = 24_000_000; const SOURCE_CLOCK_DIVIDER: u32 = 3; const PINCONFIG: iomuxc::Config = iomuxc::Config::zero() .set_open_drain(iomuxc::OpenDrain::Enabled) .set_slew_rate(iomuxc::SlewRate::Fast) .set_drive_strength(iomuxc::DriveStrength::R0_4) .set_speed(iomuxc::Speed::Fast) .set_pull...
Rust
0
push(major << 5 | (value as u8)); 1 } else if value < 0x100 { bytes.push(major << 5 | 24); bytes.push(value as u8); 2 } else if value < 0x1_0000 { bytes.push(major << 5 | 25); bytes.push((value >> 8) as u8); bytes.push(value as u8); 3 } else if...
Rust
0
once, operation.created_at, operation.eth_sign_data, ) .execute(transaction.conn()) .await?; }; transaction.commit().await?; Ok(()) } pub(crate) async fn store_executed_priority_operation( &mut self, op...
Rust
0
import pandas as pd import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from itertools import product file_path = 'D:\桌面\B题\问题三\问题三数据表.xlsx' sheet_name = '11101111' data = pd.read_excel(file_path, sheet_name=sheet_name) half_p_d = ['[1, 1, 1]', '[1, 1, 0]', '[1, 0, 1]', '[1, 0,...
Python
1
#[cfg(not(feature = "std"))] extern crate no_std_compat as std; mod commitment; /// Implements Vector Commitments using Merkle Trees. /// /// <https://eprint.iacr.org/2011/495.pdf> // TODO: Spin of to it's own crate. // TODO: Implement sparse Merkle trees. // TODO: Generalize over hash implementations. mod index; mod ...
Rust
0
Interrupt Flag Register"] pub if_: crate::Reg<if_::IF_SPEC>, #[doc = "0x1c - Interrupt Flag Set Register"] pub ifs: crate::Reg<ifs::IFS_SPEC>, #[doc = "0x20 - Interrupt Flag Clear Register"] pub ifc: crate::Reg<ifc::IFC_SPEC>, #[doc = "0x24 - Single Conversion Result Data"] pub singledata: ...
Rust
0
let mut rng = if params.random_seed { Xoshiro256Plus::seed_from_u64(rand::random()) } else { Xoshiro256Plus::seed_from_u64((j as u64 * 9781 + frame_num as u64 * 6271) | 1) }; row.iter_mut().enumerate().for_each(|(i, c...
Rust
0
from checkov.common.models.enums import CheckResult, CheckCategories from checkov.cloudformation.checks.resource.base_resource_check import BaseResourceCheck from checkov.common.util.type_forcers import force_list class GlueSecurityConfiguration(BaseResourceCheck): def __init__(self): name = "Ensure Glue ...
Python
1
import dagster as dg import pytest from dagster_and_dbt_tests.fixtures import setup_dbt_env # noqa: F401 @pytest.mark.parametrize("setup_dbt_env", ["lesson_6"], indirect=True) def test_dbt_partitioned_incremental_assets(setup_dbt_env): # noqa: F811 from dagster_and_dbt.completed.lesson_6.assets import dbt ...
Python
1
from typing import List from datetime import datetime from collections import deque # Track execution time of the function def timeit(func): def wrapper(*args, **kwargs): start = datetime.now() value = func(*args, **kwargs) end = datetime.now() print(f"Time: {end-start}") re...
Python
1
_>(dst, bit_depth, ac, alpha, edge_buf), TxSize::TX_8X4 => self.predict_intra_inner::<Block8x4, _>(dst, bit_depth, ac, alpha, edge_buf), TxSize::TX_8X16 => self.predict_intra_inner::<Block8x16, _>(dst, bit_depth, ac, alpha, edge_buf), TxSize::TX_16X8 => self.predict_intra_inner...
Rust
0
print("[3] Realizar venda") print("[4] Sair") try: opcao = int(input("Escolha uma opção: ")) if tipo_acesso == "administrador": if opcao == 1: cadastrar_produto() elif opcao == 2: exibir_produtos() ...
Python
1
) -> i32 { let d1 = days_since_1970(date1); let d2 = days_since_1970(date2); (d1 - d2).abs() } } <filename>src/usart5/rxdouble.rs<gh_stars>0 #[doc = "Reader of register RXDOUBLE"] pub type R = crate::R<u32, super::RXDOUBLE>; #[doc = "Reader of field `RXDATA0`"] pub type RXDATA0_R = crate::R<...
Rust
0
import cv2 import numpy as np # --- Load Image --- # --- Resmi Yükleme --- image1 = cv2.imread("resimler/resim1.jpg") # --- Apply Mean Filter (Averaging Blur) --- # --- Ortalama Filtresi (Bulanıklaştırma) Uygulama --- # Mean filter: Calculates the average of the surrounding pixels and assigns it to the center pixel. ...
Python
1
res: 'Win32_Media_MediaFoundation'*"] pub const eAVDecVideoDXVAMode_MC: eAVDecVideoDXVAMode = 2i32; #[doc = "*Required features: 'Win32_Media_MediaFoundation'*"] pub const eAVDecVideoDXVAMode_IDCT: eAVDecVideoDXVAMode = 3i32; #[doc = "*Required features: 'Win32_Media_MediaFoundation'*"] pub const eAVDecVideoDXVAMode_VL...
Rust
0
olEsportStreamNotificationsESportsApiStreamgroups { #[serde(rename = "content", skip_serializing_if = "Option::is_none")] pub content: Option<String>, #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option<i64>, #[serde(rename = "live", skip_serializing_if = "Option::is_none...
Rust
0
0, ).map(|_| ()) .map_err(|e| e.into()) } } pub fn destroy_device(device: &File) -> Result<(), Error> { // This is safe because no memory ownership is transferred by this function. unsafe { ioctl( device, IOCTL_TEST_DESTROY_DEVICE, ::std::p...
Rust
0
class Solution: def findWords(self, words: List[str]) -> List[str]: ans = [] rows = [set('qwertyuiop'), set('asdfghjkl'), set('zxcvbnm')] for word in words: lowerWord = set(word.lower()) if any(lowerWord <= row for row in rows): ans.append(word) return ans
Python
1
import json from datetime import datetime from typing import Optional, List, Dict, Any, Literal from huggingface_hub import HfApi, DatasetInfo, hf_hub_download HF_API = HfApi() def _format_date(dt: Optional[datetime]) -> str: if not dt: return "" return dt.strftime("%B %d, %Y") def _clean_entry(en...
Python
1
thon file-handle reference to the heap. Box::new(bf) }; // create the reader let reader = SeqReader::new(stream); // parse all records let records = PyList::empty(py); for result in reader { match result { Ok(seq) => { ...
Rust
0
tleneck, 64, num_blocks[0], 1) # TODO replace var by const to enable folding #l = tf.stop_gradient(l) l = resnet_group(l, prefix + 'group1', resnet_bottleneck, 128, num_blocks[1], 2) l = resnet_group(l, prefix + 'group2', resnet_bottleneck, 256, num_blocks[2], 2) # 16x downsampling u...
Python
1
:*; /// # use glam::UVec2; /// let e = Extent::from_min_and_shape(UVec2::new(1, 2), UVec2::new(2, 2)); /// /// let points: Vec<_> = e.par_iter2().collect(); /// /// assert_eq!( /// points, /// vec![ /// UVec2::new(1, 2), /// UVec2::new(2, 2), /// ...
Rust
0
console.print(f"💾 [DP-{self.args.dp_rank}] Saved batch results to [highlight]{batch_out}[/highlight]") self.print_progress_stats(idx, len(dataloader)) progress_bar.update(1) console.rule(style="cyan") progress_bar.close() elapsed_total = time.time() - self.start_...
Python
1
ther)) } } #[cfg(test)] impl Ord for Square { fn cmp(&self, other: &Self) -> Ordering { self.0.cmp(&other.0) } } #[cfg(test)] mod tests { use super::*; use crate::file::File; use crate::rank::Rank; #[test] fn pull_rank_file_back_out() { for rank in Rank::ALL.iter() { ...
Rust
0
ute path of the given path. If the path is already absolute, it is returned as is. Otherwise, it is transformed to an absolute path relative to the current file path. Args: path (str): The path to be transformed. Returns: str: The absolute path. """ if os.path.isabs(path): ...
Python
1
from djangoappengine.db.utils import get_cursor, set_cursor, set_config from google.appengine.api.datastore import Key from mapreduce.datastore_range_iterators import AbstractKeyRangeIterator, _KEY_RANGE_ITERATORS from mapreduce.input_readers import AbstractDatastoreInputReader, _get_params, BadReaderParamsError from...
Python
1
) mesh_points = np.asarray(points_transformed) vertices.append(mesh_points) # if self.cfg.robot_type == "panda_arm_hand": # chain_joint_angles = np.concatenate( # [joint_angles[:-2], joint_angles[-1:]] # ) # forward_kinematics = sel...
Python
1
"""Tests for the Bluetooth integration.""" from unittest.mock import patch import bleak from habluetooth.usage import ( install_multiple_bleak_catcher, uninstall_multiple_bleak_catcher, ) from habluetooth.wrappers import HaBleakClientWrapper, HaBleakScannerWrapper import pytest from homeassistant.core import...
Python
1
OW."] #[inline] pub fn pinclr14(&mut self) -> _PINCLR14W { _PINCLR14W { w: self } } #[doc = "Bit 15 - Fast GPIO output value Clear bits. Bit 0 in CLRx controls pin Px\\[0\\], bit 31 in CLRx controls pin Px\\[31\\]. 0 = Controlled pin output is unchanged. 1 = Controlled pin output is set to LOW."...
Rust
0
# Python Program to Find Numbers which are Divisible by 7 and Multiple of 5 in a Given Range. a = int(input("Enter any range here: ")) print("The range is:", a) for i in range(a): if i % 7 == 0 and i % 5 == 0: print(i, end = " ")
Python
1