text string | label_name string | labels int64 |
|---|---|---|
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
from __future__ import annotations
__all__ = [
"__version__",
"version",
"m... | Python | 1 |
size;
let stride_z = (sdf.header.dim.0 * sdf.header.dim.1) as usize;
let mut voxels = sdf.voxels.clone();
// NOTE: Storing x=0, y=0, z=0 slices as is
// TODO: 1d gradient estimate for the first y scanline
// TODO: 2d gradient estimate for the first z slice
for z in 1..z_dim {
for y in... | Rust | 0 |
e, closed="left")],
"radius": [Interval(Integral, 0, None, closed="left")],
"min_radius": [Interval(Integral, 0, None, closed="left")],
"rings": ["boolean"],
"isomeric": ["boolean"],
"kekulize": ["boolean"],
"variant": [StrOptions({"bit", "count", "raw_hashes"})],
}
... | Python | 1 |
""" Unit tests for selection block. """
import torch
from maze.perception.blocks.general.multi_index_slicing import MultiIndexSlicingBlock
def test_multi_index_slicing_block_multiple_ids():
""" perception test """
mask = torch.rand([2, 1, 4])
in_shape = (mask.shape[-1],)
select_block = MultiIndexSl... | Python | 1 |
0).unwrap();
/// assert_eq!(botan::bcrypt_verify("not even close", &bcrypt), Ok(false));
/// assert_eq!(botan::bcrypt_verify("password", &bcrypt), Ok(true));
/// ```
pub fn bcrypt_verify(pass: &str, hash: &str) -> Result<bool> {
let rc = unsafe { botan_bcrypt_is_valid(make_cstr(pass)?.as_ptr(), make_cstr(hash)?.as_... | Rust | 0 |
# **************************************************************************** #
# #
# ::: :::::::: #
# main.py :+: :+: :+: ... | Python | 1 |
u8 = 0x00;
// BVC
const OPCODE_BVC: u8 = 0x50;
// BVS
const OPCODE_BVS: u8 = 0x70;
// CLC
const OPCODE_CLC: u8 = 0x18;
// CLD
const OPCODE_CLD: u8 = 0xd8;
// CLI
const OPCODE_CLI: u8 = 0x58;
// CLV
const OPCODE_CLV: u8 = 0xb8;
// EOR
const OPCODE_EOR_IMMEDIATE: u8 = 0x49;
const OPCODE_EOR_ZEROPAGE: u8 = 0x45;
c... | Rust | 0 |
json!(val.into_iter().map(|e| e.value).collect::<Vec<_>>());
return self;
}
pub fn source_material_class<'a>(
&'a mut self,
val: CodeableConcept,
) -> &'a mut SubstanceSourceMaterialBuilder {
self.value["sourceMaterialClass"] = json!(val.value);
return self;
}
... | Rust | 0 |
}
impl std::fmt::Display for App {
#[fehler::throws(std::fmt::Error)]
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) {
write!(f, "projects {}", self.cmd)?;
}
}
impl std::fmt::Display for Cmd {
#[fehler::throws(std::fmt::Error)]
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) {
match... | Rust | 0 |
from django import forms
from django.contrib import messages
from django.contrib.messages.views import SuccessMessageMixin
from django.http import HttpResponse, HttpResponseRedirect
from django.template import engines
from django.template.response import TemplateResponse
from django.urls import path, re_path, reverse
f... | Python | 1 |
ache()?
};
send_response_from_cache(&cache, total, SendResponse::Json, icon);
return Ok(());
} else {
filter::dyn_run(
if let Some(ref q) = self.query {
q
} else {
Default::default()
... | Rust | 0 |
deMode = 1002;
pub const PREVIOUS_DIALOG: ModeMode = 1003;
pub const RESET_DIALOG: ModeMode = 1004;
pub type MenuReturn = c_uint;
pub const MENU_LOWER_MASK: MenuReturn = (1 << 16) - 1;
pub const MENU_OK: MenuReturn = 1 << 16;
pub const MENU_CANCEL: MenuReturn = 1 << 17;
pub const MENU_NEXT: MenuReturn = 1 << 18;
pub c... | Rust | 0 |
put_str:str, input_steps:str = '')->str:
""" 直接题目输入的 prompt
Args:
input_str (str): 输入的问题字符串
"""
prompt = f"<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n<|im_start|>user\n{input_str.strip()}\nPlease solve this task step by step and use the format like \"Step 1:\", \"... | Python | 1 |
ew(RefCell::new(VIC {
window_buffer: vec![0; c64::SCREEN_WIDTH * c64::SCREEN_HEIGHT],
last_byte: 0,
raster_cnt: NUM_RASTERLINES - 1,
raster_irq: 0,
curr_cycle: 1,
border_on: false,
is_bad_line: false,
dbg_reg_changed: fals... | Rust | 0 |
.kill();
}
}
}
}
}
pub fn connect(routes: Routes) -> Result<Socket, io::Error> {
let mut last_err = None;
for route in routes {
match connect_impl(&route) {
Ok(s) => {
return Ok(s);
}
Err(e) if e.kind() == io::E... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
import os
ROWS, COLS = 800, 800 # 2K resolution
MAX_ITER = 1500 # Установлено фиксированное количество итераций
def julia(c):
def mandelbrot(z):
for n in range(MAX_ITER):
if abs(z) > 4:
return n
z = z ** 2 + c
... | Python | 1 |
"""
Write a python function to find the length of the longest sublists.
assert Find_Max_Length([[1],[1,4],[5,6,7,8]]) == 4
"""
def Find_Max_Length(lst):
"""
:param lst: list of lists
:return: int
"""
if not lst:
return 0
max_length = 1
for i in range(1,len(lst)):
for j in ra... | Python | 1 |
println!("error: second argument '{}' file already exists", commands[2]);
continue;
} else if from_file.to_string_lossy().ends_with(SYSTEM_FILES) {
println!("error: Can not copy system file '{}'", commands[1]);
continue;
}
match fs::copy(from_file, to_file) {
Ok(_) => println!("Successfully ... | Rust | 0 |
Extracted positional embeddings according to relative positions.
"""
max_rel_dist = int(2 * max(q_size, k_size) - 1)
# Interpolate rel pos if needed.
if rel_pos.shape[0] != max_rel_dist:
# Interpolate rel pos.
rel_pos_resized = F.interpolate(
rel_pos.reshape(1, rel_po... | Python | 1 |
raph):
raise GenerateGraphvizError(
"Parameter 'graph' should be of type labgraph.Graph"
)
if not output_file:
raise GenerateGraphvizError(
"Parameter 'output_file' cannot be null or empty string."
)
filename, format = output_file.split('.')
# Local ... | Python | 1 |
pr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum _bindgen_ty_10 {
nes_ntsc_640_in_width = 271,
}
pub const nes_ntsc_640_out_width: _bindgen_ty_11 = _bindgen_ty_11::nes_ntsc_640_out_width;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum _bindgen_ty_11 {
nes_ntsc_640_o... | Rust | 0 |
Tree::TopTreeArity::to_usize() > 0 || Tree::SubTreeArity::to_usize() > 0,
"Cannot have a sub/top tree without more than 1 config"
);
if Tree::TopTreeArity::to_usize() > 0 {
ensure!(
Tree::SubTreeArity::to_usize() > 0,
"Invalid top arity specified without sub arity"
... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import scrapy
from stackoverflow.spiders.items import StackoverflowItem
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger('monitor')
logger.setLevel(logging.INFO)
fh = logging.FileHandle... | Python | 1 |
ama yapmak için sorgu vektörü oluşturuyoruz
# Gerçek uygulamada bu kullanıcının sorusunun embedding'i olur
query_vector = np.random.random(dimension).astype('float32').tolist()
# Arama işleminin ne kadar sürdüğünü ölçmek için başlangıç zamanını kaydet
start_time = time.time()
# Sorgu vektörüne en yakın 5 vektörü bul
... | Python | 1 |
#!/usr/bin/python
from os import environ, path
from pocketsphinx.pocketsphinx import *
from sphinxbase.sphinxbase import *
MODELDIR = "../../../model"
DATADIR = "../../../test/data"
config = Decoder.default_config()
config.set_string('-hmm', path.join(MODELDIR, 'en-us/en-us'))
config.set_string('-lm', path.join(MOD... | Python | 1 |
Vec<u8>>>().to_string(),
});
map_type!(m, String, "text");
map_type!(m, &std::ffi::CStr, "cstring");
map_type!(m, &crate::cstr_core::CStr, "cstring");
map_type!(m, (), "void");
map_type!(m, i8, "\"char\"");
map_type!(m, i16, "smallint");
map_type!(m, i32, "integer");
map_type!(m, i6... | Rust | 0 |
(&mut rng) as f64 / 16.0;
black_box([a, b, a + (b - a) * fac])
})
.collect::<Vec<_>>();
c.bench_function("orient_2d_collinear", move |b| {
b.iter(|| {
data.iter().for_each(|[a, b, c]| {
orient_2d(*a, *b, *c);
})
})
});
}
crite... | Rust | 0 |
ors.BOLD}--check-sfv false{Colors.RESET} to disable)")
else:
print(f"{Colors.BLUE}📋 SFV Checking:{Colors.RESET} {Colors.YELLOW}Disabled{Colors.RESET}")
print(f"{Colors.YELLOW}🗂️ Delete '-1' Duplicates:{Colors.RESET} {'Enabled' if delete_dash_one_enabled else 'Disabled'} (use --delete-dash-one false t... | Python | 1 |
].shape.to_tvec()).as_ref(),
)?))
}
fn axes_info(&self, _model: &TypedModel, node: &TypedNode) -> TractResult<AxesInfo> {
let mut i = 0;
let mut axes = tvec!();
for out in 0..node.outputs[0].fact.shape.rank() {
if !self.axes.contains(&out) {
axes.push... | Rust | 0 |
{
pub fn alt_IBlip_SetSprite(_instance: *mut alt_IBlip, sprite: ::std::os::raw::c_ushort);
}
extern "C" {
pub fn alt_IBlip_SetColor(_instance: *mut alt_IBlip, color: ::std::os::raw::c_uchar);
}
extern "C" {
pub fn alt_IBlip_SetRoute(_instance: *mut alt_IBlip, state: bool);
}
extern "C" {
pub fn alt_IBli... | Rust | 0 |
th(AuthorizationType::Trust)
.with_members(vec!["node_1".to_string(), "node_2".to_string()])
.with_roster(vec![service_definition_1])
.with_persistence(PersistenceType::Any)
.with_durability(DurabilityType::NoDurability)
.with_routes(RouteType::Any)
... | Rust | 0 |
pass
for i in reversed(range(self.mcsLSyncCoreListLayout.count())):
try:
self.mcsLSyncCoreListLayout.itemAt(i).widget().setParent(None)
except AttributeError:
pass
try:
self.mcsLSyncCor... | Python | 1 |
not load the GID [%s] from the circuit [%s]' %
input_options.morphology.blue_config, str(input_options.morphology.gid))
exit(0)
# If the input is a morphology file, then use the parser to load it directly
elif arguments.input == 'file':
# Read the morphology file... | Python | 1 |
# Adjust the import as necessary
import os
import re
import requests
from langchain.chains.summarize import load_summarize_chain
from langchain.docstore.document import Document
from langchain_community.document_loaders.llmsherpa import LLMSherpaFileLoader
from langchain_community.document_loaders import WebBaseLoader
... | Python | 1 |
_file_path):
svg = SVG.parse(svg_file_path)
all_paths_points = [] # Store all paths points, with each path's points as a sublist
for element in svg.elements():
if isinstance(element, Path):
element = Path(element) # Ensure it's a Path object, applying any transformations
e... | Python | 1 |
.into_diagnostic()?) {
let relate_to_config = get_vcs_relate_to(config)?.map(RelateTo::new);
Ok(relate_to_config)
} else {
Ok(None)
}
}
None => Ok(None),
}
}
#[cfg(test)]
mod tests_able_to_load_config_from_git {
use std::{... | Rust | 0 |
t - $day:tt , $($rest:tt)*) => {
$crate::toml_internal!(@arraydatetime $root ($yr - $mo - $day) $($rest)*);
};
// Parse local time `00:32:00.999999`.
(@array $root:ident $hr:tt : $min:tt : $sec:tt . $frac:tt , $($rest:tt)*) => {
$crate::toml_internal!(@arraydatetime $root ($hr : $min : $sec... | Rust | 0 |
: Session = None, user_id: int = None) -> CoachResult:
"""
Orchestrates the complete fitness and diet planning pipeline.
This is the main service function that:
1. Generates a personalized 7-day workout plan and diet plan using the coach agent
2. Estimates days to reach weight goal using the estima... | Python | 1 |
'''Copyright 2018 Province of British Columbia
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | Python | 1 |
l::sync::Lazy<&'static str> =
once_cell::sync::Lazy::new(|| unsafe {
CStr::from_ptr(ffi::NM_IP_ROUTE_ATTRIBUTE_INITRWND)
.to_str()
.unwrap()
});
#[doc(alias = "NM_IP_ROUTE_ATTRIBUTE_LOCK_CWND")]
pub static IP_ROUTE_ATTRIBUTE_LOCK_CWND: once_cell::sync::Lazy<&'static str> =
on... | Rust | 0 |
# WAP to ask the user to enter names of their 3 favorite movies & store them in a list.
# movies=[]
# movies.append(input("Enter movie1: "))
# movies.append(input("Enter movie2: "))
# movies.append(input("Enter movie3: "))
# print(movies)
#********************************************************************************... | Python | 1 |
omplexfloating]]:
"""Build a Morse potential.
The morse potential is given by
.. math::
V(x) = D_e (e^{-2(x - x_e)/a} - 2 e^{-(x - x_e)/a})
where :math:`D_e` is the depth, :math:`x_e` is the origin, and :math:`a`
is the height parameter.
"""
axis %= metadata.n_dim
if not all(
... | Python | 1 |
_tracing_root(tracing_honeycomb::TraceId::new(), None)
.unwrap();
log_error!(
"Error while handling reaction_remove event",
reaction_remove::reaction_remove(ctx, event).await
);
}
}
async fn unmute(
ctx: &client::Context,
config: &Arc<Config>,
db: &Ar... | Rust | 0 |
C" {
fn DMA0();
fn DMA1();
fn DMA2();
fn DMA3();
fn DMA4();
fn DMA5();
fn DMA6();
fn DMA7();
fn DMA8();
fn DMA9();
fn DMA10();
fn DMA11();
fn DMA12();
fn DMA13();
fn DMA14();
fn DMA15();
fn DMA_ERROR();
fn CTI0_ERROR();
fn CTI1_ERROR();
fn ... | Rust | 0 |
sub(free_balance);
if missing_funds > 0 {
// If there are not enough funds, then the user can send the missing TEER to the enclave address and start again.
println!(
"Enclave account: {:}, missing funds {}",
accountid.to_ss58check(),
missing_funds
);
return Err(Error::Custom(
"Enclave doe... | Rust | 0 |
EEP2_W<'a> {
w: &'a mut W,
}
impl<'a> KEEP2_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[d... | Rust | 0 |
from .die import Die
from .utils import i_just_throw_an_exception
class GameRunner:
def __init__(self):
self.dice = Die.create_dice(5)
self.reset()
def reset(self):
self.round = 1
self.wins = 0
self.loses = 0
@property
def answer(self):
total = 0
... | Python | 1 |
# -*- coding: utf-8 -*-
import os
from provy.core import Role
from provy.more.debian import UserRole, TornadoRole, SupervisorRole, NginxRole
class FrontEnd(Role):
def provision(self):
with self.using(UserRole) as role:
role.ensure_user('frontend', identified_by='pass', is_admin=True)
... | Python | 1 |
import os
import subprocess
HTML_FILE = "how_to_use.html"
PORT = 8080
print("\n=== Tinyevil_url HTML Server with Cloudflared ===\n")
# Step 1: Check if HTML file exists
if not os.path.exists(HTML_FILE):
print(f"[!] {HTML_FILE} not found. Place it in the same folder as this script.")
exit(1)
# Step 2: Instru... | Python | 1 |
StagedFiles::new(hashmap!("pf_in_a" => input_a_info, "pf_in_b" => input_b_info));
let output_files = StagedFiles::new(hashmap!("pf_out" => output_info));
let runtime = Box::new(RawIoRuntime::new(input_files, output_files));
let function = WAMicroRuntime::default();
let summary = funct... | Rust | 0 |
async fn index() -> Option<NamedFile> {
return NamedFile::open(Path::new("./Cello/build/index.html")).await.ok()
}
#[get("/<_>")]
async fn any_index() -> Option<NamedFile> {
return NamedFile::open(Path::new("./Cello/build/index.html")).await.ok()
}
//TODO
#[get("/boards/<board_id>")]
async fn get_board(board_... | Rust | 0 |
test dataset
n_samples, n_features, n_targets = 8, 3, 2
X = backend.asarray(backend.randn(n_samples, n_features), backend.float64)
y = backend.asarray(backend.randn(n_samples, n_targets), backend.float64)
# Create sample weights
sample_weight = backend.asarray([1.0, 2.0, 0.5, 1.5, 2.5, 1.0, 0.... | Python | 1 |
_machine = state_machine.next().await.unwrap();
let state_after_sum = state_machine.as_ref().clone();
let events_after_sum = EventSnapshot::from(&event_subscriber);
assert_after_phase_failure(
&state_before_sum,
&events_before_sum,
&state_after_sum,
... | Rust | 0 |
Iter {
dx: f32,
dy: f32,
x: i32,
y: i32,
error: f32,
end_x: i32,
is_steep: bool,
y_step: i32,
}
impl BresenhamLineIter {
pub fn new(start: (f32, f32), end: (f32, f32)) -> BresenhamLineIter {
let (mut x0, mut y0) = (start.0, start.1);
let (mut x1, mut y1) = (end.0, en... | Rust | 0 |
import uvicorn
from src.app import app
if __name__ == "__main__":
uvicorn.run("src.app:app", host="0.0.0.0", port=8000)
| Python | 1 |
import sys
import kclvm.kcl.error as kcl_error
import os
cwd = os.path.dirname(os.path.realpath(__file__))
kcl_error.print_kcl_error_message(
kcl_error.get_exception(err_type=kcl_error.ErrType.TypeError_Compile_TYPE,
file_msgs=[
kcl_error.ErrFileMsg(
... | Python | 1 |
/10</plugin_publication_date>
<cvss_vector>CVSS2#AV:N/AC:M/Au:N/C:C/I:C/A:C</cvss_vector>
<synopsis>Theremotehostcontainsawebbrowserthatallowsarbitrarycodeexecution.</synopsis>
<patch_publication_date>2010/09/09</patch_publication_date>
<see_also>http://www.opera.com/docs/changelogs/windows/1062/</see_a... | Rust | 0 |
n(),
hash_functions: self.k_num,
}
}
pub fn how_full(&self) -> f64 {
self.bitmap.how_full()
}
}
pub struct BloomJournal {
pub hash_functions: u32,
pub entries: Vec<(usize, u64)>,
}
#[test]
fn bloom_test_set() {
let mut bloom = Bloom::new(10, 80);
let key: &Vec<... | Rust | 0 |
;
let path_str = CStr::from_ptr(lib);
let path = Path::new(path_str.to_str().unwrap());
let boxed = Box::new(Xsim::new(&path));
Box::into_raw(boxed)
}
/// # Safety
///
/// This function writes to a register, should be called after allocating
#[no_mangle]
pub unsafe extern "C" fn write_reg(handle: *mut ... | Rust | 0 |
import time
import random
# Tulis kode mu di bawah
print("PERMAINAN BATU GUNTING KERTAS")
SkorAnda = 0
SkorKomputer = 0
while True:
pilihan = input("Masukkan pilihan kamu: (Batu, Gunting, Kertas) ")
komputer = random.randint(1,3)
if komputer == 1:
komputer = "Batu"
elif komputer == 2:
k... | Python | 1 |
ve |scope| {
handle_dir(scope, ctx, &path, file_id);
});
continue;
}
ctx.push_diagnostic(Diagnostic::error(file_id, "IO", "unhandled file type"));
}
});
let duration = start.elapsed();
let count = formatted.load(Ordering::... | Rust | 0 |
import os, shutil
# remove write permission to the 'MONTE_RUN' directory
os.chmod("MONTE_IO_FAIL", 0o555)
monte_carlo.mc_master.activate("IO_FAIL")
monte_carlo.mc_master.generate_meta_data = True
monte_carlo.mc_master.set_num_runs(1)
print('****************************************************************************... | Python | 1 |
pub length: u16,
pub grab_window: xcb_window_t,
pub modifiers: u16,
pub key: xcb_keycode_t,
pub pointer_mode: u8,
pub keyboard_mode: u8,
pub pad0: [u8; 3],
}
impl Default for xcb_grab_key_request_t {
fn default() -> Self {
unsafe { std::mem::MaybeUninit::zeroed().assume_init() }
... | Rust | 0 |
rchitecture."""
newcmd = cmd[:]
fid, filename = tempfile.mkstemp(suffix=".f")
try:
d = os.path.dirname(filename)
output = os.path.splitext(filename)[0] + ".o"
try:
newcmd.extend(["-arch", arch, "-c", filename])
p = Popen(newcmd, stderr=STDOUT, stdout=PIPE, cwd... | Python | 1 |
Tree.html#method.do_refit). This function should
/// ideally not be called more than once per frame.
///
/// The main heuristic used for insertion and tree rotation, is surface area of the bounding volume.
///
/// Updating of values in the tree, can either be performed by using the
/// [`values`](struct.DynamicBounding... | Rust | 0 |
review: bool) {
if show_preview {
if let Some(ref p) = self.preview {
g.redraw(p);
}
}
if g.canvas.get_cursor_in_map_space().is_some() {
if let Some(cursor) = match self.mode {
Mode::Pan => None,
Mode::Paint => S... | Rust | 0 |
lar_bits).map(Scalar)
}
fn random_nonzero_scalar<R: RngCore + CryptoRng>(rng: &mut R) -> Self::Scalar {
Scalar(ProjectivePoint::random_nonzero_scalar(rng))
}
fn scalar_as_bytes(scalar: Self::Scalar) -> GenericArray<u8, Self::ScalarLen> {
ProjectivePoint::scalar_as_bytes(scalar.0)
}
fn scalar_invert(scalar:... | Rust | 0 |
sumerWatcherSensor):
"""
Watches for the progress of dbt model execution, run by the producer task (DbtProducerWatcherOperator).
"""
template_fields: tuple[str] = DbtConsumerWatcherSensor.template_fields + DbtRunMixin.template_fields # type: ignore[operator]
def __init__(self, *args: Any, **kwarg... | Python | 1 |
authority = Some(authority.clone());
uri.scheme = Some(scheme.clone());
// Update the the request URI
head.uri = http::Uri::from_parts(uri).expect("valid uri");
Request::from_parts(head, body)
})
}
/// Set the URI to use as the origin for all requests.
... | Rust | 0 |
Ƀ ,qдPGSq{RWMểgӽGkXɈ:ہ!um0N@Co \+oW*BXYM©ZႇtɰtqWZ]>]kkwjw_^nX]nN%?Vqߨ՞1ݤ`XG*RѫU!_
fSrA`>wZ `nᒳQ3d+RI@<D9DX9
e+{ƕq54v{P0.j>8j^%yJoATkV|2iqǡnp""*KW3n"EMVKǓbAYZ7
YGӪW$ٮႴj̅aVL_(.54fws."yro53A?PK (XjcXU @ game/controllers/__pycache__/interact_controller.... | Python | 1 |
///
/// # Examples
///
/// ```no_run
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let mut plug = tplink::Plug::new([192, 168, 1, 100]);
/// let is_on = plug.is_on()?;
/// # Ok(())
/// # }
/// ```
pub fn is_on(&mut self) -> Result<bool> {
self.devic... | Rust | 0 |
"""
缺点:主窗口的任意项在每次编辑后完成后不可以立即再次编辑该项,需要重启项目 (已解决)
"""
import tkinter as tk
import json
from tkinter import ttk
from tkinter import messagebox
PATH = "configs/user.json"
with open(PATH, "r", encoding="utf-8") as file:
data = json.load(file)
combobox_lockers_values = []
combobox_count_tasks_values = []
combobox_t... | Python | 1 |
t('--md-output', action='store_true', help='Show table output in markdown format')
parser.add_argument('--only-diffs', action='store_true', help='Only show stack info when it differs between the input files')
args = parser.parse_args()
parsers = {'dumpbin': parse_dumpbin_assembly, 'objdump' : parse_objdump... | Python | 1 |
)
let range_slice: *const _ = &self[start..end];
// Calling `set_len` creates a fresh and thus unique mutable references, making all
// older aliases we created invalid. So we cannot call that function.
self.len = start as Size;
unsafe {
Drain {
tail... | Rust | 0 |
.push((
(2. * knots[0].x + knots[1].x) / 3.,
(2. * knots[0].y + knots[1].y) / 3.,
));
// P2 = 2P1 – P0
second_control_point.push((
2. * first_control_point[0].0 - knots[0].x,
2. * first_control_point[0].1 - knots[0].y,
));
} else {
... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import hr_contract_sign_document_wizard
from . import refuse_offer_wizard
| Python | 1 |
ret[obj_label].append({"T_wo": T_wo.matrix(),
"T_wc": T_wc.matrix(),
"T_co": T_co.matrix(),
"id": idx,
"Q": Q,
... | Python | 1 |
' or 'cuda').
Returns:
- The percentage of valid counterfactuals.
"""
assert isinstance(x, pd.DataFrame), 'This validity metric can be used only if input is a row of a pandas DataFrame at the moment.'
if not isinstance(y, pd.DataFrame):
y = pd.DataFrame(y, columns=x.columns.tolist())
e... | Python | 1 |
ge(image)
image_embed = model.vision_proj(image_feat)
image_embed = F.normalize(image_embed, dim=-1)
vit_feats.append(vit_feat.cpu())
image_embeds.append(image_embed)
vit_feats = torch.cat(vit_feats, dim=0)
image_embeds = torch.cat(image_embeds, dim=0)
sims_matrix = []
... | Python | 1 |
NT
// indent after open brace if siblings are indented
(
TomlKind::OpenBrace,
Box::new(indent_after_open_brace) as RuleFn,
),
// indent after comma if siblings are indented
(TomlKind::Comma, Box::new(indent_after_comma) as RuleFn),
]
}
<reponame>mtn/ip... | Rust | 0 |
Compact representation of an atom, to use in array cells
pub trait RAtomMem: Clone + Copy + Debug + Num + RUninit + NumCast {}
impl RAtomMem for i8 {}
impl RAtomMem for i16 {}
impl RAtomMem for i32 {}
impl RAtomMem for i64 {}
pub trait RAtomCell: Debug {
fn get(self: &Self, ty: AtomTy) -> Option<Atom>;
fn... | Rust | 0 |
import time
pwd=input("Enter your password: ") #any password u want to set
def IInd_func():
count1=0
for j in range(5):
a=0
count=0
user_pwd = input("Enter remember password: ") #password you remember
for i in range(len(pwd)):
if user_pwd[i] == pwd[a]: #comparing remembered pw... | Python | 1 |
entry_768, item_766,
)?;
}
list_767.finish();
}
#[allow(unused_mut)]
let mut scope_769 = writer.prefix("StartupAction");
if let Some(var_770) = &input.startup_action {
scope_769.string(var_770);
}
Ok(())
}
#[allow(unused_mut)]
pub fn serializ... | Rust | 0 |
::Key::Up => egui::Key::ArrowUp,
glfw::Key::Right => egui::Key::ArrowRight,
glfw::Key::Down => egui::Key::ArrowDown,
glfw::Key::Escape => egui::Key::Escape,
glfw::Key::Tab => egui::Key::Tab,
glfw::Key::Backspace => egui::Key::Backspace,
glfw::Key::Space ... | Rust | 0 |
[row][col][2]
if temp_field[row][col][2] == 0:
open_cascade(field, row, col)
return temp_field
def flag_cell(event, field, row, col):
print("flag!")
temp_field = field
if temp_field[row][col][3] != Constants.cellTypes["open"]:
if temp_field[row][col][0] == Constants.selecti... | Python | 1 |
(colormap, sz): (Colormap, usize) = <Colormap>::from_bytes(&bytes[index..])?;
index += sz;
Some((
Pictforminfo {
id: id,
ty: ty,
depth: depth,
direct: direct,
colormap: colormap,
},
index... | Rust | 0 |
l = re.sub(email_pattern, r'<font color="green">\g<0></font>', email)
context_with_email = message.replace(email, highlighted_email)
story.append(Paragraph(context_with_email, normal_style))
# Add URL end-note citation with size 6 font and bold "Source:"
... | Python | 1 |
import sys
sys.path.append("airflow_pipeline")
from airflow.models import BaseOperator, DAG, TaskInstance
from hook.brewery_hook import BreweryHook
import json
from datetime import datetime
from os.path import join
from pathlib import Path
class BreweryOperator(BaseOperator):
template_fields = ["file_path"]
... | Python | 1 |
_err());
assert!(linker
.func_wrap("f", "", || -> Result<(), Trap> { loop {} })
.is_err());
// globals
let ty = GlobalType::new(ValType::I32, Mutability::Const);
let global = Global::new(&mut store, ty, Val::I32(0))?;
linker.define("g", "1", global.clone())?;
assert!(linker.defi... | Rust | 0 |
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-Licens... | Python | 1 |
te, MIDIClientDispose, MIDINotification,
MIDIPortRef, MIDIOutputPortCreate, MIDIEndpointRef, MIDISourceCreate
};
use coremidi_sys_ext::{
MIDIPacketList, MIDIInputPortCreate, MIDIDestinationCreate
};
use std::ops::Deref;
use std::mem;
use std::ptr;
use Object;
use Client;
use Port;
use OutputPort;
use InputPo... | Rust | 0 |
?
.map(|message_id_str| MessageId::from_str(&message_id_str))
.transpose()
.map_err(identity_core::diff::Error::merge)?
.unwrap_or(self.previous_message_id);
let properties: Object = diff
.properties
.map(|value| self.properties.merge(value))
.transpose()?
.unwrap_or... | Rust | 0 |
import os
def check(cmd, mf):
m = mf.findNode("pylsp")
if m is None or m.filename is None:
return None
includes = ["pylsp.__main__", "pylsp.python_lsp"]
root_dir = m.packagepath[0]
files = os.scandir(os.path.join(root_dir, "plugins"))
for file in files:
if file.name.endswith(... | Python | 1 |
XE]
[INSTALLED] package `foo v0.0.1 ([CWD])` (executable `example1[EXE]`)
[WARNING] be sure to add [..]
",
)
.run();
}
#[cargo_test]
fn install_bin() {
full_project()
.cargo("install --path . --bin 'bi*1'")
.with_stderr(
"\
[INSTALLING] foo v0.0.1 ([CWD])
[COMPILING] foo... | Rust | 0 |
limit: Some(2),
..SearchQuery::everything(SearchDirection::Forward)
})?;
search_returned(&*history, res, vec![1, 4])?;
Ok(())
}
}
use ash::version::DeviceV1_0;
use ash::vk;
use thiserror::Error;
use crate::backend;
use backend::command::{CommandBuffer, CommandBuf... | Rust | 0 |
le_name='newmodulename', provider_name='newprovidername')
# Update name of original and new namespace
test_namespace.update_name('updatedoriginalnamespacename')
new_namespace_obj.update_name('updatedmovednamespacename')
# Call redirect, ensuring original name is passed to a... | Python | 1 |
# Copyright (C) 2015-2023 Swift Navigation Inc.
# Contact: https://support.swiftnav.com
#
# This source is subject to the license found in the file 'LICENSE' which must
# be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
... | Python | 1 |
.. code-block:: python
# Create or update folder
app.update_folder(folder_id, title="New folder", included_chats="me")
"""
title_text, title_entities = (await utils.parse_text_entities(self, title, parse_mode, title_entities)).values()
if not isinst... | Python | 1 |
html.escape(fst_name),
html.escape(user.reason),
time,
)
update.effective_message.reply_text(res, parse_mode="html")
__help__ = """
• `/afk <reason>`*:* mark yourself as AFK (away from keyboard).
• `brb <reason>`*:* same as the afk command - but ... | Python | 1 |
"""
图像特征提取模块:负责加载预训练模型并提取图像特征
"""
import os
import sys
import time
from typing import Tuple, Union, Any, Dict, Optional, Callable
import numpy as np
import torch
import torchvision.transforms as transforms
from PIL import Image, UnidentifiedImageError
# CLIP模型相关
try:
from transformers import CLIPProcessor, CLIPMo... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.