text string | label_name string | labels int64 |
|---|---|---|
from datetime import datetime
from PyQt6.QtCore import QDate
from PyQt6.QtCore import Qt
from PyQt6.QtGui import QPixmap
from PyQt6.QtWidgets import QLabel, QFileDialog
def qdate_to_timestamp(date):
# 将 QDate 转换为 datetime 对象
date_time = datetime(date.year(), date.month(), date.day())
# 将 datetime 对象转换为时间... | Python | 1 |
u16 {
let mask = (1u16 << self.len_field_size) - 1;
self.inner & mask
}
pub fn set_distance(&mut self, dist: u16) -> Result<()> {
if (dist << self.len_field_size) >> self.len_field_size == dist {
let l = self.get_length();
self.inner = (dist << self.len_field_si... | Rust | 0 |
t date. Uses the ISO 8601 standard for
/// calculating the week. See [Wikipedia](https://en.wikipedia.org/wiki/ISO_week_date).
///
/// # Example
///
/// ~~~~
/// use chrono::NaiveDate;
/// use chrono_utilities::naive::DateTransitions;
///
/// let d1 = NaiveDate::from_ymd(2020, 1, 4);... | Rust | 0 |
output,
"{}@{} ({}): ",
parts.0,
parts.1,
krate.licenses.len(),
)?;
}
for (i, license) in krate.li... | Rust | 0 |
es'],
paths=batch['im_file'],
fname=self.save_dir / f'train_batch{ni}.jpg',
on_plot=self.on_plot)
def plot_metrics(self):
"""Plots metrics from a CSV file."""
plot_results(file=self.csv, on_plot=self.on_plot) # save results.png
def p... | Python | 1 |
.
//!
//! ```
//! use typed_sql::{Query, Table, ToSql};
//!
//! #[derive(Table)]
//! struct User {
//! id: i64,
//! name: String
//! }
//!
//! let stmt = User::table()
//! .select()
//! .filter(|user| user.id.neq(6).and(user.id.gt(3)))
//! .group_by(|user| user.name)
//! .order_by(|user| user.na... | Rust | 0 |
logger.info(f'getTaskAward {taskName} {taskType} {taskId} {res.text}')
except Exception as e:
logger.error(f'10086 {token} 签到程序异常:{e}')
cache.delete(f'10086_{token}')
await dingAlert(**result)
# 中国联通
async def m10010(**kwargs):
result = {
"code": 400,
"msg": f'请输入e... | Python | 1 |
width=0,command = next_song)
pause_button=Button(controls_frame,image=pause_btn_img,borderwidth=0,command=lambda: pause(paused))
stop_button=Button(controls_frame,image=stop_btn_img,borderwidth=0, command= stop)
back_button.grid(row=0,column=0,padx=10)
play_button.grid(row=0,column=1,padx=10)
forward_button.grid(row=0... | Python | 1 |
UnaryOperation(op, expr) => {
Box::new(UnaryEvaluator::new(op, create_value_iter(ctx, *expr)))
}
Expr::BinaryOperation(expr) => {
let (op, lhs, rhs, bool_modifier, vector_matching, group_modifier) = expr.into_inner();
create_binary_evaluator(
op,
... | Rust | 0 |
+ ImplicitPromote<$rust_type>
+ ImplicitPromote<$rust_type, Output = T>,
{
fn $op_name(&mut self, rhs: $rust_type) {
let mut temp = $func(self, &rhs, false);
mem::swap(self, &mut temp);
}
}
... | Rust | 0 |
import torch
def projection(vertices, P, dist_coeffs, orig_size):
'''
Calculate projective transformation of vertices given a projection matrix
P: 3x4 projection matrix
dist_coeffs: vector of distortion coefficients
orig_size: original size of image captured by the camera
'''
vertices = to... | Python | 1 |
from typing import Protocol, runtime_checkable
from app.context.manager import Context
from app.modules.dto import OctantRewardsDTO
from app.modules.octant_rewards.core import calculate_rewards
from app.pydantic import Model
@runtime_checkable
class StakingProceeds(Protocol):
def get_staking_proceeds(self, conte... | Python | 1 |
<reponame>aganders3/pyo3<gh_stars>0
use crate::internal_tricks::{extract_cstr_or_leak_cstring, NulByteInString};
use crate::{ffi, AsPyPointer, FromPyObject, PyAny, PyObject, PyResult, Python};
use std::ffi::CStr;
use std::fmt;
use std::os::raw::{c_int, c_void};
/// Python 3.8 and up - __ipow__ has modulo argument corr... | Rust | 0 |
}
bad_text_expression = { (!chord_newline ~ non_quote)+ } // no leading placement symbol
// ==== 6.1.1 Typesetting linebreaks
// this would include comments, if we did not strip them already:
abc_eol = { line_continuation? ~ WSP* }
line_continuation = { ["\\"] }
// -FIX... | Rust | 0 |
buffer
)
offset = 0
if header.payload_length:
while offset < header.payload_length:
count = min(
header.payload_length - offset,
TransportConstants.MAX_PAYLOAD_LENGTH,
... | Python | 1 |
struct WindowsStorageResources {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub iops: Option<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub bps: Option<u64>,
#[serde(
default,
skip_serializing_if = "Option::is_none",
rename = "sandboxSiz... | Rust | 0 |
s(
close=close,
entries=entries,
exits=exits,
direction=direction,
init_cash=init_cash,
cash_sharing=cash_sharing,
size=size,
size_type=size_type_converted,
fees=fees,
... | Python | 1 |
import os
import sys
import shutil
def exit_shell(exit_code=0):
"""Exit the shell with a given exit code."""
os._exit(int(exit_code))
def echo(*args):
"""Echo the arguments to stdout."""
print(" ".join(args))
def shell_type(command):
"""Check if a command is a shell builtin or executable."""
... | Python | 1 |
eq!(
crate::remote::make_execute_request(
&req,
ProcessMetadata {
instance_name: None,
cache_key_gen_version: Some("meep".to_owned()),
platform_properties: vec![],
}
),
Ok((want_action, want_command, want_execute_request))
);
}
#[tokio::test]
async fn make_execut... | Rust | 0 |
rounding errors, we use 50ns instead.
pub const POUNDER_IO_UPDATE_DURATION: f32 = 50e-9;
/// The DDS reference clock frequency in MHz.
pub const DDS_REF_CLK: MegaHertz = MegaHertz(100);
/// The multiplier used for the DDS reference clock PLL.
pub const DDS_MULTIPLIER: u8 = 5;
/// The DDS system clock frequency after... | Rust | 0 |
ed %r' % self)
else:
logging.warning('TempFilePath already deleted %r' % self)
else:
_tracked_paths[self] -= 1
def _cleanup_temp_files():
logging.debug('_cleanup_temp_files')
for path in list(_tracked_paths.keys()):
try:
os.unlink(path)
... | Python | 1 |
has this name.", 0))
insert_query = insert(user).values(
username=username,
password_hash=hash_password(password),
device_id=decrypted_fields[b'vid'][0].decode(),
data=None,
timestamp=None,
crc=None,
coin_mp=1,
)
await database.execute(insert_query)
... | Python | 1 |
#!/usr/bin/env python
#
# File Name : rouge.py
#
# Description : Computes ROUGE-L metric as described by Lin and Hovey (2004)
#
# Creation Date : 2015-01-07 06:03
# Author : Ramakrishna Vedantam <vrama91@vt.edu>
import numpy as np
import pdb
def my_lcs(string, sub):
"""
Calculates longest common subsequence ... | Python | 1 |
"SourceFolderPrefix", "testfolder"),
RunParameter(RunParameterType.Pipeline, "SinkStorageAccountName", "sinkstorage"),
RunParameter(RunParameterType.Pipeline, "SinkContainerName", "sinkcontainer"),
RunParameter(RunParameterType.Pipeline, "SinkFolderName", "sinkfolder"),
],
... | Python | 1 |
op temperature measurement"]
pub tasks_stop: TASKS_STOP,
_reserved0: [u8; 248usize],
#[doc = "0x100 - Temperature measurement complete, data ready"]
pub events_datardy: EVENTS_DATARDY,
_reserved1: [u8; 512usize],
#[doc = "0x304 - Enable interrupt"]
pub intenset: INTENSET,
#[doc = "0x308 ... | Rust | 0 |
i32 {
let p = ochr;
let val = scan_usv_num(input);
let p = p + val;
let n = *SF_CODE(val as usize) % 65536;
scan_optional_equals(input);
let val = scan_char_class(input);
if a >= 4 {
geq_... | Rust | 0 |
#3. Laadi ohjelma, joka laskee kuinka moni sai hyvitystä aikaansa (=aika oli alle minuutin)
# ja kuinka moni ei saanut hyvitystä sekä aikojen keskiarvon.
# Ohjelmassa on toisto, joka jatkuu niin kauan kunnes ajaksi annetaan nolla.
# Ohjelma kysyy joka kierroksella ajan ja summaa aikojen yhteismäärää sekä joko hyvit... | Python | 1 |
))
}
<gh_stars>0
use core::time;
use std::thread;
use std::time::Duration;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate web_view;
use crate::gpio::{Direction, GPIOPin, Pin};
use crate::gui::GuiManager;
use crate::hx711::Hx711;
use crate::workflow::{Manager, BlueprintBlock, Command, Co... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
generate_outline_style_toc.py — Generate a Markdown TOC with Outline-style heading slugs.
This script creates a table of contents for Markdown files using the same slug generation
rules as Outline's rich-markdown-editor (https://github.com/outline/outline).
Usage:
... | Python | 1 |
ome(data) => {
let x = OwnedMessage::Text(data);
if let Err(e) = sender.send_message(&x) {
match e {
WebSocketError::IoError(e) => {
warn!("Send WebSocket D... | Rust | 0 |
import re
import pytest
from fastapi import FastAPI, status
from fastapi.testclient import TestClient
from models.lorem_models import LoremInput, LoremOutput, LoremType
from routers.lorem_router import router as lorem_router
# Fixture for the FastAPI app
@pytest.fixture(scope="module")
def test_app() -> FastAPI:
... | Python | 1 |
text;
st.className = b.cls + " state";
// جزئیات
const flags = (it.flags||[]).join(",");
const mac = it.mac ? (" | MAC: <span class='k'>" + it.mac + "</span>") : "";
card.querySelector('.flags').innerHTML = "پرچمها: " + (flags || "هیچ");
card.querySelector('.meta').in... | Python | 1 |
import cv2
import mediapipe as mp
import numpy as np
import os
import time
# ---------------------------------------------------------------- #
# 1. 参数设置 (Parameters)
# ---------------------------------------------------------------- #
# 定义所有你想要采集的手势类别
# Define all gesture classes you want to collect
gesture_names = [... | Python | 1 |
BACKTRACE` in here.
panic!(
"exec.prefab_module.initial can't be greater than exec.prefab_module.maximum;
thus Memory::new must not fail;
qed"
)
});
let mut env_builder = sp_sandbox::EnvironmentDefinitionBuilder::new();
let mut current... | Rust | 0 |
}
fn detect_daychange<S: AsRef<str>>(re: &Regex, msg: S) -> Option<DateTime<Local>> {
if let Some(re_match) = re.captures(msg.as_ref()) {
let mon = &re_match[1];
let day = &re_match[2];
let year = &re_match[3];
let s = format!("{}{}{}", year, mon, day);
if let Ok(naive_date)... | Rust | 0 |
nknown"]
pub const _NV_ENC_PIC_TYPE_NV_ENC_PIC_TYPE_UNKNOWN: _NV_ENC_PIC_TYPE = 255;
#[doc = " Input picture type"]
pub type _NV_ENC_PIC_TYPE = u32;
#[doc = " Input picture type"]
pub use self::_NV_ENC_PIC_TYPE as NV_ENC_PIC_TYPE;
#[doc = "<Driver selects QuarterPel motion vector precision by default"]
pub const _NV_EN... | Rust | 0 |
import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from skimage import filters
import tkinter as tk
from tkinter import filedialog, messagebox
import pandas as pd # type: ignore
import os
def preprocess_image(path):
img = cv2.imread(path, cv2.IMREAD_GRAYSCALE)
if img is None:... | Python | 1 |
(Roll-out Quoten data)",
)
parser.add_argument(
"--openrouter-api-key",
type=str,
help="OpenRouter API key for LLM-assisted matching",
)
parser.add_argument(
"--openrouter-base-url",
type=str,
default="https://openrouter.ai/api/v1",
help="OpenRoute... | Python | 1 |
urrent),
})
}
}
}
}
<reponame>astrolabe-coop/astarte-device-sdk-rust<gh_stars>1-10
/*
* This file is part of Astarte.
*
* Copyright 2021 SECO Mind Srl
*
* 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 ... | Rust | 0 |
ys as keys;
pub use exonum_merkledb as merkledb;
#[macro_use]
pub mod messages;
pub mod blockchain;
pub mod helpers;
pub mod runtime;
#[doc(hidden)]
pub mod proto;
// This file is part of Substrate.
// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-e... | Rust | 0 |
xpect us to. However, our generated seeds are correct and tiny-bip39,
//! an alternative implementation of bip39 also does not fulfill the test vectors.
// These vectors are tuples of
// (entropy, mnemonic, passphrase, seed)
let vectors = [
(
"00000000000000000000000000000000",
"あいこくしん あいこくしん あいこくしん... | Rust | 0 |
polynomial of arbitrary rank using Horner's method.
///
/// Horner's method goes like this: to find 𝑎𝑥³+𝑏𝑥²+𝑐𝑥+𝑑, you evaluate 𝑥(𝑥(𝑎𝑥+𝑏)+𝑐)+𝑑.
///
/// That's what this function does too.
///
/// You provide a value for `𝑥` and a slice of values for the coefficients `&[𝑎, 𝑏, 𝑐, 𝑑, …]`.
/// The cardin... | Rust | 0 |
1"
},
"domain_id": "domain1"
}"#;
let config: BlobCacheEntry = serde_json::from_str(content).unwrap();
assert!(!config.blob_config.prefetch_config.enable);
assert_eq!(config.blob_config.prefetch_config.threads_count, 0);
assert_eq!(config.blob_config.prefe... | Rust | 0 |
"
} else {
"ON"
};
let mut config = cmake::Config::new(clone_path);
config
.define("NN_STATIC_LIB", "ON")
.define("NN_ENABLE_DOC", "OFF")
.define("NN_ENABLE_GETADDRINFO_A", getaddrinfo_a_flag)
.define("NN_TESTS", "OFF");
if env::var("CARGO_CFG_TARGET_ENV").u... | Rust | 0 |
from openai import OpenAI
import anthropic
from utils import call_api
import argparse
import json
import os
from utils import cache_output
from tqdm import tqdm
import random
random.seed(2024)
def overall_score(idea_proposal, openai_client, model):
prompt = "You are a professor in Natural Language Processing. You... | Python | 1 |
e_failed_trials=max_consecutive_failed_trials,
)
super().__init__(oracle=oracle, hypermodel=hypermodel, **kwargs)
def run_trial(self, trial, *fit_args, **fit_kwargs):
hp = trial.hyperparameters
if "tuner/epochs" in hp.values:
fit_kwargs["epochs"] = hp.values["tuner/epoch... | Python | 1 |
")
if BARK == '' and BARK_PUSH == '':
print("bark服务的bark_token未设置!!\n取消推送")
return
def serverJ(title, content):
print("\n")
if not SCKEY:
print("server酱服务的SCKEY未设置!!\n取消推送")
return
print("serverJ服务启动")
data = {
"text": title,
"desp": content.replace(... | Python | 1 |
import socket
import argparse
from app.src.redisdata import RedisObject
import pdb
def client_session(server_ip="localhost", server_port=6379):
# Create a socket object for the client
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print("Client socket initiated")
try:
# Con... | Python | 1 |
collection = ee.ImageCollection("MODIS/006/MCD43A4")
# default colors for bands and spectral indices
bandColors = {
'Nadir_Reflectance_Band3': '#003fbd',
'Nadir_Reflectance_Band4': '#008700',
'Nadir_Reflectance_Band1': '#c50003',
'Nadir_Reflectance_Band2': '#af54ff',
'Nadir_Reflectance_Band6': '#ff... | Python | 1 |
};
use crate::bellman::pairing::ff::{
Field,
PrimeField,
PrimeFieldRepr,
BitIterator
};
use crate::bellman::{
SynthesisError,
};
use crate::bellman::plonk::better_better_cs::cs::{
Variable,
ConstraintSystem,
ArithmeticTerm,
MainGateTerm
};
use crate::circuit::{
Assignment
};... | Rust | 0 |
#define RUSTG_JOB_NO_SUCH_JOB "NO SUCH JOB"
#define RUSTG_JOB_ERROR "JOB PANICKED"
"#
)
.unwrap();
// module: dmi
if enabled!("DMI") {
write!(f, r#"
#define rustg_dmi_strip_metadata(fname) call(RUST_G, "dmi_strip_metadata")(fname)
#define rustg_dmi_create_png(path, width, height, data) call(RU... | Rust | 0 |
return msg
def _report_bleu(self, tgt_path):
import subprocess
base_dir = os.path.abspath(__file__ + "/../../..")
# Rollback pointer to the beginning.
self.out_file.seek(0)
print()
res = subprocess.check_output(
"perl %s/tools/multi-bleu.perl %s" %... | Python | 1 |
D",
extension: "RV64A",
op: |cpu, word, _addr| {
// FormatR
Ok(())
},
},
Instruction {
// fn7 rs2 rs1 fn3 rd op
mask: 0b11111_0_0_00000_00000_111_00000_1111111,
reqd: 0b01100_0_0_00000_00000_011_00000_0101111,
name: "AMOAND.D",
extension: "RV64A",
op: |cpu, word, _addr| {
... | Rust | 0 |
# -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany
... | Python | 1 |
6, 5, 4, 3, 2, 1, 0);
/// let percentile = ks::percentile(&samples, 50);
/// assert_eq!(percentile, 4);
/// ```
pub fn percentile<T: Ord + Clone>(samples: &[T], p: u8) -> T {
assert!(0 < p && p <= 100);
let length = samples.len();
assert!(length > 0);
let r = (p as f64 * length as f64 / 100.0).ceil() ... | Rust | 0 |
/// # use graph_oauth::oauth::OAuth;
/// # let mut oauth = OAuth::new();
/// oauth.grant_type("token");
/// ```
pub fn grant_type(&mut self, value: &str) -> &mut OAuth {
self.insert(OAuthCredential::GrantType, value)
}
/// Set the resource.
///
/// # Example
/// ```
... | Rust | 0 |
ags> for libc::c_uchar {
type Error = std::num::TryFromIntError;
fn try_from(flags: &IfaFFlags) -> Result<libc::c_uchar, Self::Error> {
let mut n: libc::c_uint = 0;
for bit in 0..std::mem::size_of::<libc::c_uint>() * 8 {
if flags.contains(&IfaF::from(1 << bit)) {
n |=... | Rust | 0 |
from src.Controllers.Ventanas import login
def start():
login.start()
| Python | 1 |
);
} else {
runner.input_byte(c);
}
}
}
// Go back to sleep for however many naps we have left
context = runner.context;
context.state = ProgramState::Asleep;
context
}
/// Handles the 'Asleep' state. Checks for an `Esc`, has a nap and then pips
/// the LED.
fn asleep(context: &mut Context) -> Pr... | Rust | 0 |
ar(
mut cmap: *mut CMap,
mut input: *mut ifreader,
mut count: i32,
) -> i32 {
loop {
let fresh7 = count;
count = count - 1;
if !(fresh7 > 0i32) {
break;
}
if ifreader_read(input, (127i32 * 2i32) as size_t) == 0i32 as u64 {
return -1i32;
... | Rust | 0 |
" },
"signIn": { "id": "VXNlcjow", "email": "<EMAIL>", "username": null },
})
);
}
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - SENSITIVE_ROM_TABLE_LOCK"]
pub sensitive_rom_table_lock: SENSITIVE_ROM_TABLE_LOCK,
#[doc = "0x04 - SENSITIVE_ROM_TABLE"]... | Rust | 0 |
# Цель: приобрести навык использования асинхронного запуска функций на практике
# Задача "Асинхронные силачи":
import asyncio # Импортируем библиотеку для работы с асинхронным программированием
# Асинхронная функция для выполнения работы силача
async def start_strongman(name, power):
# Начинаем выполнение з... | Python | 1 |
2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
class Config:
frozen = True
smart_union = True
extra = pydantic.Extra.allow
AgentWorkflowRequestModelNodesValue = typing_... | Python | 1 |
p), norm_Tp)
d2q = np.divide(d2Tp - np.dot(dq, dnorm_Tp) - np.dot(q, d2norm_Tp) - np.dot(dq, dnorm_Tp), norm_Tp )
# % >>> d3q
d3Tp = -np.dot(mL, d3aL )
d3norm_Tp = np.dot( 2*np.dot(d2Tp, dTp) + np.dot(dTp, d2Tp)+ np.dot(Tp, d3Tp) - 3*np.dot(dnorm_Tp, d2norm_Tp), norm_Tp)
d3q... | Python | 1 |
opts.optopt("", "leaf-color", "set leaf color", "COL");
opts.optopt("p",
"starting-point",
"set the starting point of the tree",
"X,Y");
opts.optopt("s", "skew", "set the amount to skew tree to the right", "DEG");
opts.optflag("h", "help", "print out usage inf... | Rust | 0 |
# 可选择打印更多信息进行调试
def test_decode_stage():
# 设置测试参数
batch_size = 1
num_heads = 4
initial_seq_length = 16
generated_seq_length = 16
head_dim = 64
BLOCK_M = 16
BLOCK_N = 16
# 生成固定的初始输入张量
torch.manual_seed(0)
q_initial = torch.randn(
batch_size,
num_heads,... | Python | 1 |
: T) {
*self = *self / rhs
}
}
impl<T: IsInteger> DivAssign<&T> for Overflowing<T> {
fn div_assign(&mut self, rhs: &T) {
*self = *self / rhs
}
}
impl<T: IsInteger> Rem<Self> for Overflowing<T> {
type Output = Self;
fn rem(self, rhs: Self) -> Self {
self.bin_apply(rhs, |lhs, rhs| lhs.overflowing_rem(rhs))
... | Rust | 0 |
utures::failed("Generic failure".into()))
}
/// Send back the answers
fn send_security_question_answers(&self, security_answer: &Vec<models::SecurityAnswer>, context: &C) -> Box<Future<Item=SendSecurityQuestionAnswersResponse, Error=ApiError>> {
let context = context.clone();
println!("send... | Rust | 0 |
#[no_mangle]
fn gr_cinfo_base(p: *const gr_char_info) -> size_t;
#[no_mangle]
fn gr_make_seg(
font: *const gr_font,
face: *const gr_face,
script: gr_uint32,
pFeats: *const gr_feature_val,
enc: gr_encform,
pStart: *const libc::c_void,
nChars: size_... | Rust | 0 |
d = defer.Deferred()
self.q.put((name, self.__acquire, timeout, d))
return d
def __acquire(self, name, timeout):
if self.verbose > 2: self.message("__acquire %s %d" % ( name, timeout ))
tick = timeout
while 1:
if self.lock.acquire(0):
... | Python | 1 |
'convection_scheme': 2,
'rollup_dt': dt,
'rollup_aic_refresh': 1,
'rollup_tolerance': 1e-4,
'velocity_field_generator': 'SteadyVelocityField',
'velocity_field_input': aux_settin... | Python | 1 |
user_id_type: str = FeishuReceiveType.OPEN_ID.value, page_size: int = 100):
"""
获取用户或机器人所在的群列表
参考API: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat/list
Args:
user_id_type: 用户id类型,默认 open_id
page_size: 分页大小,默认每次拉取100
Raises:
... | Python | 1 |
_from).collect::<Result<Vec<_>>>()?;
Ok(Self(units))
}
}<gh_stars>0
#![warn(clippy::all)]
#![warn(clippy::pedantic)]
#![warn(clippy::cargo)]
#![warn(clippy::needless_borrow)]
// https://github.com/rust-lang/rust-clippy/pull/5998#issuecomment-731855891
#![allow(clippy::map_err_ignore)]
#![allow(clippy::optio... | Rust | 0 |
count_columns: usize) -> EntityFrame {
match entity {
Entity::Global => EntityFrame::new(0, count_columns, 0, count_rows),
&Entity::Column(c) => EntityFrame::new(c, c + 1, 0, count_rows),
&Entity::Row(r) => EntityFrame::new(0, count_columns, r, r + 1),
&Entity::Cell(r, c) => EntityF... | Rust | 0 |
{
panic!("running empty testcase, enable either FUZZ_OLD_HTML5GUM or FUZZ_HTML5EVER");
}
}
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}<filename>kernel/src/arch/x86_64/memory/regions/private_direct_kernel_region.rs
use x86::tlb;
use crate::{
arch::memory::{
paging_structs::{... | Rust | 0 |
verenchanted |
SetBonus => 100.0,
SharingIsCaring => 500.0,
// Tier 3
FastLearners => 250.0,
WellEquipped |
SwapDay => 500.0,
// Utility Tree
// Tier 1
SpendItAll => 25.0,
UpgradeThemAll => 50.0,
... | Rust | 0 |
$signature.push_with_default_value(
stringify!($t),
$e,
);
$( starlark_signature!($signature $($rest)+) )?
};
}
#[doc(hidden)]
#[macro_export]
macro_rules! starlark_parse_param_type {
(1 : $pt:ty) => { $pt };
(? : $pt:ty) => { $pt };
(* : $pt:ty) => { $p... | Rust | 0 |
f args.subpath != '':
np.save( os.path.join(args.subpath, "{:05d}.npy".format(i)), prediction)
else:
np.save(os.path.join(os.path.join(output_folder, BAND + '_npy', prediction), '%04d.npy' % i), prediction)
# Normalize for video encoding (min/max are saved on two CVS... | Python | 1 |
].item()} s'approche")
play_sound("son_cut.mp3")
elif ((x2-x1)-(oldx2-oldx1)) < -5 or ((y2-y1)-(oldy2-oldy1)) < -5: # the difference is negative and big enough so the person is stepping back
print(f"{detections.id[i].item()} se recule")
... | Python | 1 |
Gltf;
use super::Error;
#[derive(Clone, Copy)]
pub enum ColliderKind {
AABB,
Convex,
TriMesh,
}
#[derive(serde::Serialize)]
pub enum Collider {
AABB {
extent: na::Vector3<f32>,
},
Convex {
points: Vec<na::Point3<f32>>,
},
TriMesh {
vertices: Vec<na::Point3<f32>... | Rust | 0 |
neg).collect();
newcs.push(Clause { lits: lsnew });
}
}
Formula {
clauses: newcs,
maxvar: f.maxvar,
}
}
// Can return a negative value, in which case the negated literal will
// be the first one to try, and only if it fails will the positive
// version be tried.
fn choos... | Rust | 0 |
from collections import Counter
from collections.abc import Sequence
from typing import Optional
from typing import Union
from typing_extensions import assert_never
from ice.formatter.multi import stop
from ice.formatter.multi import StopSentinel
from ice.formatter.transform.value import ValueTransform
from ice.recip... | Python | 1 |
token_amount: Uint128,
) -> StdResult<CosmosMsg> {
// create transfer cw20 msg
let transfer_cw20_msg = Cw20ExecuteMsg::TransferFrom {
owner: owner.into(),
recipient: recipient.into(),
amount: token_amount,
};
let exec_cw20_transfer = WasmMsg::Execute {
contract_addr: ... | Rust | 0 |
from core.redis import rds
from core.triage import Triage
from core.parser import ScanParser
class Rule:
def __init__(self):
self.rule = 'DSC_OR39'
self.rule_severity = 1
self.rule_description = 'This rule checks for the exposure of GitLab Panels'
self.rule_confirm = 'Identified a GitLab Panel'
... | Python | 1 |
class Solution:
def maxPoints(self, points: List[List[int]]) -> int:
n = len(points[0])
# dp[j] := max # Points you can have if points[i][j] is the most recent cell you picked
dp = [0] * n
for row in points:
leftToRight = [0] * n
runningMax = 0
for j in range(n):
runningMax ... | Python | 1 |
from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Union
import torch
from torch.utils._pytree import (
SUPPORTED_NODES,
TreeSpec,
LeafSpec,
PyTree,
_is_leaf,
_get_node_type,
tree_flatten,
tree_map,
tree_unflatten,
)
def tree_flatten_like(pytree: PyTree, spe... | Python | 1 |
e = file_name.into();
match self.resumable_policy {
ResumablePolicy::Threshold(threshold) => {
if size > 0 && size < threshold.into() {
self.upload_stream_by_form(stream, size, file_name, mime)
} else {
self.upload_stream_by_blo... | 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 u... | Python | 1 |
01_0111
// 7 ^ 15 23 31 ^ 39 47
// 10 35
// 01_1010 0110_1100_1010_0101 111
// s2 10 1010 1011 0101 1101 1011 0100 11_1010
// s ^= s2 11_0000 1101 1001 011... | Rust | 0 |
@_deprecate_positional_args
def foo_method(self, bar=None): ...
obj = Foo()
obj.foo_method()
obj.foo_classmethod()
def test_deprecate_positional_args_decorator_not_needed():
match = (
"Function 'test_deprecate_positional_args_decorator_not_needed.<locals>.Foo.foo' has 0 "
... | Python | 1 |
/lang/Object;");
assert_eq!(rest, "");
assert_eq!(
d,
FieldDescriptor::Array(Box::new(FieldDescriptor::Array(Box::new(
FieldDescriptor::Array(Box::new(FieldDescriptor::Object(String::from(
"java/lang/Object"
))))
)))... | Rust | 0 |
=> println!("three to get ready"),
4 => println!("four to go!"),
5 => println!("<NAME> is alive!"),
_ => println!(""),
}
let pt = Point{x: x, y: x*2};
println!("pt.x = {}, pt.y = {}", pt.x, pt.y);
}
}
fn while_loop_example(){
println!("running wh... | Rust | 0 |
import re
import warnings
from dataclasses import dataclass, is_dataclass, fields
from typing import ClassVar, Any, Dict, Type, Set, List, TYPE_CHECKING, Sequence
import _internal_mitmproxy.flow
if TYPE_CHECKING:
import _internal_mitmproxy.addonmanager
import _internal_mitmproxy.log
class Hook:
name: Cl... | Python | 1 |
event going from one control char to another
// - Prevent overflow for common characters
dest_stream[encoded_idx] = next_byte + 0x40;
}
} else if next_byte == DLE_CHAR {
if encoded_idx + 1 >= max_dest_len {
return Er... | Rust | 0 |
test_case("€" ; "width 3")]
#[test_case("𐍈" ; "width 4")]
fn too_long_with_unicode_widths(c: &str) {
let response = Response::log_from_fmt(format_args!("{}", c.repeat(500)));
let log = match response {
Response::Log(log) => log,
_ => panic!(),
... | Rust | 0 |
g. sputnik, evmodin)",
default_value = "sputnik"
)]
evm_type: EvmType,
#[structopt(
help = "fetch state over a remote instead of starting from empty state",
long,
short
)]
#[structopt(alias = "rpc-url")]
#[structopt(env = "... | Rust | 0 |
= "Win32_Foundation", feature = "Win32_Networking_WinSock"))]
pub fn PeerPnrpUpdateRegistration(hregistration: *const ::core::ffi::c_void, pregistrationinfo: *const PEER_PNRP_REGISTRATION_INFO) -> ::windows_sys::core::HRESULT;
}
#[repr(C)]
#[doc = "*Required features: `\"Win32_NetworkManagement_P2P\"`, `\"Win32_Fo... | Rust | 0 |
t mut nbitplanes: [u8; 3] = [0; 3];
let mut tmagic: [u8; 2] = [0; 2];
/* initialize the byte read position to the beginning of the array */
/*
* File starts either with special 2-byte magic code or with
* FITS keyword "SIMPLE ="
*/
qread(infile, &mut tmagic, 2);
/*
* check for ... | Rust | 0 |
test]
fn rfc_test_case_8() {
assert_eq!(run_rfc_test_base32(7), 162583)
}
#[test]
fn rfc_test_case_9() {
assert_eq!(run_rfc_test_base32(8), 399871)
}
#[test]
fn rfc_test_case_10() {
assert_eq!(run_rfc_test_base32(9), 520489)
}
<gh_stars>0
pub type Child = crate::Child<std::process::Child, crate::pty::std:... | Rust | 0 |
h工具响应(GPT MCP标准格式)"""
results: List[FetchResultItem] = Field(..., description="获取结果列表")
# ==================== 个人记忆写入工具模型 ====================
class PersonalMemoryInput(BaseModel):
"""个人记忆写入输入模型"""
content: str = Field(
...,
description=(
"要记忆的内容,使用自然语言描述。\n"
"可以使用... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.