text
string
label_name
string
labels
int64
nfig=inference_config, model_dir=MODEL_DIR) # Get path to saved weights # Either set a specific path or find last trained weights # model_path = os.path.join(ROOT_DIR, ".h5 file name here") model_path = model.find_last()[1] # Load trained weights (fill in path to trai...
Python
1
""" 演示JWT Token生成器 为测试目的生成固定的JWT token """ import jwt from datetime import datetime, timedelta from config import settings # 固定的演示用户信息 DEMO_USER = { "user_id": "demo_user_123", "username": "demo_user", "permissions": ["trading", "market_data", "admin"], "email": "demo@example.com" } def generate_dem...
Python
1
rnal fields of this type. unsafe fn inner_dequeue(&self) -> Option<T> { let current_head = self.head.load(Ordering::Relaxed); if current_head == self.tail.load(Ordering::Acquire) { None } else { let v = (self.buffer.get_unchecked(current_head).get() as *const T).read...
Rust
0
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # from airbyte_cdk.sources.declarative.requesters import RequestOption from airbyte_cdk.sources.declarative.requesters.request_option import RequestOptionType from source_braze import DatetimeIncrementalSyncComponent def test_datetime_slicer(): """ -...
Python
1
from_bytes(&inputsystem_dll).unwrap(); let materialsystem_file = PeFile::from_bytes(&materialsystem_dll).unwrap(); let shaderapidx9_file = PeFile::from_bytes(&shaderapidx9_dll).unwrap(); let vgui2_file = PeFile::from_bytes(&vgui2_dll).unwrap(); let vguimatsurface_file = PeFile::from_bytes(&vguimatsurface...
Rust
0
VkFormat::R32G32B32_SINT, VkFormat::R32G32B32_SFLOAT, VkFormat::R32G32B32A32_UINT, VkFormat::R32G32B32A32_SINT, VkFormat::R32G32B32A32_SFLOAT, VkFormat::R64_UINT, VkFormat::R64_SINT, VkFormat::R64_SFLOAT, VkFormat::R64G64_UINT, VkFormat::R64G64_SINT, VkFormat::R64G64_SFLOAT, ...
Rust
0
人婆是……!?', TxtCtl.Enter, ), ) CloseMessageWindow() ChrTalk( 0x0017, ( '#0040260838V#033F#5P咦,你不知道吗?', TxtCtl.Enter, TxtCtl.Clear, '#0040260839V#030F据说是帝国北部\n', '一个叫做卡普亚男爵家的小领主。', TxtCtl.Enter, ...
Python
1
Tan, |a| a.tan(), ctx); } #[cfg(not(all(feature = "blas", feature = "intel-mkl")))] { let ret = ctx.input(0).map(|a| a.tan()); ctx.append_output(ret); } Ok(()) } fn grad(&self, ctx: &mut crate::op::GradientContext<T>) { let cos = cos(&ctx....
Rust
0
科能买吗', '吉比特的行情', '北方稀土怎么样', '欧派家居的行情', '亿联网络的行情', '鸿特科技的行情', '汉森制药前景怎么样', '乐视怎么样?', '科伦药业咋样?', '瑞普生物赚钱吗?', '石大胜华的新闻', '天广中茂的财报', '南卫股份的公告', '百隆东方的K线', '同洲电子的走势', '西部黄金的日度' ] class_four_list = [ '华远地产的机构推荐', '会畅通讯的研报', '模塑科技的机构评级', '巴安水务资金分析', '创业黑马财务面分析', '开创国际技术分析', '傲农生...
Python
1
shape tensors into: # (bash_size * (time_steps / stride), stride, features) kernel = _tf.reshape(kernel, self.intermediate_shape[1:]) inputs = _tf.reshape(inputs, self.intermediate_shape) # broadcasting kernel to inputs batch dimension linear_decay = _tf.reduce_sum(kernel * inpu...
Python
1
=> $($tail)*); }; (@ $from:ty, $to:ty=> sident; $($tail:tt)*) => { check!(@ $from, $to=> v: -1;); check!(@ $from, $to=> v: 0;); check!(@ $from, $to=> v: 1;); check!(@ $from, $to=> $($tail)*); }; (@ $from:ty, $to:ty=> fident; $($tail:tt)*) => { check!(@ $from, $t...
Rust
0
} return { "total_messages": total_messages, "total_recipients": total_recipients, "total_read": total_read, "total_unread": total_unread, "messages_per_recipient": messages_per_recipient, "timestamp": datet...
Python
1
doc)]; return $name($($arg_name),*); $($attrs)* extern { fn $name($($arg_name : $arg_ty),*) $(-> $ret_ty),*; } } ) ) }"; } // add a bunch of macros as though they were placed at the head of the // program (ic...
Rust
0
Returns: True if successful, False otherwise """ pass @abstractmethod def sub_live_market_data(self, symbol: str, timeframe: str) -> bool: """Subscribe to live market data. Arg...
Python
1
h.LongTensor(pc_label_list[0].astype(np.long)).unsqueeze(-1) # preprocess pcds_xyzi, pcds_coord, pcds_sphere_coord = self.form_batch_tta(pc_list.copy()) pcds_bev_target = self.generate_bev_label(pcds_coord[0], pcds_target) data_dict = { 'pcds_xyzi': pcds_xyzi, ...
Python
1
tobo.typedef")] #[derive(Debug, FinalClass)] #[base(BaseTypedefClause)] pub struct UnionOfClause { #[pyo3(set)] typedef: Ident, } impl UnionOfClause { pub fn new(typedef: Ident) -> Self { Self { typedef } } } impl ClonePy for UnionOfClause { fn clone_py(&self, py: Python) -> Self { ...
Rust
0
pretty_print_notification( &matchup.fighter_two.get_name(), &matchup.win_percent_two, &matchup.fighter_one.get_name(), &bout.odds.two_wins.as_frac(), &matchup.warning, ); BoutStatus::Announced } else { BoutStatus::Checked ...
Rust
0
und_active { let input = get_input(&packet); rlbot .interface() .update_player_input_flatbuffer(input.finished_data())?; } } } fn get_input<'a>(packet: &GameTickPacket) -> flatbuffers::FlatBufferBuilder<'a> { let ball = packet.ball.as_ref().expect...
Rust
0
lax_schema=core_schema.no_info_plain_validator_function(_validators.ip_v6_network_validator), strict_schema=make_strict_ip_schema(IPv6Network), serialization=core_schema.to_string_ser_schema(), ), lambda _1, _2: {'type': 'string', 'fo...
Python
1
import random import P as P import numpy as np import P # from sh_info import shInfoAbstract, _0_info from O0s_info import _projectiles_info, _waves_info, _clouds_info def _genesis(): ''' Creates instance of each info and stores in dict ''' gis = {} if 'projectiles' in P.O0_TO_SHOW: p...
Python
1
# Basic Programming 2 # https://open.kattis.com/problems/basicprogramming2 # TAGS: array, sorting # CP4: 2.2e, Sorting, Easier # NOTES: """ t == 1 condition is that x+y = 7777 for 2 values x,y in the input array AND that x != y But since 7777 is odd, it is impossible that x = y so no need to check anyway Don't know if ...
Python
1
from .models import City from app.utils.repository import BaseRepository class CityRepository(BaseRepository): model = City
Python
1
#!/usr/bin/env python3 # 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 "Lic...
Python
1
reamKeyBecameActive { .. } => (), message => panic!("Unexpected publisher message received: {:?}", message), }; } async fn new_publisher( request: RtmpEndpointRequest, mut receiver: UnboundedReceiver<RtmpEndpointPublisherMessage>, ) -> TestContext { let (mut clie...
Rust
0
from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from entity.ExcelData import TestRow from service.Logger import Logs def open_link_in_new_tab(driver, url: str, logs: Logs): logs.log.info(f"(WindowH...
Python
1
### Append stop word ### STOP_WORD = False ### Capitalization CAPITALIZATION = True ### small number EPSILON = 1e-100 ### Inference Types ### GREEDY = 0 BEAM = 1; BEAM_K = 2 VITERBI = 2 INFERENCE = VITERBI ### Smoothing Types ### LAPLACE = 0; LAPLACE_FACTOR = .2 INTERPOLATION = 1; LAMBDAS = None KNESERNEY = 2 GOOD...
Python
1
from fastapi import APIRouter, HTTPException import requests import json import os from dotenv import load_dotenv load_dotenv() BEARER_KEY = os.getenv('BEARER_KEY') router = APIRouter() @router.get("/alreadywatched/{movieIDs}") def movieDetails(movieIDs: str): movieList = movieIDs.split(",") try: ...
Python
1
} // 0x6000-0x7fff match self.mbc { MBC::MBC1 => { self.select_mode = if value == 0 { SelectMode::ROM } else { SelectMode::RAM }; }, MBC::MBC3 => { // Latch RTC register values // Not yet implemented }, _ => (), } } pub fn set_rom_bank(&mut self, b...
Rust
0
lazy_static! { /// Declaring lazily evaluated statics for app arguments pub static ref APP_ARGS: AppArgs = make_app_args(); /// Declaring lazily evaluated statics for app configurations pub static ref APP_CONF: Config = ConfigReader::make(); } pub fn make_app_args() -> AppArgs { let matches = App:...
Rust
0
struct ElementData { pub texcoord_id: [u16], pub normal_id: [u16], } } chum_binary! { /// A triangle strip's extra data #[derive(Clone, Debug)] pub struct StripExt { pub elements: [dynamic array [u32] [struct ElementData] ElementData::default()], } } #[derive(Clone, Debug)...
Rust
0
enumber, &chars[33..40])?; let beta = parse_number(linenumber, &chars[40..47])?; let gamma = parse_number(linenumber, &chars[47..54])?; // TODO: make a fancy error message if a part of the space group is not numeric let spacegroup = chars[55..std::cmp::min(66, chars.len())] .iter() .coll...
Rust
0
te, idle, nfc): if state == nfc.READER_STATE_REQUEST_TAG_ID_READY: ret = nfc.reader_get_tag_id() tag_id_str = ''.join([f"{x:02x}" for x in ret.tag_id]) Variables.last_nfc_card = tag_id_str Variables.last_nfc_card_type = ret.tag_type if idle: nfc.read...
Python
1
(&self) -> Html; /// The `rendered` method is called after each time a Component is rendered but /// before the browser updates the page. /// ## Examples /// ```rust ///# use yew::{Html, Component, ComponentLink, html, ShouldRender}; ///# struct Model{props: ()}; ///# impl Model { fn setup_...
Rust
0
st = "hello world" print(f"st :{st}") print(type(st)) print("-" * 60) print(f"st :{st}") print(f"st[0] :{st[0]}") print(f"st[6] :{st[6]}") print(f"st[10] :{st[10]}") print("-" * 60) # slicing print(f"st[0:5] :{st[0:5]}") print(f"st[6:11] :{st[6:11]}") print(f"st[0:11] :{st[0:11]}") print(f"st[0:11:2] :{st[0...
Python
1
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from itertools import product import torch from fvcore.common.benchmark import benchmark from tests.test_mesh...
Python
1
#!/usr/bin/env python3 """ DFG解析器模块 """ import re from typing import Dict, List, Optional class DFGParser: """DFG文件解析器""" def __init__(self): self.bind_pattern = r'\(Bind dest:([^\s]+).*?tree:(.*?)\)(?=\n\(Bind|\nBranch:|\n\n|\Z)' self.parsed_signals = {} def parse_file(self, fil...
Python
1
16, F17, F18, F19, F20, F21, F22, F23, F24, Execute, Help, Menu, Select, Stop, Again, Undo, Cut, Copy, Paste, Find, Mute, VolumeUp, VolumeDown, AltErase, Sysreq, Cancel, Clear, Prior, Return2, Separator, ...
Rust
0
# Auto generated configuration file # using: # Revision: 1.173 # Source: /cvs_server/repositories/CMSSW/CMSSW/Configuration/PyReleaseValidation/python/ConfigBuilder.py,v # with command line options: step1 -s HLT:HIon -n 2 --filein file.root --eventcontent FEVTDEBUGHLT --conditions MC_37Y_V0::All --mc --scenario Heav...
Python
1
# Задание Классы 4 # Создайте класс House. # # Добавьте в класс атрибуты is_roof_created и is_walls_created. Для данных атрибутов установите значение False # в классе House. # Добавьте в класс метод create_walls, который выводит в консоль сообщение "Построили стены" # и меняет значение атрибута is_walls_created на True...
Python
1
overformat", None) _v = yhoverformat if yhoverformat is not None else _v if _v is not None: self["yhoverformat"] = _v _v = arg.pop("yperiod", None) _v = yperiod if yperiod is not None else _v if _v is not None: self["yperiod"] = _v _v = arg.pop("yp...
Python
1
thub.com/postcss/autoprefixer/blob/main/data/prefixes.js#L79 // TODO add `border-radius` https://github.com/postcss/autoprefixer/blob/main/data/prefixes.js#L59 // TODO fix me https://github.com/postcss/autoprefixer/blob/main/lib/hacks/intrinsic.js // TODO add https://github.com/postc...
Rust
0
/// ``` /// /// The [take_mut](https://docs.rs/take_mut) crate offers a sound solution, /// at the cost of either lazily creating a replacement value or aborting /// on panic, to ensure that the uninitialized value cannot be observed. #[clippy::version = "1.39.0"] pub MEM_REPLACE_WITH_UNINIT...
Rust
0
::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tcd6_nbytes_mlno](tcd6_nbytes_mlno) module"] pub type TCD6_NBYTES_MLNO = crate::Reg<u32, _TCD6_NBYTES_MLNO>; #[allow(missing_docs)] #[do...
Rust
0
::select_all; use optics_base::{cancel_task, OpticsAgent}; use optics_core::Common; use crate::{settings::UpdaterSettings as Settings, updater::Updater}; #[allow(unused_must_use)] async fn _main() -> Result<()> { color_eyre::install()?; let settings = Settings::new()?; let agent = Updater::from_settings...
Rust
0
:, 0].unsqueeze(-1), 1e3 ).squeeze(2) return mel_postnet, mel_linear, stop_token @torch.no_grad() def inference(self, text, max_length=800, stop_token_threshold = 0.5, with_tqdm = True): self.eval() self.train(False) text_lengths = torch.tensor(text.shape[1]).unsqueeze(0).cuda...
Python
1
ulate the form. user_settings = db_manager.fetchone(''' SELECT email, pushover_user_key, pushover_api_token, notify_email, notify_pushover, apprise_url, notify_apprise FROM users WHERE id = ? ''', (user_id,)) # Fetch by user_id. if...
Python
1
break # 过滤 value_map if attribute.value_map: # 将 property_value_list_keys 转换为集合 property_value_list_keys = set(property_value_list.split(',')) # 确保 value_map_keys 是一个集合 value_map_keys = set...
Python
1
# Copyright (c) 2024 Chai Discovery, Inc. # Licensed under the Apache License, Version 2.0. # See the LICENSE file for details. from pathlib import Path from tempfile import TemporaryDirectory from chai_lab.data.dataset.msas.colabfold import generate_colabfold_msas from chai_lab.data.dataset.msas.msa_context import M...
Python
1
let mut serialized = vec![0; data.serialized_size()]; data.serialize(&mut serialized[..]).unwrap(); let de = T::deserialize(&serialized[..]).unwrap(); assert_eq!(data, de); let mut serialized = vec![0; data.uncompressed_size()]; data.serialize_uncompressed(&mut serializ...
Rust
0
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations from typing_extensions import Literal, TypedDict __all__ = ["PermissionRetrieveParams"] class PermissionRetrieveParams(TypedDict, total=False): after: str """Identifier for the last perm...
Python
1
odify(intr::ERROR::CLEAR); } /// Clear the event IRQ fn clear_event_interrupt(&self) { let regs = self.registers; regs.intr_state.modify(intr::SPI_EVENT::CLEAR); } /// Will generate a `test` interrupt on the error irq /// Note: Left to allow debug accessibility #[allow(dead_...
Rust
0
"""构建模型的参数和工具""" import numpy as np import pandas as pd import torch from torch.utils.data import Dataset, DataLoader class CSVDataset(Dataset): # def __init__(self, csv_file, n_rows): # """ # 初始化函数 # Args: # csv_file: CSV 文件路径 # n_rows: 读取的行数 # chunksize: 每次读取...
Python
1
: Borrow<T> + PartialOrd, R: RangeBounds<T>, T: PartialOrd { let x_is_empty = match (x.start_bound(), x.end_bound()) { (Bound::Included(s), Bound::Included(e)) => e < s, (Bound::Included(s), Bound::Excluded(e)) => e <= s, (Bound::Excluded(s), Bound::Included(e)) => e <= s...
Rust
0
# Generated by Django 4.2.20 on 2025-05-13 07:35 from django.db import migrations, models port_values = {} def convert_admin_state_up_to_boolean(apps, schema_editor): Port = apps.get_model("openstack", "Port") for port in Port.objects.all(): if port.admin_state_up == "True": port_values[...
Python
1
import matplotlib.pyplot as plt import numpy as np class Dice: def __init__(self, num_dice: int): self.num_dice = num_dice def play(self, number_of_times: int) -> np.ndarray: results: np.ndarray = np.random.randint(1, 7, size=(self.num_dice, number_of_times)) results = results.sum(0) ...
Python
1
# PROGRAMA GERADOR DE CPF: def gerar_cpf(): # GERADOR DOS NOVE DÍGITOS: import random cpf_gerado = str() counter = 1 while counter <= 9: numero_aleatorio = random.randint(0, 9) cpf_gerado += f'{numero_aleatorio}' counter += 1 # VERIFICAÇÃO DO PRIMEIRO DÍGITO: ...
Python
1
cbrDpeVersion, "cbrDpeIsConnected": cbrDpeIsConnected, "cbrDpeInMessages": cbrDpeInMessages, "cbrDpeOutMessages": cbrDpeOutMessages, "cbrDpeInMsgAvgSize": cbrDpeInMsgAvgSize, "cbrDpeOutMsgAvgSize": cbrDpeOutMsgAvgSize, "cbrDpeInMsgMaxSize": cbrDpeInMsgMaxSize, "cbrDpeInM...
Python
1
from django.contrib import admin from project.models import Project,Category,Tag,Picture,Rate,Donation,Comment # Register your models here. admin.site.register(Project) admin.site.register(Category) admin.site.register(Tag) admin.site.register(Picture) admin.site.register(Donation) admin.site.register(Rate) admin.sit...
Python
1
f you want to add (new) or remove (existing) settings, please add setting # in config file like below (just Python dictionay operations): # # *) Add a new one or replace existing one; # # MLMMJ_DEFAULT_PROFILE_SETTINGS.update({key: value}) # # *) Remove an existing one: # # MLMMJ_DEFAULT_PROFILE_SETTINGS.po...
Python
1
#*************************************************************************** #* * #* Copyright (c) 2016 - Victor Titov (DeepSOIC) * #* <vv.titov@gmail.com> * #* ...
Python
1
ate', 'n_clicks', 'n_dblclicks', 'n_loads', 'opacity', 'pane', 'url', 'zIndex'] self._valid_wildcard_attributes = [] self.available_properties = ['children', 'id', 'alt', 'attribution', 'bounds', 'bubblingMouseEvents', 'className', 'clickData', 'crossOrigin', 'dblclickData', 'disableDefaultEv...
Python
1
lientConfig]: ../../../framework/struct.HttpApiClient.html /// [response]: ../struct.AppSetup.html pub struct AppSetupDetails<'a> { /// setup_id is the unique setup identifier. pub setup_id: &'a str, } #[cfg(feature = "builder")] impl<'a> AppSetupDetails<'a> { pub fn new(setup_id: &'a str) -> AppSetupDetai...
Rust
0
from __future__ import annotations import torch from transformers.utils import logging from app.config import settings from .architecture import ( Basic_EmbeddingModel, EmbeddingModel, Hierarchical_EmbeddingModel, SentenceTransformerToHF, TokenizerTextSplitter, ) # Hide unwanted warnings regardi...
Python
1
from abaqusConstants import * from .Leaf import Leaf class LeafFromModelElemLabels(Leaf): """The LeafFromModelElemLabels object can be used whenever a Leaf object is expected as an argument. Leaf objects are used to specify the items in a display group. Leaf objects are constructed as temporary objects, w...
Python
1
2 + 1.0 x3)).unwrap(); //! prob.add_constraint(con!("c2": 30.0 >= 1.0 x1 + (-3.0) x2 + 1.0 x3)).unwrap(); //! //! // solve the problem //! let sol = prob.solve().unwrap(); //! println!("{:?}", sol); //! // values taken from the output of `lpex1.c` //! assert!(sol.objective == 202.5); //! ass...
Rust
0
import tkinter as tk from tkinter import ttk, messagebox import sqlite3 from datetime import datetime def fetch_tasks(): conn = sqlite3.connect('tasks.db') cursor = conn.cursor() cursor.execute("SELECT * FROM tasks") rows = cursor.fetchall() conn.close() return rows def add_task(): title =...
Python
1
h for `Keystore` files pub fn default_keystore_path(chain_id: &str) -> PathBuf { let mut path = default_path(); path.push(chain_id); path.push("keystore"); path } impl Storages { /// Create storage using user directory if specified, or default path in other case. pub fn new(path: PathBuf) -> St...
Rust
0
from openai.openai_object import OpenAIObject class Customer(OpenAIObject): @classmethod def get_url(cls, customer, endpoint): return f"/customer/{customer}/{endpoint}" @classmethod def create(cls, customer, endpoint, **params): instance = cls() return instance.request("post",...
Python
1
BOT_TOKEN = ''
Python
1
)(ed) # ed-G out = LazyConcatenate()([n, ed, ud]) out = MLP(**output_mlp)(out) # raw megnet message and aggregate part # for i in range(0, nblocks): # if has_ff and i > 0: #T # vp2 = GraphMLP(**node_ff_args)(vp) # ep2 = GraphMLP(**edge_ff_args)(ep) # ...
Python
1
let consumer = ALICE; let shopping_agent = BOB; // 消费者最初的余额 let origin_consumer_balance = GenericAsset::free_balance(origin_order.currency, &consumer); // 代购者最初的余额 let origin_shopping_agent_balance = GenericAsset::free_balance(origin_order.currency, &shoppin...
Rust
0
ass = CustomPageNumberPagination @HasPermission("Integration-View,Alarms-View") def list(self, request, *args, **kwargs): return super().list(request, *args, **kwargs) class LevelModelViewSet(ModelViewSet): """ 告警等级视图集 """ # TODO 创建的时候动态增加level_id 锁表 queryset = Level.objects.all()...
Python
1
ot self.polling_active: threading.Thread(target=self.league_polling_loop, daemon=True).start() time.sleep(3) # ---------- Match Polling ---------- def league_polling_loop(self): self.polling_active = True api_url = self.api_url_var.get() api_key = self.ap...
Python
1
ne] pub fn is_uart1_receive(&self) -> bool { *self == DMAMUXPER4R::UART1_RECEIVE } #[doc = "Checks if the value of the field is `I2S1_DMA_REQUEST_2`"] #[inline] pub fn is_i2s1_dma_request_2(&self) -> bool { *self == DMAMUXPER4R::I2S1_DMA_REQUEST_2 } #[doc = "Checks if the val...
Rust
0
# Copyright 2022-2023 OmniSafe Team. 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 ...
Python
1
= "P3\n3 2\n255\n0 0 0 \n26 26 26 \n51 51 51 \n76 76 76 \n102 102 102 \n128 128 128 \n"; let mut buffer = Vec::new(); let image = { let mut temp = Image::new(3.try_into().unwrap(), 2.try_into().unwrap()).unwrap(); temp.as_mut().iter_mut().enumerate().for_each(|(count, pixel)| { let v...
Rust
0
onnector=sim.AllToAllConnector(location_selector=random_section(apical_dendrites())), synapse_type=sim.StaticSynapse(weight=0.5, delay=0.5), receptor_type="AMPA" ) print("Running simulation") sim.run(10) # (pyramidal_cells + interneurons).write_data("ou...
Python
1
>>, after_flush: bool, rep: BuilderRep, } impl BlockBasedTableBuilder { pub fn new( options: &TableBuilderOptions, table_options: BlockBasedTableOptions, file: Box<WritableFileWriter>, ) -> Self { let data_block_builder = BlockBuilder::new( table_options.bloc...
Rust
0
from abc import ABC, abstractmethod from typing import List from canopy.knowledge_base.models import KBDocChunk from canopy.models.data_models import Document from canopy.utils.config import ConfigurableMixin class Chunker(ABC, ConfigurableMixin): """ Base class for chunkers. Chunkers take a document (id, te...
Python
1
utPoint, is_issuance_asset: bool, is_issuance_token: bool, ) -> BlindData { BlindData { vout, asset: data.asset.clone(), amount: data.amount.clone(), asset_blind_factor: data.asset_blind_factor.clone(), amount_blind_factor: data.amount_blind_factor.clone(), issuance_out...
Rust
0
d_phases + 180) % 360 - 180 print("coarse_corrected_unwrapped_phases",np.max(coarse_corrected_unwrapped_phases)) # --- Step 3: Fine Corrections (Residual CFO & Phase Offset) --- # 调用我们融合后的新函数 final_calibrated_wrapped = calculate_fine_corrections( subburst_times, corr_mags, coarse...
Python
1
might be in. In the image, they're ordered /// from left to right, then from top to bottom. #[derive(Clone, Copy)] enum ShipStance { UpNorm = 0, UpFast = 1, UpSlow = 2, MidNorm = 3, MidFast = 4, MidSlow = 5, DownNorm = 6, DownFast = 7, DownSlow = 8 } impl Ship { pub fn...
Rust
0
n_bits, 5, 1, 6) } // [12] => uimm[5] // [6:2] => uimm[4:2|7:6] fn lwsp_uimmediate(instruction_bits: u32) -> u32 { x(instruction_bits, 4, 3, 2) | x(instruction_bits, 12, 1, 5) | x(instruction_bits, 2, 2, 6) } // [12] => uimm[5] // [6:2] => uimm[4:3|8:6] fn fldsp_uimmediate(instruction_bits: u32) -> u32 { x(...
Rust
0
iounit: 0, }) } fn rread(&mut self, fid: &mut Fid<Self::Fid>, _offset: u64, _count: u32) -> Result<Fcall> { let mut fid = fid.aux_mut(); let entry = self.get_node(&fid.path).ok_or(errno!(EINVAL))?; let buf = if fid.already_read { Data(Vec::new()) ...
Rust
0
import numpy as np import pandas as pd from featuretools.primitives import NumCharacters from featuretools.tests.primitive_tests.utils import ( PrimitiveTestBase, find_applicable_primitives, valid_dfs, ) class TestNumCharacters(PrimitiveTestBase): primitive = NumCharacters def test_general(self)...
Python
1
3, 0, pwm3_pos) print(pwm3_pos) def servo_init(): pwm.set_pwm(0, 0, pwm0_pos) pwm.set_pwm(1, 0, pwm1_pos) pwm.set_pwm(2, 0, pwm2_max) pwm.set_pwm(3, 0, pwm3_pos) try: pwm.set_all_pwm(0, 300) except: pass def clean_all(): global pwm pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(50) pwm.set_all_pwm...
Python
1
with ( mock.patch( "prowler.providers.common.provider.Provider.get_global_provider", return_value=aws_provider, ), mock.patch( "prowler.providers.aws.services.cloudwatch.cloudwatch_log_group_kms_encryption_enabled.cloudwatch_log_group_k...
Python
1
tribute_str].data) if component.numel() == 1: configs.logger.info(f'{attribute_str} = {component.item()} is loaded.') flag = False else: component.load_stat...
Python
1
print(tamsayi_mi(okuma(input("bir metin girin: ")))) 3) Şoru 1 ve Soru 2'deki fonksiyonları kullanarak kullanıcıdan tamsayı alalım. Ve bu sayıyı dönelim. Soru 2 bize tamsayı almayı garantiler. Kullanıcı tamsayı girmemişse tekrar tekrar (recursive) soralım. # Çözüm: def okuma(text): try: ...
Python
1
# -*- coding: utf-8 -*- import itcase_sphinx_theme # -- General configuration ------------------------------------------------ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', ...
Python
1
dtype=pl.Array(pl.Array(pl.Int64, 2), 2), ) b = pl.Series( [[[0, 0], [0, 0]], [[0, 0], [0, 0]]], dtype=pl.Array(pl.Array(pl.Int64, 2), 2), ) e = a # added 0 assert_series_equal(exec_op(a, b, op.add), e) def test_array_elementwise_arithmetic_19682() -> None: dt = pl.Array(p...
Python
1
corrupted.")?; Ok(()) } #[derive(Error, Debug)] enum WorldCreationError { #[error("There is already a folder at this path.")] PathExists, } pub fn create_world(path: &Path, name: String, force: bool) -> Result<World> { if path.exists() && path.read_dir()?.next().is_some() && !force { return E...
Rust
0
from rigour.mime.types import XLSX from typing import Dict from zavod import helpers as h import openpyxl import re from zavod import Context from zavod.entity import Entity from zavod.shed.zyte_api import fetch_html, fetch_resource # "a.k.a.", "A.K.A.:" and variations # ידוע גם ("also known as") # ועוד ידוע: ("and a...
Python
1
"""Tests for the simplified meet_notes entry point""" import pytest from unittest.mock import Mock, patch, MagicMock from pathlib import Path import sys from dnd_notetaker.meet_notes import main class TestMeetNotes: """Test the main entry point""" @patch('dnd_notetaker.meet_notes.Config') @patch('d...
Python
1
2 * t**2 / (rho**2 + z**2) assert vec.Et2.subs(values).evalf() == pytest.approx(80) def test_rhophi_theta_tau(): vec = vector.MomentumSympy4D( vector.backends.sympy.AzimuthalSympyRhoPhi(rho, phi), vector.backends.sympy.LongitudinalSympyTheta( sympy.acos(z / sympy.sqrt(rho**2 + z**2...
Python
1
} else { None } }, }) } 4 => { m.players.push(PlayerDetail::Remove { uuid: uuid }) } _ => panic!(), } ...
Rust
0
MetaOp::Unrecognized => Request::Invalid { error: format!("Unrecognized operator"), }, } } async fn parse(tokens: LexerResult<'_>) -> Request { match tokens.op { Operator::MiscOp(op) => validate_misc_op(op, tokens.argv).await, Operator::StringOp(op) => validate_string_op(op,...
Rust
0
l_mesh.vertices[ # markers_indices # ] # shape(num_markers, 3) tree = cKDTree(new_smpl_mesh.vertices) inner_points = sample_points - vectors dists, indices = tree.query(inner_points, k=1) geodesic_distances = geodesic_distances_on_vertices[indices].reshape(-1, 1) ...
Python
1
, 1] val_score = self.eval(val_labels, probs[self.val_graph.ndata['val_mask']]) if val_score[self.train_config['metric']] > self.best_score: if self.train_config['inductive']: loss, logits = self.model(self.source_graph) probs = logits.soft...
Python
1
Vdpa::new(device_path, mem).map_err(Error::CreateVhostVdpa)?; vhost.set_owner().map_err(Error::SetOwner)?; let device_type = vhost.get_device_id().map_err(Error::GetDeviceId)?; let queue_size = vhost.get_vring_num().map_err(Error::GetVringNum)?; let avail_features = vhost.get_features()....
Rust
0