text string | label_name string | labels int64 |
|---|---|---|
import reacton.ipyvuetify as v
from typing import Optional, Union, Callable, Tuple, Dict
import nextpy.interfaces.jupyter as widget
@widget.component
def textarea(
label: Optional[str] = None,
value: str = "",
max_chars: Optional[int] = None,
key: Optional[Union[str, int]] = None,
type: str = "defa... | Python | 1 |
from typing import Set, List
from common.exception import NotFoundUserException, AuthException
from common.utilities.util_logger import Log
import importlib
from i18n import t__access
from cacheout import Cache
cache = Cache()
logger = Log.get_logger(__name__)
@cache.memoize(ttl=5)
class MenuAccess:
def get_use... | Python | 1 |
>`"]
pub type INT_RAM_MBE = crate::Reg<int_ram_mbe::INT_RAM_MBE_SPEC>;
#[doc = "Internal Memory RAM MBE Interrupt Redirect Selection"]
pub mod int_ram_mbe;
#[doc = "INT_ROM_SBE register accessor: an alias for `Reg<INT_ROM_SBE_SPEC>`"]
pub type INT_ROM_SBE = crate::Reg<int_rom_sbe::INT_ROM_SBE_SPEC>;
#[doc = "Internal M... | Rust | 0 |
one
};
let loc = match value {
Some(ref value) => key.span().union(value.span()),
None => key.span()
};
Ok(Located::new(Attribute {
key: key,
value: value
}, loc))
}
}
impl Parsable for AttributeValue {
fn parse<L>(lexer: &mut Peekable<L>) -> Result<Located<AttributeValue>> where L: Iterator<... | Rust | 0 |
(p[1]) + Self::STRIDES[2].wrapping_mul(p[2])
}
#[inline]
fn delinearize(mut i: $scalar) -> [$scalar; 3] {
let z = i / Self::STRIDES[2];
i -= z * Self::STRIDES[2];
let y = i / Self::STRIDES[1];
let x = i % Self::STRIDES[... | Rust | 0 |
ound to 48.86696
longitude=2.310142, # round to 2.31014
)
assert len(result2) == 1
assert result2[0] == address
def test_multiple_address_found(self):
address = factories.AddressFactory(
banId="75101_8635_00182",
postalCode="75001",
c... | Python | 1 |
_ref.clone(),
})?;
let target_url = graph.check_schema.target_url;
let diff_to_previous = graph.check_schema.diff_to_previous;
let operation_check_count = diff_to_previous.number_of_checked_operations.unwrap_or(0) as u64;
let result = diff_to_previous.severity.into();
let mut changes = Vec::w... | Rust | 0 |
args("write(a), write(b), false.\n\
halt.\n\
",
"ab false.\n")
}
/*
// issue #812
#[test] // FIXME: the line number is of by one (should be 4), empty line not accounted for or starting to count at line 0?
fn singleton_warn... | Rust | 0 |
#[derive(Clone, Debug, Eq, PartialEq)]
struct AKAIndexRecord {
id: Vec<u8>,
offset: u64,
count: u64,
}
/// A streaming iterator over indexable AKA records.
///
/// Each indexable record is a triple, and consists of an IMDb title ID,
/// the number of alternate titles for that title, and the file offset in... | Rust | 0 |
let mut content_length: Option<usize> = None;
loop {
buffer.clear();
let _result = reader.read_line(&mut buffer);
// eprin
match &buffer {
s if s.trim().is_empty() => break,
s => {
match parse_header(s)? {
LspHeader::C... | Rust | 0 |
n(batch, model):
return _predict_base(batch, model)
def _predict_rm(batch, model):
return _predict_base(batch, model)
def _predict_rnn(batch, model):
batch_size, n_features, window_size = batch['Y'].shape
Y, Y_hat, mask = model.forward(batch)
Y, Y_hat, mask = Y.detach().cpu().numpy(), Y_hat.deta... | Python | 1 |
locate the default storage locations for the
/// platform it looks in, as documented in the `filesystem`
/// module. You can also always debug-print the
/// `Context::filesystem` field to see what paths it is
/// searching.
#[deprecated]
pub fn load_from_conf(
game_id: &'static str,
... | Rust | 0 |
<E>, true_val: Q, false_val: Q) -> Q
where
E: MpcEngine<Share = T>,
Q: WrappedShare<Item = T>,
{
let delta = true_val.raw() - false_val.raw();
Q::wrap(false_val.raw() + mul(ctx, delta, self.0).await)
}
/// Returns (x, y) if self is 0, or (y, x) if self is 1.
pub asyn... | Rust | 0 |
ge_size) * page_size;
// Allocate new `rwx` memory segment.
let ptr = unsafe {
mmap(
std::ptr::null_mut(),
len,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_ANONYMOUS,
-1, /* fd */
0, /... | Rust | 0 |
=> {
$(
poly_from_expr_tests!($case: $expr, None => $expected);
)*
};
($($case:ident: $expr:expr, $relative:expr => $expected:expr)*) => {
$(
#[test]
fn $case() {
let expr = parse_expr!($expr);
let relative: Opt... | Rust | 0 |
.collect()
}
#[cfg(test)]
mod tests {
use super::*;
use crate::apkg_col::APKG_COL;
use crate::apkg_schema::APKG_SCHEMA;
use crate::{Field, Model, Note, Template};
use rusqlite::Connection;
use std::time::{SystemTime, UNIX_EPOCH};
use tempfile::{NamedTempFile, TempPath};
fn write_to_db_... | Rust | 0 |
#[doc = "Checks if the value of the field is `VALUE2`"]
#[inline(always)]
pub fn is_value2(&self) -> bool {
**self == H2STE_A::VALUE2
}
}
impl core::ops::Deref for H2STE_R {
type Target = crate::FieldReader<bool, H2STE_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
... | Rust | 0 |
targets.add((urldecode(url, kb.pageEncoding), None, None, None, None))
if kb.targets:
if kb.normalizeCrawlingChoice is None:
message = "do you want to normalize "
message += "crawling results [Y/n] "
kb.normalizeCrawlingChoice = readInput(message, de... | Python | 1 |
utput.len() && !self.buf.is_empty()
{
output[i] = self.buf.pop_front().unwrap();
i += 1;
}
Ok(i as usize)
}
}
pub fn TESTONLY_buflen(&self) -> usize { self.buf.len() }
pub fn TESTONLY_schedule_feed_accepts(&mut self, sizes: &[usize]... | Rust | 0 |
repository.
basedir = Path(__file__).resolve().parents[1]
# `LOCALE_DIR` from `config.mk`.
localedir = basedir / "docs" / "locale"
language = app.config.overrides.get("language", "en")
headers = ["Title", "Description", "Extension"]
# The gettext domain for schema translations. Should match th... | Python | 1 |
# this is a Python2 version of the code in readme.py
from twisted.internet.task import react
from twisted.internet.defer import inlineCallbacks
from twisted.internet.endpoints import UNIXClientEndpoint
import treq
import txtorcon
@react
@inlineCallbacks
def main(reactor):
tor = yield txtorcon.connect(
rea... | Python | 1 |
Alias(
alias="session_duration",
expr=ast.Call(
name="sumMerge",
args=[ast.Field(chain=["total_session_duration_state"])],
),
)
elif metric == WebTrendsMetric.TOTAL_SESSIONS:
return ast.Alias(
... | Python | 1 |
active_region_permutations.append(current_region_permutation)
object_mesh.data.region_add(current_region_permutation)
if not ngon_material_index == -1:
material_name = mat.name
if Surfa... | Python | 1 |
import numpy as np
import scipy.stats as si
import pandas as pd
from sklearn.metrics import r2_score
risk_free_rate = 0.0423
def black_scholes_call(S, X, T, r, sigma):
"""
Calculate the Black-Scholes call option price.
Parameters:
S (float): Current stock price
X (float): Strike price
T (floa... | Python | 1 |
source_list = [phi_s, softmax_layer(y_hat)]
target_list = [phi_t, softmax_layer(y_t_hat)]
batch_size = int(phi_s.size()[0])
joint_kernels = None
for source, target, k_mul, k_num, sigma in zip(
source_list, target_list, self._kernel_mul, self._kernel_num, [None, 1.68]
... | Python | 1 |
as u8,
TcpFlag::Syn => ffi::tcp::TH_SYN as u8,
TcpFlag::Rst => ffi::tcp::TH_RST as u8,
TcpFlag::Psh => ffi::tcp::TH_PSH as u8,
TcpFlag::Ack => ffi::tcp::TH_ACK as u8,
TcpFlag::Urg => ffi::tcp::TH_URG as u8,
TcpFlag::Ece => ffi::tcp::TH_ECE as u8,
... | Rust | 0 |
Option<i32>,
}
impl RObject for ConnectionStateUpdating {
#[doc(hidden)]
fn extra(&self) -> Option<&str> {
self.extra.as_deref()
}
#[doc(hidden)]
fn client_id(&self) -> Option<i32> {
self.client_id
}
}
impl TDConnectionState for ConnectionStateUpdating {}
impl ConnectionState... | Rust | 0 |
from .def_json_formatter import DefJsonFormatter
from .inst_cfg_formatter import InstCfgFormatter
__all__ = ["DefJsonFormatter", "InstCfgFormatter"] | Python | 1 |
x = str("Hello World")
#display x:
print(x)
#display the data type of x:
print(type(x))
x = int(20)
#display x:
print(x)
#display the data type of x:
print(type(x))
| Python | 1 |
{
($name:ident, $bytes:expr) => {
key_eq_value! { $name, $bytes, b"KEY", b"VALUE" }
};
($name:ident, $bytes:expr, $key:expr, $value:expr) => {
#[test]
fn $name() -> Result<()> {
let mut tkv = TaggedAttributes::from_bytes($bytes);
... | Rust | 0 |
elle",
"cat123",
"amarillo",
"yadira",
"qwaszx",
"perros",
"jaypee",
"hacker",
"yahooo",
"soccer2",
"louise1",
"jericho",
"jackie1",
"domingo",
"derek",
"clarence",
"benjie",
"55555555",
"megaman",
"dallas1",
"daddyyankee",
"cutiepie1",... | Rust | 0 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import copy
from dynamic_stereo.models.dynamic_stereo_model import DynamicStereoModel
from pytorch3d.implicitron.tools.co... | Python | 1 |
###############################################################################
#
# OpenEduCat Inc
# Copyright (C) 2009-TODAY OpenEduCat Inc(<https://www.openeducat.org>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License a... | Python | 1 |
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from users.views import users
router = DefaultRouter()
router.register(r'search', users.UserListSearchView, 'users-search')
urlpatterns = [
path('users/reg/', users.RegistrationView.as_view(), name='reg'),
path('users/me... | Python | 1 |
file
#[structopt(long = "output", short = "o")]
output: Option<String>,
/// Show the list of functions with the largest internal counts
#[structopt(long = "topn")]
topn: Option<usize>,
/// Set the count value cutoff. Functions with the maximum count less than
/// this value will not be prin... | Rust | 0 |
Bif::StartedBy => bif_started_by(parameters),
Bif::Starts => bif_starts(parameters),
Bif::StartsWith => bif_starts_with(parameters),
Bif::Stddev => bif_stddev(parameters),
Bif::String => bif_string(parameters),
Bif::StringLength => bif_string_length(parameters),
Bif::Sublist => bif_sublist(para... | Rust | 0 |
::new();
vec.extend(0..n);
vec
});
}
fn gen_from_iter<V: Vector<u64>>(n: u64, b: &mut Bencher) {
let v: Vec<u64> = (0..n).collect();
b.iter(|| {
let vec = V::from(&v);
vec
});
}
fn gen_from_slice<V: Vector<u64>>(n: u64, b: &mut Bencher) {
let v: Vec<u64> = (0..n).co... | Rust | 0 |
as u32).map_or_else(
|| error_invalid_bitshift(outer, inner),
|n| Ok(Cow::Owned(Value::from(n))),
),
_ => error_invalid_binary(outer, inner, op, lhs, rhs),
}
} else if let (Some(l), Some(r)) = (lhs.cast_f64(), rhs.cast_f64()) {
match op {
... | Rust | 0 |
_base_ = [
'../_base_/models/san_vit-b16.py',
'../_base_/datasets/pascal_voc12_aug.py', '../_base_/default_runtime.py',
'../_base_/schedules/schedule_160k.py'
]
crop_size = (640, 640)
metainfo = dict(
classes=('aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car',
'cat', 'chair', ... | Python | 1 |
{
let conn = conn.clone();
thread::spawn(move || {
let mut blink = false;
loop {
let title = if blink { "Basic Threaded Window ;-)" }
else { "Basic Threaded Window :-)" };
let c = xcb::change_property_checked(&conn, xcb::PROP_MODE_... | Rust | 0 |
service_handle: self.handle,
characteristic_handle: self.motion_char.handle,
offset: 0,
value: binary_motion_data.as_slice(),
};
rc.update_characteristic_value(¶ms)
.map_err(|_| nb::Error::Oth... | Rust | 0 |
4,
])
),
field_new!(
Fq,
BigInteger([
0x57ec31b05ef70e9c,
0x4b273803cb8a715d,
0xf0443627811cbe40,
0x485f10c72ec590f1,
0x66a35e7875569c25,
0xdb621dfd9498071a,
... | Rust | 0 |
atrix()
oIdx = tensor.lmatrix()
o = sparse_block_dot(W, h, iIdx, b, oIdx)
f = theano.function([W, h, iIdx, b, oIdx], [o, tensor.grad(o.sum(),
wrt=W)],
mode=mode_with_gpu)
assert sum(1 for n in f.maker.fgraph.apply_... | Python | 1 |
: "OtherStudyNumbers", vr: IS }, // RET (2004)
E { tag: Single(Tag(0x0020, 0x1200)), alias: "NumberOfPatientRelatedStudies", vr: IS },
E { tag: Single(Tag(0x0020, 0x1202)), alias: "NumberOfPatientRelatedSeries", vr: IS },
E { tag: Single(Tag(0x0020, 0x1204)), alias: "NumberOfPatientRelatedInstances", vr: IS... | Rust | 0 |
4.804, 28.302, 43.295, 50.363, 70.542, 55.132, 79.985, 70.779, 78.772, 100.383, 115.705, 84.389, 118.964, 135.08, 118.264, 122.099, 122.102, 120.406, 118.547, 119.27]]
# print(GA(option_name, sample_list, cp_type, se_type, perf_list))
vars = []
cptype = []
with open("./ndp_predictions.txt", "r", encodi... | Python | 1 |
# -*- coding: utf-8 -*-
from odoo import fields, models, api
class HrEmployeeInherit(models.Model):
_inherit = 'hr.employee'
_description = "Human Resource"
education_ids = fields.One2many('employee.education', 'employee_id', string='Education')
# Your Python code (e.g., in a controller or model)
clas... | Python | 1 |
15", b"%16", b"%17",
b"%18", b"%19", b"%1a", b"%1b", b"%1c", b"%1d", b"%1e", b"%1f",
// b'-' b'.'
b"%20", b"%21", b"%22", b"%23", b"%24", b"%25", b"%26", b"%27", b"%28", b"%29", b"%2a"... | Rust | 0 |
from abaqusConstants import *
from .Inertia import Inertia
from ..Region.Region import Region
class HeatCapacitance(Inertia):
"""The HeatCapacitance object defines point heat capacitance on a part or an assembly
region.
The HeatCapacitance object is derived from the Inertia object.
Attributes
---... | Python | 1 |
c - Shifter Configuration N Register"]
pub shiftcfg3: SHIFTCFG3,
_reserved4: [u8; 240usize],
#[doc = "0x200 - Shifter Buffer N Register"]
pub shiftbuf0: SHIFTBUF0,
#[doc = "0x204 - Shifter Buffer N Register"]
pub shiftbuf1: SHIFTBUF1,
#[doc = "0x208 - Shifter Buffer N Register"]
pub shif... | Rust | 0 |
proof: None,
account: object.object,
};
let parsed = ton_block_json::db_serialize_account_ex(
"id",
&set,
ton_block_json::SerializationMode::QServer,
)
.map_err(|err| Error::serialization_error(err, "account"))?;
Ok(ResultOfParse {
parsed: parsed.into(),... | Rust | 0 |
import pygame
import sys
def main():
# Inicializa o Pygame
pygame.init()
# Inicializa os joysticks
pygame.joystick.init()
# Verifica se há joysticks conectados
joystick_count = pygame.joystick.get_count()
if joystick_count == 0:
print("Nenhum controle conectado.")
pygame.q... | Python | 1 |
n_if_stmt(False))
@test_util.run_deprecated_v1
def test_tensor_multiple_returns(self):
with self.cached_session():
t = self.multi_return_if_stmt(constant_op.constant(True))
self.assertAllEqual([1, 2], self.evaluate(t))
t = self.multi_return_if_stmt(constant_op.constant(False))
self.asse... | Python | 1 |
uence::{preceded, terminated},
IResult,
};
use crate::generator::{GeneratorFunc, Generator};
use crate::generator::generators::{Sequence, UUID, CurrentDateTime, RandomString, RandomInt, RandomFromFile, RandomFromList, RandomArray, RandomBool};
use crate::parser::{func, args_string, args, str_to_int, sp, GenError};
... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#- HalftoneCluster - Nitrofurano - 0806241812 - GPL2 licence - (thanks DanielPC help)
from gimpfu import *
def python_filter(img,layer):
region=layer.get_pixel_rgn(0,0,img.width,img.height,True,False);
clust=[[0,6,8,14],[2,12,4,10],[8,14,0,6],[4,10,2,12]]
clidx=[0x000... | Python | 1 |
ori" }
]
}))
});
app.listen("127.0.0.1:8080").await?;
Ok(())
})
}
<reponame>avrabe/rustbus<filename>rustbus/examples/user_defined_types.rs<gh_stars>0
use rustbus::signature;
use rustbus::wire::marshal::MarshalContext;
use rustbus::Marshal;
use rustbus::Signature;... | Rust | 0 |
".to_string(),
"ping".to_string(),
"identify".to_string(),
],
},
remote_addr,
);
*self.identify_send_back.lock() = Some(sender);
}
}
pub struct CITANodeHandler<Substream> {
/// Substream open for custom protocol
... | Rust | 0 |
from rest_framework.response import Response
from rest_framework import status
from rest_framework.decorators import api_view
from .models import Pharmacy
from .serializers import PharmacySerializer, PharmacyAddSerializer
# Create a new pharmacy record
@api_view(['POST'])
def create_pharmacy(request):
serializer ... | Python | 1 |
entropy_mask = loss.Entropy(softmax_out[non_mask]).mean()
softmax_mean = torch.clamp(softmax_out[non_mask].mean(dim=0), min=args.epsilon)
softmax_log_term = (-softmax_mean * torch.log(softmax_mean + args.epsilon)).sum()
else:
entropy_mask = 0.0
softmax_log_term =... | Python | 1 |
356 as u128) * day;
let constants = to_vec(&Constants {
name: "3SHARE Token".to_string(),
symbol: "3SHARES".to_string(),
decimals: 18,
ether,
day,
FARMING_POOL_REWARD_ALLOCATION,
COMMUNITY_FUND_POOL_ALLOCATION,
DEV_FUND_POOL_ALLOCATION,
VESTIN... | Rust | 0 |
"`*"]
pub const LVM_GETOUTLINECOLOR: u32 = 4272u32;
#[doc = "*Required features: `\"Win32_UI_Controls\"`*"]
pub const LVM_GETSELECTEDCOLUMN: u32 = 4270u32;
#[doc = "*Required features: `\"Win32_UI_Controls\"`*"]
pub const LVM_GETSELECTEDCOUNT: u32 = 4146u32;
#[doc = "*Required features: `\"Win32_UI_Controls\"`*"]
pub c... | Rust | 0 |
&'a DpmFileRef<'a>) -> Result<Ax> {
let buffer = if ax.file.encryption_key.is_some() {
crypt::decrypt(&ax.data)?
} else {
ax.data.clone()
};
bytes_to_ax(buffer)
}
pub fn bytes_to_ax(buffer: Vec<u8>) -> Result<Ax> {
let mut stream = Cursor::new(&buffer);
let mut header = [0; 4... | Rust | 0 |
import os
import json
import torch
import numpy as np
import hifigan
from model import FastSpeech2, ScheduledOptim
def get_model(args, configs, device, train=False):
(preprocess_config, model_config, train_config) = configs
model = FastSpeech2(preprocess_config, model_config).to(device)
if args.restore... | Python | 1 |
}
),*
]
}
),*
]
}
};
}
static EXPECTED: &str = concat!(
"Example { _indexes: [], _counts: [2, 4, 13], _nested: [",
concat!(
"Example { _indexes: [(0, 2)], _counts: [3, 10], _nested: [",
concat!(
... | Rust | 0 |
1.clone()),
]);
let hash1b = hash1;
assert_eq!(hb1.compute_root_hash(), hash1);
let mut stream0 = RlpStream::new_list(2);
let path0 = encode_path(unpack_nibbles(&key0[1..]).as_slice(), true);
stream0.append(&path0);
stream0.append(&val0);
let entry0 = str... | Rust | 0 |
from django.contrib import admin
from .models import (
Activity,
Ambassador,
AmbassadorAchieve,
AmbassadorActivity,
AmbassadorGoal,
AmbassadorProgram,
AmbassadorStatus,
AmbassadorStatusHistory,
Goal,
)
class AmbassadorProgramInline(admin.TabularInline):
model = AmbassadorProgr... | Python | 1 |
hs = [_convert_mol(m, self.molecule_format, self.converter) for m in mols]
else:
func = partial(_convert_mol, molecule_format=self.molecule_format, converter=self.converter)
graphs = self.pool.map(func, mols)
return graphs
def create_cached_generator(self) -> GraphBatchGener... | Python | 1 |
core: float, style_score: float) -> List[str]:
"""Generate detailed feedback for code"""
feedback = []
if syntax_score < 100:
feedback.append("❌ Syntax Error: Please check your code syntax")
if logic_score < 70:
feedback.append("⚠️ Logic Issues: Consider ... | Python | 1 |
();
//!
//! let (duty1, duty2) = (core::u16::MAX / 4, core::u16::MAX / 2);
//! let mut ctrl = sm2.control(&mut pwm2.handle);
//!
//! ctrl.enable(Channel::A);
//! ctrl.enable(Channel::B);
//! ctrl.set_duty(Channel::A, duty1);
//! ctrl.set_duty(Channel::B, duty2);
//! ```
use crate::ccm;
use crate::iomuxc::pwm::Pin;
pub... | Rust | 0 |
The number to be rounded."]
#[doc = ""]
#[doc = " @return:"]
#[doc = " `a` rounded to the nearest 16.16 fixed integer, halfway cases away"]
#[doc = " from zero."]
#[doc = ""]
#[doc = " @note:"]
#[doc = " The function uses wrap-around arithmetic."]
pub fn FT_RoundFix(a: FT_Fixed) -... | Rust | 0 |
ck<<Link as HasLink>::Rel>>::from(link))?
.mask(<&NBytes<F::CapacitySize>>::from(s.arr()))?
.absorb(<&Fallback<<LS as LinkStore<F, <Link as HasLink>::Rel>>::Info>>::from(
info,
))?;
}
ctx.absorb(repeated_keys)?;
for (id, cursor... | Rust | 0 |
condition evaluated false. This branch is the default:
println!("Did not match Some(i) and foo == false");
}
// If let can be used with Enums too
enum Color{
Red,
Green,
Blue
}
let my_color = Color::Green;
if let Color::Red = my_color {
println!("Red!"... | Rust | 0 |
headers = {"Platform": "open_platform", "Content-Type": "application/json"}
session = await session_manager.get_session()
async with session.post(url, data=payload, headers=headers, timeout=30) as response:
response.raise_for_status()
return await response.json()
... | Python | 1 |
tring::from("pdf")],
vec![
String::from("js"),
String::from("php"),
String::from("pdf"),
String::from("tar.gz"),
],
];
let base = Url::parse("http://localhost/turbo").unwrap();
let js = Url::parse("http://lo... | Rust | 0 |
(uu_truncate);
<filename>positional-parser/src/main.rs
#[macro_use]
extern crate serde_derive;
extern crate serde_yaml;
mod positional_parser;
fn print_usage() {
println!("positional-parser <SCHEMA_FILE> <DATA_FILE>");
}
fn main() {
let args: Vec<String> = std::env::args().collect();
if args.len() != 3 ... | Rust | 0 |
from pocketflow import Flow
from nodes import DecideAction, SearchWeb, AnswerQuestion
def create_agent_flow():
"""
Create and connect the nodes to form a complete agent flow.
The flow works like this:
1. DecideAction node decides whether to search or answer
2. If search, go to SearchWeb node
... | Python | 1 |
st _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( TPML_HANDLE ) , "::" ,
stringify ! ( handle ) ));
}
impl Default for TPML_HANDLE {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
#[repr(C)]
#[derive(Copy)]
pub struct TPML_DIGEST... | Rust | 0 |
if st.checkbox(
page_name,
value=checked,
key=f"nav_checkbox_{page_path}",
disabled=checked # Desabilita o checkbox da página atual
):
if Path(page_path).exists():
... | Python | 1 |
we can do the equivalent of
// fp_to_float(big_to_fp(u)) here, only without the double rounding.
u = f.clone();
u.mul_pow5(e_abs).mul_pow2(e_abs);
v = Big::from_small(1);
}
quick_start::<T>(&mut u, &mut v, &mut k);
let mut rem = Big::from_small(0);
let mut x = Big::from_... | Rust | 0 |
from openai import OpenAI
from typing import List, Dict, Any
import numpy as np
print("正在导入必要模块...")
from sklearn.metrics.pairwise import cosine_similarity
print("模块导入完成!")
import os
import json
client = OpenAI(
api_key=os.getenv("OPENAI_API_KEY"),
organization=os.getenv("OPENAI_ORG_ID"), # 可选 OpenAI API 中的组织... | Python | 1 |
f.offset_inc(header.data_size);
Ok(Stdp{
header: header
})
}
}
/**
8.6.1.2
8.6.1.2.1 Decoding Time to Sample Box Definition
Box Type : `stts`
Container: Sample Table Box (‘stbl’)
Mandatory: Yes
Quantity : Exactly one
This box contains a compact version of a table that allows i... | Rust | 0 |
89048;
pub const WL_SHM_FORMAT_XRGB4444: wl_shm_format = 842093144;
pub const WL_SHM_FORMAT_BGR233: wl_shm_format = 944916290;
pub const WL_SHM_FORMAT_RGB332: wl_shm_format = 943867730;
pub const WL_SHM_FORMAT_C8: wl_shm_format = 538982467;
pub const WL_SHM_FORMAT_XRGB8888: wl_shm_format = 1;
pub const WL_SHM_FORMAT_AR... | Rust | 0 |
"""Ejercicio #2: Verificación de paréntesis balanceados. Escriba un programa que
determine si una cadena de texto dada tiene los paréntesis ( ), { }, y [ ] balanceados.
Use una pila para realizar el seguimiento de los paréntesis abiertos."""
from verificador import esta_balanceada
# Función que muestra el menú intera... | Python | 1 |
let mut object = aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
crate::json_ser::serialize_structure_crate_input_tag_resource_input(&mut object, input)?;
object.finish();
Ok(aws_smithy_http::body::SdkBody::from(out))
}
pub fn serialize_operation_crate_operation_untag_resource(
input: ... | Rust | 0 |
<CommunityDatas<T>>::remove(community_data.name.clone());
Self::deposit_event(RawEvent::RemoveCommunity(name_of_community.clone()));
return Ok(());
}
community_data.remove_votes.push(who.clone());
community_data.register_block_number ... | Rust | 0 |
import csv
def export_csv(data: dict, filepath: str):
keys = data.keys()
rows = zip(*data.values())
with open(filepath, "w", newline="", encoding="utf-8") as f:
writer = csv.writer(f)
writer.writerow(keys)
writer.writerows(rows)
| Python | 1 |
generated by the parser are "true" or "false"
///
/// assert_eq!(boolean.parse("true"), Ok(true));
/// assert_eq!(boolean.parse("false"), Ok(false));
/// // Does not panic, because the original parser only accepts "true" or "false"
/// assert!(boolean.parse("42").is_err());
/// ```
fn unwra... | Rust | 0 |
st_imagegrid_cbar_mode_edge():
arr = np.arange(16).reshape((4, 4))
fig = plt.figure(figsize=(18, 9))
positions = (241, 242, 243, 244, 245, 246, 247, 248)
directions = ['row']*4 + ['column']*4
cbar_locations = ['left', 'right', 'top', 'bottom']*2
for position, direction, location in zip(
... | Python | 1 |
import pytest
from common.exceptions import LogicError, PlenumValueError
from plenum.test.helper import create_pre_prepare_no_bls
nodeCount = 4
def test_last_prepared_certificate_in_view(replica):
replica._consensus_data.is_master = False
with pytest.raises(LogicError) as excinfo:
replica._ordering_... | Python | 1 |
' so it doesn't attempt to request an
// interrupt from the isolate.
self.waker.update(|w| w.poll_state = PollState::Dropped);
// V8 automatically deletes all sessions when an `V8Inspector` instance is
// deleted, however InspectorSession also has a drop handler that cleans
// up after itself. To a... | Rust | 0 |
ormatter) -> ::std::fmt::Result {
::protobuf::text_format::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for DebugOptions {
fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef {
::protobuf::reflect::ProtobufValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'s... | Rust | 0 |
: [u8; $nbytes] = [0; $nbytes];
b[0] = ($x & 0xFF) as u8;
for i in 1..$nbytes {
b[i] = (($x & (0xFF << i * 8)) >> i * 8) as u8;
}
b
}
}
}
pub fn le_u32(b: [u8; 4]) -> u32 {
little_endian!(u32, b, 4)
}
pub fn le_u64(b: [u8; 8]) -> u64 {
... | Rust | 0 |
k
rels = nrels
return rels
print(minimize([('R', (0, 1)), ('S', (1, 2))]))
print(minimize([('R', (0, 1)), ('S', (1, 2)), ('T', (2, 0, 3))]))
# %%
def optimize(rels):
# rels is a list of relations (which is itself a pair of (relationId, list of attributes)) [(relId, [attrId1, attrId2, ...]), ...]
... | Python | 1 |
from datetime import datetime
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, Field
from crewai.memory.storage.kickoff_task_outputs_storage import (
KickoffTaskOutputsSQLiteStorage,
)
from crewai.task import Task
"""Handles storage and retrieval of task execution outputs."""
class ... | Python | 1 |
set.frame_at(2).is_err());
// BPP1 ignores palette
set.format_indices(&palette, VeraPixelDepth::BPP1)?;
let mut line_start = 10000;
// assemble 8 BPP
set.format_indices(&palette, VeraPixelDepth::BPP8)?;
println!("{}", set);
let asm = set.assemble(&AsmFormat::Ca65, &mut line_start)?;
println!("{}", asm);
// ... | Rust | 0 |
de,
) {
// Works like in ESLint - by comparing text repr of case statement
let mut seen: HashSet<String> = HashSet::new();
for case in &switch_stmt.cases {
if let Some(test) = &case.test {
let span = test.span();
let test_txt = self.context.source_map.span_to_snippet(span).unwrap();... | Rust | 0 |
entity, Protocol::KeyCommand(key_command)) = event {
if let Ok(mut position) = q_player_position.get_mut(*entity) {
shared_behavior::process_command(key_command, &mut position);
}
}
}
}
<reponame>wpwoodjr/rust-merge-sort<gh_stars>0
// simple-forward-large-slice-swap
... | Rust | 0 |
et _ = ensure_signed(origin)?;
Thing1::<T>::put(val);
Self::deposit_event(Event::ValueSet(1, val));
Ok(().into())
}
/// Sets the second stored value
#[pallet::weight(10_000)]
pub fn set_thing_2(origin: OriginFor<T>, val: u32) -> DispatchResultWithPostInfo {
let _ = ensure_signed(origin)?;
Thi... | Rust | 0 |
metadata = {
'protocolName': 'Lysis Pre-Fill (Salmonella/Listeria)',
'author': 'Chaz <protocols@opentrons.com>',
'source': 'Custom Protocol Request',
'apiLevel': '2.0'
}
def run(protocol):
[lysis, pip_type, pip_mnt, no_plates, tip_no] = get_values( # noqa: F821
'lysis', 'pip_type', 'pip_m... | Python | 1 |
# Copyright (C) 2012 Yahoo! Inc. 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... | Python | 1 |
s))
self.inputs = {'X': x, 'Y': self.real_size}
self.outputs = {'Out': out}
def test_check_output(self):
# NODE(yjjiang11): This op will be deprecated.
self.check_output(check_dygraph=False)
class TestBlockExpandOpCase6(TestBlockExpandOpCase5):
def config(self):
self.b... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.