text string | label_name string | labels int64 |
|---|---|---|
h_k=self.search_k,
include_distances=self.include_distances)
if not self.include_distances:
nearest_ids = [self.inverse_id_map[ind] for ind in nearest_indices]
else:
nearest_ids = dict(zip([self.inverse_id_map[ind] for ind in nearest_indices[0]], nea... | Python | 1 |
from movies.repository import MoviesRepository
import streamlit as st
class MoviesService:
def __init__(self):
self.movies_repository = MoviesRepository()
def get_movies(self):
# small cash to improve performance and API request overhead ;)
if 'movies' in st.session_state:
... | Python | 1 |
0x3271_E326),
(r"meshes\i\in_v_s_int_lcolumn_01.nif", 0x0132_204B, 0x36F4_D2C7),
(r"meshes\i\in_v_s_int_lbridge_02.nif", 0x0132_204B, 0x38E1_D476),
(r"meshes\i\in_v_s_int_lpillar_01.nif", 0x0132_204B, 0x3B45_5CC1),
(r"meshes\i\in_v_s_int_entrance_02.nif", 0x0132_204B, 0x6167_7EF9),
(r"meshes\i... | Rust | 0 |
#former_name_ident
{
#( #fields_none, )*
}
}
}
#[doc = #doc]
#[derive( Debug )]
pub struct #former_name_ident #generics
{
#( #fields_optional, )*
}
impl #generics #former_name_ident #generics
{
#[inline]
pub fn form( mut self ) -> #name... | Rust | 0 |
BKIT_DOM_NODE_FILTER_SHOW_ENTITY_REFERENCE", "16"),
("WEBKIT_DOM_NODE_FILTER_SHOW_NOTATION", "2048"),
("WEBKIT_DOM_NODE_FILTER_SHOW_PROCESSING_INSTRUCTION", "64"),
("WEBKIT_DOM_NODE_FILTER_SHOW_TEXT", "4"),
("WEBKIT_DOM_NODE_FILTER_SKIP", "3"),
("WEBKIT_DOM_NODE_PROCESSING_INSTRUCTION_NODE", "7"),
... | Rust | 0 |
rivate_key_info::PEM_TYPE_LABEL, pem, LineEnding},
alloc::string::String,
core::str::FromStr,
};
#[cfg(feature = "std")]
use {
super::private_key::write_secret_file,
std::{fs, path::Path},
};
/// Encrypted PKCS#8 private key document.
///
/// This type provides heap-backed storage for [`EncryptedPriva... | Rust | 0 |
dim time> de la manana",
datetime_check!(form!(Form::TimeOfDay(_))),
b.reg(r#"(?:a|en|de) la (?:ma[ñn]ana|madrugada)"#)?,
|datetime, _| {
let period = helpers::hour(0, false)?
.span_to(&helpers::hour(12, false)?, false)?;
date... | Rust | 0 |
]
answer = individual_error[2]
question_id = individual_error[3]
kls.answers.append(
{"correct": correct, "question": question, "answer": answer, "id": question_id})
generated_reports = kls.reports.generate_repo... | Python | 1 |
import unittest
from edsl.surveys.exceptions import SurveyRuleCollectionHasNoRulesAtNodeError
from edsl.surveys.rules import Rule, RuleCollection
class TestRuleCollection(unittest.TestCase):
def test_next_question_with_no_rules(self):
rc = RuleCollection()
with self.assertRaises(SurveyRuleCollecti... | Python | 1 |
from subprocess import Popen, PIPE
import os
from os.path import abspath, basename
from time import sleep
import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
pparentdir = os.path.dirname(parentdir)
sys.path.insert(0,pparen... | Python | 1 |
import torch
from torchvision import models
from YOLOv4.models import Yolov4
from lib.models.pose_estimator import EfficientNet, PoseEstimator
from lib.models.feature_extractor import Bottleneck, FeatureExtractor
from lib.models.transformer import SmplTR
from lib.models import builder
from lib.models.smpl import creat... | Python | 1 |
("pyo3_pytests.othermod", m.getattr("othermod")?)?;
sys_modules.set_item("pyo3_pytests.path", m.getattr("path")?)?;
sys_modules.set_item("pyo3_pytests.pyclass_iter", m.getattr("pyclass_iter")?)?;
sys_modules.set_item("pyo3_pytests.subclassing", m.getattr("subclassing")?)?;
Ok(())
}
<reponame>cs2dsb/fel... | Rust | 0 |
for ST-MOCs.")),
Op1::Contract => Err(String::from("Contract border not implemented (yet) for ST-MOCs.")),
Op1::ExtBorder => Err(String::from("External border not implemented (yet) for ST-MOCs.")),
Op1::IntBorder => Err(String::from("Internal border not implemented (yet) for ST-MOCs.")),
Op1:... | Rust | 0 |
: tuple
scores of subject and object corruptions
args : list
Non-key arguments.
kwargs : dict
Key arguments.
Returns
-------
tf.tensor
Model loss.
"""
eps = 1e-10
subs = kwargs["subs"]
objs = kwargs... | Python | 1 |
Kind,
macros,
utils::get_func_addr,
};
use astro_codegen::asts::{SimpleExpr, AST};
use astro_lexer::{Token, TokenKind};
/************************* PARSER *************************/
/// Astro parser.
pub struct Parser {
combinator: Combinator<AST>,
}
type ParserFn<'a> = fn(
args: &[CombinatorArg<'a, A... | Rust | 0 |
ect_type)};
unsafe{cur_node = (*cur_node).next};
$body
}
}
}
};
}
use crate::assembler::parsing::program;
use crate::vm::VM;
use std::io::{self, Write};
pub struct REPL {
vm: VM,
command_buffer: Vec<String>,
}
impl REPL {
//... | Rust | 0 |
fs;
use std::io::{self, Read, Write};
use test::Bencher;
use wain_exec::{DefaultImporter, Runtime};
use wain_syntax_binary::parse;
use wain_validate::validate;
struct Discard;
impl Read for Discard {
fn read(&mut self, _buf: &mut [u8]) -> io::Result<usize> {
Ok(0)
... | Rust | 0 |
#!/usr/bin/env python3
"""
PDE Regularity Generator (pure mathematics)
Elliptic interior regularity and Hölder continuity schematic.
"""
import matplotlib.pyplot as plt
import numpy as np
from pathlib import Path
from typing import Dict, Any
def generate_pde_regularity() -> Dict[str, Any]:
fig, (ax1, ax2) = plt.... | Python | 1 |
fn csv_invariance() {
let mut r_ok = 0;
let mut v_ok = 0;
for _ in 0..ITERATIONS {
let cb = get_random_cb();
let koe0 = get_random_koe(Rc::<CB>::new(cb));
let csv0 = CSV::from_koe(koe0);
let koe1 = KOE::from_csv(csv0.clone());
let c... | Rust | 0 |
#name = input("Enter your full name: ")
#phone_number = input("Enter your phone #: ")
#result = len(name)
#result = name.find("b")
#result = name.rfind("d") # it will return -1 if it cannot find
#name = name.capitalize()
#name = name.upper()
#name = name.lower()
#result = name.isdigit()
#result = name.isalpha()
#resu... | Python | 1 |
// go faster?!
}
duration = now.elapsed().as_nanos();
println!("{}ns to iterate 1000 times with for x in iter (u8 array)...", duration);
}
<reponame>Riey/maple
//! # Maple API Documentation
//!
//! Maple is a VDOM-less web library with fine-grained reactivity.
//!
//! This is the API docs for maple. ... | Rust | 0 |
import my
import tp
def on_you_are_declared_leader(me, x, y):
my.thing_polymorph(me, "sluud_dark")
def on_you_are_declared_a_follower(me, leader, x, y):
r = my.py_non_pcg_random_range_inclusive(1, 100)
if r < 90:
my.thing_polymorph(me, "sluud")
else:
my.thing_polymorph(me, "sluud")
... | Python | 1 |
opcode = Self::OPCODE;
sqe.fd = dirfd;
sqe.addr_splice.addr = pathname as _;
sqe.len = mode;
sqe.op_flags.open_flags = flags as _;
}
}
impl Prepare for OpenAt2 {
type Return = RawFd;
fn prep_sqe(self, sqe: &mut SubmissionQueueEvent) {
let Self {
dirfd,
pathname,
how,
l... | Rust | 0 |
tats()
def check_throughput(iter, total_token_batch_size_per_iter, fn, *args, use_tqdm=False, **kwargs):
t1 = time.time()
out = fn(*args, **kwargs)
t2 = time.time()
time_cost = t2-t1
throughtput = total_token_batch_size_per_iter / time_cost
if use_tqdm:
tqdm.write("Time cost after iter... | Python | 1 |
y borrowed.
/// assert!(monster.try_borrow().is_err());
/// #
/// # Ok(())
/// # }
/// #
/// # fn main() {
/// # try_main().unwrap();
/// # }
/// ```
pub fn try_borrow(&self) -> Result<Ref<T>, BorrowError> {
debug!("Trying to borrow an immutable reference to the inner... | Rust | 0 |
/// Display CLI plot
pub fn display_plot(&self, max_height: u16) {
prepare_term();
let mut next_graph_pos = 0_u16;
next_graph_pos = show_specific_counter(&self.spam_stats, next_graph_pos, max_height);
next_graph_pos = show_specific_counter(&self.ham_stats, next_graph_pos, max_height);
next_graph_pos = show_... | Rust | 0 |
swer: the final answer to the original input question
Begin!
Question: {input}
Thought:{agent_scratchpad}'''
prompt = PromptTemplate.from_template(template)
""" # noqa: E501
missing_vars = {"tools", "tool_names", "agent_scratchpad"}.difference(
prompt.... | Python | 1 |
];
DrawTurn::draw_full(current, g, color_turn_type(current.turn_type, ui));
let mut batch = GeomBatch::new();
for t in ui.primary.map.get_turns_in_intersection(current.id.parent) {
if current.conflicts_with(t) {
DrawTurn::draw_... | Rust | 0 |
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(DeviceStatus::from_glib_borrow(this).unsafe_cast_ref())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"noti... | Rust | 0 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
;
return Ok((cur_node, pos));
}
}
lexer::TokType::LBracket => {
let mut cur_node = ParseNode::new(NodeType::DirectDeclaratorPost(toks[pos].clone()));
let pos = pos + 1;
if let Ok(_) = check_tok(pos, &toks, &lexer::TokType::RBracket) ... | Rust | 0 |
'check',
color=common.Color.Green(),
size=common.Size.Margin(2.0)
)
else:
icon = ui.get_icon(
'file',
size=common.Size.Margin(2.0)
)
self._data[len(self._data)] = {
... | Python | 1 |
from typing import Any
from just_agents.base_agent import ChatAgent
from just_agents.llm_options import LLAMA3_3
"""
This example shows how to use agents with different LLM models to simulate a moderated debate between Kamala Harris and Donald Trump
"""
if __name__ == "__main__":
kamala_options = LLAMA3_3
tr... | Python | 1 |
# Copyright (c) 2024 Microsoft Corporation.
# Licensed under the MIT License
"""Typing definitions for the OpenAI DataShaper package."""
from collections.abc import Callable
from .llm_invocation_result import LLMInvocationResult
ErrorHandlerFn = Callable[[BaseException | None, str | None, dict | None], None]
"""Err... | Python | 1 |
} else if self == &R1 {
write!(f, "R1")
} else if self == &R2 {
write!(f, "R2")
} else if self == &R3 {
write!(f, "R3")
} else if self == &R4 {
write!(f, "R4")
} else if self == &R5 {
... | Rust | 0 |
self.frame_size = 128
self.frame_shift = int(sample_rate * self.targetrate / 10000000)
self.mfcc_front_end = MFCCFrontEnd(sample_rate, self.frame_size, usec0=self.usec0,
usedelta=self.usedelta, useacc=self.useacc,
... | Python | 1 |
_cache(
#[marshal(cffi::ArcRefMarshaler::<PrefixPackageStore>)] handle: Arc<PrefixPackageStore>,
) {
handle.clear_cache();
}
#[derive(Debug, thiserror::Error)]
#[error("{0}")]
struct RefreshRepoError(&'static str);
#[cffi::marshal(return_marshaler = "cffi::UnitMarshaler")]
pub extern "C" fn pahkat_prefix_pack... | Rust | 0 |
rn output_filename
def filter_entropy_fastqs(fastq: Path, output_filename: Path) -> None:
"""Filter FASTQ records based on entropy and write the filtered records to a new FASTQ file.
:param canu_fastq: Input FASTQ file containing long read sequences.
:param outdir: Output directory for the filtered FASTQ... | Python | 1 |
# recognition_opencv.py
import cv2
import numpy as np
import os
# Load OpenCV's Haarcascade face detector
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
# Load LBPH face recognizer
recognizer = cv2.face.LBPHFaceRecognizer_create()
dataset_path = "faces"
labels, fa... | Python | 1 |
write(&mut self, device: u8, register: u8, dat: u8) -> bool {
if let Some(p) = self.periphs.get_mut(&device) {
p.write(register, dat)
} else {
panic!("Unimplemented I2C write for peripheral at 0x{:02X}", device);
}
}
}
pub fn make_peripherals() -> I2cPeripherals {
... | Rust | 0 |
: NO_ITEM,
},
}
}
}
#[cfg(test)]
mod node_test {
use super::*;
#[test]
fn test_from_into() {
let root_decoded = DecodedNode::Root(129);
let root_raw = Node {
base: 129,
check: NO_PARENT,
id: 0,
};
let term_decoded ... | Rust | 0 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Python | 1 |
\
ORDER BY to_main_chain_index DESC LIMIT 1",
kind, address
)
};
let mut stmt = db.prepare(&sql)?;
let mut rows = stmt.query_map(&[], |row| row.get::<_, u32>(0))?;
let row = rows.next();
if row.is_none() {
Ok(0)
} else {
Ok(row.unwrap()? + 1)
... | Rust | 0 |
\"interactive-rebase-tool.breakColor\" is not valid: \"256\" is not a valid color index. Index must be \
between 0-255."
)]
fn value_parsing_invalid(#[case] value: &str, #[case] expected_error: &str) {
with_git_config(
&["[interactive-rebase-tool]", format!("breakColor = {}", value).as_str()],
|git_config|... | Rust | 0 |
# Problem: Prime Pairs With Target Sum - https://leetcode.com/problems/prime-pairs-with-target-sum/description/
class Solution:
def findPrimePairs(self, n: int) -> List[List[int]]:
'''Approach: Maths. The problem asks to find prime pairs that are
less than or equal to the target and sum up to the t... | Python | 1 |
# Copyright (C) 2013 Google Inc. All rights reserved.
# Copyright (C) 2017 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the abov... | Python | 1 |
12usize,
concat!(
"Offset of field: ",
stringify!(ACameraCaptureSession_captureCallbacks),
"::",
stringify!(onCaptureCompleted)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<ACameraCaptureSession_captureCallbacks>())).o... | Rust | 0 |
#!/usr/bin/env python3
# date: 2020.01.25
# https://stackoverflow.com/questions/59902716/how-to-rotate-element-around-pivot-point-in-pygame
import pygame
import time
import math
# --- constants --- (UPPER_CASE_NAMES)
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, ... | Python | 1 |
tMessageHandler;
use crate::frontend::utility_types::MouseCursorIcon;
use crate::input::keyboard::{Key, MouseMotion};
use crate::input::InputPreprocessorMessageHandler;
use crate::layout::widgets::{LayoutRow, NumberInput, PropertyHolder, Widget, WidgetCallback, WidgetHolder, WidgetLayout};
use crate::message_prelude::*... | Rust | 0 |
"Please retry or manually install them to proceed.\n"
"To manually install the weights, please refer to the documentation here :\n"
"https://github.com/gaudot/SlicerDentalSegmentator",
)
return False
if self.destWeightFolder.exists():
... | Python | 1 |
import frappe
@frappe.whitelist()
def get_context(context):
doctrinal_statement = frappe.get_doc('Doctrinal Statement')
context.doctrinal_statement = doctrinal_statement.doctrinalst
@frappe.whitelist()
def get_doctrinal_statement():
print("Method DS called from SA")
doctrinal_statement = frappe.get_doc(... | Python | 1 |
fault();
let options = CommandOptions {
desc: Some("Mute a user. Can provide an optional reason and time.".to_string()),
usage: Some("<user_resolvable> [/t time] [/r reason]".to_string()),
example: Some("@Adelyn /t 1day /r spam".to_string()),
required_permissions:... | Rust | 0 |
.iter())
.fold(true, move |st, (lhs, rhs)| {
st && lhs.ulps_eq(&rhs, epsilon.clone(), max_ulps)
})
}
}
impl<T> ops::Div<T> for Matrix3<T>
where
T: num_traits::Num + Copy,
{
type Output = Self;
#[inline]
fn div(self, rhs: T) -> Self {
let mut output = s... | Rust | 0 |
fg="green",
)
commands = click.CommandCollection(sources=[common, interactive_graph])
elif is_insight_mode(context.flex):
if context.context == "global":
if len(sys.argv) < 2 or sys.argv[1] != "use":
info("Using GLOBAL.", fg="green", bold=True)
... | Python | 1 |
| s.to_string()).collect());
for p in parts {
for (pattern, escaped) in replacements.clone() {
if p.contains(pattern) && p != pattern && p != format!("{}{}", pattern, pattern) {
let replacement = p.replace(pattern, escaped);
text = text.replace(&p, &replacement);... | Rust | 0 |
cursor = next;
}
timeline
}
pub fn timeline(&self, kind: TimelineType) -> Timeline {
Timeline::new(self.timeline_map(kind), kind)
}
}
#[cfg(test)]
mod tests {
use super::*;
static MOCK: &str = r"
[2001-01-19, 02:34:56] Foo: Hey! 💩
[2001-01-21, 02:34:56] Bar Baz: heyyyyyy... | Rust | 0 |
"""
提供凯撒密码的加密和解密函数
由 FireStar0507 编写
Provides encryption and decryption functions for Caesar ciphers
Written by FireStar0507
"""
# 定义小写字母、大写字母、数字和符号的列表
abc = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
ABC = ["A", "B", "C", "D", "E... | Python | 1 |
not handle some situations such as below
//! (error handlings are omitted for simplicity):
//!
//! ```rust
//! # use on_demand::generate_on_demand_macro;
//! # use std::io::{Seek, Read, SeekFrom};
//! fn foo<T: Seek + Read>(binary: &mut T) {
//! generate_on_demand_macro!(a: u32 = None, {
//! let mut buf = ... | Rust | 0 |
c', np.array([0, 1]), np.array([0, 1]), (2, 2)),
('a', 'd', np.array([]), np.array([]), (2, 2)),
('b', 'c', np.array([]), np.array([]), (2, 2)),
('b', 'd', np.array([0, 1]), np.array([0, 1]), (2, 2)),
]
self._check_results(expected, result)
def test_sparse_matrix... | Python | 1 |
put them into a vector
pub fn parse_entries(&mut self) -> Result<Vec<Rc<RefCell<V1Entry>>>, V1KpdbError> {
let mut entry_number: u32 = 0;
let mut cur_entry = Rc::new(RefCell::new(V1Entry::new()));
let mut entries: Vec<Rc<RefCell<V1Entry>>> = vec![];
let mut field_type: u16;
... | Rust | 0 |
for s in strategies {
cards = match s {
ShuffleStrategy::Invert => cards.into_iter().rev().collect::<VecDeque<_>>(),
ShuffleStrategy::Cut(c) => {
let c = *c;
let range = if c < 0 { c..0 } else { 0..c };
for _ in range {
... | Rust | 0 |
lt, Constructor, Display)]
pub struct NodeId(pub u64);
pub trait NodeIdHolder {
fn node_id(&self) -> NodeId;
}
impl NodeIdHolder for Node {
#[inline]
fn node_id(&self) -> NodeId {
match *self {
Node::ConstantValue(ref value) => value.node_id,
Node::Identifier(ref identifier... | Rust | 0 |
,
"custard": "🍮",
"honeyPot": "🍯",
"shortcake": "🍰",
"bentoBox": "🍱",
"potOfFood": "🍲",
"cooking": "🍳",
"forkKnife": "🍴",
"teacupOutHandle": "🍵",
"sakeBottleAndCup": "🍶",
"wineGlass": "🍷",
"cocktailGlass": "🍸",
"t... | Python | 1 |
ias=q_module.bias,
)
else:
raise NotImplementedError
regularization_loss, reconstruction_loss = self.adaptive_round_loss_fn(
fp_out,
q_out,
ada_quantizer.V,
curr_iter=g... | Python | 1 |
_proto()
)
})
}
fn default_instance() -> &'static NodeInfo {
static instance: ::protobuf::rt::LazyV2<NodeInfo> = ::protobuf::rt::LazyV2::INIT;
instance.get(NodeInfo::new)
}
}
impl ::protobuf::Clear for NodeInfo {
fn clear(&mut self) {
self.cpu.clear();
... | Rust | 0 |
metadata[j][text_key] = line
to_upsert = zip(ids_batch, embeds, metadata)
# upsert to Pinecone
index.upsert(vectors=list(to_upsert), namespace=namespace)
return cls(index, embedding.embed_query, text_key, namespace)
@classmethod
def from_existing_index(
... | Python | 1 |
kernel_initializer = 'he_normal'))(conv9)
conv9 = TimeDistributed(Conv2D(3, 3, activation = 'relu', padding = 'same',
kernel_initializer = 'he_normal'))(conv9)
if linear_layer:
conv10 = TimeDistributed(Conv2D(nb_ch_out, 1, activation = None))(conv9)
... | Python | 1 |
a", lib_name)).exists() {
Some("static")
} else {
None
}
}
fn main() {
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();
let config_build_from_source = env::var("CARGO_FEATURE_BUILD_FROM_SOURCE").is_ok();
let ex... | Rust | 0 |
o(be_some().value(1));
expect!(catalog_manager.get_column_index("table", "col_3")).to(be_some().value(2));
}
<filename>examples/vm.rs
extern crate hibitset;
extern crate rtforth;
extern crate time;
use self::hibitset::BitSet;
use rtforth::core::{Control, Core, ForwardReferences, Stack, State, Wordlist};
use rtfort... | Rust | 0 |
perature;
use super::db;
const TEMPERATURE_CHECK_DT: u128 = 5000;
pub async fn run_main_loop() {
let mut last_temp_check = time::UNIX_EPOCH;
let mut interval = tokio::time::interval(Duration::from_secs(1));
let mut now;
let mut db = db::DbItf::new().await;
let mut current_temperature;
interva... | Rust | 0 |
ome-seeing_free-atmosphere")
.build()
.into();
let mut timer: Initiator<_> = Timer::new(n_sample).into();
timer.add_output().build::<Tick>().into_input(&mut atm);
atm.add_output().build::<WfeRms>().log(&mut sink).await;
atm.add_output().build::<Wavefront>().log(&... | Rust | 0 |
,
op: UnaryOp::Neg,
},
Database { exprs },
);
}
#[test]
fn lower_variable_ref() {
check(
"$foo",
Expr::VariableRef { var: "$foo".into() },
Database::default(),
);
}
#[test]
fn lower_variable_def... | Rust | 0 |
for x in range(1, 2031):
num = 6**260 + 6 ** 160 + 6 ** 60 - x
res = ''
while num:
res += str(num%6)
num //= 6
if res.count('0') == 202:
print(x)
break
| Python | 1 |
,
rn,
rm,
extendop,
},
}
}
fn alu_inst_immlogic(op: ALUOp, rd: Writable<Reg>, rn: Reg, rm: ResultRSImmLogic) -> Inst {
match rm {
ResultRSImmLogic::ImmLogic(imml) => Inst::AluRRImmLogic {
alu_op: op,
rd,
rn,
imm... | Rust | 0 |
4000,
"temperature": 0.7,
"provider": "google"
},
AIModel.GEMINI_FLASH: {
"max_tokens": 8192,
"temperature": 0.7,
"provider": "google"
},
AIModel.GPT_4_TURBO: {
"max_tokens": 4... | Python | 1 |
# Copyright (c) 2024 PaddlePaddle Authors. 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 by appli... | Python | 1 |
= " Link metrics Enhanced-ACK Based Probing management"]
#[doc = "** Format: 6Cd - Write only"]
#[doc = "*"]
#[doc = "* Required capability: `SPINEL_CAP_THREAD_LINK_METRICS`"]
#[doc = "*"]
#[doc = "* `6` : IPv6 destination address"]
#[doc = "* `C` : Indicate whether to register or clear the probing. `0` - clear, `1` -... | Rust | 0 |
"""
Firstly we find the middle node of the list,
we then reverse the second half of the list and set 2 pointers,
left pointer at the beginning of the list and a right pointer at the beginning of the reversed second half of the list.
We then check all sums and keep track of a max.
O(n) time O(1) space.
"""
# ... | Python | 1 |
padded!(Aes256Cbc, AnsiX923, ciphertext, key, iv),
"AES-192-CBC-ANSIX923" => decrypt_padded!(Aes192Cbc, AnsiX923, ciphertext, key, iv),
"AES-128-CBC-ANSIX923" => decrypt_padded!(Aes128Cbc, AnsiX923, ciphertext, key, iv),
"AES-256-CBC-ISO7816" => decrypt_padded!(Aes256Cbc, Iso7816, ciphertext, ke... | Rust | 0 |
import string
import os
import requests as re
from bs4 import BeautifulSoup
URL = "https://www.nature.com/nature/articles?sort=PubDate&year=2020&page="
DOMAIN = "https://www.nature.com"
headers = {'Accept-Language': 'en-US,en;q=0.5'}
def get_scrap_details():
page_no = int(input())
article_type = input()
... | Python | 1 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Python | 1 |
gopro_image = image_link[1].get_attribute('src')
new_product(sql, connection, iphone_name, iphone_price,
site, datetime.now(), iphone_image)
new_product(sql, connection, gopro_name, gopro_price,
site, datetime.now(), gopro_image)
print('2- Success')
def scrapy_website3(... | Python | 1 |
import os
import pandas as pd
from dagster import asset, AssetKey, AssetSpec
import example_pipeline.config as config
source_path = os.getenv("SOURCE_FILENAME")
source_name = os.path.splitext(os.path.basename(source_path))[0]
aws_bucket = os.getenv("AWS_BUCKET")
csv_asset = AssetSpec(
key = AssetKey("csv_asset")... | Python | 1 |
ion::is_none")]
pub description: Option<String>,
/// Textual representation of an expression in Common Expression Language syntax.
#[serde(skip_serializing_if = "Option::is_none")]
pub expression: Option<String>,
/// Optional. String indicating the location of the expression for error reporting, e.g... | Rust | 0 |
);
m.insert(c, 1 + m[&c]);
}
if map == m { return true }
start += 1;
end += 1;
}
false
}
// not needed lmao
// fn is_permutation(s1: &str, s2: &str) -> bool {
// if s2 == "" { return false }
// let mut string = s2.to_string();
// for i in 0..s1.len() {
// let c =... | Rust | 0 |
.len(),
"simple.hlsl\0".as_ptr() as _,
null(),
null_mut(),
"PSMain\0".as_ptr() as _,
"ps_5_0\0".as_ptr() as _,
0,
0,
&mut ptr,
&mut err,
);
if !err.is_n... | Rust | 0 |
lt */
if !varString.is_null() && *varString as i32 != 0i32 {
strcat(name_of_file, b"/\x00" as *const u8 as *const i8);
strcat(name_of_file, varString);
}
if !featString.is_null() && *featString as i32 != 0i32 {
strcat(name_of_file, b":\... | Rust | 0 |
e<'a>(&'a self, path: &str) -> Cow<'a, str> {
use self::Token::*;
match *self {
ArgumentTemplate::Tokens(ref tokens) => {
let mut s = String::new();
for token in tokens {
match *token {
Basename => s += basename(pat... | Rust | 0 |
vm.x86.avx512.psrli.w.512"]
fn vpsrliw(a: i16x32, imm8: u32) -> i16x32;
#[link_name = "llvm.x86.avx512.psrlv.w.512"]
fn vpsrlvw(a: i16x32, b: i16x32) -> i16x32;
#[link_name = "llvm.x86.avx512.psrlv.w.256"]
fn vpsrlvw256(a: i16x16, b: i16x16) -> i16x16;
#[link_name = "llvm.x86.avx512.psrlv.w.128... | Rust | 0 |
1.len(), 0);
assert!(l1.is_empty());
let l2 = GuideLibrary::new(vec![g1.clone(), g2.clone()]).unwrap();
assert_eq!(l2.len(), 2);
assert_eq!(l2.guides, vec![g1, g2]);
assert_eq!(l2.guide_length, 20);
}
#[test]
fn test_guide_library_rejects_mixed_length() {
le... | Rust | 0 |
import tensorflow as tf
import keras
from keras import datasets, layers, models
import matplotlib.pyplot as plt
import numpy as np
from keras.models import load_model
import cv2
import os
from PIL import Image
from keras.models import Sequential
from keras_preprocessing.image import img_to_array
from keras.layers impor... | Python | 1 |
feature
};
let search = gen();
let data = (0..16384).map(|_| gen()).collect::<Vec<_>>();
c.bench_function("space: 4-nn in 16384", |b| {
b.iter(|| space::LinearKnn(data.iter()).knn(&search, 4).len())
})
.bench_function("min_by_key: 1-nn in 16384", |b| {
b.iter(|| {
... | Rust | 0 |
1);
let y_ssa = {
let mut cur = FuncCursor::new(&mut func).at_bottom(block0);
cur.ins().iconst(I32, 2)
};
ssa.def_var(y_var, y_ssa, block0);
assert_eq!(ssa.use_var(&mut func, x_var, I32, block0).0, x_ssa);
assert_eq!(ssa.use_var(&mut func, y_var, I32, bloc... | Rust | 0 |
F::dropout(x, self.dropout_rate, train), out_len),
1,
)
})
.collect();
let hs = self.conv.forward(F::batch::concat(xs));
let masks: Vec<f32> = masks.into_iter().flatten().collect();
let masks: V = F::input(([1, out_len, 1], batch_size),... | Rust | 0 |
last_published_pubkey_expiry");
// Time it takes to process a single block.
pub static ref PROCESS_NEXT_BLOCK_TIME: Histogram = OP_COUNTERS.histogram("process_next_block_time");
// Time it takes to perform the enclave ingest_txs call.
pub static ref INGEST_TXS_TIME: Histogram = OP_COUNTERS.histogram("... | Rust | 0 |
(format!("execute store success score {dst} if score {src} matches 0"));
}
&LirInstr::Eqz64(dst, src) => {
let src_lo = src.lo();
let src_hi = src.hi();
assert_ne!(dst, src_lo);
code.push(format!("execute store success score {dst} if score {src_lo} matches 0"));
code.push(format!("execute if score {d... | Rust | 0 |
swapchain
pub extern "C" fn alvr_create_swapchain(
images_count: u64,
width: u32,
height: u32,
format: u32,
sample_count: u32,
handle: bool, // create handle to DXGI resource, ignored on Linux
textures: *mut c_void, // array of size images_count
) -> u64 {
0
}
pub extern "C" f... | Rust | 0 |
o_binary(&Cw20ExecuteMsg::Transfer {
recipient: recipient.to_string(),
amount,
})?,
funds: vec![],
})),
AssetInfo::NativeToken { .. } => Ok(CosmosMsg::Bank(BankMsg::Send {
to_address: recipient.to_string(),
... | Rust | 0 |
locators.add_adhoc_filter_button.click()
@TestStep(When)
def click_save_confirmation_button(self):
"""Click save confirmation button."""
locators.save_confirmations_button(grafana_version=self.context.grafana_version).click()
@TestStep(When)
def click_refresh_button(self):
"""Click refresh button.... | Python | 1 |
ctory(
context_factory, acceptable_protocols=[b"h2"]
)
self.endpoint_factory = _StandardEndpointFactory(
self._reactor, self._context_factory, connect_timeout, bind_address
)
def get_endpoint(self, uri: URI) -> HostnameEndpoint:
return self.endpoint_factory.e... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.