text string | label_name string | labels int64 |
|---|---|---|
_val);
},
// Unknown Settings parameters must be ignored.
_ => (),
}
}
Ok(Frame::Settings {
num_placeholders,
max_header_list_size,
qpack_max_table_capacity,
qpack_blocked_streams,
grease: None,
})
}
fn parse_push_promise... | Rust | 0 |
"""
Debug Streaming Issue
Let's see what's happening with the Responses API streaming conversion.
"""
import asyncio
import os
from dotenv import load_dotenv
from bhumi.base_client import BaseLLMClient, LLMConfig
load_dotenv()
async def main():
api_key = os.getenv("OPENAI_API_KEY")
if not api_key:
p... | Python | 1 |
al methods on `WindowBuilder` that are specific to Android.
pub trait WindowBuilderExt {
}
impl WindowBuilderExt for WindowBuilder {
}
<filename>tentacle/tests/test_tls_reconnect.rs<gh_stars>1-10
#![cfg(feature = "tls")]
use crossbeam_channel::Receiver;
use rustls_pemfile::{certs, pkcs8_private_keys, rsa_private_keys... | Rust | 0 |
import cv2
import matplotlib.pyplot as plt
import numpy as np
import open3d as o3d
from geometry_utils import *
# Load images
rgb = cv2.cvtColor(cv2.imread('data/rgb.png'), cv2.COLOR_BGR2RGB)
# Depth is stored as float32 in meters
depth = cv2.imread('data/depth.exr', cv2.IMREAD_ANYDEPTH)
# Get intrinsic parameters
h... | Python | 1 |
###
# Copyright CEA (Commissariat à l'énergie atomique et aux
# énergies alternatives) (2017-2025)
#
# This software is governed by the CeCILL license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/ or redistribute the software under the terms of the CeCILL
# ... | Python | 1 |
::BSTR, pnStatus: *mut ::VSS_WRITER_STATE,
phResultFailure: *mut ::HRESULT
) -> ::HRESULT,
fn SetBackupSucceeded(
&mut self, instanceId: ::VSS_ID, writerId: ::VSS_ID, ct: ::VSS_COMPONENT_TYPE,
wszLogicalPath: ::LPCWSTR, wszComponentName: ::LPCWSTR, bSucceded: bool
) -> ::HRESULT,
... | Rust | 0 |
crate::prelude::*;
use crate::{scalar, DateTime, Document};
use skia_bindings::{
C_SkPDF_MakeDocument, C_SkPDF_Metadata_Construct, C_SkPDF_Metadata_destruct,
SkPDF_Metadata, SkString,
};
// TODO: DocumentStructureType
// TODO: StructureElementNode
#[derive(Clone, Debug, Defaul... | Rust | 0 |
set_of_keys.remove('input_dimentions')
if 'output_dimentions' in set_of_keys:
set_of_keys.remove('output_dimentions')
list_of_keys = ['type', 'input_dimentions', 'output_dimentions'] + sorted(list(set_of_keys))
with open(fullPathToOutputFile, "a", newline="") as file:
... | Python | 1 |
_lines)
# 修改roles/kubernetes/preinstall/vars/main.yml解决CentOS操作系统依赖问题
if kubespray_version == "2.26.0":
lines = read_yaml_file(f"{kubespray_path}/roles/kubernetes/preinstall/vars/main.yml")
# 删除CentOS: {}行
modified_lines = replace_line_with_pattern(lines, "CentOS: {}", "#CentOS: {}")
mo... | Python | 1 |
I64, Ordering as AtomicOrdering},
};
const DUST_ALLOWANCE_VALUE: u64 = 1_000_000;
const MAX_INPUT_SELECTION_TRIES: i64 = 10_000_000;
#[derive(Debug, Clone)]
pub struct Input {
pub address: AddressWrapper,
pub internal: bool,
pub balance: u64,
}
pub fn select_input(target: u64, mut available_utxos: Vec<In... | Rust | 0 |
unc_name(){
println!("You called {:?}()", stringify!($func_name));
}
)
}
macro_rules! print_ex {
($e:expr) => {
println!("{:?} = {:?}",stringify!($e),$e);
};
}
macro_rules! exame {
($l:expr; and $r:expr ) => (
println!("{:?} and {:?} is {:?}",
stringify!... | Rust | 0 |
# Generated by Django 4.1.7 on 2023-05-01 21:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('recipes', '0006_remove_recipe_category_id'),
]
operations = [
migrations.AddField(
model_name='... | Python | 1 |
return A*np.exp(-B*x)+C
#generacion con un
x_normal=np.arange(-5,10,0.2)
y_normal=my_exponential(x_normal,2.0,0.5,5.0)
data = np.vstack((x_normal,y_normal)).T # Nx2
kmeans = KMeans(n_clusters=3, random_state=0)
kmeans.fit(data)
r = kmeans.labels_
c = kmeans.cluster_centers_
y_ruidosa=y_normal+np.random.randn... | Python | 1 |
factors_weekly.loc[idx, 'big_high']) / 3
factors_weekly.loc[idx, 'SMB'] = small_avg - big_avg
# 计算HML
high_avg = (factors_weekly.loc[idx, 'small_high'] +
... | Python | 1 |
[
0x12, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
];
const EXPECTED_ROM: u16 = 0x20A;
let mut cpu = Cpu::new(&ROM);
cpu.run_cycle();
assert_eq!(cpu.pc, EXPECTED_ROM);
}
#[test]
fn test_call_nnn() {
// 0x200: CALL 0x204
// 0x202: DUMMY INSTRUCTION
// 0x... | Rust | 0 |
use js_builder::Print;
///
///let mut result = Vec::new();
///Statement::build().do_while()
/// .expr().add_assign().id("a").number(1)
/// .lt().id("a").id("b").build()
/// .compact_print(&mut result);
///
///assert_eq!(
/// "do a += 1; while(a < b);",
/// String::... | Rust | 0 |
# -*- coding: utf-8 -*-
# Autogenerated on 12:54:39 2017/06/25
# flake8: noqa
from __future__ import absolute_import, division, print_function, unicode_literals
from ibeis.algo.verif import clf_helpers
from ibeis.algo.verif import sklearn_utils
from ibeis.algo.verif import deploy
from ibeis.algo.verif import pairfeat
f... | Python | 1 |
(labels, var_name) in str_var_labels
.into_iter()
.map(|(k, v)| (v, k))
.collect::<BTreeSet<_>>()
{
if first_var_label.is_none() {
first_var_label = Some(labels.len.clone());
}
let StrLabels ... | Rust | 0 |
gument('-o', '-output-file', dest='output_file', default='fireworm.mp4')
args = parser.parse_args()
if len(sys.argv) == 1:
parser.print_help()
sys.exit(-1)
if args.spray_addr == None:
args.spray_addr = sp_addr
if args.rop_pivot == None:
args.rop_pivot = newpc_val
# Build th... | Python | 1 |
.as_ref().map(String::as_str) {
Ok("dumb") | Err(_) => {
red_fg = Style::new();
green_fg = Style::new();
}
Ok(_) => {
red_fg = Style::new().fg(Red);
green_fg = Style::new().fg(Green);
}
}
for i in 0..diffs.len() {
match dif... | Rust | 0 |
aller\'s duty to"]
#[doc = " truncate it on return)."]
#[doc = ""]
#[doc = " For this write function to be used, the chain must have been read with"]
#[doc = " FLAC__metadata_chain_read_with_callbacks()/FLAC__metadata_chain_read_ogg_with_callbacks(),"]
#[doc = " not FLAC__metadata_chain_read()/F... | Rust | 0 |
16le' , '-ar', '44100', '-ac', '2', f'{wav_audio_path}', '-y', '-hide_banner', '-loglevel', 'error']) # formatting mp4 file in to wav format
clear(mp4_audio_path)
return voice_recognizer(wav_audio_path)
def fromaudio_voice_recognizer(ogg_audio_path):
wav_audio_path = "temp/audio.wav"
subprocess.run... | Python | 1 |
log4rs_syslog::Facility::Daemon,
)
// Custom rust log level <=> libc log level mapping.
.level_map(Box::new(|l| match l {
// WARNING: On linux this will broadcast error message on all consoles.
log::Level::Error => libc::LOG_EMERG,
... | Rust | 0 |
import pytest
from pydantic.v1 import ValidationError
from main import AllSoundbites, Soundbite
# Mock LLM response data
mock_llm_response = {
"soundbites": [
{
"start_time": "00:00:10",
"end_time": "00:00:20",
"text": "This is a sample soundbite.",
"reasonin... | Python | 1 |
1_TX_DMASREQ,
#[doc = "SSI1 TX DMA burst request , controlled by SSI0:DMACR.TXDMAE"]
SSI1_TX_DMABREQ,
#[doc = "SSI1 RX DMA single request, controlled by SSI0:DMACR.RXDMAE"]
SSI1_RX_DMASREQ,
#[doc = "SSI1 RX DMA burst request , controlled by SSI0:DMACR.RXDMAE"]
SSI1_RX_DMABREQ,
#[doc = "SSI0 ... | Rust | 0 |
from __future__ import annotations
from dataclasses import asdict, dataclass
import vtk
from slicer import vtkSegment
from trame_slicer.utils import hex_to_rgb_float, rgb_float_to_hex
@dataclass
class SegmentProperties:
color: list[float]
name: str
label_value: int
terminology_tag: str
@classm... | Python | 1 |
_, u32>("other_list");
assert_eq!(non_existent_list.len(), 0);
}
let patch = fork.into_patch();
let access = GenericRawAccess::from(&patch as &dyn Snapshot);
assert!(!access.is_mutable());
assert_eq!(access.get_entry::<_, String>("entry").get().unwrap(), "!");
... | Rust | 0 |
{:?} destroyed because it not used anymore!",
texture.state().path()
));
}
retain
});
}
fn update_model(&mut self, dt: f32) {
for model in self.models.iter_mut() {
model.time_to_live -= dt;
if model.use_count()... | Rust | 0 |
.friend_id = f3.user_id
JOIN friendships f4 ON f3.friend_id = f4.user_id
JOIN friendships f5 ON f4.friend_id = f5.user_id
WHERE f1.user_id = %(id)s
LIMIT 1
"""
params = {"id": vertex_id}
case Grap... | Python | 1 |
_value = struct.unpack('h', ''.join([chr(values[16]), chr(values[17])]))
print(this_value[0] / 8)
print(this_value[0] / 8 + abs(this_value[0]) * 0.0013131313)
this_value = struct.unpack('h', ''.join([chr(values[18]), chr(values[19])]))
print(this_value[0] / 8)
print(this_value[0] / 8 + abs(this_value[0]) * 0.0013131313... | Python | 1 |
::CreateTarget {
msg: "failed to front target".into(),
});
}
info!(
"nvmf target listening on {}:({},{})",
get_ipv4_address().unwrap(),
trid_nexus.trsvcid.as_str(),
trid_replica.trsvcid.as_str(),
);
self.next_sta... | Rust | 0 |
XNOREN,
#[doc = "Pause command queue when input MSPI1 bit XORed with SWFLAG1 is '1' value."]
MSPI1XOREN,
#[doc = "Pause command queue when input MSPI0 bit XORed with SWFLAG0 is '1' value."]
MSPI0XOREN,
#[doc = "Pause the command queue when software flag bit 7 is '1'. value."]
SWFLAGEN7,
#[do... | Rust | 0 |
escription": "Match query criteria, which includes all the filter string fields",
"name": "q",
"in": "query"
},
{
"enum": [
"created_on",
"created_on|desc",
"last_updated_on",
"last_updated_on|desc"
],
"type": "string",
... | Python | 1 |
Clone for CUlinkState_st {
fn clone(&self) -> Self {
*self
}
}
pub type CUlinkState = *mut CUlinkState_st;
#[repr(u32)]
/**
* Flags to register a graphics resource
*/
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum CUgraphicsRegisterFlags_enum {
CU_GRAPHICS_REGISTER_FLAGS_NONE = 0,
... | Rust | 0 |
other traits are implemented for our number types
trait AllImpl<'a>:
Add
+ Add<&'a Self>
+ AddAssign
+ AddAssign<&'a Self>
+ Sub
+ Sub<&'a Self>
+ SubAssign
+ SubAssign<&'a Self>
+ Mul
+ Mul<&'a Self>
+ MulAssign
+ MulAs... | Rust | 0 |
# FastAPI router: offline meteoroid environment compute endpoint
from fastapi import APIRouter, HTTPException
from pydantic import BaseModel, Field, confloat
import numpy as np
from lucidia.astro.meteoroid_env.api import (
number_density,
encounter_velocities,
OrbitalElements,
TargetPoint,
)
from lucid... | Python | 1 |
692fb",
"<KEY>",
"<KEY>",
"68c4d0f69d1f18b756c2ee875c14f1c6cd38682e715ded14bf7e3c1c5610e9fc",
"8b16cd3ec44875e4856e30344c0b4a68a6f929a68be5117b225b80926301e7b1",
"<KEY>",
"70ffdd5fa0f3aea18bd4700f1ac2e2e03cf5d4b7b857e8dd93b862a8319b9653",
"d81ef64a0063573d80cd32222d8d04debbe807345ad7af2e9edf... | Rust | 0 |
{
let conn = create_connection();
conn.test_transaction::<_, diesel::result::Error, _>(|| {
let wikitext = "{|\n|A\n|B\n|}";
let result = Configuration::default().parse(wikitext);
assert_eq!(
render(&conn, &result),
"<table>\n<tbody><tr>\n<td>A\n</td>\n<t... | Rust | 0 |
ase_globals)] pub const STENCIL_INDEX: types::GLenum = 0x1901;
#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_INDEX1: types::GLenum = 0x8D46;
#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_INDEX16: types::GLenum = 0x8D49;
#[allow(dead_code, non_upper_case_globals)] pub const STENCIL_INDEX4... | Rust | 0 |
prite("sprite", path);
// Print instructions to the console
println!("\n\
Instructions:\n\
\n\
1-9: Set Zoom level (sprite scale) to this amount.\n\
Del/Backspace: Delete existing collider.*\n\
Mouse Click: Add a collider point. Add points in a CLOCKWISE direction. Must be a CONVEX polygon ... | Rust | 0 |
'مرحباً بك في نظام أرشفة'
sender = current_app.config['MAIL_USERNAME'] or 'noreply@arshafa.com'
# Text version
text_body = render_template('email/welcome.txt',
user=user, password=password)
# HTML version
html_body = render_template('email/welcome.html',
... | Python | 1 |
lbackEXT = extern "system" fn(
DebugUtilsMessageSeverityFlagBitsEXT,
DebugUtilsMessageTypeFlagsEXT,
*const DebugUtilsMessengerCallbackDataEXT,
*mut c_void,
) -> Bool32;
pub type VoidFunction = extern "system" fn() -> ();
// Unused types
pub type Display = c_void;
pub type VisualID = c_void;
pub type W... | Rust | 0 |
defaults_ot3._build_default_transform(
[[1, 2, 3], [3, 2, 1]], defaults_ot3.DEFAULT_MACHINE_TRANSFORM
)
== defaults_ot3.DEFAULT_MACHINE_TRANSFORM
)
# list of right number of lists of wrong number of elements
assert (
defaults_ot3._build_default_transform(
... | Python | 1 |
Signature {
type Error = SignerError;
fn try_from(v: Vec<u8>) -> Result<Signature, Self::Error> {
if v.len() != SIGNATURE_RECOVERY_SIZE {
return Err(SignerError::GenericString(
"Invalid Signature Length".to_string(),
));
}
let mut sk = Signature ... | Rust | 0 |
PROC: Pid = Pid::new(2);
pub const PM: Pid = Pid::new(3);
pub const VM_SERVER: Pid = Pid::new(4);
pub const TTY: Pid = Pid::new(5);
pub const VFS: Pid = Pid::new(6);
pub const XHCI: Pid = Pid::new(7);
pub const TEST_1: Pid = Pid::new(8);
pub const TEST_2: Pid = Pid::new(9);
use serde::de::{Deserializer, Error, Visitor}... | Rust | 0 |
# src/necropolis.py
import json
from datetime import datetime
from pathlib import Path
TOMBS_PATH = Path("model_tombs.json")
class Necropolis:
def __init__(self, tombs_path=TOMBS_PATH):
self.tombs_path = tombs_path
self.tombs = self.load_tombs()
def load_tombs(self):
if not self.tomb... | Python | 1 |
k(Db {
db,
credentials_db,
auto_save: true,
})
}
pub struct Db {
db: PickleDb,
credentials_db: PickleDb,
auto_save: bool,
}
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
pub struct PendingDeposit {
pub exchange: Exchange,
pub amount: u64, // lamports/tokens... | Rust | 0 |
+ str(e)
yield tk_count
class ZhipuChat(Base):
def __init__(self, key, model_name="glm-3-turbo", **kwargs):
self.client = ZhipuAI(api_key=key)
self.model_name = model_name
def chat(self, system, history, gen_conf):
if system:
history.insert(0, {"role": "system", "... | Python | 1 |
import random
import time
# Sample database of animal sounds
ANIMAL_SOUNDS = {
"Lion": "roar",
"Dog": "bark",
"Cat": "meow",
"Cow": "moo",
"Elephant": "trumpet"
}
def play_sound(animal: str) -> None:
print(f"Playing sound: {ANIMAL_SOUNDS[animal]}") # Simulate playing sound
def animal_quiz() ... | Python | 1 |
명의_사람_연한_갈색_피부_진한_갈색_피부:',
'pt': ':pessoas_de_mãos_dadas_pele_morena_clara_e_pele_morena_escura:',
'it': ':persone_che_si_tengono_per_mano_carnagione_abbastanza_chiara_e_carnagione_abbastanza_scura:',
'fa': ':اشخاصی_دست_در_دست_هم_پوست_روشن_پوست_گندمی:',
'id': ':orang_bergandengan_warna_k... | Python | 1 |
s (int): number of diffusion steps
temperature (float, optional): temperature for scaling noise. Defaults to 1.0.
spks (torch.Tensor, optional): speaker ids. Defaults to None.
shape: (batch_size, spk_emb_dim)
cond: Not used but kept for future purposes
Return... | Python | 1 |
import colight.plot as Plot
# %% tags=["hide_source"]
Plot.html(
[
"div.bg-black.text-white.p-3",
"""This example depends on communication with a python backend, and will not be interactive on the docs website.""",
],
)
# %% [markdown]
#
# When using the widget display mode, we can reset the co... | Python | 1 |
ead while fetching header",
));
}
Ok((_, _)) => (),
Err(err) => {
return Err(Error::new(ErrorKind::Other, err));
}
}
while to_read > 0 {
let mut slice = buf.split_off(udp_head... | Rust | 0 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from dataclasses import dataclass, field
from typing import List
from omegaconf import II
from fairseq.dataclass import FairseqD... | Python | 1 |
= permit_rule_id
obligations = permit_obligations
elif any_deny:
decision = "deny"
reason = "explicit_deny"
last_rule_id = deny_rule_id
obligations = []
else:
decision = "deny"
obligations = []
else: # first-applica... | Python | 1 |
from __future__ import annotations
import torch
class NoiseScheduler:
"""Linear beta schedule for DDPM training and sampling."""
def __init__(
self,
beta_start: float = 1e-4,
beta_end: float = 0.02,
timesteps: int = 1000,
device: torch.device | str = "cpu",
) -> N... | Python | 1 |
"""OralB session fixtures."""
from unittest import mock
import pytest
class MockServices:
"""Mock GATTServicesCollection."""
def get_characteristic(self, key: str) -> str:
"""Mock GATTServicesCollection.get_characteristic."""
return key
class MockBleakClient:
"""Mock BleakClient."""
... | Python | 1 |
from dotenv import load_dotenv
load_dotenv() # take environment variables from .env.
import streamlit as st
import os
import textwrap
import shelve
import google.generativeai as genai
def pre_p(text):
text = text.replace('•', ' *')
return textwrap.indent(text, '> ', predicate=lambda _: True)
# Check if the... | Python | 1 |
on)) == 0
assert len(user.roles) == 1 and user.roles[0].grant_id == grant.id and user.roles[0].role == RoleEnum.MEMBER
def test_grant_member_add_role_or_create_invitation_creates_invitation(self, db_session, factories) -> None:
grant = factories.grant.create()
interfaces.user.add_grant_memb... | Python | 1 |
import os
from pydantic_settings import BaseSettings
from app.utils.ngrok_utils import get_server_domain
class Setting(BaseSettings):
"""Application settings"""
# Open AI configuration
openai_api_key: str = os.getenv("openai_api_key", "")
openai_ws_url: str = os.getenv("openai_ws_url") or f"wss:/... | Python | 1 |
def tarfile_to_samples_nothrow(src, handler=wds.warn_and_continue):
streams = url_opener(src, handler=handler)
files = tar_file_expander(streams, handler=handler)
samples = group_by_keys_nothrow(files, handler=handler)
return samples
| Python | 1 |
ng:1.0",
)?;
xml_out.attr(
"xmlns:loext",
"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0",
)?;
xml_out.attr(
"xmlns:field",
"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0",
)?;
xml_out.attr("xmlns:math", "http://www.w3.org... | Rust | 0 |
from flask import render_template, request, jsonify
from . import main
@main.app_errorhandler(404)
def page_not_found(e):
""" 使用 app_errorhandler 注册全局 404(网页未找到) 错误处理
:param e: 接收异常
"""
if request.accept_mimetypes.accept_json and not request.accept_mimetypes.accept_html:
resp = jsonify({'erro... | Python | 1 |
x + self.cols.as_usize()
&& self.y <= row
&& row < self.y + self.rows.as_usize()
}
}
impl Offset {
pub fn frame(size: usize) -> Self {
Self {
top: size,
bottom: size,
right: size,
left: size,
}
}
// FIXME: This sho... | Rust | 0 |
10, pady=5)
# Hidden Files
hidden_files_section = ctk.CTkLabel(scrollable_frame, text="Hidden Files:", font=("Arial", 14, "bold"))
hidden_files_section.pack(anchor=tk.W, padx=10, pady=(20, 5))
# System Files
system_files_label = ctk.CTkLabel(scrollable_frame, text="Syst... | Python | 1 |
sys::core::PCWSTR,
pub hPageSetupTemplate: isize,
}
#[cfg(target_arch = "x86")]
#[cfg(feature = "Win32_Foundation")]
impl ::core::marker::Copy for PAGESETUPDLGW {}
#[cfg(target_arch = "x86")]
#[cfg(feature = "Win32_Foundation")]
impl ::core::clone::Clone for PAGESETUPDLGW {
fn clone(&self) -> Self {
*se... | Rust | 0 |
import bpy
d = bpy.context.active_object.data.archipack_window[0]
d.frame_y = 0.05999999865889549
d.flip = False
d.blind_z = 0.029999999329447746
d.blind_open = 80.0
d.hole_margin = 0.10000000149011612
d.out_frame_y = 0.019999999552965164
d.blind_y = 0.0020000000949949026
d.in_tablet_x = 0.03999999910593033
d.in_table... | Python | 1 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'find.ui'
#
# Created by: PyQt5 UI code generator 5.12.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectNa... | Python | 1 |
import numpy as np
import pandas as pd
from keras.models import Model
from keras.layers import LSTM, Dense, Input, Bidirectional
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import train_test_split
import joblib
import matplotlib.pyplot as plt
# 数据加载和预处理
def load_and_preprocess_data(file... | Python | 1 |
, |w, v| w.write_all(v.default_str().as_bytes()))?;
write!(w, " {})", val)?
}
val::RVal::N(_) => (),
}
}
if skipped == self.args.len() {
write!(w, " true")?
}
write!(w, ")")?;
Ok(())
}
}
//! Functio... | Rust | 0 |
<Nav/>
<section class="w-full">{"section"}</section>
</div>
}
}
}
<filename>samples/server/petstore/rust-server/output/rust-server-test/src/mimetypes.rs
/// mime types for requests and responses
pub mod responses {
use hyper::mime::*;
// The macro is called per-operation to beat the recurs... | Rust | 0 |
import six
from ..utils import str_coercible
from .weekday import WeekDay
@str_coercible
class WeekDays(object):
def __init__(self, bit_string_or_week_days):
if isinstance(bit_string_or_week_days, six.string_types):
self._days = set()
if len(bit_string_or_week_days) != WeekDay.NU... | Python | 1 |
: ile, name: Interlingue (Originally called Occidental; then Interlingue after WWII)
Ie,
/// 639-2: ibo, name: Igbo (Asụsụ Igbo)
Ig,
/// 639-2: iii, name: Nuosu (ꆈꌠ꒿ Nuosuhxop)
Ii,
/// 639-2: ipk, name: Inupiaq (Iñupiaq, Iñupiatun)
Ik,
/// 639-2: ido, name: Ido
Io,
/// 639-2: isl... | Rust | 0 |
n't use the HTML renderer?
open(book.build_dir_for("html").join("index.html"));
}
Ok(())
}
pub mod grpc_server;
pub mod integration_events;
pub mod logging_service;
pub mod pb;
pub mod service;
use actix_web::{put, web};
use tracing::instrument;
use super::{AuthToken, APIError, ensure_user_collection};... | Rust | 0 |
/// Reading ` moves `.
/// ` moves ` 読取中。
MovesLabel,
/// The game record is being analyzed.
/// 棋譜の解析中。
Moves,
}
let mut machine_state = MachineState::Start;
// Read one character at a time.
// 1文字ずつ読取。
for ... | Rust | 0 |
ippy::use_self,
)]
use chrono::{DateTime, Utc};
use clap::{App, Arg, ArgMatches, SubCommand};
use failure::Fail;
use hyper::Client as HyperClient;
use hyper_tls::HttpsConnector;
use url::Url;
use edgelet_http::client::{Client, ClientImpl, TokenSource};
use iothubservice::error::Error;
use iothubservice::DeviceClient;... | Rust | 0 |
.newaxis, :, :, np.newaxis]
for i in range(n_train)
]
im_train.extend([tn[0][np.newaxis, :, :, np.newaxis] for tn in test_noisy])
im_val = [
io.imread(Path(root / "noisy_test" / "care" / "source" /
f"{i:03d}.tif"))[np.newaxis, :, :, np.newaxis]
for i in range(n... | Python | 1 |
context,
);
}
pub fn zombie<F: Frame, C: ColModify>(
entity: &ToRenderEntity,
view_context: ViewContext<C>,
frame: &mut F,
) {
StringViewSingleLine::new(
Style::new()
.with_foreground(colours::ZOMBIE)
.with_bold(true),
)
.view("Zmb", view_context, frame);
... | Rust | 0 |
f"ClientUdpDhcp: Received DHCP Offer from "
f"{dhcp_packet_rx.dhcp_srv_id}"
f"IP: {dhcp_packet_rx.dhcp_yiaddr}, "
f"Mask: {dhcp_packet_rx.dhcp_subnet_mask}, "
f"Router: {dhcp_packet_rx.dhcp_router}"
f"DNS: {dhcp_packet_rx.dhcp_dns}, "
f"Domain: {... | Python | 1 |
from auto_derby.single_mode.item.effect_summary import EffectSummary
from ... import _test
from ...constants import Mood, TrainingType
from .. import race, training
from ..commands import RaceCommand, TrainingCommand
from ..context import Context
from ..training import Training
from . import game_data
from . import tes... | Python | 1 |
opy value
ret -= 1_i64;
ret |= ret >> 1;
ret |= ret >> 2;
ret |= ret >> 4;
ret |= ret >> 8;
ret |= ret >> 16;
ret + 1
}
/// Helper function which emulates the behavior of std::upper_bound().
pub fn find_interval<P>(size: i32, pred: P) -> i32
where
P: Fn(i32) -> bool,
{
let mut first... | Rust | 0 |
raw_word["context_id"], raw_word["cost"]
)
logger.warning(
f"UserDictionaryRepository: [{word_uuid}] priority is not set. "
+ "Use cost to calculate priority. "
+ f"(cost: {raw_wor... | Python | 1 |
from utils.file_manager import sc, get_json_dir
from models.fuel_tank import FuelTankRaw, FuelTank
from utils.file_manager import load_raw_data_from_dict
from loguru import logger
import json
json_dir = get_json_dir()
def load_fuel_tank_from_p4k() -> list[FuelTank]:
"""Load a fuel_tank from a P4K file"""
fu... | Python | 1 |
\x01\x20\x01(\tR\x02idB\
\x06\xe2\xde\x1f\x02ID\x12\x16\n\x02ip\x18\x02\x20\x01(\tR\x02ipB\x06\
\xe2\xde\x1f\x02IP\x12\x12\n\x04port\x18\x03\x20\x01(\rR\x04port\"T\n\
\x0fProtocolVersion\x12\x19\n\x03p2p\x18\x01\x20\x01(\x04R\x03p2pB\x07\
\xe2\xde\x1f\x03P2P\x12\x14\n\x05block\x18\x02\x20\x01(\x04R\x05b... | Rust | 0 |
<T>) -> bool {
let band_data = unsafe { signature.as_ptr().offset(self.band_start) };
let band_key = BandKey {
v: band_data,
len: (self.band_end - self.band_start) as usize,
};
match self.hash_table.raw_entry_mut().from_key(&band_key) {
RawEntryMut::O... | Rust | 0 |
import json
import pandas as pd
import requests
def get_api_conn(api_url):
"""Realiza una petición GET a la API y retorna los datos en JSON o None si falla."""
try:
response = requests.get(api_url, timeout=10)
response.raise_for_status()
return response.json()
except requests.Reques... | Python | 1 |
*i)).collect()
}
}
impl<'a> Data<'a> for Vec<u64> {
fn cast_ref_u64(&self) -> &[u64] {
self
}
fn cast_ref_mut_u64(&mut self) -> &mut Vec<u64> {
self
}
}
impl<'a> Data<'a> for Vec<u32> {
fn cast_ref_u32(&self) -> &[u32] {
self
}
fn cast_ref_mut_u32(&mut self) -> ... | Rust | 0 |
fn time_size_struct_value() {
let size = 100usize;
let time_to_live = Duration::from_millis(100);
let mut lru_cache =
super::LruCache::<Temp, usize>::with_expiry_duration_and_capacity(time_to_live, size);
for i in 0..1000 {
if i < size {
assert... | Rust | 0 |
:
y = spmm(self._D[j], y)
out.append(y)
x = torch.stack(out, dim=0)
return x
def upsample(self, x, n1=1, n2=0):
"""Upsample mesh."""
if x.ndimension() < 3:
for i in reversed(range(n2, n1)):
x = spmm(self._U[i], x)
... | Python | 1 |
import qrcode
import numpy as np
from PIL import Image, ImageDraw
import requests
from io import BytesIO
# ============================
# 🔗 Step 1: User Input for spotify Profile URL
# ============================
#spotify_username = "spotify"
spotify_username = input("Enter your spotify username: ") # User can inpu... | Python | 1 |
import sys
input = sys.stdin.readline # 빠른 입력
print = sys.stdout.write # 빠른 출력, 출력은 반드시 문자열로
"""
4
3 5
8 14
5 20
1 16
->
5 20
1 16
8 14
3 5
-> 20 19 18 17 16
-> 15
-> 14 13 12 11 10 9 8 7
-> (6) 4 3 2 => 2초부터 시작
"""
N = int(input())
arr = []
for i in range(N):
#T_i 완성될때 필요한 시간, S_i끝내야하는 시간
tmp... | Python | 1 |
color: black;
border-radius: 0px;
background-color: #65B0EA;
}
"""
)
self.progressBar.setRange(0, 0)
vbox.addWidget(self.progressBar)
sel... | Python | 1 |
import numpy as np
from qulacs import GeneralQuantumOperator, Observable
class TestObservable:
def test_get_matrix_from_observable(self) -> None:
n_qubits = 3
obs = Observable(n_qubits)
obs.add_operator(0.5, "Z 2")
obs.add_operator(1.0, "X 0 X 1 X 2")
obs.add_operator(1.0,... | Python | 1 |
cción', yaxis_title='Número de Viajes Anteriores')
st.plotly_chart(fig03)
st.subheader('Año de registro por sexo del usuario')
fig04 = px.violin(usuarios_matcheados_df, x="sexo", y="año_registro", color="sexo", box=True,
labels={'sexo': 'Sexo del usuario', 'año_registro': 'Año del registro'... | Python | 1 |
inkCollection {
pub links: Vec<Link>,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
/// Struct representing a [Nodeinfo 2.1](https://github.com/jhass/nodeinfo/blob/1fcd229a84031253eb73a315e89d3f7f13f117b4/PROTOCOL.md) entity
pub struct Nodeinfo {
pub version: S... | Rust | 0 |
let unit = 1_000_000_000_000;
let initial_project_tokens = 1_000_000 * unit;
let initial_usdt = 1_000_000 * unit;
let sale_duration = MaxSaleDuration::get();
let initial_weight = Permill::one() / 2;
let final_weight = Permill::one() / 2;
let fee = Permill::zero();
within_sale_with_liquidity(
ALICE,
... | Rust | 0 |
"""Test for a Home Assistant bridge that changes light features at runtime."""
from homeassistant.components.light import ATTR_SUPPORTED_COLOR_MODES, ColorMode
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from ..common import (
device_config_changed,
set... | Python | 1 |
DATA_1 = 0x16,
/// RX_HARD_DATA\[0\]. Can be used together with RX_SYMBOL_TICK for alternative serial RX output.
RX_HARD_DATA_0 = 0x17,
/// PA_PD. Note: PA_PD will have the same signal level in SLEEP and TX states. To control an external PA or RX/TX switch in applications where the SLEEP state is used it i... | Rust | 0 |
t.error = createAction(type+'_ERROR', undefined, metaCreator)
// request.cancel = createAction(type+'_CANCEL', undefined, metaCreator)
// request.progress = createAction(type+'_PROGRESS', undefined, metaCreator)
// request.process = createAction(type+'_PROCESS', undefined, metaCreator)
//
// return request
//}
//
/... | Rust | 0 |
from crewai import Agent, Task, Crew, Process,LLM
from crewai_tools import CodeInterpreterTool
import os
API_KEY=os.getenv("GOOGLE_API_KEY")
llm=LLM(
model="gemini/gemini-1.5-flash",
api_key=API_KEY
)
# Initialize the tool
code_interpreter = CodeInterpreterTool()
# Define an agent that uses the tool
programm... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.