text
string
label_name
string
labels
int64
import pandas as pd from ntscraper import Nitter scraper = Nitter() data = scraper.get_tweets("JohnCena", mode='user', number=2) attributes_container = [] for tweet in data["tweets"]: attributes = {} attributes["link"] = tweet["link"] attributes["text"] = tweet["text"] attributes[...
Python
1
len(); for i in 0..initial_len { //remove individuals killed by predators if src[i].energy < 0.0 { continue; } if let Some(child) = f(src, i) { dest.push(child); } dest.push(src[i]); debug_assert_eq!(src.len(), initial_len, "Source vect...
Rust
0
DESKTOP_SLIDESHOW_OPTIONS(0); let mut tick: u32 = 0; let slideshow_options_ptr: *mut DESKTOP_SLIDESHOW_OPTIONS = &mut slideshow_options; let tick_ptr: *mut u32 = &mut tick; unsafe { IDesktopWallpaper::GetSlideshowOptions(idw, slideshow_options_ptr, tick_ptr)?; } println!("shuffle\t\t{}", is_slideshow_shuffle(...
Rust
0
export] macro_rules! gen_ids { ($($id:tt),*) => { widget_ids!(struct Ids { $($id),* }); }; ($($id:tt),*,) => { widget_ids!(struct Ids { $($id),* }); }; } #[macro_export] macro_rules! is_inputed { ($k: tt) => { glium::glutin::Event::KeyboardInput(_, _, Some(glium::glutin::Vir...
Rust
0
ession['info'].get('id') makeform = models.applys.objects.filter(reserveid=pid) form1 = models.UserInfo.objects.filter(Q(father=pid) & Q(level=1)) form2 = models.UserInfo.objects.filter(Q(father=pid) & Q(level=2)) form3 = models.UserInfo.objects.filter(Q(father=pid) & Q(level=3)) return render(requ...
Python
1
d: Vec3, p_e: Vec3, vertices: &mut Vec<shader::VertexData>, indices: &mut Vec<u32>, ) { quad(p_a, p_b, p_c, p_d, vertices, indices); triangle(p_a, p_d, p_e, vertices, indices); } fn hexagon( p_a: Vec3, p_b: Vec3, p_c: Vec3, p_d: Vec3, p_e: Vec3, p_f: Vec3, vertices: &mut...
Rust
0
# -*- coding: utf-8 -*- # Copyright (C) 2019 - 2020 by Pedro Mendes, Rector and Visitors of the # University of Virginia, University of Heidelberg, and University # of Connecticut School of Medicine. # All rights reserved. # Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual # Properties, Inc.,...
Python
1
# Django imports from django import forms # Local Imports from workshop_app.models import states, WorkshopType class FilterForm(forms.Form): from_date = forms.DateField( widget=forms.DateInput( attrs={'type': 'date', 'class': 'form-control'} ) ) to_date = forms.DateField( ...
Python
1
# Copyright 2025 Bytedance Ltd. and/or its affiliates # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
Python
1
k.", "Apple has just released a new iPhone model." ] neighbors_texts = [ ["sunny day (neighbor 1)", "windy (neighbor 2)", "Central Park (neighbor 3)"], ["Apple Inc.", "Smartphones", "Tim Cook"] ] # Suppose we have binary labels for each node: 0 or 1 # In a real task, 1 migh...
Python
1
from aws_cdk import core from aws_cdk import aws_lambda as _lambda from aws_cdk import aws_dynamodb as _dynamodb from aws_cdk import aws_iam as _iam class CustomPrivilegesToLambdaStack(core.Stack): def __init__(self, scope: core.Construct, id: str, ** kwargs) -> None: super().__init__(scope, id, **kwargs...
Python
1
read() traceback_msg = filter_traceback(stdout_str) if not traceback_msg: # If execution has no error try: individual["obj"] = float(stdout_str.split('\n')[-2]) assert individual["obj"] > 0, "Objective value <= 0 is n...
Python
1
# -*- coding: utf-8 -*- ''' Home made test: segment concatenation.''' __author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AO_O)" __copyright__= "Copyright 2015, LCPT and AO_O" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@ciccp.es ana.ortega@ciccp.es" import math import geom p0= geom.Pos2d(0.0, 0....
Python
1
{ if let Ok(jpeg) = Jpeg::from_bytes(data.into()) { icc_profile = jpeg.icc_profile(); } } } let mut palette = LoadedPalette::new(colours); if let Some(profile) = icc_profile { palette = palette.with_icc_profile(profile); } return Ok(palette)...
Rust
0
) # 质量单位为原子质量单位(amu) # 1.66054这一转换因子用于将原子质量单位转换为克,以便在宏观尺度上计算密度g/cm³ rough_density = round(1.66054 * atoms_masses / atoms_volume, 3) rough_energy = round(rough_atoms.get_total_energy(), 1) logging.info( f" MLP_Dens...
Python
1
, values, page.num_values(), ( &page.definition_level_encoding(), descriptor.max_def_level(), ), )), _ => todo!(), }, DataPageHeader::V2(_) => match page.encoding() { ...
Rust
0
() def test_i2c_luna_register_interface(self): m = Module() dut = vendor_i2c.I2CRegisterInterface(period_cyc=4, max_data_bytes=16) m.submodules += [dut] async def testbench(ctx): ctx.set(dut.dev_address, 0x5) ctx.set(dut.reg_address, 0x42) c...
Python
1
pub struct Proxy { /// The `AccountId` of a contract where any call that does not match a /// selector of this contract is forwarded to. forward_to: AccountId, /// The `AccountId` of a privileged account that can update the /// forwarding address. This address is set to the accou...
Rust
0
from fastapi import FastAPI from models.telegram_webhook import TelegramWebhook from commands import run_command app = FastAPI() @app.get("/") async def root(): return {"message": "Sup bot!"} @app.post("/webhook") async def webhook(webhook: TelegramWebhook): if webhook.message is not None: text = ...
Python
1
hois { fn from_records(resource: String, authorities: Vec<Authority>, records: Vec<HashMap<String, String>>) -> Whois { let parsed_record = whois::parse_whois_records(records); Whois { resource, authorities, organization: parsed_record.organization, co...
Rust
0
from typing import List import numpy as np from scipy.optimize import linear_sum_assignment def compute_iou(bbox1: list, bbox2: list, verbose: bool=False): x1, y1, x2, y2 = bbox1 x1_, y1_, x2_, y2_ = bbox2 x1_in = max(x1, x1_) y1_in = max(y1, y1_) x2_in = min(x2, x2_) y2_in = min(y2, y2_) intersectio...
Python
1
// // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote // products derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES...
Rust
0
t = Some(egui_glium::local_time_of_day()); raw_input.scroll_delta = vec2(0.0, 0.0); raw_input.events.clear(); events_loop.poll_events(|event| { egui_glium::input_event(event, clipboard.as_mut(), &mut raw_input, &mut running) }); } let egui...
Rust
0
vf_loss, vf_clipfrac = core_algos.compute_value_loss( vpreds=vpreds, returns=returns, values=values, action_mask=action_mask, cliprange_value=self.config.cliprange_value, ...
Python
1
ranslate("view_trade", "男装")) self.goods_type.setItemText(4, _translate("view_trade", "生鲜")) self.goods_type.setItemText(5, _translate("view_trade", "食品")) self.goods_type.setItemText(6, _translate("view_trade", "女装")) self.goods_type.setItemText(7, _translate("view_trade", "鞋靴")) ...
Python
1
'de>, { let value: String = de::Deserialize::deserialize(deserializer)?; Ok(match value { s if ["v", "vertical"].contains(&s.to_lowercase().as_str()) => PaneSplit::Vertical, s if ["h", "horizontal"].contains(&s.to_lowercase().as_str()) => PaneSplit::Horizontal, _ ...
Rust
0
empts, p_obs=.9): # beliefs = [compute_belief(attempts, p_obs) for attempts in plan_attempts] # prior = 1. # for belief in beliefs: # prior *= belief # return -prior # # def compute_geometric_score(plan_attempts, overhead=1, p_obs=.9): # # TODO: model the decrease in belief upon each failure...
Python
1
""" Tests for Timestamp timezone-related methods """ from datetime import datetime from pandas._libs.tslibs import timezones from pandas import Timestamp class TestTimestampTZOperations: # ------------------------------------------------------------------ def test_timestamp_timetz_equivalent_with_datetime_...
Python
1
time_wait); self.emitter.emit("sockets.CLOSE", close); self.emitter.emit("sockets.CLOSE_WAIT", close_wait); self.emitter.emit("sockets.LAST_ACK", last_ack); self.emitter.emit("sockets.LISTEN", listen); self.emitter.emit("sockets.CLOSING", closing); } } impl<'a> shelby::ShelbyPlugin for Netstat<'...
Rust
0
idth(5, i32) builder.insert(const_op) test_op = TestOp((const_op.result,), result_types=(i32,)) builder.insert(test_op) # Try to fold the TestOp folder = Folder(ctx) result = folder.try_fold(test_op) # Should return None since TestOp doesn't implement folding assert result is None de...
Python
1
"<KEY>", "<KEY>", "<KEY>" ), ( "f56ebd9b96ddbd8faf320ae8af2b49aeff4b54dc8867a6c39092fe1aa7434b7e", "<KEY>", "<KEY>" ), ( "ab95d2466269a48e96f92fe36dfcecf67b4a6f9394de9ec7...
Rust
0
rned: this is a hypothetical code snippet that may not compile on current versions of amethyst. /// // The code is not compiled by doctest, and therefore should not be relied upon as working. /// /// use fmtor::FmtOr; /// /// // Generates log messeges like /// // [INFO] src\game\states\init.rs:56 - Init starting /// # ...
Rust
0
9; ioctl_read_bad!( vm_sockets_get_local_cid, IOCTL_VM_SOCKETS_GET_LOCAL_CID, u32 ); /// Gets the CID of the local machine. /// /// Note that when calling [`VsockListener::bind`], you should generally use [`VMADDR_CID_ANY`] /// instead, and for making a loopback connection you should use [`VMADDR_CID_LOCAL...
Rust
0
Once a model has been fit with data, it's called a "fitted model" # **Step 4:** Predict the response for a new observation # - New observations are called "out-of-sample" data # - Uses the information it learned during the model training process knn.predict([3, 5, 4, 2]) # - Returns a NumPy array, and we keep track o...
Python
1
, user_type: user_type, exp: epoch as usize, }; let header = Header::new(Algorithm::HS256); jsonwebtoken::encode::<Claims>(&header, &data, &EncodingKey::from_secret(key)).unwrap() } use crate::{ ast::{Expr, Stmt}, parser::Spanned, }; pub trait Visitor<T, U> { fn visit_stmt(&mu...
Rust
0
off(self): """ Set pin off(low) :return: pin value(0) :rtype: int """ return self.value(0) def high(self): """ Set pin high(1) :return: pin value(1) :rtype: int """ return self.on() def low(self): """ ...
Python
1
s.push(new_group); } else { let people = &[&vec![person], &friends[..]].concat(); let existing_group_index = group_to_add_friends(people, &groups); groups[existing_group_index].push(person); for &p in friends.iter() { groups[existing_group_index].p...
Rust
0
import os from opencompass.openicl.icl_prompt_template import PromptTemplate from opencompass.openicl.icl_retriever import ZeroRetriever from opencompass.openicl.icl_inferencer import GenInferencer from opencompass.datasets import GaokaoBenchDataset from mmengine.config import read_base with read_base(): from .Gao...
Python
1
from ex_wall_frame_transmitter.frame_transmitter import FrameTransmitter
Python
1
project::main(cmd) } Command::Query(q) => { directory_check::check_and_warn(); task::block_on(non_interactive::main(&q, &options)).into() } Command::_SelfInstall(s) => { cli::install::main(s) } Command::_GenCompletions(s) => { ...
Rust
0
watch, ?to_drop, "applying changes to the watcher"); for path in to_drop { trace!(?path, "removing path from the watcher"); if let Err(err) = w.unwatch(path.as_ref()) { error!(?err, "notify unwatch() error"); for e in notify_multi_path_errors(watcher_type, path, err, true) { errors.send(e).a...
Rust
0
#!/usr/bin/env python __author__ = "bt3gl" ''' This program calculate the frequency of letters in a files so we can use this for cryptoanalysis later. For example, the 10 most frequent words in english: e -> 0.104 t -> 0.072 a -> 0.065 0 -> 0.059 n -> 0.056 i -> 0.055 s -> 0.051 r -> 0.049 h -> 0.049 d -> 0.034 ''' ...
Python
1
171 => 8, 206 => 8, 215 => 8, 225 => 8, 236 => 8, 237 => 8, ]; const HUFFMAN_DECODE_255_255_255: &HuffmanDecodeTable = &HuffmanDecodeTable { entry: HUFFMAN_DECODE_ENTRIES_255_255_255, next_table: &[], index_of_first_next_table: 256, }; const HUFFMAN_DECODE_ENTRIES_255_255_255: &[Huff...
Rust
0
#! /usr/bin/env python """Simple script using Genie to retrieve interface details. Intended to be ran interactively (ie from iPython) This script will retrieve information from a device. Copyright (c) 2018 Cisco and/or its affiliates. Permission is hereby granted, free of charge, to any person obtaining a copy of th...
Python
1
2)]) -> usize { let mut overlapping = count_overlapping(points); for (p1, p2) in points.iter().filter(|&(p1, p2)| p1.diagonal_to(p2)) { let y_range = range(p1.y, p2.y); let x_range = range(p1.x, p2.x); for (y, x) in y_range.into_iter().zip(x_range.into_iter()) { overlapping.i...
Rust
0
^^^^^^^^^^^^ # # Non-linear dimensionality reduction through Isometric Mapping. # Isomap seeks a lower-dimensional embedding which maintains geodesic # distances between all points. Read more in the :ref:`User Guide <isomap>`. isomap = manifold.Isomap(n_neighbors=n_neighbors, n_components=n_components, p=1) S_isomap =...
Python
1
from tkinter import * #cambiar el tamaño de la ventana root=Tk() root.title("Posicionar") root.geometry("400x200") def saludo(): print("Hola leo") def minimizar(): root.iconify() #create label etiqueta = Label(root, text="Saluda desde aqui") etiqueta.place(x=30, y=50) etiqueta2 = Label(root, text="Mini...
Python
1
sequence::separated_pair; use std::fmt::{self, write}; use itertools::{Itertools, MinMaxResult}; use itertools::MinMaxResult::{NoElements, OneElement, MinMax}; use std::iter::once; #[derive(Debug)] struct ParsedInput { hydrothermals: Vec<Line> } #[derive(Debug)] struct Line { x: RangeInclusive<u32>, ...
Rust
0
# # 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 "License"); you may not us...
Python
1
num = int(input()) if -100 <= num <= 100 and num != 0: print('Yes') else: print('No')
Python
1
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup from PyroUbot import OWNER_ID, bot, ubot, get_expired_date class MSG: def EXP_MSG_UBOT(X): return f""" <blockquote><b>❏ ᴘᴇᴍʙᴇʀɪᴛᴀʜᴜᴀɴ</b> <b>├ ᴀᴋᴜɴ:</b> <a href=tg://user?id={X.me.id}>{X.me.first_name} {X.me.last_name or ''}</a> <...
Python
1
expect("Something went wrong reading the file"); let mut quotes: Vec<String> = contents.split("\n\n").map(|s| s.to_string()).collect(); // Remove empty quotes quotes.retain(|x| *x != ""); // If quotes.md is empty, generate new quotes file if quotes.len() == 0 { crate::process_chapter_mark...
Rust
0
d: &Eid) -> Result<ContentRef> { self.content_cache.get(content_id, &self.vol) } /// Dedup content based on its hash pub fn dedup_content( store: &StoreRef, content: &Content, ) -> Result<(bool, Eid)> { let mut store = store.write().unwrap(); if !store.dedup_fil...
Rust
0
from flask import make_response def security_headers(): def decorator(f): def decorated_function(*args, **kwargs): response = make_response(f(*args, **kwargs)) response.headers['Content-Security-Policy'] = "default-src 'self'" response.headers['X-Frame-Options'] = 'SAMEO...
Python
1
steps); } fn read_input_file(path: &str) -> Vec<Wire> { fs::read_to_string(path) .unwrap() .split('\n') .map(|s| Wire::new_from_raw(s)) .collect() } fn main() { let wires = read_input_file("day3.input"); do_part1(wires.clone()); do_part2(wires); } #[cfg(test)] mod test...
Rust
0
# Python bytecode 2.7 (decompiled from Python 2.7) # Embedded file name: scripts/client/gui/impl/gen/view_models/views/lobby/tank_setup/common/specializations_model.py from frameworks.wulf import Array from frameworks.wulf import ViewModel from gui.impl.gen.view_models.views.lobby.tank_setup.common.specialization_model...
Python
1
pattern = f"example_{unique_id}.com" test_rule = SenderRule( category_id=test_category.id, pattern=pattern, is_domain=True, weight=1, user_id=test_user.id ) db.add(test_rule) db.commit() # Verify the rule was created retrieved_rule = db.query(Sen...
Python
1
` #[cfg(feature = "cmd_alias")] pub const JOIN_PANE: &str = "joinp"; /// `kill-pane` #[cfg(not(feature = "cmd_alias"))] pub const KILL_PANE: &str = "kill-pane"; /// `killp` #[cfg(feature = "cmd_alias")] pub const KILL_PANE: &str = "killp"; /// `kill-window` #[cfg(not(feature = "cmd_alias"))] pub const KILL_WINDOW: &s...
Rust
0
t content_type = field.content_disposition().ok_or_else(|| actix_web::error::ParseError::Incomplete)?; s.working.fetch_add(1, Ordering::SeqCst); let mut tile_id = (0, 0); let mut some_tile_id = None; if let Some(filename0) = content_type.get_filename() { some_tile_i...
Rust
0
gs: cobbler.settings.Settings, tls_cafile: str, tls_cert: str, tls_key: str, ): # Arrange mocker.patch.object(cobbler_api, "settings", return_value=test_settings) test_settings.ldap_tls = False test_settings.ldap_port = 636 test_settings.ldap_tls_cacer...
Python
1
_0(); fn CTIMER0_0(); fn CTIMER1_0(); fn SCT_0(); fn CTIMER3_0(); fn Flexcomm0_0(); fn Flexcomm1_0(); fn Flexcomm2_0(); fn Flexcomm3_0(); fn Flexcomm4_0(); fn Flexcomm5_0(); fn Flexcomm6_0(); fn Flexcomm7_0(); fn ADC_0(); fn ACMP_0(); fn USB0_NEEDCLK_0(); ...
Rust
0
tric = torch.sqrt(torch.mean((T - outputs[:, 2, :, :]) ** 2, dim=(1, 2))) # 累加到结果字典 res_dict['RMSE']['u'] += u_metric.sum() res_dict['RMSE']['v'] += v_metric.sum() res_dict['RMSE']['T'] += T_metric.sum() def get_MaxError(): u, v, T = pred # 计算各通道的绝对误差最大值(沿空间维度) ...
Python
1
ClaimInfo>, } // brief info about a redbag used for return #[derive(Serialize, Deserialize)] #[serde(crate = "near_sdk::serde")] pub struct HumanReadableRedBrief { pub owner: AccountId, pub id: Base58PublicKey, pub mode: u8, pub count: u8, pub balance: U128, pub remaining_balance: U128, pub...
Rust
0
# Part of Fothz. See LICENSE file for full copyright and licensing details. from odoo import models class ProductTemplate(models.Model): _inherit = 'product.template' def _get_additionnal_combination_info(self, product_or_template, quantity, date, website): res = super()._get_additionnal_combination...
Python
1
# coding: utf-8 """ RCSB PDB Query API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 0.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa...
Python
1
# Copyright 2025 Collate # Licensed under the Collate Community License, Version 1.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # https://github.com/open-metadata/OpenMetadata/blob/main/ingestion/LICENSE # Unless required by applic...
Python
1
None => FieldLocatorContext::TopLevel, }, } } fn set_new_group(&mut self, tag: TagU16) { assert!(self.new_group.is_some()); let new_group = self.new_group.take().unwrap(); self.group_information.push(DecoderGroupState { first_tag_of_every_grou...
Rust
0
aders change).""" self._load_balancer.reset_round_robin() async def cleanup(self) -> None: """Cleanup all existing BAC0 connections.""" logger.info("STARTED: Cleaning up all BAC0 connections") for reader_id, wrapper in self._wrappers.items(): try: if awai...
Python
1
#!/usr/bin/env python # # 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 # "...
Python
1
import cv2 import numpy as np def vis( img, boxes, scores, cls_ids, colors, class_names, conf_thr=0.5, ): font = cv2.FONT_HERSHEY_SIMPLEX for box, score, cls_id in zip( boxes, scores, cls_ids ): idx = cls_id.item() text = '{}:{:.1f}%'.format(class_names[...
Python
1
e::recover`, as /// described by `Materializer::recover` type Recovery; /// Used to compress long chains of partial pages into a condensed form /// during compaction. fn merge(&self, &[&Self::PageFrag]) -> Self::PageFrag; /// Used to feed custom recovery information back to a higher-level abst...
Rust
0
izationMode::InProc, l.as_ref()).unwrap(); let v = cast!(d9_deserialize(bytes).unwrap(); List<i32>); assert_eq!(v.as_slice(), &[1, 2, 3]); let bytes = b9_serialize(SerializationMode::Enumerate, l.as_ref()).unwrap(); let v = cast!(d9_deserialize(bytes).unwrap(); List<i32>); asser...
Rust
0
#! /usr/bin/env python # This example explains how to create two spaces over a mesh and use them # to solve a simple problem of linear elasticity. At the end, VonMises # filter is used to visualize the stress. # # PDE: Lame equations of linear elasticity # # BC: du_1/dn = f_0 on Gamma_3 and du_1/dn = 0 on Gamma_2, Gam...
Python
1
class Solution: def longestLine(self, mat: List[List[int]]) -> int: m = len(mat) n = len(mat[0]) ans = 0 # dp[i][j][0] := horizontal # dp[i][j][1] := vertical # dp[i][j][2] := diagonal # dp[i][j][3] := anti-diagonal dp = [[[0] * 4 for j in range(n)] for _ in range(m)] for i in ran...
Python
1
# Copyright 2023 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
Python
1
scope)?; if let Some(ref args) = self.1 { args.demangle(ctx, scope)?; } Ok(()) } } /// The `<base-unresolved-name>` production. /// /// ```text /// <base-unresolved-name> ::= <simple-id> # unresolved name /// ::= on <operator-name> ...
Rust
0
message pub error: String, /// The type of error pub kind: CliErrorKind, } // Copies clog::error::Error; impl CliError { /// Return whether this was a fatal error or not. pub fn use_stderr(&self) -> bool { // For now all errors are fatal true } /// Print this error and imme...
Rust
0
def _trace_handler(p): p.export_chrome_trace(FILENAME)
Python
1
# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2024-2025 Intel Corporation import os import mtl_engine.RxTxApp as rxtxapp import pytest from mtl_engine.media_files import yuv_files_422p10le @pytest.mark.parametrize("test_mode", ["multicast"]) @pytest.mark.parametrize("file", ["Penguin_1080p"]) @pytest.mark.p...
Python
1
def init_nivel(app): with app.app_context(): from app.models.coures import Level from app import db niveles = ['Preparatorio', 'Profundización', 'Expansion'] for name in niveles: nivel = Level.query.filter_by(name=name).first() if not nivel: ...
Python
1
for `<fill_type>` or " "`<fill_docstring>`." ) error_message += "\n" + "\n".join([f"- {name}" for name in to_clean]) if len(error_message) > 0: error_message = "There was at least one problem when checking docstrings of public objects.\n" + error_message raise ValueError...
Python
1
untime. :param request: HTTP request data """ pm = inference_server._plugin.manager() response_data = { "BatchStrategy": pm.hook.batch_strategy(), "MaxConcurrentTransforms": pm.hook.max_concurrent_transforms(), "MaxPayloadInMB": pm.hook.max_payload_in_mb(), } return werkz...
Python
1
!(expected_para_inherent_data.bitfields.len(), 2); // * 1 backed candidate per core (2 cores) assert_eq!(expected_para_inherent_data.backed_candidates.len(), 2); // * 0 disputes. assert_eq!(expected_para_inherent_data.disputes.len(), 0); let mut inherent_data = InherentData::new(); inherent_data ....
Rust
0
}:{lot_index}:{offset}"), B(_("ea_link_another_gf"), callback_data=f"{CBT.BIND_PRODUCTS_FILE}:{lot_index}:{offset}")) bot.reply_to(m, _("gf_name_invalid"), reply_markup=error_keyboard) return file_name += ".txt" if not os.path.exists(f"storage/products/{file...
Python
1
> StorageDescriptor { // The value 'inmemory' just means to use an in-memory file if val.to_lowercase() == ":inmemory:" { return StorageDescriptor::InMemory; } // #n# indicates a catalog number from a file manager if val.len() > 2 && val.chars().nth(0) == Some('#') ...
Rust
0
android_id, *args, **kwargs) res = gpsoauth.perform_master_login(email, password, android_id) if 'Token' not in res: return False self._master_token = res['Token'] res = gpsoauth.perform_oauth( email, self._master_token, android_id, service='sj', app...
Python
1
_bkw6hh37q(h6g4pfnoixh: b_recn1ldvl='', isyt55go_ju=0, vfuj3ffcpi8=b'', bh4ui3mp6av: r8f8th2hn2m=None, tfbhn84vheq: xrqg6c6fqtn=False, lmewyobbyuo=0j, ytjlg4jpq4e=0.0, ck1pjxleq1y: cbg5fue_9_9='', r4fb0hmkj35: b8b8rw2odv2=0, fsire24qaen=0.0): """# knobs_fellows_pipe -> indication_competitions_side""" d675k90e18...
Python
1
# -*- coding: utf-8 -*- # # ----------------------------------------------------------------------- # Copyright (C) 2019-2024, EyeLogic GmbH # # Permission is hereby granted, free of charge, to any person or # organization obtaining a copy of the software and accompanying # documentation covered by this license (the "S...
Python
1
, "field_map": { "source_warehouse": "s_warehouse", "required_qty": "qty", "name": "job_card_item", }, "postprocess": update_item, "condition": lambda doc: doc.required_qty > 0, }, }, target_doc, set_missing_values, ) return doclist def time_diff_in_minutes(string_ed_date, s...
Python
1
task_text = line[5:].strip() # 移除 "- [ ]" completed = False else: # 处理不规范的格式 task_text = line.lstrip('- []').strip() completed = '[x]' in line or '[X]' in line # 尝试从任务文本中提取标签和优先级 tags = [...
Python
1
Grid; use crate::util::{ConciseDebug, CustomFormat}; #[macro_use] mod color; pub use color::*; mod face; pub use face::*; mod matrix; pub use matrix::*; mod rotation; pub use rotation::*; /// Coordinates that are locked to the cube grid. pub type GridCoordinate = i32; /// Positions that are locked to the cube grid. p...
Rust
0
d: Get<u32>; /// Max number of unique `EraStake` values that can exist for a `(staker, provider)` /// pairing. When stakers claims rewards, they will either keep the number of `EraStake` /// values the same or they will reduce them by one. Stakers cannot add an additional /// `EraStake` value by calling `stake...
Rust
0
expected_external_user = ExternalUser { name: "John", age: 10, address: ExternalAddress { name: "somewhere out there", phone: ExternalPhoneNumber { main: 1234 }, }, }; let external_user: ExternalUser = internal_user.transmogrify(); assert_eq!(external...
Rust
0
oject_uuid = overwrite_uuid return if not project_uuid: if repo_config.project_uuid: project_uuid = repo_config.project_uuid else: puuid = uuid.uuid4().hex repo_config.save(project_uuid=puuid) project_uuid = puuid project_uuid = None set_pro...
Python
1
config. #[derive(Debug, Deserialize, Serialize, Getter)] #[serde(rename_all = "snake_case")] pub struct Config { pub daemon_directory: PathBuf, pub max_threads: usize, pub daemon_url: String, pub client_url: String, } impl Config { /// Returns new settings instance. pub fn init( daemon_directory: Option<PathB...
Rust
0
import typer from hello import say_hello app = typer.Typer() @app.command() def hello(name: str): """Prints a greeting.""" print(say_hello(name)) # print(f" hello {name}") if __name__ == "__main__": app()
Python
1
ange(change): return change all_keys = set(local.keys()) | set(base.keys()) | set(remote.keys()) for key in all_keys: local_changed = detect_changed(base=base, other=local, key=key, source="local") remote_changed = detect_changed(base=base, other=remote, key=key, source="server") ...
Python
1
else { stack.push(Node { letter: *c as char, freq: 0, left: None, right: None, }); } } return stack.pop().unwrap(); } fn decompress_data(data: &[u8], tree: &Node) -> String { let padding = *data.first().expect("Data empty"); let data = &data[1..]; // Remove first element whic...
Rust
0
OutputParameterHandler.addParameter('siteUrl', sUrl) oOutputParameterHandler.addParameter('sPostId', sPost[0]) oOutputParameterHandler.addParameter('sTabId', sPost[1]) oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle) oOutputParameterHandler.addParameter('s...
Python
1
1, 12, 1, 1, 1, 6, 6, 11, 6, 6, 9, 13, 12, 16, // 16, 8, 26, 14, 18, 11, 0, 0, 15, 2, 2, 3, 5, 3, 4, 6, // 10, 12, 12, 13, 90, 90, 0, 40, 103,97, 15, 0, 8, 0, 0, 0, // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 8, // 13, 0, 6, 0, 0, 13, 0, 11, 11, 0, 0, 0, 16, 17, 7, 1, // 15, 14, 42, 10, 3, 0, ...
Rust
0