text
string
label_name
string
labels
int64
fn create_rust_thing() -> RustThing { RustThing::default() } #[wasm_bindgen] #[derive(Clone, Default)] pub struct RustThing { things: usize, list: Observable<Vec<String>>, } #[wasm_bindgen] impl RustThing { pub fn do_something(&mut self) { self.things += 1; self.list.push(format!("Thi...
Rust
0
.abs(); if filled { self.inner_line(x0, radius + y0, x0, -radius + y0, color); self.inner_line(radius + x0, y0, -radius + x0, y0, color); } else { self.inner_pixel(x0, radius + y0, color); self.inner_pixel(x0, -radius + y0, color); self.inner_...
Rust
0
_EPOCH).expect("date should be after Unix Epoch"); datalog::ConstraintKind::Date(datalog::DateConstraint::Before(dur.as_secs())) }, ConstraintKind::Date(DateConstraint::After(date)) => { let dur = date.duration_since(UNIX_EPOCH).expect("date should be after Unix Epoch"); da...
Rust
0
)?; let a = ast_argv(t); let n = a.len(); let mut i = 0; while i < n { if a[i+1].symbol_type == SymbolType::None { self.compile_ast(bv, &id)?; if a[i].symbol_type == SymbolType::Identifier { self.compile_string(bv, &a[i])?; ...
Rust
0
ssures[i-1] else: # Exhaust stroke if theta <= exhaust_start + blowdown_duration: if i > 0: progress = (theta - exhaust_start) / blowdown_duration decay = 1 / (1 + np.exp(6 * (progress - 0.5))) ...
Python
1
an codes into key events. fn advance_state(state: &mut DecodeState, code: u8) -> Result<Option<KeyEvent>, Error>; /// Convert a Scan Code set X byte to our 'KeyCode' enum fn map_scancode(code: u8) -> Result<KeyCode, Error>; /// Convert a Scan Code Set X extended byte (prefixed E0) to our `KeyCode` ...
Rust
0
: evaluator = _create_evaluator_with_supported_channel_signals() await _trigger_callback_with_data_and_assert_note(evaluator, data={ services_constants.CONFIG_IS_CHANNEL_MESSAGE: True, services_constants.CONFIG_MESSAGE_SENDER: "TEST-CHAN-1", services_constants.CONFIG_MESSAGE_CONTENT: """...
Python
1
import pytest from pandas import IntervalIndex import pandas._testing as tm class TestPickle: @pytest.mark.parametrize("closed", ["left", "right", "both"]) def test_pickle_round_trip_closed(self, closed): # https://github.com/pandas-dev/pandas/issues/35658 idx = IntervalIndex.from_tuples([(1,...
Python
1
import torch, time import chamfer2D.dist_chamfer_2D import chamfer3D.dist_chamfer_3D import chamfer5D.dist_chamfer_5D import chamfer_python cham2D = chamfer2D.dist_chamfer_2D.chamfer_2DDist() cham3D = chamfer3D.dist_chamfer_3D.chamfer_3DDist() cham5D = chamfer5D.dist_chamfer_5D.chamfer_5DDist() from torch.autograd im...
Python
1
from rest_framework import serializers from restaurants.models import Restaurant, RestaurantRating from django.db.models import Avg class RestaurantSerializer(serializers.ModelSerializer): category_name = serializers.CharField(source='category.name', required=False) manager_id = serializers.Char...
Python
1
32, 32, 64, LLVMDIFlags::LLVMDIFlagArtificial, map[&ClassId::PRIMITIVE_INT] ); let vtable_field = di_builder.create_member_type( unknown_file, "__vtable", unknown_file, 0, 64, 64, 0, LLVMDIFlags::LLVMDIFlagArtificial...
Rust
0
> /// <p>You can use IAM policies to control this action's access to Amazon SWF resources as /// follows:</p> /// <ul> /// <li> /// <p>Use a <code>Resource</code> element with the domain name to limit the action to /// only specified domains.</p> /// </li> /// <li> /// <p>Use an <code>Action</code> element to allow or ...
Rust
0
NO_WIN_PROMPT, Less => EVIL_WIN_PROMPT, } } #[cfg(test)] mod tests { #[test] fn returns_expected() { use super::good_vs_evil; assert_eq!(good_vs_evil("0 0 0 0 0 10", "0 0 0 0 0 0 0"), "Battle Result: Good triumphs over Evil"); assert_eq!(good_vs_evil("0 0 0 0 0 0", "0 0 0 0...
Rust
0
x *= 10; x += (it.next().unwrap() as u8 - b'0') as i32; } else { break; } } res.push(Tok::Num(-x)); } '0'..='9' => { le...
Rust
0
(class_marker).into_conditional(class_is_valid) } fn implements_clause(p: &mut Parser) -> ParsedSyntax<ConditionalSyntax> { if p.cur_src() != "implements" { return Absent; } let mut is_valid = true; let implements_clause = p.start(); let start = p.cur_tok().range.start; p.bump_remap(T![implements]); let li...
Rust
0
""" Dictionaries with names of common elements, like hardware types. Just for display purposes. """ # A dictionary of hardware types, for display purposes hardware_types = { 0: "Reserved", 1: "Ethernet", 2: "Experimental Ethernet", 3: "Amateur Radio AX.25", 4: "Proteon ProNET Token Ring", 5: "C...
Python
1
# Copyright (c) 2025 Joseph Agrane # Licensed under the MIT License. See LICENSE file in the project root for full license information. from ndshapecheck.shape_check import ShapeCheck def test_single_shape_h1() -> None: def f(a, b): sc = ShapeCheck() return sc(a).check(b) assert f('1,2,3', (1,2...
Python
1
Cursor; /// /// let lzss10: [u8; 11] = [ 0x10, 0x14, 0x00, 0x00, 0x08, 0x61, 0x62, 0x63, 0x64, 0xD0, 0x03, ]; // abcdabcdabcdabcdabcdabcd /// let decoded = decompress(&mut Cursor::new(lzss10)); /// ``` pub fn decompress<T: Read + Seek>(data: &mut T) -> Result<Vec<u8>, Error> { let lz_type = data.read_u8()?; let...
Rust
0
ailure_reason).into()), } } fn create_output_file( &mut self, user_id_hash: &str, name: &str, removable_media: Option<&str>, ) -> Result<std::fs::File, Box<dyn Error>> { let path = match removable_media { Some(media_path) => Path::new(REMOVABLE_ME...
Rust
0
#入力値を取得 # Coin_kind = コインの種類 # Totalfee = 支払う合計金額 # coin_list = [a円, b円, c円, ...] # or Totalfee, Coin_kind = map(int,input().split()) coin_list = list(map(int,input().split())) #入力値を取得 Coin_kind = 7 Totalfee = 1499 coin_list = [2, 3, 5, 10, 15, 30, 100] def coin_list_check_problem(Coin_kind, Totalfee, coin_list):...
Python
1
import gstaichi as ti from .base import Base @ti.data_oriented class Smoke(Base): def __init__(self): super().__init__() @property def sampler(self): return "regular"
Python
1
extern crate chrono; mod config; #[derive(Debug)] struct ReportEntry<'a> { activity: &'a str, duration: &'a str, from: &'a str, to: &'a str, comment: &'a str, } impl<'a> ReportEntry<'_> { pub fn new( activity: &'a str, duration: &'a str, from: &'a str, to: &'...
Rust
0
# Copyright 2017 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
Python
1
t_data, sentiment, use_memory) # Display prediction if "BULLISH" in prediction['direction']: st.success(f"**{prediction['direction']}** - Confidence: {prediction['confidence']:.1f}%") elif "BEARISH" in prediction['d...
Python
1
, y_center, width, height = label x_min, y_min, x_max, y_max = denormalize_bbox( [x_center, y_center, width, height], img_width, img_height ) # 绘制边界框 rect = patches.Rectangle( (x_min, y_min), x_max - x_min, y_max - y_min, ...
Python
1
::Mat) //! - [(&)Point2<T>](nalgebra::Point2) -> [Point_<T>](opencv::core::Point_) //! - [(&)Point3<T>](nalgebra::Point3) -> [Point3_<T>](opencv::core::Point3_) //! - [(&)Translation<N, D>](nalgebra::Translation) ->? [Mat](opencv::core::Mat) //! - [(&)Isometry3<T>](nalgebra::Isometry3) ->? [OpenCvPose<Point3_<T>>](Open...
Rust
0
import pygame import sys from Shared_Resources import ( SCREEN_WIDTH, SCREEN_HEIGHT, BUTTON_COLOR, BUTTON_HOVER_COLOR, font, small_font, TEXT_COLOR_WHITE, RANK_COLORS, draw_text ) pygame.init() screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) pygame.display.set_captio...
Python
1
#🔒 Password Strength Meter with Streamlit import streamlit as st import re # Streamlit App Title st.title("🔐 Password Strength Meter") # User input for password password = st.text_input("Enter your password", type="password") # Password strength evaluation function def evaluate_password_strength(password): st...
Python
1
F_W5_SPEC>`"] pub type HOST_SLCHOST_CONF_W5 = crate::Reg<host_slchost_conf_w5::HOST_SLCHOST_CONF_W5_SPEC>; #[doc = ""] pub mod host_slchost_conf_w5; #[doc = "HOST_SLCHOST_WIN_CMD register accessor: an alias for `Reg<HOST_SLCHOST_WIN_CMD_SPEC>`"] pub type HOST_SLCHOST_WIN_CMD = crate::Reg<host_slchost_win_cmd::HOST_SLCH...
Rust
0
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isSameTree(self, p: Optional[TreeNode], q: Optional[TreeNode]) -> bool: # has to just be an O(n)...
Python
1
rs // rustfmt-binop_separator: Back fn main() { let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ^ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; let value = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ & abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ; ...
Rust
0
662c99d750f60d3"), plaintext: b"", aad: b"", ciphertext: b"", tag: &hex!("aec7ece66b7344afd6f6cc7419cf6027"), }, TestVector { key: &hex!("f30b5942faf57d4c13e7a82495aedf1b4e603539b2e1599317cc6e53225a2493"), nonce: &hex!("336c388e18e6abf92bb739a9"), plaintex...
Rust
0
# -*- coding: utf-8 -*- from django.test import TestCase from functools import partial from mock import patch from tools.gis import donde_queda from preciosa.precios.tests.factories import CityFactory, SucursalFactory from tools.gis import punto_destino def mock_reverse_geocode(lat, lon, formatted=True, ...
Python
1
let timeout = Timeout::new(reactor.now() + timeout); match select_3(handler, timeout.elapsed(), token.cancelled()).await { Select3::R1(ret) => ret?, Select3::R2(_) => return Err(ServerError::Timeout), Select3::R3(_) => return Err(ServerError::St...
Rust
0
th, &segment_config, &optimizers_config, ); let collection = construct_collection( segment_holder, segment_config, wal, search_runtime, optimizers, optimizers_config.flush_interval_sec, ); Ok(collection) } use crate::interpreter::Value; ...
Rust
0
"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03ff << 16)) | ((value as u32 & 0x03ff) << 16); self.w } } #[doc = "Field `rx_adc_os_i` reader - "] pub struct RX_ADC_OS_I_R(crate::FieldReader<u16, u16>); impl RX_ADC_OS_I_R { pub(c...
Rust
0
setting_type: SettingType::Usize, comment: Some("The port the MM web GUI will listen on. Deprecated."), }, SettingRow { id: "node_binary_path", name: "NodeJS Binary Path", default: None, setting_type: SettingType::String, ...
Rust
0
_add_vector_mut() { let mut large_vector: LargeVector<u8, 4> = LargeVector { data: vec![1, 2, 3, 4], }; let large_vector_2: LargeVector<u8, 4> = LargeVector { data: vec![5, 6, 7, 8], }; large_vector += large_vector_2; let added_large_vector: Lar...
Rust
0
import pygame from pygame.locals import * from sys import exit from random import randint, randrange, choice import os pygame.init() pygame.mixer.init() pygame.display.set_caption("UTF Killed me!") largura = 640 altura = 480 nivel = 0 diretorio_principal = os.path.dirname(__file__) diretorio_imagens = os.path.joi...
Python
1
self.__update_board(board_copy, position) new_node = Node(board_copy) temp_value = self.minimax(new_node, depth - 1, human_score, agent_score, alpha, beta, False)[1] if (temp_value > value): ...
Python
1
task_type: 0, task_for: "".to_string(), task_state: 0, data: "".to_string(), create_time: Local::now().naive_local(), execute_time: Local::now().naive_local(), retried_times: 0, } } } impl RawTask { pub fn new<T: Serialize +...
Rust
0
import os import cv2 import time import torch import pickle import numpy as np from tqdm import tqdm from alisuretool.Tools import Tools from torch.nn import functional as F from torch.utils.data import Dataset from torch.utils.data import DataLoader from src.my_data.utils_rle import rle_to_mask from src.my_transforms ...
Python
1
ple number: ", idx_nb) ext_loop = int(np.floor(idx_nb / num_batches_per_global)) int_loop = int(idx_nb % num_batches_per_global) temp = ar.get_layer(ds_att, batch = ext_loop, layer = rf_dict["layer"]) nheads = len(temp["heads"].keys()) nbatch = temp["datetime"].shape[0] nlevel = temp.ml.shape[0]...
Python
1
Console(record=True) console.log( "JSONRPC [i]request[/i]", 5, 1.3, True, False, None, { "jsonrpc": "2.0", "method": "subtract", "params": {"minuend": 42, "subtrahend": 23}, "id": 3, }, ) conso...
Python
1
"{} failed with error number '{}' ('{}')", stringify!($function), errno.0, errno); } pointer } } } use crate::error::*; use crate::manifest::add_pallet_to_manifest; use crate::registry::registry_path; use crate::runtime::add_pallet_to_runtime; use cargo_edit::{get_latest_dependency, registry_url, update_regis...
Rust
0
mapped group {} for volume {}", opt.group, mp_str))?; set_file_owner(&dir, user, group) .map_err(|e| format_err!("Error chowning \ persistent volume: {}", e))?; set_file_mode(&dir, opt.mode) ...
Rust
0
Box::new(Expr::Sexp( Op::Sub, Box::new(Expr::Atom(Prim::Num(26))), Box::new(Expr::Atom(Prim::Num(20))), )), )) ),] ); } #[test] fn whitespace() { let foo = b" ...
Rust
0
.get_value(0, ctx.schema_1.clone()) .unwrap() .unwrap() .get_inner(); assert_eq!(value, InnerValue::Int(12345)); let value = record.get_value(1, ctx.schema_1.clone()).unwrap(); assert!(value.is_none()); let value = record .get_value(2, ctx.schema_1.clone()) ...
Rust
0
import ssl def load_ssl_context(cert_file, pkey_file): context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) context.load_cert_chain(cert_file, pkey_file) return context def save_ssl_files(cert, pkey): import atexit import os import tempfile from cryptography.hazmat.primitives import seriali...
Python
1
::fmt::Result { write!(formatter, "a 40 character long hash") } fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> { if v.len() != 40 { return Err(serde::de::Error::invalid_value( serde::de::Unexpected::Str(v), &"expected a 40 ...
Rust
0
# BSD 3-Clause License # # Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyrig...
Python
1
queries = {} qrels = {} for row_id, row in enumerate(query_list): queries[str(row_id)] = row["query"] qrels[str(row_id)] = {str(row["relevant_docs"]): 1} corpus_list = datasets.load_dataset( name="nlp_journal_abs_article-corpus", split="corp...
Python
1
impl RTCBuildFlags { pub const DYNAMIC: RTCBuildFlags = RTCBuildFlags(1); } impl ::std::ops::BitOr<RTCBuildFlags> for RTCBuildFlags { type Output = Self; #[inline] fn bitor(self, other: Self) -> Self { RTCBuildFlags(self.0 | other.0) } } impl ::std::ops::BitOrAssign for RTCBuildFlags { ...
Rust
0
new())), "binaryerror" | "binary_error" => Some(Box::new(BinaryError::new())), "binaryerror01" | "binary_error01" => Some(Box::new(BinaryError01::new())), _ => None } } pub fn metrics_from_names(names: &[String]) -> Option<Vec<Box<dyn Metric>>> { let mut metrics = Vec::new(); for na...
Rust
0
torage' WHITENOISE_USE_FINDERS = True # After login/logout, redirect to project LOGIN_URL = "/login" LOGIN_REDIRECT_URL = "../" LOGOUT_REDIRECT_URL = "../" STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') CORS_ALLOWED_ORIGINS = [ "http://localhost:5173", "http://127.0.0.1:5173", "http://127.0.0.1:8000...
Python
1
ing::ToString; let address: Address = random(); let _route = route!["str", "STR2", "STR3".to_string(), address]; } } <filename>Chapter08/feruscore/src/instruction.rs use rand::{thread_rng, Rng}; use std::io; use std::io::Write; #[derive(PartialEq, Eq, Copy, Clone, Debug)] pub enum OpCode { Dat,...
Rust
0
import cv2 import numpy as np from tqdm import tqdm from scipy.interpolate import interp1d from srcs.Phaser import Phaser from config import * def get_world_points(pattern_size): world_point = np.zeros((np.prod(pattern_size), 3), np.float32) world_point[:, :2] = np.indices(pattern_size).T.reshape(-1, 2) ...
Python
1
def _global_pool(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: if self.pool_type == 'avg': pooled, tokens = x[:, 1:].mean(dim=1), x[:, 1:] elif self.pool_type == 'tok': pooled, tokens = x[:, 0], x[:, 1:] else: pooled = tokens = x ret...
Python
1
UrlID; use crate::db::models::Url; use crate::Config; use anyhow::{anyhow, Result}; use std::convert::TryInto; use tantivy::{ collector::TopDocs, directory::MmapDirectory, doc, query::Query, query::{BooleanQuery, FuzzyTermQuery}, schema::{Field, Schema}, Index, IndexReader, Term, }; use toki...
Rust
0
pSrSSKrSSKrSSKrSSKrSSKJs Jr "SS5r Sr \ S:Xa\ "5 gg)AExample of Timer and Compare APIs: $ python -m examples.compare Nc<\rSrSrSrSrSrSrSrSr Sr S r g ) FauxTorch...
Python
1
= 2.0 / (top - bottom); m[3 * 4 + 0] = (right + left) / (right - left) * -1.0; m[3 * 4 + 1] = (top + bottom) / (top - bottom) * -1.0; return m; } js!( var gl; var webgl_names = ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"]; for( var i = 0; i < webgl...
Rust
0
ests_with = retry_flaky() @flaky(jira_keys, 1, 1) def test_delayed(self): # Get a copy of the event log at this point of the test. self.log = list(log) test = FlakyTest('test_delayed') result = ExtendedTestResult(log) test.run(result) ...
Python
1
def __init__(self): raise EnvironmentError( 'AutoModelForNextSentencePrediction is designed to be instantiated using the `AutoModelForNextSentencePrediction.from_pretrained(pretrained_model_name_or_path)` or `AutoModelForNextSentencePrediction.from_config(config)` methods.' )
Python
1
end = args.to shapes = shapes[args.from_:end] print("Changing batch size to ", args.batch) for i in range(len(shapes)): shapes[i] = list(shapes[i]) shapes[i][0] = args.batch shapes[i] = tuple(shapes[i]) if args.type == "pytorch": if args.target == "cuda": ...
Python
1
log, }; use std::str::FromStr; /// Starts the client. #[wasm_bindgen] pub async fn start_client(chain_spec: String, log_level: String) -> Result<Client, JsValue> { start_inner(chain_spec, log_level) .await .map_err(|err| JsValue::from_str(&err.to_string())) } async fn start_inner(chain_spec: String, log_level: S...
Rust
0
 M P !  rc@s>eZdZdZdeddddfddZddZdedfdd ZdS) IMAP4_SSLaIMAP4 client class over SSL connection Instantiate with: IMAP4_SSL([host[, port[, keyfile[, certfile[, ssl_context[, timeout=None]]]]]]) host ...
Python
1
pub struct Profile { /// Profile ID #[serde(rename = "_id")] pub id: String, /// ? #[serde(rename = "aid")] pub aid: u64, /// SCAV profile ID #[serde(rename = "savage")] pub savage: Option<String>, /// Profile info pub info: Info, /// Character customization pub cust...
Rust
0
"cgg" => Ok(LANG_CGG), "cgg-UG" => Ok(LANG_CGG_UG), "cu-RU" => Ok(LANG_CU_RU), "da-GL" => Ok(LANG_DA_GL), "dav" => Ok(LANG_DAV), "dav-KE" => Ok(LANG_DAV_KE), "de-BE" => Ok(LANG_DE_BE), "de-IT" => Ok(LANG_DE_IT), "dje" =>...
Rust
0
tate == "present": delta = dict(set(proposed.items()).difference(existing.items())) if delta: command = config_igmp_snooping(delta, existing) if command: if group_timeout: igmp_snooping_gt_dependency(command, existing, module) c...
Python
1
rrt_star = star.RRTStar(planner, rrt_star_options) new_path = rrt_star.return_plan() new_path = imacs.UnwrapToContinuousPath2d(G, new_path, 2) for i in range(1, len(new_path)): # print(new_path[i-1][2], new_path[i][2]) assert np.abs(new_path[i-1][2] - new_path[i][2]) <= np.pi print("SE(2)/G RRT* path length...
Python
1
7 = sales_ma7.loc[sample_period] sample_ma30 = sales_ma30.loc[sample_period] sample_ewm = sales_ewm.loc[sample_period] plt.figure(figsize=(14, 8)) plt.plot(sample_data.index, sample_data, label='原始数据', alpha=0.7, linewidth=1) plt.plot(sample_ma7.index, sample_ma7, label='7日移动平均', linewidth...
Python
1
gLayer_setKernel_Size(self.as_raw_mut_PoolingLayer(), &val) }.into_result().expect("Infallible function failed: set_kernel") } fn stride(&self) -> core::Size { unsafe { sys::cv_dnn_PoolingLayer_stride_const(self.as_raw_PoolingLayer()) }.into_result().expect("Infallible function failed: stride") } fn set_strid...
Rust
0
from odoo import api, fields, models, _ class Project(models.Model): _inherit = 'project.project' planned_amount_total = fields.Monetary(string='Total Planned Amount', compute='_compute_budget', groups='project_mngmnt.project_group_project_manager') practical_am...
Python
1
<Tribe<T>>, pub selections: Selections, // Tribes+Candidates pub start_after: u64, pub owner: AccountOf<T>, } /// Configure the pallet by specifying the parameters and types on which it depends. #[pallet::config] pub trait Config: frame_system::Config { /// Because this pallet emits events, it depends on ...
Rust
0
ficulty (int): The difficulty of the Proof of Work problem. """ block = blockchain.get_last_block() transactions = blockchain.get_pending_transactions() nonce = 0 while True: block_hash = calculate_hash(block['index'] + 1, transactions, block['hash'], nonce) if block_hash.startswith...
Python
1
import itertools import json from collections.abc import Callable from collections.abc import Generator from collections.abc import MutableMapping from typing import Any from typing import cast from typing import TextIO from mitmproxy import flowfilter from mitmproxy.http import HTTPFlow def f_id(x): return x ...
Python
1
n_add: HashMap<usize, Vec<DataPoint3D>>, /// Called on individual selection. pub on_select: HashMap<usize, Vec<DataPoint3D>>, /// Called on generation. pub on_generation: HashMap<usize, (HeuristicStatistics, Vec<DataPoint3D>)>, /// Keeps track population state at generation. pub population_state...
Rust
0
import firebase_admin from firebase_admin import credentials from firebase_admin import db cred = credentials.Certificate("serviceAccountKey.json") firebase_admin.initialize_app(cred,{ 'databaseURL' :" " }) ref = db.reference('Students') data = { "D2021":{ "name": " ", "Major": "Medical", ...
Python
1
class FloorRepo: def __init__(self): self.floors = {}
Python
1
nt, $pin:ident ) => { impl FunctionTrait<$pin> for $type { type Kind = $kind; fn assign(&mut self, _pin: &mut $pin, swm: &mut Handle) { swm.swm.$reg_name.modify(|_, w| unsafe { w.$reg_field().bits($pin::ID | ($pin::PORT as u8) << 5) ...
Rust
0
opts: &UpdateOptions) -> CargoResult<()> { let mut source = try!(PathSource::for_path(manifest_path.parent().unwrap(), opts.config)); try!(source.update()); let package = try!(source.root_package()); let previous_resolve = match try!...
Rust
0
rst_index(); assert_eq!( collect_stream_iterators(align.iter_alignments(&sidx, &Value::Str("b".to_string()), &mut tidx)), vec![ sindex("alphabet:1:code") ] ); assert_eq!( collect_stream_iterators(align.iter_alignments(&sidx, &Value::Str("a".to_string()), &mut tidx)), vec![ sindex(...
Rust
0
import os from pathlib import Path root_dir = Path(__file__).resolve().parent.parent / "assets" / "keyboards" print(f"📂 当前目录:{root_dir}") # 遍历当前目录下的所有子文件夹 for folder in os.listdir(root_dir): folder_path = os.path.join(root_dir, folder) # 确保是目录 if os.path.isdir(folder_path): mjcf_file = os.path....
Python
1
#!/usr/bin/env python from vtkmodules.vtkCommonCore import ( vtkLookupTable, vtkPoints, ) from vtkmodules.vtkCommonTransforms import vtkThinPlateSplineTransform from vtkmodules.vtkFiltersHybrid import ( vtkGridTransform, vtkTransformToGrid, ) from vtkmodules.vtkIOImage import vtkBMPReader from vtkmodule...
Python
1
}; } None => { self.state = TipsetProcessorState::Idle; } } } } } } } #[derive(Debug, Copy, Clone)] enum InvalidBlockStrategy { Strict, Forgiving, } t...
Rust
0
myemma_logger::LogFormat::Text => { println!( "PANIC:{} - {}:{}{}", panic_message, file, line, <$backtrace_filter>::get_backtrace_in...
Rust
0
pub fn new(dog_service: Arc<Mutex<DogService>>) -> Arc<Mutex<HumanService>> { Arc::new(Mutex::new(Self(Default::default(), dog_service))) } } impl Operation for HumanService { type Item = Human; } #[async_trait] impl Fetching for HumanService { async fn fetch_collection( &self, uri: &...
Rust
0
_Continuous_Underline")] XK_ISO_Continuous_Underline, /// XK_ISO_Discontinuous_Underline #[strum(serialize = "ISO_Discontinuous_Underline")] XK_ISO_Discontinuous_Underline, /// XK_ISO_Emphasize #[strum(serialize = "ISO_Emphasize")] XK_ISO_Emphasize, /// XK_ISO_Center_Object #[strum(s...
Rust
0
#Step 5 import random import hangman_art import hangman_words import os def hangman(): #Update the word list to use the 'word_list' from hangman_words.py chosen_word = random.choice(hangman_words.word_list) word_length = len(chosen_word) end_of_game = False lives = 6 #Import the logo from han...
Python
1
# File generated from our OpenAPI spec by Stainless. from __future__ import annotations from .thread import Thread as Thread from .assistant import Assistant as Assistant from .thread_deleted import ThreadDeleted as ThreadDeleted from .assistant_deleted import AssistantDeleted as AssistantDeleted from .thread_create_...
Python
1
# Generated by Django 4.2.19 on 2025-03-31 12:28 from django.db import migrations from django.db import models def fill_stored_event_count(apps, schema_editor): Issue = apps.get_model("issues", "Issue") lookup_dict = { d["id"]: d["count"] for d in Issue.objects.values("id").annotate(count=mo...
Python
1
**kwargs (dict): Additional keyword arguments to pass to the `concept_module`. See the sklearn documentation of the provided `concept_model_class` for more details. """ self.model_with_split_points = model_with_split_points self.split_point: str = split_point # type:igno...
Python
1
/// /// The `converter` provides a way to convert each item in the iterator into /// something that doesn't embed a 'py token and thus allows the GIL to be released /// /// The `buffer_size` represents the number of items that we buffer before we /// need to acquire the GIL again. pub fn new(it...
Rust
0
import logging from rich.logging import RichHandler FORMAT = "%(message)s" logging.basicConfig(level="NOTSET", format=FORMAT, datefmt="[%X]", handlers=[RichHandler()]) log = logging.getLogger("msm_we") log.setLevel(logging.DEBUG) import numpy as np def processCoordinates(self, coords): log.debug("Processing co...
Python
1
ector3D, direction: Vector3D) -> Ray { Ray { start, direction } } pub fn point_at(&self, t: f32) -> Vector3D { self.start + t * self.direction } } <filename>src/main.rs #![deny(rust_2018_idioms, unused, unused_import_braces, unused_qualifications, warnings)] use { std::{ conver...
Rust
0
xt.gc_context) { let buffer = bytearray.decompress(CompressionAlgorithm::Deflate)?; bytearray.clear(); bytearray.write_bytes(&buffer)?; } } Ok(Value::Undefined) } pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>> { let class = Cla...
Rust
0
): raise ValueError( "Couldn't serialize to h5, and model has no factory " "function for component serialization." ) # Check the factory function and throw ValueError if it doesn't exist keras_model_fns.get(self._model.catalogue_nam...
Python
1
pub(crate) query: T, } impl<T> QueryFragment<Pg> for Only<T> where T: QueryFragment<Pg>, { fn walk_ast<'b>(&'b self, mut out: AstPass<'_, 'b, Pg>) -> QueryResult<()> { out.push_sql("ONLY "); self.query.walk_ast(out.reborrow())?; Ok(()) } } impl<T> QuerySource for Only<T> where ...
Rust
0
# trggering the process import os import subprocess import sys def instasubprocess(user, tags, type, productId): try: child_env = sys.executable file_pocessing = ( os.getcwd() + "/insta_datafetcher.py " + user + " " + tags + "...
Python
1
<u32, DMAMUX::Register>, /// Flash accelerator configuration register for flash bank A flashcfga: ReadWrite<u32, FLASHCFG::Register>, /// Flash accelerator configuration register for flash bank B flashcfgb: ReadWrite<u32, FLASHCFG::Register>, /// ETB RAM configuration etbcfg: ReadWrite<u32>, /// Chip configuration regi...
Rust
0