text
string
label_name
string
labels
int64
#!/usr/bin/env python3 import re import sys import os import argparse # argument parsing # WARNING: this script expects the tech lef first # Parse and validate arguments # ============================================================================== parser = argparse.ArgumentParser(description="Merges lefs together...
Python
1
from bs4 import BeautifulSoup import requests import csv alphabet = [chr(i) for i in range(ord("А"), ord("Я") + 1)] def parse_animals_by_letter(alphabet=alphabet, url=None): count_category = {s: 0 for s in alphabet} for s in alphabet: url = f"https://ru.wikipedia.org/w/index.php?title=Категория:Ж...
Python
1
from ase.data import atomic_masses, atomic_numbers from scipy.constants import N_A, calorie, eV from ase.io import read, write def kcal_mol_to_eV(val): return val * 1000 * calorie / N_A / eV init_str = 'Ar_FCC_init.lammps' rlx_str = 'Ar_FCC_relaxed.lammps' mass = atomic_masses[atomic_numbers['Ar']] # J. Chem. Phys...
Python
1
#!/usr/bin/python # Copyright 2015 Huawei Devices USA Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
Python
1
pchain, None); vulkan_data.swapchain = vk::SwapchainKHR::null(); } } use regex_syntax::hir; use std::fmt; /// Represent a set of characters as an union of ranges. #[derive(Debug)] pub enum Atom { Literal(hir::Literal), Class(hir::Class), } impl Atom { /// Check if a unicode character matches a...
Rust
0
def greet(name): return f"Hello, {name}!" def subtract(a, b): return a - b
Python
1
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1 import typing, winrt import enum _ns_module = winrt._import_ns_module("Windows.Graphics.Holographic") try: import winrt.windows.foundation except: pass try: import winrt.windows.foundation.collections except: pass...
Python
1
""" Functions for plotting ants images """ __all__ = [ "plot_hist" ] import fnmatch import math import os import warnings from matplotlib import gridspec import matplotlib.pyplot as plt import matplotlib.patheffects as path_effects import matplotlib.lines as mlines import matplotlib.patches as patches import ma...
Python
1
# Recursion: , Time: O(9 ^ n) × O(m ^ 2), Sp: O(N) class Solution: def func(self, i, j1, j2, n, m, grid, dp): if j1 < 0 or j1 >= m or j2 < 0 or j2 >= m: return -int(1e9) if i == n - 1: if j1 == j2: return grid[i][j1] else: return ...
Python
1
8> { let mut intensity: f64 = self.varying_intensity.dot(&vertex); let uv: Vector2<f64> = self.varying_texture * vertex; if intensity > 0.95 { intensity = 1.0; } else if intensity > 0.50 { intensity = 0.70; } else if intensity > 0.10 { intensity = 0.35; } else { intensit...
Rust
0
| //! |audiodatarate |`Number` | //! |audiodelay |`Number` | //! |audiosamplerate|`Number` | //! |audiosamplesize|`Number` | //! |canSeekToEnd |`Boolean` | //! |creationdate |`String` | //! |duration |`Number` | //! |filesize |`Number` | //! |framerate |`Num...
Rust
0
# Unit test __init__ ForecasterEquivalentDate # ============================================================================== import sys import re import pytest import numpy as np import skforecast from skforecast.ForecasterBaseline import ForecasterEquivalentDate def test_init_TypeError_offset_not_int_or_DateOffset...
Python
1
#!/usr/bin/env python ########################### # This code block is a HACK (!), but is necessary to avoid code duplication. Do NOT alter these lines. import importlib.util import os from setuptools import setup filepath = os.path.abspath(os.path.dirname(__file__)) filepath_import = os.path.join(filepath, "..", "co...
Python
1
openai/clip-vit-base-patch32") >>> processor = AutoProcessor.from_pretrained("openai/clip-vit-base-patch32") >>> url = "http://images.cocodataset.org/val2017/000000039769.jpg" >>> image = Image.open(requests.get(url, stream=True).raw) >>> inputs = processor( ... text=["a photo of a cat", "a ph...
Python
1
merge them from_slot = |s: &Spanned<Slot>| s.span; }; } } impl TySeq { pub fn all_with_loc<Loc: Into<Span>>(self, loc: Loc) -> SpannedTySeq { let span: Span = loc.into(); SpannedTySeq { head: self.head.into_iter().map(|t| t.with_loc(span)).collect(), ...
Rust
0
, witness, input) = unsafe { ( addrs_from_slice(callers_raw), addrs_from_slice(witness_raw), slice::from_raw_parts(input_raw.data, input_raw.len as usize).to_vec(), ) }; let exec_metrics = ExecMetrics::new(exec_step, gas_factor, gas_left, depth_left); let...
Rust
0
CanTriviallyDerivePartialEqOrPartialOrd { /// Return `Yes` if `PartialEq` or `PartialOrd` can trivially be derived /// for this thing. fn can_trivially_derive_partialeq_or_partialord(&self, ctx: &BindgenContext) -> CanDerive; } /// Whether it is possible or not to automatically derive trait for an item. //...
Rust
0
, COLOR_BLACK]; pub fn calculate_monochrome_color_id(palette: u8, pix: u8) -> usize { assert!(pix < 4); ((palette >> (pix * 2)) & 0x03) as usize } <gh_stars>10-100 use std::collections::HashMap; #[cfg(feature = "debugger")] use std::collections::HashSet; use log::{debug, info, trace}; use url::Url; use flowc...
Rust
0
>shared/src/messages/client.rs use std::time::Duration; use glam::f32::Vec2; use serde::{Deserialize, Serialize}; use crate::components::*; /// A message sent from the client to the server. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub enum ClientMessage { /// Sent upon receiving a `ServerMessag...
Rust
0
0, 2.0], //! # ]; //! # //! # // Check result //! # for i in 0..4 { //! # for j in 0..4 { //! # assert!((res[i][j] - hessian_forward[i][j]).abs() < 1e-6); //! # assert!((res[i][j] - hessian_central[i][j]).abs() < 1e-6); //! # } //! # } //! ``` //! //! ### Product of the Hessian `H(x)` wi...
Rust
0
=> () } fn main() { frobnicate!(); } "#, ); } #[test] fn active_param_score() { mark::check!(active_param_type_match); check_scores( r#" struct S { foo: i64, bar: u32, baz: u32 } fn test(bar: u32) { } fn foo(s: S) { test(s.<|>) } "#, expect![[r#" ...
Rust
0
&t.ext } <filename>vm/src/stdlib/keyword.rs<gh_stars>0 /// Testing if a string is a keyword. pub(crate) use decl::make_module; #[pymodule(name = "keyword")] mod decl { use rustpython_parser::lexer; use crate::obj::objstr::PyStrRef; use crate::pyobject::{BorrowValue, PyObjectRef, PyResult}; use cra...
Rust
0
e(serialize_with = "get_math_record")] fractionNumeratorDisplayStyleShiftUp: MathValueRecord, #[serde(serialize_with = "get_math_record")] fractionDenominatorShiftDown: MathValueRecord, #[serde(serialize_with = "get_math_record")] fractionDenominatorDisplayStyleShiftDown: MathValueRecord, #[serd...
Rust
0
', expected")); assert!(message.contains("Unexpected token '*', expected")); } #[test] fn error_recovery_bool_wire_and_colons() { init_logger(); let message = get_errors_for( "bool mem_read = icode in { MRMOVQ }; reg_srcA = [ icode in {RRMOVQ, CMOVXX, RMMOVQ, MRMOVQ, PUSHQ...
Rust
0
, max_mem_mb), chart_name="GPU Memory Allocated (MB)", chart_index=random_index() ) # GPU 温度 self.gpu_temp_key = generate_key("gpu.{idx}.temp") tem_config = HardwareConfig(chart_name="GPU Temperature (℃)", chart_index=random_index()) # GPU 功耗 self.gpu_power_key = generate...
Python
1
am u: :return: """ try: logger.debug(f'尝试登出 [账户:{u}]') self.driver.get(Netflix.LOGOUT_URL) self.find_element_by_xpath('//a[@data-uia="header-login-link"]', timeout=4.9, poll_frequency=0.5, message='查找登入元素未果') ...
Python
1
for the environment print(cmd, environment_name, app_name, deploy_config_dir, config_file_name) server_configurations = load_config(path.join(deploy_config_dir, app_name, environment_name, config_file_name)) if cmd == "deploy": deploy(server_configurations) elif cmd == "set...
Python
1
# -*- coding: utf-8 -*- # Copyright 2025 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
erver(config).await; Ok(()) } <reponame>kziemianek/tsp-solver<gh_stars>0 fn main() { cli::start(); } mod cli { use clap::{App, Arg, ArgMatches}; use std::cmp::Ordering::Equal; use tspsolver::solve; pub fn start() { let matches = App::new("tsp-solver") .version("0.1.0") ...
Rust
0
# Copyright Materialize, Inc. and contributors. All rights reserved. # # Use of this software is governed by the Business Source License # included in the LICENSE file at the root of this repository. # # As of the Change Date specified in that file, in accordance with # the Business Source License, use of this software...
Python
1
with gr.Column(): load_model_btn = gr.Button("读取模型并重置", scale=1) refresh_model_btn = gr.Button("刷新列表", scale=1) with gr.Row(visible=False) as load_state_section: history_dropdown = gr.Dropdown( label="模型历史", choices=history_fil...
Python
1
er Size. ShortPacket = 13, /// Asserted in a Transfer Event TRB if the Transfer Ring is empty when an enabled Isoch /// endpoint is scheduled to transmit data. RingUnderrun = 14, /// Asserted in a Transfer Event TRB if the Transfer Ring is empty when an enabled Isoch /// endpoint is scheduled to...
Rust
0
team: usize, } #[derive(Deserialize, Debug)] pub struct RadiantTeam { team_name: String, team_id: usize, team_logo: usize, complete: bool, } #[derive(Deserialize, Debug)] pub struct DireTeam { team_name: String, team_id: usize, team_logo:...
Rust
0
0], yb[0] - 1]) if __name__ == "__main__": # Minimize the cost function def cost_function(a_coeffs, gamma=1): if COST_FUNCTION == QUAD: def a_func(t, kappa, lambda_, gamma=1): return fr.reconstruct_from_sin(t, a_coeffs) + gamma * t def a_dot_func(t, kappa, lambda_, gamma=1): return fr.reconstruct_...
Python
1
#[inline(always)] pub fn eoc11(&self) -> EOC11_R { EOC11_R::new(((self.bits >> 11) & 0x01) != 0) } #[doc = "Bit 24 - Data Ready Interrupt Mask"] #[inline(always)] pub fn drdy(&self) -> DRDY_R { DRDY_R::new(((self.bits >> 24) & 0x01) != 0) } #[doc = "Bit 25 - General Overr...
Rust
0
ystem( mut commands: Commands, interactables_query: Query<&InteractableComponent>, mut vulnerability_resource: ResMut<VulnerabilityResource>, mut app_state: ResMut<State<GameState>>, mut texture_atlases: ResMut<Assets<TextureAtlas>>, time: Res<Time>, asset_server: Res<AssetServer>, audio...
Rust
0
#!/usr/bin/env python # coding=utf-8 from lib.poc.dummy import * async def do_scan(ip, port, service, is_http, task_msg): if port != 2181 and not service.lower().startswith('zookeeper'): return # if is_intranet(ip): # do not scan intranet IPs # return try: reader, writer = aw...
Python
1
from typing import Type, Tuple, Optional, Dict from .node import ASTNode, ASTNodeType from .constant_node import ConstantNode class EnumerationNode(ASTNode): """Represents C++ enumeration that treated as named set of constants in Python. EnumerationNode can have only constants as its children nodes. ...
Python
1
let v = (theta - self.theta_min) / self.delta_theta; // Calcuate first derivatives let dpdu = Vector3D::new(-self.phi_max * hit_y, self.phi_max * hit_x, 0.); let dpdv = Vector3D::new(hit_z * cos_phi, hit_z * sin_phi, -self.radius * sin_theta) * self.delta_theta; // ...
Rust
0
config, dataset, feature_extractor, coarse_topk_indices, vlad_instance, ): if config.match_strategy.lower() == "none": # only use the coarse VPR return coarse_topk_indices else: loguru_logger.info( f"Calculating Fine Place Recognition Performance using {config.match...
Python
1
esource"); } }; Ok(()) } async fn create_job( &self, session_id: &SessionIdentifier, raw_capabilities: &RawCapabilitiesRequest, ) -> Result<ProvisionedSessionMetadata, KubernetesProvisionerError> { let request = raw_capabilities.parse()?; ...
Rust
0
import string import random from django.contrib.auth.forms import PasswordResetForm from django.contrib.auth.views import LoginView from django.conf import settings from django.core.mail import send_mail from django.shortcuts import render, get_object_or_404, redirect from django.urls import reverse_lazy from django.v...
Python
1
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # 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 # # ht...
Python
1
1 { return false; } // 九萬・九筒・九索の時に1つ後(一筒・一索・東)が来ても連続とはみなさない if matches!(self.index, Tile::M9 | Tile::P9 | Tile::S9) && self.get() == tile.get() - 1 { return false; } else if self.get() == tile.get() - 1 || self.get() == tile.get() + 1 { ...
Rust
0
run_tag_keys_test_case(MeasurementWithMaxTime {}, predicate, expected_tag_keys).await; } #[tokio::test] async fn list_tag_name_max_time_less_one() { test_helpers::maybe_start_logging(); let predicate = PredicateBuilder::default() .timestamp_range(-9223372036854775806, 9223372036854775805) // one l...
Rust
0
x = x + self._get_pos_embed(x.shape[1:3]) outputs = [] for i, blk in enumerate(self.blocks): x = blk(x) if (i == self.stage_ends[-1]) or ( i in self.stage_ends and self.return_interm_layers ): feats = x.permute(0, 3, 1, 2) ...
Python
1
import os from tqdm import tqdm os.system('rm -rf images') os.system('mkdir images') os.system('cp -r ../MME_Benchmark_release/OCR images/') os.system('mkdir images/artwork') os.system('cp ../MME_Benchmark_release/artwork/questions_answers_YN/* images/artwork/') with open('LaVIN/artwork.txt') as fin: paths = [ l...
Python
1
from types import SimpleNamespace import streamlit as st from streamlit_elements import elements, mui from frontend.components.controllers_file_explorer import ControllersFileExplorer from frontend.components.dashboard import Dashboard from frontend.components.directional_strategy_creation_card import DirectionalStra...
Python
1
from pypge.benchmarks import explicit import numpy as np # visualization libraries import matplotlib.pyplot as plt # Set your output directories img_dir = "../img/explicit/" data_dir = "../benchmarks/explicit/" names = [ "koza_01", "koza_02", "koza_03", "lipson_01", "lipson_02", "lipson_03", "nguyen_01", ...
Python
1
s is off state_dtype = torch.float if self.fp32_optimizer_states else p.dtype # gradient momentums state['exp_avg'] = torch.zeros_like(p.data, dtype=state_dtype, device=device) #memory_format=torch.preserve_format) # gr...
Python
1
[cfg(all(feature = "package-2017-03", not(feature = "no-default-tag")))] pub use package_2017_03::{models, operations, operations::Client, operations::ClientBuilder, operations::Error}; #[cfg(feature = "package-2016-06-preview")] pub mod package_2016_06_preview; #[cfg(all(feature = "package-2016-06-preview", not(featur...
Rust
0
)) content = { 'survey': [{'type': 'note', 'label': 'Read me', 'name': 'n1'}], } new_asset = Asset.objects.create( asset_type='survey', content=content, date_created=date_forced, date_modified=date_forced, ) AssetVersion...
Python
1
RectCorner}; pub use rounded_rect::RoundedRect; pub use size::Size; pub use thickness::Thickness; pub use triangle::Triangle; pub use vec2::Vec2; mod arc_segment; mod bezier_segment; mod color; mod ellipse; mod line; mod matrix3x2; mod point; mod quad_bezier_segment; mod rect; mod rounded_rect; mod size; mod thicknes...
Rust
0
FAQ: Start Game if event.key == pygame.K_RETURN: find_path = True elif event_ == pygame.MOUSEMOTION or event_ == pygame.MOUSEBUTTONUP: # FAQ: Add walls mouse_event = pygame.mouse.get_pressed(3) if mouse_event[0]: ...
Python
1
ms": {"type": "number"}, }, } _combined_schemas = { "$schema": "http://json-schema.org/draft-04/schema#", "description": """`Logistic Regression`_ from `Snap ML`_. .. _`Logistic Regression`: https://snapml.readthedocs.io/en/latest/#snapml.LogisticRegression .. _`Snap ML`: https://www.zurich.ibm.com/snapml...
Python
1
elf.config["#Revision"]["Original-Model"] = self.model self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Version"] = f"{self.constants.patcher_version}" self.config["NVRAM"]["Add"]["4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102"]["OCLP-Model"] = self.model def _save_config(self) -> ...
Python
1
r]. pub trait FrameBuilderLike { /// Add a slice of data as a field to the frame. /// /// ``` /// use yatlv::{FrameBuilder, FrameBuilderLike}; /// let mut data = Vec::with_capacity(100); /// { /// let mut bld = FrameBuilder::new(&mut data); /// let tag = 45; /// let data ...
Rust
0
.sink.set_volume(mixed_vol); // trace!("Sink volume for Channel {:?} is now {}", self.id, self.sink.volume()); self } fn volume(&self) -> f32 { self.channel_volume } fn set_volume(&mut self, volume: f32) -> &mut Self { self.channel_volume = volume; self } ...
Rust
0
} // optional fixed64 steamid = 1; pub fn get_steamid(&self) -> u64 { self.steamid.unwrap_or(0) } pub fn clear_steamid(&mut self) { self.steamid = ::std::option::Option::None; } pub fn has_steamid(&self) -> bool { self.steamid.is_some() } // Param is passed b...
Rust
0
n(config_file, "w") as f: f.write("") try: # 应该能处理空文件 config_manager = ConfigManager(config_file) self.assertEqual(config_manager.get("work_duration"), 25) finally: os.remove(config_file) os.rmdir(temp_dir) def test_config_wit...
Python
1
# SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of sourc...
Python
1
import pytest from aizynthfinder.search.dfpn.nodes import MoleculeNode, BIG_INT from aizynthfinder.search.dfpn import SearchTree @pytest.fixture def setup_root(default_config): def wrapper(smiles): owner = SearchTree(default_config) return MoleculeNode.create_root(smiles, config=default_config, o...
Python
1
from neo4j import GraphDatabase URI = "neo4j://localhost:7690" AUTH = ("neo4j", "13102010@Gla") DB_NAME = "neo4j" def get_aligned_sequence_with_gaps(driver, sample_name): with driver.session(database=DB_NAME) as session: return session.execute_read(_fetch_aligned_sequence_tx, sample_name) def _fetch_alig...
Python
1
t("MISTRAL_API_KEY") if not api_key: raise ValueError("MISTRAL_API_KEY environment variable is not set.") pipeline = get_pipeline(name) inputs, outputs, preprocess, postprocess = get_interface_args(pipeline) fn = get_fn(name, preprocess, postprocess, api_key) if pipeline == "chat": ...
Python
1
# 从临时配置文件导入配置 from temp_config import * import os import time import copy import torch import shutil import json from PIL import Image, ImageDraw from MobileAgent.api import inference_chat from MobileAgent.text_localization import ocr from MobileAgent.icon_localization import det from MobileAgent.controller import ge...
Python
1
let mut dialogue = common_dialogue(); dialogue.dialogue = String::from("updated dialogue."); assert_eq!(1, querier.update_dialogue(100, dialogue.clone())); let got_dialogue = querier.get_dialogue(100); assert_eq!(dialogue.clone(), got_dialogue); } #[test] fn test_comp...
Rust
0
#!/usr/bin/env python3 """ Tourism Data Chatbot Frontend Runner This script runs the Streamlit frontend with uv dependency management. """ import os import subprocess import sys import time def check_dependencies(): """Ensure all frontend dependencies are installed using uv.""" try: # Check if stream...
Python
1
commands.entity(anim_e).insert(AgentAnimationBlock(dur)); } } PlayerAnimation::Idle => { stop_anim_entities.push(anim.body_root_e); if let Ok((mut animator, t)) = animator_q.get_mut(anim.face_e) { ...
Rust
0
import cv2 import time class RaspPDI: def __init__(self) -> None: pass def illumination_compesation (self, img): initial_time = time.time() height, width = img.shape[0:2] channel_b, channel_g, channel_r = cv2.split(img) mean_r = cv2.mean(channel_r)[0] print("R...
Python
1
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # Name: musicxml/xmlSoundParser.py # Purpose: Translate the <sound> tag to music21 # # Authors: Michael Scott Asato Cuthbert # # Copyright: Copyright © 2016-22 Michael Scott Asato Cuthbert # Lic...
Python
1
fat #![crate_type="lib"] // MSAN-0-NOT: @__msan_track_origins // MSAN-1: @__msan_track_origins = weak_odr {{.*}}constant i32 1 // MSAN-2: @__msan_track_origins = weak_odr {{.*}}constant i32 2 // MSAN-1-LTO: @__msan_track_origins = weak_odr {{.*}}constant i32 1 // MSAN-2-LTO: @__msan_track_origins = weak_odr {...
Rust
0
using_name(module_name, class_name, suffix='', type=object): """Import the module In the file, the class called ClassNameFuffix() will be instantiated. It has to be a subclass of type, and it is case-insensitive. """ filename = module_name lib = importlib.import_module(filename) target ...
Python
1
$ cargo run --example format_mime From: NoBody <<EMAIL>> Reply-To: Yuin <<EMAIL>> To: Hei <<EMAIL>> Subject: Happy new year MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: quoted-printable =D0=9F=D1=80=D0=B8=D0=B2=D0=B5=D1=82, =D0=BC=D0=B8=D1=80! ``` ##### Multiple parts And mo...
Rust
0
clear(&mut self) { self.success = false; self.errorCode = 0; self.notes.clear(); self.unknown_fields.clear(); } } impl ::std::fmt::Debug for GetNotesListResponse { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self...
Rust
0
import pygame pygame.init() font = pygame.font.SysFont(None, 60) screen = pygame.display.set_mode((794, 1123)) pygame.display.set_caption("Картинка 9") running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False #white screen fill ...
Python
1
""" Write a python function to find the sum of fourth power of first n odd natural numbers. assert odd_num_sum(2) == 82 """ def odd_num_sum(n): """ :param n: int :return: int """ sum = 0 for i in range(1, n+1): if i % 2 != 0: sum += i**4 return sum assert odd_num_sum(2)...
Python
1
_readable = true; } } } extern crate ambassador; use ambassador::{delegatable_trait, Delegate}; use std::any::type_name; #[delegatable_trait] pub trait Taxonomy<E> { type Res; } pub struct Cat; pub struct Dog; pub struct Alligator; pub struct Class; pub struct Mammal; pub struct Reptile; pub struct...
Rust
0
&mut Buffer, state: &mut Self::State) { self.render_cached(area, buf, state); } } impl CachableWidget<StockState> for StockSummaryWidget { fn cache_state_mut(state: &mut StockState) -> &mut CacheState { &mut state.cache_state } fn render(self, mut area: Rect, buf: &mut Buffer, state: &...
Rust
0
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class IrSequence(models.Model): _inherit = 'ir.sequence' l10n_cl_journal_ids = fields.Many2many('account.journal', 'l10n_cl_journal_sequence_rel', 'sequence_id', ...
Python
1
import numpy as np import os import pandas as pd rounds_1200 = 1 rounds_ml = 1 ncpu = 30 nrays = 5e5 # PARAMS FOR 1200l/mm GRATING SIMULATIONS hb_1200_order = 1 hb_1200_energy = np.concatenate([ np.arange(500, 570, 1), # Step of 1 from 500 to 570 (exclusive) np.arange(570, 590.2, ...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import remove_signature
Python
1
/// /// If a string contains multiple contiguous separators, you will end up /// with empty strings yielded by the iterator: /// /// ``` /// use bstr::{B, ByteSlice}; /// /// let x: Vec<&[u8]> = b"||||a||b|c".rsplit_str("|").collect(); /// assert_eq!(x, vec![ /// B("c"), B("b...
Rust
0
]); assert!(r1.is_ok()); assert!(dest_dir.exists()); fs::remove_dir_all(dest_dir).unwrap(); } } <gh_stars>0 use std::collections::{HashMap, HashSet}; use std::hash::Hash; use std::ops::AddAssign; use std::str::FromStr; fn counter<A, I>(xs: I) -> HashMap<A, usize> where A: Clone + Part...
Rust
0
import cv2 import numpy as np import matplotlib.pyplot as plt #临近插值 def Nearest(img, bigger_height, bigger_width, channels): near_img = np.zeros(shape=(bigger_height, bigger_width, channels), dtype=np.uint8) for i in range(0, bigger_height): for j in range(0, bigger_width): row = (i / bigg...
Python
1
rationResult::Accept(..) => write!(f, "Accept"), OperationResult::Push => write!(f, "Push"), OperationResult::Pop(..) => write!(f, "Pop"), OperationResult::Failed(ref e) => write!(f, "Failed({:?})", e), } } } #![no_std] #![no_main] use cortex_m_rt::entry; use panic_rtt_t...
Rust
0
mut self) -> Self { self.valign = VerticalAlignment::Bottom; self.align = TextAlignment::Right; self } } pub struct TextProcessing; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum LineBreakMode { NoWrap, CharWrapping, WordWrapping, TrancatingTail, } impl Default for ...
Rust
0
import torch from torchoptics import PlanarGrid from torchoptics.profiles import cylindrical_lens_phase def test_cylindrical_lens_phase_shape_and_dtype(): shape = (100, 100) focal_length = 50.0 theta = torch.pi / 4 wavelength = 0.5 spacing = (0.1, 0.1) offset = (0.0, 0.0) phase_profile = ...
Python
1
a rangeproof segment. pub fn rangeproof_segment(&self, id: SegmentIdentifier) -> Result<Segment<RangeProof>, Error> { let now = Instant::now(); let txhashset = self.txhashset.read(); let pmmr = txhashset.rangeproof_pmmr_at(&self.header); let segment = Segment::from_pmmr(id, &pmmr, true)?; debug!( "rangep...
Rust
0
es:**\n\n" batch_map = {} for batch in batches: bi = batch.get("_id") bn = batch.get("name") batch_text += f"📖 `{bi}` → **{bn}**\n" batch_map[bi] = bn query_msg = await app.send_message( chat_id=message.chat.id, text=batc...
Python
1
ut reader) => reader.read(def_level, rep_level).map(Value::U64), ValueReader::I64(ref mut reader) => reader.read(def_level, rep_level).map(Value::I64), ValueReader::F32(ref mut reader) => reader.read(def_level, rep_level).map(Value::F32), ValueReader::F64(ref mut reader) => reader.read(def_level, rep_level).ma...
Rust
0
f) -> List[Dictionary]: return self.state.dictionaries @classmethod def setup_task( cls, cfg: MultiresHubertPretrainingConfig, **kwargs ) -> "MultiresHubertPretrainingTask": return cls(cfg) def load_dictionaries(self): label_dir = self.cfg.data if self.cfg.label_dir is ...
Python
1
""" This module houses the GEOS ctypes prototype functions for the topological operations on geometries. """ __all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull', 'geos_difference', 'geos_envelope', 'geos_intersection', 'geos_linemerge', 'geos_pointonsurface', 'geos_pre...
Python
1
import cv2 import numpy as np import matplotlib.pyplot as plt background = cv2.imread("news.jpg") foreground = cv2.imread("cheburashka.jpg") cv2.namedWindow("TV",cv2.WINDOW_NORMAL) capture = cv2.VideoCapture(0) while capture.isOpened(): ret,frame = capture.read() foreground_points = np.array([[0,0], ...
Python
1
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # DATE_FORMAT = 'j. F Y.' TIME_FORMAT = 'H:i' DATETIME_FORMAT = 'j. F Y. H:i' YEAR_MONTH_FORMAT = 'F Y.' MONTH_DAY_FORMAT = 'j. F' SHORT_DATE_FORMAT = 'j.m.Y.' SHORT_DATETIME_FORMAT = 'j.m.Y. H:i' FIRST_DAY_OF_WEEK = 1 D...
Python
1
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
Python
1
Self::TimeUpdate => 0x04, Self::EntityEquipment => 0x05, Self::SpawnPosition => 0x06, Self::UseEntity => 0x07, Self::UpdateHealth => 0x08, Self::Respawn => 0x09, Self::PlayerFlying => 0x0a, Self::PlayerPosition => 0x0b, ...
Rust
0
kDCI2997); pub const MODE_8KDCI30: DisplayMode = DisplayMode(_BMDDisplayMode_bmdMode8kDCI30); pub const MODE_8KDCI50: DisplayMode = DisplayMode(_BMDDisplayMode_bmdMode8kDCI50); pub const MODE_8KDCI5994: DisplayMode = DisplayMode(_BMDDisplayMode_bmdMode8kDCI5994); pub const MODE_8KDCI60: DisplayMode = Di...
Rust
0
_504" shape = [96] dtype = "float32" min_val = float("9.10764") max_val = float("87.3514") mean = float("47.7536") std = float("20.7812") data = None class Program_weight_tensor_parameter_505: name = "parameter_505" shape = [96] dtype = "float32" min_val = float("-11.2056")...
Python
1
# Pyto.app # note: first implementation to run on ios # interpreter Python 3.8+ in iOS import sys import runpy sys.argv.append('test/fullPresentation.md') sys.argv.append('test.pptx') runpy.run_path('./md2pptx', init_globals={'sys': sys})
Python
1
from mpmath import * def test_diff(): mp.dps = 15 assert diff(log, 2.0, n=0).ae(log(2)) assert diff(cos, 1.0).ae(-sin(1)) assert diff(abs, 0.0) == 0 assert diff(abs, 0.0, direction=1) == 1 assert diff(abs, 0.0, direction=-1) == -1 assert diff(exp, 1.0).ae(e) assert diff(exp, 1.0, n=5).a...
Python
1