text string | label_name string | labels int64 |
|---|---|---|
_binary_expression_precedence(input, 0)?;
if let Expression::BinaryExpression(b) = expression {
return Ok((i, b));
} else {
unimplemented!()
}
}
pub fn parse_binary_expression_precedence(
i: Span,
operator_precedence: i32,
) -> nom::IResult<Span, Expression> {
let line_info = Li... | Rust | 0 |
23760, 1.023760, 1.023760, 1.090500, 1.089670, 1.086302, 1.082156,
1.075398, 1.072158, 1.065357, 1.056707, 1.048909, 1.041525, 1.033163, 1.023515, 1.015901, 1.015901, 1.015901, 1.137542, 1.188167, 1.019230, 1.019230, 1.036922, 1.036922,
1.036922, 1.036922, 1.036922, 1.036922, 1.036922, 1.036922, 1.036... | Python | 1 |
)?;
let diff_secs: i32 = (filetime_to_secs(&ft_local) - filetime_to_secs(&ft_system))
.try_into()
.ok()?;
UtcOffset::from_hms(
(diff_secs / 3_600) as _,
((diff_secs / 60) % 60) as _,
(diff_secs % 60) as _,
)
.ok()
}
#[... | Rust | 0 |
.unwrap();
let mut response = Vec::new();
let mut framebuf: ModbusFrameBuf = [0; 256];
if *proto == ModbusProto::Rtu {
let mut ascii_frame = Vec::new();
generate_ascii_frame(&request, &mut ascii_frame).unwrap();
for i in 0..framebuf.l... | Rust | 0 |
Array, FactoryCache, Guid, Param,
RefCount, Waiter,
};
pub use strings::{BString, CoString, HString};
pub use traits::{Abi, Interface, RuntimeName, RuntimeType};
pub use windows_macros::{build, implement};
extern crate self as windows;
mod bindings {
include_bindings!();
}
#[doc(hidden)]
pub type RawPtr = *... | Rust | 0 |
Vec<FrameFormat>>> = Rc::new(RefCell::new(Vec::new()));
let frame_state: Rc<RefCell<Option<FrameState>>> = Rc::new(RefCell::new(None));
let frame_buffer_done = Rc::new(AtomicBool::new(false));
// Instantiating screencopy manager.
let screencopy_manager = match globals.instantiate_exact::<ZwlrScreencopy... | Rust | 0 |
await
.map_err(|e| e.into())
}
add_bindings!($($rest)*);
};
( $i:ident = $snd:ident $(:: $snd_path:ident)*; $($rest:tt)* ) => {
#[instrument(skip(self))]
pub async fn $i(&self, user_id: UserId) -> crate::Result<()> {
self.update_sender
... | Rust | 0 |
from __future__ import absolute_import
import cffi
import sys
ffibuilder = cffi.FFI()
ffibuilder.set_source('blurhash._functions', '''
#include <stdbool.h>
#include "common.h"
const char* blurHashForPixels(int x_components, int y_components,
int width, int height,
... | Python | 1 |
reply::json(&Error::new(code, cause.to_string()));
} else if let Some(cause) = err.find::<UnsupportedMediaType>() {
code = StatusCode::UNSUPPORTED_MEDIA_TYPE;
body = reply::json(&Error::new(code, cause.to_string()));
} else if let Some(cause) = err.find::<MethodNotAllowed>() {
code = St... | Rust | 0 |
logger.info(f"Random Forest training completed. ROC-AUC: {rf_performance['roc_auc']:.4f}")
# Train XGBoost
logger.info("Training XGBoost model")
xgb_performance = model_trainer.train_xgboost(
X_train_balanced, y_train_balanced, X_test, y_test,
optimize_hyperpara... | Python | 1 |
///
/// A type parameter `U` is considered a prefix of `T` in all of these cases:
///
/// - `U` is a zero-sized type with an alignment equal or lower than `T`
///
/// - `U` is a `#[repr(transparent)]` wrapper over `T`
///
/// - `U` and `T` are both `#[repr(C)]` structs,
/// in which `T` starts with the fields of `U` i... | Rust | 0 |
:DivisionByZero))
} else {
Ok(Double::new(vm, self.val / (rhs as f64)))
}
} else if let Some(rhs) = other.try_downcast::<Double>(vm) {
if rhs.val == 0f64 {
Err(VMError::new(vm, VMErrorKind::DivisionByZero))
} else {
... | Rust | 0 |
lockPhase) {
self.spi.set_phase(cpal);
}
fn get_polarity(&self) -> hil::spi::ClockPolarity {
self.spi.get_clock()
}
fn get_phase(&self) -> hil::spi::ClockPhase {
self.spi.get_phase()
}
}
//! List of the active feature gates.
use super::{Feature, State};
use rustc_span::ed... | Rust | 0 |
::from_reader(f)?
} else if let Some(external_metadata_uri) = external_metadata_uri {
let body: Value = reqwest::blocking::get(external_metadata_uri)?.json()?;
let creators_json = body
.get("properties")
.ok_or_else(|| anyhow!("Bad JSON"))?
.get("creators")
... | Rust | 0 |
i32,
pub denominator: i32,
}
impl Default for xcb_xv_rational_t {
fn default() -> Self {
unsafe { std::mem::MaybeUninit::zeroed().assume_init() }
}
}
/// An iterator over `Xv::Rational` objects.
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct xcb_xv_rational_iterator_t {
/// The value of ... | Rust | 0 |
see [pcies](pcies) module"]
pub type PCIES = crate::Reg<u16, _PCIES>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _PCIES;
#[doc = "`read()` method returns [pcies::R](pcies::R) reader structure"]
impl crate::Readable for PCIES {}
#[doc = "`write(|w| ..)` method takes [pcies::W](pcies::W) writer structure"]
impl cr... | Rust | 0 |
_of(super::tag_base_type(cx, enum_type_and_layout))
);
// ... and a field for the discriminant.
unions_fields.push(build_field_di_node(
cx,
enum_type_di_node,
"discriminant",
cx.size_and_align_of(enum_type_and_layout.field(cx, tag_field).ty),
enum_type_and_layout.fie... | Rust | 0 |
let m = a + b;
assert_eq!((m[0], m[1], m[2]), (4.0, 2.0, 3.0));
assert_eq!((m[3], m[4], m[5]), (4.0, 7.0, 6.0));
assert_eq!((m[6], m[7], m[8]), (7.0, 8.0, 10.0));
}
#[test]
fn subtrating_by_a_matrix() {
let a = Matrix::new(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0);
let b = Matrix::diag(1.... | Rust | 0 |
_in_base_field)?;
let mut addition_chain = vec![];
for a in addition_elements.iter() {
addition_chain.push(a.base_field_limb.clone());
}
for result_remainder in result_remainder_decomposition.iter() {
let mut negated_remainder_in_base_field = result_remainder.ba... | Rust | 0 |
_id, author, stars, comment)| {
Msg::Rate(post_id, author, stars, comment)
});
let delete = self.link.callback(|id| {
log("Deleting Post".to_string());
Msg::DeletePost(id)
});
let edit = self.link... | Rust | 0 |
70, 0.79),
(171, 0.80),
(172, 0.80),
];
for &(id, tax) in series.iter() {
simulate(tmp_settings(id, tax));
}
}
fn tmp_settings(id: u32, tax: f64) -> Settings {
Settings {
id: id,
tax_1: tax,
tax_2: 0.0,
start_fortune: 0.2,
players: 100,
... | Rust | 0 |
if an input group can return multiple workloads in a suite resource
filtered_suite = self.suite.with_input_group("testtag1")
self.assertIsInstance(filtered_suite, SuiteResource)
self.assertEqual(len(filtered_suite), 2)
for workload in filtered_suite:
self.assertIsInstance(wo... | Python | 1 |
angle_deg: f64) -> Matrix {
let a = angle_deg.to_radians();
Matrix::new(4, 4, vec![
a.cos(), a.sin(), 0., 0.,
-a.sin(), a.cos(), 0., 0.,
0., 0., 1., 0.,
0., 0., 0., 1.,
])
// m.set(0, 0, angle_deg.to_radians().cos());
// m.set... | Rust | 0 |
caption_content = f.read()
logger.info(f"标注文件内容:\n{caption_content}")
except Exception as e:
logger.error(f"读取标注文件出错: {str(e)}")
# 定义预处理命令并执行
try:
# 检查必要的预处理文件是否存在
dataset_script = os.path.join(SCRIPTS_DIR, "pre... | Python | 1 |
returned: always
type: dict
sample: >
{
"profileId": "string",
"name": "string",
"schedule": {
"id": "string",
"name": "string"
},
"conditions": [
{
"metric": "string",
"threshold": {
"temperature": {
"celsius":... | Python | 1 |
fn move_n_right(&mut self, n: u32, context: &mut Context) {
let sel_day = context.calendar_context.day;
context.calendar_context.day = std::cmp::min(
(context.get_month().days(context.get_year()) - 1) as u32,
sel_day.checked_add(n).unwrap_or(sel_day),
);
}
... | Rust | 0 |
/// make sure our stack is aligned. Since we modify one of our inputs, our assembly has "side effects"
/// therefore we should use the `volatile` option. I **think** this is actually set for us by default
/// when there are no output parameters given (my own assumption after going through the source code)
/// for the ... | Rust | 0 |
{
use kvdb_rocksdb::{Database, DatabaseConfig};
let path = root.join("parachains").join("db");
let mut db_config = DatabaseConfig::with_columns(columns::NUM_COLUMNS);
let _ = db_config
.memory_budget
.insert(columns::COL_AVAILABILITY_DATA, cache_sizes.availability_data);
let _ = db_config
.memory_budget
... | Rust | 0 |
s a page frame.
pub fn allocate(&self) -> PageFrame {
// NOTE: The lock on the list also locks the allocator, should the inner
// workings of the allocator be changed, then there will also need to be a
// locking mechanism.
let list = FREE_LIST.lock();
let mut iterator = Free... | Rust | 0 |
str = typer.Argument(help=" ap serial in json format ap_sn.json ")):
with open(device_sn,'r') as config_file:
ap_sn = json.load(config_file)
wlan_data = {}
wlan_data.update(ap_sn)
wlan_data['services']=[license_type]
apiPath = "/platform/licensing/v1/subscriptions/assign"
apiMethod = "POST"
ap... | Python | 1 |
'''
Created on 2016/02/19
@author: takuya-hv2
'''
from pybrain.rl.learners.valuebased.valuebased import ValueBasedLearner
class IndexableValueBasedLearner(ValueBasedLearner):
indexOfAgent=None
ownerAgentProperties={
"requireOtherAgentsState": None, #Define if learner require, in addition ... | Python | 1 |
print(f"✅ Bias detection test passed: {case['description']} (score: {bias_score:.2f})")
# Performance test
async def test_theory_performance():
"""Test Theory performance with multiple validations"""
import time
theory_config = {'factcheck_api_keys': {}}
test_insights ... | Python | 1 |
(always)]
pub fn sf_if_4_cmd_en(&mut self) -> SF_IF_4_CMD_EN_W {
SF_IF_4_CMD_EN_W { w: self }
}
#[doc = "Bit 26"]
#[inline(always)]
pub fn sf_if_4_adr_en(&mut self) -> SF_IF_4_ADR_EN_W {
SF_IF_4_ADR_EN_W { w: self }
}
#[doc = "Bit 25"]
#[inline(always)]
pub fn sf_if_4... | Rust | 0 |
impl<'a, T> TaggedObserverResult<'a, T>
where
T: Into<observability_deps::opentelemetry::metrics::Number>,
{
fn with_callback<F>(
labels: Vec<KeyValue>,
callback: F,
) -> impl Fn(&ObserverResult<T>) + Send + Sync + 'static
where
F: Fn(TaggedObserverResult<'_, T>) + Send + Sync ... | Rust | 0 |
formation: https://github.com/open-mmlab/mmengine/blob/main/docs/en/tutorials/param_scheduler.md # noqa: E501
param_scheduler = [
dict(
type=LinearLR,
start_factor=1e-5,
by_epoch=True,
begin=0,
end=warmup_ratio * max_epochs,
convert_to_iter_based=True),
dict(
... | Python | 1 |
exec.run_singlethreaded(proxy.set_role(a2dp::Role::Sink)).expect("set role response");
assert_eq!(avdtp::EndpointType::Source, peers.lock().preferred_direction());
exec.run_singlethreaded(proxy.set_role(a2dp::Role::Source)).expect("set role response");
assert_eq!(avdtp::EndpointType::Si... | Rust | 0 |
&Self::Statistic) -> Option<Summary> {
Some(Summary::histogram(
1_000_000_000_000,
3,
Some(self.general_config().window()),
))
}
}
impl Softnet {
async fn sample_softnet_stats(&self) -> Result<(), std::io::Error> {
let file = File::open("/proc/net/so... | Rust | 0 |
] | None
) -> DtypeObj | dict[Hashable, DtypeObj] | None:
"""
Ensure we have either None, a dtype object, or a dictionary mapping to
dtype objects.
"""
if isinstance(dtype, defaultdict):
# "None" not callable [misc]
default_dtype = pandas_dtype(dtype.default_factory()) # type: igno... | Python | 1 |
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from aumentador.path import router as augment_router
import uvicorn
app = FastAPI(
title="Augment App",
version="1.0.0"
)
# Configure CORS
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # embedding url (need to b... | Python | 1 |
perly escaped shell commands.
"""
return prompt
def _parse_plan_response(self, response: str) -> Dict[str, Any]:
"""Parse the AI response to extract plan data."""
import json
import re
# Try to extract JSON from response
try:
... | Python | 1 |
::*;
#[test]
fn init_test() {
let mut hands = vec![];
let mut pack = vec![];
let mut bank = vec![];
init_game(&mut hands, &mut pack, &mut bank, 5);
assert_eq!(5, hands.len());
assert_eq!(4 * 52, pack.len());
assert_eq!(vec!(300; 5), bank);
}
#[tes... | Rust | 0 |
from src.emiel.datagen.conceptshift import shifter as con_shift
from src.emiel.datagen.conceptshift import selector as con_sel
from src.emiel.datagen.covshift import selector as cov_sel
def call_bias(x, y, bias, bias_params):
'''
'class_imbalance', 'reduce_samples', 'bias_2features', 'bias_most_important_f... | Python | 1 |
halve(e0: *mut Element_t, e1: *mut Element_t) -> ();
fn _element_square(e0: *mut Element_t, e1: *mut Element_t) -> ();
fn _element_neg(e0: *mut Element_t, e1: *mut Element_t) -> ();
fn _element_invert(e0: *mut Element_t, e1: *mut Element_t) -> ();
fn _element_cmp(e0: *mut Element_t, e1: *mut Element_t) ... | Rust | 0 |
d to Ops created by this class.
"""
parameters = dict(locals())
with ops.name_scope(name) as name:
with ops.name_scope("init", values=[scale]):
scale = ops.convert_to_tensor(scale)
if validate_args:
scale = distribution_util.assert_symmetric(scale)
chol = linalg_ops.c... | Python | 1 |
import pytest
from numpy import allclose, array, maximum, sqrt, sum
from SeismicMesh import generate_mesh, geometry, sliver_removal
@pytest.mark.serial
def test_3dmesher_SDF():
"""Unit cylinder"""
hmin = 0.10
bbox = (-1.0, 1.0, -1.0, 1.0, -1.0, 1.0)
def cylinder(p):
r, z = sqrt(p[:, 0] ** 2... | Python | 1 |
stringify!(nzttB64Cert),
"::",
stringify!(b64Certlen_nzttB64Cert)
)
);
assert_eq!(
unsafe { &(*(0 as *const nzttB64Cert)).next_nzttB64Cert as *const _ as usize },
16usize,
concat!(
"Alignment of field: ",
stringify!(nzttB64Cert)... | Rust | 0 |
#!/usr/bin/env python
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkFiltersCore import vtkGlyph3D
from vtkmodules.vtkFiltersSources import (
vtkConeSource,
vtkSphereSource,
)
from vtkmodules.vtkRenderingCore import (
vtkPolyDataMapper,
vtkRenderWindow,
vtkRenderWindowIntera... | Python | 1 |
═')
print(f'\033[1;36m|STT\033[1;97m| \033[1;33mThời gian ┊ \033[1;32mStatus | \033[1;31mType Job | \033[1;32mID Acc | \033[1;32mXu |\033[1;33m Tổng')
for i in range(choose):
url2 = 'https://gateway.golike.net/api/advertising/publishers/linkedin/jobs?account_id='+str(account_id)+'&data=n... | Python | 1 |
Accent(Command):
args = 'self'
class hat(MathAccent): pass
class check(MathAccent): pass
class breve(MathAccent): pass
class acute(MathAccent): pass
class grave(MathAccent): pass
class tilde(MathAccent): pass
class bar(MathAccent): pass
class vec(MathAccent): pass
class dot(MathAccent): pass
class ddot(MathAccent)... | Python | 1 |
d the given result. This object holds stderr, stdout, return
code etc.
"""
command.hide = True
for line in command.stdout_output:
match = self._re_pointer.match(line)
if match:
host_name = match.group("value").strip().lower()
# Add ... | Python | 1 |
u32),
SoapOpera,
}
#[derive(Debug, Clone, Copy)]
pub enum ChestEvent {
Explode,
Gas,
Treasure(u32),
}
#[derive(Debug, Clone, Copy)]
pub enum BookEvent {
Blind,
Poetry,
PlayMonster(MonsterType),
Dexterity,
Strength,
Sticky,
}
#[derive(Debug, Clone, Copy, PartialEq)]
enum Attac... | Rust | 0 |
#!/usr/bin/env python3
"""
This script demonstrates how to use the MAML implementation of L2L.
Each task i consists of learning the parameters of a Normal distribution N(mu_i, sigma_i).
The parameters mu_i, sigma_i are themselves sampled from a distribution N(mu, sigma).
"""
import torch as th
from torch import nn, ... | Python | 1 |
import torch
from torch.utils.data import WeightedRandomSampler
from matplotlib import pyplot as plt
import polars as pl
from data import EventDataset
blur_size = 0.10
feature_cols = [
"blurred_px_0", "blurred_py_0", "pz_0", "blurred_energy_0", "blurred_px_1", "blurred_py_1", "pz_1",
"blurred_energy_1"
]
data = Ev... | Python | 1 |
import time
from datetime import date
import pydantic
import attrs
from dataclasses import dataclass, field
import itertools
class CFG:
PROJECT_NAME: str = field()
DATE: date = date.today()
SEED: int = field()
PATH: str = field()
TRAIN_PATH: str = field()
TEST_PATH: str = field()
@prop... | Python | 1 |
{
let mut key_pairs = Vec::new();
let mut voting_rights = BTreeMap::new();
for _ in 0..count {
let key_pair = get_key_pair();
voting_rights.insert(key_pair.0, 1);
key_pairs.push(key_pair);
}
let committee = Committee::new(voting_rights);
let mut clients = HashMap::new();... | Rust | 0 |
d(0x52) // 82 R
// .add(0x53) // 83 S
// .add(0x54) // 84 T
// .add(0x55) // 85 U
// .add(0x56) // 86 V
// .add(0x57) // 87 W
// .add(0x58) // 88 X
// .add(0x59) // 89 Y
// .add(0x5a) // 90 Z
// .add(0x5b) // 91 [
// .add(0x5c) // 92 \
// .add(0x5d) // 93 ]
// .add(0x5e) ... | Rust | 0 |
ple mass flow rate [kg]
self.ex_C.set_T(C_T_in) # Example temperature [K]
self.ex_C.set_p(self.su_C.p) # Example Pressure [Pa]
if abs(self.res) < res_tol:
print("-------------------------")
print("Success !")
print("----------------------... | Python | 1 |
#Global ve Local Değişkenler
#global scope
x= 'global x'
def function ():
#local scope
x = 'local x'
print(x) #local x
function()
print(x) #global x
#global olarak tanımlanan serkan
name ="Serkan"
def change_name(new_name):
#local
name=new_name
print(name) #acelya
change_name('Acelya')
prin... | Python | 1 |
et mut url = Url::parse(host_str.as_ref()).unwrap();
url = url.join(path).unwrap();
if let Some(pairs) = query {
let qs = serde_urlencoded::to_string(pairs)?;
url.set_query(Some(&qs));
}
debug!(
"Parsing uri: {}, client_type: {:?}, socket: {}",
... | Rust | 0 |
transform::with_dictionary(content, &letter_map)
}
/// Transform latin text to runes
///
///
/// # Examples
///
/// ```
/// use riimut::younger_futhark;
///
/// let result = younger_futhark::runes_to_letters("ᛁᚢᛁᚾ:ᛏᚼᚢᚢᚴᚼ:ᚢᚢᚢ'ᛏ:ᛋᚢᚢᚾ:ᛒᛁ:ᚴᚢᚾᛁ");
/// let expected = "iuin thuukh uuu't suun bi kuni";
///
/// assert_... | Rust | 0 |
jlong
) -> jobject {
handle_exception_result(|| {
let transaction_id = transaction_id.rptr(&env)?;
transaction_id
.typed_ref::<TransactionHash>()
.map(|tx_hash| TransactionInput::new(tx_hash, index as u32))
.and_then(|tx_input| tx_input.rptr().jptr(&env))
})
.jresult(&env)
}
<filename>s... | Rust | 0 |
metadata = {} if not asset_id else self._download_json(
f'https://cms.rtvcplay.co/api/v1/video/asset-id/{asset_id}', video_id, fatal=False)
return {
'id': video_id,
'formats': formats,
'subtitles': subtitles,
**traverse_obj(metadata, {
... | Python | 1 |
"specific")
# 手动调用方法
pdf_path = analyzer.find_pdf_file("filename.pdf")
if pdf_path:
image = analyzer.pdf_to_image(pdf_path)
first_pass = analyzer.check_first_feature(image)
second_pass = analyzer.check_second_feature(image)
analyzer.detectAnd_visualize_lines(image, "filename")
""")
print()
de... | Python | 1 |
{
&self.0
}
}
#[doc = "Field `tsen_refcode_rfcal` reader - "]
pub struct TSEN_REFCODE_RFCAL_R(crate::FieldReader<u16, u16>);
impl TSEN_REFCODE_RFCAL_R {
pub(crate) fn new(bits: u16) -> Self {
TSEN_REFCODE_RFCAL_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for TSEN_REFCODE_RFCA... | Rust | 0 |
.ctx.hash = [0 as u8; 64];
self.ctx.N = [0 as u8; 64];
self.ctx.sigma = [0 as u8; 64];
self.ctx.data.clear();
self.result = [0 as u8; 64];
}
}
/// An implementation of Streebog algorithm with digest size 256 bit.
///
/// # Examples
///
/// ```
/// use streebog_hash::*;
/// let mut ... | Rust | 0 |
scale = None;
}
}
/// Set the physics emulation time scale (must be positive)
///
/// # Panics
///
/// Panic if the scale is negative
///
pub fn set_scale(&mut self, scale: f32) {
assert!(scale >= 0.0);
self.scale = scale;
}
/// Get the physics emulation... | Rust | 0 |
import torch
"""
@author: Andreas Gebhardt
@contact: AGebhardt1999@gmail.com
"""
def negative_MLS(features, features_variance, others, others_variance):
"""
This function computes the *negative* MLS between two batches of multivariate normal distributions with diagonal covariances.
"""
# shapes: ... | Python | 1 |
get_website_description(url)
tags = ["+web"]
parsed_url = urlparse(url)
domain = parsed_url.netloc
if not description:
description = active_window_title
options = ["Link", "Task", "Playlist", "Highlights"]
message = f"Add a pet link for '{truncated_description}' from '{domain}' domain... | Python | 1 |
# SPDX-License-Identifier: Apache-2.0
from pathlib import Path
from alpha_factory_v1.core.eval.fitness import compute_fitness, CurriculumSwitcher
from alpha_factory_v1.core.archive.db import ArchiveDB
def _results(dataset: str, rate: float, count: int = 10):
passed = int(rate * count)
items = []
for i in... | Python | 1 |
(https://dev.twitch.tv/docs/api/reference#get-polls)
#[derive(PartialEq, typed_builder::TypedBuilder, Deserialize, Serialize, Clone, Debug)]
#[non_exhaustive]
pub struct GetPollsRequest {
/// The broadcaster running polls. Provided broadcaster_id must match the user_id in the user OAuth token.
#[builder(setter(... | Rust | 0 |
use git2::{Config, Error as GitError, ErrorClass, ErrorCode, Repository};
use std::{
collections::HashSet,
env,
error::Error,
fs,
io::{self, Write},
path::{Path, PathBuf},
};
program::main!("git-ignore");
fn usage_line(program_name: &str) -> String {
format!(
"Usage: {} [-h] [-gir... | Rust | 0 |
"layer": 0,
"father_group_number": None
}
layer_info.append(group_info)
max_group_number = new_group_number
task_tree[0] = layer_info
while True:
prev_group_count = max_group_number
task_tree, max_group_number = process_t... | Python | 1 |
projections
.into_iter()
.map(|p| {
p.scalar_fields()
.map(|sf| {
let entry = mapped
.get(&sf.name)
.expect("Error splitting RecordProjection: ModelProjection doesn't match.")
... | Rust | 0 |
is lint is target register size dependent, it is
/// limited to 32-bit to try and reduce portability problems between 32 and
/// 64-bit, but if you are compiling for 8 or 16-bit targets then the limit
/// will be different.
///
/// The configuration option `trivial_copy_size_limit` can be set to ove... | Rust | 0 |
# Copyright 2024 Gerardo Puga
#
# 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,... | Python | 1 |
impl Default for xcb_visualtype_iterator_t {
fn default() -> Self {
unsafe { std::mem::MaybeUninit::zeroed().assume_init() }
}
}
/// The `DEPTH` struct.
///
/// The following fields can be accessed via accessor functions:
///
/// - `visuals`
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct xcb_dept... | Rust | 0 |
["TTP or MISP or IOC", ["0dfccb58-158c-4436-b338-163e3662943c", "dd3ea54c-3a9d-4f9f-a690-983e2fd8f235"]],
]
)
def test_search_text(client, feeds, api_schema, text, expected_ids):
resp = client.get("/api/v1/feeds/", query_params=dict(text=text))
assert resp.status_code == 200
assert {r['id'] for r in res... | Python | 1 |
l_semi_count = 0;
while self.consume(TokenType::Semi) {
tail_semi_count += 1;
if self.is_token(TokenType::EOF) {
break;
}
}
if !omit_tailing_semi
&& tail_semi_count == 0
&& !self.is_seen_newline
&& !self.is_t... | Rust | 0 |
cargo:gnustep-1-9=1"); // DEP_OBJC_GNUSTEP_1_9
// }
// if version >= (2, 0) {
// println!("cargo:gnustep-2-0=1"); // DEP_OBJC_GNUSTEP_2_0
// }
// if version >= (2, 1) {
// println!("cargo:gnustep-2-1=1"); // DEP_OBJC_GNUSTEP_2_1
// ... | Rust | 0 |
n
/// otherwise unnameable adapter in a custom smart pointer, to store it within a struct.
///
/// # Usage
///
/// ```
/// # use unsize::CoerciblePtr;
/// // A non-coercible box, for demonstration purposes
/// struct MyBox<T: ?Sized>(Box<T>);
///
/// unsafe impl<'lt, T, U: ?Sized... | Rust | 0 |
();
assert!(allowed_devices.is_ok());
let allowed_devices = allowed_devices.unwrap();
assert_eq!(allowed_devices.len(), 1);
assert_eq!(
allowed_devices[0],
DeviceResource {
allow: true,
devtype: DeviceType::Char,
maj... | Rust | 0 |
, z4, z5, z6, z7, z8, z9),
y1, y2, y3, y4, y5, y6, y7, y8, y9),
t1, t2, t3, t4, t5, t6, t7, t8, t9)
}
}
<reponame>elasticrash/data-generator<filename>src/datastores/datastore.rs<gh_stars>1-10
use super::generic::common_models::{ForeignKeyRel, TableFields};
use crate::configu... | Rust | 0 |
\n\
Makes some changes to the foo feature\n"
};
}
macro_rules! test_commit_with_gpg_stuff_in_message {
() => {
"\
tree 0123456701234567012345670123456701234567\n\
parent 7654321076543210765432107654321076543210\n\
author <NAME> <<EMAIL>> 1513... | Rust | 0 |
pr,
total_gt_num[idx:idx + num_part],
total_dt_num[idx:idx + num_part],
total_dc_num[idx:idx + num_part],
gt_datas_part,
dt_datas_part,
dc_datas_part,
... | Python | 1 |
None
# Calculate ROC
risk_reduction = current_ale - residual_ale
net_benefit = risk_reduction - treatment_cost
roc = net_benefit / treatment_cost
return roc
@property
def roc_display(self):
"""
Returns a human-readable format of the ROC.
"""
... | Python | 1 |
powf(2.0) + len_y.powf(2.0)).sqrt(); //a²+b²=c²
if len + PADDING >= IDEAL_NODE_DISTANCE { continue }
//TODO: Weight movement that would snap to the ideal distance heavier than other weight.
NODE_FORCES[i_].x += len_x/len * (len-IDEAL_NODE_DISTANCE);
NODE_FORCES[i_].y += len_y/len * (len-IDEAL_NODE_... | Rust | 0 |
.into())
// .map(|ret| { println!("{}", ret); ret })
.unwrap_or_else(|err| {
let mut errors =
err .into_iter()
.map(|err| Error::new(
err.span(),
format_args!("`#[extension(trait …)]`: {}", err),
... | Rust | 0 |
x
/// local.get $y
/// i32.add)
/// (export "sum" (func $sum_f)))
/// """
/// )
///
/// # What's next? Serialize the module, and execute it on the
/// # targeted host.
/// ```
#[pymodule]
fn target(_py: Python, module: &PyModule) -> PyResult<()> {
// Classes.
module.add_class::<target::T... | Rust | 0 |
ColStream, JointRowStream, JointValStream,
LookupStreamer, LookupTensorStreamer, Tensor,
};
use crate::psnark::Proof;
use crate::subprotocols::entryproduct::streams::entry_product_streams;
use crate::subprotocols::entryproduct::EntryProduct;
use crate::subprotocols::plookup::streams::{plookup_streams, SortedStreame... | Rust | 0 |
since = "0.3.0")]
pub async fn command_raw(&self, value: Vec<u8>) -> Result<(), CommandError> {
self.send(Message::Binary(value))
.await
.map_err(CommandError::from_send)
}
/// Shut down the shard.
///
/// The shard will cleanly close the connection by sending a nor... | Rust | 0 |
S8(RoomGridLevel):
"""
Pick up the ball
Rooms have a size of 8
"""
def __init__(self, room_size=8, seed=None):
super().__init__(
room_size=room_size,
num_rows=1,
num_cols=1,
seed=seed
)
def gen_mission(self):
obj, _ = self... | Python | 1 |
api.get_file_edit(eg.edits.files[0].edit_id)
assert api.get_fileset_edit(eg.edits.filesets[0].edit_id)
assert api.get_webcapture_edit(eg.edits.webcaptures[0].edit_id)
assert api.get_release_edit(eg.edits.releases[0].edit_id)
assert api.get_work_edit(eg.edits.works[0].edit_id)
def test_edit_delete_all... | Python | 1 |
Ok(part) => Ok(part),
Err(e) => {
let (grpc_status, grpc_message) = match e {
Error::GrpcMessage(GrpcMessageError {
grpc_status,
grpc_messa... | Rust | 0 |
?), so the error trace will include foo()
/// fn foo() -> propagate::Result<(), &'static str> {
/// let result = gives_error();
/// propagate::Ok(result?)
/// }
///
/// // NO: Result returned directly, so the error trace will not include bar()
/// fn bar() -> propagate::Result<(), &'static str> {
/// let re... | Rust | 0 |
"""Module to predict for a DB of Atoms."""
import torch
from jarvis.core.atoms import Atoms
from jarvis.core.graphs import Graph
from alignn.models.alignn import ALIGNN
# from jarvis.analysis.structure.spacegroup import Spacegroup3D
from jarvis.db.figshare import data
model_path = "JV15/jv_optb88vdw_bandgap_alignn/c... | Python | 1 |
iterion_main, Criterion};
use json::de;
use json::schema::{build::build_schema, index::IndexBuilder, CoreAnnotation};
use json::validator::{SpanContext, Validator};
use serde_json::{json, Value};
const CITI_RIDES_SCHEMA: &[u8] = include_bytes!("testdata/citi-rides.schema.json");
const CITI_RIDES: &[u8] = include_bytes... | Rust | 0 |
/// Gets all funds from the API and returns of them.
pub async fn funds(&self) -> Result<Funds, Box<dyn Error>> {
self.funds_api.funds().await
}
/// Gets holdings information from the API and returns it.
pub async fn holdings(&self) -> Result<HoldingsInformation, Box<dyn Error>> {
... | Rust | 0 |
/// The WebGL2RenderingContext.pauseTransformFeedback() method of the WebGL 2 API pauses a transform feedback operation.
#[wasm_bindgen(method, js_name = pauseTransformFeedback)]
pub fn pause_transform_feedback(this: &WebGL2RenderingContext);
/// The WebGL2RenderingContext.resumeTransformFeedback() meth... | Rust | 0 |
ize - ZERO ;
ret.push(NUMBER_SYMBOL_TABLE[i].1.to_string());
} else {
let mut found_in_symbols = false;
for (d, s) in &SYMBOL_TABLE {
if &c == d {
ret.push(s.to_string());
found_in_symbols = true;
bre... | Rust | 0 |
not
# within the first list and that have an adverbial clause dependency label
referring_inclusive_ancestors = [referring]
referring_inclusive_ancestors.extend(referring.ancestors)
if (
len(
[
1
for ancestor in referring... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.