text string | label_name string | labels int64 |
|---|---|---|
s from intermediate epoches.")
parser.add_argument('-start', '--start_epoch', type=int, default=1, help="!Not supported currently. For training from a break-point.")
args = parser.parse_args()
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
args.cfg = './configs/' + args.cfg
s... | Python | 1 |
= samples.index_axis_move(Axis(1), 0);
// convert real to complex
let samples_c = samples.mapv(|v| Complex { re: v, im: 0.0 });
// fft parameters
let fft_len = 512;
let segment_len = 256;
let overlap = 192;
// build window for fft
let window = W::periodic(W::sqrt(W::hann(segm... | Rust | 0 |
ell<OpenAiApi> = OnceCell::new();
interaction_setup! {
name = "chatbot",
description = "Chat with Pekora!",
enabled_if = |config| config.ai_chatbot.enabled,
options = [
//! Ask Usada Pekora anything!
ask: SubCommand = [
//! Your question.
prompt: String,
... | Rust | 0 |
one,
}).collect())
}
// =============================================================================
type LabelInfoMap = HashMap<Sp<Ident>, RawLabelInfo>;
struct RawLabelInfo {
time: i32,
offset: u64,
}
/// A quick pass near the end of a subroutine's compilation that collects the offsets of all labels.
... | Rust | 0 |
it__(self):
if not utils.get_symbol_value("CONFIG_SCHED_WORKQUEUE"):
return
super().__init__("worker", gdb.COMMAND_USER)
def invoke(self, arg, from_tty):
queues = get_work_queues()
for queue in queues:
print(f"{queue}")
if not queue.is_running:
... | Python | 1 |
#!/usr/bin/env python3
import os
import shutil
import sys
_resources = {}
_aliases = {}
_ignore = (
'org.gnome.Builder.svg',
'org.gnome.Builder.Devel.svg',
'org.gnome.Builder-symbolic.svg',
'org.gnome.Builder.Devel-symbolic.svg',
)
def addResource(directory, name):
if directory not in _resources:
... | Python | 1 |
on that guarantee as it would be considered corrupt
// if the data changed types underneath.
if row < #root::Table::row_cnt(&self.0) {
::core::option::Option::Some(
(#(
self.#cell_fns(row).expect(#bug_msg)
... | Rust | 0 |
# blog/forms.py
from django import forms
from .models import Post, Comentario
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ['titulo', 'conteudo']
class ComentarioForm(forms.ModelForm):
class Meta:
model = Comentario
fields = ['autor', 'texto'] | Python | 1 |
from pathlib import Path
import subprocess
import os
import sys
import wasabi
TEST_DATA = Path(__file__).absolute().parent / "test-data"
WASABI_DIR = Path(wasabi.__file__).absolute().parent.parent
def test_jupyter():
# This runs some code in a jupyter notebook environment, but without actually
# starting up... | Python | 1 |
u32) as i32 * y + x) as isize;
let cur = self.linear_buf.offset(offset);
let old_color = color::RGBA8::from(*cur);
let new_color = color.blend_with(old_color);
*cur = new_color.encode();
}
}
fn clamp(max: i32, value: i32) -> i32 {
if value < 0 {
... | Rust | 0 |
"SECTION",
" 2",
"ENTITIES",
" 0",
"TEXT",
" 7",
"some-text-style",
" 0",
"ENDSEC",
" 0",
"EOF",
]
.join("\r\n")
... | Rust | 0 |
'OpGroupSMaxNonUniformAMD' : 5007,
'OpFragmentMaskFetchAMD' : 5011,
'OpFragmentFetchAMD' : 5012,
'OpSubgroupShuffleINTEL' : 5571,
'OpSubgroupShuffleDownINTEL' : 5572,
'OpSubgroupShuffleUpINTEL' : 5573,
'OpSubgroupShuffleXorINTEL' : 5574,
'OpSubgroupBlockR... | Python | 1 |
t {weather_description} avec une température de {temp_value:.1f}{temp_unit}."
else: # Default to English
report = f"The current weather in {city_name} is {weather_description} with a temperature of {temp_value:.1f}{temp_unit}."
result = {"status": "success", "report... | Python | 1 |
n.into_txout().into_txout();
unvaults_cache.insert(
unvault_outpoint,
UtxoInfo {
txo,
is_confirmed: true,
},
);
log::debug!(
"Transaction spending Unvault '{}' was evicted from mempool. Downgrading vault at \
'{}' from '{}' to 'Unvaulted'",
... | Rust | 0 |
an error while executing the Lua code (eg. a function call
/// returns an error), or if the requested return type doesn't match the actual return type.
///
/// > **Note**: In order to pass parameters, see `call_with_args` instead.
#[inline]
pub fn call<V>(&'lua self) -> Result<V, LuaError>
where... | Rust | 0 |
0x09, 0x39, // Usage (Hat switch)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x07, // Logical Maximum (7)
0x35, 0x00, // Physical Minimum (0)
0x46, 0x3B, 0x01, // Physical Maximum (315)
0x65, 0x14, // Unit (System: English Rotation, Lengt... | Rust | 0 |
f64| -100.0 * (-x.powi(100)).exp() * x.powi(99);
let f = RealFnAndFirst::new(&in_f, &in_df);
let conv = DeltaX::new(1e-9);
let _ = newton_raphson(&f, 0.99999, &conv, 100).expect_err("no convergence");
}
}
/*
* Copyright (c) 2018 by the author(s)
*
* ====================================... | Rust | 0 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# __author__ = 'liao gao xiang'
from xml.etree.ElementTree import iterparse
# 增量式解析大型xml文件,通过迭代器和生成器使用尽可能少的内存
def parse_and_remove(filename, path):
path_part = path.split('/')
doc = iterparse(filename, ('start', 'end'))
next(doc)
tag_stack, elem_stack = ... | Python | 1 |
(query_string) => form_urlencoded::parse(query_string.as_bytes())
.into_owned()
.fold(HashMap::new(), |mut hm, (k, v)| {
hm.entry(k).or_insert(vec![]).push(v);
hm
}),
None => HashMap::new(),
};
let fluff = params.get("fluff").is_some();
Box::new(parse_body(req).and_then(
move |slate: S... | Rust | 0 |
from turtle import *
screensize(1000, 1000)
lt(90)
m = 10
tracer(0)
for i in range(9):
fd(22*m)
rt(90)
fd(6*m)
rt(90)
up()
fd(m)
rt(90)
fd(5*m)
lt(90)
down()
for i in range(9):
fd(53*m)
rt(90)
fd(75*m)
rt(90)
up()
for x in range(-30, 30):
for y in range(-30, 30):
goto(x*m, ... | Python | 1 |
import re
import struct
import ida_struct
import idc
import ida_bytes, ida_name, ida_offset
LOAD_X27_PATTERN = "\[X27,#0x(\S*)\]"
RE_LOAD_X27_PATTERN = re.compile(LOAD_X27_PATTERN)
# ADD <reg_tmp>, X27, #0x<index_high>,LSL#<index_high_shift>
ADD_X27_PATTERN = "ADD (\S*), X27, #0x(\S*),LSL#(... | Python | 1 |
let version_config: &'static str = config.config_parser_version(); // getting text about version of config parser
/// ```
///
pub struct config_parser {
config_parser: ini::Ini,
}
/// It is a UART/Sbus/Ibus configuration struct
pub struct IbusConfig {
/// baudrate (u32 value)
pub baudrate: u32,
/// Por... | Rust | 0 |
import math
import paddle
import paddle.nn.functional as F
from paddle import Tensor
from paddle.nn import Embedding
from paddle_geometric.nn.kge import KGEModel
class RotatE(KGEModel):
r"""The RotatE model from the `"RotatE: Knowledge Graph Embedding by
Relational Rotation in Complex Space" <https://arxiv.... | Python | 1 |
import asyncio
import importlib
from pyrogram import idle
from pytgcalls.exceptions import NoActiveGroupCall
import config
from VIP_INNOCENT import LOGGER, app, userbot
from VIP_INNOCENT.core.call import INNOCENT
from VIP_INNOCENT.misc import sudo
from VIP_INNOCENT.plugins import ALL_MODULES
from VIP_INNOCENT.utils.... | Python | 1 |
from unittest import TestCase
from container_transform.transformer import BaseTransformer
from container_transform.schema import ARG_MAP
class BaseTransformerTests(TestCase):
"""
Tests for the BaseTransformer class
"""
def test_base_transformer_has_all_methods(self):
"""
Test to conf... | Python | 1 |
expected);
}
NodeEvent::OnConnectionInfo { info: _ } => {
assert_eq!(zx::Status::OK, expected);
}
}
}
async fn assert_read<'a>(
file_proxy: &'a FileProxy,
length: u64,
expected: &'a [u8],
) -> Result<(), Error> {
let (status, read_data) = file_proxy.read(length)... | Rust | 0 |
"""
Hotjar template tags and filters.
"""
import re
from django.template import Library, Node, TemplateSyntaxError
from analytical.utils import disable_html, get_required_setting, is_internal_ip
HOTJAR_TRACKING_CODE = """\
<script>
(function(h,o,t,j,a,r){
h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments... | Python | 1 |
}
}
let always_hello = escape_grapheme("a", AlwaysHello);
assert_eq!(always_hello, "hello");
struct Simple;
impl CharEncoder for Simple {
fn encode(iter: &mut dyn Iterator<Item = char>) -> Option<String> {
iter.next().map(|i| format!("{}", i a... | Rust | 0 |
Words per minute (WPM)
""")
st.sidebar.markdown("---")
st.sidebar.markdown("### 📘 About")
st.sidebar.info("""
This app is built by **Muhammad Jarreer** using AI-based evaluation to give real-time English speaking feedback.
🔗 [Portfolio](https://jarreer.github.io/portfolio/)
📨 [Con... | Python | 1 |
None
else:
print(f"\n{Fore.RED}Please add your {C}SecurityTrails{Fore.RED} API Key in config.ini file{Fore.RESET}")
None
def get_domain_historical_ip_address(domain):
try:
url = f"https://viewdns.info/iphistory/?domain={domain}"
headers = {
"User-Agent": "Mozilla/5.0... | Python | 1 |
ta()) {
eprintln!("{} - {}", record.level(), record.args());
}
}
fn flush(&self) {}
}
fn init_logger() -> Result<(), SetLoggerError> {
log::set_logger(&LOGGER)?;
log::set_max_level(LevelFilter::Debug);
Ok(())
}
<gh_stars>0
// As opposed to this function, which will never return... | Rust | 0 |
ions: Dimension,
pub local_declarations: LocalDeclarations,
}
#[derive(PartialEq, Debug, Clone)]
pub enum RootDefinition {
GlobalVariable(GlobalVariable),
Struct(StructDefinition),
Function(FunctionDefinition),
Kernel(Kernel),
}
pub use slp_shared::opencl::Extension;
#[derive(PartialEq, Debug, Cl... | Rust | 0 |
size_hint: g.event_counter,
iterators,
serialization: g.serialization,
})
}
}
impl std::iter::Iterator for GraphUpdateIterator {
type Item = Result<(u64, UpdateEvent)>;
fn next(&mut self) -> Option<Self::Item> {
// Remove all empty table iterators.
... | Rust | 0 |
r r4 r- r& |