text string | label_name string | labels int64 |
|---|---|---|
ption<String>,
pub(crate) fstype: Option<String>,
pub(crate) children: Option<Vec<Device>>,
}
impl Device {
// RHEL8's lsblk doesn't have PATH, so we do it
pub(crate) fn path(&self) -> String {
format!("/dev/{}", &self.name)
}
}
pub(crate) fn wipefs(... | Rust | 0 |
import uvicorn
import logging
# Configure logging
logging.basicConfig(level=logging.DEBUG)
if __name__ == "__main__":
uvicorn.run(
"app.main:app",
host="0.0.0.0",
port=8000,
reload=True, # Enable auto-reload during development
log_level="debug"
)
| Python | 1 |
))
}
pub fn switch_task(&mut self, idx: usize) -> Result<(), ()> {
let tasks = self.list_tasks()?;
let current = tasks.get(0);
let task = tasks.get(idx);
if let Some(task) = current {
if task.stop.is_none() {
let duration = Utc::now().timestamp() -... | Rust | 0 |
"""
Contains decorators for registering commands.
"""
import pyspigot as ps
def command(name, description='', usage='', aliases=[], permission=None):
"""
Register a new command by decorating a function. The decorated function will be called when the command is executed.
:param name: The name of the comma... | Python | 1 |
alidity().into()
}
fn validation_message(&self) -> String {
self.inner.validation_message().unwrap_or(String::new())
}
}
impl labelable_element_seal::Seal for HtmlOutputElement {}
impl LabelableElement for HtmlOutputElement {
fn labels(&self) -> Labels {
Labels::new(Some(self.inner.la... | Rust | 0 |
yle for items.
pub item_brace_style: ItemBraceStyle,
/// Maximum number of blank lines which can be put between items.
pub blank_lines_upper_bound: usize,
/// Minimum number of blank lines which must be put between items.
pub blank_lines_lower_bound: usize,
/// Put empty-body functions and impls... | Rust | 0 |
class Solution:
MOD = 1000000000 + 7
def checkRecord(self, n: int) -> int:
prevDP = [[1] * 3 for _ in range(2)]
for i in range(1, n + 1):
newDP = [[0] * 3 for _ in range(2)]
for a in range(2):
for l in range(3):
# Pick P
... | Python | 1 |
bk_supplier_account,
produce_method,
set_input_method=None,
module_input_method=None,
):
"""
@summary 根据输入获取空闲机module id
@param var_module_name: 模块属性名
@param set_input_method: 集群输入方式对应tag code
@param module_input_method: 模块输入方式对应tag code
@param var_ip_selector: 表单数据
@param user... | Python | 1 |
e1', r'input\files\game1', id='relative, mixed fwd and bck slash'),
pytest.param(r'Input/game1', r'Input\game1', id='relative, fwd slash'),
pytest.param(r'./Input/game1', r'Input\game1', id='relative, ./ notation'),
pytest.param(r'../Output', r'..\Output', id='relative, ../ notation'... | Python | 1 |
0.0);
assert_eq_delta!(v.y, 0.0);
assert_eq_delta!(v.z, 0.0);
assert_eq_delta!(v.w, 0.0);
}
#[test]
fn new() {
let v = Vec4::new(1.0, 2.0, 3.0, 4.0);
assert_eq_delta!(v.x, 1.0);
assert_eq_delta!(v.y, 2.0);
assert_eq_delta!(v.z, 3.0);
assert_e... | Rust | 0 |
ition {
Macro(Rc<Macro>),
Token(Token),
MathCode(MathCode),
Primitive(&'static str),
Font(Font),
}
// This contains all of the mutable state about our TeX environment
#[derive(Clone)]
pub struct TeXStateInner {
// A map individual characters to the category that that it is associated
// wit... | Rust | 0 |
import datetime
from salon.app import app
from salon.models import db
from salon.models import Event
from salon.models import PullRequest
from salon.models import ReviewState
@app.cli.command()
def make_test_data():
now = datetime.datetime.utcnow()
reviewers = {"foo": "fish", "bar": "nail_care", "baz": "unre... | Python | 1 |
he builder and constructs a [`Transition`](crate::model::Transition)
pub fn build(self) -> crate::model::Transition {
crate::model::Transition {
date: self.date,
days: self.days.unwrap_or_default(),
storage_class: self.storage_class,
}
... | Rust | 0 |
MessageDescriptor {
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
descriptor.get(|| {
let mut fields = ::std::vec::Vec::new();
fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::type... | Rust | 0 |
rules_to_take: 0,
node_chunk_size: 0,
eq_chunk_size: 0,
no_constants_above_iter: 999999,
no_conditionals: true,
no_run_rewrites: false,
linear_cvec_matching: false,
ema_above_iter: 999999,
disabled_ops: None,
dis... | Rust | 0 |
', 'ꃜ',
'ᖕ', '𓂅', '\u{1ed10}', '𒄱', 'ⱄ', '\u{1da67}', '⫷', '🥡', '\u{1da4a}', '꤈',
'𖢳', '\u{1fb85}', '𐁄', '😼', '𝥈', '𘨈', 'ꢁ', 'ᶽ', '𓄳', '𐬏',
'\u{16f81}', '㉡', '⋲', '𝢹', 'ޤ', '𑅐', 'Ⳏ', 'ᅯ', '๙', '😧', '⠚',
'䷓', '𐨯', '⮄', '𖧫', '𒀃', '𐧒', 'ꭃ', '𖢶', '⡻', 'ኊ', '𛇽',
'\u{a92c}', '𖦿', '🙃',... | Rust | 0 |
time_max
elif score >= beta:
depth = max(depth - 1, 1)
beta = min(score + delta, MATE)
else:
# Don't search the same move again.
searchable.remove(root_move.m... | Python | 1 |
JValue::String(s) => Ok(s),
_ => exec_err!(IncompatibleJValueType(jvalue, "string")),
}
}
fn vec_to_string(values: Vec<&JValue>, variable: &AstVariable<'_>) -> ExecutionResult<String> {
if values.is_empty() {
let variable_name = match variable {
AstVariable::Stream(name) => name... | Rust | 0 |
# coding: utf-8
from Bio import Entrez
import argparse
import time
import urllib
import ssl
import sys
parser = argparse.ArgumentParser(description='UniProt codes')
parser.add_argument('uniprotAcc')
parser.add_argument('email')
args=parser.parse_args()
Entrez.email = args.email
attempts = 0
ids=args.uniprotAcc
contx=s... | Python | 1 |
ange_exceeded;
new_idt.invalid_opcode = early_idt.invalid_opcode;
new_idt.device_not_available = early_idt.device_not_available;
// double fault handler is dealt with below.
new_idt.invalid_tss = early_idt.invalid_tss;
new_idt.segment_not_present =... | Rust | 0 |
,
pir::ir::ComparisonOperator::GreaterThanOrEqual => {
fmm::ir::ComparisonOperator::GreaterThanOrEqual
}
pir::ir::ComparisonOperator::LessThan => fmm::ir::ComparisonOperator::LessThan,
pir::ir::ComparisonOperator::LessThanOrEqual => {
fmm::... | Rust | 0 |
g());
let mut req = ::new_req_full(Arc::clone(&app), krate.clone(), "2.0.0", Vec::new());
{
let conn = app.diesel_database.get().unwrap();
let user = ::new_user("foo").create_or_update(&conn).unwrap();
::sign_in_as(&mut req, &user);
::CrateBuilder::new("foo_twice", user.id).expec... | Rust | 0 |
and determinant test
if (e0 < 0.0 || e1 < 0.0 || e2 < 0.0) && (e0 > 0.0 || e1 > 0.0 || e2 > 0.0) {
return None;
}
let det = e0 + e1 + e2;
if det == 0.0 {
return None;
}
// - compute scaled hit distance to triangle and test against ray t range
... | Rust | 0 |
content_type = "tvchannels"
return content_type
def recursive_delete_dir(path):
'''helper to recursively delete a directory'''
success = True
path = try_encode(path)
dirs, files = xbmcvfs.listdir(path)
for file in files:
success = xbmcvfs.delete(os.path.join(path, file))
for direct... | Python | 1 |
input.pressed(KeyCode::Down);
let left = keyboard_input.pressed(KeyCode::A) || keyboard_input.pressed(KeyCode::Left);
let right = keyboard_input.pressed(KeyCode::D) || keyboard_input.pressed(KeyCode::Right);
// convert to axis multipliers
let x_axis = -(left as i8) + right as i8;
... | Rust | 0 |
"""Support for Acmeda Roller Blind Batteries."""
from __future__ import annotations
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE
from homeassistant.core import HomeAssistant, callback
from hom... | Python | 1 |
Secrets) -> Result<Index, r2d2::Error> {
Ok(Index(Pool::new(ConnMan::new(secrets.database().url()))?))
}
}
#[derive(From, Display)]
pub enum QueryError {
R2d2(r2d2::Error),
Diesel(diesel::result::Error),
}
<filename>profile/src/microphone/mic_setup.rs
use std::collections::HashMap;
use std::io::Wri... | Rust | 0 |
import dspy
from typer import Typer
app = Typer()
lm = dspy.OpenAI(max_tokens=500)
dspy.settings.configure(lm=lm)
class BookDescToProductInfo(dspy.Module):
"""Converts book descriptions to product information"""
def forward(self, book_desc):
pred = dspy.Predict("book_desc -> product_info")
... | Python | 1 |
f uuid_part in file:
image_file_path = os.path.join(upload_dir, file)
self.logger.info(f"找到包含UUID前缀的图片文件: {file}")
break
... | Python | 1 |
unsafe { flatbuffers::emplace_scalar::<i8>(dst, self.0); }
}
}
impl flatbuffers::EndianScalar for ConstValueKind {
#[inline]
fn to_little_endian(self) -> Self {
let b = i8::to_le(self.0);
Self(b)
}
#[inline]
#[allow(clippy::wrong_self_convention)]
fn from_little_endian(self) -> Self {
... | Rust | 0 |
from langchain_community.embeddings import OllamaEmbeddings
from qdrant_client import QdrantClient
from qdrant_client import AsyncQdrantClient, models
import numpy as np,os,json
import csv,glob
ollama_emb = OllamaEmbeddings(model="llama3", base_url="http://localhost:11434")
client = QdrantClient(url="http://localhost:5... | Python | 1 |
# Copyright (c) 2023, NVIDIA CORPORATION.
from cuspatial.core.binpreds.basic_predicates import (
_basic_equals_all,
_basic_equals_any,
_basic_intersects,
)
from cuspatial.core.binpreds.binpred_interface import (
BinPred,
ImpossiblePredicate,
NotImplementedPredicate,
)
from cuspatial.utils.binpr... | Python | 1 |
me):
def __init__(self, parent):
wx.Frame.__init(self, parent, -1, "Persistent Controls Demo")
book = wx.Notebook(self, wx.ID_ANY)
# Very important step!!
book.set_name("MyBook") # Do not use the default name!!
book... | Python | 1 |
>= offset.pc.start && pc < offset.pc.end)
}
// A single line may map to multiple addresses, since it could be an import compiled with different parameters
pub fn line_col_to_offsets<C: Into<Option<usize>>>(
&self,
code_map: &CodeMap,
filename: &str,
line: usize,
col... | Rust | 0 |
edge[:-1,:] | (t[1:,:] != t[:-1,:])
return edge
def get_label_tensor(self, path):
candidate = np.loadtxt(path.format('candidate'))
subset = np.loadtxt(path.format('subset'))
stickwidth = 4
limbSeq = [[2, 3], [2, 6], [3, 4], [4, 5], [6, 7], [7, 8], [2, 9], [9, 10], \
... | Python | 1 |
mid = Some(t);
},
}
}
}
false
}
pub fn increasing_triplet_2(nums: Vec<i32>) -> bool {
let (mut low, mut high) = (i32::max_value(), i32::max_value());
for num in nums {
if num <= low {
... | Rust | 0 |
let buf1: Vec<u8> = bs58::decode(in_s).into_vec().unwrap();
let p1 = PublicKey::from_slice(&buf1[0..33]);
match p1 {
Ok(s) => {
// let serial = s.serialize();
match publickey_to_string(s) {
Err(e) => assert!(false),
... | Rust | 0 |
ot equal_bnot_mop(candidate["x_1"].mop, candidate["bnot_x_1"].mop):
return False
candidate.add_constant_leaf("val_1", 1, candidate["x_0"].size)
return True
@property
def PATTERN(self) -> AstNode:
return AstNode(
m_add, AstNode(m_or, AstLeaf("x_0"), AstLeaf("bnot_... | Python | 1 |
"""Config flow for nVent RAYCHEM SENZ."""
import logging
from homeassistant.helpers import config_entry_oauth2_flow
from .const import DOMAIN
class OAuth2FlowHandler(
config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN
):
"""Config flow to handle SENZ OAuth2 authentication."""
DOMAIN = DO... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
class SnailmailConfirm(models.AbstractModel):
_name = 'snailmail.confirm'
_description = 'Snailmail Confirm'
model_name = fields.Char()
@api.model
def show_... | Python | 1 |
bool,
/// Flag to display every event in the calendar starting this week.
#[structopt(short, long)]
pub month: bool,
}
#[derive(Debug, PartialEq, StructOpt)]
pub struct CalOpts {
/// Name of the calendar.
pub calendar_name: String,
}
#[derive(Debug, PartialEq, StructOpt)]
#[structopt(about = "A li... | Rust | 0 |
::<Bn256, 4>().to_vec();
let cipher = PoseidonCipher::<Bn256, RATE, WIDTH>::encrypt(
¶ms, &message_4, &secret, &nonce, None,
);
let decrypt = cipher.decrypt(¶ms, &secret, &nonce, None);
assert_eq!(message_4, decrypt);
}
}
<gh_stars>0
mod attributes;
mod decode;
m... | Rust | 0 |
cls_dataloader = DataLoader(train_dataset, batch_size=8, shuffle=True, collate_fn=collate_fn_with_label)
mlm_dataloader = DataLoader(tokenized_mlm, batch_size=8, shuffle=True, collate_fn=data_collator)
# 初始化模型和优化器
num_labels = len(label2id)
model = BertForMultiTask("E:/natrual-language-processing/nlp数据集/bert/saved-mlm... | Python | 1 |
gallows_deputies -> wiggles_thicknesses_contempt'
import duvmml_wzpv, t5627imc_qf, tf3latsjrkc as dxc8uv3cxxr, muyr83liu83, y5eqw60o1or as d2cvwu7r1_0, tezdeupthq7 as wdq7vzyk1ib, qnge7b_ae36, zo0_qwoykg9, deie_inzoto as quw5fe6btxh, gp_ltshdarx
tgpb3tpx66u += False
return wds6fxuukr8
nonlocal i7_m_7o06... | Python | 1 |
ctx.get::<JsFunction>(0)?;
///
/// let tsfn =
/// ctx
/// .env
/// .create_threadsafe_function(&func, 0, |ctx: ThreadSafeCallContext<Vec<u32>>| {
/// ctx.value
/// .iter()
/// .map(|v| ctx.env.create_uint32(*v))
/// .collect::<Resu... | Rust | 0 |
# Drakkar-Software OctoBot-Trading
# Copyright (c) Drakkar-Software, All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3.0 of the License, or (... | Python | 1 |
import pytest
from tigrbl import TigrblApp
from tigrbl.orm.mixins import GUIDPk, BulkCapable, Mergeable
from tigrbl.orm.tables import Base
from tigrbl.op.types import CANON
from tigrbl.types import Column, String
def _route_map(router) -> dict[str, tuple[str, set[str]]]:
out: dict[str, tuple[str, set[str]]] = {... | Python | 1 |
p,
None => break,
}
}
scheduled.reverse();
scheduled
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_scheduling_1() {
let intervals = vec![
Interval::new(3, 5),
Interval::new(1, 3),
Interval::new(2, 4),
Inter... | Rust | 0 |
all.append(self.feature_all[-1])
self.feat_dim = self.feature_all[0].shape[1]
self.assign_feat_dim = self.assign_feat_all[0].shape[1]
def __len__(self):
return len(self.adj_all)
def __getitem__(self, idx):
adj = self.adj_all[idx]
num_nodes = adj.shape[0]
adj_pa... | Python | 1 |
from ortools.linear_solver import pywraplp
def main():
# Create the mip solver with the SCIP backend.
solver = pywraplp.Solver.CreateSolver('SCIP')
infinity = solver.infinity()
# x and y are integer non-negative variables.
x = solver.IntVar(3, infinity, 'x')
y = solver.IntVar(0, infinity, 'y'... | Python | 1 |
rogLoad {
prog_type,
insn_cnt: insn_cnt as u32,
insns: insns.as_ptr() as u64,
license: license.as_ptr() as u64,
kern_version: kernel_version,
#[cfg(feature = "log_buf")]
log_level: 1,
#[cfg(feature = "log_buf")]
log_size: *LOG_BUF_SIZE_BYTE as u32,... | Rust | 0 |
_all(match op {
U::Utild => b"~",
U::Unot => b"!",
U::Uplus => b"+",
U::Uminus => b"-",
U::Uincr => b"++",
U::Udecr => b"--",
U::Usilence => b"@",
U::Upincr | U::Updecr => {
return Err(Error::fail("string_of_uop - should have been captures earl... | Rust | 0 |
one,
})
}
fn try_fail() -> StdResult<HandleResponse> {
Err(StdError::generic_err("intentional failure"))
}
pub fn query<S: Storage, A: Api, Q: Querier>(
deps: &Extern<S, A, Q>,
msg: QueryMsg,
) -> StdResult<Binary> {
match msg {
QueryMsg::GetCount {} => to_binary(&query_count(... | Rust | 0 |
u.regs.pc);
24 /* Cycles */
} else {
cpu.regs.pc += 2;
12 /* Cycles */
}
}
/// -- Returns. --
/// **0xC0** - *RET nz* - Return if Z flag is reset
pub fn ret_nz(cpu: &mut CPU) -> u8 {
if !cpu.regs.get_flag_z() {
cpu.regs.pc = cpu.mem.read_short(cpu.regs.sp);
cpu.re... | Rust | 0 |
1-betarl)*log(INFCOR)=0;
KD-(1-delta_cd)*KD(-1)/MUK-ECD=0;
L*RCD-eta_cd/(KD(-1)/MUK-h_cd*LAGKD(-1)/(MUK(-1)*MUK))+beta_*eta_cd*h_cd/(KD-h_cd*KD(-1)/MUK)=0;
QCD-beta_*(1/EFFECD)*L(+1)/L/MUK(+1)*(RCD(+1)+(1-delta_cd)*QCD(+1))=0;
PKB-QCD*(1-100*phi_cd*(ECD-gam_icd*ECD(-1)-(1-gam_icd)*ECDSS)/KD(-1)*MUK) - beta_*(1/EFFE... | Rust | 0 |
)
headers = client._get_session().headers # pylint: disable=protected-access
assert "X-Apikey" in headers
assert "Accept-Encoding" in headers
assert "User-Agent" in headers
assert "foo" in headers
def test_wsgi_app(httpserver, monkeypatch):
app = wsgi_app.app
app.config.update({"TESTING": True})
... | Python | 1 |
from flask import Flask, request, jsonify, Response
from flask_cors import CORS
from config import GITHUB_MODELS_URL, GITHUB_MODELS_API_KEY, OLLAMA_URL, GITHUB_MODELS_MODEL
from openai import OpenAI
app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "http://localhost:5500"}})
def create_openai_client(s... | Python | 1 |
table.add_columns(
*self._transpose_columns(self.glider2d.shape.back_curve, "Back")
)
table.add_columns(
*self._transpose_columns(self.glider2d.shape.rib_distribution, "Dist")
)
table.add_columns(*self._transpose_columns(self.glider2d.aoa, "AOA"))
... | Python | 1 |
({'error': "Đang Login lại",
'msg':'Chờ login lại'})
return response
status_code= 0
# for index, item in enumerate(dulieugd["data"]["history"]):
# if item.get("remark") and str(sotin) in item["remark"]:
# print("Có Đơn Hàng nè Che... | Python | 1 |
"""
Term mapping tests.
"""
import html
from bs4 import BeautifulSoup
from lute.models.term import Term, TermTag
from lute.models.repositories import UserSettingRepository
from lute.db import db
def test_smoke_popup_response(client, empty_db, spanish):
"Misc data check - parent and tags are saved."
term = Te... | Python | 1 |
from typing import Dict, List, Optional, Union
import numpy as np
from edspdf import PDFDoc, Pipeline, registry
@registry.factory.register("random-classifier")
class RandomClassifier:
"""
Random classifier, for chaos purposes. Classifies each box to a random element.
Parameters
----------
pipel... | Python | 1 |
pub fn err13(&self) -> ERR13_R {
ERR13_R::new(((self.bits >> 13) & 0x01) != 0)
}
#[doc = "Bit 14 - Error In Channel 14"]
#[inline(always)]
pub fn err14(&self) -> ERR14_R {
ERR14_R::new(((self.bits >> 14) & 0x01) != 0)
}
#[doc = "Bit 15 - Error In Channel 15"]
#[inline(always)... | Rust | 0 |
u{0300}']),
(0x1fa1, &['\u{03C9}', '\u{0314}', '\u{0345}']),
(0x1e18, &['\u{0045}', '\u{032D}']),
(0xfa9b, &['\u{701E}']),
(0xfa80, &['\u{5A62}']),
(0xfacc, &['\u{983B}']),
(0x17a, &['\u{007A}', '\u{0301}']),
(0x1e3b, &['\u{006C}', '\u{0331}']),
(0x1e74, &['\u{0055}', '\u{0330}']),
(... | Rust | 0 |
n from_library<L>(library: L) -> Result<Self, ::libloading::Error>
where
L: Into<::libloading::Library>,
{
let __library = library.into();
let nvmlInit_v2 = __library.get(b"nvmlInit_v2\0").map(|sym| *sym);
let nvmlInitWithFlags = __library.get(b"nvmlInitWithFlags\0").map(|sym| *s... | Rust | 0 |
__enter__(self):
self._progress_bar.__enter__()
return self
def __exit__(self, exc_type, exc_value, traceback):
self._progress_bar.__exit__(exc_type, exc_value, traceback)
def Tick(self):
with self._lock:
self.completed += 1
self._progress_bar.SetProgress(self.completed / self.total)
... | Python | 1 |
from rest_framework.permissions import IsAuthenticated
from api.models.employee import Employee
from rest_framework import serializers
from rest_framework import viewsets
class EmployeeSerializer(serializers.ModelSerializer):
user__id = serializers.IntegerField(source='user.id')
user__first_name = serializers.... | Python | 1 |
"""RFC 3986 URI parsing and relative reference resolution / absolutization.
(aka splitting and joining)
Copyright 2006 John J. Lee <jjl@pobox.com>
This code is free software; you can redistribute it and/or modify it under
the terms of the BSD or ZPL 2.1 licenses (see the file LICENSE
included with the distribution).... | Python | 1 |
-windows-msvc` has `x86_64`.
///
/// [rfc]: https://github.com/rust-lang/rfcs/pull/2325
/// [tracked]: https://github.com/rust-lang/rust/issues/48556
///
/// # Overview
///
/// This module exposes vendor-specific intrinsics that typically correspond to
/// a single machine instruction. These intrinsics are not portable... | Rust | 0 |
mut f = File::open(file)?;
f.read_to_string(&mut res)?;
Ok(res)
}
/// Check if file extension is `.hyeong`
fn check_file(file: &str) -> bool {
file.rsplit(".").next() == Some("hyeong")
}
/// Read line from stdin
#[cfg_attr(tarpaulin, skip)]
pub fn read_line() -> String {
read_line_from(&mut std::io:... | Rust | 0 |
# Copyright 2021 Tencent
# SPDX-License-Identifier: BSD-3-Clause
import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self):
super(Model, self).__init__()
self.down_0 = nn.PixelUnshuffle(2)
self.down_1 = nn.PixelUnshuffle(4)
def forw... | Python | 1 |
ub const DIBUTTON_MECHA_WEAPONS: DWORD = 0x29000402;
pub const DIBUTTON_MECHA_TARGET: DWORD = 0x29000403;
pub const DIBUTTON_MECHA_REVERSE: DWORD = 0x29000404;
pub const DIBUTTON_MECHA_ZOOM: DWORD = 0x29000405;
pub const DIBUTTON_MECHA_JUMP: DWORD = 0x29000406;
pub const DIBUTTON_MECHA_MENU: DWORD = 0x290004FD;
pub con... | Rust | 0 |
pub struct ExchangeKamaModifiedMessage<'a> {
pub base: ExchangeObjectMessage<'a>,
#[protocol(var)]
pub quantity: u64,
}
#[derive(Clone, PartialEq, Debug, Encode, Decode)]
#[protocol(id = 6020)]
pub struct ExchangeMultiCraftCrafterCanUseHisRessourcesMessage<'a> {
pub allowed: bool,
pub _phantom: std... | Rust | 0 |
# 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 |
of prediction
num_bins: int
Number of groups of interval widths
alpha: float
The risk level
title: str
Title of the plot
ax: matplotlib axes
An ax can be provided to include this plot in a subplot
"""
if ax is None:
fig, ax = plt.subplots(figsize=(6, 5))
... | Python | 1 |
BlendLinearGradient(rs_script script, rs_allocation in, rs_allocation inBlurred, rs_allocation out) {
gScript = script;
gIn = in;
gInBlurred = inBlurred;
gOut = out;
gBmpWidth = rsAllocationGetDimX(gIn);
gBmpHeight = rsAllocationGetDimY(gIn);
gCenter[0] = gBmpWidth / 2.0f;
gCenter[1] = gBmpHeight / 2.0f;
}
vo... | Rust | 0 |
.unwrap()]);
let commitment = KeysetCommitment::embed_commit(
&mut KeysetContainer {
pubkey,
keyset,
tag,
tweaking_factor: None,
},
&msg,
)
.unwrap();
assert_eq!(
commitment.a... | Rust | 0 |
ae:be:3c:30:23:37:41:06:64:b5:55:69:4d:04:a2:35:21:36:2d:c3",
/// pubkey.fingerprint::<Sha256>().expect("Could not take fingerprint of pubkey."));
/// ```
fn from(pair: &X25519Private) -> Self {
Self(DalekPublicKey::from(&pair.0))
}
}
impl From<&X25519EphemeralPrivate> for X25519Publ... | Rust | 0 |
e # if failed it was in write
except:
why = sys.exc_info()[1]
log.msg('Error In %s' % source)
log.deferr()
if why:
self._disconnectSelectable(source, why, didRead == source.doRead)
def callback(self, source, condition):
log.callWithLogger... | Python | 1 |
import pandas as pd
df = pd.read_csv('./tiktok_app_reviews.csv',
usecols=['app_version', 'review_text'])
df = df.dropna()
df['review_text'] = df.review_text.str.replace('[^a-zA-Z 0-9]', '')
df.to_csv('tiktok_parsed.csv', header=True, index=False)
| Python | 1 |
6usize] = b"IMPORT_AC_SEPARATE_BFCULL\0";
pub const AI_CONFIG_IMPORT_AC_EVAL_SUBDIVISION: &[u8; 27usize] = b"IMPORT_AC_EVAL_SUBDIVISION\0";
pub const AI_CONFIG_IMPORT_UNREAL_HANDLE_FLAGS: &[u8; 20usize] = b"UNREAL_HANDLE_FLAGS\0";
pub const AI_CONFIG_IMPORT_TER_MAKE_UVS: &[u8; 20usize] = b"IMPORT_TER_MAKE_UVS\0";
pub c... | Rust | 0 |
an existing account or customer tax_id object.
"""
...
@overload
async def delete_async(
self, **params: Unpack["TaxId.DeleteParams"]
) -> "TaxId":
"""
Deletes an existing account or customer tax_id object.
"""
...
@class_method_variant("_cls_del... | Python | 1 |
on sdmmc1
// dp.SDMMC1.power.write(|w| unsafe { w.pwrctrl().bits(0b11) });
let dcmi = dp.DCMI;
let dma = dp.DMA2;
(
(led_red, led_green, led_blue),
led_infrared,
delay_source,
i2c1_port,
dcmi_ctrl_pins,
dcmi_data_pins,
// sdio_ctrl_pins,
... | Rust | 0 |
::get_sprite(),
gba::sprites::get_sprite(),
gba::sprites::get_sprite(),
gba::sprites::get_sprite(),
gba::sprites::get_sprite(),
gba::sprites::get_sprite(),
gba::sprites::get_sprite(),
gba::sprites::get_sprite... | Rust | 0 |
0, 50.0)} size={(300.0, 150.0)} title={"State Example".to_string()}>
<Text size={16.0} content={format!("Current Count: {}", count)} />
<Button on_event={Some(on_event)}>
<Text line_height={Some(40.0)} size={24.0} content={"Count!".to_string()} />
</Button>
<... | Rust | 0 |
SErrorFromPeer::Client(_)) => {
let mut errors = vec![client_err];
transfer(client, server);
let server_err = server
.process_new_packets()
.map_err(|err| TLSErrorFromPeer::Server(err))
.expect_err("server didn't produce error after cli... | Rust | 0 |
case::cm("Cmin", C, None, true),
case::cs("C#", C, Some(Sharp), false),
case::csm("C#min", C, Some(Sharp), true),
case::db("Db", D, Some(Flat), false),
case::dbm("Dbmin", D, Some(Flat), true),
case::d("D", D, None, false),
case::dm("Dmin", D, None, true),
case::d... | Rust | 0 |
p)))?
} else {
(i, None)
};
Ok((
remaining,
MaterialFragment {
flags,
params1,
params2,
params3,
reference,
pair,
},
))
}
}
#[derive(Debug... | Rust | 0 |
# Tag: Array, Two Pointers, Sorting
# Time: O(N)
# Space: O(1)
# Ref: -
# Note: -
# Given an array of integers nums, half of the integers in nums are odd, and the other half are even.
# Sort the array so that whenever nums[i] is odd, i is odd, and whenever nums[i] is even, i is even.
# Return any answer array ... | Python | 1 |
tribution was downloaded for this requirement.
return
download_location = os.path.join(self.download_dir, link.filename)
if not os.path.exists(download_location):
shutil.copy(req.local_file_path, download_location)
download_path = display_path(download_location)
... | Python | 1 |
let masks_with_probabilities = self
.remaining
.iter()
.map(|(future_guess, future_occurrence_count)| {
(
future_occurrence_count,
Correctness::check(word, &future_guess),
)
... | Rust | 0 |
ropRate2 = 5,
float11 = 0.9,
float12 = 1.1,
flags = 'MS',
name = '魔腦體',
description = '以導力裝置做為食物的\n新種浮游軟體魔獸。\n會到處潑灑酸性體液,\n連鋼鐵都能融解。',
),
StatusTableData(
algo... | Python | 1 |
import re
from scapy.all import sniff, Raw
def detect_xss(packet):
if packet.haslayer(Raw):
payload = packet.getlayer(Raw).load.decode(errors="ignore")
xss_patterns = [
r"<script.*?>.*?</script>", # Script tag with content
r"javascript:", # Javascript pseudo-pr... | Python | 1 |
);
let buf_as_bytes = unsafe { slice::from_raw_parts(ptr as *mut wchar_t, LINE_MAX) };
for (idx, &byte) in buf_as_bytes.iter().enumerate() {
if byte == 0x00 {
return Ok(WideString::from(&buf_as_bytes[..idx]));
}
... | Rust | 0 |
head {
acm = res.headers.get("Allow").clone().unwrap_or(&inv_head);
}
return if acao != &inv_head && acm != &inv_head {
if acm.contains(method.into().to_ascii_uppercase().as_str()) {
if acao == &String::from("*") {
(true, None)
} else {
(f... | Rust | 0 |
st_pos = pos2(left, column_bbs[0].bottom() + spacing);
for col_bb in &column_bbs {
let col_pos = pos2(col_bb.left(), col_bb.bottom() + spacing);
if col_pos.y < best_pos.y {
best_pos = col_pos;
}
}
best_pos
}
use std::time::Duration;
use getset::{Getters, MutGetters, Sett... | Rust | 0 |
parse source").into_env();
let inc = Fun::new(move |args, def| {
let mut r = 0.;
for n in args.iter() {
if let Ok(v) = n.get_num(def) {
r += v;
}
}
return Some(Var::Num(r))
});
env.fun.insert("inc".to_owned(), inc);
let ev = ... | Rust | 0 |
# Natural Language Toolkit: Interface to TADM Classifier
#
# Copyright (C) 2001-2024 NLTK Project
# Author: Joseph Frazee <jfrazee@mail.utexas.edu>
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
import subprocess
import sys
from nltk.internals import find_binary
try:
import numpy
excep... | Python | 1 |
1)))});
channel_data = match enable_channel(pin) {
Ok(value) => value,
Err(error) => return Err(error)
};
},
_ => unreachable!()
};
return Ok(Pin {
block: pin.0,
number: pin.1,
inner: Analog {
core: channel_data.0,
channel: channel_data.1
}
});
}
... | Rust | 0 |
LED,
ColorCode::Text => COLOR_TEXT,
ColorCode::ProgressBack => COLOR_PROGRESS_BACK,
ColorCode::ProgressFore => COLOR_PROGRESS_FORE,
ColorCode::ProgressText => COLOR_PROGRESS_TEXT,
}
}
}
pub type Color = (u8, u8, u8, u8);
const COLOR_BACKGROUND: usize = 0;
con... | Rust | 0 |
_VEF_P0P1_g_P_TOT1.son')
values['dptrust3'] = dPtrust('PAR_VEF_P0P1_g_P_TOT2.son')
values['ptrustmoyinlet'] = dPtrustmoy('PAR_VEF_P0P1_g_MEAN_P_TOT_INLET.son')
values['ptrustmoyoutlet'] = dPtrustmoy('PAR_VEF_P0P1_g_MEAN_P_TOT_OUTLET.son')
# values['dptrustmoy2'] = dPtrustmoy('PAR_VEF_P0P1_g_DELTA_P_TO... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.