text string | label_name string | labels int64 |
|---|---|---|
from constant.chromosome import Chromosome
from util.openai_util import completion_with_chatgpt
def llm_fitness_ranking(chromosome: Chromosome) -> int:
question_prompt = chromosome.question_prompt
llm_response = chromosome.llm_response
fitness_ranking_prompt = f"""
You are a Red Team Judge evaluating pro... | Python | 1 |
// If this is a well-known trait, which one? If `None`, this is a regular,
/// user-defined trait.
pub well_known: Option<WellKnownTrait>,
}
/// A list of the traits that are "well known" to chalk, which means that
/// the chalk-solve crate has special, hard-coded impls for them.
#[derive(Copy, Clone, Debug, P... | Rust | 0 |
import networkx as nx
from networkx.algorithms.moral import moral_graph
def test_get_moral_graph():
graph = nx.DiGraph()
graph.add_nodes_from([1, 2, 3, 4, 5, 6, 7])
graph.add_edges_from([(1, 2), (3, 2), (4, 1), (4, 5), (6, 5), (7, 5)])
H = moral_graph(graph)
assert not H.is_directed()
assert H... | Python | 1 |
let mut ditherer = Ditherer::new(img.width() as usize);
for (x, y, pixel) in img.enumerate_pixels() {
if pixel.0[3] < 128u8 {
reduced.put_pixel(x, y, transparent);
continue;
}
let pixel_with_error = ditherer.apply_error(pixel);
let closest = find_closest... | Rust | 0 |
)
inv_foreground_mask = ~foreground_mask
inv_background_mask = foreground_mask
aux_foreground_mask = inv_foreground_mask.unsqueeze(2).unsqueeze(2).repeat(
1, 1, self.num_heads, self.num_queries // 2, 1).flatten(start_dim=0, end_dim=2)
aux_background_mask = inv_background_mas... | Python | 1 |
d] and the two IDs are not identical. In this case an
/// [IncompatibleContextIds] error will be returned.
pub fn combine(&self, other: ContextId) -> Result<ContextId, IncompatibleContextIds> {
match self {
ContextId::Any => Ok(other),
ContextId::Id(id) => {
if ... | 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... | Python | 1 |
from flask import send_file, request
from image.date.month_image_creator import MonthImageCreator
from PIL import ImageOps
from datetime import datetime
class MonthImageAPI:
def __init__(self):
self.creator = MonthImageCreator()
def get_month_image(self):
# 获取请求参数
year = int(re... | Python | 1 |
Void };
pub const OP_SELFDESTRUCT: Instruction = Instruction { op: 0xff, name: "SELFDESTRUCT", arg: ArgType::Void };
pub const INSTRUCTIONS: [Instruction; 135] = [
OP_STOP,
OP_ADD,
OP_MUL,
OP_SUB,
OP_DIV,
OP_SDIV,
OP_MOD,
OP_SMOD,
OP_ADDMOD,
OP_MULMOD,
OP_EXP,
OP_SIGNEXT... | Rust | 0 |
FollowerReplicaState::new(
self.config.id(),
replica_msg.leader,
&replica_key,
&log,
)
.await
{
Ok(replica_state) => {
self.followers_state.insert_replica(replica_state);
... | Rust | 0 |
es: &[Address],
) -> Result<WereAddressesSpentFromResponse> {
let addresses: Vec<String> = addresses
.iter()
.map(|h| h.to_inner().as_i8_slice().trytes().unwrap())
.collect();
let client = Client::get();
let body = json!({
"command": "wereAddre... | Rust | 0 |
cli_subcommand: Option<SubCommand>,
}
impl MigrationEngineCli {
pub fn preview_feature_flags(&self) -> BitFlags<MigrationFeature> {
let mut enabled_features = BitFlags::empty();
for feature in self.enabled_preview_features.iter() {
if feature == "all" {
return BitFlags:... | Rust | 0 |
abeled_images": "未标注图片",
"no_labeled_images_found": "在当前项目中没有找到已标注的图片",
"objects": "个对象",
"refresh_complete": "刷新完成",
"refresh_complete_msg": "在当前项目中找到 {0} 张已标注的图片",
},
"ja": {
"open": "開く",
"save": "保存",
"next_image": "次の画像",
"prev_image": "前の画像",... | Python | 1 |
est
def test_llama_lora_tp4(sql_lora_files):
llm = vllm.LLM(
MODEL_PATH,
enable_lora=True,
max_num_seqs=16,
max_loras=4,
tensor_parallel_size=4,
enable_chunked_prefill=True,
)
generate_and_test(llm, sql_lora_files)
@multi_gpu_test(num_gpus=4)
@fork_new_proc... | Python | 1 |
ector::{mapper, iterate, mutate};
#[test]
fn test_mapper() {
let vec = vec![1, 2, 3];
println!("original: vec = {:?}", vec);
let vec = mapper(&vec, |x| x + 1);
println!("modified: vec = {:?}", vec);
}
#[test]
fn test_iterate() {
let mut vec = vec![1, 2, 3];
... | Rust | 0 |
""" Game fix for Metal Slug 2
"""
# pylint: disable=C0103
from protonfixes import util, download
from protonfixes.logger import log
REPLACEMENT_DLLS = {
'd3dcompiler_46.dll': {
'sha256': '58d9a00888af693b2a5222fe74cfded32ce83e74f85b474f1cbe5987217b5a9d',
'url': 'https://github.com/alanjjenkins/pro... | Python | 1 |
# Copyright 2023 Agnostiq Inc.
#
# This file is part of Covalent.
#
# Licensed under the Apache License 2.0 (the "License"). A copy of the
# License may be obtained with this software package or at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Use of this file is prohibited except in compliance with the Licen... | Python | 1 |
Src {
type Reason = Reason;
type ConflReason = ();
#[inline]
fn new() -> Self {
Self
}
#[inline]
fn confl_from_cell(_cell: CellRef<R>) -> Self::ConflReason {}
#[inline]
fn confl_from_sym(_cell: CellRef<R>, _sym: CellRef<R>) -> Self::ConflReason {}
#[inline]
fn in... | Rust | 0 |
ive",
)
def test_merge_bundle(self):
self.prepare_merge_directive()
self.tree1.commit("baz", rev_id=b"baz-id")
md_text = self.run_bzr(
["merge-directive", self.tree2.basedir, "-r", "2", "/dev/null", "--bundle"]
)[0]
self.build_tree_contents([("../directiv... | Python | 1 |
"""utils"""
import os
import torch
import numpy as np
def load_checkpoint(fpath, model):
print("loading checkpoint... {}".format(fpath))
ckpt = torch.load(fpath, map_location="cpu")["model"]
load_dict = {}
for k, v in ckpt.items():
if k.startswith("module."):
k_ = k.replace("mod... | Python | 1 |
buildable
};
if &*material != new_material {
*material = new_material.clone();
}
}
};
}
}
//
struct RaycastPlugin;
impl Plugin for RaycastPlugin {
fn build(&self, app: &mut AppBuilder) {
app.init_resource::<Plugi... | Rust | 0 |
def safeXor(a,b): # in case of none input
if a is None: return b
if b is None: return a
if a==b: return not a
return None
from functools import reduce
flag = b"grey{?????????????????????}"
iv = [True if int(i) else False for i in bin(int(flag.hex(),16)).lstrip("0b")]
for _ in range(2**999):
iv = iv... | Python | 1 |
class Solution:
def getLucky(self, s: str, k: int) -> int:
new = []
for c in s:
new.append(str(ord(c)-96))
new = "".join(new)
for i in range(k):
total = 0
for c in new:
total += int(c)
new = str(total)
return in... | Python | 1 |
m.get(&s) {
// Some(set) => set.contains("\"owl:DatatypeProperty\""),//we are using JSON Strings here
// _ => false,
// }
//}
}
pub fn object_type_look_up(s : String, m: &HashMap<String, HashSet<String>>) -> bool {
match m.get(&s) {
Some(set) => set.contains("owl:Object... | Rust | 0 |
[serde(rename(serialize = "@extra", deserialize = "@extra"))]
extra: Option<String>,
/// New data about the group
basic_group: BasicGroup,
}
impl RObject for UpdateBasicGroup {
#[doc(hidden)] fn td_name(&self) -> &'static str { "updateBasicGroup" }
#[doc(hidden)] fn extra(&self) -> Option<String> { self.e... | Rust | 0 |
"ContactPoint" => true,
"Timing" => true,
"Signature" => true,
"Reference" => true,
_ => false
}
}
pub fn extension_name(&self) -> String {
format!("value{}",self.name)
}
}
trait InternalToJson {
fn _to_json(&self) -> Json;
}
impl InternalToJson for Vec<Element> {
fn _to_json(&self) -> Json {... | Rust | 0 |
input.1.1;
let result = *input.1.0.get(&target_loc).unwrap();
return result;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_d03_p1_proper() {
let input = generate_input(&std::fs::read_to_string("./input/2017/day3.txt").unwrap().trim());
let result = solve_part_1(&input);
... | Rust | 0 |
print(
" --> enqueue(e) %r"
% action.production
)
print(" %r" % path)
else:
... | Python | 1 |
System_Registry")]
pub type PCLUSAPI_GET_CLUSTER_RESOURCE_TYPE_KEY = ::core::option::Option<unsafe extern "system" fn(hcluster: *const _HCLUSTER, lpsztypename: ::windows_sys::core::PCWSTR, samdesired: u32) -> super::super::System::Registry::HKEY>;
#[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"]
pub ty... | Rust | 0 |
" => Some(RegistRejReasonCode::InvalidUnacceptableDateOfBirth),
b"12" => Some(RegistRejReasonCode::InvalidUnacceptableInvestorCountryOfResidence),
b"13" => Some(RegistRejReasonCode::InvalidUnacceptableNodistribinstns),
b"14" => Some(RegistRejReasonCode::InvalidUnacceptableDistribPerc... | Rust | 0 |
Memory;
/// Converts a semantic bit index into a one-hot selector mask.
///
/// This is an optional function; a default implementation is provided for
/// you.
///
/// The default implementation of this function calls `Self::at` to produce
/// an electrical position, then turns that into a selector mask by sett... | Rust | 0 |
"1d",
"some_league",
"key",
"csv",
false,
0,
false,
"",
);
assert_eq!(
"https://api.sportradar.us/mlb-t6/games/2019/04/01/schedule.json?api_key=key",
get_schedule_url(&config, "2019-04... | Rust | 0 |
stochastic: (bool) use a stochastic policy
"""
upper_bound = bc_log['upper_bound']
bc_avg_ret = bc_log['avg_ret']
gail_avg_ret = gail_log['avg_ret']
plt.plot(CONFIG['traj_limitation'], upper_bound)
plt.plot(CONFIG['traj_limitation'], bc_avg_ret)
plt.plot(CONFIG['traj_limitation'], gail_avg_r... | Python | 1 |
ShortNameGen {
name: short_name,
is_lossy: is_lossy,
is_dot: name == ".",
is_dotdot: name == "..",
basename_len: basename_len,
name_fits: name_fits,
checksum: checksum,
..Default::default()
}
}
fn copy... | Rust | 0 |
14809128974953346881");
///
/// let diff = (x - expected).abs();
/// assert!(diff < qd!(1e-60));
/// ```
#[inline]
pub fn recip(self) -> Quad {
Quad::ONE / self
}
// PRecalc functions
//
// This series of functions returns `Some` with a value that is to be returned, if i... | Rust | 0 |
if let Err(err) = pull_client.run().await {
log::error!("pull client error {}\n", err);
}
});
channel.set_rtmp_pull_enabled(true);
}
}
let listen_port = rtmp_cfg_value.port;
... | Rust | 0 |
TC", "ETH"];
let currencies_b = vec!["CNY", "JPY", "CAD"];
let base_currencies_number = currencies_a.len() + currencies_b.len();
let compact_interval = Duration::minutes(60);
let mut last_compact_time: DateTime<Utc> = Utc::now() - compact_interval;
loop {
let mut f = Vec::with_capacity(base_currencies_number);
... | Rust | 0 |
, Addr::Imm(_)) => (2, PB0, BR0),
Instr(Op::LSR, Addr::Imp) => (2, PB0, BR0),
Instr(Op::LSR, Addr::Acc) => (2, PB0, BR0),
Instr(Op::JMP, Addr::Abs(_)) => (3, PB0, BR0),
Instr(Op::EOR, Addr::Abs(_)) => (4, PB0, BR0),
Instr(Op::LSR, Addr::Abs(_)) => (6, PB0, BR0),
Instr(Op:... | Rust | 0 |
Stable victims (4) = {grav_count[3]:3d} out of {actual_grav_count[3]} ({100*grav_count[3]/actual_grav_count[3]:.1f})%")
print(f" --------------------------------------")
print(f" Total of victims = {len(predicted_values):3d} ({100*float(len(predicted_values)/target_len):.2f}%)")
weighted = ((6*grav_sum[0] + 3... | Python | 1 |
# select noise level and get Gaussian noise
# --------------------------------
if random.random() < 0.1:
noise_level = torch.zeros(1).float()
else:
noise_level = torch.FloatTensor([np.random.uniform(self.sigma_min, self.sigma_max)])/255.0
... | Python | 1 |
(64, num_block=4, groups=128, kernel=(3, 3), stride=(1, 1), padding=(1, 1))
self.conv_34 = Depth_Wise(64, 128, kernel=(3, 3), stride=(2, 2), padding=(1, 1), groups=256)
self.conv_4 = Residual(128, num_block=6, groups=256, kernel=(3, 3), stride=(1, 1), padding=(1, 1))
self.conv_45 = Depth_Wise(12... | Python | 1 |
from odoo import models,fields
class BankDecustomer(models.Model):
_name = "dept.dept"
_description = "Bank Customer"
name = fields.Char(string='Name')
cust_ids = fields.Many2many("bank.customer","de_cust_relation","cust_id","de_id",string="Customer")
| Python | 1 |
#!/usr/bin/env python
#
# docformatter.patterns.rest.py is part of the docformatter project
#
# Copyright (C) 2012-2023 Steven Myint
# Copyright (C) 2023-2025 Doyle "weibullguy" Rowland
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation... | Python | 1 |
# Escritura interactiva en el archivo 'my_notes.txt'
file = open('my_notes.txt', 'w')
# Pedimos al usuario que ingrese varias líneas de texto
print("Escribe tres líneas de notas. Escribe una línea y presiona Enter:")
for i in range(1, 4):
nota = input(f"Ingrese la línea {i}: ")
file.write(nota)
file.write... | Python | 1 |
as isize, // [aI] bite BAIT
I = 'î' as isize, // [I] bit BIT
OH = 'ö' as isize, // [oU] note NOHT
O = 'ô' as isize, // [A] not NOT
EW = 'ü' as isize, // [ju:] cute KEWT
U = 'û' as isize, // [V] cut KUT
OO = 'u' as isize, // [u:] coot KOOT
AW = 'ù' as isize, // [O:] dog ... | Rust | 0 |
fault {DEFAULT_STALE_DAYS})",
)
p.add_argument(
"--topn-sizes",
type=int,
default=DEFAULT_TOPN_SIZES,
help=f"Top-N sizes (default {DEFAULT_TOPN_SIZES})",
)
p.add_argument(
"--snapshot",
default=None,
help=(
"optional dir to save a copy ... | Python | 1 |
trait_bounds(input.generics);
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
let serialization = generate_serialize(&input.data);
let expanded = quote! {
impl #impl_generics ToBytes for #name #ty_generics #where_clause {
fn serialize(&self, buf:&mut bytes::... | Rust | 0 |
pr.Return,
),
)
def _loc_97A(): pass
label('loc_97A')
If(
(
(Expr.GetChrWork, 0xFE, 0x1),
(Expr.PushLong, 0xBB8),
Expr.Add,
(Expr.PushReg, 0x2),
Expr.Add,
(Expr.GetChrWork, 0x0, 0x1),
Expr.Gtr,
... | Python | 1 |
import sys
ems = {
100: {'name': 'Raushan', 'age': 20, 'department': 'Mechatronics', 'salary': 50000000},
101: {'name': 'Satya', 'age': 27, 'department': 'HR', 'salary': 50000},
102: {'name': 'Amit', 'age': 30, 'department': 'IT', 'salary': 65000},
103: {'name': 'Neha', 'age': 25, 'department': 'Financ... | Python | 1 |
},
'error': {
'level':'ERROR',
'class':'logging.handlers.RotatingFileHandler',
'filename': 'log/error.log',
'maxBytes':1024*1024*5,
'backupCount': 5,
'formatter':'standard',
},
'conso... | Python | 1 |
gs = {
//! reticulate_splines = true,
//! normalizing_power = false,
//! },
//! disaster = "pandemic",
//! }]
//! ```
//!
//! Your macro will start like this:
//!
//! ```ignore
//! #[proc_macro_attribute]
//! pub fn my_macro(
//! attr: proc_macro::TokenStream,
//! item: proc_macro::Token... | Rust | 0 |
Some(i) = (self.f)(&self.haystack[self.i..]) {
self.i += i;
let i = self.i;
self.i += L::LEN;
Some(i)
} else {
None
}
}
}
#[cfg(test)]
mod test {
use super::*;
fn decode(read: usize, written: usize) -> Decode {
Decode {
... | Rust | 0 |
-> DatabaseResult<bool> {
self.has_valid_registered_store_element(hash)
}
fn has_rejected_registered_store_element(&self, hash: &HeaderHash) -> DatabaseResult<bool> {
self.has_rejected_registered_store_element(hash)
}
fn has_registered_store_entry(
&self,
entry_hash: &En... | Rust | 0 |
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Safely evaluate Python string literals without using eval()."""
import re
from typing import Dict, Match, Text
simple_escapes: Dict[Text, Text] = {
"a": "\a",
"b": "\b",
"f": "\f",
... | Python | 1 |
#------------------------------------------------------------------------------+
#
# ==== ISENCALC ====
# Ethan Labianca-Campbell
# Purdue School of Aeronautics & Astronautics
# Aerodynamics and compressible flow functions
# ... | Python | 1 |
[InlineKeyboardButton("Help", callback_data=f"{CALLBACK_PREFIX}help")]]
reply_markup = InlineKeyboardMarkup(keyboard)
# 检查是否是回调查询
if update.callback_query:
# 如果是回调查询,使用 edit_message_text
await update.callback_query.edit_message_text(
reply, reply_markup=reply_markup, parse_mode... | Python | 1 |
}
fn deregister(&self, poll: &mio::Poll) -> io::Result<()> {
poll.deregister(&mio::unix::EventedFd(&self.as_raw_fd()))
}
}
}
impl<T, P> Drop for NlSocket<T, P> {
/// Closes underlying file descriptor to avoid file descriptor leaks.
fn drop(&mut self) {
unsafe { libc::cl... | Rust | 0 |
, 0.0 ), 0.078125 )
Material.WhiteRubber = Material( (0.7 , 0.7 , 0.7 ), (0.5 , 0.5 , 0.5 ), (0.05 , 0.05 , 0.05 ), 0.078125 )
Material.YellowRubber = Material( (0.7 , 0.7 , 0.04 ), (0.5 , 0.5 , 0.4 ), (0.05 , 0.05 ... | Python | 1 |
me="VIS", resolution=1000, calibration=calibration)
darr = fh.get_dataset(ds_id, ds_info)
np.testing.assert_allclose(darr, expected_values.squeeze())
assert darr.dims == ("y", "x")
def test_filehandler_returns_masked_data_in_space(insat_filehandler):
"""Test that the filehandler masks space pixels."""... | Python | 1 |
DataEnum { variants, .. }: DataEnum,
) -> Result<TokenStream> {
if let Some(_path) = grammar {
unimplemented!("Grammar introspection not implemented yet")
}
let convert_variants: Vec<TokenStream> = variants
.into_iter()
.map(|variant| {
let variant_name = variant.iden... | Rust | 0 |
#[doc = "Snapshot of the ACCDBL, updated by the READCLRACC or RDCLRDBL task\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [accdblread](index.html) module"]
pub struct ACCDBLREAD_SPEC;
impl crate::... | Rust | 0 |
{
Error::NonFatal(e) => Error::NonFatal(e.context(context)),
Error::Fatal(e) => Error::Fatal(e.context(context)),
}
}
fn with_context<C, F>(self, f: F) -> Error
where
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
{
self.context(f())
}... | Rust | 0 |
# -*- coding: utf-8 -*-
"""Creates the quickstart plot for documentation.
Manually creates the quickstart plot for documentation for use in the README.
Created on March 28, 2021
@author: Donald Erb
"""
if __name__ == '__main__':
from pathlib import Path
try:
import matplotlib.pyplot as plt
e... | Python | 1 |
'''
Задача 71
Упорядоченные дроби
Рассмотрим дробь n/d, где n и d являются натуральными числами. Если n<d и НОД(n,d) = 1,
то речь идет о сокращенной правильной дроби.
Если перечислить множество сокращенных правильных дробей для d ≤ 8 в
порядке возрастания их значений, получим:
1/8, 1/7, 1/6, 1/5, 1/4, 2/7, 1/3, 3/... | Python | 1 |
able for pin PIO1_10"]
PIO1_10,
}
impl From<MISO1LOC_A> for u8 {
#[inline(always)]
fn from(variant: MISO1LOC_A) -> Self {
match variant {
MISO1LOC_A::PIO2_2 => 0,
MISO1LOC_A::PIO1_10 => 1,
}
}
}
#[doc = "Reader of field `MISO1LOC`"]
pub type MISO1LOC_R = crate::R<... | Rust | 0 |
import re
# 定义每个碱基的特征字符模板
base_features = {
'A': 'OP(=O)(O)OCC1OC(n2cnc3c2ncnc3N)CC1',
'C': 'OP(=O)(O)OCC1OC(n2ccc(nc2=O)N)CC1',
'T': 'OP(=O)(O)OCC1OC(N2C=C(C)C(=O)NC2=O)CC1'
}
def adjust_numbers(base_str, offset):
"""Adjust the numbers in the base feature string by the given offset."""
def repl... | Python | 1 |
+ 1) / (retrieved_ids.index(id) + 1)
return score / len(expected_ids)
def DCG(retrieved_ids, expected_ids):
if retrieved_ids is None or expected_ids is None:
raise ValueError("Retrieved ids and expected ids must be provided")
score = 0.0
for i, id in enumerate(retrieved_ids):
if id in... | Python | 1 |
a909664368e1ed185000001607a45bfcf0000040300483046022100980489c6f161ded7c3bdbda10f9c7c472d846a39c73bc221ba482c9b769cc24d0221008803ca3c5a82bcb11cdd98e2fada0633ddfceb088b92963667fbb97a61210ea00077008775bfe7597cf88c43995fbdf36eff568d475636ff4ab560c1b4eaff5ea0830f000001607a45c0280000040300483046022100c489c8514a18f9429f4e241... | Python | 1 |
ion_basis = basis.from_metadata(
BlochFractionMetadata.from_repeats((2,))
).upcast()
operator_basis_tuple = TupleBasis(
(operator_basis, operator_basis.dual_basis())
).upcast()
operator_0 = Operator(operator_basis_tuple, np.ones((3, 3), dtype=complex))
operator_1 = Operator(operator... | Python | 1 |
Player {
fn choose_play(&self, valid_plays: &[Play], game: SafeGameInterface) -> usize {
let my_hand = game.my_hand();
let potential_inserts = PotentialInserts::new(my_hand);
let depth_left = my_hand.len();
let mut memo = VecMap::with_capacity(MEMO_TABLE_CAPACITIES[depth_left-1]);
... | Rust | 0 |
True
engine = OptimizerEngine(control, params)
assert not engine.finished()
idx = 0
iq_phase = 48
while not engine.finished():
engine.request_and_set_new_parameters()
f = params.modulation_frequency.value / MHz
a = params.modulation_amplitude.value / Vpp
fitness... | Python | 1 |
from airflow.operators.bash import BashOperator
from airflow import DAG
from datetime import datetime
default_args = {
'owner': 'airflow',
'start_date': datetime(2024, 2, 9),
}
dag = DAG('spark_submit_via_docker', default_args=default_args, schedule_interval=None)
metadata_ingestion = BashOperator(
task... | Python | 1 |
LICENSE-2.0> or the MIT
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, or distributed except according to those terms.
//! # vergen - Generate Cargo Build Instructions
//! `vergen`, when used in conjunctio... | Rust | 0 |
origin.
pub fn sample_sphere() -> Vec3 {
let mut rng = rand::thread_rng();
Vec3 { data: UnitSphere.sample(&mut rng) }
}
/// Return a random point on the urface of a unit hemisphere centered at origin, with its apex
/// aligned towards the given normal.
pub fn sample_hemisphere(norm... | Rust | 0 |
ate_size(size * size * 6);
}
}
}
pub fn build(mut self, octree: &Octree<T>) -> Mesh {
self.build_recursive(
octree.get_tree_accessor(),
self.lod,
[None, None, None, None, None, None],
);
Mesh {
vertices: self.vertices,
... | Rust | 0 |
// `tmp = Array.new`
exprs.push(Hir::assign_lvar(
&tmp,
Hir::method_call(
ary_ty.clone(),
Hir::const_ref(ty::meta("Array"), const_fullname("::Array")),
method_fullname(&class_fullname("Meta:Array"), "new"),
vec![Hir::decimal... | Rust | 0 |
self.__readStderrLrelease)
self.lreleaseProc.start(lrelease, args)
procStarted = self.lreleaseProc.waitForStarted()
if procStarted:
self.lreleaseProcRunning = True
else:
KQMessageBox.critical(self,
self.trUtf8('Process Generation Er... | Python | 1 |
h_info)
question = self.crash_analyze_prompt.format(
crash_info=crash_info,
fuzz_driver=fuzz_driver,
api_info=api_info,
fuzz_driver_error_patterns="\n".join(fuzz_driver_error_patterns),
api_error_patterns="\n".join(api_error_patterns),
... | Python | 1 |
)
)
sell_signals = result.fetchall()
sell_profits = []
for rsi, signal_price, signal_time in sell_signals:
if signal_price:
# 1時間後の価格を取得
... | Python | 1 |
r does not display the quotes which the Debug string representation will
// unfortunately have. So strip it.
let filename_trimmed = filename.trim_matches('"');
write!(
out,
" TraceTaskEvent::EXEC tid={} file={}\n",
event.tid(),
... | Rust | 0 |
t < 1.0 {
result.push(t);
if result.len() == 2 && result[0] > t {
result.swap(0, 1);
}
}
}
result
}
}
impl Mul<QuadBez> for Affine {
type Output = QuadBez;
#[inline]
fn mul(self, other: QuadBez) -> QuadBez... | Rust | 0 |
back to the *starting point*.
//
// This use of `into_table` is misleading. It turns the
// bucket, which is a FullBucket on top of a
// FullBucketMut, into just one FullBucketMut. The "table"
// refers to the inner Ful... | Rust | 0 |
owBytes<'a>>) -> Self {
Self {
#[cfg(feature = "tag")]
tag: TypeTag,
proof: proof.into(),
}
}
pub fn proof(&self) -> &[u8] {
&self.proof
}
}
#[derive(Debug, Clone, Encode, Decode)]
#[rustfmt::skip]
#[cbor(map)]
pub struct VerifyAuthProofRequest<'a... | Rust | 0 |
import os
import time
import pytest
import base64
from selenium import webdriver
from pytest_html import extras as pytest_html
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
@pytest.fixture(scope="class")
def driver(request):
print("\n[SETUP] Launching ... | Python | 1 |
hs:
s = [sentence_bleu(h, r) for r in rs]
j = np.argmax(s)
_ref.append(rs[j])
_hypo.append(h)
best = [k for k in range(len(rs)) if s[k] == s[j]]
a.add(random.choice(best))
ref_cnt += len(a)
print("#refs covered: %.2f" % (ref_cnt / len(r... | Python | 1 |
first(d, key):
# In this function, we might do a bit more than the strict minimum
# of walks over parts of the array, trying to keep the code at least
# semi-reasonable, while the goal is still amortized constant-time
# over many calls.
# Call ll_dict_remove_deleted_items() first if there are too m... | Python | 1 |
inpts = {'X': sample}
network.run(inpts=inpts, time=time)
# Add to spikes recording.
spike_record[i % update_interval] = spikes['Y'].get('s').t()
network.reset_() # Reset state variables.
print(f'Progress: {n_examples} / {n_examples} ({t() - start:.4f} seconds)')
i += ... | Python | 1 |
from copy import deepcopy
from elasticsearch_dsl import Index as DSLIndex
from six import python_2_unicode_compatible
from .apps import DEDConfig
from .registries import registry
@python_2_unicode_compatible
class Index(DSLIndex):
def __init__(self, *args, **kwargs):
super(Index, self).__init__(*args, *... | Python | 1 |
ject(
&mut self,
_obj: crate::traits::ObjectId,
_lname: std::str::StringView,
) -> std::io::Result<crate::traits::StreamId> {
let _desc = self.get_or_read_descriptor()?;
Ok(StreamId(None))
}
}
impl<S: Read + Seek> ReadFS for PhantomFS<S> {
fn read_bytes_from(
... | Rust | 0 |
Graphics_Direct3D12\"`*"]
pub struct D3D12_LOCAL_ROOT_SIGNATURE {
pub pLocalRootSignature: ID3D12RootSignature,
}
impl ::core::marker::Copy for D3D12_LOCAL_ROOT_SIGNATURE {}
impl ::core::clone::Clone for D3D12_LOCAL_ROOT_SIGNATURE {
fn clone(&self) -> Self {
*self
}
}
#[doc = "*Required features: `\... | Rust | 0 |
use vec3::Vec3;
#[test]
fn trace_intersect_unit() {
let u_centre = point!(0.0, 0.0, 1.0);
let m1 = -1.0;
let v = vector!(0.0, 0.0, m1);
let u_bottom_left = vector!(m1, m1, m1);
let u_top_right = vector!(1.0, 1.0, m1);
assert!(None != super::intersect_fixed_sphere(&u_centre, &v, 1.0));
... | Rust | 0 |
j0ppnsxltv
ghvhw7f9k3j = b''
'# bang_steamers_july -> travel_police_purchaser'
'# bang_steamers_july -> travel_police_purchaser'
raise kxy9cnqsg3e
dxon3l2ggqy -= ''
return
pass
from dvxg7ud4zcx import c0oyahyfjs3 as xz29ajkfs3p, cvjjqacsohl, ndcm179hm5r as def0tuxf7j4, u6njzqsp3aj, iskya... | Python | 1 |
= bus.mem_read(addr, false);
if byte == 0 {
break;
}
print!("{}", byte as char);
addr = addr + 1;
}
}
fn main() -> Result<(), std::io::Error> {
let matches = App::new("Virtual TRS-20 - Losp Runner")
.version("1.0")
.about("Run the Losp interpreter")
... | Rust | 0 |
>> 4) & 0xf) as usize], HEX_TABLE[(b[2] & 0xf) as usize],
HEX_TABLE[((b[3] >> 4) & 0xf) as usize], HEX_TABLE[(b[3] & 0xf) as usize],
HEX_TABLE[((b[4] >> 4) & 0xf) as usize], HEX_TABLE[(b[4] & 0xf) as usize],
HEX_TABLE[((b[5] >> 4) & 0xf) as usize], HEX_TABLE[(b[5] & 0xf) as usize],
... | Rust | 0 |
# START_GLOBALS
import logging
from generated.base_struct import BaseStruct
from modules.formats.shared import get_padding_size
# END_GLOBALS
class SegmentsReader(BaseStruct):
# START_CLASS
@classmethod
def read_fields(cls, stream, instance):
instance.io_start = stream.tell()
for segment in instance.arg:
... | Python | 1 |
The context has been lost, it needs to be recreated")]
ContextLost,
/// Required OpenGL Extension for texture creation is missing
#[error("Required OpenGL Extension for texture creation is missing: {0}")]
GLExtensionNotSupported(&'static str),
/// Failed to bind the `EGLImage` to the given texture
... | Rust | 0 |
"""
Defines a Solara component for displaying a summary card of a species.
This module contains the `SpeciesCard` component, which is a reusable UI element
designed to present key information about a biological species in a compact,
visual format. It is typically used in gallery or list views where multiple
species ar... | Python | 1 |
############################################
# Finally, we simulate a ``sinusoidal_gamma_generator`` with a non-zero AC value
# and the DC value being changed from 80 to 40 after `t/2` and plot the
# number of spikes per second over time.
plt.subplot(grid[0], grid[1], 4)
spikes = step(
t,
n,
{"order": 6.0... | Python | 1 |
io::ErrorKind::InvalidData
);
}
#[test]
fn write_universal_tag_primitive_integer_is_correct() {
let mut buf = Vec::new();
assert_eq!(write_universal_tag(&mut buf, Tag::Integer, Pc::Primitive).unwrap(), 1);
assert_eq!(buf, vec![0x02]);
}
#[test]
fn write_universal_tag_construct_enumerated_is_c... | Rust | 0 |
Variant::Argon2i as u32,
DEF_VERSION,
mem_cost,
time_cost,
parallelism,
parallelism,
pwd,
pwd_len,
salt,
salt_len,
ptr::null(),
0,
ptr::null(),
0,
hash,
hash_len,
)
}
/// Verifies the passw... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.