text string | label_name string | labels int64 |
|---|---|---|
from functools import lru_cache
from typing import Any
from rei_s.config import Config
from rei_s.services.formats.abstract_format_provider import AbstractFormatProvider
# here we need to import all format_providers
from rei_s.services.formats import pdf_provider as pdf_provider
from rei_s.services.formats import mar... | Python | 1 |
import matplotlib.pyplot as mt
import pandas as pd
import seaborn as s
heart=pd.read_csv("heart.csv")
print(heart.head(5)) #top 5 rows
print(heart.tail(5)) #last 5 rows
print(heart.shape) #shape of data set
print(heart.isnull())
print(heart.duplicated())
print(heart.describe())
b=heart.corr()
s.heatmap(b)
mt.show()... | Python | 1 |
nsity_weight=density_weight)
ratios.append(ratio)
if ratio < ratios[0] / 2:
break
if len(ratios) >= 4:
if abs(ratios[-1] - ratios[-2]) < 0.005 and abs(ratios[-2] - ratios[-3]) < 0.005 and abs(ratios[-3] - ratios[-4]) < 0.005:
flag =... | Python | 1 |
from write_the.commands import write_the_docs
from write_the.errors import FileSkippedError
from write_the.utils import create_tree, format_source_code, load_source_code
from rich.syntax import Syntax
from rich.progress import Progress
from typing import List
from pathlib import Path
from openai.error import InvalidReq... | Python | 1 |
72eab45\
72022100e89bd46bb3a5a62adc679f659b7ce876d83ee297c7a5587b2011c4fcc72eab45\
72022100e89bd46bb3a5a62adc679f659b7ce876d83ee297c7a5587b2011c4fcc72eab45\
72022100e89bd46bb3a5a62adc679f659b7ce876d83ee297c7a5587b2011c4fcc72eab45\
72022100e89bd46bb3a5a62adc679f659b7ce... | Rust | 0 |
from django.core.management.base import BaseCommand, CommandError
from safe_transaction_service.account_abstraction.utils import get_bundler_client
from safe_transaction_service.utils.ethereum import get_chain_id
from ...models import Chain
class Command(BaseCommand):
help = "Check current connected Ethereum RP... | Python | 1 |
_arr_append, "write deny-oom", 1,1,1],
["json.arrindex", json_arr_index, "readonly", 1,1,1],
["json.arrinsert", json_arr_insert, "write deny-oom", 1,1,1],
["json.arrlen", json_arr_len, "readonly", 1,1,1],
["json.arrpop", json_arr_pop, "write", 1,1,1],
... | Rust | 0 |
help("parameter names must be valid identifiers")
}
Error::Ignored => {
seg_span.error(error.to_string())
.help("use a name such as `_guard` or `_param`")
}
Error::MissingClose => {
seg_span.error(error.to_string())
.help(format!("d... | Rust | 0 |
# Copyright (c) 2021 - present / Neuralmagic, 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 b... | Python | 1 |
if self.lines[be_off + i] == Signal::High {
off += 1;
} else {
break;
}
}
let mut bytes = 0;
for i in off..4 {
if self.lines[be_off + i] == Signal::Low {
bytes += 1;
} else {
bre... | Rust | 0 |
Schema_FieldId,
output_array: *mut i64,
);
}
extern "C" {
pub fn Schema_GetUint32List(
object: *const Schema_Object,
field_id: Schema_FieldId,
output_array: *mut u32,
);
}
extern "C" {
pub fn Schema_GetUint64List(
object: *const Schema_Object,
field_id: S... | Rust | 0 |
() -> ApiBuilder {
ApiBuilder::private(PrivateMethod::DepositAddresses)
}
/// Get deposit methods.
pub fn deposit_methods() -> ApiBuilder {
ApiBuilder::private(PrivateMethod::DepositMethods)
}
/// Get account balance.
pub fn balance() -> ApiBuilder {
ApiBuilder::private(PrivateMethod::Balance)
}
/// Get ... | Rust | 0 |
y_anchoring_tx_payload(&tx, &core_schema)?;
if !tx.verify_input(&redeem_script, self.input(), pub_key, self.signature()) {
return Err(ValidateError::SignatureIncorrect);
}
Ok(())
} else {
return Err(ValidateError::MsgFromNonValidator);
}
... | Rust | 0 |
from .file_handler import ExcelFileHandler
from .sheet_handler import ExcelSheetHandler
from .cell_handler import ExcelCellHandler
from .search_handler import ExcelSearchHandler
from .pandas_handler import ExcelPandasHandler
from .data_processor import ExcelDataProcessor
from src.log_operations.log_handlers import Cust... | Python | 1 |
from collections import deque
from collections import OrderedDict
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.checkpoint import checkpoint
from LowMemConv import LowMemConvBase
def getParams():
#Format for this is to make it work easily... | Python | 1 |
# Test LMDeploy deployment framework
module = lazyllm.TrainableModule(self.model_path)
# Use deploy_method to set deployment framework and parameters
module.deploy_method(deploy.LMDeploy, port=9090, tp=1, max_batch_size=256)
deploy_args = module._impl._deploy_args
# Che... | Python | 1 |
*mut opj_tgt_node_t;
let mut l_parent_node = 0 as *mut opj_tgt_node_t;
let mut l_parent_node0 = 0 as *mut opj_tgt_node_t;
let mut i: OPJ_UINT32 = 0;
let mut j: OPJ_INT32 = 0;
let mut k: OPJ_INT32 = 0;
let mut l_num_levels: OPJ_UINT32 = 0;
let mut n: OPJ_UINT32 = 0;
let mut l_node_size: OPJ_UINT32 = 0;
... | Rust | 0 |
from collections import deque
import sys
dx = [-1, 1, 0, 0]
dy = [0, 0, -1, 1]
def bfs():
q = deque()
q.append((1, 1))
visited = {(1, 1)}
count = {(1, 1)}
switch[1][1] = True
while q:
x, y = q.popleft()
# 불을 켤 수 있는 스위치가 있는지 확인
if len(maps[x][y]) == 0:
pass... | Python | 1 |
acelike_coarse_timer();
MergedIterator::<<E as Iterable>::Iteron>::new(
&self.engine,
LARGE_CausetS,
spacelike_key,
lightlike_key,
false,
)
.map(|mut iter| {
let mut size = 0;
let mut tuplespaceInstanton = 0;
... | Rust | 0 |
ens = self.cls_token.expand(B, -1, -1)
x = torch.cat((cls_tokens, x), dim=1)
#x = x + self.pos_embed
x = self.drop_after_pos(x)
outs = []
for i, layer in enumerate(self.layers):
x = layer(x)
if i == len(self.layers) - 1 and self.final_norm:
... | Python | 1 |
struct GraphVizNode {
pub id : String,
pub style : GraphvizNodeStyle
}
impl DotTranslatable for GraphVizNode {
fn to_dot_string(&self) -> String {
let mut res = String::new();
res.push_str(&(self.id));
res.push_str(&(self.style.to_dot_string()));
res.push_str(";");
... | Rust | 0 |
# Importa o criador de rotas e as ferramentas de dependência do FastAPI
from fastapi import APIRouter, Depends
# Importa sessão e comando "select" do SQLModel
from sqlmodel import Session, select
# Importa os modelos que vamos usar: o completo e o de criação
from app.models import Transaction, TransactionCreate
# Im... | Python | 1 |
TMR5CLR register"]
pub struct TMR5CLR {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "TMR5CLR register"]
pub mod tmr5clr;
#[doc = "TMR5SET register"]
pub struct TMR5SET {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "TMR5SET register"]
pub mod tmr5set;
#[doc = "TMR5INV register"]
pub struct TMR5INV {
... | Rust | 0 |
"""
Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings.
You need to help them find out their common interest with the least list index sum. If there is a choice tie between answers, output all of them with no order requirement. You co... | Python | 1 |
o find the MSVC linker and set it up in the default configuration
//! one would need to set up anyway. This means that the Rust compiler can be
//! run not only in the developer shells of MSVC but also the standard cmd.exe
//! shell or MSYS shells.
//!
//! As a high-level note, all logic in this module for looking up v... | Rust | 0 |
}
#[derive(Copy, Clone)]
struct RutabagaCapsetInfo {
pub capset_id: u32,
pub component: RutabagaComponentType,
}
/// The global libary handle used to query capability sets, create resources and contexts.
///
/// Currently, Rutabaga only supports one default component. Many components running at the
/// same ... | Rust | 0 |
nel.Check(site, Getuser[0], Getpass[0])
with open('result/Config_results.txt', 'a') as ww:
ww.write(' Host: ' + Gethost[0] + '\n' + ' user: ' + Getuser[0] + '\n' + ' pass: ' + Getpass[0] + '\n' + ' DB: ' + Getdb[0] + '\n---------------------\n')
except:
... | Python | 1 |
import test_5
test_5.datos()
test_5.impuesto()
| Python | 1 |
bleRng;
use rand_distr::{Distribution, Geometric};
use std::convert::TryInto;
use std::fmt::Debug;
use std::iter::FusedIterator;
use std::mem;
use std::ptr::NonNull;
use std::sync::atomic::{self, AtomicPtr, AtomicUsize};
use std::sync::Arc;
type Link<K, V> = Option<Arc<AtomicPtr<SkipNode<K, V>>>>;
/// A node in the s... | Rust | 0 |
);
const PRINT_RW: &str = include_str!("./transform/print.rw");
pub fn flatten(term: Term) -> Result<Term, String> {
let mut r = parse_rewrite_string(FLATTEN_RW).unwrap();
r.set_filename("./transform/flatten.rw");
let mut rw = Rewriter::new_with_prelude(r);
rw.rewrite(term)
}
pub fn compile(term: Term... | Rust | 0 |
l, "two_heads", False)
else model.head.parameters()
)
optim = torch.optim.AdamW(
[
{"params": body_params, "lr": 1e-4}, # bump if still flat: 2e-4
{"params": head_params, "lr": 2e-4},
],
weight_decay=weight_decay,
)
print(
"Trainable (fi... | Python | 1 |
l_calculated)|`.
method : str
Minimization algorithm to use, choose from:
'leastsq', 'nelder', 'powell', 'cobyla', 'least-squares'.
See `lmfit` documentation (https://lmfit.github.io/lmfit-py/fitting.html)
for more information.
vary_angles : bool,
... | Python | 1 |
ill produce retry intervals for errors that satisfy the
/// given [`RetryPredicate`], and uses the given [`Sleeper`] to produce the interval futures.
pub fn with_sleeper(retry_check: R, config: Config, sleeper: S) -> Self {
Self {
// precalculate the range because it's the same for all opera... | Rust | 0 |
",
"852456",
"marcela",
"drpepper",
"gerardo",
"titanic",
"robert1",
"alison",
"moomoo",
"paulina",
"blossom",
"simpleplan",
"cutie1",
"abcd1234",
"bethany",
"kucing",
"bulldogs",
"buddy",
"fabian",
"ILOVEYOU",
"hollister",
"samson",
... | Rust | 0 |
0f, 0x16, 0x03], "movhpd xmm0, qword [ebx]");
test_invalid(&[0x66, 0x0f, 0x16, 0xc3]);
test_instr(&[0x66, 0x0f, 0x17, 0x03], "movhpd qword [ebx], xmm0");
test_invalid(&[0x66, 0x0f, 0x17, 0xc3]);
test_instr(&[0x66, 0x0f, 0x28, 0xd0], "movapd xmm2, xmm0");
test_instr(&[0x66, 0x0f, 0x28, 0x00], "movap... | Rust | 0 |
a=[1,7,2,4]
b=[]
for i in range(0,len(a)-1):
for j in range(i+1,len(a)):
c=a[i]+a[j]
if c%3!=0:
b.append(a[i])
b.append(a[j])
else:
pass
print(set(b))
| Python | 1 |
import json
import requests
def handler(data, context):
"""Handle request.
Args:
data (obj): the request data
context (Context): an object containing request and configuration details
Returns:
(bytes, string): data to return to client, (optional) response content type
"""
... | Python | 1 |
(0u64, |count, _| future::ready(Ok(count + 1)))
.await
}
async fn is_empty(&self, txn: &T) -> TCResult<bool> {
let mut blocks = self.source.clone().block_stream(txn.clone()).await?;
while let Some(block) = blocks.try_next().await? {
if block.any() {
retur... | Rust | 0 |
}
MuxCommandMarker::Test => Self::Test(TestCommandParams::decode(buf)?),
};
Ok(params)
}
}
impl Encodable for MuxCommandParams {
type Error = FrameParseError;
fn encoded_len(&self) -> usize {
match self {
Self::ParameterNegotiation(cmd) => cmd.e... | Rust | 0 |
LuaValue::Number(n) => float_to_integer(*n),
LuaValue::Str(s) => string_to_integer(s),
_ => None,
}
}
}
fn string_to_integer(s: &String) -> Option<i64> {
if let Ok(i) = s.parse::<i64>() {
Some(i)
} else if let Ok(n) = s.parse::<f64>() {
float_to_i... | Rust | 0 |
#Aritmetiksel operatörler
sayi1 = 10
sayi2 = 3
print("Toplam", sayi1 + sayi2)
print("Çıkar", sayi1 - sayi2)
print("Çarp", sayi1 * sayi2)
print("Böl", sayi1 / sayi2)
print("Tam Böl", sayi1 // sayi2)
print("Üs", sayi1 ** sayi2)
print("Mod", sayi1 % sayi2)
#Karşılaştırma Operatörleri
print(sayi1 < sayi2)
print(sayi1 =... | Python | 1 |
}
#[no_mangle]
pub unsafe extern "C" fn lodepng_get_channels(info: &ColorMode) -> c_uint {
c_uint::from(info.channels())
}
#[no_mangle]
pub unsafe extern "C" fn lodepng_is_greyscale_type(info: &ColorMode) -> c_uint {
info.is_greyscale_type() as c_uint
}
#[no_mangle]
pub unsafe extern "C" fn lodepng_is_alpha_... | Rust | 0 |
OTCONN,
nix::errno::Errno::ETIMEDOUT => host::__WASI_ETIMEDOUT,
nix::errno::Errno::ECONNREFUSED => host::__WASI_ECONNREFUSED,
nix::errno::Errno::EHOSTUNREACH => host::__WASI_EHOSTUNREACH,
nix::errno::Errno::EALREADY => host::__WASI_EALREADY,
nix::errno::Errno::EINPROGRESS => host... | Rust | 0 |
from __future__ import annotations
from homeassistant import data_entry_flow
from homeassistant.components.repairs import RepairsFlow
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_ENTITY_ID
from homeassistant.core import HomeAssistant
from custom_components.powercalc.common... | Python | 1 |
def add_lines(self):
# 在页面上添加多条水平横线
line_height = 10 # 每条线之间的高度
y_start = 20 # 第一条线的起始高度
page_height = 297 # A4页面高度
margin = 10 # 左右边距
num_lines = (page_height - y_start) // line_height
for i in range(int(num_lines)):
y_position = y_start + i * line_height
self.line(ma... | Python | 1 |
1.0 / 60.0) * 3.0; // 3 frames @ 60 FPS
pub const SPEED_UP_TIME: f64 = (1.0 / 60.0) * 6.0; // 6 frames @ 60 FPS
pub const MAX_SPEED: f64 = 10.0 * 64.0; // 10 tiles / second
#![doc = "generated by AutoRust 0.1.0"]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[derive(Cl... | Rust | 0 |
_owned(),
&[
"http://www.w3.org/ns/rdftest#TestTurtlePositiveSyntax",
"http://www.w3.org/ns/rdftest#TestTurtleEval",
],
)
}
fn trig_test_data() -> Result<Vec<u8>, Box<dyn Error>> {
test_data_from_testsuite(
"http://w3c.github.io/rdf-tests/trig/manifest.ttl".to_ow... | Rust | 0 |
x intersection checks
pub signs: [bool; 3], // Handle degenerate case in bbox intersection
}
impl Ray {
pub fn new(origin: Vec3, direction: Vec3) -> Ray {
let inv_x = 1.0 / direction.x;
let inv_y = 1.0 / direction.y;
let inv_z = 1.0 / direction.z;
Ray {
origin: orig... | Rust | 0 |
_click",
"long_view",
"is_like",
],
"domain_group_name": "domain",
"num_experts": 4,
"view_dim": 32,
"scenario_dim": 16,
"meta_tower_depth": 3,
"meta_unit_depth": 3,
"meta_unit_shared": True,
... | Python | 1 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most football options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import sphinx
# -- Path setup -------------------------------------------------------... | Python | 1 |
odeKind::TsThisType,
TsThisTypeOrIdent::Ident(_) => NodeKind::Ident,
}
}
}
impl<'a> From<&TsThisTypeOrIdent<'a>> for Node<'a> {
fn from(node: &TsThisTypeOrIdent<'a>) -> Node<'a> {
match node {
TsThisTypeOrIdent::TsThisType(node) => (*node).into(),
TsThisTypeOrIdent::Ident(node) => (*node)... | Rust | 0 |
port]
macro_rules! regex {
($expr:expr) => {{
static REGEX: ::once_cell::sync::Lazy<::regex::Regex> =
::once_cell::sync::Lazy::new(|| ::regex::Regex::new($expr).unwrap());
®EX
}};
($expr:expr,) => {
regex!($expr)
};
}
#[macro_export]
macro_rules! select {
($se... | Rust | 0 |
import pandas as pd
import streamlit as st
import plotly.express as px
# Load the cleaned dataset
def load_data(file_path):
df = pd.read_csv(file_path, parse_dates=["Date"], index_col="Date")
return df
# Load forecast data (if available)
def load_forecast(file_path):
try:
df_forecast = pd.read_csv... | Python | 1 |
code::SyntaxHighlighter, index::Index, mathjax::MathjaxPolicy, stylesheet::Stylesheet,
RenderOpts, ToHtml,
},
};
use globset::GlobSet;
use object::SourceFileObject;
use std::{
convert::TryFrom,
fs::{self, File},
io::{self, Write},
path::PathBuf,
};
use tree::DirTree;
pub mod object;
mod ha... | Rust | 0 |
2 / (l2 - 2.00179144e-2);
let three = 1.01046945 * l2 / (l2 - 103.560653);
Float::sqrt(1.0 + one + two + three)
}
pub static INDEX_K: [Float; 25] = {
[
0.3, 0.31, 0.32, 0.334, 0.35, 0.365, 0.37, 0.38, 0.39, 0.4, 0.405, 0.42, 0.436, 0.46, 0.5,
0.546, 0.58, 0.62, 0.66, 0.7, 1.06, 1.53, 1.97,... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
class Employee(models.Model):
_inherit = 'hr.employee'
subscribed_courses = fields.Many2many('slide.channel', related='user_partner_id.slide_channel_ids')
has_subscr... | Python | 1 |
for (&c, &v) in map.iter() {
if v == 1 {
return c;
}
}
unreachable!()
}
// bit_manipulation hash_table
#[test]
fn test2_389() {
assert_eq!(
find_the_difference("abcd".to_string(), "abcde".to_string()),
'e'
);
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub... | Rust | 0 |
or parsing {}", flag_val));
}
}
}
if verbose {
let tool_name = self.get_tool_name();
let welcome_len = format!("* Welcome to {} *", tool_name).len().max(28);
// 28 = length of the 'Powered by' by statement.
println!("{}", "*".... | Rust | 0 |
# [01] START: src/__init__.py — namespace marker
"""MAIC application source root."""
# [01] END: src/__init__.py
| Python | 1 |
_regions<'tcx, T>(
tcx: &ty::ctxt<'tcx>,
value: &Binder<T>)
-> T
where T : TypeFoldable<'tcx> + Repr<'tcx> + Clone
{
assert!(!binds_late_bound_regions(tcx, value));
value.0.clone()
}
/// Replace any late-bound regions bound in `value` with `'static`. Useful in trans but also
/// method lookup a... | Rust | 0 |
}
}
impl<'router, 'path, Handler> Eq for Match<'router, 'path, Handler> {}
impl<'router, 'path, Handler> PartialOrd for Match<'router, 'path, Handler> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl<'router, 'path, Handler> Ord for Match<'router, 'path, Hand... | Rust | 0 |
cho::MachHeader64::parse(bytes).unwrap();
let endian: Endianness = header.endian().unwrap();
let mut commands = header.load_commands(endian, bytes).unwrap();
let command = commands.next().unwrap().unwrap();
let (segment, _) = command.segment_64().unwrap().unwrap();
assert_eq!(segment.vmsize.get(endi... | Rust | 0 |
let x43: u8 = ((x42 & (0xff as u64)) as u8);
let x44: u64 = (x42 >> 8);
let x45: u8 = ((x44 & (0xff as u64)) as u8);
let x46: u8 = ((x44 >> 8) as u8);
let x47: u8 = ((x1 & (0xff as u64)) as u8);
let x48: u64 = (x1 >> 8);
let x49: u8 = ((x48 & (0xff as u64)) as u8);
let x50: u64 = (x48 >> ... | Rust | 0 |
# --- Do not remove these libs ---
from freqtrade.strategy.interface import IStrategy
from typing import Dict, List
from functools import reduce
from pandas import DataFrame
# --------------------------------
import talib.abstract as ta
import freqtrade.vendor.qtpylib.indicators as qtpylib
class ONUR(IStrategy):
... | Python | 1 |
from llm.llm_methods import answer_with_documentation, predict_answer, add_context_to_query
from chunker.chunker import Chunker
from get_project_root import root_path
# from build.local_variables import YANDEX_GPT_TOKEN
class Rag:
"""
Основной класс, реализующий работу с RAG моделью
"""
@staticmetho... | Python | 1 |
for stat_key in next(iter(stats_episodes.values())).keys():
aggregated_stats[stat_key] = (
sum([v[stat_key] for v in stats_episodes.values()])
/ num_episodes
)
for k, v in aggregated_stats.items():
logger.info(f"Average episode {k}: {v:.4f}")
... | Python | 1 |
454a iyr:2023\n\
pid:3556412378 byr:2007\n\
\n\
pid:7876582 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980\n\
hcl:#623a2f\n\
\n\
pid:5837609946 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980\n\
hcl:#623a2f";
//split passports by double-newlines
let passports = passports.split("\n\n").collect::<Vec... | Rust | 0 |
import os
import dspy
from fastapi import FastAPI, Body
from pydantic import BaseModel
from contextlib import asynccontextmanager
#
# Define a simple DSPy Signature
class MultiServerSignature(dspy.Signature):
"""Helpful Assistant with Tools Available"""
history: list[dict[str, str]] = dspy.InputField(desc="The... | Python | 1 |
as_millis());
loop {
trace!("poke the watchdog");
if notify(false, &[NotifyState::Watchdog]).is_err() {
warn!("fail to poke watchdog");
}
delay_for(timeout).await;
}
}
<filename>src/Category.rs
// This file is part of caniuse-serde. It is subject to the license terms ... | Rust | 0 |
er("svg_file", storage=STORAGE))
tar_file = Trait(file=Faker("tar_file", storage=STORAGE))
txt_file = Trait(file=Faker("txt_file", storage=STORAGE))
webp_file = Trait(file=Faker("webp_file", storage=STORAGE))
xlsx_file = Trait(file=Faker("xlsx_file", storage=STORAGE))
zip_file = ... | Python | 1 |
} else {
match github_response.status_code() {
422 => Err(ReposUploadReleaseAssetError::Status422),
code => Err(ReposUploadReleaseAssetError::Generic { code }),
}
}
}
/// ---
///
/// # Upload a release asset
///
/// This endpo... | Rust | 0 |
payload = {
"init_images": [encoded_image],
"prompt": '8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm XT3, on the beach',
"negative_prompt": "(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, mutated hands and fingers:1.4), (defor... | Python | 1 |
True,
}
self.assert_compose_to_wf_graph(wf_name, expected_wf_graph)
expected_wf_ex_graph = {
"directed": True,
"graph": {},
"nodes": [
{"id": "task1"},
{"id": "task2"},
{"id": "task3"},
{"id": ... | Python | 1 |
mary']}")
print(f"用户意图: {extracted['user_intent']}")
print("\n" + "="*60 + "\n")
# 示例2: 批量提取知识
print("示例2: 批量提取知识")
all_knowledge = extractor.batch_extract_knowledge(sample_conversations)
print(f"总共提取了 {len(all_knowledge)} 个知识点")
# 显示所有知识点
print(f"\n所有知识点:")
for key, c... | Python | 1 |
}
}
}
return ( minimal_distance, minimal_steps );
}<filename>bridge/class-master/src/primitives/vdf.rs<gh_stars>1-10
use crate::curv::arithmetic::traits::Modulo;
use crate::curv::arithmetic::traits::Samplable;
use crate::pari_init;
use crate::primitives::hash_to_prime;
use crate::primitives::... | Rust | 0 |
factory).unwrap() };
let pipe_desc = PipelineDescBuilder::new()
.with_vertex_desc(&vertex_desc)
.with_shaders(util::simple_shader_set(
&shader_vertex_basic,
Some(&shader_fragment),
))
.with_layout(&pipeline_layout)
.with_subpass(subpass)
.with_... | Rust | 0 |
.complete());
}
} else if let Some(captures) = instruction_line.captures(&line) {
let instr_line = &captures["instr_line"];
let instr_addr = &captures["addr"];
let instr_addr = u32::from_str_radix(instr_addr, 16)
.map_err(|e| AsmError::AddrParseErr... | Rust | 0 |
import torch
from torch import nn
from dataset.dataset import train_dataset
from conv_block import ConvBlock
from config import *
from difussion import forward_difussion
from Time_Position_Embedding import TimePositionEmbedding
class UNet(nn.Module):
def __init__(self,img_channel,channels=[64,128,256,512,1024],tim... | Python | 1 |
st_code)
# JavaScript jest patterns
jest_code = "describe('test', () => { it('should work', () => {}); });"
assert re.search(frameworks['javascript']['jest'], jest_code)
def test_assertion_pattern_matching(self, analyzer):
"""Test assertion pattern matching."""
... | Python | 1 |
import sys
sys.path.append(r'D:\Dev\Source\Falcom\Decompiler2')
from Falcom.ED6.Parser.scena_writer_helper import *
try:
import T0020_hook
except ModuleNotFoundError:
pass
scena = createScenaWriter('T0020 ._SN')
# id: 0xFFFF offset: 0x0
@scena.Header('Header')
def Header():
header = ScenaHeader()
h... | Python | 1 |
ackIdL_IsoVL_PFJet30_v*']),
#denGenericTriggerEventPSet = dict(hltPaths = ['HLT_IsoMu24_v*'])
)
susyEle23CaloIdMJet30_jet = hltSUSYmonitoring.clone(
FolderName = 'HLT/SUSY/Ele23CaloIdMJet30/JetMonitor',
nmuons = 0,
nelectrons = 1,
njets = 1,
eleSelection = 'pt>50 & abs(eta)<2.4',
jetSelectio... | Python | 1 |
## PyLogis
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
# Param orders: r, K
def logis(x, y, p):
est = []
for time in xrange(0, len(x)):
num = p[1] * y[0] * np.exp(p[0] * x[time])
den = p[1] + y[0] * (np.exp(p[0] * x[time]) -1)
est.append(num/float(den))
return est
def leastsquare(... | Python | 1 |
#Write a function to find the nth hexagonal number.
def hexagonal_num(n):
return n*(2*n - 1) | Python | 1 |
wrap().0 {
candidate.replace((len, Cell { row, col }, options));
if len == 2 {
break 'lowest;
}
}
}
}
if let Some((_, cell, options)) = candidate {
... | Rust | 0 |
HANDLE,
dwFlags: DWORD,
) -> BOOL> {
Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("SetProcessAffinityUpdateMode\0")) ) } )
}
pub fn QueryProcessAffinityUpdateMode() -> Option<unsafe fn(
hProcess: HANDLE,
lpdwFlags: LPDWORD,
) -> BOOL> {
Some( unsafe { std::mem::transmute( get_k32_... | Rust | 0 |
Supply(inflamounts, 0),
)?;
// 3
<SerpTreasury as SerpTreasuryExtended<AccountId>>::buyback_swap_with_exact_supply(
currency_id,
SERP,
SwapLimit::ExactSupply(inflamounts, 0),
)?;
// 4
<SerpTreasury as SerpTreasuryExtended<AccountId>>::buyback_swap_with_exact_supply(
currency_... | Rust | 0 |
s = filtered_bookings[offset:offset + limit]
list_bookings = [booking.to_dict() for booking in paginated_bookings]
return jsonify(list_bookings)
@app_views.route('/bookings/<booking_id>/', methods=['GET'], strict_slashes=False)
@swag_from('documentation/booking/get_booking.yml', methods=['GET'])
def get_booki... | Python | 1 |
= "r";
const REPETITIONS_ARG_DEFAULT: &str = "10000";
const REPETITIONS_ARG_VALUE_NAME: &str = "NUM";
const REPETITIONS_ARG_HELP: &str = "Number of repetitions of each host function call";
const OUTPUT_DIR_ARG_NAME: &str = "output-dir";
const OUTPUT_DIR_ARG_SHORT: &str = "o";
const OUTPUT_DIR_ARG_VALUE_NAME: &str = "... | Rust | 0 |
import torch
import torch.nn as nn
from torch_scatter import scatter
""" 自注意力层的 Lipschitz 归一化及其在图神经网络中的应用
基于注意力的神经网络在广泛的应用中是最先进的。但是,当层数增加时,它们的性能往往会下降。
在这项工作中,我们表明,通过归一化注意力分数来加强 Lipschitz 连续性可以显着提高深度注意力模型的性能。首先,我们表明,对于深度图注意力网络(GAT),在训练过程中会出现梯度爆炸,导致基于梯度的训练算法性能不佳。
为了解决这个问题,我们推导了注意力模块的 Lipschitz 连续性的理论分析,并引入了 LipschitzNo... | Python | 1 |
.exemplars_y.append(list(data_topk[:, 1]))
# self.exemplars_y.append(list(data_topk[:, 1]))
self.exemplars_mask.append(list(data_topk[:, 2]))
self.exemplars_span.append(list(data_topk[:, 3]))
self.radius[l] = radius
def build_stage_loader(self... | Python | 1 |
$shift,
8 + $shift, 9 + $shift,
10 + $shift, 11 + $shift,
12 + $shift, 13 + $shift,
14 + $shift, 15 + $shift,
])
}
}
match imm8 {
0 => shuffle!(0),
1 => shuffle!(1),
2 => shuffle!(2),
3 => shuffl... | Rust | 0 |
"""
Medical code model for GOZ/BEMA codes
"""
from sqlalchemy import Column, String, Text, Float, Boolean, Enum as SQLEnum
from sqlalchemy.orm import relationship
import enum
from app.models.base import BaseModel
from app.models.treatment import treatment_medical_codes
class CodeSystem(enum.Enum):
"""Medical co... | Python | 1 |
e
F: FnMut(T),
T: DeserializeOwned,
P: AsRef<Path>,
{
let walker =
WalkDir::new(root)
.into_iter()
.filter_entry(|e: &DirEntry| {
if e.path().is_dir() {
return true;
}
match e.path().extension() {
... | Rust | 0 |
since UNIX epoch
// Default unit millisecond
Timestamp { unit: TimeUnit },
// Exact time encoded with int64, default unit millisecond
Time { unit: TimeUnit },
// YEAR_MONTH or DAY_TIME interval in SQL style
Interval { unit: TimeUnit },
// Precision- and scale-based decimal type. Storage type depends o... | Rust | 0 |
, Serialize, Deserialize)]
#[non_exhaustive]
pub enum Event {
/// This time was just added to the split.
Pushed,
/// This time was just removed from the split.
/// The UI may choose to load this time into a split editor.
Popped,
/// This is a new aggregate time for this split.
Aggregate(mode... | Rust | 0 |
";
const STR_NEXT: &str = "NEXT";
const STR_NOT: &str = "NOT";
const STR_ON: &str = "ON";
const STR_OPEN: &str = "OPEN";
const STR_OR: &str = "OR";
const STR_OUTPUT: &str = "OUTPUT";
const STR_PRINT: &str = "PRINT";
const STR_PUT: &str = "PUT";
const STR_RANDOM: &str = "RANDOM";
const STR_READ: &str = "READ";
const STR... | Rust | 0 |
::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sac1dat](sac1dat) module"]
pub type SAC1DAT = crate::Reg<u16, _SAC1DAT>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _SAC1DAT;
#[do... | Rust | 0 |
# ax.set_xticks(xtickrange)
# if xticklabels is not None:
# ax.set_xticklabels(xticklabels)
# else:
# ax.set_xticklabels([x for x in range(len(x))])
pass
else:
ax.set_xticks(xtickrange)
if xticklabels is not Non... | Python | 1 |
ext = self.get_context()
context.update(kwargs or {})
return TemplateResponse(
self.request, self.change_form_template or self.get_template_list(
'views/model_form.html'),
context)
def post(self, request, *args, **kwargs):
if "_saveasnew" in self.req... | Python | 1 |
import logging
import kopf
from .secretinjector_funcs import reconcile_config
from .operator_config import OPERATOR_API_GROUP
logger = logging.getLogger("educates")
@kopf.index(f"secrets.{OPERATOR_API_GROUP}", "v1beta1", "secretinjectors")
def secretinjector_index(name, meta, body, **_):
generation = meta["ge... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.