text string | label_name string | labels int64 |
|---|---|---|
)[None, :]
bottom_edges, _ = torch.max(in_height_coords, dim=-1)
in_height_coords = in_height_coords + height * (~in_height)
top_edges, _ = torch.min(in_height_coords, dim=-1)
# Get left and right edges
in_width, _ = torch.max(masks, dim=-2)
in_width_coords = in_width * torch.arange(width, devi... | Python | 1 |
let (segment_id, size) = value?;
result.insert(segment_id, size);
}
Ok(result)
}
fn move_segment_grids(conn: &Connection, src_segment_id: i64, dst_segment_id: i64,
shift: Vec2i) -> rusqlite::Result<usize> {
conn.execute_named(
MOVE_SEGMENT_GRIDS,
named_params! ... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import argparse
from paq.evaluation.eval_utils import metric_max_over_ground_truths, exact_match_scor... | Python | 1 |
![];
match __request.body(__body) {
Ok(request) => Ok((request, crate::ResponseBody::new)),
Err(err) => Err(crate::RequestError::Http(err)),
}
}
/// Use `<GetSchedulingV1alpha1APIResourcesResponse as Response>::try_from_parts` to parse the HTTP response body of [`get_scheduling_v1alpha1_api_res... | Rust | 0 |
source.async_resolve_media(
hass, "media-source://camera/camera.demo_camera", None
)
assert str(exc_info.value) == "Stream integration not loaded"
hass.config.components.add("stream")
with pytest.raises(media_source.Unresolvable) as exc_info:
await media_source.async_resolve_me... | Python | 1 |
old_member.name {
// Some((&new_member.name, &old_member.name))
// } else {
// None
// };
//
// let nickname_change = match (old_nickname, new_nickname) {
// (Some(old_nick), Some(new_nick)) => Some((old_nick, new_nick)),
... | Rust | 0 |
8\xc2\xd6F\xce\xce4\xfa\x1bD\
\x0bF|LjW\xc7ABI\x9a\xd0\xf6\x0e\x0d\xf4\
M\x84\x0c\x14Z\x93[K?xB\xaa\xe8hMW\
y\xb2\xdc\xd0v\x0a\xdb8\x828\x8a\xc4\xd3\xcc*\xba\
Z\xb1\xdc\xd7\x88\x12:\xda\x92'\xa0\xb4\xa3c@\xb4\
\xa7P\x8a$\xd4l\xad-Qd\x09;\xfb\x13f\x8b\
\x12\x10\xb4\x8a\xa5Q\xaaS\x14\x9aq=\xe3\x86\xcd\xd8\
\x82\xf5\xd6\x... | Python | 1 |
self.position);
let generation = scope
.world
.entities()
.meta
.get_unchecked(*entity as usize)
.generation;
let entity = Entity {
generation,
id: *entity,
};
... | Rust | 0 |
ruct which
/// was used to construct this `Repository`.
#[ inline ]
pub fn config (
& self,
) -> & RepositoryConfig {
& self.data.config
}
/// This is an accessor method for the `RepositoryCore` which holds the most
/// basic details about a repository
#[ inline ]
pub fn core (& self) -> & RepositoryCor... | Rust | 0 |
import os
import csv
import numpy as np
import torch
from torch import nn, optim
from tqdm import tqdm
from datetime import datetime
from dataset.mnist6000 import get_dataloader_6000 as get_dataloader
from model.resnet import get_resnet
def evaluate_accuracy(model, dataloader, device, sample_batches=10):
"""データロー... | Python | 1 |
= "shrink":
lora_weights_lst.append(
torch.rand(
(lora_nums, max_rank, hidden_size), # col-major
dtype=dtype,
).to(device))
# NOTE shrink kernel using torch.float32 as output type
# shrink op need a... | Python | 1 |
"""
===========
Shared axis
===========
You can share the x- or y-axis limits for one axis with another by
passing an `~.axes.Axes` instance as a *sharex* or *sharey* keyword argument.
Changing the axis limits on one Axes will be reflected automatically
in the other, and vice-versa, so when you navigate with the tool... | Python | 1 |
reader.sr as u32;
let mut test_sample = reader.samples_arr2()?;
let ch = test_sample.len_of(Axis(0)) as u16;
seed_from_u64(42);
let rand_resample = RandResample::new(1., sr as usize, 0.8, 1.2, 1024);
rand_resample.transform(&mut test_sample).unwrap();
write_wav_iter("../... | Rust | 0 |
=> unreachable!(),
/// }
/// }
///
/// # fn main() {
/// let g = Grammar::new(
/// tp!(EXPR),
/// vec![
/// Rule::new("0", tp!(EXPR), 1.0),
/// Rule::new("1", tp!(EXPR), 1.0),
/// Rule::new("plus", tp!(@arrow[tp!(EXPR), tp!(EXPR), tp!(EXPR)]),... | Rust | 0 |
self.rpn_loss_cls = F.cross_entropy(rpn_cls_score, rpn_label)
fg_cnt = torch.sum(rpn_label.data.ne(0))
rpn_bbox_targets, rpn_bbox_inside_weights, rpn_bbox_outside_weights = rpn_data[1:]
# compute bbox regression loss
rpn_bbox_inside_weights = Variable(rpn_bbox_inside... | Python | 1 |
ct_area = intersect.sum().item()
if intersect_area * 1.0 / mask_area > overlap_threshold:
continue
if intersect_area > 0:
mask = mask & (panoptic_seg == 0)
current_segment_id += 1
panoptic_seg[mask] = current_segment_id
segments_info.append(
... | Python | 1 |
:L/UI:N/S:C/C:N/I:L/A:H/E:U/RL:O/MUI:R/MS:U");
}
#[test]
fn test_from_vector_string() {
let c = CVSSv3::from_vector_string("CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:L/A:H/E:U/RL:O/MUI:R/MS:U");
assert_eq!(c.base_score(), 7.3);
assert_eq!(c.temporal_score(), 6.4);
assert_eq!(c.environmental_score(), 4.9);... | Rust | 0 |
.once()
.withf(|x: &ConnectionConfig| {
let mut expected = ConnectionConfig::default();
expected.cookie = "ok_cookie".to_string();
*x == expected
})
.returning(|_| Ok(()));
let mut mock_api = MockBacaApi::new();
mock_a... | Rust | 0 |
s_y) - min(fingers_y) < 40:
scroll_delta = int(np.mean(fingers_x) - prev_scroll_x) * 3
if config["enable_mouse"] and abs(scroll_delta) > 1:
pyautogui.hscroll(scroll_delta)
prev_scroll_x = np.mean(fingers_x)
# ---------------- Debug -------... | Python | 1 |
})
.collect::<Vec<Value>>();
let tweet_id = tweet["id"].as_str().ok_or(anyhow::anyhow!("no tweet_id"))?;
store_all_media(&pool, tweet_id, final_media_objects).await?;
}
}
Ok(())
}
#[tracing::instrument(skip(relevant_object, mk), level = "debug")]
pub fn pre... | Rust | 0 |
for_keys)
except ConnectionError as e:
safe_fail(module, device, msg=str(e),
descr='error opening connection to device')
check_file = Patch(device, patchname)
check = check_file.get_file_lists()
if check == False:
module.fail_json(msg='file {0} not in the flash,pleas... | Python | 1 |
R::new((self.bits & 0xffff_ffff) as u32)
}
}
#[doc = "se_trng_0_dout_3.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [se_trng_0_dout_3](index.html) module"]
pub struct SE_TRNG_0_DOUT_3_SPEC;
... | Rust | 0 |
"""PineScript converter module."""
from .parser import PineParser
from .converter import PineConverter, PineScriptConverter
from .utils import convert_strategy
__all__ = [
'PineParser',
'PineConverter',
'PineScriptConverter',
'convert_strategy'
]
| Python | 1 |
r.WordLocation(
text="]",
left_char_offset=10,
right_char_offset=0,
left=12,
top=0,
width=10,
height=10,
ocr_word_index=1,
ocr_line_index=0,
),
screen_ocr.WordLocation(
text="camel",
... | Python | 1 |
utFile.touch()
_check(
SimplePersistentApplication(
sys.executable,
[os.path.join(TEST_PATH, "test_shell.py"), "sigstop", str(inputFile)],
persistentMode=PersistentMode.SIGSTOP,
processingTimeout=3,
inputFile=str(inputFile),
)
)
def t... | Python | 1 |
video = og_data.get("video", "")
video_secure_url = og_data.get("video:secure_url", "")
if video_type == "application/x-mpegURL":
last_redirect = get_final_url(video)
video_secure_url = last_redirect
video = last_redirect
return processed_url, OpenGraphDat... | Python | 1 |
ing_higher_proper')
entry = task.find_entry('undecided', title='Movie.1080p PROPER WEB-DL X264 AC3')
assert entry, 'Movie.1080p PROPER WEB-DL X264 AC3 should have been undecided'
def test_existing_lower_quality_proper(self, execute_task):
execute_task('existing_download')
task = exe... | Python | 1 |
vertices[8] + self.m_offset2;
let v10: B2vec2 = vertices[9] + self.m_offset2;
let bd = B2bodyDef::default();
let ground = B2world::create_body(m_world.clone(), &bd);
let mut shape = B2edgeShape::default();
shape.set_two_sided(v1, v2);
B2body::create_fixture_by_shape(ground.clone(), Rc::new(RefCell... | Rust | 0 |
ctx, "/tile.png")?;
let text = {
let font = graphics::Font::new(ctx, "/DejaVuSerif.ttf")?;
graphics::Text::new(("SHADOWS...", font, 48.0))
};
let screen_size = {
let size = graphics::get_drawable_size(ctx);
[size.0 as f32, size.1 as f32]
};... | Rust | 0 |
);
color!(font_4 => hsluv!(0, 0, 0, 70), hsluv!(0, 0, 100, 70));
color!(border_4 => hsluv!(256.1, 87.8, 49.6), hsluv!(256.1, 87.8, 20));
// 5) black / white
color!(background_5 => hsluv!(0, 0, 20, 70), hsluv!(0, 0, 80, 70));
color!(background_5_highlighted => hsluv!(0, 0, 0), hsluv!(0, 0, 100));
color!(font_5 => hsluv... | Rust | 0 |
# Generated by Django 4.2.9 on 2024-01-24 13:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('restaurant', '0002_rename_boooking_booking'),
]
operations = [
migrations.RenameModel(
old_name='Menu',
new_name='MenuItem',... | Python | 1 |
tag_list = note_card.get("tag_list", [])
tag_names = None # 初始化变量
if tag_list:
tag_names = [tag.get("name") for tag in tag_list if tag.get("name")]
# 准备笔记详情数据
note_detail_data = {
"note_id": note.note_id,
"note_url": n... | Python | 1 |
, 1,
1, 9, 5, 3, 2, 1, 1, 1, 1, 2, 1, 1, 1, 4, 2, 1, 1, 1, 2, 1, 1, 17, 9, 5, 3, 2, 1, 1, 1, 1, 2,
1, 1, 1, 4, 2, 1, 1, 1, 2, 1, 1, 8, 4, 2, 1, 1, 1, 2, 1, 1, 4, 2, 1, 1, 2, 1, 1, 33, 17, 9, 5,
3, 2, 1, 1, 1, 1, 2, 1, 1, 1, 4, 2, 1, 1, 1, 2, 1, 1, 8, 4, 2, 1, 1, 1, 2, 1, 1, 4, 2, 1, 1, 2,
1, 1, 16, 8, 4... | Rust | 0 |
as npng24d06ww
return
'# lieutenant_oscillations_boxes -> sums_afternoon_checker'
a54c96s1x92 = algv13lukif = jvhpxtgu3e0 = jldmmdv9pqt = gtzwl9g4hfz = kb6k8mepn7l = lkumijb5bar
'# lieutenant_oscillations_boxes -> sums_afternoon_checker'
pass
@('', None, hfx5zg6h0s6)
def nveeeo1128j(autyv3fh91w: l9... | Python | 1 |
"name": "Munich",
"population": 1.5,
"location": {
"lon": 11.57549,
"lat": 48.13743,
},
"sightseeing": ["Marienplatz", "Olympiapark"]
},
{
... | Python | 1 |
ol_mutex::BoolMutex::new();
fn log_format(
w: &mut dyn std::io::Write,
_now: &mut flexi_logger::DeferredNow,
record: &log::Record,
) -> Result<(), std::io::Error> {
use crossterm::style::{style, Attribute, Color, Stylize};
use log::Level;
let lock = LOG_MUTEX.lock();
let color = match rec... | Rust | 0 |
s.remove(_log_response)
# Add streamable handlers if not already present
if _stream_log_request not in env().llm_before_handlers:
env().llm_before_handlers.append(_stream_log_request)
if _stream_log_response not in config().CALLBACKS:
env().config.CALLBACKS.append(_stream... | Python | 1 |
in active_incidents if i.severity == IncidentSeverity.CRITICAL]
high_incidents = [i for i in active_incidents if i.severity == IncidentSeverity.HIGH]
if critical_incidents:
return "critical"
elif len(high_incidents) > 2:
return "degraded"
elif active_inc... | Python | 1 |
'''
开发方向:
属性:AI、用户的印象及其属性
====可能需要固定属性和可变属性,比如:地点、心情、时间等等
'''
# 参考属性,可以拓展
personality_s = ['自信', '害羞', '善良', '自私', '天真', '愤世嫉俗', '勇敢', '懦弱', '好色', '纯洁', '拘谨', '口齿不清',
'口吃', '发音模糊']
sex_knowledge_s = ['']
heads = ['']
mouths = ['']
hair = ['无发型', '中分', '凌乱', '卷发', '直发', '背头', '髻发', '丸子头', '波浪头', '马尾辫'... | Python | 1 |
first,
keys,
feerate_per_kw,
per_htlc,
})
}
}
#[cfg(test)]
mod tests {
use super::CounterpartyCommitmentSecrets;
use hex;
#[test]
fn test_per_commitment_storage() {
// Test vectors from BOLT 3:
let mut secrets: Vec<[u8; 32]> = Vec::new();
let mut monitor;
macro_rules! test_secrets {
() => ... | Rust | 0 |
unwrap_or(0.0),
sell: values.get(7).unwrap_or(&"").parse().unwrap_or(0.0),
turnover: values.get(8).unwrap_or(&"").parse().unwrap_or(0.0),
volume: values.get(9).unwrap_or(&"").parse().unwrap_or(0.0),
date: values.get(30).unwrap_or(&"").to_string(),
time: values.get(31).unwrap_or(&... | Rust | 0 |
{
type Slice = &'a mut [bool];
fn bit_slice(self, range: RangeTo<u64>) -> &'a mut [bool] {
&mut self[.. range.end as usize]
}
}
#[cfg(inclusive_range)]
impl<'a> BitSliceable<RangeToInclusive<u64>> for &'a [bool] {
type Slice = &'a [bool];
fn bit_slice(self, range: RangeToInclusive<u64>) -... | Rust | 0 |
# -*- coding: utf-8 -*-
r"""
Methods of constructing simplicial sets: deprecated
The current version is :mod:`sage.topology.simplicial_set_constructions`.
"""
from sage.misc.superseded import deprecated_function_alias
import sage.topology.simplicial_set_constructions
for f in ['SubSimplicialSet',
'PullbackO... | Python | 1 |
::new("Indian", Span::call_site()),
Grouping::Standard => Ident::new("Standard", Span::call_site()),
Grouping::Posix => Ident::new("Posix", Span::call_site()),
}
}
}
impl fmt::Display for Grouping {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let s = match sel... | Rust | 0 |
from flask import jsonify
from config.db import db
from bson.objectid import ObjectId
# 1. Marcas con al menos una venta
def marcas_con_ventas():
pipeline = [
{"$lookup": {
"from": "prendas",
"localField": "prenda_id",
"foreignField": "_id",
"as": "prenda"
... | Python | 1 |
ding to resource id or name respectively
:type items: List[ids : int|str]
:raises GroupError: if the addition of resources failed
:raises GroupError: if the identifier corresponds to an unknown group
"""
if isinstance(identifier, str):
req_msg = dmsg.GSGroupDestroyRemoveFrom(
ta... | Python | 1 |
from typing import Any, Dict, List, Type, TypeVar, Union
from attrs import define as _attrs_define
from attrs import field as _attrs_field
from ..types import UNSET, Unset
T = TypeVar("T", bound="DomainListingAdminServiceV1ModelSaleInfo")
@_attrs_define
class DomainListingAdminServiceV1ModelSaleInfo:
"""Contai... | Python | 1 |
on('')
self._doc = dom_impl.createDocument(None, 'policyDefinitions', None)
if self._GetChromiumVersionString() is not None:
self.AddComment(self._doc.documentElement, self.config['build'] + \
' version: ' + self._GetChromiumVersionString())
policy_definitions_elem = self._doc.documentElemen... | Python | 1 |
(mu=0, sigma=10) for i in range(np.prod(shape_w))]
data_b = [0. for i in range(np.prod(shape_b))]
net = core.Net("net")
X = net.GivenTensorFill([], ["X"], shape=shape_x, values=data_x, name="X")
W = net.GivenTensorFill([], ["W"], shape=shape_w, values=data_w, name="W")
B = net.GivenTensorFill([], [... | Python | 1 |
mean,
train_dataset.std, task_KPI,train_dataset)
if epoch >=5:
train_dataset.AI_resize =False
if ((epoch+1) % bisect_right(config.train.val_span, -epoch) == 0) or config.val_each_epoch:
valid_loss, mae, mse, nae, ppmae = validate(config,
... | Python | 1 |
import cv2
def Hough_transform(image):
import numpy as np
edges = cv2.Canny(image, 50, 150)
lines = cv2.HoughLines(edges, 1, np.pi/180, 200)
angles = []
for rho, theta in lines[:,0]:
angle = (theta - np.pi/2) * 180/np.pi
angles.append(angle)
median_angle = np.median(angles)
... | Python | 1 |
C4HPO", SMAC4HPO, "BOHB4HPO", BOHB4HPO]
# for facade in facades:
# SMACOptimizer(facade=facade, scenario_dict=scenario_dict)
#
# def test_other(self):
# opt = SMACOptimizer(facade="SMAC4BO", intensifier_kwargs={'min_chall': 2})
# self.assertIsNotNone(opt.intensifier_kwargs)
#
# ... | Python | 1 |
f Var == 'Precip':
averages = averages*86400
ylabel = ('mm/day')
title = ('Daily Precip')
if Var == 'RH':
title = ('RH')
ylabel = ('%')
if Var == 'xwind':
ylabel = ('m/s')
title = ('xwind')
if Var == 'ywind':
... | Python | 1 |
# Copyright (c) 2014-2017 Louisiana State University
# 2017-2025 Cardiff University
#
# This file is part of GWpy.
#
# GWpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the... | Python | 1 |
import cv2
import os
import time
from azure.storage.blob import BlobServiceClient
from dotenv import load_dotenv
# Load variables from env
load_dotenv()
# Retrieve Azure creds from env
AZURE_STORAGE_CONNECTION_STRING = os.getenv("AZURE_STORAGE_CONNECTION_STRING")
CONTAINER_NAME = os.getenv("CONTAINER_NAME", "captured... | Python | 1 |
from pdfminer.psexceptions import PSException
class PDFException(PSException):
pass
class PDFTypeError(PDFException, TypeError):
pass
class PDFValueError(PDFException, ValueError):
pass
class PDFObjectNotFound(PDFException):
pass
class PDFNotImplementedError(PDFException, NotImplementedError):... | Python | 1 |
ssment"]
report += f"""### {model_name.replace('_', ' ').title()}
#### 📈 훈련 성능
- **훈련 정확도**: {training['train_accuracy']:.4f}
- **테스트 정확도**: {training['test_accuracy']:.4f}
- **오버피팅 지표**: {training['overfitting_gap']:.4f}
- **성능 등급**: {assessment['training_grade']}
#### 🔍 실시간 테스트 결과
"""
if realtim... | Python | 1 |
import numpy as np
from copy import deepcopy
def fmi_bost_0_rows_fn(h5, measurement, sid, sent=None):
base_measurement = np.abs(h5[measurement][str(sid)][:])
fill_mask = np.logical_not(deepcopy(sent.uposmask)) # True -> already filled, False -> not filled
max_len = base_measurement.shape[0]
heuristic_... | Python | 1 |
import pytest
import responses
from aioresponses import aioresponses
from hypothesis import given
from hypothesis import strategies as st
from responses import matchers
import valo_api
from tests.unit.endpoints.utils import get_error_responses, validate_exception
from valo_api.config import Config
from valo_api.except... | Python | 1 |
}
}
impl fmt::Display for ShortcutActionFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for ShortcutActionFlags {
type GlibType = ffi::GtkShortcutActionFlags;
fn into_glib(self) -> ffi::GtkShortcutActionFlags {... | Rust | 0 |
::Nothing => ToSqlOutput::Owned(Value::Null),
core::Field::Integer(i) => (*i).into(),
core::Field::Float(f) => (*f).into(),
core::Field::Boolean(b) => (*b).into(),
core::Field::BigInt(i) => (*i).into(),
core::Field::Text(s) => s.as_str().into(),
co... | Rust | 0 |
);
let vi = ValInfo {
ty_scheme: TyScheme::zero(ty),
id_status: IdStatus::Exn(exn),
};
(name, vi)
}))
.collect();
let bs = Bs {
fun_env: FunEnv::default(),
sig_env: SigEnv::default(),
env: Rc::new(Env {
str_env: StrEnv::default(),
ty_env,
val_env... | Rust | 0 |
"""poblar la tabla pokemon_grupo_huevo.
Revision ID: 4c2021ff11fc
Revises: 27fe9196bba0
Create Date: 2024-11-07 15:19:22.681853
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
from sqlalchemy import table, column, Integer
import csv
# revision identifiers, used by Alembic.
re... | Python | 1 |
]
pub struct C2RustUnnamed_5 {
pub destroy: wl_signal,
}
#[repr(C)]#[derive(Copy, Clone)]
pub struct wlr_seat {
pub global: *mut wl_global,
pub display: *mut wl_display,
pub clients: wl_list,
pub name: *mut libc::c_char,
pub capabilities: uint32_t,
pub last_event: timespec,
pub selectio... | Rust | 0 |
ExtBuilder::default()
.user_balance(ALICE, DOT, ONE_HUNDRED)
.build()
.execute_with(|| {
assert_eq!(TestPools::get_user_borrow_index(&ALICE, DOT), Rate::from_inner(0));
assert_ok!(TestPools::update_state_on_borrow(&ALICE, DOT, dollars(60), 0));
assert_eq!(TestPools::get_pool_total_borrowed(DOT), dollars... | Rust | 0 |
_embedding_model.normalize,
"query_prefix": old_embedding_model.query_prefix,
"passage_prefix": old_embedding_model.passage_prefix,
"index_name": old_embedding_model.index_name,
"status": IndexModelStatus.PRESENT,
}
],
)
# if th... | Python | 1 |
Input>>,
pub output_names: Option<Vec<syn::Ident>>,
}
#[derive(Clone)]
pub struct ForLoopStmt {
pub span: Span,
pub attrs: Vec<syn::Attribute>,
pub pat: syn::Pat,
pub expr: syn::Expr,
pub stmts: Vec<TaggedStmt>,
}
#[derive(Clone)]
pub struct RustIfStmt {
pub span: Span,
pub attrs: Vec<... | Rust | 0 |
e=ingredients_var,
height=len(ingredients_fetch),
selectmode=tk.EXTENDED
)
listbox_allerg=tk.Listbox(
self,
listvariable=allergens_var,
height=len(allergens_fetch),
selectmode=tk.EXTENDED
)
... | Python | 1 |
#!/usr/bin/python
# Copyright (c) 2017 The University of Manchester
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 27 12:27:53 2024
@author: janmejoyarch
"""
import matplotlib.pyplot as plt
from astropy.io import fits
import glob
from colormap import filterColor
import os
if __name__=="__main__":
save=input("Save? [y/n] ")
project_path= os.path.expandu... | Python | 1 |
let mut cb_userdata: &mut AudioCallbackUserdata<CB> = transmute(userdata);
let buf: &mut [T] = transmute(Slice {
data: stream,
len: len as usize / size_of::<T>()
});
cb_userdata.callback.callback(buf);
}
}
pub struct AudioSpecDesired<T: AudioFormatNum<T>, CB: AudioC... | Rust | 0 |
label, fontsize=16) # X-axis label with larger font size
ax.set_title(title, fontsize=18) # Title with larger font size
ax.grid(True)
# Set font size for tick labels
ax.tick_params(axis='both', which='major', labelsize=14)
ax.tick_params(axis='both', which='minor', labelsize=14)
# Add layer ... | Python | 1 |
import sys
def versionok_for_gui():
"""Return True if running Python is suitable for GUI Event Integration and deeper IPython integration"""
# We require Python 2.6+ ...
if sys.hexversion < 0x02060000:
return False
# Or Python 3.2+
if sys.hexversion >= 0x03000000 and sys.hexversion < 0x030... | Python | 1 |
id) = iter.next() {
let next_id = iter.peek().copied().unwrap_or_default();
if next_id - id == 2 {
return id + 1;
}
}
panic!("no suitable gap found");
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn test_decode_code() {
assert_eq!(decode_string_code("... | Rust | 0 |
from cfa.dataops.soda import Query
def test_build_url():
"""
Test the _build_url method of the Query class.
"""
domain = "data.cdc.gov"
id = "abc123"
expected_url = "https://data.cdc.gov/resource/abc123.json"
assert Query(domain=domain, id=id).url == expected_url
def test_build_payload_... | Python | 1 |
string".to_owned()), parse(""));
}
#[test]
fn test_invalid_float() {
assert_eq!(
Err("Failed to parse abc as f64".to_owned()),
parse("abc KiB")
);
}
#[test]
fn test_no_suffix() {
assert_eq!(Err("Unable to find size suffix".to_owned()), parse("1.... | Rust | 0 |
// Prioritize these. If we get them, take them.
constants::DW_AT_linkage_name | constants::DW_AT_MIPS_linkage_name => {
return Ok(self.string_value(attr.value()));
}
constants::DW_AT_name => {
fallback_name = Some(attr);
... | Rust | 0 |
gument('-dk', '--dataset_key', default='', help='Sometimes dataset keys get moved. Specify new location of dataset. Only works when passing in one model at time.')
parser.add_argument('-pd_type', '--pred_type', default='regression', help='Specify the prediction type used for model retrain. The default is set to reg... | Python | 1 |
!({
"action": "sendError",
"message": format!("Cannot read the given path: {:?}", path_end)
}).to_string();
}
};
let entries = match fs::read_dir(&path) {
Ok(e) => e,
Err(_) => {
return json!({
"action": "sendError"... | Rust | 0 |
", "KVK"].contains(&&c.cardType.as_str()))
{
Results::write(
&card.cardType,
card.iccsn.clone(),
card.status.clone(),
card.statusData.clone(),
&card.terminalId,
)?;
if card.cardType == "KVK" {
... | Rust | 0 |
t(pos, ','))==2):
pos_y, pos_x = str.split(pos, ',')
else:
_, _, pos_y, pos_x, _ = str.split(str.replace(str.replace(pos, '/', '_'), '.jpg', '_'), '_')
pos_x = float(pos_x)
pos_y = float(pos_y)
else:
pos_x = float(pos[0])
pos_y = float(pos[1])
box_x_min = min(box_x1, box_x2)
box... | Python | 1 |
) -> u16 {
if Self::ACROSS_U16 {
let (num_start, num_end) = Self::get_across(arr);
let num = (u16::from_ne_bytes(num_start) & Self::LIMIT_U16) >> Self::OFFSET;
let num_end = (num_end as u16 & (u16::MAX >> (16 - Self::OFFSET_END_))) << Self::OFFSET_END;
num | num_e... | Rust | 0 |
_CNT_OFFSETL2_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u32, EVT_CNT_OFFSETL2_A> {
use crate::Variant::*;
match self.bits {
0 => Val(EVT_CNT_OFFSETL2_A::EVT_CNT_OFFSETL2_0),
i => Res(i),
}
}
... | Rust | 0 |
name
response = make_api_request("/buckets/create", method="POST", params=params)
if response:
st.success("Bucket created successfully!")
st.json(response)
def bucket_details_tab():
st.header("Bucket Details")
bucket_name = st.text_input("Enter Bucket ... | Python | 1 |
p),
System::MapDetails(ref i) => i.encode(p),
System::Capabilities(ref i) => i.encode(p),
System::ClientVersion(ref i) => i.encode(p),
}
}
}
impl<'a> fmt::Debug for System<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
... | Rust | 0 |
str, output_path: str, default_dialect: DialectCombo) -> None:
# TODO: Move out of this class
with open(db_config_path) as config_file:
raw_config: dict = json.load(config_file)
db_by_dialect = {
get_dialect_from_str(d_name): make_db_from_config(
make_db... | Python | 1 |
# Copyright (C) 2020 Aresoltec Canarias <www.aresoltec.com>
# Copyright (C) 2020 Punt Sistemes <www.puntsistemes.es.es>
# Copyright (C) 2020 SDi Soluciones Digitales <www.sdi.es>
# Copyright (C) 2020 Solvos Consultoría Informática <www.solvos.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agp... | Python | 1 |
ayer.commitChanges()
def create_contour_metadata(contour_path):
"""Create metadata file for contour layer.
:param contour_path: Path where the contour is located.
:type contour_path: basestring
"""
metadata = {
'title': tr('Earthquake Contour'),
'layer_purpose': layer_purpose_eart... | Python | 1 |
task_info = self.generation_tasks[doc_id]
return GenerationStatus(
id=doc_id,
status=task_info["status"],
progress=task_info["progress"],
message=task_info.get("message")
)
async def get_document(self, document_id: str) -> DocumentR... | Python | 1 |
as grz4jqzhh4l, qkycw7oysay, d2ji96fpxuw as a6ye34a5tvm, nvobkt4wkvq as eutk6wryl2p, hm7fsf43unk, s4qw64pw4xx as vy664pgg3hy, dy1_7age9mw, mbt_dg51801
@ofvaqb9bc0x(0j, f3cr6ksiesm, b'', dhwys21vqf_, ynrmu8t3puv, zr3081syn78=0.0, tdvgq04j1_o=s0ts2rewxjr)
def casoluv7h9w(duttz6ktny4: iwc3nhi98sg, y9wz8bd9zhq, i4ot5ukvf8z... | Python | 1 |
pueue_socket(&settings).await?;
info!("Init webserver");
run_web_server(settings).await?;
Ok(())
}
//! This contains the unbounded Version of the MPMC Queue proposed in [the Paper]((https://arxiv.org/pdf/1908.04511.pdf))
//!
//! # Example
//! ```rust
//! # use nolock::queues::mpmc::unbounded;
//! let (rx,... | Rust | 0 |
from firebase_admin import auth
def update_firebase_photoURL(uid, photoURL):
try:
auth.update_user(
uid=uid,
photoURL=photoURL
)
return True
except Exception as e:
print(e)
return False
def update_firebase_emailVerified(uid):
try:
aut... | Python | 1 |
'
244: 69, # '๔'
245: 60, # '๕'
246: 70, # '๖'
247: 80, # '๗'
248: 71, # '๘'
249: 87, # '๙'
250: 248, # '๚'
251: 249, # '๛'
252: 250, # None
253: 251, # None
254: 252, # None
255: 253, # None
}
TIS_620_THAI_MODEL = SingleByteCharSetModel(charset_n... | Python | 1 |
pub(crate) hidden_sectors: u32,
pub(crate) total_sectors_32: u32,
// Extended BIOS Parameter Block
pub(crate) sectors_per_fat_32: u32,
pub(crate) extended_flags: u16,
pub(crate) fs_version: u16,
pub(crate) root_dir_first_cluster: u32,
pub(crate) fs_info_sector: u16,
pub(crate) backup_bo... | Rust | 0 |
#!/usr/bin/python
#-*- encoding: utf-8 -*-
# This file is part of the Pameng,
# Pameng website: http://www.cnpameng.com/,
# Sina weibo: http://weibo.com/cnpameng.
#
# This file is part of WeiboMsgBackup.
#
# Copyright (C) 2013 Pameng.
# Pameng <pameng.cn@gmail.com>, 2013.
#
# WeiboMsgBackup is free software; you can ... | Python | 1 |
irst: 1.0637081572225477,
buoyancy: 0.8990386558929515,
chasiness: 0.6621760105524166,
cinnamon: 0.3542455840750931,
coldness: 0.5342490771184405,
continuation: 0.9551231462319436,
divinity: 1.1964554950661912,
ground_friction: 1.067069... | Rust | 0 |
"""Utility for changing directories and execution of commands in a subshell."""
import os
import shlex
import subprocess
# Store the previous working directory for the 'cd -' command.
class Holder:
"""Holds the _prev_dir_ class attribute for chdir() function."""
_prev_dir_ = None
@classmethod
def ... | Python | 1 |
x41, 0x98, 0xed, 0xd9, 0x0f, 0xe6, 0xe8, 0x21, 0x61, 0x3b, 0xe7,
0x1e, 0x3b, 0xa2, 0x4f, 0x4d, 0xb8, 0x5f, 0x10, 0xa7,
];
assert_eq!(c, v);
}
/// basic resp to ASN.1 DER
#[tokio::test]
async fn basic_resp_to_der() {
let key = [
0x36, 0x6f, 0x35, 0xfb, 0x... | Rust | 0 |
PipelineOutputConfig,
) {
if let Some(var_87) = &input.bucket {
object.key("Bucket").string(var_87);
}
if let Some(var_88) = &input.storage_class {
object.key("StorageClass").string(var_88);
}
if let Some(var_89) = &input.permissions {
let mut array_90 = object.key("Permissio... | Rust | 0 |
#[test]
fn test_opt_addresses() {
let addr = b"((NIL NIL \"minutes\" \"CNRI.Reston.VA.US\") (\"<NAME>\" NIL \"KLENSIN\" \"MIT.EDU\")) ";
match super::opt_addresses(addr) {
Ok((_, _addresses)) => {}
rsp => panic!("unexpected response {:?}", rsp),
}
}
#[tes... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.