text string | label_name string | labels int64 |
|---|---|---|
xt, enum_variant)` tuples, create a dropdown select widget
/// This is exactly the same interface as `Radio` so that both can be used interchangably,
/// with dropdown taking less space in the UI.
pub fn new(
values: impl IntoIterator<Item = (impl Into<LabelText<T>> + 'static, T)> + Clone + 'static,... | Rust | 0 |
from collections import OrderedDict
from faker.utils.decorators import lowercase, slugify
from .. import Provider as InternetProvider
class Provider(InternetProvider):
"""
Provider for internet stuff for en_PH locale
Free email domains are based on anecdotal evidence and experience. Available TLDs are ... | Python | 1 |
"""Compare the outputs of HF and vLLM for Mistral models using greedy sampling.
Run `pytest tests/models/test_llama_embedding.py`.
"""
import pytest
import torch
import torch.nn.functional as F
MODELS = [
"intfloat/e5-mistral-7b-instruct",
]
def compare_embeddings(embeddings1, embeddings2):
similarities = [... | Python | 1 |
import multiprocessing
from maix import audio, time,display,camera,image
class Mult_player:
def __init__(self):
self.process=None
def thread_play(self,audio_file,sample_rate):
print("play")
player=audio.Player(sample_rate=sample_rate)
with open(audio_file, 'rb') as f:
... | Python | 1 |
f64) -> f64 {
libm::log10(x)
}
#[no_mangle]
pub extern "C" fn log10f(x: f32) -> f32 {
libm::log10f(x)
}
#[no_mangle]
pub extern "C" fn logf(x: f32) -> f32 {
libm::logf(x)
}
#[no_mangle]
pub extern "C" fn log2(x: f64) -> f64 {
libm::log2(x)
}
#[no_mangle]
pub extern "C" fn log2f(x: f32) -> f32 {
libm::log2f(x)... | Rust | 0 |
8;
n >>= 1
}
count
}
use log::*;
enum State {
Alive,
Suspect,
Dead,
}
enum Addr {
Ipv4(u8,u8,u8,u8),
Ipv6(String)
}
struct Node {
name: String,
address: Addr,
port: u32,
state: State,
}
/*
struct GossipProtocol {
config: Config,
connections: vec![addr]
}
s... | Rust | 0 |
from setuptools import setup, find_packages
setup(
name="CryptoClasec",
version="1.0.0",
description="A library for various cryptography algorithms (Caesar, Hill Cipher.)",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
author="Ibrahem Abo kila",
a... | Python | 1 |
pt CoercionFailed:
ok = False
else:
ok = True
if not ok or _mod < 1:
raise ValueError("modulus must be a positive integer, got %s" % _mod)
key = _mod, _dom, _sym
try:
cls = _modular_integer_cache[key]
except KeyError:
class cls(ModularInteger):
... | Python | 1 |
# Copyright (C) 2015 Will Metcalf william.metcalf@gmail.com
#
# This program 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 later version.
#
# This p... | Python | 1 |
data: MemoryMappedSource }
}
pub struct MemoryMappedSource {
raw_source: RawMemoryMappedSourceMutPtr
}
impl MemoryMappedSource {
pub fn open(path: String, mode: AccessMode) -> MemoryMappedSource {
MemoryMappedSource {
raw_source: unsafe { open_mmap_src(string_to_cstr!(path), mode) }
}
}
pub fn... | Rust | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-11-10 09:05
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_typ... | Python | 1 |
raise exception.NotImplemented() # pragma: no cover
@abc.abstractmethod
def update_sp(self, sp_id, sp):
"""Update a service provider.
:param sp_id: id of the service provider
:type sp_id: string
:param sp: service prvider object
:type sp: dict
:returns: ... | Python | 1 |
#!/usr/bin/env python3
import argparse
import hashlib
import os
import pathlib
import sys
def gen_blobs(enc_path, dec_path, out_path):
# Sanity checks
pathlib.Path(out_path).mkdir(parents=True, exist_ok=True)
enc_len = len(os.listdir(enc_path))
dec_len = len(os.listdir(dec_path))
out_len = len(os.... | Python | 1 |
alpart=None),
type_=aioxmpp.IQType.SET,
payload=xso.Query(self.client.local_jid.localpart, new_pass)
)
await self.client.send(iq)
async def cancel_registration(self):
"""
Cancels the currents client's account with the server.
Even if the cancellatio... | Python | 1 |
eq!(cpu.memory.bytes[26], 34);
cpu.ticks(9).unwrap();
assert_eq!(cpu.memory.bytes[7], 56);
}
#[test]
fn multiple_registers() {
let mut cpu = cpu_with_code! {
lda #10
ldx #20
sta 0
stx 1
};
cpu.ticks(10).unwrap();
assert_eq!(cpu.memory.bytes[0..2],... | Rust | 0 |
)
} else {
-field_switching::<_, Fr>(&k2_rec)
};
assert_eq!(k2, k2_with_sign_rec);
}
}
}
<gh_stars>1-10
use std::str;
use clap::{App, ArgMatches, SubCommand};
use semver::Version;
use serde::{Deserialize, Serialize};
use casper_node::{
rpcs::{
... | Rust | 0 |
, y, x - 1);
}
if x < Board::WIDTH - 1 && !reached[y][x + 1] && board.rows[y][x + 1].is_none() {
Self::dfs(board, reached, y, x + 1);
}
}
fn count_board_holes(board: &Board) -> usize {
let mut reached = DFSMap::default();
let y = 0;
(0..Board::WIDTH)
... | Rust | 0 |
idle."""
return STE_TO_HA_HVAC.get(self._operation)
@property
def preset_mode(self):
"""Return the current preset mode, e.g., home, away, temp."""
return STE_TO_HA_PRESET.get(self._operation)
@property
def preset_modes(self):
"""Return a list of available preset modes."... | Python | 1 |
::ffi;
use crate::newton::Newton;
use std::marker::PhantomData;
/// Iterator over all the bodies in a NewtonWorld.
#[derive(Debug)]
pub struct Bodies<'a> {
pub(crate) newton: *const ffi::NewtonWorld,
pub(crate) next: *const ffi::NewtonBody,
pub(crate) _phantom: PhantomData<&'a ()>,
}
impl<'a> Iterator fo... | Rust | 0 |
pub fn empty() -> Modifiers {
Default::default()
}
/// Returns `true` if no modifiers are set.
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
/// Returns `true` if all the modifiers in `other` are set.
pub fn contains(&self, other: Modifiers) -> bool {
self.0.c... | Rust | 0 |
expr {
($lhs:expr, "==", $rhs:expr) => {
$crate::parser::ast::ExprNode::Equal(Box::new($lhs), Box::new($rhs))
};
($lhs:expr, "!=", $rhs:expr) => {
$crate::parser::ast::ExprNode::NotEqual(Box::new($lhs), Box::new($rhs))
};
}
macro_rules! term_expr {
($lhs:expr, '+', $rhs:expr) => {
... | Rust | 0 |
import sys
sys.stdin = open('input.txt', 'r')
s1="BABJYP"
s2="ABCBJY"
def LCS(s1, s2):
len1, len2 = len(s1), len(s2)
arr = [[0]*(len1 + 1) for _ in range(len2 + 1)]
for i in range(1, len2 + 1):
for j in range(1, len1 + 1):
if s2[i-1] == s1[j-1]:
arr[i][j] = arr[i-1][j-... | Python | 1 |
rendering: WrImageRendering) -> WrExternalImage {
use crate::wr_translate::translate_external_image_id_wr;
let (tex, wh) = get_opengl_texture(&translate_external_image_id_wr(key))
.map(|(tex, (w, h))| (WrExternalImageSource::NativeTexture(tex), WrDevicePoint::new(w, h)))
.unwrap_or((Wr... | Rust | 0 |
# Copyright 2017 Insurance Australia Group Limited
#
# 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 ag... | Python | 1 |
ntext(|| format!("failed to parse config file '{}'", file_path.display()))?;
match config.as_table() {
Some(t) => {
let defaults = defaults_from_table(t);
let overrides = overrides_from_table(t);
Ok((defaults, overrides))
}
None => {
let defau... | Rust | 0 |
Account<AccountId = <Self as frame_system::Config>::AccountId>
+ Parameter;
type SignerSignature: Verify<Signer = Self::Signer>
+ From<sp_core::ecdsa::Signature>
+ Parameter;
type FromAccountId: From<sp_core::sr25519::Public>
+ IsType<Self::AccountId>
+ Clone
+ core::fmt::Debug
+ PartialEq<Se... | Rust | 0 |
kpoint {:#?} exists, reading", checkpoint_path);
let file = util::open_read_write(&checkpoint_path).await?;
let mut checkpoint = CheckPoint {
option: option.to_owned(),
file,
offset: initial_offset.clone(),
};
... | Rust | 0 |
# Generate treatment effect vector
effect_vector = generate_treatment_effect(effect_type, T, T0, max_effect)
# Simulate data
df = sim_panel(
effect_vector,
N=N,
T=T,
T0=T0,
sigma_list=sigma_list,
hetfx=hetfx,
num_treated=num_treated,
rho=... | Python | 1 |
::AngleBracketed(syn::AngleBracketedGenericArguments { args, .. }) => {
if !args.is_empty() {
match &args[0] {
syn::GenericArgument::Type(ty) => Some(ty.clone()),
_ => None,
}
} else {
None
}
}
_ => None,
}
}
fn compute_subscription_type(arg: &syn::FnArg) -> syn::Type {
let ty = ma... | Rust | 0 |
| slepc_sys::STGetType(self.as_raw(), st_type)) };
check_error(ierr)?;
// Transform c string to rust string
Ok(unsafe { std::ffi::CStr::from_ptr(st_type).to_str().unwrap() })
}
/// Wrapper for [`slepc_sys::STGetKSP`]
///
/// Gets the KSP object associated with the spectral trans... | Rust | 0 |
in_time::DurationSeconds;
use jormungandr_integration_tests::common::file_utils;
use jormungandr_lib::{
crypto::{hash::Hash, key::SigningKey},
interfaces::{Block0Configuration, BlockchainConfiguration, Initial, InitialUTxO},
};
use rand_core::{CryptoRng, RngCore};
use serde::{Deserialize, Serialize};
use std::p... | Rust | 0 |
OK);
}
}
/// Opens a directory as readable, and checks that a child directory cannot be opened as writable.
#[fasync::run_singlethreaded(test)]
async fn open_child_dir_with_extra_rights() {
let harness = TestHarness::new().await;
let root = root_directory(vec![directory("child", vec![])]);
let root_di... | Rust | 0 |
_header_index = fixed_header.fixed_len;
bytes.advance(variable_header_index);
let pkid = bytes.get_u16();
let mut payload_bytes = fixed_header.remaining_len - 2;
let mut return_codes = Vec::with_capacity(payload_bytes);
while payload_bytes > 0 {
let return_code = by... | Rust | 0 |
> for BodyReversed<'_> {
type Item = BasicBlock;
type Iter = Box<dyn Iterator<Item = BasicBlock> + 'graph>;
}
impl graph::GraphPredecessors<'graph> for BodyReversed<'_> {
type Item = BasicBlock;
type Iter = Box<dyn Iterator<Item = BasicBlock> + 'graph>;
}
impl graph::WithPredecessors for BodyReversed<'_> {
... | Rust | 0 |
import time
from time import sleep
import cv2
import numpy as np
from module.automation import auto
from module.config import cfg
from module.decorator.decorator import begin_and_finish_time_log
from module.logger import log
from module.my_error.my_error import unableToFindTeamError, InputAttributeError, backMainWinE... | Python | 1 |
notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//... | Rust | 0 |
SwapConstraints, SWAP_CONSTRAINTS};
use crate::{
curve::{
base::SwapCurve,
calculator::{RoundDirection, TradeDirection},
fees::Fees,
},
error::SwapError,
instruction::{
DepositAllTokenTypes, DepositSingleTokenTypeExactAmountIn, Initialize, Swap,
SwapInstruction, W... | Rust | 0 |
r
/// [`Cx::fail_string`]: struct.Cx.html#method.fail_string
/// [`Cx::fail`]: struct.Cx.html#method.fail
/// [`Ret`]: struct.Ret.html
/// [`actor!`]: macro.actor.html
/// [`actor_new!`]: macro.actor_new.html
/// [`fail!`]: macro.fail.html
/// [`ret_failthru!`]: macro.ret_failthru.html
#[macro_export]
macro_rules! ret_... | Rust | 0 |
= bucket.put_object_with_content_type("/test.file", content, "text/plain").await?;
/// assert_eq!(201, code);
/// Ok(())
/// }
/// ```
#[maybe_async::maybe_async]
pub async fn put_object_with_content_type<S: AsRef<str>>(
&self,
path: S,
content: &[u8],
co... | Rust | 0 |
, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0); /* bottom left */
vertices.add(0.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0, 0.0); /* top left */
vertices.add(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0); /* bottom right */
vertices.add(0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0); /* top right */
// Face 6 (right)
vertices.add(1.0, 0... | Rust | 0 |
dex_and_items()
sbins = first_items.values.astype(np.int64)
group_indices: GroupIndices = tuple(
[slice(i, j) for i, j in zip(sbins[:-1], sbins[1:])]
+ [slice(sbins[-1], None)]
)
unique_coord = Variable(
dims=group.name, data=first_items.index, attrs=... | Python | 1 |
"""
Write a function to interleave 3 lists of the same length into a single flat list.
assert interleave_lists([1,2,3,4,5,6,7],[10,20,30,40,50,60,70],[100,200,300,400,500,600,700])==[1, 10, 100, 2, 20, 200, 3, 30, 300, 4, 40, 400, 5, 50, 500, 6, 60, 600, 7, 70, 700]
"""
def interleave_lists(list1, list2, list3):
r... | Python | 1 |
drc_lct: crate::Reg<ac_adc_drc_lct::AC_ADC_DRC_LCT_SPEC>,
#[doc = "0x244 - ADC DRC Compressor Slope High Setting Register"]
pub ac_adc_drc_hkc: crate::Reg<ac_adc_drc_hkc::AC_ADC_DRC_HKC_SPEC>,
#[doc = "0x248 - ADC DRC Compressor Slope Low Setting Register"]
pub ac_adc_drc_lkc: crate::Reg<ac_adc_drc_lkc:... | Rust | 0 |
"QRSW" => "Norse religion & mythology",
"QRV" => "Aspects of religion",
"QRVA" => "Sacred texts",
"QRVC" => "Criticism & exegesis of sacred texts",
"QRVG" => "Theology",
"QRVH" => "Sermons",
"QRVJ" => "Prayers & liturgical material",
"QRVJ1" => "Worship, rites & ceremonies",
"QRVJ2" => "... | Rust | 0 |
>, state: AppState) -> impl Responder {
let form = form.into_inner();
match state.user_add(&form).await {
Ok(res) => {
info!("register {:?} res: {}", form, res);
ApiResult::new().with_msg("ok").with_data(res)
}
Err(e) => {
error!("regitser {:?} error:... | Rust | 0 |
/// Path to the input if it is on disk
pub path: Option<PathBuf>,
/// Size of the contents of the input
pub len: usize,
}
#[derive(PartialEq, PartialOrd, Eq, Ord)]
pub struct InputPriority {
/// The arbitrary priority for this input
pub weight: usize,
/// The index of the input
pub idx: usi... | Rust | 0 |
from typing import List
from rich.console import Console
from rich.prompt import Prompt
from skyagi.settings import Settings
from skyagi.simulation.agent import GenerativeAgent
class Context:
def __init__(self, console: Console, settings: Settings, webcontext=None) -> None:
self.clock: int = 0
s... | Python | 1 |
itingForQueueSpace,
Expired,
Created,
}
impl fmt::Display for ReportStatusEnum {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
ReportStatusEnum::Submitted => write!(f, "submitted"),
ReportStatusEnum::Running => write!(f, "running"),
ReportSt... | Rust | 0 |
},
(Vl(v), Op::Return) => Res::Ret(v),
(Vl(v), Op::Throw) => Res::Exn(v),
(Vl(Values::Str(path)), Op::Include) => eval_include(path, scope),
(Vl(v), x) => bad_op(&v, None, *x),
(e, _) => e,
}
}
/// Repeatedly dereferences a ptr and returns a copy of the value
fn deref(... | Rust | 0 |
p: &PyObjectRef) -> i32 {
objint::get_value(p).to_i32().unwrap()
}
pub(crate) fn to_usize(p: &PyObjectRef) -> usize {
objint::get_value(p).to_usize().unwrap()
}
pub(crate) fn to_f32(p: &PyObjectRef) -> f32 {
match &p.payload {
PyObjectPayload::Integer { value } => value.to_i32().unwrap() as f32,
... | Rust | 0 |
f (.D(o[0]), .C(clk), .CE(), .R(), .Q(do[0]));
(* LOC=LOC, BEL="BFF", KEEP, DONT_TOUCH *)
FDRE bff (.D(o[1]), .C(clk), .CE(), .R(), .Q(do[1]));
(* LOC=LOC, BEL="CFF", KEEP, DONT_TOUCH *)
FDRE cff (.D(o[2]), .C(clk), .CE(), .R(), .Q(do[2]));
(* LOC=LOC, BEL="DFF", KEEP, DONT_TOUCH *)
FDRE dff (.D... | Python | 1 |
str(avg_from_array(y_gyro_offset_avg)))
print('z_avg_read: ' +
str(avg_from_array(z_gyro_avg)) +
' z_avg_offset: ' +
str(avg_from_array(z_gyro_offset_avg)))
if pidgy.check_time():
y_gyro_offset = pid... | Python | 1 |
_pos(), ref_loc))
mems = location_filtered_candidates
if location_filtered_candidates: # could be [], if so will return []
default_selector_d = {"return_quantity": "ALL"}
selector_d = filters_d.get("selector", default_selector_d)
S = interpret_selector(interpreter, speaker, selector_d)... | Python | 1 |
there. If this happens, try
/// changing the remote shell if you can, or fall back to [`command`](Session::command)
/// and do the escaping manually instead.
///
/// [POSIX compliant]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html
/// [this article]: https://mywiki.wo... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
class QueryUserStatsFieldRequestBody(object):
_types = {
"locale": str,
"stats_type": str,
"start_date": int,
"end_date": int,
... | Python | 1 |
import abc
from typing import List, Type
from seqeval import scheme as s
IOB2 = s.IOB2
BILOU = s.BILOU
IOBES = s.IOBES
Token = s.Token
Entities = s.Entities
def create_tagger(scheme: Type[Token]):
if scheme == IOB2:
return IOB2Tagger()
elif scheme == IOBES:
return StartInsideEndTagger()
... | Python | 1 |
import parmed.unit as units
from intermol.decorators import accepts_compatible_units
from intermol.forces.abstract_bond_type import AbstractBondType
class FeneBondType(AbstractBondType):
__slots__ = ['length', 'kb', 'order', 'c']
@accepts_compatible_units(None, None,
length=un... | Python | 1 |
# Copyright (c) 2024 Microsoft Corporation.
# Licensed under the MIT License
"""The GraphRAG package."""
from graphrag.cli.main import app
app(prog_name="graphrag")
| Python | 1 |
marker later on.
}
else {
if ch > (127 as char) {
return Err(DecodeError::IllegalChar(ch))
}
let val = DECODE_ALPHABET[ch as usize];
if val == 0xFF {
return Err(DecodeError::IllegalChar(ch))
}
val
... | Rust | 0 |
ak;
default:
const defaultVal = "default";
return defaultVal;
}
"#;
let r: Result<ScopeManager, SwcDiagnosticBuffer> = ast_parser.parse_module(
"file_name.ts",
syntax,
source_code,
|parse_result, _comments| {
let module = parse_result?;
let mut scope_visitor = Scop... | Rust | 0 |
add_subscriber(subscriber.clone());
unsafe { libc::close(sock2.as_raw_fd()) };
event_manager.run_with_timeout(100).unwrap();
event_manager.run_with_timeout(100).unwrap();
event_manager.run_with_timeout(100).unwrap();
// Since the subscriber did not remove the event from its watch list, the
//... | Rust | 0 |
_structure(self) -> bool:
"""
Validate the structure of the transaction.
Returns:
bool: True if the transaction structure is valid, False otherwise
"""
# Basic structure validation
if not self.sender or not self.receiver:
return False
... | Python | 1 |
let (pattern, time) = &*pattern_time.lock().unwrap();
if time.elapsed().as_millis() > MAX_MILLIS * 10 {
// We assume a loop / too long behaviour in pulldown-cmark.
// We print the pattern and exec ourselves again to not infinite-loop a thread.
... | Rust | 0 |
"""initial
Revision ID: a0f53370c44b
Revises:
Create Date: 2024-03-01 15:31:22.722972
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = 'a0f53370c44b'
down_revision: Union[str, None] = None
branch_labels: Union[str, Seque... | Python | 1 |
, FixedBitsCast, FixedBitsOptionalArbitrary, FixedBitsOptionalBorsh,
FixedBitsOptionalNum, FixedBitsOptionalSerde,
};
use crate::{
helpers::{Sealed, Widest},
types::extra::{LeEqU128, LeEqU16, LeEqU32, LeEqU64, LeEqU8, Unsigned},
F128Bits, FixedI128, FixedI16, FixedI32, FixedI64, FixedI8, FixedU128, Fixe... | Rust | 0 |
mole_delta += airflow;
cur_info.mole_delta = target_delta;
}
info.entry(cur_index).and_modify(|info| *info = cur_info);
}
}
static PLANET_TURF_CYCLE: AtomicBool = AtomicBool::new(false);
pub(crate) fn equalize(
equalize_hard_turf_limit: usize,
high_pressure_turfs: &[NodeIndex<usize>],
) -> usize {
let turf... | Rust | 0 |
from core.app.app_config.base_app_config_manager import BaseAppConfigManager
from core.app.app_config.common.sensitive_word_avoidance.manager import SensitiveWordAvoidanceConfigManager
from core.app.app_config.entities import RagPipelineVariableEntity, WorkflowUIBasedAppConfig
from core.app.app_config.features.file_upl... | Python | 1 |
removals_res.coins,
removals_res.proofs,
block_i.foliage_transaction_block.removals_root,
)
if validated is False:
await peer.close()
return None
removed_coins = []
... | Python | 1 |
child="s0_sp37 s0_sp42" rule="<" category="S[mod=nm,form=base,fin=t]" end="6" begin="2" id="s0_sp36"/>
<span child="s0_sp38 s0_sp41" rule="<" category="S[mod=nm,form=base,fin=f]" end="5" begin="2" id="s0_sp37"/>
<span child="s0_sp39 s0_sp40" rule="<" category="S[mod=nm,form=cont,fin=f]" end... | Rust | 0 |
ert len(kspace.shape) == 3
if not is_testing:
target = target.astype(np.float32)
target = to_tensor(target)
max_value = attrs["max"].astype(np.float32)
else:
target = torch.tensor(0)
max_value = 0.0
kspace = to_... | Python | 1 |
import matplotlib.pyplot as plt
import numpy as np
import math
from scipy import linalg
# def A
A = np.array([
[ 4, 2, -2, 6],
[ 2, 5, 5, 1],
[-2, 5, 26, -10],
[ 6, 1, -10, 12]
])
#cholesky methode
def cholesky(A):
n = len(A)
L = np.zeros_like(A)
for i in range(n):
for j in r... | Python | 1 |
None,
operand4: None,
lock: false,
rounding_mode: None,
merge_mode: None,
sae: false,
mask: None,
broadcast: None,
},
&[102, 15, 239, 211],
OperandSize::Qword,
)
}
#[test]
fn pxor_8() {
run_test(
... | Rust | 0 |
ch fn {
get_type => || gtk_sys::gtk_constraint_layout_get_type(),
}
}
impl ConstraintLayout {
pub fn new() -> ConstraintLayout {
assert_initialized_main_thread!();
unsafe { LayoutManager::from_glib_full(gtk_sys::gtk_constraint_layout_new()).unsafe_cast() }
}
}
impl Default for Cons... | Rust | 0 |
ed by `argparse`.
*([f'--gcc-override-flags="{gcc_override_flags}"'] if gcc_override_flags is not None else []),
*(["--use-makefile-info-pkl"] if use_makefile_info_pkl else []),
*(["--verbose"] if verbose else []),
]
ret = run_docker_command(cmd, user=user_id, return_... | Python | 1 |
result
};
// iterate through all attributes in a field
let field_fold = |result: CompoundIndexOptions, field: &Field| {
field
.attrs
.iter()
.fold(result, |cio, attr| attrs_fold(cio, field, attr))
};
// iterate through all fields
let compound_index =... | Rust | 0 |
'width_loss': width_loss
},
'pred': {
'pos': prob,
'cos': cos_pred,
'sin': sin_pred,
'width': width_pred
}
}
def get_ground_truth(self,target,prediction):
gt_patches = []
pre_patch... | Python | 1 |
getInvestorID(self):
'''ๆ่ต่
ไปฃ็ '''
return str(self.InvestorID, 'GBK')
def getreserve1(self):
'''ไฟ็็ๆ ๆๅญๆฎต'''
return str(self.reserve1, 'GBK')
def getExchangeID(self):
'''ไบคๆๆไปฃ็ '''
return str(self.ExchangeID, 'GBK')
def getOrderSysID(self):
'''ๆฅๅ็ผๅท'''
... | Python | 1 |
ry root.
const DEFAULT_CONFIG_PATH: &str = "config.toml";
const DEFAULT_TEMPLATE_PATH: &str = "document.template";
#[tokio::main]
async fn main() {
pretty_env_logger::init();
let matches = cli::cli().get_matches();
let config_path = matches.value_of("config").unwrap_or(DEFAULT_CONFIG_PATH);
info!("Tr... | Rust | 0 |
Options) -> Result<(), BlockingError<E>>;
}
impl <T, E> BlockingTransmit<E> for T
where
T: Transmit<Error = E> + DelayUs<u32>,
E: core::fmt::Debug,
{
fn do_transmit(&mut self, data: &[u8], tx_options: BlockingOptions) -> Result<(), BlockingError<E>> {
// Enter transmit mode
self.start_tran... | Rust | 0 |
"""
Module: 'socket' on micropython-esp32-1.15
"""
# MCU: {'ver': '1.15', 'port': 'esp32', 'arch': 'xtensawin', 'sysname': 'esp32', 'release': '1.15.0', 'name': 'micropython', 'mpy': 10757, 'version': '1.15.0', 'machine': 'ESP32 module with ESP32', 'build': '', 'nodename': 'esp32', 'platform': 'esp32', 'family': 'micro... | Python | 1 |
o()
}
_ => state.into(),
},
_ => self,
}
}
/// Callback when a previously scheduled event fired.
pub fn on_timed_event(self, sta: &mut Client, event_id: EventId) -> States {
// Lookup the event matching the given id.
let event ... | Rust | 0 |
"{text}\n\n์ ํ
์คํธ์ ์์ฃผ ์งง์ ์์ฝ์ ๋ฌด์์ธ๊ฐ์?", "{summary}"),
("{text}\n์์ ์ธ๊ธํ ํ
์คํธ๋ฅผ ํ ๊ตฌ์ ๋ก ์์ฝํ์ธ์.", "{summary}"),
("{text}\n์ ๋จ๋ฝ์ ๋ํ ๊ฐ๋จํ ์์ฝ์ ์์ฑํ ์ ์๋์?", "{summary}"),
("์ด ์์ฝ์ ๋ฐ๋ผ ๋ฌธ์ฅ์ ์์ฑํ์ธ์: {summary}", "{text}"),
("\"{summary}\"๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ๋ฌธ์ฅ์ ์์ฑํ์ธ์.", "{text}"),
],
'ko_summary2': [
("๋ค์ ... | Python | 1 |
plt.plot(test_x_sample.squeeze(), y_pred[id], 'g')
plt.scatter(train_x_sample, train_y_sample, c='tomato', zorder=10, label='Observations')
plt.grid(True)
plt.tick_params(axis='both', bottom='off', top='off', left='off', right='off',
labelbottom='off', labeltop='of... | Python | 1 |
8),
Draw(RegIdx, RegIdx, u8),
IfKeyEq(RegIdx),
IfKeyNeq(RegIdx),
GetDelay(RegIdx),
GetKey(RegIdx),
SetDelayTimer(RegIdx),
SetSoundTimer(RegIdx),
AddPointer(RegIdx),
LoadSprite(RegIdx),
StoreBCD(RegIdx),
RegDump(RegIdx),
RegLoad(RegIdx),
RegDumpRPL(RegIdx),
RegLoadRPL(RegIdx)
}
fn parse_opco... | Rust | 0 |
TestPool {
_workers: workers,
sender_: send,
}
}
pub fn execute<F>(&self, closure: F)
where
F: FnOnce() + Send + 'static,
{
self.sender_
.send(Box::new(closure))
.expect("Thread shut down too early");
}
}
#[cfg(test)]
mod test... | Rust | 0 |
# ่ช้ณ/้ณๆ้็ฅ
def play_audio(detections=None, params=None):
# TODO: ๅฏฆไฝ่ช้ณๆ็นๆ้ณๆ็คบ
pass
| Python | 1 |
s = 0
n = 0
m = 0
c = 0
lista2 = []
lista = [12, 15, 13, 10, 12, 13, 12, 15, 10, 9, 5, 18]
for n in lista:
s += n
c += 1
m = s / c
print('Soma da lista: ', s)
print(f'Mรฉdia da lista: {m:.2f}')
| Python | 1 |
ndustryService::new(pool.clone());
let item_service = ItemService::new(pool.clone());
let project_service = ProjectService::new(pool.clone(), asset_service.clone());
let universe_service = UniverseService::new(pool.clone());
start(
asset_service,
character_service,
eve_s... | Rust | 0 |
value_unit(1, Unit::Imperial(Mile));
let mile_to_inch = mile.to(Unit::Imperial(Inch));
assert_eq!(mile_to_inch.unit, Unit::Imperial(Inch));
assert_eq!(mile_to_inch.value, 63360.0);
let mile_to_foot = mile.to(Unit::Imperial(Foot));
assert_eq!(mile_to_foot.unit, Unit::Imperial(Foot));
assert_eq!... | Rust | 0 |
dElement {
self.square_times(1)
}
/// Performs 2 * self^2.
pub fn double_square(&self) -> FieldElement {
let mut double_square = self.square_times(1);
for i in 0..5 {
double_square.0[i] *= 2;
}
double_square
}
/// Performs self^{2^250 - 1}.
/... | Rust | 0 |
query_labels.append([class_id] * n_query)
support_set = np.concatenate(support_set, axis=0)
query_set = np.concatenate(query_set, axis=0)
support_labels = np.concatenate(support_labels, axis=0)
query_labels = np.concatenate(query_labels, axis=0)
return support_set, support_labels, query_set, qu... | Python | 1 |
'''
Christopher Anciano 3/22/24
Youtube Video Downloader
'''
from pytube import YouTube # Import the YouTube class from the pytube library
import tkinter as tk # Import the tkinter library as tk for creating GUI
from tkinter import filedialog # Import the filedialog module from tkinter for opening file dialogs
def... | Python | 1 |
.5) * math.pi * zoom
init_x[None] = [0.1, 0.5]
init_v[None] = [0.3 * math.cos(alpha), 0.3 * math.sin(alpha)]
loss[None] = 0
clear()
forward(visualize=False)
print(loss[None])
losses.append(loss[None])
angles.append(math.degrees(alpha))
plt.plot(angl... | Python | 1 |
// let mut path = os::getcwd().unwrap();
// path.push(game.trim());
let mut reader = File::open(format!("games/{}", game)).unwrap();
load_to_memory(cpu, &mut reader);
}
fn load_to_memory(cpu: &mut Cpu, reader: &mut File) {
for byte in reader.bytes() {
match byte {
Ok(value) => ... | Rust | 0 |
#[cfg(feature = "u128")] { 17 }
#[cfg(not(feature = "u128"))] { 13 }
}] = [
BIT, KILO_BIT, KIBI_BIT, MEGA_BIT, MEBI_BIT, GIGA_BIT, GIBI_BIT,
TERA_BIT, TEBI_BIT, PETA_BIT, PEBI_BIT, EXA_BIT, EXBI_BIT,
#[cfg(feature = "u128")] ZETTA_BIT,
#[cfg(feature = "u128")] ZEBI_BI... | Rust | 0 |
output="รฏ" />
</action>
<action id="ad08_I">
<when state="none" output="I" />
<when state="1dk" output="ร" />
<when state="grave" output="ร" />
<when state="circumflex" output="ร" />
<when state="tilde" output="ฤจ" />
<whe... | Python | 1 |
fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(1 << 3)) | ((value as u32 & 1) << 3);
self.w
}
}
#[doc = "\n\nValue on reset: 0"]
#[deri... | Rust | 0 |
import numpy
import scipy
print("โ
All dependencies satisfied (including chart generation)")
charts_available = True
except ImportError as e:
print(f"โ ๏ธ Chart dependencies missing: {e}")
print("๐ Charts will not be available without these packages")
charts_av... | Python | 1 |
_mcast_port",
high_availability::corosync_conf::change_mcast_port,
)
.add_plugin("add_firewall_port", firewall_cmd::add_port)
.add_plugin("remove_firewall_port", firewall_cmd::remove_port)
.add_plugin("pcs", high_availability::pcs)
.add_plugin("lctl", lustre::lctl)
... | Rust | 0 |
d: CpuLockCell::new(None),
owning_task: CpuLockCell::new(None),
}
}
}
<reponame>rodrimati1992/tstr<filename>tstr/src/to_uint.rs<gh_stars>1-10
mod sealed {
#[doc(hidden)]
pub trait Sealed: Sized {}
}
use sealed::Sealed;
/// Converts a [`TStr`] to unsigned integers.
///
/// # Example
///
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.