text string | label_name string | labels int64 |
|---|---|---|
A_NEWDST,
#[cfg(target_env = "gnu")]
Pref = libc::RTA_PREF,
#[cfg(target_env = "gnu")]
EncapType = libc::RTA_ENCAP_TYPE,
#[cfg(target_env = "gnu")]
Encap = libc::RTA_ENCAP,
#[cfg(target_env = "gnu")]
Expires = libc::RTA_EXPIRES,
#[cfg(target_env = "gnu")]
Pad = libc::RTA_PAD,
... | Rust | 0 |
g are required to
// link to libclang-cpp.so instead of individual libraries.
let use_libclang = if cfg!(target_os = "macos") {
false
} else { // target_os = "linux"
let mut libclang_path = PathBuf::new();
libclang_path.push(llvm_lib_dir);
libclang_path.push("libclang-cpp.so... | Rust | 0 |
.get_name(), access_time.elapsed().unwrap().as_secs_f64(), utils::time_to_timestamp_string(&access_time), creation_time.elapsed().unwrap().as_secs_f64(), utils::time_to_timestamp_string(&creation_time));
}
}
}
}
use crate::config;
use crate::errors::Error;
use crate::jwt::encode;
use chrono::Utc... | Rust | 0 |
x="9" cy="13" r="1"/><circle cx="15" cy="13" r="1"/><path d="M18,11.03C17.52,8.18,15.04,6,12.05,6c-3.03,0-6.29,2.51-6.03,6.45c2.47-1.01,4.33-3.21,4.86-5.89 C12.19,9.19,14.88,11,18,11.03z"/><path d="M20.99,12C20.88,6.63,16.68,3,12,3c-4.61,0-8.85,3.53-8.99,9H2v6h3v-5.81c0-3.83,2.95-7.18,6.78-7.29 c3.96-0.12,7.22,3.06,7.2... | Rust | 0 |
memoryOffset: VkDeviceSize,
) -> VkResult;
}
extern "C" {
pub fn vkGetBufferMemoryRequirements(
device: VkDevice,
buffer: VkBuffer,
pMemoryRequirements: *mut VkMemoryRequirements,
);
}
extern "C" {
pub fn vkGetImageMemoryRequirements(
device: VkDevice,
image: ... | Rust | 0 |
,
[author], 1)
]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Astrobase', 'Astroba... | Python | 1 |
_,
LincolnChar::Unprintable(n),
) => {
write!(
f,
"cannot convert code {:#o} from Lincoln Writer character set to Unicode, because it has no printable representation",
n
)
}
LincolnToUnicode... | Rust | 0 |
import numpy as np
def create_blend_mask(patch_w, patch_h, left_margin, right_margin, top_margin, bottom_margin):
"""
Creates a blending mask for a patch of dimensions (patch_w, patch_h). The mask is calculated so that:
- In the horizontal dimension, the weight ramps linearly from 0 at the left edge up t... | Python | 1 |
str:
return f"<{self.__class__.__name__} id={self.id} owner={self.owner!r} flags={self.flags!r}>"
@property
def time_remaining(self) -> timedelta | None:
"""The amount of time that this license can be used for."""
if self.flags & LicenseFlag.Expired > 0:
return
if s... | Python | 1 |
.ones([1], device=mean.device, dtype=mean.dtype)], dim=0
)
vec = AllReduce.apply(vec * B)
total_batch = vec[-1].detach()
momentum = total_batch.clamp(max=1) * self.momentum # no update if total_batch is 0
total_batch = torch.max(total_batch, torch.ones_l... | Python | 1 |
.host = "google.com";
// assert_eq!(s, u);
// }
#[test]
fn host_subcomponent() {
let mut u = Url::new();
let s = Url::from("http://192.168.0.1/").unwrap();
u.scheme = Some("http");
u.host = "192.168.0.1";
u.path = Some("/");
assert_eq!(s, u);
}
... | Rust | 0 |
AdvancedBruteForceBot()
# Ask if user wants to calibrate first
print("\nDo you want to run calibration mode first? (y/n): ", end="")
if input().lower().startswith('y'):
bot.calibrate_detection()
return
bot.run()
except ImportErr... | Python | 1 |
e_path = os.path.join(output_directory, csv_file_name)
pdf_text = extract_text_from_pdf(pdf_path)
chinese_text = filter_chinese_characters(pdf_text)
if not os.path.exists(output_directory):
os.makedirs(output_directory)
with open(csv_file_path, mode='w', newline='\n', encoding='utf-8-sig') as... | Python | 1 |
import factory
from django.contrib.auth import get_user_model
from ralph.tests.models import TestManufacturer
class UserFactory(factory.Factory):
"""
User *password* is 'ralph'.
"""
class Meta:
model = get_user_model()
username = factory.Sequence(lambda n: "user_{}".format(n))
@fac... | Python | 1 |
}"
for x in sum(
(
generate_fast(
model,
tok,
lang_prefix_dict[i_lang],
n_gen_per_prompt=n_gen // 5,
... | Python | 1 |
_map.append(cb_res_map);
}
return FieldError(name, Some(serde_json::json!(base_map)));
} else {
return FieldError(name, Some(cb_res));
}
}
FieldError(name, Some(cb(&self)))
}
}
impl ErrorExtensions for FieldError {
fn exte... | Rust | 0 |
置文件中缺少 {sim_name} 的 SIM 信息: SIM_1_OPERATOR={sim_operator}, SIM_1_NUMBER={sim_number}")
# print("请检查配置文件是否正确更新或重新运行 SIM 卡信息读取操作。")
return
sim_info = {
sim_name: {
"Operator": sim_operator,
"Number": sim_number
}
}
# print(sim_info)
# print(f"{sim_na... | Python | 1 |
# El programa elige una palabra secreta (por ejemplo, "programar").
# El usuario tiene 5 intentos para adivinar la palabra.
# En cada intento, el programa compara la palabra introducida por el usuario con la palabra secreta.
# Si son iguales, muestra un mensaje de felicitación y termina.
# Si no son iguales, indica cuá... | Python | 1 |
#!/usr/bin/env python3
"""
API密钥设置脚本
帮助用户配置必要的API密钥
"""
import os
import sys
def setup_serpapi_key():
"""设置SerpAPI密钥"""
print("🔑 设置SerpAPI密钥")
print("-" * 30)
print("SerpAPI用于搜索AI Agent活动")
print("获取免费API密钥: https://serpapi.com/")
print("免费账户每月提供100次搜索")
current_key = os.getenv("SERP... | Python | 1 |
ntactState::pk).expand_width();
let del_btn = Button::new("Delete").on_click(ContactsController::click_remove_contact);
Flex::row()
.with_flex_child(alias, 1.0)
.with_flex_child(pk, 1.0)
.with_child(del_btn)
}
use packed_struct::prelude::*;
#[test]
#[cfg(test)]
fn test_packed_compact_b... | Rust | 0 |
k_assign(
v::Expr::new_ref(name),
v::Expr::new_ulit_dec(*width as u32, &value),
));
}
});
module.add_process(initial);
// cell instances
comp.cells
.iter()
.filter_map(|cell| cell_instance(&cell.borrow()))
.for_each(|instance| ... | Rust | 0 |
l,
supports_detection_of_input_fx_in_set_fx_change: bool,
}
impl ControlSurfaceAdapter {
pub fn new(
delegate: Box<dyn ControlSurface>,
reaper_version: &ReaperVersion,
) -> ControlSurfaceAdapter {
let reaper_version_5_95: ReaperVersion = ReaperVersion::new("5.95");
ControlSu... | Rust | 0 |
Styled<Rectangle, PrimitiveStyle<Rgb565>> =
egrectangle!(top_left = Point::new(10, 20), size = Size::new(20, 20),);
let _r: Styled<Rectangle, PrimitiveStyle<Rgb565>> =
egrectangle!(top_left = (10, 20), size = (20, 20),);
let _r: Styled<Rectangle, PrimitiveStyle<Rgb565>> = egrect... | Rust | 0 |
))
, Effect::ReturnPoint(lbl, body, new_offset) => EFPEffect::ReturnPoint(lbl, exp(body, frame_offset + new_offset), new_offset)
, Effect::If(test, conseq, alt) => EFPEffect::If( pred(test, frame_offset)
, mk_box!(effect(*conseq, frame_offset))
... | Rust | 0 |
=> {
// Return the value from the script evaluation
Ok(val)
}
Err(err) => {
// Load the script into Redis if the script hash wasn't there already
if err.kind() == ErrorKind::NoScriptError {
load_cmd.query_async(... | Rust | 0 |
30 0123723 off
//! ```
//!
//! You can run start processing those commands with
//! `$ cat fritz-commands.txt | fritzctrl schedule`
//!
//! The program will wait until the next command should run and then toggle the device state. Once all commands are done the app will exit.
//!
//! ## Why???
//!
//! Useful for schedul... | Rust | 0 |
malized = empty_metrics()
if isinstance(metrics, dict):
merge_usage_metrics(normalized, metrics)
service_bucket[channel] = normalized
history_usage[service] = service_bucket
except (json.JSOND... | Python | 1 |
-code
pub fn part_1(input: &Vec<String>) -> usize {
// Get the number of bits, remove empty strings at beginning and end
let bitcount = input[0].split("").collect::<Vec<&str>>().len() - 2;
let mut accumulator = vec![0; bitcount];
for number in input {
for (i, bit) in number.split("").enumerate() {
ma... | Rust | 0 |
.
#[inline]
pub fn iter(&self) -> RowIterator<'_> {
RowIterator::new(self)
}
#[braneg(test)]
pub fn decode(
buf: &mut EinsteinDB_util::codec::BytesSlice<'_>,
field_types: &[FieldType],
) -> Result<Chunk> {
let mut chunk = Chunk {
columns: Vec::with_ca... | Rust | 0 |
enderingContext2d as Context2d, HtmlCanvasElement, Window};
use yew::NodeRef;
const SCALE: f64 = 2.0;
const RETAIN: f64 = 6_000.0;
const LINE_WIDTH: f64 = 1.0;
/// Pixels per second
const PPS: f64 = 50.0;
pub struct Point {
pub value: f64,
pub timestamp: f64,
}
pub struct LiveChart {
last_timestamp: f... | Rust | 0 |
rate::Reg<u32, _SLP_REJECT_CAUSE>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _SLP_REJECT_CAUSE;
#[doc = "`read()` method returns [slp_reject_cause::R](slp_reject_cause::R) reader structure"]
impl crate::Readable for SLP_REJECT_CAUSE {}
#[doc = "RTC_CNTL_SLP_REJECT_CAUSE"]
pub mod slp_reject_cause;
#[doc = "RTC_C... | Rust | 0 |
nOutChannels
# Final batch norm
self.features.add_module('last_norm%d' % (i + 1), nn.BatchNorm2d(num_features))
# Linear layer
self.fc = nn.Linear(6156, 1024)
self.dist_reg = nn.Linear(1024, self.cfg.model.num_lights)
self.rgb_ratio_reg = nn.Linear(1024, 3)
... | Python | 1 |
# tests/test_settings.py
import pytest
from fastapi import status
def test_list_models(client, user_token):
"""Test listing available LM Studio models."""
response = client.get("/api/settings/models", headers=user_token)
assert response.status_code == status.HTTP_200_OK
models = response.json()
ass... | Python | 1 |
b`.
#[allow(clippy::missing_const_for_fn)]
pub fn thumb(mut self, thumb: Thumb) -> Self {
self.thumb = Some(thumb);
self
}
}
impl Serialize for VideoNote {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
let mut map = seria... | Rust | 0 |
import cv2
import numpy as np
import tensorflow as tf
from tensorflow import keras
def get_landmark_model(saved_model="models/pose_model"):
model = keras.models.load_model(saved_model)
return model
def get_square_box(box):
left_x = box[0]
top_y = box[1]
right_x = box[2]
bottom_y = box[3]
... | Python | 1 |
'''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any late... | Python | 1 |
ps!(i64x2[i64; 2] | shr_u[i64x2_uhr_u_test]:
([0, -1], 1) => [0, i64::max_value()]);
#[wasm_bindgen_test]
fn v128_bitwise_logical_ops() {
unsafe {
let a: [u32; 4] = [u32::max_value(), 0, u32::max_value(), 0];
let b: [u32; 4] = [u32::max_value(); 4];
le... | Rust | 0 |
\x1bx\
\xff\xebsb\xde\xe1}\x18\xce\x8f\xc2|S>\x81h\
\xf3\xbd!\xdap:s\xb5\xaf\x98\xce\xcf\x0c\xe7\x8dU\
\xb7y\x7f\x12\xae]\xf4\xc6\xdc\xe7\xe0p\xf3.u\xf3\
b~\x8ae*\xdaw\x16QJpp\x89W@T\
tk\x1a\x11l2{i\x1bm=\x98_.P\x5c\
\xa0|0oLj\xcd8@\x11M\xec\x02\x08\x98\xcd\
\xdaj\xc5\x00.\xd9<Y;\xb3F\xf7&#\xe2\xbd\
\xdc\xef\xd6\x1e\x9... | Python | 1 |
um",
path=Path("anomaly/visa/visa_pipe_fryum_medium"),
group="medium",
),
]
BENCHMARK_CRITERIA = [
Criterion(name="training:epoch", summary="max", compare="<", margin=0.1),
Criterion(name="training:e2e_time", summary="max", compare="<", margin=0.1),
Criterion(name="training:gpu_mem", su... | Python | 1 |
@microtesla: prefix!(micro); "µT", "microtesla", "microteslas";
@nanotesla: prefix!(nano); "nT", "nanotesla", "nanoteslas";
@picotesla: prefix!(pico); "pT", "picotesla", "picoteslas";
@femtotesla: prefix!(femto); "fT", "femtotesla", "femtoteslas";
@attotesla: prefix!(atto); "aT",... | Rust | 0 |
(inline)]
pub use crate::grouped::people_and_body::hand_fingers_open::HAND_WITH_FINGERS_SPLAYED;
// RAISED_BACK_OF_HAND 🤚
#[doc(inline)]
pub use crate::grouped::people_and_body::hand_fingers_open::RAISED_BACK_OF_HAND;
// RAISED_HAND ✋
#[doc(inline)]
pub use crate::grouped::people_and_body::hand_fin... | Rust | 0 |
version(ctx: *mut SSL_CTX) -> c_int {
SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, ptr::null_mut()) as c_int
}
pub unsafe fn SSL_CTX_get_max_proto_version(ctx: *mut SSL_CTX) -> c_int {
SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, ptr::null_mut()) as c_int
... | Rust | 0 |
ments
used to construct each field object.
:param converter:
A converter to generate the fields based on the model properties. If
not set, ``ModelConverter`` is used.
"""
# Extract the fields from the model.
field_dict = model_fields(model, only, exclude, field_args, converter)
... | Python | 1 |
as("ones")
@overload
def zeros(
n: int | Expr,
dtype: PolarsDataType = ...,
*,
eager: Literal[False] = ...,
) -> Expr:
...
@overload
def zeros(
n: int | Expr,
dtype: PolarsDataType = ...,
*,
eager: Literal[True],
) -> Series:
...
@overload
def zeros(
n: int | Expr,
... | Python | 1 |
lass(concat!(stringify!($name), '\0')) {
Some(cls) => cls,
None => panic!("Class with name {} could not be found", stringify!($name)),
}
})
}
#[doc(hidden)]
#[macro_export]
macro_rules! sel_impl {
// Declare a function to hide unsafety, otherwise we can trigger the
// unused... | Rust | 0 |
ytes = fs::read(format!("{}/8.txt", DATA_ROOT)).unwrap();
let hex_strs = String::from_utf8(hex_bytes).unwrap();
let hex_str_vec: Vec<&str> = hex_strs.split('\n').collect();
for hs in hex_str_vec {
let mut map = HashMap::<[u8; 16], u64>::new();
let ct = hex::decode(hs).unwrap();
let ... | Rust | 0 |
"lineno": span.begin.lineno,
"colno": span.begin.colno,
},
"end": {
"lineno": span.end.lineno,
"colno": span.end.colno,
},
},
"execution_count": output.... | Python | 1 |
import os
import re
import pytest
import sh
from binaryornot.check import is_binary
PATTERN = r"{{(\s?cookiecutter)[.](.*?)}}"
RE_OBJ = re.compile(PATTERN)
@pytest.fixture
def context():
return {
"project_name": "my_click_project",
"package_name": "click_project",
"cli_name": "click_proj... | Python | 1 |
'de': 'Pahlavi', 'el': 'Μπουκ Παχλαβί', 'el-polyton': 'Μπουκ Παχλαβί', 'en': 'Book Pahlavi', 'en-Dsrt': '𐐒𐐳𐐿 𐐑𐐪𐑊𐐲𐑂𐐨', 'et': 'pahlavi raamatukiri', 'fa': 'پهلوی کتابی', 'fi': 'kirjapahlavilainen', 'fr': 'pehlevi des livres', 'fy': 'Boek Pahlavi', 'gsw': 'Pahlavi', 'gu': 'બુક પહલવી', 'hi': 'बुक पाहलवी', 'hi-Lat... | Python | 1 |
vec![0x01, 0x02, 0x03] };
assert!(session_channel
.receive_user_data(FlowControlledData { user_data: user_data.clone(), credits: None })
.is_ok());
// Data should be relayed to the client.
match exec.run_until_stalled(&mut data_received_by_client) {
Poll::Re... | Rust | 0 |
d)
db.commit()
return {"success": True, "message": "읽음 처리 완료"}
except HTTPException:
raise
except Exception as e:
print(f"Error in mark_system_announcement_as_read: {str(e)}")
raise HTTPException(status_code=500, detail=f"Internal server error: {str(e)}"... | Python | 1 |
# Problem: Search a 2D Matrix - https://leetcode.com/problems/search-a-2d-matrix/
class Solution:
def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
col_1 = []
for i in matrix:
col_1.append(i[0])
a = bisect_left(col_1,target)
if a < len(col_1) and col_... | Python | 1 |
the field is `PUSHPULL`"]
#[inline(always)]
pub fn is_pushpull(&self) -> bool {
*self == GPIO28OUTCFG_A::PUSHPULL
}
#[doc = "Checks if the value of the field is `OD`"]
#[inline(always)]
pub fn is_od(&self) -> bool {
*self == GPIO28OUTCFG_A::OD
}
#[doc = "Checks if the va... | Rust | 0 |
cortex_m;
extern crate cortex_m_rt;
extern crate panic_halt;
extern crate stm32f4xx_hal as mcu;
extern crate embedded_hal as hal;
use cortex_m_rt::entry;
use defmt_rtt as _;
use mcu::prelude::*;
use mcu::stm32;
use mcu::gpio;
use mcu::gpio::gpiod::{PD13};
use mcu::delay::Delay;
use cortex_m::peripheral::Peripheral... | Rust | 0 |
= Screen::default()?;
screen.clear()?;
screen.write(&[special_char::ALPHA])?;
screen.write(&[special_char::BETA])?;
screen.write(&[special_char::EPSILON])?;
screen.write(&[special_char::MU])?;
screen.write(&[special_char::SIGMA])?;
screen.write(&[special_char::RO])?;
screen.write(&[spe... | Rust | 0 |