text string | label_name string | labels int64 |
|---|---|---|
tent=user_content)],
stream_tokens=True,
)
response_content = ""
for chunk in stream:
# Check if chunk has message_type attribute (Letta's streaming format)
if hasattr(chunk, "message_type"):
message_type = getattr(chunk, "message_type", None... | Python | 1 |
or_search.hybrid_search(query, query_embedding)
status.update(label="Done!", state="complete", expanded=False)
time.sleep(1)
for result in results:
st.session_state.messages.append({"role": "ai", "content": result})
col1, col2 = st.columns(2)
doc_toggle = col1.toggle("Document ret... | Python | 1 |
);
}
#[test]
fn issue_attribues_have_no_default_namespace () {
test(
br#"<hello xmlns="urn:foo" x="y"/>"#,
br#"
|StartDocument(1.0, UTF-8)
|StartElement({urn:foo}hello [x="y"])
|EndElement({urn:foo}hello)
|EndDocument
"#,
ParserCon... | Rust | 0 |
ps: List[ReasoningStep]) -> str:
"""Create the conclusion section."""
# Calculate overall confidence
avg_confidence = sum(step.confidence for step in reasoning_steps) / len(reasoning_steps) if reasoning_steps else 0
conclusion = f"Based on the multi-step analysis of '{query}', t... | Python | 1 |
1}, {0.5 * ({lambda}-{phi})}
cnot {0}, {1}
rz {1}, {-0.5 * ({phi}+{lambda})}
ry {1}, {-0.5 * {theta}}
cnot {0}, {1}
ry {1}, {0.5 * {theta}}
rz {1}, {phi}
rz {0}, {0.5 * ({phi} + {lambda})}"#);
declare_controlled!(
/// Controlled `V` gate.
CV, crate::gates::V,
cost=2.0*CX::cost() + crate::gates::U1::cost() ... | Rust | 0 |
t chunk_storage = edited_chunks.take_storage();
let mut changed_chunk_mins: Vec<_> =
chunk_storage.chunk_keys().map(|k| k.minimum).collect();
for (chunk_key, chunk) in chunk_storage.into_iter() {
voxels.write_chunk(chunk_key, chunk);
}
// TODO: we currently assu... | Rust | 0 |
"type":"uint256"},{"internalType":"address payable","name":"_refundAddress","type":"address"},{"internalType":"uint256","name":"_amountLD","type":"uint256"},{"internalType":"uint256","name":"_minAmountLD","type":"uint256"},{"components":[{"internalType":"uint256","name":"dstGasForCall","type":"uint256"},{"internalType"... | Python | 1 |
#!/usr/bin/env python3
"""
Setup script for AI Trade Matching System
Creates necessary directories and sample data for first-time setup
"""
import os
import sys
from pathlib import Path
def create_directories():
"""Create necessary directories"""
directories = [
'data/BANK',
'data/COUNTERPARTY'... | Python | 1 |
def exec15():
massa= float(input("Informe o peso em Kg: "))
altura= float(input("Informe a altura em metros: "))
imc= massa/(altura**2)
if imc<20:
print("Sua faixa de risco é: ABAIXO DO PESO")
elif imc>=20 and imc<25:
print("Sua faixa de risco é: NORMAL")
elif imc>=25 and... | Python | 1 |
true,
Shareability::InnerSharable,
AccessPermission::KernelOnly,
MemoryAttr::DevicenGnRnE,
);
}
KERNEL_PUD[kernel_base.table_index::<Level3>() + 1] = Entry::page_entry(
PhysAddr(0x40000000),
true,
true,
true,
Shareab... | Rust | 0 |
# -*- coding: utf-8 -*-
"""home
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1VMvSIHAPbldkvpgkQ2X_YJcF8U4224y6
"""
# Arquivo: pages/home.py
import dash
from dash import dcc, html, callback, Input, Output, State, no_update
import dash_bootstrap_components a... | Python | 1 |
INE_AA)
print(em, current)
em_count += 1
print(em_count)
if em_count >= 60:
if current != em:
current = em
if current != "happy":
... | Python | 1 |
from typing import Any, Dict, TypeVar
from sqlalchemy.orm import DeclarativeBase
ModelType = TypeVar('ModelType', bound='Base')
class Base(DeclarativeBase):
def as_dict(self) -> Dict[str, Any]:
result: Dict[str, Any] = {}
for attr, value in self.__dict__.items():
if attr.startswith(... | Python | 1 |
d IPs but not other ranges.
# Dynamic ranges cannot overlap anything (no ranges or IPs).
if self.type == IPRANGE_TYPE.RESERVED:
unused = self.subnet.get_ipranges_available_for_reserved_range(
exclude_ip_range_id=self.id
)
else:
unused = self.su... | Python | 1 |
t
"""
注释:
代码要兼容GPU,则必须使用 dtype=theano.config.floatX,并且定义为theano.shared
另外,W的初始化有个规则:如果使用tanh函数,则在-sqrt(6./(n_in+n_hidden))到sqrt(6./(n_in+n_hidden))之间均匀
抽取数值来初始化W,若时sigmoid函数,则以上再乘4倍。
"""
#如果W未初始化,则根据上述方法初始化。
#加入这个判断的原因是:有时候我们可以用训练好的参数来初始化W,见我的上一篇文... | Python | 1 |
{ChangedFieldIndices, ParsedFields};
use syn::__private::TokenStream2;
impl ParsedFields {
pub(super) fn generate_delta_type_one_batch(
&self,
prefix: &str,
dipa_attrs: &DipaAttrs,
) -> TokenStream2 {
let delta_name = self.delta_name(prefix);
let delta_owned_name = self.... | Rust | 0 |
r own speech
speak(response if response else "Command executed successfully!")
else:
speak("I apologize, but I couldn't complete that task. Would you like to try something else?")
return success
except Exception as e:
logger.error(f"Error process... | Python | 1 |
a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
self.w
}
}
#[doc = "Reader of field `VEC0`"]
pub type VEC0_R = crat... | Rust | 0 |
.getPluginDevApplyList.html
/// 使用者的类目
pub categories: Vec<HashMap<String, String>>,
/// 使用者的申请时间
pub create_time: String,
/// 使用者的小程序码
pub apply_url: String,
/// 使用者的申请说明
pub reason: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PluginList {
/// 申请或使用中的插件列表
pub ... | Rust | 0 |
_);
crate::uvret(unsafe {
uv_fs_event_getpath(self.handle, buf.as_mut_ptr() as _, &mut size as _)
})
.map(|_| {
// size is the length of the string, *not* including the null
unsafe { buf.set_len((size as usize) + 1) };
unsafe { CStr::from_bytes_wi... | Rust | 0 |
"q" for Save Graphics State).
:return: The name of the operator as a string.
"""
return "Td"
def get_number_of_operands(self) -> int:
"""
Retrieve the expected number of operands for this operator.
The number of operands varies depending on the operator's purpose.... | Python | 1 |
page: Optional[int] = 1,
number_of_items_per_page: Optional[int] = 20,
_=Depends(AuthorizationService.check_user_access_token)) -> PageDTO[TypingDTO]:
"""
Advanced search for transformers typing
"""
return TypingService.searc... | Python | 1 |
pher<T, U, V>(ciphered_text: T, key: U, charset: V) -> Result<String>
// where T: AsRef<str>,
// U: AsRef<str>,
// V: AsRef<str> {
pub fn decipher(ciphered_text: &str, key: &str, charset: &str) -> Result<String>{
check_substitution_key(&key, &charset)?;
let mut deciphered_message = Strin... | Rust | 0 |
from itertools import permutations
graph = 'АБ БГ ГЕ ЕЗ ЗД ДВ ВА БВ ГД'.split()
matrix = '67 567 456 35 234 123 12'.split()
print(*range(1, 8))
for i in permutations('АБВГДЕЗ'):
if all(str(i.index(x) + 1) in matrix[i.index(y)] for x, y in graph):
print(*i)
| Python | 1 |
ars the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
self.w
... | Rust | 0 |
"""
==============================
Lasso on dense and sparse data
==============================
We show that linear_model.Lasso provides the same results for dense and sparse
data and that in the case of sparse data the speed is improved.
"""
print(__doc__)
from time import time
from scipy import sparse
from scipy ... | Python | 1 |
srv(c1));
cli(c2);
t.join().unwrap();
}
mod private {
use super::*;
pub trait Sealed {}
// Impl for all exported protocol types
impl Sealed for Eps {}
impl<A, P> Sealed for Send<A, P> {}
impl<A, P> Sealed for Recv<A, P> {}
impl<P, Q> Sealed for Choose<P, Q> {}
impl<P, Q> Seale... | Rust | 0 |
st(read_config("black_list"), "masiro"):
continue
self.books.append(book)
async def build_book_info(self, book: Book):
url = f"{self.domain}/admin/novelView?novel_id={book.book_id}"
res = await request.get(url, self.header, self.session)
if not res:
... | Python | 1 |
from keras_core import backend
from keras_core import ops
class DropoutRNNCell:
"""Object that holds dropout-related functionality for RNN cells.
This class is not a standalone RNN cell. It suppose to be used with a RNN
cell by multiple inheritance. Any cell that mix with class should have
following ... | Python | 1 |
import requests, time, json, statistics, argparse
def bench_once(model, prompt, host="http://localhost:11434", num_predict=512):
url = f"{host}/api/generate"
t0 = time.perf_counter()
with requests.post(url, json={
"model": model,
"prompt": prompt,
"stream": True,
"options": ... | Python | 1 |
ty1 => Matrix2<f32>, ty2 => Vector2<f32>)
});
bench_ultraviolet!(group, size, |b, size| {
use ultraviolet::{Mat2, Vec2};
bench_binop!(b, size, op => mul, ty1 => Mat2, ty2 => Vec2)
});
bench_nalgebra!(group, size, |b, size| {
use nalgebra::{Matrix2, Ve... | Rust | 0 |
llvm_narrow_i16x8_u(a: i32x4, b: i32x4) -> i16x8;
#[link_name = "llvm.wasm.avgr.unsigned.v8i16"]
fn llvm_avgr_u_i16x8(a: i16x8, b: i16x8) -> i16x8;
#[link_name = "llvm.wasm.widen.low.signed.v8i16.v16i8"]
fn llvm_widen_low_i16x8_s(a: i8x16) -> i16x8;
#[link_name = "llvm.wasm.widen.high.signed.v8i16.v... | Rust | 0 |
# Build a query engine from the index
query_engine = index.as_query_engine()
# Execute a query and print the response
response = query_engine.query('Give me my calendar.')
print(response)
| Python | 1 |
# How Conditions & if else statements Works:
a = 30
b = 50
if(a == b):
print('equal')
else:
print('not equal')
if(a < b):
print('a is less than b')
else:
print('b is greater than a')
if(a > b):
print('a is greater than b')
else:
print('b is less than a')
""" Output: not equal
a... | Python | 1 |
#!/usr/bin/env python
thumbs = [
{
'src': 'vignettes/figures/ggrepel/empty_string-1.png',
'href': 'vignettes/ggrepel.md#hide-some-of-the-labels'
},
{
'src': 'vignettes/figures/ggrepel/point_padding_na-1.png',
'href': 'vignettes/ggrepel.md#do-not-repel-labels-from-data-points... | Python | 1 |
ils.deposit, &deposit, &old_deposit)
})?;
}
Attribute::<T, I>::insert(
(class, maybe_instance, key.clone()),
(value.clone(), deposit),
);
Self::deposit_event(Event::AttributeSet(class, maybe_instance, key, value));
Ok(())
}
/// Clear attribute for an asset class or instance.
///
/// ... | Rust | 0 |
# This file was auto-generated by Fern from our API Definition.
import typing
LoraTargetModules = typing.Union[
typing.Literal[
"LORA_TARGET_MODULES_UNSPECIFIED",
"LORA_TARGET_MODULES_QV",
"LORA_TARGET_MODULES_QKVO",
"LORA_TARGET_MODULES_QKVO_FFN",
],
typing.Any,
]
| Python | 1 |
): Type of mixer (default is 'ResidualMixer').
normalization (str): Type of normalization ('batchnorm', 'instancenorm', or None).
"""
super(ResidualConvBlock, self).__init__()
# Handle padding logic: 'same' means padding to preserve the input dimensions
if padding.lower() ==... | Python | 1 |
0,
0xF0, 0x90, 0xF0, 0x90, 0x90,
0xE0, 0x90, 0xE0, 0x90, 0xE0,
0xF0, 0x80, 0x80, 0x80, 0xF0,
0xE0, 0x90, 0x90, 0x90, 0xE0,
0xF0, 0x80, 0xF0, 0x80, 0xF0,
0xF0, 0x80, 0xF0, 0x80, 0x80
];
<filename>spinoso-time/src/time/chrono/math.rs
use crate::time::chrono::Time;
impl Time {
/// Returns a new... | Rust | 0 |
from interfaces.instruction import Instruction
from environment.types import ExpressionType
class Print(Instruction):
def __init__(self, line, col, Exp):
self.line = line
self.col = col
self.Exp = Exp
def ejecutar(self, ast, env, gen):
for exp in self.Exp:
val = exp... | Python | 1 |
d ind app :
Condition 1 :
The base `Const(..)` obtained by unfolding is the ind_const for the constructor's
parent inductive. IE `list.cons` for some type `A : Type u` has to end with
an application of `Const("list", [u])` to some arguments.
Condition 2 :
The number of argument... | Rust | 0 |
"""
2506. Count Pairs Of Similar Strings
Easy
Topics
premium lock icon
Companies
Hint
You are given a 0-indexed string array words.
Two strings are similar if they consist of the same characters.
For example, "abca" and "cba" are similar since both consist of characters 'a', 'b', and 'c'.
However, "abacba" and "bcfd"... | Python | 1 |
(super::super::super::super::super::api::Distribution),
}
}
/// The translation config to capture necessary settings for a translation task
/// and subtask.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TranslationConfigDetails {
/// The dialect of the input files.
#[prost(message, optional, tag=... | Rust | 0 |
:
raise exc.InvalidRequestError(
"No listeners found for event %s / %r / %s "
% (self.target, self.identifier, self.fn)
)
dispatch_reg = _key_to_collection.pop(key)
for collection_ref, listener_ref in dispatch_reg.items():
collection ... | Python | 1 |
# Copyright (c) 2022 Intel and/or its affiliates.
# 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 applicable law or ag... | Python | 1 |
ut we couldn't detect an OpenSSL
installation. If there isn't one installed then you can try the rust-openssl
README for more information about how to download precompiled binaries of
OpenSSL:
https://github.com/sfackler/rust-openssl#windows
",
);
}
panic!(msg);
}
/// Attempt to find OpenSSL through... | Rust | 0 |
the end of the sentence
(meaning sentence is now 'a b c d')
5: Also add the word to the end of the current ngram, and
remove the first word from the current ngram.
This produces 'b c d' for our example.
6: Repeat step #2 until you generate 'EOL'.
"""
pass
... | Python | 1 |
let alias_callbacks = lua.create_table()?;
globals.set(engine::GLOBAL_ALIAS_CALLBACKS, alias_callbacks)?;
// 初始化CreateAlias函数
let queue = tmpq.clone();
let create_alias = lua.create_function(
move |lua,
(name, group, pattern, flags, func): (
String,
String,... | Rust | 0 |
ure scaling to the logits and sample from the probabilities
if temperature > 0:
probs = torch.softmax(logits / temperature, dim=-1)
next_token = sample_top_p(probs, top_p)
# If temperature is 0, directly sample the token with the highest logit (argmax sample)
else:
next_token = torch... | Python | 1 |
ct_throw( "Could not create websocket" );
let res = ws.close_reason( 500, "Normal Shutdown" ).await;
assert_eq!( &WsErrKind::InvalidCloseCode(500), res.unwrap_err().kind() );
Ok(())
}.boxed_local().compat()
}
// Verify close_code method.
//
#[ wasm_bindgen_test(async) ]
//
pub fn close_reason_invalid() -> ... | Rust | 0 |
await adapter.validate_token(token)
def test_load_well_known_success(adapter):
"""
Testa o carregamento do well-known com sucesso,
mockando resposta HTTP válida.
"""
fake_response = MagicMock()
fake_response.json.return_value = {
"authorization_endpoint": "https://example.com/... | Python | 1 |
同,则无法获取本地线程绑定的运行时
///
pub fn current_async_runtime<O, P>() -> Option<AsyncRuntime<O, P>>
where O: Default + 'static,
P: AsyncTaskPoolExt<O> + AsyncTaskPool<O, Pool = P> {
match PI_ASYNC_LOCAL_THREAD_ASYNC_RUNTIME.try_with(move |rt| {
unsafe {
let ptr = *rt.get();
... | Rust | 0 |
from django.contrib.auth import validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("auth", "0006_require_contenttypes_0002"),
]
operations = [
migrations.AlterField(
model_name="user",
name="username",
... | Python | 1 |
the following call to `pin`
// doesn't call `finalize` again.
self.handle_count.set(1);
unsafe {
// Pin and move the local bag into the global queue. It's important that `push_bag`
// doesn't defer destruction on any new garbage.
let guard = &self.pin();
... | Rust | 0 |
8_t* data, uint32_t numRegisters)
fn env_new(text: *const u8, data: *const u8, numRegisters: u32) -> *const env;
/// @C void native_load(env*, size_t, const char*);
fn native_load_wrapper(e: *const env, index: usize, path: *const i8);
/// @C uint8_t virtual_execute_wrapper(env*, uint32_t, uint32_t, uint... | Rust | 0 |
setup_backend(3)
for idx in range(NUM_REPEATS):
backend.reset(pure=pure)
n = [
state_preps[idx % cutoff],
state_preps[(idx + 1) % cutoff],
state_preps[(idx + 2) % cutoff],
]
n = np.array(n)
meas_modes =... | Python | 1 |
#input function is a simple way for your program to get information from people using your program.
name = input('Enter your name: ')
print('Hello, ', name)
#BASIC STRUCTURE IS;
#variable name = input(message to user)
#To get numbers from the users to use in calculations;
num = eval(input('Enter a number: '))
print('Y... | Python | 1 |
).unwrap();
assert!(cur < len);
(cur + 1) % len
}
pub fn take_key(&mut self, color: u8) -> Result<(), ()> {
let has_key = self.keys & (1 << color) != 0;
self.keys &= !(1 << color);
if has_key {
Ok(())
} else {
Err(())
}
}
... | Rust | 0 |
klass: _Unwind_VRS_RegClass,
word: _Unwind_Word,
repr: _Unwind_VRS_DataRepresentation,
data: *mut libc::c_void) -> _Unwind_VRS_Result;
}
let mut val: _Unwind_Word = 0;
let ptr = &mut val as *mut _Unw... | Rust | 0 |
import asyncio
import dbopenapi
from common import *
from app_keys import appkey, appsecretkey, saved_access_token # app_keys.py 파일에 appkey, appsecretkey 변수를 정의하고 사용하세요
async def main():
api=dbopenapi.OpenApi()
# if not await api.login(appkey, appsecretkey): return print(f'연결실패: {api.last_message}')
if no... | Python | 1 |
z5SampleCallbacksTestCase.test_callback_register_doublec C s G dd d}G dd dt }dd }| }| }d|_d|_d |_td |}ttj}|j}||f|_ d |_
|||t|| |
|j|j |
|j|j |
|j|j |
|jd |
|jd |
|jd |
|j|j |
|j|j |
|j... | Python | 1 |
oma_mut(&mut self) -> &mut T {
&mut self.chroma.0
}
/// Returns a mutable reference to the the `L` hue channel scalar
pub fn hue_mut(&mut self) -> &mut A {
&mut self.hue.0
}
/// Sets the `L` channel scalar
pub fn set_L(&mut self, val: T) {
self.L.0 = val;
}
/// Se... | Rust | 0 |
,
junction: Q,
) -> io::Result<()> {
symlink_junction_inner(original.as_ref(), junction.as_ref())
}
// Creating a directory junction on windows involves dealing with reparse
// points and the DeviceIoControl function, and this code is a skeleton of
// what can be found here:
//
// http://www.flexhex.com/docs/a... | Rust | 0 |
ders, "close_short")
if existing_short_tp_qty is None or existing_short_tp_qty != short_pos_qty:
try:
if existing_short_tp_id is not None:
self.cancel_take_profit_orders(symbol, "short")
print(f"Short tak... | Python | 1 |
update_source_for_commit():
"""Test _update_source_for_commit helper."""
# Replace placeholder
source = {"commit": "COMMIT_PLACEHOLDER"}
changes = manifest_ops._update_source_for_commit(source, "abc123")
assert source["commit"] == "abc123"
assert len(changes) == 1
assert "Updated commit to a... | Python | 1 |
n reverse_migrations {
migration.undo(&pool).await?;
performed_migrations.remove(&migration.name);
}
for migration in migrations {
migration.perform(&pool).await?;
}
} else {
for migration in migrations {
... | Rust | 0 |
n = int(input())
s = set()
for i in range(n):
student_name = input()
s.add(student_name)
print(s)
| Python | 1 |
_f64(
val_in: &PyArray3<f32>,
iid_index: &PyArray1<usize>,
sid_index: &PyArray1<usize>,
val_out: &PyArray3<f64>,
num_threads: usize,
) -> Result<(), PyErr> {
let iid_index = iid_index.readonly();
let sid_index = sid_index.readonly();
let val_in = unsaf... | Rust | 0 |
ile 1:
ser, xa, xb = series_data[-1]
if verbose:
print("Computing Taylor series for [%f, %f]" % (xa, xb))
y = mpolyval(ser, xb-xa)
xa = xb
ser, xb = ode_taylor(ctx, F, xb, y, tol_prec, degree)
series_boundaries.append(xb)
... | Python | 1 |
all_merge,
single_merge,
msg="Calling merge with a data length of 1 should not change the data "
"output.")
self.compare_accumulators(
expected,
all_merge,
msg="Calculated accumulators "
"did not match expected accumulator.")
def validate_accumulator_ext... | Python | 1 |
)?;
Ok(())
}
/// For rebases, if a commit is known to have been applied upstream, skip it
/// without attempting to apply it.
pub fn hook_skip_upstream_applied_commit(
effects: &Effects,
commit_oid: NonZeroOid,
) -> eyre::Result<()> {
let repo = Repo::from_current_dir()?;
let commit = repo.fi... | Rust | 0 |
T(i)`
///
/// `DE D0+i`
///
/// `8087+`
///
/// `16/32/64-bit`
Fcomp_st0_sti_DED0 = 633,
/// `FCOMPP`
///
/// `DE D9`
///
/// `8087+`
///
/// `16/32/64-bit`
Fcompp = 634,
/// `FSUBRP ST(i), ST(0)`
///
/// `DE E0+i`
///
/// `8087+`
///
/// `16/32/64-bit`
Fsubrp_sti_st0 = 635,
/// `FSUBP ST(i), ST... | Rust | 0 |
]
TimePriority,
/// Orderbook entry time
#[serde(rename = "9")]
OrderbookEntryTime,
/// Order submission time
#[serde(rename = "10")]
OrderSubmissionTime,
/// Publicly reported
#[serde(rename = "11")]
PubliclyReported,
/// Public report updated
#[serde(rename = "12")]
PublicReportUpdated,
/// Non-publicly... | Rust | 0 |
acy values are between 0 and 1
plt.xticks(rotation=45, ha='right') # Rotate x-axis labels for better readability
plt.tight_layout() # Adjust layout to prevent clipping of labels
plt.savefig("./figures/tsn_class_accuracy.png")
accuracies_base = [(cls, per_class_accs_base[i]) for i, cls in enumerat... | Python | 1 |
STRUCT => system::selfdestruct::<H, S>(machine, handler),
OpCode::CREATE => system::create::<H, S>(machine, false, handler), //check
OpCode::CREATE2 => system::create::<H, S>(machine, true, handler), //check
OpCode::CALL => system::call::<H, S>(machine, CallScheme::Call, handler), //check
... | Rust | 0 |
albedo: Vec<u8>,
// }
// #[derive(Serialize, Deserialize)]
// struct Material {
// resolution: u16,
// mipmaps: u8,
// albedo: Vec<Vec<[u8; 4]>>,
// }
// pub struct MaterialSet<R: gfx::Resources> {
// pub(crate) texture_view: gfx_core::handle::ShaderResourceView<R, [f32; 4]>,
// pub(crate) _... | Rust | 0 |
from pydantic import BaseModel
class InstitutionModel(BaseModel):
institution:str
class QualificationModel(BaseModel):
qual_name:str
industry:str
career:str
link:str
description:str
qual_icon:str
institution:str
online_freq:str
online_freq_label:str
in_person_freq:str
in... | Python | 1 |
>) {
if gen_env.get_export_config(class_decl).is_some() {
let cls = Class::new(class_decl, gen_env);
if !cls.is_excluded() {
cls.dependent_types().into_iter()
.for_each(|dep| {
visitor.visit_dependent_type(dep);
});
class_decl.walk_enums_while(|enm| {
let enm = Enum::new(enm);
... | Rust | 0 |
hon MVP Screener Build Process...")
# Phase 0
step_0_1_define_scope_legal()
step_0_2_core_team_tools()
pine_script_mvp = step_0_3_pine_mvp_analysis()
step_0_4_basic_architecture_cloud()
# Phase 1 (Simulated Engine Build/Validation)
# In a real scenario, these steps build the core engine co... | Python | 1 |
10).0;
let mut rng = rand::thread_rng();
for (&u, &v) in us.iter().cartesian_product(us.iter()) {
let wo = cos_sample_hemisphere((u, v));
let refl = (0..100)
.map(|_| {
let wi_uv = rng.gen::<(f32, f32)>();
let (f, wi, pr) =... | Rust | 0 |
PartitionRestOp { req }
}
}
<gh_stars>0
extern crate log;
extern crate webdriver_client_api as wda;
use log::*;
use serde_json::Map;
use serde_json::Value;
use wda::traits::HttpExecutor;
use wda::traits::Element;
use wda::httpdecorator::HttpExecutorPathDecorator;
use wda::traits::LocatorStrategy;
use wda::WEB_ELEME... | Rust | 0 |
import cv2
import os
def images_to_video(image_folder, output_video, fps=15):
print("Current directory:", os.getcwd())
images = [img for img in os.listdir(image_folder) if img.endswith((".png", ".jpg", ".jpeg"))]
images.sort() # Ensure images are in the correct order
images = images[:4000] # Limit t... | Python | 1 |
() -> Language {
let mut dsl = Language::uniform(vec![
("0", ptp!(int)),
("+1", ptp!(@arrow[tp!(int), tp!(int)])),
("-1", ptp!(@arrow[tp!(int), tp!(int)])),
("len", ptp!(@arrow[tp!(str), tp!(int)])),
("empty_str", ptp!(str)),
("lower", ptp!(@arrow[tp!(str), tp!(str)])... | Rust | 0 |
.L".to_string(), create_sample_flat_vol());
vol_surfaces.insert("GSK.L".to_string(), create_sample_flat_vol());
MarketData::new(spot_date, spots, yield_curves,
borrow_curves, dividends, vol_surfaces)
}
#[test]
fn european_unbumped_price() {
let market_data = sample_mar... | Rust | 0 |
let (value, units) = quant.into_value_and_units();
if let Num::Real(_) = value {
Err(RtErr::InvalidTypeCast {
from: Type::Quant(NumType::Real),
to: Type::Quant(NumType::Rational),
})
} else {
Ok(Quant::new(Num::Rational(value.into()), units).into())
}
}
// in... | Rust | 0 |
import os
import sys
from PIL import ImageGrab
import logging
import time
TIME_INTERVAL = 0.3
def take_screenshot():
try:
screenshot = ImageGrab.grab()
screenshot.save(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'screenshot.png'))
except Exception as e:
logging.error("Erro... | Python | 1 |
ad::{
macos::InstallTarget as MacOSInstallTarget, windows::InstallTarget as WindowsInstallTarget,
};
use serde::de::DeserializeOwned;
use serde::Serialize;
use url::Url;
use crate::config::ConfigPath;
use crate::ffi::BoxError;
use crate::repo::PayloadError;
use crate::transaction::{PackageStatus, PackageStatusErro... | Rust | 0 |
{}'.format(a.shape))
a = alignment(a.numpy(), 32.0)
wfid.write(a.tobytes())
scale = model['decoder.conv.weight_scale'].exp()
a = model['decoder.conv.weight'].permute(2,1,0) * scale
print('decoder a is {}'.format(a.shape))
a = alignment(a.numpy(), 32.0)
wfid.write(a.tobytes())
print('joiner !!!!')
scale = model['join... | Python | 1 |
PlayerAction::GoToDownLeft,
(PageDown, _) | (NumPad3, _) => PlayerAction::GoToDownRight,
(NumPad5, _) => PlayerAction::SkipTurn,
(Enter, _) => PlayerAction::InteractWithMap,
(F1, _) => PlayerAction::OpenHelp,
(Text, 'i')... | Rust | 0 |
"""
Test the in-context learning prompting on a test example.
"""
import os
import json
import clickdiffusion.prompting
from clickdiffusion.instruction_following import follow_instruction
from clickdiffusion.plotting import plot_instruction_example
if __name__ == "__main__":
# Load the example
example_pat... | Python | 1 |
[doc = " or writing to a recording. The recording path is relative to the \"user path\""]
#[doc = " which is the SD card on Android."]
#[doc = ""]
#[doc = " @param ppRecording The recording being opened."]
#[doc = " @param filePath The file path. This will be passed directly to the OS without modifi... | Rust | 0 |
.bits = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24);
self.w
}
}
#[doc = "Reader of field `SIMOBUCKCLKDIVSEL`"]
pub type SIMOBUCKCLKDIVSEL_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `SIMOBUCKCLKDIVSEL`"]
pub struct SIMOBUCKCLKDIVSEL_W<'a> {
w: &'a mut W,
}
impl<'a> SIMOBUCKC... | Rust | 0 |
: Float> op::Op<T> for Sigmoid {
fn compute(&self, ctx: &mut crate::op::ComputeContext<T>) -> Result<(), crate::op::OpError> {
let ret;
#[cfg(feature = "mkl")]
{
ret = fast_sigmoid_impl(&ctx.input(0));
}
#[cfg(not(feature = "mkl"))]
{
let half ... | Rust | 0 |
let idle = self.current_idle_exclude(exclude) as usize;
limit.resize(idle.saturating_sub(self.keep_remain).max(1))?;
Ok(())
}
/// set the keep_remain to the keeper.
/// this applies to subquent `exec_over` calls.
pub fn set_remain(&mut self, remain: usize) {
self.keep_remain = r... | Rust | 0 |
Buf, serde_yaml::Error),
StartPlaybackTimeout,
SystemTimeError(time::SystemTimeError),
UnsupportedSoundCard(String),
VPDParseFailed(String, ParseIntError),
WorkerPanics(Box<dyn Any + Send + 'static>),
ZeroPlayerIsNotRunning,
ZeroPlayerIsRunning,
}
impl PartialEq for Error {
// Implement... | Rust | 0 |
error)?
.map(ok_to_json)
}
<reponame>skyline75489/tikv<filename>components/coprocessor_plugin_api/src/util.rs
// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
use super::allocator::HostAllocatorPtr;
use super::plugin_api::CoprocessorPlugin;
/// Name of the exported constructor function for the p... | Rust | 0 |
le to stream to Redis subscribers.
We need to check if the client is interested in the stream or not
"""
self.send_command(RdataCommand(stream_name, self._instance_name, token, data))
def on_lock_released(
self, instance_name: str, lock_name: str, lock_key: str
) -> None:
... | Python | 1 |
2;
#[doc = "*Required features: 'Win32_Devices_DeviceQuery'*"]
pub const DevObjectTypeAEPService: DEV_OBJECT_TYPE = 10i32;
#[doc = "*Required features: 'Win32_Devices_DeviceQuery'*"]
pub const DevObjectTypeDevicePanel: DEV_OBJECT_TYPE = 11i32;
#[doc = "*Required features: 'Win32_Devices_DeviceQuery'*"]
pub type DEV_QUE... | Rust | 0 |
import os
import json
import glob
import tensorflow as tf
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
from model import resnet50
def main():
im_height = 224
im_width = 224
num_classes = 5
# load image
img_path = "../tulip.jpg"
assert os.path.exists(img_path), "f... | Python | 1 |
rds for url, keywords in url_keyword_count.items() if len(keywords) > 1}
if multi_keyword_urls:
print(f"\nURLs WITH MULTIPLE KEYWORDS ({len(multi_keyword_urls)}):")
for url, keywords in sorted(multi_keyword_urls.items(), key=lambda x: len(x[1]), reverse=True)[:5]:
if url ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.