text string | label_name string | labels int64 |
|---|---|---|
ens(data_name):
if data_name == 'multiwoz':
db_tokens = ['<sos_db>', '<eos_db>', '[db_nores]', '[db_0]', '[db_1]', '[db_2]', '[db_3]',
'[book_nores]', '[book_fail]', '[book_success]']
special_tokens = ['<go_r>', '<go_b>', '<go_a>',
'<eos_u>', '<eos_r>',... | Python | 1 |
olor="white",
font_family="courier",
shadow=True,
point_color="grey",
point_size=20,
)
my_nodes_2 = [mesh_set.nodes[18], mesh_set.nodes[30]]
my_labels_2 = [] # ["MyNode3"]
plot.add_node_labels(
my_nodes_2,
mesh_set,
my_labels_2,
font_size=15,
text_color="black",
font_family="ar... | Python | 1 |
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
match *se... | Rust | 0 |
index: 1,
flags: 0,
eax: LEAFBH_INDEX1_APICID_SHIFT,
ebx: 0,
ecx: 1 | (leaf_0xb::LEVEL_TYPE_INVALID << leaf_0xb::ecx::LEVEL_TYPE_SHIFT),
edx: 0,
padding: [0, 0, 0],
};
{
let entries = kvm_cpuid.mut_entries_s... | Rust | 0 |
n(
camera_name,
projection
);
None
}
}
use std::{fmt, ops, sync::Arc, marker, net::{Ipv4Addr, Ipv6Addr}};
use chrono_tz::Tz;
use crate::{
binary::{Encoder, ReadEx},
errors::{Error, FromSqlError, Result},
types::{
column::{
column_data::ArcCol... | Rust | 0 |
# Bob's Burgers 🍔
# Codédex
class Restaurant:
name = ''
type = ''
rating = 0.0
delivery = False
bobs_burgers = Restaurant()
bobs_burgers.name = 'Bob\'s Burgers'
bobs_burgers.type = 'American Diner'
bobs_burgers.rating = 4.2
bobs_burgers.delivery = False
katz_deli = Restaurant()
katz_deli.name = 'Katz\'s Del... | Python | 1 |
"""Crea una clase base llamada Animal con atributos como nombre y edad.
Luego, define clases derivadas como Perro, Gato, etc., que agreguen
atributos específicos y métodos relacionados con cada tipo de animal."""
class Animal:
def __init__(self, nombre, edad):
self.nombre = nombre
self.edad = edad... | Python | 1 |
}
pub struct LocalContext<'a> {
pub(crate) inner: NonNull<Option<NonNull<LocalContextInner>>>,
pub(crate) marker: PhantomData<&'a ()>,
}
pub struct Local<'a, T: Trace> {
val: *mut Option<NonNull<dyn Trace>>,
_marker: PhantomData<&'a T>,
}
pub struct PersistentContext {
pub(crate) inner: *mut LocalC... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Demonstrates use of FillBetweenItem to fill the space between two plot curves.
"""
import initExample ## Add path to library (just for examples; you do not need this)
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
#FIXME: When running on Qt5, not as perfec... | Python | 1 |
"""Image process functions for ComfyUI nodes
by chflame https://github.com/chflame163
@author: chflame
@title: CatVTON_Wrapper
@nickname: CatVTON_Wrapper
@description: CatVTON warpper for ComfyUI
"""
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
# import math
import numpy as np
impo... | Python | 1 |
import pandas as pd
import sys
def select_by_loss(filepath, topk, out_path):
df = pd.read_csv(filepath)
df = df.sort_values(by='pseudo_loss', ascending=False)
df.head(topk).to_csv(out_path, index=0)
if __name__ == '__main__':
try:
filepath = sys.argv[1]
topk = sys.argv[2]
ou... | Python | 1 |
use std::collections::BTreeMap;
use zoon::{Deserialize, Serialize};
pub mod encoder;
mod logs;
mod sink;
pub mod writer;
#[ignore_none]
#[derive(Serialize, Deserialize, Debug, Clone, Default, Field)]
#[serde(crate = "serde", default)]
pub(super) struct Val {
sink: Mutable<Option<sink::Val>>,
logs: Mutable<Op... | Rust | 0 |
fn test_div_rounded_int_by_int_zero() {
let x = 17_u16;
let y = 0_u16;
let _z = x.div_rounded(y, 5);
}
}
<reponame>robsaunders/winit-vst
#![cfg(target_os = "macos")]
use objc;
use cocoa::base::{id, nil, YES, NO, SEL, class};
use libc;
use std::os::raw::c_void;
use std::sync::Mutex;
use std... | Rust | 0 |
ble_dfu.target_mac_increase(1)
# Try connection with new address
print("Couldn't connect, will try DFU MAC")
if not ble_dfu.scan_and_connect():
raise Exception("Can't connect to device")
ble_dfu.start()
# Disconnect from peer device if not done... | Python | 1 |
ulkan/specs/1.2-extensions/man/html/vkDestroyDescriptorUpdateTemplateKHR.html>"]
pub unsafe fn destroy_descriptor_update_template_khr(
&self,
device: Device,
descriptor_update_template: DescriptorUpdateTemplate,
p_allocator: *const AllocationCallbacks,
) -> c_void {
(self... | Rust | 0 |
r3k2r/p1pp2b1/bn1qpnpB/3P1Q2/1p2PP2/2N5/PPP4P/R3KB1r b Qkq f3 0 1"),
("e8a8", "2kr3r/p1pp2b1/bn1qpnpB/3P1Q2/1p2PP2/2N5/PPP4P/R3KB1r w Q - 0 1"),
("f5h5", "2kr3r/p1pp2b1/bn1qpnpB/3P3Q/1p2PP2/2N5/PPP4P/R3KB1r b Q - 0 1"),
("f6e4", "2kr3r/p1pp2b1/bn1qp1pB/3P3Q/1p2nP2/2N5/PPP4P/R3KB1r w ... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# 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 law or... | Python | 1 |
GA_OK
}
};
}
macro_rules! ok_json {
($t:expr, $x:expr) => {{
let x = json!($x);
debug!("ok_json!() {:?}", x);
ok!($t, GDKRPC_json::new(x))
}};
}
macro_rules! safe_ref {
($t:expr) => {{
if $t.is_null() {
return GA_ERROR;
}
... | Rust | 0 |
import os
import torch
from tqdm import tqdm
from utils.utils import get_lr
def fit_one_epoch(model_train, model, loss_history, optimizer, criterion, epoch, epoch_step, gen, Epoch, anchors, cfg, cuda, save_period, save_dir):
total_r_loss = 0
total_c_loss = 0
total_landmark_loss = 0
pr... | Python | 1 |
}
//! Implements the `stats` target which extracts various statistical
//! information from the document tree.
use preamble::*;
use std::collections::HashMap;
use serde_yaml;
use std::io;
/// Dump stats to stdout as yaml.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct... | Rust | 0 |
g=True):
# origin input shape is: (bs, 3, 300, 300)
# using dali and nhwc input shape is: (bs, 300, 300, 4)
ploc, plabel = self.model(img)
ploc, plabel = ploc.float(), plabel.float()
if training:
N = img.shape[0]
bbox.requires_grad = False
labe... | Python | 1 |
raph::{Node, NodeRef, QueryGraph, QueryGraphDependency},
ParsedInputMap, ParsedInputValue,
};
use connector::{Filter, RecordFilter};
use prisma_models::{ModelRef, PrismaValue, RelationFieldRef};
use std::{convert::TryInto, sync::Arc};
/// Adds a delete (single) record node to the graph and connects it to the paren... | Rust | 0 |
}
impl Solution {
fn new(nums: Vec<i32>) -> Self {
Solution { nums }
}
fn reset(&self) -> Vec<i32> {
self.nums.clone()
}
fn shuffle(&self) -> Vec<i32> {
let mut ans = self.nums.clone();
let n = ans.len();
for i in 0..n {
let j = i + rand::threa... | Rust | 0 |
g == "linkedin":
re1 = re.compile('class=l>[a-zA-Z ,._-]* - LinkedIn</a>')
res = re1.findall(data)
resul = []
for x in res:
y = string.replace(x, ' - LinkedIn</a>', '')
y = string.replace(y, 'class=l>', '')
y = string.replace(y, '</a>', '')
resul.append(y)
return resul
else:
data = string.r... | Python | 1 |
ィレクトリでは無かった場合
raise ValueError
if progress == "none":
for msg in self.track:
x1 = math.floor(msg["start"] / ticks_per_dot)
x2 = math.floor(msg["stop"] / ticks_per_dot) - 1
y = 127 - msg["note"]
if x2 < x1:
... | Python | 1 |
olar_year(1993).unwrap().to_lunar_year()
);
assert_eq!(
LunarYear::from_era(HeavenlyStems::Fifth, EarthlyBranch::Eleventh),
LunisolarYear::from_solar_year(2018).unwrap().to_lunar_year()
);
}
use std::{fs::File, io::BufReader};
use keyplace::*;
use mindbase_core::*;
use std::path::PathBuf;
u... | Rust | 0 |
import subprocess
path_drive = '/content/drive/MyDrive/projeto_final_BI'
subprocess.run(["python", "./cargas_dw/create_dw.py"], check=True)
subprocess.run(["python", "./cargas_dw/carga_manual_circobito.py"], check=True)
subprocess.run(["python", "./cargas_dw/carga_manual_escfal.py"], check=True)
subprocess.run(["pytho... | Python | 1 |
let it = itertools::izip!(
parse_16x16(slices[0])?,
parse_16x16(slices[1])?,
parse_16x16(slices[2])?,
parse_16x16(slices[3])?,
parse_16x16(slices[4])?,
)
.map(|(e0, e1, e2, e3, e4)| Tile::TilesetSpecific([e0, e... | Rust | 0 |
= self.header.clone();
let value = t.into();
Ok(Service { header, inner, value })
}
}
// === impl Service ===
impl<H, S, B> svc::Service for Service<H, S>
where
H: IntoHeaderName + Clone,
S: svc::Service<Request = http::Request<B>>,
{
type Request = S::Request;
type Response = S::R... | Rust | 0 |
F11,
gdk_key::F12 => Key::F12,
gdk_key::F13 => Key::F13,
gdk_key::F14 => Key::F14,
gdk_key::F15 => Key::F15,
gdk_key::F16 => Key::F16,
gdk_key::F17 => Key::F17,
gdk_key::F18 => Key::F18,
gdk_key::F19 => Key::F19,
gdk_key::F20 => Key::F20,
g... | Rust | 0 |
_range.end());
// 3. Advance the filter header chain to 9.
cbfmgr.sync(&tree);
let (_, parent) = cbfmgr.filters.tip();
let cfheaders = util::cfheaders(*parent, &suffix);
cbfmgr
.received_cfheaders(&remote, cfheaders, &tree)
.unwrap();
assert_eq!... | Rust | 0 |
until_nul(&mut self) -> Option<&[u8]> {
self.parse_while(|x| **x != b'\0')
}
fn parse_str_until_nul(&mut self) -> Option<&str> {
let out = self.parse_until_nul()?;
let out = core::str::from_utf8(out).ok()?;
Some(out)
}
fn parse_with_u32_le_prefix(&mut self) -> Option<&[... | Rust | 0 |
None:
critic_obs = self.critic_state_handler.reset(obs_dict["stack_critic"], obs_dict["none_stack_critic"])
obs_dict["critic"] = critic_obs
return obs_dict["policy"], {"observations": obs_dict}
def step(self, actions: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor... | Python | 1 |
me_since_epoch_ms()),
last_batch_executed_index: AtomicI64::new(-1),
last_batch_committed_index: AtomicI64::new(-1),*/
//last_batch_buffering_started_index: 0,
last_batch_execution_started_index: -1,
last_batch_execution_started_time: time_since_epoch_ms(),
... | Rust | 0 |
import sys
import yaml
import argparse
import torch
from torch.utils.data import Dataset, DataLoader
from utils.model_loader import ModelLoader
from utils.extractor.feature_extractor import CommonExtractor
sys.path.append('..')
from data_processor.test_dataset import CommonTestDataset
from backbone.backbone_def import ... | Python | 1 |
;
let mut spl_x = x;
for _ in 0.. m1 {
let (x_rsn, spl) = spl_x.split_at_mut(2 + n);
spl_x = spl;
self.cone_rotsoc.proj(dual_cone, x_rsn)?;
}
let x_p = spl_x;
self.cone_zero.proj(dual_cone, x_p)?;
Ok(())
}
f... | Rust | 0 |
nce = SEQUENCE
.lines()
.map(str::trim)
.map(str::parse)
.collect::<Result<Vec<u64>, _>>()?;
let weak_entry = XMAS::find_weak_number(5, &number_sequence).unwrap();
assert_eq!(127, weak_entry);
let encryption_weakness =
XMAS::find_encr... | Rust | 0 |
/// Returns the inferred number of channels.
#[inline]
pub const fn channels(&self) -> Channels {
self.header.channels
}
/// Returns the header that will be stored in the encoded image.
#[inline]
pub const fn header(&self) -> &Header {
&self.header
}
/// The maximum nu... | Rust | 0 |
import re
from typing import Dict, List, Set
from pipelex.core.memory.working_memory import WorkingMemory
from pipelex.core.stuffs.stuff_content import ListContent, StructuredContent, TextContent
from pipelex.tools.func_registry import func_registry
from pydantic import Field
class TextChunk(StructuredContent):
... | Python | 1 |
}) => {
assert_eq!(peer_addr, qp2p1_info.peer_addr);
assert_eq!(err.description(), Error::ConnectionCancelled.description());
}
r => panic!("Unexpected result {:?}", r),
}
}
mod handle_user_msg {
use super::*;
#[test]
fn ... | Rust | 0 |
with exactly `N` columns. Only available when using the
/// `#[row(exact)]` attribute on the container,
///
/// ```
/// # use postgres_query::{FromSqlRow, query, Result};
/// # use tokio_postgres::Client;
/// # async fn foo() -> Result<()> {
/// # let client: Client = unimplemented!();
/// #[derive(Debug, FromSqlRow)]... | Rust | 0 |
quote_spanned! {variant.span()=>
#index => #decode_bytes_expr
}
});
quote! {
let option = u128::from(<nimble::VarInt>::decode_from(config, &mut reader).await?);
match option {
... | Rust | 0 |
logger.error(f"Error in concurrent execution: {e}")
raise RuntimeError(
f"Concurrent execution failed: {str(e)}"
)
# if __name__ == "__main__":
# load_dotenv()
# # Get the OpenAI API key from the environment variable
# api_key = os.getenv("OPENAI_API_KEY")
# ... | Python | 1 |
texts_splitter = ChineseTextSplitter(pdf=True, sentence_size=sentence_size)
docs = loader.load_and_split(texts_splitter)
elif self.file_path.lower().endswith(".jpg") or self.file_path.lower().endswith(
".png") or self.file_path.lower().endswith(".jpeg"):
l... | Python | 1 |
ot condemn myself as incompetent. Instead, I will accept what has happened and see what I can do to put it right.’ Obviously, verbalizing a new assumption in the therapist’s office carries little conviction unless the client repeatedly and forcefully acts in support of it in a variety of situations where the old malada... | Python | 1 |
def kahn_topological_sort(edges):
# 모든 노드를 수집
nodes = set()
for src, dest in edges:
nodes.add(src)
nodes.add(dest)
# 각 노드의 들어오는 간선의 수를 저장할 딕셔너리 초기화
in_degree = {node: 0 for node in nodes}
# 인접 리스트를 저장할 딕셔너리 초기화
adj_list = {node: [] for node in nodes}
# 간선 리스트를 순회하며 ... | Python | 1 |
"entity_id": "binary_sensor.state",
"name": "sensor1",
"state": "on",
"start": "{{ utcnow().replace(hour=0, minute=0, second=0, microsecond=100) }}",
"duration": {"hours": 2},
"t... | Python | 1 |
c1: 0.32, c2: 2.60, c3: 7.55,
max_len: 1.3,
}),
_ => None,
}
}
#[allow(bad_style)]
#[allow(unused)] // FIXME
pub fn nanotube_CC_pol_constants() -> PolConstants {
enum_map!{
BondType::CC => Some(PolConstant {
c1: 0.04, c2: 4.0, c3: 4.7,
max_len... | Rust | 0 |
name).save()
service_obj.public_domains.update(dom_obj)
service_obj.save()
# Handle LoadBalancer status
if service.status:
if service.status.load_balancer:
if service.status.load_balancer.ingress:
for ingress in service.sta... | Python | 1 |
ndentLevel::from_node(last_field_syntax);
let mut new_field = new_field.to_string();
if usage_file_id != def_file_id {
new_field = format!("pub(crate) {}", new_field);
}
new_field = format!("\n{}{}", indent, new_field);
let needs_comma = !last_field_syntax.to_string().ends_with(',');
i... | Rust | 0 |
} of {:0>5}... ", frame, frames))
}
6 => {
update =
Box::new(|frame| print!("\nRendering frame {:0>6} of {:0>6}... ", frame, frames))
}
7 => {
update =
Box::new(|frame| print!("\nRendering frame {:0>7} of {:0>7}... ", frame, frames)... | Rust | 0 |
converted to an NbtList first
nbt.insert("list", NbtList::from(vec!["string 1", "string 2"]));
// NbtCompound::display will convert the compound tag to snbt
println!("{}", nbt);
// Alternatively, you can do the same as the above with our handy `compound!` macro
let macro_nbt = compound! {
... | Rust | 0 |
#Copyright ReportLab Europe Ltd. 2000-2017
#see license.txt for license details
#history https://hg.reportlab.com/hg-public/reportlab/log/tip/src/reportlab/graphics/charts/markers.py
__version__='3.3.0'
__doc__="""This modules defines a collection of markers used in charts.
The make* functions return a simple shape o... | Python | 1 |
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from rest_framework.exceptions import PermissionDenied
from restaurants.models import Restaurant
from accounts.models import User
from api.serializers.restaurants import RestaurantSerializer
from accounts.permissions import IsOwn... | Python | 1 |
key(self, file_key: &FileKey) -> Vec<RecipientLine> {
match self {
EncryptorType::Keys(recipients) => recipients
.iter()
.map(|key| key.wrap_file_key(file_key))
// Keep the joint well oiled!
.chain(iter::once(oil_the_joint()))
... | Rust | 0 |
"""Exit with an error
Prints an error message to the standard error stream and exits with
a non-zero status.
Args:
msg: The error message to print to standard error
"""
print('%s\n' % msg, file=sys.stderr)
sys.exit(os.EX_DATAERR)
def main(args):
"""Main function
Use the first... | Python | 1 |
pub fn new_test_ext() -> sp_io::TestExternalities {
let mut ext = frame_system::GenesisConfig::default()
.build_storage::<Test>()
.expect("Failed to create test externalities.");
crate::GenesisConfig::<Test> {
keys: NEXT_VALIDATORS.with(|l| {
l.borrow()
.iter()
.cloned()
.map(|i| (i, ... | Rust | 0 |
#!/usr/bin/env python3
from typing import List
class Solution:
def putMarbles(self, weights: List[int], k: int) -> int:
n = len(weights)
pairWeights = [weights[i] + weights[i + 1] for i in range(n - 1)]
pairWeights.sort()
answer = 0
for i in range(k - 1):
answe... | Python | 1 |
on::world_definition::*;
use gamework::*;
use log::*;
pub struct MainMenuState {
gui: Gui<GuiRenderer>,
continue_button: WidgetId,
new_game_button: WidgetId,
load_button: WidgetId,
join_button: WidgetId,
settings_button: WidgetId,
exit_button: WidgetId,
continue_save: Option<WorldDef>,
... | Rust | 0 |
match node
.children()
.find(|n| n.has_tag_name("name"))
.and_then(|n| n.text())
{
Some(name) => TypeName::new(name),
_ => panic!("Handle has no name: {:?}", node),
};
let... | Rust | 0 |
import numpy as np
from skrobot.coordinates import Coordinates
from skrobot.model.primitives import Box
from plainmp.constraint import EqCompositeCst, IneqCompositeCst
from plainmp.ik import solve_ik
from plainmp.manifold_rrt.manifold_rrt_solver import ManiRRTConfig, ManiRRTConnectSolver
from plainmp.problem import Pr... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 Xanadu Quantum Technologies Inc.
# 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... | Python | 1 |
* 1 * 2 * 3
}
// ------ Nan ------------------------------------------------------------------
#[test]
fn nan_testing() {
let defs = &Definitions::new();
let nan = Ok(Value::Num(std::f64::NAN.into()));
let x = process_w_num("+ nan", defs);
assert_eq!(x, nan);
let x = process_w_num("- nan", defs);
... | Rust | 0 |
alladssembed.set_author(name="樂府特殊事件")
# choice1
balladssclose1 = discord.Embed(title="演出決策",description="➤你決定親赴軍營勞軍。為激勵士氣,你親自登台舞劍,動作俐落,劍光如虹。老將們頻頻點頭,你也從排練中獲得不少啟發,武藝大有精進。",color=discord.Color.purple())
balladssclose1.add_field(name=" ",value="------------------... | Python | 1 |
#!/usr/bin/env python
# coding: utf-8
# %%
# # Graphics: Other Plots
#
# This lesson covers:
#
# * Histograms
# * Scatter Plots
# %%
# Plotting in notebooks requires using a magic command, which starts with `%`,
# to initialize the plotting backend.
# %%
# Setup
import matplotlib.pyplot as plt
plt.rc("figure", figs... | Python | 1 |
}
// Adds YaSerialize and YaDeserialize implementations for types that support FromStr and Display traits.
#[proc_macro_derive(UtilsDefaultSerde)]
pub fn default_serde(input: TokenStream) -> TokenStream {
let ast = parse_macro_input!(input as DeriveInput);
let struct_name = &ast.ident;
let struct_name_li... | Rust | 0 |
70de5b6f19ff9a0a".into()),
start_time: Seconds(1_478_293_361.271),
trace_id: TraceId::Rendered("1-581cf771-a006649127e371903a2de979".into()),
end_time: Some(Seconds(1_478_293_361.449)),
..Segment::default()
})
.expect("failed to ser... | Rust | 0 |
these products result in a Versor.
//Ideally, we'd have some sort of thing that could selectively pick either a Rotor or
//Reflector, but that gets.... messy. The trait bounds would get a little crazy and
//honestly it's a little bit easier to work with if the Output type is the same no matter
... | Rust | 0 |
import idaapi
import idautils
import idc
def find_pool_tags():
"""
Dirty hack around IDA's type information, find references to tag using functions then the comment marking the tag
then add the function caller/tag to output dictionary.
"""
funcs = [
"ExAllocatePoolWithTag",
"ExFre... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
class L10nCoDocumentType(models.Model):
_inherit = "l10n_latam.identification.type"
l10n_co_document_code = fields.Char("Document Code")
| Python | 1 |
c!["cn=123"],
ResolveResult::False(vec![], Expression::Empty(false)),
);
}
#[test]
fn resolve_less_float() {
let f = "(cn<123.56)";
// test positive
run_resolve_test(f, &vec!["cn=122.674"], ResolveResult::True);
// test negative
run_resolve_test(
f,
&vec!["cn=126"],
... | Rust | 0 |
on package
metadata.( R R R ( ( ( s_ /private/var/folders/vy/31wknkcs30l6xb2fzgwnrkh80000gn/T/pip-build-H4rTmN/pip/pip/exceptions.pyRE s N( R t
__future__R t itertoolsR R R t pip._vendor.sixR t ExceptionR R R
R R R
R R R R... | Python | 1 |
for optional deps'")
.default_value("black")
.possible_values(&COLORS),
Arg::from_usage("--optional-shape [SHAPE] 'Shape for optional deps'")
.default_value("round")
.possible_values(&DEP_SHAPES),
... | Rust | 0 |
d_x.depth_or_array_layers,
);
});
wgpu_profiler!("compose & render", profiler, &mut cpass, device, {
const LOCAL_SIZE_COMPOSE: wgpu::Extent3d = wgpu::Extent3d {
width: 32,
height: 32,
depth_or_array_laye... | Rust | 0 |
&Context::err(&conn, "Couldn't delete task.")))
}
}
#[get("/")]
fn index(msg: Option<FlashMessage>, conn: DbConn) -> Template {
Template::render("index", &match msg {
Some(ref msg) => Context::raw(&conn, Some((msg.name(), msg.msg()))),
None => Context::raw(&conn, None),
})
}
fn rocket() -... | Rust | 0 |
vantage(batch,
adv_estimator=self.config.algorithm.adv_estimator,
gamma=self.config.algorithm.gamma,
lam=self.config.algorithm.lam,
... | Python | 1 |
[key] = json!(state);
diff[soul][METADATA][STATE][key] = json!(state);
}
}
diff
}
<gh_stars>0
use std::env;
use std::process;
use minigrep::Config;
fn main() {
// `unwrap_or_else` behaves similarly to `unwrap`
// if the `Result` is an `Ok` value, it returns the inner value `Ok` is wrapping
// i... | Rust | 0 |
ress,
should_interrupt: &AtomicBool,
object_hash: git::hash::Kind,
) -> anyhow::Result<()> {
let mut out = BufWriter::new(git::lock::File::acquire_to_update_resource(
output_path,
git::lock::acquire::Fail::Immediately,
None,
)?);
git::odb::pack::multi_index::File::write_from_... | Rust | 0 |
CoreJweKeyManagementAlgorithm::RsaPkcs1V15,
CoreJweKeyManagementAlgorithm::RsaOaep,
CoreJweKeyManagementAlgorithm::RsaOaepSha256,
CoreJweKeyManagementAlgorithm::AesKeyWrap128,
CoreJweKeyManagementAlgorithm::AesKeyWrap192,
CoreJweKeyManagementAlgori... | Rust | 0 |
), Box<dyn Error>> {
// Setup and initialize the env_logger.
let env = env_logger::Env::default()
.filter_or("SOUNDSENSE_RS_LOG", "warn")
.write_style_or("SOUNDSENSE_RS_LOG_STYLE", "always");
env_logger::Builder::from_env(env)
.format_module_path(false)
.format_timestamp_mill... | Rust | 0 |
attrs={'property': 'og:description'})
if meta_description and meta_description.get('content'):
links.append(meta_description['content'])
if og_description and og_description.get('content'):
links.append(og_description['content'])
matches = re.findall(r'<p class="config".*?>(.*?... | Python | 1 |
ut_image = Image_Data()
out_image.Init_From_Itk(conn_out)
array = out_image.Get_Data()
a = np.bincount(array.flatten())
a[0] = 0
a_list = list(a)
t = a_list.index(max(a))
array[array != t] = 0
array[array == t] = 255
out_image.Init_From_Numpy_array... | Python | 1 |
let max_p = bottom_p - HectoPascal(50.0);
match itertools::izip!(ps, zs, ts, dps)
// Filter out levels with missing data
.filter(|(p, z, t, dp)| p.is_some() && z.is_some() && t.is_some() && dp.is_some())
// Unpack from the optional::Optioned type
.map(|(p, z, t, dp)| (p.unpack(), z... | Rust | 0 |
positions = t_origins + t_dirs * (t_starts + t_ends) / 2.0
if timestamps is not None:
# dnerf
t = (
timestamps[ray_indices]
if radiance_field.training
else timestamps.expand_as(positions[:, :1])
)
return radiance_fi... | Python | 1 |
find_toc() {
let mut data_toc: Vec<u8> = Vec::new();
data_toc.extend_from_slice(&[0x0A, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0x7F]); // 10-11
data_toc.extend_from_slice(&[0x0C, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0xFF, 0xFF,
... | Rust | 0 |
k_and_sweep<'a>(
&mut self,
roots: impl Iterator<Item = &'a SteelVal>,
function_stack: impl Iterator<Item = &'a Gc<ByteCodeLambda>>,
) {
// mark
for root in roots {
traverse(root);
}
for function in function_stack {
for upvalue in func... | Rust | 0 |
}
```
"""
url = route.FBA_INVENTORY_ADJUSTMENTS
# 解析并验证参数
args = {
"start_date": start_date,
"end_date": end_date,
"sids": sids,
"search_field": search_field,
"search_value": search_value,
"offset": off... | Python | 1 |
# Copyright 2021 OROCA
#
# 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 law or agreed to in writing, softwa... | Python | 1 |
he_cipher: he::PaillierParallel::new(),
ec_key: gen_scalar(),
self_num_features: Arc::new(RwLock::default()),
self_num_records: Arc::new(RwLock::default()),
plaintext_features: Arc::new(RwLock::default()),
plaintext_keys: Arc::new(RwLock::default()),
... | Rust | 0 |
er y value of gripper starting position (leave empty for default == {init_y}): ")
if y_val == "":
y_val = init_y
z_val = input(f"Enter z value of gripper starting position (leave empty for default == {init_z}): ")
if z_val == "":
z_... | Python | 1 |
"{-}
{{ yes }} || {{ yes }} = {{ yes || yes }}
{{ yes }} || {{ no }} = {{ yes || no }}
{{ no }} || {{ yes }} = {{ no || yes }}
{{ no }} || {{ no }} = {{ no || no }}
{{ yes }} && {{ yes }} = {{ yes && yes }}
{{ yes }} && {{ no }} = {{ yes && no }}
{{ no }} && {{ yes }} = {{ no && yes }}
{{ no }} && {{ no }} = {{ no && ... | Rust | 0 |
MAP => sys_mmap(args[0], args[1], args[2], args[3], args[4], args[5]),
// 10
SYS_MPROTECT => sys_mprotect(args[0], args[1], args[2]),
SYS_MUNMAP => sys_munmap(args[0], args[1]),
SYS_BRK => {
warn!("sys_brk is unimplemented, return -1");
Err(SysError::ENOMEM)
... | Rust | 0 |
ter()
))
.collect::<Vec<IndexInfo>>(),
vec![IndexInfo {
unique: false,
name: "idx_location".to_owned(),
parts: vec![IndexPart {
column: "location".to_owned(),
order: IndexOrder::Ascending,
... | Rust | 0 |
medTemporaryFile(delete=False, mode="w", suffix=".sh")
temp_file.write(bash_script_content)
temp_file.close()
# Make the script executable
os.chmod(temp_file.name, 0o755)
yield temp_file.name # Return the path to the temporary script
# Cleanup: Delete the temporary sc... | Python | 1 |
(
device: RTCDevice,
error: RTCErrorFunction,
userPtr: *mut ::std::os::raw::c_void,
);
}
pub type RTCMemoryMonitorFunction = ::std::option::Option<
unsafe extern "C" fn(ptr: *mut ::std::os::raw::c_void, bytes: isize, post: bool) -> bool,
>;
extern "C" {
pub fn rtcSetDeviceMemoryMonit... | Rust | 0 |
sage: random_ternaryqf() # random
Ternary quadratic form with integer coefficients:
[1 1 4]
[-1 1 -1]
sage: random_ternaryqf([-1, 2]) # random
Ternary quadratic form with integer coefficients:
[1 0 1]
[-1 -1 -1]
sage: random_ternaryqf([-10, 10, "uniform"... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A股量化交易示例脚本 - 简化版,不依赖TA-Lib
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import akshare as ak
import datetime
import os
def get_stock_data(stock_code, start_date, end_date):
"""获取股票数据"""
try:
# 使用AKShare获取股票数据
stoc... | Python | 1 |
"CreateCustAcctId返回参数结构体
"""
def __init__(self):
r"""
:param _SubAcctNo: STRING(50),见证子账户的账号(平台需要记录下来,后续所有接口交互都会用到)
注意:此字段可能返回 null,表示取不到有效值。
:type SubAcctNo: str
:param _ReservedMsg: STRING(1027),保留域(需要开通智能收款,此处返回智能收款账号,正常情况下返回空)
注意:此字段可能返回 null,表示取不到有效值。
:type Reserve... | Python | 1 |
s.path.exists(exe)
try:
o = subprocess.check_output([f"{os.path.realpath(exe)}"], stdin=subprocess.DEVNULL, text=True, encoding="utf-8").splitlines()[-1]
finally:
if os.path.exists(exe):
os.remove(exe)
if ctx.verbose:
print(f"result = {o}")
val = fix_val(o, ctx.type_)
assert val is not None
ctx.res.ap... | Python | 1 |
"layout",
"lens",
"list",
"multiwin",
"panels",
"parse",
"scroll_colors",
"scroll",
"split_demo",
"styled_text",
//"svg", // usvg doesn't compile on usvg at the time of this writing
"switches",
"timer",
"view_switcher",
];
fn main() -> Result<()> {
let crate_di... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.