text string | label_name string | labels int64 |
|---|---|---|
from .structure import RootConfig
schema, = python_type_to_json_schemas(RootConfig)
# Some of the default values will still be python types,
# so let's use deform_to_bus to turn them into something
# that'll be json safe
schema = deform_to_bus(schema)
schema["$schema"] = SCHEMA_URI
return ... | Python | 1 |
from django.shortcuts import render, redirect
from .forms import MonthSelectionForm, ForecastDataForm
from .models import ForecastData, ForecastResult, SeasonalityIndicator, GrowthStabilityIndicator, DynamicsIndicator, CoherenceIndicator
import datetime
import calendar
from pytrends.request import TrendReq
import time
... | Python | 1 |
ken_ids = torch.as_tensor(arr, dtype=torch.long, device=self.device)
indices = token_ids.unsqueeze(2)
token_probs = torch.zeros(
(len(execute_model_req.seq_group_metadata_list), sample_len,
self.vocab_size),
dtype=torch.float32,
device=self.device,
... | Python | 1 |
"kucing",
"kucing tersengih dengan mata tersenyum",
"mata",
"muka",
"senyuman",
"tersengih",
],
},
#[cfg(feature = "mt")]
crate::Annotation {
lang: "mt",
tts: Some("wiċċ ta’ qa... | Rust | 0 |
d(1)}/${ul.p95.toFixed(1)} [${W}s]`;
cardObj.el.querySelector('.stats').textContent = line;
}
// ---------- Reposition buttons next to badges ----------
function placeCtrlNextToState(card){
try{
const ctrl = card.querySelector('.ctrl-btn'); if(!ctrl) return;
const badgeRow = ca... | Python | 1 |
!{Nrexc, ()}
ex_impl!{Nrexc<((), ())>, ()}
ex_impl!{Nrexc<Not>, Id<bool>}
ex_impl!{Nrexc<(Not, ())>, ()}
ex_impl!{Nrexc<((), Not)>, Id<bool>}
ex_impl!{Nrexc<(Not, Not)>, Id<bool>}
ex_impl!{Nrexc<(Id<bool>, ())>, Id<bool>}
ex_impl!{Nrexc<((), Id<bool>)>, ()}
ex_impl!{Nrexc<(Id<bool>, Id<bool>)>, Id<bool>}
ex_impl!{Nrexc... | Rust | 0 |
from padHexToValue import padTo
from displayBits import getBits
from roundToEvenInt import roundEven
def output(n, e, d):
# convert to hex for display and pad to appropriate values
n, e, d = hex(n), hex(e), hex(d)
# pad to appropriate byte formats for display
n, e, d = padTo(n, roundEven(len(n) - 2)), padTo(e, 6... | Python | 1 |
/ AccountId::from(hex_literal::hex!("c225ec79661cdd770f68ae0047af6545fea12b77752aa2f314e0d8cc736b592a")),
// AccountId::from(hex_literal::hex!("<KEY>")),
// AccountId::from(hex_literal::hex!("04a8faeb34bbe3149737cee6c353aff5d607a7b3d297e17ad012d990d9b86771")),
// AccountId::from(hex_literal::hex!("e8e1289d24... | Rust | 0 |
DEPIN5_R = crate::pac::generic::R<bool, ENDEPIN5_A>;
impl ENDEPIN5_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> ENDEPIN5_A {
match self.bits {
false => ENDEPIN5_A::DISABLED,
true => ENDEPIN5_A::ENABLED,
}
}
#[doc = "... | Rust | 0 |
// belongs).
buf_alloc: u32,
// Number of bytes the sender has received and consumed (for the connection to which this packet
// belongs). For instance, for our Unix backend, this counter would be the total number of bytes
// we have successfully written to a backing Unix socket.
fwd_cnt: u32,
... | Rust | 0 |
g>,
callback: Option<String>,
<<<<<<< HEAD
context: &C) -> Result<TestEndpointParametersResponse, ApiError>
{
let context = context.clone();
info!("test_endpoint_parameters({}, {}, \"{}\", {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}, {:?}) - X-Span-ID: {:?}", number, d... | Rust | 0 |
"keywords": ["征集"],
"wiki_url": "https://thedream.feishu.cn/wiki/YIK6wvyxuiER1MkWDUjcv1WfnQb",
"as_subpage": True
},
{
"keywords": ["南门茶话会"],
"wiki_url": "https://thedream.feishu.cn/wiki/B3sUwGL9oiD6oNkTzzkcMm4fnKd"... | Python | 1 |
\"))]
pub password: String,
#[validate(must_match = \"password\")]
pub password_confirmation: String,
}
#[derive(Serialize, Deserialize, FromForm)]
pub struct Login {
pub email: String,
pub password: String,
}
#[derive(Debug)]
pub struct CurrentUser(i32);
impl<'a, 'r> FromRequest<'a, 'r> for Curr... | Rust | 0 |
d(cors)
all_cors.append(cors)
test_df["correct"] = cors
for j in range(probs.shape[1]):
choice = choices[j]
test_df["choice{}_probs".format(choice)] = probs[:, j]
test_df.to_csv(
os.path.join(
args.save_dir,result_dir, f"{subject}.csv"... | Python | 1 |
options: BundleProcessingOptions,
**kwd,
) -> str:
value_translation_by_data_table_column = bundle_description.value_translation_by_data_table_column
value = kwd.get(column_name)
if (
data_table_name in value_translation_by_data_table_column
and column_name in value_translation_by_dat... | Python | 1 |
import os
# Debug True/False
DEBUG = True
# Database connection
DATABASE = 'bombolone'
# ~
ENV = "home"
# ~
PATH = 'http://0.0.0.0:5000'
# ~
PATH_API = 'http://0.0.0.0:5000/api/1.0'
# ~
PATH_LAYOUT = 'http://0.0.0.0:5000/static/layout/'
# ~
PROJECT_DIR = os.path.dirname(__file__)
# ~
STATIC = os.path.join(PROJE... | Python | 1 |
tex_shader,
pub tex_rgbx: wlr_gles2_tex_shader,
pub tex_ext: wlr_gles2_tex_shader,
}
#[repr(C)]#[derive(Copy, Clone)]
pub struct C2RustUnnamed_2 {
pub program: GLuint,
pub proj: GLint,
pub color: GLint,
}
#[repr(C)]#[derive(Copy, Clone)]
pub struct C2RustUnnamed_3 {
pub program: GLuint,
pu... | Rust | 0 |
ontext, EarlyLintPass, LintContext};
use rustc_middle::lint::in_external_macro;
use rustc_session::{declare_tool_lint, impl_lint_pass};
declare_clippy_lint! {
/// **What it does:** Warns if a long integral or floating-point constant does
/// not contain underscores.
///
/// **Why is this bad?** Reading... | Rust | 0 |
.kind(get_vdev_type(raid_name))
.health(health)
.disks(inner.map(get_disk_from_disk_line).collect())
.error_statistics(error_statics)
.reason(reason)
.build()
.expect("Failed to bu... | Rust | 0 |
referred_transactions.lock().unwrap();
let transaction_unreferred: Vec<String> = transaction_unreferred_
.iter()
.map(|h| h.to_string())
.collect();
drop(transaction_unreferred_);
// proposer number
let mut proposer_number: usize = 0;
let mut ... | Rust | 0 |
loss_fn(config)
print("Put model on device")
model = model.to(device)
print("Initialize labels")
if config['dataset'] == 'temca':
labels = torch.cat([x[1].unsqueeze(0).to('cpu') for x in iter(dataset)], dim=0)
outputs = torch.cat([model(x[0].unsqueeze(0).to(device)).to('cpu') for x in iter(d... | Python | 1 |
(json format). Required for dev set")
parser.add_argument("--num_workers", type=int, default=16,
help="number of parallel processes to binarize reader data")
def get_encoder_checkpoint_params_names():
return ['do_lower_case', 'pretrained_model_cfg', 'encoder_model_type',
'p... | Python | 1 |
u8; 12usize],
#[doc = "0x20 - Length"]
pub len: LEN,
_reserved3: [u8; 12usize],
#[doc = "0x30 - CRC Seed/Result"]
pub result: RESULT,
_reserved4: [u8; 68usize],
#[doc = "0x78 - LOCK Control"]
pub lockctrl: LOCKCTRL,
#[doc = "0x7c - LOCK Status"]
pub lockstat: LOCKSTAT,
#[doc ... | Rust | 0 |
protocol_version: ProtocolVersion,
}
impl ChainInfo {
/// Create an instance of `ChainInfo` for testing.
#[cfg(test)]
pub fn create_for_testing() -> Self {
ChainInfo {
network_name: "rust-tests-network".to_string(),
maximum_net_message_size: 22 * 1024 * 1024, // Hardcoded a... | Rust | 0 |
::Output {
&mut self.0[idx]
}
}
impl Index<NamedColor> for List {
type Output = Rgb;
#[inline]
fn index(&self, idx: NamedColor) -> &Self::Output {
&self.0[idx as usize]
}
}
impl IndexMut<NamedColor> for List {
#[inline]
fn index_mut(&mut self, idx: NamedColor) -> &mut Self... | Rust | 0 |
onent.is_zero() {
if !exponent.is_even() {
number = &number * &*self;
while number.len() > r {
let new = (number.len() - 1) % r;
let x = number.data.pop().unwrap();
number.data[new] += x;
}
... | Rust | 0 |
(i, value) in array.into_iter().enumerate() {
vm.store(self.address + i, Cell::Value(value))?;
}
Ok(())
}
}
use log::{trace, debug};
use std::io::Error;
use kf_protocol::api::{RequestMessage, ResponseMessage};
use sc_api::topic::{FlvFetchTopicsRequest, FlvFetchTopicsResponse};
use sc... | Rust | 0 |
wait_clock_cycle!(sim, clock, x);
x.core.trigger_start.trigger.next = 0_u32.into();
x = sim.watch(|x| x.slave.transfer_done.val(), x)?;
sim_assert!(sim, x.slave.data_inbound.val() == 0x12345678deadbeef_u64, x);
for sample in [0xcafe_u16, 0xbabe_u16, 0x5ea1_u16, 0x5e5e_u16] {
... | Rust | 0 |
from typing import List, Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
def print_linked_list(head):
current = head
while current:
print(current.val, end=" -> ")
current = current.next
class Solution:
def mergeKLists(self, ... | Python | 1 |
'pretrained_models')
args = parser.parse_args()
taskname = args.task_name
av = get_available_models()
if taskname not in av.keys():
raise RuntimeError("Invalid task name. This pretrained model does not exist. To see available task names, "
... | Python | 1 |
import torch
import numpy as np
def cast_rays(ori, dir, z_vals):
return ori[..., None, :] + z_vals[..., None] * dir[..., None, :]
def get_ray_directions(W, H, fx, fy, cx, cy, use_pixel_centers=True):
pixel_center = 0.5 if use_pixel_centers else 0
i, j = np.meshgrid(
np.arange(W, dtype=np.float32... | Python | 1 |
import matplotlib.pyplot as plt
import numpy as np
from joblib import Parallel, delayed
import acoustotreams
k0 = 2 * np.pi * 50000 / 343
materials = [acoustotreams.AcousticMaterial(1050 + 100j, 2350 - 300j),
acoustotreams.AcousticMaterial(998, 1497)]
lmax = 3
radii = [0.0075, 0.0075]
positions = [[-0.0... | Python | 1 |
24, 11858, 39482, 57956, 55792, 59312, 33340, 23788, 49616, 31347, 47475, 10256, 15412, 51863, 20169, 36861, 22139, 44933, 3762, 488, 54885, 19702, 17817, 50982, 29320, 48681, 41714, 10243, 51964, 34819, 37926, 29594, 37522, 28362, 44442, 16836], 'chosen_samples_score': ['0.75871724', '0.7782122', '0.80007535', '0.7619... | Python | 1 |
class Solution:
def minimizeError(self, prices: List[str], target: int) -> str:
# A[i] := (costCeil - costFloor, costCeil, costFloor)
# The lower the costCeil - costFloor, the cheaper to ceil it
A = []
sumFloored = 0
sumCeiled = 0
for price in map(float, prices):
floored = math.floor(pr... | Python | 1 |
",
p.url()
)),
);
}
#[test]
fn error_message_for_missing_manifest() {
let p = project("foo")
.file(
"Cargo.toml",
r#"
[project]
name = "foo"
version = "0.5.0"
authors = ["<EMAIL>"]
[dependencies.ba... | Rust | 0 |
from fnmatch import fnmatch
for i in range(1203456009 - (1203456009%98591), 10**12+1, 98591):
if fnmatch(str(i), '12?3*456??9'):
print(i, i//98591)
| Python | 1 |
uxiliary models used during training, ex. for knowledge distillation.",
hint=FieldHint.feature,
)
def _validate(self) -> None:
self.training.export.setup(self.model)
for reference_model in self.reference_models.values():
self._add_reference_distributed_to_pretrained(referenc... | Python | 1 |
"""
This file pulls data from the YouTube API relating to the English Premier League
highlights and loads it into a BigQuery table.
"""
import googleapiclient.discovery
from google.cloud import secretmanager
from datetime import datetime, timedelta, timezone
import pandas as pd
from pandas import DataFrame
def gcp_... | Python | 1 |
p};
pub enum EventType {
Added,
Deleted,
}
pub struct EventDriver {
images: BiMap<String, u64>,
pods: BiMap<(String, String), u64>,
map: HashMap<u64, Vec<u64>>,
}
impl EventDriver {
pub fn new() -> EventDriver {
EventDriver {
images: BiMap::new(),
pods: BiMap::... | Rust | 0 |
import os
from exa_py import Exa #For Website Search/Scraping
from langchain.agents import tool
class ExaSearchToolset():
@tool
def search(query: str):
"""Search a webpage based on the query."""
return ExaSearchToolset._exa().search(f"{query}", use_autoprompt=True, num_results=3)
@too... | Python | 1 |
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... | Python | 1 |
e`.
/// This trait mostly just exists for consistency.
pub trait ZeroChoice {}
impl ZeroChoice for Zero {}
impl ZeroChoice for NonZero {}
/// A trait to figure out whether the result of a multiplication should be [`Zero`] or [`NonZero`] at compile time.
pub trait DecideZero<ZZ> {
/// If both arguments are `NonZe... | Rust | 0 |
def move_orbit_to(self, tar_ele, tar_azi, radius, d_radius=0, num_frames=30):
# only support fixed radius now
if d_radius != 0:
raise ValueError("Only support fixed radius now")
traj = CamPlanner().add_traj(startcam=self.basecam).move_orbit_to(tar_ele, tar_azi, radius, d_radius, nu... | Python | 1 |
b sw_mux_ctl_pad_gpio_emc_02: SW_MUX_CTL_PAD_GPIO_EMC_02,
#[doc = "0x20 - SW_MUX_CTL_PAD_GPIO_EMC_03 SW MUX Control Register"]
pub sw_mux_ctl_pad_gpio_emc_03: SW_MUX_CTL_PAD_GPIO_EMC_03,
#[doc = "0x24 - SW_MUX_CTL_PAD_GPIO_EMC_04 SW MUX Control Register"]
pub sw_mux_ctl_pad_gpio_emc_04: SW_MUX_CTL_PAD_G... | Rust | 0 |
indow_info_t),
"::",
stringify!(shared_texture_enabled)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<_cef_window_info_t>())).external_begin_frame_enabled as *const _
as usize
},
80usize,
concat!(
"Offset ... | Rust | 0 |
equired')
if validation_pattern:
input_field.props(f'pattern="{validation_pattern}"')
# フォーカススタイル
input_field.props(
'onfocus="this.style.borderColor=\'#3b82f6\'; this.style.boxShadow=\'0 0 0 3px rgba(59, 130, 246, 0.1)\'" '
... | Python | 1 |
atform].items():
addr = ecu[1:]
if ecu[0] not in CHECK_FUZZY_ECUS:
continue
# Sanity check that a subset of Volkswagen FW is in the database
found_versions = live_fw_versions.get(addr, [])
if not any(found_version in expected_versions for found_version in found_versions):
... | Python | 1 |
config_synth_div2_cc26_2g4::W) writer structure"]
impl crate::Writable for CONFIG_SYNTH_DIV2_CC26_2G4 {}
#[doc = "Internal. Only to be used through TI provided API."]
pub mod config_synth_div2_cc26_2g4;
#[doc = "Internal. Only to be used through TI provided API.\n\nThis register you can [`read`](crate::generic::Reg::re... | Rust | 0 |
/ buf_x, ((buf_y - y) * 0xFF) / buf_y);
let g: u32 = min((x * 0xFF) / buf_x, ((buf_y - y) * 0xFF) / buf_y);
let b: u32 = min(((buf_x - x) * 0xFF) / buf_x, (y * 0xFF) / buf_y);
writer.write_u32::<NativeEndian>((0xFF << 24) + (r << 16) + (g << 8) + b)?;
}
writer.flush(... | Rust | 0 |
\x17\n\x0c\n\x04\x04#\x02\0\x12\
\x04\xeb\x01\x04\"\n\x0f\n\x05\x04#\x02\0\x04\x12\x06\xeb\x01\x04\xea\
\x01\x19\n\r\n\x05\x04#\x02\0\x06\x12\x04\xeb\x01\x04\x16\n\r\n\x05\x04#\
\x02\0\x01\x12\x04\xeb\x01\x17\x1d\n\r\n\x05\x04#\x02\0\x03\x12\x04\xeb\
\x01\x20!\n\x0c\n\x04\x04#\x02\x01\x12\x04\xec\x01\x0... | Rust | 0 |
get_current_word(&self, params: &Value) -> Fallible<String> {
let key = "cword";
let expr = "expand('<cword>')";
try_get(key, params)?.map_or_else(|| self.eval(expr), Ok)
}
pub fn get_goto_cmd(&self, params: &Value) -> Fallible<Option<String>> {
let key = "gotoCmd";
t... | Rust | 0 |
gle),
/// Fills the clipped region with a solid color.
Clear(Color),
}
impl DisplayCommand {
/// Returns the maximum bounds.
/// Somewhat unorthodox function, since most variants aren't directly graphically expressible.
pub fn bounds(&self) -> Result<Option<Rect>, error::FontError> {
Ok(mat... | Rust | 0 |
println!();
}
println!(" └─────┴─────┴{}┴{}┴{}┘\n", b, b, b);
}
#[derive(Debug)]
pub struct Car {
pub color: Color,
pub motor: Transmission,
pub roof: bool,
pub age: (Age, u32),
}
#[derive(PartialEq, Debug)]
pub enum Transmission {
Manual,
SemiAuto,
Automatic,
}... | Rust | 0 |
gt_segments:
for word in gt_segment:
syn_colored = False
if synonyms is not None and word in synonyms.keys():
syns = synonyms[word]
for syn in syns:
if syn in all_words:
all_words[word] = all_words[syn]
... | Python | 1 |
st.markdown("""
**🐉 Fantasy Adventures**
- A dragon who's afraid of heights
- A wizard's apprentice mixing up spells
- A magical library where books come alive
""")
with example_col2:
st.markdown("""
**🚀 Sci-Fi Stories**
... | Python | 1 |
MP12_W {
SMP12_W { w: self }
}
#[doc = "Bits 3:5 - Channel 11 sampling time selection"]
#[inline(always)]
pub fn smp11(&mut self) -> SMP11_W {
SMP11_W { w: self }
}
#[doc = "Bits 0:2 - Channel 10 sampling time selection"]
#[inline(always)]
pub fn smp10(&mut self) -> SMP10... | Rust | 0 |
import os
import json
def unescape_xml_strings(file_path):
"""
Takes a file containing a JSON string representation of XML and
converts it to properly formatted XML.
Args:
file_path (str): Path to the file containing the XML string.
Returns:
str: Path to the new file with unescap... | Python | 1 |
#this program will ask the user to input how many times they want the for loop to run
# it will then print out how many times the loop ran
forloopcount = int(input("how many times do you want the for loop to run: "))
for count in range(forloopcount):
print(f"for loop has run {count + 1} times") | Python | 1 |
"""
Calculate mean clap scores for each attribute of each dimension of each system
"""
import json
ACC_PROMPT_PATH = "/home/liucheng/project/tta-benchmark/prompt/acc_prompt.json"
GENERAL_PROMPT_PATH = "/home/liucheng/project/tta-benchmark/prompt/generalization_prompt.json"
ROBUSTNESS_PROMPT_PATH = "/home/liucheng/proj... | Python | 1 |
content = content.replace(pic.pic_id, f"Image/{image_name}")
else:
content = content.replace(pic.pic_url, f"Image/{image_name}")
except Exception as e:
log.debug(f"{pic.pic_path} 替换图片失败 {str(e)}")
log.debug(traceback.print_exc())
# 百合会特殊处理
if "s... | Python | 1 |
"""
dp[i][t] = considering stones[0~i-1], if it can sum up to target t
Time: O(SN), S is the sum of stone weight. N is the number of stones.
Space: O(SN), can reduce to O(S).
"""
class Solution(object):
def lastStoneWeightII(self, stones):
total = sum(stones)
target = total/2
dp = [[False f... | Python | 1 |
text = input("")
# Convert the input to lowercase
lowercase_text = text.lower()
# Print the lowercase result
print(lowercase_text) | Python | 1 |
# Copyright (c) 2025, NVIDIA CORPORATION. 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 appli... | Python | 1 |
json");
const JSON_F31C: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/overrides_f31c.json");
const JSON_F31F: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/overrides_f31f.json");
const JSON_F31M: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/data/overrides_f31m.json");
const JSON_F30: &str = c... | Rust | 0 |
VERSIONED: D3D12_SHADER_CACHE_FLAGS = 1u32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D12\"`*"]
pub const D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR: D3D12_SHADER_CACHE_FLAGS = 2u32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D12\"`*"]
pub type D3D12_SHADER_CACHE_KIND_FLAGS = u32;
#[doc = "*Required... | Rust | 0 |
}
}
}
#[derive(Debug)]
struct Graph {
nodes: HashMap<String, Vec<String>>,
}
impl Graph {
fn new() -> Self {
Self {
nodes: HashMap::new(),
}
}
fn add(&mut self, node: &str) {
if !self.nodes.contains_key(node) {
self.nodes.insert(node.to_str... | Rust | 0 |
f_mod
.get(py, "TransactionReceipt")
.expect("Unable to get TransactionReceipt");
let py_txn_receipt = py_txn_receipt_class
.call(py, cpython::NoArgs, None)
.expect("Unable to instantiate TransactionReceipt");
py_txn_receipt
.call_method(
... | Rust | 0 |
UniversalMeasureUnit::Millimeter,
)),
id: Some(1),
}
}
}
#[test]
pub fn test_fit_text_from_xml() {
let xml = FitText::test_xml("fitText");
let fit_text = FitText::from_xml_element(&XmlNode::from_str(xml.as_str()).unwrap())... | Rust | 0 |
true
).await;
}
}
Err(e) => {
let data_str = format!(
"Trigger id {}, Message received with Invalid UTF-8 sequence: {}",
&trigger_id, e
);
warn!("[send_mqtt_data] {}", &data_str);
}
};
}
pub as... | Rust | 0 |
sues/2015.
:param buffer_size: Buffer size in self's coordinate system units.
:param metric: Whether to perform the buffering in a local metric system (defaults to ``True``).
:param plot: Whether to show intermediate plots.
:returns: A Vector containing the buffered geometries.
... | Python | 1 |
import sys
from functions_sumo_to_fiware import *
def main():
# Establecer la posición de la orden en la línea de argumentos
orden = sys.argv[1]
if orden == "XMLtoJSON":
xml_file_path = sys.argv[2]
json_file_path = sys.argv[3]
convert_xml_to_json(xml_file_path, json_file_path)
... | Python | 1 |
{
let mut words: Vec<&str> = string
.split(del)
.map(|s| s.trim())
.filter(|s| !s.is_empty())
.collect();
all.append(&mut words);
}
all
}
let left_words = splitter(left, delimiter);
let right_words = ... | Rust | 0 |
let bob: TestAccount = BOB.clone();
let challenge = Uuid::new_v4().to_hyphenated().to_string().into_bytes();
let signed_challenge = prefixed_mesage(challenge.clone());
let signature = ALICE_PK.clone().sign_message(&signed_challenge);
let store = test_store(ALICE.clone(), false, ... | Rust | 0 |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from accounts.models import CustomUser
# Custom user admin
class CustomUserAdmin(UserAdmin):
list_display = [
'username',
'email',
'is_staff',
'is_superuser'
]
admin.site.register(CustomUser, C... | Python | 1 |
res, original_end);
// MULTIPLY SHARDS
// work[ .. recovery_count] = recovery * erasures
// work[recovery_count .. chunk_size ] = 0
// work[chunk_size .. original_end ] = original * erasures
// work[original_end .. ] = 0
for i in 0... | Rust | 0 |
from flask import Blueprint, request
from flask_jwt_extended import get_jwt_identity, jwt_required
from datetime import date
from AnyshareService.AnyShareBaseService import listDir
from Handler.Handler import admin_required, position_required, record_history
from Model.User import PositionEnum, User
from .globals impo... | Python | 1 |
object.data.layers[1] = False
bpy.context.object.data.layers[0] = True
# bpy.ops.pose.select_all(action='DESELECT')
# for b in leaf_bones:
# b_name = b.name
# obj.data.bones[b_name].select = True
... | Python | 1 |
]);
let m3 = join_to_string!(&self.digits[2..5]);
let e3 = join_to_string!(&self.digits[5..8]);
let branch = join_to_string!(self.branch_digits);
let verifier = join_to_string!(self.verifier_digits);
write!(f, "{}.{}.{}/{}-{}", f3, m3, e3, branch, verifier)
}
}
#[derive(De... | Rust | 0 |
particle.vy = -DAMPING * particle.vy;
}
if particle.y < MIN_Y {
particle.y = MIN_Y;
particle.vy = -DAMPING * particle.vy;
}
if (particle.x - duck.x).powi(2) + (particle.y - duck.y).powi(2) < DUCK_RADIUS.powi(2) {
let distance_x = particle.... | Rust | 0 |
from typing import List, Tuple, Dict, Optional
from dataclasses import dataclass
import json
import argparse
import random
import os
from datetime import datetime
from openai import OpenAI
@dataclass
class OpenAIConfig:
"""OpenAI配置"""
api_key: str = "sk-OndcygfG5hh4mmoSFzQKefFLrnPKxyI653aYKYC8QzK3Y8ZR"
... | Python | 1 |
from typing import List
class Solution:
def maxSubarraySumCircular(self, nums: List[int]) -> int:
max_sum, cur_sum = -1000000009, -1000000009
n = len(nums)
cum_sums = []
cum_sum = 0
for e in nums:
cum_sum += e
cum_sums.append(cum_sum)
tm... | Python | 1 |
pub fn sinhf(arg1: f32) -> f32;
}
extern "C" {
pub fn sinh(arg1: f64) -> f64;
}
extern "C" {
pub fn sinhl(arg1: u128) -> u128;
}
extern "C" {
pub fn tanhf(arg1: f32) -> f32;
}
extern "C" {
pub fn tanh(arg1: f64) -> f64;
}
extern "C" {
pub fn tanhl(arg1: u128) -> u128;
}
extern "C" {
pub fn e... | Rust | 0 |
from] cw20_base::ContractError),
#[error("Unauthorized")]
Unauthorized {},
#[error("No rewards claimable")]
NoRewardsClaimable {},
#[error("Reward period not finished")]
RewardPeriodNotFinished {},
#[error("Invalid funds")]
InvalidFunds {},
#[error("Invalid Cw20")]
InvalidCw20 {}... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
class LostReason(models.Model):
_name = "crm.lost.reason"
_description = 'Opp. Lost Reason'
name = fields.Char('Description', required=True, translate=True)
active = ... | Python | 1 |
pub fn get_system_metrics(&self) -> Result<MonitoringMetrics, Error> {
let system_health = SystemHealth::observe().map_err(Error::SystemMetricsFailed)?;
Ok(MonitoringMetrics {
metadata: Metadata::new(ProcessType::System),
process_metrics: Process::System(system_health.into()),
... | Rust | 0 |
ooter class="pf-c-login__main-footer">
{ for props.children.iter() }
{ if props.links.len() > 0 {
html!{
<ul class="pf-c-login__main-footer-links">
{ for props.links.iter().map(|item|{
html!{ <li class="pf-c-login__... | Rust | 0 |
}
Err(Error::new(ErrorKind::Other, "Debian file without data.tar"))
// any other archive (Arch/FreeBSD .tar)
} else {
cb(Some(ent), opt)
}
}
fn index_pkg(tr: &postgres::GenericConnection, mut opt: PkgOpt, verid: i32) -> std::io::Result<()> {
let indexfunc = |paths: &[&str], e... | Rust | 0 |
ec<&[u8]> >, separated_list!(tag!(","), tag!("")));
named!(multi_longsep<&[u8],Vec<&[u8]> >, separated_list!(tag!(".."), tag!("abcd")));
let a = &b"abcdef"[..];
let b = &b"abcd,abcdef"[..];
let c = &b"azerty"[..];
let d = &b",,abc"[..];
let e = &b"abcd,abcd,ef"[..];
let f = &b"abc"[..];
... | Rust | 0 |
# 02_modeling.py
# Add your model building code here
def train_model(data):
print("Training model...")
# Example model code here
if __name__ == "__main__":
print("Run modeling script")
| Python | 1 |
*pixels_drawn as usize,
tile_address,
tile_pixel_y,
tile_attributes,
);
*pixels_drawn += 8;
} else {
let x_flip = tile_attributes.contains(CgbTileAttribute::X_FLIP);
let bg_priority = tile_attributes.cont... | Rust | 0 |
new_reports_found = True
if new_reports_found:
save_processed_reports(processed_reports)
else:
log_message("No new reports found.", "INFO")
await asyncio.sleep(CHECK_INTERVAL)
def main():
if not all([TELEGRAM_BOT_TOKEN... | Python | 1 |
"command": "command",
"windows": "command",
"cmd": "command",
"win": "command",
"backspace": "delete",
'alt gr': 'alt' # Issue #117
})
all_modifiers = {'alt', 'ctrl', 'shift', 'windows'}
if platform.system() == 'Linux':
canonical_names.update({
"select":... | Python | 1 |
ned()));
}
}
#![allow(dead_code)]
use std::sync::{atomic::AtomicBool, atomic::AtomicUsize, atomic::Ordering, Arc};
use std::thread;
use std::time::{Duration, SystemTime};
use crate::channel::{self, Receiver, RecvTimeoutError, SendTimeoutError, Sender};
use crate::hashbrown::HashSet;
use crate::parking_lot::{Mutex... | Rust | 0 |
}
}
#[cfg(test)]
mod test {
use super::*;
// empty header, nonce 71
static V1_19_HASH: [u64; 4] = [
0xd129f63fba4d9a85,
0x457dcb3666c5e09c,
0x045247a2e2ee75f7,
0x1a0f2e1bcb9d93ff,
];
static V1_19_SOL: [u64; 42] = [
0x33b6, 0x487b, 0x88b7, 0x10bf6, 0x15144, 0x17cb7, 0x22621, 0x2358e, 0x23775, 0x24fb3,
... | Rust | 0 |
trivial = Vec::new();
for field in fields {
if is_trivial(field)? {
trivial.push(&field.ty);
}
}
Ok(trivial)
}
fn decide_trivial(fields: &Fields) -> Result<fn(&Field) -> Result<bool>> {
for field in fields {
if is_explicit_trivial(field)? {
return Ok(i... | Rust | 0 |
: recommendations
}
new_state["metadata"] = {
"last_updated": datetime.now().isoformat(),
"uncertainty_assessed_at": datetime.now().isoformat()
}
print(f"不确定性评估完成,整体置信度: {confidence_scores.get('overall', 0.7):.2f}")
return new_state
def uncertainty_route(state: ExpertSyste... | Python | 1 |
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.tools import GetElementsTool
from langchain_community.tools.playwright.get_elements import GetElementsToolInput
# Create a way to dynamically look up deprecated imports.
# Used to conso... | Python | 1 |
_value='extrapolate', assume_sorted=True, bounds_error=False)
return y(yv).astype(x.dtype)
def computeMetricsContinue(values, gt0, gt1):
values = values.flatten().astype(np.float32)
gt0 = gt0.flatten().astype(np.float32)
gt1 = gt1.flatten().astype(np.float32)
inds = np.argsort(values)
inds = i... | Python | 1 |
in list_ips_in_network_range(iprange):
log_query(__ip)
__host = await reverse_single_ip(ip=__ip, resolver=__resolver)
callback(__host)
log_result(__host)
#####################################################################
# IO
########################################################... | Python | 1 |
import pandas as pd
import panel as pn
import plotly.express as px
from dataviz_in_python import config
config.configure("plotly", url="lib_plotly", title="Plotly")
TEXT = """
# Plotly: High Quality, Interactive Plots in Python
[Plotly](https://plotly.com/python/)'s Python graphing library makes interactive, publi... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.