text string | label_name string | labels int64 |
|---|---|---|
_true',
help="Give a file path to store the history in. This file is used to undo changes",
default=f"history_{datetime.now()}.json")
parser.add_argument('--small', type=int, default=10 ** 6, help="Upper limit for small files in bytes")
parser.add_argument('--medi... | Python | 1 |
pub fn bits(&self) -> u8 {
match *self {
ADC_DCCTL1_CICR::ADC_DCCTL1_CIC_LOW => 0,
ADC_DCCTL1_CICR::ADC_DCCTL1_CIC_MID => 1,
ADC_DCCTL1_CICR::ADC_DCCTL1_CIC_HIGH => 3,
ADC_DCCTL1_CICR::_Reserved(bits) => bits,
}
}
#[allow(missing_docs)]
#[doc(h... | Rust | 0 |
dable version of
a card, in the form:
<type>: value value
"""
return f'{self.value} {self.value}'
class Triple(Card):
# init只用输入一张
type = '三同张'
def __repr__(self):
"""
Returns a string which is a readable version of
a card, in the form:
<type... | Python | 1 |
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_MULTIPLE_CHOICE_JOINT
from helm.benchmark.adaptation.common_adapter_specs import get_multiple_choice_adapter_spec
from helm.benchmark.metrics.common_metric_specs import get_exact_match_metric_specs
from helm.benchmark.run_spec import RunSpec, run_spec... | Python | 1 |
TestNet::reset();
let para_a_location: MultiLocation = MultiLocation {
parents: 1,
interior: X1(Parachain(1)),
};
let para_a_asset: pallet_assets_wrapper::XTransferAsset =
para_a_location.try_into().unwrap();
ParaB::execute_with(|| {
// ParaB register the native asset of paraA
assert_ok!(ParaA... | Rust | 0 |
#[cfg(unix)]
use std::os::unix::fs::symlink as symlink_dir;
#[cfg(windows)]
use std::os::windows::fs::symlink_dir;
fn is_enable(env_var: &str, default: bool) -> bool {
match std::env::var(env_var).ok().as_deref() {
Some("0") => false,
Some(_) => true,
None =>... | Rust | 0 |
Variable(boundary_bb.type(Tensor))
# Sample noise as generator input
layouts_imgs_tensor = []
# plot images
# np.random.seed(100)
z = Variable(Tensor(np.random.normal(0, 1, (real_room_bb.shape[0], opt.latent_dim))))
gen_room_bb = generator(z, [nodes, triples], room_to_sample, boundary=boundary_bb)
nodes = node... | Python | 1 |
class Solution:
def minAddToMakeValid(self, s: str) -> int:
ans = 0
chars = list(s)
openCount = 0
closedCount = 0
for idx, c in enumerate(chars):
if c == '(':
openCount += 1
elif c == ')':
if openCount == 0:
... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
File: jd_dpcj.py(店铺抽奖-JK)
Author: HarbourJ
Date: 2022/10/15 23:00
TG: https://t.me/HarbourToulu
TgChat: https://t.me/HarbourChat
cron: 1 1 1 1 1 1
new Env('店铺抽奖-JK');
ActivityEntry:https://shop.m.jd.com/shop/lottery?shopId=xxxxx&venderId=xxxxx
Description: 变量:export D... | Python | 1 |
eponame>wasml/linalg
pub mod basic;
pub mod interop;
pub mod math;
pub mod sampling;
<filename>src/torrent/mod.rs
use ansi_term::Colour::{Green, Red};
use std::cmp::Ordering;
#[derive(Debug)]
pub struct Torrent {
pub name: String,
pub magnet_link: String,
pub seeders: Option<u32>,
pub leechers: Option<... | Rust | 0 |
master_key,
branch_seed,
primary_key_index,
digest_type: PhantomData,
}),
Err(e) => Err(KeyManagerError::from(e)),
}
}
/// Creates a KeyManager from the provided sequence of mnemonic words, the language of the mnemo... | Rust | 0 |
roe(net_income: float, shareholders_equity: float) -> float:
"""ROE (자기자본이익률) 계산"""
if shareholders_equity == 0:
return 0.0
return net_income / shareholders_equity
@staticmethod
def calculate_roa(net_income: float, total_assets: float) -> float:
"""ROA (총자산이익률) 계... | Python | 1 |
import matplotlib.pyplot as plt
import numpy as np
from numpy import pi, exp, log
import sys
import json
import scipy.stats, scipy.special
methods = {}
for filename in sys.argv[1:]:
info = json.load(open(filename))
ncall = info['ncall']
logz = info['logz']
logzerr = info['logzerr']
ndim = len(info[... | Python | 1 |
import sys
from collections import deque
def turn(c):
global d
if c == 'L':
d = (d - 1) % 4
else:
d = (d + 1) % 4
def game(head_x, head_y):
time = 0
snake = deque([(head_x, head_y)])
board[head_x][head_y] = -1
while True:
time += 1
head_x += dx[d]
... | Python | 1 |
default_initial_settings = {
"name": "Kingroon Base Printer",
"manufacturer": "Kingroon",
"start_gcode": "G28 ; home all axes\n M117 Purge extruder\n G92 E0 ; reset extruder\n G1 Z1.0 F3000 ; move z up little to prevent scratching of surface\n G1 X2 Y20 Z0.3 F5000.0 ; move to start-line position\n G1 X2 Y17... | Python | 1 |
sum([x.val for x in bar])
min([x.val for x in bar])
max([x.val for x in bar])
# Ok
sum(x.val for x in bar)
min(x.val for x in bar)
max(x.val for x in bar)
| Python | 1 |
.os_id.is_none() {
debug!("Open called with no file link or unique id...");
return Err(ShmemError::NoLinkOrOsId);
}
// Get the os_id from the flink
if let Some(ref flink_path) = self.flink_path {
debug!(
"Open shared memory from file link {}",... | Rust | 0 |
insert(*treenode, nodecost);
}
// Now that we've calculated all the costs, we can extract the cheapest one
extract_from_nodecosts(root, &inv, &nodecost_of_treenode, egraph)
}
fn extract_from_nodecosts(
root: Id,
inv: &PtrInvention,
nodecost_of_treenode: &AHashMap<Id,NodeCost>,
egraph: &cra... | Rust | 0 |
from bandstatisticsapp.bandstatisticsdialog import BandStatisticsDialog
from enmapbox.gui.applications import EnMAPBoxApplication
from enmapbox.typeguard import typechecked
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QMenu
def enmapboxApplicationFactory(enmapBox):
return [BandStatisticsApp(e... | Python | 1 |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab
import aws_cdk as cdk
from aws_cdk import (
Stack,
aws_lakeformation
)
from constructs import Construct
class DataLakePermissionsStack(Stack):
def __init__(self, scope: Construct, construct_id: str, glue_jo... | Python | 1 |
assert!(a < b);
}
#[test]
fn test_ord() {
let mut a = Flags::empty();
let mut b = Flags::empty();
assert!(a <= b && a >= b);
a = Flags::A;
assert!(a > b && a >= b);
assert!(b < a && b <= a);
b = Flags::B;
assert!(b > a && b >= a);
... | Rust | 0 |
h");
bindgen::Builder::default()
.clang_arg("-I./vendor/xxhash/")
.header("src/xxhash_bindings.h")
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.rustfmt_bindings(t... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""usage: blobtools map2cov -i FASTA [-b BAM...] [-a CAS...]
[-o PREFIX] [-c]
[-h|--help]
Options:
-h --help show this
-i, --infile FASTA FASTA ... | Python | 1 |
import random, time
def solve(eggs):
redactedscript = """
█ █ █████████
██ █ ██
███ █ ██ █████████
██████████████ █ ██
████████ █ ██████████
███ █ ██ █████████
███ █ ██ █████████
██ █ ██ █ ███ █ ██ ██
████████
██ █ ██ ██
... | Python | 1 |
, Deg, Quaternion};
use nice_engine::{camera::Camera, mesh_group::MeshGroup, transform::Transform, window::Window, Context, GpuFuture};
use simplelog::{LevelFilter, SimpleLogger};
use std::{collections::HashSet, time::Instant};
use winit::{
dpi::LogicalSize, DeviceEvent, ElementState, Event, EventsLoop, KeyboardInput,... | Rust | 0 |
e(always)]
pub fn ctoesen(&mut self) -> CTOESEN_W {
CTOESEN_W { w: self }
}
#[doc = "Bit 17 - Command CRC Error Status Enable"]
#[inline(always)]
pub fn ccesen(&mut self) -> CCESEN_W {
CCESEN_W { w: self }
}
#[doc = "Bit 18 - Command End Bit Error Status Enable"]
#[inline... | Rust | 0 |
audioldm_tts_pipe = AudioLDM2Pipeline.from_pretrained("anhnct/audioldm2_gigaspeech")
audioldm_tts_pipe = audioldm_tts_pipe.to(torch_device)
audioldm_tts_pipe.set_progress_bar_config(disable=None)
inputs = self.get_inputs_tts(torch_device)
audio = audioldm_tts_pipe(**inputs).audios... | Python | 1 |
.collect::<Vec<_>>();
let oxygen_rating = get_reading(&input, 11, true);
let co2_rating = get_reading(&input, 11, false);
(oxygen_rating * co2_rating) as u32
}
<reponame>csixteen/AdventOfCode<filename>2020/Rust/Day20/src/img.rs
pub mod tile;
pub mod image;
// Copyright 2018 (c) rust-themis develo... | Rust | 0 |
test]
fn decode1() {
const ENCODED: &str = "TWFu";
const EXPECTED: &str = "Man";
let decoder = Base64::new();
assert_eq!(
str::from_utf8(&decoder.decode(ENCODED.as_bytes()).expect("Decoding error")[..]).unwrap(),
EXPECTED
);
}
#[test]
fn decode2() {
const ENCODED: &str = "TWFuI... | Rust | 0 |
if full_response:
return LLMFullResponse(
generated_text=data["content"][0]["text"],
model=model_name,
process_time=time.time() - start_time,
llm_provider_response=data,
... | Python | 1 |
();
let mut parser = Parser::new(&tokens);
let root = parser.parse().unwrap();
let node = if let NodeType::Root(_) = &root.ntype {
&root
} else {
panic!("Parse result should always be a Root node");
};
let mut ctx = EvalContext::populated();
... | Rust | 0 |
import streamlit as st
import requests
import pandas as pd
from requests.auth import HTTPBasicAuth
import streamlit_shadcn_ui as ui
from os import environ
from dotenv import load_dotenv
import os
# Cargar las variables de entorno desde el archivo .env
load_dotenv()
st.title("Projects")
SEARCH_ISSUE_FROM_JQL_MESSAGE_... | Python | 1 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | Python | 1 |
rc::{Rc, Weak}
};
use crate::libc::c_void;
use wlroots_sys::{
wlr_surface, wlr_xdg_popup_v6, wlr_xdg_surface_v6, wlr_xdg_surface_v6_for_each_surface,
wlr_xdg_surface_v6_ping, wlr_xdg_surface_v6_role, wlr_xdg_surface_v6_send_close,
wlr_xdg_surface_v6_surface_at, wlr_xdg_toplevel_v6, wlr_xdg_toplevel_v6_s... | Rust | 0 |
fn execute_deposit_check_funds() {
let mut deps = mock_dependencies(&[]);
let (mut env, mut info) = utils::initialize(&mut deps);
// zero amount
env.block.time = Timestamp::from_seconds(5);
let resp = contract::execute(
deps.as_mut(),
env.clone(),
info.clone(),
Execu... | Rust | 0 |
file2.write(&cypher2.get_cypher_header()).unwrap();
write_striple_with_enc(&cypher2,&ts.0,None,&mut datafile2, &public_enc).unwrap();
write_striple_with_enc(&cypher2,&personalts.0,Some(&personalts.1),&mut datafile2, &private_enc).unwrap();
write_striple_with_enc(&cypher2,&hashstamp.0,Some(&hashstamp.1),&mut dataf... | Rust | 0 |
ate s& |