text string | label_name string | labels int64 |
|---|---|---|
system_base_info
.sctpsysctl
.sctp_delayed_sack_time_default
.wrapping_mul(hz as libc::c_uint)
.wrapping_add(999u32)
.wrapping_div(1000u32)
};
(*m).sctp_timeoutticks[3usize] = if hz == 1000i32 {
system_base_info.sctpsysctl.sctp_heartbeat_i... | Rust | 0 |
#problem statement link: https://leetcode.com/problems/string-compression-iii/description/?envType=daily-question&envId=2024-11-04
#solution:
class Solution:
def compressedString(self, word: str) -> str:
comp = ''
i = 0
n = len(word)
while i < n:
count = 1
... | Python | 1 |
import os
from flask.ext.script import Manager
"""
Flask-Script module
--> allows for easy specification of tasks to help manage our application
"""
from blog import app
from blog.models import Post
from blog.database import session
#create an instance of the Manager object
manager = Manager(app)
"""
1) Add a comman... | Python | 1 |
/* ToDo: This requires FutureExt::select to be implemented
#[test]
fn finished_future() {
let (_a_tx, a_rx) = oneshot::channel::<i32>();
let (b_tx, b_rx) = oneshot::channel::<i32>();
let (c_tx, c_rx) = oneshot::channel::<i32>();
let mut stream = futures_unordered(vec![
FutureObj::new(Box::new... | Rust | 0 |
u8 = 0x00;
pub(crate) const LOC_lower: u8 = 29;
pub(crate) const LOC: Self = Self([Self::LOC_higher, Self::LOC_lower]);
/// Older DNSSEC concept.
///
/// Defined in RFC 3755 and RFC 2535; abandoned.
pub(crate) const NXT_higher: u8 = 0x00;
pub(crate) const NXT_lower: u8 = 30;
pub(crate) const NXT: Self = Self(... | Rust | 0 |
_state;
pub mod list;
pub mod manifest;
mod utils;
use std::path::Path;
use indicatif::{ProgressBar, ProgressStyle};
use walkdir::{DirEntry, WalkDir};
use crate::error::PathError;
const ACTIVITY_FILE_TYPES: [&str; 3] = ["fit", "gpx", "tcx"];
pub fn create_spinner(msg: &str) -> ProgressBar {
let pb = ProgressBar... | Rust | 0 |
ScalarValue::Float(x) => Ok(x),
_ => Err(FromMetaError::expected("a float", meta)),
}
}
}
impl FromMeta<'_> for bool {
fn from_meta(meta: &Sp<Meta>) -> Result<Self, FromMetaError<'_>> {
Ok(i32::from_meta(meta)? != 0)
}
}
impl FromMeta<'_> for String {
fn from_met... | Rust | 0 |
.limit(10)
.offset(100)
.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" LIMIT 10 OFFSET 100"#
);
}
#[test]
fn select_2() {
assert_eq!(
Query::select()
.columns([Char::Character, Char::SizeW, Char::Size... | Rust | 0 |
er_shape[0] = dist.get_world_size(group) * gather_shape[0]
ret = torch.empty(gather_shape, dtype=temp.dtype, device=in_tensor.device)
dist.all_gather_into_tensor(ret, temp, group=group)
ret = ret.transpose(0, -2).contiguous()
return ret
# 8. SR -> RS
def reshard_SR_to_RS(in_tensor, group):
# (bs... | Python | 1 |
[0b000_000_1_00000_00000_000_11111_0000000, 0b000_001_0_00010_00001_101_00000_0000111], // vluxei16.v
[0b000_000_1_00000_00000_000_11111_0000000, 0b000_001_0_00010_00001_110_00000_0000111], // vluxei32.v
[0b000_000_1_00000_00000_000_11111_0000000, 0b000_001_0_00010_00001_111_00000_00001... | Rust | 0 |
(cc, stat) in self.stats.iter() {
if cc != "all" {
countries.push(CountryStatWithCode { cc, stat });
}
}
countries.sort();
countries
}
pub fn to_csv(&self) -> String {
let mut s = String::new();
writeln!(s, "iso2,coverage,accurac... | Rust | 0 |
s if there are no tags in the input and no group columns in the query
let plan_builder = if !tag_columns.is_empty() {
// reorder columns
let reorder_exprs = tag_columns
.iter()
.map(|tag_name| tag_name.as_expr())
.collect::<Vec<_>>();
... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# 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... | Python | 1 |
data: OrderUpdateData {
symbol: "GRTUSDT".to_string(),
client_order_id: "web_TF7zjup9BmWWFluoSz6M".to_string(),
side: OrderUpdateSide::Buy,
order_type: "MARKET".to_string(),
time_in_force: "GTC".to_string(),
original_quantit... | Rust | 0 |
op @ 0b0010 |
op @ 0b0011 => {
inst.opcode = [
Opcode::DIVU(size), Opcode::DIV(size),
Opcode::PUSH(size), Opcode::DIVX(size),
][op as usize];
inst.operands[0] =... | Rust | 0 |
_eq!(events.len(), 3);
}
<filename>contracts/sim-token/tests/owner.rs<gh_stars>0
use near_sdk_sim::{call, init_simulator, to_yocto, view, DEFAULT_GAS};
use near_sdk::AccountId;
use crate::common::*;
mod common;
#[test]
pub fn test_owner(){
let root = init_simulator(None);
let token = deploy_token(&root);
... | Rust | 0 |
import matplotlib.pyplot as plt
x = [56, 52, 48, 16, 45, 20, 52, 52, 36, 60, 70, 52, 36, 56, 20, 80, 56, 36, 44, 36,
56, 48, 68, 56, 80, 64, 60, 12, 56, 60, 36, 72, 24, 60, 60, 12, 54, 75, 23, 65,
12, 65, 12, 65, 62, 67, 12, 87, 43, 98, 46, 65, 24, 43, 34, 23, 65, 23, 64, 65,
56, 52, 48, 16, 45, 20, 52... | Python | 1 |
rost::alloc::collections::BTreeMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
/// The full resource URL of the external storage location. Currently, only
/// Google Cloud Storage is supported. So input_url should be of the form:
/// `gs://BUCKET_NAME\[/NAMESPACE_PATH\]/OVERALL_EXPORT_M... | Rust | 0 |
ublicX25519Dalek publicEd25519Dalek }}"
},
"citizenIdentifier": "canard",
"exp": timestamp+60,
}))
.unwrap(),
&public_key,
)
.unwrap();
let request = Request::builder().body(Body::from(query)).unwrap();
let response = block_on(chatrouille(
r... | Rust | 0 |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2024.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | Python | 1 |
/// `.`
Dot,
/// `==`
Eq,
/// `>`
GreaterThan,
/// `>=`
GreaterThanOrEq,
/// `++`
Inc,
/// `<<`
LeftSh,
/// `<`
LessThan,
/// `<=`
LessThanOrEq,
/// `%`
Mod,
/// `*`
Mul,
/// `~`
Neg,
/// `!`
Not,
/// `!=`
NotEq,
... | Rust | 0 |
oth of the alignment flags.
pub const Marginalized: Self = Self(c_api::NCPLANE_OPTION_MARGINALIZED);
/// Do not scroll alongside its parent.
///
/// If this plane is bound to a scrolling plane, it ought *not* scroll along
/// with the parent (it will still move with the parent, maintaining its
... | Rust | 0 |
}
// String methods.
add_method(&Type::String, Type::Bool, vec![Type::String], "contains", "$0 LIKE '%' || $1 || '%'");
add_method(&Type::String, Type::Bool, vec![Type::String], "ends_with", "$0 LIKE '%' || $1");
add_method(&Type::String, Type::Bool, vec![Type::String], "starts_with", "$0 LIKE $1 || '%... | Rust | 0 |
eze(anchor)[:3]
# 用query方法查询最近的kk个点,返回距离和索引
distances, indices = tree.query(anchor, k=kk)
# 用索引从data中提取对应的点和标签
# points = data[indices]
# labels = data[indices, -1]
return distances, indices
# nbrs = NearestNeighbors(n_neighbors=kk, algorithm='kd_tree').fit(data) # 创建NearestNeighbors类的实例... | Python | 1 |
rmutations.push(p_cloned);
}
}
}
}
permutations
}
pub enum MappingError {
MismatchSize,
MismatchNumbering
}
pub fn mapping_neighbours(
neighbour_groups: &mut Vec<NeighbourIndexes>,
numbering: &Vec<usize>,
) -> Result<Vec<VertexMapping>, MappingError> {
... | Rust | 0 |
}"),
"div {\
\n color: singleton;\
\n divider: 3;\
\n}\
\ndiv span {\
\n msg: foo;\
\n}\
\ndiv span {\
\n msg: bar;\
\n}\
\ndiv span {\
\n msg: hux;\
\n}\n"
);
}
<filename>shachain/src/test_store... | Rust | 0 |
= self.thumbnails_dir_path.clone();
thumbnail_path.push(format!("{}.jpg", hash.to_string()));
thumbnail_path
}
fn retrieve_thumbnail(&self, image_path: &Path, thumbnailoptions: &Options) -> Option<PathBuf> {
let path = self.get_thumbnail_path(image_path, thumbnailoptions);
if path.exists() {
Some(path)
... | Rust | 0 |
self.module_id);
// Update the origin of the child module
// Note: We do not support inline modules
// Also note that the FileId is where this module is defined and not declared
// To find out where the module was declared, you need to check its parent
modules[module_id].origin ... | Rust | 0 |
Some(self.keypad.input),
ioregs::KEYCNT => Some(self.keypad.control),
// System Control
ioregs::WAITCNT => Some(self.sysctl.reg_waitcnt),
ioregs::IMC => Some(self.sysctl.reg_imemctl as u16),
ioregs::IMC_H => Some((self.sysctl.reg_imemctl >> 16) as u16),
... | Rust | 0 |
a=int(input("Enter the number from where you want to start the reverse number:\t"))
for i in range(a,0,-1):
print(i) | Python | 1 |
st):
f_globals = top_level().f_globals
try:
val = f_globals[varname]
i =(lst.index(val) + 1) % len(lst)
except:
i = 0
val = lst[i]
print("[{}/{}]".format(i + 1, len(lst)))
f_globals[varname] = val
return val
def argv(cmd):
sys.argv = shlex.split(cmd)
def find_gl... | Python | 1 |
import asyncio
import websockets
from config.logger import setup_logging
from core.connection import ConnectionHandler
from config.config_loader import get_config_from_api
from core.utils.modules_initialize import initialize_modules
from core.utils.util import check_vad_update, check_asr_update
TAG = __name__
class ... | Python | 1 |
T) -> Result<LastModified, XmlParseError> {
try!(start_element(tag_name, stack));
let obj = try!(characters(stack));
try!(end_element(tag_name, stack));
Ok(obj)
}
}
/// Write `LastModified` contents to a `SignedRequest`
pub struct LastModifiedWriter;
impl LastModifiedWriter {
p... | Rust | 0 |
(issuers.iter().map(|issuer| self.resolve(issuer)).collect::<Vec<_>>()).await
}
/// Fetches the DID Document of the holder of a [`Presentation`].
///
/// # Errors
///
/// Errors if the holder URL is missing, is not a valid [`IotaDID`], or DID resolution fails.
pub async fn resolve_presentation_holder(&se... | Rust | 0 |
ait;
client
.send_command(third_room_uri, Value::Extant)
.await
.expect("Failed to send command!");
time::sleep(Duration::from_secs(1)).await;
println!("Stopping client in 2 seconds");
time::sleep(Duration::from_secs(2)).await;
client.stop().await.unwrap();
}
#![no_std]
m... | Rust | 0 |
;
use sentencepiece::SentencePieceProcessor;
use std::io;
fn main() {
let spp = SentencePieceProcessor::open("sentencepiece.model").unwrap();
let mytranslator = Translator::new("./model").unwrap();
loop {
println!("Enter what you want to be translated:");
let stdin = io::stdin();
l... | Rust | 0 |
pattern,
occurences=1,
strand="both",
location=Location(1, 6, strand=-1),
)
],
logger=None,
)
problem.resolve_constraints()
assert problem.all_constraints_pass()
assert pattern in problem.sequence # uses +1 strand by ... | Python | 1 |
,
)
})
});
c.bench_function("Deserialize MicrovmState", |b| {
b.iter(|| {
bench_restore_snapshot(
black_box(&mut snapshot_state_without_crc.as_mut_slice()),
black_box(snapshot_len),
black_box(version_map.clone()),
... | Rust | 0 |
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from time import sleep
import pytest
from pages.base_page import BasePage
from pages.etapa1_page import Etapa1Page
from page... | Python | 1 |
nt')
return net
def fuse_test_net4():
# test network to demonstrate overcurrent protection in tutorial
net = create_empty_network()
# create buses
create_buses(net, nr_buses=9, vn_kv=[20, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4],
index=[0, 1, 2, 3, 4, 5, 6, 7, 8], name=None, typ... | Python | 1 |
st size: {len(test_df)}")
# 2) Map user_id and item_id to integer IDs
unique_user_ids_str = sorted(set(train_df["user_id"].astype(str)).union(set(test_df["user_id"].astype(str))))
unique_item_ids_str = sorted(set(train_df["item_id"].astype(str)).union(set(test_df["item_id"].astype(str))))
user_id_map ... | Python | 1 |
# Problem: Count the Number of Good Subarrays - https://leetcode.com/problems/count-the-number-of-good-subarrays/description/
class Solution:
def countGood(self, nums: List[int], k: int) -> int:
n = len(nums)
right, good_sub = 0, 0
num_map = defaultdict(int)
pairs = 0
for l... | Python | 1 |
= "0x0f - Flash Common Command Object Registers"]
pub fccob8: FCCOB8,
#[doc = "0x10 - Program Flash Protection Registers"]
pub fprot3: FPROT3,
#[doc = "0x11 - Program Flash Protection Registers"]
pub fprot2: FPROT2,
#[doc = "0x12 - Program Flash Protection Registers"]
pub fprot1: FPROT1,
... | Rust | 0 |
fn story() -> TextOverlay {
let bold = Style::new()
.with_foreground(colours::STRIPE)
.with_bold(true);
let normal = Style::new()
.with_foreground(colours::STRIPE)
.with_bold(false);
let faint = Style::new()
.with_foreground(colours::STRIPE)
.with_bold(false)... | Rust | 0 |
c} }t j. |d } d
}
g }t d| j D ] }t j
j
}| j | j |
z |z | z | j( | | j ... | Python | 1 |
),*> std::fmt::Display for Op<#(#type_params),*> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
#(#format_calls),*
}
}
}
impl<#(#type_params_with_bounds),*> Op<#(... | Rust | 0 |
},
PduParsing,
};
use log::{debug, info, trace, warn};
use ring::rand::SecureRandom;
use sspi::internal::credssp;
use crate::{transport::*, InputConfig, RdpError, BUF_STREAM_SIZE};
use ironrdp::rdp::ProtocolIndependentCode;
pub type StaticChannels = HashMap<String, u16>;
pub struct DesktopSizes {
pub wid... | Rust | 0 |
pi::VerApi;
/// Future that resolves to account nonce.
type FutureResult<T> = jsonrpc_core::BoxFuture<Result<T, RpcError>>;
/// System RPC methods.
#[rpc]
pub trait SystemApi<BlockHash, AccountId, Index> {
/// Returns the next valid index (aka nonce) for given account.
///
/// This method takes into consideration ... | Rust | 0 |
.33) ( -0.13, 0.33) 0.04
// ( 0.62, 0.00) ( 0.62, 0.00) ( 0.69, 0.00) ( 0.69, 0.00) 0.56
// ( -0.04, -0.58) ( -0.04, 0.58) ( -0.39, -0.07) ( -0.39, 0.07) -0.13
// ( 0.28, 0.01) ( 0.28, -0.01) ( -0.02, -0.19) ( -0.02, 0.19) -0.80
// ( -0.04, 0.34) ( -0.04, -0.34) ( -0.40, 0.22) ( -0.40, -0.22) 0... | Rust | 0 |
from django.apps import AppConfig
class AuthsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'auths'
| Python | 1 |
rts(input).0
}
#[aoc(day19, part2)]
pub fn part2(input: &[u8]) -> i64 {
both_parts(input).1
}
#[cfg(test)]
mod tests {
use super::{part1, both_parts, matmul, RX90, RY90, transform, V3, rotations};
use std::collections::HashSet;
use std::collections::hash_map::RandomState;
const RX90Y90: [V3;3] = ... | Rust | 0 |
(hr));
unsafe { ComPtr::from_raw(shader) }
}
impl Internal {
pub fn new(device: &ComPtr<d3d11::ID3D11Device>) -> Self {
let internal_buffer = {
let desc = d3d11::D3D11_BUFFER_DESC {
ByteWidth: mem::size_of::<BufferImageCopyInfo>() as _,
Usage: d3d11::D3D11_U... | Rust | 0 |
;
type BlockNumber = BlockNumber;
type AccountId = AccountId;
type Event = Event;
type ModuleToIndex = ();
type Call = Call;
}
impl module::Trait for Runtime {}
frame_support::construct_runtime!(
pub enum Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: ... | Rust | 0 |
#
# SPDX-FileCopyrightText: Copyright (c) 1993-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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... | Python | 1 |
match super::insert_apl(_ct) {
Some(res) => {
match super::insert_code(_ct) {
Some(res) => _ct,
None => {
panic!(
"PANIC... | Rust | 0 |
import os.path
import numpy as np
import pandas as pd
import argparse
from scipy.stats import spearmanr
from sklearn.metrics import roc_auc_score
parser = argparse.ArgumentParser()
parser.add_argument('--path', type=str, required=True)
parser.add_argument('--name', type=str, required=True)
parser.add_argument('--... | Python | 1 |
from db.classes import Daily
from db.engine import engine
from db.db_requests import get_daily_words, reset_daily
from sqlalchemy.orm import Session
from random import choice
from game.play.words_ru import words as words_ru
from datetime import datetime
import asyncio
async def get_daily_word() -> None:
session =... | Python | 1 |
ARY : i32 = -3;
/// public static final [VARCHAR](https://developer.android.com/reference/java/sql/Types.html#VARCHAR)
pub const VARCHAR : i32 = 12;
}
}
// Copyright 2022 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found... | Rust | 0 |
dataflow::operators::{ToStream, Map, Inspect};
/// use timely::dataflow::operators::aggregation::Aggregate;
///
/// timely::example(|scope| {
///
/// (0..10).to_stream(scope)
/// .map(|x| (x % 2, x))
/// .aggregate::<_,Vec<i32>,_,_,_>(
/// |_key, val, agg|... | Rust | 0 |
) => f.debug_tuple("Fit").field(a).finish(),
Operation::Reserve(ref a, ref b) => f.debug_tuple("Reserve").field(a).field(b).finish(),
Operation::MarkReady => f.debug_tuple("MarkReady").finish(),
Operation::SetMeta(ref a) => f.debug_tuple("SetMeta").field(a).finish(),
}
}
... | Rust | 0 |
except Exception as e:
logger.error(f"Error getting currency info: {str(e)}")
# Return USD as default
return {
'code': 'USD',
'symbol': '$',
'name': 'US Dollar'
}
def submit_bulk_read_job(self, modul... | Python | 1 |
# Tag: Backtracking
# Time: O(k * C(n, k))
# Space: O(K)
# Ref: -
# Note: -
# Given two integers n and k, return all possible combinations of k numbers chosen from the range [1, n].
# You may return the answer in any order.
#
# Example 1:
#
# Input: n = 4, k = 2
# Output: [[1,2],[1,3],[1,4],[2,3],[2,4],... | Python | 1 |
{
let line_height = data.config.editor.line_height as f64;
let offset = data.editor.new_cursor.offset();
let (line, _) =
data.doc.buffer().offset_to_line_col(offset);
... | Rust | 0 |
import unittest
import os
import sqlite3
import shutil
from flask import Flask, send_file, redirect
from werkzeug.utils import secure_filename
from io import BytesIO
import impasse as assimp
from app import server, init_db, get_db_connection, TEMP_UPLOAD_FOLDER, TEXTURE_UPLOAD_FOLDER, convert_to_obj
import tempfile
c... | Python | 1 |
the admin routes won't be available
ADMIN_PASSWORD = os.environ.get("API_KEY_ADMIN_PASSWORD", "abc")
# secret for the google form to give to the admin/register endpoint
REGISTER_WEBHOOK_TOKEN = os.environ.get("API_KEY_REGISTER_WEBHOOK_TOKEN")
REDIS_HOST = os.environ.get("REDIS_HOST", "delphi_redis")
REDIS_PASSWORD = ... | Python | 1 |
Kind::Destructor,
"assignment_operator" => SpecialMemberKind::AssignmentOperator,
_ => panic!("unexpected special_member_kind"),
})
}
/// Any reference parameters or return values.
pub(super) fn get_reference_parameters_and_return(&self) -> References {
l... | Rust | 0 |
"c_out"],
dynamic_axes={},
)
else:
obs = (
torch.zeros(1, self.actor.obs_dim)
if isinstance(self.actor, ActorMoE)
else torch.zeros(1, self.actor[0].in_features)
)
torch.onnx.export(
s... | Python | 1 |
/* make spi instance and dotstar, disable postamble for one led */
let spi = hal::Spi::new(&mut asf::SPI_0);
let mut dotstar = Apa102::new_with_custom_postamble(spi, 0, false);
/* wait for USB enumeration */
while !asf::cdcdf_acm_is_enabled() {}
/* Rust wants an Option<fn()> and C wants a vo... | Rust | 0 |
_compressed) =
nom::multi::length_value(nom::number::complete::le_u32, nom::combinator::rest)(data)?;
assert_eq!(data.len(), 0);
Ok((
data,
Self {
time,
location: location.into(),
runs,
active_meta_point... | Rust | 0 |
= try_load_macos_entry_point()?;
let version = SMBiosVersion {
major: entry_point.major_version(),
minor: entry_point.minor_version(),
revision: 0,
};
let table = try_load_macos_table()?;
Ok(SMBiosData::from_vec_and_version(table, Some(version)))
}
/// Returns smbios raw dat... | Rust | 0 |
w
use super::scope::Listener;
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
use eww_shared_util::{Span, VarName};
use maplit::hashmap;
use simplexpr::{dynval::DynVal, SimplExpr};
use crate::state::scope_graph::ScopeGraph;
pub fn create_fn_verificator() -> (Arc<AtomicBool>, Box<dyn Fn()>) {
let... | Rust | 0 |
if !ty.arguments.is_empty() {
out.write_str("<")?;
let mut it = ty.arguments.iter().peekable();
while let Some(argument) = it.next() {
argument.format(out, extra, level + 1)?;
... | Rust | 0 |
re so that any
early returns that happen inside don't interfere with the macro generated code.
If you don't have an early return (a `return`/`continue`/`break`)
in the code passed to this macro you can use
`extern_fn_panic_handling!{no_early_return; <code here> }`,
which *might* be cheaper(this has not been tested ... | Rust | 0 |
.ec2_vpc_id {
::serde::ser::SerializeMap::serialize_entry(&mut map, "EC2VpcId", ec2_vpc_id)?;
}
::serde::ser::SerializeMap::serialize_entry(&mut map, "GroupDescription", &self.group_description)?;
if let Some(ref tags) = self.tags {
::serde::ser::SerializeMap::serialize_e... | Rust | 0 |
<Box<dyn WindowCallbacks>>,
bitmap: RefCell<GdiBitmap>,
#[cfg(feature = "opengl")]
gl_state: Option<Rc<glium::backend::Context>>,
}
#[derive(Debug, Clone)]
pub struct Window(HWindow);
fn rect_width(r: &RECT) -> i32 {
r.right - r.left
}
fn rect_height(r: &RECT) -> i32 {
r.bottom - r.top
}
fn adju... | Rust | 0 |
ut [u8] {
self.bytes
}
/// Write a slice of `T`s into this memory.
///
/// The `offset` parameter can be used to control the initial offset of the write in bytes.
/// If the `offset` is greater than the length of `self.bytes_mut()` it will be clamped to `self.bytes_mut().len()` (and nothing will be written).
/... | Rust | 0 |
state. The rest of the bits
/// represent the current version.
version: AtomicUsize,
/// All watchers
watchers: Mutex<Watchers>,
/// Task to notify when all watchers drop
cancel: AtomicWaker,
}
type Watchers = FnvHashSet<Watcher>;
/// The watcher's ID is based on the Arc's pointer.
#[derive... | Rust | 0 |
t(&self) {
process::exit(0);
}
fn show(&self) {
let code = self.repl.show();
println!("{}", code);
}
#[inline]
fn clear(&mut self) {
self.repl.clear();
}
}
pub mod errors;
pub mod types;
pub mod store;
// #[macro_use]
// extern crate error_chain;
#[cfg(test)]... | Rust | 0 |
tion
"""
try:
result = self.engine.execute_query(
"""
SELECT table_name, time_column, last_watermark, last_updated
FROM sqlflow_transform_watermarks
ORDER BY table_name, time_column
"""
)
# C... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2015 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 |
Accuracy target (≥81%): {compliance_status}")
print(f" Parameter limit (≤600K): ✅ PASS")
print(f" Sample minimum (≥600): ✅ PASS")
print(f" Data quality checks: ✅ PASS")
print(f" Unified architecture: ✅ PASS")
return model_path, model, metadata
def test_model_variability(model_path):
""... | Python | 1 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 by Ihor E. Novikov
#
# This program 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 (at your option) any later v... | Python | 1 |
_entry.write_to(&mut inner)?;
for _ in 1..version.dir_entries_per_sector() {
DirEntry::unallocated().write_to(&mut inner)?;
}
let sectors = Sectors::new(version, 3 * sector_len as u64, inner);
let allocator = Allocator::new(sectors, difat_sector_ids, difat, fat)
... | Rust | 0 |
print(f"✅ Collected {len(text)} characters")
except Exception as e:
print(f"❌ Error with {url}: {e}")
time.sleep(1)
# Step 2: Structure with LLM
print("\n🤖 Structuring data with GPT-4o...")
structured_data = []
for i, item in enumerate(raw_data):
... | Python | 1 |
state.join_by(&self.columns, |s, c| write!(s, "{}", c), |s| write!(s, ","))?;
write!(state, ") VALUES {} ;", self.values.query_part())
}
}
impl<'q, DB: Database, S: for<'p> ArgSourceList<'p, DB>> BindArgs<'q, DB> for InsertQuery<DB, S>
where
DatabaseValue: for<'p> AppendToArgs<'p, DB>,
{
fn b... | Rust | 0 |
# coding=utf-8
import collections
class TrieNode:
def __init__(self):
self.children = collections.defaultdict(TrieNode)
self.is_w = False
class Trie:
def __init__(self):
self.root = TrieNode()
def insert(self, w):
current = self.root
for c in w:
curr... | Python | 1 |
ind(ApplicationCommandOptionType::String)
.name("league")
.description("which league?")
})
});
}
commands.create_application_command(|command| {
command
.na... | Rust | 0 |
n getattr(cls, '__excluded_on__', ()):
exclusions.exclude(db, op, spec,
"'%s' unsupported on DB %s version %s" % (
cls.__name__, config.db.name,
exclusions._server_version(config.db)))
def beforeTest(self, test):
warnings.resetwarnings... | Python | 1 |
g_ommit_list, o_swig_intf)
writeSwigI(l_lib_dlc, generic_ommit_list, o_swig_intf)
function_ommit = ['int vscnprintf(char *buf, size_t bufsz, const char *format, va_list args)',
'static inline int scnprintf(char *buf, size_t bufsz, const char *format, ...)']
writeSwigI(l_string, generic_ommit_list, o_swig_int... | Python | 1 |
;
const FUNC_TEST_WRITE: usize = 0x666233;
const FUNC_TEST_WRITE_ONE: usize = 0x444555;
const FUNC_TEST_READ_ONE: usize = 0x999888;
const FUNC_TEST_READ_LINE: usize = 0x11117777;
const FUNC_TEST_RESET_TIMER: usize = 0x333;
const FUNC_TEST_READ_TIMER: usize = 0x22;
const FUNC_SWITCH_TASK: usize = 0x666666;
const FUNC_... | Rust | 0 |
})
}
mod aabb;
mod interpolation;
mod transform;
mod trigonometry;
pub use self::aabb::*;
pub use self::interpolation::*;
pub use self::transform::*;
pub use self::trigonometry::*;
/// Converts perceptual (db) into linear ([0, 1]).
pub fn perceptual(db: f32) -> f32 {
const LUT: [f32; 256] = [
1.0, 1.... | Rust | 0 |
::min(
data.target.epoch,
parent_crosslink.end_epoch + spec.max_epochs_per_crosslink
),
Invalid::BadParentCrosslinkEndEpoch
);
}
// Crosslink data root is zero (to be removed in phase 1).
verify!(
attestation.data.crosslink... | Rust | 0 |
let s_api = s_api.send(random::<i32>())?;
let (_, s_user) = s_user.recv()?;
close_mpst(s_api, s_controller, s_storage, s_user)
}
i if i % 2 == 0 => {
let s_controller: EndpointControllerUp<i32> = choose_mpst_controller_to_all!(
s_controlle... | Rust | 0 |
true,
compression: CompressionType::NoCompress,
block_restart_interval: 16,
filter_policy: None,
block_size: 1 << 12,
comparator: Arc::new(BytewiseComparatorImpl::new()),
block_cache: None,
reuse_logs: false,
paranoid_check... | Rust | 0 |
import random
from datetime import datetime
print("")
print("=" * 76)
print("SELAMAT DATANG DI SISTEM PEMESANAN WARUNG PEBRI".center(76))
print(" - KAMI MENYEDIAKAN PRODUK KEBUTUHAN SILAHKAN DI CEK - ".center(76))
print("=" * 76)
lanjut = input("Apakah Anda ingin memesan? (ya/tidak): ").lower()
if lanjut != 'ya':
... | Python | 1 |
r("%Y-%m-%d")
ax1.grid()
ax1.xaxis.set_major_formatter(date_form)
ax1.xaxis.set_major_locator(mdates.WeekdayLocator(interval=1))
fig.autofmt_xdate()
fig.tight_layout()
plt.ylim(0,1.5)
#instantiate a second axes that shares the same x-axis
ax2 = ax1.twinx()
color = 'tab:red'
... | Python | 1 |
story_state::<models::CmdItemState>(history)?;
let mut item = sqlite::find_item_by_uuid(conn, &state.uuid)?;
item.title = state.title.clone();
item.description = state.description.clone();
item.state = state.state;
item.modified = state.modified;
sqlite::update_item(conn, &item)?;
Ok(())
}... | Rust | 0 |
* std::f64::consts::PI / 180.;
delta_psi[i] = (tables::ABCD[i][0] + tables::ABCD[i][1] * jce) * f64::sin(sum_xy);
delta_eps[i] = (tables::ABCD[i][2] + tables::ABCD[i][3] * jce) * f64::cos(sum_xy);
}
let delta_psi_sum: f64 = delta_psi.iter().sum();
let delta_eps_sum: f64 = delta_eps.iter().s... | Rust | 0 |
# True-color Mandelbrot Fractal
# FB36 - 20130113
import math
from PIL import Image
imgx = 800; imgy = 800
image = Image.new("RGB", (imgx, imgy))
pixels = image.load()
xa = -2.0; xb = 1.0
ya = -1.5; yb = 1.5
maxIt = 256 # of iterations
# find max values for |x|, |y|, |z|
maxAbsX = 0.0; maxAbsY = 0.0; maxAbsZ = 0.0
for... | Python | 1 |
, num_channels, int(np.sqrt(num_patches)), int(np.sqrt(num_patches))
)
return visual_tokens # (1, 1024, 24, 24) if llava-7b
def get_llava_vision_model(
model_name: str = "llava-hf/llava-1.5-7b-hf", device: str | torch.device = "cuda"
) -> tuple[LlavaVisualFeature, AutoProcessor]:
"""Get LLaVA model a... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.