text string | label_name string | labels int64 |
|---|---|---|
d.shape) == 3
kp2d_normalized = kp2d.clone()
kp2d_normalized[:, :, :2] = 2.0 * kp2d[:, :, :2] / img_res - 1.0
return kp2d_normalized
def unormalize_kp2d(kp2d_normalized: torch.Tensor, img_res):
assert len(kp2d_normalized.shape) == 3
assert kp2d_normalized.shape[2] == 2
kp2d = kp2d_normalized.c... | Python | 1 |
.h3c.com/netconf/config:1.0">
<VLAN>
<AccessInterfaces>
<Interface>
<IfIndex>{}</IfIndex>
<PVID>{}</PVID>
</Interface>
</AccessInterfaces>
</VLA... | Rust | 0 |
f.generate_analysis_report()
def main():
parser = argparse.ArgumentParser(
description="SSL Header and Metrics Analyzer - Focused analysis of HTTP headers and response metrics",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Analysis Categories:
- HTTP request header ana... | Python | 1 |
---------------
pub struct EncryptedPacket {
pkey: PublicKey,
// public key of recipient
id: Vec<u8>,
// IBE ID
rval: RVal,
// R_val used for SAKE encryption
cmsg: Vec<u8>, // encrypted payload
}
impl EncryptedPacket {
pub fn new(pkey: &PublicKey, id: &[u8], rval: &RVal, cmsg: &[u8]) ->... | Rust | 0 |
/// Total number of bytes requested
#[prost(int64, tag="1")]
pub requested_bytes: i64,
/// Total number of bytes allocated if known
#[prost(int64, tag="2")]
pub allocated_bytes: i64,
/// Name of the allocator used
#[prost(string, tag="3")]
pub allocator_name: ::prost::alloc::string::... | Rust | 0 |
}
impl PageTable {
const IDX_BITS: usize = 9;
const IDX_MASK: usize = (1 << Self::IDX_BITS) - 1;
const PAGE_BITS: usize = 12;
pub const PAGE_MASK: usize = (1 << Self::PAGE_BITS) - 1;
pub const ENTRY_COUNT: usize = 1 << Self::IDX_BITS;
/// Size of a normal page
pub const PAGE_SIZE: usize... | Rust | 0 |
bject, field) > 0 {
Entity::from_schema_field(object.get_object(field))
.map_err(Error::at_field::<Self>(field))
} else {
Err(Error::missing_field::<Self>())
}
}
fn add(object: &mut SchemaObject, field: u32, value: &Entity) {
let obj = object.add_... | Rust | 0 |
# How to open camera with pygame in Windows?
# https://stackoverflow.com/questions/29673348/how-to-open-camera-with-pygame-in-windows
#
# blit opencv camera capture with pygame throws TypeError: argument 1 must be pygame.Surface, not cv2.VideoCapture
# https://stackoverflow.com/questions/74077114/blit-opencv-camera-cap... | Python | 1 |
)
# Overall sustainability score
weights = {
'activity': 0.25,
'contributors': 0.20,
'maintenance': 0.20,
'health': 0.20,
'recency': 0.15
}
overall_score = (
commit_frequency_score * weights['act... | Python | 1 |
import asyncio
import calendar
import logging
import os
from datetime import date, timedelta
import aiohttp
from my_bezeq import ElectricReportLevel, MyBezeqAPI
logging.basicConfig(level=logging.INFO)
async def main():
session = aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl=False), timeout=aiohttp.C... | Python | 1 |
1680usize,
concat!(
"Offset of field: ",
stringify!(_NV_ENC_PIC_PARAMS),
"::",
stringify!(reserved2)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_NV_ENC_PIC_PARAMS>())).qpDeltaMap as *const _ as usize },
1696usize,
... | Rust | 0 |
#!/usr/bin/evn python
# coding=utf-8
# + + + ++ + + ++ + + ++ + + ++ + + ++ + + ++ + + ++ + + ++ + + ++ + + ++ + + ++ + + ++ + + ++ + + ++ + + +
# โโใใใโโ+ +
# ใใใโโโปโโโโโปโ + +
# ใใใโใใใใใใ โ ใ
# ใใใโใใใโใใใโ ++ + + +
# ใใ โโโโโโโโโ โ+
# ใใใโใใใใใใ โ +
# ใใใโใใใโปใใใโ
# ใใใโใใใใใใ โ + +
# ใใใโโโใใใโโโ
# ใใใใใโใใใ... | Python | 1 |
import os
from dotenv import load_dotenv
from deepseek_agent.model import DeepSeekChatModel
from deepseek_agent.assistant import DeepSeekAssistant
from deepseek_agent.tools.rag_tool import RAGTool, add_document
# ๅ ่ฝฝ .env ๆไปถ
load_dotenv()
# ๅๅงๅ DeepSeek ๆจกๅ
api_key = os.getenv('DEEPSEEK_API_KEY')
model_name = ''
llm = ... | Python | 1 |
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from tkinter import filedialog
import os
import load_data
default_dir = os.getcwd()
file_selection = filedialog.askopenfilename(initialdir=default_dir)
indirect_categories = ['HLDY', 'ENGM', 'MACC', 'PJM', 'PTVP']
df, project, indirect = loa... | Python | 1 |
from connection.packet import *
from scambiochiavi.dhaes import *
from gzip import decompress
import json
import socket
import base64
import os
def listener(ADDRESS: tuple):
'''
Listens for incoming packets
'''
#try:
client = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
client.bind(ADDRESS... | Python | 1 |
:return: Estimated size in MB (approximate)
"""
if not validate_youtube_url(url):
raise ValueError(f"Invalid YouTube URL: {url}")
format_spec = f'{video_format}+{audio_format}' if audio_format else video_format
ydl_opts = {
'format': format_sp... | Python | 1 |
acing::trace!("got item");
self.batch.queue(item);
let mut rx = self.tx.subscribe();
Box::pin(async move {
match rx.recv().await {
Ok(result) => {
if result.is_ok() {
t... | Rust | 0 |
Numeric(ArbitraryPrecisionNumericAttr),
/// 32 bit floating-point
Real,
/// 64 bit floating-point
DoublePrecision,
/// 16 bit autoincrementing integer
SmallSerial,
/// 32 bit autoincrementing integer
Serial,
/// 64 bit autoincrementing integer
BigSerial,
/// Currency amou... | Rust | 0 |
le_req.execute(num_retries=NUM_RETRIES)
print('Successfully patched %s "%s"' % (res['kind'], res['id']))
except HttpError as http_error:
print('Error in creating table: %s. Err: %s' % (table_id, http_error))
is_success = False
return is_success
def insert_rows(big_query, project_id, da... | Python | 1 |
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score, roc_auc_score
import numpy as np
from pathlib import Path
import torch
import csv
import argparse
parser = argparse.ArgumentParser(description='Random seed set:')
parser.add_argument... | Python | 1 |
# DO NOT EDIT! This file was generated by jschema_to_python version 0.0.1.dev29,
# with extension for dataclasses and type annotation.
from __future__ import annotations
import dataclasses
from typing import List, Optional
from torch.onnx._internal.diagnostics.infra.sarif import (
_exception,
_property_bag,
... | Python | 1 |
alize_struct("texture", 4)?;
s.serialize_field("uuid", &self.uuid)?;
s.serialize_field("name", &self.name)?;
s.serialize_field("sampler", &self.sampler)?;
s.end()
}
}//! Test suite for the Web and headless browsers.
#![cfg(target_arch = "wasm32")]
extern crate wasm_bindgen_test;
extern crate web_sys;
extern ... | Rust | 0 |
nce(
vk_sym(mem::zeroed(), &api, b"vkCreateInstance\0")
);
Some(Vulkan {
vk,
// Late inits.
surface: ::std::mem::uninitialized(),
gpu: ::std::mem::uninitialized(),
pqi: ::std::mem::uninitialized(),
sampled: ::std::mem::uninitialized(),
device: ::std::mem::uninitialized(),
command_buffer:... | Rust | 0 |
"""Basic coerce tests cases
Made for Jython.
"""
import unittest
from test import test_support
from javatests import Coercion
from collections import Sequence
class MySeqClass1(Sequence):
def __init__(self, l):
self.l = l
def __getitem__(self, i):
return self.l[i]
def __len__(self):
... | Python | 1 |
"subdir").mkdir()
(tmp_path / "subdir" / "file.txt").write_text("content")
(tmp_path / "subdir" / "debug.log").write_text("log content")
tool = ListFilesTool(str(tmp_path))
async def fake_run(cmd, cwd=None, timeout=None, timeout_ms=None):
if "-I" in cmd: # No ignore
files = [
... | Python | 1 |
};
assert!(r == 1);
let r = match (0,97) {
(0, A) => 0,
(x, y) => 1 + x + y,
};
assert!(r == 0);
}
mod m {
pub static aha : int = 7;
}
fn g() {
use self::m::aha as AHA;
let r = match (0,0) {
(0, AHA) => 0,
(x, y) => 1 + x + y,
};
assert!(r == 1);... | Rust | 0 |
erse(1, "PP", "geht")),
(1, Dependency::regular(1, "PP", "ins")),
(2, Dependency::inverse(2, "ROOT", "<root>")),
(3, Dependency::inverse(1, "PN", "ins")),
(2, Dependency::regular(1, "PN", "kino")),
(3, Dependency::inverse(2, "PP", "geht")),
(1, Dep... | Rust | 0 |
, map_location='cpu')
except Exception as e:
info.append(f'[auto_resume] failed, {e} @ {all_ckpt[1]}')
return info, 0, 0, '[no acc str]', [], {}, {}
dist.barrier()
ep, it = ckpt['epoch'], ckpt['iter']
eval_milestone = ckpt.get('milestones', [])
info.append(f'[auto_re... | Python | 1 |
zy state preservation is active. floating-point stack frame has been allocated but saving state to it has been deferred."]
_1 = 1,
}
impl From<LSPACT_A> for bool {
#[inline(always)]
fn from(variant: LSPACT_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `LSPACT`"]
pub type LSPACT_R ... | Rust | 0 |
, BQ, BK, BB, BN, BR,
];
}
pub(crate) const NONE: u8 = 12;
#[cfg(feature = "simd")]
pub(crate) const NONE_SIMD: u8x64 = u8x64::splat(NONE);
const NUM_SQUARES: usize = NUM_FILES * NUM_RANKS;
const NUM_FILES: usize = NUM_RANKS;
const NUM_RANKS: usize = 1 + Rank::Eight as usize;
/// An array of `Option<P... | Rust | 0 |
laxation temperature
probs (Number, Tensor): the probability of sampling `1`
logits (Number, Tensor): the log-odds of sampling `1`
"""
arg_constraints = {"probs": constraints.unit_interval, "logits": constraints.real}
support = constraints.unit_interval
has_rsample = True
def __init... | Python | 1 |
from TransformerEncoderLayer import TransformerEncoderLayer
import transformers
import torch
class HalveTransformer(torch.nn.Module):
def __init__(
self,
num_classes = 6 ,
embedding_size = 64 ,
feedforward_size = 128 ,
dropout = 0.1 ,
layers ... | Python | 1 |
from qtpy.QtCore import QModelIndex, QObject
from typing import Optional
from .baseplot_table_model import BasePlotCurvesModel
from .baseplot_curve_editor import BasePlotCurveEditorDialog, ColorColumnDelegate, PlotStyleColumnDelegate
from .timeplot import PyDMTimePlot
class PyDMTimePlotCurvesModel(BasePlotCurvesModel... | Python | 1 |
GDB = '../../gdb'
else:
# Punt and use the gdb in the path.
GDB = 'gdb'
def main(argv):
"""The main subprogram."""
if len(argv) != 2:
print "Usage: test_pubnames_and_indexes.py <filename>"
sys.exit(2)
find_executables();
# Get the index produced by Gold--It should have been built int... | Python | 1 |
tts: Option<TextToSpeechProvider>,
}
pub fn extract_custom_broadcast_config(config: &str) -> Option<BroadcastConfig> {
let re = RegexBuilder::new(
r"^BROADCAST ([1-3]\d{2}(\.\d{1,3})?)(,[ ]?VOICE ([a-zA-Z-:]+))?:[ ]*(.+)$",
)
.case_insensitive(true)
.build()
.unwrap();
re.captures(conf... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
ๆฌ่ฝฏไปถไป
ไพๅญฆไน ็จ้ ่ฏทๅฟ็จไฝ่ฟๆณ่กไธบ ๅๆ่ช่ด!
Githubไปๅบๅฐๅ:https://github.com/sun589/QQkey_Tool
ไฝ่
:sun589
"""
import os
import traceback
from PyQt5 import QtCore, QtWidgets, QtGui
from PyQt5.QtWidgets import QDialog
import sys
from PyQt5.QtGui import QPixmap, QIcon, QFont
from PIL import Image
import requests
impo... | Python | 1 |
struct TrowInstance {
pid: Child,
}
/// Call out to cargo to start trow.
/// Seriously considering moving to docker run.
fn start_trow() -> TrowInstance {
let mut child = Command::new("cargo")
.arg("run")
.env_clear()
.envs(Environment::inherit().... | Rust | 0 |
import cv2
import torch
import numpy as np
import os
from PIL import Image
from datasets import load_dataset
from matplotlib import pyplot as plt
from sklearn.utils import shuffle
from torchvision import transforms
import torchvision
import kagglehub
import datasets
import json
def get_images_intel_images(directory)... | Python | 1 |
>(
&self,
id: &str,
exchange_ids: Option<&[Ex]>,
include_exchange_logo: bool,
page: i64,
order: TickersOrder,
depth: bool,
) -> Result<Tickers, Error> {
let order = match order {
TickersOrder::TrustScoreAsc => "trust_score_asc",
... | Rust | 0 |
+ 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "notify::is-important",
transmute(notify_is_important_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_property_visible_horizontal_notify<F: Fn(&Self) + 'static>(&self, f: F) -> S... | Rust | 0 |
LCNet_x1_0_doc_ori",
"UVDoc",
"PP-DocLayout-L",
"PP-DocLayout-M",
"PP-DocLayout-S",
"PP-DocLayout_plus-L",
"PP-DocBlockLayout",
"SLANeXt_wired",
"SLANeXt_wireless",
"PP-LCNet_x1_0_table_cls",
"RT-DETR-L_wired_table_cell_det",
"RT-DETR-L_wireless_table_cell_det",
"PP-OCRv4... | Python | 1 |
lose-conversations-channel", "botid");
let resp = test::TestRequest::post()
.uri(&format!("/conversations/close"))
.set_json(&serde_json::json!({
"user_id": user_id,
"channel_id": channel_id,
"bot_id": bot... | Rust | 0 |
import pandas as pd
from datetime import timedelta
from config import Config
# 1. CSV'den veriyi oku
file_path = f"{Config.PROJECT_ROOT}src/data/processed/customer_data.csv"
df = pd.read_csv(file_path, parse_dates=["order_date"])
# 2. Referans tarih: verideki en son sipariล tarihi + 1 gรผn
reference_date = df["order_d... | Python | 1 |
cs(task, edit_model, image_name, dst, 'SSIM')), 4)
sample = {}
sample['image'] = image_name
sample['dataset'] = dataset
sample['prompt'] = prompt
sample['evaluation'] = evaluation
sample['type'] = in... | Python | 1 |
match() {
assert!(!has_match("acb", "abc"));
assert!(!has_match("a", ""));
assert!(!has_match("abc", "def"));
assert!(!has_match("๐จฦยทยฎxยฏรฤ.ษ
", "5รนยจศผโโฉโโ^"));
assert!(!has_match(
"ะฟัะพะฟะธัะฝะฐั ะะฃะะะ",
"ะฟัะพะฟะธัะฝะฐัะะฃะะะ"
));
assert!(!has_match(
"ะะฃะะะ ะฟัะพะฟะธัะฝะฐั",
"ะฟัะพะฟะธัะฝะฐั... | Rust | 0 |
unwrap());
t.offset_minutes(1);
assert_eq!(central_localtime(&t), Datetime::new(2017, 3, 26, 1, 59, 0, 3600).unwrap());
t.offset_minutes(1);
assert_eq!(central_localtime(&t), Datetime::new(2017, 3, 26, 3, 0, 0, 7200).unwrap());
t.offset_minutes(1);
assert_eq!(centra... | Rust | 0 |
e
def main():
parser = make_parser()
args = parser.parse_args()
b = beaker.Beaker.from_env()
experiment = b.experiment.get(experiment=args.experiment_id)
metrics_all = {}
metrics_summary = {}
for job in experiment.jobs:
# Skip unfinished jobs.
eval_task = job.name.replac... | Python | 1 |
import json
def read_jsonl(file_path):
data = []
with open(file_path, 'r', encoding='utf-8') as f:
for line in f:
data.append(json.loads(line))
return data
def write_jsonl(results, path_output):
with open(path_output, "w", encoding="utf-8") as f:
for result in results:
... | Python | 1 |
= take_while1(is_digit)(rest)?;
let (rest, _) = char(' ')(rest)?;
let (rest, c) = take(1u8)(rest)?;
let (rest, _) = take(2u8)(rest)?;
let (rest, password) = take_while1(is_alphabetic)(rest)?;
Ok((rest, Line::new(c[0] as char,
std::str::from_utf8(min).unwrap().parse::<i32>().unwrap(),
... | Rust | 0 |
ered out
return mean.squeeze(0), mask
return valid_points.mean(dim=0), mask
def interpolate(x0, x1, alpha):
return (1 - alpha) * x0 + (alpha * x1)
def smooth_mean(x0: torch.Tensor, sx1: torch.Tensor, alpha: float, std_threshold: float):
x1, _ = clipped_mean(sx1, std_threshold)
return int... | Python | 1 |
__init__(self):
super().__init__()
self.linear1 = flow.nn.Linear(3, 4)
self.linear2 = flow.nn.Linear(3, 4)
self.linear2.weight = self.linear1.weight
reuse_var_m = ReuseVarModule()
test_case.assertTrue(reuse_var_m.linear1.weight is reuse_... | Python | 1 |
# Copyright (c) OpenMMLab. All rights reserved.
from mmengine.registry import Registry
NODES = Registry('node')
| Python | 1 |
ub type ADDR_R = crate::R<bool, bool>;
#[doc = "Reader of field `TXC`"]
pub type TXC_R = crate::R<bool, bool>;
#[doc = "Reader of field `TXBL`"]
pub type TXBL_R = crate::R<bool, bool>;
#[doc = "Reader of field `RXDATAV`"]
pub type RXDATAV_R = crate::R<bool, bool>;
#[doc = "Reader of field `ACK`"]
pub type ACK_R = crate... | Rust | 0 |
usuario in lista_usuarios:
if usuario.id == id:
lista_usuarios.remove(usuario)
return jsonify({
'mensaje': 'Usuario eliminado con exito',
'status': 200
}),200
return jsonify({
'mensaje': 'No se encontro el usuario',
... | Python | 1 |
_shell::WlShell) {
let ptr = shell.get_user_data();
shell.set_user_data(::std::ptr::null_mut());
let data = unsafe { Box::from_raw(ptr as *mut ShellUserData<SD>) };
// explicitly call drop to not forget what we're doing here
::std::mem::drop(data);
}
}
pub fn make_shell_clie... | Rust | 0 |
/*
let mut map = HashMap::new();
let doclen = index.len().unwrap().to_string();
map.insert("docs", doclen.as_str());
let tags = index.get_tags();
let taglen = tags.len().to_string();
map.insert("tags",taglen.as_str());
get_content_page_with_named_template("index.html",&map)
*/
R... | Rust | 0 |
0), size=('100%', '100%'),
# fill='none', stroke=config.BORDER_COLOR, stroke_width=config.BORDER_THICKNESS))
dwg.save(pretty=True) # pretty=True adds indentation
print(f"Successfully saved SVG to {file_path}")
messagebox.showinfo("Export Successful", f"Saved SVG to:\n{f... | Python | 1 |
nside `y`.
///
/// # Panics
///
/// Panics if `x` or `y` are not large enough for the requested amount of elements.
///
/// # Example
///
/// ```
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// # let _a = cust::quick_init()?;
/// # use blastoff::CublasContext;... | Rust | 0 |
hted_sum = sum(weights[k] * noise[:, t, k] for k in range(K))
# U_global[:, t] += weighted_sum
weights_reshaped = weights.reshape(1, 1, K) # Reshape for broadcasting
weighted_noise_sum = torch.sum(noise * weights_reshaped, axis=2).cpu().numpy() # shape (nu, T)
U_global = weighted_noise_sum
# ===... | Python | 1 |
# Copyright 2023 solo-learn development team.
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to use,
# copy, modify, merge, publ... | Python | 1 |
from importlib import reload
from maya import cmds
from nlol.shelves_menus import rigging_list
from nlol.utilities.nlol_maya_logger import get_logger
reload(rigging_list)
def update_rigging_shelf():
"""Update or add the rigging shelf."""
logger = get_logger()
shelf_name = "nlRigTools"
# get top sh... | Python | 1 |
ytesStream {
fn from(bytes: Bytes) -> Self {
Self::new(bytes)
}
}
impl Stream for BytesStream {
type Item = Result<Bytes, StreamError>;
fn poll_next(
self: Pin<&mut Self>,
_cx: &mut std::task::Context<'_>,
) -> Poll<Option<Self::Item>> {
let mut self_mut = self.get_... | Rust | 0 |
italic = false;
let mut underlined = false;
let mut strikethrough = false;
'mainloop: loop {
while let Some(ev) = window.poll_event() {
match ev {
Event::Closed => break 'mainloop,
Event::TextEntered { unicode } => {
if unicode == 0x0... | Rust | 0 |
from django.shortcuts import render
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.contrib import messages
from django.urls import reverse_lazy
from django.contrib.auth.mixins import L... | Python | 1 |
.145 {
pix.pixel(i as f32, i as f32, 20.0)?;
}
// drawing a 4x4 image
pix.draw("0123456789abcdef", 4.0, 4.0, h / 2.0, w / 2.0, None)?;
// drawing a text
pix.print(15.0, 0.0, 0.0, "Hello World")?;
Ok(())
}
}
fn main() -> Result<(), String> {
run(Game {})
}
<reponame>cyrille-blanchet-19... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResUsers(models.Model):
_inherit = 'res.users'
resource_ids = fields.One2many(
'resource.resource', 'user_id', 'Resources')
resource_calendar_id = fields.Many2... | Python | 1 |
tal_bytes_per_tag_cpu * mask)
for tag, index in self.dataset.tag_to_index.items():
tag_micro_loss[tag] = float(mean_loss_per_tag_cpu[index])
# no macro loss for the leaf tags
if self.bytes_per_token is not None:
tag_micro_bpb[tag] = float(mean_bits_per_tag_c... | Python | 1 |
"""
Write a python function to find the number of divisors of a given integer.
assert divisor(15) == 4
"""
def divisor(n):
count = 0
for i in range(1, n+1):
if n % i == 0:
count += 1
return count
print(divisor(15))
/python/00001-05000/01001-01500/01491_find_the_maximum_element_on_botto... | Python | 1 |
ailable:
alpha = n_tasks * torch.from_numpy(alpha).cuda()
else:
alpha = n_tasks * torch.from_numpy(alpha)
# Optimization step
optimizer.zero_grad()
task_losses = model(X, ts)
weighted_loss = torch.sum(task_losses * alpha) # * 5... | Python | 1 |
# -*- coding: utf-8 -*-
u"""
Created on 2015-7-13
@author: cheng.li
"""
from simpleutils import add_parent_path
add_parent_path(__file__, 3)
from simpleutils import TestRunner
from simpleutils import CustomLogger
import PyFin.tests.api as api
import PyFin.tests.Analysis as Analysis
import PyFin.tests.CashFlows as C... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2022 Google LLC. 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/licenses/LICENSE-2.0
#
# Unless requir... | Python | 1 |
}
// Sync the values to the array.
bindings::futhark_context_sync(ctx);
Ok(())
}
unsafe fn free<C>(ctx: C, ptr: *mut Self) -> ::std::os::raw::c_int
where
C: Into<*mut bindings::futhark_context>,
{
let ctx = ctx.into();
bindings::futhark_free_i64_1d(ctx, p... | Rust | 0 |
mple, you can't specify <code>*prod.example.com</code> or <code>prod*.example.com</code>.</p> </li>
/// <li> <p>The * can't replace any of the middle labels, for example, marketing.*.example.com.</p> </li>
/// <li> <p>If you include * in any position other than the leftmost label in a domain name, DNS treats it... | Rust | 0 |
_slice());
assert_eq!(dtb.is_ok(), true);
/* now parse them again from DTB to trees to test our DTB generation code is sound */
let parsed = dtb.unwrap().to_parsed();
assert_eq!(parsed.is_ok(), true);
let parsed = parsed.unwrap();
/* perform checks */
/* should... | Rust | 0 |
Storage, path: &[u8]) -> Result<bool, Self::ExistsErr>;
type GetErr;
fn get(&self, storage: Storage, path: &[u8]) -> Result<Vec<u8>, GetError<Self::GetErr>>;
}
#[derive(Debug)]
pub enum SetError<T> {
NoParentExists,
SerializationError(Box<dyn std::error::Error>),
Other(T)
}
#[derive(Debug)]
pub en... | Rust | 0 |
็ฒๅ็ๅฏฆIP
user_agent = "Streamlit App"
# ๅ่ฉฆไฝฟ็จๆๅๅฑค้ฒ่ก่ช่ญ
if SERVICES_AVAILABLE:
return _service_login(
username, password, ip_address, user_agent, remember_me
)
# ไฝฟ็จ็ฐกๅ่ช่ญ
return _simple_login(username, password, remember_me)
except Exception... | Python | 1 |
refixes::_66, 0x0F3832, 3),
SseOpcode::Pmovzxwd => (LegacyPrefixes::_66, 0x0F3833, 3),
SseOpcode::Pmovzxwq => (LegacyPrefixes::_66, 0x0F3834, 3),
SseOpcode::Pmovzxdq => (LegacyPrefixes::_66, 0x0F3835, 3),
SseOpcode::Sqrtps => (LegacyPrefixes::None, 0x0F51,... | Rust | 0 |
import logging
from functions.common import get_backup_name, clean_temp
from functions.db import do_backup, check_db
from functions.s3 import upload_file, clear_s3, check_s3
from conf.config import CommonConfig
import sys
logger = logging.getLogger(__name__)
def backup_function():
"""
ะะตัะตะฑะธัะฐะตะผ ะบะฐะถะดัั ะฑะฐะทั ... | Python | 1 |
interrupt, CorePeripherals, Peripherals};
use wio::prelude::*;
use wio::{button_interrupt, entry, Button, ButtonController, ButtonEvent, Pins, Sets};
use cortex_m::interrupt::{free as disable_interrupts, CriticalSection};
use heapless::consts::U8;
use heapless::spsc::Queue;
#[entry]
fn main() -> ! {
let mut peri... | Rust | 0 |
_0101 = 5,
#[doc = "6: Bus clock * 7"]
_0110 = 6,
#[doc = "7: Bus clock * 8"]
_0111 = 7,
#[doc = "8: Bus clock * 9"]
_1000 = 8,
#[doc = "9: Bus clock * 10"]
_1001 = 9,
#[doc = "10: Bus clock * 11"]
_1010 = 10,
#[doc = "11: Bus clock * 12"]
_1011 = 11,
#[doc = "12:... | Rust | 0 |
elf {
Shape::aabb(aabb)
}
}
impl From<Poly> for Shape {
fn from(poly: Poly) -> Self {
Shape::poly(poly)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn line_seg_test() {
assert_eq!(seg_seg_query(Vec2::new(0.0, 0.0), Vec2::new(3.0, 1.0), Vec2::new(2.0, 1.0), Vec2::... | Rust | 0 |
onment, file_extension: str) -> str:
languages = env.project.files.language_mapping
lang = languages.get(file_extension) # If the suffix matches a defined one in the languages table
if lang is None:
return file_extension.replace(".", "") # If it didn't find a match, return the suffix only
ret... | Python | 1 |
subkey_with_flags(parent_key, KEY_READ))
.and_then(|program_key| program_key.get_value("ParentKeyName"))
.and_then(|parent_key: String| {
parent_key_value = parent_key;
Ok(())
});
if parent_key_value != "" {
add_program = false;
... | Rust | 0 |
stomizableGetCampaignLevelReports<M, I> {
org_id: u64,
reporting_request: ReportingRequest,
phantom_m: PhantomData<M>,
phantom_i: PhantomData<I>,
}
impl<M, I> CustomizableGetCampaignLevelReports<M, I> {
pub fn new(org_id: u64, reporting_request: ReportingRequest) -> Self {
Self {
... | Rust | 0 |
"""
Tests for functionality in openedx/core/lib/courses.py.
"""
from django.test.utils import override_settings
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from ..courses import course_image_url
class CourseImageTestCase(Modu... | 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 |
"""
ไฟฎๅคไปปๅก็ถๆๅฝไปค
ๆญคๅฝไปค็จไบไฟฎๅคไปปไฝๅกๅจprocessing_completed็ถๆ็ไปปๅก๏ผๅนถๅฐๅ
ถๆดๆนไธบๆญฃ็กฎ็็ถๆ
"""
import logging
import json
from django.core.management.base import BaseCommand
from django.utils import timezone
from templateImage.models import ComfyUITask, ImageUploadRecord
from templateImage.queue_service_singleton import queue_service
from template... | Python | 1 |
ry) > 1 and (datetime.now() - history[-1]) > timedelta(seconds=10):
print(f"Job {job_id} is overdue")
# Example usage
scheduler = JobScheduler()
# Submit jobs
job1 = Job(1, 1, datetime.now() + timedelta(seconds=20))
job2 = Job(2, 2, datetime.now() + timedelta(seconds=15), [1])
job3 = Job(3, 3, datetim... | Python | 1 |
AsyncRead + Unpin>(stream: &mut T) -> Result<(u32, Vec<u8>)> {
use smol::io::AsyncReadExt;
let mut buf_single: [u8; 1] = [!0];
let mut buf: Vec<u8> = vec![];
// recieve empty byte preamble
trace!("waiting for preamble");
let len = stream.read(&mut buf_single).await?;
if len == 0 {
... | Rust | 0 |
().no_default_profile;
// Collect syscall names from strace file
let file =
File::open(&path).context(format!("failed to open strace log: {}", &path.display()))?;
let mut syscalls: HashMap<NonNulString, SyscallRule> = HashMap::new();
// unwrap(): Creating regex from constant expression will nev... | Rust | 0 |
True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_use_modindex = True
# If false, no index is generated... | Python | 1 |
{idx}/{len(train_iter)}], "
f"Train loss :{loss.item():.3f}, Train acc: {acc:.3f}")
end_time = time.time()
train_loss = losses / len(train_iter)
logging.info(f"Epoch: {epoch}, Train loss: {train_loss:.3f}, Epoch time = {(end_time - start_time):.3f}s")
if (epo... | Python | 1 |
"""Author Anurag Kumar | anuragkumarak95@gmail.com | git/anuragkumarak95
Simple example of Fractal generation using recursive function.
What is Sierpinski Triangle?
>>The Sierpinski triangle (also with the original orthography Sierpinski), also called the Sierpinski gasket or the Sierpinski Sieve,
is a fractal and a... | Python | 1 |
# Copyright (c) 2021 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/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 1 |
urn False
return True
@staticmethod
def text_match(
textMatch: TextMatch, ocrResults: List[OcrResult]
) -> Position | None:
"""
ๆๆฌๅน้
:param textMatch: ๆๆฌๅน้
:param ocrResults: ocr ่ฏๅซ็ปๆ
:return:
"""
for ocr_result in ocrResults:
... | Python | 1 |
ntTemplate {
let collection = CssCollection::new();
ComponentTemplate {
name: file!(),
css_path: "/account/releases/new",
template: html! {
h1 { "Draft a release for " a href={"/account/projects/"(project_name)} {(project_name)} }
form method="post" action="/api/releases/new" class="two-c... | Rust | 0 |
arguments['events'][event_key].append(
(argument['start']+1, min(argument['end'], cut_off)+1, argument2idx[role]))
triggers_entities_ids=[trigger_entities2idx[i] for i in triggers_entities]
if pad_size:
... | Python | 1 |
offset_x: i32,
offset_y: i32,
) {
unsafe {
ffi::gdk_window_input_shape_combine_region(
self.to_glib_none().0,
shape_region.to_glib_none().0,
offset_x,
offset_y,
);
}
}
#[doc(alias = "gdk_... | Rust | 0 |
),
(vec!["hello", "", "word"], -3, Some(1), vec!["l", "", "o"]),
(vec!["hello", "", "word"], -3, Some(2), vec!["ll", "", "or"]),
(
vec!["hello", "", "word"],
-3,
Some(3),
vec!["llo", "", "ord"],
),
... | Rust | 0 |
"""
@Author: Chunel
@Contact: chunel@foxmail.com
@File: T04-Complex
@Time: 2025/3/2 23:43
@Desc:
"""
from PyCGraph import GPipeline, GCluster, GRegion
from MyGNode.MyNode1 import MyNode1
from MyGNode.MyNode2 import MyNode2
def tutorial_complex():
pipeline = GPipeline()
b1, b2, b3 = MyNode1('nodeB1'), MyNod... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.