text string | label_name string | labels int64 |
|---|---|---|
"""
Module: base_scraper.py
Defines an abstract base class for all scraper implementations.
Handles common scraper initialization and provides a utility method
for HTML content retrieval via URLAccess.
Subclasses must implement the scrape() method to extract relevant data.
"""
from abc import ABC, abstractmethod
from... | Python | 1 |
import loooooooooooooong
import mediuuuuuum
import short
import σηορτ
import shoort
import mediuuuuum
import λοοοοοοοοοοοοοονγ
import μεδιυυυυυμ
import looooooooooooooong
| Python | 1 |
Validator,
/// Nominating for a group of other stakers.
Nominator(Vec<AccountId>),
}
#[derive(PartialEq, Eq, Clone, Encode, Decode)]
#[cfg_attr(feature = "std", derive(Debug))]
pub struct ValidatorPrefs {
/// Validator should ensure this many more slashes than is necessary before being unstaked.
#[... | Rust | 0 |
container = next(keyword_node.value.infer())
except (InferenceError, StopIteration) as exc:
raise UseInferenceDefault from exc
break
if not isinstance(container, nodes.BaseContainer):
raise UseInferenceDefault
for elt in container.elts:
... | Python | 1 |
Windfall", TALKED_TO_JOANNA_ON_WINDFALL),
("Got Leaf", GOT_LEAF),
("Talked to Mesa when visiting Outset a second time", TALKED_TO_MESA_WHEN_VISITING_OUTSET_A_SECOND_TIME),
("Denied leaving Outset", DENIED_LEAVING_OUTSET),
("Makar in Wind Temple", MAKAR_IN_WIND_TEMPLE),
("Medli in Earth Temple",... | Rust | 0 |
ode<T: ProtocolData>(value: &T) -> Result<Vec<u8>, Error> {
encoding::to_vec(value).map_err(Error::from)
}
}
<filename>components/ynab-api/src/types.rs<gh_stars>1-10
use url::Url;
use serde::{
Serialize,
Deserialize,
};
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, Clone, Se... | Rust | 0 |
randomn}')
except:
await ctx.reply(f'Something went wrong. Did you typed correct min/max values?')
#2
@client.command(name='essa', help='Check your "essa"')
async def essa(ctx):
import random
losessa = random.randrange(101)
await ctx.send(f'Twój dzisiejszy poziom essy: {losessa}%')
print(f'... | Python | 1 |
ropagation() # Propagate logs to the root logger.
optuna.logging.disable_default_handler() # Stop showing logs in sys.stderr.
if args.restart:
study = joblib.load(os.path.join(args.hyperopt_dir, "study.pkl"))
else:
study = optuna.create_study(
pruner=optuna.pruners.HyperbandPr... | Python | 1 |
company_employees = [
(101, 'Hayam Esam', 10000.0, 'Engineer', 'F'),
(102, 'Ibrahim Ahmed', 9000.0, 'Accountant', 'M'),
(103, 'Adham Aly', 5000.0, 'Engineer','M'),
(104, 'Islam Hassan', 7000.0, 'Sales','M'),
(105, 'Marwa Esam', 7000.0, 'Marketer','F'),
(106, 'Ola Hassan', 7000.0, 'Engineer','F')
]
male_count, female_co... | Python | 1 |
month_entry["state"] = "readonly"
yen_swift_rate_CTkLabel = ctk.CTkLabel(CTkFrame, text="КУРС JPY В BBR БАНКЕ")
yen_swift_rate_CTkLabel.grid(row=0, column=2, padx=10, pady=4, sticky='w')
yen_swift_rate_entry = ctk.CTkEntry(CTkFrame)
yen_swift_rate_entry.grid(row=0, column=3, padx=10, pady=4, sticky='w')
euro_rate_CTk... | Python | 1 |
* Q` words at each `Q`-aligned
//! boundary. We call `i` the window spanning from `i * Q` to `(i + N) * Q`. Only
//! those windows actually exist in the underlying storage. We use compaction to
//! shift the current window from `i` to `i + 1`, preserving the content of the
//! store.
//!
//! For a given state of the v... | Rust | 0 |
# Problem statement
# Given a linked list of 'N' nodes, where each node has an integer value that can be 0, 1, or 2. You need to sort the linked list in non-decreasing order and the return the head of the sorted list.
# Example:
# Given linked list is 1 -> 0 -> 2 -> 1 -> 2.
# The sorted list for the given linked lis... | Python | 1 |
wLockWriteGuard<'a, TypeErasedLayer>,
}
impl<'a, T: Component> LayerViewMut<'a, T> {
/// Insert a component into the layer.
///
/// This returns a reference to the node that was created,
/// which you can use to connect it to other nodes.
/// # Example
/// ```
/// # use starframe::{graph::{... | Rust | 0 |
"""Initialization of the field (:mod:`fluidsim.solvers.ad1d.init_fields`)
=========================================================================
.. autoclass:: InitFieldsAD1D
:members:
.. autoclass:: InitFieldsCos
:members:
.. autoclass:: InitFieldsGaussian
:members:
"""
import numpy as np
from fluids... | Python | 1 |
'''
Ram and Shyam have devised a new encoding scheme called "Reverse Mirror Encoding." In this system:
For letters 'a' to 'n', the code is their reverse position in the first half of the alphabet.
Example: 'a' → n, 'b' → m, ..., 'n' →a.
For letters 'o' to 'z', the code is their reverse position in the second half of ... | Python | 1 |
" {
break;
}
}
}
// Do clean-up here!
reset_screen(&mut stdout);
}
/// Writes a colored version of showboard to stdout using termion.
pub fn draw_board(board: &Board) {
let stdout = io::stdout();
let mut stdout = stdout.lock().into_raw_mode().unwrap();
let m... | Rust | 0 |
iError(ApiError<T>),
}
#[derive(Debug)]
pub struct ApiError<T> {
pub code: hyper::StatusCode,
pub content: Option<T>,
}
impl<'de, T> From<(hyper::StatusCode, &'de [u8])> for Error<T>
where T: serde::Deserialize<'de> {
fn from(e: (hyper::StatusCode, &'de [u8])) -> Self {
if e.1.len() == 0 {
... | Rust | 0 |
Returns:
3-array: (x,y,z) global current position representing the robot
"""
return env.robots[self._robot_idn].states[Pose].get_value()[0]
def get_shortest_path_to_goal(self, env, start_xy_pos=None, entire_path=False):
"""
Get the shortest path and geodesic distance f... | Python | 1 |
_request_latency(50.0)
self.metrics.record_request_latency(50.0)
# Now add enough errors to exceed threshold
self.metrics.record_error("error1") # 1/6 = ~16.7% error rate
mock_warning.assert_called_with("High error rate detected: 16.67% (threshold: 10.00%)")
mock_warnin... | Python | 1 |
"""
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. After a tour, the smart thief realized that "all houses in this place forms a binary tree". It will automatically contact the p... | Python | 1 |
mand=("sxx", plugin_category),
info={
"header": "bad art, try yourself ",
"usage": "{tr}sxx",
},
)
async def kakashi(saxy):
"Bad stuff"
await edit_or_reply(
saxy,
"⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀\n"
"⢀⡴⠑⡄⠀⠀⠀⠀⠀⠀⠀⣀⣀⣤⣤⣤⣀⡀⠀⠀⠀⠀\n"
"⠸⡇⠀⠿⡀⠀⠀⠀⣀⡴⢿⣿⣿⣿⣿⣿⣿⣿⣷⣦⡀⠀⠀⠀\n"
... | Python | 1 |
/// Field Visibility: user
fn sticks(&self, ctx: &Context) -> FieldResult<i32> {
ctx.check_village_key(self.0.key())?;
Ok(
ctx.db().resource(ResourceType::Sticks, self.0.key()) as i32
)
}
/// Field Visibility: user
fn feathers(&self, ctx: &Context) -> FieldResult<... | Rust | 0 |
import os
import torch
import torch.nn as nn
from torch.nn import utils
from torch.optim import Adam
from core.models import network
from core.models.loss import Loss
class Model(object):
def __init__(self, configs):
self.configs = configs
self.num_hidden = [int(x) for x in configs.num_hidden.spli... | Python | 1 |
from chat_bot import get_ai_response
import speech_recognition as sr
import pyttsx3
def speak(text):
engine = pyttsx3.init()
engine.say(text)
engine.runAndWait()
def listen():
r = sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
audio = r.listen(source)
... | Python | 1 |
e/png;base64,{img_data}" alt="{name}">
</div>
"""
html_content += """
</div>
<div class="footer">
<p>Report generated by SutZawAung(KBU) analyzer</p>
</div>
</body>
</html>
"""
# Generate PDF
... | Python | 1 |
if vertex.number() == x:
return vertex
return None
# dodata metoda za dohvatanje čvora po indeksu
def get_vertex_by_index(self, x):
for vertex in self.vertices():
if vertex.index() == x:
return vertex
return None
def degree(self, v, o... | Python | 1 |
vail_mask.append(0)
C = torch.stack(cand_vals, dim=1) # [B, K]
avail = torch.tensor(avail_mask, device=X.device, dtype=torch.bool)[None, :] # [1,K]
logits = self.baseline_proj(z_last) # [B, K]
logits = torch.where(avail, logits, torch.full_like(logits, -1e9)) #... | Python | 1 |
e;}il;}il;}io;'bI.;'a*w")
.output()
.unwrap_or_else(|e| { panic!("failed to execute process: {}", e) });
assert!(output.stderr.len() == 0, "stderr shouldn't exist");
assert_eq!(String::from_utf8_lossy(&output.stdout), "H.e.l.l.o");
}
#[test]
fn string_divide() {
let output = Command::new(".... | Rust | 0 |
clipper.AddPath(clone, pyclipper.PT_SUBJECT, True)
combine_nfp = clipper.Execute(pyclipper.CT_UNION, pyclipper.PFT_NONZERO, pyclipper.PFT_NONZERO)
if not combine_nfp:
return None
clipper = pyclipper.Pyclipper()
clipper.AddPaths(combine_nfp, pyclipper.PT_CLIP, True)
... | Python | 1 |
from models.tasks.task_executor import TaskExecutor
from mojodex_core.produced_text_managers.task_produced_text_manager import TaskProducedTextManager
from app import placeholder_generator
from mojodex_core.tag_manager import TagManager
class InstructTaskManager:
def __init__(self, session_id, user_id):
... | Python | 1 |
cannot be None'
# TODO: fixme
if isinstance(aid2, list):
aid2_ = aid2[0]
else:
aid2_ = aid2
timedelta_str = ('\n' + get_timedelta_str(ibs, qaid, aid2_))
text_list.append(timedelta_str)
query_text = ', '.join(text_list)
return query_text
#========... | Python | 1 |
} else {
acc.insert(recipient.to_string(), vec![message_ref.clone()]);
}
});
acc
},
)
.reduce(HashMap::new, |mut a, b| {
b.into_iter().for_each(|(name, mut value)|... | Rust | 0 |
_extern! { crate::saliency::MotionSaliencyBinWangApr2014,
cv_PtrOfMotionSaliencyBinWangApr2014_delete, cv_PtrOfMotionSaliencyBinWangApr2014_get_inner_ptr, cv_PtrOfMotionSaliencyBinWangApr2014_get_inner_ptr_mut
}
ptr_extern_ctor! { crate::saliency::MotionSaliencyBinWangApr2014, cv_PtrOfMotionSaliencyBinWangApr2014... | Rust | 0 |
len);
for iov in iov_slice {
check_ptr(iov.iov_base as *const u8)?;
}
}
if !(*user_hdr).msg_control.is_null() {
check_ptr((*user_hdr).msg_control as *const u8)?;
}
Ok(())
... | Rust | 0 |
8332096944629367896u64,
18005297320867222879u64,
58811391084848524u64,
]);
}
impl FpParameters for FqParameters {
/// MODULUS = 68914503843157325393967896822756575424796689125361501095137901602096234222434917360876831832894116876408645677537866134511617591205542477593495116991253015989516050... | Rust | 0 |
from neo4j import GraphDatabase
import numpy as np
uri = "bolt://localhost:7688"
username = "neo4j"
password = ""
def clear_database():
with driver.session() as session:
session.run("MATCH (n) DETACH DELETE n")
def load_nodes():
query = """
:auto LOAD CSV with headers FROM 'file:///products_train... | Python | 1 |
# chains/course_recommender.py
import logging
from langchain_core.prompts import ChatPromptTemplate
from utils.llm_provider import get_llm
from utils.course_data_loader import load_course_data
# Setup logger
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Load LLM
llm = get_llm()
# Lo... | Python | 1 |
Range {
let offset = -viewport_offset as ScrollbackOrVisibleRowIndex;
SelectionRange {
start: SelectionCoordinate {
x: self.start.x,
y: self.start.y.max(offset) - offset,
},
end: SelectionCoordinate {
x: self.end.x,
... | Rust | 0 |
import torch
import torch.nn as nn
import torch.nn.functional as F
class LinearAdapter(nn.Module):
def __init__(self, in_features, out_features):
"""Initialize a linear adapter layer.
Args:
in_features (int): Number of input features.
out_features (int): Number of output fe... | Python | 1 |
d(SubCommand::with_name("list").about("Lists projects"));
let matches = app.get_matches(); //doesn't work _from_safe_borrow();
let token = env::var("APPVEYOR").expect("APPVEYOR env variable was not found!");
if matches.is_present("enable") {
enable(&token);
} else if matches.is_present("disab... | Rust | 0 |
# 1. 模型配置(models) =========================================
model = dict(
backbone=dict(
type="MixFormer",
vit_type="cvt21",
pretrain_path="/home/dmmm/VscodeProject/FPI/pretrain_model/CvT-21-384x384-IN-22k.pth",
pretrain=True,
output_index=[0],
),
neck=dict(
t... | Python | 1 |
setup(),
"main_args",
vec![gears_obj!(1), gears_obj!(1), gears_obj!(1)],
) {
Ok(_) => panic!("Should not have passed"),
Err(error) => match error {
GearsError::InterOpError { error, .. } => match error {
InterOpErrorType::TooManyArgs => {}
... | Rust | 0 |
ngletonFutureState,
_phantom: PhantomData<(Fut, Inner, Ret)>,
}
/// State for the future returned by `AsyncSingleton::use_singleton`.
enum UseSingletonFutureState {
AcquireLock,
CallFunction,
}
impl<Func, Fut, Inner, Ret> Future for UseSingletonFuture<Func, Fut, Inner, Ret>
where
Func: FnOnce(&Inner) ... | Rust | 0 |
m(0);
}
impl MyDupeEnum {
pub const B: MyDupeEnum = MyDupeEnum(1);
}
impl ::std::ops::BitOr<MyDupeEnum> for MyDupeEnum {
type Output = Self;
#[inline]
fn bitor(self, other: Self) -> Self {
MyDupeEnum(self.0 | other.0)
}
}
impl ::std::ops::BitOrAssign for MyDupeEnum {
#[inline]
fn bit... | Rust | 0 |
t into an ident
) => (
// Define a helper macro that will be called with the generated ident
macro_rules! helper { ($name:ident) => (
const $name: i32 = $value;
)}
// call the `with_concat_ident!` macro
with_concat_ident! {
concat!($($tt)*) => helper!
... | Rust | 0 |
ph eId="sec_23N__subsec_4__para_a">
<num>(a)</num>
<content>
<p eId="sec_23N__subsec_4__para_a__p_1">“A” represents the percentage to be determined;</p>
</content>
</paragraph>
<paragraph eId="sec_23N__subsec_4__para_b">
<num>(b)</num>
<content>
<p eId="sec_23N__sub... | Python | 1 |
import _plotly_utils.basevalidators
class CustomdatasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="customdatasrc", parent_name="contour", **kwargs):
super(CustomdatasrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | Python | 1 |
, 'if_cloud')
if cloud_mode:
online_generate_image(prompt, background[0], "background")
else:
generate_image(prompt, background[0], "background")
background_image = background[0]
background_list.append(background_ima... | Python | 1 |
store(1, SeqCst);
//! });
//!
//! assert_eq!(0, v2.load(SeqCst));
//! }
//! ```
//!
//! This program is obviously incorrect, yet the test can easily pass.
//!
//! The problem is compounded when Rust's relaxed memory model is considered.
//!
//! Historically, the strategy for testing concurrent code has been to ... | Rust | 0 |
let iv = (v * imax) as i16;
result.push(iv);
}
result
}
pub fn normalize_f(samples: &Vec<f32>) -> Vec<f32> {
let mut result: Vec<f32> = Vec::with_capacity(samples.len());
let mut max = 0.0;
for v in samples.iter() {
let av = v.abs();
if av > max { max = av; }
}
let ... | Rust | 0 |
physics)
def get_observation(self, physics):
"""Returns an observation of the state."""
obs = collections.OrderedDict()
obs['position'] = physics.position()
obs['velocity'] = physics.velocity()
return obs
def get_reward(self, physics):
"""Returns a quadratic state and control reward."""
... | Python | 1 |
#coding:utf8
import jieba
import numpy as np
'''
分句
'''
def sentence_classify(corpus,target_path,keyword):
fr = open(corpus,"r")
fw = open(target_path,"a")
line = fr.readline()
while line:
# print line
if line.__contains__(keyword):
print line
fw.write(line)
... | Python | 1 |
ctx.save()
ctx.rgb(*scheme.bg).rectangle(-SCREEN_RADIUS, -SCREEN_RADIUS, 2 * SCREEN_RADIUS, 2 * SCREEN_RADIUS).fill()
# label = f"{mday:02d}-{month:02d}-{year:02d}"
# ctx.rgb(*scheme.fg).move_to(-80,60).text(label)
ctx.restore()
self.draw_overlays(ctx)
colours... | Python | 1 |
d:", num_shared_list)
print("num_unique:", num_unique_list)
print("qheads:", qheads_list)
print("kvheads:", kvheads_list)
print("dim:", dim_list)
total = (
len(bs_list)
* len(num_shared_list)
* len(num_unique_list)
* len(qheads_list)
* len(kvheads_list)
... | Python | 1 |
使用插值或前向填充處理缺失值"
))
# 檢測重複數據
if 'symbol' in df.columns and 'date' in df.columns:
duplicates = df.duplicated(subset=['symbol', 'date']).sum()
if duplicates > 0:
issues.append(QualityIssue(
issue_type="duplicate_data",
... | Python | 1 |
.allowlist_recursively(true)
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.generate()
.expect("Failed to generate bindings");
bindings
.write_to_file(out.join("bindings.rs"))
.expect("Failed to write bindings");
}
<filename>src/main.rs
#![no_std]
#![no_main]
extern crate panic_halt;
pub ... | Rust | 0 |
) -> ::std::os::raw::c_int,
>,
pub releaseManagedLibraryExpression: ::std::option::Option<
unsafe extern "C" fn(
mname: *const ::std::os::raw::c_char,
id: mint,
) -> ::std::os::raw::c_int,
>,
pub registerLibraryCallbackManager: ::std::option::Option<
... | Rust | 0 |
trace!("BluetoothDiscoverySession::stop_discovery");
// NOTE: discovery is only stopped when BluetoothAdapter is dropped
Ok(())
}
}
use std::fmt;
use std::fs::File;
use std::io::{BufReader, BufRead};
#[derive(PartialEq, Clone, Copy, Debug)]
enum WaitingPlace {
Floor,
Empty,
Taken,
... | Rust | 0 |
!(s_new_duration_ns, i64);
init_method!(s_new_time_ns, i64);
init_method!(s_new_f32, f32);
init_method!(s_new_f64, f64);
#[rustler::nif]
pub fn s_parse_date32_from_str_slice(name: &str, val: Vec<&str>, fmt: &str) -> ExSeries {
let parsed = Date32Chunked::parse_from_str_slice(name, &val, fmt);
ExSeries::new(par... | Rust | 0 |
c_uchar, value: i32);
fn set_webp_config_alpha_quality(config: *const c_uchar, value: i32);
fn set_webp_config_autofilter(config: *const c_uchar, value: i32);
fn set_webp_config_emulate_jpeg_size(config: *const c_uchar, value: i32);
fn set_webp_config_exact(config: *const c_uchar, value: i32);
fn s... | Rust | 0 |
# Ultroid - UserBot
# Copyright (C) 2021-2023 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://github.com/TeamUltroid/pyUltroid/blob/main/LICENSE>.
from .. import udB
def get_stuff(key="NSFW"):
return udB.get_key... | Python | 1 |
ive IR is also captured at 640x576."]
pub const k4a_depth_mode_t_K4A_DEPTH_MODE_NFOV_UNBINNED: k4a_depth_mode_t = 2;
#[doc = "< Depth captured at 512x512. Passive IR is also captured at 512x512."]
pub const k4a_depth_mode_t_K4A_DEPTH_MODE_WFOV_2X2BINNED: k4a_depth_mode_t = 3;
#[doc = "< Depth captured at 1024x1024. Pas... | Rust | 0 |
import customtkinter
from PIL import Image
import os
import sys
def abs_db_path(file_name: str) -> str:
"""
computes the absolute path of the file (based on this root dir)
:return: absolute path
"""
if hasattr(sys, '_MEIPASS'): # TODO add `data` dir in exe for all data, paste manually
bas... | Python | 1 |
ystem.run();
}
<filename>tests/linalg/qr.rs<gh_stars>1-10
#![cfg(feature = "arbitrary")]
use na::{DMatrix, DVector, Matrix3x5, Matrix4, Matrix4x3, Matrix5x3, Vector4};
use std::cmp;
quickcheck! {
fn qr(m: DMatrix<f64>) -> bool {
let qr = m.clone().qr();
let q = qr.q();
let r = qr.r();
... | Rust | 0 |
false,
timezone: "PT",
pattern: Err(DstJumpedOver(datetime)) if datetime == "2:00 AM 3/14"
},
dst_start_doesnt_exist2 => {
now: "2021-03-13T00:00:00-08:00",
date: "3/14",
hour: 2,
minute: 30,
pm: false,
time... | Rust | 0 |
and_present_verify() {
verify_keys_test(vec![vec![5], vec![6]], vec![Some(vec![5]), None]);
}
#[test]
fn empty_proof() {
let mut tree = make_3_node_tree();
let mut walker = RefWalker::new(&mut tree, PanicSource {});
let (proof, absence) = walker
.create_proof(ve... | Rust | 0 |
data_compaction(manager: &Manager, req : &DataCompactionRequest) {
let part_info = &manager.find_partition_info(req.partition_id);
let mut cache = BlockCache::new(part_info);
let scan_req = ScanRequest {
min_ts: 0,
max_ts: u64::max_value(),
partition_id: req.partition_id,
fi... | Rust | 0 |
kafka_topics.clone(),
kafka_user_resource,
kafka_users.clone(),
secrets.clone(),
),
)?));
// event source - device registry
let registry_dispatcher =
EventDispatcher::one(FnEventProcessor::new(controller.clone(), is_relevant));
let registry = ... | Rust | 0 |
he given volume string.
"""
kvs = volume_str.strip().split(",")
volume_keys = []
parsed_volume_dict = {}
for kv in kvs:
k, v = kv.strip().split("=")
k = k.strip()
v = v.strip()
if k not in volume_keys:
volume_keys.append(k)
else:
raise ... | Python | 1 |
large, so let's count it
num_overages += 1;
if i != (headers_len - 1) {
overage_separator_sum += 3;
}
if i == 0 {
overage_separator_sum += 1;
}
}
... | Rust | 0 |
)[0] != source_docker_repository:
raise InvalidConnectionError(
f"The provided docker image ({source_docker_repository}) does not match the image for connection ID {retrieved_objects.connection_id}. Please double check that this connection is using the correct image. Connection URL: {connect... | Python | 1 |
s should be kept in order to be
/// able to decrypt application messages from previous epochs, the size of
/// the store must be increased through [`max_past_epochs()`].
message_secrets_store: MessageSecretsStore,
}
implement_persistence!(
CoreGroup,
group_context,
group_epoch_secrets,
tree... | Rust | 0 |
e::*;
use crate::errors::{ParquetError, Result};
use crate::record::api::Field;
use crate::schema::types::ColumnDescPtr;
/// Macro to generate simple functions that cover all types of triplet iterator.
/// $func is a function of a typed triplet iterator and $token is a either {`ref`} or
/// {`ref`, `mut`}
macro_rules!... | Rust | 0 |
# main.py — VEDA-CAMPUS Entry Point
# Author: M P Anwar Baba
from modules.veda_core import ask_veda
from modules.logger import log_interaction
def intro():
print("\n====================================")
print(" Welcome to VEDA CAMPUS AI ")
print(" Your Intelligent College Buddy ")
print(... | Python | 1 |
-1])
least_path = []
list_seq1 = []
list_seq2 = []
i = maxi
j = maxj
#we start at max and work back until we reach zero
while path[i][j][0] != -1 and path[i][j][1] != -1:
point = path[i][j]
least_path.append(point)
if i-1 == point[0] and j-1 == point[1]:
... | Python | 1 |
#pixel manipulation for image encryption
from PIL import Image
def encrypt_image(image_path):
img = Image.open(image_path)
width, height = img.size
for x in range(width):
for y in range(height):
pixel = img.getpixel((x, y))
new_pixel = (pixel[2], pixel[0], pixel[1])
... | Python | 1 |
zero over time
once the financial transaction is settled.
"""
result: Literal["APPROVED", "DECLINED"]
"""
APPROVED transactions were successful while DECLINED transactions were declined
by user, Lithic, or the network.
"""
settled_amount: int
"""
Amount of the transaction that ... | Python | 1 |
, show_size, style, theta, aspects, FOV):
relative_path = file_path.relative_to(dir_input)
path_output = dir_output / relative_path.with_suffix(".png")
path_output.parent.mkdir(parents=True, exist_ok=True)
return file_path, path_output, show_size, style, theta, aspects, F... | Python | 1 |
# Razor Enhanced Scripts for Ultima Online by
# GRL
# https://github.com/GloriousRedLeader/omgarturo
# 2025-01-11
# Use at your own risk.
from Scripts.omgarturo.src.fm_core.core_attack import run_dex_loop
# Nothing fancy. Uses consecrate weapon and primary ability.
# Basic dexer loop that attacks nearby mon... | Python | 1 |
o,
WarangCiti,
Yezidi,
YiRadicals,
YiSyllables,
Yijing,
ZanabazarSquare,
ZnamennyMusic,
}
impl UnicodeProperty for Blk {
fn property_value_name(&self) -> PropertyName {
property_names::blk_name(*self)
}
}
/// Unicode property Script(sc).
#[derive(Debug, PartialEq, Clone, Co... | Rust | 0 |
from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
if TYPE_CHECKING:
from ..models.api_field_value import ApiFieldValue
T = TypeVar("T", bound="ApiChartWidgetDataTwoDimensionalElement")
@attr.s(auto_attribs=True)
class ApiChartWidgetDataTwoDimension... | Python | 1 |
_id();
let target = target_node_id();
scorer.payment_path_failed(&payment_path_for_amount(500).iter().collect::<Vec<_>>(), 42);
assert_eq!(scorer.channel_penalty_msat(42, 500, 1_000, &source, &target), 2_000);
SinceEpoch::advance(Duration::from_secs(10));
assert_eq!(scorer.channel_penalty_msat(42, 500, 1_00... | Rust | 0 |
world::World,
};
pub struct SpawnBatchIter<'w, I>
where
I: Iterator,
I::Item: Bundle,
{
inner: I,
spawner: BundleSpawner<'w, 'w>,
}
impl<'w, I> SpawnBatchIter<'w, I>
where
I: Iterator,
I::Item: Bundle,
{
#[inline]
pub(crate) fn new(world: &'w mut World, iter: I) -> Self {
// ... | Rust | 0 |
self.num_envs, self.num_dof
)
self.gym.refresh_dof_state_tensor(self.sim)
self.gym.refresh_actor_root_state_tensor(self.sim)
self.gym.refresh_rigid_body_state_tensor(self.sim)
self.gym.refresh_net_contact_force_tensor(self.sim)
self.gym.refresh_force_sensor_... | Python | 1 |
import pytest
from pygears.util.test_utils import synth_check
from pygears.typing import Union, Uint
from pygears.lib import demux, mux, demux_ctrl
from pygears.lib.delay import delay_rng
from pygears.lib.verif import drv, directed
from pygears.sim import sim
from pygears import Intf, gear
@pytest.mark.parametrize('... | Python | 1 |
import os
import shutil
from fastapi import APIRouter, Depends, HTTPException
from typing import List
from sqlalchemy.orm import Session
from app.core.config import getConfigPath
from app.core.response import Res
from app.db.database import get_db
from app.dto.project_dto import ProjectCreateDTO, ProjectResponseDTO,... | Python | 1 |
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton, InlineKeyboardButton, InlineKeyboardMarkup
fsm_stop_kb_by_message = ReplyKeyboardMarkup(
keyboard=[
[KeyboardButton(text='Вернуться в главное меню')],
], resize_keyboard=True
)
fsm_stop_kb_by_call = InlineKeyboardMarkup(
inline_keyboar... | Python | 1 |
(tx, consensus_branch_id, hash_type, signable_input)
}
<filename>examples/grid/main.rs
#![cfg_attr(not(feature = "gtk_3_10"), allow(unused_variables, unused_mut))]
use gtk::glib;
use gtk::prelude::*;
use gtk::{ApplicationWindow, Builder, Button, Grid};
fn build_ui(application: >k::Application) {
let glade_src =... | Rust | 0 |
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
# Load Titanic dataset
url = "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv"
titanic_df = pd.read_csv(url)
# Bar plot (Embarked vs. Age)
# We should first aggregate the Age values (mean/median)... | Python | 1 |
#WAP to create two base classes LU and ITM and one derived class(Multiple inheritance).
#multiple inheritance
class LU:
subjects=["AI/ML","AR/VR","Cloud Computing","Full Stack Developer"]
teachers=["Sai Sir","Swapnil Sir","ABC","XYZ"]
duration=["60 days","30 days","50 days","55 days"]
class ITM:
subject... | Python | 1 |
def remove_duplicates(nums):
"""
Function to remove duplicates from a sorted list in-place.
Returns the number of unique elements.
"""
# Edge case: If the list is empty, return 0
if len(nums) == 0:
return 0
# Variable to track the position of the next unique element
k = 1 # TO c... | Python | 1 |
0x46,0x90,0x3d,0x2e,0xf4
,0x2f,0xce,0xd4,0x6f,0x08,0x46,0xe7,0x25
,0x7b,0xb1,0x56,0xd3,0xd7,0xb3,0x0d,0x3f]);
let mut state = State::init(&key);
state.update(&c);
let a = state.finalize();
assert!(a == a_expected);
}
}
use mem... | Rust | 0 |
},
DocId, Document, Result, Score, SegmentOrdinal, SegmentReader,
};
pub use cantine_derive_internal::{Aggregable, Filterable};
pub trait Filterable: Sized {
type Query;
type Schema: FilterableSchema<Self, Self::Query>;
fn create_schema<O: Into<IntOptions>>(builder: &mut SchemaBuilder, options: O) ->... | Rust | 0 |
_ms: 4000,
until_ms: 5000,
}));
animations.push(Box::new(StrayAnimation::new(0, 5000, 7.)));
//animations.push(Box::new(SizeAnimation {
//from_ms: 2000,
//until_ms: 3000,
//start_scale: 1.,
//end_scale: 1.5,
//}));
//animations.push(Box::new(SizeAnimation {
//from_ms: ... | Rust | 0 |
from .Section import Section
class AcousticInfiniteSection(Section):
"""The AcousticInfiniteSection object defines the properties of an acoustic section.
The AcousticInfiniteSection object is derived from the Section object.
Notes
-----
This object can be accessed by:
.. code-block:: python
... | Python | 1 |
})
.expect("raw_binary");
run_raw_round_trip_test::<Foo>(bytes.as_slice(), "raw_binary");
}
#[test]
fn raw_regex() {
#[derive(Serialize, Deserialize, PartialEq, Debug)]
struct Foo<'a> {
#[serde(borrow)]
r: RawRegexRef<'a>,
}
let bytes = bson::to_vec(&doc! {
"r": R... | Rust | 0 |
tebooks/text2im.ipynb
model_out = self.forward(x, timestep, y, data_info=data_info, **kwargs)
return model_out.chunk(2, dim=1)[0]
def forward_with_cfg(self, x, timestep, y, cfg_scale, data_info, mask=None, **kwargs):
"""
Forward pass of PixArt, but also batches the unconditional for... | Python | 1 |
ngs,
).collect()
window_spec = Window().order_by("value", desc=desc, nulls_first=nulls_first)
daft_result = (
df.with_column("row_num", row_number().over(window_spec))
.with_column("rank_val", rank().over(window_spec))
.with_column("dense_rank_val", dense_rank().over(window_spec))
... | Python | 1 |
from django.urls import path
from . import views
urlpatterns = [
path('login/', views.login, name='login'),
path('protected/', views.protected, name='protected'),
path('productos/', views.productos_view, name='productos'),
path('productos/<str:producto_id>/', views.producto_detalle_view, name='pro... | Python | 1 |
from tests.support.asserts import assert_error, assert_success
from tests.support.helpers import element_rect
from tests.support.inline import inline
def get_element_rect(session, element_id):
return session.transport.send(
"GET",
"session/{session_id}/element/{element_id}/rect".format(
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.