text string | label_name string | labels int64 |
|---|---|---|
"""
QA 생성 모듈
LLM을 사용한 질문-답변 쌍 및 퀴즈 생성
MODIFIED 2024-12-19: models 의존성 제거하여 단순화
"""
from typing import List, Dict, Optional
import json
from ai_processing.llm_client import LLMClient
from utils.logger import get_logger
logger = get_logger(__name__)
class QAGenerator:
"""QA 생성 클래스"""
def __init__(self):
... | Python | 1 |
Error>;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = self.project();
if this.sleep.poll(cx).is_ready() {
Poll::Ready(Err(Box::new(Status::deadline_exceeded(format!(
"{:?} timeout",
this.du... | Rust | 0 |
T, E, M> Context<T, E, M> for std::result::Result<T, E>
where
E: Display,
M: Display,
{
fn context(self, msg: M) -> crate::Result<T> {
match self {
Ok(x) => Ok(x),
Err(e) => Err(crate::Error {
msg: format!("{}\n - {}", e, msg),
}),
}
}
... | Rust | 0 |
import dspy
from loguru import logger
from chatbi.agent.agent_message import (
AgentMessage,
)
from chatbi.agent.llm import LLM
from chatbi.agent.prompts.sql_prompt import get_sql_prompt
dspy.enable_logging()
class SqlSignature(dspy.Signature):
"""Signature for the text2sql method."""
context = dspy.In... | Python | 1 |
e(storage, "B", 4).unwrap();
map.save(storage, "C", &13, 4).unwrap();
// checkpoint 5
map.add_checkpoint(storage, 5).unwrap();
map.remove(storage, "A", 5).unwrap();
map.update(storage, "D", 5, |_| -> StdResult<u64> { Ok(22) })
.unwrap();
// and delete it late... | Rust | 0 |
ize) -> usize {
/*
Decodes the other symbols except the first quality score using binary search based on conditional probabilities
and updates range
Input:
pre_symbol: decoded previous quality score of current quality score
Output:
sym_idx: ... | Rust | 0 |
* All rights reserved.
* Algorithms Copyright (c) 2000 <NAME> and sol.net Network Services
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain ... | Rust | 0 |
# Questão 5. Jornada no Deserto
# a. Descrição: Um explorador está cruzando um deserto. Ele precisa saber se a quantidade de água
# que tem é suficiente para chegar ao próximo oásis. Ele calcula que precisa de 2 litros de água
# para cada quilômetro. Crie um programa ... | Python | 1 |
*self.leader_id.read().await;
let leader_id = match leader_id {
Some(id) => id,
None => {
let id = fetch_leader_id(&self.route_table).await?;
*self.leader_id.write().await = Some(id);
id
}
};
let leader_addr = s... | Rust | 0 |
# Copyright (c) 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of G... | Python | 1 |
from langchain_core.prompts import (
ChatPromptTemplate,
SystemMessagePromptTemplate,
HumanMessagePromptTemplate,
PromptTemplate
)
from langchain_core.output_parsers import StrOutputParser
from langchain_openai import ChatOpenAI
# Create a prompt template for the system message
system_prompt_template: ... | Python | 1 |
root_tag(rootNode)
if rootClass is None:
rootTag = 'ConfigType'
rootClass = ConfigType
rootObj = rootClass.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
if not silence:
sys.stdout.write('#from maja_xml_camera_user_confi... | Python | 1 |
self.add_local(id.name());
visit(self, env, catch_body)?;
}
visit(self, env, finally)
}
_ => s.recurse(env, self),
}
}
fn visit_expr_(&mut self, env: &mut (), e: &Expr_) -> Result<(), String> {
use a... | Rust | 0 |
StatusCode.UNAVAILABLE,
StatusCode.DATA_LOSS,
]:
retry_info_bin = dict(error.trailing_metadata()).get(
"google.rpc.retryinfo-bin"
)
if retry_info_bin is not None:
... | Python | 1 |
p(1) # Simulate time for MPC signature
logger.info("Simulating ZK proof generation...")
time.sleep(2) # Simulate time for ZK proof
logger.info("Simulating proof submission to L1/DA layer...")
time.sleep(1) # Simulate time for submission
# In a real i... | Python | 1 |
alid(self, mock_config_manager):
"""Test validating a valid configuration."""
# Mock the ConfigManager
mock_cm_instance = MagicMock()
mock_cm_instance.get_runner_config.return_value = {'valid': 'config'}
mock_config_manager.return_value = mock_cm_instance
# Set u... | Python | 1 |
);
#[allow(clippy::integer_arithmetic)]
const fn gen_2mb_pdt_entries(i: usize) -> u64 {
let base: u64 = HUGE_PAGE_TABLE_FLAGS;
let step: u64 = BYTES_2_MIB;
base + (i as u64) * step
}
#[allow(clippy::integer_arithmetic)]
const fn gen_2gb_pdpt_entries(i: usize) -> u64 {
let base: u64 = HUGE_PAGE_TABLE_F... | Rust | 0 |
own
return x, -15
v[:] = vtilde[:]
v *= (1 / rho)
y *= (1 / rho)
w[:] = wtilde[:]
w *= (1 / xi)
z *= (1 / xi)
delta = dotprod(z, y)
if np.abs(delta) < deltatol: # delta breakdown
return x, -13
ytilde = M2.matvec(y)
... | Python | 1 |
_primitives::{
anchor::{AnchorInspector, AnchorInterface},
utils::{self, compute_chain_id_type},
webb_proposals::{AnchorUpdateProposal, ProposalHeader, TypedChainId},
ElementTrait, ResourceId,
};
use xcm::latest::prelude::*;
#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;
pub mod types;
pub use pallet::*;
use typ... | Rust | 0 |
{
/// id should be the entities globally unique id. It doesn't matter what it
/// is internally as long as that thing can be returned as a string
/// (implements Display from std).
fn id(&self) -> &ID;
}
pub trait AggregateWriteRepository<T: RootAggregate> {
fn store(&mut self, aggregate: T) -> Re... | Rust | 0 |
as usize].as_mut_ptr(),
(*afl).queued_paths as u64_0));
/* Highlight crashes in red if found, denote going over the KEEP_UNIQUE_CRASH
limit with a '+' appended to the count. */
sprintf(tmp.as_mut_ptr() as *mut libc::c_char,
b"%s%s\x00" as *const u8 as *const libc::c_c... | Rust | 0 |
::fs::File::create("client.txt").unwrap();
///
/// let (hash, num_chunks, _mode) = f_protocol.initialize_file("client.txt").unwrap();
/// let channel_id = f_protocol.generate_channel().unwrap();
/// f_protocol.send_metadata(channel_id, &hash, num_chunks);
/// ```
///
pub fn send_metadata(
... | Rust | 0 |
,
max_count: u64,
}
impl Iterator for MaskAddrIter {
type Item = u64;
fn next(&mut self) -> Option<u64> {
if self.counter == self.max_count {
None
} else {
let cur_mask_val = self.counter.pdep(self.mask.mask);
self.counter += 1;
Some(cur_mask_... | Rust | 0 |
#!/usr/bin/python3
import csv
suffixes = {}
with open('ItemRandomProperties.csv', newline='') as f:
reader = csv.DictReader(f, delimiter=',')
for row in reader:
s = row['Name_lang']
if s not in suffixes:
suffixes[s] = []
suffixes[s].append(int(row['ID']))
with open('ItemRan... | Python | 1 |
f32 = 4.2857143283e-01; /* 0x3edb6db7 */
const L3: f32 = 3.3333334327e-01; /* 0x3eaaaaab */
const L4: f32 = 2.7272811532e-01; /* 0x3e8ba305 */
const L5: f32 = 2.3066075146e-01; /* 0x3e6c3255 */
const L6: f32 = 2.0697501302e-01; /* 0x3e53f142 */
const P1: f32 = 1.6666667163e-01; /* 0x3e2aaaab */
... | Rust | 0 |
import arxiv
import os
import json
import time
from tqdm import tqdm
import logging
from datetime import datetime
def process_metadata(result):
"""
将ArXiv结果对象转换为结构化的字典
Args:
result: arxiv.Result对象
Returns:
dict: 结构化的元数据字典
"""
metadata = {
"entry_id": result.entry_id,
... | Python | 1 |
ern): value
for pattern, value in {
'[一二三四五六七八九十百千万億兆]': 'M',
'[一-龠々〆ヵヶ]': 'H',
'[ぁ-ん]': 'I',
'[ァ-ヴーア-ン゙ー]': 'K',
'[a-zA-Za-zA-Z]': 'A',
'[0-90-9]': 'N',
}.items()
}
# fmt: off
BIAS__ = -332
BC1__ = {'HH': 6, 'II': 2... | Python | 1 |
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
# 数据
data = [
{"C": 1, "gamma": 0.1, "kernel": "linear", "accuracy": 0.9708},
{"C": 1, "gamma": 0.1, "kernel": "rbf", "accuracy": 0.9474},
{"C": 1, "gamma": 1, "kernel": "linear", "accuracy": 0.9708},
{"C": 1, "gamma": 1, "kernel... | Python | 1 |
string())
}
async fn index() -> Result<String, Error> {
Ok("For logged in users!".to_string())
}
pub fn routes(cfg: &mut ServiceConfig) {
cfg.route(
"/",
permission()
.check(web::get())
.validate(has_min_role(Role::User))
.to(index)
.build(),
... | Rust | 0 |
#[inline(always)]
pub fn host_fn2_slc1_token1_0to1_int_ena(&mut self) -> HOST_FN2_SLC1_TOKEN1_0TO1_INT_ENA_W {
HOST_FN2_SLC1_TOKEN1_0TO1_INT_ENA_W { w: self }
}
#[doc = "Bit 12"]
#[inline(always)]
pub fn host_fn2_slc1host_rx_sof_int_ena(&mut self) -> HOST_FN2_SLC1HOST_RX_SOF_INT_ENA_W {
... | Rust | 0 |
numbers=[3, 5, 1, 9, 7, 2, 8 ]
index_of_7 = numbers.index(7)
print(f"Index of 7 is: {index_of_7}") | Python | 1 |
#
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from .source import SourceSearchMetrics
__all__ = ["SourceSearchMetrics"]
| Python | 1 |
atter.format_token(&self.l_paren_token()?)?;
let initializer = formatter.format_node(self.initializer()?)?;
let in_token = formatter.format_token(&self.in_token()?)?;
let expression = formatter.format_node(self.expression()?)?;
let r_paren = formatter.format_token(&self.r_paren_token()?)?;
let body = formatte... | Rust | 0 |
,
clip: r2::rect::Rect,
) -> (r2::point::Point, r2::point::Point, bool) {
// Compute the bounding rectangle of AB, clip it, and then extract the new
// endpoints from the clipped bound
let bound = r2::rect::Rect::from_points(&[a, b]);
let (bound, intersects) = clip_edge_bound(a, b, clip, bound);
... | Rust | 0 |
for b in -11..11 {
let choose_mat = utils::random_double(&0.0, &1.0);
let center = ray::Point::new(
a as RayTracingFloat + 0.9 * utils::random_double(&0.0, &1.0),
0.2,
b as RayTracingFloat + 0.9 * utils::random_double(&0.0, &1.0),
);
... | Rust | 0 |
from archimedes import tree
__all__ = ["_ravel_args"]
def _ravel_args(x, bounds, zip_bounds=False):
# By default, just flatten/unflatten the tree
x_flat, unravel_x = tree.ravel(x)
if bounds is not None:
lower, upper = bounds
lb, _ = tree.ravel(lower)
ub, _ = tree.ravel(upper)
... | Python | 1 |
}
}
}
fn poll_services(network: &mut NetworkState) {
if let Some(socket) = network.dns_socket {
poll_dns(socket, network);
}
if network.alice_socket.is_some() {
poll_alice(network);
}
if network.easter_socket.is_some() {
poll_easter(network);
}
}
/// Initi... | Rust | 0 |
let clk = m.Input("CLK", 1);
let rst = m.Input("RST", 1);
let btn1 = m.Input("i_BTN1", 1);
let btn2 = m.Input("i_BTN2", 1);
let led = m.Output("o_LED", 8);
let mut fsm = Clock_Reset(clk,&rst)
.State("State")
.AddState("IDLE").goto("RUN", F!(btn1 == 1).... | Rust | 0 |
impl ThroughputScheduler {
pub fn new() -> ThroughputScheduler {
let now = fasync_time::now().into_zx();
ThroughputScheduler {
data: RefCell::new(WakeupData {
frame_requested: false,
next_frame_begin: true,
waker: None,
}),
... | Rust | 0 |
, [`write_with_zero`](crate::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 [adc12mem24](adc12mem24) module"]
pub type ADC12MEM24 = crate::Reg<u16, _ADC12MEM24>;
#[allow(missing_docs)]... | Rust | 0 |
String::from("?")
}
}
fn possibilities_to_detailed_string(p: &HashSet<u8>, size: usize) -> String {
let mut result = String::with_capacity(size);
for i in 0..size {
if p.contains(&(i as u8)) {
result.push_str(&(i+1).to_string());
} else {
result.push_str("... | Rust | 0 |
from enum import IntEnum, unique
@unique
class ExitStatus(IntEnum):
"""Program exit status code constants."""
SUCCESS = 0
ERROR = 1
ERROR_TIMEOUT = 2
# See --check-status
ERROR_HTTP_3XX = 3
ERROR_HTTP_4XX = 4
ERROR_HTTP_5XX = 5
ERROR_TOO_MANY_REDIRECTS = 6
PLUGIN_ERROR = 7
... | Python | 1 |
miles) for smiles in tqdm(unique_smiles)]
results_df = pd.DataFrame(results)
df = pd.merge(df, results_df, on='SMILES')
core_counts_df = df['core_counts'].apply(lambda x: pd.Series(x, dtype='int'))
df = pd.concat([df, core_counts_df], axis=1)
df = df.drop(columns='core_counts')
df.to_csv(csv_o... | Python | 1 |
h.to_u32().unwrap())
}
pub fn tpt<X: ToPrimitive + Copy, Y: ToPrimitive + Copy>(x: X, y: Y) -> TexPt {
Pt2D::new(x.to_u32().unwrap(), y.to_u32().unwrap())
}
pub fn tsz<W: ToPrimitive + Copy, H: ToPrimitive + Copy>(w: W, h: H) -> TexSz {
Sz2D::new(w.to_u32().unwrap(), h.to_u32().unwrap())
}
impl<T: ToPrimiti... | Rust | 0 |
node1, dbxxx)? {
return Ok(false);
}
}
}
//
#[cfg(not(feature = "tr_has_short_key"))]
let key_offset = node.get_ref().keys_get(node.get_ref().keys_len() - 1);
#[cfg(feature = "tr_has_short_key")]
let (key_offset, _short_key)... | Rust | 0 |
summary
recheck.append(i)
# now lets check and get recurring events instances
print("Getting recurring events!")
for r in result:
if "recurrence" in r:
raw_instances = get_event_instances(
discord_guild=discord_guild, discord_id=discord_id, event_id=r["id"]
... | Python | 1 |
use crate::crypto::*;
use crate::crypto::shares::*;
use crate::structs::*;
fn main() {
let matches = App::new("Statistics for Rn/Fn")
.version("1.0")
.author("<NAME> <<EMAIL>>")
.about("Performs time measurements for Rn/Fn (create/recover)")
.subcommand(SubCommand::with_name("Rn")
.about("... | Rust | 0 |
'loan_status': np.random.choice(['Fully Paid', 'Charged Off'], 100, p=[0.8, 0.2])
})
test_data.to_csv(data_dir / "accepted_2007_to_2018Q4.csv", index=False)
yield temp_dir
@pytest.fixture
def sample_metrics():
"""Создает тестовые метрики."""
return {
... | Python | 1 |
# -*- coding: utf-8 -*-
# vStream https://github.com/Kodi-vStream/venom-xbmc-addons
import json
from resources.lib.handler.requestHandler import cRequestHandler
from resources.hosters.hoster import iHoster
from resources.lib.comaddon import dialog, VSlog
class cHoster(iHoster):
def __init__(self):
iHost... | Python | 1 |
> {}",
src.to_str().unwrap(),
dest.to_str().unwrap(),
err
);
}
}
pub fn use_handling<F>(src: &Path, dest: &Path, func: F)
where
F: FnOnce(&Path, &Path) -> Result<(), Error>,
{
func(src, dest).unwrap_or_else(|err| handle_dir_error(src, dest, err));
}
pub fn use_h... | Rust | 0 |
from contextlib import suppress
from openfreebuds.driver.huawei.driver.generic import OfbDriverHandlerHuawei
from openfreebuds.driver.huawei.package import HuaweiSppPackage
class OfbHuaweiInfoHandler(OfbDriverHandlerHuawei):
"""
Device info handler
"""
handler_id = "device_info"
commands = [b"\x... | Python | 1 |
# Copyright 2025 Google LLC
#
# 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 agreed to in writing, s... | Python | 1 |
mer, suffix=rsuffix)
llabels = left._transform_index(lrenamer)
rlabels = right._transform_index(rrenamer)
dups = []
if not llabels.is_unique:
# Only warn when duplicates are caused because of suffixes, already duplicated
# columns in origin should not warn
dups = llabels[(llabe... | Python | 1 |
compute_scale_and_shift(prediction, target, mask)
scaled_prediction = scale * prediction + shift
return F.l1_loss(scaled_prediction[mask], target[mask])
def monogs_depth_reg(depth: torch.Tensor, gt_image: torch.Tensor, mask: Optional[torch.Tensor] = None) -> float:
"""Ensure that the depth is smoo... | Python | 1 |
sibling("1")
/// # .current_id();
/// # builder
/// # .child("1-0")
/// # .sibling("1-1")
/// # .sibling("1-2")
/// # .parent()
/// # .sibling("2");
/// # let root = builder.root_id();
/// let before = r#"root
/// |-- 0
/// |-- 1
/// | |-- 1-0
... | Rust | 0 |
import os
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.files import *
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
required_conan_version = ">=2.1"
class UwebsocketsConan(ConanFile):
... | Python | 1 |
os.mkdir(build_dir)
with open(test_file, 'wt') as f:
f.write('void foo();\n')
args = [f"--addon={addon_file}", f"--cppcheck-build-dir={build_dir}", '--xml', '--enable=all', test_file]
with open(addon_file, 'wt') as f:
f.write('print(\'{"addon":"premium","column":0,"errorId":"invalidLic... | Python | 1 |
from xml.etree.ElementTree import Element, SubElement, tostring
from xml.dom import minidom
import regex as re
from os import listdir
from os.path import isfile
import html
import json
chapter_files = [f for f in listdir() if isfile(f) and re.match("[A-Z0-9]{3}\.\d+", f)]
def prettify(elem):
"""Return a pretty-pr... | Python | 1 |
.help("Specify the architecture XLEN.")
.short("x")
.long("xlen")
.takes_value(true),
)
.arg(
Arg::with_name("ignore-funcs")
.help("Comma separated list of functions to ignore. E.g. \"foo,bar\"")
.short("i")
... | Rust | 0 |
libc::c_char,
(*sac).sac_inbound_streams as libc::c_int,
(*sac).sac_outbound_streams as libc::c_int);
let mut n =
((*sac).sac_length as
libc::c_ulong).wrapping_sub(::std::mem::size_of::<sctp_assoc_change>()
as libc::c_u... | Rust | 0 |
;
use instrumented::instrument;
use libc::{c_float, c_int, size_t};
use rocket_contrib::json::Json;
use std::collections::HashMap;
pub struct ImageUpload(Vec<u8>);
impl rocket::data::FromDataSimple for ImageUpload {
type Error = std::io::Error;
// from https://api.rocket.rs/v0.4/rocket/data/trait.FromDataSi... | Rust | 0 |
import pytest
from deeplite_torch_zoo import get_eval_function, get_model
@pytest.mark.parametrize(
('model_name', 'reference_accuracy'),
[
('mobilenet_v3_small', 0.53125),
('squeezenet1_0', 0.46875),
('hrnet_w18_small_v2', 0.609375),
('efficientnet_es_pruned', 0.609375),
... | Python | 1 |
alue("0.234"), Ok(234));
assert_eq!(parse_qvalue("1"), Ok(1000));
assert_eq!(parse_qvalue("1."), Ok(1000));
assert_eq!(parse_qvalue("1.0"), Ok(1000));
assert_eq!(parse_qvalue("1.1"), Err(()));
assert_eq!(parse_qvalue("1.00"), Ok(1000));
assert_eq!(parse_qvalue("1.000"), O... | Rust | 0 |
groups, axis=3)
else:
values.append(val)
else:
values.append(val)
return values
def remove_head(original_stem, name):
_scope = "%s/stem" % tf.get_variable_scope().name
g = tf.get_default_graph()
for x in g.get_collection(tf.GraphKeys.GLOBAL_VARIABLES,
... | Python | 1 |
in global_models:
global_models[model_name].append((file_path, section_key, row_idx))
else:
global_models[model_name] = [(file_path, section_key, row_idx)]
# Find cross-file duplicates
for obj_id, locations in globa... | Python | 1 |
}
}
fn typed_zero(typ: JITType, builder: &mut FunctionBuilder) -> Value {
match typ.code {
0x70 => builder.ins().bconst(typ.native, false),
0x76 => builder.ins().iconst(typ.native, 0),
0x77 => builder.ins().iconst(typ.native, 0),
0x78 => builder.ins().iconst(typ.native, 0),
... | Rust | 0 |
from django.urls import path
from app2.views import home
urlpatterns = [
path('', home),
] | Python | 1 |
ake_url_from_short_reddit_url() {
check_url_jsonify(
"https://v.redd.it/yub5uok42jq81",
"https://v.redd.it/yub5uok42jq81",
)
}
#[test]
fn check_not_short_reddit() {
assert!(!is_reddit_short_url(
"https://www.reddit.com/video/yub5uok42jq81"
... | Rust | 0 |
tal_basis: Metal basis set if different
charge: System charge
multiplicity: System multiplicity
Returns:
Formatted method info string
"""
lines = []
# Method line
method_line = "Method: " + " ".join(part for part in method_parts if part)
... | Python | 1 |
(0, 0, 255, 255)
).unwrap();
}
fn draw_surface(&self, c: &mut Canvas<Surface>) {
c.filled_circle(self.position.x as i16,
self.position.y as i16,
(self.area_of_effect * 3.0) as i16,
(0, 0, 255, 100)
... | Rust | 0 |
from typing import Any, Optional
import time
class CacheManager:
"""
A simple in-memory cache manager with time-to-live (TTL) expiration support.
Attributes:
_cache (dict): Internal dictionary to store cached key-value pairs.
_expiry (dict): Dictionary to store expiration timestamps for ea... | Python | 1 |
(
self.G, source=source_idx, weight="weight"
) # list of lists
for b in range(B):
if batch1 == 1:
idx = self._grid_point(p2[b])
else:
idx = self._grid_point(p1[b])
self._path_to_curve(paths[i... | Python | 1 |
typed object. So it will be a JS object,
/// not a Rust value, BUT it will have TS type safety. Return an error if input
/// isn't valid.
///
/// Because validation populates missing fields, you can "validate" an empty
/// object to get the default config.
pub fn validate_config<R, O>(input: JsValue) -> Result<O, JsVa... | Rust | 0 |
g::Saturating;
use {Num, NumCast};
/// Generic trait for primitive integers.
///
/// The `PrimInt` trait is an abstraction over the builtin primitive integer types (e.g., `u8`,
/// `u32`, `isize`, `i128`, ...). It inherits the basic numeric traits and extends them with
/// bitwise operators and non-wrapping arithmetic... | Rust | 0 |
}
if xosc_power_mode != 0u32 {
cur_state = cur_state | 4u32;
}
if cur_temp - POWER_QUAL_GLOBALS.pd_temp as (i32) >= 5i32
|| cur_state != POWER_QUAL_GLOBALS.pd_state as (u32)
{
shifted_temp = cur_temp - 15i32;
let p_lookup_table = (... | Rust | 0 |
import anndata
import numpy as np
import random
from tqdm import tqdm
from scipy.sparse import csr_matrix
random.seed(2023)
def generate_random_list(original_list, range):
random_list = []
while len(random_list) != len(original_list):
random_number = random.randint(1, range)
random_list.appe... | Python | 1 |
, 1, 1);
set_invalid_param_test!(invalid, set_seconds, 60);
}
mod minutes {
use super::*;
get_param_test!(get, get_minutes, MINUTES, 1, 1);
set_param_test!(set, set_minutes, MINUTES, 1, 1);
set_invalid_param_test!(invalid, set_minutes, 60);
}
mod hours_24h {
use super::*;
get_param_test!(g... | Rust | 0 |
# SecuML
# Copyright (C) 2016-2019 ANSSI
#
# SecuML is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# SecuML is distributed in the h... | Python | 1 |
Shiga => write!(f, "滋賀県"),
Self::Kyoto => write!(f, "京都府"),
Self::Osaka => write!(f, "大阪府"),
Self::Hyogo => write!(f, "兵庫県"),
Self::Nara => write!(f, "奈良県"),
Self::Wakayama => write!(f, "和歌山県"),
Self::Tottori => write!(f, "鳥取県"),
Self::... | Rust | 0 |
"STSS-6040",
92488u32 => "STSS-6120",
91249u32 => "STSS-6940",
92572u32 => "STSS-6961",
92786u32 => "STSS-6963",
92799u32 => "STSS-6964",
91089u32 => "STSS-6990",
90427u32 => "STSS-9990",
90523u32 => "STSS-9990",
90524u32 => "STSS-9990",
92851u32 => "STSS-9990",
90927u32 => "STSS-9990",
90928u32 => "STSS-9... | Rust | 0 |
from .db import db, environment, SCHEMA, add_prefix_for_prod
from datetime import datetime
class Watchlist_stock(db.Model):
__tablename__ = "watchlist_stocks"
if environment == "production":
__table_args__ = {'schema': SCHEMA}
id = db.Column(db.Integer, primary_key=True)
watchlist_id = db.... | Python | 1 |
E, 0x8B40, 0x45BC, 0xA8, 0xA2, 0x6A, 0x0B, 0x89, 0x4C, 0xBD, 0xA2, 5}
DEFINE_PROPERTYKEY!{PKEY_Devices_PresentationUrl,
0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 8198}
DEFINE_PROPERTYKEY!{PKEY_Devices_PrimaryCategory,
0xD08DD4C0, 0x3A9E, 0x462E, 0x82, 0x90, 0x7B, 0x63, 0x6B, 0x... | Rust | 0 |
from django.urls import path
from .views import WeaklyPlanner
urlpatterns = [
path('planner/' , WeaklyPlanner.as_view() , name='WeaklyPlanner' )
] | Python | 1 |
import sqlite3, pathlib
db_file = "bnb.sqlite3"
schema = pathlib.Path("data/schema.sql").read_text(encoding="utf-8")
conn = sqlite3.connect(db_file)
conn.executescript(schema)
conn.commit()
conn.close()
print("Database initialized:", db_file)
| Python | 1 |
mel_case_types)]
// Passing enums by value
// pretty-expanded FIXME #23616
pub enum void { }
mod bindgen {
use super::void;
extern {
pub fn printf(v: void);
}
}
pub fn main() { }
//#![deny(warnings)]
extern crate orbclient;
extern crate orbtk;
use orbclient::WindowFlag;
use orbtk::{Action, B... | Rust | 0 |
>,
/// Themes that can be played.
#[serde(default)]
pub themes: Themes,
/// Player configuration file.
#[serde(default)]
pub player: Arc<player::Config>,
/// Aliases in use for channels.
#[serde(default)]
pub aliases: Vec<DeprecatedAlias>,
/// Features enabled for bot.
#[serd... | Rust | 0 |
let block_i = block + i as u64;
let buffer_i = i * 512;
let buffer_j = cmp::min(buffer_i + 512, buffer.len());
let buffer_slice = &buffer[buffer_i .. buffer_j];
let mut cache_buf = [0; 512];
read += copy_memory(buffer_slice, &mut cache_bu... | Rust | 0 |
, _) = deal_provider_collateral_bounds(
&Policy::default(),
PaddedPieceSize(2048),
&BigInt::from(0u8),
&BigInt::from(0u8),
&power,
);
d.provider_collateral = provider_min - 1;
};
assert_deal_failure(true, f, ExitCode::USR_ILLEGAL_ARGUME... | Rust | 0 |
LibcConst::SO_TYPE => {
if outlen < SIZEOF_I32 {
return Err(Error::SysError(SysErr::EINVAL))
}
return Ok(SockOptResult::I32(skType))
}
LibcConst::SO_ERROR => {
if outlen < SIZEOF_I32 {
return Err(Error::SysError(Sys... | Rust | 0 |
00_11_00;
#[allow(unused)]
const C_LANES64: u8 = 0b00_11_00_00;
#[allow(unused)]
const D_LANES64: u8 = 0b11_00_00_00;
use core::ops::{Add, Mul, Neg};
use packed_simd::{i32x8, u32x8, u64x4, IntoBits};
use backend::serial::u64::field::FieldElement51;
use backend::vector::avx2::constants::{P_TIMES_16_HI, P_TIMES_16_LO, ... | Rust | 0 |
peers(&self) -> Vec<PeerId>;
async fn conns(&self) -> Vec<Box<dyn Conn>>;
async fn conn_to_peer(&self, peer_id: &PeerId) -> Option<Box<dyn Conn>>;
}
#[async_trait]
pub trait Network: Send + Sync + DynClone {
async fn dial_peer(&self, ctx: Context, peer_id: &PeerId) -> Result<Box<dyn Conn>, Error>;
... | Rust | 0 |
+= 1
other = kwargs.get("other")
binary_node = match.output_node()
reshape_node = None
if binary_node.args[0].target in _computation_ops:
computation_node = binary_node.args[0]
elif binary_node.args[0].target == aten.reshape.default:
... | Python | 1 |
_1_TX_COEF4_A> for u8 {
#[inline(always)]
fn from(variant: TX_PULSE_SHAPE_1_TX_COEF4_A) -> Self {
variant as _
}
}
#[doc = "Reader of field `TX_PULSE_SHAPE_1_TX_COEF4`"]
pub type TX_PULSE_SHAPE_1_TX_COEF4_R = crate::R<u8, TX_PULSE_SHAPE_1_TX_COEF4_A>;
impl TX_PULSE_SHAPE_1_TX_COEF4_R {
#[doc = r... | Rust | 0 |
from rest_framework import status, viewsets, mixins
from rest_framework.response import Response
from suppliers.repository.suppliers_repository_impl import SuppliersRepositoryImpl
from suppliers.service.suppliers_service_impl import SuppliersServiceImpl, SupplierAlreadyExists, SupplierNotFound
from suppliers.serializ... | Python | 1 |
= self.call("ModifyApiIncrement", params, headers=headers)
response = json.loads(body)
model = models.ModifyApiIncrementResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
... | Python | 1 |
don't expect there to be
// contention for the assigned name as this client library should be the collection's sole
// owner. Still, come up with a better way to assign this.
if let Some(ref name) = params.name {
collection_token.set_name(100, name.as_str())?;
}
// Duplicate of `collection... | Rust | 0 |
x..cache.chunk_index,
vec![0; HASHSIZE],
vec![true],
);
cache.chunk_index += 1;
}
// This leaf was padding in both lists, there's nothing to do.
(LeafNode:... | Rust | 0 |
Parameters
----------
param : dict
Original loaded parameter dictionary.
Returns
-------
param : dict
Modified parameter dictionary with new attribute `geometry_param`.
"""
res = param["preprocess"]["args"]["res"]
L1, W1, H1, L2, W2, H2 = param["preprocess"]["cav_lidar... | Python | 1 |
en::R](dcdcen::R) reader structure"]
impl crate::Readable for DCDCEN {}
#[doc = "`write(|w| ..)` method takes [dcdcen::W](dcdcen::W) writer structure"]
impl crate::Writable for DCDCEN {}
#[doc = "Enable DC/DC converter for REG1 stage."]
pub mod dcdcen;
#[doc = "Enable DC/DC converter for REG0 stage.\n\nThis register yo... | Rust | 0 |
Lock};
use std::time::Duration;
use tokio::time;
// use tokio::io::{AsyncReadExt, AsyncWriteExt};
// use tokio::net::TcpListener;
// use std::env;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let config = test_nacos_config();
println!(" -- > {:?}", config);
let client = config.connect_wi... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.