text string | label_name string | labels int64 |
|---|---|---|
67/Independent\0";
pub const DAQmx_Val_Switch_Topology_1169_100_SPST: &'static [u8; 14usize] = b"1169/100-SPST\0";
pub const DAQmx_Val_Switch_Topology_1169_50_DPST: &'static [u8; 13usize] = b"1169/50-DPST\0";
pub const DAQmx_Val_Switch_Topology_1175_1_Wire_196x1_Mux: &'static [u8; 22usize] =
b"1175/1-Wire 196x1 Mux... | Rust | 0 |
::Reg<tcd2_daddr::TCD2_DADDR_SPEC>,
#[doc = "0x1054 - TCD Signed Destination Address Offset"]
pub tcd2_doff: crate::Reg<tcd2_doff::TCD2_DOFF_SPEC>,
_reserved_49_dma_tcd2_citer: [u8; 0x02],
#[doc = "0x1058 - TCD Last Destination Address Adjustment/Scatter Gather Address"]
pub tcd2_dlastsga: crate::Re... | Rust | 0 |
ject;
use crate::actor::Actor;
use crate::fut::{ActorFuture, ActorStream, IntoActorFuture};
pin_project! {
/// Stream for the [`fold`](super::ActorStreamExt::fold) method.
#[derive(Debug)]
#[must_use = "streams do nothing unless polled"]
pub struct Fold<S, F, Fut, T> {
#[pin]
stream: S... | Rust | 0 |
from fastapi.testclient import TestClient
from services.handle_mint.app import app
client = TestClient(app)
def test_issue_handle_success():
response = client.post(
"/handles",
json={
"desired_handle": "Möss.Curator__",
"did": "did:key:z6MkpQn9m5x4w3p8t7b2gV9hQWkY3u1rS8p... | Python | 1 |
,
],
f_shwith300: vec![
0.86, 0.86, 0.77, 0.74, 0.71, 0.66, 0.73, 0.83, 0.81, 0.84, 0.86, 0.87,
],
f_shwith500: vec![
0.63, 0.64, 0.6, 0.49, 0.43, 0.39, 0.47, 0.6, 0.62, 0.63, 0.67, 0.62,
],
},
SurfaceMonthlyRadi... | Rust | 0 |
-100.0, -100.0, -100.0
/// ],
/// normals: vec![
/// 1.0, 0.0, 0.0,
/// 1.0, 0.0, 0.0,
/// 1.0, 0.0, 0.0,
/// 0.0, 0.0, 1.0,
/// 0.0, 0.0, 1.0,
/// 0.0, 0.0, 1.0,
/// ],
/// texcoords: vec![
/// 0.0, 0.0,
/// 1.0, 1.0,
/// ... | Rust | 0 |
Got unexpected error setting permissions a non-existent file: {:?}",
e);
}
}
}
}
<gh_stars>1-10
use std::fs::File;
use std::io::Read;
use std::thread;
use chrono::Utc;
use http::StatusCode as HttpStatus;
use reqwest::header::{self, HeaderMap, HeaderValue};
use serde_json:... | Rust | 0 |
n = dict_to_markdown(inspect_assembly)
display_data = FileObject(
type="finding_summary",
metadata={"summary": summary_markdown},
)
finding = Finding(
category=FindingCategory.VULNERABILI... | Python | 1 |
'''
----------- Example_04 --------------
Load a turbine model and tune the controller
-------------------------------------
In this example:
- Read a .yaml file
- Load a turbine model from OpenFAST
- Tune a controller
- Write a controller input file
- Plot gain schedule
'''
# Python modules
import matplotli... | Python | 1 |
println!("Block size: {}", BLOCK_SIZE);
println!("Footer size: {}", FOOTER_SIZE);
}
let add = |vec: &mut Vec<usize>, size_class| {
let size_class = round_up_to_multiple_of(ATOM_SIZE, size_class);
if false {
println!("--Adding MarkedSpace size class: {}", size_class);
... | Rust | 0 |
}
/// Generates a vertex
fn vertex(pos: [f32; 3]) -> glam::Vec3 {
glam::Vec3::from(pos)
}
use std::{collections::HashMap, fmt::Display, str::FromStr};
use simplexpr::{dynval::DynVal, SimplExpr};
use crate::{
error::{AstError, AstResult},
parser::{
ast::Ast,
ast_iterator::AstIterator,
... | Rust | 0 |
',
b'6', b'4', b'6', b'5', b'6', b'6', b'6', b'7', b'6', b'8', b'6', b'9', b'7', b'0', b'7', b'1',
b'7', b'2', b'7', b'3', b'7', b'4', b'7', b'5', b'7', b'6', b'7', b'7', b'7', b'8', b'7', b'9',
b'8', b'0', b'8', b'1', b'8', b'2', b'8', b'3', b'8', b'4', b'8', b'5', b'8', b'6', b'8', b'7',
b'8', b'8', b... | Rust | 0 |
r)
for tup in node.ops:
self.buf.write(tup[0])
self.visit(tup[1])
def visitCallFunc(self, node, *args):
self.visit(node.node)
self.buf.write('(')
if len(node.args):
self.visit(node.args[0])
for a in ... | Python | 1 |
_DATA).unwrap(),
false,
)
.unwrap();
let mut ibl = IndirectLightBuilder::new()
.unwrap()
.reflections(&ibl_texture)
.intensity(50000.0)
.rotation(&Mat3f::rotation(-90.0, Float3::new(0.0, 1.0, 0.0)))
.build(&mut engine)
... | Rust | 0 |
potify.token = Some(token);
let playlists = spotify.current_user_playlists()
.take(50)
.filter_map(Result::ok)
.collect::<Vec<_>>();
if playlists.is_empty() {
return AppResponse::Redirect(Redirect::to("/"));
}
AppResponse::Json(json!(playlists))
}
#[get("/me")]
fn me(c... | Rust | 0 |
#!/usr/bin/env python3
"""
Test script for the TexToTest backend with distractor generation
"""
import requests
import json
import os
import sys
BASE_URL = os.environ.get("BASE_URL") or (sys.argv[1] if len(sys.argv) > 1 else "http://localhost:8000")
def test_health():
"""Test the health endpoint"""
response ... | Python | 1 |
ars>1-10
use core::cell::Cell;
use hil::alarm::{Alarm, AlarmClient};
use common::{List, ListLink, ListNode};
pub struct VirtualMuxAlarm<'a, Alrm: Alarm + 'a> {
alarm: &'a MuxAlarm<'a, Alrm>,
when: Cell<u32>,
armed: Cell<bool>,
next: ListLink<'a, VirtualMuxAlarm<'a, Alrm>>,
client: Cell<Option<&'a A... | Rust | 0 |
::try_from(
(i128::from(calculated_capitalization) - i128::from(bank.capitalization())).abs()
)
.unwrap()),
);
}
#[allow(clippy::cognitive_complexity)]
fn main() {
// Ignore SIGUSR1 to prevent long-running calls being killed by logrotate
// in warehouse deployments
#[cfg(uni... | Rust | 0 |
import numpy as np
from loguru import logger
from tqdm.auto import tqdm
from ocrtoolkit.datasets.base import BaseDS
from ocrtoolkit.utilities.det_utils import save_dets
from ocrtoolkit.wrappers.model import DetectionModel
def _detect(model: DetectionModel, ds: BaseDS, **kwargs):
if not ds.batched:
for id... | Python | 1 |
onvert(p[2])),
"mul" => Instruction::Mul(convert(p[1]), convert(p[2])),
"div" => Instruction::Div(convert(p[1]), convert(p[2])),
"mod" => Instruction::Mod(convert(p[1]), convert(p[2])),
"eql" => Instruction::Eql(convert(p[1]), convert(p[2])),
... | Rust | 0 |
#AUTOMAÇÃO DE TAREFAS
# Bibliotecas usadas:
# pyautogui
# pandas
# numpy
# openpyxl
### Passo a passo do projeto ###
import pyautogui
import time
import pandas as pd
import numpy
import openpyxl
# PRINCIPAIS COMANDOS DO PROJETO
# clicar -> pyautogui.click
# escrever -> pyautogui.write
# ... | Python | 1 |
;
let result = reader.next_record().unwrap();
assert_eq!(
format!(
"{:?}",
Some(std::io::Error::new(
std::io::ErrorKind::InvalidData,
"The last fastq record isn't complete"
))
),
f... | Rust | 0 |
# Problem link - https://www.naukri.com/code360/problems/longest-string-chain_3752111?source=youtube&campaign=striver_dp_videos
# Solution - https://www.youtube.com/watch?v=YY8iBaYcc4g&list=PLgUwDviBIf0qUlt5H_kiKYaNSqJ81PMMY&index=46
from typing import List
from collections import Counter
def custom_string_compare(... | Python | 1 |
import enum
import numpy as np
import time
class Terminate(enum.Enum):
Null = 0
Fail = 1
class RLPath(object):
def __init__(self):
self.states = []
self.actions = []
self.logps = []
self.rewards = []
self.terminate = Terminate.Null
self.clear()
... | Python | 1 |
# actor_sync_handler.py (最终版)
from typing import Optional, Callable
import threading
# 导入必要的模块
import emby_handler
from database.actor_db import ActorDBManager
from database import connection, actor_db
import logging
logger = logging.getLogger(__name__)
class UnifiedSyncHandler:
def __init__(self, emby_url: str, ... | Python | 1 |
48873234)]
}
:return: ModelProto with quantization
:param nodes_to_quantize:
List of nodes names to quantize. When this list is not None only the nodes in this list
are quantized.
example:
[
'Conv__224',
'Conv__252'
]
:param nodes_t... | Python | 1 |
= 0;
let _z = 1 % y;
}
//! Generated file, do not edit by hand, see `xtask/codegen`
use crate::generated::FormatTsAnyTupleTypeElement;
use crate::prelude::*;
use rome_js_syntax::TsAnyTupleTypeElement;
impl FormatRule<TsAnyTupleTypeElement> for FormatTsAnyTupleTypeElement {
type Context = JsFormatContext;
... | Rust | 0 |
#
# Copyright(c) 2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies Co., Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#
import pytest
from api.cas.cache_config import (
CacheLineSize,
CacheMode,
KernelParameters,
UnalignedIo,
UseIoScheduler,
CacheModeTrait,
)
from api.cas.cli impor... | Python | 1 |
S>,
PhantomData<&'a ()>,
)
where
Item: Scalar,
Layout: LayoutIdentifier,
RS: SizeIdentifier,
CS: SizeIdentifier,
Mat: MatrixTrait<'a, Item, Layout, RS, CS>;
impl<'a, Item, Mat, Layout, RS, CS> MatrixRef<'a, Item, Mat, Layout, RS, CS>
where
Item: Scalar,
Mat: MatrixTrait<'a, Item, Layout... | Rust | 0 |
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# Copyright (c) 2010 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | Python | 1 |
_floats[2];
}
let quat: UnitQuaternion<f64> = UnitQuaternion::from_matrix(&mat);
let idq = ImplicitDualQuaternion::new(quat, vec);
return (idq, scaling);
}
}
pub mod clearchat;
pub mod clearmsg;
pub mod globaluserstate;
pub mod hosttarget;
pub mod join;
pub mod notice;
pub mod par... | Rust | 0 |
ore);
}
for blk in mock.blocks() {
chain_service
.process_block(Arc::new(blk.clone()), Switch::DISABLE_ALL)
.unwrap();
}
chain_service.truncate(&target.hash()).unwrap();
assert_eq!(shared.snapshot().tip_header(), &target);
}
mod cli;
mod inputs;
mod output;
use la... | Rust | 0 |
vp["gitBranch"] = self.branch
vp["gitCommit"] = self.commit
vp["system"] = f.rf.system
vp["fieldWidth"] = f.rf.SysParams["outlinelen"]
vp["sampleRate"] = f.rf.SysParams["outfreq"] * 1000000
vp["black16bIre"] = float(f.hz_to_output(f.rf.iretohz(self.blackIRE)))
... | Python | 1 |
from fastapi import APIRouter, HTTPException, Depends
from typing import Optional, Dict
from utils.auth_utils import verify_admin_api_key
from utils.fufanmanus_default_agent_service import SunaDefaultAgentService
from utils.logger import logger
from utils.config import config, EnvMode
from dotenv import load_dotenv, se... | Python | 1 |
not support this statement syntax.".into(),
));
}
};
Ok(e)
}
fn null_literal(pos: Pos) -> Expr {
Expr::new(pos, Expr_::Null)
}
fn string_literal(pos: Pos, s: &str) -> Expr {
Expr::new(pos, Expr_::String(BString::from(s)))
}
fn int_literal(pos: Pos, i: usize) -> Expr {
Expr::n... | Rust | 0 |
from __future__ import annotations
__all__ = ["HIT_EFFECT_SFX_CONCEPT_PARAM_ST"]
from soulstruct.base.params.param_row import *
from soulstruct.eldenring.params.enums import *
from soulstruct.utilities.binary import *
class HIT_EFFECT_SFX_CONCEPT_PARAM_ST(ParamRow):
AtkIron1: int = ParamField(
int16, "a... | Python | 1 |
,
mut timer: Local<FoodSpawnTimer>,
) {
if timer.0.tick(time.delta_seconds()).finished() {
commands
.spawn(SpriteBundle {
material: materials.food_material.clone(),
..Default::default()
})
.with(Food)
.with(Position {
... | Rust | 0 |
_bytes!("../resources/add.ptx").to_vec();
ptx.push(0);
let module_id = cuda_manager.load_module(&ptx).unwrap();
let function_id = cuda_manager.get_function(module_id, b"sum\0").unwrap();
let (x, y, z) = (
cuda_manager.allocate(4).unwrap(),
cuda_manager.allocate(4)... | Rust | 0 |
"""
OverworldManagerの基本機能テスト
地上部を管理するOverworldManagerの基本機能をテストする
"""
import pytest
from unittest.mock import Mock, patch, MagicMock
from src.overworld.overworld_manager import OverworldManager
from src.character.party import Party
class TestOverworldManagerBasic:
"""OverworldManagerの基本機能テスト"""
def setu... | Python | 1 |
O0_11 to PIO0_0 0 = Do nothing. 1 = Writing 1 resets the start signal."]
#[inline(always)]
pub fn rsrpio0_6(&mut self) -> RSRPIO0_6_W {
RSRPIO0_6_W { w: self }
}
#[doc = "Bit 7 - Start signal reset for start logic input PIO0_n:PIO0_11 to PIO0_0 0 = Do nothing. 1 = Writing 1 resets the start sign... | Rust | 0 |
import os
from pprint import pprint
import tensorflow as tf
from tree.main import main as m
flags = tf.app.flags
flags.DEFINE_string("model_name", "tree", "Model name [tree]")
flags.DEFINE_string("data_dir", "data/squad", "Data dir [data/squad]")
flags.DEFINE_integer("run_id", 0, "Run ID [0]")
flags.DEFINE_integer... | Python | 1 |
async def test_drop_removes_directory(kvs_client: FileSystemKeyValueStoreClient) -> None:
"""Test that drop removes the entire store directory from disk."""
await kvs_client.set_value(key='test', value='test-value')
assert kvs_client.path_to_kvs.exists()
# Drop the store
await kvs_client.drop()
... | Python | 1 |
);
concat_ws!(ConcatWs17, concat_ws_17, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q| a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q);
concat_ws!(ConcatWs18, concat_ws_18, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r| a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r);
concat_ws!(ConcatWs19, co... | Rust | 0 |
x8c, 0x55, 0x2b, 0x2b, 0xf9, 0xd4, 0x2f, 0x4f, 0x99, 0x3b, 0x6b, 0x1f,
0xef,
]);
let (ct, tag) = gimli_aead_encrypt(&msg, &ad, nonce, key);
assert_secret_seq_eq!(expected_ct, ct, U8);
assert_secret_array_eq!(expected_tag, tag, U8);
let msg_out = gimli_aead_decrypt(&ct, &ad, tag, nonce, key... | Rust | 0 |
x = 1
while x <= 100:
print(x)
x = x + 1
| Python | 1 |
e 16 VGA colors
#[derive(Eq, PartialEq, Copy, Clone, Debug)]
#[repr(u8)]
pub enum Color {
Black = 0,
Blue = 1,
Green = 2,
Cyan = 3,
Red = 4,
Magenta = 5,
Brown = 6,
LightGray = 7,
DarkGray = 8,
LightBlue = 9,
LightGreen = 10,
LightCyan = 11,
LightRed = 12,
LightMa... | Rust | 0 |
from flask import Flask,render_template,request
import tensorflow as tf
from keras_preprocessing.image import load_img
from keras_preprocessing.image import img_to_array
from keras.models import load_model
import numpy as np
# from gevent.pywsgi import WSGIServer
app = Flask(__name__)
Model_Path = r'C:\Users\Lenovo... | Python | 1 |
()>
where
B: Block,
BE: Backend<B>,
C: Client<B, BE>,
C::Api: DKGApi<B, AuthorityId, <<B as Block>::Header as Header>::Number>,
{
if let Some(path) = path {
if let Some(local_keystore) = worker.local_keystore.clone() {
debug!(target: "dkg_persistence", "Storing local key for {:?}", &path);
let key_pair = l... | Rust | 0 |
"
func {struct_name}FromSlice(slice []byte, _compatible bool) (*{struct_name}, error) {{
sliceLen := len(slice)
if sliceLen != {total_size} {{
errMsg := strings.Join([]string{{"TotalSizeNotMatch", "{struct_name}", strconv.Itoa(int(sliceLen)), "!=", strconv.Itoa({total_size})}}, " ")
return nil, ... | Rust | 0 |
from mage_ai.api.oauth_scope import OauthScope
from mage_ai.api.operations.constants import OperationType
from mage_ai.api.policies.BasePolicy import BasePolicy
from mage_ai.api.presenters.ExecutionStatePresenter import ExecutionStatePresenter
class ExecutionStatePolicy(BasePolicy):
pass
ExecutionStatePolicy.al... | Python | 1 |
# 4 - Cálculo de Juros Simples:
# Crie um programa que calcule o valor futuro de um investimento
# usando a fórmula de juros simples. Peça ao usuário para digitar o
# capital inicial, a taxa de juros e o tempo de aplicação.
print('--------------- CALCULO DE JUROS SIMPLES ------------------')
vi = | Python | 1 |
_fps);
if fps <= 0.0 {
panic!("invalid FPS: {}", fps);
}
let fps_scale = native_fps / fps;
let num_frames = (duration * fps) as usize;
for i in 0..num_frames {
let t = first_frame + (i as f64) * fps_scale;
animation.pin_mut().seek_frame(t);
canvas.pin_mut().clear(0xf... | Rust | 0 |
$p => $a,
_ => panic!("Unexpected variant {:?}", $e),
}
)
);
static UINT_VALUE: u32 = 0x12345678;
#[test]
fn test_serialize_uint() {
let (bytes, handles) =
TestInterfaceEvent::Uint { arg: UINT_VALUE }.into_message(SENDER_ID).unwra... | Rust | 0 |
account name appended in front of it like 'account/pool'
current['name'] = self.parameters['name']
modify = self.na_helper.get_modified_attributes(current, self.parameters)
if 'tags' in modify:
dummy, modify['tags'] = self.update_tags(current.get('tags'))
if ... | Python | 1 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
# Resolução do Problema de PVI:
#Importando Bibliotecas:
import numpy as np
import math as mt
import matplotlib.pyplot as plt
# Definindo Variáveis de Entrada:
g = 9.81 # m/s²
m = 68.1 # kg
cd = 0.25 # kg/m
n = 6
tf = 10
t0 = 0
y0_x = 0
y0_v = 0
h = (tf-t0)/(n-1)
# Definindo as Funções:
def f_x(v):
return v
de... | Python | 1 |
ttings {
fn default()->Self {
Self {
width: 800,
height: 600,
window_pos_storage_path: None,
title: "".to_string(),
url: "".to_string(),
enable_dev_tools: false,
warp_settings: None,
webroot: "".to_string()
... | Rust | 0 |
>,
layout_dir: Option<PathBuf>,
) -> Option<LayoutFromYamlIntermediateResult> {
layout
.map(|p| LayoutFromYamlIntermediate::from_dir(p, layout_dir.as_ref()))
.or_else(|| layout_path.map(|p| LayoutFromYamlIntermediate::from_path(p)))
.or_else(|| {
S... | Rust | 0 |
ataset_air_walking_gait(LinTzuYaunDataset):
def get_file_id_and_loc(self):
return "17c_E-S_yTeeV_DCmcgVT7_J90cRIwg0z", "Google"
class LinTzuYaunDataset_asphalt_road(LinTzuYaunDataset):
def get_file_id_and_loc(self):
return "1jty0yqd7gywNJEkS_V2hivZ-79BGuCgA", "Google"
class LinTzuYaunD... | Python | 1 |
N` key-value pairs.
///
/// # Examples
/// ```
/// # extern crate rustc_hash;
/// use rustc_hash::FxHasher;
/// # use coca::collections::Inline2WayLruCache;
/// # use core::hash::BuildHasherDefault;
/// # fn main() {
/// let keys = ["Alice", "Bob", "Charlie", "David", "Eve", "Faythe", "Grace"];
/// let mut cache = In... | Rust | 0 |
ith first Rect should be the second Rect"
);
}
}
extern crate capstone;
use capstone::prelude::*;
use capstone::InsnDetail;
const MIPS_CODE: &'static [u8] = b"\x56\x34\x21\x34\xc2\x17\x01\x00";
const X86_CODE: &'static [u8] = b"\x55\x48\x8b\x05\xb8\x13\x00\x00\xe9\x14\x9e\x08\x00\x45\x31\xe4";
/// Print... | Rust | 0 |
().push(INVALID_NUMERIC_ARGUMENT as _);
} else if fileid >= self.files().len() {
self.s_stack().push(INVALID_NUMERIC_ARGUMENT as _);
} else {
match self.files_mut()[fileid].take() {
Some(f) => {
match f.set_len(ud_lower as u64) {
... | Rust | 0 |
ntation(Platform::SSE41));
}
None
}
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[allow(unreachable_code)]
pub const fn avx2_if_supported() -> Option<Self> {
// Check whether AVX2 support is assumed by the build.
#[cfg(target_feature = "avx2")]
{
... | Rust | 0 |
_send = ui_send.clone();
tokio::spawn(async move { ipc_server::run_server(ui_send).await })
};
let forward_exit_to_app_handle = {
let ui_send = ui_send.clone();
tokio::spawn(async move {
// Wait for application exit event
... | Rust | 0 |
# Copyright 2023 The Google Earth Engine Community Authors
#
# 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 applicable... | Python | 1 |
TokenSymbol::XUSD);
pub const XBTC: CurrencyId = CurrencyId::Token(TokenSymbol::XBTC);
pub const DOT: CurrencyId = CurrencyId::Token(TokenSymbol::DOT);
pub const DOS: CurrencyId = CurrencyId::Token(TokenSymbol::DOS);
pub const XUSD_XBTC_PAIR: TradingPair = TradingPair(XUSD, XBTC);
pub const XUSD_DOT_PAIR: TradingP... | Rust | 0 |
num1 = int(input())
num2 = int(input())
num3 = int(input())
num4 = int(input())
final = ((int((num1 + num2) / num3)) * num4)
print(final)
| Python | 1 |
"""Finds narrow admissible tuples (lists of integers that do not fill every residue class modulo any prime)"""
import funsearch, functools
import numpy as np
import itertools
@funsearch.run
def evaluate(n: int) -> int:
"""Returns the number of elements in a narrow admissible tuple of with at most n"""
tuple = sol... | Python | 1 |
# -*- coding: utf-8 -*-
import logging
import os
from markupsafe import Markup
from mycodo.config import INSTALL_DIRECTORY
from mycodo.config import PATH_PYTHON_CODE_USER
from mycodo.utils.system_pi import assure_path_exists
from mycodo.utils.system_pi import cmd_output
from mycodo.utils.system_pi import set_user_grp... | Python | 1 |
# vim: set fileencoding=utf-8 :
#
# (C) 2006,2007,2008,2011 Guido Günther <agx@sigxcpu.org>
# This program 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 2 of the License, or
# (at ... | Python | 1 |
# app/api/games.py
from fastapi import APIRouter, Query, Depends, HTTPException, Request
import datetime
from typing import List, Optional
from sqlalchemy.orm import Session
from sqlalchemy import or_
from app import models, schemas
from app.crud import games
from app.db import get_db
from app.config import settings
... | Python | 1 |
eved_scores)):
new_row = {k:v for k,v in row.items()}
new_row['pasg_title'] = tt
new_row['hop2 score'] = score
new_row['hop2 source'] = 'r2'
new_row['path score'] = new_row['hop1 score']+new_row['row_rank_score']*2+new_row['hop2 score']
... | Python | 1 |
c=deterministic)
class FlaxFeedForward(nn.Module):
r"""
Flax module that encapsulates two Linear layers separated by a non-linearity. It is the counterpart of PyTorch's
[`FeedForward`] class, with the following simplifications:
- The activation function is currently hardcoded to a gated linear unit fr... | Python | 1 |
pub tag: String,
pub data: String,
pub attributes: HashMap<String, String>,
pub childs: Vec<Element>,
}
impl Debug for Element {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut s = f.debug_struct("");
match self.tag.as_str() {
"" => {
... | Rust | 0 |
(None) => {
/// println!("Expected a webhook message");
///
/// return;
/// },
/// Err(why) => {
/// println!("Error executing webhook: {:?}", why);
///
/// return;
/// },
/// };
/// ```
///
/// [`Channel`]: ../model/channel/enum.Channel.html
/// [`Message`]: ../model/channel... | Rust | 0 |
Id")
self._TopicId = params.get("TopicId")
self._Name = params.get("Name")
self._KafkaType = params.get("KafkaType")
self._KafkaInstance = params.get("KafkaInstance")
self._ServerAddr = params.get("ServerAddr")
self._IsEncryptionAddr = params.get("IsEncryptionAddr")
... | Python | 1 |
import datetime
import Metashape
"""
Script for removing duplicated photos, Metashape (v 1.8)
Matjaz Mori, CPA, May 2022
The script will remove all duplicated photos (photos referenced to the same file) from Metashape project.
"""
compatible_major_version = "2.2"
found_major_version = ".".join(Metashape.app.version... | Python | 1 |
# -*- coding: utf-8 -*-
import os
import sys
from pprint import pprint
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
# -----------------------------------------------------------------------------
print('CCXT Version:... | Python | 1 |
import numpy as np
from numpy.testing import assert_equal
from pytest import raises as assert_raises
from scipy.io._harwell_boeing._fortran_format_parser import (
FortranFormatParser, IntFormat, ExpFormat, BadFortranFormat)
class TestFortranFormatParser:
def setup_method(self):
self.parser = For... | Python | 1 |
import enum
import random
import string
from datetime import UTC, datetime, timedelta
from nonebot_plugin_orm import Model
from sqlalchemy import String
from sqlalchemy.orm import Mapped, mapped_column
EXPIRE_TIME = timedelta(minutes=30)
EXPIRE_TIME_STR = "30 分钟"
class RequestStatus(enum.StrEnum):
PENDING = "pe... | Python | 1 |
.len() {
let h = respp.headers[i];
//println!("{} : {}", h.name, str::from_utf8(h.value).unwrap());
match h.name {
"Content-Length" => {
let len_str = String::from_utf8(h.value.to_vec()).sgx_error()?;
len_num = len_str.parse::<u32>().sgx_error()?;
... | Rust | 0 |
sed: [u8; 0],
}
pub type StencilTablePtr = *mut StencilTable_obj;
extern "C" {
pub fn StencilTable_destroy(st: StencilTablePtr);
/// Returns the number of stencils in the table
pub fn StencilTable_GetNumStencils(st: StencilTablePtr) -> i32;
/// Returns the number of control vertices indexed in the tabl... | Rust | 0 |
import numpy as np
from .base_cam import BaseCAM
from pytorch_grad_cam.utils.svd_on_activations import get_2d_projection
# https://ieeexplore.ieee.org/document/9462463
class LayerCAM(BaseCAM):
def __init__(
self,
model,
target_layers,
use_cuda=False,
re... | Python | 1 |
# Factorial Calculation
# Problem: Write a function that calculates the factorial of a given number.
# Input: 5
# Output: 120
# Hint: Factorial of n (denoted as n!) is the product of all positive integers less than or equal to n.
# n! = n*(n-1) * (n-2) * (n-3) .... * 1
#! Approach 1 : through loop
def calculate_fac... | Python | 1 |
}
}
<filename>src/parser/mod.rs
use std::io;
use std::str::Utf8Error;
use crypto::digest::Digest;
use crypto::md5::Md5;
use hyper::header::ContentType;
use mime::{self, Mime};
use tendril::ByteTendril;
use url::Url;
use tasks::Resource;
mod css;
mod html;
quick_error! {
#[derive(Debug)]
pub enum ParserE... | Rust | 0 |
}
}
// item! {
// #[test]
// fn [<test_2d_zero_ $t>]() {
// let a = <Array2<$t> as ArgminZero>::zero();
// let b: Array2<$t> = Array2::zeros((0, 0));
// assert_eq!(a, b);
// }
... | Rust | 0 |
ange(order-i+1):
for k in range(order-i-j+1):
monomial_array[:,i,j,k] = tri_array[i,j,k] * (x**i) * (y**j) * (z**k) * values
monomial_time = time.time() - tri_time - start
print(f'monomial time: {monomial_time}')
CFs = monomial_array[faces]
C0 = CFs[:,0]
... | Python | 1 |
mutantResult = handler(tmpMutantName, mutant, sourceFile, uniqueMutants, compileFile=compileFile)
print(mutantResult, end=" ")
mutantName = mdir + base + ".mutant." + str(mutantNo) + ending
if (mutantResult == "VALID") or (mutantResult == "REDUNDANT" and redundantOK):... | Python | 1 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = r"""
---
module: networks_wireless_billing_info
short_description: Information module for networks _wireless _billing
description:
... | Python | 1 |
{
stdio_raw(2)
}
#[derive(Debug)]
struct File {
name: String,
data: Vec<u8>,
}
fn main() {
let f1 = File {
name: String::from("./README.md"),
data: Vec::new(),
};
let f_name = &f1.name;
let f_data = &f1.data.len();
println!("{} is {} bytes long.", f_name, f_data);
}
use ... | Rust | 0 |
import sys
from pathlib import Path
from abc import ABC
from typing import Tuple, List
from copy import deepcopy
import numpy as np
import gymnasium as gym
import torch as th
from stable_baselines3.ppo import PPO, MultiInputPolicy
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3.... | Python | 1 |
47, 86, 2, 107], OperandSize::Dword)
}
fn vfmsub231pd_24() {
run_test(&Instruction { mnemonic: Mnemonic::VFMSUB231PD, operand1: Some(Direct(ZMM6)), operand2: Some(Direct(ZMM12)), operand3: Some(Direct(ZMM17)), operand4: None, lock: false, rounding_mode: Some(RoundingMode::Zero), merge_mode: Some(MergeMode::Zero),... | Rust | 0 |
bool {
println!(
"Got command '{}' by user '{}'",
command_name, msg.author.name
);
true
}
#[hook]
async fn after_hook(ctx: &Context, msg: &Message, command_name: &str, error: CommandResult) {
match error {
Ok(()) => println!("Processed command '{}'", command_name),
Err(... | Rust | 0 |
# Copyright (c) 2017 by Rocky Bernstein
#
# This program 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 License, or
# (at your option) any later version.
#
# This program is dist... | Python | 1 |
comment(); );
( $me:ident : clear_comment ) => ( $me.current_comment.clear(); );
( $me:ident : create_doctype ) => ( $me.current_doctype = Doctype::new(); );
( $me:ident : push_doctype_name $c:expr ) ... | Rust | 0 |
tr(out).replace('-2', '-1')
self.assertTrue(str(out).endswith('-2.mid'))
self.assertTrue(os.path.exists(otherFile))
os.remove(out)
os.remove(otherFile)
def testActiveSiteAfterBoolIteration(self):
n = note.Note()
s1 = Stream([n])
s2 = Stream([n])
self.... | Python | 1 |
= false;
cfg.write("/tmp/pool.yaml").unwrap();
// setup the arguments we want to load mayastor with
let args = vec![
"-s".to_string(),
"128".into(),
"-y".into(),
"/tmp/pool.yaml".to_string(),
];
run_test(Box::from(args.clone()), |ms| {
let lvs_list = commo... | Rust | 0 |
order {
SortOrder::Ascending => is_sorted_ascending(x),
SortOrder::Descending => is_sorted_descending(x),
}
}
fn is_sorted_ascending<T: Ord>(x: &[T]) -> bool {
// window(2)は元のイテレータから1要素刻みで2要素ずつ値を取り出す新しいイテレータを返す
// 例えば元が[1, 2, 3, 4]なら[1, 2]、[2, 3]、[3, 4]を順に返す
//
// all(..)はイテレータから値(例... | Rust | 0 |
ue)
def main():
args = parse_args()
tmp_dir = tempfile.TemporaryDirectory()
frame_paths, frames = frame_extract(args.video, args.short_side,
tmp_dir.name)
h, w, _ = frames[0].shape
# Get Human detection results.
det_results, _ = detection_inference(ar... | Python | 1 |
ams):
if params.get("HeadNeck") is not None:
self._HeadNeck = SurgeryHeadNeck()
self._HeadNeck._deserialize(params.get("HeadNeck"))
if params.get("Thyroid") is not None:
self._Thyroid = SurgeryThyroid()
self._Thyroid._deserialize(params.get("Thyroid"))
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.