text
string
label_name
string
labels
int64
h, rodeo_fxhash); criterion_main!(benches); <gh_stars>1-10 #![feature(auto_traits)] // @has auto_aliases/trait.Bar.html '//*[@data-aliases="auto_aliases::Foo"]' 'impl Bar for Foo' pub struct Foo; pub auto trait Bar {} //! The type index is an intermediate index that is executed first. //! This allows the main index ...
Rust
0
aura: AuraId, grandpa: GrandpaId) -> SessionKeys { SessionKeys { grandpa, aura } } /// Configure initial storage state for FRAME modules. fn testnet_genesis(wasm_binary: &[u8], _enable_println: bool) -> GenesisConfig { let rand_str = || -> String { OsRng.sample_iter(&Alphanumeric).take(32).map(char::from).collect(...
Rust
0
[0] * deltaTime particle['POSITION'][1] += particle['VELOCITY'][1] * deltaTime pygame.draw.circle(SCREEN, (114,183,207), particle['POSITION'], int(particle['RADIUS'])) pygame.draw.circle(SCREEN, particle['COLOR'], particle['POSITION'], int(particle['RADIUS']-2...
Python
1
from aiogram import Router from aiogram.types import Message from aiogram.filters import Command from aiogram.fsm.context import FSMContext from apps.bot.keyboards.inline import language_keyboard from apps.bot.keyboards.default import main_menu_keyboard from apps.bot.states.main_menu import MainMenu as MainMenuState f...
Python
1
from datetime import datetime from random import randint import time from camunda.external_task.external_task import ExternalTask from camunda.utils.log_utils import log_with_context def handle_task(task: ExternalTask): log_context = {"WORKER_ID": task.get_worker_id(), "TASK_ID": task.get_tas...
Python
1
#!/usr/bin/env python # pylint: disable=W0212 import leather def scatterplot(self, x=0, y=1, path=None, width=None, height=None): """ Render a scatterplot using :class:`leather.Chart`. :param x: The name or index of a column to plot as the x-axis. Defaults to the first column in the tabl...
Python
1
import os import re from shutil import copyfile import pandas as pd scraped = pd.read_csv('scraped.csv') urlList = {} for row in scraped.iterrows(): for item in row[1].items(): # print(item[1]) text = re.search("text='(.*?)'", item[1]) if text == None: text = re.search("text=\"...
Python
1
while let Some(chunk) = res.chunk().await.map_err(ErrorKind::RequestError)? { file.write_all(&chunk).await.map_err(ErrorKind::IOError)?; } file.sync_all().await.map_err(ErrorKind::IOError)?; log::info!("[MinIO] 下载完毕。 Download completed."); let path = minio::do_install(&path).map_err(Erro...
Rust
0
""" Implements /src/Actionable/index.ts """ class Actionable: """ Enum implementation """ class Types: WOOD = 'wood' COAL = 'coal' URANIUM = 'uranium' def __init__(self, configs, cooldown=0.0) -> None: """ :param configs: :param cooldown: ...
Python
1
sses(): config_manager = get_config_manager() # 使用会话特定的配置管理器 classes = [] for class_key, class_data in config_manager.classes.items(): classes.append({ 'key': class_key, 'name': class_data['name'], 'description': class_data['description'], 'stats': cl...
Python
1
import os import pytest from test_utils import run_query, ProgrammingError here = os.path.dirname(__file__) def test_quadkey_conversion_success(): result = run_query( """SELECT @@RS_SCHEMA@@.QUADINT_TOQUADKEY( @@RS_SCHEMA@@.QUADINT_FROMZXY(2, 1, 1)) as quadkey1, @@RS_SCHEMA@@.QUADINT_TOQ...
Python
1
uct mcontext_t { // Note in the kernel this is just part of regs which is length 32 pub fault_address: u64, pub regs: [u64; 31], pub sp: u64, pub pc: u64, pub pstate: u64, // Note that u128 is ABI safe on aarch64, this is actually a ...
Rust
0
s); // Get paths from root to each element let path_you = find_in_tree(&map, "COM", "YOU"); let path_san = find_in_tree(&map, "COM", "SAN"); // Count how many leading elements are identical for both paths let common_elements = path_san .iter() .zip(path_you.iter()) .filter(...
Rust
0
""" Jump Around Starting from 0 on a number line, you would like to make a series of jumps that lead to the integer N. On the `i`th jump, you may move exactly `i` places to the left or right (1st jump -> 1 place, 2nd jump -> 2 places, etc.). Determine the smallest number of jumps needed to get from 0 to N. ## Bus...
Python
1
import web #Importar la clase ModeloIndex from mvc.models.modelo_index import ModeloIndex render = web.template.render('mvc/views/') #objeto de la clase ModeloIndex m_index = ModeloIndex() class Index: def GET(self): try: return render.index(m_index.nombre) except Exception as e: ...
Python
1
str = "Hi, $Iam the $ symbol $ 99.99" print(str.count("$"))
Python
1
from numpy import zeros,sin,cos,array #------------------------------------------------------- # calculates the inverse of one or more transformations # #------------------------------------------------------- def tinv(tab: array): tba = zeros((len(tab),1)) for t in range(0,tab.shape[1], 3): tba[t:t+3,:...
Python
1
import torch from torch import nn import algorithm.nn_models as m class ModelRep(m.ModelBaseRep): def _build_model(self): assert self.obs_shapes[0] == (44,) assert self.obs_shapes[1] == (6,) self.rnn = m.GRU(self.obs_shapes[0][0] + self.c_action_size, 8, 1) def forward(self, obs_lis...
Python
1
logger.debug( "f: %s, 画面 check: square_poses[yi][1]: %s, square_poses[yi][2]: %s, top_edge_pos[1]: %s, top_edge_pos[2]: %s", fno, square_poses[yi][1], square_poses[yi][2], top_edge_pos[1], top_edge_pos[2], ...
Python
1
import utils import codonbias as cb import numpy as np def run(): print('Running: Scoring sequences for CAI.') standard_cai_analysis() # Measures CAI of gene found in host to the host's reference genes. # Example: H5N1 found in duck is score against duck reference genes. def standard_cai_analysis(): score...
Python
1
d|>user<|end_header_id|> {USER1}<|eot_id|><|start_header_id|>assistant<|end_header_id|> {ASSISTANT1}<|eot_id|><|start_header_id|>user<|end_header_id|> {USER2}<|eot_id|><|start_header_id|>assistant<|end_header_id|> {ASSISTANT2}<|eot_id|>"""), ] ) @pytest.mark.parametrize("add_generation_prompt", [True, False]) d...
Python
1
'priority': '2', 'partner_assigned_id': user.commercial_partner_id.id, } if tag_own: values['tag_ids'] = [(4, tag_own.id, False)] lead = self.create(values) lead.assign_salesman_of_assigned_partner() lead.convert_opportunity(lead.partner_id) ...
Python
1
def return_match_idx(mat, ord=None, eps=0.1, return_arr=False): d0 = mat[:, 0].T ds = mat[:, 1:].T Z = mat.shape[0] arr = np.linalg.norm(ds - d0, ord=ord, axis=1) / Z mat_idx = np.where((arr < eps) & (arr > 1e-08))[0] if return_arr: return mat_idx, arr return mat_idx
Python
1
from dynamic_preferences.types import ChoicePreference from .fields import MultiValueChoiceField from .serializers import MultiValueSerializer class MultiValueChoicePreference(ChoicePreference): nfields = 5 allow_empty = False field_class = MultiValueChoiceField serializer = MultiValueSerializer ...
Python
1
type PaperReferencesEndpoint = BaseEndpoint<PaperReferencesParams>; pub struct GetPaperReferences(PaperReferencesEndpoint); impl GetPaperReferences { pub fn new(query_params: PaperReferencesParams, paper_id: String) -> GetPaperReferences { let endpoint = paper_references_endpoint(&paper_id); GetPa...
Rust
0
>) -> Vec<IocEntrySearchResult> { return vec![]; } #[cfg(windows)] pub fn check_registry(search_parameters: Vec<RegistryParameters>, deep_search_enabled: bool) -> Vec<IocEntrySearchResult> { if search_parameters.is_empty() { return vec![]; } info!("Registry search: Searching IOCs using registry...
Rust
0
each time, only if you want to save a few KiB. #[macro_use] extern crate derive_error; extern crate phf_codegen; extern crate itertools; use itertools::Itertools; use std::fs; use std::io::{self, Read, Write}; use std::str; #[derive(Debug, Error)] enum Error { Io(io::Error), Utf8(str::Utf8Error), } type R...
Rust
0
b"35" => Color::Magenta, b"36" => Color::Cyan, b"37" => Color::White, b"90" => Color::Ansi256(8), b"91" => Color::Ansi256(9), b"92" => Color::Ansi256(10), b"93" => Color::Ansi256(11), b"94" => Color::Ansi256(12), b"95" => C...
Rust
0
agent_pool: &'a [&'b B], ) -> Result<impl Iterator<Item = Option<&'b str>> + 'a> { let mut iterables = Vec::with_capacity(agent_pool.len()); // Collect iterators first, because we want to check for any errors. for agent_batch in agent_pool { let iterable = (*agent_batch).as_re...
Rust
0
# aggregator/aggregator.py import os import base64 import torch import tenseal as ts import json import random import hashlib class Aggregator(): def __init__(self, agg_id: str): self.__agg_id = agg_id self.__global_update = {} contextpath = os.path.join(os.path.dirname(__file__), "tenseal...
Python
1
from laia.decoders.ctc_alignment import ctc_alignment from laia.decoders.ctc_greedy_decoder import CTCGreedyDecoder from laia.decoders.ctc_language_decoder import CTCLanguageDecoder from laia.decoders.ctc_nbest_decoder import CTCNBestDecoder
Python
1
ICE_POST_INSTALL => Some(MSFSEvent::PostInstall), sys::PANEL_SERVICE_PRE_INITIALIZE => Some(MSFSEvent::PreInitialize), sys::PANEL_SERVICE_POST_INITIALIZE => Some(MSFSEvent::PostInitialize), sys::PANEL_SERVICE_PRE_UPDATE => Some(MSFSEvent::PreUpdate), ...
Rust
0
ist[WordFormOut]]: sentences_probabilities = self.model.predict_probabilities(sentences, batch_size, self.build_config) answers = [] for words, words_probabilities in zip(sentences, sentences_probabilities): answers.append(self.__get_sentence_forms(words, words_probabilities, include...
Python
1
import pytest from apps.homework.models import AnswerCrossCheck pytestmark = [ pytest.mark.django_db, pytest.mark.repeat(10), # we have to repeat this test suite because the method does randomizing ] @pytest.fixture def answers(mixer, question, user, another_user): return mixer.cycle(2).blend("homework...
Python
1
CStr::from_ptr((*opts).pool_name).to_string_lossy() }; let vdev = if (*opts).vdev.is_null() { eprintln!("Error: vdev option is required"); return 1; } else { CStr::from_ptr((*opts).vdev).to_strin...
Rust
0
import mlx.nn as nn from core.models.model_config import ModelConfig from core.models.architectures.model import Model from core.models.architectures.starcoder2.starcoder2_model import Starcoder2Model class Starcoder2ForCausalLM(Model): def __init__(self, args: ModelConfig): super().__init__(args) ...
Python
1
17360c61abbc0bdce513eb42295402eb5dde3d13abfc0325f277f507bc"), field_element!("034738bd5956b1df55369cdc211109fd67e6ffd2ffbb08e856b1b4d1b1a2c6ae"), ]); } proptest!( #[test] fn ifft_is_inverse(v: Vec<FieldElement>) { prop_assume!(!v.is_empty()); let tru...
Rust
0
let lam: [Limb; 4] = [0, 0, 0, 0]; let r: [*mut Limb; 3] = [lam.clone().as_mut_ptr(), lam.clone().as_mut_ptr(), lam.clone().as_mut_ptr()]; let g_2_x: &[Limb] = &[0x0af037bfbc3be46a, 0x83bdc9ba2d8fa938, 0x5349d94b5788cd24, 0x0d7e9c18caa5736a]; let g_2_y: &[Limb] = &[0x6a7e1a1d69db9ac1, 0xccbd8d37...
Rust
0
ext https://bitbucket.org/foo/bar", "https://bitbucket.org/foo/bar is great", "oh, https://bitbucket.org/foo/bar?", ], "https://bitbucket.org/foo/bar", ); testcase!( gitlab_in_text, [ "https://gitlab.com/foo/bar", "This is text htt...
Rust
0
": Loudness_Meter_1770, "Audio Gain Match (1770)": Audio_Gain_Match_1770, "Metrics (LSD + SI-SDR)": Metrics_LSD_SISDR, "Resample Audio (HQ)": Resample_Audio_HQ, } NODE_DISPLAY_NAME_MAPPINGS = { "ABX Prepare": "Egregora ABX Prepare", "ABX Judge": "Egregora ABX Judge", "Loudness Meter (BS1770)": ...
Python
1
import json import zlib import os class FileCompressor: @staticmethod def obfuscate(data, password): return bytes( [b ^ ord(password[i % len(password)]) for (i, b) in enumerate(data)] ) @staticmethod def compress_string(string_data, zip_path, password): compressed_...
Python
1
import ctypes import rotypes import rotypes.idldsl import rotypes.Windows.Foundation from rotypes.types import REFGUID @rotypes.idldsl.GUID('A37624AB-8D5F-4650-9D3E-9EAE3D9BC670') class _IDirect3DDevice(rotypes.IInspectable): pass class IDirect3DDevice(_IDirect3DDevice, rotypes.Windows.Foundation.IClosable): ...
Python
1
if number > data as usize { return number; } } unreachable!(); } //----------------------------------------------------- // Questions. pub struct Q; impl Day for Q { fn number(&self) -> String { String::from("3") } fn a(&self) { print!("{}A: ", self.nu...
Rust
0
bscribe(self.sensor_combined_sub); } } } use core::panic::PanicInfo; /// This function is called on panic. #[panic_handler] fn panic(_info: &PanicInfo) -> ! { loop {} } <reponame>dsaxton/feroxbuster<filename>src/scanner/tests.rs<gh_stars>1000+ use std::sync::Arc; use tokio::sync::Semaphore; use...
Rust
0
G_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `FCNTHF2IFG`"] pub type FCNTHF2IFG_R = crate::R<bool, FCNTHF2IFG_A>; impl FCNTHF2IFG_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> FCNTHF2IFG_A { match self.bits { false ...
Rust
0
pub fn expand_endpoint(ty: EndpointType, attrs: AttributeArgs, fun: ItemFn) -> Result<TokenStream> { let endpoint_type = match expand_endpoint_type(ty, attrs, &fun) { Ok(code) => code, Err(err) => err.to_compile_error() }; Ok(quote! { #fun #endpoint_type }) } use crate::trap::T_IRQ0; pub struct IoApic { ...
Rust
0
print((' epoch %i, minibatch %i/%i, test error of ' 'best model %f %%') % (epoch, minibatch_index + 1, n_train_batches, test_score * 100.)) if patience <= iter: done_looping = True ...
Python
1
值。 :type Address: str :param _Role: 角色。 注意:此字段可能返回 null,表示取不到有效值。 :type Role: str :param _Hidden: 是否为Hidden节点 注意:此字段可能返回 null,表示取不到有效值。 :type Hidden: bool :param _Status: 节点状态,包括:ORMAL/STARTUP/RECOVERING/STARTUP2/UNKNOWN/DOWN/ROLLBACK/REMOVED等。 注意:此字段可能返回 null,表示取不到有效值。 ...
Python
1
from webhook_processors.linear_abstract_webhook_processor import ( _LinearAbstractWebhookProcessor, ) from port_ocean.core.handlers.port_app_config.models import ResourceConfig from port_ocean.core.handlers.webhook.webhook_event import ( EventPayload, WebhookEvent, WebhookEventRawResults, ) from linear....
Python
1
uchsia_settings::DisplayMarker>() .context("Failed to connect to display service")?; let output = await!(display::command(display_service, brightness, auto_brightness))?; println!("Display: {}", output); } SettingClient::Intl { time_zone, temperature_unit, locales...
Rust
0
n = int(input()) s = 0 while s <= n: for p in range(2, n): summa = 0 s = (2 ** (p - 1)) * ((2 ** p) - 1) if s > n: break for i in range(1, (s // 2) + 1): if s % i == 0: summa += i if summa == s: print(s)
Python
1
command_buffer.insert_resource(3.14f32); command_buffer.apply(&mut world, &mut resources); let results = world .query::<(&u32, &u64)>() .map(|(a, b)| (*a, *b)) .collect::<Vec<_>>(); assert_eq!(results, vec![(1u32, 2u64)]); assert_eq!(*resources.get:...
Rust
0
_healthy = true; let days_left_output = if days_until_end.num_days() as f64 <= calculated.days_left { days_left_output.green() } else { all_are_healthy = false; days_left_output.red() }; let days_left_essential_output = if days_until_end.num_days() as f64 <= calculated.days_left_essential { days...
Rust
0
et val = Box::<Value>::leak(val); /// assert!(!haystack_value_is_na(val)); /// assert!(haystack_value_is_bool(val)); /// # } /// ``` /// # Safety /// Panics on invalid input data #[no_mangle] pub unsafe extern "C" fn haystack_value_is_bool(val: *const Value) -> bool { safe_bool_call!(val, is_bool) } /// Construct ...
Rust
0
import smtplib import random import pandas import datetime as dt date = dt.datetime.now() today = (date.month, date.day) data = pandas.read_csv("birthdays.csv") birthday_dict = {(row.month, row.day): row for (index, row) in data.iterrows()} if today in birthday_dict: n = random.randint(1, 3) file_path = f"...
Python
1
eater than or equal to tau // if it is, we end the test as it has failed let proportion_minus_point_five = proportion as f64 - 0.5; println!("{}", proportion_minus_point_five.abs()); if proportion_minus_point_five.abs() >= tau { println!("The absolute value of the proportion - 1/2 is greater th...
Rust
0
) / 2 = 3) /// ``` /// /// - A **Chunk** has size of _(log N)^2_. Its value is _rank(<u>index of the last bit of the chunk</u>)_. /// - A **Block** has size of _(log N) / 2_. A chunk has many blocks. Block's value is the number of '1's in _[<u>index of the first bit of the chunk the block belongs to</u>, <u>index of th...
Rust
0
); } } assert_eq!(d_min, 9.0); assert_eq!(d_max, 25.0); } #[test] fn test_closest_idx() { let p1 = vec![0.0, 0.0]; let p2 = vec![1.0, 0.1]; let p3 = vec![1.0, 1.0]; let p4 = vec![2.0, 1.0]; let pointset = PointSet::init_from_prese...
Rust
0
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution(object): def recoverFromPreorder(self, traversal): """ :type traversal: str :...
Python
1
), ws(expr_any)))), opt(char('-')), ))), )); let (i, (pws, _, (var, val, nws))) = p(i)?; Ok(( i, if let Some((_, val)) = val { Node::Let(Ws(pws.is_some(), nws.is_some()), var, val) } else { Node::LetDecl(Ws(pws.is_some(), nws.is_some()), v...
Rust
0
from datetime import datetime as dt from sqlalchemy import func from sqlalchemy import insert, select from sqlalchemy.orm.session import Session from core.logging import logger from db.models.login import Login, MESID def retrieve_mesid(db: Session, id_input: str) -> bool: """Check if the MESID exists in the dat...
Python
1
ts_df.to_csv("country_sample_counts_by_model.csv") # Create a combined dataframe with format: avg (n=count) combined_df = pd.DataFrame(index=avg_scores_df.index, columns=avg_scores_df.columns) for country in combined_df.index: for model in combined_df.columns: # Properly handle...
Python
1
vec![ "IDPJz0t8hTbhLaFtvxmK7sRIX55hw63Amn6RE/hzFpTJJbVUGOHUHufvhYuOgOi8jSHwX1ak2yRqRSmbPPBRFFY=".to_string(), // msig1 "HHHHHZMiOJX7SYBmBtDpdiG/7yhXJuG3CmLHF7LnboxlYtwcOqIo1kY0G+7uRjydta5I/hT16qS48NKmt1rqH8g=".to_string(), // msig2 "IEjenDsG5kP36AmR7kKh...
Rust
0
from brownie import * from .settings import * from .contracts import * from .contract_addresses import * import time def deploy_gnosis_safe(): gnosis_safe_address = CONTRACTS[network.show_active()]["gnosis_safe"] if gnosis_safe_address == "": gnosis_safe_master_copy = GnosisSafe.deploy({"from": accoun...
Python
1
from mcp.server.fastmcp import FastMCP, Context from mcp.server.elicitation import AcceptedElicitation, DeclinedElicitation, CancelledElicitation from pydantic import BaseModel, Field from recipe_data import RECIPES import random mcp = FastMCP("Recipe Finder") class DietaryChoice(BaseModel): """Schema for dietary...
Python
1
lgorithm use std::collections::HashSet; use std::convert::From; use hex; use itertools::Itertools; use protobuf::{Message, RepeatedField}; use sawtooth_sdk::consensus::engine::{Block, BlockId, PeerId}; use sawtooth_sdk::consensus::service::Service; use sawtooth_sdk::messages::consensus::ConsensusPeerMessageHeader; us...
Rust
0
#importing necessary modules import requests from bs4 import BeautifulSoup import csv #defining the working url url = "https://www.scrapethissite.com/pages/forms/?page_num={}" #filename to save our data filename = "teams.csv" with open(filename, "w", newline="", encoding='utf-8') as file: writer = csv.writer(fi...
Python
1
from_shader_files(vertex_shader_path: &str, fragment_shader_path: &str, textures: Vec<Texture>, attributes: Vec<(&str, AttributeType)>) -> Self { let vertex_source = Material::get_shader_file(vertex_shader_path); let fragment_source = Material::get_shader_file(fragment_shader_path); ...
Rust
0
> 300, setup.addresses[1] => 4, setup.addresses[2] => 10, setup.addresses[3] => 0, setup.addresses[4] => 0, ``` If `mint_tokens` is None, a mint will not occur. ### fees A `serde_json::Value` which specifies the fees to be set on the ledger. You will typically use the `json!` macro. ```no_run let fees = json!({ ...
Rust
0
0]['Sns']['Message'] print(event) user = event.split("_")[0] response_url = event.split("_")[1] cid = event.split("_")[2] aid = event.split("_")[3] channel = event.split("_")[4] command = event.split("_")[5] aid = aid.lower() cid = cid.lower() print(response_url) print("CID: ...
Python
1
erde(rename = "certificate-authority")] pub certificate_authority: Option<String>, #[serde(rename = "certificate-authority-data")] pub certificate_authority_data: Option<String>, } /// NamedAuthInfo associates name with authentication. #[derive(Clone, Debug, Serialize, Deserialize)] pub struct NamedAuthInf...
Rust
0
None else x / sequence_stride start = 0 if center is False else fft_length // 2 if length is not None: end = start + length elif center is True: end = -(fft_length // 2) else: end = expected_output_len return x[..., start:end] def rsqrt(x): return 1.0 / np.sqrt(x) de...
Python
1
cing_subscriber::fmt() /// .with_timer(timer); /// # drop(collector); /// ``` /// /// Using the [`format_description!`] macro requires enabling the `time` /// crate's "macros" feature flag. /// /// Using [`time::format_description::parse`]: /// /// ``` /// use tracing_sub...
Rust
0
print('Completed : {0}/{1}'.format(c + 1, len(uniq_diag))) generate_icd9_lookup() # generate the lookup for each diagnosis if d in uniq_diag[:8]: # Plot the results colors = {uniq_diag[0]: 'red', uniq_diag[1]: 'yellow', uniq_diag[2]: 'orange', uniq_diag[3]: 'pink', uniq_dia...
Python
1
if t.is_zero() { Ok(()) } else { Err(Self::from(io::Error::last_os_error())) } } pub fn from_result<T: IsMinusOne>(t: T) -> Result<T> { if t.is_minus_one() { Err(Self::from(io::Error::last_os_error())) } else { Ok(t) } ...
Rust
0
}; // todo: process }, ) not matched if cur_char == '{' { // id{ id } return parse_create_record_var(i); } else if cur_char == '[' { // return parse_create_array(i) let (array_right, _) = terminated(tuple((take_till(|x| x == ']'), tag("]"))), multispace0)(i)?; // ...
Rust
0
import tkinter as tk from tkinter import messagebox inventario = [] def forjar_heroi(): nome = campo_nome.get() if nome: nome_personagem.set(nome) status_label.config(text=f"⚔ {nome} está pronto para a jornada!") btn_adicionar.config(state="normal") btn_usar.config(state="norma...
Python
1
import argparse import os from pathlib import Path import smplx, pickle import torch import sys from tqdm import tqdm import glob import numpy as np sys.path.append(os.getcwd()) from dataset.quaternion import ax_to_6v, ax_from_6v from dataset.preprocess import Normalizer, vectorize_many def motion_feats_extract(inp...
Python
1
. fn cmd_docker_build() -> Result<(), AnyError> { build_all_docker_images()?; Ok(()) } fn kind_install() -> Result<(), AnyError> { let (image_name_operator, _image_name_cli) = build_all_docker_images()?; eprintln!("Loading docker image into kind..."); Command::new("kind") .arg("load") ...
Rust
0
#vamos a hacer un lazy iterator que nos de cada uno de sus objetos cuando lo vamos necesitando #usaremos la funcion 'next' def pares(): for numero_par in range(0,10,2): yield numero_par print('ejecución reanudada') generador = pares() print(next(generador)) #de esta manera obtenemos los eleme...
Python
1
pl_config!(); } pub struct BytesConfig { pub bytes: Vec<u8>, pub min_length: usize, pub encodings: Vec<Encoding>, } impl BytesConfig { pub fn new(bytes: Vec<u8>) -> Self { BytesConfig { bytes, min_length: DEFAULT_MIN_LENGTH, encodings: vec![], } ...
Rust
0
s" % ( len(df), ", ".join(df.columns))) for col in [args.sequence_column,]: if col not in df.columns: raise ValueError( "No such column '%s' in CSV. Columns are: %s" % ( col, ", ".join(["'%s'" % c for c i...
Python
1
_bcn = prefix+'_rt01_blendColors' tan_bcn = mc.createNode('blendColors',n=tan_bcn) mc.connectAttr(poc1+'.tangent',tan_bcn+'.color1',f=True) mc.connectAttr(poc2+'.tangent',tan_bcn+'.color2',f=True) mc.connectAttr(toggleAttr,tan_bcn+'.blender',f=True) # Aim Constraint aimCon = prefix+'_aimConstraint' aimCon = mc...
Python
1
## [`time`](https://crates.io/crates/time) //! //! Requires the `time` Cargo feature flag. //! //! //! ### [`uuid`](https://crates.io/crates/uuid) //! //! Requires the `uuid` Cargo feature flag. //! //! | Rust type | Postgres type(s) | //! |---------------...
Rust
0
st as excp: if excp.message in ("User_id_invalid", "Chat not found") and not str(user_id).isdigit(): message.reply_text("Saya sepertinya tidak pernah berinteraksi dengan pengguna ini sebelumnya - silakan meneruskan pesan dari " "mereka untuk memberi saya kontrol! (Sepe...
Python
1
# Copyright 2024 The KServe Authors. # # 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 wr...
Python
1
use {}.color_with(c)))); } // floor scene.add( MyShape::from(Parallelepiped::new( Matrix3::from_diagonal(&Vector3::new(size.0 + 2.0 * thc, size.1 + 2.0 * thc, thc)), Vector3::new(0.0, 0.0, -thc), )) .cover(MyMaterial::from(Glossy::new( (0.1, Refle...
Rust
0
*sc = -10000000000000000000.0; } match iterator { None => (), Some(ref mut iterator_fun) => iterator_fun( IterationReport { best_score: best_score.0, worst_score, average_score, }, ...
Rust
0
# Copyright 2020 The gRPC Authors # # 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 writ...
Python
1
> { panic!("stub") } pub(super) fn new_client(name: &str, write: bool) -> io::Result<NamedPipeClient> { panic!("stub") } } fn genname() -> String { let procid = process::id(); let random = rand::random::<usize>(); format!(r"\\.\pipe\__tokio_anonymous_pipe0__.{}.{}", procid, ra...
Rust
0
= r" Clears the field bit"] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r" Writes raw bits to the field"] #[inline] pub fn bit(self, value: bool) -> &'a mut W { const MASK: bool = true; const OFFSET: u8 = 13; self.w.bits &= !((MASK as u32) << OFFS...
Rust
0
256]; crate::common::ucs2_to_ascii(path_in, &mut path[0..255]); let path = unsafe { core::str::from_utf8_unchecked(&path) }; let root = wrapper.fs.root().unwrap(); let dir = if crate::fat::is_absolute_path(path) { &root } else { match &wrapper.node { crate::fat::Node::D...
Rust
0
IndicesDeleteTemplateRequest<'a> { fn into(self) -> Endpoint<'a, DefaultBody> { Endpoint { url: self.url, method: Method::DELETE, body: None, } } } #[derive(Debug, Clone, PartialEq)] enum IndicesExistsUrlParams<'a> { ...
Rust
0
from tvm import tensor_graph, tg, auto_tensorize as at from collections import OrderedDict TEST_CASES = OrderedDict() def register_test(func): name = func.__name__ prefix = "test" assert name[:len(prefix)] == prefix try: number = int(name[len(prefix):]) def _inner(*args, **kwargs): ...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2020 Google LLC. 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 requir...
Python
1
from database_operation import add_password, update_password, delete_password, show_passwords from pass_generator import generate_password from qr_generator import create_qr from encryption import encrypt_password from pymongo import MongoClient from bson import ObjectId client=MongoClient("mongodb+srv://nigga2807:244...
Python
1
from .tsmixer import TSMixer from .tsmixer_ext import TSMixerExt __all__ = ["TSMixer", "TSMixerExt"]
Python
1
# Copyright 2025 Code17 GmbH # # This file is licensed under the Elastic License 2.0 (ELv2). # Refer to the LICENSE.txt file in the root of the repository # for details. # """ Tests the data frames container. """ import numpy as np import getml from getml import data, datasets def make_populations(base, percentiles...
Python
1
# Contributed by Paraj Shah # https://github.com/parajshah #!/bin/python3 import math import os import random import re import sys class SinglyLinkedListNode: def __init__(self, node_data): self.data = node_data self.next = None class SinglyLinkedList: def __init__(self): self.head ...
Python
1
, variants: &[], annotations: &[], }; #[doc = "👍🏼"] pub const THUMBS_UP_MEDIUM_LIGHT_SKIN_TONE: crate::Emoji = crate::Emoji { glyph: "👍🏼", codepoint: "1F44D 1F3FC", status: crate::Status::FullyQualified, introduction_version: 1f32, name: "thumbs up: medium-light skin tone", group: "P...
Rust
0