text string | label_name string | labels int64 |
|---|---|---|
rue
while invalid_re_run:
re_run_tool = input("\nWould you like to check another ?\nEnter 'yes' or 'no'\n\nAnswer: ")
if re_run_tool == 'yes':
running_tool = True
invalid_re_run = False
# Exit loop to determine correct input and ne... | Python | 1 |
option: &str,
) -> Result<OptionStatus, BetError> {
let desc = conn
.prepare(
"SELECT desc
FROM Option
WHERE server_id = ?1 AND option_id = ?2",
)
.unwrap()
.query_row(&[server, option], |row| row.get::<usize, String>... | Rust | 0 |
import requests
API_URL = 'https://www.aladin.co.kr/ttb/api/ItemList.aspx'
API_KEY = 'keyimport requests'
params = {
'ttbkey': API_KEY,
'QueryType': 'ItemNewSpecial',
'MaxResults': '50',
'start': '1',
'SearchTarget': 'Book',
'output': 'js',
'Version': '20131101'
}
response = requests.get(... | Python | 1 |
from typing import List
from typing import Optional
from konoha.data.token import Token
from konoha.word_tokenizers.tokenizer import BaseTokenizer
class KyTeaTokenizer(BaseTokenizer):
def __init__(self, model_path: Optional[str] = None) -> None:
from Mykytea import Mykytea
super().__init__(name=... | Python | 1 |
timers.index, 0);
}
#[test]
fn change_deadline_after_epoch_advance() {
let mut timers = Timers::new();
// Add a deadline to all slots and the overflow list.
for n in 0..=SLOTS {
let deadline = timers.epoch + Duration::from_nanos((n as u64 * NS_PER_SLOT as u64) + 10);
timers.add(ProcessId(n... | Rust | 0 |
max_procedures as libc::c_ulong)
.wrapping_mul(::std::mem::size_of::<opj_procedure>() as libc::c_ulong),
) as *mut opj_procedure;
if new_procedures.is_null() {
opj_free((*p_validation_list).m_procedures as *mut libc::c_void);
(*p_validation_list).m_nb_max_procedures = 0 as libc::c_int as OPJ... | Rust | 0 |
Update the plots
if times and positions_1 and positions_2:
line1.set_xdata(times)
line1.set_ydata(positions_1)
line2.set_xdata(times)
line2.set_ydata(positions_2)
ax1.set_xlim(0, max(times) + 1)
ax1.set_ylim(min(positions_1) - 1, max(positions_1) + 1)
ax2.set... | Python | 1 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/tasks/cc/vision/image_generator/proto/image_generator_graph_options.proto
# Protobuf Python Version: 4.25.1
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.proto... | Python | 1 |
ML_FI_DEV_ECC_SBE_VOL_DEV: u32 = 11;
pub const NVML_FI_DEV_ECC_DBE_VOL_DEV: u32 = 12;
pub const NVML_FI_DEV_ECC_SBE_VOL_REG: u32 = 13;
pub const NVML_FI_DEV_ECC_DBE_VOL_REG: u32 = 14;
pub const NVML_FI_DEV_ECC_SBE_VOL_TEX: u32 = 15;
pub const NVML_FI_DEV_ECC_DBE_VOL_TEX: u32 = 16;
pub const NVML... | Rust | 0 |
lf.e_pol_m[::self.minc,:]),
levs, cmap=plt.get_cmap(cm), extend='both')
fig2.colorbar(im)
if labTex:
ax2.set_ylabel('Order $m+1$')
ax2.set_xlabel('Radius $r$')
else:
ax2.set_ylabel('Order m+1')
... | Python | 1 |
"""The ruuvitag_ble integration."""
from __future__ import annotations
import logging
from ruuvitag_ble import RuuvitagBluetoothDeviceData
from homeassistant.components.bluetooth import BluetoothScanningMode
from homeassistant.components.bluetooth.passive_update_processor import (
PassiveBluetoothProcessorCoordi... | Python | 1 |
----------
x : array_like or scalar
The value(s) whose arcsin is (are) required.
Returns
-------
out : ndarray or scalar
The inverse sine(s) of the `x` value(s). If `x` was a scalar, so
is `out`, otherwise an array object is returned.
See Also
--------
numpy.arcsin
... | Python | 1 |
et mut iter = bits.rchunks_exact(2);
///
/// assert_eq!(iter.next(), Some(bits![0, 1]));
/// assert_eq!(iter.next(), Some(bits![1, 0]));
/// assert!(iter.next().is_none());
/// assert_eq!(iter.remainder(), bits![0]);
/// ```
///
/// [`.chunks_exact()`]: Self::chunks_exact
/// [`.rchunks()`]: Self::rchunks
///... | Rust | 0 |
Tokens::Bool]);
assert_tokens!(RwLock<bool>, [Tokens::Bool]);
}
#[test]
fn test_time() {
use std::time::{Duration, SystemTime};
assert_tokens!(
Duration,
[
Tokens::Struct("Duration", &["secs", "nanos"]),
Tokens::U64,
Tokens::U32,
]
);
as... | Rust | 0 |
set_mask : the gpios that need high level."]
#[doc = ""]
#[doc = " @param uint32_t clear_mask : the gpios that need low level."]
#[doc = ""]
#[doc = " @param uint32_t enable_mask : the gpios that need be changed."]
#[doc = ""]
#[doc = " @param uint32_t disable_mask : the gpios that need diab... | Rust | 0 |
atomic_ptr(
get_proc_address,
b"glClearBufferfi\0",
&self.glClearBufferfi_p,
)
}
#[inline]
#[doc(hidden)]
pub fn ClearBufferfi_is_loaded(&self) -> bool {
!self.glClearBufferfi_p.load(RELAX).is_null()
}
/// [glClearBufferfv](http://docs.gl/es3/glClearBuffer)(bu... | Rust | 0 |
(&peer)? {
return Err(Error::Attest(AttestEnclaveError::NotFound));
}
let private_key = *self.ake.get_identity().private_key.lock()?;
let public_key = RistrettoPublic::from(&private_key);
Ok((
self.ake.peer_encrypt(&peer, &[], private_key.as_ref())?,
... | Rust | 0 |
import re
from os import getcwd, path
from tomlkit import parse
class ContractConfig:
name: str | None
contract: str
tests: list[str]
deploy: str | None
def get_file_name(self) -> str:
name = self.name
if name is None:
name = self.contract
# CamelCase -> s... | Python | 1 |
`"default"`` set.
Returns
-------
params : dict or list of dict, default={}
Parameters to create testing instances of the class.
Each dict are parameters to construct an "interesting" test instance, i.e.,
``MyClass(**params)`` or ``MyClass(**params[i])`` crea... | Python | 1 |
, field) = env.require_class_static_field("java/security/cert/CRLReason\0", "KEY_COMPROMISE\0", "Ljava/security/cert/CRLReason;\0");
env.get_static_object_field(class, field)
}
}
/// **get** public static final [CA_COMPROMISE](https://developer.android.com/reference/java/sec... | Rust | 0 |
r};
// the C stands for codegen
#[repr(C)]
#[derive(Clone, Copy)]
pub struct Instructions {
pub insns: *mut InstructionAndTag,
pub size: u32,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct InstructionAndTag {
pub insn: Instruction,
pub tag: u8,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union Instructi... | Rust | 0 |
::Borrow;
use std::borrow::Cow;
use std::collections::HashMap;
use hyper;
use serde_json::{self, Value};
use futures;
use futures::{Future, Stream};
use hyper::header::UserAgent;
use super::{Error, configuration};
pub struct AlertApiClient<C: hyper::client::Connect> {
configuration: Rc<configuration::Configurat... | Rust | 0 |
# -*- coding: utf-8 -*-
# Crayfish - A collection of tools for TUFLOW and other hydraulic modelling packages
# Copyright (C) 2016 Lutra Consulting
# info at lutraconsulting dot co dot uk
# Lutra Consulting
# 23 Chestnut Close
# Burgess Hill
# West Sussex
# RH15 8HN
# This program is free software; you can redistribu... | Python | 1 |
1.0),
Vec2::new(1.0, 1.0),
Vec2::new(1.0, 0.0),
// y = -1
Vec2::new(0.0, 0.0),
Vec2::new(0.0, 1.0),
Vec2::new(1.0, 1.0),
Vec2::new(1.0, 0.0),
// x = 1
Vec2::new(1.0, 1.0),
Vec2::new(1.0, 0.0),
Vec2::new(0.0, 0.0),
Vec2::new... | Rust | 0 |
# system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
from __future__ import print_function
... | Python | 1 |
from collections import Counter, defaultdict
from typing import List
MAJORITY_VOTE = "majority_vote"
ORM_VOTE = "orm_vote"
ORM_MAX = "orm_max"
PRM_MIN_MAX = "prm_min_max"
PRM_MIN_VOTE = "prm_min_vote"
PRM_LAST_MAX = "prm_last_max"
PRM_LAST_VOTE = "prm_last_vote"
def _agg_majority_vote(x_list: List[str], unused_v_lis... | Python | 1 |
from __future__ import annotations
import dataclasses
from enum import Enum
class EventType(Enum):
TIME_SHIFT = "t"
SNAPPING = "snap"
DISTANCE = "dist"
NEW_COMBO = "new_combo"
HITSOUND = "hitsound"
VOLUME = "volume"
CIRCLE = "circle"
SPINNER = "spinner"
SPINNER_END = "spinner_end"... | Python | 1 |
arries the same
/// meaning as google.longrunning.Operation.name.
Name = 1,
/// A field in an API-specific (custom) Operation object which carries the same
/// meaning as google.longrunning.Operation.done. If the annotated field is of
/// an enum type, `annotated_field_name == EnumType.DONE` semanti... | Rust | 0 |
sterdam',
'Europe/Andorra',
'Europe/Athens',
'Europe/Belgrade',
'Europe/Berlin',
'Europe/Brussels',
'Europe/Bucharest',
'Europe/Budapest',
'Europe/Chisinau',
'Europe/Copenhagen',
'Europe/Dublin',
'Europe/Gibraltar',
'Europe/Helsinki',
'Europe/Istanbul',
'Europe/Kaliningrad',
'Europe/Kiev',
'Europe/Lisbo... | Python | 1 |
"""file list view"""
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from tasks.models import User, Upload
from django.utils import timezone
from django.core.paginator import Paginator
@login_required
def filelist(request):
"""Display the current user's uploaded files... | Python | 1 |
t, RenderError> {
let param = h
.hash_get("format")
.and_then(|v| v.value().as_str())
.unwrap_or("json");
DataFormat::from_str(param).map_err(|e| RenderError::from_error("DataFormat::from_str", e))
}
fn find_str_param<'reg: 'rc, 'rc>(
pos: usize,
h: &Helper<'reg, 'rc>,
) -> Resu... | Rust | 0 |
q 99(%rdi), %rdx",
));
insns.push((
i_Alu_RMI_R(false, RMI_R_Op::Add, ip_RMI_M(ip_Addr_IR(99, rdi)), w_r8),
"44034763",
"addl 99(%rdi), %r8d",
));
insns.push((
i_Alu_RMI_R(false, RMI_R_Op::Add, ip_RMI_M(ip_Addr_IR(99, rdi)), w_rsi),
"037763",
"addl ... | Rust | 0 |
["eval/episode_cost"+"_"+str(task)]=[]
for ep_info in eval_ep_info_buffer:
for task in range(self.num_tasks):
if str(task) in list(ep_info.keys())[0]:
res["eval/episode_reward"+"_"+str(task)].append(ep_info["episode_reward"+"_"+str(task)])
res[... | Python | 1 |
import socket
import time
import os
import warnings
from tornado.testing import gen_test
from tests.support import TestCircus, Process, async_poll_for
from tests.support import async_run_plugin as arp
from circus.plugins.watchdog import WatchDog
class DummyWatchDogged(Process):
def run(self):
self._writ... | Python | 1 |
rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [tcd_slast](tcd_slast) module"]
pub type TCD_SLAST = crate::Reg<u32, _TCD_SLAST>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _TCD_SLAST;
#[doc = "`read()` method returns [tcd_slast::R](tcd_slast::R) reader structure"]
impl crate:... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time : 2024/12/01 16:18
@Author : thezehui@gmail.com
@File : language_model_manager.py
"""
import os.path
from typing import Any, Optional, Type
import yaml
from injector import inject, singleton
from pydantic import BaseModel, Field, model_validator
from inte... | Python | 1 |
.back(((cr1, ca1), (wr1, wa1), (ar1, aa1)));
}
}
fn start_and_wait() -> Result<(), Box<dyn Error + 'static>> {
let mut debug_args: Vec<String> = Vec::new();
let args = Args::parse(&mut env::args(), &mut debug_args)?;
if debug_args.len() > 0 {
return Ok(());
}
let num_cpu = 4;
let ch... | Rust | 0 |
import os
import sys
import tensorflow as tf
import subprocess
from tensorflow.python.framework import ops
import configparser
# Register ops for compilation here
OP_NAMES = ['backward_warp', 'downsample', 'correlation', 'forward_warp']
cwd = os.getcwd()
os.chdir(os.path.dirname(os.path.realpath(__file__)))
os.chd... | Python | 1 |
xC7, // 0x8B
AbcPar1MsbMirror = 0xC8, // 0x8C
AbcPar1LsbMirror = 0xC9, // 0x8D
AbcPar2MsbMirror = 0xCA, // 0x8E
AbcPar2LsbMirror = 0xCB, // 0x8F
AbcPar3MsbMirror = 0xCC, // 0x90
AbcPar3LsbMirror = 0xCD, // 0x91
... | Rust | 0 |
return Err(MZError::Stream);
}
let mut decomp_flags = inflate_flags::TINFL_FLAG_COMPUTE_ADLER32;
if state.zlib_header {
decomp_flags |= inflate_flags::TINFL_FLAG_PARSE_ZLIB_HEADER;
}
let first_call = state.first_call;
state.first_call = 0;
if (state.last_status as i32) < 0 ... | Rust | 0 |
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | Python | 1 |
as u64, addr)
}
gameshark::CodeLine::Write16 { value, .. } => {
self.format_write(gameshark::ValueSize::Bits16, value as u64, addr)
}
gameshark::CodeLine::IfEq8 { value, .. } => {
self.format_check(gameshark::ValueSize::Bits8, value as u64... | Rust | 0 |
from collections import Counter
class Solution:
def findDuplicates(self, arr):
freq = Counter(arr)
duplicates = []
for i in freq:
if freq[i] > 1:
duplicates.append(i)
return sorted(duplicates) if duplicates else []
| Python | 1 |
import marimo
__generated_with = "0.15.5"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
return (mo,)
@app.cell
def _(mo):
mo.md(r"""
Importa recordar as seguintes regras de diferenciação de matrizes:
$$\frac{\partial\, u'v}{\partial\, v} = \frac{\partial\, v'u... | Python | 1 |
} else {
//bare
let stack: Result<Vec<StackElement>, Error> = script_sig
.instructions_minimal()
.map(instr_to_stackelem)
.collect();
if !witness.is_empty() {
return Err(Error::NonEmptyWitness);
}
let ms = Miniscript::<bitcoin::Pu... | Rust | 0 |
{
#[inline]
fn write(
&self,
bytes: &mut [u8],
pos: &mut usize,
) -> Result<(), WriteError> {
self.get().write(bytes, pos)
}
}
)*)
}
impl_non_zero_nums! {
i16, NonZeroI16
i32, NonZeroI32... | Rust | 0 |
FFLR = crate::Reg<fflr::FFLR_SPEC>;
#[doc = "ETM FIFO Full Level Register"]
pub mod fflr;
#[doc = "CNTRLDVR1 register accessor: an alias for `Reg<CNTRLDVR1_SPEC>`"]
pub type CNTRLDVR1 = crate::Reg<cntrldvr1::CNTRLDVR1_SPEC>;
#[doc = "ETM Free-running Counter Reload Value"]
pub mod cntrldvr1;
#[doc = "SYNCFR register a... | Rust | 0 |
(0, 10, num=10)
reg = QuantileRegressor(
alpha=0, solver="interior-point", solver_options={"maxiter": 1}
)
msg = "Linear programming for QuantileRegressor did not succeed."
with pytest.warns(ConvergenceWarning, match=msg):
reg.fit(X, y)
@skip_if_32bit
@pytest.mark.skipif(
sp_versi... | Python | 1 |
set_pokedex_entry_test!(
set_pokedex_entry_3,
3,
"ABCD",
13,
37,
0x40E41,
vec![0x80, 0x81, 0x82, 0x83, 0x50, 1, 1, 37, 0]
);
set_pokedex_entry_test!(
set_pokedex_entry_4,
4,
"ABCDEF",
13,
37,
0x40F2F,
vec![0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x50, 1, 1, 37, 0]
);
... | Rust | 0 |
# Author aw.ahmed.werghi@gmail.com
# My implementation of a merge sort
class Solution:
def merge(self,nums,l1,l2,r1,r2):
aux1 = nums[l1:r1+1]
aux2 = nums[l2:r2+1]
i = 0
j = 0
k = 0
n = min(len(aux1),len(aux2))
while i < n and j < n :
if aux1[i] <... | Python | 1 |
"rating": 20
}}"#)?;
assert_eq!(new_buffer.get::<u8>(&["age"])?.unwrap(), 50u8);
assert_eq!(new_buffer.get::<&str>(&["name"])?.unwrap(), "Jimmy");
assert_eq!(new_buffer.get::<&str>(&["color"])?.unwrap(), "orange");
assert_eq!(new_buffer.get::<&str>(&["car"])?.unwrap(), "Audi");
assert_eq!(new_b... | Rust | 0 |
PageLayout {
resource_len: u64,
page_len: u64,
}
#[derive(Debug, thiserror::Error)]
enum PageError {
#[error("out of bounds: requested offset {requested} > resource length {resource_len}")]
OutOfBounds { requested: u64, resource_len: u64 },
}
impl PageLayout {
/// Returns information for the page ... | Rust | 0 |
from __future__ import absolute_import
import logging
import os
from django import template
from django.conf import settings
from django.contrib.staticfiles import finders
from django.core.exceptions import ImproperlyConfigured
from django.utils.safestring import mark_safe
from svg.exceptions import SVGNotFound
logg... | Python | 1 |
und on network storage")
else:
print("❌ Connect.gizmo file NOT found")
if init_loaded:
print("✅ Custom plugin path loaded")
else:
print("❌ Custom plugin path NOT loaded")
# Create a simple Nuke script that runs this diagnostic
def create_diagnostic_script():
"""Create a... | Python | 1 |
#!/usr/bin/python
##################
# sarcSpacing.py
#
# Copyright David Baddeley, 2009
# d.baddeley@auckland.ac.nz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... | Python | 1 |
8_TYPE.clone()) });
// mov op1 -> result
self.backend.emit_mov_r_r(&res_tmp, &tmp_op1);
// sar result, cl -> result
self.backend.emit_sar_r_cl(&res_tmp);
} else if self.match_ireg_ex(op1) && self.match_iconst_zero(op2) {
... | Rust | 0 |
Returns:
HTTpResponseRedirect when not successful
Raises:
raises Http404 exception if anything goes wrong"""
try:
project = CreateTaskView.create_project_from_document(request.user, document)
calling_model_admin.message_user(request, _("Succ... | Python | 1 |
{
'name': 'Document Flow',
'version': '1.5.6',
'category': '',
'depends': ['base', 'mail', 'task', 'dms', 'hr', 'hr_replacement'],
'external_dependencies': {'python': ['htmldocx', 'html2text']},
'description': """
""",
'author': '',
'support': '',
'application': True,
'instal... | Python | 1 |
__copyright__ = 'Copyright 2021-2025 Siemens Energy AG, Copyright 2021-2025 The AMOS Projects, Copyright 2021 Siemens AG'
__author__ = 'Garima Chauhan, YulianaPoliakova, Benedikt Kuehne, VAISHNAVI UMESH, p4cx, m-1-k-3, ashiven'
__license__ = 'MIT'
from django.conf import settings
from django.urls import path
from use... | Python | 1 |
ConfigError {
DuplicateShopName { shop_name: String },
NoSuchShopExists { shop_name: String },
}
impl Display for ConfigError {
fn fmt(&self, f: &mut Formatter) -> FmtResult {
match *self {
ConfigError::DuplicateShopName { ref shop_name } => {
write!(f, "Duplicate shop... | Rust | 0 |
py, Clone)]
pub struct br_sslrec_out_ccm_class_ {
#[doc = " \\brief Superclass, as first vtable field."]
pub inner: br_sslrec_out_class,
#[doc = " \\brief Engine initialisation method."]
#[doc = ""]
#[doc = " This method sets the vtable field in the context."]
#[doc = ""]
#[doc = " \\param c... | Rust | 0 |
'OpSubgroupAvcSicEvaluateIpeINTEL' : 5803,
'OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL' : 5804,
'OpSubgroupAvcSicEvaluateWithDualReferenceINTEL' : 5805,
'OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL' : 5806,
'OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL' : 580... | Python | 1 |
});
}
}
}
for (&column, field) in candidates.iter() {
if column.starts_with("departure") {
product *= my_ticket[*field.iter().next().unwrap()];
}
}
product
}
pub fn parse(
s: &Input,
) -> (
Vec<usize>,
Vec<Vec<usize>>,
BTreeMap<&str... | Rust | 0 |
ould be
/// inserted while maintaining sorted order.
///
/// # Examples
///
/// Looks up a series of four elements. The first is found, with a uniquely determined
/// position; the second and third are not found; the fourth could match any position in [1,4].
///
/// ```
/// use nonem... | Rust | 0 |
k == 'autoreload_on':
if v:
engine.autoreload.subscribe()
else:
engine.autoreload.unsubscribe()
elif k == 'autoreload_frequency':
engine.autoreload.frequency = v
elif k == 'autoreload_match':
engine.autoreload.match = v
elif k == 'reload_files':
... | Python | 1 |
}
if linked_list.tail == self
{
linked_list.tail = self.previous
}
if !previous.is_null()
{
debug_assert_ne!(previous, self as *mut Self, "self.previous is self");
let previous = unsafe { &mut *previous };
previous.next = next;
}
if !next.is_null()
{
debug_assert_ne!(next, se... | Rust | 0 |
rentUser, GetCurrentUserConnections,
GetCurrentUserGuildMember, GetCurrentUserGuilds, GetUser, LeaveGuild,
UpdateCurrentUser,
},
GetGateway, GetUserApplicationInfo, GetVoiceRegions, Method, Request,
},
response::ResponseFuture,
API_VERSION,
};
use hyper::{
client:... | Rust | 0 |
self, index: Idx) -> &T
where
Idx: NpyIndex<Dim = D>,
{
let offset = index.get_unchecked::<T>(self.strides());
&*self.data().offset(offset)
}
/// Same as [uget](#method.uget), but returns `&mut T`.
#[inline(always)]
pub unsafe fn uget_mut<Idx>(&self, index: Idx) -> &mut ... | Rust | 0 |
target_arch = "aarch64",
target_arch = "riscv64",
),
ignore
)]
fn test_process_group_no_posix_spawn() {
unsafe {
// Same as above, create hang-y cat. This time, force using the non-posix_spawnp path.
let mut cmd = Command::new(OsStr::new("cat"));
cmd.pgroup(0);
c... | Rust | 0 |
messages=[
{"role": "user", "content": c_keyphrase_prompt},
],
)
# CHATGPT Response
message = response.choices[0].message.content
seed_words_index = message.find('Seed wo... | Python | 1 |
assert_eq!(TokenAmount::from(20u8), get_escrow_balance(&rt, &CLIENT_ADDR).unwrap());
check_state(&rt);
}
#[test]
fn balance_after_withdrawal_must_always_be_greater_than_or_equal_to_locked_amount() {
let start_epoch = ChainEpoch::from(10);
let end_epoch = start_epoch + 200 * EPOCHS_IN_DAY;
let publ... | Rust | 0 |
# pylint: disable=C0114
# pylint: disable=C0115
# pylint: disable=C0301
from typing import Optional, TypeVar
from pydantic import BaseModel
from ragas.prompt import PydanticPrompt
from ragas.metrics._context_precision import QAC, Verification
InputModel = TypeVar("InputModel", bound=BaseModel)
class MyContextPrecis... | Python | 1 |
ome(1)).await?;
list_query(runner, "string", "hasSome", r#"[]"#, None).await?;
list_query(
runner,
"dt",
"hasSome",
r#"["2018-12-05T12:34:23.000Z", "2019-12-05T12:34:23.000Z"]"#,
Some(1),
)
.await?;
list_query(
... | Rust | 0 |
_Hg > 90,then the one(s) with highest Nph is/are the best
if self.classify90():
# print "got 90"
self.haplo_stats_sorted = self.classify90()
self.haplo_stats_sorted = OrderedDict(sorted(self.haplo_stats_sorted.items(), key=lambda x: x[1][0], reverse = True))
... | Python | 1 |
#!/usr/bin/env python3
from __future__ import division, print_function, absolute_import
# Import libraries
import roslib
import rospy
import numpy as np
from quanser_core.p_QArm import QArm, QArmUtilities
from quanser_core.q_misc import Calculus, Utilities
from qarm_msgs.msg import AllCommands, AllJointState
class Q... | Python | 1 |
n_dominated = []
for i, sol1 in enumerate(solutions):
is_dominated = False
for j, sol2 in enumerate(solutions):
if i != j and self._dominates(sol2, sol1):
is_dominated = True
break
if not is_dominated:
... | Python | 1 |
[doc(inline)]
pub use scene::{Background, Scene};
#[doc(inline)]
pub use sprite::Sprite;
#[doc(inline)]
pub use text::{Align, Font, Layout, Text};
#[doc(inline)]
pub use texture::{CubeMap, CubeMapPath, FilterMethod, Sampler, Texture, WrapMode};
#[cfg(feature = "opengl")]
#[doc(inline)]
pub use window::Window;
use s... | Rust | 0 |
BOB RECV Welcome");
// Make a preliminary GroupState out of it
let group_state =
GroupState::from_welcome(welcome, identity_secret_key, user_init_key).unwrap();
// Now receive the Add and process the Handshake
let add_handshake: Handshake = deserialize(&rx.recv().unwrap());
println!("BOB ... | Rust | 0 |
}
if v == 0 {
continue;
}
dst[p as usize] ^= gf.exp[(gf.log[v as usize] + log_c) as usize % gf.p];
}
}
pub fn poly_eval(s: &[u8], x: u8, gf: &GaloisField) -> u8 {
if x == 0 {
return s[0];
}
let mut sum = 0u8;
let log_x = gf.log[x as usize] as u... | Rust | 0 |
rustedPeers);
}
let mut block = None;
let span = span!(Level::DEBUG, "fetch_block", block = %hash.to_string());
async {
for address in trusted_peers_shuffled(config) {
let peer_span = span!(Level::TRACE, "peer_address", address = %address.to_string());
let peer = Peer::... | Rust | 0 |
fmt::Debug for CompressionHeader {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
f.debug_struct("CompressionHeader")
.field("ch_type", &self.ch_type)
.field("ch_size", &format_args!("0x{:x}", self.ch_size))
... | Rust | 0 |
urls: 点击单条信息跳转的链接列表
pics: 单条信息图片URL列表
Returns:
bool: 发送成功返回True,否则返回False
Raises:
ValueError: 当参数列表长度不匹配时
"""
if not titles or not urls or not pics:
raise ValueError("标题、URL和图片列表都不能为空")
if len(titles) != len(urls) or len(titles... | Python | 1 |
'''num = int(input('enter a nmbr:'))
for i in range(2, num):
if num%i == 0:
print(num, 'not a prime')
break
else:
print(num, 'is a prime')
break'''
low = int(input('enter your first number: '))
high = int(input('enter your second number: '))
primes = []
for i in range(low, high+1):
... | Python | 1 |
), curve(), knot(3,5)], epsilon),
# include a line with given angles
mppath.path([knot(0,0), curve(), knot(6,4), curve(), knot(4,9), line(keepangles=True), knot(1,7), curve(), knot(3,5), curve()], epsilon),
# include rough knots
mppath.path([beginknot(0,0), curve(), roughknot(6,4,langle=90), cur... | Python | 1 |
u'Λεωνίδας': u'레오니다스',
u'Ἀναξανδρίδας': u'아낙산드리다스',
u'Κλεομένης': u'클레오메네스',
u'Ὀδυσσεύς': u'오디세우스',
u'Πηνελόπη': u'페넬로페',
u'Σίσυφος': u'시시포스',
u'Νεμέα': u'네메아',
u'Ἰάσων': u'이아손',
u'Τυνδάρεως': u'틴다레오스',
... | Python | 1 |
// ハイライト本文は full から位置・メモ表記を取り除く
let highlight = full;
if (location) highlight = highlight.replace(location, "");
if (note) highlight = highlight.replace(note, "");
highlight = highlight.replace(/(位置|Location|Loc|ページ|Page)[::]*/ig,... | Python | 1 |
async with connect(ws_url) as websocket:
while True:
try:
message = await websocket.recv()
task_update = Task.model_validate(json.loads(message))
yield task_update
# If task reached te... | Python | 1 |
let mut init = bindings::ngx_command_t {
name: ngx_string!("access_log\0"),
type_: ((bindings::NGX_HTTP_MAIN_CONF
| bindings::NGX_HTTP_SRV_CONF
| bindings::NGX_HTTP_LOC_CONF
| bindings::NGX_HTTP_LIF_CONF) as libc::c_u... | Rust | 0 |
import os
import keyboard
import mss.tools
from PIL import Image
from pytesseract import pytesseract
from TemtemInfoRequester import TemtemInfoRequester
from utils.getAllTemTems import getAllTemTems
class EnemeyTemtemDetector:
def __init__(self,temtems):
self.temtems = temtems
self.initPytesse... | Python | 1 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
blue = (0, 0, 1.0)
green = (0, 0.8, 0)
red = (1.0, 0, 0)
red_alpha = (1.0, 0, 0, 0.1)
gray = (0.7, 0.7, 0.7)
x = np.arange(0, 1, 0.0001)
p_y = norm.pdf(x, 0.6, 0.1)
plt.plot(x, p_y, color=red)
plt.plot([0.5,0.5], [0.0, np.max(p_y)], '-',... | Python | 1 |
from app.notifications import INotification
from app.notifications.WebhookNotification import WebhookNotification
import os
class LogicController:
_notification : INotification = None
def __init__(self, notification: INotification):
self._notification = notification
def crashed(self, e=None):
... | Python | 1 |
import pytest
from services.merge import merge_partial_summaries, MergedDraft
from services.models import PartialSummary
def _ps(idx: int, words: int) -> PartialSummary:
# Build dummy partial summaries with simple text of given word length
text = " ".join([f"w{idx}_{i}" for i in range(words)])
return Part... | Python | 1 |
::model::Artwork,
) {
if let Some(var_278) = &input.input_key {
object.key("InputKey").string(var_278);
}
if let Some(var_279) = &input.max_width {
object.key("MaxWidth").string(var_279);
}
if let Some(var_280) = &input.max_height {
object.key("MaxHeight").string(var_280);
... | Rust | 0 |
::Positional("3"))));
assert_eq!(opts.next_arg(), Ok(Some(Arg::Short('b'))));
assert_eq!(opts.next_arg(), Ok(Some(Arg::Short('c'))));
assert_eq!(opts.next_arg(), Ok(Some(Arg::Positional("4"))));
assert_eq!(opts.next_arg(), Ok(None));
assert!(opts.is_empty());
}
#[test]
fn options_anywhere_with_valu... | Rust | 0 |
TWITTER HANDLE]
GitHub: {}
Phone: {}
Location: {}
cc @jessfraz @sdtuck @bcantrill",
self.email, self.github, self.phone, self.location,
);
// Create the issue.
repo.issues()
.create(&IssueOptions {
title,
body: Some(body),
... | Rust | 0 |
3FFA,// EVEX_Vmovss_xmm_k1z_xmm_xmm_0F11
0x1E00_3FFA,// EVEX_Vmovss_m32_k1_xmm
0x1E00_3FFF,// Movsd_xmmm64_xmm
0x1E00_3FFA,// VEX_Vmovsd_xmm_xmm_xmm_0F11
0x1E00_3FFA,// VEX_Vmovsd_m64_xmm
0x1E00_3FFA,// EVEX_Vmovsd_xmm_k1z_xmm_xmm_0F11
0x1E00_3FFA,// EVEX_Vmovsd_m64_k1_xmm
0x1E00_3FFF,// Movhlps_xmm_xmm
0x1E00_... | Rust | 0 |
import numpy as np
import sys
import math
import cv2
sys.path.append('./libs/pycbf_filter/build')
import pycbf_filter
def fill_depth_cross_bf(img: np.ndarray,
depth: np.ndarray,
space_sigma=[12, 5, 8],
range_sigma=[0.2, 0.08, 0.02],
... | Python | 1 |
opts.run_ignored = RunIgnored::Yes;
let tests = one_ignored_one_unignored_test();
let filtered = filter_tests(&opts, tests);
assert_eq!(filtered.len(), 2);
assert!(!filtered[0].desc.ignore);
assert!(!filtered[1].desc.ignore);
}
#[test]
pub fn exclude_should_panic_option() {
let mut opts = Tes... | Rust | 0 |
"""響應式設計管理模組(向後相容入口點)
此模組提供完整的響應式設計解決方案,支援多種螢幕尺寸的自適應佈局。
為了保持向後相容性,此檔案重新導出新模組化架構中的所有功能。
新的模組化架構位於 ui/responsive/ 目錄中:
- breakpoints.py: 斷點定義
- css_manager.py: CSS 樣式管理
- layout_manager.py: 佈局管理器
- components.py: 響應式組件
- utils.py: 工具函數
- touch_components.py: 觸控優化組件
支援的螢幕尺寸:
- 手機:< 768px
- 平板:768px - 1024px
- 桌面:> 1024... | Python | 1 |
}
input_files.push(f.get_name());
}
}
if input_files.is_empty() {
return Ok(());
}
let mut opts = CompactionOptions::new();
opts.set_compression(output_compression);
let max_subcompactions = num_cpus::get();
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.