text string | label_name string | labels int64 |
|---|---|---|
ng JSON payload:
{
"email": "<user_email>",
"message": "Password updated"
}
Returns:
- Response: A JSON response with the user email and a message or a
403 HTTP status.
"""
email = request.form.get("email")
reset_token = request.form.get("reset_token")
new_password =... | Python | 1 |
oot.winfo_screenheight()
# 计算窗口的 x 和 y 坐标
x = screen_width - window_width - 10
y = 0
# 设置窗口的几何大小和位置
root.geometry(f"{window_width}x{window_height}+{x}+{y}")
# 第一排############################################################
# 创建输入框用于显示文件路径,设置宽度为 300 像素
path_entry = tk.Entry(root)
p... | Python | 1 |
_sep.peek().is_some() {
let mut list:RVec<WhichPlugin>=vec![first].into();
for s in comma_sep.filter(|s| !s.is_empty() ) {
list.push( Self::parse_single(s,full_str)? );
}
WhichPlugin::Many(list)
}else{
first
}.piped(Ok)
}
}
... | Rust | 0 |
for mi in &mut minv {
mi.swap(indxr[j], indxc[j])
}
}
}
Matrix4x4 { m: minv }
}
}
impl fmt::Debug for Matrix4x4 {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
if f.alternate() {
write!(
f,
... | Rust | 0 |
# Copyright (c) Alibaba, Inc. and its affiliates.
import os
from typing import List
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
def infer_batch(engine: 'InferEngine', infer_requests: List['InferRequest']):
resp_list = engine.infer(infer_requests)
print(f'messages0: {infer_requests[0].messages}')
print(f'res... | Python | 1 |
import os
import subprocess
def privilege_escalation():
print("[*] Attempting privilege escalation...")
# Example: Check for sudo permissions and attempt to escalate privileges
sudo_check = subprocess.run(['sudo', '-l'], capture_output=True, text=True)
if 'NOPASSWD' in sudo_check.stdout:
print(... | Python | 1 |
on = self.zerolon if zerolon is None else zerolon
minlat = self.minlat if minlat is None else minlat
maxlat = self.maxlat if maxlat is None else maxlat
zerolat = self.zerolat if zerolat is None else zerolat
source_object = self.source_object if source_object is None else source_object
... | Python | 1 |
from django.contrib.auth import get_user_model
from django.core.mail import send_mail
from celery import shared_task
from django_celery_project import settings
@shared_task(bind=True)
def send_mail_func(self):
users = get_user_model().objects.all()
for user in users:
subject = "Hi! Celery Testing"
... | Python | 1 |
r y in 1..(h - 3) {
rotate!(prv3 <- prv2 <- prv1 <- curr <- nxt1 <- nxt2 <- nxt3);
rdr.read_line(r, &mut nxt3)?;
let row = dst.borrow_row_u16_mut(y);
apply_kernel_row!(u16; row, prv3, prv2, prv1, curr, nxt1, nxt2, nxt3, cfa, w);
cfa = cfa.next_y();
}
{ // y = h - 3.
... | Rust | 0 |
^2 constraints if `is_other_constant == false`, 0 constraints otherwise
fn mul_without_prereduce_for_generic_field<CS: ConstraintSystemAbstract<ConstraintF>>(
&self,
mut cs: CS,
other: &Self,
is_other_constant: bool,
) -> Result<NonNativeFieldMulResultGadget<SimulationF, Constrai... | Rust | 0 |
() {
let sim_time = 50.0;
let dt = 0.1;
let mut time = 0.;
let mut q = nalgebra::Matrix4::<f64>::identity();
q[(0, 0)] = (0.1_f64).powi(2i32);
q[(1, 1)] = (1.0/180.0 * std::f64::consts::PI).powi(2i32);
q[(2, 2)] = (0.1_f64).powi(2i32);
q[(3, 3)] = (0.1_f64).powi(2i32);
let r = nalge... | Rust | 0 |
('user_info')),
'token_expires': session.get('spotify_token_expires', 0)
}
})
@app.route('/debug-spotify-token')
def debug_spotify_token():
"""Debug endpoint to test current Spotify token with various endpoints"""
access_token = session.get('spotify_token')
if not access_token:
... | Python | 1 |
dx_dot_pair_name.clone()), Ok(PRICE_ENTRY_1));
let price_data = PriceOracle::<T>::price_data_ten();
let bucket_queue = price_data.iter().find(|&x| x.0 == hdx_dot_pair_name).unwrap().1;
assert_eq!(bucket_queue.get_last(), PriceInfo{ avg_price: Price::zero(), volume: 0});
}: { PriceOracle::<... | Rust | 0 |
from __future__ import annotations
from datetime import datetime
from enum import Enum
from pathlib import Path
from pydantic import BaseModel, Field
class AudioSegmentStatus(str, Enum):
PENDING = "pending"
IN_PROGRESS = "in_progress"
COMPLETED = "completed"
ERROR = "error"
SKIPPED = "skipped"
... | Python | 1 |
for textin in textin_array]]).transpose()
hws_bar = mean(hws)
o_hws = std_dev(hws, hws_bar)
# 计算曲线顶点与输入字节之间的协方差
correlation = cov(trace, trace_mean, hws, hws_bar)
# 计算CPA相关性
cpaoutput = correlation / (o_hws * trace_omega)
maxcpa[kguess]... | Python | 1 |
ht_pose = np.eye(4)
light_pose[:3, 3] = [0, -1, 1]
scene.add(light, pose=light_pose.copy())
light_pose[:3, 3] = [0, 1, 1]
scene.add(light, pose=light_pose.copy())
light_pose[:3, 3] = [1, 1, 2]
scene.add(light, pose=light_pose.copy())
scene.add(camera, pose=cam_pos... | Python | 1 |
1.public_key
);
assert_eq!(
peer_storage.find_by_public_key(&peer2.public_key).unwrap().public_key,
peer2.public_key
);
assert!(peer_storage.find_by_public_key(&peer3.public_key).is_err());
assert_eq!(
peer_storage.find_by_node_id(&peer1.node_... | Rust | 0 |
if reduce_step_idx < DISPATCH_BUFFER_OFFSETS.len() {
cpass.dispatch_indirect(
&self.dotproduct_reduce_result_and_dispatch_buffer,
DISPATCH_BUFFER_OFFSETS[reduce_step_idx],
)
} else {
cpass.dispatch(
... | Rust | 0 |
B2CLKW::CTMRA4 => 23,
TMRB2CLKW::CTMRB4 => 24,
TMRB2CLKW::CTMRB0 => 25,
TMRB2CLKW::CTMRB1 => 26,
TMRB2CLKW::CTMRB5 => 27,
TMRB2CLKW::CTMRB6 => 28,
TMRB2CLKW::BUCKBLE => 29,
TMRB2CLKW::BUCKB => 30,
TMRB2CLKW::BUCKA => 31,
... | Rust | 0 |
Self::Int(zast::Int::from_u64(ctx, u))
}
pub fn as_z3_bool(&self) -> &Bool<'ctx> {
match self {
Value::Bool(b) => b,
_ => panic!(),
}
}
pub fn get_context(&self) -> &'ctx Context {
match self {
Self::Bool(x) => x.get_ctx(),
Self::... | Rust | 0 |
_access_token"].to_string();
let org_access_token =
serde_json::from_str::<String>(&org_access_token_json).expect("organzation access token");
let app_id_json = config_vals["app_id"].to_string();
let app_id = serde_json::from_str::<String>(&app_id_json).expect("workgroup id");
let baseline: Ap... | Rust | 0 |
import pytest
@pytest.fixture()
def config_dict():
"""Sample config dict."""
d = {
"title": "TOML Example",
"owner": {
"name": "Tom Preston-Werner",
"dob": "1979-05-27",
},
"database": {
"server": "192.168.1.1",
"ports": [8001, 8... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009 - 2010 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Eric4 Icon Editor
This is the main Python script that performs the necessary initialization
of the icon editor and starts the Qt event loop. This is a standalone version
of the integrated icon ... | Python | 1 |
&Element,
traversed: &mut Vec<Node>,
is_albt: bool,
) -> Result<String, JsValue> {
if !element.id().is_empty() {
let labels = window()
.unwrap()
.document()
.unwrap()
.query_selector_all(&format!("label[for={}]", element.id()))?;
let mut name ... | Rust | 0 |
*(*map).glyphIndexArray.offset(i as isize) = u16::get(handle);
}
map
}
unsafe fn release_cmap2(map: *mut cmap2) {
if !map.is_null() {
free((*map).subHeaders as *mut libc::c_void);
free((*map).glyphIndexArray as *mut libc::c_void);
free(map as *mut libc::c_void);
};
}
unsafe fn... | Rust | 0 |
return_alignment_history=True)
elif decode_type == constants.GREEDY or decode_width <= 1:
sampled_ids, _, sampled_length, log_probs, alignment = self.decoder.dynamic_decode(
self.tgt_emb,
start_tokens,
... | Python | 1 |
sites_cart
def select_n_in_biggest_cluster(sites_cart,
dist_min = None,
n = None,
dist_min_ratio = 1.,
dist_min_ratio_min = 0.5,
minimize_density_of_points = None):
'''
Select n of sites_cart, taking those near biggest cluster if possible
If minimize_density_of_points, remove those with the mo... | Python | 1 |
import os
import cv2
import numpy as np
import torch
from torch.utils.data import Dataset
from tqdm import tqdm
class InferenceDataset(Dataset):
def __init__(self, frames, shape=(1024, 768), mean=(123.5, 116.5, 103.5), std=(58.5, 57.0, 57.5)):
self.frames = frames
self.shape = shape
self.... | Python | 1 |
}
// Generated as internal constructor for term xor_mem.
pub fn constructor_xor_mem<C: Context>(
ctx: &mut C,
arg0: Type,
arg1: Reg,
arg2: &MemArg,
) -> Option<Reg> {
let pattern0_0 = arg0;
let pattern1_0 = arg1;
let pattern2_0 = arg2;
// Rule at src/isa/s390x/inst.isle line 2748.
... | Rust | 0 |
age): #多维度的图像也可以
np_image = np.array(image).astype(np.float32) / 255.0
if np_image.ndim == 2:
np_image = np_image[None, None, ...]
elif np_image.ndim == 3:
np_image = np_image[None, ...]
return torch.from_numpy(np_image)
def tensor2pil(image):
return Image.fromarray(np.clip(255. *... | Python | 1 |
rySlot>,
transfer_cooldown: i32,
},
#[serde(rename = "minecraft:jigsaw")]
#[serde(rename_all = "PascalCase")]
Jigsaw {
target_pool: String,
final_state: String,
/// spelled "attachement" on the wiki,
/// but mispelling is probably a mistake?
attachment_typ... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# 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/li... | Python | 1 |
assert_eq!(param.negated, expected.negated);
assert_eq!(query.param(param), expected.value);
}
if let Some(next_query) = query.next.as_deref() {
query = next_query;
}
}
}
}
#[test]
fn test_normalize_tags() {
let tests ... | Rust | 0 |
let mut r = Vec::new();
for t in v {
let q = try!(t);
r.push(q);
}
Ok(r)
}
pub fn group_by_key<TK : Eq + std::hash::Hash,TV>(pairs: Vec<(TK,TV)>) -> HashMap<TK,Vec<TV>> {
let mut mc = HashMap::new();
for (k,v) in pairs {
let a = match mc.entry(k) {
std::coll... | Rust | 0 |
| 6 - Encode target type inline (fallback to #2) |
/// | Reference | Yes | No | 7 - Encode as reference to target type |
/// | Reference | Yes | Yes | 8 - Encode as accept any object (no fallback possible) |
///
/// Cases 1, 2, 5 & 7 a... | Rust | 0 |
w();
let mut position2 = vec![];
position2.push(7);
map2.insert(
"uri".to_string(),
"spotify:track:1301WleyT98MSxVHPZCA6M".into(),
);
map2.insert("position".to_string(), position2.into());
tracks.push(map2);
let result = async_client()
.await
.user_playlist_re... | Rust | 0 |
serde_json::from_str::<WrappedU256>("1").unwrap_err();
}
}
#[doc = "MODE2 Control A\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::m... | Rust | 0 |
def __call__(self, clip_input, params: dict=None):
clip_input = jnp.transpose(clip_input, (0, 2, 3, 1))
return self.module.apply({'params': params or self.params}, jnp.array(
clip_input, dtype=jnp.float32), rngs={})
| Python | 1 |
from distfiles.output import q, A, b, flag_ciphertext
from sage.all import *
AA = []
B = []
for i, e in enumerate(b):
if not (145 <= (e % 256) < 256): continue
B.append(e - (e % 256))
AA.append(A[i])
R = Integers(q)
AA = matrix(R, AA)
B = vector(R, B)
s = AA.solve_right(B)
e = vector(b) - matrix(R, A) *... | Python | 1 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import time
import numpy as np
import cPickle as pickle
import logging
from simpleknn.bigfile import BigFile
from constant import *
logger = logging.getLogger(__file__)
logging.basicConfi... | Python | 1 |
(None);
let genesis_block_info = BlockInfo::new(
genesis_block.id.serialize_as_vec(),
genesis_block.parent.serialize_as_vec(),
genesis_block.chain_length,
);
store
.put_block(&genesis_block.serialize_as_vec(), genesis_block_info)
.unwrap();
let mut blocks = vec![g... | Rust | 0 |
("\n==== Selected Option ====")
print(f"Product: {selected_prompt}")
# Remove redundant confirmation - proceed directly
# Run the video generation pipeline
success = generator.run_pipeline(selected_prompt)
# Final message after everything completes
if success:
print("\n" +... | Python | 1 |
()
.into(),
)
.map_err(|e| format!("{}", e))?;
connection.flush().map_err(|e| format!("{}", e))?;
let mut res = WsFrame::default();
while let Err(e) = connection.read(&mut res) {
if e.would_block() {
std::thread::sleep(std::time::Duration::from_millis(1))... | Rust | 0 |
= load_meta(meta_path)
readme_path = path.join(root, 'README.md')
readme = load_readme(readme_path)
model_name = str(meta['lang'] + '_' + meta['name'])
model_dir = path.join(model_name, model_name + '-' + meta['version'])
copy(meta_path, path.join(model_name))
copy(meta_path, model_dir)
s... | Python | 1 |
tter_message(text="I don't know any synonyms for the word "+word_record.get('word') )
await publish('hermod/'+site+'/display/show',{'frame':'https://en.wiktionary.org/wiki/'+word_record.get('word')})
await publish('hermod/'+site+'/display/show',{'question':'what are synonyms ... | Python | 1 |
ws| {
match ws {
WaterState::Resting => { w_rest += 1; '~' },
WaterState::Flowing => { w_flow += 1; '|' }
}
})
.unwrap_or(c);
print!("{}", c);
}
... | Rust | 0 |
# coding: utf-8
import os
from sunday.login.auth import config
from sunday.utils import mergeObj, LoginBase
from sunday.core import paths, Logger, enver, exit, cache_name, Auth, getCurrentUser
from bs4 import BeautifulSoup
from pydash import get
from urllib.parse import urlparse
@cache_name('AUTH')
class Login(LoginBa... | Python | 1 |
andler.delete_suite.return_value = (
[],
"No permissions to delete suite.",
)
else:
results_uploader.api_request_handler.delete_suite.return_value = ([100], "")
def delete_sections_mocker(
results_uploader: ResultsUploader, mocker=None, failing=False
):
if failing:
... | Python | 1 |
me))
}
(ctx, None) => LexResult::tt(ctx, T::BeamBreak, T::SingleBar),
}
} else {
LexResult::Error(ctx, ctx.i, LexError::UnrecognisedBarline)
}
}
fn lex_note<'a>(ctx: Context<'a>) -> LexResult {
// Optional accidental.
let (ctx, accidental) = if let (ctx, true) = ... | Rust | 0 |
agraphs are 16 bytes each.
let mem = io::Cursor::new(&[0xff; 32]);
find_entry_point(mem).expect_err("expected entry point not found error");
}
#[test]
fn find_entry_point_ok() {
#[rustfmt::skip]
let mem = io::Cursor::new(&[
// Paragraphs are 16 bytes each.
... | Rust | 0 |
FeedbackResponse(BaseModel):
status: Literal["success"] = "success"
class ChatHistoryInput(BaseModel):
"""Input for retrieving chat history."""
thread_id: str = Field(
description="Thread ID to persist and continue a multi-turn conversation.",
examples=["847c6285-8fc9-4560-a83f-4e6285809... | Python | 1 |
renderer.draw(draw_list);
}
}
pub fn new(
attacker: &Rc<RefCell<EntityState>>,
defender: &Rc<RefCell<EntityState>>,
callbacks: Vec<Box<dyn ScriptCallback>>,
duration_millis: u32,
) -> Anim {
let mut start_pos = (
(attacker.borrow().location.x + attacker.borrow().size.width / 2) as f... | Rust | 0 |
els[idx] = "precision"
labels = np.concatenate([labels, [labels[0]]])
plt.ylim(0.35, 0.8)
plt.tick_params("y", labelleft=False)
plt.thetagrids(angles * 180 / np.pi, labels, FontProperties=font)
plt.savefig(
"compare_permutation_" + dataset + ".pdf", bbox_inches="tight", pad_inches=0
)
... | Python | 1 |
::object::Object>> ScrollableExt for O {
#[cfg(any(feature = "v3_16", feature = "dox"))]
fn get_border(&self) -> Option<Border> {
unsafe {
let mut border = Border::uninitialized();
let ret = from_glib(ffi::gtk_scrollable_get_border(self.to_glib_none().0, border.to_glib_none_mut()... | Rust | 0 |
cute("""
UPDATE students
SET first_name=?, last_name=?, email=?, phone=?,
gender=?, age=?, date_of_birth=?, department=?, semester=?, year=?, photo_path=?
WHERE student_id=?
""", (first_name, last_name, email, phone,
gender, age, date_of_birth, d... | Python | 1 |
# TODO: Crie uma Função: recomendar_plano para receber o consumo médio mensal:
def recomendar_plano(consumo):
# TODO: Crie uma Estrutura Condicional para verifica o consumo médio mensal
if consumo <= 10:
return "Plano Essencial Fibra - 50Mbps"
elif consumo > 11 and consumo <= 20:
return "Plano Pra... | Python | 1 |
", loop_style().paint("LOOP_OPEN"), offset); }
instr_ptr += offset;
}
},
LOOP_CLOSE => {
if memory.get(mem_ptr) == 0 {
if modifiers.is_debug {
println!("{}, exiting loop", loop_style().paint("LOOP_CL... | Rust | 0 |
Scenarios")
plt.title("Detected vs True Keypress Events")
plt.legend(title="Legend: R = Response Time, S = Stop Time")
plt.grid(axis='x', linestyle='--', alpha=0.7)
plt.yticks(range(1, len(scenarios) + 1), scenarios.keys())
plt.tight_layout()
plt.savefig("keypress_plot.png", dpi=300)
plt.sho... | Python | 1 |
f self.extend_cardinality:
return self.model.cardinality * self.num_virtual_steps
else:
return self.model.cardinality
def forward(self, x: torch.Tensor) -> qt.QuantizedResult:
raise NotImplementedError("Not supported, use encode and decode.")
def encode(self, x: torch.T... | Python | 1 |
-retain-iter-history', action='store_true',
help='if set, decoding returns the whole history of iterative refinement')
group.add_argument('--retain-dropout', action='store_true',
help='Use dropout at inference time')
group.add_argument('--retain-dropout-modules', de... | Python | 1 |
from pydantic import BaseModel
from datetime import datetime
from app.models.user_oop import MotoristaWithUser, UserWithoutMotorista
from app.models.veiculo_oop import MotoristaVeiculoModel
class UserCaronaBase(BaseModel):
fk_user: int
fk_carona: int
# class UserCaronaCreate(UserCaronaBase):
# created_at:... | Python | 1 |
#Kết thúc chương trình với exit_code
elif services == 93:
exit_code = dict_Reg['x10']
print(f'---program is finished running ({exit_code})---')
return -1
'''
elif services == 1024:
global next_fd
try:
path_address = dict... | Python | 1 |
# coding: utf-8
import setuptools
setuptools.setup(
name='UTG',
version='0.3.2',
description='Генератор связанного русского текста',
long_description=open('README.rst').read(),
url='https://github.com/Tiendil/utg',
author='Aleksey Yeletsky <Tiendil>',
author_email='a.eletsky@gmail.com',
... | Python | 1 |
, \
pertition=', ', start='', end='',
col=None, errcol=None):
if start:
if col:
bgl.glColor4f(*col)
blf.position(font_id, ofsx, ofsy, 0)
blf.draw(font_id, start)
text_width, text_height = blf.dimensions(font_id, start)
ofsx += text_width
for i, string in enumerate(self.exp_strings)... | Python | 1 |
#[serde(rename = "OH")]
Hydroxide,
/// RESOURCE_ZYNTHIUM_KEANITE: "ZK",
#[serde(rename = "ZK")]
ZynthiumKeanite,
/// RESOURCE_UTRIUM_LEMERGITE: "UL",
#[serde(rename = "UL")]
UtriumLemergite,
/// RESOURCE_UTRIUM_HYDRIDE: "UH",
#[serde(rename = "UH")]
UtriumHydride,
/// RES... | Rust | 0 |
from reportlab.lib import colors
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle, Spacer, PageBreak
from generadorTablasIguales import tablasIguales
# Agrega el Encabezado bingo transformando el array numpy a una simple lista luego lo transforma en una ta... | Python | 1 |
im, index).clone().detach()
if layer.bias is not None:
if dim == 1:
b = layer.bias.clone().detach()
else:
b = layer.bias[index].clone().detach()
new_size = list(layer.weight.size())
new_size[dim] = len(index)
new_layer = nn.Linear(new_size[1], new_size[0], bias=la... | Python | 1 |
# 1
# 2 1
# 3 2 1
# 4 3 2 1
# 5 4 3 2 1
for i in range (1,6):
for j in range(i,0,-1):
print(j, end=" ")
print() | Python | 1 |
# 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 |
/// Test if `zebrad` can sync some larger checkpoints on mainnet.
///
/// This test might fail or timeout on slow or unreliable networks,
/// so we don't run it by default. It also takes a lot longer than
/// our 10 second target time for default tests.
#[test]
#[ignore]
fn sync_large_checkpoints_mainnet() -> Result<(... | Rust | 0 |
_DSCT3_NEXT_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets PDMA_DSCT3_NEXT to value 0"]
impl crate::Resettable for PDMA_DSCT3_NEXT_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
<reponame>adamgreig/stm32ral
#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_c... | Rust | 0 |
import json
import os
class HistoryManager:
def __init__(self, history_file='sent_posts_history.json'):
self.history_file = history_file
self.sent_history = self._load_history()
def _load_history(self):
try:
# Create file if it doesn't exist
if not os.path.exist... | Python | 1 |
ard = self.shard(h2);
// If the file does not already exist in the secondary shard,
// use the primary.
if !shard.file_exists(key.name) {
shard = shard.replace_shard(h1);
}
let update = shard.put(key.name, value)?;
self.update_estimate(h1, update);
... | Rust | 0 |
ed_up.append(filename)
print(f"✅ Backed up {filename}")
except Exception as e:
print(f"❌ Failed to backup {filename}: {e}")
if backed_up:
print(f"\n📦 Backed up {len(backed_up)} CSV files to {backup_dir}/")
return backed_up
if __name__ == '__main__'... | Python | 1 |
# Generated by Django 4.1.10 on 2024-05-15 03:17
from django.db import migrations
def populate_extractor(apps, schema_editor):
Features = apps.get_model('vision_backend', 'Features')
all_features = Features.objects.filter(extracted=True)
# Up to this point, the extractor used is the same as the extract... | Python | 1 |
# coding:UTF-8
# @Time: 2023/5/25 17:43
# @Author: Lulu Cao
# @File: parse_string.py
# @Software: PyCharm
from sympy import Add,Mul
import regex
# 定义一个函数,接受一个字符串作为参数,返回一个转换后的字符串
def convert_power(string):
# 如果字符串中包含"**",则进行转换
if "**" in string:
# 用正则表达式匹配所有的幂运算,得到一个匹配对象的列表
import re
... | Python | 1 |
ize }
} else {
0
};
let pos_byte: Option<usize> = haystack
.char_indices()
.nth(start_char)
.and_then(|(start_byte, _)| haystack[start_byte..].find(needle));
let pos_char: MoltInt = match pos_byte {
None => -1,
Some(b) => haystack[b..]
.char_... | Rust | 0 |
(extension) => match extension.to_str() {
Some(extension) => match extension.to_ascii_uppercase().as_str() {
"XB" => Font::from_xbin_file(file),
"ADF" => Font::from_adf_file(file),
"IDF" => Font::from_idf_file(file),
_ => Font::from_sauce(file)... | Rust | 0 |
size < 0) {
if let Ok(i) = book
.asks
.binary_search_by(|s| s.price.partial_cmp(&o.price).unwrap())
{
book.asks[i].amount = o.size as f64;
} else {
book.bids.push(CoreOrder {
exchange: Exchange::Gate,... | Rust | 0 |
Iter:
ax = Display.Plot_Result(simu, "damage", 1, plotMesh=True)
for i, dep in enumerate(displacements):
simu.Bc_Init()
if dim == 2:
simu.add_dirichlet(nodes_1, [0, -dep], ["x", "y"])
simu.add_dirichlet(nodes_2, [0, dep], ["x", "y"])
... | Python | 1 |
ipher TA\0";
const EXT_PROP_VALUE_2: u32 = 0x0010;
const TRACE_LEVEL: i32 = 4;
const TRACE_EXT_PREFIX: &[u8] = b"TA\0";
const TA_FRAMEWORK_STACK_SIZE: u32 = 2048;
include!(concat!(env!("OUT_DIR"), "/user_ta_header.rs"));
#![crate_name = "foo"]
#![feature(lazy_normalization_consts)]
#![allow(incomplete_features)]
// C... | Rust | 0 |
import numpy as np
from common.rollout import RolloutWorker, CommRolloutWorker
from agent.agent import Agents, CommAgents
from common.replay_buffer import ReplayBuffer
import matplotlib.pyplot as plt
from datetime import datetime
from pprint import pprint
class Runner:
def __init__(self, env, args):
self.... | Python | 1 |
from __future__ import absolute_import, division, print_function
import math, random
from scitbx import matrix
from scitbx.array_family import flex
from six.moves import range
# -----------------------------------------------------------------------------
# simplified form of surface integral for spherical harmonic (l... | Python | 1 |
()))
}
};
}
match_template::match_template! {
TT = [Int, Real, Duration, Decimal, DateTime],
match eval_type {
EvalType::TT => Ok(Box::new(AggFnExtremum::<&'static TT, T>::new())),
EvalType::Json => Ok(Box::new(AggFnExt... | Rust | 0 |
,
36usize,
concat!(
"Offset of field: ",
stringify!(heif_color_profile_nclx),
"::",
stringify!(color_primary_blue_x)
)
);
assert_eq!(
unsafe {
&(*(::core::ptr::null::<heif_color_profile_nclx>())).color_primary_blue_y as ... | Rust | 0 |
#[test]
fn greater_than_big_big2() {
expect("1982648372164176312796419487198>99127934712648732164276347216429663")
.to_yield(false)
}
#[test]
fn greater_than_big2_big() {
expect("99127934712648732164276347216429663>1982648372164176312796419487198").to_yield(true)
}... | Rust | 0 |
api).\n\nFor information about avaliable fields see [fifowr](fifowr) module"]
pub type FIFOWR = crate::Reg<u32, _FIFOWR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _FIFOWR;
#[doc = "`read()` method returns [fifowr::R](fifowr::R) reader structure"]
impl crate::Readable for FIFOWR {}
#[doc = "`write(|w| ..)` metho... | Rust | 0 |
bits = ((self.bits >> 8) & 1) != 0;
I2C_SMIS_RXFFMISR { bits }
}
}
impl W {
#[doc = r"Writes raw bits to the register"]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 0 - Data Masked Interrupt Status"]
... | Rust | 0 |
let f = table::flatten(&mut ctx, v.clone()).unwrap();
let value = datum::encode_value(&mut ctx, &[f]).unwrap();
expect_row.insert(*cid, value);
v.clone()
})
.collect();
let va... | Rust | 0 |
e| Status::invalid_argument(e.to_string()))?;
let parquet_file = repos
.parquet_files()
.get_by_object_store_id(object_store_id)
.await
.map_err(|e| {
warn!(error=%e, %req.uuid, "failed to get parquet_file by object store id");
Sta... | Rust | 0 |
import json
from bloqade.qbraid import schema
def get_noise_model():
single_qubit_error = schema.SingleQubitError(
survival_prob=(survival_prob := tuple(1 for _ in range(10))),
operator_error=(pauli_error_model := schema.PauliErrorModel()),
)
cz_error = schema.CZError(
survival_pr... | Python | 1 |
Name for the job
#[structopt(short, long)]
name: Option<String>,
/// Tool number for the cut
#[structopt(long, default_value = "1")]
tool: u32,
/// Diameter of tool, in mm
#[structopt(long, default_value = "3.175")]
tool_dia: f64,
/// Max cutting stepdown, per pass, in mm
#[s... | Rust | 0 |
fwupdbc(&mut self) -> FWUPDBC_W {
FWUPDBC_W { w: self }
}
#[doc = "Bits 12:14 - Wake-up Inputs Debouncer Period"]
#[inline(always)]
pub fn wkupdbc(&mut self) -> WKUPDBC_W {
WKUPDBC_W { w: self }
}
}
<reponame>colgator/BadDNS
use std::time::Duration;
use std::net::SocketAddr;
use std... | Rust | 0 |
{mail_account}")
return format_string.format(
folder=self._folder, mail_account=str(self.source.handle))
@property
def presentation_url(self):
return self._weblink
@property
def sort_key(self):
return self.source.handle.sort_key + (f"{self._folder or ''}/{self.... | Python | 1 |
:Usage,
_: image::ViewCapabilities,
) -> Option<image::FormatProperties> {
panic!(DO_NOT_USE_MESSAGE)
}
fn memory_properties(&self) -> adapter::MemoryProperties {
panic!(DO_NOT_USE_MESSAGE)
}
fn features(&self) -> hal::Features {
panic!(DO_NOT_USE_MESSAGE)
}
... | Rust | 0 |
String::new(), 0)],
vec![DebugData::new(0, String::from("bar"), vec![], String::new(), 0)],
vec![]
);
let output = generate_ops_bytes(
&[
OpModel::new(PRTS_STR, vec![StrKey(String::from("foo"))], String::new(), String::from("p... | Rust | 0 |
#
# Copyright (c) 2022-2025 Semgrep Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# version 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT AN... | Python | 1 |
from Tkinter import *
class MultiStatusBar(Frame):
def __init__(self, master=None, **kw):
if master is None:
master = Tk()
Frame.__init__(self, master, **kw)
self.labels = {}
def set_label(self, name, text='', side=LEFT, width=0):
if name not in self.labels:
... | Python | 1 |
# -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2009 - Frank Scholz <coherence@beebits.net>
# Copyright 2014 - Hartmut Goebel <h.goebel@crazy-compilers.com>
import pygtk
pygtk.require("2.0")
import gtk
from upnp_inspector import __version__
from ... | Python | 1 |
va aytilgan qo'shimcha imkoniyatlarga ega bo'ling.",
"ru": "Станьте премиум-участником и получите заявленные дополнительные функции."
},
"11": {
"en": "Permanent premium plan",
"uz": "Doimiy premium rejasi",
"ru": "Постоянный план премиум-подписки"
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.