text string | label_name string | labels int64 |
|---|---|---|
# pylint: disable=too-many-arguments
# pylint: disable=arguments-differ
return super().plot_eigval_hist(
bins=bins,
interval=interval,
density=density,
normalize=normalize,
savefig_path=savefig_path,
avoid_img=True,
... | Python | 1 |
# order_processing.py
import uuid
from pepecoin_rpc import PepecoinRPC
# Initialize RPC client (same as before)
rpc_user = "your_rpc_username"
rpc_password = "your_rpc_password"
pepecoin_rpc = PepecoinRPC(rpc_user, rpc_password)
def create_order(amount_due, metadata=None):
# Generate a unique order ID
order_... | Python | 1 |
authority: &Pubkey,
) -> (Pubkey, u8) {
Pubkey::find_program_address(
&[b"record_factory", tag.as_ref(), authority.as_ref()],
program_id,
)
}
pub fn get_tag_record_factory_program_address_seeds<'a>(
tag: &'a Pubkey,
authority: &'a Pubkey,
bump_seed: &'a [u8; 1],
) -> [&'a [u8]; 4] {... | Rust | 0 |
x1a | 0x1e | 0x1f | 0x2e /* Nehalem */ =>
X86Microarch::INTEL_NEHALEM,
0x25 | 0x2c | 0x2f /* Westmere */ =>
X86Microarch::INTEL_WESTMERE,
0x2a| /* Sandy Bridge */
0x2d /* Sandy Bridge EP */ =>
X86Microarch::INTEL... | Rust | 0 |
= "0: No interrupt pending"]
P4IV_0 = 0,
#[doc = "2: Interrupt Source: Port 4.0 interrupt; Interrupt Flag: P4IFG0; Interrupt Priority: Highest"]
P4IV_2 = 2,
#[doc = "4: Interrupt Source: Port 4.1 interrupt; Interrupt Flag: P4IFG1"]
P4IV_4 = 4,
#[doc = "6: Interrupt Source: Port 4.2 interrupt; I... | Rust | 0 |
this could make your application waste CPU
//! resources that could otherwise be put to good use by other applications.
//!
//! When might this be useful?
//!
//! - Running async applications on a platform that doesn't have an executor
//! - Testing that an async crate works with `no_std`
//! - Educational purposes?
/... | Rust | 0 |
anArray is used to feed the parser with tokens.
struct TokenAndSpanArray<'a>
{
sp_diag: &'a rust::Handler,
tokens: Vec<TokenAndSpan>,
current_idx: usize
}
impl<'a> TokenAndSpanArray<'a> {
fn new(sp_diag: &'a rust::Handler, tokens: Vec<TokenAndSpan>)
-> TokenAndSpanArray<'a>
{
TokenAndSpanArray {
... | Rust | 0 |
isinstance(x, np.ndarray):
assert x.size == 1
return x[0]
elif np.isscalar(x):
return x
else:
raise ValueError('expected scalar, got %s'%x)
combined_stats_sums = MPI.COMM_WORLD.allreduce(np.array([ np.array(x).flatten()[0] ... | Python | 1 |
_pos: Vec2,
pub title: String, // "Vulkan Example"
pub name: String, // "vulkanExample"
pub api_version: u32,
pub depth_stencil: (VkImage, VkDeviceMemory, VkImageView), // (image, mem, view)
pub game_pad_state: (Vec2, Vec2),
pub mouse_buttons: Buttons,
// Platform Specific
pub quit: bo... | Rust | 0 |
extern crate serde_derive;
extern crate actix;
extern crate actix_web;
#[macro_use]
extern crate dotenv_codegen;
extern crate env_logger;
extern crate log;
extern crate actix_http;
use actix_cors::Cors;
use actix_identity::{CookieIdentityPolicy, IdentityService};
use actix_web::http::header;
use actix_web::middle... | Rust | 0 |
Vector3<f32>,
}
impl ColorCieLab {
pub fn l(&self) -> f32 {
self.values[0]
}
pub fn a(&self) -> f32 {
self.values[1]
}
pub fn b(&self) -> f32 {
self.values[2]
}
pub fn values(&self) -> &Vector3<f32> {
&self.values
}
pub const fn new(l: f32, a: f32, ... | Rust | 0 |
_covered_by_impl<'a, I>(&self, prefixes: I, max_prefix_len: usize) -> bool
where
I: IntoIterator<Item = &'a Self> + Clone,
{
prefixes
.clone()
.into_iter()
.any(|x| x.is_compatible(self) && x.bit_count() <= self.bit_count())
|| (self.bit_count() <=... | Rust | 0 |
sync fn reconcile(
pod: Pod,
ctx: Context<SpawnerSettings>,
) -> Result<ReconcilerAction, IdlePodCollectorError> {
tracing::info!("reconcile called for pod: {}", pod.name());
let ctx = ctx.get_ref();
let pod_id =
PodId::from_prefixed_name(&pod.name()).ok_or(IdlePodCollectorError::Unexpected... | Rust | 0 |
@staticmethod
def add_difference(theta0, theta1, theta2, alpha):
return theta0 + (theta1 - theta2) * (1.0 - alpha)
| Python | 1 |
_clk == self.i2s_ckin;
let pll_i2s_clk = if i2s_apb1_ext {
None
} else {
self.i2s_apb1_clk
};
let pll_i2s_clk2 = if i2s_apb2_ext {
None
} else {
self.i2s_apb2_clk
};
if pll_i2s_clk.is_some() && pll_i2s_clk2.is_some()... | Rust | 0 |
]
#취소 후 체결내역 확인하여, 거래 사이즈 더하기
upbit_transaction = order_status['trades']
for contract in upbit_transaction:
upbit_size += float(contract['funds']) # 재주문없이 한번에 거래가된 경우
time.sleep(time_sleep)
upbit_orderbook = pyupbit.get_orderbook(f"KRW-{coi... | Python | 1 |
# coding:utf-8
import requests
from lib.core.common import url_handle
from lib.core.poc import POCBase
# ...
import urllib3
urllib3.disable_warnings()
class POC(POCBase):
_info = {
"author" : "Du9r1", # POC作者
"version" : "1", # POC版本,默认是1
"CreateDate"... | Python | 1 |
"""
20. Multiple many-to-many relationships between the same two tables
In this example, an ``Article`` can have many "primary" ``Category`` objects
and many "secondary" ``Category`` objects.
Set ``related_name`` to designate what the reverse relationship is called.
"""
from django.db import models
class Category(m... | Python | 1 |
an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#[macro_use]
extern crate serial_test_derive;
use pkcs11::*;
use pkcs11::types::*;
use ehsm::*;
const SU_PIN: &str = ... | Rust | 0 |
class Allocator:
def __init__(self, n: int):
self.memory = [0] * n
self.mIDToIndices = [[] for _ in range(1001)]
def allocate(self, size: int, mID: int) -> int:
consecutiveFree = 0
for i, m in enumerate(self.memory):
consecutiveFree = consecutiveFree + 1 if m == 0 else 0
if consecutiveF... | Python | 1 |
from subprocess import TimeoutExpired
import mock
import pytest
from uaclient import exceptions
from uaclient.daemon import start, stop
M_PATH = "uaclient.daemon."
@mock.patch(M_PATH + "system.subp")
class TestStart:
def test_start_success(self, m_subp):
start()
assert [
mock.call(
... | Python | 1 |
::uninit();
sys::nvpair_value_int32(self.as_ptr(), v.as_mut_ptr());
v.assume_init()
};
NvData::Int32(v)
}
sys::data_type_t::DATA_TYPE_UINT32 => {
let v = unsafe {
let mut v = MaybeUninit:... | Rust | 0 |
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
import gymnasium as gym
from . import agents
##
# Register Gym environments.
##
gym.register(
id="Template-Twor-Externa... | Python | 1 |
gen
} else {
println!(
"{}Starting with a population of {}{}",
GREEN!(),
self.properties.total_pop.unwrap(),
RESET!()
);
0
};
println!("");
... | Rust | 0 |
s = status + 1
print_vels(target_linear_velocity_x, target_angular_velocity, target_linear_velocity_y)
elif key == 'j':
target_linear_velocity_y =\
check_linear_limit_velocity(target_linear_velocity_y - LIN_VEL_STEP_SIZE)
status = status + ... | Python | 1 |
b const WEBVIEW_NAV_ERR_OTHER: c_int = 0 + 7;
// ENUM: wxWebViewReloadFlags
pub const WEBVIEW_RELOAD_DEFAULT: c_int = 0;
pub const WEBVIEW_RELOAD_NO_CACHE: c_int = 0 + 1;
// ENUM: wxWebViewFindFlags
pub const WEBVIEW_FIND_WRAP: c_int = 0x0001;
pub const WEBVIEW_FIND_ENTIRE_WORD: c_int = 0x0002;
pub const WEBVIEW_FIND... | Rust | 0 |
b fog_report_url: String,
/// Fog report id
#[prost(string, tag = 3)]
pub fog_report_id: String,
/// Fog authority subjectPublicKeyInfo
#[prost(bytes, tag = 4)]
pub fog_authority_spki: Vec<u8>,
}
impl RootIdentity {
/// Generate a random root identity with a specific fog_report_url configur... | Rust | 0 |
);
self.sign = if positive { Sign::Positive } else { Sign::Negative };
self
}
}
macro_rules! impl_op {
($($assign_trait:ident $assign_fn:ident, $checked_trait:ident $checked_fn:ident = $op_trait:ident $op_fn:ident),*) => {
$(
impl $checked_trait for BigInt {
... | Rust | 0 |
alse,
help=r"""
Use this flag to cast video to your Google cast devices. It is only working
with ffmpeg.
Examples:
Cast a file:
python mkchromecast.py --video -i "/path/to/file.mp4"
Cast from source-url:
python mkchromecast.py --source-url http://commondatastorage.googleapis.c... | Python | 1 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2023/3/5 18:12
Desc: 百度股市通-外汇-行情榜单
https://gushitong.baidu.com/top/foreign-common-%E5%B8%B8%E7%94%A8
"""
import http.client
import json
import urllib
import pandas as pd
def fx_quote_baidu(symbol: str = "人民币") -> pd.DataFrame:
"""
百度股市通-外汇-行情榜单
http... | Python | 1 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
import argparse
def get_args_from_command_line():
"""
config the parameter
"""
parser = argparse.ArgumentParser(description="The argument parser of R2Net runner")
# choose model
parser.add_argument("--model", ... | Python | 1 |
fn _dummy_loader() -> JsValue;
}
loader_hack!(Tab);
/// The `mwc-tab` component
///
/// [MWC Documentation](https://github.com/material-components/material-components-web-components/tree/master/packages/tab)
pub struct MatTab {
props: TabProps,
node_ref: NodeRef,
interacted_listener: Option<EventListener... | Rust | 0 |
# Copyright 2020 The Texar 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 applicable ... | Python | 1 |
// hotplug function isn't verified on AArch64, so set it unsupported here.
Err(Error::Unsupported)
}
}
impl AArch64 {
/// This returns a base part of the kernel command for this architecture
fn get_base_linux_cmdline() -> kernel_cmdline::Cmdline {
let mut cmdline = kernel_cmdline::Cm... | Rust | 0 |
# Copyright 2023 Hathor Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Python | 1 |
392080ff519ab6209431f81b50ec03");
}
#[test]
fn test_mnt4_753_pairing() {
use crate::field::U768Repr;
let modulus = BigUint::from_str_radix("418984909679189534023442147912406371281707099199539490717835029210253528125711067730588937637903389214180709718882537861143537265295843852015916057220... | Rust | 0 |
) $($predicate: pat)|* => $function: expr ),* $(,)?) => {
&[ $( InfixParselet {
precedence: get_binary_precedence($precedence),
predicate: |token| matches!(token.data, $($predicate)|*),
function: $function
} ),* ]
} }
use TokenData::*;
ifx! [
(LeftParen... | Rust | 0 |
OnDrop;
use crate::{dictionary, Error, Result, Type};
use std::{fmt, ops::Deref, str};
/// the maximum authorized value for a mnemonic. i.e. 2047
pub const MAX_MNEMONIC_VALUE: u16 = 2047;
/// Safe representation of a valid mnemonic index (see
/// [`MAX_MNEMONIC_VALUE`](./constant.MAX_MNEMONIC_VALUE.html)).
///
/// S... | Rust | 0 |
import sys
def generate_primes(n_max):
primes = []
for i in range(2, n_max + 1):
is_prime = True
for j in range(2, int(i ** 0.5) + 1):
if i % j == 0:
is_prime = False
break
if is_prime:
primes.append(i)
return primes
def get_p... | Python | 1 |
s for individual operations; use a unique hash of the
# arguments to avoid conflicts between multiple calls
unique = hash_args(year, node, exclude)[:6]
k = KeySeq(f"message sankey {unique}")
# Concatenate 'out' and 'in' data
self.add(k[0], "concat", "out::pyam", "in::pyam", stri... | Python | 1 |
mut hash = sha3::Sha3_256::new();
hash.update(ciphertext.nonce.mul(self.0).compress().as_bytes());
hash.update(ciphertext.tag.compress());
let key = hash.finalize().to_vec();
let secret_box = SecretBox::new(key, Salsa20).unwrap();
match secret_box.unseal(ciphertext.ciphertext.as... | Rust | 0 |
swcify;
pub mod cmd;
mod utils;
use crate::utils::Cmd;
use clap::{Parser, Subcommand};
use cmd::prove::ProveArgs;
use cmd::verify::VerifyArgs;
#[derive(Debug, Parser)]
#[clap(name = "giza")]
pub struct Opts {
#[clap(subcommand)]
pub sub: Subcommands,
}
#[derive(Debug, Subcommand)]
#[allow(clippy::large_enum... | Rust | 0 |
ectRef) {
let ctx = &vm.ctx;
extend_module!(vm, module, {
"closesocket" => ctx.new_rustfunc(multiprocessing_closesocket),
"recv" => ctx.new_rustfunc(multiprocessing_recv),
"send" => ctx.new_rustfunc(multiprocessing_send),
})
}
#[cfg(not(windows))]
fn extend_module_platform_specific(... | Rust | 0 |
me, tool_server_port
)
final_tools[tool.name] = tool_fn
except Exception:
print("Failed to fetch MCP tools")
print(traceback.format_exc())
pass
agent_cards = []
try:
async with httpx.AsyncClient(timeout=10) as client:
respo... | Python | 1 |
#[doc = "Checks if the value of the field is `VALUE1`"]
#[inline(always)]
pub fn is_value1(&self) -> bool {
*self == CHPND1_A::VALUE1
}
#[doc = "Checks if the value of the field is `VALUE2`"]
#[inline(always)]
pub fn is_value2(&self) -> bool {
*self == CHPND1_A::VALUE2
}
}
... | Rust | 0 |
ricParam, Generics, Meta,
NestedMeta,
};
fn visit_fn_name(is_mut: bool) -> syn::Ident {
if is_mut {
Ident::new("visit_mut", Span::call_site())
} else {
Ident::new("visit", Span::call_site())
}
}
fn maybe_mut(is_mut: bool) -> TokenStream {
let maybe_mut: Vec<syn::token::Mut> = if is... | Rust | 0 |
t StartWith<T> {
stream: Pin<Box<dyn Stream<Item = T>>>,
initial_value: Option<T>
}
}
// Trait to combine two streams, yielding a new stream with a tuple of their latest values
pub trait LiftStreamExt {
type A;
type B;
fn lift(self) -> Lift<Self::A, Self::B>;
}
impl<A, B, T, U> LiftSt... | Rust | 0 |
peers: params.network_config.in_peers,
out_peers: params.network_config.out_peers,
bootnodes,
reserved_only: params.network_config.non_reserved_mode == NonReservedPeerMode::Deny,
reserved_nodes,
};
// Private and public keys configuration.
if let NodeKeyConfig::Secp256k1(_) = params.network_config.no... | Rust | 0 |
let (key_len, key) = into_cstring(request.key.unwrap_or_default());
let key = lcb_KEYBUF {
type_: lcb_KVBUFTYPE_LCB_KV_COPY,
vbid: 0,
contig: lcb_CONTIGBUF {
bytes: key.as_ptr() as *const c_void,
nbytes: key_len,
},
};
let command = lcb_CMDSTATS... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 31 14:02:26 2017
@author: Yooyeon
"""
import generate as g
import svm_yooyeon as s
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import numpy as np
X1,y1,X2,y2 = g.gen_lin_separable_overlap_data()
X_train, y_train, X_test, y_test = g.split... | Python | 1 |
SEVERITY_NONLOCALIZED = ord("V")
SQLSTATE = ord("C")
MESSAGE_PRIMARY = ord("M")
MESSAGE_DETAIL = ord("D")
MESSAGE_HINT = ord("H")
STATEMENT_POSITION = ord("P")
INTERNAL_POSITION = ord("p")
INTERNAL_QUERY = ord("q")
CONTEXT = ord("W")
SCHEMA_NAME = ord("s")
TABLE_NAME = ord("t... | Python | 1 |
convert_all_call,
r#"
fn main() {
let it = core::iter::repeat(92);
let mut a = true;
it.for_each$0(|x| {
a &= x > 0;
});
}"#,
r#"
fn main() {
let it = core::iter::repeat(92);
let mut a = true;
a &= it.all(|&x| x > 0);
}"#,
)
}
}
<filename>src/... | Rust | 0 |
alarStuffAddMaybeU16(builder, self.maybeU16)
ScalarStuffAddDefaultU16(builder, self.defaultU16)
ScalarStuffAddJustI32(builder, self.justI32)
ScalarStuffAddMaybeI32(builder, self.maybeI32)
ScalarStuffAddDefaultI32(builder, self.defaultI32)
ScalarStuffAddJustU32(builder, self.justU... | Python | 1 |
nt of text output.
}
self.company = company
self.custom_rules = custom_rules or []
def get_response(
self,
user_input: str,
persona: str,
user_context: str = "",
include_context: bool = True,
) -> Tuple[StreamingResponse, str, str]:
respo... | Python | 1 |
# Copyright 2019 Komit Consulting - Duc Dao Dong
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Stock Landed Costs Currency",
"version": "16.0.1.0.0",
"author": "Komit Consulting, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Stock Accounting",
... | Python | 1 |
map(|reason| format!("{} (from clippy.toml)", reason)),
),
};
let segs: Vec<_> = path.split("::").collect();
match clippy_utils::path_to_res(cx, &segs) {
Res::Def(_, id) => {
self.def_ids.insert(id, reason);
},
... | Rust | 0 |
def find_disappeared_numbers(nums):
n = len(nums)
complete_set = set(range(1, n + 1))
nums_set = set(nums)
missing_numbers = list(complete_set - nums_set)
return missing_numbers
nums1 = [4, 3, 2, 7, 8, 2, 3, 1]
print(find_disappeared_numbers(nums1)) # Output: [5, 6]
nums2 = [1, 1]
print(find_dis... | Python | 1 |
t='data')
parser.add_argument('--start_time', help='Initial timestamp value for the generating the series (ISO 8601 format, example: "2025-01-06T12:00:00")', default=datetime.now())
# Example: python src/simulator.py --nb_activities 1000 --n_legitimate_agent 3 --n_fraudulent_agent 1 --pr_fraud 0.3
start_tim... | Python | 1 |
- [X] With diacritics
pub const KATA_A: &str = "\u{30a2}"; // ア
pub const KATA_SMALL_A: &str = "\u{30a1}"; // ァ
pub const KATA_I: &str = "\u{30a4}"; // イ
pub const KATA_SMALL_I: &str = "\u{30a3}"; // ィ
pub const KATA_U: &str = "\u{30a6}"; // ウ
pub const KATA_SMALL_U: &str = "\u{30a5}"; // ゥ
pub const KATA_E: &str = "... | Rust | 0 |
reset(&mut self) -> FB_C16_DOMAIN_SW_RESET_W {
FB_C16_DOMAIN_SW_RESET_W { w: self }
}
#[doc = "Bit 5 - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
#[inline(always)]
pub fn fb_c21_domain_sw_reset(&mut self) -> FB_C21_DOMAIN_SW_RESET_W {
FB_C21_DOMAIN_SW_RESET_W { w... | Rust | 0 |
")]
pub unsafe fn create_surface<E: EntryV1_0, I: InstanceV1_0>(
entry: &E,
instance: &I,
raw_window_handle: &raw_window_handle::RawWindowHandle
) -> Result<vk::SurfaceKHR, vk::Result> {
match raw_window_handle {
raw_window_handle::RawWindowHandle::MacOS(window_handle) => {
use std:... | Rust | 0 |
ation starts' )
ncycles = 0
for i in range( nports ):
net.send[i].rdy @= 1 # Always ready
# Inject a packet to port 0
net.recv[0].val @= 1
while not net.recv[0].rdy:
if opts.trace:
print( f'{ncycles:3}: {net.line_trace()}' )
net.sim_tick()
ncycles += 1
pkt_opts = deepcopy( opts )
... | Python | 1 |
ed: &str,
) -> std::fmt::Result {
match self {
PatternError::BellOutOfStage(bell, stage) => {
write!(f, "bell {} is out of stage {}", bell, stage)
}
PatternError::DuplicateBell(bell) => write!(f, "bell {} appears twice", bell),
PatternError::To... | Rust | 0 |
path)?);
// let f = try!(File::open(path));
// ~ let coded = json::from_reader(&mut buf).unwrap();
// ~ let mut decoder =json::Decoder::new(coded);
// ~ let frames: Vec<Frame> = Decodable::decode(&mut decoder).unwrap();
let ext: Option<&str> = path.extension().and_then(|s| s.to_str());
if ext... | Rust | 0 |
from .. import Provider as PhoneNumberProvider
class Provider(PhoneNumberProvider):
formats = (
"01 #### ###",
"020 ### ###",
"021 ### ###",
"022 ### ###",
"023 ### ###",
"031 ### ###",
"032 ### ###",
"033 ### ###",
"034 ### ###",
"03... | Python | 1 |
# Generated by Django 4.2.11 on 2024-04-14 18:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum_polls', '0003_topicpoll_hide_results'),
]
operations = [
migrations.AlterField(
model_name='topicpoll',
name=... | Python | 1 |
93, 0x14,// VEX_Vphaddsw_xmm_xmm_xmmm128
0x29,// VHW_2
0x6D,// YMM0
0x94, 0x14,// VEX_Vphaddsw_ymm_ymm_ymmm256
0x00,// Invalid
0x00,// Invalid
// 4 = 0x04
0x0B,// MandatoryPrefix2_4
0x00,// Invalid
0x0E,// VectorLength
0x29,// VHW_2
0x4D,// XMM0
0x97, 0x14,// VEX_Vpmaddubsw_xmm_xmm_xmmm... | Rust | 0 |
W
("pluse", "\u{2A72}"), // PLUS SIGN ABOVE EQUALS SIGN
("plusmn", "\u{00B1}"), // PLUS-MINUS SIGN
("plussim", "\u{2A26}"), // PLUS SIGN WITH TILDE BELOW
("plustwo", "\u{2A27}"), // PLUS SIGN WITH SUBSCRIPT TWO
("pointint", "\u{2A15}"), // INTEGRAL AROUND A POINT OPERATOR
("popf", "\u{1D561}"... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright (c) 2009 - 2010 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing a scheme access handler for QtHelp.
"""
from SchemeAccessHandler import SchemeAccessHandler
from NetworkReply import NetworkReply
class QtHelpAccessHandler(SchemeAccessHandler):
"""
Cla... | Python | 1 |
len,
}
}
fn show_extra_hints(
palette: Palette,
text_with_style: Vec<(&str, StatusBarTextColor, StatusBarTextBoldness)>,
) -> LinePart {
use StatusBarTextBoldness::*;
use StatusBarTextColor::*;
// get the colors
let white_color = palette_match!(palette.white);
let green_color = palette_... | Rust | 0 |
", dec_to_string(&dec_exp(&dec_from_string("4"))));
assert_eq!("148.4131591025766034211155800405523", dec_to_string(&dec_exp(&dec_from_string("5"))));
assert_eq!("162754.7914190039208080052048984868", dec_to_string(&dec_exp(&dec_from_string("12"))));
}
#[test]
fn test_dec_from_i32() {
assert_eq!("-1"... | Rust | 0 |
size(&self) -> u32 {
let mut my_size = 0;
if let Some(ref v) = self.challenge.as_ref() {
my_size += ::protobuf::rt::bytes_size(10, &v);
}
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
... | Rust | 0 |
Blank(AboutBlankProblem),
/// `type = "https://docs.rs/htrpc/0.0.2/htrpc/rfc7807/struct.TrackableProblem.html"`.
#[serde(rename = "https://docs.rs/htrpc/0.0.2/htrpc/rfc7807/struct.TrackableProblem.html")]
Trackable(TrackableProblem),
}
impl Problem {
/// Makes a new `AboutBlankProblem` problem.
pub... | Rust | 0 |
} else {
bail!("unexpected path");
};
#[derive(serde::Deserialize, Default)]
struct SearchParams {
class: Option<String>,
}
let search_params: Option<SearchParams> = if let Some(query) = request.uri().query() {
Some(serde_urlencoded::from_str(query)?)
} else {
None
};
let mut db = match context.databas... | Rust | 0 |
<T>> for Srgba<U>
where
T: FloatComponent,
U: Component + FromComponent<T>,
{
fn from(lin_srgb: LinSrgb<T>) -> Self {
let non_lin = Srgb::<T>::from_linear(lin_srgb);
let new_fmt = Srgb::<U>::from_format(non_lin);
new_fmt.into()
}
}
impl<T, U> From<LinSrgba<T>> for Srgba<U>
where... | Rust | 0 |
// product <- unary ((STAR / SLASH) unary)*
pub fn make_product_parser<'a>() -> impl Parser<'a, Ast> {
cmb::bind(make_unary_parser(), move |first| {
cmb::map(
cmb::zero_or_more(cmb::bind(
cmb::or(make_star_parser(), make_slash_parser()),
move |operator| {
... | Rust | 0 |
).as_slice()[0..128].to_vec();
let p_mul = p.mul(dee::Affine::endo_rep_to_scalar(bits.clone()).unwrap());
let pe_mul = p.endo_mul(bits.clone()).unwrap();
assert_eq!(p_mul, pe_mul);
}
}
#[test]
fn test_dum_endo_mul() {
for _ in 0..100 {
let p = dum::Projective::rand(&mut thread... | Rust | 0 |
.
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, Serialize, Deserialize)]
pub struct ElemIndex(u32);
entity_impl!(ElemIndex);
/// Index type of a type inside the WebAssembly module.
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, Serialize, Deserialize)]
pub struct TypeIndex(u32)... | Rust | 0 |
fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<
_,
::protobuf::types::ProtobufTypeUint64,
>(
"pkts",
|m: &GetModuleInfoResponse_IGate| &m.pkts,
|m: &mut GetModuleInfoResponse_IGate| &mut m.pk... | Rust | 0 |
(unused_imports)]
use libc::{c_char, c_int, c_ushort, c_void};
#[cfg(unix)]
pub use libc::passwd;
#[cfg(all(not(unix), feature = "dox"))]
#[repr(C)]
pub struct passwd {
pw_name: *mut c_char,
pw_passwd: *mut c_char,
pw_uid: u32,
pw_gid: u32,
pw_gecos: *mut c_char,
pw_dir: *mut c_char,
pw_sh... | Rust | 0 |
result[collection_id] = dict()
collection_content = json.loads(collection_file_path.read_text())
for term_specs_from_collection in collection_content[settings.COLLECTION_TERM_SPECS_LIST_NODE_NAME]:
term_id = term_specs_from_collection.pop(settings.ID_NODE_NAME)
data_descrip... | Python | 1 |
} else {
EdwardsFlags::NegativeY
}
}
#[inline]
pub fn is_positive(&self) -> bool {
match self {
EdwardsFlags::PositiveY => true,
EdwardsFlags::NegativeY => false,
}
}
}
impl Default for EdwardsFlags {
#[inline]
fn default() -> ... | Rust | 0 |
datasets import load_dataset
dataset_path = MAPPING_DATASET_NAME_TO_ID[dataset_name.lower()]
corpus = load_dataset(dataset_path, "corpus", split="train")
queries = load_dataset(dataset_path, "queries", split="train")
qrels = load_dataset(dataset_path, "qrels", split="train")
co... | Python | 1 |
# import userbot by apis
from time import sleep
from userbot import ALIVE_NAME, CMD_HELP
from userbot.events import register
@register(outgoing=True, pattern="^.sadboy(?: |$)(.*)")
async def typewriter(typew):
typew.pattern_match.group(1)
sleep(2)
await typew.edit("`Pertama-tama kamu cantik`")
sleep(... | Python | 1 |
# Copyright 2020 The SQLFlow 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 applicable law o... | Python | 1 |
# Copyright 2025 The Magenta 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | Python | 1 |
::and(Expr::Terminal(0), Expr::Terminal(1))
)
);
}
#[derive(Clone, Debug)]
struct InMemoryBDDLog {
labels: RefCell<Vec<(u64, String)>>,
nodes: RefCell<Vec<(BDDFunc, u64, BDDFunc, BDDFunc)>>,
}
impl InMemoryBDDLog {
pub fn new() -> InMemoryBDDLog {
... | Rust | 0 |
, AllocHC> {
htrees : AllocU32::AllocatedMemory::default(),
codes : AllocHC::AllocatedMemory::default(),
max_symbol: 0,
alphabet_size : 0,
num_htrees : 0,
}
}
}
const BROTLI_REVERSE_BITS_MAX: usize = 8;
const BROTLI_REVERSE_BITS_BASE: u8 = 0;
const kReve... | Rust | 0 |
{}.index", index_id);
// On Windows, we can't move an open file. Boo, Windows.
if cfg!(target_family = "windows") {
persisted
.sync_all()
.with_context(|| format!("Couldn't close {} to rename it", WIP_NAME))?;
drop(persisted);
fs::rena... | Rust | 0 |
{
let shape = pl.exact_dashed_polygons(
2.0 * NORMAL_LANE_THICKNESS,
Distance::meters(10.0),
Distance::meters(6.0),
);
draw.unzoomed.extend(color.alpha(0.8), shape.clone()... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ----------------------------------------------------------------------------
# Copyright (C) 2006-2008 University of Dundee. All rights reserved.
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public... | Python | 1 |
provided.
#[error("Edit resulted in error: {0:?}")]
EditError(Value),
/// Error while performing the API request.
#[error("Request error: {0}")]
RequestError(Error),
/// Unexpected data structure (eg array instead of object) in API JSON result
#[error("Result format error: {0}")]
Unex... | Rust | 0 |
template_program = '''
def select_next_node(current_node: int, depot: int, unvisited_nodes: np.ndarray, rest_capacity: np.ndarray, current_time: np.ndarray,\
demands: np.ndarray, distance_matrix: np.ndarray, time_windows: np.ndarray) -> int:
"""Design a novel algorithm to select the next nod... | Python | 1 |
eturn, newline, or tab characters. If no value is specified in the input, **user_id** is automatically set to the value of **context.global.session_id**. **Note:** This property is the same as the **user_id** property in the global system context. If **user_id** is specified in both locations, the value specified at t... | Rust | 0 |
[col]
)
noise_pred_tile = noise_pred_uncond + guidance * (noise_pred_text - noise_pred_uncond)
noise_preds_row.append(noise_pred_tile)
noise_preds.append(noise_preds_row)
# Stitch noise predictions for all tiles
... | Python | 1 |
[b, c, h, w] -> [b, w, c, h]
visual_feature = visual_feature.squeeze(3)
""" Sequence modeling stage """
if self.stages['Seq'] == 'BiLSTM':
contextual_feature = self.SequenceModeling(visual_feature)
elif self.stages['Seq'] == 'Bert':
pad_mask = text
... | Python | 1 |
fn test_serialize() {
let r = Rb::post(API_ROUTE["search"])
.set_data(json!({
"name": "alex",
}))
.build();
let a = r.serialize();
println!("{}", a)
}
}
#![no_main]
#![no_std]
use {{crate_name}} as _; // global logger + panicking-beha... | Rust | 0 |
=> {
let _flags = code.read_u32()?;
let offset = code.read_u32()?;
let value: i32 = self.pop()?;
let base: u32 = self.pop()? as u32;
let addr = (offset + base) as usize;
let mem = env.mem();
... | Rust | 0 |
import pytest
import pygame
@pytest.fixture(autouse=True)
def pygame_setup():
pygame.init()
pygame.display.set_mode((800, 600))
yield
pygame.quit()
| Python | 1 |
hange=ProsUpdater.set_title_4,
on_focus=ProsUpdater.set_title_4,
value=pros_list_2[1].title
),
width="100%",
justify="between"
),
rx.flex(
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.