text string | label_name string | labels int64 |
|---|---|---|
#encoding=utf-8
import MySQLdb
import json
import jsonpath
import urllib2
import os
class DuoDian():
def __init__(self):
self.url = 'https://gatewx.dmall.com/customersite/searchWareByCategory?param={"pageNum":1,"pageSize":30,"venderId":"1","storeId":"108","sort":"1","categoryId":11347,"categoryLevel":3,"ca... | Python | 1 |
McpChannel::Snapshot => "snapshot",
McpChannel::Stable => "Stable",
})
}
}
#[derive(Copy, Clone, Debug)]
struct McpVersionInfo { // TODO: Rename to ResolvedMcpVersion
minecraft_version: MinecraftVersion,
version: McpVersion
}
impl McpVersionInfo {
fn download_into(&self... | Rust | 0 |
}
fn print_packed_command(&self, cmd: Vec<u8>) {
let input = String::from_utf8_lossy(&cmd);
let mut chars = input.chars().peekable();
let mut mode = CommandParseMode::ArgumentCount;
let mut output = String::new();
while let Some(char) = chars.next() {
// Ad... | Rust | 0 |
max size is too high. The value must be {} bytes or less",
MAX_PAYLOAD_SIZE
))]
BatchMaxSize,
#[snafu(display(
"Batch max events is too high. The value must be {} or less",
MAX_PAYLOAD_EVENTS
))]
BatchMaxEvents,
}
#[allow(clippy::large_enum_variant)]
#[derive(Debug, Snafu)]
... | Rust | 0 |
atetime.utcnow().replace(tzinfo=pytz.utc)
cancel_limit += timedelta(0, reserv_remove.asset.cancelation_in_advance * 60)
if reserv_remove.reservation_begins < cancel_limit:
messages.error(request, _('Not enough time in advance to cancel this reservation.'))
return HttpResponseRed... | Python | 1 |
32,
pub maxX : f32,
pub maxY : f32,
pub maxZ : f32,
}
pub type AabbPositionsNV = AabbPositionsKHR;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PhysicalDeviceRepresentativeFragmentTestFeaturesNV {
pub sType : StructureType,
pub pNext : *mut void,
pub representativeFragmentTest : Bool32,
}
#[repr(C)]
#[d... | Rust | 0 |
moon(-13, -11, 0, 0, 0, 0),
moon(-17, -7, 15, 0, 0, 0),
moon(-16, 4, 2, 0, 0, 0),
];
let steps = simulate_moons(moons.clone(), 1000);
let step_1000 = &steps[1000];
let total_energy: i32 = step_1000.iter().map(|moon| moon.energy()).sum();
println!("Part 1: {:?}, Total Energy: {}", s... | Rust | 0 |
lt.figure()
sns.scatterplot(x='Age', y='DiabetesPedigreeFunction', data=df, hue='Outcome', palette='YlOrBr')
sns.scatterplot(x=user_data['Age'], y=user_data['DiabetesPedigreeFunction'], s=150, color=color)
plt.xticks(np.arange(10, 100, 5))
plt.yticks(np.arange(0, 3, 0.2))
plt.title('0 - Healthy & 1 - Unhealthy')
st.pyp... | Python | 1 |
}
if let Some(true) = map[r].get(c + 1).copied() {
to_visit.push((r, c + 1))
}
}
size
}
#[aoc_generator(day9)]
pub fn input_generator(input: &str) -> Result<Vec<Vec<u32>>, nom::Err<()>> {
use nom::{
bytes::complete::take,
character::complete::{line_endi... | Rust | 0 |
e.GREEN}[+] Update to version {version} completed!{Style.RESET_ALL}")
return True
except Exception as e:
print(f"{Fore.RED}[-] Download/extract failed: {e}{Style.RESET_ALL}")
return False
def copy_update_files(self, extract_path):
"""Copy updated... | Python | 1 |
has_name(word)) {
Some(a) => (Some(a), true),
None => (None, false),
}
}
}
/// A portion of documentation, extracted from a `#[doc]` attribute.
///
/// Each variant contains the line number within the complete doc-comment where the fragment
/// starts, as well as the Span where the ... | Rust | 0 |
ent::Entity> for Statement {
type Error = crate::Error;
fn try_into(self) -> crate::Result<crate::model::statement::Entity> {
let entity = crate::model::statement::Entity {
statement_id: self.id,
speaker_id: self.speaker_id,
video_id: self.video_id,
text:... | Rust | 0 |
/// Search for an element on the current page using the specified selector.
///
/// # Example:
/// ```rust
/// # use thirtyfour::error::WebDriverResult;
/// # use thirtyfour::{By, DesiredCapabilities, WebDriver};
/// # use tokio;
/// #
/// # #[tokio::main]
/// # async fn main()... | Rust | 0 |
gress:
return program_progress
return None
def get_program_completion(program):
topics = frappe.db.sql(
"""select `tabCourse Topic`.topic, `tabCourse Topic`.parent
from `tabCourse Topic`,
`tabProgram Course`
where `tabCourse Topic`.parent = `tabProgram Course`.course
and `tabProgram Course`.parent = %s... | Python | 1 |
::parse(rules).unwrap();
let model = unsafe {
assert!(!models.is_null());
CStr::from_ptr(models)
};
let model_str = model.to_str().unwrap();
let code_files: Vec<CodeFile> = serde_json::from_str(model_str).unwrap();
let mut executor = RuleExecutor::new(code_files, guard_rules);
... | Rust | 0 |
Big));
///
/// assert_eq!(be(b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15abcd"), Ok((&b"abcd"[..], 0x00010203040506070809101112131415)));
/// assert_eq!(be(b"\x01"), Err(Err::Incomplete(Needed::new(15))));
///
/// named!(le<u128>, u128!(Endianness::Little));
///
/// assert_eq!(le(b"\x00\x01\x02\x0... | Rust | 0 |
_port: u16, _value: u8) {
unimplemented!()
}
fn write_io_u16(&self, _port: u16, _value: u16) {
unimplemented!()
}
fn write_io_u32(&self, _port: u16, _value: u32) {
unimplemented!()
}
fn read_pci_u8(&self, _segment: u16, _bus: u8, device: u8, _function: u8, _offset: u16)... | Rust | 0 |
h.",
"That card is plastered all over the office.",
"Everybody is calling me, Nip!",
"...",
"Yeah.",
"That's my new nickname at the office.",
"Nip!",
"These guys keep asking me out for drinks.",
"Not only that, Fred, you know the guy I told you about?",
"He hasn't called me in three days.",
"...",
... | Rust | 0 |
5\xc1\x01\x8b\xf4\xae\xe7\xfa\x8d\x0e\x90\xcb\x99\xfe\xbay\
\x17L2\xe8Q\x99\xc1\x92I\xbc*]\xb0\xef\xe8\xab\
\x1e\xb27uQ\x1bF\xed\xe9\x1b~\xea{\x1b\x0f\xf3\
\xbd\xacU?\xfa\xa3?\xfa\xa8\xa3\xf4\x89\x01\xea\xbd\xe0\
\xa3\xfa\x18\xac,GJ\x9b_\xb2\x93\x5c\xe1gp\xc7\
\xa0\x89m\xa8mx\xdbpu\xb1W\xd1R\xcf\xcb\xbe\
\x95\xc3!\x1d\... | Python | 1 |
import logging
import hashlib
import json
from typing import List, Dict, Any, Optional
from dataclasses import dataclass
from enum import Enum, auto
from statistics import mean, stdev
class ValidationStatus(Enum):
VALID = auto()
INVALID = auto()
INCONCLUSIVE = auto()
@dataclass
class ValidationResult:
... | Python | 1 |
foreign architecture.
use std::arch::asm;
// @has asm_foreign/fn.aarch64.html
pub unsafe fn aarch64(a: f64, b: f64) -> f64 {
let c;
asm!("add {:d}, {:d}, d0", out(vreg) c, in(vreg) a, in("d0") {
|| {};
b
});
c
}
// @has asm_foreign/fn.x86.html
pub unsafe fn x86(a: f64, b: f64) -> f64... | Rust | 0 |
_ref().and_then(|it| it.line_folding_only) {
self.client_caps.line_folding_only = value
}
}
}
#![cfg_attr(not(feature = "std"), no_std)]
use frame_support::pallet;
pub use pallet::*;
#[cfg(test)]
pub(crate) mod mock;
#[cfg(test)]
mod tests;
#[pallet]
pub mod pallet {
use codec::{Decode, E... | Rust | 0 |
, Item};
use crate::st::St;
use crate::types::{Env, Subst, SubstEntry, Ty, TyInfo, TyScheme};
use fast_hash::FxHashMap;
use std::collections::BTreeMap;
pub(crate) fn get_scon(scon: &hir::SCon) -> Ty {
match scon {
hir::SCon::Int(_) => Ty::INT,
hir::SCon::Real(_) => Ty::REAL,
hir::SCon::Word(_) => Ty::WOR... | Rust | 0 |
dist.irq_base + i as u64;
self.access_gic_distributor(GICD_IROUTER + offset, &mut dist.gicd_irouter_l[i], true)?;
self.access_gic_distributor(
GICD_IROUTER + offset + REGISTER_SIZE,
&mut dist.gicd_irouter_h[i],
true,
)?;
}
... | Rust | 0 |
e, None) {
Ok(_) => (),
Err(e) => fail!(e.to_str()),
}
//
println("finding_one Person struct from collection");
let doc = match coll.find_one(None, None, None) {
Ok(bson) => Embedded(bson),
Err(e) => fail!(e.to_str()),
};
let fst = match BsonFormattable::from_bson_t::... | Rust | 0 |
value.__cause__ = cause
if value.__traceback__ is not tb:
raise value.with_traceback(tb)
raise value
else:
# not as nice as that of Py3K, but at least preserves
# the code line where the issue occurred
exec("def reraise(tp, value, tb=None, cause=None):\n"
" if ca... | Python | 1 |
adc_dcctl6_ctc_mid(self) -> &'a mut W {
self.variant(ADC_DCCTL6_CTCW::ADC_DCCTL6_CTC_MID)
}
#[doc = "High Band"]
#[inline(always)]
pub fn adc_dcctl6_ctc_high(self) -> &'a mut W {
self.variant(ADC_DCCTL6_CTCW::ADC_DCCTL6_CTC_HIGH)
}
#[doc = r"Writes raw bits to the field"]
#[i... | Rust | 0 |
self.add_asm_inst(
asm,
linked_hashmap! {
id2 => vec![loc2]
},
linked_hashmap! {
id1 => vec![loc1]
},
false,
)
}
/// emits a store instruction to store a spilled register
fn emit_spill_st... | Rust | 0 |
# Copyright 2021 The Google Earth Engine Community Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | Python | 1 |
ile_bank, FileBank);
list_benchmark!(list, extra, pallet_contracts, Contracts);
list_benchmark!(list, extra, pallet_segment_book, SegmentBook);
list_benchmark!(list, extra, pallet_sminer, Sminer);
// list_benchmark!(list, extra, pallet_template, TemplateModule);
/*** Add This Line ***/
// list... | Rust | 0 |
AP,
};
use bracket_lib::prelude::*;
use specs::prelude::*;
/*
*
* state.rs
* --------
* Controls the running systems, game states and other main functions at every tick.
*
*/
#[derive(Debug, PartialEq, Copy, Clone)]
pub enum RunState {
Running,
Waiting,
Start,
PlayerTurn,
MobTurn,
Target... | Rust | 0 |
Skill Key
/// I: Item Key
/// IT: Item Type
/// CD: Item Custom Data
impl<K: Hash + Eq + Debug, E, S, I: Hash + Eq + Clone + PartialEq + Debug>
SkillDefinition<K, E, S, I>
{
/// Checks if all the conditions to use this skill are met.
pub fn check_conditions<IT: SlotType, CD: PartialEq + Default + Clone + D... | Rust | 0 |
or.gather(loss.repeat(train_batch_size)).mean()
train_loss += avg_loss.item() / gradient_accumulation_steps
accelerator.backward(loss)
if accelerator.sync_gradients:
accelerator.clip_grad_norm_(unet.parameters(), max_grad_norm)
optimiz... | Python | 1 |
_app(integration_client, create_app_req1) as test_app_resp1:
with shared.with_test_app(
integration_client, create_app_req2
) as test_app_resp2:
app_id1 = test_app_resp1["app"]["id"]
app_id2 = test_app_resp2["app"]["id"]
metrics_resp = integration_client.... | Python | 1 |
for each_file in complicate_code:
#
# # for code_list, file_path,file_html in each_file:
# #
# # print("count: ",code_list)
# code_list=each_file[0]
# file_path=each_file[1]
# file_html=each_file[2]
# count ... | Python | 1 |
node_info.get("hostname", "N/A"),
'cpu_cores': int(node_info.get("cpu_cores", 0)),
'memory_gb': int(node_info.get("memory_gb", 0)),
'status': node_info.get("status", "Unknown"),
'last_heartbeat': float(node_info.get("last_h... | Python | 1 |
# config.py
import os
# Application constants
APPLICATION_NAME = "Screenshot App"
ICON_PATH = "assets/icon.ico"
PLACEHOLDER_IMAGE = "assets/screenshot_placeholder.png"
SCREENSHOT_SOUND = "assets/screenshot.wav"
SCREENSHOTS_DIR_NAME = "Screenshots"
# Window titles and messages
SELECT_WINDOW_TITLE = "Select Window"
SEL... | Python | 1 |
= false;
sent.max_bi_stream_id = true;
trace!(log, "MAX_STREAM_ID (bidirectional)");
buf.write(frame::Type::MAX_STREAM_ID);
buf.write(StreamId::new(
!self.side,
Directionality::Bi,
self.max_remot... | Rust | 0 |
vec.is_empty() {
Err(vec)
} else {
Ok(Vec1(vec))
}
}
/// Turns this `Vec1` into a `Vec`.
pub fn into_vec(self) -> Vec<T> {
self.0
}
/// Return a reference to the underlying `Vec`.
pub fn as_vec(&self) -> &Vec<T> {
&self.0
}
/// ... | Rust | 0 |
NO_ITER_VALUE = 1,
JS_GENERATOR_CLOSING = 2,
JS_NO_CONSTANT = 3,
JS_THIS_POISON = 4,
JS_ARG_POISON = 5,
JS_SERIALIZE_NO_NODE = 6,
JS_LAZY_ARGUMENTS = 7,
JS_OPTIMIZED_ARGUMENTS = 8,
JS_IS_CONSTRUCTING = 9,
JS_OVERWRITTEN_CALLEE = 10,
JS_BLOCK_NEEDS_CLONE = 11,
JS_HASH_KEY_EMPT... | Rust | 0 |
非零值的索引
nonzero_indices = torch.nonzero(self.mask)
# 如果没有非零值,返回一个空的边界框
if nonzero_indices.size(0) == 0:
# print("nonzero_indices", nonzero_indices)
return []
# 计算最小和最大索引
y_min, x_min = torch.min(nonzero_indices, dim=0)[0]
y_max, x_... | Python | 1 |
enums.")
};
types
}
/// In order to avoid conflicting definitions of the GetVariant / SetVariant traits for
/// enums that are generic over more than one parameter, we use marker structs:
/// see https://stackoverflow.com/questions/52281091/can-i-avoid-eager-ambiguity-resolution-for-trait-implementations-with... | Rust | 0 |
import os
if os.environ.get("PEFT_DEBUG_WITH_TORCH_COMPILE") == "1":
# This is a hack purely for debugging purposes. If the environment variable PEFT_DEBUG_WITH_TORCH_COMPILE is set to
# 1, get_peft_model() will return a compiled model. This way, all unit tests that use peft.get_peft_model() will
# use a ... | Python | 1 |
nt_studies.append([s_stem, ''])
print(f'no impression/findings: {patient_path / s}')
else:
# store the text of the conclusion section
patient_studies.append([s_stem, sections[idx].strip()])
study_sectioned = [s_stem]
... | Python | 1 |
"""
文件路径:your_project/reward_functions/accuracy_reward.py
说明
----
- 评分结构:
overall = format_weight * format_score # 默认 0.1
+ (1 - format_weight) * acc_score # 默认 0.9
+ reason_score # 直接累加
- reason_score 仅在 **预测选项命中** 时计算,
= (BLEU‑1 + ROUGE‑L) / 2... | Python | 1 |
test)]
#[macro_use]
mod test_helpers;
mod github_client;
mod deployment_client;
mod models;
mod cli;
fn main() {
if let Err(err) = cli::execute_command(&cli::create_cli_app().get_matches()) {
println!("Error: {}", err.as_fail());
for cause in err.iter_causes() {
println!("Caused by:");... | Rust | 0 |
from aiogram import Router, types, F
from aiogram.filters import StateFilter
from aiogram.fsm.context import FSMContext
from aiogram.utils.keyboard import InlineKeyboardBuilder
from datetime import datetime, timedelta
import logging
import asyncio
from modules.handlers.auth import AuthFilter
from modules.handlers.stat... | Python | 1 |
}
#[test]
fn eval_test_step8() {
let mut env = Environment::new();
init_environment(&mut env);
let mut tests: Vec<(&str, MalType, bool)> = Vec::new();
//;; Testing trivial macros
tests.push(("(defmacro! one (fn* () 1))", MalType::nil(), false));
tests.push(("(d... | Rust | 0 |
"*Required features: `\"Win32_System_Threading\"`*"]
pub const ProcThreadAttributeSafeOpenPromptOriginClaim: PROC_THREAD_ATTRIBUTE_NUM = 17u32;
#[doc = "*Required features: `\"Win32_System_Threading\"`*"]
pub const ProcThreadAttributeDesktopAppPolicy: PROC_THREAD_ATTRIBUTE_NUM = 18u32;
#[doc = "*Required features: `\"... | Rust | 0 |
er
/// Macro for including and loading a texture
#[macro_export]
macro_rules! load_texture (
($file:expr, $display:expr) => {{
use $crate::glium::texture::compressed_srgb_texture2d::CompressedSrgbTexture2d;
use $crate::glium::texture::RawImage2d;
use std::io::Cursor;
use $crate::imag... | Rust | 0 |
#
# The MIT License (MIT)
# Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without ... | Python | 1 |
# teletext-twitter - creates pages for vbit2 teletext system
# (c) Mark Pentler 2018 (https://github.com/mpentler)
# see README.md for details on getting it running or run with -h
# text processor module
import textwrap
import re
ESCAPE = chr(27)
text_colours = {"red" : 65, "green" : 66, "yellow" : 67 , "blue" : 68, ... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
中航光电(002179.SZ)实时股票分析工具
基于增强版机器学习预测模型
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import joblib
import os
import sys
import warnings
from datetime import datetime, timedelta
import os
import argparse
# 忽略警告
warnings.filterwarnings('igno... | Python | 1 |
"""Test training and evaluation.
mocker.patch, https://pytest-mock.readthedocs.io/en/latest/
"""
from __future__ import annotations
import os
import shutil
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import TYPE_CHECKING
import pytest
from omegaconf import DictConfig, OmegaConf
fro... | Python | 1 |
pub fn plist_dict_get_size(node: plist_t) -> u32;
}
extern "C" {
#[doc = " Create an iterator of a #PLIST_DICT node."]
#[doc = " The allocated iterator should be freed with the standard free function."]
#[doc = ""]
#[doc = " @param node The node of type #PLIST_DICT."]
#[doc = " @param iter Locat... | Rust | 0 |
def taxed_coin_exchange(coins, tax, target):
n = len(coins)
dp = [[float('inf')] * (target + 1) for _ in range(n + 1)]
dp[0][0] = 0
for i in range(1, n + 1):
for j in range(target + 1):
if j < coins[i - 1] or (i > 1 and coins[i - 1] < coins[i - 2] and coins[i - 1] % 2 == 1) or (i > ... | Python | 1 |
from flask import Blueprint
bp = Blueprint('Influencer', __name__)
from app.influencer import routes | Python | 1 |
_baud_timestamp: Instant,
}
impl Rtu {
/// Create a new RTU connection
///
/// This function opens serial port with [this](serialport::open_with_settings) function.
///
/// # Examples
/// ```
/// use serialport::{SerialPortSettings, DataBits, FlowControl, Parity, StopBits};
/// use st... | Rust | 0 |
# Time: precompute: O(sqrt(r)), r = max(nums)
# runtime: O(n * (logr + pi(sqrt(r))) = O(n * (logr + sqrt(r)/log(sqrt(r)))), pi(n) = number of primes in a range [1, n] = O(n/logn) by prime number theorem, see https://en.wikipedia.org/wiki/Prime_number_theorem
# Space: O(sqrt(r) + nlogr)
# linear sieve of era... | Python | 1 |
ow_headers=["*"]
)
# Файл для сохранения истории чата
CHAT_HISTORY_FILE = settings["chat"]["history_file"]
def load_chat_history():
try:
if os.path.exists(CHAT_HISTORY_FILE):
with open(CHAT_HISTORY_FILE, 'r', encoding='utf-8') as f:
return json.load(f)
except Exception as e... | Python | 1 |
#!/usr/bin/env python
'''
Leetcode: Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[ [2],
[3,4],
[6,5,7],
[4,1,8,3]]
The minimum path sum from top to bottom is 11 (i.e., 2 + 3 + 5... | Python | 1 |
, arcon_buffer_pool);
criterion_main!(benches);
<filename>tests/monster_test_serialize/mod.rs
// Automatically generated by the Flatbuffers compiler. Do not modify.
pub mod my_game {
use super::*;
pub mod example {
use super::*;
mod color_generated;
pub use self::color_generated::*;
mod race_generat... | Rust | 0 |
cw20_sender = deps.api.addr_validate(&cw20_msg.sender)?;
locked(deps, env, cw20_sender, cw20_msg.amount,month)
}
Err(_) => Err(StdError::generic_err("data should be given")),
}
}
/*
this bond function is used for normal staking
and tkae two parameter one is address and second ... | Rust | 0 |
crate::prelude::*;
use crate::{struct_to_bin, bin_to_struct};
use std::collections::HashMap;
use std::io::Cursor;
use std::fmt::Debug;
#[derive(Pack, Debug, PartialEq)]
struct TestOptional {
a: Option<i32>,
}
#[derive(Pack, Debug, PartialEq)]
struct TestNumbers {
... | Rust | 0 |
dTriangleHipPress,
WeightedTrxSuspendedJackknife,
WeightedUBoat,
WeightedWindmillSwitches,
WindmillSwitches,
UnknownValue(u64),
}
impl From<FieldContent> for CoreExerciseName {
fn from(field: FieldContent) -> Self {
if let FieldContent::UnsignedInt16(enum_value) = field {
ma... | Rust | 0 |
continue
if fail_msg:
self.log_fn("Communication failure to node %s: %s", node_name, fail_msg)
continue
for script, hkr, output in hooks_results:
if hkr == constants.HKR_FAIL:
if phase == constants.HOOKS_PHASE_PRE:
errs.append((node_name, script, output... | Python | 1 |
"""Admin routes for presentations."""
from marshmallow import fields
from ...messaging.models.openapi import OpenAPISchema
from ...messaging.valid import INT_EPOCH_EXAMPLE, INT_EPOCH_VALIDATE
class AnonCredsRequestedCredsRequestedAttrSchema(OpenAPISchema):
"""Schema for requested attributes within anoncreds req... | Python | 1 |
"CAPSLOCK" => int(20; DONT_ENUM | DONT_DELETE | READ_ONLY);
"CONTROL" => int(17; DONT_ENUM | DONT_DELETE | READ_ONLY);
"DELETEKEY" => int(46; DONT_ENUM | DONT_DELETE | READ_ONLY);
"DOWN" => int(40; DONT_ENUM | DONT_DELETE | READ_ONLY);
"END" => int(35; DONT_ENUM | DONT_DELETE | READ_ONLY);
"ENTER" =... | Rust | 0 |
"superclass" => Ok(TaxRank::Superclass),
"class" => Ok(TaxRank::Class),
"subclass" => Ok(TaxRank::Subclass),
"infraclass" => Ok(TaxRank::Infraclass),
"cohort" => Ok(TaxRank::Cohort),
"superorder" => Ok(TaxRank::Superorder),
"order" => O... | Rust | 0 |
{}", change.block)?,
}
}
log_file.flush()?;
log_file.sync_all()?;
Ok(())
}
fn update_change_log(&self, change_log: ChangeLog) -> StoreResult<()> {
let base_dir = self.base_dir.write()?;
let change_log_file_path = base_dir.join("logs").join(&change_log.node);
DirBuilder::new()
... | Rust | 0 |
_000..=10_000`
/// - `-262_000..=262_000` when `no-validation-limits` flag is set
#[cfg(not(feature = "no-validation-limits"))]
pub(crate) static YEAR_RANGE: RangeInclusive<i32> = -10_000..=10_000;
#[cfg(feature = "no-validation-limits")]
pub(crate) static YEAR_RANGE: RangeInclusive<i32> = -262_000..=262_000;
/// Che... | Rust | 0 |
import numpy as np
from scipy.optimize import minimize
import pandas as pd
import matplotlib.pyplot as plt
# Constants for model A4
alpha = [1e-5, 2.3e-5, 3e-5, 4e-5]
beta_prime = [1.28, 4.77, 2.13, 1.75] # Changed beta values for A4
lambda_ = [alpha[i] / beta_prime[i] for i in range(4)] # Calculate lambda_i for A4
... | Python | 1 |
import typer
from sweepai.handlers.on_failing_github_actions import on_failing_github_actions
from sweepai.utils.chat_logger import ChatLogger
from sweepai.utils.github_utils import get_github_client, get_installation_id
def test_issue_url(
pr_url: str,
):
pr_url = pr_url or typer.prompt("PR URL")
print(... | Python | 1 |
non-exhaustive patterns
m!(0, ..ALMOST_MAX); //~ ERROR non-exhaustive patterns
m!(0, ALMOST_MIN..); //~ ERROR non-exhaustive patterns
m!(0, ..=ALMOST_MAX); //~ ERROR non-exhaustive patterns
m!(0, ..=VAL | VAL_2..); //~ ERROR non-exhaustive patterns
m!(0, ..VAL_1 | VAL_2..); //~ E... | Rust | 0 |
///
/// ```rust
/// # use reqwest::{Error, redirect};
/// #
/// # fn run() -> Result<(), Error> {
/// let custom = redirect::Policy::custom(|attempt| {
/// eprintln!("{}, Location: {:?}", attempt.status(), attempt.url());
/// redirect::Policy::default().redirect(attempt)
///... | Rust | 0 |
let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
//[verbose]~^ ERROR mismatched types
//[verbose]~| expected `()`
//[verbose]~| found `fn() {<i8 as Foo<ReStatic, ReStatic, u32>>::bar::<ReStatic, char>}`
//[normal]~^^^^ ERROR mismatched types
//[normal]~| expected `()`
... | Rust | 0 |
::new(super::rsp::op_vmadh::VMADHAll {}),
Box::new(super::rsp::op_vmadh::VMADHQ1 {}),
Box::new(super::rsp::op_vmadh::VMADHH1 {}),
Box::new(super::rsp::op_vmadh::VMADH7 {}),
Box::new(super::rsp::op_vmadh::VMADHAccumulatorOverflowed {}),
Box::new(super::rsp::op_vmudh::VMUDHAll {}),... | Rust | 0 |
Pair<ForeignKeyWalker<'_>>) -> String {
format!(
r#"ALTER TABLE "{table}" RENAME CONSTRAINT "{previous}" TO "{next}""#,
table = fks.previous().table().name(),
previous = fks.previous().constraint_name().unwrap(),
next = fks.next().constraint_name().unwrap(),
... | Rust | 0 |
32, u32)> {
let mut src = &src[..V1_HEADER_SIZE as usize];
let magic_bytes = src.read_u32();
assert_eq!(magic_bytes, MagicBytes::Vx1.into());
self.n_raw_bytes = src.read_u32();
let n_payload_bytes = src.read_u32();
self.literal.num ... | Rust | 0 |
-> Option<&FieldDesc>
where
I: Iterator<Item = FieldKey>,
F: FnMut(&FieldDesc) -> bool,
{
iter.filter_map(|k| self.fields.get(k)).find(|f| closure(f))
}
/// Queries an SLK field by it's name and target object.
/// The object is necessary because the same field name can
... | Rust | 0 |
was the {former_or_latter} one {player_name} {drive_or_play_t1} for?"
Template_Rank_3 = f"{player_name} previously {drive_or_play_t1} for {previous_name} and {latter_name} {League_name}s. Which team between them did {player_name} {former_or_latter}ly {drive_or_play} for?"
# Accumulating
event, before_or_af... | Python | 1 |
g_k8s_events = self.log_k8s_events.map(|v| v.to_string());
}
if self.db_path.is_some() {
raw.log.db_path = self.db_path.map(PathBuf::from);
}
if !self.line_exclusion.is_empty() {
let regex = raw.log.line_exclusion_regex.get_or_insert(Vec::new());
wit... | Rust | 0 |
, &machine);
// Load guest binary
let (entry, max_addr) = sum::access_user_memory(||{
elf::load_elf(pa2va(hart_base_pa + pmap::HEAP_OFFSET) as *const u8,
machine.physical_memory_offset as *mut u8)
});
let guest_dtb = (max_addr | 0x1fffff) + 1;
csrw!(sepc, entry);
... | Rust | 0 |
(
r'<pre><code class="language-(\w+)">',
r'<div class="code-block"><pre><code class="language-\1">',
html
)
html = re.sub(r'</code></pre>', '</code></pre></div>', html)
return html
def get_css_styles(self) -> str:
"""
获取 Markd... | Python | 1 |
#[inline(always)]
fn dec_now(&mut self) {
self.now -= 1;
self.min = usize::min(self.now, self.min);
}
#[inline(always)]
fn inc_now(&mut self) {
self.now += 1;
self.max = usize::max(self.now, self.max);
}
}
#[derive(Copy,Clone,Debug,Default,Eq,PartialEq)]
pub str... | Rust | 0 |
import requests
def get_price(symbol: str) -> str:
"""
Fetch current USD price for a token via CoinGecko.
Usage: get_price("bitcoin") or get_price("BTC")
"""
token_id = symbol.lower()
# Mapping common symbols to CoinGecko IDs
SYMBOL_MAP = {
"btc": "bitcoin",
"eth": "ethereum... | Python | 1 |
uptime = f" (работает {datetime.now() - stream.start_time})"
print(f"\n{i}. Путь: {stream.path}")
print(f" Источник: {stream.source_type} ({stream.publishers} publisher(s), {stream.readers} reader(s)){uptime}")
print(f" RTSP URL: {stream.rtsp_url}")
if ... | Python | 1 |
k2dk: x241lnlvfpq=None, iqvng20iel9: ww6cp27r3yl=0j, mz99htt789j=False, u7l27sqk9qn=0, mvotgcf837v: rafalisbnym=b''):
pass
'# difficulties_punches_electrolyte -> trick_relief_swing'
0.0[0]: xzm6dome6wd = ph4xxx6sd12
'# difficulties_punches_electrolyte -> trick_relief_swing'
global u_hillxq5o0
re... | Python | 1 |
(
self.as_ptr() as *mut _,
b"notify::timeout\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_timeout_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[... | Rust | 0 |
, |o| action(o).to_string_lossy().into_owned())
}
#[no_mangle]
pub unsafe extern "C" fn rs_configpaths_initialized(object: *mut c_void) -> bool {
with_configpaths(object, |o| o.initialized(), false)
}
#[no_mangle]
pub unsafe extern "C" fn rs_configpaths_error_message(object: *mut c_void) -> *mut c_char {
with... | Rust | 0 |
resent() {
if pdpt[pdpt_idx].is_page() {
// Page is a 1 GiB mapping, we have to return here
let page_offset = addr.huge_page_offset();
return Some(pdpt[pdpt_idx].address() + page_offset);
} else {
let pd_idx ... | Rust | 0 |
self,
eic: EIC,
clocks: &mut GenericClockController,
mclk: &mut MCLK,
port: &mut Port,
) -> ButtonController {
let clk = clocks.gclk1();
let mut eic = eic::init_with_ulp32k(mclk, clocks.eic(&clk).unwrap(), eic);
eic.button_debounce_pins(&[
... | Rust | 0 |
needed to *compile* tests, just to run
// them, so we don't include this dependency edge in the job graph.
if self.target.is_test() && unit.target.is_bin() {
None
} else {
Some(Key::new(unit))
}
}).collect())
}
}
impl<'a> fmt::... | Rust | 0 |
,
# labelbottom=False, labelleft=False
#)
#ax[2 * j + k + 1, 0].set_axis_off()
if i == 0:
ax[2 * j + k, 0].text(
-0.6, 0.5,
f'T.D.C.: {v_lbl}\n DIPOLE: {g_lbl}',
... | Python | 1 |
"""
Defines base class for autonomous flight missions.
"""
from abc import ABC, abstractmethod
from dronekit import connect, VehicleMode
from pymavlink import mavutil
import time
import cv2
import numpy as np
class FlightMission(ABC):
"""
Base class for drone autonomous flight missions.
"""
def __ini... | Python | 1 |
test_input} expected={expected} event(s)")
search_query = f"index={setup['splunk_index']} | search {test_input} | fields *"
logger.info(search_query)
events = check_events_from_splunk(start_time="-15m@m",
url=setup["splunkd_url"],
... | Python | 1 |
k_ok("alf_loves*cats", WildcardPattern::StartsAndEndsWith {
pattern: "alf_loves*cats".into(),
starts_with: "alf_loves".into(),
ends_with: "cats".into()
});
check_ok("*alf*", WildcardPattern::Contains {
pattern: "*alf*".into(),
contains: "alf".i... | Rust | 0 |
matches = App::new("codelldb")
.arg(Arg::with_name("port").long("port").takes_value(true))
.arg(Arg::with_name("connect").long("connect").takes_value(true))
.arg(Arg::with_name("multi-session").long("multi-session"))
.arg(Arg::with_name("preload").long("preload").multiple(true).takes_val... | Rust | 0 |
from __future__ import annotations
import types
from abc import ABCMeta, abstractmethod
from collections.abc import AsyncGenerator, Callable, Coroutine, Iterable
from typing import Any, TypeVar
_T = TypeVar("_T")
class TestRunner(metaclass=ABCMeta):
"""
Encapsulates a running event loop. Every call made thr... | Python | 1 |
c.get_state(), c.get_context().unwrap()))
.or_default();
alts.insert(c.get_alt() as usize);
}
configs_to_alts.drain().map(|(_, x)| x).collect()
}
fn get_state_to_alt_map(configs: &ATNConfigSet) -> HashMap<ATNStateRef, BitSet> {
let mut m = HashMap::new();
for c in configs.get_items... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.