text string | label_name string | labels int64 |
|---|---|---|
ed();
v8::V8::initialize_platform(platform);
v8::V8::initialize();
for round in 0..1000 {
eprintln!("round {}", round);
let threads = repeat_with(|| {
thread::spawn(|| {
v8::Isolate::new(Default::default());
})
})
.take(16)
.collect::<Vec<_>>();
for join_handle in th... | Rust | 0 |
-username")
/// # .takes_value(true)
/// # .value_name("PROXY_USER")
/// # .help("Your proxy username, if applicable"),
/// # ).arg(
/// # Arg::with_name("proxy-password")
/// # .long("proxy-password")
/// # .takes_value... | Rust | 0 |
tat["output_path"] = output_file
# Show match stats and prompt enter to continue
print("Stats:")
print(json.dumps(match_stat, indent=4))
input("Press Enter to confirm...")
# Play matches
if args.parallel == 1:
for match in tqdm(matches):
play_a_match_func(match, output_file... | Python | 1 |
f self.extensions:
args.append(create_extensions_string(self.extensions))
if self.local_proxy:
args.append(f"--proxy-server=" + self.local_proxy)
args.append(user_dr)
args = unique_keys(args)
return args
def add_argument(self, arg: str):
self.argu... | Python | 1 |
#!/usr/bin/env python3
"""
Convert PNG image to RGB565 C array for ST7789 display
Usage: python3 png_to_rgb565.py input.png output.h
"""
import sys
from PIL import Image
import os
def rgb888_to_rgb565(r, g, b):
"""Convert 24-bit RGB to 16-bit RGB565"""
return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3)
... | Python | 1 |
if alpha > 0:
lam = np.random.beta(alpha, alpha)
else:
lam = 1
if is_bias:
lam = max(lam, 1 - lam)
index = torch.randperm(x.size(0)).cuda(gpu)
mixed_x = lam * x + (1 - lam) * x[index]
mixed_y = lam * y + (1 - lam) * y[index]
retur... | Python | 1 |
.claim_mut(t, |cmd, _| {
if byte == b'\r' {
// End of command
cmd_type = match &***cmd {
b"hi" | b"Hi" => CmdType::Greeting,
_ => {
if cmd.len() == 0 {
CmdType::None // Empty string
} else {
... | Rust | 0 |
it(10).map(|d| d as u8));
LayerIter {
pixels,
width,
height
}
}
fn merge_layers<T: Iterator<Item = Layer>>(layers: T) -> Layer {
layers
.fold(Layer::new(), |mut merged_layer, layer| {
for (&position, &pixel) in layer.iter() {
if !merged_layer.contains_key(&position) && pixel != 2 {
... | Rust | 0 |
import pydantic.v1 as pydantic_v1
from pcapi.connectors.clickhouse.queries import CollectiveRevenue
from pcapi.connectors.clickhouse.queries import IndividualRevenue
from pcapi.connectors.clickhouse.queries import TotalRevenue
from pcapi.routes.serialization import BaseModel
from pcapi.routes.serialization import Conf... | Python | 1 |
-team-discussion-comment-legacy>
*
* **Parameters:**
*
* * `team_id: i64`
* * `discussion_number: i64`
* * `comment_number: i64`
*/
pub async fn create_for_team_discussion_comment_legacy(
&self,
team_id: i64,
discussion_number: i64,
comment_number: ... | Rust | 0 |
let alpha = 2. / (length + 1) as ValueType;
let mut prev_value1 = src[0];
let mut prev_value2 = src[0];
let mut prev_value3 = src[0];
src.iter().for_each(|&x| {
let value = ma.next(x);
let e_ma = alpha * x + (1. - alpha) * prev_value1;
let d_ma = alpha * e_ma + (1. - alpha) * prev_value2;
... | Rust | 0 |
"""
Subscription app for managing user subscriptions and payments.
"""
| Python | 1 |
{i}.jpg")
# 压缩图像以提高性能
# 调整大小到合理的分辨率
max_dim = 1280 # 最大宽度或高度
h, w = frame.shape[:2]
if h > max_dim or w > max_dim:
scale = max_dim / max(h, w)
new_h = int(h * scale)
... | Python | 1 |
# I 숫자 = 큐에 주어진 숫자 삽입
# D 1 = 큐에서 최댓값 삭제
# D -1 = 큐에서 최솟값 삭제
def solution(operations):
queue = []
for operate in operations:
action, number = map(str, operate.split())
if action == "I":
queue.append(int(number))
else:
if not queue:
continu... | Python | 1 |
on about the Person.
Returns:
str: Variable string with information stored in the Person.
'''
person1: Person = Person("Luca", "Committeri",
birth_date= "21/04/2000", birth_place= "Roma", gender= "M")
person2: Person = Person("Marco", "Ciccia")
person3: Person = Pe... | Python | 1 |
l::BGR8U { const VK_FORMAT: VkFormat = VK_FORMAT_B8G8R8_USCALED; }
impl InternalFormat for pixel::BGR8I { const VK_FORMAT: VkFormat = VK_FORMAT_B8G8R8_SSCALED; }
impl InternalFormat for pixel::RGBA8UN { const VK_FORMAT: VkFormat = VK_FORMAT_R8G8B8A8_SRGB; }
impl InternalFormat for pixel::RGBA8IN { const VK_FORMAT: VkFo... | Rust | 0 |
-> SumIfFn {
SumIfFn {
predicate,
expr,
aggregate_type,
}
}
}
#[derive(Clone, Debug)]
pub struct PercentileFn {
pub expr: Box<Expression>,
pub p: Box<Expression>,
pub r#type: PercentileType,
pub order: Option<SortingDirection>,
}
#[derive(Clone,... | Rust | 0 |
{f.span()=>
::heapsize::HeapSize::heap_size_of_children(&self.#index)
}
});
quote! {
0 #(+ #recurse)*
}
}
Fields::Unit => {
// Unit... | Rust | 0 |
print(effect.get_report())
print('\n---------- DEFENDER SKILLS')
for effect in self.defender.effects :
if not effect.trigger_count: continue
print(effect.get_report())
def battle_report(self):
report = {
'time': datetime.now().s... | Python | 1 |
proxy.toml".to_string();
}
<filename>src/core/src/lib.rs
// Copyright 2014 The Gfx-rs Developers.
//
// 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/... | Rust | 0 |
peripheral clock enable register (RCC_AHB2ENR)
pub dcmien: En, // Camera interface enable
ahb2enr_bit1: [bit::N1; 3], // Reserved, must be kept at reset value.
pub crypen: En, // Cryptographic modules clock enable
pub hashen: En, // Hash modules clock enable
... | Rust | 0 |
)
.file("bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
.file(
"bar/src/lib.rs",
"
#[allow(dead_code)]
fn bar_priv() {}
pub fn bar_pub() {}
",
)
.build();
p.cargo("doc")
.with_stderr_unordered(
... | Rust | 0 |
"""Tool for the Merriam-Webster API."""
from typing import Optional
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.tools import BaseTool
from langchain_community.utilities.merriam_webster import MerriamWebsterAPIWrapper
class MerriamWebsterQueryRun(BaseTool): # type: ignore[ove... | Python | 1 |
(),
public_key: public_key.to_string(),
private_key: secret_key.to_string(),
from: from.to_string(),
to: to.to_string(),
amount: amount.to_string(),
fee: Option::from("0.1".to_string())
// Option::from()
};
let result = transfer_obj.execute();
match r... | Rust | 0 |
eld, which sometimes implies an environment, and
/// sometimes isn't an actual operating system.
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[allow(missing_docs)]
pub enum OperatingSystem {
Unknown,
Bitrig,
Cloudabi,
Darwin,
Dragonfly,
Emscripten,
Freebsd,
Fuchsia,
Haiku,
... | Rust | 0 |
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
# Load merged NHANES data
df = pd.read_csv("data/nhanes_diabetes.csv")
# Keep SEQN for reference (but exclude it from model training)
seqn = df[['SEQN']]
df.drop(columns=['SEQN'], inplace=True) # R... | Python | 1 |
super::state::write_ip_port(
env.memory(),
ret_addr,
addr.ip(),
addr.port()
));
__WASI_ESUCCESS
}
/// ### `sock_addr_peer()`
/// Returns the remote address to which the socket is connected to.
///
/// Note: This is similar to `getpeername` in POSIX
///
/// When successful, the c... | Rust | 0 |
sh(PV { p: prio, v: wake_token });
bk.heap.pop().unwrap().v.wake();
mem::drop(bk);
sleep_token.sleep();
};
// We took the lock
let mut bk = self.bookkeeping.lock().unwrap();
if let Some(x) = bk.heap.pop() {
// Wake the next spinner
... | Rust | 0 |
mut context, "new String('foo') == 'foo'"), "true");
assert_eq!(forward(&mut context, "null == undefined"), "true");
assert_eq!(forward(&mut context, "undefined == null"), "true");
assert_eq!(forward(&mut context, "null == false"), "false");
assert_eq!(forward(&mut context, "[] == ![]"), "true");
as... | Rust | 0 |
cker, start_date=check_date, end_date=check_date)
if day_prices.empty:
continue
o = day_prices["open"].iloc[0]
h = day_prices["high"].iloc[0]
l = day_prices["low"].iloc[0]
c = day_prices["close"].iloc[0]
sl_hit = l <= stop_loss
tp_hit = h >= target_tp
... | Python | 1 |
ed paginator for `GetVpnConnectionDeviceTypesPaginator`
///
/// This is created with [`.items()`](GetVpnConnectionDeviceTypesPaginator::items)
pub struct GetVpnConnectionDeviceTypesPaginatorItems<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::re... | Rust | 0 |
import uuid
import airflow
from airflow import DAG
from airflow.operators.dummy import DummyOperator
from airflow.operators.python import PythonOperator
def _train_model(**context):
model_id = str(uuid.uuid4())
context["task_instance"].xcom_push(key="model_id", value=model_id)
def _deploy_model(**context)... | Python | 1 |
Определяем цвет в зависимости от задержки
if latency < 100:
color = discord.Color.green()
status = "Отличное"
elif latency < 200:
color = discord.Color.gold()
status = "Хорошее"
else:
color = discord.Color.red()
status = "П... | Python | 1 |
b'.';
const SPACE: u8 = b' ';
const COMMA: u8 = b',';
#[derive(Debug)]
pub struct NameTag {
prefix: Vec<u8>,
suffix: Vec<u8>,
tags: BTreeSet<Vec<u8>>,
}
// Interface into tag naming scheme. eg filename[tag1 tag2].ext
impl NameTag {
pub fn new<T: Into<Vec<u8>>>(name: T) -> Self {
let data = nam... | Rust | 0 |
"""Tests for the TechnoVE binary sensor platform."""
from datetime import timedelta
from unittest.mock import MagicMock
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy import SnapshotAssertion
from technove import TechnoVEError
from homeassistant.const import STATE_ON, STATE_UNAVAILABLE, Pla... | Python | 1 |
{
let mut buf = vec![0u8; 1024];
let conn = self.transport_instance.quic_stream_instance.as_mut().unwrap();
let mut read = false;
for stream_id in conn.readable() {
if conn.stream_recv(stream_id, &mut buf).is_ok() {
read = true;
break;
... | Rust | 0 |
from fastapi import Depends, HTTPException, status
from fastapi.security import OAuth2PasswordBearer
from sqlalchemy.ext.asyncio import AsyncSession
from app.database import get_db
from app.user.user_model import User
from app.user.user_crud import get_user_by_user_id
from app.user.user_auth import decode_access_toke... | Python | 1 |
istance(boid) < radius)
.map(|boid| *boid)
.collect()
}
pub fn edges(&mut self, area: Vector) {
let mut pos = self.position;
if pos.x < 0.0 {
pos.x = area.x;
}
if pos.x > area.x {
pos.x = 0.0;
}
if pos.y < 0.0 {
... | Rust | 0 |
pub struct CmdOptConf {
flag_debug: bool,
cnt_verbose: usize,
opt_speed: f32,
opt_color: OptColorWhen,
opt_config: Option<String>,
arg_input: String,
arg_output: Option<String>,
}
//}}} CmdOptConf
//----------------------------------------------------------------------
#[inline(never)]
pub... | Rust | 0 |
;
ruby::rb_protect(Some(wrapper::<F, O>), ctx, &mut err);
match err {
0 => match ManuallyDrop::into_inner(out) {
Ok(out) => Ok(out),
Err(panic_info) => panic::resume_unwind(panic_info),
},
_ => Err(AnyException::_take_current()),
... | Rust | 0 |
# =====================================
# * Función incorporada filter()
# =====================================
# La función filter() selecciona elementos de un iterable
# (lista, tupla, conjunto, etc.) que cumplen con una condición.
# Devuelve un objeto de tipo filter, que es un iterable con los elementos que pasaron... | Python | 1 |
DEFAULT_REACTION_TYPES = [
{
"id": 1,
"icon": "https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/1f44d.png",
"name": "like",
},
{
"id": 2,
"icon": "https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/72x72/2764.png",
"name": "love",
},
... | Python | 1 |
h
# BS x SL
generated_sequence = self.model.generate(input_ids=input_ids, attention_mask=attention_mask, **generate_kwargs)
out_b = generated_sequence.shape[0]
if self.framework == "pt":
generated_sequence = generated_sequence.reshape(in_b, out_b // in_b, *generated_sequence... | Python | 1 |
"""Perform test request"""
import pprint
import requests
DETECTION_URL = "http://localhost:5000/v1/object-detection/yolov5s"
TEST_IMAGE = "zidane.jpg"
image_data = open(TEST_IMAGE, "rb").read()
response = requests.post(DETECTION_URL, files={"image": image_data}).json()
pprint.pprint(response)
| Python | 1 |
import argparse
import gym
from agent import REINFORCE
from utils import *
def main(args):
def preprocess(obs):
obs = obs[35:195]
obs = obs[::2, ::2, 0]
obs[obs == 144] = 0
obs[obs == 109] = 0
obs[obs != 0] = 1
return obs.astype(np.float).ravel()
INPUT_DIM =... | Python | 1 |
from __future__ import absolute_import, division, print_function
class parse_options(object):
def __init__(self, argv, keywords, case_sensitive=True):
self.keywords = keywords
self.n = 0
keywords_lower = []
for keyword in keywords:
setattr(self, keyword, False)
if (not case_sensitive):
... | Python | 1 |
model_status.append(f"✅ 2B模型: {os.path.basename(ltx_2b_model)}")
else:
model_status.append("❌ 未找到2B模型")
# 检查LTX 13B模型
if ltx_13b_model:
model_status.append(f"✅ 13B模型: {os.path.basename(ltx_13b_model)}")
else:
model_status.append("❌ 未找到13B模型")
return mode... | Python | 1 |
"""
Project Manager Module
Handles recent projects storage and management.
"""
import os
import json
class ProjectManager:
"""Manages recent projects functionality"""
def __init__(self):
self.recent_projects_file = os.path.expanduser("~/.web_server_launcher_recent.json")
self.recent_projects... | Python | 1 |
},
_ => { },
}
match x.loi {
1013 => { // Set Disposition Information
js.set_string("level_of_interest", "Set Disposition Information");
},
_ => { },
}
let gs = fuid_to_str... | Rust | 0 |
RY".into(),
value: Some(registry.domain_name),
..Default::default()
},
EnvVar {
name: "HELM_REPO".into(),
value: Some(registry.repo_name),
..Default::default()
... | Rust | 0 |
from ._base import DataIngestion | Python | 1 |
if collected.len() >= (thresh as usize) {
let read_data = &ctx.data.read().await;
let map_lock = read_data.get::<ChannelMap>()
.expect("Expected channel map")
.clone();
let map = map_lock.read().await;
let starboard = match map.get... | Rust | 0 |
e<'a> {
pub fn similarly_wrap<'b>(&self, tr: &'b TypeRef) -> TypeRefLike<'b> {
match self {
Self::TypeRef(_) => TypeRefLike::TypeRef(Cow::Borrowed(tr)),
Self::OwnedTypeRef(_) => {
TypeRefLike::OwnedTypeRef(Cow::Owned(OwnedTypeRef(Cow::Borrowed(tr))))
}
... | Rust | 0 |
let url = "/admin/api/2020-01/storefront_access_tokens.json".to_string();
self.client
.post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
.await
}
/**
* Deletes an existing storefront access token.
*
* This function performs a `DELETE` to the... | Rust | 0 |
# Funções decoradoras e decoradores com classes
def adiciona_repr(cls):
def meu_repr(self):
class_name = self.__class__.__name__
class_dict = self.__dict__
class_repr = f'{class_name}({class_dict})'
return class_repr
cls.__repr__ = meu_repr
return cls
def meu_planeta(metod... | Python | 1 |
nt_indices, dtype=np.int64)
tri_indices = np.array(tri_indices, dtype=np.int64)
points = points[point_indices]
triangles = self.triangles[tri_indices]
mask = self.check_triangles(points, triangles)
point_indices = point_indices[mask]
tri_indices = tri_indices[mask]
... | Python | 1 |
help (TODO)
// acts.sort_by(|(_, a1, l1), (_, a2, l2)| match l2.cmp(l1) {
// std::cmp::Ordering::Less => std::cmp::Ordering::Less,
// std::cmp::Ordering::Equal => a1.partial_cmp(a2).unwrap(),
// std::cmp::Ordering::Greater => std::cmp::Ordering::Greater,
// });
... | Rust | 0 |
)
}
}
<gh_stars>10-100
extern crate libsoundio_sys as raw;
use super::util::*;
use std::fmt;
/// ChannelId indicates the location or intent of a channel (left, right, LFE, etc.).
///
/// It supports the `Display` trait so that you can convert `ChannelId::FrontLeft` to `"Front Left"` for example.
///
/// # Exampl... | Rust | 0 |
(&mut self) -> DIV_NUM_LSTIMER3_W {
DIV_NUM_LSTIMER3_W { w: self }
}
#[doc = "Bit 23 - This bit is used to pause the counter in low speed timer3."]
#[inline(always)]
pub fn lstimer3_pause(&mut self) -> LSTIMER3_PAUSE_W {
LSTIMER3_PAUSE_W { w: self }
}
#[doc = "Bit 24 - This bit i... | Rust | 0 |
HE_CTRL1_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<APP_CACHE_CTRL1_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `APP_CACHE_CTRL1` writer"]
pub struct W(crate::W<APP_CACHE_CTRL1_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<APP_CACHE_CTRL1_SPEC>;
#[inline(al... | Rust | 0 |
ps_bytecode)
.set_rasterizer_state(&RasterizerDesc::default())
.set_blend_state(&BlendDesc::default())
.set_depth_stencil_state(
&DepthStencilDesc::default().set_depth_enable(false),
)
.set_primitive_topology_type(PrimitiveTopologyType::Triangle)
.set_rtv_form... | Rust | 0 |
import pytest
from http import HTTPStatus
from app.errors import ProtonAccountNotVerified
from app.proton import proton_client
def test_convert_access_token_valid():
res = proton_client.convert_access_token("pt-abc-123")
assert res.session_id == "abc"
assert res.access_token == "123"
def test_convert_a... | Python | 1 |
ve};
use serde::{Deserialize, Serialize};
use std::convert::TryFrom;
use std::fmt::{Debug, Display};
use std::marker::PhantomData;
const NON_ZERO_DELTA: f64 = 0.05;
const ZERO_DELTA: f64 = 0.00025;
pub trait InitialSolvePoint<T> {
fn initial_solve_point(&self) -> T;
}
impl<T, Distribution, W, D> InitialSolvePoin... | Rust | 0 |
(copy_range: u32, copy_mode: CopyMode) -> Self {
Self {
copy_range,
copy_mode,
}
}
pub fn new_packet(copy_range: u32) -> Self {
Self::new(copy_range, CopyMode::Packet)
}
}
impl Nla for ConfigMode {
fn value_len(&self) -> usize {
CONFIG_MODE_LEN
... | Rust | 0 |
3 + z4) * 9633 as libc::c_int as crate::jpegint_h::JLONG; /* sqrt(2) * ( c5-c3) */
tmp0 = tmp0 * 2446 as libc::c_int as crate::jpegint_h::JLONG;
tmp1 = tmp1 * 16819 as libc::c_int as crate::jpegint_h::JLONG;
tmp2 = tmp2 * 25172 as libc::c_int as crate::jpegint_h::JLONG;
t... | Rust | 0 |
}
// miscellaneous
&Instruction::System(..) => VMState::NotImplemented,
&Instruction::Comment(..) => VMState::Continue,
};
Ok(state)
}
fn set_input_radix(&mut self, radix: BigDecimal) -> VMState {
let (n, scale) = radix.as_bigint_and_expon... | Rust | 0 |
>(&data) {
Ok(asset) => AssetLoadResult::Data(Box::new(asset)),
Err(error) => {
AssetLoadResult::Error(format!("Error loading navmesh asset: {:?}", error))
}
}
}
}
use crate::enum_code::ENUM_CODE_LENGTH;
#[inline]
fn scan_block_naive(classes: &[u8], start... | Rust | 0 |
, //0000001100, slot 185
End(Some(Run {
last: false,
run: 3,
level: 3,
})), //0000001101, slot 186
Fork(188, 189), //000000111x, slot 187
End(Some(Run {
last: false,
run: 2,
level: 3,
})), //0000001110, slot 188
End(Some(Run {
last: false,
... | Rust | 0 |
minutes = (duration.as_secs() / 60) % 60;
let hours = duration.as_secs() / 3600;
if hours < 1 {
format!("{}:{:02}", minutes, seconds)
} else {
format!("{}:{:02}:{:02}", hours, minutes, seconds)
}
}
// I used to send same type of message and i just put it in different function
pub async... | Rust | 0 |
#!/usr/bin/env python
# coding: utf-8
# Script for generation of protein-ligand interaction fingerprints, IFPs, from MD trajectories
#
#
#############################
### v 1.0
#
# Copyright (c) 2020
# Released under the GNU Public Licence, v2 or any higher version
#
### Author: Daria Kokh
# Daria.Kokh... | Python | 1 |
# Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribu... | Python | 1 |
w.as_view(),
name="review",
),
path(
"speaker/<code>/",
speaker.SpeakerView.as_view(),
name="speaker",
),
path(
"speaker/<code>/og-image",
... | Python | 1 |
", {
"python_branch" => ctx.new_rustfunc(platform_python_branch),
"python_build" => ctx.new_rustfunc(platform_python_build),
"python_compiler" => ctx.new_rustfunc(platform_python_compiler),
"python_implementation" => ctx.new_rustfunc(platform_python_implementation),
"python_revis... | Rust | 0 |
Categorical variable encoder
mod encoder;
pub use encoder::{CategoricalEncoder, ImmutableCategoricalEncoder, MutableCategoricalEncoder};
mod number;
pub use number::{ImmutableNumberer, MutableNumberer, Number};
<reponame>linouxis9/rust
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the t... | Rust | 0 |
from mesh2brick.data.brick_library import brick_library
from mesh2brick.data.brick_structure import Brick
def brick_priority(brick: Brick):
return brick.x, brick.y
def plan_robotic_operation(brick_graph: dict[int, list[Brick]]):
directed_brick_graph = dict()
seq_num = 1
bricks_track = dict()
key... | Python | 1 |
#!/usr/bin/env python3
"""
🌸 Quick Instagram CSRF & Endpoint Hunter 🌸
เวอร์ชันเร็วสำหรับ Instagram โดยเฉพาะ
"""
import asyncio
import aiohttp
import re
import time
from datetime import datetime
from fake_useragent import UserAgent
import sys
class InstagramHunter:
def __init__(self):
self.ua = UserAgen... | Python | 1 |
=> {
let mut ret = "{".to_string();
let len = x.len();
for (i, (k, v)) in x.iter().enumerate() {
ret.push_str(&format!("{:?}", k));
ret.push(':');
ret.push_str(&stringify(v));
ret.push(if i < len - 1 { ',' } else { '}' ... | Rust | 0 |
>,
floating: Vec<i32>,
cut: Vec<i32>,
round: Vec<i32>,
inc: Vec<i32>,
round_input_2: Vec<i32>,
round_input_4: Vec<i32>,
round_weigh_2: Vec<i32>,
}
fn get_data(imp: &Vec<i32>, w: &Vec<i32>) -> Data {
let x: Vec<f32> = fold_f32::fold_f32(
&imp.iter().map(|&x| x as f32).collect(),
... | Rust | 0 |
group, &self.color_bind_group);
{
let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
label: Some("Render Pass"),
color_attachments: &[
wgpu::RenderPassColorAttachment {
view: &view,
... | Rust | 0 |
import os
import pandas as pd
from ydata_profiling.model.summarizer import PandasProfilingSummarizer, format_summary
from ydata_profiling.model.typeset import ProfilingTypeSet
base_path = os.path.abspath(os.path.dirname(__file__))
def test_summarizer(config):
pps = PandasProfilingSummarizer(typeset=ProfilingTy... | Python | 1 |
k] and i not in train_indices_tasks[k]:
train_indices_tasks[k].append(i)
for i in range(len(val_df_nih)):
for j in range(len(nih_pathologies)):
if (nih_pathologies[j].strip() in val_df_nih["Finding Labels"].iloc[i]):
for k in tasks_labels_nih:
... | Python | 1 |
Arg::with_name("creator")
.help("作者、編集者、翻訳者など")
.short("c")
.long("creator")
.takes_value(true))
// 言語
.arg(Arg::with_name("language")
.help("言語")
.short("l")
.long("language")
.takes_value(true))
// ... | Rust | 0 |
perties::default()).await?;
let channel = conn.create_channel().await?;
channel
.queue_declare(
"hello",
QueueDeclareOptions::default(),
FieldTable::default(),
)
.await?;
channel
.basic_publish(
"",
"hello",
... | Rust | 0 |
not provided or None, a
freshly-allocated boolean array is returned.
Returns
-------
out : ndarray
A boolean array with the same dimensions as the input.
If second argument is not supplied then a numpy boolean array is
returned with values True where the corresponding eleme... | Python | 1 |
chain, the weights must be positive.
Parameters
----------
G : NetworkX graph
weight : string or None, optional (default=None)
The edge data key used to compute the Kemeny constant.
If None, then each edge has weight 1.
Returns
-------
K : float
The Kemeny constant ... | Python | 1 |
_tensor,
&temp_tensor,
c.nranks as f32,
torch_stream,
);
unsafe {
cpp::cpp!([
ready_event as "cudaEvent_t",
torch_stream as "cu... | Rust | 0 |
from tkinter import *
import tkintermapview
def oooo():
map_widget.canvas.itemconfig(polygon1.canvas_polygon,outline="yellow", fill="yellow")
def ooooo():
map_widget.canvas.itemconfig(polygon1.canvas_polygon,outline="blue", fill="blue"
... | Python | 1 |
value(4000),
"The median equivalent value to 4000 is 4001"
);
assert_eq!(
8002,
histogram.median_equivalent_value(8000),
"The median equivalent value to 8000 is 8002"
);
assert_eq!(
10004,
histogram.median_equivalent_value(10007),
"The median equiv... | Rust | 0 |
def solve(grid):
h = len(grid)
w = len(grid[0])
cnt = {}
for r in range(h):
for c in range(w):
v = grid[r][c]
if v != 0:
cnt[v] = cnt.get(v, 0) + 1
block_color = max(cnt, key=cnt.get) if cnt else None
def clusters(idxs):
segs = []
s... | Python | 1 |
import pandas as pd
import re
df = pd.read_csv('train.csv')
print(df.shape)
print(df.isnull().sum())
NullData = df[ df['answer'].isnull()]
print(NullData)
# delete rows with null values
df.drop(NullData.index,inplace=True)
# print(df.shape)
# print(df.isnull().sum())
print(df['answer'].head())
#delete arabi... | Python | 1 |
dom.choice([0, 1/1], size=n_embd, p=[p2, 1-p2]),
# 'attn': np.array(server_mask['attn'])*np.random.choice([0, 1/1], size=(n_layer, n_embd), p=[p2, 1-p2]),
# 'mlp': np.array(server_mask['mlp'])*np.random.choice([0, 1/1], size=(n_layer, n_embd), p=[p2, 1-p2]),
# }
elif... | Python | 1 |
test]
fn node_accepted() {
let mut replica = Node::new(VecTransport::default(), CONFIG.clone());
let cmd_metas = CommandMetas("".into());
replica.proposal("123".into(), cmd_metas.clone());
assert_eq!(Some(Ballot(0, 4)), replica.proposer.highest_observed_ballot());
replica.pr... | Rust | 0 |
i::error::ValidatorAPIError;
use coconut_interface::{BlindSignRequestBody, BlindedSignatureResponse, VerificationKeyResponse};
use mixnet_contract::{GatewayBond, MixNodeBond};
use serde::{Deserialize, Serialize};
use url::Url;
pub mod error;
pub(crate) mod routes;
type PathSegments<'a> = &'a [&'a str];
pub struct Cl... | Rust | 0 |
ery) => query.ingress_expiry,
_ => panic!(
"parse_message() returned an unexpected message type: {:?}",
parsed_message
),
};
let expected = Message::Query(UserQuery {
source: UserId::from(PrincipalId::new_anonymous()),
recei... | Rust | 0 |
]
pub fn to_vec2(self) -> Vec2 {
Vec2::new(self.x as f32, self.y as f32)
}
}
// ----------------------------------------------------------------------------
#[derive(Debug, PartialEq, Clone, Copy)]
pub enum LineStyle {
Solid,
Dotted { spacing: f32 },
Dashed { length: f32 },
}
impl LineSty... | Rust | 0 |
}
}
fn query_verifier(deps: Deps) -> StdResult<VerifierResponse> {
let data = deps
.storage
.get(CONFIG_KEY)
.ok_or_else(|| StdError::not_found("State"))?;
let state: State = from_slice(&data)?;
Ok(VerifierResponse {
verifier: state.verifier.into(),
})
}
fn query_other_... | Rust | 0 |
ine(always)]
pub fn trigout(&self) -> TRIGOUT_R {
TRIGOUT_R::new(((self.bits >> 24) & 0xff) as u8)
}
}
#[doc = "Parameter\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [parameter](... | Rust | 0 |
"""6. Se necesita un programa que reciba por línea de comando una serie de palabras, hasta que reciba la
palabra "exit". Una vez recibida dicha instrucción, debe mostrar por salida standard las mismas palabras
ingresadas, almacenadas en una lista, pero ordenadas alfabéticamente y cada una debe estar
capi... | Python | 1 |
# Written by M7md-5shbh
# it performs simple authentication to GitHub using selenium module
#---------------------------------------------
# importing necessary modules
# you can download it through the terminal/cmd using pip install selenium
from selenium import webdriver
# creating a webdriver instance, you can fin... | Python | 1 |
}
}
fn red(self, flags: &args::Flags) -> String {
if flags.no_color {
format!("{}", self)
} else {
format!("{}{}", String::from(RED), self)
}
}
fn custom(self, color: &str, flags: &args::Flags) -> String {
if flags.no_color {
format!("{}", self)
} else {
format... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.