text
string
label_name
string
labels
int64
Mult): return left * right elif isinstance(operator, ast.Div): return left / right elif isinstance(operator, ast.FloorDiv): return left // right elif isinstance(operator, ast.Mod): return left % right elif isinstance(operator, ast.Pow): ...
Python
1
} pub const EMPTY_ROOT_HASH: [u8; 32] = [0u8; 32]; <filename>src/generate.rs //! Provides methods to generate random polygons. extern crate rand; use super::*; use self::rand::{thread_rng, sample}; use self::rand::distributions::{IndependentSample, Range}; use std::cmp::Ordering; /// Describes the mode used to gen...
Rust
0
\n.twocol {\ \n width: 14.364640884%;\ \n width: calc((100% - 5rem) / 6);\ \n}\ \n.threecol {\ \n width: 22.9281767956%;\ \n width: calc((100% - 3rem) / 4);\ \n}\ \n.fourcol {\ \n width: 31.4917127072%;\ \n width: calc((100% -...
Rust
0
""" Real labels evaluator for ImageNet Paper: `Are we done with ImageNet?` - https://arxiv.org/abs/2006.07159 Based on Numpy example at https://github.com/google-research/reassessed-imagenet Hacked together by / Copyright 2020 Ross Wightman """ import os import json import numpy as np class RealLabelsImagenet: ...
Python
1
assert_eq!(&super::ENCODER_18.generator[..], &generator_poly(18)[..]); assert_eq!(&super::ENCODER_19.generator[..], &generator_poly(19)[..]); assert_eq!(&super::ENCODER_20.generator[..], &generator_poly(20)[..]); assert_eq!(&super::ENCODER_21.generator[..], &generator_poly(21)[..]); ...
Rust
0
}; use std::path::PathBuf; #[derive(Default, Debug, Deserialize, Clone)] #[serde(default)] pub struct Source { pub path: PathBuf, pub enabled: bool, pub excludes: HashSet<PathBuf>, } #[derive(Default, Debug, Deserialize, Clone)] #[serde(default)] pub struct Settings { pub debug: bool, pub excludes...
Rust
0
acleKey, Blake2_128Concat, T::AccountId, TimestampedValue<UnsignedFixedPoint<T>, T::Moment>, >; #[pallet::storage] /// if a key is present, it means the values have been updated pub type RawValuesUpdated<T: Config> = StorageMap<_, Blake2_128Concat, OracleKey, bool>; /// Tim...
Rust
0
() } fn case01_iter_all(bytes: &[u8]) { bytes.iter().all(|b| b.is_ascii()) } fn case02_align_to(bytes: &[u8]) { is_ascii_align_to(bytes) } fn case03_align_to_unrolled(bytes: &[u8]) { is_ascii_align_to_unrolled(bytes) } } // These are separate since it's easier to ...
Rust
0
8::new(2000)); let invest = query_investment(deps.as_ref()).unwrap(); assert_eq!(invest.token_supply, Uint128::new(3000)); assert_eq!(invest.staked_tokens, coin(4500, "ustake")); assert_eq!(invest.nominal_value, ratio); } #[test] fn bonding_fails_with_wrong_denom() { ...
Rust
0
Config::default() /// } /// ); /// rustlet!("hello_world", { /// response!("Hello World\n"); /// }); /// // maps the uri /hello to the rustlet "hello_world" /// rustlet_mapping!("/hello", "hello_world"); /// Ok(()) /// } /// ``` #[macro_export] macro_rules! rustlet_mapping { ($a...
Rust
0
import math from typing import cast import cairo from gi.repository import Gtk from fabric.widgets.image import Image class CustomImage(Image): def do_render_rectangle( self, cr: cairo.Context, width: int, height: int, radius: int = 0 ): cr.move_to(radius, 0) cr.line_to(width - radiu...
Python
1
null()).status()?; target_dir.push("klee-last/"); Ok(target_dir) } /// Builds the test harness. fn build_test_harness( input: &GenerateInput, cargo_path: &mut PathBuf, target_dir: &mut PathBuf, project_name: &mut String, ) -> Result<ExitStatus, std::io::Error> { let mut cargo = Command::n...
Rust
0
box` crate. /* While this is not a direct copy of the `smallbox` crate, it is heavily based on the smallbox source code, which is licensed MIT as follows: The MIT License (MIT) Copyright (c) 2015 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated doc...
Rust
0
render!( MyTemplate { name: "World" }, include_str!("./templates/file.rendered") ); } use crate::migrate::migration::Migration; pub fn to_sql_migrations(migrations: Vec<Migration>) -> Vec<SqlMigration> { migrations.into_iter().map(SqlMigration::new).collect() } #[derive(Clone, Debug, PartialEq...
Rust
0
always)] pub fn variant(&self) -> crate::Variant<u8, DTOCVACK_A> { use crate::Variant::*; match self.bits { 0 => Val(DTOCVACK_A::_0000), 1 => Val(DTOCVACK_A::_0001), 2 => Val(DTOCVACK_A::_0010), 3 => Val(DTOCVACK_A::_0011), 4 => Val(DTOCVAC...
Rust
0
import pandas as pd SUBSET = "artifacts/viznet-subset.parquet" subset = pd.read_parquet(SUBSET) # shuffle the data subset = subset.sample(frac=1.0, random_state=0) import os import openai from openai import OpenAI from ratelimiter import RateLimiter import pandas as pd import numpy as np from tqdm import tqdm impor...
Python
1
# -*- coding: utf-8 -*- # Copyright(C) 2013 Julien Veyssier # # This file is part of a weboob module. # # This weboob module 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 Lice...
Python
1
# -*- coding: utf-8 -*- # # RERO ILS # Copyright (C) 2022 RERO # Copyright (C) 2022 UCLouvain # # 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, version 3 of the License. # # This program ...
Python
1
+= len(objs) self.assertEqual(obj_count, 6) def test_update(self): self.serializer_pop_related_fields_data_patcher.start() expected_data = {"name": "John", "last_name": "Richards"} instance = MockModel(name="John", last_name="Doe") instance = self.mock_serializer.update(...
Python
1
stars>1-10 use super::Dce; use swc_common::{Fold, FoldWith, Spanned}; use swc_ecma_ast::*; use swc_ecma_utils::{find_ids, ident::IdentLike}; impl Fold<FnDecl> for Dce<'_> { fn fold(&mut self, mut f: FnDecl) -> FnDecl { if self.is_marked(f.span()) { return f; } if self.marking_p...
Rust
0
import numpy as np from simple_Rabbitmq import ACT if __name__ == "__main__": # Create a sample P array P = np.array([[1, 2, 3], [0, 0, 0], [0, 0, 0]]) # Create an instance of the ACT class with the sample array and an array_ID act_instance = ACT(P, "array_001") ...
Python
1
e_or_series) msg = r"take\(\) got an unexpected keyword argument 'foo'" with pytest.raises(TypeError, match=msg): obj.take(indices, foo=2) msg = "the 'out' parameter is not supported" with pytest.raises(ValueError, match=msg): obj.take(indices, out=indices) ...
Python
1
with the `sgx_get_key()` inside-the-enclave method. #[derive(Default)] pub struct KeyRequest(sgx_key_request_t); impl_ffi_wrapper_base! { KeyRequest, sgx_key_request_t, KEY_REQUEST_SIZE; } impl_serialize_to_x64! { KeyRequest, KEY_REQUEST_SIZE; } impl KeyRequest { /// Retrieve the name of the key containe...
Rust
0
#################################################################################################### # # PySpice - A Spice Package for Python # Copyright (C) 2014 Fabrice Salvaire # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published...
Python
1
def is_pandas_df(obj): """Check if an object is a Pandas DataFrame Returns ------- bool Returns True if object is a Pandas DataFrame and False otherwise """ return obj.__class__.__module__ == "pandas.core.frame" and obj.to_records and obj.to_dict def has_geo_interface(obj): return...
Python
1
from reportlab.pdfgen import canvas import os def save_pdf_with_qr_code(filedialog, entry_data, fill_color_var, bg_color_var, logo_path_var, transparent_bg_var, shape_var, error_correction_var, size_var, border_width_var, watermark_var, gradient_color_var, create_qr_code): file_path = filedialog.asksaveasfilenam...
Python
1
alpha: HidePH<A>, beta: B, gamma: HidePH<G>, } #[derive(Debug, Arbitrary)] struct T4(T3<NotArbitrary, bool, NotArbitrary>); */ #[derive(Debug, Arbitrary)] #[proptest(no_bound)] struct T5<A, B, C>(HidePH<(A, B, C)>); #[derive(Debug, Arbitrary)] struct T6(T5<NotArbitrary, NotArbitrary, NotArbitrary>); #[t...
Rust
0
iptor { static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, }; unsafe { descriptor.get(|| { ...
Rust
0
dd_input( var_name="cross_section_Ix", var_type=float, default_value=-1, unit=None, descr="Enter the second moment of area of the cross-section \ about the horizontal axis, in m⁴.", xpath=FRAMAT_IX_XPATH, gui=INCLUDE_GUI, gui_name="Second moment of area Ix [m⁴]", gui_grou...
Python
1
with pl.SQLContext(frame=df) as ctx: res1 = ctx.execute( """ SELECT c, SUM(b) AS total_b, COUNT(b) AS count_b, COUNT(*) AS count_star FROM frame GROUP BY 1 ORDER BY c """ )...
Python
1
. current tab, scroll state of scorecard pub struct UiState { /// Selected tab pub focused_tab: usize, /// Stores current scroll value and max scroll value for each tab pub scrd_scroll: Vec<(u16, u16)>, } impl UiState { /// Return a new `UiState` struct /// /// # Arguments /// /// *...
Rust
0
tionState.BAD_PASSWORD: raise InvalidAuth if self.authentication.state == AuthenticationState.REQUIRES_VALIDATION: raise RequireValidation if self.authentication.state != AuthenticationState.AUTHENTICATED: _LOGGER.error("Unknown authentication state: %s", self.authe...
Python
1
class Solution: def makeLargestSpecial(self, s: str) -> str: specials = [] count = 0 i = 0 for j, c in enumerate(s): count += 1 if c == '1' else -1 if count == 0: specials.append( '1' + self.makeLargestSpecial(s[i + 1:j]) + '0') i = j + 1 return ''.join(so...
Python
1
alue::AnyOutputs(_) => f.write_str("Any Outputs"), } } } fn log_error<T>(req: DbKey, err: OutputManagerStorageError) -> Result<T, OutputManagerStorageError> { error!( target: LOG_TARGET, "Database access error on request: {}: {}", req, err.to_string() ); Err(err)...
Rust
0
kend = BitMapBackend::new(path.as_ref(), self.size); self.plot_with_backend(backend, targets, db, relative, transitive, start_date) } } } pub fn plot_with_backend<T, U>( &self, backend: T, targets: &[U], db: &Db, relative: bool, ...
Rust
0
ever have to worry about. // // The only reason alignment matters is that, in order to learn what data // is bound, we would normally first load the type descriptors: but their // location is ultimately depend on their content! There is, however, a // workaround. We can load the tydesc from the rust_opaque_box, whic...
Rust
0
: Res<Time>, audio: Res<Audio>, music: Res<AudioAssets>, ) { for event in er_stats_change.iter() { for (e, mut card) in query.iter_mut() { if card.id == event.card_id { if event.hp < 0 { audio.play_in_channel(music.attack.clone(), &AudioChannel::new("S...
Rust
0
import functools import threading from typing import ( Any, Callable, Set, Tuple, TypeVar, cast, ) import warnings from web3.exceptions import ( Web3ValueError, ) TFunc = TypeVar("TFunc", bound=Callable[..., Any]) def reject_recursive_repeats(to_wrap: Callable[..., Any]) -> Callable[...,...
Python
1
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport def execute(filters=None): args = { "account_type": "Payable", "naming_by": ["Buying...
Python
1
v); println!("vec 3 is {:?}", v[3]); // 访问动态数组里面的元素 println!("vec 5 is {:?}", v.get(5)); // 同上 vecShow(v); // 双端队列 let mut vd: VecDeque<u32> = VecDeque::new(); let mut _vd: VecDeque<u32> = VecDeque::with_capacity(10); vd.push_back(1); vd.push_back(2); vd.push_front(1); vd.push_...
Rust
0
backward_ops) so undo/redo remains correct. """ fwd, bwd = [], [] cur = getattr(node, "parent", None) if toggled_to is False: # any "not completed" child means parent can't be completed while cur is not None: before = bool(getattr(cur, "completed", False)) if bef...
Python
1
import pyroute2 extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.inheritance_diagram', 'aafigure.sphinxext', 'code_include.extension', ] aafig_format = {'html': 'svg', 'man': None, '': None} inheritance_graph_attrs = {'rankdir': 'LR', 'ratio': 'auto'} source_suffix = '.rst' ...
Python
1
from typing import Annotated, Literal from langchain_ollama import ChatOllama from langchain_tavily import TavilySearch from langchain_core.messages import BaseMessage, AIMessage, ToolMessage from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder from typing_extensions import TypedDict from langgrap...
Python
1
ble = "neon")] unsafe fn test_vmulq_u8() { let a: u8x16 = u8x16::new(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2); let b: u8x16 = u8x16::new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); let e: u8x16 = u8x16::new(1, 4, 3, 8, 5, 12, 7, 16, 9, 20, 11, 24, 13, 28, 15, 32); ...
Rust
0
-> Result<SpendInfo, TaprootErr> { // The tree needs to consist of a single node to be considered complete. // In this case, the first node needs to be some and the rest of the nodes array needs to be none. let non_root_nodes = &self.nodes[1..]; if self.nodes[0].is_none() || !non_root_n...
Rust
0
2, tir.Evaluate(tir.IntImm("int32", 0)), tir.Evaluate(tir.IntImm("int32", 1)), ) # Check if the generated ir is expected assert_structural_equal(ir_actual, ir_expected, map_free_vars=True) def test_ir_builder_tir_buffer_store(): buffer_a = T.buffer_decl((10, 10), "float32") i = T....
Python
1
for RandomStringGenerator { type Item = String; fn next(&mut self) -> Option<String> { loop { let n_words = self.rng.gen_range(1, self.max_words); let generated_value = self .vocabulary .iter() .choose_multiple(&mut self.rng, n_wo...
Rust
0
df_indexes = [] columns = df.columns.tolist() print("colunas", columns) for i in range(len(columns)): column = columns[i] column_values = df[column].tolist() print("ddd", column_values) indexes = select_mean(i, column_values, columns, n_solutions) df_indexes += i...
Python
1
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2020 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # T...
Python
1
return { "success": True, "username": username, "profile_data": profile_data, "message": f"Successfully fetched profile for @{username}" } except HTTPException as e: return { "success": False, "username": username, ...
Python
1
# -*- coding: UTF-8 -*- ''' bnwmovies scraper for Exodus forks. Nov 9 2018 - Checked Updated and refactored by someone. Originally created by others. ''' import re,traceback,urllib,urlparse,base64 import requests from resources.lib.modules import cleantitle from resources.lib.modules import client fro...
Python
1
:rtype: str """ return self._Remark @Remark.setter def Remark(self, Remark): self._Remark = Remark def _deserialize(self, params): self._MiniAppID = params.get("MiniAppID") self._MiniAppName = params.get("MiniAppName") self._Mode = params.get("Mode") ...
Python
1
Item number. column : int Column number. """ # check all / uncheck all state show_all_item = self.filter_treewidget.topLevelItem(0) level_items = [show_all_item.child(ii) for ii in range(show_all_item.childCount())] if item is show_all_item: ...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2017, Rambler Digital Solutions # # 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 app...
Python
1
st|tstS|j|jkSrrr9rr;rrrrrs z Frame.__eq__cCst|tstS|j|jkSrrBrrrr__lt__s z Frame.__lt__cCs t|jSr)rr;rrrrrs...
Python
1
): # if box motion > no_align_for_disp_below: # flip box if motion is opposite to orientation # also, align box to motion direction assert no_align_for_displacement_below_m < full_align_for_displacement_above_m, ( no_align_for_displacement_below_m, full_align_for_displacement_above_m, ...
Python
1
::c_void)>; /// No error pub const HT_ErrorCode_HT_ERR_OK: HT_ErrorCode = 0; /// Unknown error pub const HT_ErrorCode_HT_ERR_UNKNOWN: HT_ErrorCode = 1; /// Memory allocation failed. This is very serious error, and /// most likely your entire application is broken at this point of time. pub const HT_ErrorCode_HT_ERR_OUT...
Rust
0
import os import json import torch os.environ['CUDA_VISIBLE_DEVICE'] = '1' import pandas as pd import numpy as np from tqdm import tqdm from pathlib import Path from transformers import * pretrained_weights = 't5-small' tokenizer = T5Tokenizer.from_pretrained(pretrained_weights) model = T5EncoderModel.from_pretrained(...
Python
1
from imaginairy.vendored.refiners.foundationals.clip.text_encoder import ( CLIPTextEncoderL, ) from imaginairy.vendored.refiners.foundationals.latent_diffusion.auto_encoder import ( LatentDiffusionAutoencoder, ) from imaginairy.vendored.refiners.foundationals.latent_diffusion.freeu import SDFreeUAdapter from im...
Python
1
largest_count = 0; let mut largest_value = 0; let mut largest_value_at = 0; let mut work_at = 0; let mut registers: [u64; 6]; // This loop runs twice, first in test mode and then in actual mode. // The test mode is used to determine where the critical loop takes place. // The loop is just at attempt at N % D ...
Rust
0
etem_args.add_argument( '--delay', type=int, default=0, help='specify an overall delay for each packet') netem_args.add_argument( '--jitter', type=int, default=0, help='specify amount of jitter in milliseconds') netem_args.add_argument( '--...
Python
1
# 相关故障 relationguzhangs = [] # 相关操作引起的现象 for caozuo in similarcaozuos: relationguzhangs += findEntities(caozuo, '引起') # 根据故障部位和报警信息寻找现象 for entity2 in buweilist: relationguzhangs += findEntities2(entity2, '故障部位') for entity2 in erroridlist: relationguzhangs += find...
Python
1
]))) unit_area = np.asarray(unit_area) # Determine Cell Midpoints azm_mdpts = lazm + azinc/2. # midpoints between azimuthal gridlines azm_mdpts = azm_mdpts[0:-1] # don't include value > 360. del_mdpts1 = ldel1 + delinc1/2. # midpoints...
Python
1
DataType::Float64, false), Field::new("f", DataType::Boolean, false), Field::new("g", DataType::Utf8, true), Field::new( "h", DataType::List(Box::new(Field::new("item", DataType::Int32, true))), false, ), Field::new( "enum", ...
Rust
0
from typing import * from hypercat.core.core import Category, Object, Morphism class Topos(Category): """Represents an elementary topos.""" def __init__(self, name: str): super().__init__(name) self.terminal_object: Optional[Object] = None self.subobject_classifier: Optional[Object...
Python
1
where T: NotMyTrait<'static>, { } unsafe impl<'a, Q, R: ?Sized> Send for NotInner<'a, Q, R> where Q: NotMyTrait<'a>, <Q as NotMyTrait<'a>>::MyItem: Copy, R: for<'b> Fn((&'b bool, &'a u8)) -> &'b i8, Foo<Q>: Send, { } //! Position types for various widgets. /// Storing information about where new ...
Rust
0
# Copyright 2020 The ElasticDL Authors. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
1
import torch # We are going to create and see some random tensors # They're important because the way many neural networks learn is that they start with # tensors full of random numbers # Create a random tensor of size (3,4) random_tensor = torch.rand(3, 4) print(random_tensor) print(random_tensor.ndim) # Create a r...
Python
1
Req = 10301 SendMailRsp = 10302 NewMailNotify = 10303 ReceiveMailReq = 10304 ReceiveMailRsp = 10305 UpdateMailNotify = 10306 ClearMailBoxDataNotify = 10307 SendOfflineMsgReq = 10308 SendOfflineMsgRsp = 10309 NewOfflineMsgNotify = 10310 GetOfflineMsgReq = 10311 GetOfflineMsgRs...
Python
1
for cmd in COMMANDS { let &(cmd_name, _, _, cmd_func) = cmd; if name == cmd_name { return Some(cmd_func); } } None } pub fn usages() { for &(name, usage, description, _) in COMMANDS { println!("\t{} {}: {}", name, usage, description); } } <gh_stars>1-10 use ...
Rust
0
NotSupportTask, NotRecongize, BadOption(String), } impl Error for UptError {} impl fmt::Display for UptError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { use UptError::*; match self { NoVendor(v) => write!(f, "Vendor {} is not supported", v), NotSupportO...
Rust
0
depth > 0 { return Some(path) } } return None; } //-- DirContent ------------------------------------------------------------------------------------ /// Represents directory entries matching certain criteria like GLOB name pattern and type (files, /// directories or units). /// /// Matc...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @File : decision_tree.py # @Data : 2020/5/23 # @Author : Luo Kun # @Contact: luokun485@gmail.com import numpy as np class DecisionTree: """ Decision tree classifier(决策树分类器, ID3生成算法) """ def __init__(self): self.rate, self.root = None, None...
Python
1
cont = 0 multi = 0 num = int (input("Enter a number: ")) while cont < 10: cont += 1 multi = num * cont print(f'{num} x {cont} = {multi}') if lti % 3 == 0:
Python
1
lot(item_id) frame_id = UIManager.GetChildFrameID(_get_parent_hash(),_get_offsets(bag_id, slot)) is_visible = UIManager.FrameExists(frame_id) if not is_visible: continue left,top, right, bottom = UIManager.GetFrameCoor...
Python
1
obj: CaseStyle) -> String; } /// Trait for 'delimiter spaced' style strings, such as snake_case and kebab-case pub trait DelimiterSpaced: Debug { fn spacing_char(&self) -> char; fn do_uppercase(&self) -> bool { false } } impl<T> Case for T where T: DelimiterSpaced, { fn parse_str(&self, i...
Rust
0
ex] try: popt, pcov = curve_fit(exp_function, np.arange(len(sf_values)), sf_tuning_responses, p0=[np.amax(sf_tuning_responses), 2., np.amin(sf_tuning_responses)], maxfev=2000) sf_prediction = exp_function(np.arange(0., 4.1, 0.1), *popt) if p...
Python
1
bid: bid_pips as usize, ask: ask_pips as usize, } } } #[derive(Serialize, PartialEq, Clone)] struct DownloadDescriptor { symbol: String, start_time: u64, cur_time: u64, end_time: u64, dst: HistTickDst, } struct DataDownloader { uuid: Uuid, cs: CommandServer, run...
Rust
0
from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field if TYPE_CHECKING: from ..models.home_tab import HomeTab T = TypeVar("T", bound="HomeTabCreateResult") @_attrs_define class HomeTabCreateResult: ...
Python
1
(), team_1: team_1.clone(), team_1_goals: team_1_goals.clone(), team_2_goals: team_2_goals.clone() }; do_submit(&mut submit); } } } fn fetch(season: u32) { let url = format!("https://api.openligadb.de/getmatchdata/bl1/{:}", season...
Rust
0
gpu::Surface, adapter: wgpu::Adapter, device: wgpu::Device, queue: wgpu::Queue, } pub const TEXT_COLOR: Color = Color { r: 0.839, g: 0.839, b: 0.839, a: 1.0, }; pub const RED_HIGHLIGHT: Color = Color { r: 1.0, g: 0.0, b: 0.384, a: 1.0, }; pub const AZURE_HIGHLIGHT: Color = C...
Rust
0
assert_eq!(Length::from_metres(-10.0), delta_0.y().round(Millimetre)); assert_eq!(Length::from_metres(0.0), delta_0.z().round(Metre)); assert_eq!(358.0, delta_0.azimuth().decimal_degrees().round()); let delta_1 = ship_position_1.delta_w_to(Angle::from_decimal_degrees(90.0), sensor_position); asser...
Rust
0
_eq!(q.dequeue(), Some((1, ()))); assert_eq!(q.dequeue(), Some((3, ()))); assert_eq!(q.dequeue(), None); q.finish(&3, &()); assert_eq!(q.dequeue(), None); q.finish(&1, &()); assert_eq!(q.dequeue(), Some((2, ()))); assert_eq!(q.dequeue(), None); q.finish(&2...
Rust
0
.register.set(f(&R { bits }, &mut W { bits }).bits); } #[doc = r"Reads the contents of the register"] #[inline(always)] pub fn read(&self) -> R { R { bits: self.register.get(), } } #[doc = r"Writes to the register"] #[inline(always)] pub fn write<F>(&self, f: ...
Rust
0
e: challenge, } } fn generate_verifier(&self, size: usize) -> String { self.rsg.generate(size) } fn generate_challenge(&self, verifier: &str) -> String { let digest = Sha256::digest(verifier.as_bytes()); base64::encode_config(digest, base64::URL_SAFE_NO_PAD) } } #[...
Rust
0
e empty FEN")), test_default_fen: ("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", Ok(Board::default())), test_only_board_portion: ("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR", Err("Incorrect number of fields")), test_not_enough_rows: ("rnbqkbnr/pppppppp/8/8/8/PPPPPPPP/RNBQKBNR w K...
Rust
0
/// let mut file_write = OpenOptions::new() /// .write(true) /// .append(true) /// .create(true) /// .open(&file_path) /// .unwrap(); /// /// write!(file_write, "Hello, world 1\n").unwrap(); /// write!(file_write, "Hello, world 2\n").unwrap(); /// /// let (stream, _) = ...
Rust
0
] } } <reponame>nickray/lpc55s69-pac<filename>src/dma0/busy0.rs<gh_stars>1-10 #[doc = "Register `BUSY0` reader"] pub struct R(crate::R<BUSY0_SPEC>); impl core::ops::Deref for R { type Target = crate::R<BUSY0_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl...
Rust
0
=> x, _ => { return syn::Error::new_spanned(ast, "Xxx only works for structs.") .to_compile_error() .into() } }; let field = match &struct_ast.fields { syn::Fields::Unnamed(x) if x.unnamed.len() == 1 => &x.unnamed[0], _ => { ...
Rust
0
2h/2".parse().unwrap(), "<KEY>", "<KEY>"); // m/0h/1/2h/2/1000000000 test_path(&secp, Bitcoin, &seed, "m/0h/1/2h/2/1000000000".parse().unwrap(), "<KEY>", "<KEY>"); } #[test] fn test_vector_2() { let secp = Secp...
Rust
0
print!("{:6} ", a.0[i]); } println!(); } #[target_feature(enable = "simd128")] #[allow(dead_code)] pub unsafe fn halfsimd_dbg_i8(v: HalfSimd) { #[repr(align(16))] struct A([i8; L * HALFSIMD_MUL]); let mut a = A([0i8; L * HALFSIMD_MUL]); halfsimd_store(a.0.as_mut_ptr() as *mut HalfSimd, v); ...
Rust
0
re.fix(101325) m.fs.mix.fuel.flow_mol.fix(fuel_total) m.fs.R101.conversion_Rbl.fix(1) m.fs.R101.conversion_RCH4.fix(0) m.fs.R101.dh_rxn_RCH4.fix(-802125) m.fs.R101.dh_rxn_Rbl.fix(-135150) m.fs.R101.outlet.temperature.fix(195.66+273.15) m.fs.mix.initialize(outlvl=idaeslog.INFO) m.fs.R101.initialize(outlvl=idaes...
Python
1
s)].solution_value == 1: n = { 'user': u.id, 'server': s, 'migration': "yes" if _is_migration(u, s) else "no" } user_assignment.append(n) solution_dict['user assignment'] = user_assignment json_file.write(json.dumps(solution_dic...
Python
1
#!/usr/bin/env python3 """ Encoding-based XSS Payloads Various encoding techniques for XSS payload obfuscation. Company: EasyProTech LLC (www.easypro.tech) Dev: Brabus Created: Вс 10 авг 2025 19:35:00 MSK Telegram: https://t.me/EasyProTech """ from typing import List import base64 import urllib.parse import html ...
Python
1
""" Classifies: CHEBI:22315 alkaloid """ """ Classifies: CHEBI:3230 alkaloid """ from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import rdMolDescriptors def is_alkaloid(smiles: str): """ Determines if a molecule is an alkaloid based on its SMILES string. Alkaloids are naturally occurr...
Python
1
0d, 0x0a, 0x05, 0x05, 0x10, 0x02, 0x03, 0x02, 0x12, 0x04, 0xdd, 0x04, 0x1a, 0x1b, 0x0a, 0x0c, 0x0a, 0x04, 0x05, 0x10, 0x02, 0x04, 0x12, 0x04, 0xde, 0x04, 0x08, 0x1b, 0x0a, 0x0d, 0x0a, 0x05, 0x05, 0x10, 0x02, 0x04, 0x01, 0x12, 0x04, 0xde, 0x04, 0x08, 0x16, 0x0a, 0x0d, 0x0a, 0x05, 0x05, 0x10, 0x02, 0x04, 0x02...
Rust
0
. Each sampled texture is exposed to the shader as a combined texture-sampler binding. When building the pipeline layout, we linearize binding entries based on the groups (uniform/storage buffers, uniform/storage textures), and record the mapping into `BindGroupLayoutInfo`. When a pipeline gets created, and we track a...
Rust
0
self.message = swap.message2.clone(); } if self.message.is_none() { self.message = Some(BuyApi::init_redeem_message(swap)?); } Ok( StateProcessRespond::new(StateId::BuyerSendingInitRedeemMessage) .action(Action::BuyerSendInitRedeemMessage( self.message.clone...
Rust
0
s_hash.iter().map(u256_to_hex).collect::<Vec<String>>(), ) .finish() } } impl Block { pub fn new( work_hash: U256, height: u32, flag: BlockFlag, bias: f32, header: BlockHeader, txs_hash: Vec<U256>, ) -> Self { Block { ...
Rust
0
ard_to(10); assert_ok!(Democracy::unlock(Origin::signed(5), 5)); assert_eq!(Balances::locks(5), vec![the_lock(10)]); fast_forward_to(17); assert_ok!(Democracy::remove_vote(Origin::signed(5), r.0)); assert_ok!(Democracy::unlock(Origin::signed(5), 5)); assert_eq!(Balances::locks(5), vec![the_lock(10)]); fa...
Rust
0