text string | label_name string | labels int64 |
|---|---|---|
,
(Complex::new(0, 0), Complex::new(0.0, 0.0))
]);
}
#[test]
fn runner_multi_jobs() {
let escape_time = EscapeTime::new(Complex::new(0.0, 0.0), 50, 2.0);
let canvas = Canvas::new(32, 32, Complex::new(0.5, -0.5), Complex::new(0.0, 0.0));
let mut runner = EscapeT... | Rust | 0 |
query](https://www.w3.org/TR/sparql11-query/)
///
/// ```
/// use oxigraph::model::NamedNode;
/// use oxigraph::sparql::Query;
///
/// let query_str = "SELECT ?s ?p ?o WHERE { ?s ?p ?o . }";
/// let mut query = Query::parse(query_str, None)?;
///
/// assert_eq!(query.to_string(), query_str);
///
/// // We edit the que... | Rust | 0 |
context.service_file_path = os.path.join(Paths.SystemdServiceFilePath, f"{Configure.SERVICE_NAME}.service")
# There's not a great way to find the log path from the config file, since the only place it's located is in the systemd file.
if context.is_standalone:
context.printer_data_logs_... | Python | 1 |
import random
adivinar=int(random.randint(1,100))
numero=0
while numero!=adivinar:
numero=int(input("Adivina el número "))
if numero<adivinar:
print("El número es mayor")
else:
print("El número es menor")
print("Ganasteeee!!!!!") | Python | 1 |
One binding
consists of a member, a role, and an optional condition.
See $ {parent_command} get-iam-policy for examples of how to
specify a model resource.
"""
description = 'remove IAM policy binding from an AI Platform model'
detailed_help = iam_util.GetDetailedHelpForRemoveIamPolicyBinding(
'model... | Python | 1 |
" calls for
// dependencies. Unfortunately, prost doesn't create this for us automatically.
#![deny(
warnings,
missing_docs,
trivial_casts,
trivial_numeric_casts,
unused_import_braces
)]
#![forbid(unsafe_code)]
#![doc(html_root_url = "https://docs.rs/tendermint-proto/0.1.0")]
mod tendermint {
... | Rust | 0 |
#[no_mangle]
pub unsafe extern "C" fn Java_com_senmiao_app_websocket_WebSocket_sendBinary(env: JNIEnv, this:jobject, bytes:jbyteArray)->jboolean{
let this = JObject::from(this);
match env.convert_byte_array(bytes) {
Ok(bytes) => {
match get_client(&env, &this){
... | Rust | 0 |
]
pub fn GetAnycastIpAddressEntry(row: *mut MIB_ANYCASTIPADDRESS_ROW) -> super::super::Foundation::NTSTATUS;
#[doc = "*Required features: `\"Win32_NetworkManagement_IpHelper\"`, `\"Win32_Foundation\"`, `\"Win32_Networking_WinSock\"`*"]
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Networking_WinS... | Rust | 0 |
d instance of `V`.
/// - You must ensure the instance of `V` is not borrowed.
pub unsafe fn as_mut_ref_unchecked(self) -> &'shield mut V {
&mut *self.as_ptr()
}
/// Check if the tagged pointer is null.
pub fn is_null(self) -> bool {
self.as_ptr().is_null()
}
/// Get the tag... | Rust | 0 |
self.add_client_callbacks(client, on_first_service_request)
client.connect()
client.register_service_sync(self.info, self.REG_DELAY)
first_service_request = Request(
"/mcafee/service/JTI/file/reputation/" + self.info.service_id)
first_service_req... | Python | 1 |
::from_millis(1000));
system
.shutdown()
.expect("Kompact didn't shut down properly");
}
// Sets up two KompactSystems with 2x Pingers and Pongers. One Ponger is registered by UUID,
// the other by a custom name. One Pinger communicates with the UUID-registered Ponger,
// the other with the named ... | Rust | 0 |
from a import aksjdhflsakhdflkjsadlfajkslhf
from a import (
aksjdhflsakhdflkjsadlfajkslhf,
)
from a import (
aksjdhflsakhdflkjsadlfajkslhfdkjsaldajlahflashdfljahlfksajlhfajfjfsaahflakjslhdfkjalhdskjfa,
)
from a import (
aksjdhflsakhdflkjsadlfajkslhfdkjsaldajlahflashdfljahlfksajlhfajfjfsaahflakjslhdfkjalhdsk... | Python | 1 |
a {
}<filename>rpc/src/endpoint/block_by_hash.rs
//! `/block_by_hash` endpoint JSON-RPC wrapper
use serde::{Deserialize, Serialize};
use tendermint::{
block::{self, Block},
Hash,
};
/// Get information about a specific block by its hash
#[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]... | Rust | 0 |
splaySwitch,
KbdIllumToggle,
KbdIllumDown,
KbdIllumUp,
Eject,
Sleep,
];
for &key in &keys {
let val: u32 = key.into();
let key2: Key = val.into();
assert_eq!(key, key2);
}
}
}
<filename>src/crypto... | Rust | 0 |
elf.alpha)
try:
ct_img = torch.tensor(np.ascontiguousarray(ct_img)).float()
pet_img = torch.tensor(np.ascontiguousarray(pet_img)).float()
fusion_img = torch.tensor(np.ascontiguousarray(fusion_img)).float()
except:
print('?')
return {
... | Python | 1 |
"""
Test script for training data preparation.
This script tests the training data preparation functions with the actual Open-R1-Math-220k dataset.
"""
from datasets import load_dataset
from transformers import AutoTokenizer
def format_prompt(problem):
"""
Format the prompt for the model.
Args:
... | Python | 1 |
mut count = 0;
while count < nedges {
let i = rng.gen_range(0..nodes);
let j = rng.gen_range(0..nodes);
if i != j && !edges.contains_key(&(i, j)) {
edges.insert((i, j), rng.gen_range(min_w..max_w));
edges.insert((j, i), rng.gen_range(min_w..max_w));
coun... | Rust | 0 |
"""
===============================================================================
Module Name: blacklist.py
Description: Blacklist manager for URL and line ID checking.
Author: Jerry, Ken, SJ
Last Updated: 2025-06-23
Version: 1.0.0
Notes: 無
=====================================================... | Python | 1 |
from facelib import FaceDetector
from facelib import EmotionDetector
from facelib import special_draw
import torch
import cv2
class WebcamEmotionDetector:
def __init__(self, device=torch.device("cuda:0" if torch.cuda.is_available() else "cpu")):
print('loading ...')
self.face_detector = FaceDetect... | Python | 1 |
from pathlib import Path
from omnipaxos_cluster import OmnipaxosClusterBuilder
from omnipaxos_configs import FlexibleQuorum, RequestInterval
def example_workload() -> dict[int, list[RequestInterval]]:
experiment_duration = 10
read_ratio = 0.50
high_load = RequestInterval(experiment_duration, 100, read_ra... | Python | 1 |
ructure"]
impl crate::Readable for SYS_TIMER_SYSTIMER_TARGET0_HI {}
#[doc = "`write(|w| ..)` method takes [sys_timer_systimer_target0_hi::W](sys_timer_systimer_target0_hi::W) writer structure"]
impl crate::Writable for SYS_TIMER_SYSTIMER_TARGET0_HI {}
#[doc = "SYS_TIMER_SYSTIMER_TARGET0_HI"]
pub mod sys_timer_systimer_... | Rust | 0 |
from crewai import Agent, Crew, Process, Task, LLM
from crewai.project import CrewBase, agent, crew, task
from crewai.knowledge.source.pdf_knowledge_source import PDFKnowledgeSource
from crewai.knowledge.source.text_file_knowledge_source import TextFileKnowledgeSource
from crewai.knowledge.source.crew_docling_source im... | Python | 1 |
import dash
from dash import dcc, callback, Output, Input, dash_table # pip install dash
import dash_bootstrap_components as dbc # pip install dash-bootstrap-components
import plotly.express as px
df = px.data.tips()
print(df.head())
# convert dataframe to list of dictionaries because dcc.Store
# accepts dict | list... | Python | 1 |
from django.shortcuts import render
from .models import Note
def note_list(request):
notes = Note.objects.all()
return render(
request,
'app/note_list.html',
context={'notes': notes})
def note_detail(request, pk):
note = Note.objects.get(pk=pk)
return render(
request,... | Python | 1 |
import pytest
from connexion.operations import OpenAPIOperation
from connexion.resolver import MethodViewResolver
@pytest.fixture(scope='session', params=["fakeapi", "anotherapi"])
def method_view_resolver(request):
return request.param
def test_methodview_resolve_with_different_module_names(method_view_resolver)... | Python | 1 |
Response(
url=url,
status_code=res.status,
raw_body=response_body,
headers=res.headers,
)
_debug_log_response(self.logger, resp)
... | Python | 1 |
unwrap()
}
/// Returns an operational tool pointing to a validator node at the given node index.
pub fn get_op_tool(swarm: &LibraSwarm, node_index: usize) -> OperationalTool {
OperationalTool::new(
format!("http://127.0.0.1:{}", swarm.get_client_port(node_index)),
ChainId::t... | Rust | 0 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResCompany(models.Model):
_inherit = 'res.company'
l10n_jo_annual_leave_type_id = fields.Many2one("hr.leave.type",
string="JO Annual Leave Time-off Type",
default=lambda self: sel... | Python | 1 |
nd_VRS_RegClass,
word: _Unwind_Word,
repr: _Unwind_VRS_DataRepresentation,
data: *mut c_void)
-> _Unwind_VRS_Result;
}
let mut val: _Unwind_Word = 0;
let ptr = &mut val as *mut _Unwind_W... | Rust | 0 |
a
d: @ s d Z ddlZddlmZ ddlmZ ddlmZ g dZG dd dZ d d
Z
dd ZG d
d de ejdZ
eG dd de
Ze ZdS )zwPolicy framework for the email package.
Allows fine grained feature control of how the package parses and emits data.
N)header)charset)_ha... | Python | 1 |
import streamlit as st
from dotenv import load_dotenv
import os
import whisper
import moviepy.editor as mp
import google.generativeai as genai
import tempfile
load_dotenv()
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
# prompt -------------------
prompt = """You are a meeting video summarizer. You will be ta... | Python | 1 |
pred_boxes=proposal_boxes,
features=feature_pooled,
sizes=image_shapes,
scales=scales_yx,
)
# will we pad???
subset_kwargs = {
"max_detections": kwargs.get("max_detections", None),
"return_tensors": kwargs.get("return_tens... | Python | 1 |
exercise_slides,
exercise_tasks,
url_path: "".to_string(),
title: "".to_string(),
chapter_id: None,
}
}
}
<gh_stars>0
pub mod transport;
pub use crate::transport::*;
<filename>native-windows-gui/src/controls/animation_timer.rs
use crate::controls:... | Rust | 0 |
=dcalls, exhaust=exhaust, minz=minz,
puresat=puresat, search=search, unsorted=unsorted,
trim=trim, verbose=verbose) as primer:
# iterating over the necessary number of primes
for i, prime in enumerate(primer.enumerate()):
# reporting the c... | Python | 1 |
from mbot.core.plugins import plugin, PluginCommandContext, PluginCommandResponse, PluginMeta
from . import plex_sortout
from mbot.openapi import mbot_api
from mbot.core.params import ArgSchema, ArgType
from .get_top250 import get_top250, get_lost_top250, get_lost_douban_top250, get_lost_imdb_top250
from .sub_to_mbot i... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2015 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python | 1 |
DOWN)
}
#[doc = r" Writes raw bits to the field"]
#[inline]
pub fn bits(self, value: u8) -> &'a mut W {
const MASK: u8 = 0x03;
const OFFSET: u8 = 28;
self.w.bits &= !((MASK as u32) << OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc ... | Rust | 0 |
"""
Read log files and check the statistical differences.
"""
import pandas as pd
import numpy as np
from sklearn.metrics import mean_absolute_error, \
mean_squared_error
# get GNPy and Mininet-Optical tests data
mo_tests_path = 'mo_tests.csv'
gnpy_tests_path = '../../gnpy-cross-validation/gnpy-mytests/gnpy... | Python | 1 |
import os
import requests
import subprocess
class Version:
@staticmethod
def linuxdownload(linuxversion):
if os.path.exists(linuxversion) == False:
os.system(f"wget -c 'https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git/snapshot/{linuxversion}.tar.gz'")
i =... | Python | 1 |
from Model import *
import os
from PromptBuilder import *
from Metrics import *
from Log import *
from dotenv import load_dotenv
from Translator import *
load_dotenv()
#MODEL_NAME = "deepseek/deepseek-r1:free"
MODEL_NAME = "deepseek/deepseek-r1:nitro"
LOCAL_MODEL_NAME = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
CHAT... | Python | 1 |
rank]["read_segments"]["length"])
# total time
time = {
"delta_t_sw": time_sw,
"delta_t_sr": time_sr,
"delta_t_awa": 0,
"delta_t_awr": 0,
"delta_t_aw_lost": 0,
"delta_t_ara": 0,
"delta_t_arr": 0,
"delta_t_ar_lost": 0,
"delta_t_overhead": 0... | Python | 1 |
teNamespaceExistPersonal", params, headers=headers)
response = json.loads(body)
model = models.ValidateNamespaceExistPersonalResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKExcepti... | Python | 1 |
def greatest_of_two_numbers(a, b):
return max(a, b)
a = int(input("Enter the first number: "))
b = int(input("Enter the second number: "))
result = greatest_of_two_numbers(a, b)
print(f"The greatest of {a} and {b} is: {result}") | Python | 1 |
import socket
if __name__ == "__main__":
listen_socket = socket.socket(
family=socket.AF_INET,
type=socket.SOCK_STREAM)
# "0.0.0.0" => accept connections from anywhere
# "127.0.0.1" => accept connections only from
# the same computer
listen_address = ("0.0.0.0", 12000... | Python | 1 |
lhs, rhs)
return self._maybe_evaluate_binop(op, node.op, lhs, rhs)
operands = node.values
return reduce(visitor, operands)
_python_not_supported = frozenset(["Dict", "BoolOp", "In", "NotIn"])
_numexpr_supported_calls = frozenset(REDUCTIONS + MATHOPS)
@disallow(
(_unsupported_nodes |... | Python | 1 |
"""
Задание 2.
Пользователь вводит месяц в виде целого числа от 1 до 12.
Сообщить к какому времени года относится месяц (зима, весна, лето, осень).
Напишите вариант решения через dict.
Пример:
Введите номер месяца: 10
Результат через словарь: Осень
"""
# m = int(input("Введите номер месяца (1–12): "))
# if 1 <= m <= 1... | Python | 1 |
# Copyright 2022 Ant Group Co., Ltd.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | Python | 1 |
ively, settings parents node back to cope with the change
//
// this is guaranteed by the trie design not to recurse forever, because at some
// point the hashedkey value being shifted by level_index will match to 0,
// creating Leaf and Collision node instead of Subnode.
pub fn insert_rec<K: Clone + PartialEq, V: Clon... | Rust | 0 |
"<|qu|>",
"<|ro|>",
"<|rm|>",
"<|rn|>",
"<|ru|>",
"<|se|>",
"<|sm|>",
"<|sg|>",
"<|sa|>",
"<|sc|>",
"<|sr|>",
"<|sn|>",
"<|sd|>",
"<|si|>",
"<|sk|>",
"<|sl|>",
"<|so|>",
"<|st|>",
"<|es|>",
"<|su|>",
"<|sw|>",
"<|ss|>",
"<|sv|>"... | Python | 1 |
'ticker': config['ticker'],
'initial_capital': config['initial_capital'],
'start_date': config['start_date'],
'end_date': config['end_date'],
'transaction_fee_per_share': config['transaction_fee_per_share'],
'trading_start_time': config['trading_start_time'],
'trading_e... | Python | 1 |
# pymodbus code based on the example from http://www.solarpoweredhome.co.uk/
from pymodbus.client.sync import ModbusSerialClient as ModbusClient
from time import sleep
import datetime
import os
import json
import collections as cl
# trick to write datetime to json
def json_serial(obj):
if isinstance(obj, (datetim... | Python | 1 |
"""Test the bundlerextension CLI."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import os
import shutil
import unittest
from unittest.mock import patch
from ipython_genutils.tempdir import TemporaryDirectory
from ipython_genutils import py3compat
from traitl... | Python | 1 |
1024) {
let cs = WhiteOnBlack {};
let color = cs.color(outside(iterations));
prop_assert_eq!(Color::new(0.0, 0.0, 0.0), color);
}
}
}
}
/// Functions for signed numbers.
pub trait Signed {
/// Returns a number that represents the sign of `self... | Rust | 0 |
!("{}", e),
}
}
})
}
<gh_stars>0
use ark_ff::FftField as Field;
use crate::LabeledPolynomial;
use ark_poly::EvaluationDomain;
use ark_poly_commit::LinearCombination;
use ark_std::{cfg_into_iter, vec, vec::Vec};
pub struct MimcKey<F: Field> {
pub q_mimc: (LabeledPolynomial<F>, Vec<F>, Vec<F>... | Rust | 0 |
#-----------------------------------------------------------------------------
# Copyright (c) 2014-2023, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | Python | 1 |
_stars>1-10
#[macro_use]
mod macros;
msg_enum! {
HandshakeType, u8;
{
HelloRequest => 0x00,
ClientHello => 0x01,
ServerHello => 0x02,
NewSessionTicket => 0x04,
EndOfEarlyData => 0x05,
HelloRetryRequest => 0x06,
EncryptedExtensions => 0x08,
Certifi... | Rust | 0 |
self.cipher.encrypt(&mut output_block);
for i in 0..plaintext.len() {
plaintext[i] ^= output_block[i];
}
last_input_block = output_block;
}
}
pub fn decrypt_slice(&self, iv: &[u8; Self::IV_LEN]... | Rust | 0 |
pentomino.set(1, 0);
rpentomino.set(2, 0);
rpentomino.set(0, 1);
rpentomino.set(1, 1);
rpentomino.set(1, 2);
let demo_states = vec!{
rpentomino,
}
let mut app = Application::new_from_state(rpentomino);
let mut buffer: Vec<u32> = vec![0; WIDTH * HEIGHT];
let mut window = ... | Rust | 0 |
import numpy as np
import spacy
import os
from collections import Counter
import torch
import glob
from spacy import attrs
vocab_size = 50000
batch_size = 1000
nlp = spacy.load('en') # loads default English object
cnn_dir = '/home/mjc/datasets/CNN_DailyMail/cnn/stories/'
cnn_pre_dir = '/home/mjc/datasets/CNN_DailyMai... | Python | 1 |
.for_each(|_| Ok(())),
);
}
#[test]
fn discover_normal_peer_id() {
discover(PeerId::random())
}
#[test]
fn discover_long_peer_id() {
let max_value = String::from_utf8(vec![b'f'; 42]).unwrap();
let hash = encode(Hash::Identity, max_value.as_ref()).unw... | Rust | 0 |
{
id: String,
ranges: Vec<RangeInclusive<u32>>
}
impl TicketRule {
fn valid(&self, value: u32) -> bool {
self.ranges.iter().any(|r| r.contains(&value))
}
}
#[derive(Debug)]
struct Ticket {
fields: Vec<u32>
}
fn part1(input: &Input) -> u32 {
input.tickets.iter()
.skip(1)
... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 28 22:07:20 2024
@author: User
"""
"""Écrivez un script qui recopie une chaîne (dans une nouvelle variable) en l’inversant.
Ainsi par exemple, « zorglub » deviendra « bulgroz »."""
chaine = input("Entrez une chaine de caractère")
ch = ""
lc = len(chaine)
i = lc - 1
while... | Python | 1 |
import platform
import subprocess as sp
def get_active_window():
"""get current active window/application name, cross-platform simplified version"""
try:
sys = platform.system()
if sys == "Darwin":
script = 'tell application "System Events" to get name of first application process ... | Python | 1 |
from os import makedirs, remove
from os.path import exists, join
import sh
from pythonforandroid.recipe import Recipe
from pythonforandroid.logger import shprint
class LibPthread(Recipe):
'''
This is a dumb recipe. We may need this because some recipes inserted some
flags `-lpthread` without our control,... | Python | 1 |
from django.urls import path
from .views import medicos_view
urlpatterns = [
path('', medicos_view, name='medicos_view'),
]
| Python | 1 |
y::new(|| {
let stash = {
let template = imdecode(
&Vector::from_slice(include_bytes!("resources/stash_template.png")),
IMREAD_COLOR,
)
.unwrap();
let template_size = template.size().unwrap();
let offset = (template_size.width as u32, 0u32);
l... | Rust | 0 |
print('11)Exerc.: Boletim com listas compostas')
print("""
Crie um programa que leia nome e duas notas de vários alunos e guarde tudo em uma lista composta.
No final, mostre um boletim contendo a média de cada um e permita que o usuário possa mostrar as notas de cada aluno individualmente.
""")
alunos = []... | Python | 1 |
-> core::fmt::Result {
COTTAGE.console_pipe.write(s.as_bytes());
Ok(())
}
}
/// The task responsible for blinking the user LED.
fn blink_task_body(st: &mut BlinkSt) {
loop {
st.user_led.toggle();
System::sleep(r3::time::Duration::from_millis(210)).unwrap();
}
}
/// The tas... | Rust | 0 |
] =
[1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000];
const BASE10_STEP: i32 = 10;
const BASE10_BIAS: i32 = 350;
// HIGH LEVEL
// ----------
pub(crate) const BASE10_POWERS: ModeratePathPowers<u64> = ModeratePathPowers {
small: ExtendedFloatArray {
mant: &BASE10_SMALL_MANTISS... | Rust | 0 |
String) -> bool {
if commit.len() > MAX_COMMIT_LEN {
panic!("Commit too long!")
}
return true;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_assert_commit_len() {
let commit = "X".repeat(500);
assert!(assert_commit_len(commit));
}
#[test]
#[should_panic]
fn test_... | Rust | 0 |
ace
pub fn transpose_inplace(&mut self){
let f = |mut rmat: ArrayViewMut2::<f64>| {
rmat.swap([0, 1], [1, 0]);
rmat.swap([0, 2], [2, 0]);
rmat.swap([2, 1], [1, 2]);
};
#[cfg(feature = "parallel")]
par_azip!((rmat in self.ori.axis_iter_mut(Axis(2)... | Rust | 0 |
# Write here the code challenge solution
class Node:
def __init__(self,value):
self.value = value
self.next = None
class Linkedlist():
def __init__(self):
self.head = None
def append(self,value):
"""Append a new node with the given data to the end of the linked list."""
new_... | Python | 1 |
ists = cls.objects.filter(**filter_params).first()
return bool(exists)
@property
def user_render(self):
return UserService.get_user_name(self.user)
@property
def created_time_render(self):
return time2str(self.created_time)
class TaskMessageBoardModel(Document):
"""
留... | Python | 1 |
const COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_ID : i32 = 131;
/// **get** public static final [COMBINING_HALF_MARKS](https://developer.android.com/reference/android/icu/lang/UCharacter.UnicodeBlock.html#COMBINING_HALF_MARKS)
///
/// Required feature: android-icu-lang-UCharacter_UnicodeBlock
... | Rust | 0 |
# SPDX-FileCopyrightText: 2021-present M. Coleman, J. Cook, F. Franza
# SPDX-FileCopyrightText: 2021-present I.A. Maione, S. McIntosh
# SPDX-FileCopyrightText: 2021-present J. Morris, D. Short
#
# SPDX-License-Identifier: LGPL-2.1-or-later
import numpy as np
import pytest
from bluemira.equilibria.constants import X_A... | Python | 1 |
s": ["%DIAGNOSTIC_PLOT%"], "attachments_report_only": [verbose_savefig]}
# Check if SNR keeps increasing/decreasing in the last 7 days
_, samp_vals = bckr.get_samples_from_same_rcvr() # get samples from the same receiver as the latest value
if len(samp_vals) >= 8:
snrs_7days... | Python | 1 |
hat contains event files.
event_file: Or, a particular event file path.
tag: An optional tag name to query for.
Raises:
ValueError: If neither logdir and event_file are given, or both are given.
"""
if logdir and event_file:
raise ValueError(
'Must specify either --logdir or --event_file,... | Python | 1 |
utput_notebook_path is not a .ipynb file."
logger.error(error_message)
return {"error": error_message}
try:
pm.execute_notebook(
input_path=notebook_path,
output_path=output_notebook_path,
parameters=params or {},
)... | Python | 1 |
import os
import csv
from concurrent.futures import ThreadPoolExecutor
from tqdm import tqdm
from mongo_connection import get_collection
def process_single_csv(csv_file_path, db):
collection = get_collection(db, "socios")
print(f"Lendo arquivo {csv_file_path}...")
# Contar o número de linhas no arquivo pa... | Python | 1 |
![];
let (input, _) = tag("(")(input)?;
let (input, a) = parseSubjOrPred(input, true)?;
subterms.push(a.clone());
let (input, _) = tag(",")(input)?;
let (mut input, b) = parseSubjOrPred(input, true)?;
subterms.push(b.clone());
loop { // loop for more sub-terms
let res0: IResult<&str, &str> = tag(","... | Rust | 0 |
us": "ROBOT_EMPTY"}, LitterBoxStatus.EMPTY_CYCLE),
({"robotStatus": "ROBOT_FIND_DUMP"}, LitterBoxStatus.CLEAN_CYCLE),
({"robotStatus": "ROBOT_IDLE"}, LitterBoxStatus.READY),
({"robotStatus": "ROBOT_POWER_DOWN"}, LitterBoxStatus.POWER_DOWN),
({"robotStatus": "ROBOT_POWER_OFF"}, LitterBoxS... | Python | 1 |
nt based on response type
if not hasattr(response, 'message') and hasattr(response, 'response'):
content = response.response
tool_calls = None
else:
content = response.message.content
# Extract tool calls if present
tool_calls = getattr(respons... | Python | 1 |
set_vcounter: bool = [2, 2],
vblank_irq_enable, set_vblank_irq_enable: bool = [3, 3],
hblank_irq_enable, set_hblank_irq_enable: bool = [4, 4],
vcounter_irq_enable, set_vcounter_irq_enable: bool = [5, 5],
vcounter_setting, set_vcounter_setting: u16 = [8, 15],
});
bitfields! (DisplayControl: u16 {
... | Rust | 0 |
G>(m: &M, g: &G, simplex: &mut S) -> Option<P>
where N: Scalar,
P: Point<N, V>,
V: Vect<N>,
M: Translation<V>,
S: Simplex<N, P>,
G: SupportMap<P, V, M> + PreferedSamplingDirections<V, M> {
// find an approximation of the smallest penetration direction
let m... | Rust | 0 |
phinx_continuous', '--invalid-args'], stdout=devnull, stderr=devnull).communicate()
except OSError as e:
if e.errno == os.errno.ENOENT:
print('Error: Please install pocketsphinx to transcribe files.')
sys.exit()
files = convert_to_wav(args.inputfile)
t... | Python | 1 |
return None
return None
def write_knifeswitch_cfg(prefer_left):
# Используем тот же подход поиска Steam как в Create.py
username = os.environ.get('USERNAME', '')
localappdata = os.environ.get('LOCALAPPDATA', f'C:\\Users\\{username}\\AppData\\Local')
possible_roots = [
os.environ.get('P... | Python | 1 |
{
let mut num_params = 0;
self.decl().visit(|c| {
match c.kind() {
clang_sys::CXCursor_TemplateTypeParameter |
clang_sys::CXCursor_TemplateTemplateParameter |
clang_sys::CXCursor_NonTypeTemplateP... | Rust | 0 |
)
selected_idxs, info_2 = self.Selector.select_topk_for_eachcls(
PL_labels=(PL_labels > 1e-7).float()[mask_idxs],
output_all=logits_list[mask_idxs],
indexs_all=torch.arange(len(ids_list))[mask_idxs],
K_max=self.config.N_PSEUDOSHOTS,
candidate_... | Python | 1 |
ebug(f"표 제목 감지 실패: {str(e)}")
return f"표 {table_idx} (페이지 {page_num})"
def _extract_images_from_pdf(self, pdf_path: str) -> List[Dict]:
"""PDF에서 이미지 추출"""
if not PYMUPDF_AVAILABLE:
logger.warning("PyMuPDF(fitz) 라이브러리가 설치되지 않았습니다. 이미지 추출 기능을 사용할 수 없습니다.")
retu... | Python | 1 |
nome = 'Gabriel'
sobrenome = 'Roks Gomes Rodrigues'
idade = 17
ano_de_nacimento = 2024 - idade
maior_de_idade = idade >= 18
altura_metros = 1.78
print('Nome:', nome)
print('Sobrenome:', sobrenome)
print('Idade:', idade)
print('Ano de nacimento:', ano_de_nacimento)
print('É maior de idade?', maior_de_idade)
print('Altu... | Python | 1 |
ormat. If None will be left as default."
)
region_of_interest: Rect = Field(default=Rect(), description="Region of interest", validate_default=True)
video_writer: Optional[VideoWriter] = Field(
default=None, description="Video writer. If not provided, no video will be saved."
)
@field_valid... | Python | 1 |
{
path.push(transfered_file_name);
} else {
// just use original name when can not parse
let file_name = file.file_name().expect("Error: file name Not found");
path.push(file_name);
}
path
}
/// create all dir need
pub fn link_to(from: &Path, dest: &Path) -> Result<()> {
... | Rust | 0 |
mp_model(ckpts, i, path)
store.close()
else:
raise ValueError('no usable exp found! Cannot load.')
if not args.all_exp:
if args.best:
if args.attack:
sel_exp_id = all_exp_id[ind[0]]
else:
sel_exp_id = a... | Python | 1 |
self) -> NcResult<()> {
error![
unsafe { crate::ncdirect_set_fg_default(self) },
"NcDirect.set_fg_default()"
]
}
/// Indicates to use the "default color" for the background.
///
/// *C style function: [ncdirect_set_bg_default()][crate::ncdirect_set_bg_default].*
... | Rust | 0 |
print_results(output, output_file)?;
},
Command::Render{
templates_glob,
target_template,
data_loading_opts: DataLoadingOpts{
output_file, data_glob
}} => {
let data = neko::parse_data_glob(&data_glob)?;
... | Rust | 0 |
]
fn test_intcode_larger_example() {
let instr = "3,21,1008,21,8,20,1005,20,22,107,8,21,20,1006,20,31,
1106,0,36,98,0,0,1002,21,125,20,4,20,1105,1,46,104,
999,1105,1,46,1101,1000,1,20,4,20,1105,1,46,98,99";
let mut io = DefaultProgramIO::new(vec![0, 8, 18]);
intcode_program... | Rust | 0 |
ing specifying the name of the AnalyticalField or DiscreteField object associated
with this load. The **field** argument applies only when **distributionType** = FIELD or
**distributionType** = DISCRETE_FIELD. The default value is an empty string.
refPoint
A Region specifying... | Python | 1 |
0, 5.0), Vector::new(0.0, 0.0, 1.0));
let s = Sphere::new();
let xs = s.local_intersect(r).expect("Expected hit, found none!");
assert_eq!(xs.len(), 2);
assert_eq!(xs[0].t, -6.0);
assert_eq!(xs[1].t, -4.0);
}
// Chapter 5 Ray-Sphere Intersections
// Page 69
// r... | Rust | 0 |
#[serde(rename = "F9")]
StayOnBidside,
/// No Cross
#[serde(rename = "FA")]
NoCross,
/// OK to Cross
#[serde(rename = "FB")]
OkToCross,
/// Call first
#[serde(rename = "FC")]
CallFirst,
/// Percent of volume
#[serde(rename = "FD")]
PercentOfVolume,
/// Reinstate on system failure
#[serde(rename = "FH")... | Rust | 0 |
"""SSF Stream API Views"""
from rest_framework.viewsets import ReadOnlyModelViewSet
from authentik.core.api.utils import ModelSerializer
from authentik.enterprise.providers.ssf.api.providers import SSFProviderSerializer
from authentik.enterprise.providers.ssf.models import Stream
class SSFStreamSerializer(ModelSeri... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.