text string | label_name string | labels int64 |
|---|---|---|
import importlib
import os
from collections import OrderedDict
def create_default_local_file():
path = os.path.join(os.path.dirname(__file__), 'local.py')
empty_str = '\'\''
default_settings = OrderedDict({
'workspace_dir': empty_str,
'tensorboard_dir': 'self.workspace_dir + \'/tensorboar... | Python | 1 |
import json
import numpy as np
import os
def scale_matrix(matrix, x_scale, y_scale):
scaled_matrix = matrix.copy()
scaled_matrix[0, 3] *= x_scale
scaled_matrix[1, 3] *= y_scale
return scaled_matrix
def save_matrix_to_file(matrix, filename, intrinsic_matrix, depth_range, output_dir):
with open(os.p... | Python | 1 |
`TraceId`.
pub fn new() -> Self {
TraceId::default()
}
}
impl Default for TraceId {
/// Makes a randomly generated `TraceId`.
fn default() -> Self {
TraceId {
high: rand::random(),
low: rand::random(),
}
}
}
impl fmt::Display for TraceId {
fn fmt(&... | Rust | 0 |
type_sets: ValuedAttributes,
}
/// Translates to underlying type(without using resources) in string-format.
/// e.g. HandleTy::Process will be translated to int32 instead of zx_process.
fn ty_to_underlying_str(ast: &ast::BanjoAst, ty: &ast::Ty) -> Result<String, Error> {
match ty {
ast::Ty::Bool => Ok... | Rust | 0 |
TwoFloat = TwoFloat {
hi: 1.0471975511965979,
lo: -1.072081766451091e-16,
};
/// π/4
pub const FRAC_PI_4: TwoFloat = TwoFloat {
hi: 0.7853981633974483,
lo: 3.061616997868383e-17,
};
/// π/6
pub const FRAC_PI_6: TwoFloat = TwoFloat {
hi: 0.5235987755982989,
lo: -5.360408832255455e-17,
};
/// ... | Rust | 0 |
_ref_khz.rs
#[doc = "Register `FC0_REF_KHZ` reader"]
pub struct R(crate::R<FC0_REF_KHZ_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<FC0_REF_KHZ_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<FC0_REF_KHZ_SPEC>> for R {
#[inline(alway... | Rust | 0 |
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = [
# "tensorstore",
# "numpy",
# ]
# ///
import os
import shutil
import numpy as np
import tensorstore as ts
def write_multiscale(path: str, num_channels: int, num_scales: int):
shutil.rmtree(path, ignore_errors=True)
... | Python | 1 |
tenv("LOCAL_RANK", "0"))
store = {
"_world_size": world_size,
"_rank": rank,
"_local_world_size": local_world_size,
"_local_rank": local_rank,
"_master_addr": master_addr,
"_master_port": master_port,
}
if cuda_visible_devi... | Python | 1 |
["单位净值"], errors="coerce")
temp_df["日增长率"] = pd.to_numeric(temp_df["日增长率"], errors="coerce")
temp_df["近1年涨幅"] = pd.to_numeric(temp_df["近1年涨幅"], errors="coerce")
temp_df["近3年涨幅"] = pd.to_numeric(temp_df["近3年涨幅"], errors="coerce")
temp_df["近5年涨幅"] = pd.to_numeric(temp_df["近5年涨幅"], errors="coerce")
ret... | Python | 1 |
"""photo_tag change_3
Revision ID: 1668f37e89ce
Revises: a6d9bdcdd015
Create Date: 2024-05-07 20:21:39.918144
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '1668f37e89ce'
down_revision: Union[str, None] = 'a6d9bdcdd015... | Python | 1 |
_argument(f"--{key}", action='store_true', required=False, help=f"(optional) {value}")
@staticmethod
def run(args):
from moftransformer import __root_dir__
root_dataset = args.root_dataset
downstream = args.downstream
log_dir = args.log_dir
test_only = args.test... | Python | 1 |
Ok(())
}
}
<filename>src/model/text.rs
//! Localization structures.
use std::fmt;
use std::marker::PhantomData;
use serde::de;
use serde::de::DeserializeOwned;
use serde::de::Deserializer;
use serde::ser::Serializer;
use serde::Deserialize;
use serde::Serialize;
use crate::api::Endpoint;
use crate::model::resour... | Rust | 0 |
get_result(&connection)
.expect(&format!("Error comparing {}, {:?}", sql_str, value))
}
#[cfg(feature = "postgres")]
#[test]
#[should_panic(expected = "Received more than 4 bytes decoding i32")]
fn debug_check_catches_reading_bigint_as_i32_when_using_raw_sql() {
use diesel::dsl::sql;
use diesel::sql_ty... | Rust | 0 |
import time
from apt_interface.KSG101 import KSG101
from apt_interface.KPZ101 import KPZ101
# Paramètres de la boucle
TARGET = 1000 # valeur désirée en counts KSG (ex. 1000)
TOL = 1 # tolérance : on estime être à la bonne position si |error| < 1
GAIN = 0.002 # gain proportionnel (ajustez selon votre m... | Python | 1 |
# LISTAS DE CARACTERES:
# 1. Crea una lista llamada frutas que contengan los siguientes nombres de frutas como cadenas
# de caracteres: manzana, plátano, cereza, pera, higo, frambuesa y fresa.
# 2. Usa la función len() para imprimir la longitud de la lista frutas.
# 3. Accede al objeto numero 3 de la lista e imprímelo ... | Python | 1 |
ython\220322_DBN\2016_2020_month_test\checkpoints\checkpoint_100.pth'
pm25_csv_p = r'E:\China_2016\2016_PM25_month_mean'
output_p = 'E:/China_2018/dbn_predict_10'
ml3 = ['201801', '201802', '201803', '201804', '201805', '201806',
'201807', '201808', '201809', '201810', '201811', '201812']
... | Python | 1 |
"tool_function": generate_image_by_doubao_seedream_3_volces,
},
"edit_image_by_doubao_seededit_3_volces": {
"display_name": "Doubao Seededit 3 by volces",
"type": "image",
"provider": "volces",
"tool_function": edit_image_by_doubao_seededit_3_volces,
},
"generate_vide... | Python | 1 |
# Importing the Kratos Library
import KratosMultiphysics as KM
from KratosMultiphysics.kratos_utilities import CheckIfApplicationsAvailable
# Importing the base class
from KratosMultiphysics.CoSimulationApplication.solver_wrappers.kratos import kratos_base_wrapper
# Importing MPM
if not CheckIfApplicationsAvailable("... | Python | 1 |
) {
if (*p_j2k).m_specific_param.m_encoder.m_Ttlmi_is_byte != 0 {
opj_write_bytes_LE(
(*p_j2k)
.m_specific_param
.m_encoder
.m_tlm_sot_offsets_current,
(*p_j2k).m_current_tile_number,
1 as libc::c_int as OPJ_UINT32,
); /* PSOT */
(*p_j2k)
.m_specific_param
... | Rust | 0 |
();
// create state and game loop
let state = &mut State::new(ctx).unwrap();
// run loop
match event::run(ctx, event_loop, state) {
Ok(_) => println!("Clean loop exit"),
Err(e) => println!("Error loop exit {}", e),
};
println!("Goodbye!");
}
pub fn calculate_foward_count(network... | Rust | 0 |
from e
# Preserve the device selection as state.
return {"udid": udid}
class iOSXcodePackageCommand(iOSXcodeMixin, PackageCommand):
description = "Package an iOS app."
class iOSXcodePublishCommand(iOSXcodeMixin, PublishCommand):
description = "Publish an iOS app."
publication_channels =... | Python | 1 |
{
UnifyTargetHost::None => UnifyTargetHostImpl::None,
UnifyTargetHost::UnifyIfBoth => UnifyTargetHostImpl::UnifyIfBoth,
UnifyTargetHost::ReplicateTargetOnHost => UnifyTargetHostImpl::ReplicateTargetOnHost,
UnifyTargetHost::Auto => {
let workspace_set = gra... | Rust | 0 |
from sklearn import metrics
from pytorch_utils import forward
class Evaluator(object):
def __init__(self, model):
"""Evaluator.
Args:
model: object
"""
self.model = model
def evaluate(self, data_loader):
"""Forward evaluation data and calculate stat... | Python | 1 |
range(len(total_list[__i].charts)):
total_list[__i].charts[__j] = Chart(total_list[__i].charts[__j])
demolist = abstract.get_abstract_id_list()
unfinishobj = []
for item in obj:
try:
if int(item['id']) not in demolist:
unfinishobj.append(item)
except:
pass
unfinish_list: ... | Python | 1 |
band': 'bandpass',
'bandpass': 'bandpass',
'pass': 'bandpass',
'bp': 'bandpass',
'bs': 'bandstop',
'bandstop': 'bandstop',
'bands': 'bandstop',
'stop': 'bandstop',
'l': 'lowpass',
'low': 'lowpass',
... | Python | 1 |
pub fn get_clint(&self) -> &Clint {
&self.clint
}
pub fn get_mut_clint(&mut self) -> &mut Clint {
&mut self.clint
}
pub fn get_mut_uart(&mut self) -> &mut Uart {
&mut self.uart
}
}use crate::typedef::{DeviceList, PCB, TypeMap};
/// | result | stand |
/// |--------|-------|
/// | Err(0) | device type no... | Rust | 0 |
finalized[i // beam_size][i % beam_size]["alignment"] = alignment
return finalized
def _prepare_batch_for_alignment(self, sample, hypothesis):
src_tokens = sample["net_input"]["src_tokens"]
bsz = src_tokens.shape[0]
src_tokens = (
src_tokens[:, None, :]
... | Python | 1 |
CoseError::UnexpectedItem("array", "array with 4 items"));
}
// Remove array elements in reverse order to avoid shifts.
Ok(Self {
signature: a.remove(3).try_as_bytes()?,
payload: match a.remove(2) {
Value::Bytes(b) => Some(b),
Value::Null ... | Rust | 0 |
], trainings)
def test_one_training(self, mock_requests: 'requests_mock.Mocker') -> None:
"""Get Carif training when there's only one available."""
carif_file_name = path.join(path.dirname(__file__), 'testdata/carif_single_offer.xml')
with open(carif_file_name, encoding='utf-8') as carif_f... | Python | 1 |
import tkinter as tk
win = tk.Tk()
win.geometry('600x600')
win.title('企鹅分类')
culmen_length_label = tk.Label(win, text='喙的长度(mm)')
culmen_length_label.pack()
culmen_length_entry = tk.Entry(win, width=10)
culmen_length_entry.pack()
culmen_depth_label = tk.Label(win, text='喙的厚度(mm)')
culmen_depth_label.pack()
culmen_de... | Python | 1 |
#!/usr/bin/env python3
# zip_fast_progress.py
import sys, os
from pathlib import Path
from zipfile import ZipFile, ZIP_STORED
from tqdm import tqdm # pip install tqdm
def zip_folder_fast(src_dir: str, zip_path: str):
src = Path(src_dir).resolve()
if not src.is_dir():
raise ValueError(f"Source '{src}'... | Python | 1 |
if join_pane.horizontal.unwrap_or(false) { args.push(h_KEY); }
if join_pane.vertical.unwrap_or(false) { args.push(v_KEY); }
let s;
if let Some(size) = join_pane.size {
s = size.to_string();
args.extend_from_slice(&[l_KEY, &s]);
}
let p;
if let S... | Rust | 0 |
let slice = b1.borrow_mut(&guard).as_mut_slice::<u32>();
slice.copy_from_slice(&glyph_indices[..]);
let slice = b2.borrow_mut(&guard).as_mut_slice::<f32>();
slice.copy_from_slice(&advances[..]);
}
js_array.set(&mut ctx, 0, b1).unwrap();
... | Rust | 0 |
() {
unsafe {
apic::disable_pic();
crate::hardware::rtc::enable_rtc(6); //Default value of 1024 hz
apic::enable_apic(0);
// Default IRQs
// apic::ioapic_set_irq(0, 0, InterruptIndex::Timer.as_u8());
apic::ioapic_set_irq(1, 0, InterruptIndex::Keyboard.as_u8());
... | Rust | 0 |
, b'T', b'D', b'T', b'E', b'T', b'F', b'T', b'G',
b'T', b'H', b'T', b'I', b'T', b'J', b'T', b'K', b'T', b'L', b'T', b'M', b'T', b'N', b'T', b'O',
b'T', b'P', b'T', b'Q', b'T', b'R', b'T', b'S', b'T', b'T', b'T', b'U', b'T', b'V', b'T', b'W',
b'T', b'X', b'T', b'Y', b'U', b'0', b'U', b'1', b'U', b'2', b'U', ... | Rust | 0 |
template_program = '''
import numpy as np
def choose_action(pos: float, v: float, last_action: float) -> float:
"""Return the action for the car to proceed the next move.
Args:
pos: Car's position, a float ranges between [-1.2, 0.6].
v: Car's velocity, a float ranges between [-0.07, 0.07].
... | Python | 1 |
file_header +
payload +
central_directory_file_header +
payload +
end_of_central_directory_record
);
f = open("sploit.zip", "w")
f.write(zip)
f.close()
print "[*] Local file header size = 0x%x" %len(local_file_header)
print "[*] Central directory file header size = 0x%x" %len(central_directory_file_header)
print "[*]... | Python | 1 |
in a specific column of the data
2. Find correlations between two columns in the data
You have the following tools:
- find_outliers: Find outliers in a column using z-score or IQR methods
- For method parameter, use 'z_score' or 'iqr'
- For threshold parameter, use ... | Python | 1 |
#!/usr/bin/env python3
import sys
import subprocess
import urllib3
import requests
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
target = "http://opencrx:8080/opencrx-core-CRX/PasswordResetConfirm.jsp"
def main() -> None:
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <user_id>... | Python | 1 |
rng.fill(yv12_packet.data.as_mut_slice());
let mut yv12_global_index: usize = 0;
let mut assign_index = |b: &mut u8| {
*b = (yv12_global_index % 256) as u8;
yv12_global_index += 1;
};
// YV12 Luminance plane.
for row in... | Rust | 0 |
) > 0:
process = executable_processes.popleft()
if can_schedule(process, stock.resources) and process.priority > 0:
logging.info(f"Process start: {process.name}, Start Time: {time_elapsed}")
consume_resources(stock.resources, process)
assign_prior... | Python | 1 |
rs"),
}
}
/*
* Cosmos SDK - Legacy REST and gRPC Gateway docs
*
* A REST interface for state queries, legacy transactions
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/
/// IbcCoreConnectionV1Version : Version defines the versioning scheme used to negoti... | Rust | 0 |
c:
await check_symbol_information(client, doc, symbols)
@pytest.mark.asyncio
async def test_document_symbols_exprs(client: LanguageClient):
"""
Test that document symbols for more complex expressions are correct
This test ensures that we can round-trip well formed expressions through
'symbol_... | Python | 1 |
eturn true;
} else if let Some(flags) = &config.flags {
if let Some(current_usage) = flags.current_usage {
return current_usage;
}
}
false
}
fn get_use_basic_mode(matches: &clap::ArgMatches<'static>, config: &Config) -> bool {
if matches.is_present("basic") {
return... | Rust | 0 |
out.decode('utf-8')
stderr = stderr.decode('utf-8')
modules = eval(stdout)
self.assertIn('site', modules)
# http://bugs.python.org/issue19205
re_mods = {'re', '_sre', 'sre_compile', 'sre_constants', 'sre_parse'}
# _osx_support uses the re module in many placs
if... | Python | 1 |
cratch_pad"].chunks
]
)
answer = await self.llm_service.generate_answer(
query=state["user_query"], context=context
)
state["response"] = QAResponse(
query=state["user_query"],
answer=answer,
sources=[chunk.source_url for chun... | Python | 1 |
sion_function(X, queue=queue))
@pass_if_not_implemented_for_gpu(reason="multiclass svm is not implemented")
@pytest.mark.parametrize('queue', get_queues())
def test_iris(queue):
iris = datasets.load_iris()
clf = SVC(kernel='linear').fit(iris.data, iris.target, queue=queue)
assert clf.score(iris.data, iris... | Python | 1 |
# AUTO GENERATED FILE - DO NOT EDIT
import typing # noqa: F401
from typing_extensions import TypedDict, NotRequired, Literal # noqa: F401
from dash.development.base_component import Component, _explicitize_args
ComponentType = typing.Union[
str,
int,
float,
Component,
None,
typing.Sequence[ty... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2023 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 |
let progress = self.ticks - 5;
let size = 160 + 20 * progress;
let x = 80 - (size as i32) / 2;
let y = 75 - 3 * (progress as i32);
unsafe { *DRAW_COLORS = 0x22 }
oval(x, y, size, size);
}
else
{
let progress = self.ticks - 25;
unsafe { *DRAW_COLORS = 0x22 }
let y = 15 - 3 * ... | Rust | 0 |
rect_data.program,
&uniform! {
color: color,
projection: drawer.projection,
model: model },
&drawer.params)
.unwrap();
}
pub struct Texture {
tex: glium::texture::CompressedSrgbTexture2d,
dimensions: (u32, u32... | Rust | 0 |
"sequence": 2,
"message_id": None, # 内容块不保存到数据库
"thread_id": "thread_123",
"type": "assistant",
"is_llm_message": True,
"content": '{"role": "assistant", "... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, models
from odoo.exceptions import UserError
class AccountMove(models.Model):
_inherit = "account.move"
def action_open_l10n_ph_2307_wizard(self):
vendor_bills = self.filtered_domain([('move_type', '=', 'i... | Python | 1 |
ing_posts AS
SELECT
id,
content,
media_url,
hashtags,
likes_count,
reposts_count,
comments_count,
shares_count,
owner_id,
created_at,
(likes_count * 1.0 + reposts_count * 3.0 + co... | Python | 1 |
}
pub type bytea = varlena;
pub type text = varlena;
pub type BpChar = varlena;
pub type VarChar = varlena;
#[repr(C)]
#[derive(Debug)]
pub struct int2vector {
pub vl_len_: int32,
pub ndim: ::std::os::raw::c_int,
pub dataoffset: int32,
pub elemtype: Oid,
pub dim1: ::std::os::raw::c_int,
pub lbou... | Rust | 0 |
c_4 = data.add_client("client 4");
let f_1 = data.add_file(FileInfo::new("file 1", alloc::vec![c_1, c_2]));
let f_2 = data.add_file(FileInfo::new("file 2", alloc::vec![c_3]));
let f_3 = data.add_file(FileInfo::new("file 3", alloc::vec![c_2]));
let f_4 = data.add_file(FileInfo::new("file 4", alloc::vec!... | Rust | 0 |
abels = labels[s]
#generate difference matrix
switch = 0
expcopy = np.array(exp)
while switch == 0:
swapm = np.zeros([len(calc), len(calc)])
for i,Hi in enumerate(expcopy):
for j,Hj in enumerate(expcopy):
if i>j:
swapm[i, j] = 0
... | Python | 1 |
pattern: Optional name pattern (SQL LIKE syntax)
tags: Optional list of tags to filter by
limit: Maximum number of results
offset: Number of results to skip
Returns:
List of secret metadata (no encrypted values)
Raises:
... | Python | 1 |
stm32;
use crate::gpio::{
gpioa::{PA11, PA12, PA3, PA5},
gpiob::{PB0, PB1, PB10, PB11, PB12, PB13, PB5},
gpioc::{PC0, PC2, PC3},
gpioh::PH4,
Alternate, Speed, AF10,
};
#[cfg(not(feature = "rm0468"))]
use crate::gpio::gpioi::PI11;
#[cfg(any(feature = "rm0433", feature = "rm0399"))]
use crate::gpio... | Rust | 0 |
mentation and/or other materials provided with the distribution.
// * Neither the name of the University of California, Berkeley nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY... | Rust | 0 |
end token is reached.
results.append(h)
else:
# Otherwise continue to the extend the hypothesis.
hyps.append(h)
if len(hyps) == self._beam_size or len(results) == self._beam_size:
break
steps += 1
if steps == self._max_steps:
results.extend(hyps)... | Python | 1 |
re.shared_kernel.config.domain_services',
'alienvault-api-core.infrastructure.shared_kernel.config.domain_services.abstract_config_repository',
'alienvault-api-core.shared_kernel.config',
'alienvault-api-core.shared_kernel.config.domain_services',
'alienvault-api-core.shared_kern... | Python | 1 |
"""
Mini benchmark for powerSpectrum (pure python versus cython)
"""
import sys
from powerSpectrum import powSpectrum as powSpectrum_py
from powerSpectrum2 import powSpectrum as powSpectrum_cy
def bench_powerSpectrum_py(data,Nbins):
freq, pow_data = powSpectrum_py(data,Nbins)
print pow_data
def bench_po... | Python | 1 |
import random
def get_question(level):
questions = {
"Mudah": [
{"question": "Apa ibukota Indonesia?", "answer": "Jakarta"},
{"question": "Berapa hasil dari 2 + 2?", "answer": "4"},
{"question": "Warna bendera Indonesia?", "answer": "Merah Putih"},
{"question... | Python | 1 |
"""
Rasterize a vector
==================
This example demonstrates the rasterizing of a vector using :func:`geoutils.Vector.rasterize`.
"""
# %%
# We open a raster and vector.
# sphinx_gallery_thumbnail_number = 2
import geoutils as gu
filename_rast = gu.examples.get_path("everest_landsat_b4")
filename_vect = gu.e... | Python | 1 |
a new champion breakpoint; then \(if)if it is time for
// a page break, prepare for output, and either fire up the user's
// output routine and |return| or ship out the page and |goto done|@>;
crate::section_1005::Check_if_node_p_is_a_new_champion_breakpoint__then_if_it_is_time_for_a_page_b... | Rust | 0 |
{
fn as_ref(&self) -> &TiVec<K, V> {
self
}
}
impl<K, V> AsMut<TiVec<K, V>> for TiVec<K, V> {
fn as_mut(&mut self) -> &mut TiVec<K, V> {
self
}
}
impl<K, V> AsRef<TiSlice<K, V>> for TiVec<K, V> {
fn as_ref(&self) -> &TiSlice<K, V> {
self
}
}
impl<K, V> AsMut<TiSlice<K... | Rust | 0 |
us.RUNNING:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail="Cannot delete a job that is currently running. Please wait for it to complete or fail."
)
# Attempt to delete associated files from object storage
# Log errors but do not necessarily block ... | Python | 1 |
can't be used
if header.number() > tip_header.number() {
Some(tip_header)
} else {
Some(header)
}
// Bootstrap quickly by guessing a parent of our best tip is the forking point.
// Guessing wrong in either di... | Rust | 0 |
allow(unused_mut)]
let mut writer =
aws_smithy_query::QueryWriter::new(&mut out, "RegisterPublisher", "2010-05-15");
#[allow(unused_mut)]
let mut scope_541 = writer.prefix("AcceptTermsAndConditions");
if let Some(var_542) = &input.accept_terms_and_conditions {
scope_541.boolean(*var_542)... | Rust | 0 |
"),
Value::from(tournament.country.clone()),
);
meta.insert(
String::from("creator_username"),
Value::from(tournament.creator.clone()),
);
let creator = self.users_by_username.get(tournament.creator.as_str());
let creator_display_name = match ... | Rust | 0 |
from __pycache__ import *
n=(int(input("enter binary number=")))
i=n
decimal=0
k=0
while(i>0):
a=i%10
decimal=decimal+a*(2**k)
k=k+1
i=i//10
print("decimal=",decimal)
add()
| Python | 1 |
remove(word)
return errors
def word_only(dic):
errors = 0
words = dic.copy()
while words:
word, english, eng_gen, _, german = get_word(words)
print_word(english, eng_gen)
errors += guess_word(german, "The German word is: ", "That's right!")
words.remove(word)
return ... | Python | 1 |
= os.path.join(upload_folder, mp4_file)
output_filename = mp4_file.replace('.mp4', '_emotion_analysis.json')
output_path = os.path.join(output_folder, output_filename)
logger.info(f"Processing emotions for: {mp4_file}")
analysis_result = parser.process_video... | Python | 1 |
value.to_glib_none().0))
}
}
impl SetValue for CellRendererMode {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
pub enum Const... | Rust | 0 |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from datetime import datetime
from .._models import BaseModel
__all__ = ["CardProgram"]
class CardProgram(BaseModel):
token: str
"""Globally unique identifier."""
created: datetime
... | Python | 1 |
6",
"ADI IMMED",
"END",
];
let ppc = get_preprocessed_code(&convert_input(code));
assert_eq!(Ok(convert_input(vec!["ADI 5", "ADI 10"])), ppc);
}
#[test]
fn if_endif() {
let code = vec![
"COND SET 0ffH",
"IF COND",
"... | Rust | 0 |
_to_camel_case(field_name)
@classmethod
@cache
def gql_fragments(cls, *, lazy: bool) -> List[GraphQLFragment]:
"""Get the GraphQL fragments needed to query for this model.
The first (0th) fragment is always the fragment that represents the model itself.
The remaining fragments are ... | Python | 1 |
for c in s {
print!("{}", *c as char);
}
println!();
}
fn print_tree<T: StorageIo>(dir: &Dir<T>, level: usize) {
for dir_entry in dir.iter() {
if dir_entry.name()[0] != b'.' {
for _ in 0..level {
print!(" ");
}
print_str(dir_ent... | Rust | 0 |
";
/// The output path for transaction script documentation.
pub const TRANSACTION_SCRIPTS_DOC_DIR: &str = "transaction_scripts/doc";
/// The output path under which compiled script files can be found
pub const COMPILED_TRANSACTION_SCRIPTS_DIR: &str = "compiled/transaction_scripts";
/// The output path for transaction... | Rust | 0 |
te`]: ./struct.Coordinate.html
/// [`Polygon`]: ./struct.Polygon.html
#[macro_export]
macro_rules! polygon {
() => { $crate::Polygon::new(line_string![], vec![]) };
(
exterior: [
$((x: $exterior_x:expr, y: $exterior_y:expr)),*
$(,)?
],
interiors: [
$([... | Rust | 0 |
#!/usr/bin/env python
"""
Readers for STAR (spliced aligner) format reading
"""
class STARJunctionRecord:
"""
column 1: chromosome
column 2: first base of the intron (1-based) --> store as 0-based
column 3: last base of the intron (1-based)
column 4: strand (0: undefined, 1: +, 2: -)
column 5:... | Python | 1 |
, {distance_t}"
spec = f"standard_descriptor_spec<{params}>"
content = f"""template struct {spec};"""
specs.append(spec)
with open(path, "w") as f:
f.write(template.format(includes=includes, content=content))
cmake_list.append(f" src/neighbors/detail/cagra/{path}")
with open("compute_d... | Python | 1 |
Ok(())
}
/// List all linked shared libraries
pub fn readelf_list_shared_libs(readelf_path: &Path, lib_path: &Path) -> Result<Vec<String>> {
let mut readelf = std::process::Command::new(readelf_path);
readelf.arg("-d").arg(lib_path);
let output = readelf.output_err(false)?;
let mut needed = Vec::ne... | Rust | 0 |
ope available
mgr.push_scope(&Exp::Call(box Exp::Undefined, vec![]));
let (x, x_ptr) = test_utils::make_str("x");
let x_bnd = mgr.alloc(x, Some(x_ptr)).unwrap();
mgr.push_scope(&Exp::Undefined);
let copy = mgr.load(&x_bnd);
assert!(copy.is_ok());
let (var_copy, ... | Rust | 0 |
ath = path.replace(os.sep, "\\")
path_len = len(path)
toc.append(f"{hex(len(sub_fd))[2:]:>12s} {hex(path_len)[2:]:>2} {path}")
fd.write(sub_fd)
total_write_size += len(sub_fd)
if total_write_size % 0x4 > 0:
fd.write(byt... | Python | 1 |
'7'),
vec!('8', '5', '9', '7', '6', '1', '4', '2', '3'),
vec!('4', '2', '6', '8', '5', '3', '7', '9', '1'),
vec!('7', '1', '3', '9', '2', '4', '8', '5', '6'),
vec!('9', '6', '1', '5', '3', '7', '2', '8', '4'),
vec!('2', '8', '7', '4', '1', '9', '6', '3', '5'),
vec!('3', '4', '5', '2... | Rust | 0 |
RAY_QUERY_SPEC_VERSION: u32 = 1;
pub const VK_KHR_RAY_QUERY_EXTENSION_NAME: &'static [u8; 17usize] = b"VK_KHR_ray_query\0";
pub const VULKAN_ANDROID_H_: u32 = 1;
pub const VK_KHR_android_surface: u32 = 1;
pub const VK_KHR_ANDROID_SURFACE_SPEC_VERSION: u32 = 6;
pub const VK_KHR_ANDROID_SURFACE_EXTENSION_NAME: &'static [... | Rust | 0 |
/// ```rust
/// # use thindx::{*, d3d::*}; let d3dc = Compiler::new(47).unwrap();
/// let shader = d3dc.compile_from_file(
/// r"test\data\basic.hlsl", None, None, "ps_main", "ps_4_0",
/// Compile::Debug, CompileEffect::None
/// ).unwrap();
///
/// // Should succeed:
/// let r ... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2020 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 |
"""
INHERITANCE (PEWARISAN)
"""
print("INHERITANCE (PEWARISAN)")
class Mobil:
def __init__(self, warna, merek, kecepatan):
self.warna = warna
self.merek = merek
self.kecepatan = kecepatan
def tambah_kecepatan(self):
self.kecepatan += 10
class MobilSport(Mobil): # INHERITANCE
... | Python | 1 |
)
else:
return V1DevicesDeviceIdConfigPutRequestCoreInterfacesValueInterfaceInterfaceTypeWan(
)
"""
def testV1DevicesDeviceIdConfigPutRequestCoreInterfacesValueInterfaceInterfaceTypeWan(self):
"""Test V1DevicesDeviceIdConfigPutRequestCoreInterfacesValueInterfaceI... | Python | 1 |
params,
})
.await
.context(GrpcStatus)?;
if ctx.output == OutputFormat::Default {
debug!("Default output for jsonrpc calls is JSON.");
};
println!(
"{}",
response.get_ref().result.to_colored_json_auto().unwrap()
);
Ok(())
}
// Copyright... | Rust | 0 |
from __future__ import print_function
import ctypes
import sys
import os
if os.environ['USERNAME'] == 'r541964':
sys.path.insert(0, r'd:\src\tpn\lib')
sys.path.insert(0, r'd:\src\tracer\PythonApp\lib')
basedir = r'e:\trace2'
else:
if os.environ['COMPUTERNAME'] == 'COUGAR':
basedir = r'S:\trace... | Python | 1 |
# This is our secret number for today;s order
receipt_order = 2468
# Read the customer's input
slices = int(input("How many pizza slices did you order? "))
price_per_slice = int(input("What was the price per slice? "))
# Calculate the total
order_total = slices * price_per_slice
# Check if the order total matches ou... | Python | 1 |
The direct output from learned diffusion model.
timestep (`float`):
The current discrete timestep in the diffusion chain.
sample (`torch.FloatTensor`):
A current instance of a sample created by the diffusion process.
s_churn (`float`):
s_... | Python | 1 |
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (C) 2014 iZsh <izsh at fail0verflow.com>
#
# This code is licensed to you under the terms of the GNU GPL, version 2 or,
# at your option, any later version. See the LICENSE.txt file for the text of
# the lic... | Python | 1 |
"""
Copyright (C) 2017, 申瑞珉 (Ruimin Shen)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed i... | Python | 1 |
{
println!("No solution found.")
}
}
#![allow(clippy::needless_lifetimes)]
#[rustversion::since(1.51)]
#[multiversion::multiversion(versions(
clone = "[x86|x86_64]+avx2+avx",
clone = "[x86|x86_64]+avx",
clone = "x86+sse"
))]
fn pass<'a>(x: &'a i32) -> &'a i32 {
x
}
#[rustversion::since(1.... | Rust | 0 |
if usage:
result += f" - Usage: {usage.get('sent', 0)} sent, {usage.get('recv', 0)} received\n"
result += "\n"
return result
except Exception as e:
return f"Failed to list clients for network {network... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.