text string | label_name string | labels int64 |
|---|---|---|
import FWCore.ParameterSet.Config as cms
##########################################################
# produce generated paricles in acceptance #
##########################################################
higenp = cms.EDFilter("PdgIdAndStatusCandViewSelector",
status = cms.vint32(3),
src = cms.In... | Python | 1 |
if further_regressors.len() != 0 {
panic!("RegSigmoid can only be at the end of the chain!");
}
// vowpal compatibility
if wsum.is_nan() {
eprintln!("NAN prediction in example {}, forcing 0.0", fb.example_number);
return (logistic(0.0), 0.0);
... | Rust | 0 |
"
String
└─ `before+after`
"#,
false,
);
}
#[test]
fn _0005() {
let scope = scope!();
accept(
&scope,
StartTextualExpression,
r#" "before\U00002Bafter" "#,
r#"
String
└─ `before+after`
"#,
false,
);
}
#[test]
fn _0006() {
let scope = scope!();
ac... | Rust | 0 |
st_confirm_human_sets_session(self):
self.assertFalse(self.experiment_user.session.get(conf.CONFIRM_HUMAN_SESSION_KEY, False))
self.experiment_user.confirm_human()
self.assertTrue(self.experiment_user.session.get(conf.CONFIRM_HUMAN_SESSION_KEY, False))
def test_session_already_confirmed(sel... | Python | 1 |
_should_convert_string_slices_to_locomotive_types() {
let locomotive_type = "STEAM_LOCOMOTIVE".parse::<LocomotiveType>();
assert!(locomotive_type.is_ok());
assert_eq!(
locomotive_type.unwrap(),
LocomotiveType::SteamLocomotive
);
}
... | Rust | 0 |
args = token.split_contents()
if not len(args) in (2, 3):
raise template.TemplateSyntaxError(
"%r tag requires either one or two arguments." % args[0])
kind = args[1]
if not kind in COMPRESSORS.keys():
raise template.TemplateSyntaxError(
"%r's argument must be 'js'... | Python | 1 |
threading.Thread(target=run_and_reenable, daemon=True).start()
btn = tk.Button(root, text=text, width=42, font=btn_font,
bg="#DFFFE0", activebackground="#C8F7C5",
command=_pick_and_compare)
btn.pack(pady=6)
botones.append(btn)
tk... | Python | 1 |
l_comments'),
func.sum(Publication.shares).label('total_shares'),
func.avg(Publication.engagement_rate).label('avg_engagement')
).filter(Publication.published_at >= cutoff_date).first()
# Top performing posts
top_posts = db.query(Publication).filter(
... | Python | 1 |
def test_stable_diffusion_dpm(self):
sd_pipe = StableDiffusionPipeline.from_pretrained(
'CompVis/stable-diffusion-v1-4', safety_checker=None)
sd_pipe.scheduler = DPMSolverMultistepScheduler.from_config(sd_pipe.
scheduler.config, final_sigmas_type='sigma_min')
sd_pipe = sd_pipe.to(torch_devic... | Python | 1 |
shelf' % self.shelf_alt[index],
'retrieve the stack of bank notes from the %s of the safe'
% self.shelf[index],
'locate the money on the %s shelf, grasp it, remove if from the'
' safe, and set it on the table' % self.shelf[index],
'put the... | Python | 1 |
sum = 0
try:
file = open('C:\\Users\\KimiNikolov\\Desktop\\python-advanced-softuni\\python-advanced\\file-handling\\numbers.txt', 'r')
for line in file.readlines():
sum += int(line)
print(sum)
except FileNotFoundError:
print("File not found") | Python | 1 |
class Solution:
def numberOfSubstrings(self, s: str) -> int:
ans = 0
count = collections.Counter()
for c in s:
ans += count[c] + 1
count[c] += 1
return ans
| Python | 1 |
G = 0
F = 0
key_stream = [0] * 256
key_state = [0] * 256
key_output = 0
key_offset = 0
key_modulus = 0
e = 0
R = 0
def generate_keystream(output=True):
global G, F, key_stream, key_state, key_output, key_modulus, key_offset, e, R
oldG = G
G = G - 1
if (oldG == 0):
key_modulus += 1
key_... | Python | 1 |
h", "Fdf", "Brl", "Skbl", "Rås", "Bäf", "Ed", "Ko"]
# m_train_route = ["Gsv", "Or1", "Or", "Gbm", "Agb", "Sue", "Bhs", "Nöe", "Nol", "Än", "Alh", "Les", "Tbn", "Vpm", "Veas", "Thn", "Öx", "Bjh", "Fdf", "Brl", "Skbl", "Rås", "Bäf", "Ed", "Ko"]
# m_train_route = ["G", "Or", "Or1", "Gsv", "Säv", "Sel", "P", "Jv", ... | Python | 1 |
*mut ::std::os::raw::c_char,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct tm_https_progress_t {
pub content_length: u64,
pub content_received: u64,
pub speed: f32,
pub cancel: bool,
pub _padding_225: [::std::os::raw::c_char; 3usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct tm_... | Rust | 0 |
= "*Required features: `\"Networking\"`*"]
#[repr(transparent)]
pub struct HostNameType(pub i32);
impl HostNameType {
pub const DomainName: Self = Self(0i32);
pub const Ipv4: Self = Self(1i32);
pub const Ipv6: Self = Self(2i32);
pub const Bluetooth: Self = Self(3i32);
}
impl ::core::marker::Copy for Ho... | Rust | 0 |
SET_PLACEHOLDER: jql_ecode_t = 87003;
#[doc = "< Invalid regular expression (JQL_ERROR_REGEXP_INVALID)"]
pub const jql_ecode_t_JQL_ERROR_REGEXP_INVALID: jql_ecode_t = 87004;
pub const jql_ecode_t_JQL_ERROR_REGEXP_CHARSET: jql_ecode_t = 87005;
pub const jql_ecode_t_JQL_ERROR_REGEXP_SUBEXP: jql_ecode_t = 87006;
pub const... | Rust | 0 |
fStudent):
print(f"Enter {i + 1} student details:")
name = input("Enter student name: ")
mathGrade = self.getGrade("Math")
scienceGrade = self.getGrade("Science")
languageGrade = self.getGrade("Language")
dramaGrade = self.getGrade("Drama")
... | Python | 1 |
ose()
T2 = views[j].T[:, None]
c1 = -R1.transpose() @ T1
c2 = -R2.transpose() @ T2
t = np.random.rand(1).item()
c = (1 - t) * c1 + t * c2
R = slerp(R1, R2, t)
T = -R @ c
pseudo_view = PseudoCamera(R=R.T, T=T.squeeze(1), FoVx=views[i].FoVx, FoVy=views[i... | Python | 1 |
lse {
Result::Err(msg.to_string())
}
}<gh_stars>10-100
use crate::core_impl::info_extractor::AttrSigInfo;
use syn::{ImplItemMethod, Type, Visibility};
/// Information extracted from `ImplItemMethod`.
pub struct ImplItemMethodInfo {
/// Information on the attributes and the signature of the method.
... | Rust | 0 |
/// configuration value which says how to handle `git submodule update`
/// for this submodule. The value is usually set in the ".gitmodules"
/// file and copied to ".git/config" when the submodule is initialized.
#[derive(Debug)]
pub enum SubmoduleUpdate {
/// The default; when a submodule is updated, checkout th... | Rust | 0 |
import os
import os.path as ospath
from .distributed import global_batch_size
def get_config_arg(config, name):
if hasattr(config, name):
value = getattr(config, name)
if value is not None:
return value
if name in os.environ:
return os.environ[name]
return None
def ... | Python | 1 |
ordered: true,
bypass_document_validation: false,
}
}
}
impl Insert {
pub(crate) fn into_mongoc(self) -> Result<Bsonc> {
let d = doc! {
"ordered": self.ordered,
"bypassDocumentValidation": self.bypass_document_validation,
};
Bsonc::fro... | Rust | 0 |
t_eq!(is_valid("()[]{}".to_string()), true);
assert_eq!(is_valid("(]".to_string()), false);
assert_eq!(is_valid("([)]".to_string()), false);
assert_eq!(is_valid("{[]}".to_string()), true);
}
<gh_stars>100-1000
/*
Copyright 2013 Jesse 'Jeaye' Wilkerson
See licensing in LICENSE file, or at:
ht... | Rust | 0 |
nst LINEPROXYSTATUS_CLOSE: u32 = 2u32;
#[doc = "*Required features: 'Win32_Devices_Tapi'*"]
pub const LINEPROXYSTATUS_OPEN: u32 = 1u32;
#[doc = "*Required features: 'Win32_Devices_Tapi'*"]
pub const LINEQOSREQUESTTYPE_SERVICELEVEL: u32 = 1u32;
#[doc = "*Required features: 'Win32_Devices_Tapi'*"]
pub const LINEQOSSERVIC... | Rust | 0 |
es of the `#[derive(GetStaticEquivalent)]` macrp.
#[derive(Default)]
pub(super) struct GetStaticEquivAttrs<'a>{
pub(super) impl_interfacetype:Option<ImplInterfaceType>,
pub(super) debug_print:bool,
_marker:PhantomData<&'a ()>,
}
/// Parses the helper attributes of the `#[derive(GetStaticEquivalent)]` macr... | Rust | 0 |
class Solution:
def maxSumTwoNoOverlap(self, nums: List[int], firstLen: int, secondLen: int) -> int:
def helper(l: int, r: int) -> int:
n = len(nums)
left = [0] * n
summ = 0
for i in range(n):
summ += nums[i]
if i >= l:
summ -= nums[i - l]
if i >= l - 1:
... | Python | 1 |
Eval {step}: {eval_time:0.3f}s., {rays_per_sec:0.0f} rays/sec')
summary_writer.scalar('test_psnr', psnr, step)
#summary_writer.scalar('test_ssim', ssim, step)
summary_writer.image('test_pred_color', pred_color, step)
#for k, v in vis_suite.items():
#summary_writer.image('test_p... | Python | 1 |
sonuc = 0
while True:
sayi = input("Sayiyi giriniz: ")
kuvvet = input("Ussu giriniz: ")
if sayi.isdigit() and kuvvet.isdigit():
sayi = int(sayi)
kuvvet = int(kuvvet)
sonuc = sayi ** kuvvet
break
else:
print("Lutfen sayi giriniz")
print(sonuc) | Python | 1 |
ry: Optional[str] = None
def _remove_auth_from_netloc(self, netloc: str) -> str:
if "@" not in netloc:
return netloc
user_pass, netloc_no_user_pass = netloc.split("@", 1)
if (
isinstance(self.info, VcsInfo)
and self.info.vcs == "git"
and user_... | Python | 1 |
TestContainer::check_bytes(bytes![41u8, 0u8, 0u8, 0u8].cast(), &mut TestContext(42))
.unwrap_err();
}
}
#[test]
fn test_unsized() {
unsafe {
<[i32] as CheckBytes<()>>::check_bytes(
&[1, 2, 3, 4] as &[i32] as *const [i32],
... | Rust | 0 |
Queue, n: ThreadId, rq: RunqueueId) -> RunQueue {
// debug_assert!(n < N_THREADS);
// debug_assert!(rq < N_QUEUES);
let RunqueueId(rq_u8) = rq;
let RunQueue(mut bitcache, mut queues) = y;
bitcache = bitcache | (1u32 << (rq_u8 as u32));
queues = clist_push(queues, n, rq);
RunQueue(bitcache, q... | Rust | 0 |
# These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/raindrops/canonical-data.json
# File last updated on 2023-07-19
import unittest
from raindrops import (
convert,
)
class RaindropsTest(unittest.TestCase):
def test_the_sound_for_1_i... | Python | 1 |
return path2
class LogMiddleware:
"""WSGI middleware for logging the status."""
def __init__(self, app):
self.app = app
self.format = '%s - - [%s] "%s %s %s" - %s'
f = BytesIO()
class FakeSocket:
def makefile(self, *a):
return f
# t... | Python | 1 |
from dolfin import *
from dolfin_adjoint import *
parameters["adjoint"]["cache_factorizations"] = True
mesh = UnitSquareMesh(3, 3)
V = FunctionSpace(mesh, "R", 0)
test = TestFunction(V)
trial = TrialFunction(V)
def main(m, n):
u = interpolate(Constant(0.1), V, name="Solution")
F = inner(u*u, test)*dx - inn... | Python | 1 |
no builtin! make a default one. Give them None, at least.
builtin = module.Module(space, None)
space.setitem(builtin.w_dict, space.newtext('None'), space.w_None)
return builtin
def setup_after_space_initialization(self):
"""NOT_RPYTHON"""
space = self.space
# insta... | Python | 1 |
Cycle(c2) => Cycle(c1 + c2),
},
}
}
}
impl AddAssign for Duration {
#[inline]
fn add_assign(&mut self, rhs: Duration) {
*self = *self + rhs;
}
}
impl Sub for Duration {
type Output = Duration;
#[inline]
fn sub(self, rhs: Duration) -> Duration {
match se... | Rust | 0 |
# Generated by Django 1.11.15 on 2019-04-03 15:13
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0165_add_draft_version_field'),
]
operations = [
migrations.AlterField(
m... | Python | 1 |
start0,
step0,
pos1.get(),
interp_dim1,
start1,
step1,
method as c_uint,
off_grid,
);
HANDLE_ERROR(AfError::from(err_val));
temp.into()
}
}
/// Same as [approx2_uniform](./fn.approx2_uniform.htm... | Rust | 0 |
ode='test'))
ray_keys = ['rays_o', 'rays_d', 'viewdirs', 'radii', 'lossmult', 'near', 'far']
train_pipeline = [
dict(type='MipMultiScaleSample',
keys=['target_s'] + ray_keys,
N_rand=N_rand_per_sampler),
dict(type='GetZvals',
enable=True,
lindisp=lindisp,
N_samples=n... | Python | 1 |
ractive=True,
)
filter_radius1 = gr.Slider(
minimum=0,
maximum=7,
label=i18n(
">=3则使用对harvest音高识别的结果使用中值滤波,数值为滤波半径,使用可以削弱哑音"
),
... | Python | 1 |
update_sample_to_chunk(&mut self, chunk_id: u32) {
if let Some(ref entry) = self.trak.mdia.minf.stbl.stsc.entries.last() {
if entry.samples_per_chunk == self.chunk_samples {
return;
}
}
let entry = StscEntry {
first_chunk: chunk_id,
... | Rust | 0 |
0x05800640,
int(float_to_hex(crate.rot_x), 16),
int(float_to_hex(rotation), 16),
int(float_to_hex(crate.rot_z), 16),
0,
(0xB5 << 16) | selected_id,
... | Python | 1 |
_sentiments": customer_sentiments,
# "sentiment_lists": sentiment_lists
# })
# except Exception as e:
# print(f"Error in /analyze route: {e}") # Log the error
# return jsonify({"error": f"An unexpected error occurred: {e}"}), 500
# Direct file input analysis for testing
def a... | Python | 1 |
"failed to parse xml");
let syn = channel.syndication_ext().unwrap();
assert_eq!(syn.period(), &syndication::UpdatePeriod::HOURLY);
assert_eq!(syn.frequency(), 2);
assert_eq!(syn.base(), "2000-01-01T12:00+00:00");
}
#[test]
fn read_escaped() {
let input = r#"
<rss version="2.0">
... | Rust | 0 |
import random
from typing import Optional, Sequence
import numpy as np
from fuse.data.ops.op_base import OpBase
from fuse.utils import NDict
class OpAugOneHot(OpBase):
"""
Apply an augmentation for an one-hot encoding vector.
Op supports the following modes:
mode == "default":
replace the c... | Python | 1 |
PixelFormat::EightBit
} else {
PixelFormat::FourBit
}
}
pub fn get_tilesize(&self) -> u32 {
if self.get_colors() != 0 { 64 } else { 32 }
}
}
io_register! (
BGOffset => 2, [0x4000010, 0x4000012, 0x4000014, 0x4000016, 0x4000018, 0x400001A, 0x... | Rust | 0 |
also fine
let route = get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &nodes[2],
Some(InvoiceFeatures::known()), None, &Vec::new(), 290_000, 42, Arc::clone(&logger)).unwrap();
assert_eq!(route.paths.len(), 3);
let mut total_amount_paid_msat = 0;
for path in &route.paths {
a... | Rust | 0 |
in the users home directory
pub fn get_config_path() -> PathBuf {
let mut path = dirs::home_dir().unwrap();
path.push(".ocular");
path.push("config.toml");
path
}
async fn get_default_chains() -> Result<Vec<ChainInfo>, Error> {
let mut chains = Vec::<ChainInfo>::with_capacity(2);
match regis... | Rust | 0 |
"transform the PNG/Unicorn cartridge in P8",
"FILE");
opts.optflagopt("s", "scale", "scale the display", "VALUE");
opts.optflagopt("b", "bind", "bind a server on a specific address", "ADDR");
opts.optflag("v", "verbose", "Debug mode level");
opts.optflag("h", "help", ... | Rust | 0 |
}
#[test]
fn access(){
let reference = StaticRef::new(&8);
assert_eq!(*reference.get(), 8);
unsafe{
assert_eq!(*reference.get_raw(), 8);
}
}
#[test]
fn transmutes(){
let reference = StaticRef::new(&(!0u32));
unsafe{
... | Rust | 0 |
ub struct MultiQuery {
pub concurrency_levels: Vec<u32>,
pub database_verifier: Box<dyn DatabaseInterface>,
}
impl Query for MultiQuery {}
impl Executor for MultiQuery {
fn wait_for_database_to_be_available(&self) {
self.database_verifier.wait_for_database_to_be_available();
}
fn retrieve_b... | Rust | 0 |
@position
#[doc = "A table for substituting glyphs in a chaining context in format 3."]
pub ChainContextSubstitution3 { // ChainContextSubstFormat3
format (u16), // SubstFormat
backward_glyph_count (u16), // BacktrackGlyphCount
backward_coverage_offsets (Vec<u16>) |th... | Rust | 0 |
import MetaTrader5 as mt5
import pandas as pd
import numpy as np
from datetime import datetime, timedelta, time, timezone
import time as ptime
# === CONFIGURATION ===
LOGIN = 240512732
PASSWORD = "Mgi@2005"
SERVER = "Exness-MT5Trial6"
SYMBOL = "XAUUSDm"
TIMEFRAME = mt5.TIM... | Python | 1 |
# tigrbl/v3/runtime/atoms/storage/__init__.py
from __future__ import annotations
from typing import Any, Callable, Dict, Optional, Tuple
import logging
# Atom implementations (model-scoped)
from . import to_stored as _to_stored
# Runner signature: (obj|None, ctx) -> None
RunFn = Callable[[Optional[object], Any], Non... | Python | 1 |
import os
# Получение списка админов из переменных окружения
ADMIN_IDS = [int(x) for x in os.getenv('ADMIN_IDS', '123456789').split(',')]
def is_admin(user_id: int) -> bool:
"""Проверяет, является ли пользователь администратором"""
return user_id in ADMIN_IDS | Python | 1 |
return boxType == WhiteTigerLootBoxes.WT_TANK
def _convertToBonuses(rewards):
boxBonuses = BattlePassAwardsManager.composeBonuses([rewards])
group = {'byProbabilities': {}}
for boxBonus in boxBonuses:
oldBonusGroup, probability, bonuses = _convertBonusGroup([boxBonus])
prob = 0
... | Python | 1 |
data) {
Entry::Occupied(e) => {
debug!("Found cached PCK certificate");
e.into_mut()
}
Entry::Vacant(e) => {
let pckcert = get_pckcert(e.key())?;
e.insert(pckcert)
}
}
.clone();
if pc... | Rust | 0 |
()> {
// Create a new ReQL client
let r = Client::new();
// Create a connection pool
let conn = r.connect(Config::default())?;
// Run the query
let query = r.db("test")
.table("test")
.filter(args!(|doc| {
// Filter only documents which match our current TestItem t... | Rust | 0 |
# example usage mein values daal ke test karlo for now, irl version mein data app se aa raha hoga
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
import numpy as np
df = pd.read_csv("Sleep_Efficiency.csv")
df = df[["Age", "Sleep duration", "S... | Python | 1 |
adline():
if ptn.match(line):
try:
return float(re.split('[^0-9.]+', line)[1])
except (ValueError, IndexError):
continue
def do_jct_hint(logdir, network, batch_size, per_iter, target, tag):
"""Calculate JCT for target time"""
... | Python | 1 |
by_hash(hash, shard)
}
fn on_block_imported(&self, hashes: &[Self::Hash], block_hash: SidechainBlockHash) {
self.pool.validated_pool().on_block_imported(hashes, block_hash);
}
fn rpc_send_state(&self, hash: Self::Hash, state_encoded: Vec<u8>) -> Result<(), Error> {
self.rpc_responder
.send_state(hash, stat... | Rust | 0 |
mpl crate::Writable for HPTALR {}
#[doc = "SNVS_HP Time Alarm LSB Register"]
pub mod hptalr;
#[doc = "SNVS_LP Lock Register\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... | Rust | 0 |
k
cur[1]+=1
if cur[1]>=len(inList_a[cur[0]]):
cur[0]+=1
cur[1]=0
pos=nextStart[:]
prefix=''
while pos[0]<cur[0] or (pos[0]==cur[0] and pos[1]<cur[1]):
prefix+=inList_a[pos[0]][pos[1]]
pos[1]+=1
if pos[1]>=len(inList_a[... | Python | 1 |
return equal;
}}
public int hashCode() {{
return (int)mNativeObj;
}}
"#,
class = class_name
)
.as_bytes()
.iter()
.copied(),
);
});
swig_gen.expand_many("flap... | Rust | 0 |
e references:\n"
+ "\n".join(
f" {i}. {pname}.instances[{iname!r}]"
for i, (pname, iname) in enumerate([*dependency_tree, plugin_instance], 1)
)
),
)
if plugin_instance in state._instance_dependencies:
for target_p... | Python | 1 |
nt.from_bytes(data_reader.read(8), "little")
scaled_trunc_tokens_per_trunc_sat = int.from_bytes(data_reader.read(8), "little")
min_accepted_scaled_trunc_tokens = int.from_bytes(data_reader.read(8), "little")
enforced_locktime = int.from_bytes(data_reader.read(4), "little")
maker_pk = data_reader.read(33... | Python | 1 |
use std::collections::HashSet;
// use seed::*;
use crate::*;
use std::{hash::Hash, rc::Rc};
#[derive(Debug, Clone)]
pub struct ReactiveContext {
pub key: StorageKey,
pub reactive_state_accessors: Vec<StorageKey>,
pub always_run: bool,
}
impl ReactiveContext {
pub fn new(key: StorageKey) -> ReactiveCon... | Rust | 0 |
_60500360.npz:img",
"SigLIP B/16 384": "gs://big_vision/siglip/webli_en_b16_384_68578854.npz:img",
"SigLIP B/16 512": "gs://big_vision/siglip/webli_en_b16_512_68580893.npz:img",
"SigLIP L/16 256": "gs://big_vision/siglip/webli_en_l16_256_60552751.npz:img",
"SigLIP L/16 384": "gs://big_vision/siglip/webl... | Python | 1 |
config)
# 在后台启动服务器
asyncio.create_task(server.serve())
logger.success(f"✅ Web界面已启动: http://{self.config['web']['host']}:{self.config['web']['port']}")
except Exception as e:
logger.error(f"❌ Web界面启动失败: {e}")
raise... | Python | 1 |
).last()
client.post('/control/event/dummy/dummy/waitinglist/', {'assign': wle.pk})
wle.refresh_from_db()
assert wle.voucher
@pytest.mark.django_db
def test_priority_single(client, env):
client.login(email='dummy@dummy.dummy', password='dummy')
with scopes_disabled():
wle = WaitingListEnt... | Python | 1 |
end.line as _), end.character as _);
if start_offset.is_none() || end_offset.is_none() {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Text edit range points past end of line.",
));
}
let start_ch... | Rust | 0 |
import os
import shutil
from collections import defaultdict
import subprocess
from concurrent.futures import ThreadPoolExecutor
from tqdm import tqdm
def get_frame_rate(file_path):
try:
result = subprocess.run(
['ffprobe.exe', '-v', 'error', '-select_streams', 'v:0', '-show_entries', 'stream=r... | Python | 1 |
from typing import List, Optional
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
import models
from database import get_db
import schemas
from crud import PlayServices
play_router = APIRouter(prefix="/play", tags= ["Play"])
@play_router.post("/", response_model= schemas... | Python | 1 |
sgx_root_enclave_sgx_ra_get_msg3_trusted)
};
let proc_msg2_ret = unsafe {
sgx_ra_proc_msg2(
*context,
enclave.geteid(),
bindgen_sgx_root_enclave_sgx_ra_proc_msg2_trusted,
bindgen_sgx_root_enclave_sgx_ra_get_msg3_trusted,
msg2,
msg2_... | Rust | 0 |
esponse = ""
# Stream the response
for chunk in streaming_response:
# Skip the initial delimiter
if isinstance(chunk, dict) and 'delim' in chunk:
continue
# Extract only the content from each ch... | Python | 1 |
has three SDT: FACP, APIC and HPET
pointer_to_other_sdt: u32,
}
impl RSDT {
pub fn get_num_sdt(&self) -> usize {
(self.header.length as usize - core::mem::size_of::<ACPISDTHeader>()) / 4
}
pub fn get_sdt_addresses(&self) -> &'static [u32] {
unsafe {core::slice::from_raw_parts(&self.pointer_to_other_sdt as *con... | Rust | 0 |
on_click=show_message,
args=(result,),
)
output = BytesIO()
workbook = xlsxwriter.Workbook(output, {'in_memory': True})
... | Python | 1 |
# Copyright 2011 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | Python | 1 |
from BanAllBot import app,START_IMG,BOT_USERNAME,BOT_NAME,LOG
from pyrogram import filters
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup , CallbackQuery
START_MSG="""
ʜᴇʏ **{}** , ɪ ᴀᴍ {},
I have some interesting plugins you should tru it by click on the Help Button.
Add me in others group to ... | Python | 1 |
import numpy as np
from sklearn.neighbors import NearestNeighbors
def smooth_point_cloud(point_cloud, k=4, smoothing_factor=1):
"""
Smooth a 3D point cloud using KNN-based smoothing.
Parameters:
- point_cloud (ndarray): Nx3 array representing the 3D point cloud.
- k (int): Number of nearest neighb... | Python | 1 |
import torch
import torch.nn as nn
class PostfuseModule(nn.Module):
def __init__(self, embed_dim, embed_dim_img):
super().__init__()
self.mlp1 = MLP(embed_dim_img, embed_dim, embed_dim, use_residual=False)
self.mlp2 = MLP(embed_dim, embed_dim, embed_dim, use_residual=True)
self.lay... | Python | 1 |
',
'user-agent':'Mozilla/5.0 (Linux; Android 8.1.0; CPH1912 Build/O11019) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/107.0.5304.91 Mobile Safari/537.36',
'content-type':'application/x-www-form-urlencoded; charset=UTF-8',
'referer':f'https://tuongtaccheo.com/kiemtien{loai}',
'cookie':f'{cookie}'
}
... | Python | 1 |
import turtle
drawing_board = turtle.Screen()
drawing_board.bgcolor("light blue")
drawing_board.title("Python Turtle")
turtle_instance = turtle.Turtle()
def turtle_forward():
turtle_instance.forward(100)
def turn_right():
turtle_instance.setheading(turtle_instance.heading()-10)
#turtle_instance.right(10... | Python | 1 |
from typing import Any
from models import CoursesLecturersOrm
from .base import BaseModelView
class CourseLecturerAdmin(BaseModelView, model=CoursesLecturersOrm):
name = "Course Lecturer"
name_plural = "Courses Lecturers"
icon = "fas fa-archive"
pk_columns = [CoursesLecturersOrm.id]
form_ajax_refs... | Python | 1 |
_subscribeFinalisedHeads")
)]
fn subscribe_finalized_heads(&self, metadata: Self::Metadata, subscriber: Subscriber<Header>);
/// Unsubscribe from finalized head subscription.
#[pubsub(
subscription = "chain_finalizedHead",
unsubscribe,
name = "chain_unsubscribeFinalizedHeads",
alias("chain_unsubscribeFinal... | Rust | 0 |
rdinates/LIB/N64_GFX.INC#L38 for an assembly version of this
unsafe {
VI_BASE_REG.add(RegisterOffset::Status as usize >> 2).write_volatile(12878);
VI_BASE_REG.add(RegisterOffset::VIntr as usize >> 2).write_volatile(2);
VI_BASE_REG.add(RegisterOffset::Timing as usize >> 2).wr... | Rust | 0 |
def recursive():
def solve(arr, index, k):
if index == 0:
return 0
min_energy = float('inf')
for j in range(1, k + 1):
if index - j >= 0:
energy = solve(arr, index - j, k) + abs(arr[index] - arr[index - j])
min_energy = min(min_energy,... | Python | 1 |
coratedInsertRecord<Tab>,
{
type InsertStatement = BatchInsertStatement<Tab, Self, Op, NoReturningClause>;
fn into_insert_statement(self, target: Tab, operator: Op)
-> Self::InsertStatement
{
BatchInsertStatement {
operator: operator,
target: target,
reco... | Rust | 0 |
: deps.api.addr_humanize(&state.owner)?.to_string(),
receiver: deps.api.addr_humanize(&state.receiver)?.to_string(),
bank: deps.api.addr_humanize(&state.bank)?.to_string(),
bridge: deps.api.addr_humanize(&state.bridge)?.to_string(),
})
}
fn query_balance(deps: Deps, env: Env) -> StdResult<Balance... | Rust | 0 |
from django.core.management.base import BaseCommand
from books.models import Book
from books.utils import get_real_book_content_from_external_sources
class Command(BaseCommand):
help = 'Обновляет содержимое всех книг, получая реальные тексты из внешних источников (Флибуста, LibGen)'
def handle(self, *args... | Python | 1 |
#!/usr/bin/env python3
import sys
import os
import pyhidra
try:
from pyhidra import open_program
except ImportError:
print("ERROR: Pyhidra not installed. Run: pip install pyhidra")
sys.exit(1)
def main():
if len(sys.argv) != 4:
print("Usage: explore_ast_panic.py <binary_path> <start_address_he... | Python | 1 |
a composable string
",
common_opts!()
);
lazy_static! {
static ref AMBIG_DNA: HashMap<u8, Vec<u8>> = hashmap!{
b'M' => b"ACM".to_vec(),
b'R' => b"AGR".to_vec(),
b'W' => b"ATW".to_vec(),
b'S' => b"CGS".to_vec(),
b'Y' => b"CTY".to_vec(),
b'K' => b"GTK".to_vec(),
... | Rust | 0 |
as usize * 4];
process_scanlines(
&header,
&mut scanline_data,
&mut output_rgba,
&ancillary_chunks,
pixel_type,
)?;
Ok((header, output_rgba))
}
#[cfg(feature = "apng")]
pub mod apng {
use super::*;
#[derive(Debug)]
struct AnimationChunk{
num_frames: u32,
... | Rust | 0 |
ker.MagicMock(
ci_gcs_credentials="",
pre_release=False,
connector=mocker.MagicMock(
code_directory="path/to/connector",
metadata={"dockerImageTag": "1.2.3", "remoteRegistries": {"pypi": {"enabled": pypi_enabled, "packageName": "test"}}},
),
python_registr... | Python | 1 |
n notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE... | Rust | 0 |
}
second_socket.write_all(thumbnail_data.as_slice()).unwrap();
match second_socket.flush() {
Ok(_) => Ok(()),
Err(e) => Err(format!("failed to flush data written to tcp stream: {:?}", e)),
}
}
fn handle_thumbnail_over_fs(width: usize, height: usize, crop: bool,
... | Rust | 0 |
_string(),
hostname: hostname().unwrap_or_default(),
ip_address: get_local_ip().unwrap_or_default(),
}
}
fn version() -> (Version, Option<String>) {
match version_info() {
None => (Version::Unknown, None),
Some(v) => (
Version::Semantic(
v.dwMajorVers... | Rust | 0 |
try!(translate_string_expr(st, txt));
Ok(onion.subst_term(spine::Term::Cont(result_cont, vec![val])))
},
}
}
fn translate_branch_expr_tail<F1, F2>(
st: &mut ProgSt, env: &Env,
cond: &spiral::Expr,
then_branch: F1,
else_branch: F2) -> Res<spine::Term>
where F1: Fn(&mut ProgSt, &Env, spine::Val) -> ... | Rust | 0 |
l the screen and draw the road background
screen.fill(background_colour)
road_image()
# Draw the car
car(x, y)
# Display the score and cars passed
display_score(car_passed, score, level)
# Draw the obstacle and move it down the screen
draw_obstacle(obst... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.