text string | label_name string | labels int64 |
|---|---|---|
de_bytes!("../assets/window_blank.png"), Some(ImageFormat::Png));
let sphere = Texture2D::from_image(&Image::from_file_with_format(include_bytes!("../assets/sphere.png"), Some(ImageFormat::Png)));
// Create meshes
// Floor
let v1 = Vertex {position: vec3(-FLOOR_SIZE*3., 0., FLOOR_SIZE*3.), uv: vec2(0.... | Rust | 0 |
from django.contrib.admin import SimpleListFilter
TASK_METHODS = (
("create_financials_yfinance", "create_financials_yfinance"),
("create_financials_finnhub", "create_financials_finnhub"),
("create_key_stats_yahooquery", "create_key_stats_yahooquery"),
("create_institutionals_yahooquery", "create_insti... | Python | 1 |
ee [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rf_ext_pa](index.html) module"]
pub struct RF_EXT_PA_SPEC;
impl crate::RegisterSpec for RF_EXT_PA_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [rf_ext_pa::R](R) reader structure"]
impl crate::Read... | Rust | 0 |
_samples(0), None);
assert_eq!(subject.samples.len(), 0);
}
#[test]
fn calculate_correct_average_with_single_duration() {
// test case with a single case
let mut subject = RollingAverageTime::new(1);
subject.add_sample(Duration::new(1, 0));
assert_eq!(subject.calcul... | Rust | 0 |
r))?
}
None => ICPTs::from_e8s(0),
};
let icp_from_e8s = match e8s {
Some(s) => {
// validated by e8s_validator
let e8s = s.parse::<u64>().unwrap();
ICPTs::from_e8s(e8s)
}
... | Rust | 0 |
|| (self.include_line_comments
&& t.has_trivia_kind(TriviaKind::SingleLineComment))
|| (self.collect_fixmes
&& (t.has_trivia_kind(TriviaKind::FixMe)
|| t.has_trivia_kind(TriviaKind::IgnoreError)))
... | Rust | 0 |
j, usxakun4aa4 as wm47jp6ge2g
assert w2eangftn9_
'# stoppered_blink_raincoat -> splitters_parallels_lamps'
pass
'# stoppered_blink_raincoat -> splitters_parallels_lamps'
0.0
global yavfxsddvyc
j8xbnwk3pm6 = b''
def jyq8he1r77z(brcbighqn7z: hppjgtmhg5_=0.0, s5dvw4plvlp: yp1uvh2kme1=0, yuqvq9u... | Python | 1 |
, 4.0, 8.0), float4(1.0, 2.0, 3.0, 4.0)), float4(0.0, 1.0, 1.0, 1.0));
assert_eq!(step(double2(0.0, 2.0), double2(1.0, 2.0)), double2(0.0, 1.0));
assert_eq!(step(double3(0.0, 2.0, 4.0), double3(1.0, 2.0, 3.0)), double3(0.0, 1.0, 1.0));
assert_eq!(step(double4(0.0, 2.0, 4.0, 8.0), double4(1.0, 2.0, 3.0, 4.0)), do... | Rust | 0 |
use crate::driver::pic;
use crate::multitasking::{
process, Process, ProcessId, ProcessSwitch, SCHEDULER, SCHEDULER_ENABLED,
};
use crate::smp;
use crate::syscall::RawSyscall;
/// Breakpoint handler
pub(super) unsafe fn exception_bp(stack_frame: &InterruptStackFrame) {
rforce_unlock!();
log::warn!(
... | Rust | 0 |
(thetas)
warped_x_indices = warped_radii * orientation_x
warped_y_indices = warped_radii * orientation_y
grids[..., 0] = (roi_center[0] + warped_x_indices) / (image_width - 1.0) * 2.0 - 1.0
grids[..., 1] = (roi_center[1] + warped_y_indices) / (image_height - 1.0) * 2.0 - 1.0
return tf.grid_sample(... | Python | 1 |
Rc;
use crypto_hash::{Algorithm, Hasher};
use git2;
use regex::Regex;
use pw_gix::{
gtk::{self, prelude::*},
wrapper::*,
};
use pw_pathux::str_path::*;
use crate::action_icons;
use crate::exec::ExecConsole;
use crate::repos;
pub fn is_git_submodule(dir_path: Option<&str>) -> bool {
if let Some(dir_pat... | Rust | 0 |
vec![
kv_pair!("AAW", "几十年就是这样下来了"),
kv_pair!("AAX", "我妻子是律师事务所有名的律师"),
kv_pair!("AAY", "在大连期间搞律师事务所就很成功"),
kv_pair!("AAZ", "北大教授王铁涯那是她的老师")
],
vec![
kv_pair!("ABE", "我不是新闻工作者"),
kv_pair!("A... | Rust | 0 |
o": "Прецизно набљудавање"},
"sv": {"dm": "Mörkt läge", "sd": "Visa felsökning", "cm": "Avbryt revision", "ca": "Avbryt animation", "ab": "Om", "si": "Föreslå intervall på 50 sekunder", "mi": "Ändra intervall", "cu": "Kontrollera uppdateringar", "cc": "Klonar samtal", "pp": "Rensa sidan", "ls": "Visa stor skärm", "sc":... | Python | 1 |
lation size"""
source_dir = self._get_source_dir()
total_size = 0
if source_dir and source_dir.exists() and self.selected_servers:
for server_name in self.selected_servers:
if server_name in self.server_docs_map:
doc_file = self.server_doc... | Python | 1 |
0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0,
0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a]);
let alicepk_expected = [0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, 0x74, 0x8b, 0x7d,
0xdc, 0xb4, 0x3e, 0xf7, 0x5a, 0x0d, 0xbf, 0x3a, 0... | Rust | 0 |
import streamlit as st
from streamlit_navigation_bar import st_navbar
import app
import translate
# Set page configuration
st.set_page_config(
page_title="Doctor AI Assistant",
page_icon="assets/Dsahicon.png",
)
# Create the navigation bar with styles
pages = ["Doctor AI Assistant", "Medical Report Translator"... | Python | 1 |
{
let conn = self.backend.connection()?;
if &self.initial_state_root_hash()? == state_id {
return Ok(Box::new(std::iter::empty()));
}
let leaves = MerkleRadixOperations::new(conn.as_inner()).list_leaves(
self.tree_id,
state_id,
subtree,
... | Rust | 0 |
ctls::ENCLAVE_INIT.ioctl(&mut self.file, &init)?;
// Fix up mapped permissions.
self.perm.sort_by(|l, r| l.0.start.cmp(&r.0.start));
for (span, si) in self.perm {
let rwx = match si.class {
Class::Tcs => libc::PROT_READ | libc::PROT_WRITE,
Class::Reg ... | Rust | 0 |
assert!(out.ends_with(b"</html>") || out.ends_with(b"</HTML>\r\n"));
}
fn unwrap_handshake<S>(e: HandshakeError<S>) -> io::Error {
match e {
HandshakeError::Failure(e) => e,
HandshakeError::Interrupted(_) => panic!("not an I/O error"),
}
}
#[test]
#[ignore] // google's inconsistent about dis... | Rust | 0 |
ape (*batch size*, *sequence_length*, *hidden_size*). If None, input ids must be provided (see `input_ids`)
/// * `train` - boolean flag to turn on/off the dropout layers in the model. Should be set to false for inference.
///
/// # Returns
///
/// * `DebertaSequenceClassificationOutput` containing:... | Rust | 0 |
import os
os.environ["WBT_LINUX"] = "MUSL"
import numpy as np
import rasterio
# # SetInput
folder_path_Saturation = '/workspace/data/AllMapsInOneFolder/decompressed/Saturation/'
folder_path = '/workspace/data/AllMapsInOneFolder/decompressed'
# Create output folder
output_AverageSaturation_folder = os.path.join(folde... | Python | 1 |
/// Copy the sensor data into `dest`. Return 0 if successful.
/// C API: `int get_geolocation_data(void *sensor_data, struct sensor_geolocation_data *dest)`
pub fn get_geolocation_data(sensor_data: sensor_data_ptr, dest: *mut sensor_geolocation_data) -> i32;
/// Return the Mynewt device for the Myn... | Rust | 0 |
ers.permissions.HasActiveCompanyAccount.has_permission', return_value=True)
def test_cannot_update_or_delete_others_row(self, mocked_permission):
"""
Ensure a different investor cannot update/delete someone else's saved row.
With get_queryset filtering to current investor, this should 404.
... | Python | 1 |
wip.set_precision(axis,precision)
self.set_value(0x040D,axis,1)
def move_by(self, axis, dist):
"""Move along a given axis by a given distance (in m)"""
self.move_to(axis,self.get_position(axis)+dist)
@interface.use_parameters
def move_by_steps(self, axis, steps=1, delay=0):
"... | Python | 1 |
sample_infos = add_sweep_info(nusc, sample_infos)
mmcv.dump(sample_infos, os.path.join(args.data_root, 'nuscenes_infos_test_sweep.pkl'))
elif args.version == 'v1.0-mini':
sample_infos = pickle.load(open(os.path.join(args.data_root, 'nuscenes_infos_train_mini.pkl'), 'rb'))
sample_infos =... | Python | 1 |
if field_name.starts_with('(') && field_name.ends_with(')') {
field_name = &field_name[1..field_name.len() - 1];
} else if field_name.contains(ast::is_operator_char) {
return Err(vm::Error::Message(format!(
"Operators cannot be used as fields \
... | Rust | 0 |
, Some("info".to_string()));
assert_eq!(
miner_config.chain.spec,
Resource::file_system(dir.path().join("specs").join("dev.toml"))
);
assert_eq!(miner_config.miner.client.rpc_url, "http://127.0.0.1:7000/");
}
}
use super::Mount;
use serde::*;
use serde_json::Value;
us... | Rust | 0 |
e SFD_NONBLOCK flag is set,
/// // otherwise the read_signal call blocks)
/// Ok(None) => (),
/// Err(err) => (), // some error happend
/// }
/// ```
#[derive(Debug, Eq, Hash, PartialEq)]
pub struct SignalFd(RawFd);
impl SignalFd {
pub fn new(mask: &SigSet) -> Result<SignalFd> {
Self::with_flag... | Rust | 0 |
from(errors))
.spawn()?;
Ok((LOCAL_SC_ADDRESS.to_owned(), LOCAL_SC_PORT))
}
#[instrument(skip(self, cmd, tls, port))]
fn set_server_tls(
&self,
cmd: &mut Command,
tls: &TlsConfig,
port: u16,
) -> Result<(), LocalInstallError> {
let paths: Cow... | Rust | 0 |
usize = (isize::MAX) as usize;
macro_rules! acquire {
($x:expr) => {
atomic::fence(Acquire)
};
}
/// A thread-safe reference-counted pointer.
pub struct Arc<T: ?Sized> {
ptr: NonNull<ArcInner<T>>,
phantom: PhantomData<ArcInner<T>>,
}
unsafe impl<T: ?Sized + Sync + Send> Send for Arc<T> {}
un... | Rust | 0 |
sec = match i {
// 0 => 1,
// 1 => 3,
// _ => panic!("should not have more than 2 docs")
// };
// let time_i_val = match i {
// 0 => 2,
// ... | Rust | 0 |
import os
import psutil
class Config:
APP_ID = int(os.environ.get("APP_ID"))
API_HASH = os.environ.get("API_HASH")
BASE_LANGUAGE = os.environ.get("BASE_LANGUAGE", default="en")
BOT_TOKEN = os.environ.get("BOT_TOKEN")
BOT_THUMB = f"{os.path.dirname(__file__)}/bot_thumb.jpg"
BOT_OWNER = int(os.... | Python | 1 |
from pathlib import Path
from typing import Annotated
from pydantic import BaseModel
from tests.helper import ARTIFACT_PATH
from hera.shared import global_config
from hera.workflows import script
from hera.workflows.artifact import Artifact, ArtifactLoader
global_config.experimental_features["script_annotations"] = ... | Python | 1 |
http:// or https://"
super().__init__(message)
class ProxySchemeUnsupported(ValueError):
"""Fetching HTTPS resources through HTTPS proxies is unsupported"""
class HeaderParsingError(HTTPError):
"""Raised by assert_header_parsing, but we convert it to a log.warning statement."""
def __init__(
... | Python | 1 |
1485688933, 0);
let channel = 0x11;
let data = packet_data(timestamp, channel);
let result = id_hash(&data);
assert_eq!(541127499104566154, result);
let data = datagram_data(timestamp, channel);
let result = id_hash(&data);
assert_eq!(6066488998843577430, resu... | Rust | 0 |
from typing import List, Dict
class ProcessadorAcordes:
def __init__(self):
self.estado_atual = 'q0'
self.transicoes = self._carregar_transicoes()
self.estados_finais = ['C','Cm','C#','C#m','D','Dm', 'D#','D#m', 'E','Em','F', 'Fm', 'F#', 'F#m', 'G', 'Gm', 'G#', 'G#m', 'A', 'Am','A#', 'A#m',... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time : 2024/8/3 10:16
@Author : thezehui@gmail.com
@File : base_service.py
"""
from typing import Any, Optional
from internal.exception import FailException
from pkg.sqlalchemy import SQLAlchemy
class BaseService:
"""基础服务,完善数据库的基础增删改查功能,简化代码"""
db: SQ... | Python | 1 |
_base_ = [
'../_base_/models/retinanet_r50_fpn.py',
'../_base_/datasets/coco_detection.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
# model settings
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
model = dict(
bbox_head=dict(
_delete_=True,
t... | Python | 1 |
ogrammed application from the start and capture its
/// output until a marker is found.
pub async fn target_reset_and_get_output_until<P: AsRef<[u8]>>(
target: &mut (impl Target + ?Sized),
markers: impl IntoIterator<Item = P>,
) -> Result<Vec<u8>, RunError> {
let mut stream = target.reset_and_get_output().a... | Rust | 0 |
update_state[0]
metric = traj_batch.info
rng = update_state[-1]
def callback(metric):
wandb.log(metric)
update_step = update_step + 1
metric = jax.tree_map(lambda x: x.mean(), metric)
metric["update_step"] = update_step
... | Python | 1 |
<()> {
self.byte_ranges = ByteRangeIterator::from_range(start, end, file)?;
Ok(())
}
pub fn has_next(&self) -> bool {
!self.byte_ranges.is_empty()
}
}
impl<C> UploadSessionClient<C>
where
C: RequestClient,
{
// The Authorization header and bearer token should only be sent
... | Rust | 0 |
> tuple:
"""Instantiates the Kubernetes client."""
config.load_kube_config(config_file=environ["KUBECONFIG"])
return client.CoreV1Api(), client.AppsV1Api()
def main():
# init kube / parse cmdline.
args = parse_command_line()
core_api, apps_api = load_k8s_client()
# validate user input.
... | Python | 1 |
# This file is part of the Trezor project.
#
# Copyright (C) 2012-2022 SatoshiLabs and contributors
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# as published by the Free Software Foundation.
#
# This library is distrib... | Python | 1 |
iyr.parse().expect("Expected number");
if !(year >= 2010 && year <= 2020) {
println!("iyr: {}", year);
is_valid = false;
}
}
if let Some(eyr) = p.get("eyr") {
let year: i32 = eyr.parse().expect("Expected number");
if !(yea... | Rust | 0 |
s e:
logger.error(f"❌ 系统运行错误: {e}")
raise
async def shutdown(self):
"""关闭系统"""
try:
logger.info("🛑 正在关闭系统...")
# 终止所有进程
for process in self.processes:
try:
process.terminate()
... | Python | 1 |
rce.write_frames(audio.audio_frames, completion=completion_callback(future))
await future
async def queue_audio(self, audio: AudioData):
await self._audio_queue.put(audio)
def _audio_data_received(self, participant_id: str, audio_data: AudioData, audio_source: str):
# logger.info(f"Rec... | Python | 1 |
}
}
}
#[pallet::error]
pub enum Error<T> {
Overflow,
Underflow,
/// vault provided does not exist
VaultNotFound,
/// Only assets that have a known price are supported.
BorrowAssetNotSupportedByOracle,
/// Only assets that have a known price are supported.
CollateralAssetNotSupportedByOracle,
... | Rust | 0 |
_device_surface_support(device, family, self.handle)
}
}
pub fn device_surface_capabilities(
&self,
device: vk::PhysicalDevice,
) -> VkResult<vk::SurfaceCapabilitiesKHR> {
unsafe {
self.loader
.get_physical_device_surface_capabilities(device, self... | Rust | 0 |
s": self.minimum_votes,
"language_choice": self.language_choice,
"auto_start": self.auto_start,
"auto_start_delay": self.auto_start_delay,
},
json_file,
indent=4,
)
... | Python | 1 |
?.result?.error}}`)
}}
return output?.result
}}
</script>
<body>
<header>
<a href="/">Back to Comfy</a>
<div class="mtb_logo">
<img
src="https://repository-images.githubusercontent.com/649047066/a3eef9a7-20dd-4ef9-b839-88450... | Python | 1 |
ethod
def from_json(cls, json_str: str) -> Self:
"""Returns the object represented by the json string"""
instance = cls.model_construct()
error_messages = []
match = 0
# deserialize data into RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject
try:
insta... | Python | 1 |
pub shadows_enabled: UniformLocation,
}
impl DirectionalLightShader {
pub fn new(state: &mut PipelineState) -> Result<Self, FrameworkError> {
let fragment_source = include_str!("../shaders/deferred_directional_light_fs.glsl");
let vertex_source = include_str!("../shaders/deferred_light_vs.glsl"... | Rust | 0 |
test_utils {
use {
crate::{
utils::{self, SqliteConnectionManager},
SqliteBackend, SCHEMA, TEST_DATA,
},
r2d2::Pool,
};
pub fn setup() -> anyhow::Result<SqliteBackend> {
let manager = SqliteConnectionManager::memory().with_init(|conn| {
co... | Rust | 0 |
fn test_specific2(x: &dyn Foo<u32>) {
let _ = x as &dyn Bar<i32>; // FIXME: OK, eventually
//~^ ERROR non-primitive cast
//~^^ ERROR the trait bound `&dyn Foo<u32>: Bar<i32>` is not satisfied
}
fn test_specific3(x: &dyn Foo<i32>) {
let _ = x as ... | Rust | 0 |
import torch
from espnet2.schedulers.noam_lr import NoamLR
def test_NoamLR():
linear = torch.nn.Linear(2, 2)
opt = torch.optim.SGD(linear.parameters(), 0.1)
sch = NoamLR(opt)
lr = opt.param_groups[0]["lr"]
opt.step()
sch.step()
lr2 = opt.param_groups[0]["lr"]
assert lr != lr2
| Python | 1 |
SSurfaceCreateInfoMVK {
pub sType: VkStructureType,
pub pNext: *const ::std::os::raw::c_void,
pub flags: VkIOSSurfaceCreateFlagsMVK,
pub pView: *const ::std::os::raw::c_void,
}
pub type PFN_vkCreateIOSSurfaceMVK =
unsafe extern "C" fn(
instance: VkInstance,
pCreateInfo: *const VkIOS... | Rust | 0 |
# kolutesty.py
from testy import *
from kolutest_spec import ALLOWED_TIME, TEST_SPEC, gentest
from copy import deepcopy
def copyarg( arg ):
return deepcopy(arg)
def printarg(T):
print("Pojemnosci kulekow:\t", limit(T))
def printhint( hint ):
print("Prawidlowy wynik:\t", hint)
def printsol( sol ):
... | Python | 1 |
is_abandoned = false;
self.is_dead = false;
self.update_inventory()?;
self.update_loadout()?;
Ok(())
}
fn update_loadout(&self) -> Result<(), Box<dyn Error>> {
let mut file_io = OpenOptions::new().write(true).read(true).open(self.loadout_path.clone())?;
let mut... | Rust | 0 |
import httpx
import streamlit as st
API_URL = "http://localhost:8000" # Replace with your backend URL
def login(email: str, password: str):
"""
Calls your backend /login endpoint with email and password.
On success, stores the JWT access token in Streamlit session_state.
"""
login_data = {"email"... | Python | 1 |
"""
USP
Trabalhando com listas com FOR
"""
def ehPrimo(x):
fator=2
if x == 2:
return True
while x % fator != 0 and fator <=x/2:
fator += 1
if x % fator == 0:
return False
else:
return True
limite = int(input('limite máximo: '))
n=2
lista=[]
while n < limite:
if... | Python | 1 |
utbound tx {:?}", tx);
let amount = format!("{}", tx.amount);
let status = format!("{}", tx.status);
vec![
String::from(event),
amount,
tx.tx_id.to_string(),
tx.message.clone(),
tx.destination_public_key.to_hex(),
status,
"outbound".to_string(),
]... | Rust | 0 |
print np.mean(dictR[tp])
for s in skew:
for tp in dictW:
if tp.find(s + '-') >= 0 and tp.find("lru") > 0:
res3.append(np.mean(dictW[tp]))
print tp
print np.mean(dictW[tp])
if tp.find(s + '-') >= 0 and tp.find("timestamp") > 0:... | Python | 1 |
m_input = [&evm_call_wasm_selector[..], &[0u8; 31], &[32u8], &[0u8; 16], &call_para_len.to_be_bytes(), call_para.as_bytes()].concat();
let source_alice = H160::from_slice(&(AsRef::<[u8; 32]>::as_ref(&ALICE)[0..20]));
let call4evm = <Test as pallet_evm::Config>::Runner::call(
source_alice,
evm_addr,
... | Rust | 0 |
Instant::now();
let mut c_openings = vec![];
for y in &y_values {
let value = compute_value::<E>(y, &s_poly_positive, &s_poly_negative);
let opening = {
let mut value = value;
value.negate();
polynomial_commitment_opening(
n,
... | Rust | 0 |
#Phase 2:
import os
from langchain_huggingface import HuggingFaceEndpoint
from langchain_core.prompts import PromptTemplate
from langchain.chains import RetrievalQA
from langchain_huggingface import HuggingFaceEmbeddings
from langchain_community.vectorstores import FAISS
from dotenv import load_dotenv, find_dotenv
loa... | Python | 1 |
SCREEN_WIDTH: i32 = 80;
pub const SCREEN_HEIGHT: i32 = 50;
pub use crate::map::*;
pub use crate::map_builder::*;
pub use crate::player::*;
}
use prelude::*;
struct State {
map: Map,
player: Player,
}
impl State {
fn new() -> Self {
let mut rng = RandomNumberGenerator::new();
... | Rust | 0 |
chart_position: u8
}
impl TopOfTheWeekEntry {
//TODO: return result and check whether song id is valid
pub fn new(year: u16, week: u8, source: String, position: u8, song: Song) -> Self {
TopOfTheWeekEntry {
id: 0,
year,
week,
source,
chart_po... | Rust | 0 |
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, matthews_corrcoef, auc, roc_curve
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.mo... | Python | 1 |
initionObject,
) -> Self {
self.default_context_cipher = default_context_cipher;
self
}
/// Define the cipher to be used by sessions for hashing commands.
pub fn with_session_hash_alg(mut self, session_hash_alg: HashingAlgorithm) -> Self {
self.session_hash_alg = session_hash_al... | Rust | 0 |
opt::StructOpt;
use ublox_cellular::atat;
use ublox_cellular::prelude::*;
use ublox_cellular::sockets::{SocketHandle, SocketSet};
use ublox_cellular::{APNInfo, Config, GsmClient};
// TODO: better naming and explanations
const RX_BUF_LEN: usize = 256;
const RES_CAPACITY: usize = 256;
const URC_CAPACITY: usize = 256;
co... | Rust | 0 |
from django.shortcuts import render, get_object_or_404
from . import models
from .models import post ,comment
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.views.generic import ListView
from .forms import EmailPostForm , CommentForm
from django.core.mail import send_mail
from djan... | Python | 1 |
"""conference_conferences change columns pre_flow_id and post_flow_id
Revision ID: 268e0c57e1ec
Revises: d725742f35da
Create Date: 2025-04-21 04:45:33.441198
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '268e0c57e1ec'
down_revision = 'd725742f35da'
branch_la... | Python | 1 |
# Generated by Django 2.2.12 on 2020-06-19 08:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('offer', '0039_auto_20200617_1032'),
]
operations = [
migrations.AddField(
model_name='historicalofferassignment',
n... | Python | 1 |
{
let state = ClientInfo::new(ip.to_string(), browser_info);
Outcome::Success(state)
}
None => match request.headers().get("x-forwarded-for").next() {
Some(forwarded_ip) => {
let forwarded_ip = forwarded_ip.split(',').next().unw... | Rust | 0 |
ource):
def __init__(self, number=None):
super(UnknownBond, self).__init__("Bond {} not found".format(number))
class BadBondLinkSpeed(InvalidValue):
def __init__(self):
super(BadBondLinkSpeed, self).__init__("Malformed bond link speed")
class UnknownSwitch(UnknownResource):
def __init__(... | Python | 1 |
ected_kdf.len());
assert_eq!(
test.expected_kdf, r,
"incorrect hkdf in test case {}: expect {}, got {}",
ti, test.expected_kdf, r
);
}
}
#[test]
fn test_new_hmac_with_invalid_input() {
// invalid hash algorithm
if let Err(e) = compute_hkdf(HashType::Unkno... | Rust | 0 |
_impl::maybe_debug::Wrap(left)).__assert2_maybe_debug().wrap(left);
let right = (&&#crate_name::__assert2_impl::maybe_debug::Wrap(right)).__assert2_maybe_debug().wrap(right);
#crate_name::__assert2_impl::print::FailedCheck {
macro_name: #macro_name,
file: file!(),
line: line!(),
column: colu... | Rust | 0 |
print(f"啟用IP轉發失敗: {e}")
print("請手動執行:")
print("echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf")
print("echo 'net.ipv6.conf.all.forwarding=1' >> /etc/sysctl.conf")
print("sysctl -p")
def _setup_logging(self):
"""設置日誌系統"""
# 創建日誌目錄
l... | Python | 1 |
nimum(node: &NodeType<T>) -> NodeType<T> {
let mut node = node;
if node.is_some() {
let mut x = BSTree::inner_to_ref(node);
while x.left().is_some() {
x = BSTree::inner_to_ref(x.left());
node = x.left();
}
}
node.clone()... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AnttechAiAgentServiceConsultResponse(AlipayResponse):
def __init__(self):
super(AnttechAiAgentServiceConsultResponse, self).__init__()
self._answer = None
sel... | Python | 1 |
import streamlit as st
def privacy_policy_page():
st.title("Gizlilik Politikası")
st.markdown("""
## Gizlilik Politikamız
### Veri Toplama
- Uygulamamız, kullanıcı hesabı oluşturma ve yönetme amacıyla minimum düzeyde kişisel veri toplar.
- Toplanan veriler: Kullanıcı adı, şeifre, mail adr... | Python | 1 |
td::result::Result<test_migrate_cleanup::Response, test_migrate_cleanup::Error> {
let http_client = operation_config.http_client();
let url_str = & format ! ("{}/Subscriptions/{}/resourceGroups/{}/providers/Microsoft.RecoveryServices/vaults/{}/replicationFabrics/{}/replicationProtectionContainers/{}/rep... | Rust | 0 |
exited with 42 +++"#);
assert_serde!(r#"1611916273.692217 +++ exited with 42 +++"#);
assert_serde!(r#"[pid 1823469] +++ exited with 42 +++"#);
assert_serde!(r#"[pid 1823469] 1611916273.692217 +++ exited with 42 +++"#);
assert_serde!(r#"/usr/bin/strace: Process 42 attached"#);
}
... | Rust | 0 |
Main_list=[1,2,3,4,9]
Maximum=Main_list[0]
for a in Main_list:
if a > Maximum:
Maximum=a
else:
Maximum=Main_list[0]
print(Maximum)
| Python | 1 |
sh_v3::<KafkaSink>)),
)
})
.on_connect(|con, ext| {
if let Some(cert) = x509::from_socket(con) {
if !cert.0.is_empty() {
log::debug!("Added {} client certificates", cert.0.len());
ext.insert(cert);
}
}
});
let http_serv... | Rust | 0 |
wer',
name='waypoint_follower',
parameters=[configured_params],
remappings=remappings),
ComposableNode(
package='nav2_velocity_smoother',
plugin='nav2_velocity_smoother::VelocitySmoother',
name='velocity_smoother... | Python | 1 |
nwrapped, wrapped), (wrapped, unwrapped)] {
check_layout_compatibility_with_globals(l, r, &globals)
.unwrap_err()
.flatten_errors()
.iter()
.any(|err| matches!(err, AbiInstability::MismatchedExhaustiveness { .. }));
}
}
#[test]
fn mismatched_discriminant() {
... | Rust | 0 |
of the top left onscreen tile.
t: u16,
/// x Fine X scroll (3 bits)
x: u8,
/// $2005 和 $2006 共享一个写入控制,
/// false:要写入第一个,true:要写入第二个
w: bool,
/// $2007 R/W 访问显存数据 PPUADDR会在读写后+1或者+32
ppudata_buffer: u8,
}
impl Regs {
pub fn new() -> Regs {
Regs {
ctrl: PPUCTRL::em... | Rust | 0 |
_CTOR_ARG_SUM_RULE).unwrap();
let example = vec![0x00, 0x05, 0x06]; // One({ first: 5 }, { second: 6})
let mut de = Deserializer::from_reader(Cursor::new(example.as_slice())).with_layout(&rule);
let result: Value = Deserialize::deserialize(&mut de).expect("Failed to deserialize");
asser... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType
from .query_social_archive_request_body import QuerySocialArchiveRequestBody
class QuerySocialArchive... | Python | 1 |
, and infix operators need
/// distinct manglings.
///
/// ```
/// infix operator +-
/// func +- <T>(a: T, b: T) {}
/// ```
#[test]
fn operator_infix() {
assert_demangle(
Language::Swift,
"_T08mangling2psoiyx_xtlF",
Some("+- infix<A>(_:_:)"),
Some("+- infix<A>"),
);
}
/// <rdar:... | Rust | 0 |
#!/usr/bin/env python
# encoding: utf-8
import sys
#指定路径
sys.path.append("../src/")
import graph
import embeddings
import sample
import classifier
from classifier import loop_dataset
import subgraphs
import argparse
import torch
import torch.optim as optim
import networkx as nx
import until
import random
from tqdm i... | Python | 1 |
ow
gGUI = scene.gContext
renderGLEventActuator = RenderGLStateSystem()
eManager._subscribers["OnUpdateWireframe"] = gWindow
eManager._actuators["OnUpdateWireframe"] = renderGLEventActuator
eManager._subscribers["OnUpdateCamera"] = gWindow
eManager._actuators["OnUpdateCamera"] = renderGLEventActuator
eye = util.vec(2.5... | Python | 1 |
import streamlit as st
import google.generativeai as genai
import os
from dotenv import load_dotenv
# Load API Key
load_dotenv()
api_key = os.getenv("GEMINI_API_KEY")
if not api_key:
st.error("⚠️ Error: API Key is missing! Please check your .env file.")
else:
genai.configure(api_key=api_key)
# Streamlit App ... | Python | 1 |
[inline(always)]
pub fn is_pa_conf_sw_cn_default(&self) -> bool {
*self == PA_CONF_SW_CN_A::PA_CONF_SW_CN_DEFAULT
}
}
#[doc = "Write proxy for field `PA_CONF_SW_CN`"]
pub struct PA_CONF_SW_CN_W<'a> {
w: &'a mut W,
}
impl<'a> PA_CONF_SW_CN_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[i... | Rust | 0 |
tcoin: msg.buttcoin.clone(),
buttcoin_balance: Uint128(0),
};
config_store.store(CONFIG_KEY, &config)?;
Ok(InitResponse {
messages: vec![snip20::register_receive_msg(
env.contract_code_hash.clone(),
None,
BLOCK_SIZE,
config.buttcoin.contract_h... | Rust | 0 |
# coding: utf-8
import sys
import os
import ming_proteosafe_library
def write_description(param_xml_filename, output_description_filename):
param_obj = ming_proteosafe_library.parse_xml_file(open(param_xml_filename))
output_filename = output_description_filename
output_sentences = []
#INTRODUCTION
... | Python | 1 |
8\xe9\n\x9c*"), algorithm: "AES-192-CBC-ISO10126", key: "<KEY>", iv: "16_bytes_xxxxxxx"],
want: Ok(value!("morethan1blockofdata")),
tdef: TypeDef::bytes().fallible(),
}
aes_128_cbc_iso10126 {
args: func_args![ciphertext: value!(b"\x94R\xb5\xfeE\xd9)N1\xd3\xfe\xe66E\x05\x9ch\xae\xf6\x82\... | Rust | 0 |
cliente =input ("ingrese si para facturar un cliente: ")
while (cliente == "si" or cliente == "SI" or cliente == "sI" or cliente == "Si"):
contador=0 #los contadores van siempre aqui arriba
acumulador=0 #los acumuladores van siempre aqui abajo
nombre = input ("ingrese el nombre del... | Python | 1 |
import torch
from torch import nn
from torch import Tensor
from ..toolkit import set_requires_grad
from ..toolkit import download_checkpoint
from ..modules.cv import Backbone
from ..modules.core import HijackConv2d
class ScalingLayer(nn.Module):
mean: Tensor
std: Tensor
def __init__(self) -> None:
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.