text
string
label_name
string
labels
int64
} } <filename>781_num_rabbits/num_rabbits.rs /* * @Date: 2021-04-04 19:46:46 * @Author: <NAME> * @LastEditors: <NAME> * @LastEditTime: 2021-04-04 19:51:09 */ fn num_rabbits(answers: Vec<i32>) -> i32 { let mut map: std::collections::HashMap<i32, i32> = std::collections::HashMap::new(); for i in answer...
Rust
0
doc = "HOST_PIPE Pipe Interrupt Flag Set"] pub mod pintenset; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::Binary; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct InstantiateMsg { pub owner: String, pub admin_claim_period: u64, } #[derive(...
Rust
0
""" Count the number of LIS -> Keep a count array to keep track of the counts. cnt[i]: Stores the count that can be achieved at i dp[i] : Stores the length of LIS that can be achieved at i. If we are updating the dp table, then cnt remains same but if we are satisfying the LIS condition but the dp table is not increas...
Python
1
ovided URI are deleted. unsafe fn delete_cookies( &self, /* in */ name: LPCWSTR, /* in */ uri: LPCWSTR, ) -> HRESULT; /// Deletes cookies with matching name and domain/path pair. /// Cookie name is required. /// If domain is specified, deletes only cookies with the exact dom...
Rust
0
my_list = [42, 69, 322, 13, 0, 99, -5, 9, 8, 7, -6, 5] index = 0 while index < len(my_list): if my_list[index] < 0: break if my_list[index] > 0: print(my_list[index]) index += 1
Python
1
assert constant_size % (n * k) == 0 storage_size = constant_size // (n * k) return [storage, storage_size] elif scope == "nvcuda::wmma::accumulator": storage = "nvcuda::wmma::fragment<" + scope + ", " + storage_shape + ", " + dtype + ">" assert constant_size % (m ...
Python
1
1.00 = V - 0.81(V-R) + 0.13 # r for V-R > 1.00 = V - 0.84(V-R) + 0.13 # u-g = 1.33(U-B) + 1.12 # g-r = 0.98(B-V) - 0.19 # r-i for R-I < 1.15 = 1.00(R-I) - 0.21 # r-i for R-I > 1.15 = 1.42(R-I) - 0.69 # r-z for R-I < 1.65 = 1.65(R-I) - 0.38 # r-z for R-I > 1.65 = 2.64(R-I) - 2.16 #################### ## ugriz -> U...
Python
1
ss.run(tf_compat.v1.global_variables_initializer()) got_logits = sess.run(built_ensemble.logits) if add_mean_last_layer_predictions: got_predictions = sess.run(built_ensemble.predictions) logits = sess.run([s.logits for s in subnetworks]) last_layer = sess.run([s.last_layer f...
Python
1
\u{93c}\u{94d}ल\u{948}श वाला क\u{948}मरा", "वीडियो", ], }, #[cfg(feature = "hr")] crate::Annotation { lang: "hr", tts: Some("fotoaparat s bljeskalicom"), keywords: &[ "bljeskalica", "fotoaparat", ...
Rust
0
from numba.testing import load_testsuite import os def load_tests(loader, tests, pattern): return load_testsuite(loader, os.path.dirname(__file__))
Python
1
2008) X = [.2,.2,.2,.2,.2] Y = [.322,.072,.511,.091,.004] for i in X: print(shannoninfo(i)) for i in Y: print(shannoninfo(i)) print(shannonentropy(X)) print(shannonentropy(Y)) p = [1e-5,1e-4,.001,.01,.1,.15,.2,.25,.3,.35,.4,.45,.5] plt.subplot(111) plt.ylabel("Inf...
Python
1
import numpy as np from typing import Tuple, Union from xrprimer.utils.log_utils import get_logger, logging from .smpl_data import SMPLData from .smplx_data import SMPLXData from .smplxd_data import SMPLXDData __all__ = ['SMPLData', 'SMPLXData', 'SMPLXDData'] _SMPL_DATA_CLASS_DICT = dict( SMPLData=SMPLData, SMPL...
Python
1
[I32, I32, I32, I32, I32], Some(I32)); pub const SUICIDE: StaticSignature = StaticSignature(&[I32], None); pub const BLOCK_HASH: StaticSignature = StaticSignature(&[I64, I32], None); pub const BLOCK_NUMBER: StaticSignature = StaticSignature(&[], Some(I64)); pub const BLOCK_AUTHOR: StaticSignature = StaticSignat...
Rust
0
].level, sentry::Level::Info); assert_eq!(event.breadcrumbs[0].message, Some("Hello World!".into())); } <gh_stars>1-10 use crate::ids::{canister_test_id, node_test_id, subnet_test_id, user_test_id}; use ic_types::crypto::{AlgorithmId, KeyId, KeyPurpose, UserPublicKey}; use ic_types::messages::{Payload, RejectContex...
Rust
0
translatedresponse=translateenaz(response.text,lang) bot.delete_message(message.chat.id, msg_id) bot.reply_to(message,f'{flag.flag(lang)} - {translatedresponse}') os.remove('output.jpg') except: try: translatedresponse=translateenaz...
Python
1
lhs = new_expr( NodeType::DEREF, Some(Box::new(t.clone())), new_binop( NodeType::ADD, Some(Box::new(t.clone())), lhs, assign(tokens), ), ); ...
Rust
0
lue."] #[inline(always)] pub fn thr_zero_en_u3(&mut self) -> THR_ZERO_EN_U3_W { THR_ZERO_EN_U3_W { w: self } } #[doc = "Bit 12 - This is the enable bit for comparing unit3's count with thr_h_lim value."] #[inline(always)] pub fn thr_h_lim_en_u3(&mut self) -> THR_H_LIM_EN_U3_W { T...
Rust
0
include_bytes!("static/fonts/Roboto-Regular.ttf"), "font/ttf", ); static_files.add( "fonts/Roboto-Medium.ttf", include_bytes!("static/fonts/Roboto-Medium.ttf"), "font/ttf", ); static_files } fn add(&mut self, name: &'static st...
Rust
0
:idastar(1, 1000); match moves{ Some(vector) => println!("Moves: {:?}", vector), None => (), } } <reponame>kuoyehs/WhatSubs use frame_support::{ decl_module, decl_storage, decl_event, decl_error, ensure, StorageValue, StorageMap, Parameter, traits::{Randomness, Currency, ExistenceRequirement, ...
Rust
0
/ @generated // https://github.com/Manishearth/rust-clippy/issues/702 #![allow(unknown_lints)] #![allow(clippy)] #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(box_pointers)] #![allow(dead_code)] #![allow(missing_docs)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(non_upper_case_globals)] #![allo...
Rust
0
::set_metadata("EMBUILD_ESP_IDF_PATH", build_output.esp_idf.try_to_str()?); build_output.cincl_args.propagate(); if let Some(link_args) = build_output.link_args { link_args.propagate(); } Ok(()) } /// Calculate the mean/average value of a &[<Into<f64> + Copy>]. /// /// Returns a f64 value. //...
Rust
0
import time,unit_generate,base64 def generate_dict(dict, ramdom_float_num, ua,frist_time,sessionID,apipath,webpath ): nowtime = int(time.time() * 1000) dict['d'] = nowtime dict['e'] = ua dict['s'] = sessionID dict['u'] = apipath dict['c'] = webpath dict['f']['i_e'] = frist_time dict['f']...
Python
1
{ type Item = ($($a::Item,)+); unsafe fn next(&mut self) -> ($($a::Item,)+) { #![allow(non_snake_case)] let ($($a,)+) = self; ($($a.next(),)+) } } impl<$($a),+> ArchetypeRefs for ($($a,)+) where ...
Rust
0
import time import opcua.ua from opcua import Client client = Client("opc.tcp://192.168.0.101:4840") # Initiate # Connect to Server client.connect() node_AuxInit = client.get_node("ns=4;i=9") node_Marcha = client.get_node("ns=4;i=7") # ------- Simular arranque de máquina node_AuxInit.set_value(True) time.sleep(1) n...
Python
1
fn reset_value() -> Self::Ux { 0 } } <filename>target/release/build/typenum-dad1e3c5e3f02b9b/out/consts.rs /** Type aliases for many constants. This file is generated by typenum's build script. For unsigned integers, the format is `U` followed by the number. We define aliases for - Numbers 0 through 102...
Rust
0
import os, pickle import numpy as np import matplotlib.pyplot as plt def write_pkl(path: str, data: list): # Open the file in binary mode and write the list using pickle with open(path, 'wb') as f: pickle.dump(data, f) # Generate the source and receiver list # Please note that in Seistorch, # the coo...
Python
1
self, uri_path: String, nonce: u64, body: &str, ) -> Result<HeaderValue> { if let Some(credentials) = &self.credentials { type HmacSha512 = Hmac<Sha512>; // API-Sign = Message signature using HMAC-SHA512 of (URI path + // SHA256(nonce + POST data)...
Rust
0
_id` - The ID of the mouse. /// /// - `NSTDFloat64 x` - The number of pixels the cursor has moved on the x-axis. /// /// - `NSTDFloat64 y` - The number of pixels the cursor has moved on the y-axis. pub on_mouse_move: Option<unsafe extern "C" fn(&mut NSTDEventData, NSTDDeviceID, f64, f64)>, /// C...
Rust
0
# object_creator.py import tensorflow as tf import numpy as np from tensorflow.keras.layers import Input, Dense, Reshape, Flatten from tensorflow.keras.layers import BatchNormalization, LeakyReLU from tensorflow.keras.models import Model class ObjectCreator: def __init__(self): self.gan = self.build_gan() ...
Python
1
olumn_stack((zeros, Y, zeros)) axis = [1] elif nx == 1 and ny == 1: points = np.column_stack((zeros, zeros, Z)) axis = [2] elif nx == 1: points = np.column_stack((zeros, Y, Z)) axis = [1, 2] elif ny == 1: points = np.column_stack((X, zeros, Z)) axis = ...
Python
1
} max_test!(u8, core::u8::MAX); max_test!(u16, core::u16::MAX); max_test!(u32, core::u32::MAX); max_test!(u64, core::u64::MAX); max_test!(u128, core::u128::MAX); max_test!(usize, core::usize::MAX); } #[test] fn big() { new_wire_with_val!(256,...
Rust
0
er: ::std::option::Option<ZypperSettings>, /// Windows update settings. Use this override the default windows patch rules. #[prost(message, optional, tag = "7")] pub windows_update: ::std::option::Option<WindowsUpdateSettings>, /// The ExecStep to run before the patch update. #[prost(message, option...
Rust
0
import docker import json def to_mounts_string(mounts): l = [] for m in mounts: l.append('Type = {}, Source = {}, Target = {}' .format(m.get('Type'), m.get('Source'), m.get('Target'))) return json.dumps(l, sort_keys=True, indent=4, ensure_ascii=False) def to_networks_string(nets): l =...
Python
1
long as the socket is unroutable, attempting to send packets will /// fail on a per-packet basis. If the socket later becomes routable again, /// these operations will succeed again. #[allow(dead_code)] StayOpen, /// The socket should close. /// /// When a call to [`Socket::apply_update`] r...
Rust
0
clone()); paragraph.render(rect.clone(), &mut buffer); assert_eq!(buffer.content[6].bg, tui::style::Color::Red); } #[test] fn corrected_space_rendered_bg_green() { let mut text = make_text_model(); text.type_character('I'); text.type_character('x'); ...
Rust
0
use dep group let dep = CellDep::new_builder() .out_point(tx2_out_point.clone()) .dep_type(DepType::DepGroup.into()) .build(); let tx3 = TransactionBuilder::default() .cell_dep(dep) .input(CellInput::new(OutPoint::new(h256!("0x3").pack(), 0), 0)) .output( ...
Rust
0
#!/usr/bin/env python2 # search-gadgets.py # # Copyright 2010 Long Le Dinh <longld at vnsecurity.net> # # This program 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...
Python
1
Handle, ) -> Dart_Handle; } extern "C" { pub fn Dart_True() -> Dart_Handle; } extern "C" { pub fn Dart_False() -> Dart_Handle; } extern "C" { pub fn Dart_NewBoolean(value: bool) -> Dart_Handle; } extern "C" { pub fn Dart_BooleanValue(boolean_obj: Dart_Handle, value: *mut bool) -> Dart_Handle; } exte...
Rust
0
opt = Some(d.clone()); } } } insert_for_graph(vec)?; Ok(()) } /// inserting rows one by one is super slow because of each transaction /// bulk insert with one transaction is super fast pub fn insert_for_graph(vec: Vec<DataForGraph>) -> Result<()> { //println!("insert_for_graph start...
Rust
0
return residues, d, h def print_params(poles, residues, d, h): cfmt = "{0.real:g} + {0.imag:g}j" print("poles: " + ", ".join(cfmt.format(p) for p in poles)) print("residues: " + ", ".join(cfmt.format(r) for r in residues)) print("offset: {:g}".format(d)) print("slope: {:g}".format(h)) def vectfi...
Python
1
println!("cargo:rustc-link-search={}", out_dir.display()); } <filename>examples/014/main.rs use noise::{NoiseFn, Perlin}; use std::f32::consts::PI; use svg::node::element::path::Data; use svg::node::element::*; use svg::Document; fn main() { let mut paths = Vec::new(); let perlin = Perlin::new(); let...
Rust
0
memory.get_ro_slice(self.memory.var_addr + self.vx, 1)[0]; Ok(10) } /// fx18 fn inst_set_sound(&mut self) -> Result<usize, io::Error> { self.tone_timer = self.memory.get_ro_slice(self.memory.var_addr + self.vx, 1)[0]; Ok(10) } /// fx1e fn inst_add_x_to_i(&mut self) -> R...
Rust
0
Lookup>::Source, kitty_id: T::KittyIndex ) -> DispatchResult { let who = ensure_signed(origin.clone())?; let owner_id = <T::Lookup as StaticLookup>::lookup(dest.clone())?; // 1. first check whether kitty is being sold, if not display an Error. let mut sell_list = SellList::<T>::get(owner_id.clone()) ; ...
Rust
0
ss=10) if INVERSE: rootNode.addObject('RequiredPlugin', name='SoftRobots.Inverse') rootNode.addObject('QPInverseProblemSolver', epsilon=2e-0, maxIterations=2500, tolerance=1e-7, responseFriction=0.8) else: rootNode.addObject('GenericConstraintSolver', maxItera...
Python
1
# Copyright (c) 2010-2022 openpyxl from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Sequence, String, Float, Integer, Bool, NoneSet, ) class WebPublishObject(Serialisable): tagname = "webPublishingObject" id = Integer() div...
Python
1
class A: """ A class that does something Args: arg1 (int): Arg 1 arg2 (float): Arg 2 """ def __init__(self, arg1: int, arg2: float) -> None: """Initialize the class""" self.arg1 = arg1 self.arg2 = arg2 class B: """ A class that does something ...
Python
1
import json import tiktoken from langchain_core.tools import tool from ..configuracoes.config import API_KEY, DATASET_PATH, TOKENIZER_ENCODING from openai import OpenAI client = OpenAI(api_key=API_KEY) tokenizador = tiktoken.get_encoding(TOKENIZER_ENCODING) @tool def salvar_dataset_finetuning(pergunta: str, resposta...
Python
1
# (15) Implemente uma função que recebe o seu peso e altura e retorna seu índice de massa corporal, IMC. A função também deverá emitir a classificação, de acordo com a tabela abaixo: # IMC|CLASSIFICAÇÃO # ---|------------- # MENOR QUE 18,5| MAGREZA # ENTRE 18,5 E 25,0| NORMAL # ENTRE 25,0 E 30,0| SOBREPESO # ENTRE 30,...
Python
1
m a flare tip at a specified distance according to API 521. A graphical technique is used to get the noise at 30 m from the tip, and it is then adjusted for distance. .. math:: L_{30 \text{m}} = L - 10 \log_{10}(0.5 m c^2) .. math:: L_p = L_{30 \text{m}} - 20 \log_{10}(r/(30 \text{...
Python
1
X"] * self.n_ctx) self.ctx = nn.Parameter(ctx_vectors) # meta_net2: (bert_dim → ctx_dim) 변환기 self.meta_net2 = nn.Sequential(OrderedDict([ ("linear1", nn.Linear(bert_dim, ctx_dim // 16)), ("relu", nn.ReLU(inplace=True)), ("linear2", nn.Linear(ctx_dim // 16, c...
Python
1
, 4.0], vec![4.0, 5.0, 6.0, 7.0], vec![7.0, 8.0, 9.0, 10.0], vec![10.0, 11.0, 12.0, 13.0]]; let mut r_m2 = &mut m2; let rr_m2 = &mut r_m2; assert_eq!(matrix::permanent(rr_m2), 29556.0); } #[test] fn test_perm_c(){ let mut m3: Vec<Vec<f64>> = vec![vec![0.0, 1.0, 2.0, 3.0, 4.0], ...
Rust
0
_checker; pub mod state; pub mod config; <gh_stars>0 // Copyright © 2016-2017 winapi-rs developers // Licensed under the Apache License, Version 2.0 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. // All files ...
Rust
0
available_memory: Option<u64>, pub disk_caches: Option<u64>, pub hugetlb_allocations: Option<u64>, pub hugetlb_failures: Option<u64>, pub shared_memory: Option<u64>, pub unevictable_memory: Option<u64>, } // BalloonTubeResult are results to BalloonTubeCommand defined above. #[derive(Serialize, Des...
Rust
0
# Register models esrgan = DeepEnhancer("esrgan") model_manager.register_model("esrgan", esrgan) print("✅ ML Models registered:") for model in model_manager.list_models(): info = model_manager.get_model_info(model) print(f" 📋 {model}: {info['type']}...
Python
1
`. /// A scope is a closure, in which access to a guard is granted. /// A guard is used to schedule callbacks to run on a scope's success, failure, or exit. /// /// For more information on how to use the guard, see [`Guard`]. /// /// The scope is required to return a type implementing [`Failure`], /// to indicate wheth...
Rust
0
uad::new(ex.clone(), ex.clone(), ex.clone(), None); /// store.insert(&quad)?; /// /// // quad filter /// let results: Result<Vec<Quad>,_> = store.quads_for_pattern(None, None, None, None).collect(); /// assert_eq!(vec![quad], results?); /// /// // SPARQL query /// if let QueryResults::Solutions(mut solutions) = store.q...
Rust
0
._BillMode = params.get("BillMode") self._RequestId = params.get("RequestId") class DescribeBalanceRequest(AbstractModel): """DescribeBalance请求参数结构体 """ def __init__(self): r""" :param _AccountType: 账户类型:1-设备接入;2-云存。 :type AccountType: int """ self._Accoun...
Python
1
# -*- coding: utf-8 -*- from providerModules.a4kScrapers import core show_list = None Show = core.namedtuple('Show', 'title id') class sources(core.DefaultSources): def __init__(self, *args, **kwargs): super(sources, self).__init__(__name__, *args, **kwargs) self._feed_url = '/show/%s.rss' ...
Python
1
r: req.identifier, instance: None, sub_problems: vec![], }] }), } })) } } extern "C" { fn X509v3_get_ext_by_OBJ( x: *const openssl_sys::stack_st_X509_EXTENSION, obj: *const openssl_sys::ASN1_...
Rust
0
or_map = { "MAT 111": "8", # Grey "MAT 145": "6" # Orange } for deadline in deadlines: course_name = deadline['course_name'] event_name = deadline['name'] event_deadline = deadline['deadline'] try: start_time = datetime.strptime(event_deadline, '%...
Python
1
redirect_uri={domain}%2Fauth&\ response_type=code&\ scope=identify%20bot%20guilds", client_id = *secrets.discord().client_id(), domain = pe::utf8_percent_encode(secrets.web().domain(), pe::NON_ALPHANUMERIC), ), }); async fn error404(global: web::Data<ht...
Rust
0
class Solution(object): def reorderList(self, head): if not head or not head.next: return middle = self.find_middle(head) second_half = middle.next middle.next = None second_half = self.reverse_linked_list(second_half) self.merge_alternatively(head, second...
Python
1
), 250 => ( unsafe { *(self.must_read(4, true)?.as_slice().as_ptr() as *const u32) } as usize ), value => return Err(Error::UnexpectedValue(Type::Variant,...
Rust
0
"reference_answer": "基于用户组权限;自定义装饰器检查权限;基于权限Mixin的类视图控制。", "analysis": "考察Django权限与安全机制设计能力。" }, { "id": "django-005", "problemSetId": "python-django", "category": "后端开发", "title": "Django REST Framework设计API", "description"...
Python
1
 SrSSKJr SSKJrJr SSKJrJrJr SSKJ r J r Sr \ "S5r Sr S r\S :XaSS KrSS KJr \R&R)\R&R+\5S 5r\"S\"\R&R)...
Python
1
"""FMP Literal Definitions.""" from typing import Literal SECTORS = Literal[ "consumer_cyclical", "energy", "technology", "industrials", "financial_services", "basic_materials", "communication_services", "consumer_defensive", "healthcare", "real_estate", "utilities", "i...
Python
1
ut self, ext_dt: f64, output_poses: &mut [TOutput]) { self.update_state(ext_dt); let elapsed_time = self.local_clock + ext_dt * self.playback_speed; let mut local_poses = [ T::identity(); MAX_JOINTS ]; { let current_state = self.states.get_mut(&self.current_state[..]).unw...
Rust
0
self.figure.clear() def matches(img1, pts1, img2, pts2, m_indices, colors, pts_colors, circ_radius=3, thickness=1, alpha=1): ''' Assume pts1 are matched with pts2, respectively. ''' H1, W1, C = img1.shape H2, W2, _ = img2.shape new_img = np.zeros((max(H1, H2), W1 + W2, C), img1.dtype) ne...
Python
1
''' Time complexity: O(m+n) Space complexity: O(n) ''' class Solution: # def eventualSafeNodes(self, graph: List[List[int]]) -> List[int]: # n = len(graph) # revAdj = [[] for i in range(n)] # safeNodes = set() # in_degree = [0]*n # for i in range(n): # nb_cnt = 0 # for j in graph[i]:...
Python
1
_OT_SelectionSetCommand, ARMATURE_OT_SelectionSetTab, } def register_selection_set(): for cls in classes: bpy.utils.register_class(cls) types = bpy.types types.Scene.selection_set = PointerProperty(type=SceneSelectionSet) types.Armature.selection_set = PointerProperty(type=ArmatureSelectionSet) types.PoseBo...
Python
1
{}", display, Error::description(&err)), Ok(_) => {} }; let collection = FontCollection::from_bytes(font_data); let font = collection.into_font().unwrap(); let scale = Pixels(self.size); for i in 0..129 { let c = (i as u8) as char; let g = m...
Rust
0
''' /* * EJERCICIO: * - Crea ejemplos utilizando todos los tipos de operadores de tu lenguaje: * Aritméticos, lógicos, de comparación, asignación, identidad, pertenencia, bits... * (Ten en cuenta que cada lenguaje puede poseer unos diferentes) * - Utilizando las operaciones con operadores que tú quieras, crea ...
Python
1
s"), ] STATUS_CHOICES = [ ("pending", "Ожидает"), ("paid", "Оплачен"), ("failed", "Ошибка"), ("canceled", "Отменён"), ("expired", "Просрочен"), ] client = models.ForeignKey( Client, on_delete=models.CASCADE, related_name="payments", ...
Python
1
return await process_single_batch(batch) # tasks = [sem_task(batch) for batch in batches] # batch_results = await asyncio.gather(*tasks) # for res in batch_results: # results.extend(res) # return results # # ------------------- # # 2️⃣ Streamlit-safe async runner # # -----------------...
Python
1
vec(any::<u8>(), 0..1000) ) { let _ = Ripemd160Hasher.hash((), &bytes); } #[test] fn fuzz_ripemd160_hash_returns_ok(pass in ".*") { Ripemd160Hasher.hash_str((), &pass).unwrap(); } #[test] fn fuzz_ripemd160_hash_bytes_returns_ok( ...
Rust
0
# Author: 邵世昌 # CreatTime: 2024/11/2 # FileName: Two_DataFrame #%%导入库 import pandas as pd import numpy as np #%%创建DataFrame data = pd.DataFrame(np.arange(12).reshape((3,4)),index = ['X','Y','Z'],columns=['A','B','C','D']) print(data) #%%获取行列索引 index_data = data.index column_data = data.columns print("行索引:\n",list(ind...
Python
1
1) }, Token::BorrowedStr("TXT"), Token::Seq { len: Some(2) }, Token::U32(200), Token::BorrowedStr("<NAME>"), Token::SeqEnd, Token::MapEnd, ] } // todo: renable this test #[test] fn deserialize_test() { let records =...
Rust
0
.x[f.rd] = -1; } else if dividend == cpu.most_negative() && divisor == -1 { cpu.x[f.rd] = dividend; } else { cpu.x[f.rd] = cpu.sign_extend(dividend.wrapping_div(divisor)) } Ok(()) }, disassemble: dump_format_r }, Instruction { mask: 0xfe00707f, data: 0x02005033, name: "DIVU", operation...
Rust
0
ty) // TODO: Somehow use `dt` here pub fn do_sandfall(state: &mut GameState) { if state.frame % 10 == 0 { for (x, y, z) in iter_3d(0..VOX_MAX_X, 1..VOX_MAX_Y, 0..VOX_MAX_Z) { // TODO: Make this less boilerplate let hi = state.voxels[x][y][z]; let lo = state.voxels[x][y - ...
Rust
0
doc = "3: Interrupt n is falling-edge sensitive."] FALLING_EDGE = 3, } impl From<ICR0_A> for u8 { #[inline(always)] fn from(variant: ICR0_A) -> Self { variant as _ } } #[doc = "Reader of field `ICR0`"] pub type ICR0_R = crate::R<u8, ICR0_A>; impl ICR0_R { #[doc = r"Get enumerated values vari...
Rust
0
1 page = 2M pub const L1_PAGE_SIZE: usize = 2 * 1024 * 1024; /// Level 2 page = 1G pub const L2_PAGE_SIZE: usize = 1024 * 1024 * 1024; pub const PTE_SIZE_BYTES: usize = 8; pub const PT_LENGTH: usize = 512; const FIELD_VPN: usize = 0x1FF; /// True if paging is fully set up /// /// Some language features rely on pos...
Rust
0
t card.find_element(By.CLASS_NAME, "module-card-title").text == card_details["text"] # Check module cards module_cards = [ {"link": "/modules/modulesearch-contributed/mixedsearch-result/aws", "text": "modulesearch-contributed / mixedsearch-result"}, {"link": "/modules/modulesear...
Python
1
14, 0xde, 0x15, 0x18, 0xff, 0x05, 0x2e} DEFINE_GUID! {GUID_APPLAUNCH_BUTTON, 0x1a689231, 0x7399, 0x4e9a, 0x8f, 0x99, 0xb7, 0x1f, 0x99, 0x9d, 0xb3, 0xfa} DEFINE_GUID! {GUID_PCIEXPRESS_SETTINGS_SUBGROUP, 0x501a4d13, 0x42af,0x4429, 0x9f, 0xd1, 0xa8, 0x21, 0x8c, 0x26, 0x8e, 0x20} DEFINE_GUID! {GUID_PCIEXPRESS_ASPM_POLICY, ...
Rust
0
y_covered_examples_in_pos_and_neg( self.ruleset.rules[0], X_np, y_np, 'negative' ) unique_in_positive_rule2 = metrics_object._calculate_uniquely_covered_examples_in_pos_and_neg( self.ruleset.rules[1], X_np, y_np, 'positive' ) unique_in_negative_rule2 = metrics_obj...
Python
1
b::ffi::gboolean { let f: &F = &*(f as *const F); f( WebView::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(context_menu), &from_glib_none(event), &from_glib_borrow(hit_test_result), ) .into_glib() } unsafe { let f: Box_<F> = Box_::new(...
Rust
0
""" Ettoday tag the crawl deal with tags of ettoday's news, which could make the dictionary of jieba Usage: scrapy crawl ettoday_tag -o <filename.json> """ #!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import scrapy TODAY = datetime.date.today().strftime('%Y/%m/%d') TODAY_URL = datetime.date.today().st...
Python
1
cts.add(Arc::new(Sphere::new( point3::new(0.0, -1000.0, -0.0), 1000.0, Arc::new(Lambertian::new(pertext.clone())), ))); objects.add(Arc::new(Sphere::new( point3::new(0.0, 2.0, -0.0), 2.0, Arc::new(Lambertian::new(pertext.clone())), ))); objects } /*pub fn...
Rust
0
:param _CharacterCount: 字符计数 :type CharacterCount: int :param _Tokens: 切分后的列表 :type Tokens: list of str :param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 :type RequestId: str """ self._TokenCount = Non...
Python
1
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: envoy/type/matcher/v3/status_code_input.proto # Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf i...
Python
1
import os from transformers import Trainer, TrainingArguments, AutoModelForSequenceClassification, AutoTokenizer from datasets import load_dataset from src.config import Config def fine_tune(): """ Esegue il fine-tuning del modello per il trading di criptovalute utilizzando dati CSV. I file CSV devono aver...
Python
1
if param_match := param_match_regex.fullmatch(component): param = param_match.group(1) cls._validate_path_parameter(param, path) param_name, param_type = (p.strip() for p in param.split(":")) type_class = param_type_map[param_type] parse...
Python
1
import time import traceback from typing import Callable import asyncio import logging logger = logging.getLogger(__name__) def retry(func: Callable, max_retry=5, first_interval=2, interval_multiply=1): def sync_wrapper(*args, **kwargs): interval = first_interval for iter in range(max_retry + 1)...
Python
1
f: return json.load(f) return None def create_interactive_network(graph_data): """Generates an interactive Pyvis network graph with improved spacing, a legend, and filtering for unused entities.""" if not graph_data or "entities" not in graph_data or "edges" not in graph_data: st.warnin...
Python
1
array = [5, 4, 3, 2, 1] def selection_sort(array): length = len(array) for i in range(length): sorted = True minimum = i for j in range(i + 1, length): if array[j] < array[minimum]: minimum = j sorted = False if sorted: ...
Python
1
fmt::Display for DuplicateError impl fmt::Display for DuplicateError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Key already in use.") // user-facing output } } // Implement std::fmt::Debug for DuplicateError impl fmt::Debug for DuplicateError { fn fmt(&self, f: &mut fmt::For...
Rust
0
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations from enum import Enum class WorkflowState(str, Enum): ACTIVE = "active" INACTIVE = "inactive"
Python
1
air.zip / Zip file name, defaults to ssh_key_pair.zip """ file_list = [] for key_pair in self.key_pair_list: if key_pair.is_valid(): file_list.append(key_pair.public_key_path) file_list.append(key_pair.private_k...
Python
1
chain = ExtKeychain::from_random_seed(false).unwrap(); let builder = ProofBuilder::new(&keychain); let mut txs = vec![]; for _ in 0..10 { let tx = tx1i2o(); txs.push(tx); } let prev = BlockHeader::default(); let key_id = ExtKeychain::derive_key_id(1, 1, 0, 0, 0); let b = new_block(&txs, &keychain, &builder,...
Rust
0
s: usize, ) -> Result<(), flatbuffers::InvalidFlatbuffer> { use self::flatbuffers::Verifiable; v.visit_table(pos)? .visit_field::<flatbuffers::ForwardsUOffset< flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>, >>("schema", Self::VT_SCHEMA, false)...
Rust
0
RegisterBlock { 3758620672 as *const _ } } impl Deref for MCM { type Target = mcm::RegisterBlock; fn deref(&self) -> &mcm::RegisterBlock { unsafe { &*MCM::ptr() } } } #[doc = "Core Platform Miscellaneous Control Module"] pub mod mcm; #[allow(private_no_mangle_statics)] #[no_mangle] stati...
Rust
0