text string | label_name string | labels int64 |
|---|---|---|
cret key.
"""
private_key = coincurve.PrivateKey.from_int(secret_key)
signature = private_key.sign_recoverable(msg_hash, hasher=None)
return (
U256.from_be_bytes(signature[0:32]),
U256.from_be_bytes(signature[32:64]),
U256(signature[64]),
)
def encode_to_hex(data: Union[by... | Python | 1 |
`\"Win32_Security_Cryptography\"`*"]
pub const ENUM_SETUPPROP_REQUESTFILE: CASetupProperty = 14i32;
#[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"]
pub const ENUM_SETUPPROP_WEBCAMACHINE: CASetupProperty = 15i32;
#[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"]
pub const ENUM_SETUPPRO... | Rust | 0 |
_buffers: &[&[u8]],
_last_dst_plane: usize,
dst_strides: &[usize],
dst_buffers: &mut [&mut [u8]],
channels: PixelFormatChannels,
colorimetry: Colorimetry,
) -> bool {
if last_src_plane != 2
|| last_src_plane >= src_strides.len()
|| last_src_plane >= src_buffers.len()
|| d... | Rust | 0 |
= self.len();
if len_to_cut >= len {
self.clear();
} else {
self.resize(len - len_to_cut, value);
}
}
fn get_slice(&self) -> &[T] {
return self.as_slice();
}
fn replace(&mut self, index: usize, value: T) {
self[index] = value;
}
}
#[d... | Rust | 0 |
EventExtraData::SyscallEvent(ev) => ev,
_ => panic!("Not a syscall event"),
}
}
pub fn syscall_event_mut(&mut self) -> &mut SyscallEventData {
match &mut self.event_extra_data {
EventExtraData::SyscallEvent(ev) => ev,
_ => panic!("Not a syscall event"),
... | Rust | 0 |
} else {
return Some(btt.clone());
}
}
None
}
pub fn plan_coerce<'a>(
ecx: &'a ExprContext,
e: CoercibleScalarExpr,
coerce_to: &ScalarType,
) -> Result<HirScalarExpr, anyhow::Error> {
use CoercibleScalarExpr::*;
Ok(match e {
Coerced(e) => e,
Literal... | Rust | 0 |
import unittest
import lib.viterbi as viterbi
class TestSimpleViterbiDecoder(unittest.TestCase):
def setUp(self):
self.init_probs = [0.5, 0.5]
self.transition_probs = [
[0.9, 0.1],
[0.1, 0.9],
]
self.emission_probs = [
[0.7, 0.3],
[... | Python | 1 |
Images Test
query_dataset_test = CVUSADatasetEval(data_folder=config.data_folder ,
split="test",
img_type="query",
transforms=ground_transforms_val,
... | Python | 1 |
tnCardLicenseTimeStamp,
"tnCardLicenseRmaKey": tnCardLicenseRmaKey,
"tnCardMirrorLoopbackNoServPort": tnCardMirrorLoopbackNoServPort,
"tnCardDNRLEDColor": tnCardDNRLEDColor,
"tnCardTestHdNoServPort": tnCardTestHdNoServPort,
"tnCardAmbientTemp": tnCardAmbientTemp,
"tnCardRpmRea... | Python | 1 |
🔍 strategy after assignment: {strategy}")
# print(f"🔍 confidence after assignment: {confidence}")
# # print(recomment)
# # print(f"🔍 analysis after assignment: {sdf}")
# # # print(strategy)
# # print(recomment[0])
# if recomment:
# for idx, lesson in enumer... | Python | 1 |
se(self)
}
}
impl<Inner: HalfDuplexLayered + ReadStrLayered + WriteStr> WriteStr for TextDuplexer<Inner> {
#[inline]
fn write_str(&mut self, s: &str) -> io::Result<()> {
TextOutput::write_str(self, s)
}
}
impl<Inner: HalfDuplexLayered + ReadStrLayered + WriteStr> WriteText for TextDuplexer<Inn... | Rust | 0 |
= "Write proxy for field `MPU_RASR_A2`"]
pub struct MPU_RASR_A2_W<'a> {
w: &'a mut W,
}
impl<'a> MPU_RASR_A2_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u32) -> &'a mut W {
self.w.bits = (self.w.bits & !0xffff_ffff) | ((value as u32) & 0xff... | Rust | 0 |
req: HttpRequest,
body: web::Bytes,
certs: Option<ClientCertificateChain>,
) -> Result<HttpResponse, HttpEndpointError> {
publish(
sender,
auth,
commands,
channel.into_inner(),
None,
opts,
req,
body,
certs,
)
.await
}
#[all... | Rust | 0 |
# Databricks notebook source
# MAGIC %md
# MAGIC # Imports
# COMMAND ----------
from pyspark.sql import SparkSession, DataFrame
from pyspark.sql import functions as F, Window
from datetime import datetime, timedelta
import pandas as pd
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from t... | Python | 1 |
lidated.render_range_chunks <= 4 || validated.render_range_chunks > 256 {
warn!(
"Incorrect render_range_chunks {}, resetting to default",
validated.render_range_chunks
);
validated.render_range_chunks = defaults.render_range_chunks;
}
validated
}
<reponame>direvi... | Rust | 0 |
tion_TO::from_sabi`
](../../sabi_trait/doc_examples/struct.Action_TO.html#method.from_sabi)
This allows calling methods on the `.obj` field of `<trait>_TO`
that consume the backend and return it back.
For [`Action_TO`] specifically, [`RObject`] is the backend.
**Example:**
```rust
use abi_stable::{
pointer_trait... | Rust | 0 |
ochrome || fgd->chroma_scaling_from_luma ||
(seqhdr.ss_ver == 1 && seqhdr.ss_hor == 1 && !fgd->num_y_points))
{
fgd->num_uv_points[0] = fgd->num_uv_points[1] = 0;
} else for (int pl = 0; pl < 2; pl++) {
fgd->num_uv_points[pl] = gb.get_bits( 4);
if (fgd->nu... | Rust | 0 |
#[inline]
fn lua_read_at_position(lua: LU, index: i32) -> Result<($ty,), LU> {
LuaRead::lua_read_at_position(lua, index).map(|v| (v,))
}
}
);
($first:ident, $($other:ident),+) => (
#[allow(non_snake_case)]
impl<'lua, LU, FE, OE, $firs... | Rust | 0 |
#!/usr/bin/env python
"""
Script de Diagnóstico do Modelo Book - Problema de Capas
Arquivo: tests/book_model_diagnostic.py
Objetivo: Investigar campos de imagem no modelo Book e como estão sendo populados
"""
import os
import sys
import django
from pathlib import Path
# Configurar Django
sys.path.append(os.path.join(... | Python | 1 |
::ptr;
mod macros;
mod constants;
pub use constants::*;
mod manual;
pub use manual::*;
mod generated;
pub use generated::*;
use methods::*;
mod ffi {
use std::os::raw::{c_char, c_int, c_uchar, c_void};
extern "C" {
pub fn wxObject_delete(self_: *mut c_void);
pub fn AppSetOnInit(aFn: *mut c... | Rust | 0 |
Crie um programa que solicite um número ao usuário e use um
laço while para gerar e exibir a sequência de Collatz até chegar
ao número 1. | Python | 1 |
for c in config:
cs = re.split(r"(\d.*)", c)
if len(cs) < 2:
continue
key, val = cs[:2]
if key == "mstd":
# noise param injected via hparams for now
hparams.setdefault("magnitude_std", float(val))
elif key == "m":
magnitude = int(v... | Python | 1 |
as s_SID;
/*
* We use "unique = 0" because duplicate strings are impossible
* at this stage unless the original font already had duplicates.
*/
/*
* Check if multiply-encoded glyph.
*/
let mut j = 0;
while (... | Rust | 0 |
/// use chickenwire::coordinate::cube::Cube;
///
/// let origin_diagonals = vec![
/// Cube::force_from_coords(1, -2, 1),
/// Cube::force_from_coords(-1, -1, 2),
/// Cube::force_from_coords(-2, 1, 1),
/// Cube::force_from_coords(-1, 2, -1),
/// Cube::force_from_coords(1, 1... | Rust | 0 |
import requests
import telebot
import datetime
import sys
from keys import BOT_Token,Visual_API
API=Visual_API
TELEGRAM_BOT_TOKEN = BOT_Token
bot = telebot.TeleBot(BOT_Token)
#Current time
def get_current_hour():
# Get the current time
current_time = datetime.datetime.now()
# Extract the current hour (... | Python | 1 |
}
pub fn get_finished_trips(&self) -> FinishedTrips {
let mut result = FinishedTrips {
unfinished_trips: self.unfinished_trips,
finished_trips: Vec::new(),
};
for t in &self.trips {
if let Some(end) = t.finished_at {
result
... | Rust | 0 |
xc6\xa3\
Sc\x16\x8bN2\xbf\xbc\x7f#\x15\xa1v\x1c\x0f\
\xbdFQ\x87\x1cU\xbb\x86\x966\xc1\x87j\x9f3U\
\xc9\x1dsQ(\xb6\xced\xa0\xe0\xf0\x14\xe8\xe4do\
jH\xf0\xeb\x93N1\x13\xf2\xf4\xa9\x8cZd$\xdb\
4\xb4\xd9\xc9\xb8@\xd2\xb3\x0c\xf4\x22\xb7$\x10<\xa1\
%\x8bv\xe3\xc1\xaer\x05\x02\xed$L\xe0r>\xb5\
\xdbi\xda|z\x9a\xe1\xee\x169@... | Python | 1 |
nteger | TokenKind::Str |
TokenKind::TypeIntAtom | TokenKind::TypeIntVector |
TokenKind::TypeReal | TokenKind::TypeString |
TokenKind::KwDefault => {}
_ => return Err(SvError::syntax(t, "struct init. Expecting identifier/integer/default"))
}
... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under both the MIT license found in the
# LICENSE-MIT file in the root directory of this source tree and the Apache
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source ... | Python | 1 |
import cv2
import numpy as np
img = cv2.imread("pele.png")
# drawing a line
# cv2.line(img,(100,100),(100,200),(255,0,0),5)
# drawing a rectangle
# cv2.rectangle(img,(100,100),(200,200),(255,0,0),5)
# drawing a circle
# cv2.circle(img,(240,60),100,(255,0,0),5)
# drawing a polygon
# pts = np.array([[100,100],[400,10... | Python | 1 |
ube3x3x3Faces::idx(CubeFace::Right, 0, 1),
Cube3x3x3Faces::idx(CubeFace::Front, 0, 1),
],
// Front
[
Cube3x3x3Faces::idx(CubeFace::Top, 2, 1),
Cube3x3x3Faces::idx(CubeFace::Left, 1, 2),
Cube3x3x3Faces::idx(CubeFace::Right, 1, 0),
Cube3x3x3Faces::idx(CubeFace::Bottom, ... | Rust | 0 |
uiroot = UI(Tk, packanchor='n', name='root', title='TkUIMaker', children=[
UI(Frame, packside='left', children=[
UI(Frame, packside='top', children=[
UI(BoxedList, name='history'),
UI(Frame, packside='left', children=[
UI(Label, text='Exec: '),
... | Python | 1 |
tados['MODELO_PROD']='RNDS'
sublineas = resultados['COD_CATEGORIA_TEMP'].unique()
if verbose:
print(f'Se han generado {resultados.shape[0]} recomendaciones')
return resultados[config_data['columnas_recom_prods']]
except:
return pd.DataFrame()
def RecomendarBase_REstricc... | Python | 1 |
e": "Labels",
"description": "Labels",
"items": {
"$ref": "#/definitions/labels"
},
"order": 2
},
"note_entities": {
"type": "array",
"title": "Note Entities",
"description": "Note entities",
"items": {
... | Python | 1 |
ib = deflate::write::ZlibEncoder::new(
Vec::new(),
self.info.compression.clone().to_options(),
);
let bpp = self.info.bpp_in_prediction();
let filter_method = self.options.filter;
let adaptive_method = self.options.adaptive_filter;
for line in data.chunks... | Rust | 0 |
vance(16);
assert_eq!(a, b"o yah world zomg wat wat"[..]);
a.advance(4);
assert_eq!(a, b"h world zomg wat wat"[..]);
// Reserve some space.
a.reserve(1024);
assert_eq!(a, b"h world zomg wat wat"[..]);
a.advance(6);
assert_eq!(a, b"d zomg wat wat"[..]);
}
#[test]
#[should_panic]
fn ad... | Rust | 0 |
te::{
models::{
types::*,
membership::MembershipType,
},
traits::id::{
DestinyMembershipID,
PlatformType,
}
},
serde::Deserialize,
};
/// [Bungie documentation](https://bungie-net.github.io/multi/schema_GroupsV2-GroupUserInfoCard.h... | Rust | 0 |
elif self.dcc == fxentities.DCC.blender:
pass
elif self.dcc == fxentities.DCC.houdini:
self._save_workfile_houdini(workfile_path)
self._set_workfile_metadata(
file_name=workfile_name,
file_path=workfile_path,
file_dir=... | Python | 1 |
if "env" in a["name"]:
arg2 = a["value"]
tree.get_child(lg["parentProcessId"]).add_child(
lg["processId"],
{
"desc": arg["... | Python | 1 |
time) # Convert to timedelta
if len(data_batch) >= batch_size:
insert_start = time.time()
cursor.executemany("""
INSERT INTO technical_indicators (symbol_id, timeframe, timestamp, indicator_name, indicator_value)
... | Python | 1 |
expiration date is specified by the encoded date.
issue_date Decoded issue date is returned here. Expects atcacert_tm_utc_t.
expire_date Decoded expire date is returned here. If there is no
expiration date, the expire date will be set to... | Python | 1 |
"shade": "Grey"
},
{
"name": "Light Steel Blue",
"hex": "B0C4DE",
"rgb": [176, 196, 222],
"hsl": [151, 104, 199],
"shade": "Blue"
},
{
"name": "Light Wood",
"hex": "856363",
"rgb": [133, 99, 99],
"hsl": [0, 37, 116],
"shade": "Brown"
},
{
"name": "<NAME>",
"h... | Rust | 0 |
# -*- coding: utf-8 -*-
#
# This file is part of BES.NAURU.LIMS.
#
# BES.NAURU.LIMS 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, version 2.
#
# This program is distributed in the hope that it will be useful... | Python | 1 |
"Protocol closed before a channel was opened",
))
})
}
pub mod tcp {
use async_std::net::{TcpListener, TcpStream};
use async_std::prelude::*;
use async_std::task;
use std::io::{Error, ErrorKind, Result};
pub async fn pair(port: u16) -> Result<(TcpStream, TcpStream)> {
... | Rust | 0 |
# data_structures/deepchainmap.py
# From https://github.com/neutrinoceros/deep_chainmap; MIT License
# Copied here for easier maintainability
from typing import Any, Mapping
from collections import ChainMap
def _depth_first_update(target: dict, source: Mapping) -> None:
for key, val in source.items():
i... | Python | 1 |
from fastapi import FastAPI, UploadFile, File, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from PIL import Image, UnidentifiedImageError
import numpy as np
import tensorflow as tf
import logging
app = FastAPI()
# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],... | Python | 1 |
12, MonoTextStyle};
use eg::pixelcolor::Rgb565;
use eg::prelude::*;
use eg::primitives::{PrimitiveStyleBuilder, Rectangle};
use eg::text::Text;
use heapless::consts::U256;
use heapless::String;
use bitfield::bitfield;
#[entry]
fn main() -> ! {
let mut peripherals = Peripherals::take().unwrap();
let core = Cor... | Rust | 0 |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SSL_DISABLE = False
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_RECORD_QUERIES = True
MAIL_SERVER = 'smtp.qq.com'
MAIL_PORT = 587
MAIL_USE_TL... | Python | 1 |
, 255, 255, 255, 255, 255,
127,
];
DiscreteFiniteFieldFormat::strict_decode(&bytes[..]).unwrap();
}
#[test]
#[should_panic(expected = "DataIntegrityError")]
fn test_garbage_data_format1() {
let bytes: Vec<u8> = vec![2, 2, 4, 0, 0, 0, 0, 255, 255, 127, 127];
D... | Rust | 0 |
match x:
case : ...
| Python | 1 |
i32;
#[cfg(not(feature = "libc"))]
#[allow(non_camel_case_types)]
#[cfg(target_family = "windows")]
type wchar_t = u16;
extern "C" {
pub fn Py_DecodeLocale(arg1: *const c_char, arg2: Py_ssize_t) -> *mut wchar_t;
#[cfg_attr(PyPy, link_name = "PyPySys_GetObject")]
pub fn PySys_GetObject(arg1: *const c_char... | Rust | 0 |
_BBBW__\n___BB___")
];
let start = Instant::now();
for b in ffo_positions.iter() {
let mut to = false;
println!("Board: \n{}", b);
println!("Board: \n{:?}", b);
evals.prune_board(*b);
evals.n_rounds(3000);
println!("Solving...");
let score = evals.s... | Rust | 0 |
# rename .env.example to .env and add the following:
# SERPER_API_KEY=your_serper_api_key
# OPENAI_API_KEY=your_openai_api_key
from crewai import Crew, Agent, Task, LLM
import litserve as ls
from crewai_tools import SerperDevTool
# If you'd like, you can use a local LLM as well through Ollama. Do this:
# ollama pull ... | Python | 1 |
from typing import List
from fastapi import APIRouter, Body, Query, Request, HTTPException # 导入FastAPI组件
from APIResponseModel import ResponseModel, ErrorResponseModel # 导入响应模型
from douyin.web.web_crawler import DouyinWebCrawler # 导入抖音Web爬虫
router = APIRouter()
DouyinWebCrawler = DouyinWebCrawler()
# 获取单个作品数据
... | Python | 1 |
eSSHCredsResponse {
pub allowed_users: Option<String>,
pub admin_user: Option<String>,
pub cidr_list: Option<String>,
pub default_user: Option<String>,
pub exclude_cidr_list: Option<String>,
pub install_script: Option<String>,
pub key: String,
pub key_bits: Option<u64>,
pub key_optio... | Rust | 0 |
import phpy
IMPL = "libiconv"
VERSION = "1.16"
MIME_DECODE_STRICT = 1
MIME_DECODE_CONTINUE_ON_ERROR = 2
def strlen(_string, _encoding=None):
return phpy.call('iconv_strlen', _string, _encoding)
def substr(_string, _offset, _length=None, _encoding=None):
return phpy.call('iconv_substr', _string, _offset, _l... | Python | 1 |
r").to_bytes()
pub const BINDINGSIG_BASEPOINT_BYTES: [u8; 32] = [
145, 90, 60, 136, 104, 198, 195, 14, 47, 128, 144, 238, 69, 215, 110, 64, 72, 32, 141, 234, 91,
35, 102, 79, 187, 9, 164, 15, 85, 68, 244, 7,
];
use prost_build::Config;
fn main() {
Config::new()
.include_file("lib.rs")
.comp... | Rust | 0 |
the given
/// `DotWrite`.
fn visit_node(&self, node: NR, f: &mut DotWrite<'_, '_>) -> fmt::Result;
/// Visits this edge. The implementation may output a label for this edge to the given
/// `DotWrite`.
fn visit_edge(&self, edge: ER, f: &mut DotWrite<'_, '_>) -> fmt::Result;
// TODO: allow more... | Rust | 0 |
ate(&mut self) {
self.inner = None;
}
pub(crate) fn iter(&self) -> SingletonTableIter<V> {
self.inner.clone().into_iter().map(|v| Ok(((), v)))
}
pub(crate) fn batch_commit(&mut self, batch: TableBatch<(), V>) {
for op in batch.0 {
self.inner = match op {
... | Rust | 0 |
_method) = __jni_env.require_class_method("javax/crypto/KeyAgreementSpi\0", "engineGenerateSecret\0", "(Ljava/lang/String;)Ljavax/crypto/SecretKey;\0");
// __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
// }
// }
}
}
<filename>src/graphics/color3... | Rust | 0 |
bs<I: Into<::bobbin_bits::R16>, F: FnOnce(Prbs) -> Prbs>(&self, index: I, f: F) -> &Self {
self.prbs_reg().set(index.into(), f);
self
}
#[doc="Modify the PRBS register."]
#[inline] pub fn with_prbs<I: Into<::bobbin_bits::R16> + Copy, F: FnOnce(Prbs) -> Prbs>(&self, index: I, f: F) -> &Self ... | Rust | 0 |
ocsrs, doc(cfg(feature = "spi")))]
pub struct Pins<SDO, SDI, SCK, PCS0> {
/// Serial data out
///
/// Data travels from the SPI host controller to the SPI device.
pub sdo: SDO,
/// Serial data in
///
/// Data travels from the SPI device to the SPI host controller.
pub sdi: SDI,
/// S... | Rust | 0 |
, 2),
/// &(0..4)
/// .map(|v| {
/// (
/// if v & 1 == 0 { "#222" } else { "#ddd" },
/// 0.02 + (v as f32) / 4.0,
/// )
/// })
/// .collect::<Vec<(&str, f32)>>(),
/// &(0..4)
/// .map(|v| {
/// (
/// ... | Rust | 0 |
from fastapi import APIRouter, Depends, HTTPException, Query
from typing import List, Optional
from sqlite3 import Connection
from models import Adresse
from tools import get_db
router = APIRouter()
# Route pour créer une nouvelle adresse
@router.post("/", response_model=Adresse, tags=["Adresse"])
def create_adresse... | Python | 1 |
DEBUG_IOPORT: u16 = 0x80;
#[cfg(target_arch = "x86_64")]
const DEBUG_IOPORT_PREFIX: &str = "Debug I/O port";
#[cfg(target_arch = "x86_64")]
/// Debug I/O port, see:
/// https://www.intel.com/content/www/us/en/support/articles/000005500/boards-and-kits.html
///
/// Since we're not a physical platform, we can freely as... | Rust | 0 |
\xb4\xf9H\
\xb7]WT\xb5\x0a\x8f(\xca;\xe9V\xc6\xee\xea\xc6\
\xd9\x8a\xbe\xd9\xafm\xad\xe5\xf3<\xcd\x88]K\xd7\x9f\
j\xda\xaf\xc5;f\x1al^.\xf8y\xe1\x84\x12\xee\
\x96\xd5t=WY\xd4\x22\x86t\x7f\x9e-\xf7\x11A\
$\xb1>\x15\x15\x90#*\xfc\xcc\x1d\x8a\x9e\x9am;\
\xc2\x1e(\xd6\xee\x0e\xb7\xa1\xda>\xbdk\x1a\xda\xb7\x89\
|9\xe2\xb8SZ... | Python | 1 |
body=search_body
)
results = []
for hit in response['hits']['hits']:
results.append({
"chunk_id": hit['_id'],
"document_id": hit['_source']['document_id'],
"chunk_text": hit['_source']['chunk_text'],
"... | Python | 1 |
)]
);
bank1.freeze();
assert!(bank1.calculate_and_verify_capitalization(true));
}
fn do_test_bank_update_rewards_determinism() -> u64 {
// create a bank that ticks really slowly...
let bank = Arc::new(Bank::new_for_tests(&GenesisConfig {
accounts:... | Rust | 0 |
er.next();
match next {
Some(x) => match x {
Ok(v) => {
let itemkey = v.1.to_vec();
let itemkey = AddressBookAccess::extract_id(String::from_utf8(itemkey).unwrap())?;
let unprocessed = processed.inser... | Rust | 0 |
" at this point, so switch to "/"
// explicitly. Safe because we provide valid parameters.
SyscallReturnCode(unsafe { libc::chdir(root_dir.as_ptr()) })
.into_empty_result()
.map_err(Error::ChdirNewRoot)?;
// Umount the old_root, thus isolating the process from everything outside the jail ro... | Rust | 0 |
k (degrees)')
ax.set_ylabel('Lift Force (N)')
ax.set_title(f'Lift Force vs. AoA at {velocity} m/s')
ax.grid(True)
ax.legend()
def _plot_drag_vs_angle_compare_foils_on_axis(self, velocity, other_data_manager, ax):
"""
Compare drag force vs. angle of attack for two dif... | Python | 1 |
else:
self.assign_current_image(modules.sd_samplers.sample_to_image(self.current_latent))
self.current_image_sampling_step = self.sampling_step
except Exception:
# when switching models during genration, VAE would be on CPU, so creating an image will fail.
... | Python | 1 |
n()
.ok_or_else(|| anyhow!("Storage provider url doesn't contain a domain: {}", url))?
{
x if x.contains(StorageProviderChoices::Aws.url_pattern()) => {
Ok(StorageProviderChoices::Aws)
}
x if x.contains(StorageProviderChoices::DigitalOcean.url_pat... | Rust | 0 |
import torch
import plotly.graph_objects as go
def visualize(hand_model, object_pc, hand_pose_pred, hand_pose_gt=None, show_num=1e10):
show_num = min(show_num, hand_pose_pred.shape[0])
pc = object_pc.detach().cpu().numpy()
object_pc_plotly = go.Scatter3d(
x=pc[:, 0], y=pc[:, 1], z=pc[:, 2],
... | Python | 1 |
path)
print(f"Model saved to {filepath}")
def load_model(self, filepath: str):
"""Load a saved model."""
self.model = tf.keras.models.load_model(filepath)
print(f"Model loaded from {filepath}")
# Example usage
if __name__ == "__main__":
# Test model creation
model = Vid... | Python | 1 |
p.extra_generation_params["drop_channel_means"] = drop_channel_means
if drop_mean_post:
p.extra_generation_params["drop_mean_post"] = drop_mean_post
if not first_only: # default is true, so we only store false.
p.extra_generation_params["offset_first_only"] = fir... | Python | 1 |
FixedJoint::LOCAL_ANCHOR_2_TRANSLATION => SetFixedJointAnchor2TranslationCommand,
FixedJoint::LOCAL_ANCHOR_1_ROTATION => SetFixedJointAnchor1RotationCommand,
FixedJoint::LOCAL_ANCHOR_2_ROTATION => SetFixedJointAnchor2RotationCommand
)
}
<gh_stars>0
extern crate emerald_rs as emerald;
ext... | Rust | 0 |
amount,
eth_node_poll_interval: config.eth_node_poll_interval,
}
}
pub fn poll_interval(&self) -> Duration {
Duration::from_millis(self.eth_node_poll_interval)
}
}
// cargo run -p enums --bin conditional-enum-variants
pub trait Bool {
const VALUE: bool;
}
pub struct True;
... | Rust | 0 |
utf-8") as f:
json.dump(timestamped_dict, f, ensure_ascii=False)
def main():
result = {}
vectors = np.load(VECTORS_FILE)
deleted_points = set()
benchmark = QdrantBenchmark("http://localhost:6333")
benchmark.initial_upload(vectors)
benchmark.wait_ready()
initial_precision = benc... | Python | 1 |
ask = torch.stack(new_attn_mask, dim=0)
return None, attention_mask, past_key_values, inputs_embeds, labels
@staticmethod
def _reorder_cache(past_key_values, beam_idx):
reordered_past = ()
for layer_past in past_key_values:
reordered_past += (tuple(
past_sta... | Python | 1 |
# json.dumps e json.loads com strings + typing.TypedDict
# Dump = Jogar pra fora enquanto o Load = Puxar pra dentro
# Ao converter de Python para JSON
# Python JSON
# # dict object
# # list, tuple array
# # str string
# # int, float number
# # True true
# # False false
#... | Python | 1 |
import json, requests, datetime
current_date = datetime.date.today()
iso_calendar = current_date.isocalendar()
file = open('SECRET.json') # Opens the file
data = json.load(file) # loads the data then stores in variable called data
# Secret here:
secret = data['id']
# Database information here:
database = data['data... | Python | 1 |
dify_wq);
if let Some(vctx) = vcr {
(*vctx).modify_wq.unwrap()(wq, wq_attr)
} else {
libc::EOPNOTSUPP
}
}
#[inline]
pub unsafe fn ibv_destroy_wq(wq: *mut ibv_wq) -> c_int {
let vcr = verbs_get_ctx_op!((*wq).context, destroy_wq);
if let Some(vctx) = vcr {
(*vctx).destroy_wq... | Rust | 0 |
// TODO(hrust): parser shouldn't panic instead it should return result
// and then revert this diff.
|panic_msg: &str| -> Result<usize, String> {
let output_config =
unsafe { RustOutputConfig::from_ocaml(rust_output_config).unwrap() };
let mut w = String::new();
... | Rust | 0 |
"""
.. module: lemur.sources.schemas
:platform: unix
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
from marshmallow import fields, post_dump
from lemur.schemas import PluginInputSchema, P... | Python | 1 |
import pytest
import yaml
import logging
import sys
from memory_profiler import profile
import models.pytorchmodel_impl
sys.path.append("../questionanswering")
from datasets import webquestions_io
import models
with open("../questionanswering/default_config.yaml", 'r') as config_file:
config = yaml.load(config... | Python | 1 |
st.approx(1.0)
assert prom_access_control_failed.change() == pytest.approx(1.0)
# Encode JWT missing scope1 but with additional scopes. Should return 403.
claims = mocking.make_claims(audience="register_your_data", scopes="scope2 unused:scope")
token = jwt.encode(claims, JWKS_KEYS["key... | Python | 1 |
;
obj.insert("@value", json_value);
obj.insert("@type", "@json".into());
}
if obj.is_empty() {
// useNativeTypes is false, or conversion failed
obj.insert("@val... | Rust | 0 |
, i64);
implement_from_with_inner!([i57, i58, i59, i60, i61, i62, i63], isize, i64);
}
else if #[cfg(target_pointer_width = "64")] {
implement_into!([i2, i3, i4, i5, i6, i7], isize);
implement_into!([i9, i10, i11, i12, i13, i14, i15], isize);
implement_into!([i17, i18, i1... | Rust | 0 |
#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | Python | 1 |
ert mock_initialize_capture.call_count == 2
def test_max_retries_exceeded(self, config: IPCameraSourceConfig):
"""Test that IPCameraStream raises exception when max retries are exceeded."""
with IPCameraStream(config) as stream:
mock_cap = MagicMock(spec=cv2.VideoCapture)
mo... | Python | 1 |
e crate::structure::types::{GlobalType, Mut};
use super::val::Val;
use std::cell::RefCell;
use std::cell::{Ref, RefMut};
use std::rc::Rc;
#[derive(Debug, Clone, PartialEq)]
struct GlobalInst {
value: Val,
mut_: Mut,
}
#[derive(Clone, Debug, PartialEq)]
pub struct GlobalAddr(Rc<RefCell<GlobalInst>>);
impl Gl... | Rust | 0 |
:
ls.assemble()
ls.solve_system(sln_coarse)
else:
ls.project_global(sln_fine, sln_coarse)
# View the solution and mesh
sview.show(sln_coarse);
mesh.plot(space=space)
# Calculate error estimate wrt. fine mesh solution
hp = H1Adapt(ls)
hp.set_solutions([sln_co... | Python | 1 |
// The game board. Contains references to the WHITE and BLACK arrays.
board: [[Option<&'a Piece>; 8]; 8],
ignore_kings: bool,
ignore_check: bool,
last: ((usize, usize), (usize, usize)),
black_can_castle_right: bool,
black_can_castle_left: bool,
white_can_castle_right: bool,
white_can_cas... | Rust | 0 |
{{document}}
\\section*{{Demostración Espectral de Finitud}}
\\textbf{{Curva}}: ${E.ainvs()}$ \\
\\textbf{{Conductor}}: $N = {E.conductor()}$ \\
\\textbf{{Resultado}}: $\\Sha(E/\\mathbb{{Q}})$ es finito.
\\subsection*{{Datos Espectrales Locales}}
"""
for p, data in proof_... | Python | 1 |
w: self } }
#[doc = "Bit 1 - receive complete interrupt mask"]
#[inline(always)]
pub fn rxcmplt(&mut self) -> RXCMPLT_W { RXCMPLT_W { w: self } }
#[doc = "Bit 2 - receive used bit read interrupt mask"]
#[inline(always)]
pub fn rxusedbitread(&mut self) -> RXUSEDBITREAD_W { RXUSEDBITREAD_W { w: s... | Rust | 0 |
st[str]):
free_token_index = []
for request_id, pause_way in pause_reqs:
req: InferReq = requests_mapping[request_id]
req.req_status = pause_way
self.request_ids.remove(request_id)
if pause_way == ReqRunStatus.PAUSED_AND_OFFLOAD:
self._free... | Python | 1 |
;
impl NoteId {
pub fn new() -> NoteId {
NoteId(Date::now().round().rem_euclid(2f64.powi(32)) as u32)
}
}
impl fmt::Display for NoteId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)
}
}
#[derive(Clone, Deserialize, Serialize)]
pub struct Note {
... | Rust | 0 |
2, 0x41, 0x89, 0x97, 0x20, 0x0e, 0xf8, 0x2e,
0x44, 0xae, 0x7e, 0x3f],
&[0xd5, 0xff, 0xcf, 0x6f, 0xc5, 0xac, 0x4d, 0x69,
0x72, 0x21, 0x87, 0x42, 0x1a, 0x7f, 0x17, 0x0b])
];
#[test]
fn hash() {
for &(h, a, c, g) in CASES.iter() {
let ghash = Ghash::new(h);
... | Rust | 0 |
hanging font and size
def font_And_Size():
def apply_font():
selectedFont = fontDropBox.get()
selectedSize = sizeDropBox.get()
mainTwoFrame.config(font =(selectedFont,selectedSize))
fontAndSize = tk.Toplevel()
fontAndSize.title("Font & Size")
fontAndSize.geometry('300x200')
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.