text string | label_name string | labels int64 |
|---|---|---|
from environments.tofukingdom.agents.base_agent import TofuKingdomAgent
from typing import Dict, List, Any, Optional, Tuple, Literal
RoleType = Literal["Prince", "Princess", "Queen", "Minister", "Chef", "Guard", "Maid", "Spy"]
TruthBehavior = Literal["truth", "lie", "choice"]
class RoleAgent(TofuKingdomAgent):
""... | Python | 1 |
ons()
context: infra.DiagnosticContext[infra.Diagnostic] = infra.DiagnosticContext(
name, version, options
)
self.contexts.append(context)
return context
def clear(self):
"""Clears all diagnostic contexts."""
self.contexts.clear()
self._background... | Python | 1 |
_make_request("POST", url, headers=create_headers, json=task_data)
task_id = task_result.get("output", {}).get("task_id")
if not task_id:
raise Exception("创建任务失败,未获取到task_id")
print(f"✅ 任务创建成功: {task_id}")
print("⏳ 等待虚拟模特生成...")
final_result = handler._wait_for_task(task_id, max_wait_time... | Python | 1 |
on_choice == '2':
reservation_id = input("Enter Reservation ID to update: ")
updated_reservation = Reservation()
updated_reservation.get_input_from_user()
reservation_service.update_reservation(reservation_id, updated_reservation.get_data_f... | Python | 1 |
from dishka.integrations.fastapi import FromDishka, setup_dishka
from fastapi import FastAPI
from src.example_dishka_fastapiusers.dependencies.fastapi_users import (
auth_backend,
fastapi_users,
)
from src.example_dishka_fastapiusers.di.main import container_factory
from src.example_dishka_fastapiusers.present... | Python | 1 |
rates embeddings using the provided model for either vision or audio data.
Parameters:
- model: Model object to generate embeddings.
- curr_dev (str): Device to use for inference, default is "cpu".
- image_paths (list): List of paths to image files.
- audio_paths (list): List of pat... | Python | 1 |
参数设置。通过该参数可以指定包年包月实例的续费时长、是否设置自动续费等属性。包年包月实例该参数为必传参数。
:type InstanceChargePrepaid: :class:`tencentcloud.mongodb.v20190725.models.InstanceChargePrepaid`
"""
self._InstanceIds = None
self._InstanceChargePrepaid = None
@property
def InstanceIds(self):
return self._InstanceI... | Python | 1 |
.edit_layout.setWidget(6, QFormLayout.FieldRole, self.cfg_suffix)
self.cfg_slider = QCheckBox(edit)
self.cfg_slider.setObjectName(u"cfg_slider")
self.edit_layout.setWidget(7, QFormLayout.FieldRole, self.cfg_slider)
self.retranslateUi(edit)
QMetaObject.connectSlotsByName(edit)
... | Python | 1 |
from keybert import KeyBERT
import Levenshtein
from functions import get_websites_by_similar_keywords, get_website_keywords
import urllib.parse
def extract_keywords(query:str) -> list[str]:
kw_model = KeyBERT()
content_keywords = kw_model.extract_keywords(query, stop_words=None)
content_keywords_list = [ke... | Python | 1 |
mes = read_all_to_string(from).unwrap();
let names: Vec<String> = names.split_whitespace().map(|x| x.into()).collect();
for (i, x) in names.iter().enumerate() {
if exempt(x) {
write!(f, "#[allow(dead_code)] ").unwrap();
}
write!(f, "const {}: usize = {} + {};\n", x, offset, i... | Rust | 0 |
# Form implementation generated from reading ui file './ui/review_widget.ui'
#
# Created by: PyQt6 UI code generator 6.4.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
... | Python | 1 |
ol_size} | Combo Count: {size} | Local Time: {datetime.now()} | Keyword Match: {str(found).upper()} | Keyword: {search_string} | String Position in Array: [ {checked + 1} / {size} ]\n")
e.close()
except Exception as e:
if "User blocked" in str(e):
print(f"{custom()} {username}:{pass... | Python | 1 |
inline]
pub fn remove(&self, k: &K, guard: &epoch::Guard) -> Option<V> {
let key = UsizeKey::key_from(usize::from(k.clone()));
let v = self.inner.remove(&key, guard)?;
Some(V::from(v))
}
/// Insert a key-value pair to the tree, returns the previous value if the key was already prese... | Rust | 0 |
, 0, 0, 0, 44, 255, 255, 219, 255, 172, 199, 199, 255,
216, 255, 255, 0, 0, 48, 230, 0, 195, 195, 195, 195, 255, 239, 0,
];
// The original code made a vec![0; very_large_number] which due to overcommit *does not* OOM.
// It then exits normally with an EOF when reading.
//
// So instead we ... | Rust | 0 |
from inspect_ai.tool import Tool, tool
usernames = {
"depression": [
"user1231",
"coolguy2",
"happygal3",
"techlover4",
"bookworm5",
"traveler6",
],
"anxiety": [
"adventurer1",
"dreamer2",
"thinker3",
"creator4",
"explo... | Python | 1 |
import unittest
from welfareobs.utils.config import Config
from welfareobs.runner import Runner
class TestRunner(unittest.TestCase):
def test_invalid_runner(self):
# TODO: permutations for each syntax error
config: Config = Config("tests/invalid_runner_config.json")
result = False
... | Python | 1 |
elf.__class__ == matplotlib.backends.backend_gdk.FigureCanvasGDK:
warn_deprecated('2.0', message="The GDK backend is "
"deprecated. It is untested, known to be "
"broken and will be removed in Matplotlib 3.0. "
"Use the Agg ... | Python | 1 |
ess 'ecs' button or 'Q'\n button to exit the game.\n Or 'M' button to go back\n to the menu and 'G' button to restart\n the game.\n Did you find the 'space' button\n in the game can trigger the Unfair\n Advantage?",
TextStyle {
font: asset_server.load("fonts/finger-paint-regu... | Rust | 0 |
_base64_serde")]
Gzip(Vec<u8>),
/// Base64-encoded xz data
#[serde(with = "xz_base64_serde")]
Xz(Vec<u8>),
}
impl Content {
pub fn into_bytes(self) -> Vec<u8> {
match self {
Content::Text(s) => s.into_bytes(),
Content::Base64(b) | Content::Gzip(b) | Content::Xz(b) => b,
}
}
pub fn is... | Rust | 0 |
.map(|element| element.transform_types(transform))
.collect::<Result<_, _>>()?,
self.source_information.clone(),
))
}
}
<filename>rust/src/cells/test/reimplemented.rs<gh_stars>0
//! Test `cell*_*` reimplemented functions
use serial_test::serial;
use crate::NcCell;
... | Rust | 0 |
import math
def inverse_kinematics(p: tuple[float, float, float]) -> tuple[float, float, float]:
"""
Gets the joint values needed to reach position "p".
:param p: The position to reach in the form [x, y, z].
:return: A list of the values to set the links to for reaching position "p".
"""
px, py... | Python | 1 |
, score) for accuracy, _, text, ep, score in self.heap], reverse=True)
#전체 테스트 셋에 대해서 테스트
def evaluation_full(prompts,imdb,model,tokenizer,device,verbalizer = ['Yes','No'],side='Last'):
accs= []
for prompt in prompts:
model.eval()
subset_indices = random.sample(range(len(... | Python | 1 |
);
code.push_str("ui.spacing_mut().item_spacing.x = NORMAL_SPACING_X;");
label(&text, style, code);
true
}
fn quote(text: &str, style: &StyleText, code: &mut String) -> bool {
code.push_str("ui.spacing_mut().item_spacing.x = BIG_SPACING_X;");
code.push_str("let (rect, _) = ui.allocate_exact_size(")... | Rust | 0 |
n = input()
lst1 = n.split()
lst1 = list(map(int, lst1))
lst1 = list(map(abs, lst1))
print(lst1[::-1])
lst1.reverse()
print(lst1) | Python | 1 |
ECHO_RAM_SIZE: usize = OAM_START - ECHO_RAM_START;
pub const OAM_SIZE: usize = OAM_END - OAM_START;
pub const HARDWARE_IO_SIZE: usize = HIGH_RAM_START - HARDWARE_IO_START;
pub const HIGH_RAM_SIZE: usize = IE_START - HIGH_RAM_START;
pub struct Console {
pub cartridge: Option<Cartridge>,
// internal RAM
pu... | Rust | 0 |
'self')
def integrate_forward_jax(
self,
state: ArrayImpl,
control: ArrayImpl,
) -> Tuple[ArrayImpl, ArrayImpl]:
"""
Computes the next state.
Args:
state (ArrayImpl): (4,) jnp array [x, y, v, psi].
control (ArrayImpl): (2,) jnp array [a, delta].
Returns:
s... | Python | 1 |
},
ReNetEvent::Disconnect {
peer,
data,
} => {
println!("Peer disconnected!");
},
ReNetEvent::Receive {
peer,
channelID,
data,
flags
} => {... | Rust | 0 |
}
}
pub fn add_f32(gpu: &Gpu, executor: &Executor) -> InstDesc {
info!("Instruction: Add f32");
inst::<f32>(gpu, executor, &|init, arg, b| b.add(init, arg))
}
pub fn add_f64(gpu: &Gpu, executor: &Executor) -> InstDesc {
info!("Instruction: Add f64");
inst::<f64>(gpu, executor, &|init, arg, b| b.ad... | Rust | 0 |
leep(2)
await event.delete()
try:
# استخراج الكلمة المفتاحية من الرسالة
command, keyword = event.raw_text.split(' ', 1)
keyword = keyword.lower()
if keyword in responses:
del responses[keyword]
# حفظ التغييرات في الملف
with open(r... | Python | 1 |
15,
/// 财务成本率(精确到小数点后 3 位,超出部分会被舍弃)例如填写 [1.0,10.0] 值区间(该字段为百分比字段,默认不展示 %,如 20 实际对应 20%)
FinancialCostRate = 16,
/// 营业利润 TTM(精确到小数点后 3 位,超出部分会被舍弃)例如填写 [1000000000,1000000000] 值区间 (单位:元。仅适用于年报。)
OperatingProfitTtm = 17,
/// 归属于母公司的净利润(精确到小数点后 3 位,超出部分会被舍弃)例如填写 [1000000000,1000000000] 值区间 (单位:元。仅适用于年报... | Rust | 0 |
mut ::std::os::raw::c_void,
);
}
extern "C" {
pub fn snd_hwdep_dsp_image_set_length(obj: *mut snd_hwdep_dsp_image_t, length: usize);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct snd_aes_iec958 {
pub status: [::std::os::raw::c_uchar; 24usize],
pub subcode: [::std::os::raw::c_uchar; 147usize],
pub p... | Rust | 0 |
import busio
import digitalio
import os
import asyncio
import board
import supervisor
import time
from adafruit_pca9685 import PCA9685
from adafruit_motor import servo
from servo_ducky import servoducky
SCL_PIN = board.GP27
SDA_PIN = board.GP26
OE_PIN = board.GP28
POWER_PINS = { }
POWER_PINS["GND"] = { }
POWER_P... | Python | 1 |
0014, -81880, 750, 6280, 145)
ChrSetPos(0x0015, -79420, 250, 5000, 190)
ChrSetPos(0x0016, -77590, 750, 6270, 7)
@scena.Lambda('lambda_13AA')
def lambda_13AA():
OP_67(0, 11700, -10000, 7000)
ExitThread()
DispatchAsync(0x0101, 0x0001, lambda_13AA)
@scena.Lambda('lambda_13C2')
... | Python | 1 |
class Solution:
def findDifferentBinaryString(self, nums: List[str]) -> str:
def generate(curr):
if len(curr) == n:
if curr not in nums:
return curr
return ""
add_zero = generate(curr + "0")
... | Python | 1 |
22: h,
}
}
/// push the latest convergent using x from right to the block
pub fn update_right(&mut self, p1: T, q1: T, p2: T, q2: T) {
self.pm21 = replace(&mut self.pm11, p1);
self.qm21 = replace(&mut self.qm11, q1);
self.pm22 = replace(&mut self.pm12, p2);
self.qm2... | Rust | 0 |
# Generated by Django 3.2.25 on 2024-06-10 18:56
from django.db import migrations
import django_resized.forms
class Migration(migrations.Migration):
dependencies = [
('profiles', '0004_profile_mail_address'),
]
operations = [
migrations.AlterField(
model_name='profile',
... | Python | 1 |
sert mod.f(obj) == 1234
def test_hpy_close(self):
mod = self.make_module("""
#include <Python.h>
HPyDef_METH(f, "f", HPyFunc_NOARGS)
static HPy f_impl(HPyContext *ctx, HPy self)
{
PyObject *o = PyList_New(0);
HPy h = HPy_FromP... | Python | 1 |
}
fn g() -> uint { return 0u; }
fn main() { let y = f(); }
use bitcoin::util::psbt::PartiallySignedTransaction as Psbt;
use std::sync::Arc;
use super::{error::Error, menu::Menu};
use crate::revault::Role;
use crate::revaultd::{
model::{
RevocationTransactions, SpendTransaction, SpendTx, UnvaultTransacti... | Rust | 0 |
))
.execute(conn)
}
#[cfg_attr(test, mockable)]
pub fn get_user_color(user_id: &Uuid, conn: &SqliteConnection) -> QueryResult<char> {
use super::schema::user::dsl::*;
let res = user
.select(user_color)
.filter(id.eq(user_id.to_string()))
.limit(1)
.load::<String>(conn)
... | Rust | 0 |
0":
return
libxil_path = os.path.join(self.builder.software_dir, 'libxil')
os.makedirs(os.path.realpath(libxil_path), exist_ok=True)
lib = os.path.join(libxil_path, 'embeddedsw')
if not os.path.exists(lib):
os.system("git clone --depth 1 https://github.com/Xilinx... | Python | 1 |
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.migrations import swappable_dependency
_prefixes = {}
def swappable_setting(app_label, model):
"""Returns the setting name to use for the given model
Returns the setting name ... | Python | 1 |
the oldhistlen is then not used.
if maxhistvalue is not None:
oldhistlen = int(round(np.max(
maxhistvalue,
axis=None,
keepdims=False,
)))
else:
oldhistlen = None
#Whether we do not do uint computations and have a hist dim which
#length we can use
canusehistax = (not dostatistic) or dostatisti... | Python | 1 |
("Textured"):
# output_model_obj = gr.Model3D(
# label="Output Model (STL Format)",
# #width=768,
# interactive=False,
# )
# gr.Markdown("Note: Texture and Material are randomly assigned by the ... | Python | 1 |
import pandas as pd
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
wait = WebDriverWait(driver,120)
origin = "tehran"
destination = "tabriz"
... | Python | 1 |
let Ok(workspace) = fs::read_to_string(cargo) {
let workspace = workspace.to_lowercase();
let path_to_manifest = manifest_dir
.strip_prefix(workspace_dir)
.unwrap()
.to_string_lossy();
// Leaving this so that it... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Build a project. """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ imp... | Python | 1 |
\
\U00010100\U00010200\
\U00010400\U00010800\
\U00011000\U00012000\
\U00014000\U00018000\
\U00020000\U00030000\
\U00050000\U00090000\
\U0010FFFF"... | Rust | 0 |
get('trained_at')
model_id = json_data.get('model_id')
if assistant_id is not None:
bot = Bot.objects.get(pk=assistant_id)
if bot is not None:
model_name = f'{bot.... | Python | 1 |
(a)
aud = (aud.transpose(-1, -2) * a).transpose(-1, -2)
x_v = self.fusion_v(torch.cat([x_v, aud], dim=1))
if self.bh_model:
x_h = self.fusion_h(torch.cat([x_h, aud], dim=1))
x_v, x_h = layer(x_v, x_h, label)
if self.bh_model:
... | Python | 1 |
OutOfRange,
#[error(transparent)]
Other(#[from] anyhow::Error),
}
<reponame>sportshark/bcnode<gh_stars>1-10
#![feature(rustc_private)]
#![feature(test)]
extern crate test;
extern crate blake2_rfc;
extern crate grpc;
extern crate tls_api;
extern crate num_traits;
extern crate crypto;
#[macro_use]
extern crate ... | Rust | 0 |
self.parent.sort_button = QPushButton('🔠 이름 순 정렬')
self.parent.sort_button.clicked.connect(self.toggle_sort_list)
button_layout.addWidget(self.parent.sort_button)
self.parent.reverse_button = QPushButton('🔃 순서 반대로')
self.parent.reverse_button.clicked.connect(self.reverse_list_order)... | Python | 1 |
batches (int): batch size
max_seq_length (int): The max sequence lengths of the sequences
in the batch
slice_offst (int): output_tensor's offst
slice_size (int): current output_tensor's size
add_inputs (bool, optional): Defaults to False. adds the final lora
... | Python | 1 |
AccessoryInformation,
AirPurifier,
AirQualitySensor,
BatteryService,
CameraRtpStreamManagement,
CarbonDioxideSensor,
CarbonMonoxideSensor,
ContactSensor,
Door,
Doorbell,
Fan,
FanV2,
FilterMaintenance,
Faucet,
GarageDoorOpener,
HeaterCooler,
HumidifierDehumidifier,
HumiditySensor,
IrrigationSystem,
... | Rust | 0 |
moji),
("cigarette" , &crate::flat::CIGARETTE as &crate::Emoji),
("cinema" , &crate::flat::CINEMA as &crate::Emoji),
("circled_m" , &crate::flat::CIRCLED_M as &crate::Emoji),
("circus_tent" , &crate::flat::CIRCUS_TENT as &crate::Emoji),
("city_sunrise" , &crate::flat::SUNSET as &crate::Emoji),
("city_sunset" , &crate::... | Rust | 0 |
import pprint
import re
import pytest
import qcelemental as qcel
from qcelemental.models import AtomicInput
import qcengine as qcng
from qcengine.testing import has_program, using
from .test_canonical_config import _canonical_methods, _get_molecule
@pytest.mark.parametrize("native", ["none", "input", "all"])
@pyte... | Python | 1 |
SONIC_VISUALIZER_PATH="C:/Program Files (x86)/Sonic Visualiser/Sonic Visualiser.exe"
SONIC_ANNOTATOR_PATH="C:/Program Files (x86)/Sonic Visualiser/annotator/sonic-annotator.exe"
DEFAULT_DATA_STORAGE_PATH="E:/dataset/" | Python | 1 |
ser usado con otros invocables que no sean funciones. Cualquier atributo nombrado en assigned o updated que falte en el objeto que se está invoca se ignora (es decir, esta función no intentará establecerlos en la función de envoltura (wrapper)). AttributeError sigue apareciendo si la propia función de envoltura no tien... | Python | 1 |
yycursor += 1
yystate = 20
continue
yystate = 9
continue
case 17:
return Ans.COLOR
case 18:
yych = yyinput[yycursor]
if yych == 0x6D:
yyc... | Python | 1 |
import torch
import torch.nn as nn
from models.mem_net.resnet import resnet18
from models.modules import RFB
from models.mem_net.cbam import CBAM
class Value_Encoder(nn.Module):
def __init__(self,):
super().__init__()
network = resnet18(pretrained=True, extra_dim=1)
self.conv1 = network.co... | Python | 1 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
(e)]}, 400
except Exception as e:
return {'errors': ['An unexpected error occurred']}, 500
@dc_routes.route('/<int:id>/schedule')
def get_center_schedule(id):
"""Get center's schedule"""
center = DistributionCenter.query.get_or_404(id)
date = request.args.get('date')
if date:
return... | Python | 1 |
uantity': 1.0,
'currentDayCost': 0.0}
EQUITY_JSON = {'shortQuantity': 0.0,
'averagePrice': 79.0566,
'currentDayProfitLoss': -56.5,
'currentDayProfitLossPercentage': -0.86,
'longQuantity': 100.0, 'settledLongQuantity': 100.0,
... | Python | 1 |
M', b'3',
b'M', b'4', b'M', b'5', b'M', b'6', b'M', b'7', b'M', b'8', b'M', b'9', b'M', b'A', b'M', b'B',
b'M', b'C', b'M', b'D', b'M', b'E', b'M', b'F', b'M', b'G', b'M', b'H', b'M', b'I', b'M', b'J',
b'M', b'K', b'M', b'L', b'M', b'M', b'M', b'N', b'M', b'O', b'M', b'P', b'M', b'Q', b'M', b'R',
b'M', ... | Rust | 0 |
ccounts() -> Vec<AccountId> {
vec![
hex!["a60837b2782f7ffd23e95cd26d1aa8d493b8badc6636234ccd44db03c41fcc6c"].into(),
hex!["f29311a581558ded67b8bfd097e614ce8135f777e29777d07ec501adb0ddab08"].into(),
hex!["1098e3bf7b351d6210c61b05edefb3a2b88c9611db26fbed2c7136b6d8f9c90f"].into(),
hex!["f252bc67e45acc9b3852a0ef84... | Rust | 0 |
]: https://github.com/google/ml-metadata/blob/master/g3doc/get_started.md#upgrade-the-mlmd-library
#[error("schema version {actual} is not supported (supported version is {expected})")]
UnsupportedSchemaVersion {
/// The schema version of the database.
actual: i32,
/// The schema versio... | Rust | 0 |
, one.clone());
}
None => {
row.insert_untagged(column, UntaggedValue::nothing());
}
};
}
Err(reason) => {
row.insert_value(column, reason);
... | Rust | 0 |
= envs.get("PATH") {
if p != "" {
env::set_var("PATH", p);
}
}
envs.entry("HOME".to_owned())
.or_insert(home_dir.to_string_lossy().into_owned());
let incoming = VsockListener::bind(&SockAddr::new_vsock(3, 10000))?.incoming();
let waitpid_mutex = Arc::new(Mutex::ne... | Rust | 0 |
00544292992993952360719000252205715076, 284751400376525550861233017183497639371, 62365388436267647533064120634464266870, 243579355010018669877160932197352017974, 93028746118909893246237533845189074002, 161426242690584918941198733450953748769, 208632865147351209340449219082125897333, 1859410358898356714030977476611055... | Rust | 0 |
pubkey = share_eph_pubkey(&mut handler, &local_eph_pubkey)?;
// Compute common shared secret.
let shared_secret = diffie_hellman(&local_eph_privkey, &remote_eph_pubkey);
// Sort by lexical order.
let (low_eph_pubkey, _) = sort32(local_eph_pubkey, remote_eph_pubkey);
// Check i... | Rust | 0 |
#!/usr/bin/env python3
# _*_ coding:utf-8 _*_
# cron:false
# Modify: Kirin
import sys
import os, re
import requests
import json
import time
import hmac
import hashlib
import base64
import urllib.parse
from requests.adapters import HTTPAdapter
from urllib3.util import Retry
from typing import Dict, Any, Optional
cur_... | Python | 1 |
Control::Value(*v),
Control::Value64(v) => Control::Value64(*v),
Control::String(v) => Control::String(v.clone()),
}
}
/// The backend struct that interfaces with V4L2.
/// To see what this does, please see [`CaptureBackendTrait`].
/// # Quirks
/// - Calling [`set_resolution()`](CaptureBackendTrai... | Rust | 0 |
# Copyright 2021 Camptocamp (http://www.camptocamp.com).
# @author Iván Todorovich <ivan.todorovich@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class MailTemplate(models.Model):
_inherit = "mail.template"
use_autosubscribe_followers = fields.Boo... | Python | 1 |
st WORKSPACES: usize> {
current_workspace: usize,
geometry: MonitorGeometry,
layout: Layout,
bar_status: BarStatus,
// TODO: Serialize if possible.
#[serde(skip_serializing)]
last_selected_client: [Option<usize>; WORKSPACES],
}
impl<const WORKSPACES: usize> fmt::Debug for Monitor<WORKSPACES... | Rust | 0 |
assert_array_equal(y, yc)
def test_1d_plugin_sorted():
yield do_1d_check_sorted, 'plugin', None
def test_1d_pt_sorted():
yield do_1d_check_sorted, 'pt', None
@dec.skipif(not statk_available(), "STATK NSB wrapper not available")
@dec.slow
def test_1d_nsb_sorted():
yield do_1d_check_sorted, 'nsb', No... | Python | 1 |
) [7; 10)",
"struct Foo;|Foo",
);
}
#[test]
fn goto_definition_resolves_correct_name() {
check_goto(
"
//- /lib.rs
use a::Foo;
mod a;
mod b;
enum E { X(Foo<|>) }
//- /a.rs
struct Foo... | Rust | 0 |
{
let id = &ids[i];
match tree.search(&id) {
Some(node) => {
print_solution(&node.id, &id);
break;
}
None => tree.insert(&id),
}
}
}
fn print_solution(a: &String, b: &String) {
let solution = a
.chars()
... | Rust | 0 |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | Python | 1 |
"""Functions for modifying team properties."""
from src.utils.logging_utils import setup_logger
from src.utils.ndf_utils import find_obj_by_type, find_obj_by_namespace
logger = setup_logger(__name__)
def edit_gameplay_unit_team(source_path) -> None:
"""GameData/Gameplay/Unit/Tactic/Team.ndf
Edit Airport su... | Python | 1 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType
from .external_background_check import ExternalBackgroundCheck
class UpdateExternalBackgroundCheckReq... | Python | 1 |
`controller` - The controller which execute actual qmp command.
/// * `leak_bucket` - The LeakBucket flow controller for qmp command.
///
/// # Errors
///
/// This function will fail when json parser failed or socket file description broke.
pub fn handle_qmp(
stream_fd: RawFd,
controller: &Arc<Mutex<dyn Machin... | Rust | 0 |
rens_fisher::Stats = key_measurements
.iter()
.filter(|m| m.engine.as_ref() == engine_b)
.map(|m| m.count as f64)
.collect();
let ci = behrens_fisher::confidence_interval(1.0 - significance_level, a, b)?;
results.push(EffectSize {
arch: key.ar... | Rust | 0 |
AP_START);
println!("heap_size: {:#x}", config::HEAP_SIZE);
assert!(config::HEAP_START > ekernel);
trap::init(); // install trap handler, this should run per-hart
println!("trap init");
println!("{}", LOGO);
println!(
"[\x1b[32;1mPsicaSBI\x1b[0m]: Version {}.{}",
*SBI_IMPL_VER_MAJOR,
*SBI_IMP... | Rust | 0 |
accuracy"]) - float(random_scores[key]["accuracy"]), 2)
scores[key]["acc_gain"] = gain
else:
for sub_key in scores[key]:
gain = round(float(scores[key][sub_key]["accuracy"]) - float(random_scores[key][sub_key]["accuracy"]), 2)
scores[ke... | Python | 1 |
�苏省盐城市市辖区"),
("320902", "江苏省盐城市亭湖区"),
("320903", "江苏省盐城市盐都区"),
("320911", "江苏省盐城市郊区"),
("320921", "江苏省响水县"),
("320922", "江苏省滨海县"),
("320923", "江苏省阜宁县"),
("320924", "江苏省射阳县"),
("320925", "江苏省建湖县"),
("320926", "江苏省... | Rust | 0 |
ger.info("知识库插件正在终止...")
if hasattr(self, "init_task") and self.init_task and not self.init_task.done():
logger.info("等待初始化任务完成...")
try:
await asyncio.wait_for(self.init_task, timeout=5.0)
except asyncio.TimeoutError:
logger.warning("初始化任务超时,尝... | Python | 1 |
"""Constants of the Xiaomi Aqara component."""
DOMAIN = "xiaomi_aqara"
GATEWAYS_KEY = "gateways"
LISTENER_KEY = "listener"
KEY_UNSUB_STOP = "unsub_stop"
KEY_SETUP_LOCK = "setup_lock"
ZEROCONF_GATEWAY = "lumi-gateway"
ZEROCONF_ACPARTNER = "lumi-acpartner"
CONF_INTERFACE = "interface"
CONF_KEY = "key"
CONF_SID = "sid... | Python | 1 |
import re
import urllib
from email.Utils import formatdate
from django.utils.encoding import smart_str, force_unicode
from django.utils.functional import allow_lazy
ETAG_MATCH = re.compile(r'(?:W/)?"((?:\\.|[^"])*)"')
def urlquote(url, safe='/'):
"""
A version of Python's urllib.quote() function that can ope... | Python | 1 |
def get_hammed_count(self, start_date, end_date, category='node'):
from osf.models import NodeLog, PreprintLog
if category not in ['node', 'preprint']:
raise ValueError(f"Invalid category '{category}'. Expected 'node' or 'preprint'.")
log_model = NodeLog if category == 'node' ... | Python | 1 |
} else {
spaces.insert(core_space.name().clone(), core_space);
}
}
cores.push(core);
}
let spaces = spaces.drain().map(|(_, v)| v).collect();
Ok(DataBase::new(spaces, cores))
}
fn load_core(name: &str) -> Res... | Rust | 0 |
# IfcOpenShell - IFC toolkit and geometry engine
# Copyright (C) 2022 Dion Moult <dion@thinkmoult.com>
#
# This file is part of IfcOpenShell.
#
# IfcOpenShell 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 Foundat... | Python | 1 |
The matched indices corresponding to 1)location 2)confidence 3)landm preds.
"""
# jaccard index
overlaps = jaccard(
truths,
point_form(priors)
)
# (Bipartite Matching)
# [1,num_objects] best prior for each ground truth
best_prior_overlap, best_prior_idx = overlaps.max(1, k... | Python | 1 |
p1),
2 => sink.push(Inst::Pop2),
n @ _ => sink.push(Inst::PopN(n as u32)),
}
Ok(())
}
pub(super) fn ret(ty: Type, sink: &mut InstSink) -> CompileResult<()> {
let slots = ty
.borrow()
.occupy_slots()
.ok_or(CompileErrorVar::RequireSized(format!("{:?}", ty.cp())))?;
... | Rust | 0 |
dJungleLog,
StrippedAcaciaLog,
StrippedDarkOakLog,
StrippedOakLog,
OakWood,
SpruceWood,
BirchWood,
JungleWood,
AcaciaWood,
DarkOakWood,
StrippedOakWood,
StrippedSpruceWood,
StrippedBirchWood,
StrippedJungleWood,
StrippedAcaciaWood,
StrippedDarkOakWood,
OakLeaves,
SpruceLeaves,
BirchLeaves,
JungleLeav... | Rust | 0 |
"name": "fertility_rate_30_34",
"type": "FLOAT",
"description": "Age specific fertility rate for age 30-34 (births per 1,000 population)",
"mode": "NULLABLE",
},
{
"name": "fertility_rate_35_39",
"type": "FL... | Python | 1 |
mitives::{
consensus::TEST_NETWORK, keys::testing::arb_shielded_addr,
legacy::testing::arb_transparent_addr,
transaction::components::amount::testing::arb_nonnegative_amount,
};
use crate::address::RecipientAddress;
use super::{memo_from_vec, Payment, RawMemo, TransactionRequest};
... | Rust | 0 |
ile let Some(offset) = arg.next() {
let size = arg.next().unwrap();
let value = String::from_raw_parts(offset as _, size as _, size as _);
result.push(value);
}
result
}
}
pub(super) fn vector_der(arg_name: &str, ty: &ParsedType) -> proc_macro2::TokenStream {
... | Rust | 0 |
# ex1.m -> ex1.py
#
# Fitting an artificially created frequency response (single element)
#
# -Creating a 3rd order frequency response f(s)
# -Fitting f(s) using vectfit3.m
# -Initial poles: 3 logarithmically spaced real poles -1 iteration
#
#This example script is part of the vector fitting package (VFI... | Python | 1 |
vices = tplink::discover()?;
for (ip, device) in devices {
match device {
DeviceKind::Plug(mut plug) => {
println!("[{}] => {}", ip, plug.alias()?);
plug.turn_off()?;
assert_eq!(plug.is_on()?, false);
}
DeviceKind::Bulb(mu... | Rust | 0 |
continue
elif chord_dx == chord_bak:
chord_diff_score_by_pat[step_it - 2] = chord_diff_score_by_pat[step_it - 3] # 和弦没变 赋前值
continue
else: # 用上两拍的最后一个bass组合来进行计算
abs_notelist = accompany_bak
div12_note_list... | Python | 1 |
f testRebindingFreeVariableMemberAccesses(self):
e = self.parse('f(x.a) + g(x.y.z)')
e2 = e.rebindFreeVariableMemberAccess('x', 'a', 'x_a')
e2 = e2.rebindFreeVariableMemberAccess('x', 'y', 'x_y')
self.verifyRebindFreeVariableMemberAccess(
'f(x.a) + g(x.y.z)',
{ ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.