text string | label_name string | labels int64 |
|---|---|---|
elf.md5_hash = other.md5_hash;
}
if self.sha1_hash.is_empty() && !other.sha1_hash.is_empty() {
merged = true;
self.sha1_hash = other.sha1_hash;
}
if self.sha256_hash.is_empty() && !other.sha256_hash.is_empty() {
merged = true;
self.sha256... | Rust | 0 |
BlakeTwo256;
type AccountId = u128; // u64 is not enough to hold bytes used to generate bounty account
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type Event = Event;
type BlockHashCount = BlockHashCount;
type Version = ();
type PalletInfo = PalletInfo;
type Acc... | Rust | 0 |
#Directory Path Access Os Module
import os
def print_directory_contents(path):
"""
Print the contents of a directory
"""
try:
contents = os.listdir(path)
print(f"Contents of {path}:")
for item in contents:
print(item)
except FileNotFoundError:
print(f"Dire... | Python | 1 |
_config_path, "w") as config_file:
json.dump(override_config, config_file)
# Mock the ACCESS_CONFIG_FILE environment variable
monkeypatch.setenv("ACCESS_CONFIG_FILE", filename)
config = {
NAME_VALIDATION_PATTERN: "name_pattern",
NAME_VALIDATION_ERROR: "name_... | Python | 1 |
Some(PathRewriter::new(regex, replacement)?)
} else {
None
};
Ok(Self {
output_directory,
syntax_set: SyntaxSet::load_defaults_newlines(),
path_rewriter,
})
}
pub fn report(&self, executed_mutants: &[super::ReportableMutant]) -> R... | Rust | 0 |
epoch, net, (epoch, optimizer, scheduler), train_loss, train_acc, save_name='best_acc')
if (epoch%args.save_step)==0:
save_logging(args, test_loss, test_acc, epoch, net, (epoch, optimizer, scheduler), train_loss, train_acc, save_name=f'{epoch}')
writer.close()
else:
net.... | Python | 1 |
, for datasets that are published as a set of individual documents, such as RDF/XML documents or RDFa-annotated web pages. Non-RDF documents, such as web pages in HTML or images, are usually not included in this count. This property is intended for datasets where the total number of triples or entities is hard to deter... | Rust | 0 |
= "timeGrain")]
pub time_grain: String,
pub retention: String,
}
impl MetricAvailablity {
pub fn new(time_grain: String, retention: String) -> Self {
Self { time_grain, retention }
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct MetricData {
#[serde(rename = "timeS... | Rust | 0 |
fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) {
let _ = &this.pinned1;
let _ = &this.pinned2;
let _ = &this.unpinned1;
let _ = &this.unpinned2;
}
};
fn main() {}
use std::thread::sleep;
use std::time::Duration;
use crate::db::{C_M, C_R, D_M, D_R, InstanceDaoImpl, MetaCa... | Rust | 0 |
user_id=current_user.id
)
if updated_session:
logger.success(f"Ended room session: {room_name}")
return {
"message": "Room session ended successfully",
"room_name": room_name,
... | Python | 1 |
Any], output_dir: Path) -> Path:
"""Export results as text file."""
output_file = output_dir / 'loop_results.txt'
with open(output_file, 'w', encoding='utf-8') as f:
f.write("Loop OSINT Crawler Results\n")
f.write("=" * 50 + "\n\n")
for category, items in re... | Python | 1 |
###########################################################
#
# Copyright (c) 2020, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | Python | 1 |
marItem::ExternToken(ExternToken {
span: Span(lo, hi),
associated_types: a0,
enum_token: None,
})
}
}
#[allow(unused_variables)]
fn ___action83<
'input,
>(
text: &'input str,
(_, t, _): (usize, MatchToken, usize),
) -> GrammarItem
{
GrammarItem::MatchToken(t)
}
#[al... | Rust | 0 |
.read(PAGE_SIZE - 1, buf.as_mut(), &source).await.expect("read failed"),
11
);
}
#[fasync::run_singlethreaded(test)]
async fn test_block_unaligned_read() {
let data_buf = MemDataBuffer::new(100 * PAGE_SIZE);
let device = Arc::new(FakeDevice::new(100, 8192));
let ... | Rust | 0 |
iations.
Returns
-------
list[tuple[str, dict]]
List of tuples of the MAPDL result file path (on the platform where MAPDL was executed) and
the parameter values for each variation solved.
"""
# Specify the force load variations
forces = [250, 500, 750, 1000]
# Start MAPDL a... | Python | 1 |
(e) => {
e.insert(member.user.clone());
},
Entry::Occupied(mut e) => {
e.get_mut().clone_from(&member.user);
},
};
Ok(member)
},
}
}
pub async fn get_guild<G>(ctx: Context<'_>, guild_id: G) -> R... | Rust | 0 |
import sys, grader, parse
from p2 import value_next
from copy import deepcopy
ENSW = {'E': (0,1), 'N': (-1,0), 'S': (1,0), 'W': (0,-1)}
NOISE_DI = {'N':['N', 'E', 'W'], 'E':['E', 'S', 'N'], 'S':['S', 'W', 'E'], 'W':['W', 'N', 'S']}
def value_iteration(problem):
# return_value = ''
return_value = "V_k=0"
... | Python | 1 |
# -*- coding:utf-8 -*-
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel
from typing import List, Literal, Optional, Union
from module_admin.annotation.pydantic_annotation import as_query
class CarDriverBaseModel(BaseModel):
"""
表对应p... | Python | 1 |
// This is a mio-based implementation of running a process asynchronously and capturing its
// stdout and stderr. Mio is used here directly because in order to preserve the order of
// wakeup events, we need to use one Poll for both streams.
let (mut reader_out, writer_out) = pipe().unwrap();
let (... | Rust | 0 |
import os
import unittest
import json
from typing import Dict
import jc.parsers.proc_pid_stat
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
class MyTests(unittest.TestCase):
f_in: Dict = {}
f_json: Dict = {}
@classmethod
def setUpClass(cls):
fixtures = {
'proc_pid_stat': ... | Python | 1 |
who invoked this contract function.
let sender = ctx.sender();
let receive_address = params.to.address();
let (state, state_builder) = host.state_and_builder();
// Update the state.
state.mint(&TOKEN_ID_WCCD, amount.micro_ccd.into(), &receive_address, state_builder)?;
// Log the newly minted... | Rust | 0 |
AI Compatible, Ollama, and Hugging Face models
if "ollama" in self.model or "huggingface" in self.model or self.model.startswith("openai/"):
completion_params["api_base"] = self.api_base
try:
self.logger.info(f"📣 Calling LLM from {caller_name}()...")
response = lite... | Python | 1 |
handling clicks on the graph.
///
/// Returns None if no appropriate point can be found, for example
/// if the data point for a scroll position has already been
/// discarded.
pub fn drawing_area_pos_to_point(&self, x: f64, _y: f64) -> Option<Point> {
let view = self.s.view_read.borrow().g... | Rust | 0 |
der(
"user/2fa.html",
req.uri().path().to_string(),
Some(ctx),
Some(user),
)?))
}
/// Struct for the adding TOTP form
#[derive(Serialize, Deserialize)]
pub struct AddTotpForm {
current_password: String,
code: String,
csrf: String,
}
/// Accepts the p... | Rust | 0 |
(zx::Signals::USER_0)
);
assert_eq!(OnSignals::new(&p_check, zx::Signals::USER_1).await, Ok(zx::Signals::USER_1));
}
#[fasync::run_singlethreaded(test)]
async fn test_fails_when_set_healthy_fails() {
let paver = Arc::new(
MockPaverServiceBuilder::new()
.i... | Rust | 0 |
"""
The code of OCL metrics is sourced from the following references:
T. Oblak, R. Haraksim, P. Peer, L. Beslay.
Fingermark quality assessment framework with classic and deep learning ensemble models.
Knowledge-Based Systems, Volume 250, 2022
T. Oblak, R. Haraksim, L. Beslay, P. Peer.
Fingermark Quality Assess... | Python | 1 |
).expect("must specify output file");
// Generate the page
let input = InputData::from_file(&input_file)?;
generate_to(&output_file, &input)?;
Ok(())
}
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Default)]
pub struct MemoData {
#[serde(rename="MemoData")]
pub m... | Rust | 0 |
els = gt_labels[gt_bboxes_mask.bool()]
target_single['gt_boxes'] = self.encode_bbox(valid_bboxes) # boxes本身是torch.float64 这个encode会让它变成torch.float32
target_single['labels'] = valid_labels
targets_single.append(target_single)
for batch_idx in range(len(gt_bboxes_3d)): # 遍历每个... | Python | 1 |
from abc import ABC, abstractmethod
from automatic_prompt_engineer import llm
import itertools
from automatic_prompt_engineer import llm, data, template
import numpy as np
import asyncio
import nest_asyncio
nest_asyncio.apply()
class Evaluator(ABC):
"""Abstract base class for large language models."""
... | Python | 1 |
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.document_loaders import (
AirbyteCDKLoader,
AirbyteGongLoader,
AirbyteHubspotLoader,
AirbyteSalesforceLoader,
AirbyteShopifyLoader,
AirbyteStr... | Python | 1 |
189: 251, # 'Ѕ'
190: 252, # 'ѕ'
191: 253, # 'ї'
192: 37, # 'А'
193: 44, # 'Б'
194: 33, # 'В'
195: 46, # 'Г'
196: 41, # 'Д'
197: 48, # 'Е'
198: 56, # 'Ж'
199: 51, # 'З'
200: 42, # 'И'
201: 60, # 'Й'
202: 36, # 'К'
203: 49, # 'Л'
2... | Python | 1 |
"""
GUI VERSION OF THE ENCRYPTER & DECRYPTER PROGRAM
Text encrypter & Decrypt program
02/27/2024
Mehmet Kahya
"""
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
from tkinter import simpledialog
from tkinter import font
from colorama import Fore
def encrypt(text):
encryption_dict = {
... | Python | 1 |
sync_download!( { doc: $doc, name: $name, response: $response, path: $template, params: [ $p ] } );
};
( { doc: $doc:expr, name: $name:ident, response: $response:ty, path: $template:expr, params: [ $p:ident ], has_body: false } ) => {
register_async_download!( { doc: $doc, name: $name, response: $res... | Rust | 0 |
either override this class
method or override the `capabilities` property to disabled any unwanted
built-in capabilities.
For all except very advanced use cases, we recommend leaving these
implementations "as-is", since this provides the most choice to users and is
the most "fu... | Python | 1 |
fn parse_comment_expr(&mut self) -> Result<Box<Expr>, String> {
// match self.token.kind {
// TokenKind::Comment(Line) => {
// let expr = self.token.text();
// Ok(make_comment_line_expr(expr))
// }
// _ => Err(format!(
// "parser:fn:parse_comment_expr:error: {}",
// ... | Rust | 0 |
import sys, wx
import numpy as np
sys.path.append('../../')
from sciapp.object import Mesh, Scene
from sciwx.mesh import Canvas3D, MCanvas3D, Canvas3DFrame, Canvas3DNoteBook, Canvas3DNoteFrame
from sciapp.util import meshutil
# vts, fs, ns, cs = surfutil.build_ball((100,100,100), 50, (1,0,0))
verts, faces = meshutil.... | Python | 1 |
<meta charset="utf-8">
<style>{}</style>
</head>
<body>
<div id="root"></div>
<script>
var data = {};
var previousData = {};
</script>
<script crossorigin>{}</script>
<script crossorigin>{}</script>
<script>{}</script>
</body>
</html>"##,
include_str!("report_viewe... | Rust | 0 |
pub const mask: u32 = 1 << offset;
/// Read-only values (empty)
pub mod R {}
/// Write-only values (empty)
pub mod W {}
/// Read-write values
pub mod RW {
/// 0b0: Selecting Pad: GPIO_SD_B1_04 for Mode: ALT2
pub const GPIO_SD_B1_04_ALT2: ... | Rust | 0 |
class RoiErrors(Exception):
def __init__(self, message):
super().__init__(message)
def get_data_from_db(company_id):
return [company_id, f'Google {company_id}', 0.7] # Id, name, ROI
def test_check_company():
db_data = get_data_from_db(20)
if db_data[2] < 0.8:
raise RoiErrors('ROI ... | Python | 1 |
edSubtitleSet(self, AddedSubtitleSet):
self._AddedSubtitleSet = AddedSubtitleSet
@property
def RequestId(self):
"""唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
:rtype: str
"""
return self._RequestId
@RequestId.setter
def... | Python | 1 |
-> T {
FromPrimitive::from_usize(
x.par_iter()
.zip(y.par_iter())
.filter(|(a, b)| a != b)
.count()
).unwrap()
}
<gh_stars>1-10
use anyhow::Error;
use serde::{Deserialize, Serialize};
use sqlx::types::chrono::NaiveDateTime;
use sqlx::types::Uuid;
use sqlx::{Pool, Pos... | Rust | 0 |
__u6_addr32[0usize] == 0u32
&& (*__a).__in6_u.__u6_addr32[1usize] == 0u32
&& (*__a).__in6_u.__u6_addr32[2usize] == htonl(0xffffu32))
as libc::c_int
}) != 0
{
let mut sin = sockaddr_in {
sin_family: 0,
sin_port: 0... | Rust | 0 |
pub __imp_: *const ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_std___libcpp_refstring() {
assert_eq!(
::std::mem::size_of::<std___libcpp_refstring>(),
8usize,
concat!("Size of: ", stringify!(std___libcpp_refstring))
);
assert_eq!(
::std::mem::align_of::<std___l... | Rust | 0 |
from telethon import TelegramClient, events
from datetime import datetime
import json
from telethon.tl.types import User, Channel
import os
colors = {
"red": '\033[00;31m',
"green": '\033[00;32m',
"light_green": '\033[01;32m',
"yellow": '\033[01;33m',
"light_red": '\033[01;31m',
"blue": '\033[9... | Python | 1 |
avefig(f"{IMAGES_FOLDER}/weyls_law_analog_{test_id}.png", dpi=300)
plt.show()
print(f"Overall slope: {slope}, R^2: {r_squared}")
def run_analysis(
area_sampling,
shapes,
SCRIPT_NAME,
fit_per_shape=True,
plot_N_R_behavior=True,
plot_weyls_law_analog=True,
):
combinations = [(shape,... | Python | 1 |
{ right, body }
}
}
// -----------------------------------------------------------------------------------------------
#[derive(Clone, Serialize, Deserialize, PartialEq, Debug)]
pub enum PathItem {
Right(PathRight),
Left(PathLeft),
}
impl PathItem {
pub fn right(left: Hash) -> PathItem {
Path... | Rust | 0 |
scii!(data, ASCII_LESS_THAN_SIGN);
ascii!(data, ASCII_LESS_THAN_SIGN);
data = consume_whitespace(data);
let mut result = HashMap::new();
while data.len() > 0 {
let key = repeat!(data, identifier);
data = consume_whitespace(data);
let value = block!(data, object);
data =... | Rust | 0 |
let a2 = a2mid + 3.0 * a3mid;
let a3 = a3mid;
_acc2[k] = s2 * a2;
_acc3[k] = s3 * a3;
}
// Commit to the new state
*tnow = new_tnow;
*pos = new_pos;
*vel = new_vel;
*acc0 = new_acc... | Rust | 0 |
",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"... | Rust | 0 |
from .base_converter import BaseConverter
from ..operators import SoftACSConv
class SoftACSConverter(BaseConverter):
"""
Decorator class for converting 2d convolution modules
to corresponding soft-acs version in any networks.
Args:
model (torch.nn.module): model that needs to be converted
... | Python | 1 |
)
)
except Exception as e:
logger.info(f"Unable To Open Group {warner.chat_id} - {e}")
# Run everyday at 06
scheduler = AsyncIOScheduler(timezone="Asia/Kolkata")
scheduler.add_job(job_open, trigger="cron", hour=6, minute=1)
scheduler.start()
__help__ = """
*Admins Only*... | Python | 1 |
(&self) -> Self::AbstractTypeType {
Self::AbstractTypeType{}
}
}
impl TermTrait for i64 {
type AbstractTypeType = st::Sint64;
fn is_parametric(&self) -> bool {
false
}
fn is_type(&self) -> bool {
false
}
fn abstract_type(&self) -> Self::AbstractTypeType {
Se... | Rust | 0 |
link_tag_reciprocal: &S,
) -> RecordAPIResult<Vec<RecordAPIResult<HeaderHash>>>
where I: AsRef<str>,
S: AsRef<[u8]> + ?Sized,
A: DnaAddressable<EntryHash>,
B: DnaAddressable<EntryHash>,
{
let source_hash = calculate_identity_address(source_entry_type, source)?;
let dest_hash = ca... | Rust | 0 |
lar;
}
"#;
let pro_que = ProQue::builder()
.src(src)
.dims(array.len())
.build()
.unwrap();
let ocl_buffer = pro_que
.buffer_builder()
.copy_host_slice(array.value_slice(0, array.len()))
.build()
.unwrap();
let kernel = pro_que
... | Rust | 0 |
", &qos.qos_class)
.field("relative_priority", &qos.relative_priority)
.finish()
}
}
/// Getting global queues.
impl DispatchQueue {
/// The serial dispatch queue associated with the main thread of the current
/// process.
#[inline]
#[doc(alias = "dispatch_get_main_queue")]
... | Rust | 0 |
::VolatileCell<u32>,
}
#[doc = "Unspecified"]
pub mod unused2;
#[doc = "Unspecified"]
pub struct UNUSED3 {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "Unspecified"]
pub mod unused3;
#[doc = "Description collection[0]: Reserved for Nordic firmware design"]
pub struct NRFFW {
register: ::vcell::VolatileCell<... | Rust | 0 |
fmt: &FormattingDirectives,
) -> Result<()> {
let regular = &fmt.regular.0;
let emphasis = &fmt.emphasis.0;
// First, we print the prefix to stdout
write!(term, "{}", regular.apply_to(fmt.prefix.as_ref()))?;
// The number of characters that have been printed out to... | Rust | 0 |
import os, cv2, subprocess, re
from pymkv import MKVTrack as mkvt, MKVFile as mkvf, MKVAttachment as mkva
from typing import Union, List, Dict
from rich.progress import Progress
idiomas = ['Català', 'Español', 'English', '日本語', 'Italiano', 'Français']
iso6392 = {'cat': 'Català', 'spa': 'Español', 'eng': 'English', 'jp... | Python | 1 |
ff) as u8;
}
}
}
}
_ => {}
}
dst
}
#[cfg(feature = "libz-sys")]
unsafe fn filter_create_predictor_dict(
predictor: i32,
columns: i32,
bpc: i32,
colors: i32,
) -> pdf_dict {
let mut parms = pdf_dict::new();
parms.set("BitsPer... | Rust | 0 |
36f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a210326ffd12bd115f260a371f2f09bf29286e4c9681c7bc109f4604c82ed82d6d23212460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a210343a3b485021493370286c9f4725358a3fd459576f963dcc158cb82c02276b67f").into(),
};
let pk = Leg... | Rust | 0 |
import hecate as hc
import sys
# import pandas as pd
import torch
from torchvision import datasets, transforms
from PIL import Image
import numpy as np
from random import *
import pprint
from pathlib import Path
source_path = Path(__file__).resolve()
source_dir = source_path.parent
def preprocess():
x = [ uni... | Python | 1 |
-> Vec<IpAddr> {
match self {
IpAddrNetwork::V4(v4) => v4.all().into_iter().map(IpAddr::V4).collect(),
IpAddrNetwork::V6(v6) => v6.all().into_iter().map(IpAddr::V6).collect()
}
}
/// Returns all hosts (exclude network & broadcast addr).
///
/// # Examples:
/... | Rust | 0 |
1];
Node::Sequence(
seq_body.to_owned(),
Box::new(block_node[0].clone()),
Some(Box::new(size_node[0].clone())),
)
... | Rust | 0 |
1)
.finalize(components::spi_mux_component_helper!(stm32f303xc::spi::Spi));
let l3gd20 =
components::l3gd20::L3gd20SpiComponent::new(board_kernel, capsules::l3gd20::DRIVER_NUM)
.finalize(components::l3gd20_spi_component_helper!(
// spi type
stm32f303xc::s... | Rust | 0 |
se of decoding n>1, copy prefill cache to decoding indices
destination_index = self.free_cache_indices.pop()
self._copy_cache(from_index=index_exists,
to_index=destination_index)
self.cache_indices_mapping[cur_rid][seq_id] = destination_index
... | Python | 1 |
Ok(PassportFields::IssueYear),
"eyr" => Ok(PassportFields::ExpirationYear),
"hgt" => Ok(PassportFields::Height),
"hcl" => Ok(PassportFields::HairColor),
"ecl" => Ok(PassportFields::EyeColor),
"pid" => Ok(PassportFields::PassportId),
"cid" => Ok(Pa... | Rust | 0 |
PerfCtl {
pub target_performance_state_value: u16,
pub ida_engage: bool,
}
pub fn build_ia32_perf_ctl(msr: u64) -> IA32PerfCtl {
IA32PerfCtl {
target_performance_state_value: (msr & 0xFFFF) as u16,
ida_engage: (msr & (1 << 32)) != 0,
}
}
#[derive(... | Rust | 0 |
for library in response.context["libraries"]:
if library["i"] == "fe7046323fc3ccc7c6b2748ba58295fc4206a1a3":
for book in library["b"]:
if book["i"] == "9780007560776":
self.assertEqual(book["h"], "Y")
capturedOutput = io.StringIO()... | Python | 1 |
diff.bin", b"\x00\x01\x03");
let mut mint = Mint::new("tests/goldenfiles");
let mut file = mint.new_goldenfile("binary_content_diff.bin").unwrap();
file.write_all(b"\x00\x01\x02").unwrap();
}
#[test]
fn text_match() {
write_text_file("tests/goldenfiles/match1.txt", "Hello world!");
write_text_fil... | Rust | 0 |
"88af2c4d2672363902113b84ea93abd8d883a80ddd4f0125f9027feb3166ef290109884a781ad692144561122719b87ced012ec677c720d6de67454a84e4c3b4"
),
(
// Len = 728
"<KEY>",
(64, 58, [0x816d51c31989cbe6, 0x6d70142dbcaaf490], [0x29ccac68b1e9bf63, 0x8efaee6f760b6b77]),
"313b60f6d8f92ad9ccb01c55d4b600e799a1193fc4fcb34f7867be997... | Rust | 0 |
Assets> for World {
fn fields<'r>(&'r mut self, assets: &'r mut Assets) ->
(&'r mut vm::World, &'r mut vm::Assets<World, Assets>)
{ (&mut self.world, &mut assets.code) }
}
impl real::Api<'_, Assets> for World {
fn fields(&mut self, _: &mut Assets) -> (&mut real::State,) { (&mut self.real,) }
}
imp... | Rust | 0 |
(NR43, NR44)
const REG_SOUNDCNT_L: u32 = 0x4000080; // 2 R/W Control Stereo/Volume/Enable (NR50, NR51)
const REG_SOUNDCNT_H: u32 = 0x4000082; // 2 R/W Control Mixing/DMA Control
const REG_SOUNDCNT_X: u32 = 0x4000084; // 2 R/W Control Sound on/off (NR52)
const REG_SOUNDBIAS: u32 = 0x400008... | Rust | 0 |
import time
import pandas as pd
def calculate_summary_metrics(input_file, summary_output_file_path, relative_output_file_path):
try:
# Read input CSV file
df = pd.read_csv(input_file, skip_blank_lines=True, low_memory=False, na_values=['', 'NA', 'N/A', 'null', 'NaN'])
df.dropna(subset=['p... | Python | 1 |
_net(inputs)[0]
for t in np.arange(0, 1, delta):
tau = torch.full((batch_size, ), t)
if self._int_type == 'midpoint':
output_mid = _time_forward(output, output, tau, delta / 2)
output = _time_forward(output, output_mid, tau + delta / 2,
... | Python | 1 |
def is_negative(self, element):
"""Returns ``False`` for any ``ComplexElement``. """
return False
def is_positive(self, element):
"""Returns ``False`` for any ``ComplexElement``. """
return False
def is_nonnegative(self, element):
"""Returns ``False`` for any ``ComplexE... | Python | 1 |
let mut data = st.get_section_data("contacts".to_string());
data.save(Contact { uuid: "".to_string(), name: "contact 1".to_string(), city_location: "city A".to_string() });
data.save(Contact { uuid: "".to_string(), name: "contact 2".to_string(), city_location: "city B".to_string() });
d... | Rust | 0 |
ing() -> &'static str {
match get_boot_info()
{
&BootInfo::FDT(ref fdt) => fdt.get_props(&["","chosen","bootargs"]).next().map(|x| ::core::str::from_utf8(&x[..x.len()-1]).unwrap_or("") ).unwrap_or(""),
_ => "",
}
}
pub fn get_memory_map() -> &'static [::memory::MemoryMapEnt] {
// TODO: Assert that this is only e... | Rust | 0 |
St: 'static,
St::Ok: ActionSourceable,
St::Error: std::fmt::Debug,
{
let signal_manager_addr = self.signal_manager_addr.clone();
let stream_signal_source = s
.map_err(|e| warn!("Signal source stream error: {:?}", e))
.for_each(move |items| {
... | Rust | 0 |
lse:
pred = pred_cfg
else:
pred = model(x_lr, noise_cond, **model_inputs)
x0_lr, epsilon_lr = self.undiffuse(x_lr, logSNR_range[i], pred)
x_lr = sampler(x_lr, x0_lr, epsilon_lr, logSNR_range[i], logSNR_range[i+1], **sampler_params)
########... | Python | 1 |
ead_u8()? != 0;
world.progress.saved_mechanic = reader.read_u8()? != 0;
world.progress.defeated_goblin_army = reader.read_u8()? != 0;
world.progress.defeated_clown = reader.read_u8()? != 0;
world.progress.defeated_frost_legion = reader.read_u8()? != 0;
world.progress.defeated_pirates = reader.read_u8()? != 0;
... | Rust | 0 |
"""Run Length Encoding"""
def main() :
"""Run Length Encodind main"""
text = input()
lastWord = ''
stackTemp = ''
result = ''
for i,v in enumerate(text) :
if lastWord != v :
couter = 0
if i > 0 :
for _ in stackTemp :
couter += 1... | Python | 1 |
This is the python file
this is the 2nd line in the file
| Python | 1 |
import pytest
from lims.users.models import User
from lims.users.tests.factories import UserFactory
@pytest.fixture(autouse=True)
def _media_storage(settings, tmpdir) -> None:
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture()
def user(db) -> User:
return UserFactory()
| Python | 1 |
oError::new(
ErrorKind::UnexpectedEof,
format!(
"not enough capacity for custom spu len of {}",
self.write_size(version)
),
));
}
match self {
Self::Name(name) => {
let typ: u... | Rust | 0 |
,
pub draw_system: GuiPipeline,
hover_node_id: Option<NodeId>,
open_windows: OpenWindows,
view_state: AppViewState,
gui_msg_rx: crossbeam::channel::Receiver<GuiMsg>,
gui_msg_tx: crossbeam::channel::Sender<GuiMsg>,
app_msg_tx: crossbeam::channel::Sender<AppMsg>,
menu_bar: MenuBar,
... | Rust | 0 |
# fruits = []
# # Loop to get 7 fruits from the user
# for i in range(7):
# fruit = input(f"Enter fruit {i + 1}: ")
# fruits.append(fruit)
# # Show the final list of fruits
# print("You entered these fruits:")
# print(fruits)
#Program to accept marks of 6 students and display them in a sorted manner
# Empty... | Python | 1 |
# Generated by Django 5.0 on 2024-05-04 18:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('transcription', '0002_recording_delete_audiofile'),
]
operations = [
migrations.CreateModel(
name='AudioFile',
fields=... | Python | 1 |
the input into groups
// this is the same approach used by `simd-json`, which makes it possible
// to identify a large number of characters in a 32byte buffer using only a few
// instructions
let index_interest = {
let lo = i;
... | Rust | 0 |
= Some(2))
&& (sue.pomeranians == None || sue.pomeranians < Some(3))
&& (sue.akitas == None || sue.akitas == Some(0))
&& (sue.vizslas == None || sue.vizslas == Some(0))
&& (sue.goldfish == None || sue.goldfish < Some(5))
&& (sue.trees == No... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# 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... | Python | 1 |
# 演示列表常用操作
list_a = [100, 200, 300, 400, 600]
print("list_a 列表元素个数:", len(list_a))
print("list_a 列表最大元素:", max(list_a))
print("list_a 列表最小元素:", min(list_a))
# list.append(obj):在列表末尾添加新的对象
list_a.append(900)
print("list_a:", list_a)
# list.count(obj):统计某个元素在列表中出现的次数
print("100出现的次数:", list_a.count(100))
# list.extend... | Python | 1 |
msClient;
use snafu::ResultExt;
use std::str::FromStr;
/// Builds a KMS client for a given profile name.
pub(crate) fn build_client_kms(profile: Option<&str>) -> Result<KmsClient> {
Ok(if let Some(profile) = profile {
let mut provider = ProfileProvider::new().context(error::RusotoCredsSnafu)?;
prov... | Rust | 0 |
g.fixed as usize - 1;
format!("0.{}1", "0".repeat(n))
}
Some(_) | None => "1".to_owned(),
};
format!("Prec {}", fixed)
}
fn reset(
config: &NumberColumnStyleConfig,
default_config: &NumberColumnStyleDefaultConfig,
) -> NumberColumnSty... | Rust | 0 |
de(namespace.as_bytes(), k8s_openapi::percent_encoding2::PATH_SEGMENT_ENCODE_SET),
);
let mut __query_pairs = k8s_openapi::url::form_urlencoded::Serializer::new(__url);
optional.__serialize(&mut __query_pairs);
let __url = __query_pairs.finish();
let __request = http::Request::p... | Rust | 0 |
{}
// Make sure we catch executing inline assembly.
static TEST_BAD: () = {
unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
//~^ ERROR could not evaluate static initializer
//~| NOTE inline assembly is not supported
//~| NOTE in this expansion of llvm_asm!
//~| NOTE in this expansion of llvm_asm!... | Rust | 0 |
16.
# 如果计算类型为 torch.float16 并且 args.bits==4,也就是4bit量化模型时,进行如下操作。
if torch_dtype == torch.float16 and finetuning_args.quant_bit.bits == 4:
# 得到显卡的计算能力的最大值和最小值,分别对应major和minor
# 只有major >= 8时的GPU才支持bfloat16格式,可以使用参数--bf16来加速训练
major, minor = torch.cuda.get_device_capability()
if ma... | Python | 1 |
$Output:ty, $I:ty) => {
impl<$S: BaseFloat> Index<$I> for Quaternion<$S> {
type Output = $Output;
#[inline]
fn index<'a>(&'a self, i: $I) -> &'a $Output {
let v: &[$S; 4] = self.as_ref();
&v[i]
}
}
impl<$S: BaseFlo... | Rust | 0 |
);
creator.create_wall(-32.0, -64.0);
creator.create_wall(-80.0, -80.0);
// create enemies
creator.create_brown_tank(-100.0, 100.0);
creator.create_brown_tank(100.0, 150.0);
}
// Main game systems
#[allow(clippy::type_complexity)]
fn player_movement_system(
time: Res<Time>,
keyboard_input:... | Rust | 0 |
tProperty(name="p_frame", default=0)
def unregister():
print("unregister")
### Delete handlers
bpy.app.handlers.frame_change_pre.remove(
bpy.app.handlers.frame_change_pre[0]
)
### Unregister Classes ###
for cls in reversed(classes):
print(cls.__name__, cls)
unregiste... | Python | 1 |
,
4 => dpx_options = 4i32,
5 => dpx_options = 3i32,
1 | _ => dpx_options = 1i32,
}
if let Some((page, mut bbox, matrix)) =
pdf_doc_get_page(pf, page_num, dpx_options, 0 as *mut *mut pdf_obj)
{
pdf_close(pf);
pdf_release_obj(page);
/* Image's attribute ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.