text string | label_name string | labels int64 |
|---|---|---|
use crate::util;
use crate::watcher::PrivateWatcher;
use futures::future::BoxFuture;
use tide::{
middleware::{Middleware, Next},
Request, Response, Server,
};
use uuid::Uuid;
use crossbeam_channel::Sender;
use std::path::Path;
use std::{env, thread};
const PRIVATE_PATH_PREFIX: &str = "/private";
lazy_static!... | Rust | 0 |
ne]
pub fn take() -> Option<Instance> {
external_cortex_m::interrupt::free(|_| unsafe {
if USB_TAKEN {
None
} else {
USB_TAKEN = true;
Some(INSTANCE)
}
})
}
/// Release exclusive access to USB
///
//... | Rust | 0 |
if limit < 0 {
panic!("limit must be positive number");
}
if pos >= limit {
return pos % limit;
} else if pos < 0 {
return limit + pos;
} else {
return pos;
}
}
/* returns a new Position */
pub fn add(&self, uv: ... | Rust | 0 |
et('quality_level', 'N/A')}")
print(f" Confidence Score: {qa.get('confidence_score', 0):.2f}")
print(f" Sources Used: {', '.join(qa.get('sources_used', []))}")
if qa.get('strengths'):
print(f"\n ✅ Strengths:")
fo... | Python | 1 |
lt<RecommendedWatcher> = Watcher::new_raw(tx);
assert!(w.is_ok());
}
// if this test builds, it means RecommendedWatcher is Send.
#[test]
fn test_watcher_send() {
let (tx, _) = mpsc::channel();
let mut watcher: RecommendedWatcher = Watcher::new_raw(tx).unwrap();
thread::spawn(move || {
watche... | Rust | 0 |
(files.file_size)}\n\n📂Fɪʟᴇ ʟɪɴᴋ ➠ : {g}\n\n<i>Note: This message is deleted in 20 mins to avoid copyrights. Save the link to Somewhere else</i></b>", reply_markup=InlineKeyboardMarkup(button))
await asyncio.sleep(1200)
await k.edit("<b>Your message is successfully deleted!!!</b>")
... | Python | 1 |
while",
source_range: [122; 124),
delete: [122; 124),
insert: "while $0 {}",
kind: Keyword,
},
]
"###
)
}
}
<gh_stars>0
//! A module that contains all the actions related to the terminal. like clearing, resizing, pau... | Rust | 0 |
e temporary directory `{}` for cleanup: {}", tmpdir.display(), source))]
TmpDirCleanup {
tmpdir: PathBuf,
source: io::Error,
},
#[snafu(display("One or more scan workers failed: {}", errors))]
Scan {
errors: ErrorList,
},
#[snafu(display("Error scanning directory: {}", so... | Rust | 0 |
dmg_on: bool,
}
const RAM_SIZE: usize = 0xDFFF - 0xC000 + 1;
const HRAM_SIZE: usize = 0xFFFE - 0xFF80 + 1;
impl Mmu {
pub fn new(path: &path::Path) -> Self {
Mmu {
cartridge: cartridge::new(path),
ppu: ppu::Ppu::new(),
ram: vec![0; RAM_SIZE],
hram: vec!... | Rust | 0 |
f.embedder.encode(batch_chunks)
logger.info(
f"Потребление памяти после создания эмбеддингов для PDF: "
f"{psutil.Process().memory_info().rss / 1024**2:.2f} МБ"
)
except Exception as e:
logger.err... | Python | 1 |
from ...utils.ioUtils import write_uInt32
from .col_colTreeNodes import write_col_colTreeNodes
from .col_generate_data import COL_Data
from .col_header import write_col_header
from .col_meshes import write_col_meshes
from .col_namegroups import write_col_namegroups
def main(filepath, generateColTree):
data = COL_... | Python | 1 |
xmmm128
Mnemonic::Vpmaddubsw,// EVEX_Vpmaddubsw_ymm_k1z_ymm_ymmm256
Mnemonic::Vpmaddubsw,// EVEX_Vpmaddubsw_zmm_k1z_zmm_zmmm512
Mnemonic::Phsubw,// Phsubw_mm_mmm64
Mnemonic::Phsubw,// Phsubw_xmm_xmmm128
Mnemonic::Vphsubw,// VEX_Vphsubw_xmm_xmm_xmmm128
Mnemonic::Vphsubw,// VEX_Vphsubw_ymm_ymm_ymmm256
Mnemonic::Ph... | Rust | 0 |
sed on field-level defaults in `serde` attributes.
//!
//! # Usage
//! On a struct that derives `Serialize` or `Deserialize`, add `SerdeDefault`.
//!
//! ```rust
//! #[macro_use]
//! extern crate serde_derive;
//!
//! #[derive(Debug, SerdeDefault, PartialEq, Eq)]
//! pub struct MyStruct {
//! #[serde(default = "fie... | Rust | 0 |
'𛈪', '𑠗', '𝝄', '𑱡', 'ऋ', '🖜', '𘡉', '𝍡',
'𝗉', '🆟', '𐎐', '🙘', '⨭', '𓎑', '💔', '𑖱', '\u{11836}', '𛄂', 'ˌ',
'𒍋', '𝛙', 'ꡃ', 'ﺢ', '𞡆', '🃝', 'ꠊ', '꒿', '⑪', 'ڍ', '۾',
'\u{1e2e1}', '𐴆', '𐐛', 'ග', 'ⲣ', '𛊤', '\u{11fed}', '𐋮', 'Ꮉ', '𞲗',
'🔠', 'ତ', 'ʤ', '𒑢', 'o', 'ﰛ', 'я', '፳', 'ᦋ', '\u{e0001... | Rust | 0 |
ansactionRequest};
fn bytes_to_data(s: &[u8]) -> String {
let mut foo = "0x".to_string();
foo.push_str(&bytes_to_hex_str(&s));
foo
}
pub enum Action {
/// Sends a "traditional" ETH transfer
To(Address),
/// Does a contract call with provided ddata
Call(Vec<u8>),
}
pub struct BlockchainCli... | Rust | 0 |
let b = rb(&insert, &remove);
let v1: Vec<(u32, u32)> = a.iter().collect();
let v2: Vec<(u32, u32)> = b.into_iter().collect();
v1 == v2
}
QuickCheck::new()
.tests(300)
.quickcheck(prop as fn(std::vec::Vec<(u32, u32)>, std::vec::Ve... | Rust | 0 |
"""Calculation and controll"""
from functools import partial
ERROR_MSG = "ERROR!"
def evaluateExpression(expression):
"""Evaluate expression"""
try:
result = str(eval(expression, {}, {}))
except Exception:
result = ERROR_MSG
return result
class PyCalc:
"""Controllers class"""
... | Python | 1 |
import automacao
import pyperclip
import time
automacao.PAUSE = 1
# Passo 1:
# Entrar no sistema da empresa (no nosso caso link do drive (https://drive.google.com/drive/folders/149xknr9JvrlEnhNWO49zPcw0PW5icxga) )
automacao.hotkey("ctrl", "t")
pyperclip.copy("https://drive.google.com/drive/folders/149xknr9JvrlEnhNWO... | Python | 1 |
}
#[test]
fn parse_delta() {
let _: ByDay = "-20MO".parse().unwrap();
let _: ByDay = "30FR".parse().unwrap();
}
}
//////////////////////////////////////////////////////////////////////////////
// File: rust-worldgen/noise/mod.rs
/////////////////////////////////////////////////////////////... | Rust | 0 |
import grpc
import logging
from concurrent import futures
import nodepool_pb2
import nodepool_pb2_grpc
from user_service import UserServiceServicer
from node_manager_service import NodeManagerServiceServicer
from master_node_service import MasterNodeServiceServicer
from config import Config
logging.basicConfig(level=... | Python | 1 |
ze,
key_prefix=_TERMINAL_STATE_SYNC_ID,
barrier_timeout=self._exit_barrier_timeout,
)
log.info(
"Done waiting for other agents. Elapsed: %s seconds", time.time() - start
)
except SignalException as e:
log.warning("Go... | Python | 1 |
Map;
use std::collections::HashMap;
use std::fs::{self, File};
use std::path::{Path, PathBuf};
use crate::utils::fs::get_404_output_file;
use handlebars::Handlebars;
use regex::{Captures, Regex};
#[derive(Default)]
pub struct HtmlHandlebars;
impl HtmlHandlebars {
pub fn new() -> Self {
HtmlHandlebars
... | Rust | 0 |
b as u64, i, layout) as u128))
},
PrimVal::Ptr(ptr) => Ok(PrimVal::Ptr(ptr.wrapping_signed_offset(i, layout))),
PrimVal::Undef => Err(EvalError::ReadUndefBytes),
PrimVal::Abstract(_) => unimplemented!(),
}
}
}
// Overflow checking only works properly on the r... | Rust | 0 |
astEUTRA_Item>);
#[derive(Debug, AperCodec)]
#[asn(type = "SEQUENCE", extensible = true, optional_fields = 1)]
pub struct TAIBroadcastEUTRA_Item {
pub tai: TAI,
pub completed_cells_in_tai_eutra: CompletedCellsInTAI_EUTRA,
#[asn(optional_idx = 0)]
pub ie_extensions: Option<TAIBroadcastEUTRA_ItemIE_Exten... | Rust | 0 |
ster 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), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avail... | Rust | 0 |
[]
rouge_l_f = []
rouge_l_p = []
rouge_l_r = []
for name,score in score_json.items():
rouge_1_f.append(score["rouge-1"]['f'])
rouge_1_p.append(score["rouge-1"]['p'])
rouge_1_r.append(score["rouge-1"]['r'])
... | Python | 1 |
s://docs.xarray.dev/en/stable', None),
'dask': ('https://docs.dask.org/en/latest', None),
'pandas': ('https://pandas.pydata.org/docs', None),
'trollsift': ('https://trollsift.readthedocs.io/en/stable', None),
'trollimage': ('https://trollimage.readthedocs.io/en/stable', None),
'pyproj': ('https://py... | Python | 1 |
d, b_needed))
prize_breakdown[prize_name] = prize_breakdown.get(prize_name, 0) + red_combos
total_prize += red_combos * prize_value
summary = f"总计命中 {red_hits} 个红球, {blue_hit} 个蓝球"
return total_prize, prize_breakdown, summary
# --- 3. 主执行逻辑 ---
if __name__ == '__main__':
... | Python | 1 |
ITER_TCD4_BITER_ELINKYES register accessor: an alias for `Reg<BITER_TCD4_BITER_ELINKYES_SPEC>`"]
pub type BITER_TCD4_BITER_ELINKYES =
crate::Reg<biter_tcd4_biter_elinkyes::BITER_TCD4_BITER_ELINKYES_SPEC>;
#[doc = "TCD Beginning Minor Loop Link, Major Loop Count (Channel Linking Enabled)"]
pub mod biter_tcd4_biter_e... | Rust | 0 |
import math
import numpy as np
from scipy import interpolate
from collections import OrderedDict
def wrap_angle(angle):
return (angle + ( 2.0 * np.pi * np.floor( ( np.pi - angle ) / ( 2.0 * np.pi ) ) ) )
def move_to_point(current, goal, Kp=10, Ki=10, Kd=10, dt=0.05):
# Compute distance and angle to goal
d... | Python | 1 |
= ses.post(skipjob,params=PARAMS).json()
if checkskipjob['status'] == 200:
message = checkskipjob['message']
print(Fore.RED+str(message))
PARAMSr = {
'ads_id' : ad... | Python | 1 |
E_LOG_DEBUG (8)."]
#[doc = " @param logtype"]
#[doc = " The log type, for example, RTE_LOGTYPE_EAL."]
#[doc = " @param format"]
#[doc = " The format string, as in printf(3), followed by the variable arguments"]
#[doc = " required by the format."]
#[doc = " @param ap"]
#[doc = " The v... | Rust | 0 |
o_node(prev_index);
let dep_node_index = self.encoder.borrow().send(
profiler,
key,
prev_graph.fingerprint_by_index(prev_index),
prev_graph
.edge_targets_from(prev_index)
.iter... | Rust | 0 |
import sys, os
sys.path.append('../python/')
import microhh_tools as mht
import moser180.moser180_test as moser180
import drycbl.drycbl_test as drycbl
import drycblles.drycblles_test as drycblles
import bomex.bomex_test as bomex
import rico.rico_test as rico
import gabls1.gabls1_test as gabls1
import arm.arm_test as ... | Python | 1 |
}
impl<T, CTX> HashStable<CTX> for ::std::collections::BTreeSet<T>
where T: Ord + HashStable<CTX>,
{
fn hash_stable<W: StableHasherResult>(&self,
ctx: &mut CTX,
hasher: &mut StableHasher<W>) {
self.len().hash_stable(ctx... | Rust | 0 |
from game.game import Game
sign = lambda x: x and (1, -1)[x < 0]
class TicTacToe(Game):
@staticmethod
def identifier():
return b"gametitato"
def __init__(self):
self.board = [[0, 0, 0] for _ in range(3)]
self.turn = 0
def legal_moves(self):
legal = []
for i i... | Python | 1 |
=> {
for arg in array.iter() {
rustup_args.push(arg.to_string());
}
}
None => (),
};
CommandSpec {
command: "rustup".to_string(),
args: Some(rustup_args),
}
}
fn get_specified_min_version(toolchain: &ToolchainSpecifier) -> Option<Ver... | Rust | 0 |
{
self.lpcomp.events_up.read().bits() != 0
}
/// Checks if the `Down` transition event has been triggered.
#[inline(always)]
pub fn is_down(&self) -> bool {
self.lpcomp.events_down.read().bits() != 0
}
/// Checks if the `Cross` transition event has been triggered.
#[inline... | Rust | 0 |
import os # Importa el módulo os.
print(os.getcwd()) # Imprime el directorio de trabajo actual.
# Salida: C:\Python33
# Listar todos los subdirectorios y archivos en el directorio actual.
os.listdir() # Retorna una lista con todos los nombres de los archivos y directorios en el CWD.
# La salida es una lista con ... | Python | 1 |
canvas.save();
let pad = 5.0;
let s = w / 9.0 - pad * 2.0;
let joins = [LineJoin::Miter, LineJoin::Round, LineJoin::Bevel];
let caps = [LineCap::Butt, LineCap::Round, LineCap::Square];
let mut pts = [0.0; 4 * 2];
pts[0] = -s * 0.25 + (t * 0.3).cos() * s * 0.5;
pts[1] = (t * 0.3).sin()... | Rust | 0 |
kflowStep(
id="create_github_pr",
name="Create GitHub PR",
description="Create a GitHub PR with the security fixes",
agent="github",
action="create_pr",
parameters={
"repo": "i... | Python | 1 |
=> Err(e),
}
}
/// Multi-thread version of open_best_library()
pub fn open_best_library_arc() -> Result<Arc<dyn Library>, Error> {
if let Ok(l) = pfring::Library::open_default_paths() {
return Ok(Arc::new(l));
}
if let Ok(l) = wpcap::Library::open_default_paths() {
return Ok(Arc::new(l... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2014-2016 pocsuite developers (https://seebug.org)
See the file 'docs/COPYING' for copying permission
"""
import re
import os
import glob
from pocsuite.lib.core.data import kb
from pocsuite.lib.core.data import conf
from pocsuite.lib.core.data import log... | Python | 1 |
t)
command = [
"ipmitool", "-I", "lanplus", "-H", ipmi_host,
"-U", ipmi_user, "-P", ipmi_pass,
"raw", "0x30", "0x30", "0x02", "0xff", f"0x{hex_speed}"
]
run_command(command)
def initialize_fan_control(ipmi_host, ipmi_user, ipmi_pass):
racadm_command = [
"ssh", f"{ipmi_us... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: ssoexceptions.py
#
# Copyright 2020 Sayantan Khanra, Costas Tyfoxylos
#
# 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 restric... | Python | 1 |
_pix - min_pix))
bb[idx, min_pix:min_pix + diff_value] = 0
mask_image = Image.fromarray((bb.T * 255).astype(np.uint8)).convert("RGB")
mask_image = convolution(mask_image)
mask_image = convolution(mask_image)
mask_image = convolution(mask_image)
# generate image that ... | Python | 1 |
extractor._extract_metadata(input_meta) == {"summary": "Test Document"}
def test_extract_metadata_citations(extractor: MarkdownExtractor) -> None:
input_meta = {"citations": [{"citationId": "ref1"}, {"citationId": "ref2"}]}
assert extractor._extract_metadata(input_meta) == {"citations": ["ref1", "ref2"]}
d... | Python | 1 |
"""
Given the root of a binary tree, flatten the tree into a "linked list":
The "linked list" should use the same TreeNode class where the right child pointer points to the next node in the list and the left child pointer is always null.
The "linked list" should be in the same order as a pre-order traversal of the bi... | Python | 1 |
tinterrupt\n\tFCB\t__err__\n\tFCB\t__init_\n");
} else {
instructions.push_str("\n\tORG\t$FE\n\tFCB\t__err__\n\tFCB\t__init_\n");
}
}
<reponame>mbc-git/rust
// rustfmt-indent_style: Block
// Struct literal-style
fn main() {
let lorem = Lorem {
ipsum: dolor,
sit: amet,
};
}
<filename>src/mod... | Rust | 0 |
quote!({ defmt::export::fetch_add_string_index() })
} else {
let statik = mkstatic(varname.clone(), string, tag);
quote!({
#statik
&#varname as *const u8 as usize
})
}
}
struct Write {
fmt: Expr,
_comma: Token![,],
litstr: LitStr,
rest: Optio... | Rust | 0 |
="col-sm-1 col-form-label" for="webhooks">{ "Webhooks" }</label>
<div class="col-sm-11">
{
for self.webhooks.iter().map(move |webhook| {
let id = webhook.id.unwrap_or_default();
... | Rust | 0 |
: "Unknown",
"line_protocol": "up",
"mtu": 1500,
"oper_status": "up",
"reliability": "Unknown",
"rxload": "unknown",
"txload": "unknown",
},
"Null0": {
"bandwidth": 0,
"counters": {
"in_broadcast_pkts": 0,
"in_discards": 0,
... | Python | 1 |
fixed ×2<sup>60</sup> */
pub type Exbi<B> = Fix<B, P60>;
/** Signed fixed ×2<sup>70</sup> */
pub type Zebi<B> = Fix<B, P70>;
/** Signed fixed ×2<sup>80</sup> */
pub type Yobi<B> = Fix<B, P80>;
/** Unsigned fixed ×2<sup>0</sup> */
pub type UUnit<B> = UFix<B, Z0>;
/** Unsigned fixed ×2<... | Rust | 0 |
raw::c_char,
);
}
extern "C" {
pub fn g_assertion_message_expr(
domain: *const ::std::os::raw::c_char,
file: *const ::std::os::raw::c_char,
line: ::std::os::raw::c_int,
func: *const ::std::os::raw::c_char,
expr: *const ::std::os::raw::c_char,
);
}
extern "C" {
pub... | Rust | 0 |
bonded_types - only for new atoms
nonbonded_charges - only for new atoms."""
return self
def add_new_hbond_restraints_in_place(self, proxies, sites_cart,
max_distance_between_connecting_atoms=5,
skip_max_proxy_distance_calculation=False):
pass
def add_new_bond_restraints_in_place(self, pro... | Python | 1 |
match p.cur() {
T![++] => {
let assignment_target = expression_to_assignment(p, marker, checkpoint);
let m = assignment_target.precede(p);
p.bump(T![++]);
m.complete(p, JS_POST_UPDATE_EXPRESSION)
}
... | Rust | 0 |
from .common import InfoExtractor
class SkylineWebcamsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?skylinewebcams\.com/[^/]+/webcam/(?:[^/]+/)+(?P<id>[^/]+)\.html'
_TEST = {
'url': 'https://www.skylinewebcams.com/it/webcam/italia/lazio/roma/scalinata-piazza-di-spagna-barcaccia.html',
'... | Python | 1 |
impl<T: Copy, D: Device> Ref<[T], D> {
pub fn copy_from_slice(&mut self, from: &Self) {
D::copy(from, self);
}
pub fn copy_from_host(&mut self, from: &[T]) {
D::copy_from_host(from, self);
}
pub fn copy_to_host(&self, to: &mut [T]) {
D::copy_to_host(self, to);
}
}
imp... | Rust | 0 |
"""Song search functionality.""" | Python | 1 |
import sys, os
import numpy
import queue
import time
import threading
import base64
import librosa
from base import RemdisModule, RemdisUpdateType
from matplotlib import pyplot as plt
from matplotlib import animation
class DrawScore(RemdisModule):
def __init__(self,
sub_exchanges=['score']):
... | Python | 1 |
e.
:rtype: bool
"""
return bool(_lib.ares_threadsafety())
__all__ = (
"ARES_FLAG_USEVC",
"ARES_FLAG_PRIMARY",
"ARES_FLAG_IGNTC",
"ARES_FLAG_NORECURSE",
"ARES_FLAG_STAYOPEN",
"ARES_FLAG_NOSEARCH",
"ARES_FLAG_NOALIASES",
"ARES_FLAG_NOCHECKRESP",
"ARES_FLAG_EDNS",
"ARES... | Python | 1 |
// always maps groups of the previous level and never splits previous levels groups in half.
let group_size_iter = (1u8..)
.map(|l| (TreeLevel::try_from(l).unwrap(), level_group_size.get().pow(l as u32)))
.take_while(|(_, s)| first_level_size / *s >= min_level_size.get());
// ... | Rust | 0 |
e an instance given a public key and a set of valid networks
pub fn from_public(public: DescriptorPublicKey, networks: ValidNetworks) -> Self {
DescriptorKey::Public(public, networks, PhantomData)
}
/// Create an instance given a secret key and a set of valid networks
pub fn from_secret(secret:... | Rust | 0 |
from typing import List
import torch
from torch import Tensor, nn
import torch.nn.functional as F
class MseLoss(nn.Module):
def __init__(self, normalize: bool, is_masked: bool = False):
super().__init__()
self.normalize = normalize
self.is_masked = is_masked
def get_score_names(self)... | Python | 1 |
import pytest
from src.marketplace.applications.naas.integrations.NaasIntegration import (
NaasIntegrationConfiguration,
NaasIntegration
)
from src.core.abi.workflows.ConvertOntologyGraphToYamlWorkflow import (
ConvertOntologyGraphToYamlWorkflowConfiguration,
)
from src.core.abi.workflows.CreateIndividualO... | Python | 1 |
# nested Loops
# we create a 12 times table
# iterate through the range of numbers from 1 to 12
for multiplier in range(1,13):
for multiplicand in range(1,13): # nest the multiplicand iteration of range 1 to 12
... | Python | 1 |
models.list,
)
self.delete = to_streamed_response_wrapper(
models.delete,
)
class AsyncModelsWithStreamingResponse:
def __init__(self, models: AsyncModels) -> None:
self._models = models
self.retrieve = async_to_streamed_response_wrapper(
mod... | Python | 1 |
eKeyboardButton("💬 Contact Now", url="https://t.me/kingofpatal")],
]
)
await callback_query.message.edit_text(plan_text, reply_markup=buttons)
@app.on_callback_query(filters.regex("see_terms"))
async def see_terms(client, callback_query):
terms_text = (
"> 📜 **Terms and Conditions** 📜... | Python | 1 |
class LaneTraffic:
Unkown = 0
Inside = 1
Outside = 2
class Lane():
def __init__(self, initial = LaneTraffic.Unkown, final = LaneTraffic.Unkown):
self.initial = initial
self.final = final | Python | 1 |
negative or zero, then we get the same word::
sage: words.PalindromicDefectWord(0)
word: aaaaaa
sage: words.PalindromicDefectWord(-3)
word: aaaaaa
"""
kk = k-1
a, b = alphabet
if not (isinstance(a, str) and isinstance(b, str)):
... | Python | 1 |
def main():
name = input("Ingrese nombre: ")
last_name = input("Ingrese apellido: ")
birth_year = input("Ingrese año de nacimiento: ")
print(f"Nuevo nombre de usuario: {name[:3]}{last_name[:3]}{birth_year[-2:]}")
if __name__ == "__main__":
main() | Python | 1 |
2;
if (dfii & 1) != 0 {
dfidf += df(
mulsignf(3.141_592_741_012_573_242_2 * -0.5, dfidf.0),
mulsignf(-8.742_277_657_347_585_773_1_e-8 * -0.5, dfidf.0),
);
}
s = dfidf.normalize();
if d.is_infinite() || d.is_nan() {
s.0 ... | Rust | 0 |
3Perm = f().invert();
}
&F_PRIME
}
pub fn f2() -> &'static Cube3Perm {
lazy_static! {
static ref F2: Cube3Perm = f().ntimes(2);
}
&F2
}
pub fn r() -> &'static Cube3Perm {
lazy_static! {
static ref R: Cube3Perm = Cube3Perm {
corners: corner_prim::r().clone(),
... | Rust | 0 |
ultyLevel.EXPERT and self.custom_difficulty:
return self.custom_difficulty
return self.difficulty_presets[self.current_difficulty]
def get_current_quality_settings(self) -> QualitySettings:
"""現在の品質設定取得"""
if self.current_quality == QualityPreset.CUSTOM and self.custom_quali... | Python | 1 |
f::HLOCAL);
}
ret
}
} else {
String::from("Unknown.")
}
}
#[cfg(target_os = "windows")]
fn error_string(errno: i32) -> String {
let mut err_msg: winnt::LPWSTR = std::ptr::null_mut();
let ret = unsafe {
winbase::FormatMessageW(
winbase::FORMAT... | Rust | 0 |
ane("\\", "...%5c.%5c")
normal_scane('\\/', "..%5c%2F")
normal_scane("/", "%2e%2e%2e%2F%2e%2F")
normal_scane("/", "%2e%2e%2e%2e%2F%2F")
normal_scane("/", "%2e%2e%3B%2F")
normal_scane("\\", "%2e%2e%2e%5c%2e%5c")
normal_scane('\\/', "%2e%2e%5c%2F")
#### last request... | Python | 1 |
{
MovingAverageFilter { last: VecDeque::with_capacity(length), length: length }
}
}
impl Filter for MovingAverageFilter {
type Frame = StandardFrame;
fn apply(&mut self, input: StandardFrame) -> StandardFrame {
if self.last.len() == self.length {
self.last.pop_front();
}
self.last.push_back(input);
l... | Rust | 0 |
s be returned as a floating point data type.
Parameters
----------
mu : float or NDArray
Mean of the negative binomial distribution.
alpha : float or NDArray
Alpha (dispersion) parameter of the negative binomial distribution.
shape : int or tuple of ints
The number of sample... | Python | 1 |
#!/usr/bin/env python
# Copyright (c) 2025 Carnegie Mellon University.
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE
# ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS.
# CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND,
# EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDI... | Python | 1 |
ackrat parsing enabled.
c s8 t | j f d } j | d t d S( Nc s7 t | j } | k r3 t d d d n d S( NR i ( R R R ( R RN Rp t theseTokens( t matchTokens( sf /private/var/folders/vy/31wknkcs30l6xb2fzgwn... | Python | 1 |
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
use std::collectio... | Rust | 0 |
inline]
pub fn add_files(
&mut self,
files: flatbuffers::WIPOffset<
flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<File<'b>>>,
>,
) {
self.fbb_
.push_slot_always::<flatbuffers::WIPOffset<_>>(Package::VT_FILES, files);
... | Rust | 0 |
import os
from pathlib import Path
from setuptools import find_packages, setup
try:
import torch
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
except ModuleNotFoundError as e:
raise ModuleNotFoundError("No module named 'torch'. `torch` is required to install `grouped_gemm`.",) from e... | Python | 1 |
self
}
}
#[doc = "rtc configure register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/... | Rust | 0 |
assert_eq!(flash.read(StorageSlot::Custom(2)), None);
page1[3] = 0x2f01;
assert_eq!(flash.read(StorageSlot::Configuration), Some(0x0f));
assert_eq!(flash.read(StorageSlot::Custom(2)), Some(0x01));
}
#[test]
fn write_when_page_has_enough_space() {
let page1: [u16; ... | Rust | 0 |
from setuptools import setup
setup(
name="movement_primitive_diffusion",
version="0.0.1",
author="Paul Maria Scheikl, Nicolas Schreiber, Christoph Haas",
packages=["movement_primitive_diffusion"],
install_requires=[
"torch",
"torchvision", # For image transformations
"pytes... | Python | 1 |
::{
config::CameraConfig,
data::{Camera, PlayerState, Position, Velocity},
time::Time,
};
#[derive(Debug)]
pub struct CameraSystem;
impl CameraSystem {
pub fn run(
&mut self,
player_states: &SparseStorage<PlayerState>,
positions: &Storage<Position>,
previous_positions: ... | Rust | 0 |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def reverseList(self, head: Optional[ListNode]) -> Optional[ListNode]:
output = ListNode()
while head:
temp = ListNode(he... | Python | 1 |
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
new_nums = []
for idx in range(len(nums)):
new_nums.append((nums[idx],idx))
new_nums.sort(key=lambda item: item[0])
max_part = int(target/2)
end = 1
while(new_nums[en... | Python | 1 |
'''
Defines the set of symbols used in text input to the model.
'''
_pad = '_'
_punctuation = ',.!?-~…'
_letters = 'AEINOQUabdefghijklmnoprstuvwyzʃʧʦɯɹəɥ⁼ʰ`→↓↑ '
'''
# japanese_cleaners2
_pad = '_'
_punctuation = ',.!?-~…'
_letters = 'AEINOQUabdefghijkmnoprstuvwyzʃʧʦ↓↑ '
'''
'''# korean_cleaners
_pad ... | Python | 1 |
from unittest.mock import Mock
import pytest
from sceptre.exceptions import InvalidResolverArgumentError
from sceptre.resolvers import Resolver
from sceptre.resolvers.select import Select
class MyListResolver(Resolver):
def resolve(self):
return ["first", "second", "third"]
class ItemResolver(Resolver... | Python | 1 |
(|e| e.as_ptr())
.collect::<Vec<*const c_char>>();
let extension_names_str = get_available_extensions_names(supported_extensions);
let extension_names_ptr = extension_names_str
.iter()
.map(|e| e.as_ptr() as *const c_char)
.collect::<Vec<*const c_char>>();
//Create Instance... | Rust | 0 |
# Copyright 2017 Insurance Australia Group Limited
#
# 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 applicable law or ag... | Python | 1 |
accuracy, precision, recall, f1 = get_metrics(val_y, y_pred)
print(accuracy)
print(precision)
print(recall)
print(f1)
with open(OUTPUT_FILE, "a") as handle:
handle.write(
f"Starting testing architecture number {i+1}/{len(architectures)}\n"
)
if hid2:
... | Python | 1 |
"""Escribe un programa que pida al usuario una lista de números enteros
separados por comas y almacene estos números en una tupla. Luego, el programa
debe calcular y mostrar la suma, el promedio, el número máximo y el número
mínimo de la tupla."""
lista_num = input("Introduce numeros enteros separados por comas: ")
li... | Python | 1 |
save_path.exists();
let file = std::fs::File::options().read(true).write(true).create(true).open(save_path);
let autosave = args.autosave;
let reset = args.reset;
let mut cam = Camera::new(args, file.expect("failed to open save file"), terminal::size()?);
if exists && !reset {
cam.load();
... | Rust | 0 |
import os
import sys
import configparser
import requests
class WolfScan(object):
def __init__(self):
self.get_user_info_api = "https://plat.wgpsec.org/api/user/getUserInfo"
self.create_wolfscan_api = "https://plat.wgpsec.org/api/wscan/saveUserWsJob"
self.query_productlist_api = "https://pl... | Python | 1 |
"""Local file management toolkit."""
from langchain_community.agent_toolkits.file_management.toolkit import (
FileManagementToolkit,
)
__all__ = ["FileManagementToolkit"]
| Python | 1 |
ject for $newclass {
fn class() -> &'static Class {
$unique_newclass.call_once(|| {
let superclass = Class::get(stringify!($superclass)).unwrap();
let mut decl = ClassDecl::new(stringify!($newclass), superclass).unwrap();
decl.add_i... | Rust | 0 |
for SendFut<'sender, T> {
type Output = ();
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let (sender, to_send) = self.project();
match sender.try_send(to_send.take().unwrap()) {
Ok(_) => Poll::Ready(()),
Err(val) => {
*to_s... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.