text string | label_name string | labels int64 |
|---|---|---|
06\x01\x02\x01\x02\x12\x03:\x15'\n\x0c\n\x05\x06\x01\
\x02\x01\x03\x12\x03:2B\n\x0b\n\x04\x06\x01\x02\x02\x12\x03<\x04<\n\x0c\
\n\x05\x06\x01\x02\x02\x01\x12\x03<\x08\x12\n\x0c\n\x05\x06\x01\x02\x02\
\x02\x12\x03<\x13\x20\n\x0c\n\x05\x06\x01\x02\x02\x03\x12\x03<+8\n\x0b\n\
\x04\x06\x01\x02\x03\x12\x03>\... | Rust | 0 |
.to_owned(),
})
.expect("query executed");
collector.assert_receive_till_this_moment(vec![Ok(QueryEvent::TableCreated), Ok(QueryEvent::QueryComplete)]);
(engine, collector)
}
#[rstest::fixture]
fn str_table(database_with_schema: (InMemory, ResultCollector)) -> (InMemory, ResultCol... | Rust | 0 |
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from datetime import datetime
def connect_sheet(sheet_name="Apollo Lookup Log"):
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
creds = ServiceAccountCredentials.from_json_keyfile_name(... | Python | 1 |
match self {
PublicKey::Ed25519(pk) => Some(pk),
_ => None,
}
}
/// Serialize this key as amino bytes
pub fn to_amino_bytes(self) -> Vec<u8> {
match self {
PublicKey::Ed25519(ref pk) => {
//Amino prefix for Pubkey
l... | Rust | 0 |
n_test_layout_FMOD_GUID() {
assert_eq!(
::std::mem::size_of::<FMOD_GUID>(),
16usize,
concat!("Size of: ", stringify!(FMOD_GUID))
);
assert_eq!(
::std::mem::align_of::<FMOD_GUID>(),
4usize,
concat!("Alignment of ", stringify!(FMOD_GUID))
);
assert_eq!(
... | Rust | 0 |
field name being included automatically."]
#[doc = "@param tree the tree to append this item to"]
#[doc = "@param hf_index field index"]
#[doc = "@param tvb the tv buffer of the current data"]
#[doc = "@param bit_offset start of data in tvb expressed in bits"]
#[doc = "@param no_of_bits length of d... | Rust | 0 |
) -> String {
return kmeans::fit_draw(
point_numbers,
center_numbers,
pxmi,
pxma,
pymi,
pyma,
width,
height,
padding,
title
);
}
#[macro_use]
extern crate pest;
use pest::prelude::*;
impl_rdp! {
grammar! {
query =... | Rust | 0 |
### Alan Francisco Emmanuel Aguilar Fuentes
### Programacion de Redes Unidad 1 Recuperacion 2
N = int(input())
conjunto = list(map(int, input().split()))
creciente = sorted(conjunto)
decreciente = sorted(conjunto, reverse=True)
print(" ".join(map(str, creciente)))
print(" ".join(map(str, decreciente)))
| Python | 1 |
}
};
subst_fn.into()
}
// Deferring is requested, this will require a bit more manipulation.
else {
// Find the return statement and split the entire tokenstream there.
let mut ind: Option<usize> = None;
let mut expr: Option<ExprReturn> = None;
for n in 0..bod... | Rust | 0 |
ons, skip_special_tokens=True, clean_up_tokenization_spaces=True
)
with open(os.path.join(args.output_dir, 'predictions.jsonl'), 'w') as fout:
for i, example in enumerate(data_module['predict_dataset']):
example['prediction_with_input'] = predictions[i].strip()
... | Python | 1 |
They provide
# a two-way quoting algorithm. Any non-text character is translated
# into a 4 character sequence: a forward-slash followed by the
# three-digit octal equivalent of the character. Any '\' or '"' is
# quoted with a preceding '\' slash.
# Because of the way browsers really handle cookies (as opposed to wh... | Python | 1 |
class Solution:
def trailingZeroes(self, n: int) -> int:
fact = factorial(n)
count = 0
while fact % 10 == 0:
count += 1
fact = fact // 10
return count
| Python | 1 |
")
assert "style" not in sanitize_css_value("<style>")
def test_special_characters_removed(self) -> None:
"""Test that special characters are removed."""
# Semicolons indicate CSS injection attempts, so everything after is removed
assert sanitize_css_value("color; hack: value") == "... | Python | 1 |
rmat!("{}\\thumbnail.png", get_app_home_dir());
if let Ok(_) = thumb.save(&thumb_path){
if let Ok(mut f) = File::open(thumb_path){
let mut png_data = vec![];
let _ = f.read_to_end(&mut png_data);
if png_data.len() > 0{
cfg.current_wallpaper_thumbnail = Som... | Rust | 0 |
#[repr(C)]
pub struct pdf_page {
pub page_obj: *mut pdf_obj,
pub page_ref: *mut pdf_obj,
pub flags: i32,
pub ref_x: f64,
pub ref_y: f64,
pub cropbox: Rect,
pub resources: *mut pdf_obj,
pub background: *mut pdf_obj,
pub contents: *mut pdf_obj,
pub content_refs: [*mut pdf_obj; 4],... | Rust | 0 |
s.print_log_acc_bwt(args.taskcla, acc, lss, output_path=args.checkpoint, run_id=run_id)
return avg_acc, gem_bwt
#######################################################################################################################
def main(args):
utils.make_directories(args)
utils.some_sanity_checks(... | Python | 1 |
("redirectUrl".to_string(), redirect_url.to_string()));
}
let query_ = serde_urlencoded::to_string(&query_args).unwrap();
let url = format!(
"/v2.1/accounts/{}/users/{}/cloud_storage/{}?{}",
crate::progenitor_support::encode_path(&account_id.to_string()),
crat... | Rust | 0 |
(),
}),
)
})
.collect()
}
<reponame>Coder-256/magic-numbers<filename>src/ops/normal.rs<gh_stars>0
/// Normalize a value.
pub trait Normalize {
/// Normalize a value. For vectors, returns the normalized vector (a zero
/// vector returns a zero vector). **For scalars, t... | Rust | 0 |
FNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
// typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
// typedef void (APIENTRYP ... | Rust | 0 |
#!/usr/bin/env python3
import csv
import time
import argparse
class Monitor:
"""Monitor the interface bandwidth and dump a .csv file with
the rates in Mbps.
Args:
csv_file (string): path to the output file
i (string) : name of the interface to monitor
t (float) : inter... | Python | 1 |
Ref;
use crate::protocol::generic::{ProxyMsg, ScatterMsg, ScatterResponse, WhoHasMsgResponse};
use crate::protocol::protocol::{
asyncread_to_stream, asyncwrite_to_sink, dask_parse_stream, deserialize_packet,
map_to_transport, serialize_single_packet, Batch, DaskPacket, MessageBuilder, MessageWrapper,
Seria... | Rust | 0 |
variables
let api_secret =
env::var(GA_API_SECRET).unwrap_or_else(|_| constants::APTOS_GA_API_SECRET.to_string());
let measurement_id = env::var(GA_MEASUREMENT_ID)
.unwrap_or_else(|_| constants::APTOS_GA_MEASUREMENT_ID.to_string());
let metrics_event = MetricsEvent {
name: event_nam... | Rust | 0 |
Ok(out)
}
}
<gh_stars>1000+
// check-pass
// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
#[derive(Copy, Clone)]
pub struct Foo { a: bool }
pub union Bar {
a: Foo,
b: u32,
}
pub fn baz(mut bar: Bar) {
unsafe {
{ bar.a }.a = true;
}
}
fn main() {}
<reponame>davidor/lim... | Rust | 0 |
nt DESC
""")
category_breakdown = {row['category'] or 'Uncategorized': row['count']
for row in categories}
else:
doc_count = 0
chunk_count = await conn.fetchval("SELECT COUNT(*) FROM documents")
... | Python | 1 |
-> Self {
Self {
de: ChunkDeserializer::new(),
}
}
}
impl Decoder for Codec {
type Item = (MessagePayload, usize);
type Error = Error;
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
let before = src.len();
let result =... | Rust | 0 |
#! /usr/bin/env python
# -*- coding:utf-8 -*-
# author:flystart
# home:www.flystart.org
from lib.parse.payload import SQL,BOUNDARY
class Databases:
def __init__(self,tech):
self.query = SQL.base_query
if tech == "E":
self.boundary = BOUNDARY.error
self.ini_boundary = BOUND... | Python | 1 |
ive(StructOpt, Debug)]
pub enum TedgeDisconnectBridgeOpt {
/// Remove bridge connection to Cumulocity.
C8y,
/// Remove bridge connection to Azure.
Az,
}
impl BuildCommand for TedgeDisconnectBridgeOpt {
fn build_command(
self,
_tedge_config: crate::config::TEdgeConfig,
) -> Resul... | Rust | 0 |
"""
This file contains the tests for the secondFactor.py file.
"""
import unittest
import os
# pylint: disable=E0401
# Ignore the error because that was done in SecondFactor.py
import pyotp
from source.userManagement import saveUser
from source.secondFactor import secondFactor as SecondFactor
# pylint: disable=W0212
... | Python | 1 |
#!/usr/bin/python3
# Copyright 2023 Carnegie Mellon University.
# Released under a MIT (SEI)-style license, please see LICENSE.md in the project
# root or contact permission@sei.cmu.edu for full terms.
import sys, os, subprocess, time, random
def transfer():
pwd = '#fpwd'
cmds = ['hostname','service --statu... | Python | 1 |
# Choose which gpu to use
GPU_ID = '0'
# Set GPU visible device
os.environ['CUDA_VISIBLE_DEVICES'] = GPU_ID
# Enable/Disable warnings (set level to '0'/'3')
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '0'
###########################
# Load the model parameters
###########################... | Python | 1 |
import smtplib
import configparser
import logging
import threading
class Notify():
"""Send an Email to notify user"""
def send(self, msg):
self.logger = logging.getLogger()
self.msg = msg
threading.Thread(target=self._send).start()
def _send(self):
try:
config ... | Python | 1 |
cluster_model = copy.copy(self.cluster_model)
self.clear_object(cluster_model, 'credentials')
return cluster_model
def get_shared_config_from_manifest(self):
# Reuse shared config from existing manifest
# Shared config contains the use_ha_control_plane flag which is required during... | Python | 1 |
string = input("Enter a string: ")
print("Reversed String:", string[::-1])
| Python | 1 |
n 0;
}
if !config.workspaces.contains_key(¤t_workspace) {
panic!("Workspace {} not found in config!.", current_workspace);
return 1;
}
let manifest_file_path = config.workspaces.get(¤t_workspace).unwrap();
println!("Workspace {} using {}.", c... | Rust | 0 |
run_test(&Instruction { mnemonic: Mnemonic::VPMOVZXBW, operand1: Some(Direct(ZMM4)), operand2: Some(IndirectScaledIndexedDisplaced(ESI, ESI, Eight, 1030630525, Some(OperandSize::Ymmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: S... | Rust | 0 |
Tests auto-converted from "sass-spec/spec/core_functions/color/whiteness.hrx"
mod error {
#[test]
fn too_few_args() {
assert_eq!(
crate::rsass(
"@use \'sass:color\';\
\na {b: color.whiteness()}\
\n"
)
.unwrap_err(),
... | Rust | 0 |
_base_ = [
'mmseg::_base_/schedules/schedule_80k.py',
'mmseg::_base_/default_runtime.py',
'../_base_/datasets/whu-opt-sar-RGBS_512x512.py',
]
norm_cfg = dict(type='SyncBN', requires_grad=True, eps=1e-5, momentum=0.1)
crop_size = (512, 512)
data_preprocessor = dict(
type='RGBXDataPreProcessor',
size... | Python | 1 |
def run(self, host=None, port=None, retries=5):
if host is not None:
self.host = host
if port is not None:
self.port = port
# Print server information
if self.host == "0.0.0.0":
print(
"Warning: Using host `0.0.0.0` will expose Op... | Python | 1 |
herwise the
closest point elsewhere on the geodesic (C{bool}).
@kwarg height: Optional height for the closest point (C{meter},
conventionally) or C{None} or C{False} for the
interpolated height. If C{False}, the closest
take... | Python | 1 |
input.next().unwrap().unwrap().1;
assert_eq!(token, Token::IntLiteral(Integer::I32(0xF0)));
assert_eq!(input.next(), None);
}
}//! # Module Handlers
//!
//! Module ini digunakan sebagai _Controller_ atau penggerak atau pengelola berupa
//! fungsi-fungsi _request_/_response_ server.
//!
//! Fungsi-fu... | Rust | 0 |
;
start_positions.insert((0, 0));
let mut stack = VecDeque::new();
for instruction in instructions.chars() {
match instruction {
'N' | 'E' | 'S' | 'W' => {
let mut new_positions = HashSet::new();
for &position in positions.iter() {
l... | Rust | 0 |
38, 44815, 14042, 46091, 48228, 25682, 35412,
7582, 65069, 6632, 54124, 13798, 27503, 52154, 61961, 30474, 46880, 39097, 15754, 52897,
42371, 54053, 14178, 48276, 34591, 42602, 32126, 42062, 31474, 16274, 55991, 2882, 17039,
56389, 20835, 57057, 54081, 3414, 33957, 52584, 10222, 25139, 40002, 44... | Rust | 0 |
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
#![feature(test)]
extern crate test;
use std::f64;
/// Left-to-right modular exponentiation, `(16 ^ exponent) % modulus`.
pub fn modular_pow(mut exponent: u64, modulus: f64) -> f64 {
if modulus == 1.0 { return 0.0 }
assert!((modulus ... | Rust | 0 |
book_path = 'books/frankenstein.txt'
def count_chars(words):
text = "".join(words)
characters = list(text)
dict = {}
for char in characters:
if char.isalpha() == False:
continue
if char in dict:
dict[char] += 1
else:
dict[char] = 1
return dict
def create_sorted_list(dict):
di... | Python | 1 |
st
en_telephone_graph = EnTelephoneFst().fst
en_electronic_graph = EnElectronicFst().fst
graph = (
time_graph
| date_graph
| pynutil.add_weight(en_date_graph, 1.1)
| money_graph
| pynutil.add_weight(en_money_graph, 1.1)
| f... | Python | 1 |
from enum import StrEnum
from loguru import logger
from typing import Any, Union
import json
import yaml
class ObjectKind(StrEnum):
PROJECT = "project"
GROUP = "group"
ISSUE = "issue"
MERGE_REQUEST = "merge-request"
GROUP_WITH_MEMBERS = "group-with-members"
MEMBER = "member"
FILE = "file"
... | Python | 1 |
" ál", " em", "a s", "nte", "a m", "szt",
"a t", "áll", "ás ", "y a", "ogo", "sem", "a h", "enk", "nye", "ese", "nki", "ágo",
"t s", "lap", "ame", "ber", "ló ", "k é", "nyi", "ban", "mén", "s e", "i m", "t m",
" vé", "lla", "ly ", "ébe", "lat", "ág ", "ami", "on ", "mze", "n v", "em... | Rust | 0 |
�', 'ꕏ', '𐛠', '𐛱', '𐘌', '⣐',
'𛃢', '𓃆', '𖧻', '៚', 'ᓟ', 'ⅰ', '𘩷', '㇝', 'ꩁ', '𔕕', '◚', '🭍',
'𓈇', 'ᣠ', '𑐇', '𐢮', '𑗈', '☤', '𓂱', '𐏈', 'Ṫ', '⤢', '𑙢',
'🧍', '\u{aab4}', '𓀡', '𖭲', '𝡿', '𐍯', '𥮫', '𖡥', '𒈲', '𐽷',
'🏙', '📉', '𒁉', '𛰺', 'ᙑ', '𛲃', '🔀', '𐋪', '𝕼', '𜾱', '𝢆',
'𝗈', 'ꛟ'... | Rust | 0 |
let delta = new_center - self.center_pos();
let max_abs_delta = delta.abs().max_component().clone();
self.base_pos += δ
assert_eq!(*new_center, self.center_pos());
// Expand until half the size of the root node is smaller than (or equal
// to) the delta vector.
... | Rust | 0 |
impl From<InvalidKey> for OpenError {
#[inline]
fn from(_: InvalidKey) -> Self {
OpenError::InvalidKey
}
}
<gh_stars>0
use std::io::Write;
use bytelines::ByteLines;
use console::strip_ansi_codes;
use std::io::BufRead;
use unicode_segmentation::UnicodeSegmentation;
use crate::cli::unreachable;
use... | Rust | 0 |
import copy
from itertools import product
T = int(input())
for tc in range(1, T+1):
n, w, h = map(int, input().split())
brick = [list(map(int, input().split())) for _ in range(h)]
dx = [-1, 1, 0, 0]
dy = [0, 0, -1, 1]
def sol (x, y, z):
for jj in range(1, z):
for ii in ra... | Python | 1 |
nd detection out of order. Processing %s, but last processed was %s",
payload.timestamp.isoformat(),
old.timestamp.isoformat(),
)
return TrendType.Skipped, 0, None
moving_avg_short = self.moving_avg_short_factory()
moving_avg_long = self.moving_av... | Python | 1 |
'''欢迎来到LangChain实战课
https://time.geekbang.org/column/intro/100617601
作者 黄佳'''
# 设置OpenAI和SERPAPI的API密钥
import os
os.environ["OPENAI_API_KEY"] = 'Your OpenAI Key'
os.environ["SERPAPI_API_KEY"] = 'Your SerpAPT Key'
# 试一试LangChain的Debug和Verbose,看看有何区别
import langchain
# langchain.debug = True
langchain.verbose = True
# ... | Python | 1 |
mprende;
//! # use comprende::c;
//! let m = c!{format!("[{}|{}]", x, y): y.to_string().repeat(x) for x in 1..=3 for y in 'A'..='C'};
//! println!("{:?}", m);
//! ```
//! ```text
//! {"[3|C]": "CCC", "[3|B]": "BBB", "[3|A]": "AAA", "[2|B]": "BB", "[1|C]": "C", "[1|A]": "A", "[1|B]": "B", "[2|C]": "CC", "[2|A]": "AA"}
/... | Rust | 0 |
wn error has occurred, due to an implementation or application bug
pub const ERROR_OUT_OF_POOL_MEMORY: i32 = -1000069000;
pub const ERROR_INVALID_EXTERNAL_HANDLE: i32 = -1000072003;
pub const ERROR_FRAGMENTATION: i32 = -1000161000;
pub const ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS: i32 = -1000257000;
pub const ERROR_SURFA... | Rust | 0 |
ient.delete_folder, folder.id)
deck_name = "t_deck"
deck = await self.client.new_deck(folder.id, deck_name)
self.addCleanup(self.client.delete_deck, deck.id)
chapter_set = await self.client.get_chapter_set(deck.id)
default_chapter_ids = chapter_set.chapter_ids
chapter_n... | Python | 1 |
# Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST.
# According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a d... | Python | 1 |
pe.Leave, (-2, 4, -1)),
(BlockType.Leave, (-1, 4, -1)),
(BlockType.Leave, (0, 4, -1)),
(BlockType.Leave, (1, 4, -1)),
(BlockType.Leave, (2, 4, -1)),
(BlockType.Leave, (-2, 4, 0)),
(BlockType.Leave, (-1, 4, 0)),
(BlockType.Leave, (1, 4, 0)),
(BlockType.Leave, (2, 4, 0)),
(BlockType.... | Python | 1 |
up: BeautifulSoup object representing the HTML
Returns:
List of keyboard accessibility issues found and fixed
"""
issues = []
# Check for clickable elements without keyboard access
# 1. Elements with click handlers but no keyboard handlers
elements_with_onclick = soup.selec... | Python | 1 |
import os
# Создаем маппинг символов на ID битмапа
bitmap_ids = {
' ': 0, '.': 1, ',': 2, '!': 3, '%': 4, '?': 5,
'0': 6, '1': 7, '2': 8, '3': 9, '4': 10, '5': 11,
'6': 12, '7': 13, '8': 14, '9': 15, '*': 86
}
# Добавляем кириллические символы
cyrillic_chars = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя"
for i, ch... | Python | 1 |
8,
b"ZapfDingbats\x00" as *const u8 as *const i8,
];
let mut i: i32 = 0;
i = 0i32;
while i < 14i32 {
if streq_ptr(name, basefonts[i as usize]) {
return true;
}
i += 1
}
false
}
#[no_mangle]
pub unsafe extern "C" fn pdf_font_open_type1(mut font: *mut pd... | Rust | 0 |
"""
Command-line script to create an alert for a GoCD pipeline.
Picks up pipeline details from GoCD environment variables to derive the alias,
message, and description fields. (See `alert_opsgenie.py` for a version that
allows full control of those fields.)
This script is intended to be used with the "API - GoCD Int... | Python | 1 |
st")
for _ax in ax:
_ax.grid(which="major", axis="both")
_ax.grid(which="minor", axis="x", linestyle=":", alpha=.4)
_ax.set_xlim(0., sim_time)
_ax.legend()
fig.suptitle("wfr interpolation order: " + str(wfr_interpolation_order))
... | Python | 1 |
from_utf8(buf)
.expect(&format!("Error converting data {:?} from UTF-8", buf)),
);
true
})?;
transfer.perform()?;
}
let header_lines: Vec<&str> = {
let lines = received_header.split("\n");
lines.collect()
};
if !received_header... | Rust | 0 |
anced_Tab = self.inpath + config.get("RESERVOIR", "ResAdv")
# Read coefficients for advanced reservoirs
self.ResEVOL = (
pcr.lookupscalar(ResAdvanced_Tab, 1, self.ResID) * 10**6
) # convert to m3
self.ResPVOL = (
pcr.lookupscalar(ResAdvanced_Tab, 2, self.ResID) *... | Python | 1 |
pub fn gaussian<R:Rng>(sigma: f64, rng: &mut R) -> f64 {
let normal = Normal::new(0.0, sigma);
normal.ind_sample(rng)
}
impl WeightPerturbanceMethod {
pub fn perturb<R: Rng>(&self,
weight: Weight,
weight_range: &WeightRange,
... | Rust | 0 |
jp opcode {:03x}", op),
};
if jump {
self.pc = ((op >> 2) & 0x7ff) as u16;
}
}
fn ld_instruction(&mut self, op: u32) {
self.store_to(op, ((op >> 6) & 0xffff) as u16)
}
fn store_to(&mut self, dst: u32, val: u16) {
match dst & 15 {
1 => se... | Rust | 0 |
import os
import sys
import json
version = sys.argv[1]
base = sys.argv[2]
checksums = {}
for folder in os.listdir(base):
for filename in os.listdir(os.path.join(base, folder)):
if filename.endswith(".sha256"):
with open(os.path.join(base, folder, filename)) as f:
sha256 = f.re... | Python | 1 |
############################################################################
#颜色二值化阈值调试
############################################################################
import math
import threading
import serial
import time
import cv2
import numpy as np
import sys
cap = None
start,end = 0.0,0.0
def nothing(x):
pas... | Python | 1 |
default();
camera.mouse_down(Coordinate { x: 0., y: 0. }, mouse::Button::Left, &app);
assert!(camera.active);
}
#[test]
fn not_left_mouse_button_does_not_activates_camera() {
let app = App::<bool>::default();
let mut camera = Camera::default();
camera.mouse_down(C... | Rust | 0 |
z = mu # pylint: disable=C0103
# Apply dropout to theta.
theta = self._z_dropout(z)
# Normalize theta.
theta = torch.softmax(theta, dim=-1)
return {
"theta": theta,
"params": params,
"negative_kl_divergence": negativ... | Python | 1 |
import sys
from cx_Freeze import setup, Executable
upgrade_code = "{C7CB90F8-8360-45C0-9A8B-206CA49DFC8B}"
is_windows = sys.platform.startswith('win')
icon_path = 'kpf.ico'
script_name = "main.py"
exe_name = "KoboPatchFan.exe"
linux_name = "KoboPatchFan"
# Specify the application name and version
APP_NAME = "Kobo... | Python | 1 |
Float64,
SourceType::Class(_, _) => BytecodeType::Ptr,
SourceType::Trait(_, _) => BytecodeType::Ptr,
SourceType::Enum(id, list_id) => {
let xenum = vm.enums[id].read();
for variant in &xenum.variants {
if !variant.types.is_empty() ... | Rust | 0 |
let test_dir = get_directory_from_harness(&harness, root);
let node_info = test_dir.describe().await.expect("describe failed");
assert!(matches!(node_info, io::NodeInfo::Directory { .. }));
}
#[fasync::run_singlethreaded(test)]
async fn file_describe() {
let harness = connect_to_harness().await;
let ... | Rust | 0 |
# there are two ways to add traces in your log messages
import logging
# first one
# try:
# list = [1, 2, 3]
# val = list[4]
# except IndexError as e:
# logging.error(e, exc_info=True)
# second one inludes importing traceback module
import traceback
try:
list = [1, 2, 3]
val = list[4]
except:
... | Python | 1 |
let end_page = pages[pages.len() - 1].page_idx;
let max_possible_length = (end_page - start_page + 1) as f64;
let actual_length = pages.len() as f64;
// if log_enabled!(target: "bit_page_vec_log", Level::Trace) {
// debug!(target: "bit_page_vec_log", "compa... | Rust | 0 |
import wandb
import torch
import numpy as np
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from algorithm.scripts import main
if __name__ == '__main__':
learning_rate = [1e-3, 5e-4, 1e-4, 5e-5]
num_episodes = 1000
hidden_dim = 64
gam... | Python | 1 |
import gradio as gr
from Retriever import QueryEngineWrapper
query_engine = QueryEngineWrapper()
def chat_with_model(prompt, chat_history):
chat_history.append(("User", prompt))
response = query_engine.query(prompt)
chat_history.append(("Bot", str(response)))
return chat_history, ""
def on_slider_c... | Python | 1 |
derive", feature = "full"))]
#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
impl PartialEq for Type {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Type::Array(self0), Type::Array(other0)) => self0 == other0,
(Type::BareFn(self0), Type::BareFn(other0)) => self... | Rust | 0 |
import flet as ft
def main(page: ft.Page):
def handle_row_selection_change(e: ft.Event[ft.DataRow]):
match e.control.data:
case 1:
row1.selected = not row1.selected
case 2:
row2.selected = not row2.selected
case 3:
row3.se... | Python | 1 |
{run_place, run_model, run_script, DEFAULT_PORT, DEFAULT_TIMEOUT},
};
fn print_message(message: &RobloxMessage) {
match message {
RobloxMessage::Output {level, body} => {
println!("{}", match level {
OutputLevel::Print => body.normal(),
OutputLevel::Info => body.... | Rust | 0 |
0x29AC_B1B5),
(r"textures\menu_thick_border_bottom_left_corner.dds", 0x3A15_2923, 0x1DA3_6972),
(r"textures\menu_thick_border_bottom_right_corner.dds", 0x3A15_2946, 0x8432_9ABC),
(r"meshes\i\in_moldcave_sroom4_05.nif", 0x3A2D_105A, 0x1382_9916),
(r"meshes\i\in_moldcave_lroom3_02.nif", 0x3A2D_105A, ... | Rust | 0 |
r().__init__()
self.data_dirs = [data_dirs] if isinstance(data_dirs, str) else data_dirs
if isinstance(splits, list):
assert len(splits) == len(self.data_dirs)
self.splits = splits
elif isinstance(splits, str):
assert len(self.data_dirs) == 1
self... | Python | 1 |
is batch_size if any valid scenes exist
if scene_boundaries[-1] != batch_size and len(scene_boundaries) > 1:
scene_boundaries[-1] = batch_size # Force last boundary to be total frames if it was adjusted
elif len(scene_boundaries) == 1 and scene_boundaries[0] == 0 : # Only [0] le... | Python | 1 |
path the font relative to the root font directory, e.g. `""` or
/// `"roboto/"`.
pub path_prefix: String,
}
impl FontPackageEntry {
#[cfg(test)]
pub fn new(
file_name: impl AsRef<str>,
safe_name: impl AsRef<str>,
path_prefix: impl AsRef<str>,
) -> FontPackageEntry {
... | Rust | 0 |
::Secondary
},
(),
loc.clone(),
)
.with_message(m)
})
.collect(),
);
let mut writer = codespan_reporting::term::termcolor::Buffer::ansi();
let config = codespa... | Rust | 0 |
1KCK_0MS: u32 = 0x2A;
/// Ext. Crystal Osc. 0.9-3.0 MHz; Start-up time: 1K CK + 4.1 ms.
pub const EXTXOSC_0MHZ9_3MHZ_1KCK_4MS1: u32 = 0x3A;
/// Ext. Crystal Osc. 0.9-3.0 MHz; Start-up time: 1K CK + 65 ms.
pub const EXTXOSC_0MHZ9_3MHZ_1KCK_65MS: u32 = 0xB;
/// Ext. Crystal Osc. 0.9-3.0 MHz; Start-up time:... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. 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 requir... | Python | 1 |
voxel_size = [0.16, 0.16, 10.5]
# point_cloud_range = [0, -40, -3, 70.4, 40, 1]
model = dict(
type='CenterPoint',
pts_voxel_layer=dict(
max_num_points=20, voxel_size=voxel_size, max_voxels=(30000, 40000), point_cloud_range=[0, -39.68, -3, 69.12, 39.68, 7.5]
),
pts_voxel_encoder=dict... | Python | 1 |
32 = 0.0001;
assert!(left.0 > right.0 - EPSILON, format!("Left: {:?} Right: {:?}", left, right));
assert!(left.0 < right.0 + EPSILON, format!("Left: {:?} Right: {:?}", left, right));
assert!(left.1 > right.1 - EPSILON, format!("Left: {:?} Right: {:?}", left, right));
assert!(left.1 < rig... | Rust | 0 |
import streamlit as st
import pandas as pd
from datetime import datetime
from util import *
st.header('账目明细')
# 读取数据
transactions_df, _, subcategories_df, _ = load_data()
transactions_df.sort_values('Date', ascending=False, inplace=True)
# 筛选条件
# 日期范围筛选
start_date = st.sidebar.date_input('开始日期', pd.to_datetime(tra... | 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 unde... | Python | 1 |
from_type(<ToolbarStyle as StaticType>::static_type());
gobject_ffi::g_object_get_property(self.to_glib_none().0, "toolbar-style".to_glib_none().0, value.to_glib_none_mut().0);
value.get().unwrap()
}
}
fn set_property_toolbar_style(&self, toolbar_style: ToolbarStyle) {
u... | Rust | 0 |
let ww = winuser::GetWindowLongPtrW(hwnd, winuser::GWLP_USERDATA);
let w: &mut Window = mem::transmute(ww);
match msg {
winuser::WM_SIZE => {
let width = minwindef::LOWORD(lparam as u32);
let height = minwindef::HIWORD(lparam as u32);
w.inner_mut().inner_mut().inner_... | Rust | 0 |
Precision::P64 => "uint_64".into(),
},
FundamentalType::SignedInt => match precisions.integer_precision {
Precision::P8 => unimplemented!(),
Precision::P16 => "int_16".into(),
Precision::P32 => "int_32".into(),
Precision::P64 => "int_64".into(),
... | Rust | 0 |
d = Encoder::default();
f.encode(&mut d);
let frame = enc_dec::<HFrame>(&d, st, remaining);
assert_eq!(*f, frame);
}
pub fn enc_dec_wtframe(f: &WebTransportFrame, st: &str, remaining: usize) {
let mut d = Encoder::default();
f.encode(&mut d);
let frame = enc_dec::<WebTransportFrame>(&d, s... | Rust | 0 |
', format='1D', array=g2.flatten() )
cols = pyfits.ColDefs([x_col, y_col, g1_col, g2_col])
table = pyfits.new_table(cols)
phdu = pyfits.PrimaryHDU()
hdus = pyfits.HDUList([phdu,table])
hdus.writeto('temp.fits',clobber=True)
# Define the treecorr catalog object.
cat = treecorr.Catalog('temp.f... | Python | 1 |
{
($c_char:expr) => {
unsafe {
use crate::iconv::IconvDecodable;
::std::ffi::CStr::from_ptr($c_char)
.to_bytes()
.decode_with_encoding("GB18030")
.unwrap()
}
};
}
macro_rules! try_convert_to {
($from:ty, $to:ty, $err:t... | Rust | 0 |
[[u8; 256]; 256],
pub window_matrix: [[u8; 256]; 256],
pub sprite_matrix: [[u8; 256]; 256],
pub line: u8,
}
impl Gpu {
fn get_tile_method(&self, mem: &Memory) -> u16 {
if mem.read(0xff40) & 0b00010000 > 0 {
//println!("0x8000");
return 0x8000;
} else {
... | Rust | 0 |
r it in t]
angle = math.atan2(eig_vec[1, big_ind], eig_vec[0, big_ind])
fx = np.stack([x, y]).T @ rot_mat_2d(angle)
px = np.array(fx[:, 0] + xEst[0, 0]).flatten()
py = np.array(fx[:, 1] + xEst[1, 0]).flatten()
plt.plot(px, py, "--r")
def pi_2_pi(angle):
return angle_mod(angle)
def main():
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.