text string | label_name string | labels int64 |
|---|---|---|
mpty(&self) -> bool {
self.tlang.is_none() && self.tfields.is_empty()
}
/// Gets tlang from the `TransformExtensionList`.
///
/// # Examples
///
/// ```
/// use unic_locale_impl::Locale;
/// use unic_langid_impl::LanguageIdentifier;
///
/// let mut loc: Locale = "en-US-t... | Rust | 0 |
"Mismatch" not in stdout_f2py.getvalue()
class TestParamEval:
# issue gh-11612, array parameter parsing
def test_param_eval_nested(self):
v = '(/3.14, 4./)'
g_params = dict(kind=crackfortran._kind_func,
selected_int_kind=crackfortran._selected_int_kind_func,
sele... | Python | 1 |
blic License (Ms-PL)
This license governs use of the accompanying software. If you use the
software, you accept this license. If you do not accept the license, do not
use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution"
have the same meaning here as under U.S... | Rust | 0 |
shape(batch_size, 1, -1)
self.utt_private_subject = torch.ones_like(h)
for i in range(batch_size):
self.utt_private_subject[i] = self.subject_private[subject_labels[i]](h[i])
self.utt_private_subject = self.utt_private_subject.reshape(batch_size, -1)
self.utt_subject_recon ... | Python | 1 |
",
Mnemonic::SRA(_) => "SRA",
Mnemonic::SRL(_) => "SRL",
Mnemonic::BIT(_, _) => "BIT",
Mnemonic::SET(_, _) => "SET",
Mnemonic::RES(_, _) => "RES",
Mnemonic::JP(_, _) => "JP",
Mnemonic::JR(_, _) => "JR",
Mnemonic::CALL(_, _) ... | Rust | 0 |
from .base import BaseParser
from loguru import logger
import zipfile
import os
import tempfile
import json
import plistlib
from xml.etree import ElementTree as ET
class NumbersParser(BaseParser):
"""Numbers (.numbers) 文件解析器"""
@classmethod
def get_supported_extensions(cls) -> list[str]:
retur... | Python | 1 |
from django.contrib import admin
from alfa_romeo_web.forum.models import ForumCategory, Post, Comment
@admin.register(ForumCategory)
class ModelNameAdmin(admin.ModelAdmin):
list_display = ('pk', 'title', 'is_active')
list_editable = ('is_active',)
list_filter = ('is_active',)
list_per_page = 20
o... | Python | 1 |
from itertools import product
st = '6*97*5?'
ans = []
for i in '0123456879':
st ='6*97*5'+ i
for k in range(0, 3):
for val in product('0123456789', repeat=k*2):
val = ''.join(val)
st = '6' + val[:len(val)//2] + '97' + val[len(val)//2:] + f'5{i}'
cnt = 0
s... | Python | 1 |
import sys
import time
import numpy as np
import pytest
import ray
from ray._common.test_utils import wait_for_condition
MB = 1024 * 1024
def object_store_memory(a, delta=MB):
object_store_memory = ray.available_resources().get("object_store_memory")
if object_store_memory is None:
return False
... | Python | 1 |
# tests/parsers/test_live.py
import pytest
import json
from app.parsers import live
from app.models import AtBatResultType
@pytest.fixture
def active_inning_html_content():
"""
提供一個更全面的 HTML fixture,涵蓋多種情境:
1. 完整的打席,包含投球細節和一個非投球事件(投手牽制)。
2. 只有基本結果的打席。
3. 使用 'DH' 稱謂的打者,以測試更新後的正規表示式。
4. [新增] 測試... | Python | 1 |
_on_method_call() {
check_assist(
unnecessary_async,
r#"
pub struct S { }
impl S { pub async f$0n f2(&self) { } }
pub async fn f(s: &S) { s.f2().await }"#,
r#"
pub struct S { }
impl S { pub fn f2(&self) { } }
pub async fn f(s: &S) { s.f2() }"#,
)
}
#[test]
... | Rust | 0 |
t:
try:
value = data.get(name).get("增加屬性", {})["物理攻擊力"]
except:
value = 10
data.get(name).get("增加屬性", {})["物理攻擊力"] = int(value + (value * (enchant_level*0.1)))
elif "法術" in... | Python | 1 |
as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(ibv_async_event__bindgen_ty_1),
"::",
stringify!(port_num)
)
);
}
impl Default for ibv_async_event__bindgen_ty_1 {
fn default() -> Self {
unsafe { ::st... | Rust | 0 |
// class.path == "android/provider/ContactsContract$PinnedPositions", java.flags == PUBLIC | STATIC, .name == "pin", .descriptor == "(Landroid/content/ContentResolver;JI)V"
unsafe {
let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0.into()), __jni_bindgen::AsJValue::as_jva... | Rust | 0 |
ns, token_index in sorted(self.bpe_ranks.items(), key=lambda kv: kv[1]):
if index != token_index:
logger.warning(
f"Saving vocabulary to {merge_file}: BPE merge indices are not consecutive."
" Please check that the tokenizer is not corr... | Python | 1 |
import getopt
import sys
import os
import os.path
import xml.dom.minidom
import xml.dom
def usage():
print("""
usage:
unzeroradius.py -d [svg folder]
if a file has <circle r='0' replace with r='.00000000001'
""")
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "hd:", ["help", "dir... | Python | 1 |
""" Crie um programa que leia vários números inteiros e que termine apenas quando o utilizador digitar a opção para parar. No final mostre quantos números o utilizador inseriu e qual a soma entre eles. """
cont, soma = 0, 0
num = int(input("Digite um número [0 para parar]: "))
while num != 0:
soma += num
cont... | Python | 1 |
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as f:
description = f.read()
setup(
name='PyCourrier',
version='0.2.1',
packages=find_packages(),
description='A Python package for sending emails using various SMTP services',
author='Abdelmajid Habouch'... | Python | 1 |
while True:
# Menu
print("CHECK DIGIT VALIDATOR")
print("What would you like to validate:")
print("1. ISBN-10")
print("2. UPC-12")
print("Q. Quit Program")
options = input("Choose an option! =>")
# ISBN
elif options == "1":
ISBN = input("Enter ISBN =>")
a=(int(ISBN[0... | Python | 1 |
out.cpp"]);
}
run_shell_command("g++", &["-o", "out", "out.cpp"]);
if args.contains(&"-r".to_string()) || args.contains(&"--run".to_string()) {
run_shell_command("./out", &[]);
}
} else {
print_usage()
}
}
use crate::{
config::Config,
steamworks_util... | Rust | 0 |
g-V2
conda develop $PWD/submodules/DPT
if [ "$NERFBASELINES_DOCKER_BUILD" = "1" ]; then
# Reduce size of the environment by removing unused files
find "$CONDA_PREFIX" -name '*.a' -delete
find "$CONDA_PREFIX" -type d -name 'nsight*' -exec rm -r {} +
# Replace all libs under $CONDA_PREFIX/lib with symlinks to pkgs/cuda-... | Python | 1 |
message(_program: &str) -> String {
let z_opts = concat!(
"Options:\n",
" -X rust-version-info display rust version info and exit\n",
" -X base_dir=<path> set <path> is base directory\n",
);
z_opts.to_string()
}
#[rustfmt::skip]
fn opt_uc_x_package_version_info(_program:... | Rust | 0 |
click(b_invert_selection, inputs=[*g_checkbox_list], outputs=[*g_checkbox_list])
btn_save_json.click(b_save_file)
demo.load(
b_change_index,
inputs=[
index_slider,
batchsize_slider,
],
outputs=[*g_text_list, *g_audio_list,... | Python | 1 |
st DBIM_MODEFLAGS: u32 = 32u32;
#[doc = "*Required features: `\"Win32_UI_Shell\"`*"]
pub const DBIM_TITLE: u32 = 16u32;
#[doc = "*Required features: `\"Win32_UI_Shell\"`*"]
pub const DBPC_SELECTFIRST: u32 = 4294967295u32;
#[doc = "*Required features: `\"Win32_UI_Shell\"`*"]
pub type DEFAULTSAVEFOLDERTYPE = i32;
#[doc =... | Rust | 0 |
range constrain").into(),
offset: 0,
},
cell_values: vec![(((Any::Advice, 0).into(), 0).into(), "0x8".to_string())],
}])
);
}
}
#[test]
fn test_bitrange_subset() {
let rng = OsRng;
construct... | Rust | 0 |
w4, a[3] ^ w5]
}
fn sha1msg2(a: [u32; 4], b: [u32; 4]) -> [u32; 4] {
let [x0, x1, x2, x3] = a;
let [_, w13, w14, w15] = b;
let w16 = (x0 ^ w13).rotate_left(1);
let w17 = (x1 ^ w14).rotate_left(1);
let w18 = (x2 ^ w15).rotate_left(1);
let w19 = (x3 ^ w16).rotate_left(1);
[w16, w17, w18, w... | Rust | 0 |
training_util.create_global_step()
read_tensor = training_util._get_or_create_global_step_read()
inc_op = training_util._increment_global_step(1)
inc_three_op = training_util._increment_global_step(3)
with monitored_session.MonitoredTrainingSession() as sess:
read_value, _ = sess.run([... | Python | 1 |
np.uint8(add_weighted(np.array(rgb), alpha, np.array(original), 1 - alpha, 0))
)
rgb = np.array(rgb)
return rgb
def _draw_gt_tracks(
self,
rgb: np.ndarray, # H x W x 3,
gt_tracks: np.ndarray, # T x 2
):
T, N, _ = gt_tracks.shape
c... | Python | 1 |
class NotSleeping:
"""
Class representing a person who is struggling to fall asleep.
"""
def __init__(self):
"""
Sets all the necessary attributes for the class NotSleeping
Initial count_sheeps is 0
"""
self.count_sheeps = 0
def add_sheep(self):
"""... | Python | 1 |
-485,-357,347
-345,-311,381
-661,-816,-575
-876,649,763
-618,-824,-621
553,345,-567
474,580,667
-447,-329,318
-584,868,-557
544,-627,-890
564,392,-477
455,729,728
-892,524,684
-689,845,-530
423,-701,434
7,-33,-71
630,319,-379
443,580,662
-789,900,-551
459,-707,401
--- scanner 1 ---
686,422,578
605,423,415
515,917,-36... | Rust | 0 |
"""
Clutter UI backend
Imports here make sure the backends are registered
"""
from .app_window import ClutterAppWindowImpl # noqa
from .console_manager import ClutterConsoleManagerImpl # noqa
from .layer import ClutterLayerImpl # noqa
from .text_widget import ClutterTextWidgetImpl # noqa
from .base_element import... | Python | 1 |
result = lrcalc.coprod(part, all)
return {tuple([_Partitions(mu) for mu in la]): Integer(k)
for la, k in result.items()}
def mult_schubert(w1, w2, rank=0):
r"""
Compute a product of two Schubert polynomials.
Return a linear combination of permutations representing the
product of t... | Python | 1 |
e
E: From<Error>,
{
type Item = Result<T, E>;
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
Pin::new(&mut self.receiver)
.poll_next(cx)
.map(|maybe_res| match maybe_res {
None => None,
Some(Ok(item)) =>... | Rust | 0 |
# optimizer
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
optimizer_config = dict()
# learning policy
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False)
# runtime settings
runner = dict(type='IterBasedRunner', max_iters=20000)
checkpoint_config = dict(by_epoch=False, inte... | Python | 1 |
e-fault exception
// corresponding to the original access type. Otherwise,
// let a = pte.ppn × PAGESIZE and go to step 2."
if r == 1 || x == 1 {
break;
}
i -= 1;
let ppn = (pte >> 10) & 0x0fff_ffff_ffff;
a = ppn * PAGE_SIZE;
if i < 0 {... | Rust | 0 |
ct IMAP brute:\n\t%s" % HYDRA)
# ========================
# ------------------------------------
# Main
# ------------------------------------
KNOWN_SERVICES = {
"ftp" : ftp,
"ssh" : ssh,
"ms-wbt-server" : rdp,
"netbios-ssn" : smb,
"ms-sql-s" : ms_sql,
... | Python | 1 |
StandardD32asV4,
#[serde(rename = "Standard_D32s_v3")]
StandardD32sV3,
#[serde(rename = "Standard_D4as_v4")]
StandardD4asV4,
#[serde(rename = "Standard_D4s_v3")]
StandardD4sV3,
#[serde(rename = "Standard_D8as_v4")]
StandardD8asV4,
#[serde(rename = "Standard_D8s_v3")]
Standar... | Rust | 0 |
::Home => {
if self.data.clis.is_empty() {
self.dispatch_cmd(IoCmdEvent::GetCliInfo).await;
}
self.dispatch(IoEvent::GetNamespaces).await;
self.dispatch(IoEvent::GetNodes).await;
let active_block = self.get_current_route().active_block;
if active_... | Rust | 0 |
data);
}
// Compactly encode the partial trie DB.
let compact_trie = {
let trie = <TrieDB<L>>::new(&partial_db, &root).unwrap();
encode_compact::<L>(&trie).unwrap()
};
(root, compact_trie, items)
}
fn test_decode_compact<L: TrieLayout>(
encoded: &[Vec<u8>],
items: Vec<(&'static [u8], Option<DBValue>)>,
e... | Rust | 0 |
import random
def generate_random_3sat(n, m):
clauses = set()
while len(clauses) < m:
clause = set()
while len(clause) < 3:
var = random.randint(1, n)
negated = random.choice([True, False])
if negated:
var = -var
clause.add(var)
... | Python | 1 |
' ').nth(3)?;
let ppid_str = std::str::from_utf8(ppid_bytes).ok()?;
let ppid_u32 = u32::from_str(ppid_str).ok()?;
Some(ppid_u32)
};
let pid = pid?;
let shell_id = get_parent(pid)?;
if is_terminal(shell_id)? {
let terminal = get_parent(shell_id)?;
return state.win... | Rust | 0 |
# Copyright 2024 RIVERLANE LTD
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute,... | Python | 1 |
of Domain
//! * `create_project` - Create Project belongs to Account (Team)
//! * `update_project` - Update Project info
//! * `create_project_content` - Create Project Content (Digital Asset)
//! * `create_project_nda` - Create NDA contract between sides
//! * `create_nda_content_access_request` - Some side request a... | Rust | 0 |
a
d0` @ sZ d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z m
Z
g dZG dd dejZ
G d d
d
ejZG dd deZG d
d dZG dd dee
eZG dd deeZdd Zdd ZG dd de
ZG dd de
ZG dd deZG dd deZG dd d e
ZG d!d" d"ZG d#d$ d$ee
Z... | Python | 1 |
Data(response)
print("Response angle: " + str(response))
return saveData
########################################################################################################################
def main():
# Initialize GUI for Subject ID
subID, width = get_subject_info()
if subID is None:
... | Python | 1 |
################################################################################
# Creme is a free/open-source Customer Relationship Management software
# Copyright (C) 2018-2025 Hybird
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... | Python | 1 |
_INFO`] entries follow this header in the stream.
///
/// This struct matches the [Microsoft struct][msdn] of the same name.
///
/// [msdn]: https://docs.microsoft.com/en-us/windows/desktop/api/minidumpapiset/ns-minidumpapiset-_minidump_memory_info_list
#[derive(Clone, Pread, SizeWith)]
pub struct MINIDUMP_MEMORY_INFO_... | Rust | 0 |
# ========= Copyright 2023-2024 @ CAMEL-AI.org. 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 requ... | Python | 1 |
"{:.3f}".format(float(uem_end / 16000)),
)
to_uem.append(c_uem)
if len(to_uem) > 0:
assert c_split in ["dev", "eval"] # uem only for development set
Path(os.path.join(out_dir, "uem", c_split)).mkdir(parents=True)
to_uem = sor... | Python | 1 |
def loop_body(step, args):
latents, scheduler_state = args
latents_input = jnp.concatenate([latents] * 2)
t = jnp.array(scheduler_state.timesteps, dtype=jnp.int32)[step]
timestep = jnp.broadcast_to(t, latents_input.shape[0])
latents_input = self.scheduler.scale_model_input(scheduler_state,
l... | Python | 1 |
# Copyright (c) Qualcomm Innovation Center, Inc.
# All rights reserved
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from typing import Dict
import executorch.backends.qualcomm.python.PyQnnWrapperAdaptor as PyQnnWrapper
import torch... | Python | 1 |
query.insert("role".to_string(), "baby_programmer".to_string());
query.insert("location".to_string(), "norway".to_string());
let route = ExampleRoutes::Admin { query };
assert_eq!(route, route_to_compare);
let url_to_compare: Url = "/admin".parse().unwrap();
let route_to_... | Rust | 0 |
: &mut I2pStreamSocket,
stype: &SessionType,
nick: &str,
port: u16)
-> Result<(), I2pError>
{
let msg = match stype {
SessionType::RepliableDatagram => {
format!("SESSION CREATE STYLE=DATAGRAM ID={} PORT={} DESTINATION=TRANSIENT\n",
nick, port)
},... | Rust | 0 |
output_line[..]).unwrap();
// assert_eq!(output["message"], "missing status=404");
// assert_eq!(output["host"], "127.0.0.1");
// assert_eq!(output["status"], "404");
// }
#[test]
fn test_merge() {
let num_lines: usize = 10000;
let in_addr1 = next_addr();
let in_addr2 = next_addr();
let o... | Rust | 0 |
var.replace(':', "_").replace('.', "_");
replacements
.entry(rep.clone())
.or_insert_with(|| var.to_owned());
rep
});
let expr: meval::Expr = expr_string.parse()?;
for v in expr.iter() {
if let meval::tokenizer::Token::Var(re... | Rust | 0 |
._use_map.add(instruction)
def _propagate_postponed_aliased_definitions(self):
"""
Propagate definitions of aliased variables, postponed for propagation, after everything else is propagated.
Check before propagation, if there are no changes via aliases between definition and use.
Se... | Python | 1 |
import os
import time
import pandas as pd
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
from torch.distributed import DeviceMesh
from torch.distributed._tensor import Replicate, Shard
from chop.distributed.tensor import distribute_tensor
def device_fn(
rank,
world_size,
... | Python | 1 |
:{}
Accept: */*
User-Agent: git/oxide-{}
",
server.addr.port(),
env!("CARGO_PKG_VERSION")
)
.lines()
.collect::<Vec<_>>()
);
Ok(())
}
#[test]
fn clone_v1() -> crate::Result {
let (server, mut c) = mock::serve_and_connect(
"v1/http-handshake.response"... | Rust | 0 |
bro no encontrados.")
elif opcion == "7":
id_lector = int(input("Introduce el ID del lector: "))
lector = None
for l in lectores:
if l.getId() == id_lector:
lector = l
break
if lector:
print(... | Python | 1 |
from datetime import date
import boto3
from botocore.exceptions import ClientError
################################################################################################
#
# Configuration Parameters
#
################################################################################################
groupNr = ... | Python | 1 |
ync fn get_data(&mut self, context: &mut ProgramTestContext) -> RandomnessOracle {
let account = get_account(context, &self.keypair.pubkey()).await;
RandomnessOracle::unpack_unchecked(&account.data).unwrap()
}
}
<filename>src/credentials.rs
//! A common set of Credentials used to associate a [crate:... | Rust | 0 |
# Question 5. The angular speed of wheel 20 cm in radians is 120 rpm. What is the distance if the car travels in 10 seconds.
# Known: Radius (r) = 20 cm = 0.2 meters
# The angular speed = 120 rev / 60 seconds = 2 rev / second = (2)(6.28) radians / second = 12.56 radians / second
# Wanted: distance
# Formula: v = r... | Python | 1 |
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
... | Rust | 0 |
bal_id, :] = joints[:, coco_id, :]
if 'neck' in global_config.parts_dict: # neck point works as a root note
neckG = global_config.parts_dict['neck']
# parts_dict['neck'] = 1, parts_dict是前面定义过的字典类型,节点名称:序号
RshoC = self.parts_dict['Rsho']
LshoC = self.parts_dict['... | Python | 1 |
Element::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::name\0".as_ptr() as *const _,
Some(transmute(notify_name_trampoline::<Self, F> as usize)),
... | Rust | 0 |
f: Lease<Data, P>,
vertex_buf_len: u64,
vertex_buf_write: bool,
}
<filename>src/tests/bad_tests/ion_parser_bad_serde_value.rs
use std::convert::TryInto;
use chrono::DateTime;
use serde_json::Value;
use crate::{IonParserError, IonValue};
#[test]
fn serde_from_ion_symbol() {
let bad_value = IonValue::Symbo... | Rust | 0 |
) & 1) != 0;
EPI_HB8TIME4_RDWSMR { bits }
}
#[doc = "Bit 4 - CS3n Write Wait State Minus One"]
#[inline(always)]
pub fn epi_hb8time4_wrwsm(&self) -> EPI_HB8TIME4_WRWSMR {
let bits = ((self.bits >> 4) & 1) != 0;
EPI_HB8TIME4_WRWSMR { bits }
}
#[doc = "Bits 12:13 - CS3n Int... | Rust | 0 |
# 从Scikit-Learn库导入线性模型中的Logistic回归算法
import numpy as np
from sklearn.linear_model import LogisticRegression
# Scikit-Learn库带有知名的鸢尾花分类数据集,是一个分类问题的数据集
from sklearn.datasets import load_iris
import matplotlib.pyplot as plt
# 载入鸢尾花数据集
X, y = load_iris(return_X_y=True)
# 只选取数据集中的前两个特征进行可视化
X_vis = X[:, :2] # 取第0列和第1列
#... | Python | 1 |
};
static_assertions::assert_impl_all!(SortBy: Send, Sync);
static_assertions::assert_impl_all!(SortOrdering: Clone, Eq, PartialEq, Send, Sync);
}
use std::error::Error;
use std::path::Path;
use std::io::{BufRead, Write};
use lamb::error::LambError;
use lamb::evaluate::{Evaluator, Strategy};
use clap::value_t;... | Rust | 0 |
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from backend.database import get_db
from backend.schemas.habit_pokemon_link import HabitPokemonLinkCreate, HabitPokemonLinkUpdate, HabitPokemonLinkRead
from backend.services.habit_pokemon_link import (
create_habit_pokemon_link,
... | Python | 1 |
typ) = match split_mode_string(mode_string) {
Ok((mode, typ)) => (mode, typ),
Err(error_message) => {
return Err(vm.new_value_error(error_message));
}
};
let io_module = vm.import("_io", &[], 0)?;
// Construct a FileIO (subclass of RawIOBase)
// This is subsequentl... | Rust | 0 |
_translate("AboutDialog", "<html><head/><body><p><span style=\" font-size:10pt;\">© 2017 Kevin Zhang</span></p><p><span style=\" font-size:10pt;\">dottorrent-gui is made available under the terms of the </span><a href=\"http://choosealicense.com/licenses/gpl-3.0/\"><span style=\" font-size:10pt; text-decoration: underl... | Python | 1 |
#! /usr/bin/python
# -*- coding: utf8 -*-
import tensorflow as tf
import numpy as np
from six.moves import xrange
def discount_episode_rewards(rewards=[], gamma=0.99, mode=0):
""" Take 1D float array of rewards and compute discounted rewards for an
episode. When encount a non-zero value, consider as the end... | Python | 1 |
ialize_get_reversed(value: size_t) -> BDD;
pub fn Sylvan_serialize_reset() -> c_void;
pub fn Sylvan_serialize_totext(out: *mut FILE) -> c_void;
pub fn Sylvan_serialize_tofile(out: *mut FILE) -> c_void;
pub fn Sylvan_serialize_fromfile(input: *mut FILE) -> c_void;
pub fn Sylvan_fprint(f: *mut FILE, b... | Rust | 0 |
se_object_uuid(
self, misp_object: Union[MISPEvent, MISPObject], object_id: str):
object_uuid = self._extract_uuid(object_id)
if object_uuid in self.replacement_uuids:
comment = f'Original UUID was: {object_uuid}'
misp_object.comment = f'{misp_object.comment} - {comme... | Python | 1 |
::new(),
};
static CONNECT: Atom<Option<ConnectState>> = |_| None;
fn main() {
std::panic::set_hook(Box::new(|info| {
println!("{}", info);
}));
use dioxus::desktop::tao::dpi::LogicalSize;
crate::storage::init_dir().unwrap();
dioxus::desktop::launch_cfg(app, |cfg| {
cfg.with_wind... | Rust | 0 |
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
use std::collections::VecDeque;
use std::time::Duration;
use anyhow::Result;
use apparatus::color;
use apparatus::color::Color;
use apparatus::engine::apparatus::{Apparatus, ApparatusSettings};
use apparatus::engine::game::Game;
use app... | Rust | 0 |
c = entry.get("adc_serials")
local_json_ch = entry.get("local_channels")
for i in range(len(json_adc)):
#print(json_adc[i][1:].lower())
#print(local_json_ch[i])
file_name1 = plot_path+calib_name+"/"+calib_name+"_"+calib_run_name+"/FIT_ChargeLight_"+json_adc[i][1:].lo... | Python | 1 |
"""
Midscene 测试脚本生成智能体系统
包含四个智能体:页面元素分析智能体、交互分析智能体、Midscene用例生成智能体、脚本生成智能体
使用AutoGen 0.5.7框架实现
"""
import asyncio
import json
import os
import sys
import time
import traceback
from asyncio import Queue
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Dict, List, Optional
import aiofi... | Python | 1 |
s.append(Op(k,2))
else: s.append(Op(k,1))
if s[-1].arity==2: pad(n)
elif c in ASSIGN:
if n in CPAREN+ENDEXP: rq(Ast('prj',(Ast(c),d.pop()))); continue
else: s.append(Op(c,2))
elif c in VERBM:
if n in CPAREN+ENDEXP: raise SyntaxError(err(i,"can't project a prefix op"))
else: s.... | Python | 1 |
writer_props.statistics_enabled(×tamp_field_colpath),
true
);
}
#[test]
fn compression_level() {
assert_eq!(
CompressionLevel::from_str("max").ok().unwrap(),
CompressionLevel::Maximum
);
assert_eq!(
Compression... | Rust | 0 |
unique_visits / max(1, self.step_count)
self.get_logger().info("=== Coverage Statistics ===")
self.get_logger().info(f"Time elapsed: {t1 - t0:.1f}s")
self.get_logger().info(f"Steps: {self.step_count}, Unique: {unique_visits}/{total_cells}")
self.get_logger().info(f"Revisits: {self.revi... | Python | 1 |
# coding=utf-8
"""
Copyright 2013 LinkedIn Corp. 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 required by applicable l... | Python | 1 |
'''
AAA lllllll lllllll iiii
A:::A l:::::l l:::::l i::::i
A:::::A l:::::l l:::::l iiii
A:::::::A l:::::l l:::::l
... | Python | 1 |
{\"bar-key\": \"value\"}}`. (See `Understanding Free-form Tags`__).
__ https://docs.cloud.oracle.com/Content/Tagging/Tasks/managingtagsandtagnamespaces.htm
:param defined_tags: The defined_tags of this JavaLicenseAcceptanceRecord.
:type: dict(str, dict(str, object))
"""
self._... | Python | 1 |
_disp = Some(name);
},
Ok((Spawn(prog), fds)) => {
let disp = wl_disp.clone().expect("WAYLAND_DISPLAY must have been set");
let prog1 = prog.clone();
if let Err(err) = Command::new(&prog).before_exec(move || {
// loginw sets rea... | Rust | 0 |
def bisection(f, a, b, eps):
fa = f(a)
if fa*f(b) > 0:
return None, 0
i = 0 # iteration counter
while b-a > eps:
i += 1
m = (a + b)/2.0
fm = f(m)
if fa*fm <= 0:
b = m # root is in left half of [a,b]
else:
a = m # root is in rig... | Python | 1 |
# Generated by Django 3.2.15 on 2022-12-31 14:33
from django.db import migrations, models
import src.general.mixins
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Period',
fields=[
... | Python | 1 |
0, 12.0);
pub const AREA_Y: (f32, f32) = (-3.0, 3.0);
pub const AREA_W: f32 = AREA_X.1 - AREA_X.0;
pub const AREA_H: f32 = AREA_Y.1 - AREA_Y.0;
pub const VIEW_SCALE: f32 = AREA_H * 10.0 / 2.0;
pub const DEFAULT_SPEED: f32 = 2.0;
pub const ACTOR_RADIUS: f32 = 10.0;
pub const BG: u32 = ... | Rust | 0 |
up_info_event.wait();X=C.up_info[D][Cb]-F(K)+1
h=C.encrypt_wbi(mid=D,pn=X,ps=C.userConfig[Z],order=L)[0];i=f"https://api.bilibili.com/x/space/wbi/arc/search?{h}";b=C._get_sth(i,Q).json();J=[]
if b[M]==0:
j=b[E][G]['vlist']
for N in j:
k=A(N[T]).strip();l=C.cleanCharacters(N[P].strip());n=N[Au].strip();d=C... | Python | 1 |
us in StockStatus]
if value not in valid_statuses:
raise ValueError(
f"無效的股票狀態: {value},允許的值: {valid_statuses}"
)
return value
def __repr__(self) -> str:
"""字串表示
Returns:
str: 股票資訊的字串表示
Example:
>>> stock = S... | Python | 1 |
st_log.append(interest.minwidth)
interest_list.remove(interest)
print(f"Interest Goal! → {interest.route} : {interest.minwidth}")
# TTL(生存時間)を超えた場合
elif len(interest.route) == TTL:
interest_log.append(0)
interest_list.remove(intere... | Python | 1 |
"1-1"] {
let mut t = Lexer::new(s);
match factor(&mut t) {
Ok(ast) => {
assert_eq!(ast.tok, Int(1));
assert_eq!(ast.children.len(), 0);
}
Err(msg) => panic!(msg),
}
}
for s in vec!... | Rust | 0 |
[..sz], sample_info.fpos)?;
handle.write_all(&buffer[..sz])?;
}
}
let dfl_sample_size = 0;
for moof in iter_box!(mp4, MovieFragmentBox) {
for traf in iter_box!(moof, TrackFragmentBox) {
let tfhd = first_box!(traf, TrackFragmentHeaderBox).unwrap();
if !tf... | Rust | 0 |
//dbg!(suffix_str);
let host = format!("{}{}", prefix_str, suffix_str);
//dbg!(host);
host
}
//@lowercase
pub enum OsType {
Windows,
Linux,
Others,
}
pub fn servername(windows: Option<bool>, linux: Option<bool>) -> String {
/*
Generate a random server name
:param windows: Wind... | Rust | 0 |
/// Gets the current date as a `DateTuple`
pub fn now_as_datetuple() -> DateTuple {
let seconds = duration_since_unix_epoch().as_secs();
DateTuple::from_days(extract_days_from_duration(seconds) + UNIX_EPOCH_DATETUPLE.to_days())
.unwrap()
}
/// Gets the current month as a `MonthTuple`
pub fn now_as_mo... | Rust | 0 |
from rich_toolkit import RichToolkit, RichToolkitTheme
from rich_toolkit.styles.border import BorderedStyle
from rich_toolkit.styles.fancy import FancyStyle
from rich_toolkit.styles.tagged import TaggedStyle
for style in [TaggedStyle(tag_width=12), BorderedStyle(), FancyStyle()]:
theme = RichToolkitTheme(
... | Python | 1 |
self.f.write_string_fragment(self.w, &key.0.to_string())?;
self.f.end_string(self.w)?;
self.f.end_object_key(self.w)?;
self.f.begin_object_value(self.w)?;
self.serialize_comment_vec(value)?;
self.f.end_object_value(self.w)?;
}
self.f.end_object(self.w)?;
self.f.end_objec... | Rust | 0 |
:input::DescribeCapacityReservationFleetsInput,
) -> Result<aws_smithy_http::body::SdkBody, aws_smithy_http::operation::SerializationError> {
let mut out = String::new();
#[allow(unused_mut)]
let mut writer = aws_smithy_query::QueryWriter::new(
&mut out,
"DescribeCapacityReservationFleets",
... | Rust | 0 |
from datetime import datetime
from typing import Dict, List, Optional
def flatten_tasks(task: Dict, parent_name: Optional[str] = None, counters: Optional[Dict[str, int]] = None) -> List[Dict]:
"""
Recursively flatten the nested task structure into a list of dictionaries.
Args:
task: Dictionary co... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.