text string | label_name string | labels int64 |
|---|---|---|
try:
pre = '.'.join(pre_data).replace(" ", "").replace("and", ".")
except:
pre_lists=[]
for pre_list in pre_data:
for pre in pre_list:
pre_lists.append(pre)
... | Python | 1 |
, 0]],
[A[i, 1], P[i, 1]],
[A[i, 2], P[i, 2]], '#72bdba', lw=3)
# Affichage des noms des points et des segments avec un offset pour être lisible
ax.text(B[i, 0] + B_offset, B[i, 1] + B_offset, B[i, 2] + B_offset, f'B{i+1}', color='#386480',... | Python | 1 |
wrap:wrap">
<span class="badge {badge_cls}">{decision or "-"}</span>
<span><b>Score:</b> {row.get("score_total"):.2f}</span>
</div>
""",
unsafe_allow_html=True,
)
st.markdown("### Texto com realce (original)")
... | Python | 1 |
r_code.get() as integer == glue_node_subtype::x_leaders as integer {
print_esc($globals, crate::strpool_str!("xleaders"));
}
// else print_esc("shipout");
else {
print_esc($globals, crate::strpool_str!("shipout"));
}
use crate::section_0149::glue_node_subt... | Rust | 0 |
>) -> bool {
let mut sessions = self.0.lock();
// TODO(bnoordhuis) Evict sessions LRU-style instead of arbitrarily.
while sessions.len() >= 1024 {
let key = sessions.keys().next().unwrap().clone();
sessions.remove(&key);
}
sessions.insert(key, value);
true
}
}
pub fn create_defaul... | Rust | 0 |
0xe8, 0x84, 0xaf, 0x74, 0x10, 0xc6, 0x8, 0x6b, 0x3e, 0xea, 0x61, 0x7c, 0x9a,
0x77, 0x54, 0x31, 0x8b, 0x3b, 0x8b, 0x4, 0xc5,
],
),
(
[
0xca, 0x8b, 0x60, 0xf1, 0x88, 0x6d, 0xb6, 0xf7, 0x33, 0x4f, 0xcc, 0x39, 0x9c, 0xf4,
0x82, 0xe7, 0xde, 0x42, 0x37, 0x8d, 0xb9,... | Rust | 0 |
}
pub unsafe fn ptrAndLongRep(&mut self) -> *mut Struct_Unnamed5 {
::std::mem::transmute(&self._bindgen_data_)
}
}
impl ::std::default::Default for Union_Unnamed3 {
fn default() -> Union_Unnamed3 { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
pub struct Struct_Unnamed4 {
pub ptr1: *mut ::lib... | Rust | 0 |
"""
==================
Colormap reference
==================
Reference for colormaps included with Matplotlib.
A reversed version of each of these colormaps is available by appending
``_r`` to the name, e.g., ``viridis_r``.
See :doc:`/tutorials/colors/colormaps` for an in-depth discussion about
colormaps, including ... | Python | 1 |
) {
<Proxy<T>>::insert(proxy, stash)
}
/// Start a referendum. Can be called directly by the council.
pub fn internal_start_referendum(
proposal: T::Proposal,
threshold: VoteThreshold,
delay: T::BlockNumber,
) -> result::Result<ReferendumIndex, &'static str> {
<Module<T>>::inject_referendum(
<system::... | Rust | 0 |
let oldpos = st.tell();
match st.pop() {
Ok(c) => {
if f(c) {
Ok(c)
} else {
let err = st.place_error(Unsatisfied);
st.seek(oldpos);
Err(err)
}
}
err @ Err(_) => {
st.seek(oldp... | Rust | 0 |
import heapq
def a_star():
# Define the list of coins and their corresponding tax values
coins = [36, 40, 17, 7, 15, 23, 18, 26, 29, 24, 15, 43, 13, 12, 31, 33, 30, 31, 26, 37, 14, 31, 43, 25, 30, 7, 37, 27, 221, 13, 26, 21]
tax_values = {36: 14, 27: 19, 21: 6, 13: 8, 23: 17, 26: 17, 15: 6, 25: 7, 31: 20... | Python | 1 |
let path2 = Path::new(&path);
if !path2.exists() {
debug!("Cleaning registry: Rtools {} (not in {})", &nm, path);
key.delete_subkey_all(nm)?;
}
}
Ok(())
}
fn clean_registry_uninst(key: &RegKey) -> Result<(), Box<dyn Error>> {
for nm in key
.enum_keys()
... | Rust | 0 |
import streamlit as st
import time
st.set_page_config(
page_title="Home",
page_icon="👋",
initial_sidebar_state="collapsed"
)
st.markdown("""
<style>
[data-testid="stSidebar"] {
display: none
}
[data-testid="collapsedControl"] {
... | Python | 1 |
enemy[i].xcor = width
enemy[i].ycor = random.randint(1, height - 64)
enemy[i].xchange = random.randint(
1, movement_speed - 3) * -1
enemy[i].image = pygame.image.load(
random.choice(enemy_img... | Python | 1 |
aps),
"::",
stringify!(supported_qpts)
)
);
}
pub const IBV_RX_HASH_FUNC_TOEPLITZ: ibv_rx_hash_function_flags = 1;
pub type ibv_rx_hash_function_flags = u32;
pub const IBV_RX_HASH_SRC_IPV4: ibv_rx_hash_fields = 1;
pub const IBV_RX_HASH_DST_IPV4: ibv_rx_hash_fields = 2;
pub const IBV_... | Rust | 0 |
without_partition() -> Result<()> {
let testdata = crate::test_util::arrow_test_data();
let filename = format!("{}/avro/alltypes_plain.avro", testdata);
let avro_exec = AvroExec::new(FileScanConfig {
object_store: Arc::new(LocalFileSystem {}),
file_groups: vec![vec![local... | Rust | 0 |
from odoo import fields, models
class EstatePropertyTag(models.Model):
_name = 'estate.property.tag'
_description = 'Estate Property Tag'
name = fields.Char(string='Tag Name', required=True) | Python | 1 |
type CallFuture<T> = Box<dyn Future<Item = T, Error = ()> + Send>;
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum CowRpcRole {
PEER,
ROUTER,
}
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum CowRpcMode {
ROUTED,
DIRECT,
}
/// An RPC context.
pub struct CowRpc {
role: CowRpcRole,
... | Rust | 0 |
` to the power of `exponent`, where `self`
/// is a decimal and `exponent` is an u64 integer,
/// returning None if the result overflowed.
#[inline]
fn pow_u64(&self, exponent: u64) -> Option<Decimal> {
match exponent {
0 => Some(Decimal::ONE),
1 => Some(*self),
... | Rust | 0 |
minute: u8,
second: u8,
fraction_coefficient: BigUint,
fraction_exponent: i32,
) -> TextTime {
TextTime::FractionalSecond {
offset,
hour,
minute,
second,
fraction_coefficient,
fraction_exponent,
}
}
fn timestamp(date: TextDate, time: Option<TextT... | Rust | 0 |
e data.
Returns:
mysqlx.protobuf.Message: The Message representing a message
containing parsed data.
"""
msg = cls()
msg.set_message(
Protobuf.mysqlxpb.parse_server_message(msg_type, payload))
return msg
def mysqlxpb... | Python | 1 |
)).write as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(FLAC__IOCallbacks),
"::",
stringify!(write)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<FLAC__IOCallbacks>())).seek as *const _ as usize },
... | Rust | 0 |
.is_alive() {
return FightResult::Win;
}
if cfg!(feature = "play") {
println!("");
println!("-- {} turn --", other);
}
self.prepare_turn(false);
other.prepare_turn(true);
if let Some(passive_attack... | Rust | 0 |
# Input: nums = [1,1,1,0,0,0,1,1,1,1,0], k = 2
# Output: 6
# tc=O(2n)
# sc=O(1)
def maxconsicutiveones(nums, k):
n = len(nums)
l = 0
r = 0
result = 0
zeros = 0
while r < n:
if nums[r] == 0:
zeros += 1
while zeros > k:
if nums[l] == 0:
ze... | Python | 1 |
correctly_sorts_asteroids() {
let station = Coord::new(4, 5);
let asteroids = vec![
Coord::new(0, 0),
Coord::new(7, 3),
Coord::new(10, 5),
Coord::new(2, 9),
];
let mut asteroids_hash = HashSet::new();
for asteroid in asteroids {
... | Rust | 0 |
from io import BytesIO
import pandas as pd
try:
from pandas.io.common import ZipFile
except ImportError:
from zipfile import ZipFile
def get_bookcrossing_data(local_file=None, get_ratings=True, get_users=False, get_books=False):
if not local_file:
# downloading data
from requests import g... | Python | 1 |
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers.interval import IntervalTrigger
from database import SessionLocal
from .updatePrice import update_prices
scheduler = BackgroundScheduler()
def schedule_price_update():
db = SessionLocal()
try:
print("Starting pr... | Python | 1 |
landmark_info']['exp']
# plt.title(title_name)
# plt.draw()
# plt.savefig(result_folder+measure+'_'+title_name+fig_ext)
# plt.close()
#
# fig, ax = plt.subplots(figsize=(15, 8))
# bplot1 = plt.boxplot([landmarks_merged[exp][measure] for... | Python | 1 |
encode()?);
if consumed == *fuel {
continue;
}
let (line, col) = span.linecol_in(&test);
panic!(
"tests/all/fuel.wast:{}:{} - expected {} fuel, found {}",
line + 1,
col + 1,
fuel,
consumed
);
}
Ok(())... | Rust | 0 |
lf) {}
// CreateNodes creates graph nodes for all locations in a profile. It
// returns set of all nodes, plus a mapping of each location to the
// set of corresponding nodes (one per location.Line).
fn create_nodes(&mut self, opt: Options) {
let mut locations: HashMap<u64, Nodes<'_>> =
... | Rust | 0 |
]
//! # use std::collections::HashMap;
//! #
//! # async fn get(client: &DynamoDbClient) -> Result<(), Box<dyn std::error::Error>> {
//! #
//! # struct User { id: String };
//! # let user = User { id: "fSsgVtal8TpP".to_string() };
//!
... | Rust | 0 |
if fmt_binary {
print!("{:b}", address_type.address());
}
if fmt_binary && fmt_decimal {
print!(" - ")
}
if fmt_decimal || !fmt_binary {
print!("{}", address_type.address());
}
println!(" ({})", address_type);
}
}
<filename>s... | Rust | 0 |
from __future__ import absolute_import, division, print_function
import sys, os
import libtbx.load_env
def run():
if len(sys.argv) < 2: help()
libtbx_path = libtbx.env.find_in_repositories('libtbx')
dtrace_directory = os.path.join(libtbx_path, 'dtrace')
dtrace_script = sys.argv[1]
params = []
python_script... | Python | 1 |
sors.index.json",
"models/HunyuanVideo/text_encoder_2",
),
(
"AI-ModelScope/HunyuanVideo",
"hunyuan-video-t2v-720p/vae/pytorch_model.pt",
"models/HunyuanVideo/vae",
),
(
"DiffSynth-Studio/Huny... | Python | 1 |
from fastembed import TextEmbedding
import tempfile
import shutil
import os
import numpy as np
import faiss
import pickle
def embed(documents):
embedding_model = TextEmbedding(model_name = "BAAI/bge-small-en-v1.5")
return list(embedding_model.embed(documents, batch_size = 64))
def create_db(text_dicts, embedd... | Python | 1 |
alid_grad / torch.max(valid_grad))]
# pdb.set_trace()
assert(len(word_arr) == len(grad_norm_arr))
vis_line = visualize_input_grad.colorize_with_label(ids[tidx], word_arr, grad_norm_arr, labels[tidx].item(),
prediction[t... | Python | 1 |
ed_att = in_package['Pred_att']
orig_Pred_att_ = in_package['Pred_att_']
Pred_att_all = torch.concat([in_package['Pred_att'], in_package['Pred_att_']])
Pred_att = norm(Pred_att_all)[:orig_Pred_att.shape[0], :]
Pred_att_ = norm(Pred_att_all)[-orig_Pred_att_.shape[0]:, :]
# CCL
... | Python | 1 |
y_read(addr::REG_IRQ_FLAGS_MASK)?);
self.try_write(addr::REG_IRQ_FLAGS_MASK, f(tmp).0)
}
pub fn try_irq_flags(&self) -> Result<types::IrqFlags, RW::Error> {
Ok(types::IrqFlags(self.try_read(addr::REG_IRQ_FLAGS)?))
}
pub fn try_set_irq_flags(&self, value: types::IrqFlags) -> Result<(), R... | Rust | 0 |
from typing import Optional
from repokid import CONFIG
from repokid.filters import FilterPlugins
from repokid.types import RepokidConfig
def get_filter_plugins(
account_number: str, config: Optional[RepokidConfig] = None
) -> FilterPlugins:
config = config or CONFIG
plugins = FilterPlugins()
# Block... | Python | 1 |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# 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 requi... | Python | 1 |
ext, ref font, ref color,
ref shadow_hack,
} = text;
let mut ss_pos = *screen_space_offset;
if let Some(xform) = self.transforms.get(text_eid) {
ss_pos += Self::world_to_window(xform.render.position, g, camera, c... | Rust | 0 |
for (_, v) in inner.iter() {
if v.user_id == user_id {
return Ok(UsernameId {
username: v.username.clone(),
user_id: v.user_id.clone(),
});
}
}
Err(CredentialsStoreError::NotFoundError(format!(
... | Rust | 0 |
sing, "missing want/got, ");
};
let assert_last_consecutive = |rl: &GeneratorStreamInternal, last_consecutive: u16| {
let (want, _) = last_consecutive.overflowing_add(start);
assert_eq!(rl.last_consecutive, want, "invalid last_consecutive want");
};
... | Rust | 0 |
_str();
get(should_format, is_class_constant, id)
.into_owned()
.into()
} else {
get(should_format, is_class_constant, id)
}
}
fn handle_possible_colon_colon_class_expr(
ctx: &Context<'_>,
w: &mut dyn Write,
env: &Ex... | Rust | 0 |
presentation data to cause a problem report
(resp_status, resp_text) = agent_backchannel_POST(
context.prover_url + "/agent/command/",
"proof",
operation="send-presentation",
id=context.presentation_thread_id,
data=presentation,
)
assert resp_status == 400, f"resp_s... | Python | 1 |
wline byte.
///
/// This can be used during reading when the byte being consumed is
/// known to be a newline.
pub fn newline(&mut self) {
self.index += 1;
self.line += 1;
self.column = 1;
}
/// Returns the location's line.
pub fn line(&self) -> usize {
self.line
}
/// Returns the lo... | Rust | 0 |
# Copyright 2025 The AI Edge Torch 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 ... | Python | 1 |
ort(hardware, scenario, progress_history,
Timings(self._get_timings(src) + self._get_timings(dst)),
Timings(qemu_timings),
Timings(vcpu_timings),
self._binary, self._dst_host, self._kernel,
... | Python | 1 |
"The unique index definition refers to the unknown fields foo, bar.",
"User",
Span::new(48, 65),
));
}
#[test]
fn unique_directives_must_serialize_to_valid_dml() {
let dml = r#"
model User {
id Int @id
firstName String
lastName Strin... | Rust | 0 |
import json
import os
from datetime import datetime
from jupyterhub.utils import exponential_backoff, isoformat
from tornado import httpclient, ioloop
from tornado.log import app_log as log
async def notify_activity():
"""
Regularly notify JupyterHub of activity.
See https://github.com/jupyterhub/jupyter... | Python | 1 |
xis] = dynamic_dimension
shapes.append(shape_array(shape))
else:
# if at least one output shape is None/undefined
# set value of shape along axis into dynamic
# dynamic_dimension + static_value = dynamic_dimension
aggregated_size_along_axis = dynamic_d... | Python | 1 |
max_speed_on_flat_ground {
base.min(s)
} else {
base
};
(speed, percent_incline)
}
/// The single definitive place to determine how fast somebody could go along a single
/// movement. This should be used for pathfinding and simulation. Ignores elevation.
... | Rust | 0 |
>),
}
impl PredicateInnerOrTerminal {
#[cfg(feature = "sql")]
pub fn try_from(x: Expr, attr: &AttrMap) -> Result<Self, AString> {
match x {
Expr::BinaryOp { .. } => Ok(Self::PredicateInner(AoristRef(RArc::new(RRwLock::new(
PredicateInner::try_from(x, attr)?,
)))))... | Rust | 0 |
from __future__ import annotations
import dash
# create our crystal structure using pymatgen
from pymatgen.core import Lattice, Structure
import crystal_toolkit.components as ctc
from crystal_toolkit.helpers.layouts import H1, H3, Container
from crystal_toolkit.settings import SETTINGS
app = dash.Dash(assets_folder... | Python | 1 |
# Given a array will to move all zeros array to the right side at a given space
# It is two pionter problem will to solved move all zeros array to the right then we ini
# variable i and j
# Function defintion
class Solution:
# Function defintion with two argument
def pushZeroToEnd(self,arr):
# calcl... | Python | 1 |
, 9);
// create completed job
let job_payload = qw.next_job();
let update_req = job::UpdateRequest { status: Some(job::Status::Completed), output: None };
qw.manager.update_job(job_payload.id(), &update_req).unwrap();
assert_eq!(qw.queue_size(), 8);
// create failed job
let job_id = qw.nex... | Rust | 0 |
import tkinter as tk
from tkinter import *
from tkinter import ttk
import os
win=tk.Tk()
win.title("Virtual Mouse")
win.geometry("300x220")
bg = PhotoImage(file='images.png')
label17 = Label(win, image=bg)
label17.place(x=40, y=0)
def hand():
os.system("virtualmouse.py")
def handdetector():
os.system("eye... | Python | 1 |
MontgomeryPoint {
fn zeroize(&mut self) {
self.0.zeroize();
}
}
impl MontgomeryPoint {
/// View this `MontgomeryPoint` as an array of bytes.
pub fn as_bytes<'a>(&'a self) -> &'a [u8; 32] {
&self.0
}
/// Convert this `MontgomeryPoint` to an array of bytes.
pub fn to_bytes(&s... | Rust | 0 |
#!/usr/bin/python
#
# Copyright 2016 Red Hat | Ansible
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations
DOCUMENTATION = r"""
module: docker_container_info
short_descriptio... | Python | 1 |
io_ctx: Arc<TableIOContext>,
push_downs: Option<Extras>,
_partition_num_hint: Option<usize>,
) -> Result<ReadDataSourcePlan> {
self.do_read_plan(io_ctx, push_downs)
}
async fn read(
&self,
io_ctx: Arc<TableIOContext>,
push_downs: &Option<Extras>,
) ->... | Rust | 0 |
liab_index].is_positive(), MangoErrorCode::Default)?;
let liab_price = mango_cache.get_price(liab_index);
let liab_fee = if liab_index == QUOTE_INDEX {
ONE_I80F48
} else {
let liab_info = &mango_group.spot_markets[liab_index];
ONE_I80F48 - liab_info.liquidatio... | Rust | 0 |
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
impl R {
#[doc = r" Value of the register as raw bits"]
#[inline]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bits 0:1 - Port 1 pin 0 control."]
#[inline]
... | Rust | 0 |
gRZ");
#[program]
pub mod candy_machine {
use super::*;
pub fn initialize_candy_machine(
ctx: Context<InitializeCandyMachine>,
data: CandyMachineData,
) -> Result<()> {
handle_initialize_candy_machine(ctx, data)
}
pub fn update_candy_machine(
ctx: Context<UpdateCan... | Rust | 0 |
from SparkApiV3 import SparkApi
from evn import id
appid = id['appid'] #填写控制台中获取的 APPID 信息
api_secret = id['api_secret'] #填写控制台中获取的 APISecret 信息
api_key = id['api_key'] #填写控制台中获取的 APIKey 信息
domain = "generalv3" # 大模型版本(不知道可以去看官方文档)
Spark_url = "ws://spark-api.xf-yun.com/v3.1/chat" # v3.0环境的地址
text =[
... | Python | 1 |
use fluid_xenth::{Xenth, XenthControl};
use fluid_xenth_tune::pitch::Pitch as FluidXenthPitch;
use fluidlite::{IsPreset, IsSamples, IsSettings, Settings, Synth};
use tune::{
pitch::Pitch,
scala::{KbmRoot, Scl},
};
use crate::piano::Backend;
pub fn create<I, S: Copy + Eq + Hash>(
info_sender: Sender<I>,
... | Rust | 0 |
name.into(),
value,
service_id: None,
user_id: None,
}
}
/// Create service key.
pub fn service<N>(is_enabled: bool, name: N, service_id: Uuid) -> Self
where
N: Into<String>,
{
let value = value_generate();
Self {
is_e... | Rust | 0 |
UserString.rjust rB r% c 8 | j j | S r )r~
rpartitionrM s r rY zUserString.rpartition s yy##C((r% c V | j | j j | S r )... | Python | 1 |
import logging
logging.basicConfig(level=logging.INFO, format='%(levelname)s:LEXAI:%(message)s')
logger = logging.getLogger("LEXAI") | Python | 1 |
ints.values())
xtick_labels = list(bin_midpoints.keys())
plt.xticks(ticks = xtick_positions, labels = xtick_labels, rotation = 45, fontsize = 14)
plt.yticks(fontsize = 14)
plt.xlim(125, 425)
plt.ylim(0, 50)
plt.xlabel("Binned description length (characters)", fontsize = 16, labelpad = 10)
plt.ylabel("Mean rank of targe... | Python | 1 |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | Python | 1 |
8 u16 8
m16x8 m16 8
@m32x4 u32x4
i32x4 i32 4
u32x4 u32 4
m32x4 m32 4
f32x4 f32 4
@m64x2 u64x2
i64x2 i64 2
u64x2 u64 2
m64x2 m64 2
f64x2 f64 2
)
Align32 (
@m8x32 u8x32
i8x32 i8 32
u8x32 u8 32
... | Rust | 0 |
# MultiMolecule
# Copyright (C) 2024-Present MultiMolecule
# This file is part of MultiMolecule.
# MultiMolecule is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | Python | 1 |
check_directives
.extend(directives.into_iter().map(|sp| sp.into_line_sp(line_idx)));
} else if let Some(c) = cur_command.as_mut() {
c.add_textline(line)?;
} else {
// skip empty lines
... | Rust | 0 |
False;
type Kind=ValueKind;
const S_LAYOUT: &'static TypeLayout = {
const MONO_TYPE_LAYOUT:&'static MonoTypeLayout=&MonoTypeLayout::new(
*mono_shared_vars,
rstr!("UnsafeIgnoredType"),
make_item_info!(),
MonoTLData::struct_(rslice![]),
tl_gen... | Rust | 0 |
er.split('#')
passwd_list = passwd.split('#')
setp_array = step.split('-')
if len(user_list) == len(passwd_list):
push = ''
for line in range(0, len(user_list)):
if len(setp_array) == 2:
step = str(random.randint(
int(setp_array[0]), int(setp_... | Python | 1 |
get(cr)
}
}
unsafe impl ToOCaml<()> for () {
fn to_ocaml(&self, _cr: &mut OCamlRuntime) -> OCaml<'static, ()> {
OCaml::unit()
}
}
unsafe impl ToOCaml<OCamlInt> for i64 {
fn to_ocaml<'a>(&self, cr: &'a mut OCamlRuntime) -> OCaml<'a, OCamlInt> {
unsafe { OCaml::new(cr, ((self << 1) | 1) ... | Rust | 0 |
{
GONE_HANDLER_A_CALLED.store(true, Ordering::SeqCst);
println!(
"gone_counter_handler_a: counter deallocated with registration_id {}, counter_id {}, label {}, value {}",
registration_id,
counter_id,
counters_reader.counter_label(counter_id).unwrap().to_str().unwrap(),
c... | Rust | 0 |
import pytest
import pandas as pd
from nerea.comparisons import FrameCompare
@pytest.fixture
def frame1():
return pd.DataFrame({'value': 1.01, 'uncertainty': 0.03,
'uncertainty [%]': 2.9702970297029703,
'VAR_FRAC_C_n': None, 'VAR_FRAC_C_d': None}, index=['value'])
... | Python | 1 |
Inner;
use crate::tree::TreeInner;
/// Interface that all reference types should impelmenet
pub trait Ref: Clone + Deref
where
Self::Target: Sized,
{
/// Construct reference from target type
fn new(value: Self::Target) -> Self;
}
impl<T> Ref for Rc<T> {
fn new(value: Self::Target) -> Self {
Rc... | Rust | 0 |
BaseElement::from(5u8),
BaseElement::from(2u8) + BaseElement::from(3u8)
);
// test overflow
let t = BaseElement::from(BaseElement::MODULUS - 1);
assert_eq!(BaseElement::ZERO, t + BaseElement::ONE);
assert_eq!(BaseElement::ONE, t + BaseElement::from(2u8));
// test random values
let ... | Rust | 0 |
::{deserialize, serialize};
use std::collections::HashMap;
use std::io;
use std::str::FromStr;
use std::time::Duration;
use pool::config::{Config, ProducerConfig};
use pool::logger::LOGGER;
use pool::proto::SubmitParams;
use super::share::{Share, SubmitResult};
use kafka::client::{
Compression, KafkaClient, Requ... | Rust | 0 |
- pow(self.read_compensated_data()[1] /
self.__sealevel, 0.1903))
except:
p = 0.0
return p
@property
def dew_point(self):
"""
Compute the dew point temperature for the current Temperature
and Humidity measured pair
... | Python | 1 |
let x3_1 = P256FieldElement::from_literal(2u128) * v;
let x3_2 = r.exp(2u32) - j;
let x3 = x3_2 - x3_1;
let y3_1 = (P256FieldElement::from_literal(2u128) * s1) * j;
let y3_2 = r * (v - x3);
let y3 = y3_2 - y3_1;
let z3_ ... | Rust | 0 |
itive};
use std::convert::TryFrom;
use super::{ConditionCode, OperationMode};
/// An enum of the register names available to the processor. These names can be
/// used in the `get_register_value` and `set_register_value` functions to ensure
/// that the register being accessed is the correct one for the current execu... | Rust | 0 |
address: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct shortview {
pub _address: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct kernclasslistdlg {
pub _address: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct kernclassdlg {
pub _address: u8,
}
#[repr(C)]
#[derive(Debug, Copy... | Rust | 0 |
reserved\""]
#[inline]
pub fn buf4to1i2(&mut self) -> _BUF4TO1I2W {
_BUF4TO1I2W { w: self }
}
#[doc = "Bit 4 - Buffer MB i Interrupt Or \"reserved\""]
#[inline]
pub fn buf4to1i3(&mut self) -> _BUF4TO1I3W {
_BUF4TO1I3W { w: self }
}
#[doc = "Bit 5 - Buffer MB5 Interrupt Or... | Rust | 0 |
}
impl ::core::clone::Clone for RAW_ROOTPORT_FEATURE {
fn clone(&self) -> Self {
*self
}
}
#[repr(C, packed(1))]
#[doc = "*Required features: 'Win32_Devices_Usb'*"]
pub struct RAW_ROOTPORT_PARAMETERS {
pub PortNumber: u16,
pub PortStatus: u16,
}
impl ::core::marker::Copy for RAW_ROOTPORT_PARAMET... | Rust | 0 |
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any la... | Python | 1 |
class Levels:
class BaseLevel:
def __init__(self, level_id: int, name: str, description: str):
self.level_id = level_id
self.name = name
self.PlayerSpawnX = 0
self.PlayerSpawnY = 0
self.level_map = []
class Level0(BaseLevel):
def ... | Python | 1 |
for i in range(1,100):
if i % 11 == 0:
if i != 99:
print(i,end=',')
else:
print(i)
#print(i) | Python | 1 |
expr, $j1:expr]) => {
const JUMP: [u64; 2] = [$j0, $j1];
let mut s0 = 0;
let mut s1 = 0;
for j in &JUMP {
for b in 0..64 {
if (j & 1 << b) != 0 {
s0 ^= $self.s0;
s1 ^= $self.s1;
}
$self.ne... | Rust | 0 |
new();
for ch in target.chars() {
if guessed.contains(&ch) {
guess.push(ch).unwrap();
} else {
guess.push('_').unwrap();
}
}
let text_style = MonoTextStyle::new(&FONT_10X20, Rgb565::WHITE);
Text::new(
&guess,... | Rust | 0 |
import pytest
from algorithms.dijkstra import dijkstra
def test_dijkstra_simple_case():
graph = {
'A': {'B': 1, 'C': 4},
'B': {'A': 1, 'C': 2, 'D': 5},
'C': {'A': 4, 'B': 2, 'D': 1},
'D': {'B': 5, 'C': 1}
}
start_node = 'A'
end_node = 'D'
expected_distance = 4
ex... | Python | 1 |
dur_field, &mut args)?;
let duration = duration.ok_or(ArgsError::MissingField(dur_field))?;
let duration = Duration::from_millis(duration);
let message = Args::next_opt("message", &mut args)?;
// sleep for `duration`
future::timeout(duration, pending::<()>()).await.ok();
... | Rust | 0 |
import ast
import os
import Ishikawa_tools_generators.metrics.scripts.config as c
class FunctionCounter(ast.NodeVisitor):
def __init__(self):
self.function_count = 0
def visit_FunctionDef(self, node):
self.function_count += 1
self.generic_visit(node)
def visit_AsyncFunctionDef(s... | Python | 1 |
%-22s %10d" % ("Total",total))
#fig = plt.figure(figsize=(10, 7))
#plt.pie(data, labels=cars)
# show plot
#plt.show()
#byrows=data['rows']
#print("----------------------------")
#print(byrows)
# An other example - to get info on all the files owned by a particular user
# ToDo : Move this to its own example
m... | Python | 1 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# 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 ... | Python | 1 |
restore_with_namespace(sand_name, DEFAULT_NAMESPACE)
}
pub fn restore_with_namespace<
S: AsRef<str>,
B: ServerConfig + DeserializeOwned,
N: AsRef<str>,
>(
sand_name: S,
namespace: N,
) -> ServerResult<B> {
let config_marker = B::marker();
let key = format!("{}:{}@{}", sand_name.as_ref(), config_marke... | Rust | 0 |
# Section 6.2.3 snippets
# 6.2.3 Basic Dictionary Operations
roman_numerals = {'I': 1, 'II': 2, 'III': 3, 'V': 5, 'X': 100}
roman_numerals
# Accessing the Value Associated with a Key
roman_numerals['V']
# Updating the Value of an Existing Key–Value Pair
roman_numerals['X'] = 10
roman_numerals
# Adding a New Key–V... | Python | 1 |
_number);
o_prot.write_message_begin(&message_ident)?;
thrift::Error::write_application_error_to_out_protocol(&app_err, o_prot)?;
o_prot.write_message_end()?;
o_prot.flush()
},
_ => {
let ret_err = {
ApplicationError::new(
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.